From bc467e4dd97f079fdceda7af87f6e820a4719c6d Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 1 Apr 2024 13:27:47 +0300 Subject: [PATCH 01/14] Define test workflow --- .gitea/workflows/Tests.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitea/workflows/Tests.yaml diff --git a/.gitea/workflows/Tests.yaml b/.gitea/workflows/Tests.yaml new file mode 100644 index 0000000..5478471 --- /dev/null +++ b/.gitea/workflows/Tests.yaml @@ -0,0 +1,26 @@ +on: + push: + branches: + - '*' + - '!master' + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: latest + registry-url: https://registry.corgi.wtf + cache: yarn + - name: Install deps + run: yarn install + - name: Lint project + run: yarn run eslint src/ + - name: Build project + run: yarn build + env: + CI: false \ No newline at end of file -- 2.45.2 From c5c304d5d976b31131f1a012d29061231ceb332f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 1 Apr 2024 13:47:17 +0300 Subject: [PATCH 02/14] Refactor poll command --- .../components/commands/utility/Poll.ts | 170 +++++++++--------- src/client/components/managers/PollManager.ts | 7 +- 2 files changed, 94 insertions(+), 83 deletions(-) diff --git a/src/client/components/commands/utility/Poll.ts b/src/client/components/commands/utility/Poll.ts index 37d8553..b45fb3e 100644 --- a/src/client/components/commands/utility/Poll.ts +++ b/src/client/components/commands/utility/Poll.ts @@ -56,91 +56,76 @@ class PollCommand extends SlashCommand async execute (invoker: InvokerWrapper, { choices, channel, duration, multichoice, message }: CommandParams) { - const { subcommand, author } = invoker; - const guild = invoker.guild!; - const member = invoker.member!; + const { subcommand } = invoker; if (subcommand!.name === 'create') - { - const targetChannel = (channel?.asChannel || invoker.channel) as GuildTextBasedChannel; - if (!targetChannel?.isTextBased()) - throw new CommandError(invoker, { index: 'ERR_INVALID_CHANNEL_TYPE' }); - const botMissing = targetChannel.permissionsFor(this.client.user!)?.missing([ 'SendMessages', 'EmbedLinks' ]); - const userMissing = targetChannel.permissionsFor(member).missing([ 'SendMessages' ]); - if (!botMissing || botMissing.length) - return invoker.editReply({ index: 'COMMAND_POLL_BOT_PERMS', params: { missing: botMissing?.join(', ') ?? 'ALL', channel: targetChannel.id } }); - if (userMissing.length) - return invoker.editReply({ index: 'COMMAND_POLL_USER_PERMS', params: { missing: userMissing.join(', '), channel: targetChannel.id } }); - - const questions = await this.#queryQuestions(invoker, choices?.asNumber ?? 1, targetChannel); - if (!questions) - return; - - await invoker.editReply({ index: 'COMMAND_POLL_STARTING' }); - - const embed = { - title: guild.format('COMMAND_POLL_TITLE', { user: author.tag }), - description: guild.format('COMMAND_POLL_DESCRIPTION', { - multi: guild.format('COMMAND_POLL_MULTI', { multichoice: multichoice?.asBool && questions.length > 1 || false }, { code: true }), - duration: duration ? guild.format('COMMAND_POLL_DURATION', { time: Util.humanise(duration.asNumber), duration: Math.floor(Date.now() / 1000) + duration.asNumber }) : guild.format('COMMAND_POLL_INFINITE') - }), - fields: questions, - color: EmbedDefaultColor, - timestamp: new Date().toISOString() - }; - - let pollMsg = null; - if (questions.length === 1) - { - questions[0].name = guild.format('COMMAND_POLL_FIELD_QUESTION'); - pollMsg = await targetChannel.send({ embeds: [ embed ] }); - await pollMsg.react('👍'); - await pollMsg.react('👎'); - } - else - { - pollMsg = await targetChannel.send({ embeds: [ embed ] }); - for (const question of questions) - await pollMsg.react(PollReactions.Multi[question.index + 1]); - } - - const poll: PollData = { - questions: questions.map(q => q.value), - duration: (duration?.asNumber ?? 0), - multiChoice: multichoice?.asBool && questions.length > 1 || false, - user: author.id, - channel: targetChannel.id, - startedIn: invoker.channel!.id, - message: pollMsg.id - }; - - if (duration) - await this.client.polls.create(poll, guild.id); - await invoker.editReply({ emoji: 'success', index: 'COMMAND_POLL_START', params: { channel: targetChannel.id } }); - } + return this.#createPoll(invoker, { choices, channel, duration, multichoice }); else if (subcommand!.name === 'delete') - { - const poll = await this.client.polls.delete(message!.asString); - if (!poll) - return { index: 'COMMAND_POLL_404', emoji: 'failure' }; - const pollChannel = await guild.resolveChannel(poll.payload.channel); - if (!pollChannel) - return { index: 'COMMAND_POLL_MISSING_CHANNEL', emoji: 'failure' }; - const msg = await pollChannel.messages.fetch(poll.payload.message).catch(() => null); - if (msg) - await msg.delete(); - return { index: 'COMMAND_POLL_DELETED', emoji: 'success' }; - } + return this.#deletePoll(invoker, { message }); else if (subcommand!.name === 'end') - { - const poll = await this.client.polls.find(message!.asString); - if (!poll) - return { index: 'COMMAND_POLL_404', emoji: 'failure' }; - await this.client.polls.end(poll.payload); - // await guild._poll(poll.data as PollData & CallbackData); - return { index: 'COMMAND_POLL_ENDED', emoji: 'success' }; - } + return this.#endPoll(invoker, { message }); } + + async #createPoll (invoker: InvokerWrapper, { choices, channel, duration, multichoice }: CommandParams) + { + const { guild, member, author } = invoker; + const targetChannel = (channel?.asChannel || invoker.channel) as GuildTextBasedChannel; + if (!targetChannel?.isTextBased()) + throw new CommandError(invoker, { index: 'ERR_INVALID_CHANNEL_TYPE' }); + const botMissing = targetChannel.permissionsFor(this.client.user!)?.missing([ 'SendMessages', 'EmbedLinks' ]); + const userMissing = targetChannel.permissionsFor(member).missing([ 'SendMessages' ]); + if (!botMissing || botMissing.length) + return invoker.editReply({ index: 'COMMAND_POLL_BOT_PERMS', params: { missing: botMissing?.join(', ') ?? 'ALL', channel: targetChannel.id } }); + if (userMissing.length) + return invoker.editReply({ index: 'COMMAND_POLL_USER_PERMS', params: { missing: userMissing.join(', '), channel: targetChannel.id } }); + + const questions = await this.#queryQuestions(invoker, choices?.asNumber ?? 1, targetChannel); + if (!questions) + return; + + await invoker.editReply({ index: 'COMMAND_POLL_STARTING' }); + + const embed = { + title: guild.format('COMMAND_POLL_TITLE', { user: author.tag }), + description: guild.format('COMMAND_POLL_DESCRIPTION', { + multi: guild.format('COMMAND_POLL_MULTI', { multichoice: multichoice?.asBool && questions.length > 1 || false }, { code: true }), + duration: duration ? guild.format('COMMAND_POLL_DURATION', { time: Util.humanise(duration.asNumber), duration: Math.floor(Date.now() / 1000) + duration.asNumber }) : guild.format('COMMAND_POLL_INFINITE') + }), + fields: questions, + color: EmbedDefaultColor, + timestamp: new Date().toISOString() + }; + + let pollMsg = null; + if (questions.length === 1) + { + questions[0].name = guild.format('COMMAND_POLL_FIELD_QUESTION'); + pollMsg = await targetChannel.send({ embeds: [ embed ] }); + await pollMsg.react('👍'); + await pollMsg.react('👎'); + } + else + { + pollMsg = await targetChannel.send({ embeds: [ embed ] }); + for (const question of questions) + await pollMsg.react(PollReactions.Multi[question.index + 1]); + } + + const poll: PollData = { + questions: questions.map(q => q.value), + duration: (duration?.asNumber ?? 0), + multiChoice: multichoice?.asBool && questions.length > 1 || false, + user: author.id, + channel: targetChannel.id, + startedIn: invoker.channel!.id, + message: pollMsg.id + }; + + if (duration) + await this.client.polls.create(poll, guild.id); + await invoker.editReply({ emoji: 'success', index: 'COMMAND_POLL_START', params: { channel: targetChannel.id } }); + } + async #queryQuestions (invoker: InvokerWrapper, choices: number, targetchannel: GuildTextBasedChannel) { const { guild, member } = invoker; @@ -166,6 +151,31 @@ class PollCommand extends SlashCommand } return questions; } + + async #deletePoll (invoker: InvokerWrapper, { message }: CommandParams) + { + const { guild } = invoker; + const poll = await this.client.polls.delete(message!.asString); + if (!poll) + return { index: 'COMMAND_POLL_404', emoji: 'failure' }; + const pollChannel = await guild.resolveChannel(poll.payload.channel); + if (!pollChannel) + return { index: 'COMMAND_POLL_MISSING_CHANNEL', emoji: 'failure' }; + const msg = await pollChannel.messages.fetch(poll.payload.message).catch(() => null); + if (msg) + await msg.delete(); + return { index: 'COMMAND_POLL_DELETED', emoji: 'success' }; + } + + async #endPoll (_invoker: InvokerWrapper, { message }: CommandParams) + { + const poll = await this.client.polls.find(message!.asString); + if (!poll) + return { index: 'COMMAND_POLL_404', emoji: 'failure' }; + await this.client.polls.end(poll._id, poll.payload); + // await guild._poll(poll.data as PollData & CallbackData); + return { index: 'COMMAND_POLL_ENDED', emoji: 'success' }; + } } export default PollCommand; \ No newline at end of file diff --git a/src/client/components/managers/PollManager.ts b/src/client/components/managers/PollManager.ts index ccc22d4..306153a 100644 --- a/src/client/components/managers/PollManager.ts +++ b/src/client/components/managers/PollManager.ts @@ -47,12 +47,12 @@ class PollManager implements CallbackClient return poll; } - async handleCallback (_id: string, payload: PollData): Promise + async handleCallback (id: string, payload: PollData): Promise { - await this.end(payload); + await this.end(id, payload); } - async end ({ user, channel, startedIn, message, multiChoice }: PollData) + async end (id: string, { user, channel, startedIn, message, multiChoice }: PollData) { const startChannel = await this.#client.resolveChannel(startedIn); const pollChannel = await this.#client.resolveChannel(channel); @@ -89,6 +89,7 @@ class PollManager implements CallbackClient if (startChannel && startChannel.isTextBased()) await startChannel.send(guild.format('COMMAND_POLL_NOTIFY_STARTER', { user, channel })); } + await this.callbacks.removeCallback(id); } } -- 2.45.2 From 5f07fd3e15c4483f1cd2728eeb6549df43cf8733 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 1 Apr 2024 13:47:28 +0300 Subject: [PATCH 03/14] Eval command tweaks --- src/client/components/commands/developer/Eval.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/components/commands/developer/Eval.ts b/src/client/components/commands/developer/Eval.ts index 7049af9..6308f7b 100644 --- a/src/client/components/commands/developer/Eval.ts +++ b/src/client/components/commands/developer/Eval.ts @@ -1,7 +1,5 @@ import { userInfo } from 'os'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { Util, FilterUtil } from '../../../../utilities/index.js'; +import { Util as U, FilterUtil as FU } from '../../../../utilities/index.js'; import { inspect } from 'util'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; @@ -12,6 +10,8 @@ import { ReplyOptions } from '../../../../../@types/Wrappers.js'; const { username } = userInfo(); class EvalCommand extends Command { + static Util = U; + static FilterUtil = FU; constructor (client: DiscordClient) { super(client, { @@ -32,6 +32,10 @@ class EvalCommand extends Command if (async?.asBool) params = `(async () => {${params}})()`; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore // declared for ease of use + const { Util, FilterUtil } = EvalCommand; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore // declared for ease of use const { guild, author, member, client } = invoker; -- 2.45.2 From a3e67936329e32785aea980c651c4c88cc46f759 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 1 Apr 2024 14:01:30 +0300 Subject: [PATCH 04/14] Various fixes Hopefully prevent danging child processes Reduce unnecessary db calls in moderation manager --- src/client/DiscordClient.ts | 24 ++--- .../components/managers/CallbackManager.ts | 4 +- .../components/managers/ModerationManager.ts | 6 +- src/middleware/Controller.ts | 87 ++++++++----------- src/middleware/Metrics.ts | 2 +- src/middleware/{shard => }/Shard.ts | 27 +++--- .../{rest => }/SlashCommandManager.ts | 4 +- src/middleware/shard/index.ts | 6 -- 8 files changed, 74 insertions(+), 86 deletions(-) rename src/middleware/{shard => }/Shard.ts (94%) rename src/middleware/{rest => }/SlashCommandManager.ts (97%) delete mode 100644 src/middleware/shard/index.ts diff --git a/src/client/DiscordClient.ts b/src/client/DiscordClient.ts index 57df97e..e9509e8 100644 --- a/src/client/DiscordClient.ts +++ b/src/client/DiscordClient.ts @@ -210,14 +210,6 @@ class DiscordClient extends Client this.emit('invalidRequestWarning', ...args); }); - // this.once('ready', () => { - // this._setActivity(); - - // setInterval(() => { - // this._setActivity(); - // }, 1800000); // I think this is 30 minutes. I could be wrong. - // }); - this.#loadEevents(); // process.on('uncaughtException', (err) => { @@ -230,7 +222,13 @@ class DiscordClient extends Client }); process.on('message', this.#handleMessage.bind(this)); - process.on('SIGINT', () => this.shutdown()); + process.on('SIGINT', () => this.logger.info('Received SIGINT')); + process.on('SIGTERM', () => this.logger.info('Received SIGTERM')); + process.on('disconnect', () => + { + this.logger.info('Process disconnected from parent for some reason, exiting'); + this.shutdown(1); + }); } async build () @@ -271,7 +269,7 @@ class DiscordClient extends Client this.#activityInterval = setInterval(() => { this.setActivity(); - }, Util.random(5, 10) * 60 * 60 * 1000); + }, Util.random(5, 10) * 60 * 1000); } this.#built = true; @@ -296,6 +294,8 @@ class DiscordClient extends Client // Handle misc. messages. if (message._mEvalResult) this.evalResult(message); + if (message._shutdown) + this.shutdown(); } // eslint-disable-next-line @typescript-eslint/ban-types @@ -397,6 +397,10 @@ class DiscordClient extends Client this.user?.setActivity(`${userCount} users`, { type: ActivityType.Listening }); }, async () => + { + this.user?.setActivity('out for troublemakers', { type: ActivityType.Watching }); + }, + async () => { this.user?.setActivity('for /help', { type: ActivityType.Listening }); } diff --git a/src/client/components/managers/CallbackManager.ts b/src/client/components/managers/CallbackManager.ts index 9485067..f167064 100644 --- a/src/client/components/managers/CallbackManager.ts +++ b/src/client/components/managers/CallbackManager.ts @@ -185,9 +185,9 @@ class CallbackManager implements Initialisable * * @async * @param {string} id - * @returns {*} + * @returns {Promise} */ - async removeCallback (id: string) + async removeCallback (id: string): Promise { await this.storage.deleteOne({ _id: id }); const timeout = this.#timeouts.get(id); diff --git a/src/client/components/managers/ModerationManager.ts b/src/client/components/managers/ModerationManager.ts index 533a936..9db7c12 100644 --- a/src/client/components/managers/ModerationManager.ts +++ b/src/client/components/managers/ModerationManager.ts @@ -591,9 +591,9 @@ class ModerationManager implements Initialisable, CallbackClient return responses; } - async handleCallback (id: string) + async handleCallback (_id: string, infraction: InfractionJSON) { - const infraction = await this.#client.mongodb.infractions.findOne({ id }); + // const infraction = await this.#client.mongodb.infractions.findOne({ id }); if (!infraction) return; this.#logger.debug(`Infraction callback: ${infraction.id} (${infraction.type})`); @@ -667,7 +667,7 @@ class ModerationManager implements Initialisable, CallbackClient if (expiresAt - currentDate <= 0) { this.#logger.debug(`Expired infraction:\n${inspect(infraction)}`); - return this.handleCallback(infraction.id); + return this.handleCallback(infraction.id, infraction); } this.#logger.debug(`Creating infraction callback for ${infraction.id} (${infraction.type}), expiring in ${Util.humanise(duration / 1000)}`); diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index 9828da4..849c3ce 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -1,27 +1,47 @@ -import { EventEmitter } from 'node:events'; -import { inspect } from 'node:util'; +import { + EventEmitter +} from 'node:events'; + +import { + inspect +} from 'node:util'; + +import { + existsSync +} from 'node:fs'; + import path from 'node:path'; -import { CommandsDef, IPCMessage } from '../../@types/Shared.js'; -import { BroadcastEvalOptions, ShardMethod, ShardingOptions } from '../../@types/Shard.js'; -import { ControllerOptions } from '../../@types/Controller.js'; +import { + CommandsDef, + IPCMessage +} from '../../@types/Shared.js'; -import { MasterLogger } from '@navy.gif/logger'; -import { Collection } from 'discord.js'; +import { + BroadcastEvalOptions, + ShardMethod, + ShardingOptions +} from '../../@types/Shard.js'; + +import { + ControllerOptions +} from '../../@types/Controller.js'; + +import { + MasterLogger +} from '@navy.gif/logger'; + +import { + Collection +} from 'discord.js'; // Available for evals import ClientUtils from './ClientUtils.js'; import Metrics from './Metrics.js'; // import ApiClientUtil from './ApiClientUtil.js'; -import SlashCommandManager from './rest/SlashCommandManager.js'; -import { Shard } from './shard/index.js'; -import { existsSync } from 'node:fs'; +import SlashCommandManager from './SlashCommandManager.js'; import Util from '../utilities/Util.js'; - -// Placeholder -type GalacticAPI = { - init: () => Promise -} +import Shard from './Shard.js'; class Controller extends EventEmitter { @@ -39,7 +59,6 @@ class Controller extends EventEmitter #readyAt: number | null; #built: boolean; - #api?: GalacticAPI; clientUtils: typeof ClientUtils; constructor (options: ControllerOptions, version: string) @@ -92,28 +111,7 @@ class Controller extends EventEmitter async build () { const start = Date.now(); - // const API = this._options.api.load ? await import('/Documents/My programs/GBot/api/index.js') - // .catch(() => this.logger.warn(`Error importing API files, continuing without`)) : null; - - // let API = null; - // if (this.#options.api.load) - // API = await import('../../api/index.js').catch(() => this.#logger.warn(`Error importing API files, continuing without`)); - // if (API) { - // this.#logger.info('Booting up API'); - // const { default: APIManager } = API; - // this.#api = new APIManager(this, this.#options.api) as GalacticAPI; - // await this.#api.init(); - // const now = Date.now(); - // this.#logger.info(`API ready. Took ${now - start} ms`); - // start = now; - // } - this.#logger.status('Starting bot shards'); - // await this.shardingManager.spawn().catch((error) => { - // this.#logger.error(`Fatal error during shard spawning:\n${error.stack || inspect(error)}`); - // // eslint-disable-next-line no-process-exit - // process.exit(); // Prevent a boot loop when shards die due to an error in the client - // }); const { totalShards, token } = this.#shardingOptions; let shardCount = 0; @@ -133,7 +131,6 @@ class Controller extends EventEmitter throw new TypeError('Amount of shards must be an integer.'); } - // const promises = []; const retry: Shard[] = []; for (let i = 0; i < shardCount; i++) { @@ -148,9 +145,9 @@ class Controller extends EventEmitter this.logger.info('Retrying shard', i); retry.push(shard); } - // promises.push(); } + // Retry failed spawns for (const shard of retry) { try @@ -163,8 +160,6 @@ class Controller extends EventEmitter } } - // await Promise.all(promises); - this.#logger.status(`Shards spawned, spawned ${this.#shards.size} shards. Took ${Date.now() - start} ms`); this.#built = true; @@ -173,12 +168,11 @@ class Controller extends EventEmitter async shutdown () { - this.logger.info('Received SIGINT, shutting down'); + this.logger.info('Received SIGINT or SIGTERM, shutting down'); setTimeout(process.exit, 90_000); const promises = this.shards .filter(shard => shard.ready) - .map(shard => shard.awaitShutdown() - .then(() => shard.removeAllListeners())); + .map(shard => shard.kill()); if (promises.length) await Promise.all(promises); this.logger.status('Shutdown complete, goodbye'); @@ -406,11 +400,6 @@ class Controller extends EventEmitter return this.#logger; } - get api () - { - return this.#api; - } - get shards () { return this.#shards.clone(); diff --git a/src/middleware/Metrics.ts b/src/middleware/Metrics.ts index cf3e3e6..90d1596 100644 --- a/src/middleware/Metrics.ts +++ b/src/middleware/Metrics.ts @@ -1,6 +1,6 @@ import BaseClient from './Controller.js'; import os from 'node:os'; -import Shard from './shard/Shard.js'; +import Shard from './Shard.js'; import { IPCMessage } from '../../@types/Shared.js'; import djs, { GuildMessageManager } from 'discord.js'; import DiscordClient from '../client/DiscordClient.js'; diff --git a/src/middleware/shard/Shard.ts b/src/middleware/Shard.ts similarity index 94% rename from src/middleware/shard/Shard.ts rename to src/middleware/Shard.ts index 6aa365e..ee1343a 100644 --- a/src/middleware/shard/Shard.ts +++ b/src/middleware/Shard.ts @@ -1,13 +1,14 @@ import EventEmitter from 'node:events'; import path from 'node:path'; -import { makePlainError, makeError, MakeErrorOptions } from 'discord.js'; -import { Util } from '../../utilities/index.js'; import childProcess, { ChildProcess } from 'node:child_process'; +import { makePlainError, makeError, MakeErrorOptions } from 'discord.js'; -import { EnvObject, IPCMessage } from '../../../@types/Shared.js'; -import Controller from '../Controller.js'; -import { ShardOptions } from '../../../@types/Shard.js'; -import { ClientOptions } from '../../../@types/Client.js'; +import Controller from './Controller.js'; +import { Util } from '../utilities/index.js'; + +import { ShardOptions } from '../../@types/Shard.js'; +import { ClientOptions } from '../../@types/Client.js'; +import { EnvObject, IPCMessage } from '../../@types/Shared.js'; const KillTO = 90 * 1000; @@ -16,8 +17,8 @@ class Shard extends EventEmitter [key: string]: unknown; #id: number; - #manager: Controller; - #env: EnvObject; // { [key: string]: string | boolean | number }; + #controller: Controller; + #env: EnvObject; #ready: boolean; #clientOptions: ClientOptions; @@ -38,10 +39,10 @@ class Shard extends EventEmitter #crashes: number[]; #fatal: boolean; - constructor (manager: Controller, id: number, options: ShardOptions) + constructor (controller: Controller, id: number, options: ShardOptions) { super(); - this.#manager = manager; + this.#controller = controller; this.#id = id; this.#args = options.args ?? []; @@ -370,7 +371,7 @@ class Shard extends EventEmitter if (message._sFetchProp) { const resp = { _sFetchProp: message._sFetchProp, _sFetchPropShard: message._sFetchPropShard }; - this.#manager.fetchClientValues(message._sFetchProp, message._sFetchPropShard).then( + this.#controller.fetchClientValues(message._sFetchProp, message._sFetchPropShard).then( (results: unknown) => this.send({ ...resp, _result: results }), (error: Error) => this.send({ ...resp, _error: makePlainError(error) }) ); @@ -380,7 +381,7 @@ class Shard extends EventEmitter if (message._sEval) { const resp = { _sEval: message._sEval, _sEvalShard: message._sEvalShard }; - this.#manager._performOnShards('eval', [ message._sEval ], message._sEvalShard).then( + this.#controller._performOnShards('eval', [ message._sEval ], message._sEvalShard).then( (results: unknown) => this.send({ ...resp, _result: results }), (error: Error) => this.send({ ...resp, _error: makePlainError(error) }) ); @@ -390,7 +391,7 @@ class Shard extends EventEmitter if (message._sRespawnAll) { const { shardDelay, respawnDelay, timeout } = message._sRespawnAll; - this.#manager.respawnAll({ shardDelay, respawnDelay, timeout }).catch(() => + this.#controller.respawnAll({ shardDelay, respawnDelay, timeout }).catch(() => { // }); diff --git a/src/middleware/rest/SlashCommandManager.ts b/src/middleware/SlashCommandManager.ts similarity index 97% rename from src/middleware/rest/SlashCommandManager.ts rename to src/middleware/SlashCommandManager.ts index 3ec51b1..9d0e041 100644 --- a/src/middleware/rest/SlashCommandManager.ts +++ b/src/middleware/SlashCommandManager.ts @@ -5,8 +5,8 @@ import fs from 'node:fs'; import path from 'node:path'; import { inspect } from 'node:util'; -import BaseClient from '../Controller.js'; -import { Command, CommandOption, CommandsDef } from '../../../@types/Shared.js'; +import BaseClient from './Controller.js'; +import { Command, CommandOption, CommandsDef } from '../../@types/Shared.js'; type CommandHashTable = { global: string | null, diff --git a/src/middleware/shard/index.ts b/src/middleware/shard/index.ts deleted file mode 100644 index e7f1f8e..0000000 --- a/src/middleware/shard/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import Shard from './Shard.js'; -// import ShardingManager from './ShardingManager.js'; -export { - Shard, - // ShardingManager -}; \ No newline at end of file -- 2.45.2 From 2a43ad7febefd307c3873268b91c98abf4c70437 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 12 Jul 2024 16:25:13 +0300 Subject: [PATCH 05/14] More debug logging, added dev command to enable debug logging in specific guild --- @types/Guild.d.ts | 1 + options.json | 1 + .../components/commands/developer/Debug.ts | 59 +++++++ .../components/commands/moderation/Roles.ts | 4 - .../components/wrappers/GuildWrapper.ts | 159 ++---------------- src/client/infractions/Addrole.ts | 2 + src/client/infractions/Ban.ts | 1 + src/client/infractions/Kick.ts | 2 + src/client/infractions/Removerole.ts | 1 + src/client/infractions/Unban.ts | 1 + src/client/infractions/Unmute.ts | 6 +- src/client/interfaces/Infraction.ts | 4 + tsconfig.json | 2 +- 13 files changed, 87 insertions(+), 156 deletions(-) create mode 100644 src/client/components/commands/developer/Debug.ts diff --git a/@types/Guild.d.ts b/@types/Guild.d.ts index e815b43..2794b6b 100644 --- a/@types/Guild.d.ts +++ b/@types/Guild.d.ts @@ -120,6 +120,7 @@ export type GuildData = { caseId?: number, settings?: GuildSettings, premium?: number, + debug?: boolean, _version?: string, _imported?: { [key: string]: boolean | undefined, diff --git a/options.json b/options.json index 2712c35..c1ce5b6 100644 --- a/options.json +++ b/options.json @@ -69,6 +69,7 @@ "tables": [ "guilds", "attachments", + "messages", "permissions", "webhooks", "wordwatcher", diff --git a/src/client/components/commands/developer/Debug.ts b/src/client/components/commands/developer/Debug.ts new file mode 100644 index 0000000..6a90749 --- /dev/null +++ b/src/client/components/commands/developer/Debug.ts @@ -0,0 +1,59 @@ +import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; +import DiscordClient from '../../../DiscordClient.js'; +import { Command } from '../../../interfaces/index.js'; +import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; + +class DebugCommand extends Command +{ + constructor (client: DiscordClient) + { + super(client, { + name: 'debug', + restricted: true, + moduleName: 'developer', + options: [ + { name: 'guild', required: true }, + { name: 'enabled', required: true, type: CommandOptionType.BOOLEAN } + ] + }); + } + + async execute (_invoker: InvokerWrapper, options: CommandParams) + { + const guildId = options.guild!.asString; + return this.enableDebug(guildId, options.enabled?.asBool); + } + + async enableDebug (guildId: string, enabled = false) + { + let output = ''; + if (this.client.shard) + { + const result = await this.client.shard.broadcastEval(async (client, context) => + { + const bot = client as DiscordClient; + const wrapper = await bot.getGuildWrapper(context.guildId); + if (!wrapper) + return false; + await wrapper.setDebug(context.enabled); + return `${wrapper.name} (${wrapper.id})`; + }, { context: { guildId, enabled } }); + + if (!result.some(val => val)) + return 'No such guild'; + output = result.find(entry => entry) as string; + } + else + { + const wrapper = await this.client.getGuildWrapper(guildId).catch(() => null); + if (!wrapper) + return 'No such guild'; + await wrapper.setDebug(enabled); + output = `${wrapper.name} (${wrapper.id})`; + } + return `${enabled ? 'Enabled' : 'Disabled'} debug on **${output}**`; + } + +} + +export default DebugCommand; \ No newline at end of file diff --git a/src/client/components/commands/moderation/Roles.ts b/src/client/components/commands/moderation/Roles.ts index 1e57aaf..e6e0a8f 100644 --- a/src/client/components/commands/moderation/Roles.ts +++ b/src/client/components/commands/moderation/Roles.ts @@ -8,7 +8,6 @@ import MemberWrapper from '../../wrappers/MemberWrapper.js'; class AddroleCommand extends ModerationCommand { - constructor (client: DiscordClient) { super(client, { @@ -43,12 +42,10 @@ class AddroleCommand extends ModerationCommand clientPermissions: [ 'ManageRoles' ], skipOptions: [ 'points', 'expiration', 'force', 'prune' ] }); - } async execute (invoker: InvokerWrapper, { users, roles, ...args }: CommandParams) { - if (!users) throw new CommandError(invoker, { index: 'MODERATION_MISSING_USERS' }); if (!roles) @@ -66,7 +63,6 @@ class AddroleCommand extends ModerationCommand roles: roles.asString } }); - } } diff --git a/src/client/components/wrappers/GuildWrapper.ts b/src/client/components/wrappers/GuildWrapper.ts index c967d8b..cdbec0b 100644 --- a/src/client/components/wrappers/GuildWrapper.ts +++ b/src/client/components/wrappers/GuildWrapper.ts @@ -59,89 +59,9 @@ class GuildWrapper this.#guild = guild; this.#webhooks = new Collection(); this.#memberWrappers = new Collection(); - this.#debugLog('Created wrapper'); + this.debug('Created wrapper'); } - // async createPoll ({ user, duration, ...opts }: PollData) - // { - // // Idk polls that don't have a duration should still be stored somewhere so they can be ended at an arbitrary point - // const type = 'poll'; - // const now = Date.now(); - // const id = `${type}:${user}:${now}`; - // const data = { ...opts, user, id, guild: this.id, type, time: duration * 1000, created: now }; - // if (duration) - // await this.createCallback(data satisfies CallbackData); - // } - - // async loadCallbacks () - // { - // const data = await this.#client.mongodb.callbacks.find({ guild: this.id }); - // for (const cb of data) - // await this.createCallback(cb, false); - // } - - // async createCallback (data: CallbackData, update = true) - // { - // const handler = this[`_${data.type}`] as CallbackFn;// .bind(this); - // if (!handler) - // throw new Error('Invalid callback type'); - - // const now = Date.now(); - // const time = data.created + data.time; - // const diff = time - now; - // if (diff < 5000) - // return handler.bind(this)(data); - - // const cb = { timeout: setTimeout(handler.bind(this), diff, data), data }; - // this.#callbacks.set(data.id, cb); - // if (update) - // await this.#client.mongodb.callbacks.updateOne({ id: data.id, guild: this.id }, { $set: data }); - // } - - // async removeCallback (id: string) - // { - // const cb = this.#callbacks.get(id); - // if (cb) - // clearTimeout(cb.timeout); - // this.#callbacks.delete(id); - // await this.#client.mongodb.callbacks.deleteOne({ guild: this.id, id }); - // } - - // async _poll ({ user, message, channel, id, questions, startedIn }: PollData & CallbackData) - // { // multichoice, - // const startedInChannel = await this.resolveChannel(startedIn); - // const pollChannel = await this.resolveChannel(channel); - // if (pollChannel) - // { - // const msg = await pollChannel.messages.fetch(message).catch(() => null); - // if (msg) - // { - // const { reactions } = msg; - // const reactionEmojis = questions.length ? PollReactions.Multi : PollReactions.Single; - // const result: {[key: string]: number} = {}; - // for (const emoji of reactionEmojis) - // { - // let reaction = reactions.resolve(emoji); - // // eslint-disable-next-line max-depth - // if (!reaction) - // continue; - // // eslint-disable-next-line max-depth - // if (reaction.partial) - // reaction = await reaction.fetch(); - // result[emoji] = reaction.count - 1; - // } - - // const embed = msg.embeds[0].toJSON(); - // const results = Object.entries(result).map(([ emoji, count ]) => `${emoji} - ${count}`).join('\n'); - // embed.description = this.format('COMMAND_POLL_END', { results }); - // await msg.edit({ embeds: [ embed ] }); - // } - // } - // await this.removeCallback(id); - // if (startedInChannel) - // await startedInChannel.send(this.format('COMMAND_POLL_NOTIFY_STARTER', { user, channel })); - // } - async filterText (member: GuildMember, text: string) { const settings = await this.settings(); @@ -289,72 +209,6 @@ class GuildWrapper return true; } - // async _attemptDataImport () - // { - // const migratorOptions = { - // // host: MONGODB_V2_HOST, - // database: 'galacticbot', - // version: '2' - // }; - - // const settingsMigrator = new SettingsMigrator(this.client, this, migratorOptions); - // const modlogsMigrator = new InfractionMigrator(this.client, this, migratorOptions); - - // await settingsMigrator.connect(); - // await modlogsMigrator.connect(); - - // let importedSettings = null; - // let importedModlogs = null; - - // try - // { - // importedSettings = await settingsMigrator.import(); - // importedModlogs = await modlogsMigrator.import(); - // importedModlogs.sort((a, b) => a.case - b.case); - // } - // catch (err) - // { - // await settingsMigrator.end(); - // await modlogsMigrator.end(); - // // Did not find old settings, marking as imported anyway - // if (err.message.includes('No old')) - // { - // await this.updateData({ _imported: { settings: true, modlogs: true } }); - // } - // else - // this.client.logger.error(err.stack); - // return null; - // } - // await settingsMigrator.end(); - // await modlogsMigrator.end(); - - // await this.client.mongodb.infractions.deleteMany({ guild: this.id }); - // await this.client.mongodb.infractions.insertMany(importedModlogs); - // this._data.caseId = importedModlogs[importedModlogs.length - 1].case; - // await this.updateData({ - // caseId: this._data.caseId, - // premium: importedSettings.premium, - // _imported: { settings: true, modlogs: true } - // }); - - // const { webhook, permissions, settings } = importedSettings; - // await this.updateSettings(settings); - // if (webhook) - // { - // const hooks = await this.fetchWebhooks().catch(() => null); - // const hook = hooks?.get(webhook); - // if (hook) - // await this.updateWebhook('messages', hook); - // } - - // if (permissions) - // await this.#client.mongodb.permissions.updateOne({ guildId: this.id }, permissions); - - - // return settings; - - // } - /** * Update a webhook entry in the database * @@ -528,9 +382,16 @@ class GuildWrapper this.#logger.error(`Database error (guild:${this.id}) :\n${error.stack || error}`); } - #debugLog (log: string) + debug (log: string) { - this.#logger.debug(`[${this.name}]: ${log}`); + if (!this.#data || this.#data.debug) + this.#logger.debug(`[${this.name}]: ${log}`); + } + + async setDebug (enabled: boolean) + { + await this.#client.mongodb.guilds.updateOne({ guildId: this.id }, { $set: { debug: enabled } }); + this.#data.debug = enabled; } /* Wrapper Functions */ diff --git a/src/client/infractions/Addrole.ts b/src/client/infractions/Addrole.ts index 0dc2e8e..a2f1801 100644 --- a/src/client/infractions/Addrole.ts +++ b/src/client/infractions/Addrole.ts @@ -62,10 +62,12 @@ class AddroleInfraction extends Infraction } try { + this.guild.debug(`Adding roles ${this.data.roleIds.join(', ')} to ${this.member.tag} (${this.member.id})`); await this.member.roles.add(this.data.roleIds, this._reason); } catch (error) { + this.logger.error(`Failed to add roles (${this.data.roleIds.join(', ')}) to ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index dbaada5..746cd9a 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -65,6 +65,7 @@ class BanInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to ban ${(this.target as UserWrapper).tag} (${this.target!.id}) from ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } await this.handle(); diff --git a/src/client/infractions/Kick.ts b/src/client/infractions/Kick.ts index 5d90dc3..601a22f 100644 --- a/src/client/infractions/Kick.ts +++ b/src/client/infractions/Kick.ts @@ -4,6 +4,7 @@ import DiscordClient from '../DiscordClient.js'; import MemberWrapper from '../components/wrappers/MemberWrapper.js'; import Infraction from '../interfaces/Infraction.js'; import { KickData } from '../../../@types/Infractions.js'; +import UserWrapper from '../components/wrappers/UserWrapper.js'; class KickInfraction extends Infraction { @@ -56,6 +57,7 @@ class KickInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to kick ${(this.target as UserWrapper).tag} (${this.target!.id}) from ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } await this.handle(); diff --git a/src/client/infractions/Removerole.ts b/src/client/infractions/Removerole.ts index 4c3722f..94e5f63 100644 --- a/src/client/infractions/Removerole.ts +++ b/src/client/infractions/Removerole.ts @@ -59,6 +59,7 @@ class RemoveroleInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to remove roles (${this.data.roleIds!.join(', ')}) to ${this.member!.tag} (${this.member!.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Unban.ts b/src/client/infractions/Unban.ts index 867d871..9c65a73 100644 --- a/src/client/infractions/Unban.ts +++ b/src/client/infractions/Unban.ts @@ -49,6 +49,7 @@ class UnbanInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to unban ${this.targetId} in ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Unmute.ts b/src/client/infractions/Unmute.ts index 4208b54..6365d61 100644 --- a/src/client/infractions/Unmute.ts +++ b/src/client/infractions/Unmute.ts @@ -107,8 +107,9 @@ class UnmuteInfraction extends Infraction { this.member!.roles.remove(role, this._reason); } - catch (e) + catch (error) { + this.logger.error(`Failed to unmute ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('C_UNMUTE_1FAIL'); } } @@ -131,8 +132,9 @@ class UnmuteInfraction extends Infraction { this.member.roles.remove(role, this._reason); } - catch (e) + catch (error) { + this.logger.error(`Failed to unmute ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('C_UNMUTE_1FAIL'); } break; diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index 98672c4..76254ef 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -234,6 +234,10 @@ class Infraction }).catch(() => null); this.#dmLogMessageId = logMessage?.id ?? null; } + else + { + this.logger.debug(`Target not sendable? ${inspect(this.#target)}`); + } } if (this.#duration) diff --git a/tsconfig.json b/tsconfig.json index d4b2d78..d17bff5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -111,7 +111,7 @@ }, "compileOnSave": true, "exclude": ["archive", "api"], - "include": ["src", "index.ts", "@types"], + "include": ["src/**/*", "index.ts", "@types/*"], "watchOptions": { "watchFile": "useFsEvents", "watchDirectory": "useFsEvents", -- 2.45.2 From de26cdec44f16040d757c5e0eac59edbb647eb9e Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 12 Jul 2024 15:28:29 +0200 Subject: [PATCH 06/14] More debug logging, added dev command to enable debug logging in specific guild (#9) Reviewed-on: https://git.corgi.wtf/Galactic/galactic-bot/pulls/9 Co-authored-by: Navy.gif Co-committed-by: Navy.gif --- @types/Guild.d.ts | 1 + options.json | 1 + .../components/commands/developer/Debug.ts | 59 +++++++ .../components/commands/moderation/Roles.ts | 4 - .../components/wrappers/GuildWrapper.ts | 159 ++---------------- src/client/infractions/Addrole.ts | 2 + src/client/infractions/Ban.ts | 1 + src/client/infractions/Kick.ts | 2 + src/client/infractions/Removerole.ts | 1 + src/client/infractions/Unban.ts | 1 + src/client/infractions/Unmute.ts | 6 +- src/client/interfaces/Infraction.ts | 4 + tsconfig.json | 2 +- 13 files changed, 87 insertions(+), 156 deletions(-) create mode 100644 src/client/components/commands/developer/Debug.ts diff --git a/@types/Guild.d.ts b/@types/Guild.d.ts index e815b43..2794b6b 100644 --- a/@types/Guild.d.ts +++ b/@types/Guild.d.ts @@ -120,6 +120,7 @@ export type GuildData = { caseId?: number, settings?: GuildSettings, premium?: number, + debug?: boolean, _version?: string, _imported?: { [key: string]: boolean | undefined, diff --git a/options.json b/options.json index 2712c35..c1ce5b6 100644 --- a/options.json +++ b/options.json @@ -69,6 +69,7 @@ "tables": [ "guilds", "attachments", + "messages", "permissions", "webhooks", "wordwatcher", diff --git a/src/client/components/commands/developer/Debug.ts b/src/client/components/commands/developer/Debug.ts new file mode 100644 index 0000000..6a90749 --- /dev/null +++ b/src/client/components/commands/developer/Debug.ts @@ -0,0 +1,59 @@ +import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; +import DiscordClient from '../../../DiscordClient.js'; +import { Command } from '../../../interfaces/index.js'; +import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; + +class DebugCommand extends Command +{ + constructor (client: DiscordClient) + { + super(client, { + name: 'debug', + restricted: true, + moduleName: 'developer', + options: [ + { name: 'guild', required: true }, + { name: 'enabled', required: true, type: CommandOptionType.BOOLEAN } + ] + }); + } + + async execute (_invoker: InvokerWrapper, options: CommandParams) + { + const guildId = options.guild!.asString; + return this.enableDebug(guildId, options.enabled?.asBool); + } + + async enableDebug (guildId: string, enabled = false) + { + let output = ''; + if (this.client.shard) + { + const result = await this.client.shard.broadcastEval(async (client, context) => + { + const bot = client as DiscordClient; + const wrapper = await bot.getGuildWrapper(context.guildId); + if (!wrapper) + return false; + await wrapper.setDebug(context.enabled); + return `${wrapper.name} (${wrapper.id})`; + }, { context: { guildId, enabled } }); + + if (!result.some(val => val)) + return 'No such guild'; + output = result.find(entry => entry) as string; + } + else + { + const wrapper = await this.client.getGuildWrapper(guildId).catch(() => null); + if (!wrapper) + return 'No such guild'; + await wrapper.setDebug(enabled); + output = `${wrapper.name} (${wrapper.id})`; + } + return `${enabled ? 'Enabled' : 'Disabled'} debug on **${output}**`; + } + +} + +export default DebugCommand; \ No newline at end of file diff --git a/src/client/components/commands/moderation/Roles.ts b/src/client/components/commands/moderation/Roles.ts index 1e57aaf..e6e0a8f 100644 --- a/src/client/components/commands/moderation/Roles.ts +++ b/src/client/components/commands/moderation/Roles.ts @@ -8,7 +8,6 @@ import MemberWrapper from '../../wrappers/MemberWrapper.js'; class AddroleCommand extends ModerationCommand { - constructor (client: DiscordClient) { super(client, { @@ -43,12 +42,10 @@ class AddroleCommand extends ModerationCommand clientPermissions: [ 'ManageRoles' ], skipOptions: [ 'points', 'expiration', 'force', 'prune' ] }); - } async execute (invoker: InvokerWrapper, { users, roles, ...args }: CommandParams) { - if (!users) throw new CommandError(invoker, { index: 'MODERATION_MISSING_USERS' }); if (!roles) @@ -66,7 +63,6 @@ class AddroleCommand extends ModerationCommand roles: roles.asString } }); - } } diff --git a/src/client/components/wrappers/GuildWrapper.ts b/src/client/components/wrappers/GuildWrapper.ts index c967d8b..cdbec0b 100644 --- a/src/client/components/wrappers/GuildWrapper.ts +++ b/src/client/components/wrappers/GuildWrapper.ts @@ -59,89 +59,9 @@ class GuildWrapper this.#guild = guild; this.#webhooks = new Collection(); this.#memberWrappers = new Collection(); - this.#debugLog('Created wrapper'); + this.debug('Created wrapper'); } - // async createPoll ({ user, duration, ...opts }: PollData) - // { - // // Idk polls that don't have a duration should still be stored somewhere so they can be ended at an arbitrary point - // const type = 'poll'; - // const now = Date.now(); - // const id = `${type}:${user}:${now}`; - // const data = { ...opts, user, id, guild: this.id, type, time: duration * 1000, created: now }; - // if (duration) - // await this.createCallback(data satisfies CallbackData); - // } - - // async loadCallbacks () - // { - // const data = await this.#client.mongodb.callbacks.find({ guild: this.id }); - // for (const cb of data) - // await this.createCallback(cb, false); - // } - - // async createCallback (data: CallbackData, update = true) - // { - // const handler = this[`_${data.type}`] as CallbackFn;// .bind(this); - // if (!handler) - // throw new Error('Invalid callback type'); - - // const now = Date.now(); - // const time = data.created + data.time; - // const diff = time - now; - // if (diff < 5000) - // return handler.bind(this)(data); - - // const cb = { timeout: setTimeout(handler.bind(this), diff, data), data }; - // this.#callbacks.set(data.id, cb); - // if (update) - // await this.#client.mongodb.callbacks.updateOne({ id: data.id, guild: this.id }, { $set: data }); - // } - - // async removeCallback (id: string) - // { - // const cb = this.#callbacks.get(id); - // if (cb) - // clearTimeout(cb.timeout); - // this.#callbacks.delete(id); - // await this.#client.mongodb.callbacks.deleteOne({ guild: this.id, id }); - // } - - // async _poll ({ user, message, channel, id, questions, startedIn }: PollData & CallbackData) - // { // multichoice, - // const startedInChannel = await this.resolveChannel(startedIn); - // const pollChannel = await this.resolveChannel(channel); - // if (pollChannel) - // { - // const msg = await pollChannel.messages.fetch(message).catch(() => null); - // if (msg) - // { - // const { reactions } = msg; - // const reactionEmojis = questions.length ? PollReactions.Multi : PollReactions.Single; - // const result: {[key: string]: number} = {}; - // for (const emoji of reactionEmojis) - // { - // let reaction = reactions.resolve(emoji); - // // eslint-disable-next-line max-depth - // if (!reaction) - // continue; - // // eslint-disable-next-line max-depth - // if (reaction.partial) - // reaction = await reaction.fetch(); - // result[emoji] = reaction.count - 1; - // } - - // const embed = msg.embeds[0].toJSON(); - // const results = Object.entries(result).map(([ emoji, count ]) => `${emoji} - ${count}`).join('\n'); - // embed.description = this.format('COMMAND_POLL_END', { results }); - // await msg.edit({ embeds: [ embed ] }); - // } - // } - // await this.removeCallback(id); - // if (startedInChannel) - // await startedInChannel.send(this.format('COMMAND_POLL_NOTIFY_STARTER', { user, channel })); - // } - async filterText (member: GuildMember, text: string) { const settings = await this.settings(); @@ -289,72 +209,6 @@ class GuildWrapper return true; } - // async _attemptDataImport () - // { - // const migratorOptions = { - // // host: MONGODB_V2_HOST, - // database: 'galacticbot', - // version: '2' - // }; - - // const settingsMigrator = new SettingsMigrator(this.client, this, migratorOptions); - // const modlogsMigrator = new InfractionMigrator(this.client, this, migratorOptions); - - // await settingsMigrator.connect(); - // await modlogsMigrator.connect(); - - // let importedSettings = null; - // let importedModlogs = null; - - // try - // { - // importedSettings = await settingsMigrator.import(); - // importedModlogs = await modlogsMigrator.import(); - // importedModlogs.sort((a, b) => a.case - b.case); - // } - // catch (err) - // { - // await settingsMigrator.end(); - // await modlogsMigrator.end(); - // // Did not find old settings, marking as imported anyway - // if (err.message.includes('No old')) - // { - // await this.updateData({ _imported: { settings: true, modlogs: true } }); - // } - // else - // this.client.logger.error(err.stack); - // return null; - // } - // await settingsMigrator.end(); - // await modlogsMigrator.end(); - - // await this.client.mongodb.infractions.deleteMany({ guild: this.id }); - // await this.client.mongodb.infractions.insertMany(importedModlogs); - // this._data.caseId = importedModlogs[importedModlogs.length - 1].case; - // await this.updateData({ - // caseId: this._data.caseId, - // premium: importedSettings.premium, - // _imported: { settings: true, modlogs: true } - // }); - - // const { webhook, permissions, settings } = importedSettings; - // await this.updateSettings(settings); - // if (webhook) - // { - // const hooks = await this.fetchWebhooks().catch(() => null); - // const hook = hooks?.get(webhook); - // if (hook) - // await this.updateWebhook('messages', hook); - // } - - // if (permissions) - // await this.#client.mongodb.permissions.updateOne({ guildId: this.id }, permissions); - - - // return settings; - - // } - /** * Update a webhook entry in the database * @@ -528,9 +382,16 @@ class GuildWrapper this.#logger.error(`Database error (guild:${this.id}) :\n${error.stack || error}`); } - #debugLog (log: string) + debug (log: string) { - this.#logger.debug(`[${this.name}]: ${log}`); + if (!this.#data || this.#data.debug) + this.#logger.debug(`[${this.name}]: ${log}`); + } + + async setDebug (enabled: boolean) + { + await this.#client.mongodb.guilds.updateOne({ guildId: this.id }, { $set: { debug: enabled } }); + this.#data.debug = enabled; } /* Wrapper Functions */ diff --git a/src/client/infractions/Addrole.ts b/src/client/infractions/Addrole.ts index 0dc2e8e..a2f1801 100644 --- a/src/client/infractions/Addrole.ts +++ b/src/client/infractions/Addrole.ts @@ -62,10 +62,12 @@ class AddroleInfraction extends Infraction } try { + this.guild.debug(`Adding roles ${this.data.roleIds.join(', ')} to ${this.member.tag} (${this.member.id})`); await this.member.roles.add(this.data.roleIds, this._reason); } catch (error) { + this.logger.error(`Failed to add roles (${this.data.roleIds.join(', ')}) to ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index dbaada5..746cd9a 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -65,6 +65,7 @@ class BanInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to ban ${(this.target as UserWrapper).tag} (${this.target!.id}) from ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } await this.handle(); diff --git a/src/client/infractions/Kick.ts b/src/client/infractions/Kick.ts index 5d90dc3..601a22f 100644 --- a/src/client/infractions/Kick.ts +++ b/src/client/infractions/Kick.ts @@ -4,6 +4,7 @@ import DiscordClient from '../DiscordClient.js'; import MemberWrapper from '../components/wrappers/MemberWrapper.js'; import Infraction from '../interfaces/Infraction.js'; import { KickData } from '../../../@types/Infractions.js'; +import UserWrapper from '../components/wrappers/UserWrapper.js'; class KickInfraction extends Infraction { @@ -56,6 +57,7 @@ class KickInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to kick ${(this.target as UserWrapper).tag} (${this.target!.id}) from ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } await this.handle(); diff --git a/src/client/infractions/Removerole.ts b/src/client/infractions/Removerole.ts index 4c3722f..94e5f63 100644 --- a/src/client/infractions/Removerole.ts +++ b/src/client/infractions/Removerole.ts @@ -59,6 +59,7 @@ class RemoveroleInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to remove roles (${this.data.roleIds!.join(', ')}) to ${this.member!.tag} (${this.member!.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Unban.ts b/src/client/infractions/Unban.ts index 867d871..9c65a73 100644 --- a/src/client/infractions/Unban.ts +++ b/src/client/infractions/Unban.ts @@ -49,6 +49,7 @@ class UnbanInfraction extends Infraction } catch (error) { + this.logger.error(`Failed to unban ${this.targetId} in ${this.guild.name} (${this.guild.id})\n${error}`); return this._fail('INFRACTION_ERROR'); } diff --git a/src/client/infractions/Unmute.ts b/src/client/infractions/Unmute.ts index 4208b54..6365d61 100644 --- a/src/client/infractions/Unmute.ts +++ b/src/client/infractions/Unmute.ts @@ -107,8 +107,9 @@ class UnmuteInfraction extends Infraction { this.member!.roles.remove(role, this._reason); } - catch (e) + catch (error) { + this.logger.error(`Failed to unmute ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('C_UNMUTE_1FAIL'); } } @@ -131,8 +132,9 @@ class UnmuteInfraction extends Infraction { this.member.roles.remove(role, this._reason); } - catch (e) + catch (error) { + this.logger.error(`Failed to unmute ${this.member.tag} (${this.member.id})\n${error}`); return this._fail('C_UNMUTE_1FAIL'); } break; diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index 98672c4..76254ef 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -234,6 +234,10 @@ class Infraction }).catch(() => null); this.#dmLogMessageId = logMessage?.id ?? null; } + else + { + this.logger.debug(`Target not sendable? ${inspect(this.#target)}`); + } } if (this.#duration) diff --git a/tsconfig.json b/tsconfig.json index d4b2d78..d17bff5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -111,7 +111,7 @@ }, "compileOnSave": true, "exclude": ["archive", "api"], - "include": ["src", "index.ts", "@types"], + "include": ["src/**/*", "index.ts", "@types/*"], "watchOptions": { "watchFile": "useFsEvents", "watchDirectory": "useFsEvents", -- 2.45.2 From d637a197b22f0255eb78a00d49e011e9e247471c Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 12 Jul 2024 15:47:20 +0200 Subject: [PATCH 07/14] Add README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5d67d0 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Galactic Bot + +Welcome to the Galactic Bot repository. +I've decided to open this up as I struggle to find motivation and time to work on this, so contributions welcome. + +I do require that any contributions conform to the linter rules present and code should strive to be legible and follow generally good programming practises. Pull requests must explain what they change/add and why. + +Discussion and questions are to be had in the [discord server](https://discord.gg/WDCTKGp). + +I will hopefully expand on this file and add others to help document this project, as it stands there is very little internal documentation. \ No newline at end of file -- 2.45.2 From 96b459a8aad5037bab03631dc1d8e58d9a78459a Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 18 Jul 2024 20:06:49 +0300 Subject: [PATCH 08/14] Add license and copyright attribution --- @types/CallbackManager.d.ts | 16 + @types/Client.ts | 16 + @types/Commands/Moderation.d.ts | 16 + @types/Commands/Settings.ts | 16 + @types/Controller.d.ts | 16 + @types/Events.d.ts | 16 + @types/Guild.d.ts | 16 + @types/Infractions.d.ts | 16 + @types/Moderation.d.ts | 16 + @types/Settings.ts | 19 + @types/Shard.d.ts | 16 + @types/Shared.d.ts | 16 + @types/Storage.d.ts | 16 + @types/Utils.d.ts | 16 + @types/Wrappers.d.ts | 16 + LICENSE | 674 ++++++++++++++++++ index.ts | 17 +- package.json | 2 +- src/client/DiscordClient.ts | 16 + src/client/components/Dispatcher.ts | 16 + src/client/components/EventHooker.ts | 18 +- src/client/components/Intercom.ts | 16 + src/client/components/LocaleLoader.ts | 22 +- src/client/components/RateLimiter.ts | 16 +- src/client/components/Registry.ts | 16 + src/client/components/Resolver.ts | 23 +- .../commands/administration/Administration.ts | 17 +- .../commands/administration/Import.ts | 16 + .../commands/administration/Logging.ts | 16 +- .../commands/administration/Moderation.ts | 16 + .../commands/administration/Modstats.ts | 16 + .../commands/administration/Permissions.ts | 16 + .../commands/administration/Settings.ts | 16 + .../commands/administration/Utility.ts | 16 + .../components/commands/developer/Debug.ts | 16 + .../components/commands/developer/Eval.ts | 16 + .../components/commands/developer/Stats.ts | 16 + .../commands/information/Commands.ts | 16 + .../components/commands/information/Guild.ts | 16 + .../components/commands/information/Help.ts | 16 + .../components/commands/information/Info.ts | 16 + .../commands/information/Privacy.ts | 16 + .../components/commands/moderation/Ban.ts | 16 + .../components/commands/moderation/Case.ts | 16 + .../components/commands/moderation/Dehoist.ts | 16 + .../components/commands/moderation/Edit.ts | 16 + .../components/commands/moderation/History.ts | 16 + .../components/commands/moderation/Kick.ts | 16 + .../commands/moderation/Lockdown.ts | 16 + .../commands/moderation/Modtimers.ts | 16 + .../components/commands/moderation/Mute.ts | 16 + .../commands/moderation/Nickname.ts | 16 + .../components/commands/moderation/Note.ts | 16 + .../components/commands/moderation/Prune.ts | 16 + .../components/commands/moderation/Resolve.ts | 16 + .../components/commands/moderation/Roles.ts | 16 + .../commands/moderation/Slowmode.ts | 16 + .../components/commands/moderation/Softban.ts | 16 + .../components/commands/moderation/Staff.ts | 16 + .../components/commands/moderation/Unban.ts | 16 + .../commands/moderation/Unlockdown.ts | 16 + .../components/commands/moderation/Unmute.ts | 16 + .../commands/moderation/Unresolve.ts | 16 + .../components/commands/moderation/Vckick.ts | 16 + .../components/commands/moderation/Warn.ts | 16 + .../components/commands/utility/Avatar.ts | 16 + .../components/commands/utility/Grantable.ts | 16 + .../components/commands/utility/Ping.ts | 16 + .../components/commands/utility/Poll.ts | 16 + .../components/commands/utility/Remind.ts | 16 + .../components/commands/utility/Selfrole.ts | 16 + src/client/components/index.ts | 16 + .../components/inhibitors/ChannelIgnore.ts | 17 +- .../inhibitors/ClientPermissions.ts | 16 + src/client/components/inhibitors/Disabled.ts | 16 + src/client/components/inhibitors/GuildOnly.ts | 16 + .../components/inhibitors/Permissions.ts | 16 + .../components/inhibitors/Restricted.ts | 16 + src/client/components/inhibitors/Throttle.ts | 16 + .../components/managers/CallbackManager.ts | 16 + .../components/managers/ModerationManager.ts | 16 + src/client/components/managers/PollManager.ts | 16 + .../components/managers/ReminderManager.ts | 16 + src/client/components/observers/AuditLog.ts | 16 + .../components/observers/Automoderation.ts | 16 + .../components/observers/CommandHandler.ts | 20 +- src/client/components/observers/ErrorLog.ts | 16 + .../components/observers/GuildLogging.ts | 16 + src/client/components/observers/Metrics.ts | 17 +- .../components/observers/UtilityHook.ts | 16 + .../settings/administration/Commands.ts | 16 + .../settings/administration/IgnoreChannels.ts | 16 + .../settings/administration/Indexing.ts | 16 + .../settings/administration/PermissionType.ts | 16 + .../settings/administration/Protection.ts | 16 + .../settings/administration/Silent.ts | 16 + .../settings/administration/TextCommands.ts | 16 + .../settings/logging/DmInfraction.ts | 16 + .../components/settings/logging/Errors.ts | 16 + .../components/settings/logging/Members.ts | 16 + .../components/settings/logging/Messages.ts | 16 + .../components/settings/logging/Moderation.ts | 16 + .../components/settings/logging/Nicknames.ts | 16 + .../components/settings/logging/Voice.ts | 16 + .../settings/moderation/AutoModeration.ts | 16 + .../settings/moderation/Grantable.ts | 16 + .../settings/moderation/InviteFilter.ts | 16 + .../settings/moderation/LinkFilter.ts | 16 + .../settings/moderation/MentionFilter.ts | 16 + .../settings/moderation/ModerationPoints.ts | 16 + .../components/settings/moderation/Mute.ts | 16 + .../settings/moderation/Raidprotection.ts | 16 + .../components/settings/moderation/Staff.ts | 16 + .../settings/moderation/WordFilter.ts | 16 + .../settings/moderation/WordWatcher.ts | 16 + .../components/settings/utility/Autorole.ts | 16 + .../components/settings/utility/Selfrole.ts | 16 + .../components/settings/utility/StickyRole.ts | 16 + .../components/settings/utility/Welcomer.ts | 16 + .../components/wrappers/GuildWrapper.ts | 20 +- .../components/wrappers/InteractionWrapper.ts | 18 +- .../components/wrappers/InvokerWrapper.ts | 16 + .../components/wrappers/MemberWrapper.ts | 16 + .../components/wrappers/MessageWrapper.ts | 18 +- src/client/components/wrappers/UserWrapper.ts | 19 +- src/client/components/wrappers/index.ts | 16 + src/client/infractions/Addrole.ts | 16 + src/client/infractions/Ban.ts | 16 + src/client/infractions/Kick.ts | 16 + src/client/infractions/Lockdown.ts | 16 + src/client/infractions/Mute.ts | 16 + src/client/infractions/Nickname.ts | 16 + src/client/infractions/Note.ts | 16 + src/client/infractions/Prune.ts | 16 + src/client/infractions/Removerole.ts | 16 + src/client/infractions/Slowmode.ts | 16 + src/client/infractions/Softban.ts | 16 + src/client/infractions/Unban.ts | 16 + src/client/infractions/Unlockdown.ts | 16 + src/client/infractions/Unmute.ts | 16 + src/client/infractions/Vckick.ts | 16 + src/client/infractions/Warn.ts | 16 + src/client/infractions/index.ts | 16 + src/client/interfaces/CallbackClient.ts | 16 + src/client/interfaces/CommandError.ts | 18 +- src/client/interfaces/CommandOption.ts | 16 + src/client/interfaces/Component.ts | 17 +- src/client/interfaces/FilterSetting.ts | 19 +- src/client/interfaces/Infraction.ts | 16 + src/client/interfaces/Inhibitor.ts | 16 + src/client/interfaces/Initialisable.ts | 16 + src/client/interfaces/Module.ts | 20 +- src/client/interfaces/Observer.ts | 16 + src/client/interfaces/Setting.ts | 16 + src/client/interfaces/commands/Command.ts | 16 + .../interfaces/commands/ModerationCommand.ts | 16 + .../interfaces/commands/SettingsCommand.ts | 17 +- .../interfaces/commands/SlashCommand.ts | 16 + src/client/interfaces/index.ts | 16 + src/client/storage/StorageManager.ts | 30 +- src/client/storage/interfaces/MariadbTable.ts | 18 +- src/client/storage/interfaces/MongodbTable.ts | 20 +- src/client/storage/interfaces/Provider.ts | 16 + src/client/storage/interfaces/Table.ts | 16 + src/client/storage/interfaces/index.ts | 16 + .../storage/providers/MariaDBProvider.ts | 16 + .../storage/providers/MongoDBProvider.ts | 16 + src/client/storage/tables/mariadb/Activity.ts | 16 + .../storage/tables/mongodb/Infractions.ts | 16 + src/constants/Commands.ts | 16 + src/constants/Constants.ts | 16 + src/constants/Emojis.ts | 16 + src/constants/FilterPresets.ts | 16 + src/constants/KillItWithFire.ts | 16 + src/constants/defaults/DefaultGuild.ts | 16 + src/constants/defaults/DefaultUser.ts | 16 + src/constants/index.ts | 16 + src/middleware/ClientUtils.ts | 16 + src/middleware/Controller.ts | 16 + src/middleware/Metrics.ts | 16 + src/middleware/Shard.ts | 16 + src/middleware/SlashCommandManager.ts | 16 + src/utilities/BinaryTree.ts | 16 + src/utilities/FilterUtil.ts | 16 + src/utilities/InfractionMigrator.ts | 16 + src/utilities/SettingsMigrator.ts | 16 + src/utilities/SimpleMongoWrapper.ts | 16 + src/utilities/Util.ts | 21 +- src/utilities/index.ts | 16 + 189 files changed, 3663 insertions(+), 78 deletions(-) create mode 100644 LICENSE diff --git a/@types/CallbackManager.d.ts b/@types/CallbackManager.d.ts index 3b8a27a..8312343 100644 --- a/@types/CallbackManager.d.ts +++ b/@types/CallbackManager.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + export type CallbackCreateInfo = { payload: T, expiresAt: number, diff --git a/@types/Client.ts b/@types/Client.ts index f7934ad..a404e83 100644 --- a/@types/Client.ts +++ b/@types/Client.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClientOptions } from '@navy.gif/logger'; import { Partials, diff --git a/@types/Commands/Moderation.d.ts b/@types/Commands/Moderation.d.ts index 1d3299b..e81e53e 100644 --- a/@types/Commands/Moderation.d.ts +++ b/@types/Commands/Moderation.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommandOptions } from '../Client.js'; export type ModerationCommandOptions = { diff --git a/@types/Commands/Settings.ts b/@types/Commands/Settings.ts index dfe1c4b..e546b7f 100644 --- a/@types/Commands/Settings.ts +++ b/@types/Commands/Settings.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommandOptions } from '../Client.js'; import { ReplyOptions } from '../Wrappers.js'; diff --git a/@types/Controller.d.ts b/@types/Controller.d.ts index dd43300..0ab78d2 100644 --- a/@types/Controller.d.ts +++ b/@types/Controller.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerMasterOptions, LoggerClientOptions } from '@navy.gif/logger'; import { ClientOptions } from './Client.ts'; import { StorageManagerOptions } from './Storage.js'; diff --git a/@types/Events.d.ts b/@types/Events.d.ts index c90b3ad..b79b036 100644 --- a/@types/Events.d.ts +++ b/@types/Events.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Component } from '../src/client/interfaces/index.ts'; import { ClientEvents as CE, InvalidRequestWarningData, RateLimitData, ResponseLike } from 'discord.js'; import { ExtendedGuildBan, ExtendedMessage } from './Client.ts'; diff --git a/@types/Guild.d.ts b/@types/Guild.d.ts index 2794b6b..f594f22 100644 --- a/@types/Guild.d.ts +++ b/@types/Guild.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ChannelType, Snowflake } from 'discord.js'; import { AutomodSettings, diff --git a/@types/Infractions.d.ts b/@types/Infractions.d.ts index 9a09610..3404ee0 100644 --- a/@types/Infractions.d.ts +++ b/@types/Infractions.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { GuildTextBasedChannel } from 'discord.js'; import { MemberWrapper } from '../src/client/components/wrappers/index.ts'; import { BaseInfractionData } from './Client.ts'; diff --git a/@types/Moderation.d.ts b/@types/Moderation.d.ts index 9d11716..ffae473 100644 --- a/@types/Moderation.d.ts +++ b/@types/Moderation.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { GuildBasedChannel, GuildTextBasedChannel, Message } from 'discord.js'; import { GuildWrapper, InvokerWrapper, MemberWrapper, UserWrapper } from '../src/client/components/wrappers/index.ts'; import { CommandOption, Infraction } from '../src/client/interfaces/index.ts'; diff --git a/@types/Settings.ts b/@types/Settings.ts index f4a2aef..46dddb0 100644 --- a/@types/Settings.ts +++ b/@types/Settings.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Snowflake } from 'discord.js'; import { InfractionType, SettingAction } from './Client.js'; @@ -7,6 +23,7 @@ export type UserSettings = { } export type Setting = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any enabled: boolean } @@ -85,6 +102,7 @@ export enum MuteType { Timeout = 3 } export type MuteSettings = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any// MuteType | Snowflake | number | boolean | null type: MuteType, role: Snowflake | null, @@ -163,6 +181,7 @@ export type WelcomerSettings = { } & Setting export type WordWatcherSettings = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any// SettingAction[] | string[] | string | null words: string[], regex: string[], diff --git a/@types/Shard.d.ts b/@types/Shard.d.ts index 7197d01..d613baa 100644 --- a/@types/Shard.d.ts +++ b/@types/Shard.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ClientOptions } from './Client.ts'; export type ShardingOptions = { diff --git a/@types/Shared.d.ts b/@types/Shared.d.ts index b241562..13b844c 100644 --- a/@types/Shared.d.ts +++ b/@types/Shared.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { WriteOptions, LoggerClient } from '@navy.gif/logger'; import { ClientOptions } from './Client.ts'; diff --git a/@types/Storage.d.ts b/@types/Storage.d.ts index 5cdeafe..b296499 100644 --- a/@types/Storage.d.ts +++ b/@types/Storage.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { MongoClientOptions } from 'mongodb'; import { PoolClusterConfig, PoolConfig } from 'mysql'; diff --git a/@types/Utils.d.ts b/@types/Utils.d.ts index e27b5f3..caf0cd4 100644 --- a/@types/Utils.d.ts +++ b/@types/Utils.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + export type FilterType = 'explicit' | 'regex' | 'fuzzy' export type FilterResult = { diff --git a/@types/Wrappers.d.ts b/@types/Wrappers.d.ts index df52697..fb3bf69 100644 --- a/@types/Wrappers.d.ts +++ b/@types/Wrappers.d.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, ActionRowData, Attachment, AttachmentBuilder, AttachmentPayload, ChannelSelectMenuInteraction, EmbedBuilder, MentionableSelectMenuInteraction, MessageActionRowComponentBuilder, MessageActionRowComponentData, MessageComponent, MessageComponentType, RoleSelectMenuInteraction, StringSelectMenuInteraction, UserSelectMenuInteraction } from 'discord.js'; import { FormatOpts, FormatParams } from './Client.ts'; diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e72bfdd --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/index.ts b/index.ts index eae52ef..f35868f 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,19 @@ -// require('dotenv').config({ override: true }); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { config } from 'dotenv'; config({ override: true }); // eslint-disable-next-line no-console diff --git a/package.json b/package.json index 1e44718..15f8e85 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "url": "git+https://github.com/Navy-gif/New-GBot.git" }, "author": "Navy.gif", - "license": "ISC", + "license": "GPLv3", "bugs": { "url": "https://github.com/Navy-gif/New-GBot/issues" }, diff --git a/src/client/DiscordClient.ts b/src/client/DiscordClient.ts index e9509e8..c2a06c6 100644 --- a/src/client/DiscordClient.ts +++ b/src/client/DiscordClient.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Client, Collection, diff --git a/src/client/components/Dispatcher.ts b/src/client/components/Dispatcher.ts index 1aba5d0..01a57d7 100644 --- a/src/client/components/Dispatcher.ts +++ b/src/client/components/Dispatcher.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; import { Component, Observer } from '../interfaces/index.js'; diff --git a/src/client/components/EventHooker.ts b/src/client/components/EventHooker.ts index 7f6dc45..438a0ce 100644 --- a/src/client/components/EventHooker.ts +++ b/src/client/components/EventHooker.ts @@ -1,6 +1,18 @@ -// const { EventEmitter } = require('events'); -// const { Logger } = require('../../utilities'); -// const { InteractionWrapper } = require('./wrappers'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import EventEmitter from 'node:events'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/components/Intercom.ts b/src/client/components/Intercom.ts index deb7ef8..429d85f 100644 --- a/src/client/components/Intercom.ts +++ b/src/client/components/Intercom.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import DiscordClient from '../DiscordClient.js'; import SlashCommand from '../interfaces/commands/SlashCommand.js'; diff --git a/src/client/components/LocaleLoader.ts b/src/client/components/LocaleLoader.ts index 240460c..3e2bc3a 100644 --- a/src/client/components/LocaleLoader.ts +++ b/src/client/components/LocaleLoader.ts @@ -1,16 +1,24 @@ -// const path = require('path'); -// const fs = require('fs'); -// const chalk = require('chalk'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import path from 'node:path'; import fs from 'node:fs'; import chalk from 'chalk'; import { LoggerClient } from '@navy.gif/logger'; -// const { Util } = require('../../utilities'); -// const { Emojis } = require('../../constants/index.js'); -// const { Logger } = require('../../utilities'); - import { Util } from '../../utilities/index.js'; import { Emojis } from '../../constants/index.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/components/RateLimiter.ts b/src/client/components/RateLimiter.ts index 6c705bd..360cf60 100644 --- a/src/client/components/RateLimiter.ts +++ b/src/client/components/RateLimiter.ts @@ -1,4 +1,18 @@ -// const { TextChannel, Message } = require('discord.js'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { GuildTextBasedChannel, Message, MessageCreateOptions, TextChannel } from 'discord.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/components/Registry.ts b/src/client/components/Registry.ts index 9c2b098..b65695d 100644 --- a/src/client/components/Registry.ts +++ b/src/client/components/Registry.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import path from 'node:path'; import { Collection } from 'discord.js'; diff --git a/src/client/components/Resolver.ts b/src/client/components/Resolver.ts index 1837f1e..ddadffe 100644 --- a/src/client/components/Resolver.ts +++ b/src/client/components/Resolver.ts @@ -1,13 +1,18 @@ -// const timestring = require('@navy.gif/timestring'); -// const moment = require('moment'); -// // eslint-disable-next-line no-unused-vars -// // const { DiscordClient } = require('../DiscordClient'); -// // eslint-disable-next-line no-unused-vars -// const Component = require('../interfaces/Component'); -// const { Constants: { InfractionResolves } } = require('../../constants'); -// const { GuildWrapper } = require('./wrappers'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif -// const { Resolver: DNSResolver } = require('dns').promises; +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { Resolver as DNSResolver } from 'node:dns/promises'; diff --git a/src/client/components/commands/administration/Administration.ts b/src/client/components/commands/administration/Administration.ts index 4691518..52374cc 100644 --- a/src/client/components/commands/administration/Administration.ts +++ b/src/client/components/commands/administration/Administration.ts @@ -1,4 +1,19 @@ -// const { SettingsCommand } = require('../../../interfaces'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import DiscordClient from '../../../DiscordClient.js'; import { SettingsCommand } from '../../../interfaces/index.js'; diff --git a/src/client/components/commands/administration/Import.ts b/src/client/components/commands/administration/Import.ts index ab776e0..8d3be66 100644 --- a/src/client/components/commands/administration/Import.ts +++ b/src/client/components/commands/administration/Import.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { ReplyOptions } from '../../../../../@types/Wrappers.js'; diff --git a/src/client/components/commands/administration/Logging.ts b/src/client/components/commands/administration/Logging.ts index 73629a5..877921f 100644 --- a/src/client/components/commands/administration/Logging.ts +++ b/src/client/components/commands/administration/Logging.ts @@ -1,4 +1,18 @@ -// const { SettingsCommand } = require('../../../interfaces'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import DiscordClient from '../../../DiscordClient.js'; import { SettingsCommand } from '../../../interfaces/index.js'; diff --git a/src/client/components/commands/administration/Moderation.ts b/src/client/components/commands/administration/Moderation.ts index b43b55d..8bf5d28 100644 --- a/src/client/components/commands/administration/Moderation.ts +++ b/src/client/components/commands/administration/Moderation.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import DiscordClient from '../../../DiscordClient.js'; import { SettingsCommand } from '../../../interfaces/index.js'; diff --git a/src/client/components/commands/administration/Modstats.ts b/src/client/components/commands/administration/Modstats.ts index 1ade63f..f9734b2 100644 --- a/src/client/components/commands/administration/Modstats.ts +++ b/src/client/components/commands/administration/Modstats.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Filter } from 'mongodb'; import { CommandOptionType, CommandParams, InfractionJSON } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/administration/Permissions.ts b/src/client/components/commands/administration/Permissions.ts index 65d1dd1..6660358 100644 --- a/src/client/components/commands/administration/Permissions.ts +++ b/src/client/components/commands/administration/Permissions.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, Collection, EmbedBuilder, GuildBasedChannel, GuildMember, Role, User } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { ReplyOptions } from '../../../../../@types/Wrappers.js'; diff --git a/src/client/components/commands/administration/Settings.ts b/src/client/components/commands/administration/Settings.ts index 721cff6..1abacc3 100644 --- a/src/client/components/commands/administration/Settings.ts +++ b/src/client/components/commands/administration/Settings.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, APIEmbedField } from 'discord.js'; import { CommandOptionType } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/administration/Utility.ts b/src/client/components/commands/administration/Utility.ts index db7ccaf..b601204 100644 --- a/src/client/components/commands/administration/Utility.ts +++ b/src/client/components/commands/administration/Utility.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import DiscordClient from '../../../DiscordClient.js'; import { SettingsCommand } from '../../../interfaces/index.js'; diff --git a/src/client/components/commands/developer/Debug.ts b/src/client/components/commands/developer/Debug.ts index 6a90749..fd903d3 100644 --- a/src/client/components/commands/developer/Debug.ts +++ b/src/client/components/commands/developer/Debug.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Command } from '../../../interfaces/index.js'; diff --git a/src/client/components/commands/developer/Eval.ts b/src/client/components/commands/developer/Eval.ts index 6308f7b..c1d70ed 100644 --- a/src/client/components/commands/developer/Eval.ts +++ b/src/client/components/commands/developer/Eval.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { userInfo } from 'os'; import { Util as U, FilterUtil as FU } from '../../../../utilities/index.js'; import { inspect } from 'util'; diff --git a/src/client/components/commands/developer/Stats.ts b/src/client/components/commands/developer/Stats.ts index bc86574..d5e7098 100644 --- a/src/client/components/commands/developer/Stats.ts +++ b/src/client/components/commands/developer/Stats.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Client, TextChannel, version } from 'discord.js'; import DiscordClient from '../../../DiscordClient.js'; import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; diff --git a/src/client/components/commands/information/Commands.ts b/src/client/components/commands/information/Commands.ts index a17ba9d..31876f7 100644 --- a/src/client/components/commands/information/Commands.ts +++ b/src/client/components/commands/information/Commands.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, Collection } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/information/Guild.ts b/src/client/components/commands/information/Guild.ts index fea8dd3..b356255 100644 --- a/src/client/components/commands/information/Guild.ts +++ b/src/client/components/commands/information/Guild.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ChannelType, EmbedBuilder } from 'discord.js'; import DiscordClient from '../../../DiscordClient.js'; import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; diff --git a/src/client/components/commands/information/Help.ts b/src/client/components/commands/information/Help.ts index 2ed8784..a285a8b 100644 --- a/src/client/components/commands/information/Help.ts +++ b/src/client/components/commands/information/Help.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { EmbedBuilder } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/information/Info.ts b/src/client/components/commands/information/Info.ts index d719383..7c838f5 100644 --- a/src/client/components/commands/information/Info.ts +++ b/src/client/components/commands/information/Info.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, ActivityType, ChannelType, EmbedBuilder, GuildBasedChannel, GuildTextBasedChannel, Role, TextChannel, User } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import Emojis from '../../../../constants/Emojis.js'; diff --git a/src/client/components/commands/information/Privacy.ts b/src/client/components/commands/information/Privacy.ts index 82dd18b..af558a5 100644 --- a/src/client/components/commands/information/Privacy.ts +++ b/src/client/components/commands/information/Privacy.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { EmbedBuilder } from 'discord.js'; import DiscordClient from '../../../DiscordClient.js'; import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; diff --git a/src/client/components/commands/moderation/Ban.ts b/src/client/components/commands/moderation/Ban.ts index 087ebea..b99c9bc 100644 --- a/src/client/components/commands/moderation/Ban.ts +++ b/src/client/components/commands/moderation/Ban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Ban } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Case.ts b/src/client/components/commands/moderation/Case.ts index abea520..9a3919e 100644 --- a/src/client/components/commands/moderation/Case.ts +++ b/src/client/components/commands/moderation/Case.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/moderation/Dehoist.ts b/src/client/components/commands/moderation/Dehoist.ts index 0ebb3e6..713c0b9 100644 --- a/src/client/components/commands/moderation/Dehoist.ts +++ b/src/client/components/commands/moderation/Dehoist.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Nickname } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Edit.ts b/src/client/components/commands/moderation/Edit.ts index a1a0c2c..bd98705 100644 --- a/src/client/components/commands/moderation/Edit.ts +++ b/src/client/components/commands/moderation/Edit.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Infraction from '../../../interfaces/Infraction.js'; import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/History.ts b/src/client/components/commands/moderation/History.ts index 5c46fdd..e67a6f5 100644 --- a/src/client/components/commands/moderation/History.ts +++ b/src/client/components/commands/moderation/History.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/moderation/Kick.ts b/src/client/components/commands/moderation/Kick.ts index 151dae3..47c4c3d 100644 --- a/src/client/components/commands/moderation/Kick.ts +++ b/src/client/components/commands/moderation/Kick.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Kick } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Lockdown.ts b/src/client/components/commands/moderation/Lockdown.ts index a18e23f..844a5b0 100644 --- a/src/client/components/commands/moderation/Lockdown.ts +++ b/src/client/components/commands/moderation/Lockdown.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/Modtimers.ts b/src/client/components/commands/moderation/Modtimers.ts index 76e5c54..5ba8703 100644 --- a/src/client/components/commands/moderation/Modtimers.ts +++ b/src/client/components/commands/moderation/Modtimers.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/moderation/Mute.ts b/src/client/components/commands/moderation/Mute.ts index 8d64ceb..92e3609 100644 --- a/src/client/components/commands/moderation/Mute.ts +++ b/src/client/components/commands/moderation/Mute.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Mute } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Nickname.ts b/src/client/components/commands/moderation/Nickname.ts index 65c99e4..6348220 100644 --- a/src/client/components/commands/moderation/Nickname.ts +++ b/src/client/components/commands/moderation/Nickname.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Nickname } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Note.ts b/src/client/components/commands/moderation/Note.ts index 06148dd..906031e 100644 --- a/src/client/components/commands/moderation/Note.ts +++ b/src/client/components/commands/moderation/Note.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Note } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Prune.ts b/src/client/components/commands/moderation/Prune.ts index 1d0931c..6bcf299 100644 --- a/src/client/components/commands/moderation/Prune.ts +++ b/src/client/components/commands/moderation/Prune.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/Resolve.ts b/src/client/components/commands/moderation/Resolve.ts index 8281857..4e8d83c 100644 --- a/src/client/components/commands/moderation/Resolve.ts +++ b/src/client/components/commands/moderation/Resolve.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import Infraction from '../../../interfaces/Infraction.js'; diff --git a/src/client/components/commands/moderation/Roles.ts b/src/client/components/commands/moderation/Roles.ts index e6e0a8f..b2c67bb 100644 --- a/src/client/components/commands/moderation/Roles.ts +++ b/src/client/components/commands/moderation/Roles.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandError, ModerationCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/moderation/Slowmode.ts b/src/client/components/commands/moderation/Slowmode.ts index 26ecf49..4dc3509 100644 --- a/src/client/components/commands/moderation/Slowmode.ts +++ b/src/client/components/commands/moderation/Slowmode.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/Softban.ts b/src/client/components/commands/moderation/Softban.ts index 754c2ac..327748b 100644 --- a/src/client/components/commands/moderation/Softban.ts +++ b/src/client/components/commands/moderation/Softban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Softban } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Staff.ts b/src/client/components/commands/moderation/Staff.ts index 281c0bb..e0e3009 100644 --- a/src/client/components/commands/moderation/Staff.ts +++ b/src/client/components/commands/moderation/Staff.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/moderation/Unban.ts b/src/client/components/commands/moderation/Unban.ts index 39f67fb..95322f5 100644 --- a/src/client/components/commands/moderation/Unban.ts +++ b/src/client/components/commands/moderation/Unban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Unban } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Unlockdown.ts b/src/client/components/commands/moderation/Unlockdown.ts index 9888f1b..bb48896 100644 --- a/src/client/components/commands/moderation/Unlockdown.ts +++ b/src/client/components/commands/moderation/Unlockdown.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/Unmute.ts b/src/client/components/commands/moderation/Unmute.ts index 4290b0f..47681dd 100644 --- a/src/client/components/commands/moderation/Unmute.ts +++ b/src/client/components/commands/moderation/Unmute.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Unmute } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Unresolve.ts b/src/client/components/commands/moderation/Unresolve.ts index 06725ad..46ebc4a 100644 --- a/src/client/components/commands/moderation/Unresolve.ts +++ b/src/client/components/commands/moderation/Unresolve.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Infraction from '../../../interfaces/Infraction.js'; import SlashCommand from '../../../interfaces/commands/SlashCommand.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/commands/moderation/Vckick.ts b/src/client/components/commands/moderation/Vckick.ts index 8d3fa96..8e188c1 100644 --- a/src/client/components/commands/moderation/Vckick.ts +++ b/src/client/components/commands/moderation/Vckick.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { VcKick } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/moderation/Warn.ts b/src/client/components/commands/moderation/Warn.ts index 1b58517..5382b0f 100644 --- a/src/client/components/commands/moderation/Warn.ts +++ b/src/client/components/commands/moderation/Warn.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import DiscordClient from '../../../DiscordClient.js'; import { Warn } from '../../../infractions/index.js'; diff --git a/src/client/components/commands/utility/Avatar.ts b/src/client/components/commands/utility/Avatar.ts index a6ab676..0d2f8f0 100644 --- a/src/client/components/commands/utility/Avatar.ts +++ b/src/client/components/commands/utility/Avatar.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/utility/Grantable.ts b/src/client/components/commands/utility/Grantable.ts index 765f2c3..43755c6 100644 --- a/src/client/components/commands/utility/Grantable.ts +++ b/src/client/components/commands/utility/Grantable.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/utility/Ping.ts b/src/client/components/commands/utility/Ping.ts index 544e400..752513e 100644 --- a/src/client/components/commands/utility/Ping.ts +++ b/src/client/components/commands/utility/Ping.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/utility/Poll.ts b/src/client/components/commands/utility/Poll.ts index b45fb3e..74fd90f 100644 --- a/src/client/components/commands/utility/Poll.ts +++ b/src/client/components/commands/utility/Poll.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandError, SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/utility/Remind.ts b/src/client/components/commands/utility/Remind.ts index 52c29c5..f5f92a4 100644 --- a/src/client/components/commands/utility/Remind.ts +++ b/src/client/components/commands/utility/Remind.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/commands/utility/Selfrole.ts b/src/client/components/commands/utility/Selfrole.ts index 58652d0..3aa9d40 100644 --- a/src/client/components/commands/utility/Selfrole.ts +++ b/src/client/components/commands/utility/Selfrole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommand } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/index.ts b/src/client/components/index.ts index ac0e243..4725214 100644 --- a/src/client/components/index.ts +++ b/src/client/components/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Intercom from './Intercom.js'; import LocaleLoader from './LocaleLoader.js'; import EventHooker from './EventHooker.js'; diff --git a/src/client/components/inhibitors/ChannelIgnore.ts b/src/client/components/inhibitors/ChannelIgnore.ts index dd56b61..d29b1dc 100644 --- a/src/client/components/inhibitors/ChannelIgnore.ts +++ b/src/client/components/inhibitors/ChannelIgnore.ts @@ -1,8 +1,23 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; - class ChannelIgnore extends Inhibitor { constructor (client: DiscordClient) diff --git a/src/client/components/inhibitors/ClientPermissions.ts b/src/client/components/inhibitors/ClientPermissions.ts index 8b9f47f..5b4359e 100644 --- a/src/client/components/inhibitors/ClientPermissions.ts +++ b/src/client/components/inhibitors/ClientPermissions.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/inhibitors/Disabled.ts b/src/client/components/inhibitors/Disabled.ts index d38d6a1..fe1b143 100644 --- a/src/client/components/inhibitors/Disabled.ts +++ b/src/client/components/inhibitors/Disabled.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/inhibitors/GuildOnly.ts b/src/client/components/inhibitors/GuildOnly.ts index 9cc63a1..fd634f7 100644 --- a/src/client/components/inhibitors/GuildOnly.ts +++ b/src/client/components/inhibitors/GuildOnly.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/inhibitors/Permissions.ts b/src/client/components/inhibitors/Permissions.ts index b842a2f..9224e50 100644 --- a/src/client/components/inhibitors/Permissions.ts +++ b/src/client/components/inhibitors/Permissions.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/inhibitors/Restricted.ts b/src/client/components/inhibitors/Restricted.ts index 94fa2b8..596b8e9 100644 --- a/src/client/components/inhibitors/Restricted.ts +++ b/src/client/components/inhibitors/Restricted.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/inhibitors/Throttle.ts b/src/client/components/inhibitors/Throttle.ts index 9a4e19f..e611114 100644 --- a/src/client/components/inhibitors/Throttle.ts +++ b/src/client/components/inhibitors/Throttle.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Command, Inhibitor } from '../../interfaces/index.js'; import DiscordClient from '../../DiscordClient.js'; import { InvokerWrapper } from '../../components/wrappers/index.js'; diff --git a/src/client/components/managers/CallbackManager.ts b/src/client/components/managers/CallbackManager.ts index f167064..383aa2d 100644 --- a/src/client/components/managers/CallbackManager.ts +++ b/src/client/components/managers/CallbackManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Collection } from 'discord.js'; diff --git a/src/client/components/managers/ModerationManager.ts b/src/client/components/managers/ModerationManager.ts index 9db7c12..3d0a4a0 100644 --- a/src/client/components/managers/ModerationManager.ts +++ b/src/client/components/managers/ModerationManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { inspect } from 'node:util'; diff --git a/src/client/components/managers/PollManager.ts b/src/client/components/managers/PollManager.ts index 306153a..7b27655 100644 --- a/src/client/components/managers/PollManager.ts +++ b/src/client/components/managers/PollManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TextChannel } from 'discord.js'; import { PollData } from '../../../../@types/Guild.js'; import DiscordClient from '../../DiscordClient.js'; diff --git a/src/client/components/managers/ReminderManager.ts b/src/client/components/managers/ReminderManager.ts index 2ea0a2d..878cf97 100644 --- a/src/client/components/managers/ReminderManager.ts +++ b/src/client/components/managers/ReminderManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ReminderData } from '../../../../@types/Guild.js'; import DiscordClient from '../../DiscordClient.js'; import CallbackClient from '../../interfaces/CallbackClient.js'; diff --git a/src/client/components/observers/AuditLog.ts b/src/client/components/observers/AuditLog.ts index bdc0fff..4eaf5eb 100644 --- a/src/client/components/observers/AuditLog.ts +++ b/src/client/components/observers/AuditLog.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { AuditLogEvent, User } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import { Infraction, Observer } from '../../interfaces/index.js'; diff --git a/src/client/components/observers/Automoderation.ts b/src/client/components/observers/Automoderation.ts index 357c41f..38a9991 100644 --- a/src/client/components/observers/Automoderation.ts +++ b/src/client/components/observers/Automoderation.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, APIEmbedField, ButtonComponentData, ButtonStyle, ComponentType, Interaction, MessageCreateOptions, PermissionsString, TextChannel } from 'discord.js'; import { Ban, Kick, Mute, Softban, Warn } from '../../infractions/index.js'; import Observer from '../../interfaces/Observer.js'; diff --git a/src/client/components/observers/CommandHandler.ts b/src/client/components/observers/CommandHandler.ts index 62595a7..e2a841f 100644 --- a/src/client/components/observers/CommandHandler.ts +++ b/src/client/components/observers/CommandHandler.ts @@ -1,8 +1,18 @@ -// const { EmbedBuilder, Message, ChannelType, ComponentType, ButtonStyle } = require('discord.js'); -// const { Util } = require('../../../utilities'); -// const { InvokerWrapper, MessageWrapper } = require('../../client/wrappers'); -// const { Observer, CommandError, SettingsCommand } = require('../../interfaces/'); -// const { inspect } = require('util'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { EmbedBuilder, Message, ComponentType, ButtonStyle } from 'discord.js'; import Util from '../../../utilities/Util.js'; diff --git a/src/client/components/observers/ErrorLog.ts b/src/client/components/observers/ErrorLog.ts index edb87c2..fa1acce 100644 --- a/src/client/components/observers/ErrorLog.ts +++ b/src/client/components/observers/ErrorLog.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, GuildTextBasedChannel, TextChannel } from 'discord.js'; import { AutomodErrorProps, LinkFilterWarnProps, LogErrorProps, MissingPermsProps, UtilityErrorProps, WordWatcherErrorProps } from '../../../../@types/Moderation.js'; import Util from '../../../utilities/Util.js'; diff --git a/src/client/components/observers/GuildLogging.ts b/src/client/components/observers/GuildLogging.ts index 1ad3ba0..c5d7727 100644 --- a/src/client/components/observers/GuildLogging.ts +++ b/src/client/components/observers/GuildLogging.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, AttachmentBuilder, AuditLogEvent, Collection, GuildMember, GuildTextBasedChannel, Message, TextChannel, WebhookClient } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import Observer from '../../interfaces/Observer.js'; diff --git a/src/client/components/observers/Metrics.ts b/src/client/components/observers/Metrics.ts index 77b0618..711362a 100644 --- a/src/client/components/observers/Metrics.ts +++ b/src/client/components/observers/Metrics.ts @@ -1,4 +1,19 @@ -// const { Observer } = require('../../interfaces'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIRequest, ResponseLike } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import { Observer } from '../../interfaces/index.js'; diff --git a/src/client/components/observers/UtilityHook.ts b/src/client/components/observers/UtilityHook.ts index 01022e9..72436bf 100644 --- a/src/client/components/observers/UtilityHook.ts +++ b/src/client/components/observers/UtilityHook.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { GuildMember, MessageReaction, TextChannel, User } from 'discord.js'; import { ExtendedGuildMember, ExtendedInvite } from '../../../../@types/Client.js'; import Util from '../../../utilities/Util.js'; diff --git a/src/client/components/settings/administration/Commands.ts b/src/client/components/settings/administration/Commands.ts index 4d90ca3..938ea7a 100644 --- a/src/client/components/settings/administration/Commands.ts +++ b/src/client/components/settings/administration/Commands.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { CommandSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/administration/IgnoreChannels.ts b/src/client/components/settings/administration/IgnoreChannels.ts index a80ea59..f1f48eb 100644 --- a/src/client/components/settings/administration/IgnoreChannels.ts +++ b/src/client/components/settings/administration/IgnoreChannels.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { IgnoreSettings } from '../../../../../@types/Settings.js'; import Util from '../../../../utilities/Util.js'; diff --git a/src/client/components/settings/administration/Indexing.ts b/src/client/components/settings/administration/Indexing.ts index 509f9ab..9cbea35 100644 --- a/src/client/components/settings/administration/Indexing.ts +++ b/src/client/components/settings/administration/Indexing.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { IndexingSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/administration/PermissionType.ts b/src/client/components/settings/administration/PermissionType.ts index 5df437b..436553e 100644 --- a/src/client/components/settings/administration/PermissionType.ts +++ b/src/client/components/settings/administration/PermissionType.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandParams } from '../../../../../@types/Client.js'; import { PermissionSettings, PermissionType } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/administration/Protection.ts b/src/client/components/settings/administration/Protection.ts index 2e6e066..414ff0b 100644 --- a/src/client/components/settings/administration/Protection.ts +++ b/src/client/components/settings/administration/Protection.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, FormatParams } from '../../../../../@types/Client.js'; import { ProtectionSettings, ProtectionType } from '../../../../../@types/Settings.js'; import Util from '../../../../utilities/Util.js'; diff --git a/src/client/components/settings/administration/Silent.ts b/src/client/components/settings/administration/Silent.ts index f8b567d..560efb6 100644 --- a/src/client/components/settings/administration/Silent.ts +++ b/src/client/components/settings/administration/Silent.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { SilenceSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/administration/TextCommands.ts b/src/client/components/settings/administration/TextCommands.ts index 63f2bf6..35d8e42 100644 --- a/src/client/components/settings/administration/TextCommands.ts +++ b/src/client/components/settings/administration/TextCommands.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { TextCommandsSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/logging/DmInfraction.ts b/src/client/components/settings/logging/DmInfraction.ts index 5115208..b0d4534 100644 --- a/src/client/components/settings/logging/DmInfraction.ts +++ b/src/client/components/settings/logging/DmInfraction.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Errors.ts b/src/client/components/settings/logging/Errors.ts index bb0567b..984eaa5 100644 --- a/src/client/components/settings/logging/Errors.ts +++ b/src/client/components/settings/logging/Errors.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Members.ts b/src/client/components/settings/logging/Members.ts index 797dff5..8c3d0b3 100644 --- a/src/client/components/settings/logging/Members.ts +++ b/src/client/components/settings/logging/Members.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Messages.ts b/src/client/components/settings/logging/Messages.ts index 0045fd0..9c79131 100644 --- a/src/client/components/settings/logging/Messages.ts +++ b/src/client/components/settings/logging/Messages.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandError, Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Moderation.ts b/src/client/components/settings/logging/Moderation.ts index e69e7df..c663ab3 100644 --- a/src/client/components/settings/logging/Moderation.ts +++ b/src/client/components/settings/logging/Moderation.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Nicknames.ts b/src/client/components/settings/logging/Nicknames.ts index d1f3ad5..67023ff 100644 --- a/src/client/components/settings/logging/Nicknames.ts +++ b/src/client/components/settings/logging/Nicknames.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/logging/Voice.ts b/src/client/components/settings/logging/Voice.ts index b94e567..1fe8316 100644 --- a/src/client/components/settings/logging/Voice.ts +++ b/src/client/components/settings/logging/Voice.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/moderation/AutoModeration.ts b/src/client/components/settings/moderation/AutoModeration.ts index a068529..5900ab8 100644 --- a/src/client/components/settings/moderation/AutoModeration.ts +++ b/src/client/components/settings/moderation/AutoModeration.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, InfractionType } from '../../../../../@types/Client.js'; import { AutomodSettings } from '../../../../../@types/Settings.js'; import Util from '../../../../utilities/Util.js'; diff --git a/src/client/components/settings/moderation/Grantable.ts b/src/client/components/settings/moderation/Grantable.ts index b4a159d..556e984 100644 --- a/src/client/components/settings/moderation/Grantable.ts +++ b/src/client/components/settings/moderation/Grantable.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, FormatParams } from '../../../../../@types/Client.js'; import { GrantableSettings } from '../../../../../@types/Settings.js'; import Util from '../../../../utilities/Util.js'; diff --git a/src/client/components/settings/moderation/InviteFilter.ts b/src/client/components/settings/moderation/InviteFilter.ts index 447c482..9cc8d28 100644 --- a/src/client/components/settings/moderation/InviteFilter.ts +++ b/src/client/components/settings/moderation/InviteFilter.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, FormatParams, SettingAction, SettingMethod } from '../../../../../@types/Client.js'; import { InviteFilterSettings } from '../../../../../@types/Settings.js'; import { ZeroWidthChar } from '../../../../constants/Constants.js'; diff --git a/src/client/components/settings/moderation/LinkFilter.ts b/src/client/components/settings/moderation/LinkFilter.ts index 581a978..534fbf3 100644 --- a/src/client/components/settings/moderation/LinkFilter.ts +++ b/src/client/components/settings/moderation/LinkFilter.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, FormatParams, SettingAction, SettingMethod } from '../../../../../@types/Client.js'; import { LinkfilterSettings } from '../../../../../@types/Settings.js'; import FilterPresets from '../../../../constants/FilterPresets.js'; diff --git a/src/client/components/settings/moderation/MentionFilter.ts b/src/client/components/settings/moderation/MentionFilter.ts index a9844f9..d382ecb 100644 --- a/src/client/components/settings/moderation/MentionFilter.ts +++ b/src/client/components/settings/moderation/MentionFilter.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Role, TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams, FormatParams, SettingAction, SettingMethod } from '../../../../../@types/Client.js'; import { MentionFilterSettings } from '../../../../../@types/Settings.js'; diff --git a/src/client/components/settings/moderation/ModerationPoints.ts b/src/client/components/settings/moderation/ModerationPoints.ts index 3ddd30e..546598b 100644 --- a/src/client/components/settings/moderation/ModerationPoints.ts +++ b/src/client/components/settings/moderation/ModerationPoints.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, InfractionType } from '../../../../../@types/Client.js'; import { ModerationPointsSettings } from '../../../../../@types/Settings.js'; import { ZeroWidthChar } from '../../../../constants/Constants.js'; diff --git a/src/client/components/settings/moderation/Mute.ts b/src/client/components/settings/moderation/Mute.ts index 0f9aa6f..c3f6d8f 100644 --- a/src/client/components/settings/moderation/Mute.ts +++ b/src/client/components/settings/moderation/Mute.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { APIEmbed, ChannelType, ComponentType, OverwriteType, Role, TextChannel } from 'discord.js'; import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { MuteSettings } from '../../../../../@types/Settings.js'; diff --git a/src/client/components/settings/moderation/Raidprotection.ts b/src/client/components/settings/moderation/Raidprotection.ts index 0ede793..b4ff7ba 100644 --- a/src/client/components/settings/moderation/Raidprotection.ts +++ b/src/client/components/settings/moderation/Raidprotection.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { RaidprotectionSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/moderation/Staff.ts b/src/client/components/settings/moderation/Staff.ts index 913ab01..11155b4 100644 --- a/src/client/components/settings/moderation/Staff.ts +++ b/src/client/components/settings/moderation/Staff.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams } from '../../../../../@types/Client.js'; import { StaffSettings } from '../../../../../@types/Settings.js'; import DiscordClient from '../../../DiscordClient.js'; diff --git a/src/client/components/settings/moderation/WordFilter.ts b/src/client/components/settings/moderation/WordFilter.ts index 7524b42..1081a5a 100644 --- a/src/client/components/settings/moderation/WordFilter.ts +++ b/src/client/components/settings/moderation/WordFilter.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, FilterSettingHelperResponse, SettingAction, SettingMethod } from '../../../../../@types/Client.js'; import { WordFilterSettings } from '../../../../../@types/Settings.js'; import { ZeroWidthChar } from '../../../../constants/Constants.js'; diff --git a/src/client/components/settings/moderation/WordWatcher.ts b/src/client/components/settings/moderation/WordWatcher.ts index b83d0dd..d83e7dc 100644 --- a/src/client/components/settings/moderation/WordWatcher.ts +++ b/src/client/components/settings/moderation/WordWatcher.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CommandOptionType, CommandParams, SettingAction, SettingMethod } from '../../../../../@types/Client.js'; import { WordWatcherSettings } from '../../../../../@types/Settings.js'; import { ZeroWidthChar } from '../../../../constants/Constants.js'; diff --git a/src/client/components/settings/utility/Autorole.ts b/src/client/components/settings/utility/Autorole.ts index df3538a..0be2dd0 100644 --- a/src/client/components/settings/utility/Autorole.ts +++ b/src/client/components/settings/utility/Autorole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/utility/Selfrole.ts b/src/client/components/settings/utility/Selfrole.ts index 29fee2e..c99dc7b 100644 --- a/src/client/components/settings/utility/Selfrole.ts +++ b/src/client/components/settings/utility/Selfrole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/utility/StickyRole.ts b/src/client/components/settings/utility/StickyRole.ts index d5becea..3a94e62 100644 --- a/src/client/components/settings/utility/StickyRole.ts +++ b/src/client/components/settings/utility/StickyRole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/settings/utility/Welcomer.ts b/src/client/components/settings/utility/Welcomer.ts index ea31765..a2ff181 100644 --- a/src/client/components/settings/utility/Welcomer.ts +++ b/src/client/components/settings/utility/Welcomer.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Setting } from '../../../interfaces/index.js'; import DiscordClient from '../../../DiscordClient.js'; import InvokerWrapper from '../../wrappers/InvokerWrapper.js'; diff --git a/src/client/components/wrappers/GuildWrapper.ts b/src/client/components/wrappers/GuildWrapper.ts index cdbec0b..30474d1 100644 --- a/src/client/components/wrappers/GuildWrapper.ts +++ b/src/client/components/wrappers/GuildWrapper.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ChannelResolveable, FormatOpts, FormatParams, MemberResolveable, UserResolveable } from '../../../../@types/Client.js'; import { ChannelJSON, @@ -158,7 +174,7 @@ class GuildWrapper { await this.#client.mongodb.guilds.updateOne({ guildId: this.id }, { $set: { _version: configVersion, ...data } }); this.#data = { ...this.#data, ...data, _version: configVersion }; - this.#storageLog(`Database update: Data (guild:${this.id})`); + this.#storageLog('Database update: Data'); } catch (error) { @@ -374,7 +390,7 @@ class GuildWrapper #storageLog (log: string) { - this.#logger.debug(log); + this.debug(log); } #storageError (error: Error) diff --git a/src/client/components/wrappers/InteractionWrapper.ts b/src/client/components/wrappers/InteractionWrapper.ts index c1fe7ea..a2d99d7 100644 --- a/src/client/components/wrappers/InteractionWrapper.ts +++ b/src/client/components/wrappers/InteractionWrapper.ts @@ -1,6 +1,18 @@ -// const { Guild, InteractionType, ApplicationCommandOptionType } = require('discord.js'); -// const { EmbedDefaultColor } = require('../../../constants/Constants.js'); -// const GuildWrapper = require('./GuildWrapper.js'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { InteractionType, diff --git a/src/client/components/wrappers/InvokerWrapper.ts b/src/client/components/wrappers/InvokerWrapper.ts index d7b15c4..a916b9b 100644 --- a/src/client/components/wrappers/InvokerWrapper.ts +++ b/src/client/components/wrappers/InvokerWrapper.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { EmbedBuilder, ComponentType, Message, InteractionResponse, InteractionDeferReplyOptions, If, GuildMember, Interaction } from 'discord.js'; import { Emojis, Constants } from '../../../constants/index.js'; import MessageWrapper from './MessageWrapper.js'; diff --git a/src/client/components/wrappers/MemberWrapper.ts b/src/client/components/wrappers/MemberWrapper.ts index 09b0a9e..3bab6e6 100644 --- a/src/client/components/wrappers/MemberWrapper.ts +++ b/src/client/components/wrappers/MemberWrapper.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { GuildMember, ImageURLOptions, MessageCreateOptions, MessagePayload } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import UserWrapper from './UserWrapper.js'; diff --git a/src/client/components/wrappers/MessageWrapper.ts b/src/client/components/wrappers/MessageWrapper.ts index 57c6b1f..f714cbf 100644 --- a/src/client/components/wrappers/MessageWrapper.ts +++ b/src/client/components/wrappers/MessageWrapper.ts @@ -1,5 +1,19 @@ -// eslint-disable-next-line no-unused-vars -// const GuildWrapper = require("./GuildWrapper"); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { AwaitReactionsOptions, Collection, EmojiIdentifierResolvable, GuildMember, If, Message, MessageEditOptions, MessageReaction, MessageReplyOptions, Snowflake } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import GuildWrapper from './GuildWrapper.js'; diff --git a/src/client/components/wrappers/UserWrapper.ts b/src/client/components/wrappers/UserWrapper.ts index e188f32..cc3bdb1 100644 --- a/src/client/components/wrappers/UserWrapper.ts +++ b/src/client/components/wrappers/UserWrapper.ts @@ -1,11 +1,24 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { ImageURLOptions, MessageCreateOptions, MessagePayload, User } from 'discord.js'; import DiscordClient from '../../DiscordClient.js'; import { UserSettings } from '../../../../@types/Settings.js'; -// import GuildWrapper from './GuildWrapper.js'; import { LoggerClient } from '@navy.gif/logger'; -// type Expiry = {points: number, expiration: number, id: string} - class UserWrapper { #client: DiscordClient; diff --git a/src/client/components/wrappers/index.ts b/src/client/components/wrappers/index.ts index a450eb1..dcdd369 100644 --- a/src/client/components/wrappers/index.ts +++ b/src/client/components/wrappers/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import GuildWrapper from './GuildWrapper.js'; import InteractionWrapper from './InteractionWrapper.js'; import UserWrapper from './UserWrapper.js'; diff --git a/src/client/infractions/Addrole.ts b/src/client/infractions/Addrole.ts index a2f1801..b7290bf 100644 --- a/src/client/infractions/Addrole.ts +++ b/src/client/infractions/Addrole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index 746cd9a..ff9304e 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { InfractionJSON, InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Kick.ts b/src/client/infractions/Kick.ts index 601a22f..689d30a 100644 --- a/src/client/infractions/Kick.ts +++ b/src/client/infractions/Kick.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Lockdown.ts b/src/client/infractions/Lockdown.ts index b73f39c..c43f90e 100644 --- a/src/client/infractions/Lockdown.ts +++ b/src/client/infractions/Lockdown.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Mute.ts b/src/client/infractions/Mute.ts index 7d73193..4b9c91d 100644 --- a/src/client/infractions/Mute.ts +++ b/src/client/infractions/Mute.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { InfractionJSON, InfractionTargetType, InfractionType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Nickname.ts b/src/client/infractions/Nickname.ts index 1da2c2b..7f21505 100644 --- a/src/client/infractions/Nickname.ts +++ b/src/client/infractions/Nickname.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import escapeRegex from 'escape-string-regexp'; import { LoggerClient } from '@navy.gif/logger'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Note.ts b/src/client/infractions/Note.ts index 17d6141..018b87f 100644 --- a/src/client/infractions/Note.ts +++ b/src/client/infractions/Note.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import DiscordClient from '../DiscordClient.js'; import { Infraction } from '../interfaces/index.js'; diff --git a/src/client/infractions/Prune.ts b/src/client/infractions/Prune.ts index 54b2011..e2f9a5e 100644 --- a/src/client/infractions/Prune.ts +++ b/src/client/infractions/Prune.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* eslint-disable @typescript-eslint/no-shadow */ import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Removerole.ts b/src/client/infractions/Removerole.ts index 94e5f63..02c97b6 100644 --- a/src/client/infractions/Removerole.ts +++ b/src/client/infractions/Removerole.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/Slowmode.ts b/src/client/infractions/Slowmode.ts index efec2f6..82b118e 100644 --- a/src/client/infractions/Slowmode.ts +++ b/src/client/infractions/Slowmode.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/Softban.ts b/src/client/infractions/Softban.ts index d8c55d3..3822ac5 100644 --- a/src/client/infractions/Softban.ts +++ b/src/client/infractions/Softban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/Unban.ts b/src/client/infractions/Unban.ts index 9c65a73..e3d0127 100644 --- a/src/client/infractions/Unban.ts +++ b/src/client/infractions/Unban.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/Unlockdown.ts b/src/client/infractions/Unlockdown.ts index 633002c..74fcb44 100644 --- a/src/client/infractions/Unlockdown.ts +++ b/src/client/infractions/Unlockdown.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/Unmute.ts b/src/client/infractions/Unmute.ts index 6365d61..bda0ebc 100644 --- a/src/client/infractions/Unmute.ts +++ b/src/client/infractions/Unmute.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Role, Snowflake } from 'discord.js'; import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/infractions/Vckick.ts b/src/client/infractions/Vckick.ts index 9e58818..d1b0f1e 100644 --- a/src/client/infractions/Vckick.ts +++ b/src/client/infractions/Vckick.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import DiscordClient from '../DiscordClient.js'; import { Infraction } from '../interfaces/index.js'; diff --git a/src/client/infractions/Warn.ts b/src/client/infractions/Warn.ts index d5fef20..aef70f0 100644 --- a/src/client/infractions/Warn.ts +++ b/src/client/infractions/Warn.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Infraction } from '../interfaces/index.js'; import DiscordClient from '../DiscordClient.js'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/infractions/index.ts b/src/client/infractions/index.ts index 380f153..fef0d5c 100644 --- a/src/client/infractions/index.ts +++ b/src/client/infractions/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Addrole from './Addrole.js'; import Ban from './Ban.js'; import Kick from './Kick.js'; diff --git a/src/client/interfaces/CallbackClient.ts b/src/client/interfaces/CallbackClient.ts index f056524..71d1e89 100644 --- a/src/client/interfaces/CallbackClient.ts +++ b/src/client/interfaces/CallbackClient.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + interface CallbackClient { handleCallback(id: string, payload: unknown): Promise | void; diff --git a/src/client/interfaces/CommandError.ts b/src/client/interfaces/CommandError.ts index f91d6fc..b4c73dd 100644 --- a/src/client/interfaces/CommandError.ts +++ b/src/client/interfaces/CommandError.ts @@ -1,5 +1,19 @@ -// eslint-disable-next-line no-unused-vars -// const InteractionWrapper = require("../client/wrappers/InteractionWrapper"); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { InvokerWrapper } from '../components/wrappers/index.js'; import Command from './commands/Command.js'; diff --git a/src/client/interfaces/CommandOption.ts b/src/client/interfaces/CommandOption.ts index 2219c7a..8a3ab7d 100644 --- a/src/client/interfaces/CommandOption.ts +++ b/src/client/interfaces/CommandOption.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* eslint-disable camelcase */ import { Util } from '../../utilities/index.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/interfaces/Component.ts b/src/client/interfaces/Component.ts index 64e3fde..7432640 100644 --- a/src/client/interfaces/Component.ts +++ b/src/client/interfaces/Component.ts @@ -1,5 +1,18 @@ -// eslint-disable-next-line no-unused-vars -// const { DiscordClient } = require("../DiscordClient"); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { ComponentOptions, ComponentType } from '../../../@types/Client.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/interfaces/FilterSetting.ts b/src/client/interfaces/FilterSetting.ts index e34dc4c..8bd8c9f 100644 --- a/src/client/interfaces/FilterSetting.ts +++ b/src/client/interfaces/FilterSetting.ts @@ -1,7 +1,18 @@ -// const Setting = require('./Setting.js'); -// const { Util } = require('../../utilities'); -// const { inspect } = require('util'); -// const { EmbedDefaultColor, ZeroWidthChar } = require('../../constants/Constants.js'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { inspect } from 'node:util'; import Setting from './Setting.js'; diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index 76254ef..c5f9e3c 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { inspect } from 'node:util'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/interfaces/Inhibitor.ts b/src/client/interfaces/Inhibitor.ts index 4b8c3a2..8e2a96f 100644 --- a/src/client/interfaces/Inhibitor.ts +++ b/src/client/interfaces/Inhibitor.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { FormatParams, InhibitorOptions, InhibitorResponse } from '../../../@types/Client.js'; import Util from '../../utilities/Util.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/interfaces/Initialisable.ts b/src/client/interfaces/Initialisable.ts index c9f6b9e..d0d3f59 100644 --- a/src/client/interfaces/Initialisable.ts +++ b/src/client/interfaces/Initialisable.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + // eslint-disable-next-line @typescript-eslint/no-explicit-any const isInitialisable = (obj: any): obj is Initialisable => { diff --git a/src/client/interfaces/Module.ts b/src/client/interfaces/Module.ts index 9c4d83e..dace393 100644 --- a/src/client/interfaces/Module.ts +++ b/src/client/interfaces/Module.ts @@ -1,3 +1,18 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import { Collection } from 'discord.js'; import Component from './Component.js'; @@ -5,11 +20,6 @@ import DiscordClient from '../DiscordClient.js'; import { Util } from '../../utilities/index.js'; import { ModuleOptions } from '../../../@types/Client.js'; -// declare interface Module extends Component -// { -// get type(): 'module' -// } - class Module extends Component { #name: string; diff --git a/src/client/interfaces/Observer.ts b/src/client/interfaces/Observer.ts index 413e23e..e8d289b 100644 --- a/src/client/interfaces/Observer.ts +++ b/src/client/interfaces/Observer.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Hooks, ObserverOptions } from '../../../@types/Client.js'; import { Util } from '../../utilities/index.js'; import DiscordClient from '../DiscordClient.js'; diff --git a/src/client/interfaces/Setting.ts b/src/client/interfaces/Setting.ts index c47c00c..56b1639 100644 --- a/src/client/interfaces/Setting.ts +++ b/src/client/interfaces/Setting.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Component from './Component.js'; import { EmbedBuilder, PermissionsString, TextChannel, APIEmbed, APIEmbedField, User, If } from 'discord.js'; diff --git a/src/client/interfaces/commands/Command.ts b/src/client/interfaces/commands/Command.ts index ea84074..e5903e7 100644 --- a/src/client/interfaces/commands/Command.ts +++ b/src/client/interfaces/commands/Command.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import { EmbedBuilder, Message, PermissionsString, Snowflake } from 'discord.js'; import Component from '../Component.js'; diff --git a/src/client/interfaces/commands/ModerationCommand.ts b/src/client/interfaces/commands/ModerationCommand.ts index 476db82..714ba3a 100644 --- a/src/client/interfaces/commands/ModerationCommand.ts +++ b/src/client/interfaces/commands/ModerationCommand.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* eslint-disable max-depth */ import SlashCommand from './SlashCommand.js'; import DiscordClient from '../../DiscordClient.js'; diff --git a/src/client/interfaces/commands/SettingsCommand.ts b/src/client/interfaces/commands/SettingsCommand.ts index f7c8c2b..48b2039 100644 --- a/src/client/interfaces/commands/SettingsCommand.ts +++ b/src/client/interfaces/commands/SettingsCommand.ts @@ -1,4 +1,19 @@ -// const { SlashCommand, CommandOption } = require("../index.js"); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import SlashCommand from './SlashCommand.js'; import CommandOption from '../CommandOption.js'; import { Util } from '../../../utilities/index.js'; diff --git a/src/client/interfaces/commands/SlashCommand.ts b/src/client/interfaces/commands/SlashCommand.ts index 824e80a..740f767 100644 --- a/src/client/interfaces/commands/SlashCommand.ts +++ b/src/client/interfaces/commands/SlashCommand.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { SlashCommandOptions } from '../../../../@types/Client.js'; import DiscordClient from '../../DiscordClient.js'; import Command from './Command.js'; diff --git a/src/client/interfaces/index.ts b/src/client/interfaces/index.ts index e92dcfd..cfaf795 100644 --- a/src/client/interfaces/index.ts +++ b/src/client/interfaces/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Infraction from './Infraction.js'; import Component from './Component.js'; import Command from './commands/Command.js'; diff --git a/src/client/storage/StorageManager.ts b/src/client/storage/StorageManager.ts index df3f42e..8963528 100644 --- a/src/client/storage/StorageManager.ts +++ b/src/client/storage/StorageManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import path from 'node:path'; import fs from 'node:fs'; @@ -64,20 +80,6 @@ class StorageManager return `${instance.provider.name.substring(0, 5)}:${instance.name}`; } - // _error (info, instance = null) - // { - // // TODO: Change logging string to remove [STORA] - // // this.client.logger.error(`${chalk.bold(`[STORA]`)} ${instance ? `(${this._getName(instance)}) ` : ''}${info}`); - // this.logger.error(`${instance ? `(${this._getName(instance)}) ` : ''}${info}`); - // } - - // _log (info, instance = null) - // { - // // TODO: Change logging string to remove [STORA] - // // this.client.logger.info(`${chalk.bold(`[STORA]`)} ${instance ? `(${this._getName(instance)}) ` : ''}${info}`); - // this.#logger.info(`${instance ? `(${this._getName(instance)}) ` : ''}${info}`); - // } - get rootDir () { return this.#client.rootDir; diff --git a/src/client/storage/interfaces/MariadbTable.ts b/src/client/storage/interfaces/MariadbTable.ts index 3b10e09..b10fccd 100644 --- a/src/client/storage/interfaces/MariadbTable.ts +++ b/src/client/storage/interfaces/MariadbTable.ts @@ -1,5 +1,19 @@ -// import { MariaDBTableOptions } from '../../../@types/Storage'; -// import Provider from './Provider'; +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Table from './Table.js'; class MariadbTable extends Table diff --git a/src/client/storage/interfaces/MongodbTable.ts b/src/client/storage/interfaces/MongodbTable.ts index f0790f5..0fc9ed5 100644 --- a/src/client/storage/interfaces/MongodbTable.ts +++ b/src/client/storage/interfaces/MongodbTable.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { AggregateOptions, BulkWriteOptions, @@ -15,6 +31,8 @@ import { } from 'mongodb'; import Table from './Table.js'; + +const ObjIdReg = /[a-z0-9]{24}/u; class MongodbTable extends Table { // constructor (provider: Provider, opts: MongoDBTableOptions) @@ -154,7 +172,7 @@ class MongodbTable extends Table { // Convert data._id to Mongo ObjectIds if ('_id' in query && !(query._id instanceof ObjectId)) { - if (typeof query._id === 'string' && query._id.length === 24) + if (typeof query._id === 'string' && ObjIdReg.test(query._id)) { try { diff --git a/src/client/storage/interfaces/Provider.ts b/src/client/storage/interfaces/Provider.ts index d30b388..f3531d6 100644 --- a/src/client/storage/interfaces/Provider.ts +++ b/src/client/storage/interfaces/Provider.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import path from 'node:path'; import { LoggerClient } from '@navy.gif/logger'; diff --git a/src/client/storage/interfaces/Table.ts b/src/client/storage/interfaces/Table.ts index 7b4fecd..6ed7550 100644 --- a/src/client/storage/interfaces/Table.ts +++ b/src/client/storage/interfaces/Table.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { TableOptions } from '../../../../@types/Storage.js'; import Provider from './Provider.js'; diff --git a/src/client/storage/interfaces/index.ts b/src/client/storage/interfaces/index.ts index 8a7c49e..ea82380 100644 --- a/src/client/storage/interfaces/index.ts +++ b/src/client/storage/interfaces/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Provider from './Provider.js'; import MongodbTable from './MongodbTable.js'; import MariadbTable from './MariadbTable.js'; diff --git a/src/client/storage/providers/MariaDBProvider.ts b/src/client/storage/providers/MariaDBProvider.ts index 5e5a90c..15b681c 100644 --- a/src/client/storage/providers/MariaDBProvider.ts +++ b/src/client/storage/providers/MariaDBProvider.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { inspect } from 'node:util'; import { Credentials, MariaDBOptions, MariaError } from '../../../../@types/Storage.js'; import DiscordClient from '../../DiscordClient.js'; diff --git a/src/client/storage/providers/MongoDBProvider.ts b/src/client/storage/providers/MongoDBProvider.ts index 3816c08..c1f5d6a 100644 --- a/src/client/storage/providers/MongoDBProvider.ts +++ b/src/client/storage/providers/MongoDBProvider.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { CallbackInfo } from '../../../../@types/CallbackManager.js'; import { InfractionJSON } from '../../../../@types/Client.js'; import { AttachmentData, GuildData, GuildPermissions, MessageLogEntry, RoleCacheEntry, WebhookEntry, WordWatcherEntry } from '../../../../@types/Guild.js'; diff --git a/src/client/storage/tables/mariadb/Activity.ts b/src/client/storage/tables/mariadb/Activity.ts index 460ee44..3c51fa0 100644 --- a/src/client/storage/tables/mariadb/Activity.ts +++ b/src/client/storage/tables/mariadb/Activity.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import MariadbTable from '../../interfaces/MariadbTable.js'; import MariaDBProvider from '../../providers/MariaDBProvider.js'; diff --git a/src/client/storage/tables/mongodb/Infractions.ts b/src/client/storage/tables/mongodb/Infractions.ts index 8532c10..dd1010a 100644 --- a/src/client/storage/tables/mongodb/Infractions.ts +++ b/src/client/storage/tables/mongodb/Infractions.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { MongodbTable, Provider } from '../../interfaces/index.js'; class InfractionsTable extends MongodbTable diff --git a/src/constants/Commands.ts b/src/constants/Commands.ts index a48cce1..e0c1568 100644 --- a/src/constants/Commands.ts +++ b/src/constants/Commands.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const Commands = { "ApplicationCommandTypes": { "CHAT_INPUT": 1, diff --git a/src/constants/Constants.ts b/src/constants/Constants.ts index c1b065c..ff1f2ef 100644 --- a/src/constants/Constants.ts +++ b/src/constants/Constants.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { InfractionType } from "../../@types/Client.js"; const ZeroWidthChar = '\u200b'; diff --git a/src/constants/Emojis.ts b/src/constants/Emojis.ts index 6444bef..e2fd680 100644 --- a/src/constants/Emojis.ts +++ b/src/constants/Emojis.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const Emojis: {[key: string]: string} = { "success": "<:success:723595130808041512>", "failure": "<:failure:723595130912637018>", diff --git a/src/constants/FilterPresets.ts b/src/constants/FilterPresets.ts index 49738c9..4f2e53b 100644 --- a/src/constants/FilterPresets.ts +++ b/src/constants/FilterPresets.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const FilterPresets: { regex: { [key: string]: string[] diff --git a/src/constants/KillItWithFire.ts b/src/constants/KillItWithFire.ts index 96bb520..500ab63 100644 --- a/src/constants/KillItWithFire.ts +++ b/src/constants/KillItWithFire.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const KIWF = { "0": "0|⓪|₀|⁰|𝟢|𝟘|0|𝟎|𝟬|𝟶", "1": "⑴|➀|❶|⓵|①|₁|¹|𝟣|𝟙|1|𝟏|𝟭|𝟷", diff --git a/src/constants/defaults/DefaultGuild.ts b/src/constants/defaults/DefaultGuild.ts index 92b67e8..75322a9 100644 --- a/src/constants/defaults/DefaultGuild.ts +++ b/src/constants/defaults/DefaultGuild.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const DefaultGuild = { } diff --git a/src/constants/defaults/DefaultUser.ts b/src/constants/defaults/DefaultUser.ts index ef276d5..7853d16 100644 --- a/src/constants/defaults/DefaultUser.ts +++ b/src/constants/defaults/DefaultUser.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + const DefaultUser = {} export default DefaultUser \ No newline at end of file diff --git a/src/constants/index.ts b/src/constants/index.ts index 58bf58f..b91c371 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import * as Constants from './Constants.js'; import FilterPresets from './FilterPresets.js'; import Emojis from './Emojis.js'; diff --git a/src/middleware/ClientUtils.ts b/src/middleware/ClientUtils.ts index d0c22a4..e9fdaae 100644 --- a/src/middleware/ClientUtils.ts +++ b/src/middleware/ClientUtils.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { Util } from '../utilities/index.js'; type Cache = { diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index 849c3ce..ec4902a 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { EventEmitter } from 'node:events'; diff --git a/src/middleware/Metrics.ts b/src/middleware/Metrics.ts index 90d1596..d7104c7 100644 --- a/src/middleware/Metrics.ts +++ b/src/middleware/Metrics.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import BaseClient from './Controller.js'; import os from 'node:os'; import Shard from './Shard.js'; diff --git a/src/middleware/Shard.ts b/src/middleware/Shard.ts index ee1343a..7aeb234 100644 --- a/src/middleware/Shard.ts +++ b/src/middleware/Shard.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import EventEmitter from 'node:events'; import path from 'node:path'; import childProcess, { ChildProcess } from 'node:child_process'; diff --git a/src/middleware/SlashCommandManager.ts b/src/middleware/SlashCommandManager.ts index 9d0e041..de3118c 100644 --- a/src/middleware/SlashCommandManager.ts +++ b/src/middleware/SlashCommandManager.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { REST } from '@discordjs/rest'; import { Routes } from 'discord-api-types/v9'; import hash from 'object-hash'; diff --git a/src/utilities/BinaryTree.ts b/src/utilities/BinaryTree.ts index 9c9eb2d..1fda5a1 100644 --- a/src/utilities/BinaryTree.ts +++ b/src/utilities/BinaryTree.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* eslint-disable max-classes-per-file */ import { LoggerClient } from '@navy.gif/logger'; import DiscordClient from '../client/DiscordClient.js'; diff --git a/src/utilities/FilterUtil.ts b/src/utilities/FilterUtil.ts index 9a3af19..1aec39a 100644 --- a/src/utilities/FilterUtil.ts +++ b/src/utilities/FilterUtil.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import similarity from 'similarity'; import fs from 'node:fs'; import path from 'node:path'; diff --git a/src/utilities/InfractionMigrator.ts b/src/utilities/InfractionMigrator.ts index 0f1fb46..061a9ff 100644 --- a/src/utilities/InfractionMigrator.ts +++ b/src/utilities/InfractionMigrator.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { LoggerClient } from '@navy.gif/logger'; import MongoDB, { MongoConfig } from './SimpleMongoWrapper.js'; import DiscordClient from '../client/DiscordClient.js'; diff --git a/src/utilities/SettingsMigrator.ts b/src/utilities/SettingsMigrator.ts index 665370f..848acd8 100644 --- a/src/utilities/SettingsMigrator.ts +++ b/src/utilities/SettingsMigrator.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + /* eslint-disable no-undefined */ import { LoggerClient } from '@navy.gif/logger'; import DiscordClient from '../client/DiscordClient.js'; diff --git a/src/utilities/SimpleMongoWrapper.ts b/src/utilities/SimpleMongoWrapper.ts index bff71a0..b2c4f4e 100644 --- a/src/utilities/SimpleMongoWrapper.ts +++ b/src/utilities/SimpleMongoWrapper.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + // Doesn't replace any of the storage related db management, just a utility class to help with settings migration import { Db, DbStatsOptions, MongoClient } from 'mongodb'; diff --git a/src/utilities/Util.ts b/src/utilities/Util.ts index efc6ed9..33c49ce 100644 --- a/src/utilities/Util.ts +++ b/src/utilities/Util.ts @@ -1,9 +1,18 @@ -// const moment = require('moment'); -// const humaniseDuration = require('humanize-duration'); -// const path = require('path'); -// const fs = require('fs'); -// const fetch = require('node-fetch'); -// const { escapeMarkdown } = require('discord.js'); +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . import moment from 'moment'; import humaniseDuration from 'humanize-duration'; diff --git a/src/utilities/index.ts b/src/utilities/index.ts index a06e7a7..686691a 100644 --- a/src/utilities/index.ts +++ b/src/utilities/index.ts @@ -1,3 +1,19 @@ +// Galactic - Discord moderation bot +// Copyright (C) 2024 Navy.gif + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import Util from './Util.js'; import FilterUtil from './FilterUtil.js'; -- 2.45.2 From 2c4c4702b416b898fcbc1f4bef6089aa04b19bb2 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 19 Jul 2024 21:29:55 +0300 Subject: [PATCH 09/14] upgrade yarn --- .yarn/releases/yarn-3.6.0.cjs | 874 --------------------------------- .yarn/releases/yarn-4.3.1.cjs | 894 ++++++++++++++++++++++++++++++++++ .yarnrc.yml | 4 +- package.json | 2 +- 4 files changed, 898 insertions(+), 876 deletions(-) delete mode 100644 .yarn/releases/yarn-3.6.0.cjs create mode 100644 .yarn/releases/yarn-4.3.1.cjs diff --git a/.yarn/releases/yarn-3.6.0.cjs b/.yarn/releases/yarn-3.6.0.cjs deleted file mode 100644 index a688ef2..0000000 --- a/.yarn/releases/yarn-3.6.0.cjs +++ /dev/null @@ -1,874 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -//prettier-ignore -(()=>{var xge=Object.create;var lS=Object.defineProperty;var Pge=Object.getOwnPropertyDescriptor;var Dge=Object.getOwnPropertyNames;var kge=Object.getPrototypeOf,Rge=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var Fge=(r,e)=>()=>(r&&(e=r(r=0)),e);var w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ut=(r,e)=>{for(var t in e)lS(r,t,{get:e[t],enumerable:!0})},Nge=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Dge(e))!Rge.call(r,n)&&n!==t&&lS(r,n,{get:()=>e[n],enumerable:!(i=Pge(e,n))||i.enumerable});return r};var Pe=(r,e,t)=>(t=r!=null?xge(kge(r)):{},Nge(e||!r||!r.__esModule?lS(t,"default",{value:r,enumerable:!0}):t,r));var vK=w((J7e,SK)=>{SK.exports=bK;bK.sync=tfe;var BK=J("fs");function efe(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i{kK.exports=PK;PK.sync=rfe;var xK=J("fs");function PK(r,e,t){xK.stat(r,function(i,n){t(i,i?!1:DK(n,e))})}function rfe(r,e){return DK(xK.statSync(r),e)}function DK(r,e){return r.isFile()&&ife(r,e)}function ife(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var NK=w((V7e,FK)=>{var z7e=J("fs"),lI;process.platform==="win32"||global.TESTING_WINDOWS?lI=vK():lI=RK();FK.exports=SS;SS.sync=nfe;function SS(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){SS(r,e||{},function(s,o){s?n(s):i(o)})})}lI(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function nfe(r,e){try{return lI.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var HK=w((X7e,UK)=>{var Dg=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",TK=J("path"),sfe=Dg?";":":",LK=NK(),OK=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),MK=(r,e)=>{let t=e.colon||sfe,i=r.match(/\//)||Dg&&r.match(/\\/)?[""]:[...Dg?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Dg?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Dg?n.split(t):[""];return Dg&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},KK=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=MK(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(OK(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=TK.join(h,r),C=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(C,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];LK(c+p,{pathExt:s},(C,y)=>{if(!C&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},ofe=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=MK(r,e),s=[];for(let o=0;o{"use strict";var GK=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};vS.exports=GK;vS.exports.default=GK});var WK=w((_7e,JK)=>{"use strict";var jK=J("path"),afe=HK(),Afe=YK();function qK(r,e){let t=r.options.env||process.env,i=process.cwd(),n=r.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch{}let o;try{o=afe.sync(r.command,{path:t[Afe({env:t})],pathExt:e?jK.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=jK.resolve(n?r.options.cwd:"",o)),o}function lfe(r){return qK(r)||qK(r,!0)}JK.exports=lfe});var zK=w(($7e,PS)=>{"use strict";var xS=/([()\][%!^"`<>&|;, *?])/g;function cfe(r){return r=r.replace(xS,"^$1"),r}function ufe(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(xS,"^$1"),e&&(r=r.replace(xS,"^$1")),r}PS.exports.command=cfe;PS.exports.argument=ufe});var XK=w((eZe,VK)=>{"use strict";VK.exports=/^#!(.*)/});var _K=w((tZe,ZK)=>{"use strict";var gfe=XK();ZK.exports=(r="")=>{let e=r.match(gfe);if(!e)return null;let[t,i]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var eU=w((rZe,$K)=>{"use strict";var DS=J("fs"),ffe=_K();function hfe(r){let t=Buffer.alloc(150),i;try{i=DS.openSync(r,"r"),DS.readSync(i,t,0,150,0),DS.closeSync(i)}catch{}return ffe(t.toString())}$K.exports=hfe});var nU=w((iZe,iU)=>{"use strict";var pfe=J("path"),tU=WK(),rU=zK(),dfe=eU(),Cfe=process.platform==="win32",mfe=/\.(?:com|exe)$/i,Efe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ife(r){r.file=tU(r);let e=r.file&&dfe(r.file);return e?(r.args.unshift(r.file),r.command=e,tU(r)):r.file}function yfe(r){if(!Cfe)return r;let e=Ife(r),t=!mfe.test(e);if(r.options.forceShell||t){let i=Efe.test(e);r.command=pfe.normalize(r.command),r.command=rU.command(r.command),r.args=r.args.map(s=>rU.argument(s,i));let n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function wfe(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let i={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?i:yfe(i)}iU.exports=wfe});var aU=w((nZe,oU)=>{"use strict";var kS=process.platform==="win32";function RS(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Bfe(r,e){if(!kS)return;let t=r.emit;r.emit=function(i,n){if(i==="exit"){let s=sU(n,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function sU(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawn"):null}function Qfe(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawnSync"):null}oU.exports={hookChildProcess:Bfe,verifyENOENT:sU,verifyENOENTSync:Qfe,notFoundError:RS}});var TS=w((sZe,kg)=>{"use strict";var AU=J("child_process"),FS=nU(),NS=aU();function lU(r,e,t){let i=FS(r,e,t),n=AU.spawn(i.command,i.args,i.options);return NS.hookChildProcess(n,i),n}function bfe(r,e,t){let i=FS(r,e,t),n=AU.spawnSync(i.command,i.args,i.options);return n.error=n.error||NS.verifyENOENTSync(n.status,i),n}kg.exports=lU;kg.exports.spawn=lU;kg.exports.sync=bfe;kg.exports._parse=FS;kg.exports._enoent=NS});var uU=w((oZe,cU)=>{"use strict";function Sfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function Zl(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Zl)}Sfe(Zl,Error);Zl.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g>",ie=me(">>",!1),de=">&",_e=me(">&",!1),Pt=">",It=me(">",!1),Or="<<<",ii=me("<<<",!1),gi="<&",hr=me("<&",!1),fi="<",ni=me("<",!1),Ks=function(m){return{type:"argument",segments:[].concat(...m)}},pr=function(m){return m},Ii="$'",rs=me("$'",!1),fa="'",CA=me("'",!1),cg=function(m){return[{type:"text",text:m}]},is='""',mA=me('""',!1),ha=function(){return{type:"text",text:""}},wp='"',EA=me('"',!1),IA=function(m){return m},wr=function(m){return{type:"arithmetic",arithmetic:m,quoted:!0}},Tl=function(m){return{type:"shell",shell:m,quoted:!0}},ug=function(m){return{type:"variable",...m,quoted:!0}},Io=function(m){return{type:"text",text:m}},gg=function(m){return{type:"arithmetic",arithmetic:m,quoted:!1}},Bp=function(m){return{type:"shell",shell:m,quoted:!1}},Qp=function(m){return{type:"variable",...m,quoted:!1}},vr=function(m){return{type:"glob",pattern:m}},se=/^[^']/,yo=Je(["'"],!0,!1),Fn=function(m){return m.join("")},fg=/^[^$"]/,Qt=Je(["$",'"'],!0,!1),Ll=`\\ -`,Nn=me(`\\ -`,!1),ns=function(){return""},ss="\\",gt=me("\\",!1),wo=/^[\\$"`]/,At=Je(["\\","$",'"',"`"],!1,!1),ln=function(m){return m},S="\\a",Lt=me("\\a",!1),hg=function(){return"a"},Ol="\\b",bp=me("\\b",!1),Sp=function(){return"\b"},vp=/^[Ee]/,xp=Je(["E","e"],!1,!1),Pp=function(){return"\x1B"},G="\\f",yt=me("\\f",!1),yA=function(){return"\f"},zi="\\n",Ml=me("\\n",!1),Xe=function(){return` -`},pa="\\r",pg=me("\\r",!1),OE=function(){return"\r"},Dp="\\t",ME=me("\\t",!1),ar=function(){return" "},Tn="\\v",Kl=me("\\v",!1),kp=function(){return"\v"},Us=/^[\\'"?]/,da=Je(["\\","'",'"',"?"],!1,!1),cn=function(m){return String.fromCharCode(parseInt(m,16))},Le="\\x",dg=me("\\x",!1),Ul="\\u",Hs=me("\\u",!1),Hl="\\U",wA=me("\\U",!1),Cg=function(m){return String.fromCodePoint(parseInt(m,16))},mg=/^[0-7]/,Ca=Je([["0","7"]],!1,!1),ma=/^[0-9a-fA-f]/,rt=Je([["0","9"],["a","f"],["A","f"]],!1,!1),Bo=nt(),BA="-",Gl=me("-",!1),Gs="+",Yl=me("+",!1),KE=".",Rp=me(".",!1),Eg=function(m,b,N){return{type:"number",value:(m==="-"?-1:1)*parseFloat(b.join("")+"."+N.join(""))}},Fp=function(m,b){return{type:"number",value:(m==="-"?-1:1)*parseInt(b.join(""))}},UE=function(m){return{type:"variable",...m}},jl=function(m){return{type:"variable",name:m}},HE=function(m){return m},Ig="*",QA=me("*",!1),Rr="/",GE=me("/",!1),Ys=function(m,b,N){return{type:b==="*"?"multiplication":"division",right:N}},js=function(m,b){return b.reduce((N,U)=>({left:N,...U}),m)},yg=function(m,b,N){return{type:b==="+"?"addition":"subtraction",right:N}},bA="$((",R=me("$((",!1),q="))",Ce=me("))",!1),Ke=function(m){return m},Re="$(",ze=me("$(",!1),dt=function(m){return m},Ft="${",Ln=me("${",!1),Jb=":-",P1=me(":-",!1),D1=function(m,b){return{name:m,defaultValue:b}},Wb=":-}",k1=me(":-}",!1),R1=function(m){return{name:m,defaultValue:[]}},zb=":+",F1=me(":+",!1),N1=function(m,b){return{name:m,alternativeValue:b}},Vb=":+}",T1=me(":+}",!1),L1=function(m){return{name:m,alternativeValue:[]}},Xb=function(m){return{name:m}},O1="$",M1=me("$",!1),K1=function(m){return e.isGlobPattern(m)},U1=function(m){return m},Zb=/^[a-zA-Z0-9_]/,_b=Je([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),$b=function(){return L()},eS=/^[$@*?#a-zA-Z0-9_\-]/,tS=Je(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),H1=/^[(){}<>$|&; \t"']/,wg=Je(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),rS=/^[<>&; \t"']/,iS=Je(["<",">","&",";"," "," ",'"',"'"],!1,!1),YE=/^[ \t]/,jE=Je([" "," "],!1,!1),Q=0,Me=0,SA=[{line:1,column:1}],d=0,E=[],I=0,k;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function L(){return r.substring(Me,Q)}function Z(){return Et(Me,Q)}function te(m,b){throw b=b!==void 0?b:Et(Me,Q),Ri([lt(m)],r.substring(Me,Q),b)}function we(m,b){throw b=b!==void 0?b:Et(Me,Q),On(m,b)}function me(m,b){return{type:"literal",text:m,ignoreCase:b}}function Je(m,b,N){return{type:"class",parts:m,inverted:b,ignoreCase:N}}function nt(){return{type:"any"}}function wt(){return{type:"end"}}function lt(m){return{type:"other",description:m}}function it(m){var b=SA[m],N;if(b)return b;for(N=m-1;!SA[N];)N--;for(b=SA[N],b={line:b.line,column:b.column};Nd&&(d=Q,E=[]),E.push(m))}function On(m,b){return new Zl(m,null,null,b)}function Ri(m,b,N){return new Zl(Zl.buildMessage(m,b),m,b,N)}function vA(){var m,b;return m=Q,b=Mr(),b===t&&(b=null),b!==t&&(Me=m,b=s(b)),m=b,m}function Mr(){var m,b,N,U,ce;if(m=Q,b=Kr(),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();N!==t?(U=Ea(),U!==t?(ce=os(),ce===t&&(ce=null),ce!==t?(Me=m,b=o(b,U,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;if(m===t)if(m=Q,b=Kr(),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();N!==t?(U=Ea(),U===t&&(U=null),U!==t?(Me=m,b=a(b,U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;return m}function os(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=Mr(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=l(N),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;return m}function Ea(){var m;return r.charCodeAt(Q)===59?(m=c,Q++):(m=t,I===0&&Qe(u)),m===t&&(r.charCodeAt(Q)===38?(m=g,Q++):(m=t,I===0&&Qe(f))),m}function Kr(){var m,b,N;return m=Q,b=G1(),b!==t?(N=uge(),N===t&&(N=null),N!==t?(Me=m,b=h(b,N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function uge(){var m,b,N,U,ce,Se,ht;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=gge(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Kr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=p(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;return m}function gge(){var m;return r.substr(Q,2)===C?(m=C,Q+=2):(m=t,I===0&&Qe(y)),m===t&&(r.substr(Q,2)===B?(m=B,Q+=2):(m=t,I===0&&Qe(v))),m}function G1(){var m,b,N;return m=Q,b=pge(),b!==t?(N=fge(),N===t&&(N=null),N!==t?(Me=m,b=D(b,N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function fge(){var m,b,N,U,ce,Se,ht;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=hge(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=G1(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=T(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;return m}function hge(){var m;return r.substr(Q,2)===H?(m=H,Q+=2):(m=t,I===0&&Qe(j)),m===t&&(r.charCodeAt(Q)===124?(m=$,Q++):(m=t,I===0&&Qe(V))),m}function qE(){var m,b,N,U,ce,Se;if(m=Q,b=eK(),b!==t)if(r.charCodeAt(Q)===61?(N=W,Q++):(N=t,I===0&&Qe(_)),N!==t)if(U=q1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(Me=m,b=A(b,U),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;else Q=m,m=t;if(m===t)if(m=Q,b=eK(),b!==t)if(r.charCodeAt(Q)===61?(N=W,Q++):(N=t,I===0&&Qe(_)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=Ae(b),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;return m}function pge(){var m,b,N,U,ce,Se,ht,Bt,Jr,hi,as;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(r.charCodeAt(Q)===40?(N=ge,Q++):(N=t,I===0&&Qe(re)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Mr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();if(Se!==t)if(r.charCodeAt(Q)===41?(ht=O,Q++):(ht=t,I===0&&Qe(F)),ht!==t){for(Bt=[],Jr=He();Jr!==t;)Bt.push(Jr),Jr=He();if(Bt!==t){for(Jr=[],hi=Np();hi!==t;)Jr.push(hi),hi=Np();if(Jr!==t){for(hi=[],as=He();as!==t;)hi.push(as),as=He();hi!==t?(Me=m,b=ue(ce,Jr),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(r.charCodeAt(Q)===123?(N=pe,Q++):(N=t,I===0&&Qe(ke)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Mr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();if(Se!==t)if(r.charCodeAt(Q)===125?(ht=Fe,Q++):(ht=t,I===0&&Qe(Ne)),ht!==t){for(Bt=[],Jr=He();Jr!==t;)Bt.push(Jr),Jr=He();if(Bt!==t){for(Jr=[],hi=Np();hi!==t;)Jr.push(hi),hi=Np();if(Jr!==t){for(hi=[],as=He();as!==t;)hi.push(as),as=He();hi!==t?(Me=m,b=oe(ce,Jr),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){for(N=[],U=qE();U!==t;)N.push(U),U=qE();if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t){if(ce=[],Se=j1(),Se!==t)for(;Se!==t;)ce.push(Se),Se=j1();else ce=t;if(ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=le(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){if(N=[],U=qE(),U!==t)for(;U!==t;)N.push(U),U=qE();else N=t;if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=Be(N),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}}}return m}function Y1(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){if(N=[],U=JE(),U!==t)for(;U!==t;)N.push(U),U=JE();else N=t;if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=fe(N),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t;return m}function j1(){var m,b,N;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t?(N=Np(),N!==t?(Me=m,b=ae(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();b!==t?(N=JE(),N!==t?(Me=m,b=ae(N),m=b):(Q=m,m=t)):(Q=m,m=t)}return m}function Np(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();return b!==t?(qe.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(ne)),N===t&&(N=null),N!==t?(U=dge(),U!==t?(ce=JE(),ce!==t?(Me=m,b=Y(N,U,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function dge(){var m;return r.substr(Q,2)===he?(m=he,Q+=2):(m=t,I===0&&Qe(ie)),m===t&&(r.substr(Q,2)===de?(m=de,Q+=2):(m=t,I===0&&Qe(_e)),m===t&&(r.charCodeAt(Q)===62?(m=Pt,Q++):(m=t,I===0&&Qe(It)),m===t&&(r.substr(Q,3)===Or?(m=Or,Q+=3):(m=t,I===0&&Qe(ii)),m===t&&(r.substr(Q,2)===gi?(m=gi,Q+=2):(m=t,I===0&&Qe(hr)),m===t&&(r.charCodeAt(Q)===60?(m=fi,Q++):(m=t,I===0&&Qe(ni))))))),m}function JE(){var m,b,N;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();return b!==t?(N=q1(),N!==t?(Me=m,b=ae(N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function q1(){var m,b,N;if(m=Q,b=[],N=J1(),N!==t)for(;N!==t;)b.push(N),N=J1();else b=t;return b!==t&&(Me=m,b=Ks(b)),m=b,m}function J1(){var m,b;return m=Q,b=Cge(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=mge(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=Ege(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=Ige(),b!==t&&(Me=m,b=pr(b)),m=b))),m}function Cge(){var m,b,N,U;return m=Q,r.substr(Q,2)===Ii?(b=Ii,Q+=2):(b=t,I===0&&Qe(rs)),b!==t?(N=Bge(),N!==t?(r.charCodeAt(Q)===39?(U=fa,Q++):(U=t,I===0&&Qe(CA)),U!==t?(Me=m,b=cg(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function mge(){var m,b,N,U;return m=Q,r.charCodeAt(Q)===39?(b=fa,Q++):(b=t,I===0&&Qe(CA)),b!==t?(N=yge(),N!==t?(r.charCodeAt(Q)===39?(U=fa,Q++):(U=t,I===0&&Qe(CA)),U!==t?(Me=m,b=cg(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function Ege(){var m,b,N,U;if(m=Q,r.substr(Q,2)===is?(b=is,Q+=2):(b=t,I===0&&Qe(mA)),b!==t&&(Me=m,b=ha()),m=b,m===t)if(m=Q,r.charCodeAt(Q)===34?(b=wp,Q++):(b=t,I===0&&Qe(EA)),b!==t){for(N=[],U=W1();U!==t;)N.push(U),U=W1();N!==t?(r.charCodeAt(Q)===34?(U=wp,Q++):(U=t,I===0&&Qe(EA)),U!==t?(Me=m,b=IA(N),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;return m}function Ige(){var m,b,N;if(m=Q,b=[],N=z1(),N!==t)for(;N!==t;)b.push(N),N=z1();else b=t;return b!==t&&(Me=m,b=IA(b)),m=b,m}function W1(){var m,b;return m=Q,b=_1(),b!==t&&(Me=m,b=wr(b)),m=b,m===t&&(m=Q,b=$1(),b!==t&&(Me=m,b=Tl(b)),m=b,m===t&&(m=Q,b=aS(),b!==t&&(Me=m,b=ug(b)),m=b,m===t&&(m=Q,b=wge(),b!==t&&(Me=m,b=Io(b)),m=b))),m}function z1(){var m,b;return m=Q,b=_1(),b!==t&&(Me=m,b=gg(b)),m=b,m===t&&(m=Q,b=$1(),b!==t&&(Me=m,b=Bp(b)),m=b,m===t&&(m=Q,b=aS(),b!==t&&(Me=m,b=Qp(b)),m=b,m===t&&(m=Q,b=Sge(),b!==t&&(Me=m,b=vr(b)),m=b,m===t&&(m=Q,b=bge(),b!==t&&(Me=m,b=Io(b)),m=b)))),m}function yge(){var m,b,N;for(m=Q,b=[],se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo));N!==t;)b.push(N),se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo));return b!==t&&(Me=m,b=Fn(b)),m=b,m}function wge(){var m,b,N;if(m=Q,b=[],N=V1(),N===t&&(fg.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Qt))),N!==t)for(;N!==t;)b.push(N),N=V1(),N===t&&(fg.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Qt)));else b=t;return b!==t&&(Me=m,b=Fn(b)),m=b,m}function V1(){var m,b,N;return m=Q,r.substr(Q,2)===Ll?(b=Ll,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t&&(Me=m,b=ns()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=ss,Q++):(b=t,I===0&&Qe(gt)),b!==t?(wo.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(At)),N!==t?(Me=m,b=ln(N),m=b):(Q=m,m=t)):(Q=m,m=t)),m}function Bge(){var m,b,N;for(m=Q,b=[],N=X1(),N===t&&(se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo)));N!==t;)b.push(N),N=X1(),N===t&&(se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo)));return b!==t&&(Me=m,b=Fn(b)),m=b,m}function X1(){var m,b,N;return m=Q,r.substr(Q,2)===S?(b=S,Q+=2):(b=t,I===0&&Qe(Lt)),b!==t&&(Me=m,b=hg()),m=b,m===t&&(m=Q,r.substr(Q,2)===Ol?(b=Ol,Q+=2):(b=t,I===0&&Qe(bp)),b!==t&&(Me=m,b=Sp()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=ss,Q++):(b=t,I===0&&Qe(gt)),b!==t?(vp.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(xp)),N!==t?(Me=m,b=Pp(),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===G?(b=G,Q+=2):(b=t,I===0&&Qe(yt)),b!==t&&(Me=m,b=yA()),m=b,m===t&&(m=Q,r.substr(Q,2)===zi?(b=zi,Q+=2):(b=t,I===0&&Qe(Ml)),b!==t&&(Me=m,b=Xe()),m=b,m===t&&(m=Q,r.substr(Q,2)===pa?(b=pa,Q+=2):(b=t,I===0&&Qe(pg)),b!==t&&(Me=m,b=OE()),m=b,m===t&&(m=Q,r.substr(Q,2)===Dp?(b=Dp,Q+=2):(b=t,I===0&&Qe(ME)),b!==t&&(Me=m,b=ar()),m=b,m===t&&(m=Q,r.substr(Q,2)===Tn?(b=Tn,Q+=2):(b=t,I===0&&Qe(Kl)),b!==t&&(Me=m,b=kp()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=ss,Q++):(b=t,I===0&&Qe(gt)),b!==t?(Us.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(da)),N!==t?(Me=m,b=ln(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Qge()))))))))),m}function Qge(){var m,b,N,U,ce,Se,ht,Bt,Jr,hi,as,AS;return m=Q,r.charCodeAt(Q)===92?(b=ss,Q++):(b=t,I===0&&Qe(gt)),b!==t?(N=nS(),N!==t?(Me=m,b=cn(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Le?(b=Le,Q+=2):(b=t,I===0&&Qe(dg)),b!==t?(N=Q,U=Q,ce=nS(),ce!==t?(Se=Mn(),Se!==t?(ce=[ce,Se],U=ce):(Q=U,U=t)):(Q=U,U=t),U===t&&(U=nS()),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=cn(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ul?(b=Ul,Q+=2):(b=t,I===0&&Qe(Hs)),b!==t?(N=Q,U=Q,ce=Mn(),ce!==t?(Se=Mn(),Se!==t?(ht=Mn(),ht!==t?(Bt=Mn(),Bt!==t?(ce=[ce,Se,ht,Bt],U=ce):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=cn(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Hl?(b=Hl,Q+=2):(b=t,I===0&&Qe(wA)),b!==t?(N=Q,U=Q,ce=Mn(),ce!==t?(Se=Mn(),Se!==t?(ht=Mn(),ht!==t?(Bt=Mn(),Bt!==t?(Jr=Mn(),Jr!==t?(hi=Mn(),hi!==t?(as=Mn(),as!==t?(AS=Mn(),AS!==t?(ce=[ce,Se,ht,Bt,Jr,hi,as,AS],U=ce):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=Cg(N),m=b):(Q=m,m=t)):(Q=m,m=t)))),m}function nS(){var m;return mg.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(Ca)),m}function Mn(){var m;return ma.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(rt)),m}function bge(){var m,b,N,U,ce;if(m=Q,b=[],N=Q,r.charCodeAt(Q)===92?(U=ss,Q++):(U=t,I===0&&Qe(gt)),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N===t&&(N=Q,U=Q,I++,ce=tK(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t)),N!==t)for(;N!==t;)b.push(N),N=Q,r.charCodeAt(Q)===92?(U=ss,Q++):(U=t,I===0&&Qe(gt)),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N===t&&(N=Q,U=Q,I++,ce=tK(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t));else b=t;return b!==t&&(Me=m,b=Fn(b)),m=b,m}function sS(){var m,b,N,U,ce,Se;if(m=Q,r.charCodeAt(Q)===45?(b=BA,Q++):(b=t,I===0&&Qe(Gl)),b===t&&(r.charCodeAt(Q)===43?(b=Gs,Q++):(b=t,I===0&&Qe(Yl))),b===t&&(b=null),b!==t){if(N=[],qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne)),U!==t)for(;U!==t;)N.push(U),qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne));else N=t;if(N!==t)if(r.charCodeAt(Q)===46?(U=KE,Q++):(U=t,I===0&&Qe(Rp)),U!==t){if(ce=[],qe.test(r.charAt(Q))?(Se=r.charAt(Q),Q++):(Se=t,I===0&&Qe(ne)),Se!==t)for(;Se!==t;)ce.push(Se),qe.test(r.charAt(Q))?(Se=r.charAt(Q),Q++):(Se=t,I===0&&Qe(ne));else ce=t;ce!==t?(Me=m,b=Eg(b,N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;if(m===t){if(m=Q,r.charCodeAt(Q)===45?(b=BA,Q++):(b=t,I===0&&Qe(Gl)),b===t&&(r.charCodeAt(Q)===43?(b=Gs,Q++):(b=t,I===0&&Qe(Yl))),b===t&&(b=null),b!==t){if(N=[],qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne)),U!==t)for(;U!==t;)N.push(U),qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne));else N=t;N!==t?(Me=m,b=Fp(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;if(m===t&&(m=Q,b=aS(),b!==t&&(Me=m,b=UE(b)),m=b,m===t&&(m=Q,b=ql(),b!==t&&(Me=m,b=jl(b)),m=b,m===t)))if(m=Q,r.charCodeAt(Q)===40?(b=ge,Q++):(b=t,I===0&&Qe(re)),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();if(N!==t)if(U=Z1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(r.charCodeAt(Q)===41?(Se=O,Q++):(Se=t,I===0&&Qe(F)),Se!==t?(Me=m,b=HE(U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t}return m}function oS(){var m,b,N,U,ce,Se,ht,Bt;if(m=Q,b=sS(),b!==t){for(N=[],U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===42?(Se=Ig,Q++):(Se=t,I===0&&Qe(QA)),Se===t&&(r.charCodeAt(Q)===47?(Se=Rr,Q++):(Se=t,I===0&&Qe(GE))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=sS(),Bt!==t?(Me=U,ce=Ys(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t;for(;U!==t;){for(N.push(U),U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===42?(Se=Ig,Q++):(Se=t,I===0&&Qe(QA)),Se===t&&(r.charCodeAt(Q)===47?(Se=Rr,Q++):(Se=t,I===0&&Qe(GE))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=sS(),Bt!==t?(Me=U,ce=Ys(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t}N!==t?(Me=m,b=js(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;return m}function Z1(){var m,b,N,U,ce,Se,ht,Bt;if(m=Q,b=oS(),b!==t){for(N=[],U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===43?(Se=Gs,Q++):(Se=t,I===0&&Qe(Yl)),Se===t&&(r.charCodeAt(Q)===45?(Se=BA,Q++):(Se=t,I===0&&Qe(Gl))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=oS(),Bt!==t?(Me=U,ce=yg(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t;for(;U!==t;){for(N.push(U),U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===43?(Se=Gs,Q++):(Se=t,I===0&&Qe(Yl)),Se===t&&(r.charCodeAt(Q)===45?(Se=BA,Q++):(Se=t,I===0&&Qe(Gl))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=oS(),Bt!==t?(Me=U,ce=yg(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t}N!==t?(Me=m,b=js(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;return m}function _1(){var m,b,N,U,ce,Se;if(m=Q,r.substr(Q,3)===bA?(b=bA,Q+=3):(b=t,I===0&&Qe(R)),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();if(N!==t)if(U=Z1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(r.substr(Q,2)===q?(Se=q,Q+=2):(Se=t,I===0&&Qe(Ce)),Se!==t?(Me=m,b=Ke(U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;return m}function $1(){var m,b,N,U;return m=Q,r.substr(Q,2)===Re?(b=Re,Q+=2):(b=t,I===0&&Qe(ze)),b!==t?(N=Mr(),N!==t?(r.charCodeAt(Q)===41?(U=O,Q++):(U=t,I===0&&Qe(F)),U!==t?(Me=m,b=dt(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function aS(){var m,b,N,U,ce,Se;return m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Ln)),b!==t?(N=ql(),N!==t?(r.substr(Q,2)===Jb?(U=Jb,Q+=2):(U=t,I===0&&Qe(P1)),U!==t?(ce=Y1(),ce!==t?(r.charCodeAt(Q)===125?(Se=Fe,Q++):(Se=t,I===0&&Qe(Ne)),Se!==t?(Me=m,b=D1(N,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Ln)),b!==t?(N=ql(),N!==t?(r.substr(Q,3)===Wb?(U=Wb,Q+=3):(U=t,I===0&&Qe(k1)),U!==t?(Me=m,b=R1(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Ln)),b!==t?(N=ql(),N!==t?(r.substr(Q,2)===zb?(U=zb,Q+=2):(U=t,I===0&&Qe(F1)),U!==t?(ce=Y1(),ce!==t?(r.charCodeAt(Q)===125?(Se=Fe,Q++):(Se=t,I===0&&Qe(Ne)),Se!==t?(Me=m,b=N1(N,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Ln)),b!==t?(N=ql(),N!==t?(r.substr(Q,3)===Vb?(U=Vb,Q+=3):(U=t,I===0&&Qe(T1)),U!==t?(Me=m,b=L1(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Ln)),b!==t?(N=ql(),N!==t?(r.charCodeAt(Q)===125?(U=Fe,Q++):(U=t,I===0&&Qe(Ne)),U!==t?(Me=m,b=Xb(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.charCodeAt(Q)===36?(b=O1,Q++):(b=t,I===0&&Qe(M1)),b!==t?(N=ql(),N!==t?(Me=m,b=Xb(N),m=b):(Q=m,m=t)):(Q=m,m=t)))))),m}function Sge(){var m,b,N;return m=Q,b=vge(),b!==t?(Me=Q,N=K1(b),N?N=void 0:N=t,N!==t?(Me=m,b=U1(b),m=b):(Q=m,m=t)):(Q=m,m=t),m}function vge(){var m,b,N,U,ce;if(m=Q,b=[],N=Q,U=Q,I++,ce=rK(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N!==t)for(;N!==t;)b.push(N),N=Q,U=Q,I++,ce=rK(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=ln(ce),N=U):(Q=N,N=t)):(Q=N,N=t);else b=t;return b!==t&&(Me=m,b=Fn(b)),m=b,m}function eK(){var m,b,N;if(m=Q,b=[],Zb.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(_b)),N!==t)for(;N!==t;)b.push(N),Zb.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(_b));else b=t;return b!==t&&(Me=m,b=$b()),m=b,m}function ql(){var m,b,N;if(m=Q,b=[],eS.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(tS)),N!==t)for(;N!==t;)b.push(N),eS.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(tS));else b=t;return b!==t&&(Me=m,b=$b()),m=b,m}function tK(){var m;return H1.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(wg)),m}function rK(){var m;return rS.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(iS)),m}function He(){var m,b;if(m=[],YE.test(r.charAt(Q))?(b=r.charAt(Q),Q++):(b=t,I===0&&Qe(jE)),b!==t)for(;b!==t;)m.push(b),YE.test(r.charAt(Q))?(b=r.charAt(Q),Q++):(b=t,I===0&&Qe(jE));else m=t;return m}if(k=n(),k!==t&&Q===r.length)return k;throw k!==t&&Q{"use strict";function xfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function $l(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$l)}xfe($l,Error);$l.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;gH&&(H=v,j=[]),j.push(ne))}function Ne(ne,Y){return new $l(ne,null,null,Y)}function oe(ne,Y,he){return new $l($l.buildMessage(ne,Y),ne,Y,he)}function le(){var ne,Y,he,ie;return ne=v,Y=Be(),Y!==t?(r.charCodeAt(v)===47?(he=s,v++):(he=t,$===0&&Fe(o)),he!==t?(ie=Be(),ie!==t?(D=ne,Y=a(Y,ie),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=Be(),Y!==t&&(D=ne,Y=l(Y)),ne=Y),ne}function Be(){var ne,Y,he,ie;return ne=v,Y=fe(),Y!==t?(r.charCodeAt(v)===64?(he=c,v++):(he=t,$===0&&Fe(u)),he!==t?(ie=qe(),ie!==t?(D=ne,Y=g(Y,ie),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=fe(),Y!==t&&(D=ne,Y=f(Y)),ne=Y),ne}function fe(){var ne,Y,he,ie,de;return ne=v,r.charCodeAt(v)===64?(Y=c,v++):(Y=t,$===0&&Fe(u)),Y!==t?(he=ae(),he!==t?(r.charCodeAt(v)===47?(ie=s,v++):(ie=t,$===0&&Fe(o)),ie!==t?(de=ae(),de!==t?(D=ne,Y=h(),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=ae(),Y!==t&&(D=ne,Y=h()),ne=Y),ne}function ae(){var ne,Y,he;if(ne=v,Y=[],p.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Fe(C)),he!==t)for(;he!==t;)Y.push(he),p.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Fe(C));else Y=t;return Y!==t&&(D=ne,Y=h()),ne=Y,ne}function qe(){var ne,Y,he;if(ne=v,Y=[],y.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Fe(B)),he!==t)for(;he!==t;)Y.push(he),y.test(r.charAt(v))?(he=r.charAt(v),v++):(he=t,$===0&&Fe(B));else Y=t;return Y!==t&&(D=ne,Y=h()),ne=Y,ne}if(V=n(),V!==t&&v===r.length)return V;throw V!==t&&v{"use strict";function dU(r){return typeof r>"u"||r===null}function Dfe(r){return typeof r=="object"&&r!==null}function kfe(r){return Array.isArray(r)?r:dU(r)?[]:[r]}function Rfe(r,e){var t,i,n,s;if(e)for(s=Object.keys(e),t=0,i=s.length;t{"use strict";function Vp(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Vp.prototype=Object.create(Error.prototype);Vp.prototype.constructor=Vp;Vp.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};CU.exports=Vp});var IU=w((QZe,EU)=>{"use strict";var mU=tc();function HS(r,e,t,i,n){this.name=r,this.buffer=e,this.position=t,this.line=i,this.column=n}HS.prototype.getSnippet=function(e,t){var i,n,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,i="",n=this.position;n>0&&`\0\r -\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;ot/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),mU.repeat(" ",e)+i+a+s+` -`+mU.repeat(" ",e+this.position-n+i.length)+"^"};HS.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`: -`+t)),i};EU.exports=HS});var si=w((bZe,wU)=>{"use strict";var yU=Ng(),Tfe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Lfe=["scalar","sequence","mapping"];function Ofe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function Mfe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(Tfe.indexOf(t)===-1)throw new yU('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=Ofe(e.styleAliases||null),Lfe.indexOf(this.kind)===-1)throw new yU('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}wU.exports=Mfe});var rc=w((SZe,QU)=>{"use strict";var BU=tc(),dI=Ng(),Kfe=si();function GS(r,e,t){var i=[];return r.include.forEach(function(n){t=GS(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function Ufe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e{"use strict";var Hfe=si();bU.exports=new Hfe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var xU=w((xZe,vU)=>{"use strict";var Gfe=si();vU.exports=new Gfe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var DU=w((PZe,PU)=>{"use strict";var Yfe=si();PU.exports=new Yfe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var CI=w((DZe,kU)=>{"use strict";var jfe=rc();kU.exports=new jfe({explicit:[SU(),xU(),DU()]})});var FU=w((kZe,RU)=>{"use strict";var qfe=si();function Jfe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function Wfe(){return null}function zfe(r){return r===null}RU.exports=new qfe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Jfe,construct:Wfe,predicate:zfe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var TU=w((RZe,NU)=>{"use strict";var Vfe=si();function Xfe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Zfe(r){return r==="true"||r==="True"||r==="TRUE"}function _fe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}NU.exports=new Vfe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Xfe,construct:Zfe,predicate:_fe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"})});var OU=w((FZe,LU)=>{"use strict";var $fe=tc(),ehe=si();function the(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function rhe(r){return 48<=r&&r<=55}function ihe(r){return 48<=r&&r<=57}function nhe(r){if(r===null)return!1;var e=r.length,t=0,i=!1,n;if(!e)return!1;if(n=r[t],(n==="-"||n==="+")&&(n=r[++t]),n==="0"){if(t+1===e)return!0;if(n=r[++t],n==="b"){for(t++;t=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0"+r.toString(8):"-0"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var UU=w((NZe,KU)=>{"use strict";var MU=tc(),ahe=si(),Ahe=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function lhe(r){return!(r===null||!Ahe.test(r)||r[r.length-1]==="_")}function che(r){var e,t,i,n;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,n=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(s){n.unshift(parseFloat(s,10))}),e=0,i=1,n.forEach(function(s){e+=s*i,i*=60}),t*e):t*parseFloat(e,10)}var uhe=/^[-+]?[0-9]+e/;function ghe(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(MU.isNegativeZero(r))return"-0.0";return t=r.toString(10),uhe.test(t)?t.replace("e",".e"):t}function fhe(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||MU.isNegativeZero(r))}KU.exports=new ahe("tag:yaml.org,2002:float",{kind:"scalar",resolve:lhe,construct:che,predicate:fhe,represent:ghe,defaultStyle:"lowercase"})});var YS=w((TZe,HU)=>{"use strict";var hhe=rc();HU.exports=new hhe({include:[CI()],implicit:[FU(),TU(),OU(),UU()]})});var jS=w((LZe,GU)=>{"use strict";var phe=rc();GU.exports=new phe({include:[YS()]})});var JU=w((OZe,qU)=>{"use strict";var dhe=si(),YU=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),jU=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Che(r){return r===null?!1:YU.exec(r)!==null||jU.exec(r)!==null}function mhe(r){var e,t,i,n,s,o,a,l=0,c=null,u,g,f;if(e=YU.exec(r),e===null&&(e=jU.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(t,i,n));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],g=+(e[11]||0),c=(u*60+g)*6e4,e[9]==="-"&&(c=-c)),f=new Date(Date.UTC(t,i,n,s,o,a,l)),c&&f.setTime(f.getTime()-c),f}function Ehe(r){return r.toISOString()}qU.exports=new dhe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Che,construct:mhe,instanceOf:Date,represent:Ehe})});var zU=w((MZe,WU)=>{"use strict";var Ihe=si();function yhe(r){return r==="<<"||r===null}WU.exports=new Ihe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:yhe})});var ZU=w((KZe,XU)=>{"use strict";var ic;try{VU=J,ic=VU("buffer").Buffer}catch{}var VU,whe=si(),qS=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function Bhe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=qS;for(t=0;t64)){if(e<0)return!1;i+=6}return i%8===0}function Qhe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=qS,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),ic?ic.from?ic.from(a):new ic(a):a}function bhe(r){var e="",t=0,i,n,s=r.length,o=qS;for(i=0;i>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function She(r){return ic&&ic.isBuffer(r)}XU.exports=new whe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Bhe,construct:Qhe,predicate:She,represent:bhe})});var $U=w((HZe,_U)=>{"use strict";var vhe=si(),xhe=Object.prototype.hasOwnProperty,Phe=Object.prototype.toString;function Dhe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t{"use strict";var Rhe=si(),Fhe=Object.prototype.toString;function Nhe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e{"use strict";var Lhe=si(),Ohe=Object.prototype.hasOwnProperty;function Mhe(r){if(r===null)return!0;var e,t=r;for(e in t)if(Ohe.call(t,e)&&t[e]!==null)return!1;return!0}function Khe(r){return r!==null?r:{}}r2.exports=new Lhe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Mhe,construct:Khe})});var Lg=w((jZe,n2)=>{"use strict";var Uhe=rc();n2.exports=new Uhe({include:[jS()],implicit:[JU(),zU()],explicit:[ZU(),$U(),t2(),i2()]})});var o2=w((qZe,s2)=>{"use strict";var Hhe=si();function Ghe(){return!0}function Yhe(){}function jhe(){return""}function qhe(r){return typeof r>"u"}s2.exports=new Hhe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Ghe,construct:Yhe,predicate:qhe,represent:jhe})});var A2=w((JZe,a2)=>{"use strict";var Jhe=si();function Whe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function zhe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Vhe(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function Xhe(r){return Object.prototype.toString.call(r)==="[object RegExp]"}a2.exports=new Jhe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Whe,construct:zhe,predicate:Xhe,represent:Vhe})});var u2=w((WZe,c2)=>{"use strict";var mI;try{l2=J,mI=l2("esprima")}catch{typeof window<"u"&&(mI=window.esprima)}var l2,Zhe=si();function _he(r){if(r===null)return!1;try{var e="("+r+")",t=mI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function $he(r){var e="("+r+")",t=mI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return t.body[0].expression.params.forEach(function(s){i.push(s.name)}),n=t.body[0].expression.body.range,t.body[0].expression.body.type==="BlockStatement"?new Function(i,e.slice(n[0]+1,n[1]-1)):new Function(i,"return "+e.slice(n[0],n[1]))}function epe(r){return r.toString()}function tpe(r){return Object.prototype.toString.call(r)==="[object Function]"}c2.exports=new Zhe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:_he,construct:$he,predicate:tpe,represent:epe})});var Xp=w((VZe,f2)=>{"use strict";var g2=rc();f2.exports=g2.DEFAULT=new g2({include:[Lg()],explicit:[o2(),A2(),u2()]})});var R2=w((XZe,Zp)=>{"use strict";var Ba=tc(),I2=Ng(),rpe=IU(),y2=Lg(),ipe=Xp(),RA=Object.prototype.hasOwnProperty,EI=1,w2=2,B2=3,II=4,JS=1,npe=2,h2=3,spe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ope=/[\x85\u2028\u2029]/,ape=/[,\[\]\{\}]/,Q2=/^(?:!|!!|![a-z\-]+!)$/i,b2=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function p2(r){return Object.prototype.toString.call(r)}function vo(r){return r===10||r===13}function sc(r){return r===9||r===32}function fn(r){return r===9||r===32||r===10||r===13}function Og(r){return r===44||r===91||r===93||r===123||r===125}function Ape(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function lpe(r){return r===120?2:r===117?4:r===85?8:0}function cpe(r){return 48<=r&&r<=57?r-48:-1}function d2(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?` -`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function upe(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var S2=new Array(256),v2=new Array(256);for(nc=0;nc<256;nc++)S2[nc]=d2(nc)?1:0,v2[nc]=d2(nc);var nc;function gpe(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||ipe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function x2(r,e){return new I2(e,new rpe(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function ft(r,e){throw x2(r,e)}function yI(r,e){r.onWarning&&r.onWarning.call(null,x2(r,e))}var C2={YAML:function(e,t,i){var n,s,o;e.version!==null&&ft(e,"duplication of %YAML directive"),i.length!==1&&ft(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&ft(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&ft(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&yI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&ft(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],Q2.test(n)||ft(e,"ill-formed tag handle (first argument) of the TAG directive"),RA.call(e.tagMap,n)&&ft(e,'there is a previously declared suffix for "'+n+'" tag handle'),b2.test(s)||ft(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function kA(r,e,t,i){var n,s,o,a;if(e1&&(r.result+=Ba.repeat(` -`,e-1))}function fpe(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),fn(h)||Og(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=r.input.charCodeAt(r.position+1),fn(n)||t&&Og(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),fn(n)||t&&Og(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),fn(i))break}else{if(r.position===r.lineStart&&wI(r)||t&&Og(h))break;if(vo(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,zr(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(kA(r,s,o,!1),zS(r,r.line-l),s=o=r.position,a=!1),sc(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return kA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function hpe(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(kA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else vo(t)?(kA(r,i,n,!0),zS(r,zr(r,!1,e)),i=n=r.position):r.position===r.lineStart&&wI(r)?ft(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);ft(r,"unexpected end of the stream within a single quoted scalar")}function ppe(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return kA(r,t,r.position,!0),r.position++,!0;if(a===92){if(kA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),vo(a))zr(r,!1,e);else if(a<256&&S2[a])r.result+=v2[a],r.position++;else if((o=lpe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=Ape(a))>=0?s=(s<<4)+o:ft(r,"expected hexadecimal character");r.result+=upe(s),r.position++}else ft(r,"unknown escape sequence");t=i=r.position}else vo(a)?(kA(r,t,i,!0),zS(r,zr(r,!1,e)),t=i=r.position):r.position===r.lineStart&&wI(r)?ft(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}ft(r,"unexpected end of the stream within a double quoted scalar")}function dpe(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,C,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if(zr(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||ft(r,"missed comma between flow collection entries"),p=h=C=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),fn(a)&&(c=u=!0,r.position++,zr(r,!0,e))),i=r.line,Kg(r,e,EI,!1,!0),p=r.tag,h=r.result,zr(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),zr(r,!0,e),Kg(r,e,EI,!1,!0),C=r.result),g?Mg(r,s,f,p,h,C):c?s.push(Mg(r,null,f,p,h,C)):s.push(h),zr(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}ft(r,"unexpected end of the stream within a flow collection")}function Cpe(r,e){var t,i,n=JS,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)JS===n?n=g===43?h2:npe:ft(r,"repeat of a chomping mode identifier");else if((u=cpe(g))>=0)u===0?ft(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?ft(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(sc(g)){do g=r.input.charCodeAt(++r.position);while(sc(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!vo(g)&&g!==0)}for(;g!==0;){for(WS(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndenta&&(a=r.lineIndent),vo(g)){l++;continue}if(r.lineIndente)&&l!==0)ft(r,"bad indentation of a sequence entry");else if(r.lineIndente)&&(Kg(r,e,II,!0,n)&&(p?f=r.result:h=r.result),p||(Mg(r,c,u,g,f,h,s,o),g=f=h=null),zr(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)ft(r,"bad indentation of a mapping entry");else if(r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndent tag; it should be "scalar", not "'+r.kind+'"'),g=0,f=r.implicitTypes.length;g tag; it should be "'+h.kind+'", not "'+r.kind+'"'),h.resolve(r.result)?(r.result=h.construct(r.result),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):ft(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")):ft(r,"unknown tag !<"+r.tag+">");return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||u}function wpe(r){var e=r.position,t,i,n,s=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap={},r.anchorMap={};(o=r.input.charCodeAt(r.position))!==0&&(zr(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(s=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!fn(o);)o=r.input.charCodeAt(++r.position);for(i=r.input.slice(t,r.position),n=[],i.length<1&&ft(r,"directive name must not be less than one character in length");o!==0;){for(;sc(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!vo(o));break}if(vo(o))break;for(t=r.position;o!==0&&!fn(o);)o=r.input.charCodeAt(++r.position);n.push(r.input.slice(t,r.position))}o!==0&&WS(r),RA.call(C2,i)?C2[i](r,i,n):yI(r,'unknown document directive "'+i+'"')}if(zr(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,zr(r,!0,-1)):s&&ft(r,"directives end mark is expected"),Kg(r,r.lineIndent-1,II,!1,!0),zr(r,!0,-1),r.checkLineBreaks&&ope.test(r.input.slice(e,r.position))&&yI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&wI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,zr(r,!0,-1));return}if(r.position"u"&&(t=e,e=null);var i=P2(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n"u"&&(t=e,e=null),D2(r,e,Ba.extend({schema:y2},t))}function Qpe(r,e){return k2(r,Ba.extend({schema:y2},e))}Zp.exports.loadAll=D2;Zp.exports.load=k2;Zp.exports.safeLoadAll=Bpe;Zp.exports.safeLoad=Qpe});var tH=w((ZZe,_S)=>{"use strict";var $p=tc(),ed=Ng(),bpe=Xp(),Spe=Lg(),U2=Object.prototype.toString,H2=Object.prototype.hasOwnProperty,vpe=9,_p=10,xpe=13,Ppe=32,Dpe=33,kpe=34,G2=35,Rpe=37,Fpe=38,Npe=39,Tpe=42,Y2=44,Lpe=45,j2=58,Ope=61,Mpe=62,Kpe=63,Upe=64,q2=91,J2=93,Hpe=96,W2=123,Gpe=124,z2=125,Ni={};Ni[0]="\\0";Ni[7]="\\a";Ni[8]="\\b";Ni[9]="\\t";Ni[10]="\\n";Ni[11]="\\v";Ni[12]="\\f";Ni[13]="\\r";Ni[27]="\\e";Ni[34]='\\"';Ni[92]="\\\\";Ni[133]="\\N";Ni[160]="\\_";Ni[8232]="\\L";Ni[8233]="\\P";var Ype=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function jpe(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n0?r.charCodeAt(s-1):null,f=f&&T2(o,a)}else{for(s=0;si&&r[g+1]!==" ",g=s);else if(!Ug(o))return BI;a=s>0?r.charCodeAt(s-1):null,f=f&&T2(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?f&&!n(r)?X2:Z2:t>9&&V2(r)?BI:c?$2:_2}function Xpe(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&Ype.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return Jpe(r,l)}switch(Vpe(e,o,r.indent,s,a)){case X2:return e;case Z2:return"'"+e.replace(/'/g,"''")+"'";case _2:return"|"+L2(e,r.indent)+O2(N2(e,n));case $2:return">"+L2(e,r.indent)+O2(N2(Zpe(e,s),n));case BI:return'"'+_pe(e,s)+'"';default:throw new ed("impossible error: invalid scalar style")}}()}function L2(r,e){var t=V2(r)?String(e):"",i=r[r.length-1]===` -`,n=i&&(r[r.length-2]===` -`||r===` -`),s=n?"+":i?"":"-";return t+s+` -`}function O2(r){return r[r.length-1]===` -`?r.slice(0,-1):r}function Zpe(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(` -`);return c=c!==-1?c:r.length,t.lastIndex=c,M2(r.slice(0,c),e)}(),n=r[0]===` -`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?` -`:"")+M2(l,e),n=s}return i}function M2(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=` -`+r.slice(n,s),n=s+1),o=a;return l+=` -`,r.length-n>e&&o>n?l+=r.slice(n,o)+` -`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function _pe(r){for(var e="",t,i,n,s=0;s=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=F2((t-55296)*1024+i-56320+65536),s++;continue}n=Ni[t],e+=!n&&Ug(t)?r[s]:n||F2(t)}return e}function $pe(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),oc(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function rde(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,f;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new ed("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,g&&(r.dump&&_p===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,g&&(f+=VS(r,e)),oc(r,e+1,u,!0,g)&&(r.dump&&_p===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,n+=f));r.tag=s,r.dump=n||"{}"}function K2(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function oc(r,e,t,i,n,s){r.tag=null,r.dump=t,K2(r,t,!1)||K2(r,t,!0);var o=U2.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(rde(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(tde(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(ede(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):($pe(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&Xpe(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new ed("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function ide(r,e){var t=[],i=[],n,s;for(XS(r,t,i),n=0,s=i.length;n{"use strict";var QI=R2(),rH=tH();function bI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Fr.exports.Type=si();Fr.exports.Schema=rc();Fr.exports.FAILSAFE_SCHEMA=CI();Fr.exports.JSON_SCHEMA=YS();Fr.exports.CORE_SCHEMA=jS();Fr.exports.DEFAULT_SAFE_SCHEMA=Lg();Fr.exports.DEFAULT_FULL_SCHEMA=Xp();Fr.exports.load=QI.load;Fr.exports.loadAll=QI.loadAll;Fr.exports.safeLoad=QI.safeLoad;Fr.exports.safeLoadAll=QI.safeLoadAll;Fr.exports.dump=rH.dump;Fr.exports.safeDump=rH.safeDump;Fr.exports.YAMLException=Ng();Fr.exports.MINIMAL_SCHEMA=CI();Fr.exports.SAFE_SCHEMA=Lg();Fr.exports.DEFAULT_SCHEMA=Xp();Fr.exports.scan=bI("scan");Fr.exports.parse=bI("parse");Fr.exports.compose=bI("compose");Fr.exports.addConstructor=bI("addConstructor")});var sH=w(($Ze,nH)=>{"use strict";var sde=iH();nH.exports=sde});var aH=w((e_e,oH)=>{"use strict";function ode(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function ac(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ac)}ode(ac,Error);ac.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g({[Ke]:Ce})))},H=function(R){return R},j=function(R){return R},$=Us("correct indentation"),V=" ",W=ar(" ",!1),_=function(R){return R.length===bA*yg},A=function(R){return R.length===(bA+1)*yg},Ae=function(){return bA++,!0},ge=function(){return bA--,!0},re=function(){return pg()},O=Us("pseudostring"),F=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,ue=Tn(["\r",` -`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),pe=/^[^\r\n\t ,\][{}:#"']/,ke=Tn(["\r",` -`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),Fe=function(){return pg().replace(/^ *| *$/g,"")},Ne="--",oe=ar("--",!1),le=/^[a-zA-Z\/0-9]/,Be=Tn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),fe=/^[^\r\n\t :,]/,ae=Tn(["\r",` -`," "," ",":",","],!0,!1),qe="null",ne=ar("null",!1),Y=function(){return null},he="true",ie=ar("true",!1),de=function(){return!0},_e="false",Pt=ar("false",!1),It=function(){return!1},Or=Us("string"),ii='"',gi=ar('"',!1),hr=function(){return""},fi=function(R){return R},ni=function(R){return R.join("")},Ks=/^[^"\\\0-\x1F\x7F]/,pr=Tn(['"',"\\",["\0",""],"\x7F"],!0,!1),Ii='\\"',rs=ar('\\"',!1),fa=function(){return'"'},CA="\\\\",cg=ar("\\\\",!1),is=function(){return"\\"},mA="\\/",ha=ar("\\/",!1),wp=function(){return"/"},EA="\\b",IA=ar("\\b",!1),wr=function(){return"\b"},Tl="\\f",ug=ar("\\f",!1),Io=function(){return"\f"},gg="\\n",Bp=ar("\\n",!1),Qp=function(){return` -`},vr="\\r",se=ar("\\r",!1),yo=function(){return"\r"},Fn="\\t",fg=ar("\\t",!1),Qt=function(){return" "},Ll="\\u",Nn=ar("\\u",!1),ns=function(R,q,Ce,Ke){return String.fromCharCode(parseInt(`0x${R}${q}${Ce}${Ke}`))},ss=/^[0-9a-fA-F]/,gt=Tn([["0","9"],["a","f"],["A","F"]],!1,!1),wo=Us("blank space"),At=/^[ \t]/,ln=Tn([" "," "],!1,!1),S=Us("white space"),Lt=/^[ \t\n\r]/,hg=Tn([" "," ",` -`,"\r"],!1,!1),Ol=`\r -`,bp=ar(`\r -`,!1),Sp=` -`,vp=ar(` -`,!1),xp="\r",Pp=ar("\r",!1),G=0,yt=0,yA=[{line:1,column:1}],zi=0,Ml=[],Xe=0,pa;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function pg(){return r.substring(yt,G)}function OE(){return cn(yt,G)}function Dp(R,q){throw q=q!==void 0?q:cn(yt,G),Ul([Us(R)],r.substring(yt,G),q)}function ME(R,q){throw q=q!==void 0?q:cn(yt,G),dg(R,q)}function ar(R,q){return{type:"literal",text:R,ignoreCase:q}}function Tn(R,q,Ce){return{type:"class",parts:R,inverted:q,ignoreCase:Ce}}function Kl(){return{type:"any"}}function kp(){return{type:"end"}}function Us(R){return{type:"other",description:R}}function da(R){var q=yA[R],Ce;if(q)return q;for(Ce=R-1;!yA[Ce];)Ce--;for(q=yA[Ce],q={line:q.line,column:q.column};Cezi&&(zi=G,Ml=[]),Ml.push(R))}function dg(R,q){return new ac(R,null,null,q)}function Ul(R,q,Ce){return new ac(ac.buildMessage(R,q),R,q,Ce)}function Hs(){var R;return R=Cg(),R}function Hl(){var R,q,Ce;for(R=G,q=[],Ce=wA();Ce!==t;)q.push(Ce),Ce=wA();return q!==t&&(yt=R,q=s(q)),R=q,R}function wA(){var R,q,Ce,Ke,Re;return R=G,q=ma(),q!==t?(r.charCodeAt(G)===45?(Ce=o,G++):(Ce=t,Xe===0&&Le(a)),Ce!==t?(Ke=Rr(),Ke!==t?(Re=Ca(),Re!==t?(yt=R,q=l(Re),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R}function Cg(){var R,q,Ce;for(R=G,q=[],Ce=mg();Ce!==t;)q.push(Ce),Ce=mg();return q!==t&&(yt=R,q=c(q)),R=q,R}function mg(){var R,q,Ce,Ke,Re,ze,dt,Ft,Ln;if(R=G,q=Rr(),q===t&&(q=null),q!==t){if(Ce=G,r.charCodeAt(G)===35?(Ke=u,G++):(Ke=t,Xe===0&&Le(g)),Ke!==t){if(Re=[],ze=G,dt=G,Xe++,Ft=js(),Xe--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,Xe===0&&Le(f)),Ft!==t?(dt=[dt,Ft],ze=dt):(G=ze,ze=t)):(G=ze,ze=t),ze!==t)for(;ze!==t;)Re.push(ze),ze=G,dt=G,Xe++,Ft=js(),Xe--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,Xe===0&&Le(f)),Ft!==t?(dt=[dt,Ft],ze=dt):(G=ze,ze=t)):(G=ze,ze=t);else Re=t;Re!==t?(Ke=[Ke,Re],Ce=Ke):(G=Ce,Ce=t)}else G=Ce,Ce=t;if(Ce===t&&(Ce=null),Ce!==t){if(Ke=[],Re=Ys(),Re!==t)for(;Re!==t;)Ke.push(Re),Re=Ys();else Ke=t;Ke!==t?(yt=R,q=h(),R=q):(G=R,R=t)}else G=R,R=t}else G=R,R=t;if(R===t&&(R=G,q=ma(),q!==t?(Ce=Gl(),Ce!==t?(Ke=Rr(),Ke===t&&(Ke=null),Ke!==t?(r.charCodeAt(G)===58?(Re=p,G++):(Re=t,Xe===0&&Le(C)),Re!==t?(ze=Rr(),ze===t&&(ze=null),ze!==t?(dt=Ca(),dt!==t?(yt=R,q=y(Ce,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=ma(),q!==t?(Ce=Gs(),Ce!==t?(Ke=Rr(),Ke===t&&(Ke=null),Ke!==t?(r.charCodeAt(G)===58?(Re=p,G++):(Re=t,Xe===0&&Le(C)),Re!==t?(ze=Rr(),ze===t&&(ze=null),ze!==t?(dt=Ca(),dt!==t?(yt=R,q=y(Ce,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))){if(R=G,q=ma(),q!==t)if(Ce=Gs(),Ce!==t)if(Ke=Rr(),Ke!==t)if(Re=KE(),Re!==t){if(ze=[],dt=Ys(),dt!==t)for(;dt!==t;)ze.push(dt),dt=Ys();else ze=t;ze!==t?(yt=R,q=y(Ce,Re),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;else G=R,R=t;else G=R,R=t;if(R===t)if(R=G,q=ma(),q!==t)if(Ce=Gs(),Ce!==t){if(Ke=[],Re=G,ze=Rr(),ze===t&&(ze=null),ze!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,Xe===0&&Le(v)),dt!==t?(Ft=Rr(),Ft===t&&(Ft=null),Ft!==t?(Ln=Gs(),Ln!==t?(yt=Re,ze=D(Ce,Ln),Re=ze):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t),Re!==t)for(;Re!==t;)Ke.push(Re),Re=G,ze=Rr(),ze===t&&(ze=null),ze!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,Xe===0&&Le(v)),dt!==t?(Ft=Rr(),Ft===t&&(Ft=null),Ft!==t?(Ln=Gs(),Ln!==t?(yt=Re,ze=D(Ce,Ln),Re=ze):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t);else Ke=t;Ke!==t?(Re=Rr(),Re===t&&(Re=null),Re!==t?(r.charCodeAt(G)===58?(ze=p,G++):(ze=t,Xe===0&&Le(C)),ze!==t?(dt=Rr(),dt===t&&(dt=null),dt!==t?(Ft=Ca(),Ft!==t?(yt=R,q=T(Ce,Ke,Ft),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)}else G=R,R=t;else G=R,R=t}return R}function Ca(){var R,q,Ce,Ke,Re,ze,dt;if(R=G,q=G,Xe++,Ce=G,Ke=js(),Ke!==t?(Re=rt(),Re!==t?(r.charCodeAt(G)===45?(ze=o,G++):(ze=t,Xe===0&&Le(a)),ze!==t?(dt=Rr(),dt!==t?(Ke=[Ke,Re,ze,dt],Ce=Ke):(G=Ce,Ce=t)):(G=Ce,Ce=t)):(G=Ce,Ce=t)):(G=Ce,Ce=t),Xe--,Ce!==t?(G=q,q=void 0):q=t,q!==t?(Ce=Ys(),Ce!==t?(Ke=Bo(),Ke!==t?(Re=Hl(),Re!==t?(ze=BA(),ze!==t?(yt=R,q=H(Re),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=js(),q!==t?(Ce=Bo(),Ce!==t?(Ke=Cg(),Ke!==t?(Re=BA(),Re!==t?(yt=R,q=H(Ke),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))if(R=G,q=Yl(),q!==t){if(Ce=[],Ke=Ys(),Ke!==t)for(;Ke!==t;)Ce.push(Ke),Ke=Ys();else Ce=t;Ce!==t?(yt=R,q=j(q),R=q):(G=R,R=t)}else G=R,R=t;return R}function ma(){var R,q,Ce;for(Xe++,R=G,q=[],r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Le(W));Ce!==t;)q.push(Ce),r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Le(W));return q!==t?(yt=G,Ce=_(q),Ce?Ce=void 0:Ce=t,Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)):(G=R,R=t),Xe--,R===t&&(q=t,Xe===0&&Le($)),R}function rt(){var R,q,Ce;for(R=G,q=[],r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Le(W));Ce!==t;)q.push(Ce),r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Le(W));return q!==t?(yt=G,Ce=A(q),Ce?Ce=void 0:Ce=t,Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)):(G=R,R=t),R}function Bo(){var R;return yt=G,R=Ae(),R?R=void 0:R=t,R}function BA(){var R;return yt=G,R=ge(),R?R=void 0:R=t,R}function Gl(){var R;return R=jl(),R===t&&(R=Rp()),R}function Gs(){var R,q,Ce;if(R=jl(),R===t){if(R=G,q=[],Ce=Eg(),Ce!==t)for(;Ce!==t;)q.push(Ce),Ce=Eg();else q=t;q!==t&&(yt=R,q=re()),R=q}return R}function Yl(){var R;return R=Fp(),R===t&&(R=UE(),R===t&&(R=jl(),R===t&&(R=Rp()))),R}function KE(){var R;return R=Fp(),R===t&&(R=jl(),R===t&&(R=Eg())),R}function Rp(){var R,q,Ce,Ke,Re,ze;if(Xe++,R=G,F.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Le(ue)),q!==t){for(Ce=[],Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(pe.test(r.charAt(G))?(ze=r.charAt(G),G++):(ze=t,Xe===0&&Le(ke)),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ke!==t;)Ce.push(Ke),Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(pe.test(r.charAt(G))?(ze=r.charAt(G),G++):(ze=t,Xe===0&&Le(ke)),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ce!==t?(yt=R,q=Fe(),R=q):(G=R,R=t)}else G=R,R=t;return Xe--,R===t&&(q=t,Xe===0&&Le(O)),R}function Eg(){var R,q,Ce,Ke,Re;if(R=G,r.substr(G,2)===Ne?(q=Ne,G+=2):(q=t,Xe===0&&Le(oe)),q===t&&(q=null),q!==t)if(le.test(r.charAt(G))?(Ce=r.charAt(G),G++):(Ce=t,Xe===0&&Le(Be)),Ce!==t){for(Ke=[],fe.test(r.charAt(G))?(Re=r.charAt(G),G++):(Re=t,Xe===0&&Le(ae));Re!==t;)Ke.push(Re),fe.test(r.charAt(G))?(Re=r.charAt(G),G++):(Re=t,Xe===0&&Le(ae));Ke!==t?(yt=R,q=Fe(),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;return R}function Fp(){var R,q;return R=G,r.substr(G,4)===qe?(q=qe,G+=4):(q=t,Xe===0&&Le(ne)),q!==t&&(yt=R,q=Y()),R=q,R}function UE(){var R,q;return R=G,r.substr(G,4)===he?(q=he,G+=4):(q=t,Xe===0&&Le(ie)),q!==t&&(yt=R,q=de()),R=q,R===t&&(R=G,r.substr(G,5)===_e?(q=_e,G+=5):(q=t,Xe===0&&Le(Pt)),q!==t&&(yt=R,q=It()),R=q),R}function jl(){var R,q,Ce,Ke;return Xe++,R=G,r.charCodeAt(G)===34?(q=ii,G++):(q=t,Xe===0&&Le(gi)),q!==t?(r.charCodeAt(G)===34?(Ce=ii,G++):(Ce=t,Xe===0&&Le(gi)),Ce!==t?(yt=R,q=hr(),R=q):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,r.charCodeAt(G)===34?(q=ii,G++):(q=t,Xe===0&&Le(gi)),q!==t?(Ce=HE(),Ce!==t?(r.charCodeAt(G)===34?(Ke=ii,G++):(Ke=t,Xe===0&&Le(gi)),Ke!==t?(yt=R,q=fi(Ce),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)),Xe--,R===t&&(q=t,Xe===0&&Le(Or)),R}function HE(){var R,q,Ce;if(R=G,q=[],Ce=Ig(),Ce!==t)for(;Ce!==t;)q.push(Ce),Ce=Ig();else q=t;return q!==t&&(yt=R,q=ni(q)),R=q,R}function Ig(){var R,q,Ce,Ke,Re,ze;return Ks.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,Xe===0&&Le(pr)),R===t&&(R=G,r.substr(G,2)===Ii?(q=Ii,G+=2):(q=t,Xe===0&&Le(rs)),q!==t&&(yt=R,q=fa()),R=q,R===t&&(R=G,r.substr(G,2)===CA?(q=CA,G+=2):(q=t,Xe===0&&Le(cg)),q!==t&&(yt=R,q=is()),R=q,R===t&&(R=G,r.substr(G,2)===mA?(q=mA,G+=2):(q=t,Xe===0&&Le(ha)),q!==t&&(yt=R,q=wp()),R=q,R===t&&(R=G,r.substr(G,2)===EA?(q=EA,G+=2):(q=t,Xe===0&&Le(IA)),q!==t&&(yt=R,q=wr()),R=q,R===t&&(R=G,r.substr(G,2)===Tl?(q=Tl,G+=2):(q=t,Xe===0&&Le(ug)),q!==t&&(yt=R,q=Io()),R=q,R===t&&(R=G,r.substr(G,2)===gg?(q=gg,G+=2):(q=t,Xe===0&&Le(Bp)),q!==t&&(yt=R,q=Qp()),R=q,R===t&&(R=G,r.substr(G,2)===vr?(q=vr,G+=2):(q=t,Xe===0&&Le(se)),q!==t&&(yt=R,q=yo()),R=q,R===t&&(R=G,r.substr(G,2)===Fn?(q=Fn,G+=2):(q=t,Xe===0&&Le(fg)),q!==t&&(yt=R,q=Qt()),R=q,R===t&&(R=G,r.substr(G,2)===Ll?(q=Ll,G+=2):(q=t,Xe===0&&Le(Nn)),q!==t?(Ce=QA(),Ce!==t?(Ke=QA(),Ke!==t?(Re=QA(),Re!==t?(ze=QA(),ze!==t?(yt=R,q=ns(Ce,Ke,Re,ze),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)))))))))),R}function QA(){var R;return ss.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,Xe===0&&Le(gt)),R}function Rr(){var R,q;if(Xe++,R=[],At.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Le(ln)),q!==t)for(;q!==t;)R.push(q),At.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Le(ln));else R=t;return Xe--,R===t&&(q=t,Xe===0&&Le(wo)),R}function GE(){var R,q;if(Xe++,R=[],Lt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Le(hg)),q!==t)for(;q!==t;)R.push(q),Lt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Le(hg));else R=t;return Xe--,R===t&&(q=t,Xe===0&&Le(S)),R}function Ys(){var R,q,Ce,Ke,Re,ze;if(R=G,q=js(),q!==t){for(Ce=[],Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(ze=js(),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ke!==t;)Ce.push(Ke),Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(ze=js(),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)}else G=R,R=t;return R}function js(){var R;return r.substr(G,2)===Ol?(R=Ol,G+=2):(R=t,Xe===0&&Le(bp)),R===t&&(r.charCodeAt(G)===10?(R=Sp,G++):(R=t,Xe===0&&Le(vp)),R===t&&(r.charCodeAt(G)===13?(R=xp,G++):(R=t,Xe===0&&Le(Pp)))),R}let yg=2,bA=0;if(pa=n(),pa!==t&&G===r.length)return pa;throw pa!==t&&G{"use strict";var gde=r=>{let e=!1,t=!1,i=!1;for(let n=0;n{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let t=n=>e.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(r)?r=r.map(n=>n.trim()).filter(n=>n.length).join("-"):r=r.trim(),r.length===0?"":r.length===1?e.pascalCase?r.toUpperCase():r.toLowerCase():(r!==r.toLowerCase()&&(r=gde(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),t(r))};ev.exports=gH;ev.exports.default=gH});var hH=w((o_e,fde)=>{fde.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:"NOW_BUILDER"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"}]});var Ac=w(Un=>{"use strict";var dH=hH(),xo=process.env;Object.defineProperty(Un,"_vendors",{value:dH.map(function(r){return r.constant})});Un.name=null;Un.isPR=null;dH.forEach(function(r){let t=(Array.isArray(r.env)?r.env:[r.env]).every(function(i){return pH(i)});if(Un[r.constant]=t,t)switch(Un.name=r.name,typeof r.pr){case"string":Un.isPR=!!xo[r.pr];break;case"object":"env"in r.pr?Un.isPR=r.pr.env in xo&&xo[r.pr.env]!==r.pr.ne:"any"in r.pr?Un.isPR=r.pr.any.some(function(i){return!!xo[i]}):Un.isPR=pH(r.pr);break;default:Un.isPR=null}});Un.isCI=!!(xo.CI||xo.CONTINUOUS_INTEGRATION||xo.BUILD_NUMBER||xo.RUN_ID||Un.name);function pH(r){return typeof r=="string"?!!xo[r]:Object.keys(r).every(function(e){return xo[e]===r[e]})}});var hn={};ut(hn,{KeyRelationship:()=>lc,applyCascade:()=>od,base64RegExp:()=>yH,colorStringAlphaRegExp:()=>IH,colorStringRegExp:()=>EH,computeKey:()=>FA,getPrintable:()=>Vr,hasExactLength:()=>SH,hasForbiddenKeys:()=>qde,hasKeyRelationship:()=>av,hasMaxLength:()=>xde,hasMinLength:()=>vde,hasMutuallyExclusiveKeys:()=>Jde,hasRequiredKeys:()=>jde,hasUniqueItems:()=>Pde,isArray:()=>Ede,isAtLeast:()=>Rde,isAtMost:()=>Fde,isBase64:()=>Gde,isBoolean:()=>dde,isDate:()=>mde,isDict:()=>yde,isEnum:()=>Zi,isHexColor:()=>Hde,isISO8601:()=>Ude,isInExclusiveRange:()=>Tde,isInInclusiveRange:()=>Nde,isInstanceOf:()=>Bde,isInteger:()=>Lde,isJSON:()=>Yde,isLiteral:()=>hde,isLowerCase:()=>Ode,isNegative:()=>Dde,isNullable:()=>Sde,isNumber:()=>Cde,isObject:()=>wde,isOneOf:()=>Qde,isOptional:()=>bde,isPositive:()=>kde,isString:()=>sd,isTuple:()=>Ide,isUUID4:()=>Kde,isUnknown:()=>bH,isUpperCase:()=>Mde,iso8601RegExp:()=>ov,makeCoercionFn:()=>cc,makeSetter:()=>QH,makeTrait:()=>BH,makeValidator:()=>bt,matchesRegExp:()=>ad,plural:()=>kI,pushError:()=>pt,simpleKeyRegExp:()=>mH,uuid4RegExp:()=>wH});function bt({test:r}){return BH(r)()}function Vr(r){return r===null?"null":r===void 0?"undefined":r===""?"an empty string":JSON.stringify(r)}function FA(r,e){var t,i,n;return typeof e=="number"?`${(t=r==null?void 0:r.p)!==null&&t!==void 0?t:"."}[${e}]`:mH.test(e)?`${(i=r==null?void 0:r.p)!==null&&i!==void 0?i:""}.${e}`:`${(n=r==null?void 0:r.p)!==null&&n!==void 0?n:"."}[${JSON.stringify(e)}]`}function cc(r,e){return t=>{let i=r[e];return r[e]=t,cc(r,e).bind(null,i)}}function QH(r,e){return t=>{r[e]=t}}function kI(r,e,t){return r===1?e:t}function pt({errors:r,p:e}={},t){return r==null||r.push(`${e!=null?e:"."}: ${t}`),!1}function hde(r){return bt({test:(e,t)=>e!==r?pt(t,`Expected a literal (got ${Vr(r)})`):!0})}function Zi(r){let e=Array.isArray(r)?r:Object.values(r),t=new Set(e);return bt({test:(i,n)=>t.has(i)?!0:pt(n,`Expected a valid enumeration value (got ${Vr(i)})`)})}var mH,EH,IH,yH,wH,ov,BH,bH,sd,pde,dde,Cde,mde,Ede,Ide,yde,wde,Bde,Qde,od,bde,Sde,vde,xde,SH,Pde,Dde,kde,Rde,Fde,Nde,Tde,Lde,ad,Ode,Mde,Kde,Ude,Hde,Gde,Yde,jde,qde,Jde,lc,Wde,av,ls=Fge(()=>{mH=/^[a-zA-Z_][a-zA-Z0-9_]*$/,EH=/^#[0-9a-f]{6}$/i,IH=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,yH=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,wH=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,ov=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/,BH=r=>()=>r;bH=()=>bt({test:(r,e)=>!0});sd=()=>bt({test:(r,e)=>typeof r!="string"?pt(e,`Expected a string (got ${Vr(r)})`):!0});pde=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]),dde=()=>bt({test:(r,e)=>{var t;if(typeof r!="boolean"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i=pde.get(r);if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a boolean (got ${Vr(r)})`)}return!0}}),Cde=()=>bt({test:(r,e)=>{var t;if(typeof r!="number"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{}if(typeof n=="number")if(JSON.stringify(n)===r)i=n;else return pt(e,`Received a number that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a number (got ${Vr(r)})`)}return!0}}),mde=()=>bt({test:(r,e)=>{var t;if(!(r instanceof Date)){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"&&ov.test(r))i=new Date(r);else{let n;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch{}typeof s=="number"&&(n=s)}else typeof r=="number"&&(n=r);if(typeof n<"u")if(Number.isSafeInteger(n)||!Number.isSafeInteger(n*1e3))i=new Date(n*1e3);else return pt(e,`Received a timestamp that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a date (got ${Vr(r)})`)}return!0}}),Ede=(r,{delimiter:e}={})=>bt({test:(t,i)=>{var n;if(typeof t=="string"&&typeof e<"u"&&typeof(i==null?void 0:i.coercions)<"u"){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");t=t.split(e),i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,t)])}if(!Array.isArray(t))return pt(i,`Expected an array (got ${Vr(t)})`);let s=!0;for(let o=0,a=t.length;o{let t=SH(r.length);return bt({test:(i,n)=>{var s;if(typeof i=="string"&&typeof e<"u"&&typeof(n==null?void 0:n.coercions)<"u"){if(typeof(n==null?void 0:n.coercion)>"u")return pt(n,"Unbound coercion result");i=i.split(e),n.coercions.push([(s=n.p)!==null&&s!==void 0?s:".",n.coercion.bind(null,i)])}if(!Array.isArray(i))return pt(n,`Expected a tuple (got ${Vr(i)})`);let o=t(i,Object.assign({},n));for(let a=0,l=i.length;abt({test:(t,i)=>{if(typeof t!="object"||t===null)return pt(i,`Expected an object (got ${Vr(t)})`);let n=Object.keys(t),s=!0;for(let o=0,a=n.length;o{let t=Object.keys(r);return bt({test:(i,n)=>{if(typeof i!="object"||i===null)return pt(n,`Expected an object (got ${Vr(i)})`);let s=new Set([...t,...Object.keys(i)]),o={},a=!0;for(let l of s){if(l==="constructor"||l==="__proto__")a=pt(Object.assign(Object.assign({},n),{p:FA(n,l)}),"Unsafe property name");else{let c=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,u=Object.prototype.hasOwnProperty.call(i,l)?i[l]:void 0;typeof c<"u"?a=c(u,Object.assign(Object.assign({},n),{p:FA(n,l),coercion:cc(i,l)}))&&a:e===null?a=pt(Object.assign(Object.assign({},n),{p:FA(n,l)}),`Extraneous property (got ${Vr(u)})`):Object.defineProperty(o,l,{enumerable:!0,get:()=>u,set:QH(i,l)})}if(!a&&(n==null?void 0:n.errors)==null)break}return e!==null&&(a||(n==null?void 0:n.errors)!=null)&&(a=e(o,n)&&a),a}})},Bde=r=>bt({test:(e,t)=>e instanceof r?!0:pt(t,`Expected an instance of ${r.name} (got ${Vr(e)})`)}),Qde=(r,{exclusive:e=!1}={})=>bt({test:(t,i)=>{var n,s,o;let a=[],l=typeof(i==null?void 0:i.errors)<"u"?[]:void 0;for(let c=0,u=r.length;c1?pt(i,`Expected to match exactly a single predicate (matched ${a.join(", ")})`):(o=i==null?void 0:i.errors)===null||o===void 0||o.push(...l),!1}}),od=(r,e)=>bt({test:(t,i)=>{var n,s;let o={value:t},a=typeof(i==null?void 0:i.coercions)<"u"?cc(o,"value"):void 0,l=typeof(i==null?void 0:i.coercions)<"u"?[]:void 0;if(!r(t,Object.assign(Object.assign({},i),{coercion:a,coercions:l})))return!1;let c=[];if(typeof l<"u")for(let[,u]of l)c.push(u());try{if(typeof(i==null?void 0:i.coercions)<"u"){if(o.value!==t){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,o.value)])}(s=i==null?void 0:i.coercions)===null||s===void 0||s.push(...l)}return e.every(u=>u(o.value,i))}finally{for(let u of c)u()}}}),bde=r=>bt({test:(e,t)=>typeof e>"u"?!0:r(e,t)}),Sde=r=>bt({test:(e,t)=>e===null?!0:r(e,t)}),vde=r=>bt({test:(e,t)=>e.length>=r?!0:pt(t,`Expected to have a length of at least ${r} elements (got ${e.length})`)}),xde=r=>bt({test:(e,t)=>e.length<=r?!0:pt(t,`Expected to have a length of at most ${r} elements (got ${e.length})`)}),SH=r=>bt({test:(e,t)=>e.length!==r?pt(t,`Expected to have a length of exactly ${r} elements (got ${e.length})`):!0}),Pde=({map:r}={})=>bt({test:(e,t)=>{let i=new Set,n=new Set;for(let s=0,o=e.length;sbt({test:(r,e)=>r<=0?!0:pt(e,`Expected to be negative (got ${r})`)}),kde=()=>bt({test:(r,e)=>r>=0?!0:pt(e,`Expected to be positive (got ${r})`)}),Rde=r=>bt({test:(e,t)=>e>=r?!0:pt(t,`Expected to be at least ${r} (got ${e})`)}),Fde=r=>bt({test:(e,t)=>e<=r?!0:pt(t,`Expected to be at most ${r} (got ${e})`)}),Nde=(r,e)=>bt({test:(t,i)=>t>=r&&t<=e?!0:pt(i,`Expected to be in the [${r}; ${e}] range (got ${t})`)}),Tde=(r,e)=>bt({test:(t,i)=>t>=r&&tbt({test:(e,t)=>e!==Math.round(e)?pt(t,`Expected to be an integer (got ${e})`):Number.isSafeInteger(e)?!0:pt(t,`Expected to be a safe integer (got ${e})`)}),ad=r=>bt({test:(e,t)=>r.test(e)?!0:pt(t,`Expected to match the pattern ${r.toString()} (got ${Vr(e)})`)}),Ode=()=>bt({test:(r,e)=>r!==r.toLowerCase()?pt(e,`Expected to be all-lowercase (got ${r})`):!0}),Mde=()=>bt({test:(r,e)=>r!==r.toUpperCase()?pt(e,`Expected to be all-uppercase (got ${r})`):!0}),Kde=()=>bt({test:(r,e)=>wH.test(r)?!0:pt(e,`Expected to be a valid UUID v4 (got ${Vr(r)})`)}),Ude=()=>bt({test:(r,e)=>ov.test(r)?!1:pt(e,`Expected to be a valid ISO 8601 date string (got ${Vr(r)})`)}),Hde=({alpha:r=!1})=>bt({test:(e,t)=>(r?EH.test(e):IH.test(e))?!0:pt(t,`Expected to be a valid hexadecimal color string (got ${Vr(e)})`)}),Gde=()=>bt({test:(r,e)=>yH.test(r)?!0:pt(e,`Expected to be a valid base 64 string (got ${Vr(r)})`)}),Yde=(r=bH())=>bt({test:(e,t)=>{let i;try{i=JSON.parse(e)}catch{return pt(t,`Expected to be a valid JSON string (got ${Vr(e)})`)}return r(i,t)}}),jde=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)||s.push(o);return s.length>0?pt(i,`Missing required ${kI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},qde=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>0?pt(i,`Forbidden ${kI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},Jde=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>1?pt(i,`Mutually exclusive properties ${s.map(o=>`"${o}"`).join(", ")}`):!0}})};(function(r){r.Forbids="Forbids",r.Requires="Requires"})(lc||(lc={}));Wde={[lc.Forbids]:{expect:!1,message:"forbids using"},[lc.Requires]:{expect:!0,message:"requires using"}},av=(r,e,t,{ignore:i=[]}={})=>{let n=new Set(i),s=new Set(t),o=Wde[e];return bt({test:(a,l)=>{let c=new Set(Object.keys(a));if(!c.has(r)||n.has(a[r]))return!0;let u=[];for(let g of s)(c.has(g)&&!n.has(a[g]))!==o.expect&&u.push(g);return u.length>=1?pt(l,`Property "${r}" ${o.message} ${kI(u.length,"property","properties")} ${u.map(g=>`"${g}"`).join(", ")}`):!0}})}});var YH=w((o$e,GH)=>{"use strict";GH.exports=(r,...e)=>new Promise(t=>{t(r(...e))})});var Jg=w((a$e,pv)=>{"use strict";var cCe=YH(),jH=r=>{if(r<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],t=0,i=()=>{t--,e.length>0&&e.shift()()},n=(a,l,...c)=>{t++;let u=cCe(a,...c);l(u),u.then(i,i)},s=(a,l,...c)=>{tnew Promise(c=>s(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length}}),o};pv.exports=jH;pv.exports.default=jH});var gd=w((l$e,qH)=>{var uCe="2.0.0",gCe=Number.MAX_SAFE_INTEGER||9007199254740991,fCe=16;qH.exports={SEMVER_SPEC_VERSION:uCe,MAX_LENGTH:256,MAX_SAFE_INTEGER:gCe,MAX_SAFE_COMPONENT_LENGTH:fCe}});var fd=w((c$e,JH)=>{var hCe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};JH.exports=hCe});var uc=w((TA,WH)=>{var{MAX_SAFE_COMPONENT_LENGTH:dv}=gd(),pCe=fd();TA=WH.exports={};var dCe=TA.re=[],et=TA.src=[],tt=TA.t={},CCe=0,St=(r,e,t)=>{let i=CCe++;pCe(i,e),tt[r]=i,et[i]=e,dCe[i]=new RegExp(e,t?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","[0-9]+");St("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");St("MAINVERSION",`(${et[tt.NUMERICIDENTIFIER]})\\.(${et[tt.NUMERICIDENTIFIER]})\\.(${et[tt.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${et[tt.NUMERICIDENTIFIERLOOSE]})\\.(${et[tt.NUMERICIDENTIFIERLOOSE]})\\.(${et[tt.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${et[tt.NUMERICIDENTIFIER]}|${et[tt.NONNUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${et[tt.NUMERICIDENTIFIERLOOSE]}|${et[tt.NONNUMERICIDENTIFIER]})`);St("PRERELEASE",`(?:-(${et[tt.PRERELEASEIDENTIFIER]}(?:\\.${et[tt.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${et[tt.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${et[tt.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER","[0-9A-Za-z-]+");St("BUILD",`(?:\\+(${et[tt.BUILDIDENTIFIER]}(?:\\.${et[tt.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${et[tt.MAINVERSION]}${et[tt.PRERELEASE]}?${et[tt.BUILD]}?`);St("FULL",`^${et[tt.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${et[tt.MAINVERSIONLOOSE]}${et[tt.PRERELEASELOOSE]}?${et[tt.BUILD]}?`);St("LOOSE",`^${et[tt.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${et[tt.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${et[tt.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${et[tt.XRANGEIDENTIFIER]})(?:\\.(${et[tt.XRANGEIDENTIFIER]})(?:\\.(${et[tt.XRANGEIDENTIFIER]})(?:${et[tt.PRERELEASE]})?${et[tt.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:${et[tt.PRERELEASELOOSE]})?${et[tt.BUILD]}?)?)?`);St("XRANGE",`^${et[tt.GTLT]}\\s*${et[tt.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${et[tt.GTLT]}\\s*${et[tt.XRANGEPLAINLOOSE]}$`);St("COERCE",`(^|[^\\d])(\\d{1,${dv}})(?:\\.(\\d{1,${dv}}))?(?:\\.(\\d{1,${dv}}))?(?:$|[^\\d])`);St("COERCERTL",et[tt.COERCE],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${et[tt.LONETILDE]}\\s+`,!0);TA.tildeTrimReplace="$1~";St("TILDE",`^${et[tt.LONETILDE]}${et[tt.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${et[tt.LONETILDE]}${et[tt.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${et[tt.LONECARET]}\\s+`,!0);TA.caretTrimReplace="$1^";St("CARET",`^${et[tt.LONECARET]}${et[tt.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${et[tt.LONECARET]}${et[tt.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${et[tt.GTLT]}\\s*(${et[tt.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${et[tt.GTLT]}\\s*(${et[tt.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${et[tt.GTLT]}\\s*(${et[tt.LOOSEPLAIN]}|${et[tt.XRANGEPLAIN]})`,!0);TA.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${et[tt.XRANGEPLAIN]})\\s+-\\s+(${et[tt.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${et[tt.XRANGEPLAINLOOSE]})\\s+-\\s+(${et[tt.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0.0.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var hd=w((u$e,zH)=>{var mCe=["includePrerelease","loose","rtl"],ECe=r=>r?typeof r!="object"?{loose:!0}:mCe.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};zH.exports=ECe});var OI=w((g$e,ZH)=>{var VH=/^[0-9]+$/,XH=(r,e)=>{let t=VH.test(r),i=VH.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:rXH(e,r);ZH.exports={compareIdentifiers:XH,rcompareIdentifiers:ICe}});var Li=w((f$e,tG)=>{var MI=fd(),{MAX_LENGTH:_H,MAX_SAFE_INTEGER:KI}=gd(),{re:$H,t:eG}=uc(),yCe=hd(),{compareIdentifiers:pd}=OI(),Yn=class{constructor(e,t){if(t=yCe(t),e instanceof Yn){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>_H)throw new TypeError(`version is longer than ${_H} characters`);MI("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?$H[eG.LOOSE]:$H[eG.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>KI||this.major<0)throw new TypeError("Invalid major version");if(this.minor>KI||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>KI||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};tG.exports=Yn});var gc=w((h$e,sG)=>{var{MAX_LENGTH:wCe}=gd(),{re:rG,t:iG}=uc(),nG=Li(),BCe=hd(),QCe=(r,e)=>{if(e=BCe(e),r instanceof nG)return r;if(typeof r!="string"||r.length>wCe||!(e.loose?rG[iG.LOOSE]:rG[iG.FULL]).test(r))return null;try{return new nG(r,e)}catch{return null}};sG.exports=QCe});var aG=w((p$e,oG)=>{var bCe=gc(),SCe=(r,e)=>{let t=bCe(r,e);return t?t.version:null};oG.exports=SCe});var lG=w((d$e,AG)=>{var vCe=gc(),xCe=(r,e)=>{let t=vCe(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};AG.exports=xCe});var uG=w((C$e,cG)=>{var PCe=Li(),DCe=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new PCe(r,t).inc(e,i).version}catch{return null}};cG.exports=DCe});var cs=w((m$e,fG)=>{var gG=Li(),kCe=(r,e,t)=>new gG(r,t).compare(new gG(e,t));fG.exports=kCe});var UI=w((E$e,hG)=>{var RCe=cs(),FCe=(r,e,t)=>RCe(r,e,t)===0;hG.exports=FCe});var CG=w((I$e,dG)=>{var pG=gc(),NCe=UI(),TCe=(r,e)=>{if(NCe(r,e))return null;{let t=pG(r),i=pG(e),n=t.prerelease.length||i.prerelease.length,s=n?"pre":"",o=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return s+a;return o}};dG.exports=TCe});var EG=w((y$e,mG)=>{var LCe=Li(),OCe=(r,e)=>new LCe(r,e).major;mG.exports=OCe});var yG=w((w$e,IG)=>{var MCe=Li(),KCe=(r,e)=>new MCe(r,e).minor;IG.exports=KCe});var BG=w((B$e,wG)=>{var UCe=Li(),HCe=(r,e)=>new UCe(r,e).patch;wG.exports=HCe});var bG=w((Q$e,QG)=>{var GCe=gc(),YCe=(r,e)=>{let t=GCe(r,e);return t&&t.prerelease.length?t.prerelease:null};QG.exports=YCe});var vG=w((b$e,SG)=>{var jCe=cs(),qCe=(r,e,t)=>jCe(e,r,t);SG.exports=qCe});var PG=w((S$e,xG)=>{var JCe=cs(),WCe=(r,e)=>JCe(r,e,!0);xG.exports=WCe});var HI=w((v$e,kG)=>{var DG=Li(),zCe=(r,e,t)=>{let i=new DG(r,t),n=new DG(e,t);return i.compare(n)||i.compareBuild(n)};kG.exports=zCe});var FG=w((x$e,RG)=>{var VCe=HI(),XCe=(r,e)=>r.sort((t,i)=>VCe(t,i,e));RG.exports=XCe});var TG=w((P$e,NG)=>{var ZCe=HI(),_Ce=(r,e)=>r.sort((t,i)=>ZCe(i,t,e));NG.exports=_Ce});var dd=w((D$e,LG)=>{var $Ce=cs(),eme=(r,e,t)=>$Ce(r,e,t)>0;LG.exports=eme});var GI=w((k$e,OG)=>{var tme=cs(),rme=(r,e,t)=>tme(r,e,t)<0;OG.exports=rme});var Cv=w((R$e,MG)=>{var ime=cs(),nme=(r,e,t)=>ime(r,e,t)!==0;MG.exports=nme});var YI=w((F$e,KG)=>{var sme=cs(),ome=(r,e,t)=>sme(r,e,t)>=0;KG.exports=ome});var jI=w((N$e,UG)=>{var ame=cs(),Ame=(r,e,t)=>ame(r,e,t)<=0;UG.exports=Ame});var mv=w((T$e,HG)=>{var lme=UI(),cme=Cv(),ume=dd(),gme=YI(),fme=GI(),hme=jI(),pme=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return lme(r,t,i);case"!=":return cme(r,t,i);case">":return ume(r,t,i);case">=":return gme(r,t,i);case"<":return fme(r,t,i);case"<=":return hme(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};HG.exports=pme});var YG=w((L$e,GG)=>{var dme=Li(),Cme=gc(),{re:qI,t:JI}=uc(),mme=(r,e)=>{if(r instanceof dme)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(qI[JI.COERCE]);else{let i;for(;(i=qI[JI.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),qI[JI.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;qI[JI.COERCERTL].lastIndex=-1}return t===null?null:Cme(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};GG.exports=mme});var qG=w((O$e,jG)=>{"use strict";jG.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var WI=w((M$e,JG)=>{"use strict";JG.exports=Ht;Ht.Node=fc;Ht.create=Ht;function Ht(r){var e=this;if(e instanceof Ht||(e=new Ht),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Ht.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Ht.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Ht.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Ht.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ht;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Ht.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i{"use strict";var wme=WI(),hc=Symbol("max"),va=Symbol("length"),Wg=Symbol("lengthCalculator"),md=Symbol("allowStale"),pc=Symbol("maxAge"),Sa=Symbol("dispose"),WG=Symbol("noDisposeOnSet"),di=Symbol("lruList"),Zs=Symbol("cache"),VG=Symbol("updateAgeOnGet"),Ev=()=>1,yv=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[hc]=e.max||1/0,i=e.length||Ev;if(this[Wg]=typeof i!="function"?Ev:i,this[md]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[pc]=e.maxAge||0,this[Sa]=e.dispose,this[WG]=e.noDisposeOnSet||!1,this[VG]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[hc]=e||1/0,Cd(this)}get max(){return this[hc]}set allowStale(e){this[md]=!!e}get allowStale(){return this[md]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[pc]=e,Cd(this)}get maxAge(){return this[pc]}set lengthCalculator(e){typeof e!="function"&&(e=Ev),e!==this[Wg]&&(this[Wg]=e,this[va]=0,this[di].forEach(t=>{t.length=this[Wg](t.value,t.key),this[va]+=t.length})),Cd(this)}get lengthCalculator(){return this[Wg]}get length(){return this[va]}get itemCount(){return this[di].length}rforEach(e,t){t=t||this;for(let i=this[di].tail;i!==null;){let n=i.prev;zG(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[di].head;i!==null;){let n=i.next;zG(this,e,i,t),i=n}}keys(){return this[di].toArray().map(e=>e.key)}values(){return this[di].toArray().map(e=>e.value)}reset(){this[Sa]&&this[di]&&this[di].length&&this[di].forEach(e=>this[Sa](e.key,e.value)),this[Zs]=new Map,this[di]=new wme,this[va]=0}dump(){return this[di].map(e=>zI(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[di]}set(e,t,i){if(i=i||this[pc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[Wg](t,e);if(this[Zs].has(e)){if(s>this[hc])return zg(this,this[Zs].get(e)),!1;let l=this[Zs].get(e).value;return this[Sa]&&(this[WG]||this[Sa](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[va]+=s-l.length,l.length=s,this.get(e),Cd(this),!0}let o=new wv(e,t,s,n,i);return o.length>this[hc]?(this[Sa]&&this[Sa](e,t),!1):(this[va]+=o.length,this[di].unshift(o),this[Zs].set(e,this[di].head),Cd(this),!0)}has(e){if(!this[Zs].has(e))return!1;let t=this[Zs].get(e).value;return!zI(this,t)}get(e){return Iv(this,e,!0)}peek(e){return Iv(this,e,!1)}pop(){let e=this[di].tail;return e?(zg(this,e),e.value):null}del(e){zg(this,this[Zs].get(e))}load(e){this.reset();let t=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-t;o>0&&this.set(n.k,n.v,o)}}}prune(){this[Zs].forEach((e,t)=>Iv(this,t,!1))}},Iv=(r,e,t)=>{let i=r[Zs].get(e);if(i){let n=i.value;if(zI(r,n)){if(zg(r,i),!r[md])return}else t&&(r[VG]&&(i.value.now=Date.now()),r[di].unshiftNode(i));return n.value}},zI=(r,e)=>{if(!e||!e.maxAge&&!r[pc])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[pc]&&t>r[pc]},Cd=r=>{if(r[va]>r[hc])for(let e=r[di].tail;r[va]>r[hc]&&e!==null;){let t=e.prev;zg(r,e),e=t}},zg=(r,e)=>{if(e){let t=e.value;r[Sa]&&r[Sa](t.key,t.value),r[va]-=t.length,r[Zs].delete(t.key),r[di].removeNode(e)}},wv=class{constructor(e,t,i,n,s){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=s||0}},zG=(r,e,t,i)=>{let n=t.value;zI(r,n)&&(zg(r,t),r[md]||(n=void 0)),n&&e.call(i,n.value,n.key,r)};XG.exports=yv});var us=w((U$e,tY)=>{var dc=class{constructor(e,t){if(t=Qme(t),e instanceof dc)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new dc(e.raw,t);if(e instanceof Bv)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!$G(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Pme(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let i=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=_G.get(i);if(n)return n;let s=this.options.loose,o=s?Oi[Qi.HYPHENRANGELOOSE]:Oi[Qi.HYPHENRANGE];e=e.replace(o,Kme(this.options.includePrerelease)),Gr("hyphen replace",e),e=e.replace(Oi[Qi.COMPARATORTRIM],Sme),Gr("comparator trim",e,Oi[Qi.COMPARATORTRIM]),e=e.replace(Oi[Qi.TILDETRIM],vme),e=e.replace(Oi[Qi.CARETTRIM],xme),e=e.split(/\s+/).join(" ");let a=s?Oi[Qi.COMPARATORLOOSE]:Oi[Qi.COMPARATOR],l=e.split(" ").map(f=>Dme(f,this.options)).join(" ").split(/\s+/).map(f=>Mme(f,this.options)).filter(this.options.loose?f=>!!f.match(a):()=>!0).map(f=>new Bv(f,this.options)),c=l.length,u=new Map;for(let f of l){if($G(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let g=[...u.values()];return _G.set(i,g),g}intersects(e,t){if(!(e instanceof dc))throw new TypeError("a Range is required");return this.set.some(i=>eY(i,t)&&e.set.some(n=>eY(n,t)&&i.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new bme(e,this.options)}catch{return!1}for(let t=0;tr.value==="<0.0.0-0",Pme=r=>r.value==="",eY=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(s=>n.intersects(s,e)),n=i.pop();return t},Dme=(r,e)=>(Gr("comp",r,e),r=Fme(r,e),Gr("caret",r),r=kme(r,e),Gr("tildes",r),r=Tme(r,e),Gr("xrange",r),r=Ome(r,e),Gr("stars",r),r),$i=r=>!r||r.toLowerCase()==="x"||r==="*",kme=(r,e)=>r.trim().split(/\s+/).map(t=>Rme(t,e)).join(" "),Rme=(r,e)=>{let t=e.loose?Oi[Qi.TILDELOOSE]:Oi[Qi.TILDE];return r.replace(t,(i,n,s,o,a)=>{Gr("tilde",r,i,n,s,o,a);let l;return $i(n)?l="":$i(s)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:$i(o)?l=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(Gr("replaceTilde pr",a),l=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):l=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,Gr("tilde return",l),l})},Fme=(r,e)=>r.trim().split(/\s+/).map(t=>Nme(t,e)).join(" "),Nme=(r,e)=>{Gr("caret",r,e);let t=e.loose?Oi[Qi.CARETLOOSE]:Oi[Qi.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,s,o,a,l)=>{Gr("caret",r,n,s,o,a,l);let c;return $i(s)?c="":$i(o)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:$i(a)?s==="0"?c=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:l?(Gr("replaceCaret pr",l),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${l} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${l} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${l} <${+s+1}.0.0-0`):(Gr("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Gr("caret return",c),c})},Tme=(r,e)=>(Gr("replaceXRanges",r,e),r.split(/\s+/).map(t=>Lme(t,e)).join(" ")),Lme=(r,e)=>{r=r.trim();let t=e.loose?Oi[Qi.XRANGELOOSE]:Oi[Qi.XRANGE];return r.replace(t,(i,n,s,o,a,l)=>{Gr("xRange",r,i,n,s,o,a,l);let c=$i(s),u=c||$i(o),g=u||$i(a),f=g;return n==="="&&f&&(n=""),l=e.includePrerelease?"-0":"",c?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&f?(u&&(o=0),a=0,n===">"?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",u?s=+s+1:o=+o+1),n==="<"&&(l="-0"),i=`${n+s}.${o}.${a}${l}`):u?i=`>=${s}.0.0${l} <${+s+1}.0.0-0`:g&&(i=`>=${s}.${o}.0${l} <${s}.${+o+1}.0-0`),Gr("xRange return",i),i})},Ome=(r,e)=>(Gr("replaceStars",r,e),r.trim().replace(Oi[Qi.STAR],"")),Mme=(r,e)=>(Gr("replaceGTE0",r,e),r.trim().replace(Oi[e.includePrerelease?Qi.GTE0PRE:Qi.GTE0],"")),Kme=r=>(e,t,i,n,s,o,a,l,c,u,g,f,h)=>($i(i)?t="":$i(n)?t=`>=${i}.0.0${r?"-0":""}`:$i(s)?t=`>=${i}.${n}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,$i(c)?l="":$i(u)?l=`<${+c+1}.0.0-0`:$i(g)?l=`<${c}.${+u+1}.0-0`:f?l=`<=${c}.${u}.${g}-${f}`:r?l=`<${c}.${u}.${+g+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),Ume=(r,e,t)=>{for(let i=0;i0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Ed=w((H$e,oY)=>{var Id=Symbol("SemVer ANY"),Vg=class{static get ANY(){return Id}constructor(e,t){if(t=Hme(t),e instanceof Vg){if(e.loose===!!t.loose)return e;e=e.value}bv("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Id?this.value="":this.value=this.operator+this.semver.version,bv("comp",this)}parse(e){let t=this.options.loose?rY[iY.COMPARATORLOOSE]:rY[iY.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new nY(i[2],this.options.loose):this.semver=Id}toString(){return this.value}test(e){if(bv("Comparator.test",e,this.options.loose),this.semver===Id||e===Id)return!0;if(typeof e=="string")try{e=new nY(e,this.options)}catch{return!1}return Qv(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Vg))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new sY(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new sY(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=Qv(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=Qv(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||s&&o||a||l}};oY.exports=Vg;var Hme=hd(),{re:rY,t:iY}=uc(),Qv=mv(),bv=fd(),nY=Li(),sY=us()});var yd=w((G$e,aY)=>{var Gme=us(),Yme=(r,e,t)=>{try{e=new Gme(e,t)}catch{return!1}return e.test(r)};aY.exports=Yme});var lY=w((Y$e,AY)=>{var jme=us(),qme=(r,e)=>new jme(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));AY.exports=qme});var uY=w((j$e,cY)=>{var Jme=Li(),Wme=us(),zme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new Wme(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new Jme(i,t))}),i};cY.exports=zme});var fY=w((q$e,gY)=>{var Vme=Li(),Xme=us(),Zme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new Xme(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new Vme(i,t))}),i};gY.exports=Zme});var dY=w((J$e,pY)=>{var Sv=Li(),_me=us(),hY=dd(),$me=(r,e)=>{r=new _me(r,e);let t=new Sv("0.0.0");if(r.test(t)||(t=new Sv("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i{let a=new Sv(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||hY(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||hY(t,s))&&(t=s)}return t&&r.test(t)?t:null};pY.exports=$me});var mY=w((W$e,CY)=>{var eEe=us(),tEe=(r,e)=>{try{return new eEe(r,e).range||"*"}catch{return null}};CY.exports=tEe});var VI=w((z$e,wY)=>{var rEe=Li(),yY=Ed(),{ANY:iEe}=yY,nEe=us(),sEe=yd(),EY=dd(),IY=GI(),oEe=jI(),aEe=YI(),AEe=(r,e,t,i)=>{r=new rEe(r,i),e=new nEe(e,i);let n,s,o,a,l;switch(t){case">":n=EY,s=oEe,o=IY,a=">",l=">=";break;case"<":n=IY,s=aEe,o=EY,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(sEe(r,e,i))return!1;for(let c=0;c{h.semver===iEe&&(h=new yY(">=0.0.0")),g=g||h,f=f||h,n(h.semver,g.semver,i)?g=h:o(h.semver,f.semver,i)&&(f=h)}),g.operator===a||g.operator===l||(!f.operator||f.operator===a)&&s(r,f.semver))return!1;if(f.operator===l&&o(r,f.semver))return!1}return!0};wY.exports=AEe});var QY=w((V$e,BY)=>{var lEe=VI(),cEe=(r,e,t)=>lEe(r,e,">",t);BY.exports=cEe});var SY=w((X$e,bY)=>{var uEe=VI(),gEe=(r,e,t)=>uEe(r,e,"<",t);bY.exports=gEe});var PY=w((Z$e,xY)=>{var vY=us(),fEe=(r,e,t)=>(r=new vY(r,t),e=new vY(e,t),r.intersects(e));xY.exports=fEe});var kY=w((_$e,DY)=>{var hEe=yd(),pEe=cs();DY.exports=(r,e,t)=>{let i=[],n=null,s=null,o=r.sort((u,g)=>pEe(u,g,t));for(let u of o)hEe(u,e,t)?(s=u,n||(n=u)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,g]of i)u===g?a.push(u):!g&&u===o[0]?a.push("*"):g?u===o[0]?a.push(`<=${g}`):a.push(`${u} - ${g}`):a.push(`>=${u}`);let l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{var RY=us(),XI=Ed(),{ANY:vv}=XI,wd=yd(),xv=cs(),dEe=(r,e,t={})=>{if(r===e)return!0;r=new RY(r,t),e=new RY(e,t);let i=!1;e:for(let n of r.set){for(let s of e.set){let o=CEe(n,s,t);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},CEe=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===vv){if(e.length===1&&e[0].semver===vv)return!0;t.includePrerelease?r=[new XI(">=0.0.0-0")]:r=[new XI(">=0.0.0")]}if(e.length===1&&e[0].semver===vv){if(t.includePrerelease)return!0;e=[new XI(">=0.0.0")]}let i=new Set,n,s;for(let h of r)h.operator===">"||h.operator===">="?n=FY(n,h,t):h.operator==="<"||h.operator==="<="?s=NY(s,h,t):i.add(h.semver);if(i.size>1)return null;let o;if(n&&s){if(o=xv(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of i){if(n&&!wd(h,String(n),t)||s&&!wd(h,String(s),t))return null;for(let p of e)if(!wd(h,String(p),t))return!1;return!0}let a,l,c,u,g=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",n){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=FY(n,h,t),a===h&&a!==n)return!1}else if(n.operator===">="&&!wd(n.semver,String(h),t))return!1}if(s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator==="<"||h.operator==="<="){if(l=NY(s,h,t),l===h&&l!==s)return!1}else if(s.operator==="<="&&!wd(s.semver,String(h),t))return!1}if(!h.operator&&(s||n)&&o!==0)return!1}return!(n&&c&&!s&&o!==0||s&&u&&!n&&o!==0||f||g)},FY=(r,e,t)=>{if(!r)return e;let i=xv(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},NY=(r,e,t)=>{if(!r)return e;let i=xv(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};TY.exports=dEe});var Xr=w((eet,OY)=>{var Pv=uc();OY.exports={re:Pv.re,src:Pv.src,tokens:Pv.t,SEMVER_SPEC_VERSION:gd().SEMVER_SPEC_VERSION,SemVer:Li(),compareIdentifiers:OI().compareIdentifiers,rcompareIdentifiers:OI().rcompareIdentifiers,parse:gc(),valid:aG(),clean:lG(),inc:uG(),diff:CG(),major:EG(),minor:yG(),patch:BG(),prerelease:bG(),compare:cs(),rcompare:vG(),compareLoose:PG(),compareBuild:HI(),sort:FG(),rsort:TG(),gt:dd(),lt:GI(),eq:UI(),neq:Cv(),gte:YI(),lte:jI(),cmp:mv(),coerce:YG(),Comparator:Ed(),Range:us(),satisfies:yd(),toComparators:lY(),maxSatisfying:uY(),minSatisfying:fY(),minVersion:dY(),validRange:mY(),outside:VI(),gtr:QY(),ltr:SY(),intersects:PY(),simplifyRange:kY(),subset:LY()}});var Dv=w(ZI=>{"use strict";Object.defineProperty(ZI,"__esModule",{value:!0});ZI.VERSION=void 0;ZI.VERSION="9.1.0"});var Gt=w((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof _I=="object"&&_I.exports?_I.exports=e():r.regexpToAst=e()})(typeof self<"u"?self:MY,function(){function r(){}r.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},r.prototype.restoreState=function(p){this.idx=p.idx,this.input=p.input,this.groupIdx=p.groupIdx},r.prototype.pattern=function(p){this.idx=0,this.input=p,this.groupIdx=0,this.consumeChar("/");var C=this.disjunction();this.consumeChar("/");for(var y={type:"Flags",loc:{begin:this.idx,end:p.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(y,"global");break;case"i":o(y,"ignoreCase");break;case"m":o(y,"multiLine");break;case"u":o(y,"unicode");break;case"y":o(y,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:y,value:C,loc:this.loc(0)}},r.prototype.disjunction=function(){var p=[],C=this.idx;for(p.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),p.push(this.alternative());return{type:"Disjunction",value:p,loc:this.loc(C)}},r.prototype.alternative=function(){for(var p=[],C=this.idx;this.isTerm();)p.push(this.term());return{type:"Alternative",value:p,loc:this.loc(C)}},r.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},r.prototype.assertion=function(){var p=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(p)};case"$":return{type:"EndAnchor",loc:this.loc(p)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(p)};case"B":return{type:"NonWordBoundary",loc:this.loc(p)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var C;switch(this.popChar()){case"=":C="Lookahead";break;case"!":C="NegativeLookahead";break}a(C);var y=this.disjunction();return this.consumeChar(")"),{type:C,value:y,loc:this.loc(p)}}l()},r.prototype.quantifier=function(p){var C,y=this.idx;switch(this.popChar()){case"*":C={atLeast:0,atMost:1/0};break;case"+":C={atLeast:1,atMost:1/0};break;case"?":C={atLeast:0,atMost:1};break;case"{":var B=this.integerIncludingZero();switch(this.popChar()){case"}":C={atLeast:B,atMost:B};break;case",":var v;this.isDigit()?(v=this.integerIncludingZero(),C={atLeast:B,atMost:v}):C={atLeast:B,atMost:1/0},this.consumeChar("}");break}if(p===!0&&C===void 0)return;a(C);break}if(!(p===!0&&C===void 0))return a(C),this.peekChar(0)==="?"?(this.consumeChar("?"),C.greedy=!1):C.greedy=!0,C.type="Quantifier",C.loc=this.loc(y),C},r.prototype.atom=function(){var p,C=this.idx;switch(this.peekChar()){case".":p=this.dotAll();break;case"\\":p=this.atomEscape();break;case"[":p=this.characterClass();break;case"(":p=this.group();break}return p===void 0&&this.isPatternCharacter()&&(p=this.patternCharacter()),a(p),p.loc=this.loc(C),this.isQuantifier()&&(p.quantifier=this.quantifier()),p},r.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[n(` -`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},r.prototype.characterClassEscape=function(){var p,C=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,C=!0;break;case"s":p=f;break;case"S":p=f,C=!0;break;case"w":p=g;break;case"W":p=g,C=!0;break}return a(p),{type:"Set",value:p,complement:C}},r.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(` -`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var C=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:C}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],C=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),C=!0);this.isClassAtom();){var y=this.classAtom(),B=y.type==="Character";if(B&&this.isRangeDash()){this.consumeChar("-");var v=this.classAtom(),D=v.type==="Character";if(D){if(v.value=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,C){p.length!==void 0?p.forEach(function(y){C.push(y)}):C.push(p)}function o(p,C){if(p[C]===!0)throw"duplicate flag "+C;p[C]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(` -`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var C in p){var y=p[C];p.hasOwnProperty(C)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(B){this.visit(B)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var ty=w(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});Xg.clearRegExpParserCache=Xg.getRegExpAst=void 0;var mEe=$I(),ey={},EEe=new mEe.RegExpParser;function IEe(r){var e=r.toString();if(ey.hasOwnProperty(e))return ey[e];var t=EEe.pattern(e);return ey[e]=t,t}Xg.getRegExpAst=IEe;function yEe(){ey={}}Xg.clearRegExpParserCache=yEe});var YY=w(Cn=>{"use strict";var wEe=Cn&&Cn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Cn,"__esModule",{value:!0});Cn.canMatchCharCode=Cn.firstCharOptimizedIndices=Cn.getOptimizedStartCodesIndices=Cn.failedOptimizationPrefixMsg=void 0;var UY=$I(),gs=Gt(),HY=ty(),xa=Rv(),GY="Complement Sets are not supported for first char optimization";Cn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations: -`;function BEe(r,e){e===void 0&&(e=!1);try{var t=(0,HY.getRegExpAst)(r),i=iy(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===GY)e&&(0,gs.PRINT_WARNING)(""+Cn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` > -`)+` Complement Sets cannot be automatically optimized. - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=` - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,gs.PRINT_ERROR)(Cn.failedOptimizationPrefixMsg+` -`+(" Failed parsing: < "+r.toString()+` > -`)+(" Using the regexp-to-ast library version: "+UY.VERSION+` -`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}Cn.getOptimizedStartCodesIndices=BEe;function iy(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i=xa.minOptimizationVal)for(var f=u.from>=xa.minOptimizationVal?u.from:xa.minOptimizationVal,h=u.to,p=(0,xa.charCodeToOptimizedIndex)(f),C=(0,xa.charCodeToOptimizedIndex)(h),y=p;y<=C;y++)e[y]=y}}});break;case"Group":iy(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&kv(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,gs.values)(e)}Cn.firstCharOptimizedIndices=iy;function ry(r,e,t){var i=(0,xa.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&QEe(r,e)}function QEe(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,xa.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,xa.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function KY(r,e){return(0,gs.find)(r.value,function(t){if(typeof t=="number")return(0,gs.contains)(e,t);var i=t;return(0,gs.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function kv(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,gs.isArray)(r.value)?(0,gs.every)(r.value,kv):kv(r.value):!1}var bEe=function(r){wEe(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,gs.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?KY(t,this.targetCharCodes)===void 0&&(this.found=!0):KY(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(UY.BaseRegExpVisitor);function SEe(r,e){if(e instanceof RegExp){var t=(0,HY.getRegExpAst)(e),i=new bEe(r);return i.visit(t),i.found}else return(0,gs.find)(e,function(n){return(0,gs.contains)(r,n.charCodeAt(0))})!==void 0}Cn.canMatchCharCode=SEe});var Rv=w(Ve=>{"use strict";var jY=Ve&&Ve.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.charCodeToOptimizedIndex=Ve.minOptimizationVal=Ve.buildLineBreakIssueMessage=Ve.LineTerminatorOptimizedTester=Ve.isShortPattern=Ve.isCustomPattern=Ve.cloneEmptyGroups=Ve.performWarningRuntimeChecks=Ve.performRuntimeChecks=Ve.addStickyFlag=Ve.addStartOfInput=Ve.findUnreachablePatterns=Ve.findModesThatDoNotExist=Ve.findInvalidGroupType=Ve.findDuplicatePatterns=Ve.findUnsupportedFlags=Ve.findStartOfInputAnchor=Ve.findEmptyMatchRegExps=Ve.findEndOfInputAnchor=Ve.findInvalidPatterns=Ve.findMissingPatterns=Ve.validatePatterns=Ve.analyzeTokenTypes=Ve.enableSticky=Ve.disableSticky=Ve.SUPPORT_STICKY=Ve.MODES=Ve.DEFAULT_MODE=void 0;var qY=$I(),ir=Bd(),xe=Gt(),Zg=YY(),JY=ty(),Do="PATTERN";Ve.DEFAULT_MODE="defaultMode";Ve.MODES="modes";Ve.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function vEe(){Ve.SUPPORT_STICKY=!1}Ve.disableSticky=vEe;function xEe(){Ve.SUPPORT_STICKY=!0}Ve.enableSticky=xEe;function PEe(r,e){e=(0,xe.defaults)(e,{useSticky:Ve.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:function(v,D){return D()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){KEe()});var i;t("Reject Lexer.NA",function(){i=(0,xe.reject)(r,function(v){return v[Do]===ir.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,xe.map)(i,function(v){var D=v[Do];if((0,xe.isRegExp)(D)){var T=D.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!D.ignoreCase?T:T.length===2&&T[0]==="\\"&&!(0,xe.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?Tv(D):Nv(D)}else{if((0,xe.isFunction)(D))return n=!0,{exec:D};if((0,xe.has)(D,"exec"))return n=!0,D;if(typeof D=="string"){if(D.length===1)return D;var H=D.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),j=new RegExp(H);return e.useSticky?Tv(j):Nv(j)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,xe.map)(i,function(v){return v.tokenTypeIdx}),a=(0,xe.map)(i,function(v){var D=v.GROUP;if(D!==ir.Lexer.SKIPPED){if((0,xe.isString)(D))return D;if((0,xe.isUndefined)(D))return!1;throw Error("non exhaustive match")}}),l=(0,xe.map)(i,function(v){var D=v.LONGER_ALT;if(D){var T=(0,xe.isArray)(D)?(0,xe.map)(D,function(H){return(0,xe.indexOf)(i,H)}):[(0,xe.indexOf)(i,D)];return T}}),c=(0,xe.map)(i,function(v){return v.PUSH_MODE}),u=(0,xe.map)(i,function(v){return(0,xe.has)(v,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var v=oj(e.lineTerminatorCharacters);g=(0,xe.map)(i,function(D){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,xe.map)(i,function(D){if((0,xe.has)(D,"LINE_BREAKS"))return D.LINE_BREAKS;if(nj(D,v)===!1)return(0,Zg.canMatchCharCode)(v,D.PATTERN)}))});var f,h,p,C;t("Misc Mapping #2",function(){f=(0,xe.map)(i,Ov),h=(0,xe.map)(s,ij),p=(0,xe.reduce)(i,function(v,D){var T=D.GROUP;return(0,xe.isString)(T)&&T!==ir.Lexer.SKIPPED&&(v[T]=[]),v},{}),C=(0,xe.map)(s,function(v,D){return{pattern:s[D],longerAlt:l[D],canLineTerminator:g[D],isCustom:f[D],short:h[D],group:a[D],push:c[D],pop:u[D],tokenTypeIdx:o[D],tokenType:i[D]}})});var y=!0,B=[];return e.safeMode||t("First Char Optimization",function(){B=(0,xe.reduce)(i,function(v,D,T){if(typeof D.PATTERN=="string"){var H=D.PATTERN.charCodeAt(0),j=Lv(H);Fv(v,j,C[T])}else if((0,xe.isArray)(D.START_CHARS_HINT)){var $;(0,xe.forEach)(D.START_CHARS_HINT,function(W){var _=typeof W=="string"?W.charCodeAt(0):W,A=Lv(_);$!==A&&($=A,Fv(v,A,C[T]))})}else if((0,xe.isRegExp)(D.PATTERN))if(D.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,xe.PRINT_ERROR)(""+Zg.failedOptimizationPrefixMsg+(" Unable to analyze < "+D.PATTERN.toString()+` > pattern. -`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var V=(0,Zg.getOptimizedStartCodesIndices)(D.PATTERN,e.ensureOptimizations);(0,xe.isEmpty)(V)&&(y=!1),(0,xe.forEach)(V,function(W){Fv(v,W,C[T])})}else e.ensureOptimizations&&(0,xe.PRINT_ERROR)(""+Zg.failedOptimizationPrefixMsg+(" TokenType: <"+D.name+`> is using a custom token pattern without providing parameter. -`)+` This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return v},[])}),t("ArrayPacking",function(){B=(0,xe.packArray)(B)}),{emptyGroups:p,patternIdxToConfig:C,charCodeToPatternIdxToConfig:B,hasCustom:n,canBeOptimized:y}}Ve.analyzeTokenTypes=PEe;function DEe(r,e){var t=[],i=WY(r);t=t.concat(i.errors);var n=zY(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(kEe(s)),t=t.concat(ej(s)),t=t.concat(tj(s,e)),t=t.concat(rj(s)),t}Ve.validatePatterns=DEe;function kEe(r){var e=[],t=(0,xe.filter)(r,function(i){return(0,xe.isRegExp)(i[Do])});return e=e.concat(VY(t)),e=e.concat(ZY(t)),e=e.concat(_Y(t)),e=e.concat($Y(t)),e=e.concat(XY(t)),e}function WY(r){var e=(0,xe.filter)(r,function(n){return!(0,xe.has)(n,Do)}),t=(0,xe.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:ir.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,xe.difference)(r,e);return{errors:t,valid:i}}Ve.findMissingPatterns=WY;function zY(r){var e=(0,xe.filter)(r,function(n){var s=n[Do];return!(0,xe.isRegExp)(s)&&!(0,xe.isFunction)(s)&&!(0,xe.has)(s,"exec")&&!(0,xe.isString)(s)}),t=(0,xe.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ir.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,xe.difference)(r,e);return{errors:t,valid:i}}Ve.findInvalidPatterns=zY;var REe=/[^\\][\$]/;function VY(r){var e=function(n){jY(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(qY.BaseRegExpVisitor),t=(0,xe.filter)(r,function(n){var s=n[Do];try{var o=(0,JY.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return REe.test(s.source)}}),i=(0,xe.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ve.findEndOfInputAnchor=VY;function XY(r){var e=(0,xe.filter)(r,function(i){var n=i[Do];return n.test("")}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:ir.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Ve.findEmptyMatchRegExps=XY;var FEe=/[^\\[][\^]|^\^/;function ZY(r){var e=function(n){jY(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(qY.BaseRegExpVisitor),t=(0,xe.filter)(r,function(n){var s=n[Do];try{var o=(0,JY.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return FEe.test(s.source)}}),i=(0,xe.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ve.findStartOfInputAnchor=ZY;function _Y(r){var e=(0,xe.filter)(r,function(i){var n=i[Do];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ir.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ve.findUnsupportedFlags=_Y;function $Y(r){var e=[],t=(0,xe.map)(r,function(s){return(0,xe.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,xe.contains)(e,a)&&a.PATTERN!==ir.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,xe.compact)(t);var i=(0,xe.filter)(t,function(s){return s.length>1}),n=(0,xe.map)(i,function(s){var o=(0,xe.map)(s,function(l){return l.name}),a=(0,xe.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:ir.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ve.findDuplicatePatterns=$Y;function ej(r){var e=(0,xe.filter)(r,function(i){if(!(0,xe.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==ir.Lexer.SKIPPED&&n!==ir.Lexer.NA&&!(0,xe.isString)(n)}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ir.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ve.findInvalidGroupType=ej;function tj(r,e){var t=(0,xe.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,xe.contains)(e,n.PUSH_MODE)}),i=(0,xe.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:ir.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ve.findModesThatDoNotExist=tj;function rj(r){var e=[],t=(0,xe.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===ir.Lexer.NA||((0,xe.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,xe.isRegExp)(o)&&TEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,xe.forEach)(r,function(i,n){(0,xe.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n"+i.name+"<-")+`in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:ir.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ve.findUnreachablePatterns=rj;function NEe(r,e){if((0,xe.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,xe.isFunction)(e))return e(r,0,[],{});if((0,xe.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function TEe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,xe.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function Nv(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Ve.addStartOfInput=Nv;function Tv(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Ve.addStickyFlag=Tv;function LEe(r,e,t){var i=[];return(0,xe.has)(r,Ve.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ve.DEFAULT_MODE+`> property in its definition -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,xe.has)(r,Ve.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ve.MODES+`> property in its definition -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,xe.has)(r,Ve.MODES)&&(0,xe.has)(r,Ve.DEFAULT_MODE)&&!(0,xe.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ve.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist -`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,xe.has)(r,Ve.MODES)&&(0,xe.forEach)(r.modes,function(n,s){(0,xe.forEach)(n,function(o,a){(0,xe.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`> -`),type:ir.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ve.performRuntimeChecks=LEe;function OEe(r,e,t){var i=[],n=!1,s=(0,xe.compact)((0,xe.flatten)((0,xe.mapValues)(r.modes,function(l){return l}))),o=(0,xe.reject)(s,function(l){return l[Do]===ir.Lexer.NA}),a=oj(t);return e&&(0,xe.forEach)(o,function(l){var c=nj(l,a);if(c!==!1){var u=sj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,xe.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,Zg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. - This Lexer has been defined to track line and column information, - But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:ir.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ve.performWarningRuntimeChecks=OEe;function MEe(r){var e={},t=(0,xe.keys)(r);return(0,xe.forEach)(t,function(i){var n=r[i];if((0,xe.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ve.cloneEmptyGroups=MEe;function Ov(r){var e=r.PATTERN;if((0,xe.isRegExp)(e))return!1;if((0,xe.isFunction)(e))return!0;if((0,xe.has)(e,"exec"))return!0;if((0,xe.isString)(e))return!1;throw Error("non exhaustive match")}Ve.isCustomPattern=Ov;function ij(r){return(0,xe.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Ve.isShortPattern=ij;Ve.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type -`)+(" Root cause: "+e.errMsg+`. -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===ir.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. -`+(" The problem is in the <"+r.name+`> Token Type -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ve.buildLineBreakIssueMessage=sj;function oj(r){var e=(0,xe.map)(r,function(t){return(0,xe.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function Fv(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Ve.minOptimizationVal=256;var ny=[];function Lv(r){return r255?255+~~(r/255):r}}});var _g=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.isTokenType=Nt.hasExtendingTokensTypesMapProperty=Nt.hasExtendingTokensTypesProperty=Nt.hasCategoriesProperty=Nt.hasShortKeyProperty=Nt.singleAssignCategoriesToksMap=Nt.assignCategoriesMapProp=Nt.assignCategoriesTokensProp=Nt.assignTokenDefaultProps=Nt.expandCategories=Nt.augmentTokenTypes=Nt.tokenIdxToClass=Nt.tokenShortNameIdx=Nt.tokenStructuredMatcherNoCategories=Nt.tokenStructuredMatcher=void 0;var Zr=Gt();function UEe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Nt.tokenStructuredMatcher=UEe;function HEe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Nt.tokenStructuredMatcherNoCategories=HEe;Nt.tokenShortNameIdx=1;Nt.tokenIdxToClass={};function GEe(r){var e=aj(r);Aj(e),cj(e),lj(e),(0,Zr.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Nt.augmentTokenTypes=GEe;function aj(r){for(var e=(0,Zr.cloneArr)(r),t=r,i=!0;i;){t=(0,Zr.compact)((0,Zr.flatten)((0,Zr.map)(t,function(s){return s.CATEGORIES})));var n=(0,Zr.difference)(t,e);e=e.concat(n),(0,Zr.isEmpty)(n)?i=!1:t=n}return e}Nt.expandCategories=aj;function Aj(r){(0,Zr.forEach)(r,function(e){uj(e)||(Nt.tokenIdxToClass[Nt.tokenShortNameIdx]=e,e.tokenTypeIdx=Nt.tokenShortNameIdx++),Mv(e)&&!(0,Zr.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Mv(e)||(e.CATEGORIES=[]),gj(e)||(e.categoryMatches=[]),fj(e)||(e.categoryMatchesMap={})})}Nt.assignTokenDefaultProps=Aj;function lj(r){(0,Zr.forEach)(r,function(e){e.categoryMatches=[],(0,Zr.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Nt.tokenIdxToClass[i].tokenTypeIdx)})})}Nt.assignCategoriesTokensProp=lj;function cj(r){(0,Zr.forEach)(r,function(e){Kv([],e)})}Nt.assignCategoriesMapProp=cj;function Kv(r,e){(0,Zr.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,Zr.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,Zr.contains)(i,t)||Kv(i,t)})}Nt.singleAssignCategoriesToksMap=Kv;function uj(r){return(0,Zr.has)(r,"tokenTypeIdx")}Nt.hasShortKeyProperty=uj;function Mv(r){return(0,Zr.has)(r,"CATEGORIES")}Nt.hasCategoriesProperty=Mv;function gj(r){return(0,Zr.has)(r,"categoryMatches")}Nt.hasExtendingTokensTypesProperty=gj;function fj(r){return(0,Zr.has)(r,"categoryMatchesMap")}Nt.hasExtendingTokensTypesMapProperty=fj;function YEe(r){return(0,Zr.has)(r,"tokenTypeIdx")}Nt.isTokenType=YEe});var Uv=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.defaultLexerErrorProvider=void 0;sy.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Bd=w(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.Lexer=Cc.LexerDefinitionErrorType=void 0;var _s=Rv(),nr=Gt(),jEe=_g(),qEe=Uv(),JEe=ty(),WEe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(WEe=Cc.LexerDefinitionErrorType||(Cc.LexerDefinitionErrorType={}));var Qd={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:qEe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Qd);var zEe=function(){function r(e,t){var i=this;if(t===void 0&&(t=Qd),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=(0,nr.merge)(Qd,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===Qd.lineTerminatorsPattern)i.config.lineTerminatorsPattern=_s.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Qd.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,nr.isArray)(e)?(s={modes:{}},s.modes[_s.DEFAULT_MODE]=(0,nr.cloneArr)(e),s[_s.DEFAULT_MODE]=_s.DEFAULT_MODE):(o=!1,s=(0,nr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,_s.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,_s.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,nr.forEach)(s.modes,function(u,g){s.modes[g]=(0,nr.reject)(u,function(f){return(0,nr.isUndefined)(f)})});var a=(0,nr.keys)(s.modes);if((0,nr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,_s.validatePatterns)(u,a))}),(0,nr.isEmpty)(i.lexerDefinitionErrors)){(0,jEe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,_s.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,nr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,nr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,nr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`----------------------- -`);throw new Error(`Errors detected in definition of Lexer: -`+c)}(0,nr.forEach)(i.lexerDefinitionWarning,function(u){(0,nr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(_s.SUPPORT_STICKY?(i.chopInput=nr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=nr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=nr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=nr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=nr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,nr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,nr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized. - Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,JEe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,nr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,nr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,nr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`----------------------- -`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,C,y,B,v,D,T=e,H=T.length,j=0,$=0,V=this.hasCustom?0:Math.floor(e.length/10),W=new Array(V),_=[],A=this.trackStartLines?1:void 0,Ae=this.trackStartLines?1:void 0,ge=(0,_s.cloneEmptyGroups)(this.emptyGroups),re=this.trackStartLines,O=this.config.lineTerminatorsPattern,F=0,ue=[],pe=[],ke=[],Fe=[];Object.freeze(Fe);var Ne=void 0;function oe(){return ue}function le(pr){var Ii=(0,_s.charCodeToOptimizedIndex)(pr),rs=pe[Ii];return rs===void 0?Fe:rs}var Be=function(pr){if(ke.length===1&&pr.tokenType.PUSH_MODE===void 0){var Ii=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(pr);_.push({offset:pr.startOffset,line:pr.startLine!==void 0?pr.startLine:void 0,column:pr.startColumn!==void 0?pr.startColumn:void 0,length:pr.image.length,message:Ii})}else{ke.pop();var rs=(0,nr.last)(ke);ue=i.patternIdxToConfig[rs],pe=i.charCodeToPatternIdxToConfig[rs],F=ue.length;var fa=i.canModeBeOptimized[rs]&&i.config.safeMode===!1;pe&&fa?Ne=le:Ne=oe}};function fe(pr){ke.push(pr),pe=this.charCodeToPatternIdxToConfig[pr],ue=this.patternIdxToConfig[pr],F=ue.length,F=ue.length;var Ii=this.canModeBeOptimized[pr]&&this.config.safeMode===!1;pe&&Ii?Ne=le:Ne=oe}fe.call(this,t);for(var ae;jc.length){c=a,u=g,ae=_e;break}}}break}}if(c!==null){if(f=c.length,h=ae.group,h!==void 0&&(p=ae.tokenTypeIdx,C=this.createTokenInstance(c,j,p,ae.tokenType,A,Ae,f),this.handlePayload(C,u),h===!1?$=this.addToken(W,$,C):ge[h].push(C)),e=this.chopInput(e,f),j=j+f,Ae=this.computeNewColumn(Ae,f),re===!0&&ae.canLineTerminator===!0){var It=0,Or=void 0,ii=void 0;O.lastIndex=0;do Or=O.test(c),Or===!0&&(ii=O.lastIndex-1,It++);while(Or===!0);It!==0&&(A=A+It,Ae=f-ii,this.updateTokenEndLineColumnLocation(C,h,ii,It,A,Ae,f))}this.handleModes(ae,Be,fe,C)}else{for(var gi=j,hr=A,fi=Ae,ni=!1;!ni&&j <"+e+">");var n=(0,nr.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",r.NA=/NOT_APPLICABLE/,r}();Cc.Lexer=zEe});var LA=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.tokenMatcher=bi.createTokenInstance=bi.EOF=bi.createToken=bi.hasTokenLabel=bi.tokenName=bi.tokenLabel=void 0;var $s=Gt(),VEe=Bd(),Hv=_g();function XEe(r){return wj(r)?r.LABEL:r.name}bi.tokenLabel=XEe;function ZEe(r){return r.name}bi.tokenName=ZEe;function wj(r){return(0,$s.isString)(r.LABEL)&&r.LABEL!==""}bi.hasTokenLabel=wj;var _Ee="parent",hj="categories",pj="label",dj="group",Cj="push_mode",mj="pop_mode",Ej="longer_alt",Ij="line_breaks",yj="start_chars_hint";function Bj(r){return $Ee(r)}bi.createToken=Bj;function $Ee(r){var e=r.pattern,t={};if(t.name=r.name,(0,$s.isUndefined)(e)||(t.PATTERN=e),(0,$s.has)(r,_Ee))throw`The parent property is no longer supported. -See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,$s.has)(r,hj)&&(t.CATEGORIES=r[hj]),(0,Hv.augmentTokenTypes)([t]),(0,$s.has)(r,pj)&&(t.LABEL=r[pj]),(0,$s.has)(r,dj)&&(t.GROUP=r[dj]),(0,$s.has)(r,mj)&&(t.POP_MODE=r[mj]),(0,$s.has)(r,Cj)&&(t.PUSH_MODE=r[Cj]),(0,$s.has)(r,Ej)&&(t.LONGER_ALT=r[Ej]),(0,$s.has)(r,Ij)&&(t.LINE_BREAKS=r[Ij]),(0,$s.has)(r,yj)&&(t.START_CHARS_HINT=r[yj]),t}bi.EOF=Bj({name:"EOF",pattern:VEe.Lexer.NA});(0,Hv.augmentTokenTypes)([bi.EOF]);function eIe(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}bi.createTokenInstance=eIe;function tIe(r,e){return(0,Hv.tokenStructuredMatcher)(r,e)}bi.tokenMatcher=tIe});var mn=w(zt=>{"use strict";var Pa=zt&&zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zt,"__esModule",{value:!0});zt.serializeProduction=zt.serializeGrammar=zt.Terminal=zt.Alternation=zt.RepetitionWithSeparator=zt.Repetition=zt.RepetitionMandatoryWithSeparator=zt.RepetitionMandatory=zt.Option=zt.Alternative=zt.Rule=zt.NonTerminal=zt.AbstractProduction=void 0;var Ar=Gt(),rIe=LA(),ko=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,Ar.forEach)(this.definition,function(t){t.accept(e)})},r}();zt.AbstractProduction=ko;var Qj=function(r){Pa(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(ko);zt.NonTerminal=Qj;var bj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Rule=bj;var Sj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Alternative=Sj;var vj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Option=vj;var xj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionMandatory=xj;var Pj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionMandatoryWithSeparator=Pj;var Dj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Repetition=Dj;var kj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionWithSeparator=kj;var Rj=function(r){Pa(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e}(ko);zt.Alternation=Rj;var oy=function(){function r(e){this.idx=1,(0,Ar.assign)(this,(0,Ar.pick)(e,function(t){return t!==void 0}))}return r.prototype.accept=function(e){e.visit(this)},r}();zt.Terminal=oy;function iIe(r){return(0,Ar.map)(r,bd)}zt.serializeGrammar=iIe;function bd(r){function e(s){return(0,Ar.map)(s,bd)}if(r instanceof Qj){var t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return(0,Ar.isString)(r.label)&&(t.label=r.label),t}else{if(r instanceof Sj)return{type:"Alternative",definition:e(r.definition)};if(r instanceof vj)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof xj)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof Pj)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:bd(new oy({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof kj)return{type:"RepetitionWithSeparator",idx:r.idx,separator:bd(new oy({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof Dj)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof Rj)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof oy){var i={type:"Terminal",name:r.terminalType.name,label:(0,rIe.tokenLabel)(r.terminalType),idx:r.idx};(0,Ar.isString)(r.label)&&(i.terminalLabel=r.label);var n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(i.pattern=(0,Ar.isRegExp)(n)?n.source:n),i}else{if(r instanceof bj)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}zt.serializeProduction=bd});var Ay=w(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.RestWalker=void 0;var Gv=Gt(),En=mn(),nIe=function(){function r(){}return r.prototype.walk=function(e,t){var i=this;t===void 0&&(t=[]),(0,Gv.forEach)(e.definition,function(n,s){var o=(0,Gv.drop)(e.definition,s+1);if(n instanceof En.NonTerminal)i.walkProdRef(n,o,t);else if(n instanceof En.Terminal)i.walkTerminal(n,o,t);else if(n instanceof En.Alternative)i.walkFlat(n,o,t);else if(n instanceof En.Option)i.walkOption(n,o,t);else if(n instanceof En.RepetitionMandatory)i.walkAtLeastOne(n,o,t);else if(n instanceof En.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(n,o,t);else if(n instanceof En.RepetitionWithSeparator)i.walkManySep(n,o,t);else if(n instanceof En.Repetition)i.walkMany(n,o,t);else if(n instanceof En.Alternation)i.walkOr(n,o,t);else throw Error("non exhaustive match")})},r.prototype.walkTerminal=function(e,t,i){},r.prototype.walkProdRef=function(e,t,i){},r.prototype.walkFlat=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkOption=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkAtLeastOne=function(e,t,i){var n=[new En.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkAtLeastOneSep=function(e,t,i){var n=Fj(e,t,i);this.walk(e,n)},r.prototype.walkMany=function(e,t,i){var n=[new En.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkManySep=function(e,t,i){var n=Fj(e,t,i);this.walk(e,n)},r.prototype.walkOr=function(e,t,i){var n=this,s=t.concat(i);(0,Gv.forEach)(e.definition,function(o){var a=new En.Alternative({definition:[o]});n.walk(a,s)})},r}();ay.RestWalker=nIe;function Fj(r,e,t){var i=[new En.Option({definition:[new En.Terminal({terminalType:r.separator})].concat(r.definition)})],n=i.concat(e,t);return n}});var $g=w(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.GAstVisitor=void 0;var Ro=mn(),sIe=function(){function r(){}return r.prototype.visit=function(e){var t=e;switch(t.constructor){case Ro.NonTerminal:return this.visitNonTerminal(t);case Ro.Alternative:return this.visitAlternative(t);case Ro.Option:return this.visitOption(t);case Ro.RepetitionMandatory:return this.visitRepetitionMandatory(t);case Ro.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case Ro.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Ro.Repetition:return this.visitRepetition(t);case Ro.Alternation:return this.visitAlternation(t);case Ro.Terminal:return this.visitTerminal(t);case Ro.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(e){},r.prototype.visitAlternative=function(e){},r.prototype.visitOption=function(e){},r.prototype.visitRepetition=function(e){},r.prototype.visitRepetitionMandatory=function(e){},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){},r.prototype.visitRepetitionWithSeparator=function(e){},r.prototype.visitAlternation=function(e){},r.prototype.visitTerminal=function(e){},r.prototype.visitRule=function(e){},r}();ly.GAstVisitor=sIe});var vd=w(Mi=>{"use strict";var oIe=Mi&&Mi.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.collectMethods=Mi.DslMethodsCollectorVisitor=Mi.getProductionDslName=Mi.isBranchingProd=Mi.isOptionalProd=Mi.isSequenceProd=void 0;var Sd=Gt(),Qr=mn(),aIe=$g();function AIe(r){return r instanceof Qr.Alternative||r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionMandatory||r instanceof Qr.RepetitionMandatoryWithSeparator||r instanceof Qr.RepetitionWithSeparator||r instanceof Qr.Terminal||r instanceof Qr.Rule}Mi.isSequenceProd=AIe;function Yv(r,e){e===void 0&&(e=[]);var t=r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionWithSeparator;return t?!0:r instanceof Qr.Alternation?(0,Sd.some)(r.definition,function(i){return Yv(i,e)}):r instanceof Qr.NonTerminal&&(0,Sd.contains)(e,r)?!1:r instanceof Qr.AbstractProduction?(r instanceof Qr.NonTerminal&&e.push(r),(0,Sd.every)(r.definition,function(i){return Yv(i,e)})):!1}Mi.isOptionalProd=Yv;function lIe(r){return r instanceof Qr.Alternation}Mi.isBranchingProd=lIe;function cIe(r){if(r instanceof Qr.NonTerminal)return"SUBRULE";if(r instanceof Qr.Option)return"OPTION";if(r instanceof Qr.Alternation)return"OR";if(r instanceof Qr.RepetitionMandatory)return"AT_LEAST_ONE";if(r instanceof Qr.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(r instanceof Qr.RepetitionWithSeparator)return"MANY_SEP";if(r instanceof Qr.Repetition)return"MANY";if(r instanceof Qr.Terminal)return"CONSUME";throw Error("non exhaustive match")}Mi.getProductionDslName=cIe;var Nj=function(r){oIe(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var i=t.terminalType.name+this.separator+"Terminal";(0,Sd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitNonTerminal=function(t){var i=t.nonTerminalName+this.separator+"Terminal";(0,Sd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(aIe.GAstVisitor);Mi.DslMethodsCollectorVisitor=Nj;var cy=new Nj;function uIe(r){cy.reset(),r.accept(cy);var e=cy.dslMethods;return cy.reset(),e}Mi.collectMethods=uIe});var qv=w(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.firstForTerminal=Fo.firstForBranching=Fo.firstForSequence=Fo.first=void 0;var uy=Gt(),Tj=mn(),jv=vd();function gy(r){if(r instanceof Tj.NonTerminal)return gy(r.referencedRule);if(r instanceof Tj.Terminal)return Mj(r);if((0,jv.isSequenceProd)(r))return Lj(r);if((0,jv.isBranchingProd)(r))return Oj(r);throw Error("non exhaustive match")}Fo.first=gy;function Lj(r){for(var e=[],t=r.definition,i=0,n=t.length>i,s,o=!0;n&&o;)s=t[i],o=(0,jv.isOptionalProd)(s),e=e.concat(gy(s)),i=i+1,n=t.length>i;return(0,uy.uniq)(e)}Fo.firstForSequence=Lj;function Oj(r){var e=(0,uy.map)(r.definition,function(t){return gy(t)});return(0,uy.uniq)((0,uy.flatten)(e))}Fo.firstForBranching=Oj;function Mj(r){return[r.terminalType]}Fo.firstForTerminal=Mj});var Jv=w(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.IN=void 0;fy.IN="_~IN~_"});var Yj=w(fs=>{"use strict";var gIe=fs&&fs.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(fs,"__esModule",{value:!0});fs.buildInProdFollowPrefix=fs.buildBetweenProdsFollowPrefix=fs.computeAllProdsFollows=fs.ResyncFollowsWalker=void 0;var fIe=Ay(),hIe=qv(),Kj=Gt(),Uj=Jv(),pIe=mn(),Hj=function(r){gIe(e,r);function e(t){var i=r.call(this)||this;return i.topProd=t,i.follows={},i}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,i,n){},e.prototype.walkProdRef=function(t,i,n){var s=Gj(t.referencedRule,t.idx)+this.topProd.name,o=i.concat(n),a=new pIe.Alternative({definition:o}),l=(0,hIe.first)(a);this.follows[s]=l},e}(fIe.RestWalker);fs.ResyncFollowsWalker=Hj;function dIe(r){var e={};return(0,Kj.forEach)(r,function(t){var i=new Hj(t).startWalking();(0,Kj.assign)(e,i)}),e}fs.computeAllProdsFollows=dIe;function Gj(r,e){return r.name+e+Uj.IN}fs.buildBetweenProdsFollowPrefix=Gj;function CIe(r){var e=r.terminalType.name;return e+r.idx+Uj.IN}fs.buildInProdFollowPrefix=CIe});var xd=w(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.defaultGrammarValidatorErrorProvider=Da.defaultGrammarResolverErrorProvider=Da.defaultParserErrorProvider=void 0;var ef=LA(),mIe=Gt(),eo=Gt(),Wv=mn(),jj=vd();Da.defaultParserErrorProvider={buildMismatchTokenMessage:function(r){var e=r.expected,t=r.actual,i=r.previous,n=r.ruleName,s=(0,ef.hasTokenLabel)(e),o=s?"--> "+(0,ef.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",a="Expecting "+o+" but found --> '"+t.image+"' <--";return a},buildNotAllInputParsedMessage:function(r){var e=r.firstRedundant,t=r.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(r){var e=r.expectedPathsPerAlt,t=r.actual,i=r.previous,n=r.customUserDescription,s=r.ruleName,o="Expecting: ",a=(0,eo.first)(t).image,l=` -but found: '`+a+"'";if(n)return o+n+l;var c=(0,eo.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,eo.map)(c,function(h){return"["+(0,eo.map)(h,function(p){return(0,ef.tokenLabel)(p)}).join(", ")+"]"}),g=(0,eo.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences: -`+g.join(` -`);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,eo.first)(t).image,a=` -but found: '`+o+"'";if(i)return s+i+a;var l=(0,eo.map)(e,function(u){return"["+(0,eo.map)(u,function(g){return(0,ef.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: - `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Da.defaultParserErrorProvider);Da.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+r.name+"<-";return t}};Da.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Wv.Terminal?u.terminalType.name:u instanceof Wv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,eo.first)(e),s=n.idx,o=(0,jj.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES - `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` -`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. -`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. -`)+`To resolve this make sure each Terminal and Non-Terminal names are unique -This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,eo.map)(r.prefixPath,function(n){return(0,ef.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix -`+("in inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX -For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,eo.map)(r.prefixPath,function(n){return(0,ef.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in "+(" inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,jj.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens. -This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in inside <"+r.topLevelRule.name+`> Rule. -`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives: -`+(" inside <"+r.topLevelRule.name+`> Rule. - has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=mIe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. -`+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: - `+i+` -`)+` To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Wv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Wj=w(OA=>{"use strict";var EIe=OA&&OA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(OA,"__esModule",{value:!0});OA.GastRefResolverVisitor=OA.resolveGrammar=void 0;var IIe=jn(),qj=Gt(),yIe=$g();function wIe(r,e){var t=new Jj(r,e);return t.resolveRefs(),t.errors}OA.resolveGrammar=wIe;var Jj=function(r){EIe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,qj.forEach)((0,qj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:IIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(yIe.GAstVisitor);OA.GastRefResolverVisitor=Jj});var Dd=w(Nr=>{"use strict";var mc=Nr&&Nr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.nextPossibleTokensAfter=Nr.possiblePathsFrom=Nr.NextTerminalAfterAtLeastOneSepWalker=Nr.NextTerminalAfterAtLeastOneWalker=Nr.NextTerminalAfterManySepWalker=Nr.NextTerminalAfterManyWalker=Nr.AbstractNextTerminalAfterProductionWalker=Nr.NextAfterTokenWalker=Nr.AbstractNextPossibleTokensWalker=void 0;var zj=Ay(),Kt=Gt(),BIe=qv(),kt=mn(),Vj=function(r){mc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Kt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Kt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Kt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(zj.RestWalker);Nr.AbstractNextPossibleTokensWalker=Vj;var QIe=function(r){mc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new kt.Alternative({definition:s});this.possibleTokTypes=(0,BIe.first)(o),this.found=!0}},e}(Vj);Nr.NextAfterTokenWalker=QIe;var Pd=function(r){mc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(zj.RestWalker);Nr.AbstractNextTerminalAfterProductionWalker=Pd;var bIe=function(r){mc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Pd);Nr.NextTerminalAfterManyWalker=bIe;var SIe=function(r){mc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Pd);Nr.NextTerminalAfterManySepWalker=SIe;var vIe=function(r){mc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Pd);Nr.NextTerminalAfterAtLeastOneWalker=vIe;var xIe=function(r){mc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Pd);Nr.NextTerminalAfterAtLeastOneSepWalker=xIe;function Xj(r,e,t){t===void 0&&(t=[]),t=(0,Kt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Kt.drop)(r,n+1))}function o(c){var u=Xj(s(c),e,t);return i.concat(u)}for(;t.length=0;ge--){var re=B.definition[ge],O={idx:p,def:re.definition.concat((0,Kt.drop)(h)),ruleStack:C,occurrenceStack:y};g.push(O),g.push(o)}else if(B instanceof kt.Alternative)g.push({idx:p,def:B.definition.concat((0,Kt.drop)(h)),ruleStack:C,occurrenceStack:y});else if(B instanceof kt.Rule)g.push(DIe(B,p,C,y));else throw Error("non exhaustive match")}}return u}Nr.nextPossibleTokensAfter=PIe;function DIe(r,e,t,i){var n=(0,Kt.cloneArr)(t);n.push(r.name);var s=(0,Kt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var kd=w(Zt=>{"use strict";var $j=Zt&&Zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.areTokenCategoriesNotUsed=Zt.isStrictPrefixOfPath=Zt.containsPath=Zt.getLookaheadPathsForOptionalProd=Zt.getLookaheadPathsForOr=Zt.lookAheadSequenceFromAlternatives=Zt.buildSingleAlternativeLookaheadFunction=Zt.buildAlternativesLookAheadFunc=Zt.buildLookaheadFuncForOptionalProd=Zt.buildLookaheadFuncForOr=Zt.getProdType=Zt.PROD_TYPE=void 0;var sr=Gt(),Zj=Dd(),kIe=Ay(),hy=_g(),MA=mn(),RIe=$g(),oi;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(oi=Zt.PROD_TYPE||(Zt.PROD_TYPE={}));function FIe(r){if(r instanceof MA.Option)return oi.OPTION;if(r instanceof MA.Repetition)return oi.REPETITION;if(r instanceof MA.RepetitionMandatory)return oi.REPETITION_MANDATORY;if(r instanceof MA.RepetitionMandatoryWithSeparator)return oi.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof MA.RepetitionWithSeparator)return oi.REPETITION_WITH_SEPARATOR;if(r instanceof MA.Alternation)return oi.ALTERNATION;throw Error("non exhaustive match")}Zt.getProdType=FIe;function NIe(r,e,t,i,n,s){var o=tq(r,e,t),a=Xv(o)?hy.tokenStructuredMatcherNoCategories:hy.tokenStructuredMatcher;return s(o,i,a,n)}Zt.buildLookaheadFuncForOr=NIe;function TIe(r,e,t,i,n,s){var o=rq(r,e,n,t),a=Xv(o)?hy.tokenStructuredMatcherNoCategories:hy.tokenStructuredMatcher;return s(o[0],a,i)}Zt.buildLookaheadFuncForOptionalProd=TIe;function LIe(r,e,t,i){var n=r.length,s=(0,sr.every)(r,function(l){return(0,sr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,sr.map)(l,function(D){return D.GATE}),u=0;u{"use strict";var Zv=Vt&&Vt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.checkPrefixAlternativesAmbiguities=Vt.validateSomeNonEmptyLookaheadPath=Vt.validateTooManyAlts=Vt.RepetionCollector=Vt.validateAmbiguousAlternationAlternatives=Vt.validateEmptyOrAlternative=Vt.getFirstNoneTerminal=Vt.validateNoLeftRecursion=Vt.validateRuleIsOverridden=Vt.validateRuleDoesNotAlreadyExist=Vt.OccurrenceValidationCollector=Vt.identifyProductionForDuplicates=Vt.validateGrammar=void 0;var er=Gt(),br=Gt(),No=jn(),_v=vd(),tf=kd(),HIe=Dd(),to=mn(),$v=$g();function GIe(r,e,t,i,n){var s=er.map(r,function(h){return YIe(h,i)}),o=er.map(r,function(h){return ex(h,h,i)}),a=[],l=[],c=[];(0,br.every)(o,br.isEmpty)&&(a=(0,br.map)(r,function(h){return Aq(h,i)}),l=(0,br.map)(r,function(h){return lq(h,e,i)}),c=gq(r,e,i));var u=JIe(r,t,i),g=(0,br.map)(r,function(h){return uq(h,i)}),f=(0,br.map)(r,function(h){return aq(h,r,n,i)});return er.flatten(s.concat(c,o,a,l,u,g,f))}Vt.validateGrammar=GIe;function YIe(r,e){var t=new oq;r.accept(t);var i=t.allProductions,n=er.groupBy(i,nq),s=er.pick(n,function(a){return a.length>1}),o=er.map(er.values(s),function(a){var l=er.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,_v.getProductionDslName)(l),g={message:c,type:No.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=sq(l);return f&&(g.parameter=f),g});return o}function nq(r){return(0,_v.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+sq(r)}Vt.identifyProductionForDuplicates=nq;function sq(r){return r instanceof to.Terminal?r.terminalType.name:r instanceof to.NonTerminal?r.nonTerminalName:""}var oq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Vt.OccurrenceValidationCollector=oq;function aq(r,e,t,i){var n=[],s=(0,br.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:No.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Vt.validateRuleDoesNotAlreadyExist=aq;function jIe(r,e,t){var i=[],n;return er.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:No.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Vt.validateRuleIsOverridden=jIe;function ex(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Rd(e.definition);if(er.isEmpty(s))return[];var o=r.name,a=er.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:No.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=er.difference(s,i.concat([r])),c=er.map(l,function(u){var g=er.cloneArr(i);return g.push(u),ex(r,u,t,g)});return n.concat(er.flatten(c))}Vt.validateNoLeftRecursion=ex;function Rd(r){var e=[];if(er.isEmpty(r))return e;var t=er.first(r);if(t instanceof to.NonTerminal)e.push(t.referencedRule);else if(t instanceof to.Alternative||t instanceof to.Option||t instanceof to.RepetitionMandatory||t instanceof to.RepetitionMandatoryWithSeparator||t instanceof to.RepetitionWithSeparator||t instanceof to.Repetition)e=e.concat(Rd(t.definition));else if(t instanceof to.Alternation)e=er.flatten(er.map(t.definition,function(o){return Rd(o.definition)}));else if(!(t instanceof to.Terminal))throw Error("non exhaustive match");var i=(0,_v.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=er.drop(r);return e.concat(Rd(s))}else return e}Vt.getFirstNoneTerminal=Rd;var tx=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}($v.GAstVisitor);function Aq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){var a=er.dropRight(o.definition),l=er.map(a,function(c,u){var g=(0,HIe.nextPossibleTokensAfter)([c],[],null,1);return er.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:No.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(er.compact(l))},[]);return n}Vt.validateEmptyOrAlternative=Aq;function lq(r,e,t){var i=new tx;r.accept(i);var n=i.alternations;n=(0,br.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=er.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,tf.getLookaheadPathsForOr)(l,r,c,a),g=qIe(u,a,r,t),f=fq(u,a,r,t);return o.concat(g,f)},[]);return s}Vt.validateAmbiguousAlternationAlternatives=lq;var cq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Vt.RepetionCollector=cq;function uq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:No.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Vt.validateTooManyAlts=uq;function gq(r,e,t){var i=[];return(0,br.forEach)(r,function(n){var s=new cq;n.accept(s);var o=s.allProductions;(0,br.forEach)(o,function(a){var l=(0,tf.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,tf.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,br.isEmpty)((0,br.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:No.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Vt.validateSomeNonEmptyLookaheadPath=gq;function qIe(r,e,t,i){var n=[],s=(0,br.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,br.forEach)(l,function(u){var g=[c];(0,br.forEach)(r,function(f,h){c!==h&&(0,tf.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,tf.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=er.map(s,function(a){var l=(0,br.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:No.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function fq(r,e,t,i){var n=[],s=(0,br.reduce)(r,function(o,a,l){var c=(0,br.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,br.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,br.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.validateGrammar=rf.resolveGrammar=void 0;var ix=Gt(),WIe=Wj(),zIe=rx(),hq=xd();function VIe(r){r=(0,ix.defaults)(r,{errMsgProvider:hq.defaultGrammarResolverErrorProvider});var e={};return(0,ix.forEach)(r.rules,function(t){e[t.name]=t}),(0,WIe.resolveGrammar)(e,r.errMsgProvider)}rf.resolveGrammar=VIe;function XIe(r){return r=(0,ix.defaults)(r,{errMsgProvider:hq.defaultGrammarValidatorErrorProvider}),(0,zIe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}rf.validateGrammar=XIe});var nf=w(In=>{"use strict";var Fd=In&&In.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(In,"__esModule",{value:!0});In.EarlyExitException=In.NotAllInputParsedException=In.NoViableAltException=In.MismatchedTokenException=In.isRecognitionException=void 0;var ZIe=Gt(),dq="MismatchedTokenException",Cq="NoViableAltException",mq="EarlyExitException",Eq="NotAllInputParsedException",Iq=[dq,Cq,mq,Eq];Object.freeze(Iq);function _Ie(r){return(0,ZIe.contains)(Iq,r.name)}In.isRecognitionException=_Ie;var py=function(r){Fd(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),$Ie=function(r){Fd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=dq,s}return e}(py);In.MismatchedTokenException=$Ie;var eye=function(r){Fd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=Cq,s}return e}(py);In.NoViableAltException=eye;var tye=function(r){Fd(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=Eq,n}return e}(py);In.NotAllInputParsedException=tye;var rye=function(r){Fd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=mq,s}return e}(py);In.EarlyExitException=rye});var sx=w(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attemptInRepetitionRecovery=Ki.Recoverable=Ki.InRuleRecoveryException=Ki.IN_RULE_RECOVERY_EXCEPTION=Ki.EOF_FOLLOW_KEY=void 0;var dy=LA(),hs=Gt(),iye=nf(),nye=Jv(),sye=jn();Ki.EOF_FOLLOW_KEY={};Ki.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function nx(r){this.name=Ki.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ki.InRuleRecoveryException=nx;nx.prototype=Error.prototype;var oye=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,hs.has)(e,"recoveryEnabled")?e.recoveryEnabled:sye.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=yq)},r.prototype.getTokenToInsert=function(e){var t=(0,dy.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),C=new iye.MismatchedTokenException(p,u,s.LA(0));C.resyncedTokens=(0,hs.dropRight)(l),s.SAVE_ERROR(C)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new nx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,hs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,hs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,hs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,hs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ki.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,hs.map)(t,function(n,s){return s===0?Ki.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,hs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,hs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ki.EOF_FOLLOW_KEY)return[dy.EOF];var t=e.ruleName+e.idxInCallingRule+nye.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,dy.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,hs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,hs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,hs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ki.Recoverable=oye;function yq(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=dy.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Ki.attemptInRepetitionRecovery=yq});var Cy=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getKeyForAutomaticLookahead=Jt.AT_LEAST_ONE_SEP_IDX=Jt.MANY_SEP_IDX=Jt.AT_LEAST_ONE_IDX=Jt.MANY_IDX=Jt.OPTION_IDX=Jt.OR_IDX=Jt.BITS_FOR_ALT_IDX=Jt.BITS_FOR_RULE_IDX=Jt.BITS_FOR_OCCURRENCE_IDX=Jt.BITS_FOR_METHOD_TYPE=void 0;Jt.BITS_FOR_METHOD_TYPE=4;Jt.BITS_FOR_OCCURRENCE_IDX=8;Jt.BITS_FOR_RULE_IDX=12;Jt.BITS_FOR_ALT_IDX=8;Jt.OR_IDX=1<{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.LooksAhead=void 0;var ka=kd(),ro=Gt(),wq=jn(),Ra=Cy(),Ec=vd(),Aye=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,ro.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:wq.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,ro.has)(e,"maxLookahead")?e.maxLookahead:wq.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,ro.isES2015MapSupported)()?new Map:[],(0,ro.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,ro.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Ec.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,ro.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,Ec.getProductionDslName)(g)+f,function(){var h=(0,ka.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,Ra.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Ra.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,ro.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Ra.MANY_IDX,ka.PROD_TYPE.REPETITION,g.maxLookahead,(0,Ec.getProductionDslName)(g))}),(0,ro.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Ra.OPTION_IDX,ka.PROD_TYPE.OPTION,g.maxLookahead,(0,Ec.getProductionDslName)(g))}),(0,ro.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Ra.AT_LEAST_ONE_IDX,ka.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Ec.getProductionDslName)(g))}),(0,ro.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Ra.AT_LEAST_ONE_SEP_IDX,ka.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Ec.getProductionDslName)(g))}),(0,ro.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Ra.MANY_SEP_IDX,ka.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Ec.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,ka.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Ra.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,ka.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,ka.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Ra.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();my.LooksAhead=Aye});var Qq=w(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.addNoneTerminalToCst=To.addTerminalToCst=To.setNodeLocationFull=To.setNodeLocationOnlyOffset=void 0;function lye(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(KA,"__esModule",{value:!0});KA.defineNameProp=KA.functionName=KA.classNameFromInstance=void 0;var fye=Gt();function hye(r){return Sq(r.constructor)}KA.classNameFromInstance=hye;var bq="name";function Sq(r){var e=r.name;return e||"anonymous"}KA.functionName=Sq;function pye(r,e){var t=Object.getOwnPropertyDescriptor(r,bq);return(0,fye.isUndefined)(t)||t.configurable?(Object.defineProperty(r,bq,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}KA.defineNameProp=pye});var kq=w(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateRedundantMethods=Si.validateMissingCstMethods=Si.validateVisitor=Si.CstVisitorDefinitionError=Si.createBaseVisitorConstructorWithDefaults=Si.createBaseSemanticVisitorConstructor=Si.defaultVisit=void 0;var ps=Gt(),Nd=ox();function vq(r,e){for(var t=(0,ps.keys)(r),i=t.length,n=0;n: - `+(""+s.join(` - -`).replace(/\n/g,` - `)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}Si.createBaseSemanticVisitorConstructor=dye;function Cye(r,e,t){var i=function(){};(0,Nd.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,ps.forEach)(e,function(s){n[s]=vq}),i.prototype=n,i.prototype.constructor=i,i}Si.createBaseVisitorConstructorWithDefaults=Cye;var ax;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(ax=Si.CstVisitorDefinitionError||(Si.CstVisitorDefinitionError={}));function xq(r,e){var t=Pq(r,e),i=Dq(r,e);return t.concat(i)}Si.validateVisitor=xq;function Pq(r,e){var t=(0,ps.map)(e,function(i){if(!(0,ps.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,Nd.functionName)(r.constructor)+" CST Visitor.",type:ax.MISSING_METHOD,methodName:i}});return(0,ps.compact)(t)}Si.validateMissingCstMethods=Pq;var mye=["constructor","visit","validateVisitor"];function Dq(r,e){var t=[];for(var i in r)(0,ps.isFunction)(r[i])&&!(0,ps.contains)(mye,i)&&!(0,ps.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,Nd.functionName)(r.constructor)+` CST Visitor -There is no Grammar Rule corresponding to this method's name. -`,type:ax.REDUNDANT_METHOD,methodName:i});return t}Si.validateRedundantMethods=Dq});var Fq=w(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.TreeBuilder=void 0;var sf=Qq(),_r=Gt(),Rq=kq(),Eye=jn(),Iye=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,_r.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:Eye.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=_r.NOOP,this.cstFinallyStateUpdate=_r.NOOP,this.cstPostTerminal=_r.NOOP,this.cstPostNonTerminal=_r.NOOP,this.cstPostRule=_r.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=sf.setNodeLocationFull,this.setNodeLocationFromNode=sf.setNodeLocationFull,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=sf.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=sf.setNodeLocationOnlyOffset,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=_r.NOOP;else throw Error('Invalid config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,sf.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,sf.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,_r.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,Rq.createBaseSemanticVisitorConstructor)(this.className,(0,_r.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,_r.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,Rq.createBaseVisitorConstructorWithDefaults)(this.className,(0,_r.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},r.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},r.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},r}();Ey.TreeBuilder=Iye});var Tq=w(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.LexerAdapter=void 0;var Nq=jn(),yye=function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Nq.END_OF_FILE},r.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Nq.END_OF_FILE:this.tokVector[t]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(e){this.currIdx=e},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r}();Iy.LexerAdapter=yye});var Oq=w(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.RecognizerApi=void 0;var Lq=Gt(),wye=nf(),Ax=jn(),Bye=xd(),Qye=rx(),bye=mn(),Sye=function(){function r(){}return r.prototype.ACTION=function(e){return e.call(this)},r.prototype.consume=function(e,t,i){return this.consumeInternal(t,e,i)},r.prototype.subrule=function(e,t,i){return this.subruleInternal(t,e,i)},r.prototype.option=function(e,t){return this.optionInternal(t,e)},r.prototype.or=function(e,t){return this.orInternal(t,e)},r.prototype.many=function(e,t){return this.manyInternal(e,t)},r.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},r.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},r.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},r.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},r.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},r.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},r.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},r.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},r.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},r.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},r.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},r.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},r.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},r.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},r.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},r.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},r.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},r.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},r.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},r.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},r.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},r.prototype.OPTION=function(e){return this.optionInternal(e,0)},r.prototype.OPTION1=function(e){return this.optionInternal(e,1)},r.prototype.OPTION2=function(e){return this.optionInternal(e,2)},r.prototype.OPTION3=function(e){return this.optionInternal(e,3)},r.prototype.OPTION4=function(e){return this.optionInternal(e,4)},r.prototype.OPTION5=function(e){return this.optionInternal(e,5)},r.prototype.OPTION6=function(e){return this.optionInternal(e,6)},r.prototype.OPTION7=function(e){return this.optionInternal(e,7)},r.prototype.OPTION8=function(e){return this.optionInternal(e,8)},r.prototype.OPTION9=function(e){return this.optionInternal(e,9)},r.prototype.OR=function(e){return this.orInternal(e,0)},r.prototype.OR1=function(e){return this.orInternal(e,1)},r.prototype.OR2=function(e){return this.orInternal(e,2)},r.prototype.OR3=function(e){return this.orInternal(e,3)},r.prototype.OR4=function(e){return this.orInternal(e,4)},r.prototype.OR5=function(e){return this.orInternal(e,5)},r.prototype.OR6=function(e){return this.orInternal(e,6)},r.prototype.OR7=function(e){return this.orInternal(e,7)},r.prototype.OR8=function(e){return this.orInternal(e,8)},r.prototype.OR9=function(e){return this.orInternal(e,9)},r.prototype.MANY=function(e){this.manyInternal(0,e)},r.prototype.MANY1=function(e){this.manyInternal(1,e)},r.prototype.MANY2=function(e){this.manyInternal(2,e)},r.prototype.MANY3=function(e){this.manyInternal(3,e)},r.prototype.MANY4=function(e){this.manyInternal(4,e)},r.prototype.MANY5=function(e){this.manyInternal(5,e)},r.prototype.MANY6=function(e){this.manyInternal(6,e)},r.prototype.MANY7=function(e){this.manyInternal(7,e)},r.prototype.MANY8=function(e){this.manyInternal(8,e)},r.prototype.MANY9=function(e){this.manyInternal(9,e)},r.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},r.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},r.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},r.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},r.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},r.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},r.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},r.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},r.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},r.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},r.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},r.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},r.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},r.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},r.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},r.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},r.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},r.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},r.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},r.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},r.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},r.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},r.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},r.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},r.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},r.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},r.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},r.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},r.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},r.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},r.prototype.RULE=function(e,t,i){if(i===void 0&&(i=Ax.DEFAULT_RULE_CONFIG),(0,Lq.contains)(this.definedRulesNames,e)){var n=Bye.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),s={message:n,type:Ax.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,i);return this[e]=o,o},r.prototype.OVERRIDE_RULE=function(e,t,i){i===void 0&&(i=Ax.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,Qye.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(n);var s=this.defineRule(e,t,i);return this[e]=s,s},r.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var i=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,wye.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}},r.prototype.getGAstProductions=function(){return this.gastProductionsCache},r.prototype.getSerializedGastProductions=function(){return(0,bye.serializeGrammar)((0,Lq.values)(this.gastProductionsCache))},r}();yy.RecognizerApi=Sye});var Hq=w(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.RecognizerEngine=void 0;var Pr=Gt(),qn=Cy(),wy=nf(),Mq=kd(),of=Dd(),Kq=jn(),vye=sx(),Uq=LA(),Td=_g(),xye=ox(),Pye=function(){function r(){}return r.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,xye.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Td.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,Pr.has)(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if((0,Pr.isArray)(e)){if((0,Pr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty. - Note that the first argument for the parser constructor - is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if((0,Pr.isArray)(e))this.tokensMap=(0,Pr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Pr.has)(e,"modes")&&(0,Pr.every)((0,Pr.flatten)((0,Pr.values)(e.modes)),Td.isTokenType)){var i=(0,Pr.flatten)((0,Pr.values)(e.modes)),n=(0,Pr.uniq)(i);this.tokensMap=(0,Pr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Pr.isObject)(e))this.tokensMap=(0,Pr.cloneObj)(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Uq.EOF;var s=(0,Pr.every)((0,Pr.values)(e),function(o){return(0,Pr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Td.tokenStructuredMatcherNoCategories:Td.tokenStructuredMatcher,(0,Td.augmentTokenTypes)((0,Pr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Pr.has)(i,"resyncEnabled")?i.resyncEnabled:Kq.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Pr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:Kq.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<t},r.prototype.orInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(qn.OR_IDX,t),n=(0,Pr.isArray)(e)?e:e.DEF,s=this.getLaFuncFromCache(i),o=s.call(this,n);if(o!==void 0){var a=n[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},r.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new wy.NotAllInputParsedException(t,e))}},r.prototype.subruleInternal=function(e,t,i){var n;try{var s=i!==void 0?i.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,i!==void 0&&i.LABEL!==void 0?i.LABEL:e.ruleName),n}catch(o){this.subruleInternalError(o,i,e.ruleName)}},r.prototype.subruleInternalError=function(e,t,i){throw(0,wy.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:i),delete e.partialCstResult),e},r.prototype.consumeInternal=function(e,t,i){var n;try{var s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),n=s):this.consumeInternalError(e,s,i)}catch(o){n=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(i!==void 0&&i.LABEL!==void 0?i.LABEL:e.name,n),n},r.prototype.consumeInternalError=function(e,t,i){var n,s=this.LA(0);throw i!==void 0&&i.ERR_MSG?n=i.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new wy.MismatchedTokenException(n,t,s))},r.prototype.consumeInternalRecovery=function(e,t,i){if(this.recoveryEnabled&&i.name==="MismatchedTokenException"&&!this.isBackTracking()){var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(s){throw s.name===vye.IN_RULE_RECOVERY_EXCEPTION?i:s}}else throw i},r.prototype.saveRecogState=function(){var e=this.errors,t=(0,Pr.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},r.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},r.prototype.ruleInvocationStateUpdate=function(e,t,i){this.RULE_OCCURRENCE_STACK.push(i),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},r.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},r.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},r.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},r.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),Uq.EOF)},r.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},r}();By.RecognizerEngine=Pye});var Yq=w(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.ErrorHandler=void 0;var lx=nf(),cx=Gt(),Gq=kd(),Dye=jn(),kye=function(){function r(){}return r.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,cx.has)(e,"errorMessageProvider")?e.errorMessageProvider:Dye.DEFAULT_PARSER_CONFIG.errorMessageProvider},r.prototype.SAVE_ERROR=function(e){if((0,lx.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,cx.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(r.prototype,"errors",{get:function(){return(0,cx.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),r.prototype.raiseEarlyExitException=function(e,t,i){for(var n=this.getCurrRuleFullName(),s=this.getGAstProductions()[n],o=(0,Gq.getLookaheadPathsForOptionalProd)(e,s,t,this.maxLookahead),a=o[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:i,ruleName:n});throw this.SAVE_ERROR(new lx.EarlyExitException(u,this.LA(1),this.LA(0)))},r.prototype.raiseNoAltException=function(e,t){for(var i=this.getCurrRuleFullName(),n=this.getGAstProductions()[i],s=(0,Gq.getLookaheadPathsForOr)(e,n,this.maxLookahead),o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var l=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:l,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new lx.NoViableAltException(c,this.LA(1),l))},r}();Qy.ErrorHandler=kye});var Jq=w(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.ContentAssist=void 0;var jq=Dd(),qq=Gt(),Rye=function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(e,t){var i=this.gastProductionsCache[e];if((0,qq.isUndefined)(i))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,jq.nextPossibleTokensAfter)([i],t,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(e){var t=(0,qq.first)(e.ruleStack),i=this.getGAstProductions(),n=i[t],s=new jq.NextAfterTokenWalker(n,e).startWalking();return s},r}();by.ContentAssist=Rye});var eJ=w(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.GastRecorder=void 0;var yn=Gt(),Lo=mn(),Fye=Bd(),Xq=_g(),Zq=LA(),Nye=jn(),Tye=Cy(),vy={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vy);var Wq=!0,zq=Math.pow(2,Tye.BITS_FOR_OCCURRENCE_IDX)-1,_q=(0,Zq.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:Fye.Lexer.NA});(0,Xq.augmentTokenTypes)([_q]);var $q=(0,Zq.createTokenInstance)(_q,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze($q);var Lye={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Oye=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return Nye.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new Lo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` - This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return Ld.call(this,Lo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){Ld.call(this,Lo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Ld.call(this,Lo.RepetitionMandatoryWithSeparator,t,e,Wq)},r.prototype.manyInternalRecord=function(e,t){Ld.call(this,Lo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){Ld.call(this,Lo.RepetitionWithSeparator,t,e,Wq)},r.prototype.orInternalRecord=function(e,t){return Mye.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(Sy(t),!e||(0,yn.has)(e,"ruleName")===!1){var n=new Error(" argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,yn.peek)(this.recordingProdStack),o=e.ruleName,a=new Lo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?Lye:vy},r.prototype.consumeInternalRecord=function(e,t,i){if(Sy(t),!(0,Xq.hasShortKeyProperty)(e)){var n=new Error(" argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,yn.peek)(this.recordingProdStack),o=new Lo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),$q},r}();xy.GastRecorder=Oye;function Ld(r,e,t,i){i===void 0&&(i=!1),Sy(t);var n=(0,yn.peek)(this.recordingProdStack),s=(0,yn.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,yn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),vy}function Mye(r,e){var t=this;Sy(e);var i=(0,yn.peek)(this.recordingProdStack),n=(0,yn.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new Lo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,yn.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,yn.some)(s,function(l){return(0,yn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,yn.forEach)(s,function(l){var c=new Lo.Alternative({definition:[]});o.definition.push(c),(0,yn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,yn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),vy}function Vq(r){return r===0?"":""+r}function Sy(r){if(r<0||r>zq){var e=new Error("Invalid DSL Method idx value: <"+r+`> - `+("Idx value must be a none negative value smaller than "+(zq+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var rJ=w(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.PerformanceTracer=void 0;var tJ=Gt(),Kye=jn(),Uye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,tJ.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:1/0,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Kye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <"+e+">");var n=(0,tJ.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();Py.PerformanceTracer=Uye});var iJ=w(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.applyMixins=void 0;function Hye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}Dy.applyMixins=Hye});var jn=w(dr=>{"use strict";var oJ=dr&&dr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(dr,"__esModule",{value:!0});dr.EmbeddedActionsParser=dr.CstParser=dr.Parser=dr.EMPTY_ALT=dr.ParserDefinitionErrorType=dr.DEFAULT_RULE_CONFIG=dr.DEFAULT_PARSER_CONFIG=dr.END_OF_FILE=void 0;var en=Gt(),Gye=Yj(),nJ=LA(),aJ=xd(),sJ=pq(),Yye=sx(),jye=Bq(),qye=Fq(),Jye=Tq(),Wye=Oq(),zye=Hq(),Vye=Yq(),Xye=Jq(),Zye=eJ(),_ye=rJ(),$ye=iJ();dr.END_OF_FILE=(0,nJ.createTokenInstance)(nJ.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(dr.END_OF_FILE);dr.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:aJ.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});dr.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var ewe;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(ewe=dr.ParserDefinitionErrorType||(dr.ParserDefinitionErrorType={}));function twe(r){return r===void 0&&(r=void 0),function(){return r}}dr.EMPTY_ALT=twe;var ky=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,en.has)(t,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. - Please use the flag on the relevant DSL method instead. - See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=(0,en.has)(t,"skipValidations")?t.skipValidations:dr.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,en.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,en.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,sJ.resolveGrammar)({rules:(0,en.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,en.isEmpty)(n)&&e.skipValidations===!1){var s=(0,sJ.validateGrammar)({rules:(0,en.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,en.values)(e.tokensMap),errMsgProvider:aJ.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,en.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Gye.computeAllProdsFollows)((0,en.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,en.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,en.isEmpty)(e.definitionErrors))throw t=(0,en.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected: - `+t.join(` -------------------------------- -`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();dr.Parser=ky;(0,$ye.applyMixins)(ky,[Yye.Recoverable,jye.LooksAhead,qye.TreeBuilder,Jye.LexerAdapter,zye.RecognizerEngine,Wye.RecognizerApi,Vye.ErrorHandler,Xye.ContentAssist,Zye.GastRecorder,_ye.PerformanceTracer]);var rwe=function(r){oJ(e,r);function e(t,i){i===void 0&&(i=dr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,en.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(ky);dr.CstParser=rwe;var iwe=function(r){oJ(e,r);function e(t,i){i===void 0&&(i=dr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,en.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(ky);dr.EmbeddedActionsParser=iwe});var lJ=w(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.createSyntaxDiagramsCode=void 0;var AJ=Dv();function nwe(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+AJ.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+AJ.VERSION+"/diagrams/diagrams.css":s,a=` - - - - - -`,l=` - -`,c=` -