diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efe697d --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +main.js +*.log +.DS_Store +data.json + diff --git a/README.md b/README.md new file mode 100644 index 0000000..ae0624f --- /dev/null +++ b/README.md @@ -0,0 +1,153 @@ +# Multimuse Obsidian - Obsidian Plugin + +Obsidian plugin for MultiMuse bot integration - track Discord threads and send messages as muses directly from Obsidian. + +## Features + +- ✅ Automatically tracks Discord threads linked in your scene files +- ✅ Updates `Replied?` and `Participants` fields in frontmatter +- ✅ **Send as Muse**: Right-click selected text to post as a muse to Discord threads +- ✅ Auto-detects user ID from API key (no manual configuration needed) +- ✅ Configurable poll interval (5-60 minutes) +- ✅ Works entirely within Obsidian +- ✅ Supports multiple muses and character selection + +## Installation + +### Manual Installation + +1. Copy the `multimuse-obsidian` folder to your Obsidian vault's `.obsidian/plugins/` directory +2. Open Obsidian Settings → Community Plugins +3. Enable "Multimuse Obsidian" +4. Go to Settings → Multimuse Obsidian and configure your API key + +### Development Installation + +1. Clone or copy this folder to `.obsidian/plugins/multimuse-obsidian` +2. Install dependencies: + ```bash + npm install + ``` +3. Build the plugin: + ```bash + npm run build + ``` +4. Enable the plugin in Obsidian Settings → Community Plugins + +## Setup + +### 1. Get Your API Key + +1. Open Discord DMs with the MultiMuse bot +2. Use the command: `/api generate` +3. Copy the generated API key (starts with `mm_`) + +### 2. Configure Plugin + +1. Open Obsidian Settings → Multimuse Obsidian +2. Paste your API key in the "API Key" field +3. Your user ID will be automatically detected from the API key +4. Set poll interval (default: 15 minutes) +5. Set scenes folder (default: "RP Scenes") +6. (Optional) Set Obsidian Base path for scene tracking +7. Enable polling + +## How It Works + +### Thread Tracking + +1. The plugin scans all `.md` files in your scenes folder +2. For each file with a `Link` and `Characters` field in frontmatter: + - Extracts the Discord thread ID from the URL + - Queries the MultiMuse API for thread state + - Updates `Replied?` field (true = your turn, false = not your turn) + - Updates `Participants` field + +### Send as Muse + +1. Select text in a scene file +2. Right-click → "Send as Muse" +3. If multiple characters in frontmatter, select which muse to post as +4. Message is automatically posted to the Discord thread via the MultiMuse API +5. Long messages are automatically split to respect Discord's limits + +## Scene File Format + +Your scene files should have frontmatter like this: + +```markdown +--- +Link: https://discord.com/channels/123456789/987654321/111222333444555666 +Characters: + - Bel + - Another Character +Participants: 2 +Replied?: false +Is Active?: true +--- + +[Scene content here] +``` + +**Required fields:** +- `Link`: Full Discord thread URL +- `Characters`: Array of character/muse names (used for "Send as Muse") + +**Auto-updated fields:** +- `Replied?`: Automatically updated by the plugin (true = your turn, false = not your turn) +- `Participants`: Automatically updated with thread participant count + +## Commands + +- **Check Discord Threads Now**: Manually trigger a check +- **Toggle Discord Polling**: Enable/disable automatic polling +- **Create New Scene**: Create a new scene file with muse selection +- **Sync from Tracker**: Sync scenes from bot tracker to Obsidian + +## Settings + +- **Enable Polling**: Turn automatic checking on/off +- **API Key**: Your MultiMuse API key (auto-detects user ID) +- **Poll Interval**: How often to check (5-60 minutes) +- **Scenes Folder**: Folder containing your scene files +- **Obsidian Base Path**: Optional path to Base file for scene tracking + +## Troubleshooting + +### "API authentication failed" error +- Make sure your API key is correct (starts with `mm_`) +- Verify the API key was generated using `/api generate` in Discord +- Check that the API key hasn't been revoked + +### "Failed to get user ID from API key" +- Verify your API key is valid +- Check your internet connection +- Ensure the MultiMuse bot API is accessible + +### "Muse not found or not accessible" +- Make sure the muse name in your frontmatter matches exactly (case-insensitive) +- Verify the muse exists in Discord +- Check that the muse is owned by you or shared with you + +### Files not updating +- Check that your scene files have `Link` and `Characters` fields in frontmatter +- Verify the link contains a valid Discord thread URL +- Make sure polling is enabled +- Check the console (Ctrl+Shift+I) for errors + +### "Send as Muse" not working +- Ensure text is selected before right-clicking +- Verify the file has `Link` and `Characters` in frontmatter +- Check that the selected muse exists and is accessible +- Verify your API key is configured correctly + +## Privacy & Security + +- Your API key is stored locally in Obsidian's settings +- The plugin only accesses threads you've linked in your scene files +- All communication goes through the MultiMuse bot API +- User ID is automatically detected from API key (no manual entry needed) + +## License + +MIT diff --git a/esbuild.config.mjs b/esbuild.config.mjs new file mode 100644 index 0000000..a801f5a --- /dev/null +++ b/esbuild.config.mjs @@ -0,0 +1,39 @@ +import esbuild from "esbuild"; +import process from "process"; +import builtins from "builtin-modules"; + +const isProduction = process.argv.includes("production"); + +const ctx = await esbuild.context({ + bundle: true, + entryPoints: ["main.ts"], + external: [ + "obsidian", + "electron", + "@codemirror/autocomplete", + "@codemirror/collab", + "@codemirror/commands", + "@codemirror/language", + "@codemirror/lint", + "@codemirror/search", + "@codemirror/state", + "@codemirror/view", + "@lezer/common", + "@lezer/highlight", + "@lezer/lr", + ...builtins], + format: "cjs", + target: "es2018", + logLevel: "info", + sourcemap: isProduction ? false : "inline", + treeShaking: true, + outfile: "main.js", +}); + +if (isProduction) { + await ctx.rebuild(); + process.exit(0); +} else { + await ctx.watch(); +} + diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..d0252f8 --- /dev/null +++ b/main.ts @@ -0,0 +1,1667 @@ +import { Plugin, PluginSettingTab, Setting, Notice, TFile, MetadataCache, App, requestUrl, Modal, Editor, MarkdownView } from 'obsidian'; + +interface MultimuseObsidianSettings { + botApiUrl: string; // Bot HTTP API URL (hidden from user UI for security) + pollInterval: number; // in minutes + scenesFolder: string; + basePath: string; // Obsidian Base file path (e.g., "RP Scenes/Roleplay Tracker.base") + ownerId: string; // DEPRECATED: Auto-synced from API key, kept for backward compatibility + userIds: string; // DEPRECATED: Auto-synced from API key, kept for backward compatibility + enabled: boolean; + apiKey: string; // API key for authentication (Bearer token) + cachedUserId: string; // Cached user ID from API key (auto-populated) +} + +const DEFAULT_SETTINGS: MultimuseObsidianSettings = { + botApiUrl: 'http://216.201.73.233:9056', // Hidden from user for security + pollInterval: 15, + scenesFolder: 'RP Scenes', + basePath: '', + ownerId: '', // Deprecated - auto-synced from API key + userIds: '', // Deprecated - auto-synced from API key + enabled: true, + apiKey: '', + cachedUserId: '' // Auto-populated from API key +}; + +interface MuseInfo { + name: string; + trigger: string; + tags: string; + owner_id: number; + is_shared: boolean; +} + +export default class MultimuseObsidian extends Plugin { + settings: MultimuseObsidianSettings; + pollIntervalId: number | null = null; + museCache: Map = new Map(); // user_id (as string) -> muses + + async onload() { + await this.loadSettings(); + + // Add settings tab + this.addSettingTab(new MultimuseObsidianSettingTab(this.app, this)); + + // Sync muses on startup (auto-fetch user ID from API key) + if (this.settings.apiKey) { + await this.getUserIdFromApiKey(); // Cache user ID + await this.syncMuses(); + } + + // Start polling if enabled + if (this.settings.enabled && this.settings.apiKey) { + this.startPolling(); + } + + // Add command to manually check now + this.addCommand({ + id: 'check-discord-threads', + name: 'Check Discord Threads Now', + callback: () => { + this.checkAllThreads(); + } + }); + + // Add command to toggle polling + this.addCommand({ + id: 'toggle-polling', + name: 'Toggle Discord Polling', + callback: () => { + this.settings.enabled = !this.settings.enabled; + this.saveSettings(); + if (this.settings.enabled) { + this.startPolling(); + new Notice('Discord polling enabled'); + } else { + this.stopPolling(); + new Notice('Discord polling disabled'); + } + } + }); + + // Add command to create new scene + this.addCommand({ + id: 'create-scene', + name: 'Create New Scene', + callback: () => { + this.createNewScene(); + } + }); + + // Add command to sync from tracker + this.addCommand({ + id: 'sync-from-tracker', + name: 'Sync from Tracker', + callback: () => { + this.syncFromTracker(); + } + }); + + // Watch for scene file creation/modification to check state + this.registerEvent( + this.app.vault.on('modify', async (file) => { + if (file instanceof TFile && file.extension === 'md') { + await this.handleSceneFileChange(file); + } + }) + ); + + this.registerEvent( + this.app.vault.on('create', async (file) => { + if (file instanceof TFile && file.extension === 'md') { + await this.handleSceneFileChange(file); + } + }) + ); + + // Add context menu item for sending text as muse + this.registerEvent( + this.app.workspace.on('editor-menu', (menu, editor, view) => { + menu.addItem((item) => { + item.setTitle('Send as Muse') + .setIcon('message-square') + .onClick(async () => { + // Type guard: ensure view is MarkdownView, not MarkdownFileInfo + if (view instanceof MarkdownView) { + await this.sendSelectionAsMuse(editor, view); + } else { + new Notice('This feature requires a markdown view.'); + } + }); + }); + }) + ); + } + + onunload() { + this.stopPolling(); + } + + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + // Ensure botApiUrl always uses default if empty or not set + if (!this.settings.botApiUrl || this.settings.botApiUrl.trim() === '') { + this.settings.botApiUrl = DEFAULT_SETTINGS.botApiUrl; + } + } + + async saveSettings() { + await this.saveData(this.settings); + } + + startPolling() { + this.stopPolling(); // Clear any existing interval + + if (!this.settings.ownerId) { + new Notice('Discord user ID not configured. Please set it in settings.'); + return; + } + + const intervalMs = this.settings.pollInterval * 60 * 1000; + this.pollIntervalId = window.setInterval(() => { + this.checkAllThreads(); + }, intervalMs); + + // Do an initial check + this.checkAllThreads(); + } + + stopPolling() { + if (this.pollIntervalId !== null) { + window.clearInterval(this.pollIntervalId); + this.pollIntervalId = null; + } + } + + /** + * Get the bot API URL, falling back to default if not set. + * @returns Bot API URL string + */ + getBotApiUrl(): string { + if (!this.settings.botApiUrl || this.settings.botApiUrl.trim() === '') { + return DEFAULT_SETTINGS.botApiUrl; + } + return this.settings.botApiUrl; + } + + /** + * Get headers for API requests, including Authorization header if API key is set. + * @returns Headers object for requestUrl + */ + getApiHeaders(): Record { + const headers: Record = { + 'Content-Type': 'application/json' + }; + + // Add Authorization header if API key is configured + if (this.settings.apiKey && this.settings.apiKey.trim() !== '') { + headers['Authorization'] = `Bearer ${this.settings.apiKey.trim()}`; + } + + return headers; + } + + /** + * Handle API response errors, especially authentication errors. + * @param response The response object from requestUrl + * @param context Context string for logging + * @returns true if error was handled, false otherwise + */ + handleApiError(response: any, context: string): boolean { + if (response.status === 401) { + const errorMsg = 'API authentication failed. Please check your API key in settings.'; + console.error(`[MultimuseObsidian] ${context}: ${errorMsg}`); + new Notice(errorMsg); + return true; + } + return false; + } + + /** + * Get user ID from API key (cached or fetched fresh). + * @returns User ID string, or null if not available + */ + async getUserIdFromApiKey(): Promise { + // If we have a cached user ID and API key is set, use it + if (this.settings.cachedUserId && this.settings.apiKey) { + return this.settings.cachedUserId; + } + + // If no API key, can't get user ID + if (!this.settings.apiKey || this.settings.apiKey.trim() === '') { + return null; + } + + // Fetch user ID from API + try { + const url = `${this.getBotApiUrl()}/api/v1/auth/me`; + const response = await requestUrl({ + url: url, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status === 200) { + const data = JSON.parse(response.text); + const userId = data.user_id; + if (userId) { + // Cache the user ID + this.settings.cachedUserId = String(userId); + // Also update deprecated fields for backward compatibility + this.settings.ownerId = String(userId); + this.settings.userIds = ''; + await this.saveSettings(); + return this.settings.cachedUserId; + } + } else { + if (!this.handleApiError(response, 'getUserIdFromApiKey')) { + console.error(`[MultimuseObsidian] Failed to get user ID from API: ${response.status}`); + } + } + } catch (error) { + console.error('[MultimuseObsidian] Error fetching user ID from API key:', error); + } + + return null; + } + + /** + * Collect all configured user IDs (now just from API key). + * @returns Array of user ID numbers + */ + async getAllUserIds(): Promise { + const userId = await this.getUserIdFromApiKey(); + if (userId) { + return [userId]; + } + // Fallback to old settings for backward compatibility + const userIdSet = new Set(); + if (this.settings.ownerId) { + const ownerIds = this.settings.ownerId.split(',').map(id => id.trim()).filter(id => id.length > 0); + ownerIds.forEach(id => userIdSet.add(id)); + } + if (this.settings.userIds) { + const additionalIds = this.settings.userIds.split(',').map(id => id.trim()).filter(id => id.length > 0); + additionalIds.forEach(id => userIdSet.add(id)); + } + return Array.from(userIdSet); + } + + /** + * Get the primary user ID (from API key). + * @returns Primary user ID as string, or null if not configured + */ + async getPrimaryUserId(): Promise { + return await this.getUserIdFromApiKey(); + } + + async syncMuses(): Promise { + /**Sync muse names from bot API for all configured user IDs.*/ + if (!this.settings.apiKey) { + return; + } + + try { + // Collect all user IDs (deduplicated) - now from API key + const userIds = await this.getAllUserIds(); + if (userIds.length === 0) { + return; + } + + // Build query string - always use user_ids parameter for consistency + const queryParam = `user_ids=${userIds.join(',')}`; + + const url = `${this.getBotApiUrl()}/api/v1/muses/list?${queryParam}`; + + const response = await requestUrl({ + url: url, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status === 200) { + const data = JSON.parse(response.text); + const muses: MuseInfo[] = data.muses || []; + + // Cache all muses for each user ID (API already returns all accessible muses for all provided user IDs) + // Since the API returns muses that are either owned by or shared with any of the user IDs, + // we cache all of them for each user ID so they're available when needed + // Keep user IDs as strings to avoid precision loss with large Discord IDs + for (const userId of userIds) { + this.museCache.set(String(userId), muses); + } + + console.log(`[MultimuseObsidian] Synced ${muses.length} muse(s) for ${userIds.length} user(s)`); + } else { + if (!this.handleApiError(response, 'syncMuses')) { + console.error(`Failed to sync muses: ${response.status} - ${response.text}`); + } + } + } catch (error) { + console.error('Error syncing muses:', error); + } + } + + async checkAllThreads() { + if (!this.settings.enabled || !this.settings.apiKey) { + return; + } + + await this.checkAllThreadsViaBotApi(); + } + + async checkAllThreadsViaBotApi(): Promise { + /**Check all scene files by querying the tracker API for linked scenes in batch.*/ + if (!this.settings.apiKey) { + return; + } + + try { + // Get primary user ID for linked scenes query + const primaryUserIdStr = await this.getPrimaryUserId(); + if (!primaryUserIdStr) { + return; + } + const primaryUserId = parseInt(primaryUserIdStr); + if (isNaN(primaryUserId)) { + return; + } + + // Get all linked scenes from the API + const linkedUrl = `${this.getBotApiUrl()}/api/v1/scenes/linked?user_id=${primaryUserId}`; + const linkedResponse = await requestUrl({ + url: linkedUrl, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (linkedResponse.status !== 200) { + if (!this.handleApiError(linkedResponse, 'checkAllThreadsViaBotApi')) { + console.error(`[MultimuseObsidian] Failed to fetch linked scenes: ${linkedResponse.status} - ${linkedResponse.text}`); + } + return; + } + + const linkedData = JSON.parse(linkedResponse.text); + const linkedThreads = linkedData.linked_threads || []; + + if (linkedThreads.length === 0) { + return; + } + + // Create a map of scene_path -> thread info for quick lookup + const scenePathMap = new Map(); + for (const thread of linkedThreads) { + if (thread.scene_path) { + scenePathMap.set(thread.scene_path, thread); + } + } + + // Get all scene files + const sceneFiles = this.getSceneFiles(); + let updatedCount = 0; + + // Process each scene file + for (const file of sceneFiles) { + try { + const cache = this.app.metadataCache.getFileCache(file); + if (!cache || !cache.frontmatter) { + continue; + } + + // Skip if scene is marked as inactive + const isActive = cache.frontmatter['Is Active?']; + if (isActive === false || isActive === 'false') { + continue; + } + + // Check if this scene is in the linked threads + const threadInfo = scenePathMap.get(file.path); + if (!threadInfo) { + // Scene not linked, try querying by thread_id and characters + const link = cache.frontmatter['Link']; + if (!link) continue; + + const characters = this.getCharacterNames(cache.frontmatter); + if (characters.length === 0) continue; + + const threadId = this.extractThreadIdFromUrl(link); + if (!threadId) continue; + + // Query this scene individually + const updated = await this.querySceneState(file); + if (updated) { + updatedCount++; + } + } else { + // Scene is linked - query its state + const characters = threadInfo.characters || []; + if (characters.length === 0) continue; + + const charactersParam = Array.isArray(characters) ? characters.join(',') : characters; + // Use primary user ID for query + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + continue; + } + const queryUrl = `${this.getBotApiUrl()}/api/v1/scenes/query?thread_id=${threadInfo.thread_id}&characters=${encodeURIComponent(charactersParam)}&user_id=${primaryUserId}`; + + const queryResponse = await requestUrl({ + url: queryUrl, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (queryResponse.status === 200) { + const queryData = JSON.parse(queryResponse.text); + + if (queryData.tracked && queryData.state) { + const state = queryData.state; + const updated = await this.updateSceneFromState(file, cache, state); + if (updated) { + updatedCount++; + } + } + } else { + // Log auth errors but don't spam for every scene + if (queryResponse.status === 401) { + this.handleApiError(queryResponse, 'checkAllThreadsViaBotApi - query scene'); + } + } + } + } catch (error) { + console.error(`Error checking ${file.path}:`, error); + } + } + + if (updatedCount > 0) { + new Notice(`Updated ${updatedCount} scene file(s)`); + } + } catch (error) { + console.error(`[MultimuseObsidian] Error checking all threads:`, error); + } + } + + async querySceneState(file: TFile): Promise { + /**Query the tracker API for a specific scene's state and update frontmatter.*/ + const cache = this.app.metadataCache.getFileCache(file); + if (!cache || !cache.frontmatter) { + return false; + } + + // Skip if scene is marked as inactive + const isActive = cache.frontmatter['Is Active?']; + if (isActive === false || isActive === 'false') { + return false; // Skip inactive scenes + } + + const link = cache.frontmatter['Link']; + if (!link) { + return false; + } + + const characters = this.getCharacterNames(cache.frontmatter); + if (characters.length === 0) { + return false; + } + + const threadId = this.extractThreadIdFromUrl(link); + if (!threadId) { + return false; + } + + try { + // Query the tracker API for this specific scene + const charactersParam = characters.join(','); + // Use primary user ID for query + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + return false; + } + const url = `${this.getBotApiUrl()}/api/v1/scenes/query?thread_id=${threadId}&characters=${encodeURIComponent(charactersParam)}&user_id=${primaryUserId}`; + + const response = await requestUrl({ + url: url, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status !== 200) { + if (!this.handleApiError(response, `querySceneState for ${file.path}`)) { + console.error(`[MultimuseObsidian] API error for ${file.path}: ${response.status} - ${response.text}`); + } + return false; + } + + const data = JSON.parse(response.text); + + // If scene is not tracked, don't update anything + if (!data.tracked || !data.state) { + return false; + } + + const state = data.state; + return await this.updateSceneFromState(file, cache, state); + } catch (error) { + console.error(`[MultimuseObsidian] Error querying scene state for ${file.path}:`, error); + return false; + } + } + + async updateSceneFromState(file: TFile, cache: any, state: any): Promise { + /**Update scene frontmatter from API state data.*/ + let updated = false; + + // Update Replied? field - normalize boolean values for comparison + const currentRepliedRaw = cache.frontmatter['Replied?']; + // Handle both boolean and string values + const currentReplied = currentRepliedRaw === true || currentRepliedRaw === 'true' || currentRepliedRaw === 'True'; + const shouldBeReplied = state.replied === true || state.replied === 'true'; // true = your turn, false = not your turn + + if (currentReplied !== shouldBeReplied) { + console.log(`[MultimuseObsidian] ${file.basename}: Updated Replied? to ${shouldBeReplied}`); + await this.updateFrontmatter(file, 'Replied?', shouldBeReplied); + updated = true; + } + + // Update Participants field + const currentParticipants = cache.frontmatter['Participants'] || cache.frontmatter['participants']; + const shouldBeParticipants = state.participants || 2; + + if (currentParticipants !== shouldBeParticipants) { + console.log(`[MultimuseObsidian] ${file.basename}: Updated Participants to ${shouldBeParticipants}`); + await this.updateFrontmatter(file, 'Participants', shouldBeParticipants); + updated = true; + } + + return updated; + } + + + async handleSceneFileChange(file: TFile): Promise { + /**Handle scene file creation/modification - scenes are auto-detected when queried, no registration needed.*/ + // Only process files in the scenes folder + if (!file.path.startsWith(this.settings.scenesFolder + '/')) { + return; + } + + // Only process if enabled and API key is set + if (!this.settings.apiKey || !this.settings.enabled) { + return; + } + + // Small delay to avoid checking during file creation + await new Promise(resolve => setTimeout(resolve, 1000)); + + // Query the scene state - this will auto-detect if it matches a tracked thread + try { + await this.querySceneState(file); + } catch (error) { + // Silently fail - don't spam errors for every file change + console.debug(`Error checking scene ${file.path}:`, error); + } + } + + + getSceneFiles(): TFile[] { + const folder = this.app.vault.getAbstractFileByPath(this.settings.scenesFolder); + if (!folder) { + return []; + } + + const files: TFile[] = []; + this.collectMarkdownFiles(folder, files); + return files; + } + + collectMarkdownFiles(fileOrFolder: any, files: TFile[]): void { + if (fileOrFolder instanceof TFile && fileOrFolder.extension === 'md') { + files.push(fileOrFolder); + } else if ('children' in fileOrFolder) { + for (const child of fileOrFolder.children) { + this.collectMarkdownFiles(child, files); + } + } + } + + + getCharacterNames(frontmatter: any): string[] { + const characters = frontmatter['Characters']; + if (!characters) { + return []; + } + + // Handle both array and single value + if (Array.isArray(characters)) { + return characters.map(c => String(c).trim()); + } else if (typeof characters === 'string') { + // Handle comma-separated string + return characters.split(',').map(c => c.trim()).filter(c => c.length > 0); + } + + return [String(characters).trim()]; + } + + + extractThreadIdFromUrl(url: string): string | null { + if (!url || typeof url !== 'string') { + return null; + } + + // Discord URL formats: + // Thread URL: https://discord.com/channels/GUILD_ID/CHANNEL_ID/THREAD_ID (3 IDs - extract last) + // Channel/Thread URL: https://discord.com/channels/GUILD_ID/THREAD_ID (2 IDs - extract second) + // Also handle canary.discord.com + const match3 = url.match(/discord(?:app)?(?:canary)?\.com\/channels\/\d+\/\d+\/(\d+)/); + if (match3) { + return match3[1]; // Thread URL with 3 IDs + } + + const match2 = url.match(/discord(?:app)?(?:canary)?\.com\/channels\/\d+\/(\d+)/); + if (match2) { + return match2[1]; // Channel/Thread URL with 2 IDs (thread ID is the channel ID) + } + + return null; + } + + + async updateFrontmatter(file: TFile, key: string, value: any): Promise { + const content = await this.app.vault.read(file); + + // Parse frontmatter + const frontmatterRegex = /^---\s*\n([\s\S]*?)\n---\s*\n/; + const match = content.match(frontmatterRegex); + + if (!match) { + console.error(`[MultimuseObsidian] No frontmatter found in ${file.path}`); + return; + } + + let frontmatterText = match[1]; + const body = content.slice(match[0].length); + + // Escape special regex characters in the key + const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + + // Format value for YAML (handle booleans, strings, etc.) + let formattedValue: string; + if (typeof value === 'boolean') { + formattedValue = value.toString(); // "true" or "false" + } else if (typeof value === 'string') { + formattedValue = value; + } else { + formattedValue = String(value); + } + + // Update the key-value pair - match the key at the start of a line + // Handle both single-line and multi-line values + // Match any value after the colon (including true/false, "true"/"false", etc.) + const keyRegex = new RegExp(`^${escapedKey}:\\s*(.+)$`, 'gm'); + const keyMatch = frontmatterText.match(keyRegex); + + if (keyMatch) { + // Replace ALL occurrences of the key (in case there are duplicates) + // Always update to the new value + frontmatterText = frontmatterText.replace(keyRegex, `${key}: ${formattedValue}`); + } else { + // Add new key-value pair at the end + frontmatterText += `\n${key}: ${formattedValue}`; + } + + // Reconstruct file content + const newContent = `---\n${frontmatterText}\n---\n${body}`; + + await this.app.vault.modify(file, newContent); + } + + // ========= NEW COMMAND METHODS ========= + + async createNewScene(): Promise { + /**Create a new scene with muse selection, thread link, location, name, and participants.*/ + if (!this.settings.apiKey) { + new Notice('API key must be configured in settings.'); + return; + } + + // 1) Get muses from bot API for all configured user IDs + let muses: MuseInfo[] = []; + try { + // Collect all user IDs (deduplicated) - now from API key + const userIds = await this.getAllUserIds(); + if (userIds.length === 0) { + new Notice('Failed to get user ID from API key. Please check your API key in settings.'); + return; + } + + // Always use user_ids parameter for consistency with API + const queryParam = `user_ids=${userIds.join(',')}`; + + const url = `${this.getBotApiUrl()}/api/v1/muses/list?${queryParam}`; + console.log(`[MultimuseObsidian] Fetching muses for ${userIds.length} user(s): ${userIds.join(', ')}`); + console.log(`[MultimuseObsidian] API URL: ${url}`); + + const response = await requestUrl({ + url: url, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status === 200) { + const data = JSON.parse(response.text); + muses = data.muses || []; + console.log(`[MultimuseObsidian] Found ${muses.length} muse(s) from ${userIds.length} user(s)`); + if (muses.length > 0) { + const ownerIds = muses.map(m => m.owner_id); + const uniqueOwners = [...new Set(ownerIds)]; + console.log(`[MultimuseObsidian] Muses from ${uniqueOwners.length} owner(s): ${uniqueOwners.join(', ')}`); + console.log(`[MultimuseObsidian] Muse names: ${muses.map(m => m.name).join(', ')}`); + } + } else { + if (!this.handleApiError(response, 'createNewScene - fetch muses')) { + console.error(`[MultimuseObsidian] API error: ${response.status} - ${response.text}`); + new Notice(`Failed to fetch muses: ${response.status}`); + } + return; + } + } catch (error) { + console.error('Error fetching muses:', error); + new Notice('Failed to fetch muses from bot API. Check your API URL and connection.'); + return; + } + + if (muses.length === 0) { + new Notice('No muses found. Make sure you have muses created in Discord.'); + return; + } + + // 2) Select muse + const museOptions = muses.map(m => m.name); + const selectedMuseIndex = await this.showSuggester(museOptions, museOptions); + if (selectedMuseIndex === null || selectedMuseIndex < 0) return; + + const selectedMuse = muses[selectedMuseIndex]; + + // 3) Get Discord thread/channel link + const threadUrl = await this.showInputPrompt('Enter Discord thread/channel URL'); + if (!threadUrl) return; + + const threadInfo = this.extractThreadInfoFromUrl(threadUrl); + if (!threadInfo) { + new Notice('Invalid Discord URL format.'); + return; + } + + // 4) Get location (RP folder) + const location = await this.selectSceneLocation(); + if (!location) return; + + // 5) Get scene name + const sceneName = await this.showInputPrompt('Enter scene name', `${selectedMuse.name} - Scene`); + if (!sceneName) return; + + // 6) Get participants + const participantsStr = await this.showInputPrompt('Number of participants (default: 2)', '2'); + const participants = parseInt(participantsStr) || 2; + + // 7) Create scene file + const filePath = `${location}/${sceneName}.md`; + const frontmatter = { + 'Link': threadUrl, + 'Characters': [selectedMuse.name], + 'Participants': participants, + 'Replied?': false, + 'Created': new Date().toISOString().split('T')[0], + }; + + const frontmatterLines = ['---']; + for (const [key, value] of Object.entries(frontmatter)) { + if (Array.isArray(value)) { + frontmatterLines.push(`${key}:`); + for (const item of value) { + frontmatterLines.push(` - ${item}`); + } + } else { + frontmatterLines.push(`${key}: ${value}`); + } + } + frontmatterLines.push('---'); + frontmatterLines.push(''); + + const content = frontmatterLines.join('\n'); + + // Ensure folder exists + const folderPath = location; + const folder = this.app.vault.getAbstractFileByPath(folderPath); + if (!folder) { + await this.app.vault.createFolder(folderPath); + } + + // Create file + const createdFile = await this.app.vault.create(filePath, content); + + // 8) Register with bot API and optionally create thread tracking + try { + // Register scene + // Log the extracted thread info for debugging + console.debug(`Registering scene: threadId=${threadInfo.threadId}, guildId=${threadInfo.guildId}, channelId=${threadInfo.channelId}, url=${threadUrl}`); + + // Convert IDs to strings to avoid JavaScript number precision loss + // Discord IDs are larger than Number.MAX_SAFE_INTEGER, so we send them as strings + // Use primary user ID for scene registration + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + new Notice('Failed to get user ID from API key. Please check your API key in settings.'); + return; + } + + const registerResponse = await requestUrl({ + url: `${this.getBotApiUrl()}/api/v1/scenes/create`, + method: 'POST', + headers: this.getApiHeaders(), + body: JSON.stringify({ + thread_id: threadInfo.threadId, // Send as string, let Python convert + user_id: primaryUserId, // Send as string + scene_path: createdFile.path, + characters: [selectedMuse.name], + participants: participants, + is_active: true, + guild_id: threadInfo.guildId || null // Send as string or null + }) + }); + + console.debug(`Scene registration response: ${registerResponse.status} - ${registerResponse.text}`); + + if (registerResponse.status === 200) { + // Scene registered successfully - proceed with optional operations + + // Also create thread tracking (optional - don't fail if this errors) + // This may fail if bot can't access the thread, which is okay + try { + const trackResponse = await requestUrl({ + url: `${this.getBotApiUrl()}/api/v1/threads/track`, + method: 'POST', + headers: this.getApiHeaders(), + body: JSON.stringify({ + thread_id: threadInfo.threadId, // Send as string to avoid precision loss + user_id: primaryUserId, // Send as string + muse_name: selectedMuse.name, + participants: participants, + scene_path: createdFile.path, + guild_id: threadInfo.guildId || null // Send as string or null + }) + }); + + if (trackResponse.status === 200) { + console.debug('Thread tracking created successfully'); + } else { + console.error(`Thread tracking failed: ${trackResponse.status} - ${trackResponse.text}`); + } + } catch (trackError: any) { + // Thread tracking is optional - scene is already registered + // Only log if it's not a 400 (which means bot can't access thread - expected) + if (trackError?.status !== 400) { + console.error('Thread tracking error (non-fatal):', trackError); + } + } + + // Add to Base if configured + try { + if (this.settings.basePath) { + await this.addSceneToBase(createdFile, frontmatter); + } + } catch (baseError) { + console.error('Error adding to Base (non-fatal):', baseError); + } + + new Notice(`Scene created: ${sceneName}`); + await this.app.workspace.getLeaf(true).openFile(createdFile); + } else if (registerResponse.status === 401) { + // Authentication error - show helpful message + this.handleApiError(registerResponse, 'createNewScene - register scene'); + new Notice('Scene created but failed to register with bot: Authentication failed. Check your API key.'); + } else { + const errorText = registerResponse.text || 'Unknown error'; + console.error(`Failed to register scene: ${registerResponse.status} - ${errorText}`); + new Notice(`Scene created but failed to register with bot: ${registerResponse.status}`); + } + } catch (error: any) { + // Log the full error for debugging + console.error('Error registering scene:', error); + const errorMessage = error?.message || error?.text || 'Unknown error'; + console.error('Error details:', errorMessage); + + // Only show error if scene registration itself failed + // Thread tracking errors are handled above and shouldn't reach here + if (error?.status === 400 && error?.message?.includes('threads/track')) { + // This is a thread tracking error that slipped through - ignore it + // Scene was already registered successfully + new Notice(`Scene created: ${sceneName}`); + await this.app.workspace.getLeaf(true).openFile(createdFile); + } else { + new Notice(`Scene created but failed to register with bot: ${errorMessage}`); + } + } + } + + async syncFromTracker(): Promise { + /**Sync scenes from bot tracker to Obsidian Base and create missing scene files.*/ + if (!this.settings.apiKey) { + new Notice('API key must be configured in settings.'); + return; + } + + try { + // Get primary user ID for tracked threads query + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + new Notice('Failed to get user ID from API key. Please check your API key in settings.'); + return; + } + + // Get tracked threads from bot + const response = await requestUrl({ + url: `${this.getBotApiUrl()}/api/v1/threads/tracked?user_id=${primaryUserId}`, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status !== 200) { + if (!this.handleApiError(response, 'syncFromTracker - fetch tracked threads')) { + console.error(`Failed to fetch tracked threads: ${response.status}`); + new Notice('Failed to fetch tracked threads from bot.'); + } + return; + } + + const data = JSON.parse(response.text); + const threads = data.threads || []; + + if (threads.length === 0) { + new Notice('No tracked threads found.'); + return; + } + + let createdCount = 0; + let updatedCount = 0; + + for (const thread of threads) { + const threadId = thread.thread_id; + const museName = thread.muse_name; + const participants = thread.participants || 2; + const existingScenePath = thread.scene_path; + + // Check if scene already exists + if (existingScenePath) { + const existingFile = this.app.vault.getAbstractFileByPath(existingScenePath); + if (existingFile && existingFile instanceof TFile) { + // Update Base if configured + if (this.settings.basePath) { + await this.updateBaseRecord(existingFile, thread); + } + updatedCount++; + continue; + } + } + + // Create new scene file + // Only create if we have a valid scene_path (thread is linked to Obsidian) + // If no scene_path, this thread isn't meant to be an Obsidian scene + if (!existingScenePath) { + // Skip threads without scene_path - they're not Obsidian scenes + continue; + } + + const guildId = thread.guild_id; + // Don't create URLs with guild_id=0 - that's invalid + const threadUrl = guildId && guildId !== '0' && guildId !== 0 + ? `https://discord.com/channels/${guildId}/${threadId}` + : null; // Can't create valid URL without guild_id + + if (!threadUrl) { + console.debug(`Skipping thread ${threadId} - no valid guild_id`); + continue; + } + + // Determine location (use scenes folder + default subfolder or prompt) + const location = await this.selectSceneLocation(`muse "${museName}"`); + if (!location) continue; + + const sceneName = thread.thread_name || `${museName} - Thread ${threadId}`; + const filePath = `${location}/${sceneName}.md`; + + const frontmatter = { + 'Link': threadUrl, + 'Characters': [museName], + 'Participants': participants, + 'Replied?': false, + 'Created': new Date().toISOString().split('T')[0], + }; + + const frontmatterLines = ['---']; + for (const [key, value] of Object.entries(frontmatter)) { + if (Array.isArray(value)) { + frontmatterLines.push(`${key}:`); + for (const item of value) { + frontmatterLines.push(` - ${item}`); + } + } else { + frontmatterLines.push(`${key}: ${value}`); + } + } + frontmatterLines.push('---'); + frontmatterLines.push(''); + + const content = frontmatterLines.join('\n'); + + // Ensure folder exists + const folder = this.app.vault.getAbstractFileByPath(location); + if (!folder) { + await this.app.vault.createFolder(location); + } + + // Create file + const file = await this.app.vault.create(filePath, content); + + // Register with bot + // Use primary user ID for scene registration + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + console.error('Failed to get user ID from API key, skipping scene registration'); + continue; + } + + await requestUrl({ + url: `${this.getBotApiUrl()}/api/v1/scenes/create`, + method: 'POST', + headers: this.getApiHeaders(), + body: JSON.stringify({ + thread_id: threadId, // Send as string to avoid precision loss + user_id: primaryUserId, // Send as string + scene_path: filePath, + characters: [museName], + participants: participants, + guild_id: guildId || null, // Include guild_id if available + }) + }); + + // Add to Base if configured + if (this.settings.basePath) { + await this.addSceneToBase(file, frontmatter); + } + + createdCount++; + } + + new Notice(`Sync complete: ${createdCount} created, ${updatedCount} updated`); + } catch (error) { + console.error('Error syncing from tracker:', error); + new Notice('Error syncing from tracker. Check console for details.'); + } + } + + // ========= BASE INTEGRATION ========= + + async addSceneToBase(file: TFile, frontmatter: any): Promise { + /**Add scene to Obsidian Base with characters as variables.*/ + if (!this.settings.basePath) return; + + try { + const baseFile = this.app.vault.getAbstractFileByPath(this.settings.basePath); + if (!baseFile || !(baseFile instanceof TFile)) { + return; + } + + // Skip .base files - they use a special format that we shouldn't modify directly + // Base plugin should handle its own format + if (baseFile.extension === 'base') { + console.log(`[MultimuseObsidian] Skipping Base integration for .base file - use Base plugin UI to add records`); + return; + } + + // Only handle .md files with markdown tables + if (baseFile.extension !== 'md') { + return; + } + + // Read Base file + const baseContent = await this.app.vault.read(baseFile); + + // Extract characters from frontmatter + const characters = this.getCharacterNames(frontmatter); + const link = frontmatter['Link'] || ''; + const participants = frontmatter['Participants'] || 2; + const replied = frontmatter['Replied?'] || false; + + // Check if scene already exists in table + if (baseContent.includes(`| ${file.basename} |`)) { + // Scene already exists, skip + return; + } + + // Add record as markdown table row + const recordLine = `| ${file.basename} | ${characters.join(', ')} | ${link} | ${participants} | ${replied} |\n`; + + // Check if Base has table structure + if (baseContent.includes('|')) { + // Append to existing table + await this.app.vault.modify(baseFile, baseContent + recordLine); + } else { + // Create table structure + const tableHeader = '| Scene | Characters | Link | Participants | Replied? |\n|-------|------------|------|--------------|----------|\n'; + await this.app.vault.modify(baseFile, tableHeader + recordLine); + } + } catch (error) { + console.error('Error adding scene to Base:', error); + } + } + + async updateBaseRecord(file: TFile, thread: any): Promise { + /**Update existing Base record for a scene.*/ + if (!this.settings.basePath) return; + + try { + const baseFile = this.app.vault.getAbstractFileByPath(this.settings.basePath); + if (!baseFile || !(baseFile instanceof TFile)) return; + + // Skip .base files - they use a special format + if (baseFile.extension === 'base') { + return; + } + + // Only handle .md files + if (baseFile.extension !== 'md') { + return; + } + + const baseContent = await this.app.vault.read(baseFile); + const sceneName = file.basename; + + // Update the row for this scene + const lines = baseContent.split('\n'); + const updatedLines = lines.map(line => { + if (line.includes(`| ${sceneName} |`)) { + const characters = [thread.muse_name]; + const link = thread.guild_id && thread.guild_id !== '0' + ? `https://discord.com/channels/${thread.guild_id}/${thread.thread_id}` + : `https://discord.com/channels/0/${thread.thread_id}`; + return `| ${sceneName} | ${characters.join(', ')} | ${link} | ${thread.participants || 2} | false |`; + } + return line; + }); + + await this.app.vault.modify(baseFile, updatedLines.join('\n')); + } catch (error) { + console.error('Error updating Base record:', error); + } + } + + // ========= HELPER METHODS ========= + + extractThreadInfoFromUrl(url: string): { threadId: string; guildId: string | null; channelId?: string } | null { + // Discord URL formats: + // Thread in channel: https://discord.com/channels/GUILD_ID/CHANNEL_ID/THREAD_ID + // Standalone thread: https://discord.com/channels/GUILD_ID/THREAD_ID (thread ID = channel ID) + const match3 = url.match(/discord(?:app)?(?:canary)?\.com\/channels\/(\d+)\/(\d+)\/(\d+)/); + if (match3) { + // 3-part URL: GUILD_ID/CHANNEL_ID/THREAD_ID - thread ID is the last one + return { guildId: match3[1], channelId: match3[2], threadId: match3[3] }; + } + + const match2 = url.match(/discord(?:app)?(?:canary)?\.com\/channels\/(\d+)\/(\d+)/); + if (match2) { + // 2-part URL: GUILD_ID/THREAD_ID - could be a standalone thread or channel + // In this case, the thread ID is the same as the channel ID + return { guildId: match2[1], threadId: match2[2] }; + } + + return null; + } + + async selectSceneLocation(context?: string): Promise { + /**Select or create scene location folder. + * @param context Optional context string (e.g., muse name) to display in the prompt + */ + const RP_ROOT = this.settings.scenesFolder; + const files = this.app.vault.getFiles(); + const dirSet = new Set(); + + for (const file of files) { + if (!file.path.startsWith(RP_ROOT + "/")) continue; + const parts = file.path.split("/"); + parts.pop(); + if (parts.length >= 2) { + for (let i = 2; i <= parts.length; i++) { + const dirPath = parts.slice(0, i).join("/"); + dirSet.add(dirPath); + } + } + } + + let options = Array.from(dirSet) + .map((fullPath) => fullPath.slice(RP_ROOT.length + 1)) + .filter(Boolean) + .sort((a, b) => a.localeCompare(b, "en", { sensitivity: "base" })); + + options.push("+ New folder path…"); + + // Build title with context if provided + const suggesterTitle = context + ? `Select location for ${context}` + : 'Select scene location'; + + const choiceIndex = await this.showSuggester(options, options, suggesterTitle); + if (choiceIndex === null) return null; + + const choice = options[choiceIndex]; + if (!choice) return null; + + let relPath: string; + if (choice === "+ New folder path…") { + const promptMsg = context + ? `Folder under "${RP_ROOT}" for ${context} (e.g. For the Greeks/Twin Flames)` + : `Folder under "${RP_ROOT}" (e.g. For the Greeks/Twin Flames)`; + const input = await this.showInputPrompt(promptMsg); + if (!input) return null; + relPath = input.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, ""); + } else { + relPath = choice; + } + + return `${RP_ROOT}/${relPath}`; + } + + showSuggester(items: string[], values: any[], title?: string): Promise { + return new Promise((resolve) => { + // Try QuickAdd API first + const quickadd = (this.app as any).plugins.plugins.quickadd; + if (quickadd?.api?.suggester) { + quickadd.api.suggester(items, values).then((selected: any) => { + const index = values.indexOf(selected); + resolve(index >= 0 ? index : null); + }).catch(() => resolve(null)); + return; + } + + // Fallback: create a modal with buttons + const modal = new (class extends Modal { + selectedIndex: number | null = null; + items: string[]; + values: any[]; + titleText: string; + + constructor(app: App, items: string[], values: any[], titleText?: string) { + super(app); + this.items = items; + this.values = values; + this.titleText = titleText || 'Select an option'; + } + + onOpen() { + const { contentEl } = this; + contentEl.empty(); + contentEl.createEl('h2', { text: this.titleText }); + + this.items.forEach((item, index) => { + const button = contentEl.createEl('button', { + text: item, + cls: 'mod-cta', + attr: { style: 'width: 100%; margin: 5px 0;' } + }); + button.onclick = () => { + this.selectedIndex = index; + this.close(); + }; + }); + } + + onClose() { + resolve(this.selectedIndex); + } + })(this.app, items, values, title); + + modal.open(); + }); + } + + showInputPrompt(prompt: string, defaultValue?: string): Promise { + return new Promise((resolve) => { + // Try QuickAdd API first + const quickadd = (this.app as any).plugins.plugins.quickadd; + if (quickadd?.api?.inputPrompt) { + quickadd.api.inputPrompt(prompt, defaultValue).then(resolve).catch(() => resolve(null)); + return; + } + + // Fallback: use Obsidian's built-in prompt + const modal = new (class extends Modal { + inputEl: HTMLInputElement; + value: string | null = null; + + constructor(app: App, prompt: string, defaultValue?: string) { + super(app); + this.titleEl.textContent = prompt; + this.inputEl = this.contentEl.createEl('input', { + type: 'text', + value: defaultValue || '' + }); + this.inputEl.style.width = '100%'; + this.inputEl.onkeydown = (e) => { + if (e.key === 'Enter') { + this.value = this.inputEl.value; + this.close(); + } + }; + } + + onOpen() { + this.inputEl.focus(); + this.inputEl.select(); + } + + onClose() { + resolve(this.value); + } + })(this.app, prompt, defaultValue); + + modal.open(); + }); + } + + async sendSelectionAsMuse(editor: Editor, view: MarkdownView): Promise { + /**Send selected text as a muse to Discord thread from frontmatter properties.*/ + // Get selected text + const selection = editor.getSelection(); + if (!selection || selection.trim().length === 0) { + new Notice('No text selected. Please select text to send as muse.'); + return; + } + + // Get active file + const file = view.file; + if (!file) { + new Notice('No active file found.'); + return; + } + + // Get frontmatter + const cache = this.app.metadataCache.getFileCache(file); + if (!cache || !cache.frontmatter) { + new Notice('File does not have frontmatter. Please add Link and Characters properties.'); + return; + } + + // Extract link and characters + const link = cache.frontmatter['Link']; + if (!link) { + new Notice('No Link property found in frontmatter. Please add a Discord thread URL.'); + return; + } + + const characters = this.getCharacterNames(cache.frontmatter); + if (characters.length === 0) { + new Notice('No Characters property found in frontmatter. Please add at least one character name.'); + return; + } + + // Extract thread ID from link + const threadId = this.extractThreadIdFromUrl(link); + if (!threadId) { + new Notice('Invalid Discord URL format in Link property.'); + return; + } + + // Get primary user ID + const primaryUserId = await this.getPrimaryUserId(); + if (!primaryUserId) { + new Notice('Failed to get user ID from API key. Please check your API key in settings.'); + return; + } + + // Select muse if multiple characters + let selectedMuse: string; + if (characters.length === 1) { + selectedMuse = characters[0]; + } else { + // Show modal to select muse + const museIndex = await this.showSuggester(characters, characters); + if (museIndex === null || museIndex < 0) { + return; // User cancelled + } + selectedMuse = characters[museIndex]; + } + + // Verify muse exists and is accessible + const userIds = await this.getAllUserIds(); + if (userIds.length === 0) { + new Notice('Failed to get user ID from API key. Please check your API key in settings.'); + return; + } + + // Get muses to verify the selected muse is available + let muses: MuseInfo[] = []; + try { + const queryParam = `user_ids=${userIds.join(',')}`; + const url = `${this.getBotApiUrl()}/api/v1/muses/list?${queryParam}`; + const response = await requestUrl({ + url: url, + method: 'GET', + headers: this.getApiHeaders() + }); + + if (response.status === 200) { + const data = JSON.parse(response.text); + muses = data.muses || []; + } else { + if (!this.handleApiError(response, 'sendSelectionAsMuse - fetch muses')) { + new Notice(`Failed to fetch muses: ${response.status}`); + } + return; + } + } catch (error) { + console.error('Error fetching muses:', error); + new Notice('Failed to fetch muses from bot API. Check your API URL and connection.'); + return; + } + + // Check if selected muse exists (case-insensitive fuzzy match) + const museExists = muses.some(m => { + const museLower = m.name.toLowerCase().trim(); + const selectedLower = selectedMuse.toLowerCase().trim(); + // Exact match or contains check + return museLower === selectedLower || museLower.includes(selectedLower) || selectedLower.includes(museLower); + }); + + if (!museExists) { + new Notice(`Muse "${selectedMuse}" not found or not accessible. Available muses: ${muses.map(m => m.name).join(', ')}`); + return; + } + + // Post message via API + try { + const url = `${this.getBotApiUrl()}/api/v1/messages/post`; + const response = await requestUrl({ + url: url, + method: 'POST', + headers: this.getApiHeaders(), + body: JSON.stringify({ + thread_id: threadId, + muse_name: selectedMuse, + content: selection.trim(), + user_id: primaryUserId + }) + }); + + if (response.status === 200) { + const data = JSON.parse(response.text); + new Notice(`Message sent as ${selectedMuse}!`); + } else { + if (!this.handleApiError(response, 'sendSelectionAsMuse - post message')) { + const errorData = JSON.parse(response.text); + new Notice(`Failed to send message: ${errorData.message || response.status}`); + } + } + } catch (error: any) { + console.error('Error sending message:', error); + const errorMessage = error?.message || error?.text || 'Unknown error'; + new Notice(`Failed to send message: ${errorMessage}`); + } + } +} + +class MultimuseObsidianSettingTab extends PluginSettingTab { + plugin: MultimuseObsidian; + + constructor(app: App, plugin: MultimuseObsidian) { + super(app, plugin); + this.plugin = plugin; + } + + display(): void { + const { containerEl } = this; + + containerEl.empty(); + + containerEl.createEl('h2', { text: 'Multimuse Obsidian Settings' }); + + // Enable/Disable toggle + new Setting(containerEl) + .setName('Enable Polling') + .setDesc('Automatically check Discord threads for new replies') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.enabled) + .onChange(async (value) => { + this.plugin.settings.enabled = value; + await this.plugin.saveSettings(); + if (value) { + this.plugin.startPolling(); + } else { + this.plugin.stopPolling(); + } + })); + + // Poll Interval + new Setting(containerEl) + .setName('Poll Interval (minutes)') + .setDesc('How often to check for new replies') + .addSlider(slider => slider + .setLimits(5, 60, 5) + .setValue(this.plugin.settings.pollInterval) + .setDynamicTooltip() + .onChange(async (value) => { + this.plugin.settings.pollInterval = value; + await this.plugin.saveSettings(); + if (this.plugin.settings.enabled) { + this.plugin.stopPolling(); + this.plugin.startPolling(); + } + })); + + // Scenes Folder + new Setting(containerEl) + .setName('Scenes Folder') + .setDesc('Folder containing your scene files') + .addText(text => text + .setPlaceholder('RP Scenes') + .setValue(this.plugin.settings.scenesFolder) + .onChange(async (value) => { + this.plugin.settings.scenesFolder = value; + await this.plugin.saveSettings(); + })); + + new Setting(containerEl) + .setName('Obsidian Base Path') + .setDesc('Path to your Obsidian Base file (e.g., "RP Scenes/Roleplay Tracker.base" or "RP Scenes/Tracker.md")') + .addText(text => text + .setPlaceholder('RP Scenes/Roleplay Tracker.base') + .setValue(this.plugin.settings.basePath) + .onChange(async (value) => { + this.plugin.settings.basePath = value; + await this.plugin.saveSettings(); + })); + + // Bot API URL - Hidden from user for security (uses hardcoded default) + // Removed from settings UI to prevent exposing server IP address + + // API Key (required for authentication) + new Setting(containerEl) + .setName('API Key') + .setDesc('Your Multimuse API key for authentication. Generate one using /api generate in Discord DMs with the bot. Your user ID will be automatically detected from the API key.') + .addText(text => { + text.setPlaceholder('mm_...') + .setValue(this.plugin.settings.apiKey || '') + .inputEl.type = 'password'; + text.onChange(async (value) => { + this.plugin.settings.apiKey = value.trim(); + // Clear cached user ID when API key changes + this.plugin.settings.cachedUserId = ''; + await this.plugin.saveSettings(); + + // Auto-fetch user ID from API key + if (value.trim()) { + const userId = await this.plugin.getUserIdFromApiKey(); + if (userId) { + new Notice(`User ID detected: ${userId}`); + await this.plugin.syncMuses(); + if (this.plugin.settings.enabled) { + this.plugin.stopPolling(); + this.plugin.startPolling(); + } + } else { + new Notice('Failed to get user ID from API key. Please check your API key.'); + } + } + }); + }); + + // Show cached user ID (read-only, for information) + if (this.plugin.settings.cachedUserId) { + new Setting(containerEl) + .setName('Detected User ID') + .setDesc(`Your Discord user ID (automatically detected from API key): ${this.plugin.settings.cachedUserId}`) + .addText(text => { + text.setValue(this.plugin.settings.cachedUserId) + .setDisabled(true); + }); + } + + // Sync Muses button + new Setting(containerEl) + .setName('Sync Muses') + .setDesc('Manually sync muse names from bot API') + .addButton(button => button + .setButtonText('Sync Now') + .setCta() + .onClick(async () => { + await this.plugin.syncMuses(); + new Notice('Muses synced!'); + })); + + // Manual check button + new Setting(containerEl) + .setName('Manual Check') + .setDesc('Check Discord threads now') + .addButton(button => button + .setButtonText('Check Now') + .setCta() + .onClick(() => { + this.plugin.checkAllThreads(); + new Notice('Checking Discord threads...'); + })); + + // Info section + containerEl.createEl('hr'); + const infoEl = containerEl.createEl('div'); + infoEl.createEl('h3', { text: 'How It Works' }); + infoEl.createEl('p', { text: 'This plugin queries the Multimuse API to check if your scene files match tracked threads and updates the "Replied?" and "Participants" fields.' }); + infoEl.createEl('p', { text: '• Scenes are matched by Link (thread_id) and Characters properties' }); + infoEl.createEl('p', { text: '• If scene matches a tracked thread: Updates Replied? (true = your turn, false = not your turn) and Participants' }); + infoEl.createEl('p', { text: '• If scene does not match: No updates (scene is not tracked)' }); + infoEl.createEl('p', { text: '• Make sure your scene files have a "Link" field (Discord thread URL) and "Characters" field (array) in frontmatter' }); + infoEl.createEl('p', { text: '• Uses Multimuse API - requires an API key for authentication' }); + infoEl.createEl('p', { text: '• Generate an API key using /api generate in Discord DMs with the bot' }); + infoEl.createEl('p', { text: '• Scenes are auto-detected when queried - no manual registration needed' }); + } +} + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..bc5c3bb --- /dev/null +++ b/manifest.json @@ -0,0 +1,12 @@ +{ + "id": "multimuse-obsidian", + "name": "Multimuse Obsidian", + "version": "1.0.0", + "minAppVersion": "1.0.0", + "description": "Roleplay sync tool for use with the MultiMuse bot in discord", + "author": "BackstagePass Group", + "authorUrl": "", + "fundingUrl": "", + "isDesktopOnly": false +} + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..5e66522 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2320 @@ +{ + "name": "discord-scene-tracker", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "discord-scene-tracker", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@types/node": "^16.11.6", + "@typescript-eslint/eslint-plugin": "5.29.0", + "@typescript-eslint/parser": "5.29.0", + "builtin-modules": "3.3.0", + "esbuild": "0.17.3", + "obsidian": "latest", + "tslib": "2.4.0", + "typescript": "4.7.4" + } + }, + "node_modules/@codemirror/state": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.0.tgz", + "integrity": "sha512-MwBHVK60IiIHDcoMet78lxt6iw5gJOGSbNbOIVBHWVXIH4/Nq1+GQgLLGgI1KlnN86WDXsPudVaqYHKBIx7Eyw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.38.6", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.38.6.tgz", + "integrity": "sha512-qiS0z1bKs5WOvHIAC0Cybmv4AJSkAXgX5aD6Mqd2epSLlVJsQl8NG23jCVouIgkh4All/mrbdsf2UOLFnJw0tw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@codemirror/state": "^6.5.0", + "crelt": "^1.0.6", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.3.tgz", + "integrity": "sha512-1Mlz934GvbgdDmt26rTLmf03cAgLg5HyOgJN+ZGCeP3Q9ynYTNMn2/LQxIl7Uy+o4K6Rfi2OuLsr12JQQR8gNg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.3.tgz", + "integrity": "sha512-XvJsYo3dO3Pi4kpalkyMvfQsjxPWHYjoX4MDiB/FUM4YMfWcXa5l4VCwFWVYI1+92yxqjuqrhNg0CZg3gSouyQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.3.tgz", + "integrity": "sha512-nuV2CmLS07Gqh5/GrZLuqkU9Bm6H6vcCspM+zjp9TdQlxJtIe+qqEXQChmfc7nWdyr/yz3h45Utk1tUn8Cz5+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.3.tgz", + "integrity": "sha512-01Hxaaat6m0Xp9AXGM8mjFtqqwDjzlMP0eQq9zll9U85ttVALGCGDuEvra5Feu/NbP5AEP1MaopPwzsTcUq1cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.3.tgz", + "integrity": "sha512-Eo2gq0Q/er2muf8Z83X21UFoB7EU6/m3GNKvrhACJkjVThd0uA+8RfKpfNhuMCl1bKRfBzKOk6xaYKQZ4lZqvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.3.tgz", + "integrity": "sha512-CN62ESxaquP61n1ZjQP/jZte8CE09M6kNn3baos2SeUfdVBkWN5n6vGp2iKyb/bm/x4JQzEvJgRHLGd5F5b81w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.3.tgz", + "integrity": "sha512-feq+K8TxIznZE+zhdVurF3WNJ/Sa35dQNYbaqM/wsCbWdzXr5lyq+AaTUSER2cUR+SXPnd/EY75EPRjf4s1SLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.3.tgz", + "integrity": "sha512-CLP3EgyNuPcg2cshbwkqYy5bbAgK+VhyfMU7oIYyn+x4Y67xb5C5ylxsNUjRmr8BX+MW3YhVNm6Lq6FKtRTWHQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.3.tgz", + "integrity": "sha512-JHeZXD4auLYBnrKn6JYJ0o5nWJI9PhChA/Nt0G4MvLaMrvXuWnY93R3a7PiXeJQphpL1nYsaMcoV2QtuvRnF/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.3.tgz", + "integrity": "sha512-FyXlD2ZjZqTFh0sOQxFDiWG1uQUEOLbEh9gKN/7pFxck5Vw0qjWSDqbn6C10GAa1rXJpwsntHcmLqydY9ST9ZA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.3.tgz", + "integrity": "sha512-OrDGMvDBI2g7s04J8dh8/I7eSO+/E7nMDT2Z5IruBfUO/RiigF1OF6xoH33Dn4W/OwAWSUf1s2nXamb28ZklTA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.3.tgz", + "integrity": "sha512-DcnUpXnVCJvmv0TzuLwKBC2nsQHle8EIiAJiJ+PipEVC16wHXaPEKP0EqN8WnBe0TPvMITOUlP2aiL5YMld+CQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.3.tgz", + "integrity": "sha512-BDYf/l1WVhWE+FHAW3FzZPtVlk9QsrwsxGzABmN4g8bTjmhazsId3h127pliDRRu5674k1Y2RWejbpN46N9ZhQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.3.tgz", + "integrity": "sha512-WViAxWYMRIi+prTJTyV1wnqd2mS2cPqJlN85oscVhXdb/ZTFJdrpaqm/uDsZPGKHtbg5TuRX/ymKdOSk41YZow==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.3.tgz", + "integrity": "sha512-Iw8lkNHUC4oGP1O/KhumcVy77u2s6+KUjieUqzEU3XuWJqZ+AY7uVMrrCbAiwWTkpQHkr00BuXH5RpC6Sb/7Ug==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.3.tgz", + "integrity": "sha512-0AGkWQMzeoeAtXQRNB3s4J1/T2XbigM2/Mn2yU1tQSmQRmHIZdkGbVq2A3aDdNslPyhb9/lH0S5GMTZ4xsjBqg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.3.tgz", + "integrity": "sha512-4+rR/WHOxIVh53UIQIICryjdoKdHsFZFD4zLSonJ9RRw7bhKzVyXbnRPsWSfwybYqw9sB7ots/SYyufL1mBpEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.3.tgz", + "integrity": "sha512-cVpWnkx9IYg99EjGxa5Gc0XmqumtAwK3aoz7O4Dii2vko+qXbkHoujWA68cqXjhh6TsLaQelfDO4MVnyr+ODeA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.3.tgz", + "integrity": "sha512-RxmhKLbTCDAY2xOfrww6ieIZkZF+KBqG7S2Ako2SljKXRFi+0863PspK74QQ7JpmWwncChY25JTJSbVBYGQk2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.3.tgz", + "integrity": "sha512-0r36VeEJ4efwmofxVJRXDjVRP2jTmv877zc+i+Pc7MNsIr38NfsjkQj23AfF7l0WbB+RQ7VUb+LDiqC/KY/M/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.3.tgz", + "integrity": "sha512-wgO6rc7uGStH22nur4aLFcq7Wh86bE9cOFmfTr/yxN3BXvDEdCSXyKkO+U5JIt53eTOgC47v9k/C1bITWL/Teg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.3.tgz", + "integrity": "sha512-FdVl64OIuiKjgXBjwZaJLKp0eaEckifbhn10dXWhysMJkWblg3OEEGKSIyhiD5RSgAya8WzP3DNkngtIg3Nt7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/codemirror": { + "version": "5.60.8", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.8.tgz", + "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/tern": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "16.18.126", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz", + "integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tern": { + "version": "0.23.9", + "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz", + "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.29.0.tgz", + "integrity": "sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/type-utils": "5.29.0", + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.29.0.tgz", + "integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.29.0.tgz", + "integrity": "sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.29.0.tgz", + "integrity": "sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.29.0.tgz", + "integrity": "sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz", + "integrity": "sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.29.0.tgz", + "integrity": "sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.29.0.tgz", + "integrity": "sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/esbuild": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.3.tgz", + "integrity": "sha512-9n3AsBRe6sIyOc6kmoXg2ypCLgf3eZSraWFRpnkto+svt8cZNuKTkb1bhQcitBcvIqjNiK7K0J3KPmwGSfkA8g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.3", + "@esbuild/android-arm64": "0.17.3", + "@esbuild/android-x64": "0.17.3", + "@esbuild/darwin-arm64": "0.17.3", + "@esbuild/darwin-x64": "0.17.3", + "@esbuild/freebsd-arm64": "0.17.3", + "@esbuild/freebsd-x64": "0.17.3", + "@esbuild/linux-arm": "0.17.3", + "@esbuild/linux-arm64": "0.17.3", + "@esbuild/linux-ia32": "0.17.3", + "@esbuild/linux-loong64": "0.17.3", + "@esbuild/linux-mips64el": "0.17.3", + "@esbuild/linux-ppc64": "0.17.3", + "@esbuild/linux-riscv64": "0.17.3", + "@esbuild/linux-s390x": "0.17.3", + "@esbuild/linux-x64": "0.17.3", + "@esbuild/netbsd-x64": "0.17.3", + "@esbuild/openbsd-x64": "0.17.3", + "@esbuild/sunos-x64": "0.17.3", + "@esbuild/win32-arm64": "0.17.3", + "@esbuild/win32-ia32": "0.17.3", + "@esbuild/win32-x64": "0.17.3" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/moment": { + "version": "2.29.4", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/obsidian": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.10.3.tgz", + "integrity": "sha512-VP+ZSxNMG7y6Z+sU9WqLvJAskCfkFrTz2kFHWmmzis+C+4+ELjk/sazwcTHrHXNZlgCeo8YOlM6SOrAFCynNew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/codemirror": "5.60.8", + "moment": "2.29.4" + }, + "peerDependencies": { + "@codemirror/state": "6.5.0", + "@codemirror/view": "6.38.6" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-mod": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz", + "integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4da254c --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "multimuse-obsidian", + "version": "1.0.0", + "description": "Obsidian plugin for MultiMuse bot integration - track Discord threads and send messages as muses", + "main": "main.js", + "scripts": { + "dev": "node esbuild.config.mjs", + "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", + "version": "node version-bump.mjs && git add manifest.json versions.json" + }, + "keywords": [], + "author": "", + "license": "MIT", + "devDependencies": { + "@types/node": "^16.11.6", + "@typescript-eslint/eslint-plugin": "5.29.0", + "@typescript-eslint/parser": "5.29.0", + "builtin-modules": "3.3.0", + "esbuild": "0.17.3", + "obsidian": "latest", + "tslib": "2.4.0", + "typescript": "4.7.4" + } +} + diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..f6c57e3 --- /dev/null +++ b/styles.css @@ -0,0 +1,19 @@ +/* Styles for Discord Scene Tracker plugin */ + +.discord-scene-tracker-settings { + padding: 20px; +} + +.discord-scene-tracker-settings h2 { + margin-top: 0; +} + +.discord-scene-tracker-settings .setting-item { + border-top: 1px solid var(--background-modifier-border); + padding: 18px 0; +} + +.discord-scene-tracker-settings .setting-item:first-child { + border-top: none; +} + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d03466b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "inlineSourceMap": true, + "inlineSources": true, + "module": "ESNext", + "target": "ES6", + "allowJs": true, + "noImplicitAny": true, + "moduleResolution": "node", + "importHelpers": true, + "lib": [ + "DOM", + "ES5", + "ES6", + "ES7" + ] + }, + "include": [ + "**/*.ts" + ] +} +