diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index dbe06ce..5e897a7 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -7,5 +7,8 @@ "dataview", "weather-fetcher", "geocoding-properties", - "obsidian-kanban" + "metaedit", + "kanban-status-updater", + "obsidian-kanban", + "templater-obsidian" ] \ No newline at end of file diff --git a/.obsidian/plugins/kanban-status-updater/data.json b/.obsidian/plugins/kanban-status-updater/data.json new file mode 100644 index 0000000..a61f72c --- /dev/null +++ b/.obsidian/plugins/kanban-status-updater/data.json @@ -0,0 +1,5 @@ +{ + "statusPropertyName": "status", + "showNotifications": true, + "debugMode": false +} \ No newline at end of file diff --git a/.obsidian/plugins/kanban-status-updater/main.js b/.obsidian/plugins/kanban-status-updater/main.js new file mode 100644 index 0000000..9914036 --- /dev/null +++ b/.obsidian/plugins/kanban-status-updater/main.js @@ -0,0 +1,480 @@ +'use strict'; + +var obsidian = require('obsidian'); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +const DEFAULT_SETTINGS = { + statusPropertyName: 'status', + showNotifications: false, + debugMode: false // Default to false for better performance +}; +class KanbanStatusUpdaterPlugin extends obsidian.Plugin { + constructor() { + super(...arguments); + // Track active observers to disconnect them when not needed + this.currentObserver = null; + this.isProcessing = false; + this.activeKanbanBoard = null; + } + onload() { + return __awaiter(this, void 0, void 0, function* () { + console.log('Loading Kanban Status Updater plugin'); + // Load settings + yield this.loadSettings(); + // Display startup notification + if (this.settings.showNotifications) { + new obsidian.Notice('Kanban Status Updater activated'); + } + this.log('Plugin loaded'); + // Register DOM event listener for drag events - but only process if active leaf is Kanban + this.registerDomEvent(document, 'dragend', this.onDragEnd.bind(this)); + this.log('Registered drag event listener'); + // Watch for active leaf changes to only observe the current Kanban board + this.registerEvent(this.app.workspace.on('active-leaf-change', this.onActiveLeafChange.bind(this))); + // Initial check for active Kanban board + this.app.workspace.onLayoutReady(() => { + this.checkForActiveKanbanBoard(); + }); + // Add settings tab + this.addSettingTab(new KanbanStatusUpdaterSettingTab(this.app, this)); + }); + } + onunload() { + // Disconnect any active observers to prevent memory leaks + this.disconnectObservers(); + this.log('Plugin unloaded'); + } + loadSettings() { + return __awaiter(this, void 0, void 0, function* () { + this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); + }); + } + saveSettings() { + return __awaiter(this, void 0, void 0, function* () { + yield this.saveData(this.settings); + }); + } + // Log helper with debug mode check + log(message) { + if (this.settings.debugMode) { + console.log(`[KSU] ${message}`); + } + } + // Clean up observers when switching away from a Kanban board + disconnectObservers() { + if (this.currentObserver) { + this.log('Disconnecting observer for performance'); + this.currentObserver.disconnect(); + this.currentObserver = null; + } + this.activeKanbanBoard = null; + } + // Check if the active leaf is a Kanban board + onActiveLeafChange(leaf) { + this.checkForActiveKanbanBoard(); + } + checkForActiveKanbanBoard() { + var _a; + // First disconnect any existing observers + this.disconnectObservers(); + // Get the active leaf using the non-deprecated API + const activeLeaf = this.app.workspace.getLeaf(false); + if (!activeLeaf) + return; + try { + // Find the content element safely + let contentEl = null; + // Use type assertions to avoid TypeScript errors + if (activeLeaf.view) { + // Try to access the contentEl property using type assertion + contentEl = activeLeaf.view.contentEl || null; + } + // If that didn't work, try another approach + if (!contentEl) { + // Try to get the Kanban board directly from the DOM + // Leaf containers have 'view-content' elements that contain the actual view + const viewContent = (_a = activeLeaf.containerEl) === null || _a === void 0 ? void 0 : _a.querySelector('.view-content'); + if (viewContent) { + contentEl = viewContent; + } + else { + // Last resort - look for Kanban boards anywhere in the workspace + contentEl = document.querySelector('.workspace-leaf.mod-active .view-content'); + } + } + if (!contentEl) { + this.log('Could not access content element for active leaf'); + return; + } + // Check if this is a Kanban board + const kanbanBoard = contentEl.querySelector('.kanban-plugin__board'); + if (kanbanBoard) { + this.log('Found active Kanban board, setting up observer'); + // Store reference to active board + this.activeKanbanBoard = kanbanBoard; + // Set up observer only for this board + this.setupObserverForBoard(kanbanBoard); + } + else { + this.log('Active leaf is not a Kanban board'); + } + } + catch (error) { + this.log(`Error detecting Kanban board: ${error.message}`); + } + } + setupObserverForBoard(boardElement) { + // Create a new observer for this specific board + this.currentObserver = new MutationObserver((mutations) => { + if (this.isProcessing) + return; + // Simple debounce to prevent rapid-fire processing + this.isProcessing = true; + setTimeout(() => { + this.handleMutations(mutations); + this.isProcessing = false; + }, 300); + }); + // Observe only this board with minimal options needed + this.currentObserver.observe(boardElement, { + childList: true, + subtree: true, + attributes: false // Don't need attribute changes for performance + }); + this.log('Observer set up for active Kanban board'); + } + handleMutations(mutations) { + if (!this.activeKanbanBoard) + return; + try { + const max_mutations = 10; + // Only process a sample of mutations for performance + const mutationsToProcess = mutations.length > max_mutations ? + mutations.slice(0, max_mutations) : mutations; + this.log(`Got ${mutationsToProcess.length} mutations of ${mutations.length}`); + // Look for Kanban items in mutation + let i = 0; + for (const mutation of mutationsToProcess) { + this.log(`Mutation #${++i} - Type: ${mutation.type}`); + if (mutation.type === 'childList') { + // Check added nodes for Kanban items + for (const node of Array.from(mutation.addedNodes)) { + try { + // Check if node is any kind of Element (HTML or SVG) + if (node instanceof Element) { + this.log(`Processing Element of type: ${node.tagName}`); + // Handle the node according to its type + if (node instanceof HTMLElement || node instanceof HTMLDivElement) { + // Direct processing for HTML elements + this.log(`Found HTML element of type ${node.className}`); + this.processElement(node); + } + else if (node instanceof SVGElement) { + // For SVG elements, look for parent HTML element + const parentElement = node.closest('.kanban-plugin__item'); + if (parentElement) { + this.log('Found Kanban item parent of SVG element'); + this.processElement(parentElement); + } + else { + // Look for any kanban items in the document that might have changed + // This is for cases where the SVG update is related to a card movement + const items = this.activeKanbanBoard.querySelectorAll('.kanban-plugin__item'); + if (items.length > 0) { + // Process only the most recently modified item + const recentItems = Array.from(items).slice(-1); + for (const item of recentItems) { + this.log('Processing recent item after SVG change'); + this.processElement(item); + } + } + } + } + } + else if (node.nodeType === Node.TEXT_NODE) { + // For text nodes, check the parent element + const parentElement = node.parentElement; + if (parentElement && (parentElement.classList.contains('kanban-plugin__item-title') || + parentElement.closest('.kanban-plugin__item'))) { + this.log('Found text change in Kanban item'); + const itemElement = parentElement.closest('.kanban-plugin__item'); + if (itemElement) { + this.processElement(itemElement); + } + } + } + else { + this.log(`Skipping node type: ${node.nodeType}`); + } + } + catch (nodeError) { + this.log(`Error processing node: ${nodeError.message}`); + // Continue with next node even if this one fails + } + } + } + else { + this.log('Ignoring mutation type: ' + mutation.type); + } + } + } + catch (error) { + this.log(`Error in handleMutations: ${error.message}`); + } + } + onDragEnd(event) { + // Only process if we have an active Kanban board + if (!this.activeKanbanBoard || this.isProcessing) { + this.log('Drag end detected but no active Kanban board or already processing'); + this.log('activeKanbanBoard: ' + (this.activeKanbanBoard ? 'Yes' : 'No')); + this.log('isProcessing: ' + (this.isProcessing ? 'Yes' : 'No')); + return; + } + try { + this.log('Drag end detected'); + // Set processing flag to prevent multiple processing + this.isProcessing = true; + const target = event.target; + if (!target) + return; + this.processElement(target); + } + catch (error) { + this.log(`Error in onDragEnd: ${error.message}`); + } + finally { + // Reset processing flag after a delay to debounce + setTimeout(() => { + this.isProcessing = false; + }, 300); + } + } + processElement(element) { + try { + // Only process if inside our active Kanban board + if (!this.activeKanbanBoard || !element.closest('.kanban-plugin__board')) { + this.log('Element NOT in active Kanban board. Skipping.'); + return; + } + // Use different strategies to find the Kanban item + this.log("👀 Looking for Kanban item element"); + // Check if element is a Kanban item or contains one + const kanbanItem = element.classList.contains('kanban-plugin__item') + ? element + : element.querySelector('.kanban-plugin__item'); + if (kanbanItem) { + this.log(`✅ Found Kanban item: ${kanbanItem}`); + this.log('classList of kanbanItem: ' + kanbanItem.classList); + this.processKanbanItem(kanbanItem); + return; + } + this.log('Not a Kanban item, checking for parent'); + // If element is inside a Kanban item, find the parent + const parentItem = element.closest('.kanban-plugin__item'); + this.log(`Parent item: ${parentItem ? parentItem : 'Not found'}`); + if (parentItem) { + this.processKanbanItem(parentItem); + return; + } + } + catch (error) { + this.log(`Error in processElement: ${error.message}`); + } + } + processKanbanItem(itemElement) { + try { + // TODO: Select the title + const internalLink = itemElement.querySelector('.kanban-plugin__item-title .kanban-plugin__item-markdown a.internal-link'); + if (!internalLink) { + this.log('🚫 No internal link found in item'); + return; + } + this.log(`Found internal link: ${internalLink.textContent}`); + // Get the link path from data-href or href attribute + const linkPath = internalLink.getAttribute('data-href') || + internalLink.getAttribute('href'); + if (!linkPath) + return; + this.log(`🔗 Link path: ${linkPath}`); + // Find the lane (column) this item is in + const lane = itemElement.closest('.kanban-plugin__lane'); + if (!lane) { + this.log('🚫 No lane found for item'); + return; + } + // Get column name from the lane header + const laneHeader = lane.querySelector('.kanban-plugin__lane-header-wrapper .kanban-plugin__lane-title'); + if (!laneHeader) { + this.log('🚫 No laneHeader found for item'); + return; + } + const columnName = laneHeader.textContent.trim(); + this.log(`✅ Got lane name: ${columnName}`); + this.log(`Processing card with link to "${linkPath}" in column "${columnName}"`); + // Update the linked note's status + this.updateNoteStatus(linkPath, columnName); + } + catch (error) { + this.log(`Error in processKanbanItem: ${error.message}`); + } + } + updateNoteStatus(notePath, status) { + return __awaiter(this, void 0, void 0, function* () { + try { + // Find the linked file + const file = this.app.metadataCache.getFirstLinkpathDest(notePath, ''); + if (!file) { + if (this.settings.showNotifications) { + new obsidian.Notice(`⚠️ Note "${notePath}" not found`, 3000); + } + return; + } + // Get current status if it exists + const metadata = this.app.metadataCache.getFileCache(file); + let oldStatus = null; + if ((metadata === null || metadata === void 0 ? void 0 : metadata.frontmatter) && metadata.frontmatter[this.settings.statusPropertyName]) { + oldStatus = metadata.frontmatter[this.settings.statusPropertyName]; + } + // Only update if status has changed + if (oldStatus !== status) { + // Use the processFrontMatter API to update the frontmatter + yield this.app.fileManager.processFrontMatter(file, (frontmatter) => { + // Set the status property + frontmatter[this.settings.statusPropertyName] = status; + }); + // Show notification if enabled + if (this.settings.showNotifications) { + if (oldStatus) { + new obsidian.Notice(`Updated ${this.settings.statusPropertyName}: "${oldStatus}" → "${status}" for ${file.basename}`, 3000); + } + else { + new obsidian.Notice(`Set ${this.settings.statusPropertyName}: "${status}" for ${file.basename}`, 3000); + } + } + this.log(`Updated status for ${file.basename} to "${status}"`); + } + else { + this.log(`Status already set to "${status}" for ${file.basename}, skipping update`); + } + } + catch (error) { + this.log(`Error updating note status: ${error.message}`); + if (this.settings.showNotifications) { + new obsidian.Notice(`⚠️ Error updating status: ${error.message}`, 3000); + } + } + }); + } + // Method for the test button to use + runTest() { + this.log('Running test...'); + // Make sure we're using the current active board + this.checkForActiveKanbanBoard(); + if (!this.activeKanbanBoard) { + new obsidian.Notice('⚠️ No active Kanban board found - open a Kanban board first', 5000); + return; + } + // Find items in the active board + const items = this.activeKanbanBoard.querySelectorAll('.kanban-plugin__item'); + const count = items.length; + new obsidian.Notice(`Found ${count} cards in active Kanban board`, 3000); + if (count > 0) { + // Process the first item with a link + for (let i = 0; i < count; i++) { + const item = items[i]; + if (item.querySelector('a.internal-link')) { + new obsidian.Notice(`Testing with card: "${item.textContent.substring(0, 20)}..."`, 3000); + this.processKanbanItem(item); + break; + } + } + } + } +} +class KanbanStatusUpdaterSettingTab extends obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + new obsidian.Setting(containerEl) + .setName('Status property name') + .setDesc('The name of the property to update when a card is moved') + .addText(text => text + .setPlaceholder('status') + .setValue(this.plugin.settings.statusPropertyName) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.statusPropertyName = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Show notifications') + .setDesc('Show a notification when a status is updated') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.showNotifications) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.showNotifications = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Debug mode') + .setDesc('Enable detailed logging (reduces performance)') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.debugMode) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.debugMode = value; + yield this.plugin.saveSettings(); + if (value) { + new obsidian.Notice('Debug mode enabled - check console for logs', 3000); + } + else { + new obsidian.Notice('Debug mode disabled', 3000); + } + }))); + // Add a test button + new obsidian.Setting(containerEl) + .setName('Test plugin') + .setDesc('Test with current Kanban board') + .addButton(button => button + .setButtonText('Run Test') + .onClick(() => { + this.plugin.runTest(); + })); + } +} + +module.exports = KanbanStatusUpdaterPlugin; + + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/kanban-status-updater/manifest.json b/.obsidian/plugins/kanban-status-updater/manifest.json new file mode 100644 index 0000000..669275a --- /dev/null +++ b/.obsidian/plugins/kanban-status-updater/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "kanban-status-updater", + "name": "Kanban Status Updater", + "version": "1.0.0", + "minAppVersion": "1.1.0", + "description": "Automatically updates a 'status' property in a note when its card is moved on a Kanban board", + "author": "Ankit Kapur", + "authorUrl": "https://github.com/ankit-kapur", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/kanban-status-updater/styles.css b/.obsidian/plugins/kanban-status-updater/styles.css new file mode 100644 index 0000000..4a9bd2a --- /dev/null +++ b/.obsidian/plugins/kanban-status-updater/styles.css @@ -0,0 +1,13 @@ +/* styles.css for Kanban Status Updater */ + +/* Status bar styling - minimal to ensure good performance */ +.kanban-status-updater-statusbar { + color: var(--text-accent); + font-size: 0.8em; + padding: 0 8px; + opacity: 0.8; +} + +.kanban-status-updater-statusbar:hover { + opacity: 1; +} \ No newline at end of file diff --git a/.obsidian/plugins/metaedit/data.json b/.obsidian/plugins/metaedit/data.json new file mode 100644 index 0000000..be9b75d --- /dev/null +++ b/.obsidian/plugins/metaedit/data.json @@ -0,0 +1,25 @@ +{ + "ProgressProperties": { + "enabled": true, + "properties": [] + }, + "IgnoredProperties": { + "enabled": false, + "properties": [] + }, + "AutoProperties": { + "enabled": true, + "properties": [] + }, + "EditMode": { + "mode": "All Single", + "properties": [] + }, + "KanbanHelper": { + "enabled": true, + "boards": [] + }, + "UIElements": { + "enabled": true + } +} \ No newline at end of file diff --git a/.obsidian/plugins/metaedit/main.js b/.obsidian/plugins/metaedit/main.js new file mode 100644 index 0000000..3e4308c --- /dev/null +++ b/.obsidian/plugins/metaedit/main.js @@ -0,0 +1,5540 @@ +'use strict'; + +var obsidian = require('obsidian'); +var fs_1 = require('fs'); +var path_1 = require('path'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var fs_1__default = /*#__PURE__*/_interopDefaultLegacy(fs_1); +var path_1__default = /*#__PURE__*/_interopDefaultLegacy(path_1); + +var EditMode; +(function (EditMode) { + EditMode["AllSingle"] = "All Single"; + EditMode["AllMulti"] = "All Multi"; + EditMode["SomeMulti"] = "Some Multi"; +})(EditMode || (EditMode = {})); + +function noop() { } +function run(fn) { + return fn(); +} +function blank_object() { + return Object.create(null); +} +function run_all(fns) { + fns.forEach(run); +} +function is_function(thing) { + return typeof thing === 'function'; +} +function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); +} +function is_empty(obj) { + return Object.keys(obj).length === 0; +} +function append(target, node) { + target.appendChild(node); +} +function append_styles(target, style_sheet_id, styles) { + const append_styles_to = get_root_for_style(target); + if (!append_styles_to.getElementById(style_sheet_id)) { + const style = element('style'); + style.id = style_sheet_id; + style.textContent = styles; + append_stylesheet(append_styles_to, style); + } +} +function get_root_for_style(node) { + if (!node) + return document; + const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; + if (root && root.host) { + return root; + } + return node.ownerDocument; +} +function append_stylesheet(node, style) { + append(node.head || node, style); + return style.sheet; +} +function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); +} +function detach(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } +} +function destroy_each(iterations, detaching) { + for (let i = 0; i < iterations.length; i += 1) { + if (iterations[i]) + iterations[i].d(detaching); + } +} +function element(name) { + return document.createElement(name); +} +function text(data) { + return document.createTextNode(data); +} +function space() { + return text(' '); +} +function listen(node, event, handler, options) { + node.addEventListener(event, handler, options); + return () => node.removeEventListener(event, handler, options); +} +function attr(node, attribute, value) { + if (value == null) + node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) + node.setAttribute(attribute, value); +} +function children(element) { + return Array.from(element.childNodes); +} +function set_data(text, data) { + data = '' + data; + if (text.wholeText !== data) + text.data = data; +} +function set_input_value(input, value) { + input.value = value == null ? '' : value; +} +function set_style(node, key, value, important) { + if (value === null) { + node.style.removeProperty(key); + } + else { + node.style.setProperty(key, value, important ? 'important' : ''); + } +} +function select_option(select, value) { + for (let i = 0; i < select.options.length; i += 1) { + const option = select.options[i]; + if (option.__value === value) { + option.selected = true; + return; + } + } + select.selectedIndex = -1; // no option should be selected +} +function select_value(select) { + const selected_option = select.querySelector(':checked') || select.options[0]; + return selected_option && selected_option.__value; +} + +let current_component; +function set_current_component(component) { + current_component = component; +} +function get_current_component() { + if (!current_component) + throw new Error('Function called outside component initialization'); + return current_component; +} +/** + * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM. + * It must be called during the component's initialisation (but doesn't need to live *inside* the component; + * it can be called from an external module). + * + * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api). + * + * https://svelte.dev/docs#run-time-svelte-onmount + */ +function onMount(fn) { + get_current_component().$$.on_mount.push(fn); +} + +const dirty_components = []; +const binding_callbacks = []; +const render_callbacks = []; +const flush_callbacks = []; +const resolved_promise = Promise.resolve(); +let update_scheduled = false; +function schedule_update() { + if (!update_scheduled) { + update_scheduled = true; + resolved_promise.then(flush); + } +} +function add_render_callback(fn) { + render_callbacks.push(fn); +} +// flush() calls callbacks in this order: +// 1. All beforeUpdate callbacks, in order: parents before children +// 2. All bind:this callbacks, in reverse order: children before parents. +// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT +// for afterUpdates called during the initial onMount, which are called in +// reverse order: children before parents. +// Since callbacks might update component values, which could trigger another +// call to flush(), the following steps guard against this: +// 1. During beforeUpdate, any updated components will be added to the +// dirty_components array and will cause a reentrant call to flush(). Because +// the flush index is kept outside the function, the reentrant call will pick +// up where the earlier call left off and go through all dirty components. The +// current_component value is saved and restored so that the reentrant call will +// not interfere with the "parent" flush() call. +// 2. bind:this callbacks cannot trigger new flush() calls. +// 3. During afterUpdate, any updated components will NOT have their afterUpdate +// callback called a second time; the seen_callbacks set, outside the flush() +// function, guarantees this behavior. +const seen_callbacks = new Set(); +let flushidx = 0; // Do *not* move this inside the flush() function +function flush() { + // Do not reenter flush while dirty components are updated, as this can + // result in an infinite loop. Instead, let the inner flush handle it. + // Reentrancy is ok afterwards for bindings etc. + if (flushidx !== 0) { + return; + } + const saved_component = current_component; + do { + // first, call beforeUpdate functions + // and update components + try { + while (flushidx < dirty_components.length) { + const component = dirty_components[flushidx]; + flushidx++; + set_current_component(component); + update(component.$$); + } + } + catch (e) { + // reset dirty state to not end up in a deadlocked state and then rethrow + dirty_components.length = 0; + flushidx = 0; + throw e; + } + set_current_component(null); + dirty_components.length = 0; + flushidx = 0; + while (binding_callbacks.length) + binding_callbacks.pop()(); + // then, once components are updated, call + // afterUpdate functions. This may cause + // subsequent updates... + for (let i = 0; i < render_callbacks.length; i += 1) { + const callback = render_callbacks[i]; + if (!seen_callbacks.has(callback)) { + // ...so guard against infinite loops + seen_callbacks.add(callback); + callback(); + } + } + render_callbacks.length = 0; + } while (dirty_components.length); + while (flush_callbacks.length) { + flush_callbacks.pop()(); + } + update_scheduled = false; + seen_callbacks.clear(); + set_current_component(saved_component); +} +function update($$) { + if ($$.fragment !== null) { + $$.update(); + run_all($$.before_update); + const dirty = $$.dirty; + $$.dirty = [-1]; + $$.fragment && $$.fragment.p($$.ctx, dirty); + $$.after_update.forEach(add_render_callback); + } +} +const outroing = new Set(); +function transition_in(block, local) { + if (block && block.i) { + outroing.delete(block); + block.i(local); + } +} +function mount_component(component, target, anchor, customElement) { + const { fragment, after_update } = component.$$; + fragment && fragment.m(target, anchor); + if (!customElement) { + // onMount happens before the initial afterUpdate + add_render_callback(() => { + const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); + // if the component was destroyed immediately + // it will update the `$$.on_destroy` reference to `null`. + // the destructured on_destroy may still reference to the old array + if (component.$$.on_destroy) { + component.$$.on_destroy.push(...new_on_destroy); + } + else { + // Edge case - component was destroyed immediately, + // most likely as a result of a binding initialising + run_all(new_on_destroy); + } + component.$$.on_mount = []; + }); + } + after_update.forEach(add_render_callback); +} +function destroy_component(component, detaching) { + const $$ = component.$$; + if ($$.fragment !== null) { + run_all($$.on_destroy); + $$.fragment && $$.fragment.d(detaching); + // TODO null out other refs, including component.$$ (but need to + // preserve final state?) + $$.on_destroy = $$.fragment = null; + $$.ctx = []; + } +} +function make_dirty(component, i) { + if (component.$$.dirty[0] === -1) { + dirty_components.push(component); + schedule_update(); + component.$$.dirty.fill(0); + } + component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); +} +function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) { + const parent_component = current_component; + set_current_component(component); + const $$ = component.$$ = { + fragment: null, + ctx: [], + // state + props, + update: noop, + not_equal, + bound: blank_object(), + // lifecycle + on_mount: [], + on_destroy: [], + on_disconnect: [], + before_update: [], + after_update: [], + context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), + // everything else + callbacks: blank_object(), + dirty, + skip_bound: false, + root: options.target || parent_component.$$.root + }; + append_styles && append_styles($$.root); + let ready = false; + $$.ctx = instance + ? instance(component, options.props || {}, (i, ret, ...rest) => { + const value = rest.length ? rest[0] : ret; + if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { + if (!$$.skip_bound && $$.bound[i]) + $$.bound[i](value); + if (ready) + make_dirty(component, i); + } + return ret; + }) + : []; + $$.update(); + ready = true; + run_all($$.before_update); + // `false` as a special case of no DOM component + $$.fragment = create_fragment ? create_fragment($$.ctx) : false; + if (options.target) { + if (options.hydrate) { + const nodes = children(options.target); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.l(nodes); + nodes.forEach(detach); + } + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.c(); + } + if (options.intro) + transition_in(component.$$.fragment); + mount_component(component, options.target, options.anchor, options.customElement); + flush(); + } + set_current_component(parent_component); +} +/** + * Base class for Svelte components. Used when dev=false. + */ +class SvelteComponent { + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + $on(type, callback) { + if (!is_function(callback)) { + return noop; + } + const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); + callbacks.push(callback); + return () => { + const index = callbacks.indexOf(callback); + if (index !== -1) + callbacks.splice(index, 1); + }; + } + $set($$props) { + if (this.$$set && !is_empty($$props)) { + this.$$.skip_bound = true; + this.$$set($$props); + this.$$.skip_bound = false; + } + } +} + +var ProgressPropertyOptions; +(function (ProgressPropertyOptions) { + ProgressPropertyOptions["TaskTotal"] = "Total Tasks"; + ProgressPropertyOptions["TaskComplete"] = "Completed Tasks"; + ProgressPropertyOptions["TaskIncomplete"] = "Incomplete Tasks"; +})(ProgressPropertyOptions || (ProgressPropertyOptions = {})); + +/* src/Modals/ProgressPropertiesSettingModal/ProgressPropertiesModalContent.svelte generated by Svelte v3.55.1 */ + +function add_css$3(target) { + append_styles(target, "svelte-kqcr7b", ".buttonContainer.svelte-kqcr7b{display:flex;justify-content:center;margin-top:1rem}select.svelte-kqcr7b{border-radius:4px;width:100%;height:30px;border:1px solid #dbdbdc;color:#383a42;background-color:#fff;padding:3px}button.svelte-kqcr7b{margin-left:5px;margin-right:5px;font-size:15px}"); +} + +function get_each_context$3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[10] = list[i]; + child_ctx[11] = list; + child_ctx[12] = i; + return child_ctx; +} + +function get_each_context_1$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[13] = list[i]; + return child_ctx; +} + +// (32:24) {#each options as text} +function create_each_block_1$1(ctx) { + let option; + + return { + c() { + option = element("option"); + option.__value = /*text*/ ctx[13]; + option.value = option.__value; + attr(option, "label", /*text*/ ctx[13]); + }, + m(target, anchor) { + insert(target, option, anchor); + }, + p: noop, + d(detaching) { + if (detaching) detach(option); + } + }; +} + +// (25:8) {#each properties as property} +function create_each_block$3(ctx) { + let tr; + let td0; + let input0; + let t0; + let td1; + let select; + let t1; + let td2; + let input1; + let t2; + let mounted; + let dispose; + + function input0_input_handler() { + /*input0_input_handler*/ ctx[5].call(input0, /*each_value*/ ctx[11], /*property_index*/ ctx[12]); + } + + let each_value_1 = /*options*/ ctx[2]; + let each_blocks = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); + } + + function select_change_handler() { + /*select_change_handler*/ ctx[7].call(select, /*each_value*/ ctx[11], /*property_index*/ ctx[12]); + } + + function click_handler() { + return /*click_handler*/ ctx[9](/*property*/ ctx[10]); + } + + return { + c() { + tr = element("tr"); + td0 = element("td"); + input0 = element("input"); + t0 = space(); + td1 = element("td"); + select = element("select"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t1 = space(); + td2 = element("td"); + input1 = element("input"); + t2 = space(); + attr(input0, "type", "text"); + attr(input0, "placeholder", "Property name"); + attr(select, "class", "svelte-kqcr7b"); + if (/*property*/ ctx[10].type === void 0) add_render_callback(select_change_handler); + attr(input1, "type", "button"); + attr(input1, "class", "not-a-button"); + input1.value = "❌"; + }, + m(target, anchor) { + insert(target, tr, anchor); + append(tr, td0); + append(td0, input0); + set_input_value(input0, /*property*/ ctx[10].name); + append(tr, t0); + append(tr, td1); + append(td1, select); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(select, null); + } + + select_option(select, /*property*/ ctx[10].type); + append(tr, t1); + append(tr, td2); + append(td2, input1); + append(tr, t2); + + if (!mounted) { + dispose = [ + listen(input0, "input", input0_input_handler), + listen(input0, "change", /*change_handler*/ ctx[6]), + listen(select, "change", select_change_handler), + listen(select, "change", /*change_handler_1*/ ctx[8]), + listen(input1, "click", click_handler) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + + if (dirty & /*properties, options*/ 5 && input0.value !== /*property*/ ctx[10].name) { + set_input_value(input0, /*property*/ ctx[10].name); + } + + if (dirty & /*options*/ 4) { + each_value_1 = /*options*/ ctx[2]; + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1$1(ctx, each_value_1, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block_1$1(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(select, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value_1.length; + } + + if (dirty & /*properties, options*/ 5) { + select_option(select, /*property*/ ctx[10].type); + } + }, + d(detaching) { + if (detaching) detach(tr); + destroy_each(each_blocks, detaching); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$4(ctx) { + let div1; + let table; + let thead; + let t3; + let t4; + let div0; + let button; + let mounted; + let dispose; + let each_value = /*properties*/ ctx[0]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); + } + + return { + c() { + div1 = element("div"); + table = element("table"); + thead = element("thead"); + + thead.innerHTML = `Name + Type`; + + t3 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t4 = space(); + div0 = element("div"); + button = element("button"); + button.textContent = "Add"; + set_style(table, "width", "100%"); + attr(button, "class", "mod-cta svelte-kqcr7b"); + attr(div0, "class", "buttonContainer svelte-kqcr7b"); + attr(div1, "class", "centerSettingContent"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, table); + append(table, thead); + append(table, t3); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(table, null); + } + + append(div1, t4); + append(div1, div0); + append(div0, button); + + if (!mounted) { + dispose = listen(button, "click", /*addNewProperty*/ ctx[3]); + mounted = true; + } + }, + p(ctx, [dirty]) { + if (dirty & /*removeProperty, properties, save, options*/ 23) { + each_value = /*properties*/ ctx[0]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$3(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$3(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(table, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; +} + +function instance$4($$self, $$props, $$invalidate) { + const options = Object.keys(ProgressPropertyOptions).map(k => ProgressPropertyOptions[k]); + let { save } = $$props; + let { properties } = $$props; + + function addNewProperty() { + let newProp = { + name: "", + type: ProgressPropertyOptions.TaskTotal + }; + + $$invalidate(0, properties = [...properties, newProp]); + save(properties); + } + + function removeProperty(property) { + $$invalidate(0, properties = properties.filter(prop => prop !== property)); + save(properties); + } + + function input0_input_handler(each_value, property_index) { + each_value[property_index].name = this.value; + $$invalidate(0, properties); + $$invalidate(2, options); + } + + const change_handler = () => save(properties); + + function select_change_handler(each_value, property_index) { + each_value[property_index].type = select_value(this); + $$invalidate(0, properties); + $$invalidate(2, options); + } + + const change_handler_1 = () => save(properties); + const click_handler = property => removeProperty(property); + + $$self.$$set = $$props => { + if ('save' in $$props) $$invalidate(1, save = $$props.save); + if ('properties' in $$props) $$invalidate(0, properties = $$props.properties); + }; + + return [ + properties, + save, + options, + addNewProperty, + removeProperty, + input0_input_handler, + change_handler, + select_change_handler, + change_handler_1, + click_handler + ]; +} + +class ProgressPropertiesModalContent extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$4, create_fragment$4, safe_not_equal, { save: 1, properties: 0 }, add_css$3); + } +} + +/* src/Modals/AutoPropertiesSettingModal/AutoPropertiesModalContent.svelte generated by Svelte v3.55.1 */ + +function add_css$2(target) { + append_styles(target, "svelte-kqcr7b", ".buttonContainer.svelte-kqcr7b{display:flex;justify-content:center;margin-top:1rem}button.svelte-kqcr7b{margin-left:5px;margin-right:5px;font-size:15px}"); +} + +function get_each_context$2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[13] = list[i]; + child_ctx[14] = list; + child_ctx[15] = i; + return child_ctx; +} + +function get_each_context_1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[16] = list[i]; + child_ctx[17] = list; + child_ctx[18] = i; + return child_ctx; +} + +// (49:20) {#each property.choices as choice, i} +function create_each_block_1(ctx) { + let div; + let input0; + let t0; + let input1; + let t1; + let mounted; + let dispose; + + function input0_input_handler() { + /*input0_input_handler*/ ctx[10].call(input0, /*each_value_1*/ ctx[17], /*i*/ ctx[18]); + } + + function click_handler_1() { + return /*click_handler_1*/ ctx[11](/*property*/ ctx[13], /*i*/ ctx[18]); + } + + return { + c() { + div = element("div"); + input0 = element("input"); + t0 = space(); + input1 = element("input"); + t1 = space(); + attr(input0, "type", "text"); + attr(input1, "class", "not-a-button"); + attr(input1, "type", "button"); + input1.value = "❌"; + set_style(div, "display", "block"); + }, + m(target, anchor) { + insert(target, div, anchor); + append(div, input0); + set_input_value(input0, /*choice*/ ctx[16]); + append(div, t0); + append(div, input1); + append(div, t1); + + if (!mounted) { + dispose = [ + listen(input0, "change", /*change_handler_1*/ ctx[9]), + listen(input0, "input", input0_input_handler), + listen(input1, "click", click_handler_1) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + + if (dirty & /*autoProperties*/ 1 && input0.value !== /*choice*/ ctx[16]) { + set_input_value(input0, /*choice*/ ctx[16]); + } + }, + d(detaching) { + if (detaching) detach(div); + mounted = false; + run_all(dispose); + } + }; +} + +// (40:8) {#each autoProperties as property} +function create_each_block$2(ctx) { + let tr; + let td0; + let input0; + let t0; + let td1; + let input1; + let t1; + let td2; + let t2; + let td3; + let div; + let input2; + let t3; + let br; + let mounted; + let dispose; + + function click_handler() { + return /*click_handler*/ ctx[6](/*property*/ ctx[13]); + } + + function input1_input_handler() { + /*input1_input_handler*/ ctx[8].call(input1, /*each_value*/ ctx[14], /*property_index*/ ctx[15]); + } + + let each_value_1 = /*property*/ ctx[13].choices; + let each_blocks = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + } + + function click_handler_2() { + return /*click_handler_2*/ ctx[12](/*property*/ ctx[13]); + } + + return { + c() { + tr = element("tr"); + td0 = element("td"); + input0 = element("input"); + t0 = space(); + td1 = element("td"); + input1 = element("input"); + t1 = space(); + td2 = element("td"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t2 = space(); + td3 = element("td"); + div = element("div"); + input2 = element("input"); + t3 = space(); + br = element("br"); + attr(input0, "type", "button"); + input0.value = "❌"; + attr(input0, "class", "not-a-button"); + attr(input1, "type", "text"); + attr(input1, "placeholder", "Property name"); + attr(input2, "class", "not-a-button"); + attr(input2, "type", "button"); + input2.value = "➕"; + set_style(div, "width", "50%"); + set_style(div, "text-align", "center"); + set_style(div, "margin", "5px auto auto"); + }, + m(target, anchor) { + insert(target, tr, anchor); + append(tr, td0); + append(td0, input0); + append(tr, t0); + append(tr, td1); + append(td1, input1); + set_input_value(input1, /*property*/ ctx[13].name); + append(tr, t1); + append(tr, td2); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(td2, null); + } + + append(tr, t2); + append(tr, td3); + append(td3, div); + append(div, input2); + insert(target, t3, anchor); + insert(target, br, anchor); + + if (!mounted) { + dispose = [ + listen(input0, "click", click_handler), + listen(input1, "change", /*change_handler*/ ctx[7]), + listen(input1, "input", input1_input_handler), + listen(input2, "click", click_handler_2) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + + if (dirty & /*autoProperties*/ 1 && input1.value !== /*property*/ ctx[13].name) { + set_input_value(input1, /*property*/ ctx[13].name); + } + + if (dirty & /*removeChoice, autoProperties, save*/ 19) { + each_value_1 = /*property*/ ctx[13].choices; + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1(ctx, each_value_1, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(td2, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value_1.length; + } + }, + d(detaching) { + if (detaching) detach(tr); + destroy_each(each_blocks, detaching); + if (detaching) detach(t3); + if (detaching) detach(br); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$3(ctx) { + let div1; + let table; + let thead; + let t4; + let t5; + let div0; + let button; + let mounted; + let dispose; + let each_value = /*autoProperties*/ ctx[0]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); + } + + return { + c() { + div1 = element("div"); + table = element("table"); + thead = element("thead"); + + thead.innerHTML = ` + Name + Values`; + + t4 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t5 = space(); + div0 = element("div"); + button = element("button"); + button.textContent = "Add"; + attr(button, "class", "mod-cta svelte-kqcr7b"); + attr(div0, "class", "buttonContainer svelte-kqcr7b"); + attr(div1, "class", "centerSettingContent"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, table); + append(table, thead); + append(table, t4); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(table, null); + } + + append(div1, t5); + append(div1, div0); + append(div0, button); + + if (!mounted) { + dispose = listen(button, "click", /*addNewProperty*/ ctx[2]); + mounted = true; + } + }, + p(ctx, [dirty]) { + if (dirty & /*addChoice, autoProperties, removeChoice, save, removeProperty*/ 59) { + each_value = /*autoProperties*/ ctx[0]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$2(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$2(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(table, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; +} + +function instance$3($$self, $$props, $$invalidate) { + let { save } = $$props; + let { autoProperties = [] } = $$props; + + function addNewProperty() { + let newProp = { name: "", choices: [""] }; + if (typeof autoProperties[Symbol.iterator] !== 'function') $$invalidate(0, autoProperties = [newProp]); else $$invalidate(0, autoProperties = [...autoProperties, newProp]); + save(autoProperties); + } + + function removeProperty(property) { + $$invalidate(0, autoProperties = autoProperties.filter(ac => ac !== property)); + save(autoProperties); + } + + function removeChoice(property, i) { + property.choices.splice(i, 1); + $$invalidate(0, autoProperties); // Svelte + save(autoProperties); + } + + function addChoice(property) { + $$invalidate(0, autoProperties = autoProperties.map(prop => { + if (prop === property) { + prop.choices.push(""); + } + + return prop; + })); + + save(autoProperties); + } + + const click_handler = property => removeProperty(property); + const change_handler = () => save(autoProperties); + + function input1_input_handler(each_value, property_index) { + each_value[property_index].name = this.value; + $$invalidate(0, autoProperties); + } + + const change_handler_1 = () => save(autoProperties); + + function input0_input_handler(each_value_1, i) { + each_value_1[i] = this.value; + $$invalidate(0, autoProperties); + } + + const click_handler_1 = (property, i) => removeChoice(property, i); + const click_handler_2 = property => addChoice(property); + + $$self.$$set = $$props => { + if ('save' in $$props) $$invalidate(1, save = $$props.save); + if ('autoProperties' in $$props) $$invalidate(0, autoProperties = $$props.autoProperties); + }; + + return [ + autoProperties, + save, + addNewProperty, + removeProperty, + removeChoice, + addChoice, + click_handler, + change_handler, + input1_input_handler, + change_handler_1, + input0_input_handler, + click_handler_1, + click_handler_2 + ]; +} + +class AutoPropertiesModalContent extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$3, create_fragment$3, safe_not_equal, { save: 1, autoProperties: 0 }, add_css$2); + } +} + +var top = 'top'; +var bottom = 'bottom'; +var right = 'right'; +var left = 'left'; +var auto = 'auto'; +var basePlacements = [top, bottom, right, left]; +var start = 'start'; +var end = 'end'; +var clippingParents = 'clippingParents'; +var viewport = 'viewport'; +var popper = 'popper'; +var reference = 'reference'; +var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); // modifiers that need to read the DOM + +var beforeRead = 'beforeRead'; +var read = 'read'; +var afterRead = 'afterRead'; // pure-logic modifiers + +var beforeMain = 'beforeMain'; +var main = 'main'; +var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) + +var beforeWrite = 'beforeWrite'; +var write = 'write'; +var afterWrite = 'afterWrite'; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + +function getNodeName(element) { + return element ? (element.nodeName || '').toLowerCase() : null; +} + +function getWindow(node) { + if (node == null) { + return window; + } + + if (node.toString() !== '[object Window]') { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + + return node; +} + +function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; +} + +function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} + +function isShadowRoot(node) { + // IE 11 has no ShadowRoot + if (typeof ShadowRoot === 'undefined') { + return false; + } + + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + +// and applies them to the HTMLElements such as popper and arrow + +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function (name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } // Flow doesn't support to extend this property, but it's the most + // effective way to apply styles to an HTMLElement + // $FlowFixMe[cannot-write] + + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (name) { + var value = attributes[name]; + + if (value === false) { + element.removeAttribute(name); + } else { + element.setAttribute(name, value === true ? '' : value); + } + }); + }); +} + +function effect$2(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: '0', + top: '0', + margin: '0' + }, + arrow: { + position: 'absolute' + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + + return function () { + Object.keys(state.elements).forEach(function (name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + + var style = styleProperties.reduce(function (style, property) { + style[property] = ''; + return style; + }, {}); // arrow is optional + virtual elements + + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + + Object.assign(element.style, style); + Object.keys(attributes).forEach(function (attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} // eslint-disable-next-line import/no-unused-modules + + +var applyStyles$1 = { + name: 'applyStyles', + enabled: true, + phase: 'write', + fn: applyStyles, + effect: effect$2, + requires: ['computeStyles'] +}; + +function getBasePlacement(placement) { + return placement.split('-')[0]; +} + +var max = Math.max; +var min = Math.min; +var round = Math.round; + +function getUAString() { + var uaData = navigator.userAgentData; + + if (uaData != null && uaData.brands) { + return uaData.brands.map(function (item) { + return item.brand + "/" + item.version; + }).join(' '); + } + + return navigator.userAgent; +} + +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); +} + +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + + var _ref = isElement(element) ? getWindow(element) : window, + visualViewport = _ref.visualViewport; + + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width: width, + height: height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x: x, + y: y + }; +} + +// means it doesn't take into account transforms. + +function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. + // Fixes https://github.com/popperjs/popper-core/issues/1223 + + var width = element.offsetWidth; + var height = element.offsetHeight; + + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + + return { + x: element.offsetLeft, + y: element.offsetTop, + width: width, + height: height + }; +} + +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method + + if (parent.contains(child)) { + return true; + } // then fallback to custom implementation with Shadow DOM support + else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + + + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false + + + return false; +} + +function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); +} + +function isTableElement(element) { + return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; +} + +function getDocumentElement(element) { + // $FlowFixMe[incompatible-return]: assume body is always available + return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + element.document) || window.document).documentElement; +} + +function getParentNode(element) { + if (getNodeName(element) === 'html') { + return element; + } + + return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( // DOM Element detected + isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) // fallback + + ); +} + +function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle(element).position === 'fixed') { + return null; + } + + return element.offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + + if (isIE && isHTMLElement(element)) { + // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport + var elementCss = getComputedStyle(element); + + if (elementCss.position === 'fixed') { + return null; + } + } + + var currentNode = getParentNode(element); + + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + + while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that + // create a containing block. + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + + if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + + return null; +} // Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. + + +function getOffsetParent(element) { + var window = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent); + } + + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { + return window; + } + + return offsetParent || getContainingBlock(element) || window; +} + +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; +} + +function within(min$1, value, max$1) { + return max(min$1, min(value, max$1)); +} +function withinMaxClamp(min, value, max) { + var v = within(min, value, max); + return v > max ? max : v; +} + +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} + +function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); +} + +function expandToHashMap(value, keys) { + return keys.reduce(function (hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} + +var toPaddingObject = function toPaddingObject(padding, state) { + padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); +}; + +function arrow(_ref) { + var _state$modifiersData$; + + var state = _ref.state, + name = _ref.name, + options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? 'height' : 'width'; + + if (!arrowElement || !popperOffsets) { + return; + } + + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === 'y' ? top : left; + var maxProp = axis === 'y' ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var startDiff = popperOffsets[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is + // outside of the popper bounds + + var min = paddingObject[minProp]; + var max = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset = within(min, center, max); // Prevents breaking syntax highlighting... + + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); +} + +function effect$1(_ref2) { + var state = _ref2.state, + options = _ref2.options; + var _options$element = options.element, + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + + if (arrowElement == null) { + return; + } // CSS selector + + + if (typeof arrowElement === 'string') { + arrowElement = state.elements.popper.querySelector(arrowElement); + + if (!arrowElement) { + return; + } + } + + if (process.env.NODE_ENV !== "production") { + if (!isHTMLElement(arrowElement)) { + console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' ')); + } + } + + if (!contains(state.elements.popper, arrowElement)) { + if (process.env.NODE_ENV !== "production") { + console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' ')); + } + + return; + } + + state.elements.arrow = arrowElement; +} // eslint-disable-next-line import/no-unused-modules + + +var arrow$1 = { + name: 'arrow', + enabled: true, + phase: 'main', + fn: arrow, + effect: effect$1, + requires: ['popperOffsets'], + requiresIfExists: ['preventOverflow'] +}; + +function getVariation(placement) { + return placement.split('-')[1]; +} + +var unsetSides = { + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto' +}; // Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. + +function roundOffsetsByDPR(_ref) { + var x = _ref.x, + y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; +} + +function mapToStyles(_ref2) { + var _Object$assign2; + + var popper = _ref2.popper, + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; + + var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty('x'); + var hasY = offsets.hasOwnProperty('y'); + var sideX = left; + var sideY = top; + var win = window; + + if (adaptive) { + var offsetParent = getOffsetParent(popper); + var heightProp = 'clientHeight'; + var widthProp = 'clientWidth'; + + if (offsetParent === getWindow(popper)) { + offsetParent = getDocumentElement(popper); + + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { + heightProp = 'scrollHeight'; + widthProp = 'scrollWidth'; + } + } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + + + offsetParent = offsetParent; + + if (placement === top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + offsetParent[heightProp]; + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + + if (placement === left || (placement === top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + offsetParent[widthProp]; + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + + var commonStyles = Object.assign({ + position: position + }, adaptive && unsetSides); + + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x, + y: y + }) : { + x: x, + y: y + }; + + x = _ref4.x; + y = _ref4.y; + + if (gpuAcceleration) { + var _Object$assign; + + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); +} + +function computeStyles(_ref5) { + var state = _ref5.state, + options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + + if (process.env.NODE_ENV !== "production") { + var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ''; + + if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) { + return transitionProperty.indexOf(property) >= 0; + })) { + console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' ')); + } + } + + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration: gpuAcceleration, + isFixed: state.options.strategy === 'fixed' + }; + + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets + }))); + } + + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: 'absolute', + adaptive: false, + roundOffsets: roundOffsets + }))); + } + + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-placement': state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +var computeStyles$1 = { + name: 'computeStyles', + enabled: true, + phase: 'beforeWrite', + fn: computeStyles, + data: {} +}; + +var passive = { + passive: true +}; + +function effect(_ref) { + var state = _ref.state, + instance = _ref.instance, + options = _ref.options; + var _options$scroll = options.scroll, + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; + var window = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.addEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.addEventListener('resize', instance.update, passive); + } + + return function () { + if (scroll) { + scrollParents.forEach(function (scrollParent) { + scrollParent.removeEventListener('scroll', instance.update, passive); + }); + } + + if (resize) { + window.removeEventListener('resize', instance.update, passive); + } + }; +} // eslint-disable-next-line import/no-unused-modules + + +var eventListeners = { + name: 'eventListeners', + enabled: true, + phase: 'write', + fn: function fn() {}, + effect: effect, + data: {} +}; + +var hash$1 = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash$1[matched]; + }); +} + +var hash = { + start: 'end', + end: 'start' +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function (matched) { + return hash[matched]; + }); +} + +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} + +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + // Popper 1 is broken in this case and never had a bug report so let's assume + // it's not an issue. I don't think anyone ever specifies width on + // anyway. + // Browsers where the left scrollbar doesn't cause an issue report `0` for + // this (e.g. Edge 2019, IE11, Safari) + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +} + +function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + + if (layoutViewport || !layoutViewport && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + + return { + width: width, + height: height, + x: x + getWindowScrollBarX(element), + y: y + }; +} + +// of the `` and `` rect bounds if horizontally scrollable + +function getDocumentRect(element) { + var _element$ownerDocumen; + + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + + if (getComputedStyle(body || html).direction === 'rtl') { + x += max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + + return { + width: width, + height: height, + x: x, + y: y + }; +} + +function isScrollParent(element) { + // Firefox wants us to check `-x` and `-y` variations as well + var _getComputedStyle = getComputedStyle(element), + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; + + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} + +function getScrollParent(node) { + if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { + // $FlowFixMe[incompatible-return]: assume body is always available + return node.ownerDocument.body; + } + + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + + return getScrollParent(getParentNode(node)); +} + +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/ + +function listScrollParents(element, list) { + var _element$ownerDocumen; + + if (list === void 0) { + list = []; + } + + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))); +} + +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} + +function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === 'fixed'); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} + +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +} // A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` + + +function getClippingParents(element) { + var clippingParents = listScrollParents(getParentNode(element)); + var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + + if (!isElement(clipperElement)) { + return []; + } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 + + + return clippingParents.filter(function (clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; + }); +} // Gets the maximum area that the element is visible in due to any number of +// clipping parents + + +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var clippingParents = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents[0]; + var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} + +function computeOffsets(_ref) { + var reference = _ref.reference, + element = _ref.element, + placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference.x + reference.width / 2 - element.width / 2; + var commonY = reference.y + reference.height / 2 - element.height / 2; + var offsets; + + switch (basePlacement) { + case top: + offsets = { + x: commonX, + y: reference.y - element.height + }; + break; + + case bottom: + offsets = { + x: commonX, + y: reference.y + reference.height + }; + break; + + case right: + offsets = { + x: reference.x + reference.width, + y: commonY + }; + break; + + case left: + offsets = { + x: reference.x - element.width, + y: commonY + }; + break; + + default: + offsets = { + x: reference.x, + y: reference.y + }; + } + + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + + if (mainAxis != null) { + var len = mainAxis === 'y' ? 'height' : 'width'; + + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + break; + + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + break; + } + } + + return offsets; +} + +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: 'absolute', + placement: placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + // 0 or negative = within the clipping rect + + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element + + if (elementContext === popper && offsetData) { + var offset = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function (key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; + overflowOffsets[key] += offset[axis] * multiply; + }); + } + + return overflowOffsets; +} + +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { + return getVariation(placement) === variation; + }) : basePlacements; + var allowedPlacements = placements$1.filter(function (placement) { + return allowedAutoPlacements.indexOf(placement) >= 0; + }); + + if (allowedPlacements.length === 0) { + allowedPlacements = placements$1; + + if (process.env.NODE_ENV !== "production") { + console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' ')); + } + } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... + + + var overflows = allowedPlacements.reduce(function (acc, placement) { + acc[placement] = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding + })[getBasePlacement(placement)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function (a, b) { + return overflows[a] - overflows[b]; + }); +} + +function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +} + +function flip(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + + if (state.modifiersData[name]._skip) { + return; + } + + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { + return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements + }) : placement); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements[0]; + + for (var i = 0; i < placements.length; i++) { + var placement = placements[i]; + + var _basePlacement = getBasePlacement(placement); + + var isStartVariation = getVariation(placement) === start; + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? 'width' : 'height'; + var overflow = detectOverflow(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + altBoundary: altBoundary, + padding: padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + + if (checks.every(function (check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + + checksMap.set(placement, checks); + } + + if (makeFallbackChecks) { + // `2` may be desired in some cases – research later + var numberOfChecks = flipVariations ? 3 : 1; + + var _loop = function _loop(_i) { + var fittingPlacement = placements.find(function (placement) { + var checks = checksMap.get(placement); + + if (checks) { + return checks.slice(0, _i).every(function (check) { + return check; + }); + } + }); + + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + + if (_ret === "break") break; + } + } + + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} // eslint-disable-next-line import/no-unused-modules + + +var flip$1 = { + name: 'flip', + enabled: true, + phase: 'main', + fn: flip, + requiresIfExists: ['offset'], + data: { + _skip: false + } +}; + +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} + +function isAnySideFullyClipped(overflow) { + return [top, right, bottom, left].some(function (side) { + return overflow[side] >= 0; + }); +} + +function hide(_ref) { + var state = _ref.state, + name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: 'reference' + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets: referenceClippingOffsets, + popperEscapeOffsets: popperEscapeOffsets, + isReferenceHidden: isReferenceHidden, + hasPopperEscaped: hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + 'data-popper-reference-hidden': isReferenceHidden, + 'data-popper-escaped': hasPopperEscaped + }); +} // eslint-disable-next-line import/no-unused-modules + + +var hide$1 = { + name: 'hide', + enabled: true, + phase: 'main', + requiresIfExists: ['preventOverflow'], + fn: hide +}; + +function distanceAndSkiddingToXY(placement, rects, offset) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; + + var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; + + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} + +function offset(_ref2) { + var state = _ref2.state, + options = _ref2.options, + name = _ref2.name; + var _options$offset = options.offset, + offset = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = placements.reduce(function (acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); + return acc; + }, {}); + var _data$state$placement = data[state.placement], + x = _data$state$placement.x, + y = _data$state$placement.y; + + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +var offset$1 = { + name: 'offset', + enabled: true, + phase: 'main', + requires: ['popperOffsets'], + fn: offset +}; + +function popperOffsets(_ref) { + var state = _ref.state, + name = _ref.name; + // Offsets are the actual position the popper needs to have to be + // properly positioned near its reference element + // This is the most basic placement, and will be adjusted by + // the modifiers in the next step + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: 'absolute', + placement: state.placement + }); +} // eslint-disable-next-line import/no-unused-modules + + +var popperOffsets$1 = { + name: 'popperOffsets', + enabled: true, + phase: 'read', + fn: popperOffsets, + data: {} +}; + +function getAltAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} + +function preventOverflow(_ref) { + var state = _ref.state, + options = _ref.options, + name = _ref.name; + var _options$mainAxis = options.mainAxis, + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + altBoundary: altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + + if (!popperOffsets) { + return; + } + + if (checkMainAxis) { + var _offsetModifierState$; + + var mainSide = mainAxis === 'y' ? top : left; + var altSide = mainAxis === 'y' ? bottom : right; + var len = mainAxis === 'y' ? 'height' : 'width'; + var offset = popperOffsets[mainAxis]; + var min$1 = offset + overflow[mainSide]; + var max$1 = offset - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go + // outside the reference bounds + + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want + // to include its full size in the calculation. If the reference is small + // and near the edge of a boundary, the popper can overflow even if the + // reference is not overflowing as well (e.g. virtual elements with no + // width or height) + + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } + + if (checkAltAxis) { + var _offsetModifierState$2; + + var _mainSide = mainAxis === 'x' ? top : left; + + var _altSide = mainAxis === 'x' ? bottom : right; + + var _offset = popperOffsets[altAxis]; + + var _len = altAxis === 'y' ? 'height' : 'width'; + + var _min = _offset + overflow[_mainSide]; + + var _max = _offset - overflow[_altSide]; + + var isOriginSide = [top, left].indexOf(basePlacement) !== -1; + + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + + state.modifiersData[name] = data; +} // eslint-disable-next-line import/no-unused-modules + + +var preventOverflow$1 = { + name: 'preventOverflow', + enabled: true, + phase: 'main', + fn: preventOverflow, + requiresIfExists: ['offset'] +}; + +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} + +function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } +} + +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} // Returns the composite rect of an element relative to its offsetParent. +// Composite means it takes into account transforms as well as layout. + + +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} + +function order(modifiers) { + var map = new Map(); + var visited = new Set(); + var result = []; + modifiers.forEach(function (modifier) { + map.set(modifier.name, modifier); + }); // On visiting object, check for its dependencies and visit them recursively + + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function (dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + + modifiers.forEach(function (modifier) { + if (!visited.has(modifier.name)) { + // check for visited object + sort(modifier); + } + }); + return result; +} + +function orderModifiers(modifiers) { + // order based on dependencies + var orderedModifiers = order(modifiers); // order based on phase + + return modifierPhases.reduce(function (acc, phase) { + return acc.concat(orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + })); + }, []); +} + +function debounce(fn) { + var pending; + return function () { + if (!pending) { + pending = new Promise(function (resolve) { + Promise.resolve().then(function () { + pending = undefined; + resolve(fn()); + }); + }); + } + + return pending; + }; +} + +function format(str) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return [].concat(args).reduce(function (p, c) { + return p.replace(/%s/, c); + }, str); +} + +var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; +var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; +var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; +function validateModifiers(modifiers) { + modifiers.forEach(function (modifier) { + [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)` + .filter(function (value, index, self) { + return self.indexOf(value) === index; + }).forEach(function (key) { + switch (key) { + case 'name': + if (typeof modifier.name !== 'string') { + console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); + } + + break; + + case 'enabled': + if (typeof modifier.enabled !== 'boolean') { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); + } + + break; + + case 'phase': + if (modifierPhases.indexOf(modifier.phase) < 0) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); + } + + break; + + case 'fn': + if (typeof modifier.fn !== 'function') { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); + } + + break; + + case 'effect': + if (modifier.effect != null && typeof modifier.effect !== 'function') { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); + } + + break; + + case 'requires': + if (modifier.requires != null && !Array.isArray(modifier.requires)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); + } + + break; + + case 'requiresIfExists': + if (!Array.isArray(modifier.requiresIfExists)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); + } + + break; + + case 'options': + case 'data': + break; + + default: + console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { + return "\"" + s + "\""; + }).join(', ') + "; but \"" + key + "\" was provided."); + } + + modifier.requires && modifier.requires.forEach(function (requirement) { + if (modifiers.find(function (mod) { + return mod.name === requirement; + }) == null) { + console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); + } + }); + }); + }); +} + +function uniqueBy(arr, fn) { + var identifiers = new Set(); + return arr.filter(function (item) { + var identifier = fn(item); + + if (!identifiers.has(identifier)) { + identifiers.add(identifier); + return true; + } + }); +} + +function mergeByName(modifiers) { + var merged = modifiers.reduce(function (merged, current) { + var existing = merged[current.name]; + merged[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged; + }, {}); // IE11 does not support Object.values + + return Object.keys(merged).map(function (key) { + return merged[key]; + }); +} + +var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; +var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; +var DEFAULT_OPTIONS = { + placement: 'bottom', + modifiers: [], + strategy: 'absolute' +}; + +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return !args.some(function (element) { + return !(element && typeof element.getBoundingClientRect === 'function'); + }); +} + +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + + var _generatorOptions = generatorOptions, + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper(reference, popper, options) { + if (options === void 0) { + options = defaultOptions; + } + + var state = { + placement: 'bottom', + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference, + popper: popper + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state: state, + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options); + state.scrollParents = { + reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], + popper: listScrollParents(popper) + }; // Orders the modifiers based on their dependencies and `phase` + // properties + + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + + state.orderedModifiers = orderedModifiers.filter(function (m) { + return m.enabled; + }); // Validate the provided modifiers so that the consumer will get warned + // if one of the modifiers is invalid for any reason + + if (process.env.NODE_ENV !== "production") { + var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { + var name = _ref.name; + return name; + }); + validateModifiers(modifiers); + + if (getBasePlacement(state.options.placement) === auto) { + var flipModifier = state.orderedModifiers.find(function (_ref2) { + var name = _ref2.name; + return name === 'flip'; + }); + + if (!flipModifier) { + console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); + } + } + + var _getComputedStyle = getComputedStyle(popper), + marginTop = _getComputedStyle.marginTop, + marginRight = _getComputedStyle.marginRight, + marginBottom = _getComputedStyle.marginBottom, + marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can + // cause bugs with positioning, so we'll warn the consumer + + + if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { + return parseFloat(margin); + })) { + console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); + } + } + + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + + var _state$elements = state.elements, + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + // anymore + + if (!areValidElements(reference, popper)) { + if (process.env.NODE_ENV !== "production") { + console.error(INVALID_ELEMENT_ERROR); + } + + return; + } // Store the reference and popper rects to be read by modifiers + + + state.rects = { + reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), + popper: getLayoutRect(popper) + }; // Modifiers have the ability to reset the current update cycle. The + // most common use case for this is the `flip` modifier changing the + // placement, which then needs to re-run all the modifiers, because the + // logic was previously ran for the previous placement and is therefore + // stale/incorrect + + state.reset = false; + state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier + // is filled with the initial data specified by the modifier. This means + // it doesn't persist and is fresh on each update. + // To ensure persistent data, use `${name}#persistent` + + state.orderedModifiers.forEach(function (modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (process.env.NODE_ENV !== "production") { + __debug_loops__ += 1; + + if (__debug_loops__ > 100) { + console.error(INFINITE_LOOP_ERROR); + break; + } + } + + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + + var _state$orderedModifie = state.orderedModifiers[index], + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === 'function') { + state = fn({ + state: state, + options: _options, + name: name, + instance: instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function () { + return new Promise(function (resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + + if (!areValidElements(reference, popper)) { + if (process.env.NODE_ENV !== "production") { + console.error(INVALID_ELEMENT_ERROR); + } + + return instance; + } + + instance.setOptions(options).then(function (state) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state); + } + }); // Modifiers have the ability to execute arbitrary code before the first + // update cycle runs. They will be executed in the same order as the update + // cycle. This is useful when a modifier adds some persistent data that + // other modifiers need to use, but the modifier is run after the dependent + // one. + + function runModifierEffects() { + state.orderedModifiers.forEach(function (_ref3) { + var name = _ref3.name, + _ref3$options = _ref3.options, + options = _ref3$options === void 0 ? {} : _ref3$options, + effect = _ref3.effect; + + if (typeof effect === 'function') { + var cleanupFn = effect({ + state: state, + name: name, + instance: instance, + options: options + }); + + var noopFn = function noopFn() {}; + + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + + function cleanupModifierEffects() { + effectCleanupFns.forEach(function (fn) { + return fn(); + }); + effectCleanupFns = []; + } + + return instance; + }; +} + +var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; +var createPopper = /*#__PURE__*/popperGenerator({ + defaultModifiers: defaultModifiers +}); // eslint-disable-next-line import/no-unused-modules + +// Sam stole all this from Liam's Periodic Notes Plugin: https://github.com/liamcain/obsidian-periodic-notes +const wrapAround = (value, size) => { + return ((value % size) + size) % size; +}; +class Suggest { + constructor(owner, containerEl, scope) { + this.owner = owner; + this.containerEl = containerEl; + containerEl.on("click", ".suggestion-item", this.onSuggestionClick.bind(this)); + containerEl.on("mousemove", ".suggestion-item", this.onSuggestionMouseover.bind(this)); + scope.register([], "ArrowUp", (event) => { + if (!event.isComposing) { + this.setSelectedItem(this.selectedItem - 1, true); + return false; + } + }); + scope.register([], "ArrowDown", (event) => { + if (!event.isComposing) { + this.setSelectedItem(this.selectedItem + 1, true); + return false; + } + }); + scope.register([], "Enter", (event) => { + if (!event.isComposing) { + this.useSelectedItem(event); + return false; + } + }); + } + onSuggestionClick(event, el) { + event.preventDefault(); + const item = this.suggestions.indexOf(el); + this.setSelectedItem(item, false); + this.useSelectedItem(event); + } + onSuggestionMouseover(_event, el) { + const item = this.suggestions.indexOf(el); + this.setSelectedItem(item, false); + } + setSuggestions(values) { + this.containerEl.empty(); + const suggestionEls = []; + values.forEach((value) => { + const suggestionEl = this.containerEl.createDiv("suggestion-item"); + this.owner.renderSuggestion(value, suggestionEl); + suggestionEls.push(suggestionEl); + }); + this.values = values; + this.suggestions = suggestionEls; + this.setSelectedItem(0, false); + } + useSelectedItem(event) { + const currentValue = this.values[this.selectedItem]; + if (currentValue) { + this.owner.selectSuggestion(currentValue, event); + } + } + setSelectedItem(selectedIndex, scrollIntoView) { + const normalizedIndex = wrapAround(selectedIndex, this.suggestions.length); + const prevSelectedSuggestion = this.suggestions[this.selectedItem]; + const selectedSuggestion = this.suggestions[normalizedIndex]; + prevSelectedSuggestion === null || prevSelectedSuggestion === void 0 ? void 0 : prevSelectedSuggestion.removeClass("is-selected"); + selectedSuggestion === null || selectedSuggestion === void 0 ? void 0 : selectedSuggestion.addClass("is-selected"); + this.selectedItem = normalizedIndex; + if (scrollIntoView) { + selectedSuggestion.scrollIntoView(false); + } + } +} +class TextInputSuggest { + constructor(app, inputEl) { + this.app = app; + this.inputEl = inputEl; + this.scope = new obsidian.Scope(); + this.suggestEl = createDiv("suggestion-container"); + const suggestion = this.suggestEl.createDiv("suggestion"); + this.suggest = new Suggest(this, suggestion, this.scope); + this.scope.register([], "Escape", this.close.bind(this)); + this.inputEl.addEventListener("input", this.onInputChanged.bind(this)); + this.inputEl.addEventListener("focus", this.onInputChanged.bind(this)); + this.inputEl.addEventListener("blur", this.close.bind(this)); + this.suggestEl.on("mousedown", ".suggestion-container", (event) => { + event.preventDefault(); + }); + } + onInputChanged() { + const inputStr = this.inputEl.value; + const suggestions = this.getSuggestions(inputStr); + if (!suggestions) { + this.close(); + return; + } + if (suggestions.length > 0) { + this.suggest.setSuggestions(suggestions); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.open(this.app.dom.appContainerEl, this.inputEl); + } + else { + this.close(); + } + } + open(container, inputEl) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.app.keymap.pushScope(this.scope); + container.appendChild(this.suggestEl); + this.popper = createPopper(inputEl, this.suggestEl, { + placement: "bottom-start", + modifiers: [ + { + name: "sameWidth", + enabled: true, + fn: ({ state, instance }) => { + // Note: positioning needs to be calculated twice - + // first pass - positioning it according to the width of the popper + // second pass - position it with the width bound to the reference element + // we need to early exit to avoid an infinite loop + const targetWidth = `${state.rects.reference.width}px`; + if (state.styles.popper.width === targetWidth) { + return; + } + state.styles.popper.width = targetWidth; + instance.update(); + }, + phase: "beforeWrite", + requires: ["computeStyles"], + }, + ], + }); + } + close() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.app.keymap.popScope(this.scope); + this.suggest.setSuggestions([]); + this.popper.destroy(); + this.suggestEl.detach(); + } +} + +class KanbanHelperSettingSuggester extends TextInputSuggest { + constructor(app, inputEl, boards) { + super(app, inputEl); + this.app = app; + this.inputEl = inputEl; + this.boards = boards; + } + getSuggestions(inputStr) { + const inputLowerCase = inputStr.toLowerCase(); + return this.boards.map(board => { + if (board.basename.toLowerCase().contains(inputLowerCase)) + return board; + }); + } + selectSuggestion(item) { + this.inputEl.value = item.basename; + this.inputEl.trigger("input"); + this.close(); + } + renderSuggestion(value, el) { + if (value) + el.setText(value.basename); + } +} + +class LogManager { + register(logger) { + LogManager.loggers.push(logger); + return this; + } + logError(message) { + LogManager.loggers.forEach(logger => logger.logError(message)); + throw new Error(); + } + logWarning(message) { + LogManager.loggers.forEach(logger => logger.logError(message)); + } + logMessage(message) { + LogManager.loggers.forEach(logger => logger.logMessage(message)); + } +} +LogManager.loggers = []; +const log = new LogManager(); + +/* src/Modals/KanbanHelperSetting/KanbanHelperSettingContent.svelte generated by Svelte v3.55.1 */ + +function add_css$1(target) { + append_styles(target, "svelte-kqcr7b", ".buttonContainer.svelte-kqcr7b{display:flex;justify-content:center;margin-top:1rem}button.svelte-kqcr7b{margin-left:5px;margin-right:5px;font-size:15px}"); +} + +function get_each_context$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[15] = list[i]; + child_ctx[16] = list; + child_ctx[17] = i; + return child_ctx; +} + +// (55:8) {#each kanbanProperties as kanbanProperty, i} +function create_each_block$1(ctx) { + let tr; + let td0; + let input0; + let t0; + let td1; + let t1_value = /*kanbanProperty*/ ctx[15].boardName + ""; + let t1; + let t2; + let td2; + let input1; + let t3; + let td3; + let t4_value = /*getHeadingsInBoard*/ ctx[6](/*kanbanProperty*/ ctx[15].boardName) + ""; + let t4; + let t5; + let br; + let mounted; + let dispose; + + function click_handler() { + return /*click_handler*/ ctx[9](/*i*/ ctx[17]); + } + + function input1_input_handler() { + /*input1_input_handler*/ ctx[11].call(input1, /*each_value*/ ctx[16], /*i*/ ctx[17]); + } + + return { + c() { + tr = element("tr"); + td0 = element("td"); + input0 = element("input"); + t0 = space(); + td1 = element("td"); + t1 = text(t1_value); + t2 = space(); + td2 = element("td"); + input1 = element("input"); + t3 = space(); + td3 = element("td"); + t4 = text(t4_value); + t5 = space(); + br = element("br"); + attr(input0, "type", "button"); + input0.value = "❌"; + attr(input0, "class", "not-a-button"); + attr(input1, "type", "text"); + attr(input1, "placeholder", "Property name"); + }, + m(target, anchor) { + insert(target, tr, anchor); + append(tr, td0); + append(td0, input0); + append(tr, t0); + append(tr, td1); + append(td1, t1); + append(tr, t2); + append(tr, td2); + append(td2, input1); + set_input_value(input1, /*kanbanProperty*/ ctx[15].property); + append(tr, t3); + append(tr, td3); + append(td3, t4); + insert(target, t5, anchor); + insert(target, br, anchor); + + if (!mounted) { + dispose = [ + listen(input0, "click", click_handler), + listen(input1, "change", /*change_handler*/ ctx[10]), + listen(input1, "input", input1_input_handler) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + if (dirty & /*kanbanProperties*/ 1 && t1_value !== (t1_value = /*kanbanProperty*/ ctx[15].boardName + "")) set_data(t1, t1_value); + + if (dirty & /*kanbanProperties*/ 1 && input1.value !== /*kanbanProperty*/ ctx[15].property) { + set_input_value(input1, /*kanbanProperty*/ ctx[15].property); + } + + if (dirty & /*kanbanProperties*/ 1 && t4_value !== (t4_value = /*getHeadingsInBoard*/ ctx[6](/*kanbanProperty*/ ctx[15].boardName) + "")) set_data(t4, t4_value); + }, + d(detaching) { + if (detaching) detach(tr); + if (detaching) detach(t5); + if (detaching) detach(br); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$2(ctx) { + let div1; + let table; + let thead; + let t6; + let t7; + let input; + let t8; + let div0; + let button; + let mounted; + let dispose; + let each_value = /*kanbanProperties*/ ctx[0]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); + } + + return { + c() { + div1 = element("div"); + table = element("table"); + thead = element("thead"); + + thead.innerHTML = ` + Board + Property in link + Possible values`; + + t6 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t7 = space(); + input = element("input"); + t8 = space(); + div0 = element("div"); + button = element("button"); + button.textContent = "Add"; + set_style(table, "width", "100%"); + attr(input, "type", "text"); + attr(button, "class", "mod-cta svelte-kqcr7b"); + attr(div0, "class", "buttonContainer svelte-kqcr7b"); + attr(div1, "class", "centerSettingContent"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, table); + append(table, thead); + append(table, t6); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(table, null); + } + + append(div1, t7); + append(div1, input); + /*input_binding*/ ctx[12](input); + set_input_value(input, /*inputValue*/ ctx[3]); + append(div1, t8); + append(div1, div0); + append(div0, button); + + if (!mounted) { + dispose = [ + listen(input, "input", /*input_input_handler*/ ctx[13]), + listen(button, "click", /*addNewProperty*/ ctx[4]) + ]; + + mounted = true; + } + }, + p(ctx, [dirty]) { + if (dirty & /*getHeadingsInBoard, kanbanProperties, save, removeProperty*/ 99) { + each_value = /*kanbanProperties*/ ctx[0]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$1(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$1(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(table, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + + if (dirty & /*inputValue*/ 8 && input.value !== /*inputValue*/ ctx[3]) { + set_input_value(input, /*inputValue*/ ctx[3]); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + /*input_binding*/ ctx[12](null); + mounted = false; + run_all(dispose); + } + }; +} + +function instance$2($$self, $$props, $$invalidate) { + let { save } = $$props; + let { kanbanProperties = [] } = $$props; + let { boards } = $$props; + let { app } = $$props; + let suggestEl; + let inputValue; + + onMount(() => { + new KanbanHelperSettingSuggester(app, suggestEl, boards); + }); + + function addNewProperty() { + const board = boards.find(board => board.basename === inputValue); + const exists = !!kanbanProperties.find(kp => kp.boardName === board.basename); + if (!board || exists) return; + kanbanProperties.push({ property: "", boardName: board.basename }); + $$invalidate(0, kanbanProperties); // Svelte + save(kanbanProperties); + } + + function removeProperty(i) { + kanbanProperties.splice(i, 1); + $$invalidate(0, kanbanProperties); // Svelte + save(kanbanProperties); + } + + function getHeadingsInBoard(boardName) { + const file = boards.find(board => board.basename === boardName); + + if (!file) { + log.logWarning(`file ${boardName} not found.`); + return "FILE NOT FOUND"; + } + + const headings = app.metadataCache.getFileCache(file).headings; + if (!headings) return ""; + return headings.map(heading => heading.heading).join(", "); + } + + const click_handler = i => removeProperty(i); + const change_handler = () => save(kanbanProperties); + + function input1_input_handler(each_value, i) { + each_value[i].property = this.value; + $$invalidate(0, kanbanProperties); + } + + function input_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + suggestEl = $$value; + $$invalidate(2, suggestEl); + }); + } + + function input_input_handler() { + inputValue = this.value; + $$invalidate(3, inputValue); + } + + $$self.$$set = $$props => { + if ('save' in $$props) $$invalidate(1, save = $$props.save); + if ('kanbanProperties' in $$props) $$invalidate(0, kanbanProperties = $$props.kanbanProperties); + if ('boards' in $$props) $$invalidate(7, boards = $$props.boards); + if ('app' in $$props) $$invalidate(8, app = $$props.app); + }; + + return [ + kanbanProperties, + save, + suggestEl, + inputValue, + addNewProperty, + removeProperty, + getHeadingsInBoard, + boards, + app, + click_handler, + change_handler, + input1_input_handler, + input_binding, + input_input_handler + ]; +} + +class KanbanHelperSettingContent extends SvelteComponent { + constructor(options) { + super(); + + init( + this, + options, + instance$2, + create_fragment$2, + safe_not_equal, + { + save: 1, + kanbanProperties: 0, + boards: 7, + app: 8 + }, + add_css$1 + ); + } +} + +/* src/Modals/shared/SingleValueTableEditorContent.svelte generated by Svelte v3.55.1 */ + +function add_css(target) { + append_styles(target, "svelte-kqcr7b", ".buttonContainer.svelte-kqcr7b{display:flex;justify-content:center;margin-top:1rem}button.svelte-kqcr7b{margin-left:5px;margin-right:5px;font-size:15px}"); +} + +function get_each_context(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[7] = list[i]; + child_ctx[8] = list; + child_ctx[9] = i; + return child_ctx; +} + +// (23:8) {#each properties as property, i} +function create_each_block(ctx) { + let tr; + let td0; + let input0; + let t0; + let td1; + let input1; + let t1; + let mounted; + let dispose; + + function click_handler() { + return /*click_handler*/ ctx[4](/*i*/ ctx[9]); + } + + function input1_input_handler() { + /*input1_input_handler*/ ctx[6].call(input1, /*each_value*/ ctx[8], /*i*/ ctx[9]); + } + + return { + c() { + tr = element("tr"); + td0 = element("td"); + input0 = element("input"); + t0 = space(); + td1 = element("td"); + input1 = element("input"); + t1 = space(); + attr(input0, "type", "button"); + input0.value = "❌"; + attr(input0, "class", "not-a-button"); + set_style(input1, "width", "100%"); + attr(input1, "type", "text"); + attr(input1, "placeholder", "Property name"); + }, + m(target, anchor) { + insert(target, tr, anchor); + append(tr, td0); + append(td0, input0); + append(tr, t0); + append(tr, td1); + append(td1, input1); + set_input_value(input1, /*property*/ ctx[7]); + append(tr, t1); + + if (!mounted) { + dispose = [ + listen(input0, "click", click_handler), + listen(input1, "change", /*change_handler*/ ctx[5]), + listen(input1, "input", input1_input_handler) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + + if (dirty & /*properties*/ 1 && input1.value !== /*property*/ ctx[7]) { + set_input_value(input1, /*property*/ ctx[7]); + } + }, + d(detaching) { + if (detaching) detach(tr); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$1(ctx) { + let div1; + let table; + let thead; + let t2; + let t3; + let div0; + let button; + let mounted; + let dispose; + let each_value = /*properties*/ ctx[0]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); + } + + return { + c() { + div1 = element("div"); + table = element("table"); + thead = element("thead"); + + thead.innerHTML = ` + Property`; + + t2 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t3 = space(); + div0 = element("div"); + button = element("button"); + button.textContent = "Add"; + set_style(table, "width", "100%"); + attr(button, "class", "mod-cta svelte-kqcr7b"); + attr(div0, "class", "buttonContainer svelte-kqcr7b"); + attr(div1, "class", "centerSettingContent"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, table); + append(table, thead); + append(table, t2); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(table, null); + } + + append(div1, t3); + append(div1, div0); + append(div0, button); + + if (!mounted) { + dispose = listen(button, "click", /*addNewProperty*/ ctx[2]); + mounted = true; + } + }, + p(ctx, [dirty]) { + if (dirty & /*properties, save, removeProperty*/ 11) { + each_value = /*properties*/ ctx[0]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(table, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; +} + +function instance$1($$self, $$props, $$invalidate) { + let { save } = $$props; + let { properties = [] } = $$props; + + function addNewProperty() { + properties.push(""); + $$invalidate(0, properties); // Svelte + save(properties); + } + + function removeProperty(i) { + properties.splice(i, 1); + $$invalidate(0, properties); // Svelte + save(properties); + } + + const click_handler = i => removeProperty(i); + const change_handler = async () => save(properties); + + function input1_input_handler(each_value, i) { + each_value[i] = this.value; + $$invalidate(0, properties); + } + + $$self.$$set = $$props => { + if ('save' in $$props) $$invalidate(1, save = $$props.save); + if ('properties' in $$props) $$invalidate(0, properties = $$props.properties); + }; + + return [ + properties, + save, + addNewProperty, + removeProperty, + click_handler, + change_handler, + input1_input_handler + ]; +} + +class SingleValueTableEditorContent extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$1, create_fragment$1, safe_not_equal, { save: 1, properties: 0 }, add_css); + } +} + +function toggleHiddenEl(el, bShow) { + if (el && !bShow) { + el.style.display = "none"; + return true; + } + else if (el && bShow) { + el.style.display = "block"; + return false; + } + return bShow; +} +class MetaEditSettingsTab extends obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.svelteElements = []; + this.plugin = plugin; + } + display() { + let { containerEl } = this; + containerEl.empty(); + containerEl.createEl('h2', { text: 'MetaEdit Settings' }); + this.addProgressPropertiesSetting(containerEl); + this.addAutoPropertiesSetting(containerEl); + this.addIgnorePropertiesSetting(containerEl); + this.addEditModeSetting(containerEl); + this.addKanbanHelperSetting(containerEl); + this.addUIElementsSetting(containerEl); + } + addProgressPropertiesSetting(containerEl) { + let modal, div, hidden = true; + const setting = new obsidian.Setting(containerEl) + .setName("Progress Properties") + .setDesc("Update properties automatically.") + .addToggle(toggle => { + toggle + .setTooltip("Toggle Progress Properties") + .setValue(this.plugin.settings.ProgressProperties.enabled) + .onChange(async (value) => { + if (value === this.plugin.settings.ProgressProperties.enabled) + return; + this.plugin.settings.ProgressProperties.enabled = value; + this.plugin.toggleAutomators(); + await this.plugin.saveSettings(); + }); + }) + .addExtraButton(button => button.onClick(() => hidden = toggleHiddenEl(div, hidden))); + div = setting.settingEl.createDiv(); + setting.settingEl.style.display = "block"; + div.style.display = "none"; + modal = new ProgressPropertiesModalContent({ + target: div, + props: { + properties: this.plugin.settings.ProgressProperties.properties, + save: async (progressProperties) => { + this.plugin.settings.ProgressProperties.properties = progressProperties; + await this.plugin.saveSettings(); + } + }, + }); + this.svelteElements.push(modal); + } + addAutoPropertiesSetting(containerEl) { + let modal, div, hidden = true; + const setting = new obsidian.Setting(containerEl) + .setName("Auto Properties") + .setDesc("Quick switch for values you know the value of.") + .addToggle(toggle => { + toggle + .setTooltip("Toggle Auto Properties") + .setValue(this.plugin.settings.AutoProperties.enabled) + .onChange(async (value) => { + if (value === this.plugin.settings.AutoProperties.enabled) + return; + this.plugin.settings.AutoProperties.enabled = value; + await this.plugin.saveSettings(); + }); + }) + .addExtraButton(b => b.onClick(() => hidden = toggleHiddenEl(div, hidden))); + div = setting.settingEl.createDiv(); + setting.settingEl.style.display = "block"; + div.style.display = "none"; + modal = new AutoPropertiesModalContent({ + target: div, + props: { + autoProperties: this.plugin.settings.AutoProperties.properties, + save: async (autoProperties) => { + this.plugin.settings.AutoProperties.properties = autoProperties; + await this.plugin.saveSettings(); + } + }, + }); + this.svelteElements.push(modal); + } + addIgnorePropertiesSetting(containerEl) { + let modal, div, hidden = true; + const setting = new obsidian.Setting(containerEl) + .setName("Ignore Properties") + .setDesc("Hide these properties from the menu.") + .addToggle(toggle => { + toggle + .setTooltip("Toggle Ignored Properties") + .setValue(this.plugin.settings.IgnoredProperties.enabled) + .onChange(async (value) => { + if (value === this.plugin.settings.IgnoredProperties.enabled) + return; + this.plugin.settings.IgnoredProperties.enabled = value; + await this.plugin.saveSettings(); + this.display(); + }); + }).addExtraButton(b => b.onClick(() => hidden = toggleHiddenEl(div, hidden))); + if (this.plugin.settings.IgnoredProperties.enabled) { + div = setting.settingEl.createDiv(); + setting.settingEl.style.display = "block"; + div.style.display = "none"; + modal = new SingleValueTableEditorContent({ + target: div, + props: { + properties: this.plugin.settings.IgnoredProperties.properties, + save: async (ignoredProperties) => { + this.plugin.settings.IgnoredProperties.properties = ignoredProperties; + await this.plugin.saveSettings(); + } + }, + }); + this.svelteElements.push(modal); + } + } + addEditModeSetting(containerEl) { + let modal, div, bDivToggle = true, extraButtonEl; + // For linebreaks + const df = new DocumentFragment(); + df.createEl('p', { text: "Single: property values are just one value. " }); + df.createEl('p', { text: "Multi: properties are arrays. " }); + df.createEl('p', { text: "Some Multi: all options are single, except those specified in the settings (click button)." }); + const setting = new obsidian.Setting(containerEl) + .setName("Edit Mode") + .setDesc(df) + .addDropdown(dropdown => { + dropdown + .addOption(EditMode.AllSingle, EditMode.AllSingle) + .addOption(EditMode.AllMulti, EditMode.AllMulti) + .addOption(EditMode.SomeMulti, EditMode.SomeMulti) + .setValue(this.plugin.settings.EditMode.mode) + .onChange(async (value) => { + switch (value) { + case EditMode.AllMulti: + this.plugin.settings.EditMode.mode = EditMode.AllMulti; + toggleHiddenEl(extraButtonEl, false); + bDivToggle = toggleHiddenEl(div, false); + break; + case EditMode.AllSingle: + this.plugin.settings.EditMode.mode = EditMode.AllSingle; + toggleHiddenEl(extraButtonEl, false); + bDivToggle = toggleHiddenEl(div, false); + break; + case EditMode.SomeMulti: + this.plugin.settings.EditMode.mode = EditMode.SomeMulti; + toggleHiddenEl(extraButtonEl, true); + break; + } + await this.plugin.saveSettings(); + }); + }) + .addExtraButton(b => { + extraButtonEl = b.extraSettingsEl; + b.setTooltip("Configure which properties are Multi."); + return b.onClick(() => bDivToggle = toggleHiddenEl(div, bDivToggle)); + }); + if (this.plugin.settings.EditMode.mode != EditMode.SomeMulti) { + toggleHiddenEl(extraButtonEl, false); + } + div = setting.settingEl.createDiv(); + setting.settingEl.style.display = "block"; + div.style.display = "none"; + modal = new SingleValueTableEditorContent({ + target: div, + props: { + properties: this.plugin.settings.EditMode.properties, + save: async (properties) => { + this.plugin.settings.EditMode.properties = properties; + await this.plugin.saveSettings(); + } + }, + }); + this.svelteElements.push(modal); + } + hide() { + this.svelteElements.forEach(el => el.$destroy()); + return super.hide(); + } + addKanbanHelperSetting(containerEl) { + let modal, div, hidden = true; + const setting = new obsidian.Setting(containerEl) + .setName("Kanban Board Helper") + .setDesc("Update properties in links in kanban boards automatically when a card is moved to a new lane.") + .addToggle(toggle => { + toggle + .setTooltip("Toggle Kanban Helper") + .setValue(this.plugin.settings.KanbanHelper.enabled) + .onChange(async (value) => { + if (value === this.plugin.settings.KanbanHelper.enabled) + return; + this.plugin.settings.KanbanHelper.enabled = value; + this.plugin.toggleAutomators(); + await this.plugin.saveSettings(); + }); + }) + .addExtraButton(button => button.onClick(() => hidden = toggleHiddenEl(div, hidden))); + div = setting.settingEl.createDiv(); + setting.settingEl.style.display = "block"; + div.style.display = "none"; + modal = new KanbanHelperSettingContent({ + target: div, + props: { + kanbanProperties: this.plugin.settings.KanbanHelper.boards, + boards: this.plugin.getFilesWithProperty("kanban-plugin"), + app: this.app, + save: async (kanbanProperties) => { + this.plugin.settings.KanbanHelper.boards = kanbanProperties; + await this.plugin.saveSettings(); + } + }, + }); + this.svelteElements.push(modal); + } + addUIElementsSetting(containerEl) { + new obsidian.Setting(containerEl) + .setName("UI Elements") + .setDesc("Toggle UI elements: the 'Edit Meta' right-click menu option.") + .addToggle(toggle => { + toggle + .setTooltip("Toggle UI elements") + .setValue(this.plugin.settings.UIElements.enabled) + .onChange(async (value) => { + if (value === this.plugin.settings.UIElements.enabled) + return; + this.plugin.settings.UIElements.enabled = value; + value ? this.plugin.linkMenu.registerEvent() : this.plugin.linkMenu.unregisterEvent(); + await this.plugin.saveSettings(); + }); + }); + } +} + +var MetaType; +(function (MetaType) { + MetaType[MetaType["YAML"] = 0] = "YAML"; + MetaType[MetaType["Dataview"] = 1] = "Dataview"; + MetaType[MetaType["Tag"] = 2] = "Tag"; + MetaType[MetaType["Option"] = 3] = "Option"; +})(MetaType || (MetaType = {})); + +const ADD_FIRST_ELEMENT = "cmd:addfirst"; +const ADD_TO_BEGINNING = "cmd:beg"; +const ADD_TO_END = "cmd:end"; +const newDataView = "New Dataview field"; +const newYaml = "New YAML property"; +const MAIN_SUGGESTER_OPTIONS = [ + { key: newYaml, content: newYaml, type: MetaType.Option }, + { key: newDataView, content: newDataView, type: MetaType.Option } +]; + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn) { + var module = { exports: {} }; + return fn(module, module.exports), module.exports; +} + +function commonjsRequire (path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); +} + +var utils = createCommonjsModule(function (module, exports) { +var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JAVASCRIPT_RESERVED_KEYWORD_SET = exports.setProp = exports.findUp = exports.isValidLocalPath = exports.hasDepInstalled = exports.getIncludePaths = exports.concat = exports.importAny = void 0; + + +async function importAny(...modules) { + try { + const mod = await modules.reduce((acc, moduleName) => acc.catch(() => Promise.resolve().then(() => __importStar(commonjsRequire(moduleName)))), Promise.reject()); + return mod; + } + catch (e) { + throw new Error(`Cannot find any of modules: ${modules}\n\n${e}`); + } +} +exports.importAny = importAny; +function concat(...arrs) { + return arrs.reduce((acc, a) => { + if (a) { + return acc.concat(a); + } + return acc; + }, []); +} +exports.concat = concat; +/** Paths used by preprocessors to resolve @imports */ +function getIncludePaths(fromFilename, base = []) { + if (fromFilename == null) + return []; + return [ + ...new Set([...base, 'node_modules', process.cwd(), (0, path_1__default["default"].dirname)(fromFilename)]), + ]; +} +exports.getIncludePaths = getIncludePaths; +const depCheckCache = {}; +/** + * Checks if a package is installed. + * + * @export + * @param {string} dep + * @returns boolean + */ +async function hasDepInstalled(dep) { + if (depCheckCache[dep] != null) { + return depCheckCache[dep]; + } + let result = false; + try { + await Promise.resolve().then(() => __importStar(commonjsRequire(dep))); + result = true; + } + catch (e) { + result = false; + } + return (depCheckCache[dep] = result); +} +exports.hasDepInstalled = hasDepInstalled; +function isValidLocalPath(path) { + return path.startsWith('.'); +} +exports.isValidLocalPath = isValidLocalPath; +// finds a existing path up the tree +function findUp({ what, from }) { + const { root, dir } = (0, path_1__default["default"].parse)(from); + let cur = dir; + try { + while (cur !== root) { + const possiblePath = (0, path_1__default["default"].join)(cur, what); + if ((0, fs_1__default["default"].existsSync)(possiblePath)) { + return possiblePath; + } + cur = (0, path_1__default["default"].dirname)(cur); + } + } + catch (e) { + console.error(e); + } + return null; +} +exports.findUp = findUp; +// set deep property in object +function setProp(obj, keyList, value) { + let i = 0; + for (; i < keyList.length - 1; i++) { + const key = keyList[i]; + if (typeof obj[key] !== 'object') { + obj[key] = {}; + } + obj = obj[key]; + } + obj[keyList[i]] = value; +} +exports.setProp = setProp; +exports.JAVASCRIPT_RESERVED_KEYWORD_SET = new Set([ + 'arguments', + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'var', + 'void', + 'while', + 'with', + 'yield', +]); +}); + +class MetaEditSuggester extends obsidian.FuzzySuggestModal { + constructor(app, plugin, data, file, controller) { + super(app); + this.file = file; + this.app = app; + this.plugin = plugin; + this.data = this.removeIgnored(data); + this.controller = controller; + this.options = MAIN_SUGGESTER_OPTIONS; + this.setSuggestValues(); + this.setInstructions([ + { command: "❌", purpose: "Delete property" }, + { command: "🔃", purpose: "Transform to YAML/Dataview" } + ]); + } + renderSuggestion(item, el) { + super.renderSuggestion(item, el); + if (Object.values(this.options).find(v => v === item.item)) { + el.style.fontWeight = "bold"; + } + else { + this.createButton(el, "❌", this.deleteItem(item)); + this.createButton(el, "🔃", this.transformProperty(item)); + } + } + getItemText(item) { + return item.key; + } + getItems() { + return utils.concat(this.options, this.data); + } + async onChooseItem(item, evt) { + if (item.content === newYaml) { + const newProperty = await this.controller.createNewProperty(this.suggestValues); + if (!newProperty) + return null; + const { propName, propValue } = newProperty; + await this.controller.addYamlProp(propName, propValue, this.file); + return; + } + if (item.content === newDataView) { + const newProperty = await this.controller.createNewProperty(this.suggestValues); + if (!newProperty) + return null; + const { propName, propValue } = newProperty; + await this.controller.addDataviewField(propName, propValue, this.file); + return; + } + await this.controller.editMetaElement(item, this.data, this.file); + } + deleteItem(item) { + return async (evt) => { + evt.stopPropagation(); + await this.controller.deleteProperty(item.item, this.file); + this.close(); + }; + } + transformProperty(item) { + return async (evt) => { + evt.stopPropagation(); + const { item: property } = item; + if (property.type === MetaType.YAML) { + await this.toDataview(property); + } + else { + await this.toYaml(property); + } + this.close(); + }; + } + async toYaml(property) { + await this.controller.deleteProperty(property, this.file); + await this.controller.addYamlProp(property.key, property.content, this.file); + } + async toDataview(property) { + await this.controller.deleteProperty(property, this.file); + await this.controller.addDataviewField(property.key, property.content, this.file); + } + createButton(el, content, callback) { + const itemButton = el.createEl("button"); + itemButton.textContent = content; + itemButton.classList.add("not-a-button"); + itemButton.style.float = "right"; + itemButton.style.marginRight = "4px"; + itemButton.addEventListener("click", callback); + } + removeIgnored(data) { + const ignored = this.plugin.settings.IgnoredProperties.properties; + let purged = []; + for (let item in data) { + if (!ignored.contains(data[item].key)) + purged.push(data[item]); + } + return purged; + } + setSuggestValues() { + const autoProps = this.plugin.settings.AutoProperties.properties; + this.suggestValues = autoProps.reduce((arr, val) => { + if (!this.data.find(prop => val.name === prop.key || val.name.startsWith('#'))) { + arr.push(val.name); + } + return arr; + }, []); + } +} + +class MetaEditParser { + constructor(app) { + this.app = app; + } + async getTagsForFile(file) { + const cache = this.app.metadataCache.getFileCache(file); + if (!cache) + return []; + const tags = cache.tags; + if (!tags) + return []; + let mTags = []; + tags.forEach(tag => mTags.push({ key: tag.tag, content: tag.tag, type: MetaType.Tag })); + return mTags; + } + async parseFrontmatter(file) { + const fileCache = this.app.metadataCache.getFileCache(file); + const frontmatter = fileCache === null || fileCache === void 0 ? void 0 : fileCache.frontmatter; + if (!frontmatter) + return []; + //@ts-ignore - this is part of the new Obsidian API as of v1.4.1 + const { start, end } = fileCache === null || fileCache === void 0 ? void 0 : fileCache.frontmatterPosition; + const filecontent = await this.app.vault.cachedRead(file); + const yamlContent = filecontent.split("\n").slice(start.line, end.line).join("\n"); + const parsedYaml = obsidian.parseYaml(yamlContent); + let metaYaml = []; + for (const key in parsedYaml) { + metaYaml.push({ key, content: parsedYaml[key], type: MetaType.YAML }); + } + return metaYaml; + } + async parseInlineFields(file) { + const content = await this.app.vault.cachedRead(file); + const regex = /[\[\(]?([^\n\r\(\[]*)::[ ]*([^\)\]\n\r]*)[\]\)]?/g; + const properties = []; + let match; + while ((match = regex.exec(content)) !== null) { + const key = match[1].trim(); + const value = match[2].trim(); + properties.push({ key, content: value, type: MetaType.Dataview }); + } + return properties; + } +} + +class GenericTextSuggester extends TextInputSuggest { + constructor(app, inputEl, items) { + super(app, inputEl); + this.app = app; + this.inputEl = inputEl; + this.items = items; + } + getSuggestions(inputStr) { + const inputLowerCase = inputStr.toLowerCase(); + const filtered = this.items.filter(item => { + if (item.toLowerCase().contains(inputLowerCase)) + return item; + }); + if (!filtered) + this.close(); + if ((filtered === null || filtered === void 0 ? void 0 : filtered.length) === 1) + return [...filtered, inputStr]; + if ((filtered === null || filtered === void 0 ? void 0 : filtered.length) > 1) + return filtered; + } + selectSuggestion(item) { + this.inputEl.value = item; + this.inputEl.trigger("input"); + this.close(); + } + renderSuggestion(value, el) { + if (value) + el.setText(value); + } +} + +/* src/Modals/GenericPrompt/GenericPromptContent.svelte generated by Svelte v3.55.1 */ + +function create_fragment(ctx) { + let div; + let h1; + let t0; + let t1; + let input; + let mounted; + let dispose; + + return { + c() { + div = element("div"); + h1 = element("h1"); + t0 = text(/*header*/ ctx[1]); + t1 = space(); + input = element("input"); + set_style(h1, "text-align", "center"); + attr(input, "class", "metaEditPromptInput"); + attr(input, "placeholder", /*placeholder*/ ctx[2]); + set_style(input, "width", "100%"); + attr(input, "type", "text"); + attr(div, "class", "metaEditPrompt"); + }, + m(target, anchor) { + insert(target, div, anchor); + append(div, h1); + append(h1, t0); + append(div, t1); + append(div, input); + /*input_binding*/ ctx[8](input); + set_input_value(input, /*value*/ ctx[0]); + + if (!mounted) { + dispose = [ + listen(input, "input", /*input_input_handler*/ ctx[9]), + listen(input, "keydown", /*submit*/ ctx[4]) + ]; + + mounted = true; + } + }, + p(ctx, [dirty]) { + if (dirty & /*header*/ 2) set_data(t0, /*header*/ ctx[1]); + + if (dirty & /*placeholder*/ 4) { + attr(input, "placeholder", /*placeholder*/ ctx[2]); + } + + if (dirty & /*value*/ 1 && input.value !== /*value*/ ctx[0]) { + set_input_value(input, /*value*/ ctx[0]); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div); + /*input_binding*/ ctx[8](null); + mounted = false; + run_all(dispose); + } + }; +} + +function instance($$self, $$props, $$invalidate) { + let { app } = $$props; + let { header = "" } = $$props; + let { placeholder = "" } = $$props; + let { value = "" } = $$props; + let { onSubmit } = $$props; + let { suggestValues } = $$props; + let inputEl; + + onMount(() => { + if (suggestValues && suggestValues.length > 0) new GenericTextSuggester(app, inputEl, suggestValues); + inputEl.select(); + inputEl.focus(); + }); + + function submit(evt) { + if (evt.key === "Enter") { + evt.preventDefault(); + onSubmit(value); + } + } + + function input_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + inputEl = $$value; + $$invalidate(3, inputEl); + }); + } + + function input_input_handler() { + value = this.value; + $$invalidate(0, value); + } + + $$self.$$set = $$props => { + if ('app' in $$props) $$invalidate(5, app = $$props.app); + if ('header' in $$props) $$invalidate(1, header = $$props.header); + if ('placeholder' in $$props) $$invalidate(2, placeholder = $$props.placeholder); + if ('value' in $$props) $$invalidate(0, value = $$props.value); + if ('onSubmit' in $$props) $$invalidate(6, onSubmit = $$props.onSubmit); + if ('suggestValues' in $$props) $$invalidate(7, suggestValues = $$props.suggestValues); + }; + + return [ + value, + header, + placeholder, + inputEl, + submit, + app, + onSubmit, + suggestValues, + input_binding, + input_input_handler + ]; +} + +class GenericPromptContent extends SvelteComponent { + constructor(options) { + super(); + + init(this, options, instance, create_fragment, safe_not_equal, { + app: 5, + header: 1, + placeholder: 2, + value: 0, + onSubmit: 6, + suggestValues: 7 + }); + } +} + +class GenericPrompt extends obsidian.Modal { + static Prompt(app, header, placeholder, value, suggestValues) { + const newPromptModal = new GenericPrompt(app, header, placeholder, value, suggestValues); + return newPromptModal.waitForClose; + } + constructor(app, header, placeholder, value, suggestValues) { + super(app); + this.didSubmit = false; + this.modalContent = new GenericPromptContent({ + target: this.contentEl, + props: { + app, + header, + placeholder, + value, + suggestValues, + onSubmit: (input) => { + this.input = input; + this.didSubmit = true; + this.close(); + } + } + }); + this.waitForClose = new Promise((resolve, reject) => { + this.resolvePromise = resolve; + this.rejectPromise = reject; + }); + this.open(); + } + onOpen() { + super.onOpen(); + const modalPrompt = document.querySelector('.metaEditPrompt'); + const modalInput = modalPrompt.querySelector('.metaEditPromptInput'); + modalInput.focus(); + modalInput.select(); + } + onClose() { + super.onClose(); + this.modalContent.$destroy(); + if (!this.didSubmit) + this.rejectPromise("No input given."); + else + this.resolvePromise(this.input); + } +} + +class GenericSuggester extends obsidian.FuzzySuggestModal { + static Suggest(app, displayItems, items) { + const newSuggester = new GenericSuggester(app, displayItems, items); + return newSuggester.promise; + } + constructor(app, displayItems, items) { + super(app); + this.displayItems = displayItems; + this.items = items; + this.promise = new Promise((resolve) => (this.resolvePromise = resolve)); + this.open(); + } + getItemText(item) { + return this.displayItems[this.items.indexOf(item)]; + } + getItems() { + return this.items; + } + onChooseItem(item, evt) { + this.resolvePromise(item); + } +} + +class MetaController { + constructor(app, plugin) { + this.hasTrackerPlugin = false; + this.useTrackerPlugin = false; + this.app = app; + this.parser = new MetaEditParser(app); + this.plugin = plugin; + // @ts-ignore + this.hasTrackerPlugin = !!this.app.plugins.plugins["obsidian-tracker"]; + } + async getPropertiesInFile(file) { + const yaml = await this.parser.parseFrontmatter(file); + const inlineFields = await this.parser.parseInlineFields(file); + const tags = await this.parser.getTagsForFile(file); + return [...tags, ...yaml, ...inlineFields]; + } + async addYamlProp(propName, propValue, file) { + const fileContent = await this.app.vault.read(file); + const frontmatter = await this.parser.parseFrontmatter(file); + const isYamlEmpty = ((!frontmatter || frontmatter.length === 0) && !fileContent.match(/^-{3}\s*\n*\r*-{3}/)); + if (frontmatter.some(value => value.key === propName)) { + new obsidian.Notice(`Frontmatter in file '${file.name}' already has property '${propName}. Will not add.'`); + return; + } + const settings = this.plugin.settings; + if (settings.EditMode.mode === EditMode.AllMulti || + (settings.EditMode.mode === EditMode.SomeMulti && settings.EditMode.properties.contains(propName))) { + propValue = `[${propValue}]`; + } + let splitContent = fileContent.split("\n"); + if (isYamlEmpty) { + splitContent.unshift("---"); + splitContent.unshift(`${propName}: ${propValue}`); + splitContent.unshift("---"); + } + else { + splitContent.splice(1, 0, `${propName}: ${propValue}`); + } + const newFileContent = splitContent.join("\n"); + await this.app.vault.modify(file, newFileContent); + } + async addDataviewField(propName, propValue, file) { + const fileContent = await this.app.vault.read(file); + let lines = fileContent.split("\n").reduce((obj, line, idx) => { + obj[idx] = !!line ? line : ""; + return obj; + }, {}); + let appendAfter = await GenericSuggester.Suggest(this.app, Object.values(lines), Object.keys(lines)); + if (!appendAfter) + return; + let splitContent = fileContent.split("\n"); + if (typeof appendAfter === "number" || parseInt(appendAfter)) { + splitContent.splice(parseInt(appendAfter), 0, `${propName}:: ${propValue}`); + } + const newFileContent = splitContent.join("\n"); + await this.app.vault.modify(file, newFileContent); + } + async editMetaElement(property, meta, file) { + const mode = this.plugin.settings.EditMode.mode; + if (property.type === MetaType.Tag) + await this.editTag(property, file); + else if (mode === EditMode.AllMulti || mode === EditMode.SomeMulti) + await this.multiValueMode(property, file); + else + await this.standardMode(property, file); + } + async editTag(property, file) { + const splitTag = property.key.split("/"); + const allButLast = splitTag.slice(0, splitTag.length - 1).join("/"); + const trackerPluginMethod = "Use Tracker", metaEditMethod = "Use MetaEdit", choices = [trackerPluginMethod, metaEditMethod]; + let newValue; + let method = metaEditMethod; + if (this.hasTrackerPlugin) + method = await GenericSuggester.Suggest(this.app, choices, choices); + if (!method) + return; + if (method === trackerPluginMethod) { + newValue = await GenericPrompt.Prompt(this.app, `Enter a new value for ${property.key}`); + this.useTrackerPlugin = true; + } + else if (method === metaEditMethod) { + const autoProp = await this.handleAutoProperties(allButLast); + if (autoProp) + newValue = autoProp; + else + newValue = await GenericPrompt.Prompt(this.app, `Enter a new value for ${property.key}`); + } + if (newValue) { + await this.updatePropertyInFile(property, newValue, file); + } + } + async handleProgressProps(meta, file) { + var _a, _b; + try { + const { enabled, properties } = this.plugin.settings.ProgressProperties; + if (!enabled) + return; + const tasks = (_b = (_a = this.app.metadataCache.getFileCache(file)) === null || _a === void 0 ? void 0 : _a.listItems) === null || _b === void 0 ? void 0 : _b.filter(li => li.task); + if (!tasks) + return; + let total = 0, complete = 0, incomplete = 0; + total = tasks.length; + complete = tasks.filter(i => i.task != " ").length; + incomplete = total - complete; + const props = await this.progressPropHelper(properties, meta, { total, complete, incomplete }); + await this.updateMultipleInFile(props, file); + } + catch (e) { + log.logError(e); + } + } + async createNewProperty(suggestValues) { + let propName = await GenericPrompt.Prompt(this.app, "Enter a property name", "Property", "", suggestValues); + if (!propName) + return null; + let propValue; + const autoProp = await this.handleAutoProperties(propName); + if (autoProp) { + propValue = autoProp; + } + else { + propValue = await GenericPrompt.Prompt(this.app, "Enter a property value", "Value") + .catch(() => null); + } + if (propValue === null) + return null; + return { propName, propValue: propValue.trim() }; + } + async deleteProperty(property, file) { + const fileContent = await this.app.vault.read(file); + const splitContent = fileContent.split("\n"); + const regexp = new RegExp(`^\s*${property.key}:`); + const idx = splitContent.findIndex(s => s.match(regexp)); + const newFileContent = splitContent.filter((v, i) => { + if (i != idx) + return true; + }).join("\n"); + await this.app.vault.modify(file, newFileContent); + } + async progressPropHelper(progressProps, meta, counts) { + return progressProps.reduce((obj, el) => { + const property = meta.find(prop => prop.key === el.name); + if (property) { + switch (el.type) { + case ProgressPropertyOptions.TaskComplete: + obj.push(Object.assign(Object.assign({}, property), { content: counts.complete.toString() })); + break; + case ProgressPropertyOptions.TaskIncomplete: + obj.push(Object.assign(Object.assign({}, property), { content: counts.incomplete.toString() })); + break; + case ProgressPropertyOptions.TaskTotal: + obj.push(Object.assign(Object.assign({}, property), { content: counts.total.toString() })); + break; + } + } + return obj; + }, []); + } + async standardMode(property, file) { + const autoProp = await this.handleAutoProperties(property.key); + let newValue; + if (autoProp) + newValue = autoProp; + else + newValue = await GenericPrompt.Prompt(this.app, `Enter a new value for ${property.key}`, property.content, property.content); + if (newValue) { + await this.updatePropertyInFile(property, newValue, file); + } + } + async multiValueMode(property, file) { + const settings = this.plugin.settings; + let newValue; + if (settings.EditMode.mode == EditMode.SomeMulti && !settings.EditMode.properties.includes(property.key)) { + await this.standardMode(property, file); + return false; + } + let selectedOption, tempValue, splitValues; + let currentPropValue = property.content; + if (currentPropValue !== null) + currentPropValue = currentPropValue.toString(); + else + currentPropValue = ""; + if (property.type === MetaType.YAML) { + splitValues = currentPropValue.split('').filter(c => !c.includes("[]")).join('').split(","); + } + else { + splitValues = currentPropValue.split(",").map(prop => prop.trim()); + } + if (splitValues.length == 0 || (splitValues.length == 1 && splitValues[0] == "")) { + const options = ["Add new value"]; + selectedOption = await GenericSuggester.Suggest(this.app, options, [ADD_FIRST_ELEMENT]); + } + else if (splitValues.length == 1) { + const options = [splitValues[0], "Add to end", "Add to beginning"]; + selectedOption = await GenericSuggester.Suggest(this.app, options, [splitValues[0], ADD_TO_END, ADD_TO_BEGINNING]); + } + else { + const options = ["Add to end", ...splitValues, "Add to beginning"]; + selectedOption = await GenericSuggester.Suggest(this.app, options, [ADD_TO_END, ...splitValues, ADD_TO_BEGINNING]); + } + if (!selectedOption) + return; + let selectedIndex; + const autoProp = await this.handleAutoProperties(property.key); + if (autoProp) { + tempValue = autoProp; + } + else if (selectedOption.includes("cmd")) { + tempValue = await GenericPrompt.Prompt(this.app, "Enter a new value"); + } + else { + selectedIndex = splitValues.findIndex(el => el == selectedOption); + tempValue = await GenericPrompt.Prompt(this.app, `Change ${selectedOption} to`, selectedOption); + } + if (!tempValue) + return; + switch (selectedOption) { + case ADD_FIRST_ELEMENT: + newValue = `${tempValue}`; + break; + case ADD_TO_BEGINNING: + newValue = `${[tempValue, ...splitValues].join(", ")}`; + break; + case ADD_TO_END: + newValue = `${[...splitValues, tempValue].join(", ")}`; + break; + default: + if (selectedIndex) + splitValues[selectedIndex] = tempValue; + else + splitValues = [tempValue]; + newValue = `${splitValues.join(", ")}`; + break; + } + if (property.type === MetaType.YAML) + newValue = `[${newValue}]`; + if (newValue) { + await this.updatePropertyInFile(property, newValue, file); + return true; + } + return false; + } + async handleAutoProperties(propertyName) { + const autoProp = this.plugin.settings.AutoProperties.properties.find(a => a.name === propertyName); + if (this.plugin.settings.AutoProperties.enabled && autoProp) { + const options = autoProp.choices; + return await GenericPrompt.Prompt(this.app, `Enter a new value for ${propertyName}`, '', '', options); + } + return null; + } + updateYamlProperty(property, newValue, file) { + const fileCache = this.app.metadataCache.getFileCache(file); + const frontMatter = fileCache.frontmatter; + frontMatter[property.key] = newValue; + return obsidian.stringifyYaml(frontMatter); + } + async updatePropertyInFile(property, newValue, file) { + // I'm aware this is hacky. Didn't want to spend a bunch of time rewriting old logic. + // This uses the new frontmatter API to update the frontmatter. Later TODO: rewrite old logic to just do this & clean. + if (property.type === MetaType.YAML) { + const updatedMetaData = `---\n${this.updateYamlProperty(property, newValue, file)}\n---`; + //@ts-ignore + const frontmatterPosition = this.app.metadataCache.getFileCache(file).frontmatterPosition; + const fileContents = await this.app.vault.read(file); + const deleteFrom = frontmatterPosition.start.offset; + const deleteTo = frontmatterPosition.end.offset; + const newFileContents = fileContents.substring(0, deleteFrom) + updatedMetaData + fileContents.substring(deleteTo); + await this.app.vault.modify(file, newFileContents); + return; + } + const fileContent = await this.app.vault.read(file); + const newFileContent = fileContent.split("\n").map(line => { + if (this.lineMatch(property, line)) { + return this.updatePropertyLine(property, newValue, line); + } + return line; + }).join("\n"); + await this.app.vault.modify(file, newFileContent); + } + escapeSpecialCharacters(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + } + lineMatch(property, line) { + const propertyRegex = new RegExp(`${this.escapeSpecialCharacters(property.key)}\:{1,2}`); + const tagRegex = new RegExp(`^\s*${this.escapeSpecialCharacters(property.key)}`); + if (property.key.contains('#')) { + return tagRegex.test(line); + } + return propertyRegex.test(line); + } + updatePropertyLine(property, newValue, line) { + let newLine; + switch (property.type) { + case MetaType.Dataview: + const propertyRegex = new RegExp(`([\\(\\[]?)${this.escapeSpecialCharacters(property.key)}::[ ]*[^\\)\\]\n\r]*(?:\\]\])?([\\]\\)]?)`, 'g'); + newLine = line.replace(propertyRegex, `$1${property.key}:: ${newValue}$2`); + break; + case MetaType.YAML: + newLine = `${property.key}: ${newValue}`; + break; + case MetaType.Tag: + if (this.useTrackerPlugin) { + newLine = `${property.key}:${newValue}`; + } + else { + const splitTag = property.key.split("/"); + if (splitTag.length === 1) + newLine = `${splitTag[0]}/${newValue}`; + else if (splitTag.length > 1) { + const allButLast = splitTag.slice(0, splitTag.length - 1).join("/"); + newLine = `${allButLast}/${newValue}`; + } + else + newLine = property.key; + } + break; + default: + newLine = property.key; + break; + } + return newLine; + } + async updateMultipleInFile(properties, file) { + let fileContent = (await this.app.vault.read(file)).split("\n"); + for (const prop of properties) { + fileContent = fileContent.map(line => { + if (this.lineMatch(prop, line)) { + return this.updatePropertyLine(prop, prop.content, line); + } + return line; + }); + } + const newFileContent = fileContent.join("\n"); + await this.app.vault.modify(file, newFileContent); + } +} + +const DEFAULT_SETTINGS = Object.freeze({ + ProgressProperties: { + enabled: false, + properties: [] + }, + IgnoredProperties: { + enabled: false, + properties: [] + }, + AutoProperties: { + enabled: false, + properties: [] + }, + EditMode: { + mode: EditMode.AllSingle, + properties: [], + }, + KanbanHelper: { + enabled: false, + boards: [] + }, + UIElements: { + enabled: true + } +}); + +class LinkMenu { + constructor(plugin) { + this.plugin = plugin; + } + registerEvent() { + this.eventRef = this.plugin.app.workspace.on('file-menu', (menu, file, source) => this.onMenuOpenCallback(menu, file, source)); + this.plugin.registerEvent(this.eventRef); + } + unregisterEvent() { + if (this.eventRef) { + this.plugin.app.workspace.offref(this.eventRef); + } + } + onMenuOpenCallback(menu, file, source) { + const bCorrectSource = (source === "link-context-menu" || + source === "calendar-context-menu" || + source == "file-explorer-context-menu"); + if (bCorrectSource) { + if (file instanceof obsidian.TFile && file.extension === "md") { + this.targetFile = file; + this.addFileOptions(menu); + } + if (file instanceof obsidian.TFolder && file.children && file.children.some(f => f instanceof obsidian.TFile && f.extension === "md")) { + this.targetFolder = file; + this.addFolderOptions(menu); + } + } + } + addFileOptions(menu) { + menu.addItem(item => { + item.setIcon('pencil'); + item.setTitle("Edit Meta"); + item.onClick(async (evt) => { + await this.plugin.runMetaEditForFile(this.targetFile); + }); + }); + } + addFolderOptions(menu) { + menu.addItem(item => { + item.setIcon('pencil'); + item.setTitle("Add YAML property to all files in this folder (and subfolders)"); + item.onClick(async (evt) => { + await this.plugin.runMetaEditForFolder(this.targetFolder); + }); + }); + } +} + +class MetaEditApi { + constructor(plugin) { + this.plugin = plugin; + } + make() { + return { + autoprop: this.getAutopropFunction(), + update: this.getUpdateFunction(), + getPropertyValue: this.getGetPropertyValueFunction(), + getFilesWithProperty: this.getGetFilesWithPropertyFunction(), + createYamlProperty: this.getCreateYamlPropertyFunction(), + getPropertiesInFile: this.getGetPropertiesInFile(), + }; + } + getAutopropFunction() { + return (propertyName) => new MetaController(this.plugin.app, this.plugin).handleAutoProperties(propertyName); + } + getUpdateFunction() { + return async (propertyName, propertyValue, file) => { + const targetFile = this.getFileFromTFileOrPath(file); + if (!targetFile) + return; + const controller = new MetaController(this.plugin.app, this.plugin); + const propsInFile = await controller.getPropertiesInFile(targetFile); + const targetProperty = propsInFile.find(prop => prop.key === propertyName); + if (!targetProperty) + return; + return controller.updatePropertyInFile(targetProperty, propertyValue, targetFile); + }; + } + getFileFromTFileOrPath(file) { + let targetFile; + if (file instanceof obsidian.TFile) + targetFile = file; + if (typeof file === "string") { + const abstractFile = this.plugin.app.vault.getAbstractFileByPath(file); + if (abstractFile instanceof obsidian.TFile) { + targetFile = abstractFile; + } + } + return targetFile; + } + getGetPropertyValueFunction() { + return async (propertyName, file) => { + const targetFile = this.getFileFromTFileOrPath(file); + if (!targetFile) + return; + const controller = new MetaController(this.plugin.app, this.plugin); + const propsInFile = await controller.getPropertiesInFile(targetFile); + const targetProperty = propsInFile.find(prop => prop.key === propertyName); + if (!targetProperty) + return; + return targetProperty.content; + }; + } + getGetFilesWithPropertyFunction() { + return (propertyName) => { + return this.plugin.getFilesWithProperty(propertyName); + }; + } + getCreateYamlPropertyFunction() { + return async (propertyName, propertyValue, file) => { + const targetFile = this.getFileFromTFileOrPath(file); + if (!targetFile) + return; + const controller = new MetaController(this.plugin.app, this.plugin); + await controller.addYamlProp(propertyName, propertyValue, targetFile); + }; + } + getGetPropertiesInFile() { + return async (file) => { + const targetFile = this.getFileFromTFileOrPath(file); + if (!targetFile) + return; + const controller = new MetaController(this.plugin.app, this.plugin); + return await controller.getPropertiesInFile(targetFile); + }; + } +} + +function getActiveMarkdownFile(app) { + const activeFile = app.workspace.getActiveFile(); + const activeMarkdownFile = abstractFileToMarkdownTFile(activeFile); + if (!activeMarkdownFile) { + this.logError("could not get current file."); + return null; + } + return activeMarkdownFile; +} +function abstractFileToMarkdownTFile(file) { + if (file instanceof obsidian.TFile && file.extension === "md") + return file; + return null; +} + +var ErrorLevel; +(function (ErrorLevel) { + ErrorLevel["Error"] = "ERROR"; + ErrorLevel["Warning"] = "WARNING"; + ErrorLevel["Log"] = "LOG"; +})(ErrorLevel || (ErrorLevel = {})); + +class MetaEditLogger { + formatOutputString(error) { + return `MetaEdit: (${error.level}) ${error.message}`; + } + getMetaEditError(message, level) { + return { message, level, time: Date.now() }; + } +} + +class ConsoleErrorLogger extends MetaEditLogger { + constructor() { + super(...arguments); + this.ErrorLog = []; + } + logError(errorMsg) { + const error = this.getMetaEditError(errorMsg, ErrorLevel.Error); + this.addMessageToErrorLog(error); + console.error(this.formatOutputString(error)); + } + logWarning(warningMsg) { + const warning = this.getMetaEditError(warningMsg, ErrorLevel.Warning); + this.addMessageToErrorLog(warning); + console.warn(this.formatOutputString(warning)); + } + logMessage(logMsg) { + const log = this.getMetaEditError(logMsg, ErrorLevel.Log); + this.addMessageToErrorLog(log); + console.log(this.formatOutputString(log)); + } + addMessageToErrorLog(error) { + this.ErrorLog.push(error); + } +} + +class GuiLogger extends MetaEditLogger { + constructor(plugin) { + super(); + this.plugin = plugin; + } + logError(msg) { + const error = this.getMetaEditError(msg, ErrorLevel.Error); + new obsidian.Notice(this.formatOutputString(error)); + } + logWarning(msg) { + const warning = this.getMetaEditError(msg, ErrorLevel.Warning); + new obsidian.Notice(this.formatOutputString(warning)); + } + logMessage(msg) { } +} + +class UniqueQueue { + constructor() { + this.elements = []; + } + enqueue(item) { + if (this.elements.find(i => i === item)) { + return false; + } + this.elements.push(item); + return true; + } + dequeue() { + return this.elements.shift(); + } + peek() { + return this.elements[0]; + } + isEmpty() { + return this.elements.length === 0; + } + length() { + return this.elements.length; + } +} + +class UpdatedFileCache { + constructor() { + this.map = new Map(); + } + get(key) { + return this.map.get(key); + } + set(key, content) { + if (this.map.has(key) && this.map.get(key).content === content) + return false; + this.map.set(key, { content, updateTime: Date.now() }); + this.clean(); + return true; + } + delete(key) { + this.map.delete(key); + } + clean() { + const five_minutes = 300000; + this.map.forEach((item, key) => { + if (item.updateTime < Date.now() - five_minutes) { + this.delete(key); + } + }); + } +} + +class OnFileModifyAutomatorManager { + constructor(plugin) { + this.updateFileQueue = new UniqueQueue(); + this.updatedFileCache = new UpdatedFileCache(); + this.automators = []; + this.notifyDelay = 5000; + this.notifyAutomators = obsidian.debounce(async () => { + while (!this.updateFileQueue.isEmpty()) { + const file = this.updateFileQueue.dequeue(); + for (const automator of this.automators) { + await automator.onFileModify(file); + } + } + }, this.notifyDelay, true); + this.plugin = plugin; + this.app = plugin.app; + } + startAutomators() { + this.plugin.registerEvent(this.plugin.app.vault.on("modify", (file) => this.onFileModify(file))); + return this; + } + attach(automator) { + const isExist = this.automators.some(tAuto => tAuto.type === automator.type); + if (isExist) { + log.logWarning(`a ${automator.type} automator is already attached.`); + return this; + } + this.automators.push(automator); + return this; + } + detach(automatorType) { + const automatorIndex = this.automators.findIndex(automator => automator.type === automatorType); + if (automatorIndex === -1) { + log.logMessage(`automator of type '${automatorType}' does not exist.`); + return this; + } + this.automators.splice(automatorIndex, 1); + return this; + } + async onFileModify(file) { + const outfile = abstractFileToMarkdownTFile(file); + if (!outfile) + return; + // Return on Excalidraw files to prevent conflict with its auto-save feature. + const metadata = await this.app.metadataCache.getFileCache(outfile); + if (metadata.frontmatter != null) { // Don't try to use frontmatter if it doesn't exist. + const keys = Object.keys(metadata === null || metadata === void 0 ? void 0 : metadata.frontmatter); + if (keys && keys.some(key => key.toLowerCase().contains("excalidraw"))) { + return; + } + const fileContent = await this.app.vault.cachedRead(outfile); + if (!this.updatedFileCache.set(outfile.path, fileContent)) + return; + if (this.updateFileQueue.enqueue(outfile)) { + this.notifyAutomators(); + } + } + } +} + +class OnFileModifyAutomator { + constructor(plugin, type) { + this.plugin = plugin; + this.app = plugin.app; + this.type = type; + } +} + +var OnModifyAutomatorType; +(function (OnModifyAutomatorType) { + OnModifyAutomatorType["KanbanHelper"] = "KanbanHelper"; + OnModifyAutomatorType["ProgressProperties"] = "ProgressProperties"; +})(OnModifyAutomatorType || (OnModifyAutomatorType = {})); + +class KanbanHelper extends OnFileModifyAutomator { + get boards() { return this.plugin.settings.KanbanHelper.boards; } + constructor(plugin) { + super(plugin, OnModifyAutomatorType.KanbanHelper); + } + async onFileModify(file) { + const kanbanBoardFileContent = await this.app.vault.cachedRead(file); + const kanbanBoardFileCache = this.app.metadataCache.getFileCache(file); + const targetBoard = this.findBoardByName(file.basename); + if (!targetBoard || !kanbanBoardFileCache) + return; + const { links } = kanbanBoardFileCache; + if (!links) + return; + await this.updateFilesInBoard(links, targetBoard, kanbanBoardFileContent); + } + findBoardByName(boardName) { + return this.boards.find(board => board.boardName === boardName); + } + getLinkFile(link) { + const markdownFiles = this.app.vault.getMarkdownFiles(); + return markdownFiles.find(f => f.path.endsWith(`/${link.link}.md`) || f.path === `${link.link}.md`); + } + async updateFilesInBoard(links, board, kanbanBoardFileContent) { + for (const link of links) { + const linkFile = this.getLinkFile(link); + const linkIsMarkdownFile = !!abstractFileToMarkdownTFile(linkFile); + if (!linkFile || !linkIsMarkdownFile) { + log.logMessage(`${link.link} is not updatable for the KanbanHelper.`); + continue; + } + await this.updateFileInBoard(link, linkFile, board, kanbanBoardFileContent); + } + } + async updateFileInBoard(link, linkFile, board, kanbanBoardFileContent) { + const heading = this.getTaskHeading(link.original, kanbanBoardFileContent); + if (!heading) { + log.logMessage(`found linked file ${link.link} but could not get heading for task.`); + return; + } + const fileProperties = await this.plugin.controller.getPropertiesInFile(linkFile); + if (!fileProperties) { + log.logWarning(`No properties found in '${board.boardName}', cannot update '${board.property}'.`); + return; + } + const targetProperty = fileProperties.find(prop => prop.key === board.property); + if (!targetProperty) { + log.logWarning(`'${board.property} not found in ${board.boardName} for file "${linkFile.name}".'`); + new obsidian.Notice(`'${board.property} not found in ${board.boardName} for file "${linkFile.name}".'`); // This notice will help users debug "Property not found in board" errors. + return; + } + const propertyHasChanged = (targetProperty.content != heading); // Kanban Helper will check if the file's property is different from its current heading in the kanban and will only make changes to the file if there's a difference + if (propertyHasChanged) { + console.debug("Updating " + targetProperty.key + " of file " + linkFile.name + " to " + heading); + await this.plugin.controller.updatePropertyInFile(targetProperty, heading, linkFile); + } + } + getTaskHeading(targetTaskContent, fileContent) { + const MARKDOWN_HEADING = new RegExp(/#+\s+(.+)/); + const TASK_REGEX = new RegExp(/(\s*)-\s*\[([ Xx\.]?)\]\s*(.+)/, "i"); + let lastHeading = ""; + const contentLines = fileContent.split("\n"); + for (const line of contentLines) { + const headingMatch = MARKDOWN_HEADING.exec(line); + if (headingMatch) { + const headingText = headingMatch[1]; + lastHeading = headingText; + } + const taskMatch = TASK_REGEX.exec(line); + if (taskMatch) { + const taskContent = taskMatch[3]; + if (taskContent.includes(targetTaskContent)) { + return lastHeading; + } + } + } + return null; + } +} + +class ProgressPropertyHelper extends OnFileModifyAutomator { + constructor(plugin) { + super(plugin, OnModifyAutomatorType.ProgressProperties); + } + async onFileModify(file) { + const data = await this.plugin.controller.getPropertiesInFile(file); + if (!data) + return; + await this.plugin.controller.handleProgressProps(data, file); + } +} + +class MetaEdit extends obsidian.Plugin { + async onload() { + console.log('Loading MetaEdit'); + this.controller = new MetaController(this.app, this); + await this.loadSettings(); + this.addCommand({ + id: 'metaEditRun', + name: 'Run MetaEdit', + callback: async () => { + const file = getActiveMarkdownFile(this.app); + if (!file) + return; + await this.runMetaEditForFile(file); + } + }); + this.addSettingTab(new MetaEditSettingsTab(this.app, this)); + this.linkMenu = new LinkMenu(this); + if (this.settings.UIElements.enabled) { + this.linkMenu.registerEvent(); + } + this.api = new MetaEditApi(this).make(); + log.register(new ConsoleErrorLogger()) + .register(new GuiLogger(this)); + this.automatorManager = new OnFileModifyAutomatorManager(this).startAutomators(); + this.toggleAutomators(); + } + toggleAutomators() { + if (this.settings.KanbanHelper.enabled) + this.automatorManager.attach(new KanbanHelper(this)); + else + this.automatorManager.detach(OnModifyAutomatorType.KanbanHelper); + if (this.settings.ProgressProperties.enabled) + this.automatorManager.attach(new ProgressPropertyHelper(this)); + else + this.automatorManager.detach(OnModifyAutomatorType.ProgressProperties); + } + async runMetaEditForFile(file) { + const data = await this.controller.getPropertiesInFile(file); + if (!data) + return; + const suggester = new MetaEditSuggester(this.app, this, data, file, this.controller); + suggester.open(); + } + onunload() { + console.log('Unloading MetaEdit'); + this.linkMenu.unregisterEvent(); + } + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + } + async saveSettings() { + await this.saveData(this.settings); + } + getFilesWithProperty(property) { + const markdownFiles = this.app.vault.getMarkdownFiles(); + let files = []; + markdownFiles.forEach(file => { + const fileCache = this.app.metadataCache.getFileCache(file); + if (fileCache) { + const fileFrontmatter = fileCache.frontmatter; + if (fileFrontmatter && fileFrontmatter[property]) { + files.push(file); + } + } + }); + return files; + } + async runMetaEditForFolder(targetFolder) { + const pName = await GenericPrompt.Prompt(this.app, `Add a new property to all files in ${targetFolder.name} (and subfolders)`); + if (!pName) + return; + const pVal = await GenericPrompt.Prompt(this.app, "Enter a value"); + if (!pVal) + return; + const updateFilesInFolder = async (targetFolder, propertyName, propertyValue) => { + for (const child of targetFolder.children) { + if (child instanceof obsidian.TFile && child.extension == "md") + await this.controller.addYamlProp(pName, pVal, child); + if (child instanceof obsidian.TFolder) + await updateFilesInFolder(child); + } + }; + await updateFilesInFolder(targetFolder); + } +} + +module.exports = MetaEdit; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/metaedit/manifest.json b/.obsidian/plugins/metaedit/manifest.json new file mode 100644 index 0000000..a04a992 --- /dev/null +++ b/.obsidian/plugins/metaedit/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "metaedit", + "name": "MetaEdit", + "version": "1.8.2", + "minAppVersion": "1.4.1", + "description": "MetaEdit helps you manage your metadata.", + "author": "Christian B. B. Houmann", + "authorUrl": "https://bagerbach.com", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/metaedit/styles.css b/.obsidian/plugins/metaedit/styles.css new file mode 100644 index 0000000..75539c7 --- /dev/null +++ b/.obsidian/plugins/metaedit/styles.css @@ -0,0 +1,15 @@ +.centerSettingContent { + display: grid; + align-items: center; + justify-content: center; +} + +.not-a-button { + background: none; + color: inherit; + border: none; + padding: 0; + font: inherit; + cursor: pointer; + outline: inherit; +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-kanban/data.json b/.obsidian/plugins/obsidian-kanban/data.json index 7a153bd..d110415 100644 --- a/.obsidian/plugins/obsidian-kanban/data.json +++ b/.obsidian/plugins/obsidian-kanban/data.json @@ -1,3 +1,14 @@ { - "new-note-template": "templates/kanban_template.md" + "new-note-template": "templates/kanban_template.md", + "show-checkboxes": false, + "hide-card-count": true, + "link-date-to-daily-note": true, + "metadata-keys": [ + { + "metadataKey": "status", + "label": "status", + "shouldHideLabel": false, + "containsMarkdown": false + } + ] } \ No newline at end of file diff --git a/.obsidian/plugins/templater-obsidian/data.json b/.obsidian/plugins/templater-obsidian/data.json new file mode 100644 index 0000000..acd4a55 --- /dev/null +++ b/.obsidian/plugins/templater-obsidian/data.json @@ -0,0 +1,36 @@ +{ + "command_timeout": 5, + "templates_folder": "templates", + "templates_pairs": [ + [ + "", + "" + ] + ], + "trigger_on_file_creation": false, + "auto_jump_to_cursor": false, + "enable_system_commands": false, + "shell_path": "", + "user_scripts_folder": "", + "enable_folder_templates": true, + "folder_templates": [ + { + "folder": "", + "template": "" + } + ], + "enable_file_templates": false, + "file_templates": [ + { + "regex": ".*", + "template": "" + } + ], + "syntax_highlighting": true, + "syntax_highlighting_mobile": false, + "enabled_templates_hotkeys": [ + "" + ], + "startup_templates": [], + "intellisense_render": 1 +} \ No newline at end of file diff --git a/.obsidian/plugins/templater-obsidian/main.js b/.obsidian/plugins/templater-obsidian/main.js new file mode 100644 index 0000000..3f022ff --- /dev/null +++ b/.obsidian/plugins/templater-obsidian/main.js @@ -0,0 +1,29 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var Aa=Object.create;var Ln=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames;var ya=Object.getPrototypeOf,ja=Object.prototype.hasOwnProperty;var Yi=n=>Ln(n,"__esModule",{value:!0});var va=(n,e)=>{Yi(n);for(var t in e)Ln(n,t,{get:e[t],enumerable:!0})},wa=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of xa(e))!ja.call(n,r)&&r!=="default"&&Ln(n,r,{get:()=>e[r],enumerable:!(t=_a(e,r))||t.enumerable});return n},X=n=>wa(Yi(Ln(n!=null?Aa(ya(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var Ui=(()=>{for(var n=new Uint8Array(128),e=0;e<64;e++)n[e<26?e+65:e<52?e+71:e<62?e-4:e*4-205]=e;return t=>{for(var r=t.length,i=new Uint8Array((r-(t[r-1]=="=")-(t[r-2]=="="))*3/4|0),o=0,a=0;o>4,i[a++]=c<<4|d>>2,i[a++]=d<<6|m}return i}})();va(exports,{default:()=>Oi});var jr=X(require("obsidian"));var L=X(require("obsidian"));var Gi=X(require("obsidian"));function oe(n){let e=new Gi.Notice("",8e3);n instanceof O&&n.console_msg?(e.noticeEl.innerHTML=`Templater Error:
${n.message}
Check console for more information`,console.error("Templater Error:",n.message,` +`,n.console_msg)):e.noticeEl.innerHTML=`Templater Error:
${n.message}`}var O=class extends Error{constructor(e,t){super(e);this.console_msg=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}};async function Te(n,e){try{return await n()}catch(t){return t instanceof O?oe(t):oe(new O(e,t.message)),null}}function ke(n,e){try{return n()}catch(t){return oe(new O(e,t.message)),null}}var re=function(){function n(){}return n.explainIfInvalidTSDocTagName=function(e){if(e[0]!=="@")return'A TSDoc tag name must start with an "@" symbol';if(!n._tsdocTagNameRegExp.test(e))return"A TSDoc tag name must start with a letter and contain only letters and numbers"},n.validateTSDocTagName=function(e){var t=n.explainIfInvalidTSDocTagName(e);if(t)throw new Error(t)},n.explainIfInvalidLinkUrl=function(e){if(e.length===0)return"The URL cannot be empty";if(!n._urlSchemeRegExp.test(e))return'An @link URL must begin with a scheme comprised only of letters and numbers followed by "://". (For general URLs, use an HTML "" tag instead.)';if(!n._urlSchemeAfterRegExp.test(e))return'An @link URL must have at least one character after "://"'},n.explainIfInvalidHtmlName=function(e){if(!n._htmlNameRegExp.test(e))return"An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens"},n.validateHtmlName=function(e){var t=n.explainIfInvalidHtmlName(e);if(t)throw new Error(t)},n.explainIfInvalidPackageName=function(e){if(e.length===0)return"The package name cannot be an empty string";if(!n._validPackageNameRegExp.test(e))return"The package name ".concat(JSON.stringify(e)," is not a valid package name")},n.explainIfInvalidImportPath=function(e,t){if(e.length>0){if(e.indexOf("//")>=0)return'An import path must not contain "//"';if(e[e.length-1]==="/")return'An import path must not end with "/"';if(!t&&e[0]==="/")return'An import path must not start with "/" unless prefixed by a package name'}},n.isSystemSelector=function(e){return n._systemSelectors.has(e)},n.explainIfInvalidUnquotedIdentifier=function(e){if(e.length===0)return"The identifier cannot be an empty string";if(n._identifierBadCharRegExp.test(e))return"The identifier cannot non-word characters";if(n._identifierNumberStartRegExp.test(e))return"The identifier must not start with a number"},n.explainIfInvalidUnquotedMemberIdentifier=function(e){var t=n.explainIfInvalidUnquotedIdentifier(e);if(t!==void 0)return t;if(n.isSystemSelector(e))return'The identifier "'.concat(e,'" must be quoted because it is a TSDoc system selector name')},n._tsdocTagNameRegExp=/^@[a-z][a-z0-9]*$/i,n._urlSchemeRegExp=/^[a-z][a-z0-9]*\:\/\//i,n._urlSchemeAfterRegExp=/^[a-z][a-z0-9]*\:\/\/./i,n._htmlNameRegExp=/^[a-z]+[a-z0-9\-]*$/i,n._identifierBadCharRegExp=/[^a-z0-9_$]/i,n._identifierNumberStartRegExp=/^[0-9]/,n._validPackageNameRegExp=/^(?:@[a-z0-9\-_\.]+\/)?[a-z0-9\-_\.]+$/i,n._systemSelectors=new Set(["instance","static","constructor","class","enum","function","interface","namespace","type","variable"]),n}();var kr=function(){function n(){this._docNodeDefinitionsByKind=new Map,this._docNodeDefinitionsByConstructor=new Map}return n.prototype.registerDocNodes=function(e,t){var r=re.explainIfInvalidPackageName(e);if(r)throw new Error("Invalid NPM package name: "+r);for(var i=0,o=t;i0&&i.appendNodes(r),i}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this._nodes},enumerable:!1,configurable:!0}),e.prototype.appendNode=function(t){if(!this.configuration.docNodeManager.isAllowedChild(this.kind,t.kind))throw new Error("The TSDocConfiguration does not allow a ".concat(this.kind," node to")+" contain a node of type ".concat(t.kind));this._nodes.push(t)},e.prototype.appendNodes=function(t){for(var r=0,i=t;r0){var i=this.nodes[this.nodes.length-1];i.kind===g.Paragraph&&(r=i)}r||(r=new at({configuration:this.configuration}),this.appendNode(r)),r.appendNode(t)},e.prototype.appendNodesInParagraph=function(t){for(var r=0,i=t;r1){var e=this._chunks.join("");this._chunks.length=1,this._chunks[0]=e}return this._chunks[0]},n}();var zi=function(){function n(){}return n.transform=function(e){for(var t=[],r=!1,i=[],o=[],a=!1,l=0,c=e.nodes;l0&&(r&&(i.push(" "),r=!1),i.push(P),o.push(d),a=!0),E&&a&&(r=!0);break;case g.SoftBreak:a&&(r=!0),o.push(d);break;default:r&&(i.push(" "),r=!1),i.length>0&&(t.push(new Ge({configuration:e.configuration,text:i.join("")})),i.length=0,o.length=0),t.push(d),a=!0}}i.length>0&&(t.push(new Ge({configuration:e.configuration,text:i.join("")})),i.length=0,o.length=0);var k=new at({configuration:e.configuration});return k.appendNodes(t),k},n}();var Or=function(){function n(){}return n.trimSpacesInParagraph=function(e){return zi.transform(e)},n}();var Mr=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r0&&(this._ensureLineSkipped(),this._renderNodes(a.modifierTagSet.nodes));break;case g.DeclarationReference:var l=e;this._writeContent(l.packageName),this._writeContent(l.importPath),(l.packageName!==void 0||l.importPath!==void 0)&&this._writeContent("#"),this._renderNodes(l.memberReferences);break;case g.ErrorText:var c=e;this._writeContent(c.text);break;case g.EscapedText:var d=e;this._writeContent(d.encodedText);break;case g.FencedCode:var m=e;this._ensureAtStartOfLine(),this._writeContent("```"),this._writeContent(m.language),this._writeNewline(),this._writeContent(m.code),this._writeContent("```"),this._writeNewline(),this._writeNewline();break;case g.HtmlAttribute:var y=e;this._writeContent(y.name),this._writeContent(y.spacingAfterName),this._writeContent("="),this._writeContent(y.spacingAfterEquals),this._writeContent(y.value),this._writeContent(y.spacingAfterValue);break;case g.HtmlEndTag:var b=e;this._writeContent("");break;case g.HtmlStartTag:var E=e;this._writeContent("<"),this._writeContent(E.name),this._writeContent(E.spacingAfterName);for(var P=E.spacingAfterName===void 0||E.spacingAfterName.length===0,k=0,w=E.htmlAttributes;k":">");break;case g.InheritDocTag:var $=e;this._renderInlineTag($,function(){$.declarationReference&&(t._writeContent(" "),t._renderNode($.declarationReference))});break;case g.InlineTag:var K=e;this._renderInlineTag(K,function(){K.tagContent.length>0&&(t._writeContent(" "),t._writeContent(K.tagContent))});break;case g.LinkTag:var C=e;this._renderInlineTag(C,function(){(C.urlDestination!==void 0||C.codeDestination!==void 0)&&(C.urlDestination!==void 0?(t._writeContent(" "),t._writeContent(C.urlDestination)):C.codeDestination!==void 0&&(t._writeContent(" "),t._renderNode(C.codeDestination))),C.linkText!==void 0&&(t._writeContent(" "),t._writeContent("|"),t._writeContent(" "),t._writeContent(C.linkText))});break;case g.MemberIdentifier:var H=e;H.hasQuotes?(this._writeContent('"'),this._writeContent(H.identifier),this._writeContent('"')):this._writeContent(H.identifier);break;case g.MemberReference:var I=e;I.hasDot&&this._writeContent("."),I.selector&&this._writeContent("("),I.memberSymbol?this._renderNode(I.memberSymbol):this._renderNode(I.memberIdentifier),I.selector&&(this._writeContent(":"),this._renderNode(I.selector),this._writeContent(")"));break;case g.MemberSelector:var J=e;this._writeContent(J.selector);break;case g.MemberSymbol:var te=e;this._writeContent("["),this._renderNode(te.symbolReference),this._writeContent("]");break;case g.Section:var ne=e;this._renderNodes(ne.nodes);break;case g.Paragraph:var Q=Or.trimSpacesInParagraph(e);Q.nodes.length>0&&(this._hangingParagraph?this._hangingParagraph=!1:this._ensureLineSkipped(),this._renderNodes(Q.nodes),this._writeNewline());break;case g.ParamBlock:var h=e;this._ensureLineSkipped(),this._renderNode(h.blockTag),this._writeContent(" "),this._writeContent(h.parameterName),this._writeContent(" - "),this._hangingParagraph=!0,this._renderNode(h.content),this._hangingParagraph=!1;break;case g.ParamCollection:var S=e;this._renderNodes(S.blocks);break;case g.PlainText:var f=e;this._writeContent(f.text);break}},n.prototype._renderInlineTag=function(e,t){this._writeContent("{"),this._writeContent(e.tagName),t(),this._writeContent("}")},n.prototype._renderNodes=function(e){for(var t=0,r=e;t1){for(var r=!0,i=0,o=t;i0?this.params:void 0,this.typeParams.count>0?this.typeParams:void 0,this.returnsBlock],this.customBlocks,!0),this.seeBlocks,!0),[this.inheritDocTag],!1),this.modifierTagSet.nodes,!0)},e.prototype.emitAsTsdoc=function(){var t=new st,r=new ct;return r.renderComment(t,this),t.toString()},e}(T);var Ma=function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ba=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r=t},n._scanTextContent=function(e,t,r){for(var i=0,o=e;i=t||(r+=n._scanTextContent(a.getChildNodes(),t,r),r>=t))break}return r},n._countNonSpaceCharacters=function(e){for(var t=0,r=e.length,i=0;ithis.buffer.length)return{line:0,column:0};for(var t=1,r=1,i=0;ithis.buffer.length)throw new Error("TextRange.pos cannot exceed the associated text buffer length");if(this.end>this.buffer.length)throw new Error("TextRange.end cannot exceed the associated text buffer length")},n.empty=new n("",0,0),n}();var mn=function(){function n(e){this.messageId=e.messageId,this.unformattedText=e.messageText,this.textRange=e.textRange,this.tokenSequence=e.tokenSequence,this.docNode=e.docNode,this._text=void 0}return n._formatMessageText=function(e,t){if(e||(e="An unknown error occurred"),t.pos!==0||t.end!==0){var r=t.getLocation(t.pos);if(r.line)return"(".concat(r.line,",").concat(r.column,"): ")+e}return e},Object.defineProperty(n.prototype,"text",{get:function(){return this._text===void 0&&(this._text=n._formatMessageText(this.unformattedText,this.textRange)),this._text},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return this.text},n}();var Br=function(){function n(){this._messages=[]}return Object.defineProperty(n.prototype,"messages",{get:function(){return this._messages},enumerable:!1,configurable:!0}),n.prototype.addMessage=function(e){this._messages.push(e)},n.prototype.addMessageForTextRange=function(e,t,r){this.addMessage(new mn({messageId:e,messageText:t,textRange:r}))},n.prototype.addMessageForTokenSequence=function(e,t,r,i){this.addMessage(new mn({messageId:e,messageText:t,textRange:r.getContainingTextRange(),tokenSequence:r,docNode:i}))},n.prototype.addMessageForDocErrorText=function(e){var t;e.textExcerpt?t=e.textExcerpt:t=e.errorLocation,this.addMessage(new mn({messageId:e.messageId,messageText:e.errorMessage,textRange:t.getContainingTextRange(),tokenSequence:t,docNode:e}))},n}();var Fr=function(){function n(e,t){this.commentRange=We.empty,this.lines=[],this.tokens=[],this.configuration=e,this.sourceRange=t,this.docComment=new Kn({configuration:this.configuration}),this.log=new Br}return n}();var xt=function(){function n(e){this.parserContext=e.parserContext,this._startIndex=e.startIndex,this._endIndex=e.endIndex,this._validateBounds()}return n.createEmpty=function(e){return new n({parserContext:e,startIndex:0,endIndex:0})},Object.defineProperty(n.prototype,"startIndex",{get:function(){return this._startIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"endIndex",{get:function(){return this._endIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tokens",{get:function(){return this.parserContext.tokens.slice(this._startIndex,this._endIndex)},enumerable:!1,configurable:!0}),n.prototype.getNewSequence=function(e,t){return new n({parserContext:this.parserContext,startIndex:e,endIndex:t})},n.prototype.getContainingTextRange=function(){return this.isEmpty()?We.empty:this.parserContext.sourceRange.getNewRange(this.parserContext.tokens[this._startIndex].range.pos,this.parserContext.tokens[this._endIndex-1].range.end)},n.prototype.isEmpty=function(){return this._startIndex===this._endIndex},n.prototype.toString=function(){return this.tokens.map(function(e){return e.toString()}).join("")},n.prototype._validateBounds=function(){if(this.startIndex<0)throw new Error("TokenSequence.startIndex cannot be negative");if(this.endIndex<0)throw new Error("TokenSequence.endIndex cannot be negative");if(this.endIndexthis.parserContext.tokens.length)throw new Error("TokenSequence.startIndex cannot exceed the associated token array");if(this.endIndex>this.parserContext.tokens.length)throw new Error("TokenSequence.endIndex cannot exceed the associated token array")},n}();var pe;(function(n){n[n.BeginComment1=0]="BeginComment1",n[n.BeginComment2=1]="BeginComment2",n[n.CollectingFirstLine=2]="CollectingFirstLine",n[n.CollectingLine=3]="CollectingLine",n[n.AdvancingLine=4]="AdvancingLine",n[n.Done=5]="Done"})(pe||(pe={}));var Xi=function(){function n(){}return n.extract=function(e){for(var t=e.sourceRange,r=t.buffer,i=0,o=0,a=0,l=0,c=t.pos,d=pe.BeginComment1,m=[];d!==pe.Done;){if(c>=t.end)switch(d){case pe.BeginComment1:case pe.BeginComment2:return e.log.addMessageForTextRange(v.CommentNotFound,'Expecting a "/**" comment',t),!1;default:return e.log.addMessageForTextRange(v.CommentMissingClosingDelimiter,"Unexpected end of input",t),!1}var y=r[c],b=c;++c;var E=ca)&&m.push(t.getNewRange(a,l)),a=c,l=c,d=pe.AdvancingLine):y==="*"&&E==="/"?(l>a&&m.push(t.getNewRange(a,l)),a=0,l=0,++c,o=c,d=pe.Done):n._whitespaceCharacterRegExp.test(y)||(l=c);break;case pe.AdvancingLine:y==="*"?E==="/"?(a=0,l=0,++c,o=c,d=pe.Done):(E===" "&&++c,a=c,l=c,d=pe.CollectingLine):y===` +`?(m.push(t.getNewRange(b,b)),a=c):n._whitespaceCharacterRegExp.test(y)||(l=c,d=pe.CollectingLine);break}}return e.commentRange=t.getNewRange(i,o),e.lines=m,!0},n._whitespaceCharacterRegExp=/^\s$/,n}();var gn=function(){function n(){}return n.readTokens=function(e){n._ensureInitialized();for(var t=[],r=void 0,i=0,o=e;i":u.GreaterThan,"=":u.Equals,"'":u.SingleQuote,'"':u.DoubleQuote,"/":u.Slash,"-":u.Hyphen,"@":u.AtSign,"{":u.LeftCurlyBracket,"}":u.RightCurlyBracket,"`":u.Backtick,".":u.Period,":":u.Colon,",":u.Comma,"[":u.LeftSquareBracket,"]":u.RightSquareBracket,"|":u.Pipe,"(":u.LeftParenthesis,")":u.RightParenthesis,"#":u.PoundSymbol,"+":u.Plus,$:u.DollarSign},o=0,a=Object.getOwnPropertyNames(i);o?@[\\]^`{|}~",n._wordCharacters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_",n}();var Ir=function(){function n(e,t){if(this._parserContext=e,this.tokens=e.tokens,t){if(t.parserContext!==this._parserContext)throw new Error("The embeddedTokenSequence must use the same parser context");this._readerStartIndex=t.startIndex,this._readerEndIndex=t.endIndex}else this._readerStartIndex=0,this._readerEndIndex=this.tokens.length;this._currentIndex=this._readerStartIndex,this._accumulatedStartIndex=this._readerStartIndex}return n.prototype.extractAccumulatedSequence=function(){if(this._accumulatedStartIndex===this._currentIndex)throw new Error("Parser assertion failed: The queue should not be empty when extractAccumulatedSequence() is called");var e=new xt({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex});return this._accumulatedStartIndex=this._currentIndex,e},n.prototype.isAccumulatedSequenceEmpty=function(){return this._accumulatedStartIndex===this._currentIndex},n.prototype.tryExtractAccumulatedSequence=function(){if(!this.isAccumulatedSequenceEmpty())return this.extractAccumulatedSequence()},n.prototype.assertAccumulatedSequenceIsEmpty=function(){if(!this.isAccumulatedSequenceEmpty()){var e=new xt({parserContext:this._parserContext,startIndex:this._accumulatedStartIndex,endIndex:this._currentIndex}),t=e.tokens.map(function(r){return r.toString()});throw new Error(`Parser assertion failed: The queue should be empty, but it contains: +`+JSON.stringify(t))}},n.prototype.peekToken=function(){return this.tokens[this._currentIndex]},n.prototype.peekTokenKind=function(){return this._currentIndex>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex].kind},n.prototype.peekTokenAfterKind=function(){return this._currentIndex+1>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex+1].kind},n.prototype.peekTokenAfterAfterKind=function(){return this._currentIndex+2>=this._readerEndIndex?u.EndOfInput:this.tokens[this._currentIndex+2].kind},n.prototype.readToken=function(){if(this._currentIndex>=this._readerEndIndex)throw new Error("Cannot read past end of stream");var e=this.tokens[this._currentIndex];if(e.kind===u.EndOfInput)throw new Error("The EndOfInput token cannot be read");return this._currentIndex++,e},n.prototype.peekPreviousTokenKind=function(){return this._currentIndex===0?u.EndOfInput:this.tokens[this._currentIndex-1].kind},n.prototype.createMarker=function(){return this._currentIndex},n.prototype.backtrackToMarker=function(e){if(e>this._currentIndex)throw new Error("The marker has expired");this._currentIndex=e,e" character should be escaped using a backslash to avoid confusion with an HTML tag'));break;case u.Backtick:this._pushAccumulatedPlainText(e),e.peekTokenAfterKind()===u.Backtick&&e.peekTokenAfterAfterKind()===u.Backtick?this._pushNode(this._parseFencedCode(e)):this._pushNode(this._parseCodeSpan(e));break;default:e.readToken();break}this._pushAccumulatedPlainText(e),this._performValidationChecks()},n.prototype._performValidationChecks=function(){var e=this._parserContext.docComment;e.deprecatedBlock&&(ir.hasAnyTextContent(e.deprecatedBlock)||this._parserContext.log.addMessageForTokenSequence(v.MissingDeprecationMessage,"The ".concat(e.deprecatedBlock.blockTag.tagName," block must include a deprecation message,")+" e.g. describing the recommended alternative",e.deprecatedBlock.blockTag.getTokenSequence(),e.deprecatedBlock)),e.inheritDocTag&&(e.remarksBlock&&this._parserContext.log.addMessageForTokenSequence(v.InheritDocIncompatibleTag,'A "'.concat(e.remarksBlock.blockTag.tagName,'" block must not be used, because that')+" content is provided by the @inheritDoc tag",e.remarksBlock.blockTag.getTokenSequence(),e.remarksBlock.blockTag),ir.hasAnyTextContent(e.summarySection)&&this._parserContext.log.addMessageForTextRange(v.InheritDocIncompatibleSummary,"The summary section must not have any content, because that content is provided by the @inheritDoc tag",this._parserContext.commentRange))},n.prototype._validateTagDefinition=function(e,t,r,i,o){if(e){var a=e.syntaxKind===R.InlineTag;a!==r?r?this._parserContext.log.addMessageForTokenSequence(v.TagShouldNotHaveBraces,'The TSDoc tag "'.concat(t,'" is not an inline tag; it must not be enclosed in "{ }" braces'),i,o):this._parserContext.log.addMessageForTokenSequence(v.InlineTagMissingBraces,'The TSDoc tag "'.concat(t,'" is an inline tag; it must be enclosed in "{ }" braces'),i,o):this._parserContext.configuration.validation.reportUnsupportedTags&&(this._parserContext.configuration.isTagSupported(e)||this._parserContext.log.addMessageForTokenSequence(v.UnsupportedTag,'The TSDoc tag "'.concat(t,'" is not supported by this tool'),i,o))}else this._parserContext.configuration.validation.ignoreUndefinedTags||this._parserContext.log.addMessageForTokenSequence(v.UndefinedTag,'The TSDoc tag "'.concat(t,'" is not defined in this configuration'),i,o)},n.prototype._pushAccumulatedPlainText=function(e){e.isAccumulatedSequenceEmpty()||this._pushNode(new Ge({parsed:!0,configuration:this._configuration,textExcerpt:e.extractAccumulatedSequence()}))},n.prototype._parseAndPushBlock=function(e){var t=this._parserContext.docComment,r=this._parserContext.configuration,i=t.modifierTagSet,o=this._parseBlockTag(e);if(o.kind!==g.BlockTag){this._pushNode(o);return}var a=o,l=r.tryGetTagDefinitionWithUpperCase(a.tagNameWithUpperCase);if(this._validateTagDefinition(l,a.tagName,!1,a.getTokenSequence(),a),l)switch(l.syntaxKind){case R.BlockTag:if(a.tagNameWithUpperCase===G.param.tagNameWithUpperCase){var c=this._parseParamBlock(e,a,G.param.tagName);this._parserContext.docComment.params.add(c),this._currentSection=c.content;return}else if(a.tagNameWithUpperCase===G.typeParam.tagNameWithUpperCase){var c=this._parseParamBlock(e,a,G.typeParam.tagName);this._parserContext.docComment.typeParams.add(c),this._currentSection=c.content;return}else{var d=new Gt({configuration:this._configuration,blockTag:a});this._addBlockToDocComment(d),this._currentSection=d.content}return;case R.ModifierTag:i.addTag(a);return}this._pushNode(a)},n.prototype._addBlockToDocComment=function(e){var t=this._parserContext.docComment;switch(e.blockTag.tagNameWithUpperCase){case G.remarks.tagNameWithUpperCase:t.remarksBlock=e;break;case G.privateRemarks.tagNameWithUpperCase:t.privateRemarks=e;break;case G.deprecated.tagNameWithUpperCase:t.deprecatedBlock=e;break;case G.returns.tagNameWithUpperCase:t.returnsBlock=e;break;case G.see.tagNameWithUpperCase:t._appendSeeBlock(e);break;default:t.appendCustomBlock(e)}},n.prototype._tryParseJSDocTypeOrValueRest=function(e,t,r,i){for(var o,a=1;a>0;){var l=e.peekTokenKind();switch(l){case t:o===void 0&&a++;break;case r:o===void 0&&a--;break;case u.Backslash:o!==void 0&&(e.readToken(),l=e.peekTokenKind());break;case u.DoubleQuote:case u.SingleQuote:case u.Backtick:o===l?o=void 0:o===void 0&&(o=l);break}if(l===u.EndOfInput){e.backtrackToMarker(i);return}e.readToken()}return e.tryExtractAccumulatedSequence()},n.prototype._tryParseUnsupportedJSDocType=function(e,t,r){if(e.assertAccumulatedSequenceIsEmpty(),!(e.peekTokenKind()!==u.LeftCurlyBracket||e.peekTokenAfterKind()===u.AtSign)){var i=e.createMarker();e.readToken();var o=this._tryParseJSDocTypeOrValueRest(e,u.LeftCurlyBracket,u.RightCurlyBracket,i);if(o){this._parserContext.log.addMessageForTokenSequence(v.ParamTagWithInvalidType,"The "+r+" block should not include a JSDoc-style '{type}'",o,t);var a=this._tryReadSpacingAndNewlines(e);a&&(o=o.getNewSequence(o.startIndex,a.endIndex))}return o}},n.prototype._tryParseJSDocOptionalNameRest=function(e){if(e.assertAccumulatedSequenceIsEmpty(),e.peekTokenKind()!==u.EndOfInput){var t=e.createMarker();return this._tryParseJSDocTypeOrValueRest(e,u.LeftSquareBracket,u.RightSquareBracket,t)}},n.prototype._parseParamBlock=function(e,t,r){var i=e.createMarker(),o=this._tryReadSpacingAndNewlines(e),a=this._tryParseUnsupportedJSDocType(e,t,r),l;e.peekTokenKind()===u.LeftSquareBracket&&(e.readToken(),l=e.extractAccumulatedSequence());for(var c="",d=!1;!d;)switch(e.peekTokenKind()){case u.AsciiWord:case u.Period:case u.DollarSign:c+=e.readToken();break;default:d=!0;break}var m=re.explainIfInvalidUnquotedIdentifier(c);if(m!==void 0){e.backtrackToMarker(i);var y=new dn({configuration:this._configuration,blockTag:t,parameterName:""}),b=c.length>0?"The "+r+" block should be followed by a valid parameter name: "+m:"The "+r+" block should be followed by a parameter name";return this._parserContext.log.addMessageForTokenSequence(v.ParamTagWithInvalidName,b,t.getTokenSequence(),t),y}var E=e.extractAccumulatedSequence(),P;if(l){P=this._tryParseJSDocOptionalNameRest(e);var k=l;P&&(k=t.getTokenSequence().getNewSequence(l.startIndex,P.endIndex)),this._parserContext.log.addMessageForTokenSequence(v.ParamTagWithInvalidOptionalName,"The "+r+" should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.",k,t)}var w=this._tryReadSpacingAndNewlines(e),M=this._tryParseUnsupportedJSDocType(e,t,r),$,K,C;return e.peekTokenKind()===u.Hyphen?(e.readToken(),$=e.extractAccumulatedSequence(),K=this._tryReadSpacingAndNewlines(e),C=this._tryParseUnsupportedJSDocType(e,t,r)):this._parserContext.log.addMessageForTokenSequence(v.ParamTagMissingHyphen,"The "+r+" block should be followed by a parameter name and then a hyphen",t.getTokenSequence(),t),new dn({parsed:!0,configuration:this._configuration,blockTag:t,spacingBeforeParameterNameExcerpt:o,unsupportedJsdocTypeBeforeParameterNameExcerpt:a,unsupportedJsdocOptionalNameOpenBracketExcerpt:l,parameterNameExcerpt:E,parameterName:c,unsupportedJsdocOptionalNameRestExcerpt:P,spacingAfterParameterNameExcerpt:w,unsupportedJsdocTypeAfterParameterNameExcerpt:M,hyphenExcerpt:$,spacingAfterHyphenExcerpt:K,unsupportedJsdocTypeAfterHyphenExcerpt:C})},n.prototype._pushNode=function(e){this._configuration.docNodeManager.isAllowedChild(g.Paragraph,e.kind)?this._currentSection.appendNodeInParagraph(e):this._currentSection.appendNode(e)},n.prototype._parseBackslashEscape=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker();if(e.readToken(),e.peekTokenKind()===u.EndOfInput)return this._backtrackAndCreateError(e,t,v.UnnecessaryBackslash,"A backslash must precede another character that is being escaped");var r=e.readToken();if(!gn.isPunctuation(r.kind))return this._backtrackAndCreateError(e,t,v.UnnecessaryBackslash,"A backslash can only be used to escape a punctuation character");var i=e.extractAccumulatedSequence();return new Yn({parsed:!0,configuration:this._configuration,escapeStyle:rr.CommonMarkBackslash,encodedTextExcerpt:i,decodedText:r.toString()})},n.prototype._parseBlockTag=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker();if(e.peekTokenKind()!==u.AtSign)return this._backtrackAndCreateError(e,t,v.MissingTag,'Expecting a TSDoc tag starting with "@"');switch(e.peekPreviousTokenKind()){case u.EndOfInput:case u.Spacing:case u.Newline:break;default:return this._backtrackAndCreateError(e,t,v.AtSignInWord,'The "@" character looks like part of a TSDoc tag; use a backslash to escape it')}var r=e.readToken().toString();if(e.peekTokenKind()!==u.AsciiWord)return this._backtrackAndCreateError(e,t,v.AtSignWithoutTagName,'Expecting a TSDoc tag name after "@"; if it is not a tag, use a backslash to escape this character');for(var i=e.createMarker();e.peekTokenKind()===u.AsciiWord;)r+=e.readToken().toString();switch(e.peekTokenKind()){case u.Spacing:case u.Newline:case u.EndOfInput:break;default:var o=e.peekToken().range.toString()[0];return this._backtrackAndCreateError(e,t,v.CharactersAfterBlockTag,'The token "'.concat(r,'" looks like a TSDoc tag but contains an invalid character')+" ".concat(JSON.stringify(o),'; if it is not a tag, use a backslash to escape the "@"'))}if(re.explainIfInvalidTSDocTagName(r)){var a=this._createFailureForTokensSince(e,v.MalformedTagName,"A TSDoc tag name must start with a letter and contain only letters and numbers",i);return this._backtrackAndCreateErrorForFailure(e,t,"",a)}return new Hn({parsed:!0,configuration:this._configuration,tagName:r,tagNameExcerpt:e.extractAccumulatedSequence()})},n.prototype._parseInlineTag=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker();if(e.peekTokenKind()!==u.LeftCurlyBracket)return this._backtrackAndCreateError(e,t,v.MissingTag,'Expecting a TSDoc tag starting with "{"');e.readToken();var r=e.extractAccumulatedSequence(),i=e.createMarker();if(e.peekTokenKind()!==u.AtSign)return this._backtrackAndCreateError(e,t,v.MalformedInlineTag,'Expecting a TSDoc tag starting with "{@"');for(var o=e.readToken().toString();e.peekTokenKind()===u.AsciiWord;)o+=e.readToken().toString();if(o==="@"){var a=this._createFailureForTokensSince(e,v.MalformedInlineTag,'Expecting a TSDoc inline tag name after the "{@" characters',i);return this._backtrackAndCreateErrorRangeForFailure(e,t,i,"",a)}if(re.explainIfInvalidTSDocTagName(o)){var a=this._createFailureForTokensSince(e,v.MalformedTagName,"A TSDoc tag name must start with a letter and contain only letters and numbers",i);return this._backtrackAndCreateErrorRangeForFailure(e,t,i,"",a)}var l=e.extractAccumulatedSequence(),c=this._tryReadSpacingAndNewlines(e);if(c===void 0&&e.peekTokenKind()!==u.RightCurlyBracket){var d=e.peekToken().range.toString()[0],a=this._createFailureForToken(e,v.CharactersAfterInlineTag,"The character ".concat(JSON.stringify(d)," cannot appear after the TSDoc tag name; expecting a space"));return this._backtrackAndCreateErrorRangeForFailure(e,t,i,"",a)}for(var m=!1;!m;)switch(e.peekTokenKind()){case u.EndOfInput:return this._backtrackAndCreateErrorRange(e,t,i,v.InlineTagMissingRightBrace,'The TSDoc inline tag name is missing its closing "}"');case u.Backslash:if(e.readToken(),!gn.isPunctuation(e.peekTokenKind())){var a=this._createFailureForToken(e,v.UnnecessaryBackslash,"A backslash can only be used to escape a punctuation character");return this._backtrackAndCreateErrorRangeForFailure(e,t,i,"Error reading inline TSDoc tag: ",a)}e.readToken();break;case u.LeftCurlyBracket:{var a=this._createFailureForToken(e,v.InlineTagUnescapedBrace,'The "{" character must be escaped with a backslash when used inside a TSDoc inline tag');return this._backtrackAndCreateErrorRangeForFailure(e,t,i,"",a)}case u.RightCurlyBracket:m=!0;break;default:e.readToken();break}var y=e.tryExtractAccumulatedSequence();e.readToken();var b=e.extractAccumulatedSequence(),E={parsed:!0,configuration:this._configuration,openingDelimiterExcerpt:r,tagNameExcerpt:l,tagName:o,spacingAfterTagNameExcerpt:c,tagContentExcerpt:y,closingDelimiterExcerpt:b},P=o.toUpperCase(),k=new Ir(this._parserContext,y||xt.createEmpty(this._parserContext)),w;switch(P){case G.inheritDoc.tagNameWithUpperCase:w=this._parseInheritDocTag(E,k);break;case G.link.tagNameWithUpperCase:w=this._parseLinkTag(E,k);break;default:w=new Wt(E)}var M=this._parserContext.configuration.tryGetTagDefinitionWithUpperCase(P);return this._validateTagDefinition(M,o,!0,l,w),w},n.prototype._parseInheritDocTag=function(e,t){var r=new Wt(e),i=or({},e);if(t.peekTokenKind()!==u.EndOfInput){if(i.declarationReference=this._parseDeclarationReference(t,e.tagNameExcerpt,r),!i.declarationReference)return r;if(t.peekTokenKind()!==u.EndOfInput)return t.readToken(),this._parserContext.log.addMessageForTokenSequence(v.InheritDocTagSyntax,"Unexpected character after declaration reference",t.extractAccumulatedSequence(),r),r}return new un(i)},n.prototype._parseLinkTag=function(e,t){var r=new Wt(e),i=or({},e);if(!e.tagContentExcerpt)return this._parserContext.log.addMessageForTokenSequence(v.LinkTagEmpty,"The @link tag content is missing",i.tagNameExcerpt,r),r;for(var o=t.peekTokenKind()===u.Slash&&t.peekTokenAfterKind()===u.Slash,a=t.createMarker(),l=o;!l;)switch(t.peekTokenKind()){case u.AsciiWord:case u.Period:case u.Hyphen:case u.Plus:t.readToken();break;case u.Colon:t.readToken(),o=t.peekTokenKind()===u.Slash&&t.peekTokenAfterKind()===u.Slash,l=!0;break;default:l=!0}if(t.backtrackToMarker(a),o){if(!this._parseLinkTagUrlDestination(t,i,e.tagNameExcerpt,r))return r}else if(!this._parseLinkTagCodeDestination(t,i,e.tagNameExcerpt,r))return r;if(t.peekTokenKind()===u.Spacing)throw new Error("Unconsumed spacing encountered after construct");if(t.peekTokenKind()===u.Pipe){t.readToken(),i.pipeExcerpt=t.extractAccumulatedSequence(),i.spacingAfterPipeExcerpt=this._tryReadSpacingAndNewlines(t),l=!1;for(var c=void 0;!l;)switch(t.peekTokenKind()){case u.EndOfInput:l=!0;break;case u.Pipe:case u.LeftCurlyBracket:var d=t.readToken().toString();return this._parserContext.log.addMessageForTokenSequence(v.LinkTagUnescapedText,'The "'.concat(d,'" character may not be used in the link text without escaping it'),t.extractAccumulatedSequence(),r),r;case u.Spacing:case u.Newline:t.readToken();break;default:c=t.createMarker()+1,t.readToken()}var m=t.tryExtractAccumulatedSequence();m&&(c===void 0?i.spacingAfterLinkTextExcerpt=m:c>=m.endIndex?i.linkTextExcerpt=m:(i.linkTextExcerpt=m.getNewSequence(m.startIndex,c),i.spacingAfterLinkTextExcerpt=m.getNewSequence(c,m.endIndex)))}else if(t.peekTokenKind()!==u.EndOfInput)return t.readToken(),this._parserContext.log.addMessageForTokenSequence(v.LinkTagDestinationSyntax,"Unexpected character after link destination",t.extractAccumulatedSequence(),r),r;return new zn(i)},n.prototype._parseLinkTagUrlDestination=function(e,t,r,i){for(var o="",a=!1;!a;)switch(e.peekTokenKind()){case u.Spacing:case u.Newline:case u.EndOfInput:case u.Pipe:case u.RightCurlyBracket:a=!0;break;default:o+=e.readToken();break}if(o.length===0)throw new Error("Missing URL in _parseLinkTagUrlDestination()");var l=e.extractAccumulatedSequence(),c=re.explainIfInvalidLinkUrl(o);return c?(this._parserContext.log.addMessageForTokenSequence(v.LinkTagInvalidUrl,c,l,i),!1):(t.urlDestinationExcerpt=l,t.spacingAfterDestinationExcerpt=this._tryReadSpacingAndNewlines(e),!0)},n.prototype._parseLinkTagCodeDestination=function(e,t,r,i){return t.codeDestination=this._parseDeclarationReference(e,r,i),!!t.codeDestination},n.prototype._parseDeclarationReference=function(e,t,r){e.assertAccumulatedSequenceIsEmpty();for(var i=e.createMarker(),o=!1,a=!0,l=!1,c=!1;!c;)switch(e.peekTokenKind()){case u.DoubleQuote:case u.EndOfInput:case u.LeftCurlyBracket:case u.LeftParenthesis:case u.LeftSquareBracket:case u.Newline:case u.Pipe:case u.RightCurlyBracket:case u.RightParenthesis:case u.RightSquareBracket:case u.SingleQuote:case u.Spacing:c=!0;break;case u.PoundSymbol:o=!0,c=!0;break;case u.Slash:case u.AtSign:a&&(l=!0),e.readToken();break;case u.AsciiWord:case u.Period:case u.Hyphen:e.readToken();break;default:a=!1,e.readToken()}if(!o&&l){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingHash,'The declaration reference appears to contain a package name or import path, but it is missing the "#" delimiter',e.extractAccumulatedSequence(),r);return}e.backtrackToMarker(i);var d,m,y,b;if(o){if(e.peekTokenKind()!==u.Period){var E=e.peekTokenKind()===u.AtSign,P=!1;for(c=!1;!c;)switch(e.peekTokenKind()){case u.EndOfInput:throw new Error("Expecting pound symbol");case u.Slash:E&&!P?(e.readToken(),P=!0):c=!0;break;case u.PoundSymbol:c=!0;break;default:e.readToken()}if(!e.isAccumulatedSequenceEmpty()){d=e.extractAccumulatedSequence();var k=re.explainIfInvalidPackageName(d.toString());if(k){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMalformedPackageName,k,d,r);return}}}for(c=!1;!c;)switch(e.peekTokenKind()){case u.EndOfInput:throw new Error("Expecting pound symbol");case u.PoundSymbol:c=!0;break;default:e.readToken()}if(!e.isAccumulatedSequenceEmpty()){m=e.extractAccumulatedSequence();var k=re.explainIfInvalidImportPath(m.toString(),!!d);if(k){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMalformedImportPath,k,m,r);return}}if(e.peekTokenKind()!==u.PoundSymbol)throw new Error("Expecting pound symbol");if(e.readToken(),y=e.extractAccumulatedSequence(),b=this._tryReadSpacingAndNewlines(e),d===void 0&&m===void 0){this._parserContext.log.addMessageForTokenSequence(v.ReferenceHashSyntax,"The hash character must be preceded by a package name or import path",y,r);return}}var w=[];for(c=!1;!c;)switch(e.peekTokenKind()){case u.Period:case u.LeftParenthesis:case u.AsciiWord:case u.Colon:case u.LeftSquareBracket:case u.DoubleQuote:var M=w.length>0,$=this._parseMemberReference(e,M,t,r);if(!$)return;w.push($);break;default:c=!0}if(d===void 0&&m===void 0&&w.length===0){this._parserContext.log.addMessageForTokenSequence(v.MissingReference,"Expecting a declaration reference",t,r);return}return new Rn({parsed:!0,configuration:this._configuration,packageNameExcerpt:d,importPathExcerpt:m,importHashExcerpt:y,spacingAfterImportHashExcerpt:b,memberReferences:w})},n.prototype._parseMemberReference=function(e,t,r,i){var o={parsed:!0,configuration:this._configuration};if(t){if(e.peekTokenKind()!==u.Period){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingDot,"Expecting a period before the next component of a declaration reference",r,i);return}e.readToken(),o.dotExcerpt=e.extractAccumulatedSequence(),o.spacingAfterDotExcerpt=this._tryReadSpacingAndNewlines(e)}if(e.peekTokenKind()===u.LeftParenthesis&&(e.readToken(),o.leftParenthesisExcerpt=e.extractAccumulatedSequence(),o.spacingAfterLeftParenthesisExcerpt=this._tryReadSpacingAndNewlines(e)),e.peekTokenKind()===u.LeftSquareBracket){if(o.memberSymbol=this._parseMemberSymbol(e,i),!o.memberSymbol)return}else if(o.memberIdentifier=this._parseMemberIdentifier(e,r,i),!o.memberIdentifier)return;if(o.spacingAfterMemberExcerpt=this._tryReadSpacingAndNewlines(e),e.peekTokenKind()===u.Colon){if(e.readToken(),o.colonExcerpt=e.extractAccumulatedSequence(),o.spacingAfterColonExcerpt=this._tryReadSpacingAndNewlines(e),!o.leftParenthesisExcerpt){this._parserContext.log.addMessageForTokenSequence(v.ReferenceSelectorMissingParens,"Syntax error in declaration reference: the member selector must be enclosed in parentheses",o.colonExcerpt,i);return}if(o.selector=this._parseMemberSelector(e,o.colonExcerpt,i),!o.selector)return;o.spacingAfterSelectorExcerpt=this._tryReadSpacingAndNewlines(e)}else if(o.leftParenthesisExcerpt){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingColon,"Expecting a colon after the identifier because the expression is in parentheses",o.leftParenthesisExcerpt,i);return}if(o.leftParenthesisExcerpt){if(e.peekTokenKind()!==u.RightParenthesis){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingRightParen,"Expecting a matching right parenthesis",o.leftParenthesisExcerpt,i);return}e.readToken(),o.rightParenthesisExcerpt=e.extractAccumulatedSequence(),o.spacingAfterRightParenthesisExcerpt=this._tryReadSpacingAndNewlines(e)}return new Jn(o)},n.prototype._parseMemberSymbol=function(e,t){if(e.peekTokenKind()!==u.LeftSquareBracket)throw new Error('Expecting "["');e.readToken();var r=e.extractAccumulatedSequence(),i=this._tryReadSpacingAndNewlines(e),o=this._parseDeclarationReference(e,r,t);if(!o){this._parserContext.log.addMessageForTokenSequence(v.ReferenceSymbolSyntax,"Missing declaration reference in symbol reference",r,t);return}if(e.peekTokenKind()!==u.RightSquareBracket){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingRightBracket,"Missing closing square bracket for symbol reference",r,t);return}e.readToken();var a=e.extractAccumulatedSequence();return new Xn({parsed:!0,configuration:this._configuration,leftBracketExcerpt:r,spacingAfterLeftBracketExcerpt:i,symbolReference:o,rightBracketExcerpt:a})},n.prototype._parseMemberIdentifier=function(e,t,r){var i=void 0,o=void 0;if(e.peekTokenKind()===u.DoubleQuote){for(e.readToken(),i=e.extractAccumulatedSequence();e.peekTokenKind()!==u.DoubleQuote;){if(e.peekTokenKind()===u.EndOfInput){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingQuote,"Unexpected end of input inside quoted member identifier",i,r);return}e.readToken()}if(e.isAccumulatedSequenceEmpty()){this._parserContext.log.addMessageForTokenSequence(v.ReferenceEmptyIdentifier,"The quoted identifier cannot be empty",i,r);return}var a=e.extractAccumulatedSequence();return e.readToken(),o=e.extractAccumulatedSequence(),new fn({parsed:!0,configuration:this._configuration,leftQuoteExcerpt:i,identifierExcerpt:a,rightQuoteExcerpt:o})}else{for(var l=!1;!l;)switch(e.peekTokenKind()){case u.AsciiWord:case u.DollarSign:e.readToken();break;default:l=!0;break}if(e.isAccumulatedSequenceEmpty()){this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingIdentifier,"Syntax error in declaration reference: expecting a member identifier",t,r);return}var a=e.extractAccumulatedSequence(),c=a.toString(),d=re.explainIfInvalidUnquotedMemberIdentifier(c);if(d){this._parserContext.log.addMessageForTokenSequence(v.ReferenceUnquotedIdentifier,d,a,r);return}return new fn({parsed:!0,configuration:this._configuration,leftQuoteExcerpt:i,identifierExcerpt:a,rightQuoteExcerpt:o})}},n.prototype._parseMemberSelector=function(e,t,r){e.peekTokenKind()!==u.AsciiWord&&this._parserContext.log.addMessageForTokenSequence(v.ReferenceMissingLabel,"Expecting a selector label after the colon",t,r);var i=e.readToken().toString(),o=e.extractAccumulatedSequence(),a=new Qn({parsed:!0,configuration:this._configuration,selectorExcerpt:o,selector:i});if(a.errorMessage){this._parserContext.log.addMessageForTokenSequence(v.ReferenceSelectorSyntax,a.errorMessage,o,r);return}return a},n.prototype._parseHtmlStartTag=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker(),r=e.readToken();if(r.kind!==u.LessThan)throw new Error('Expecting an HTML tag starting with "<"');var i=e.extractAccumulatedSequence(),o=this._parseHtmlName(e);if(hn(o))return this._backtrackAndCreateErrorForFailure(e,t,"Invalid HTML element: ",o);for(var a=this._tryReadSpacingAndNewlines(e),l=[];e.peekTokenKind()===u.AsciiWord;){var c=this._parseHtmlAttribute(e);if(hn(c))return this._backtrackAndCreateErrorForFailure(e,t,"The HTML element has an invalid attribute: ",c);l.push(c)}e.assertAccumulatedSequenceIsEmpty();var d=e.createMarker(),m=!1;if(e.peekTokenKind()===u.Slash&&(e.readToken(),m=!0),e.peekTokenKind()!==u.GreaterThan){var y=this._createFailureForTokensSince(e,v.HtmlTagMissingGreaterThan,'Expecting an attribute or ">" or "/>"',d);return this._backtrackAndCreateErrorForFailure(e,t,"The HTML tag has invalid syntax: ",y)}e.readToken();var b=e.extractAccumulatedSequence();return new Vn({parsed:!0,configuration:this._configuration,openingDelimiterExcerpt:i,nameExcerpt:o,spacingAfterNameExcerpt:a,htmlAttributes:l,selfClosingTag:m,closingDelimiterExcerpt:b})},n.prototype._parseHtmlAttribute=function(e){e.assertAccumulatedSequenceIsEmpty();var t=this._parseHtmlName(e);if(hn(t))return t;var r=this._tryReadSpacingAndNewlines(e);if(e.peekTokenKind()!==u.Equals)return this._createFailureForToken(e,v.HtmlTagMissingEquals,'Expecting "=" after HTML attribute name');e.readToken();var i=e.extractAccumulatedSequence(),o=this._tryReadSpacingAndNewlines(e),a=this._parseHtmlString(e);if(hn(a))return a;var l=e.extractAccumulatedSequence(),c=this._tryReadSpacingAndNewlines(e);return new Gn({parsed:!0,configuration:this._configuration,nameExcerpt:t,spacingAfterNameExcerpt:r,equalsExcerpt:i,spacingAfterEqualsExcerpt:o,valueExcerpt:l,spacingAfterValueExcerpt:c})},n.prototype._parseHtmlString=function(e){var t=e.createMarker(),r=e.peekTokenKind();if(r!==u.DoubleQuote&&r!==u.SingleQuote)return this._createFailureForToken(e,v.HtmlTagMissingString,"Expecting an HTML string starting with a single-quote or double-quote character");e.readToken();for(var i="";;){var o=e.peekTokenKind();if(o===r){e.readToken();break}if(o===u.EndOfInput||o===u.Newline)return this._createFailureForToken(e,v.HtmlStringMissingQuote,"The HTML string is missing its closing quote",t);i+=e.readToken().toString()}return e.peekTokenKind()===u.AsciiWord?this._createFailureForToken(e,v.TextAfterHtmlString,"The next character after a closing quote must be spacing or punctuation"):i},n.prototype._parseHtmlEndTag=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker(),r=e.peekToken();if(r.kind!==u.LessThan)return this._backtrackAndCreateError(e,t,v.MissingHtmlEndTag,'Expecting an HTML tag starting with "" for the HTML tag');return this._backtrackAndCreateErrorForFailure(e,t,"",c)}e.readToken();var d=e.extractAccumulatedSequence();return new Wn({parsed:!0,configuration:this._configuration,openingDelimiterExcerpt:o,nameExcerpt:a,spacingAfterNameExcerpt:l,closingDelimiterExcerpt:d})},n.prototype._parseHtmlName=function(e){var t=e.createMarker();if(e.peekTokenKind()===u.Spacing)return this._createFailureForTokensSince(e,v.MalformedHtmlName,"A space is not allowed here",t);for(var r=!1;!r;)switch(e.peekTokenKind()){case u.Hyphen:case u.Period:case u.AsciiWord:e.readToken();break;default:r=!0;break}var i=e.tryExtractAccumulatedSequence();if(!i)return this._createFailureForToken(e,v.MalformedHtmlName,"Expecting an HTML name");var o=i.toString(),a=re.explainIfInvalidHtmlName(o);return a?this._createFailureForTokensSince(e,v.MalformedHtmlName,a,t):this._configuration.validation.reportUnsupportedHtmlElements&&!this._configuration.isHtmlElementSupported(o)?this._createFailureForToken(e,v.UnsupportedHtmlElementName,"The HTML element name ".concat(JSON.stringify(o)," is not defined by your TSDoc configuration"),t):i},n.prototype._parseFencedCode=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker(),r=t+2;switch(e.peekPreviousTokenKind()){case u.Newline:case u.EndOfInput:break;default:return this._backtrackAndCreateErrorRange(e,t,r,v.CodeFenceOpeningIndent,"The opening backtick for a code fence must appear at the start of the line")}var i="";if(i+=e.readToken(),i+=e.readToken(),i+=e.readToken(),i!=="```")throw new Error("Expecting three backticks");for(var o=e.extractAccumulatedSequence();e.peekTokenKind()===u.Spacing;)e.readToken();for(var a=e.tryExtractAccumulatedSequence(),l=!1,c=void 0;!l;)switch(e.peekTokenKind()){case u.Spacing:case u.Newline:c===void 0&&(c=e.createMarker()),e.peekTokenKind()===u.Newline&&(l=!0),e.readToken();break;case u.Backtick:var d=this._createFailureForToken(e,v.CodeFenceSpecifierSyntax,"The language specifier cannot contain backtick characters");return this._backtrackAndCreateErrorRangeForFailure(e,t,r,"Error parsing code fence: ",d);case u.EndOfInput:var m=this._createFailureForToken(e,v.CodeFenceMissingDelimiter,"Missing closing delimiter");return this._backtrackAndCreateErrorRangeForFailure(e,t,r,"Error parsing code fence: ",m);default:c=void 0,e.readToken();break}var y=e.extractAccumulatedSequence(),b=y.getNewSequence(y.startIndex,c),E=y.getNewSequence(c,y.endIndex),P=-1,k=-1;l=!1;for(var w;!l;)switch(e.peekTokenKind()){case u.EndOfInput:var m=this._createFailureForToken(e,v.CodeFenceMissingDelimiter,"Missing closing delimiter");return this._backtrackAndCreateErrorRangeForFailure(e,t,r,"Error parsing code fence: ",m);case u.Newline:for(w=e.readToken(),P=e.createMarker();e.peekTokenKind()===u.Spacing;)w=e.readToken();if(e.peekTokenKind()!==u.Backtick||(k=e.createMarker(),e.readToken(),e.peekTokenKind()!==u.Backtick)||(e.readToken(),e.peekTokenKind()!==u.Backtick))break;e.readToken(),l=!0;break;default:e.readToken();break}w.kind!==u.Newline&&this._parserContext.log.addMessageForTextRange(v.CodeFenceClosingIndent,"The closing delimiter for a code fence must not be indented",w.range);var M=e.extractAccumulatedSequence(),$=M.getNewSequence(M.startIndex,P),K=M.getNewSequence(P,k),C=M.getNewSequence(k,M.endIndex);for(l=!1;!l;)switch(e.peekTokenKind()){case u.Spacing:e.readToken();break;case u.Newline:l=!0,e.readToken();break;case u.EndOfInput:l=!0;break;default:this._parserContext.log.addMessageForTextRange(v.CodeFenceClosingSyntax,"Unexpected characters after closing delimiter for code fence",e.peekToken().range),l=!0;break}var H=e.tryExtractAccumulatedSequence();return new Un({parsed:!0,configuration:this._configuration,openingFenceExcerpt:o,spacingAfterOpeningFenceExcerpt:a,languageExcerpt:b,spacingAfterLanguageExcerpt:E,codeExcerpt:$,spacingBeforeClosingFenceExcerpt:K,closingFenceExcerpt:C,spacingAfterClosingFenceExcerpt:H})},n.prototype._parseCodeSpan=function(e){e.assertAccumulatedSequenceIsEmpty();var t=e.createMarker();if(e.peekTokenKind()!==u.Backtick)throw new Error('Expecting a code span starting with a backtick character "`"');e.readToken();for(var r=e.extractAccumulatedSequence(),i=void 0,o=void 0;;){var a=e.peekTokenKind();if(a===u.Backtick){if(e.isAccumulatedSequenceEmpty())return this._backtrackAndCreateErrorRange(e,t,t+1,v.CodeSpanEmpty,"A code span must contain at least one character between the backticks");i=e.extractAccumulatedSequence(),e.readToken(),o=e.extractAccumulatedSequence();break}if(a===u.EndOfInput||a===u.Newline)return this._backtrackAndCreateError(e,t,v.CodeSpanMissingDelimiter,"The code span is missing its closing backtick");e.readToken()}return new $n({parsed:!0,configuration:this._configuration,openingDelimiterExcerpt:r,codeExcerpt:i,closingDelimiterExcerpt:o})},n.prototype._tryReadSpacingAndNewlines=function(e){var t=!1;do switch(e.peekTokenKind()){case u.Spacing:case u.Newline:e.readToken();break;default:t=!0;break}while(!t);return e.tryExtractAccumulatedSequence()},n.prototype._createError=function(e,t,r){e.readToken();var i=e.extractAccumulatedSequence(),o=new St({parsed:!0,configuration:this._configuration,textExcerpt:i,messageId:t,errorMessage:r,errorLocation:i});return this._parserContext.log.addMessageForDocErrorText(o),o},n.prototype._backtrackAndCreateError=function(e,t,r,i){return e.backtrackToMarker(t),this._createError(e,r,i)},n.prototype._backtrackAndCreateErrorRange=function(e,t,r,i,o){for(e.backtrackToMarker(t);e.createMarker()!==r;)e.readToken();e.peekTokenKind()!==u.EndOfInput&&e.readToken();var a=e.extractAccumulatedSequence(),l=new St({parsed:!0,configuration:this._configuration,textExcerpt:a,messageId:i,errorMessage:o,errorLocation:a});return this._parserContext.log.addMessageForDocErrorText(l),l},n.prototype._backtrackAndCreateErrorForFailure=function(e,t,r,i){e.backtrackToMarker(t),e.readToken();var o=e.extractAccumulatedSequence(),a=new St({parsed:!0,configuration:this._configuration,textExcerpt:o,messageId:i.failureMessageId,errorMessage:r+i.failureMessage,errorLocation:i.failureLocation});return this._parserContext.log.addMessageForDocErrorText(a),a},n.prototype._backtrackAndCreateErrorRangeForFailure=function(e,t,r,i,o){for(e.backtrackToMarker(t);e.createMarker()!==r;)e.readToken();e.peekTokenKind()!==u.EndOfInput&&e.readToken();var a=e.extractAccumulatedSequence(),l=new St({parsed:!0,configuration:this._configuration,textExcerpt:a,messageId:o.failureMessageId,errorMessage:i+o.failureMessage,errorLocation:o.failureLocation});return this._parserContext.log.addMessageForDocErrorText(l),l},n.prototype._createFailureForToken=function(e,t,r,i){i||(i=e.createMarker());var o=new xt({parserContext:this._parserContext,startIndex:i,endIndex:i+1});return{failureMessageId:t,failureMessage:r,failureLocation:o}},n.prototype._createFailureForTokensSince=function(e,t,r,i){var o=e.createMarker();if(osetTimeout(e,n))}function no(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ro(){return/(<%(?:-|_)?\s*[*~]{0,1})\+((?:.|\s)*?%>)/g}function Za(n,e){e=(0,Ve.normalizePath)(e);let t=n.vault.getAbstractFileByPath(e);if(!t)throw new O(`Folder "${e}" doesn't exist`);if(!(t instanceof Ve.TFolder))throw new O(`${e} is a file, not a folder`);return t}function Dt(n,e){e=(0,Ve.normalizePath)(e);let t=n.vault.getAbstractFileByPath(e);if(!t)throw new O(`File "${e}" doesn't exist`);if(!(t instanceof Ve.TFile))throw new O(`${e} is a folder, not a file`);return t}function ze(n,e){let t=Za(n,e),r=[];return Ve.Vault.recurseChildren(t,i=>{i instanceof Ve.TFile&&r.push(i)}),r.sort((i,o)=>i.path.localeCompare(o.path)),r}async function io(n,e){return await Promise.all(e.map(async r=>{let i=await n.vault.cachedRead(r);return es(r,i)}))}function es(n,e){let r=new qr().parseString(e),i=new Lr(n);return i.description=ts(r.docComment.summarySection),i.returns=ns(r.docComment.returnsBlock),i.arguments=rs(r.docComment.params),i}function ts(n){try{return n.nodes.map(t=>t.getChildNodes().filter(r=>r instanceof Ge).map(r=>r.text).join(` +`)).join(` +`)}catch(e){throw console.error("Failed to parse sumamry section"),e}}function ns(n){if(!n)return"";try{return n.content.nodes[0].getChildNodes()[0].text.trim()}catch{return""}}function rs(n){try{return n.blocks.map(r=>{let i=r.parameterName,o=r.content.getChildNodes()[0].getChildNodes().filter(a=>a instanceof Ge).map(a=>a.text).join(" ");return new Hr(i,o)})}catch{return[]}}function Pt(n,e,t){if(t<0||t===n.length)return;let r=n[e];n[e]=n[t],n[t]=r}function Jt(n){return n.workspace.activeEditor?.file??n.workspace.getActiveFile()}function oo(n){let e=n.lastIndexOf("/");return e!==-1?n.slice(0,e):""}function $r(n){return n!==null&&typeof n=="object"}function ao(n){let e=n.toString(),t=e.indexOf("(");return e.substring(t+1,e.indexOf(")")).replace(/ /g,"").split(",")}function Kr(n,e,t){let r=n instanceof HTMLOListElement?"li":"p",i=n.createEl(r),o=n.createEl("b",{text:e});return i.appendChild(o),i.appendChild(document.createTextNode(`: ${t}`)),i}var Po=X(require("obsidian"));var Co=X(require("obsidian"));var ie="top",ue="bottom",ce="right",ae="left",sr="auto",yt=[ie,ue,ce,ae],lt="start",Nt="end",so="clippingParents",cr="viewport",Qt="popper",co="reference",Rr=yt.reduce(function(n,e){return n.concat([e+"-"+lt,e+"-"+Nt])},[]),lr=[].concat(yt,[sr]).reduce(function(n,e){return n.concat([e,e+"-"+lt,e+"-"+Nt])},[]),is="beforeRead",os="read",as="afterRead",ss="beforeMain",cs="main",ls="afterMain",ps="beforeWrite",us="write",fs="afterWrite",lo=[is,os,as,ss,cs,ls,ps,us,fs];function de(n){return n?(n.nodeName||"").toLowerCase():null}function Z(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function De(n){var e=Z(n).Element;return n instanceof e||n instanceof Element}function fe(n){var e=Z(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Xt(n){if(typeof ShadowRoot=="undefined")return!1;var e=Z(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ds(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!fe(o)||!de(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var l=i[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function ms(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=a.reduce(function(c,d){return c[d]="",c},{});!fe(i)||!de(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}var po={name:"applyStyles",enabled:!0,phase:"write",fn:ds,effect:ms,requires:["computeStyles"]};function me(n){return n.split("-")[0]}var Fe=Math.max,Ot=Math.min,pt=Math.round;function Zt(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function An(){return!/^((?!chrome|android).)*safari/i.test(Zt())}function Pe(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&fe(n)&&(i=n.offsetWidth>0&&pt(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&pt(r.height)/n.offsetHeight||1);var a=De(n)?Z(n):window,l=a.visualViewport,c=!An()&&t,d=(r.left+(c&&l?l.offsetLeft:0))/i,m=(r.top+(c&&l?l.offsetTop:0))/o,y=r.width/i,b=r.height/o;return{width:y,height:b,top:m,right:d+y,bottom:m+b,left:d,x:d,y:m}}function Mt(n){var e=Pe(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function _n(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Xt(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ve(n){return Z(n).getComputedStyle(n)}function Yr(n){return["table","td","th"].indexOf(de(n))>=0}function he(n){return((De(n)?n.ownerDocument:n.document)||window.document).documentElement}function ut(n){return de(n)==="html"?n:n.assignedSlot||n.parentNode||(Xt(n)?n.host:null)||he(n)}function uo(n){return!fe(n)||ve(n).position==="fixed"?null:n.offsetParent}function gs(n){var e=/firefox/i.test(Zt()),t=/Trident/i.test(Zt());if(t&&fe(n)){var r=ve(n);if(r.position==="fixed")return null}var i=ut(n);for(Xt(i)&&(i=i.host);fe(i)&&["html","body"].indexOf(de(i))<0;){var o=ve(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ie(n){for(var e=Z(n),t=uo(n);t&&Yr(t)&&ve(t).position==="static";)t=uo(t);return t&&(de(t)==="html"||de(t)==="body"&&ve(t).position==="static")?e:t||gs(n)||e}function Bt(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Ft(n,e,t){return Fe(n,Ot(e,t))}function fo(n,e,t){var r=Ft(n,e,t);return r>t?t:r}function xn(){return{top:0,right:0,bottom:0,left:0}}function yn(n){return Object.assign({},xn(),n)}function jn(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var hs=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,yn(typeof e!="number"?e:jn(e,yt))};function As(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,a=t.modifiersData.popperOffsets,l=me(t.placement),c=Bt(l),d=[ae,ce].indexOf(l)>=0,m=d?"height":"width";if(!(!o||!a)){var y=hs(i.padding,t),b=Mt(o),E=c==="y"?ie:ae,P=c==="y"?ue:ce,k=t.rects.reference[m]+t.rects.reference[c]-a[c]-t.rects.popper[m],w=a[c]-t.rects.reference[c],M=Ie(o),$=M?c==="y"?M.clientHeight||0:M.clientWidth||0:0,K=k/2-w/2,C=y[E],H=$-b[m]-y[P],I=$/2-b[m]/2+K,J=Ft(C,I,H),te=c;t.modifiersData[r]=(e={},e[te]=J,e.centerOffset=J-I,e)}}function _s(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!_n(e.elements.popper,i)||(e.elements.arrow=i))}var mo={name:"arrow",enabled:!0,phase:"main",fn:As,effect:_s,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ne(n){return n.split("-")[1]}var xs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ys(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:pt(t*i)/i||0,y:pt(r*i)/i||0}}function go(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,a=n.offsets,l=n.position,c=n.gpuAcceleration,d=n.adaptive,m=n.roundOffsets,y=n.isFixed,b=a.x,E=b===void 0?0:b,P=a.y,k=P===void 0?0:P,w=typeof m=="function"?m({x:E,y:k}):{x:E,y:k};E=w.x,k=w.y;var M=a.hasOwnProperty("x"),$=a.hasOwnProperty("y"),K=ae,C=ie,H=window;if(d){var I=Ie(t),J="clientHeight",te="clientWidth";if(I===Z(t)&&(I=he(t),ve(I).position!=="static"&&l==="absolute"&&(J="scrollHeight",te="scrollWidth")),I=I,i===ie||(i===ae||i===ce)&&o===Nt){C=ue;var ne=y&&I===H&&H.visualViewport?H.visualViewport.height:I[J];k-=ne-r.height,k*=c?1:-1}if(i===ae||(i===ie||i===ue)&&o===Nt){K=ce;var Q=y&&I===H&&H.visualViewport?H.visualViewport.width:I[te];E-=Q-r.width,E*=c?1:-1}}var h=Object.assign({position:l},d&&xs),S=m===!0?ys({x:E,y:k},Z(t)):{x:E,y:k};if(E=S.x,k=S.y,c){var f;return Object.assign({},h,(f={},f[C]=$?"0":"",f[K]=M?"0":"",f.transform=(H.devicePixelRatio||1)<=1?"translate("+E+"px, "+k+"px)":"translate3d("+E+"px, "+k+"px, 0)",f))}return Object.assign({},h,(e={},e[C]=$?k+"px":"",e[K]=M?E+"px":"",e.transform="",e))}function js(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,a=o===void 0?!0:o,l=t.roundOffsets,c=l===void 0?!0:l,d={placement:me(e.placement),variation:Ne(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,go(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,go(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ho={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:js,data:{}};var pr={passive:!0};function vs(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,l=a===void 0?!0:a,c=Z(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(m){m.addEventListener("scroll",t.update,pr)}),l&&c.addEventListener("resize",t.update,pr),function(){o&&d.forEach(function(m){m.removeEventListener("scroll",t.update,pr)}),l&&c.removeEventListener("resize",t.update,pr)}}var Ao={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vs,data:{}};var ws={left:"right",right:"left",bottom:"top",top:"bottom"};function en(n){return n.replace(/left|right|bottom|top/g,function(e){return ws[e]})}var bs={start:"end",end:"start"};function ur(n){return n.replace(/start|end/g,function(e){return bs[e]})}function It(n){var e=Z(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function qt(n){return Pe(he(n)).left+It(n).scrollLeft}function Ur(n,e){var t=Z(n),r=he(n),i=t.visualViewport,o=r.clientWidth,a=r.clientHeight,l=0,c=0;if(i){o=i.width,a=i.height;var d=An();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:l+qt(n),y:c}}function Gr(n){var e,t=he(n),r=It(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Fe(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Fe(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+qt(n),c=-r.scrollTop;return ve(i||t).direction==="rtl"&&(l+=Fe(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:l,y:c}}function Lt(n){var e=ve(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function fr(n){return["html","body","#document"].indexOf(de(n))>=0?n.ownerDocument.body:fe(n)&&Lt(n)?n:fr(ut(n))}function jt(n,e){var t;e===void 0&&(e=[]);var r=fr(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=Z(r),a=i?[o].concat(o.visualViewport||[],Lt(r)?r:[]):r,l=e.concat(a);return i?l:l.concat(jt(ut(a)))}function tn(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Es(n,e){var t=Pe(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function _o(n,e,t){return e===cr?tn(Ur(n,t)):De(e)?Es(e,t):tn(Gr(he(n)))}function Ts(n){var e=jt(ut(n)),t=["absolute","fixed"].indexOf(ve(n).position)>=0,r=t&&fe(n)?Ie(n):n;return De(r)?e.filter(function(i){return De(i)&&_n(i,r)&&de(i)!=="body"}):[]}function Wr(n,e,t,r){var i=e==="clippingParents"?Ts(n):[].concat(e),o=[].concat(i,[t]),a=o[0],l=o.reduce(function(c,d){var m=_o(n,d,r);return c.top=Fe(m.top,c.top),c.right=Ot(m.right,c.right),c.bottom=Ot(m.bottom,c.bottom),c.left=Fe(m.left,c.left),c},_o(n,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function vn(n){var e=n.reference,t=n.element,r=n.placement,i=r?me(r):null,o=r?Ne(r):null,a=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,c;switch(i){case ie:c={x:a,y:e.y-t.height};break;case ue:c={x:a,y:e.y+e.height};break;case ce:c={x:e.x+e.width,y:l};break;case ae:c={x:e.x-t.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?Bt(i):null;if(d!=null){var m=d==="y"?"height":"width";switch(o){case lt:c[d]=c[d]-(e[m]/2-t[m]/2);break;case Nt:c[d]=c[d]+(e[m]/2-t[m]/2);break;default:}}return c}function qe(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,a=o===void 0?n.strategy:o,l=t.boundary,c=l===void 0?so:l,d=t.rootBoundary,m=d===void 0?cr:d,y=t.elementContext,b=y===void 0?Qt:y,E=t.altBoundary,P=E===void 0?!1:E,k=t.padding,w=k===void 0?0:k,M=yn(typeof w!="number"?w:jn(w,yt)),$=b===Qt?co:Qt,K=n.rects.popper,C=n.elements[P?$:b],H=Wr(De(C)?C:C.contextElement||he(n.elements.popper),c,m,a),I=Pe(n.elements.reference),J=vn({reference:I,element:K,strategy:"absolute",placement:i}),te=tn(Object.assign({},K,J)),ne=b===Qt?te:I,Q={top:H.top-ne.top+M.top,bottom:ne.bottom-H.bottom+M.bottom,left:H.left-ne.left+M.left,right:ne.right-H.right+M.right},h=n.modifiersData.offset;if(b===Qt&&h){var S=h[i];Object.keys(Q).forEach(function(f){var Me=[ce,ue].indexOf(f)>=0?1:-1,be=[ie,ue].indexOf(f)>=0?"y":"x";Q[f]+=S[be]*Me})}return Q}function Vr(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,a=t.padding,l=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?lr:c,m=Ne(r),y=m?l?Rr:Rr.filter(function(P){return Ne(P)===m}):yt,b=y.filter(function(P){return d.indexOf(P)>=0});b.length===0&&(b=y);var E=b.reduce(function(P,k){return P[k]=qe(n,{placement:k,boundary:i,rootBoundary:o,padding:a})[me(k)],P},{});return Object.keys(E).sort(function(P,k){return E[P]-E[k]})}function ks(n){if(me(n)===sr)return[];var e=en(n);return[ur(n),e,ur(e)]}function Ss(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,l=a===void 0?!0:a,c=t.fallbackPlacements,d=t.padding,m=t.boundary,y=t.rootBoundary,b=t.altBoundary,E=t.flipVariations,P=E===void 0?!0:E,k=t.allowedAutoPlacements,w=e.options.placement,M=me(w),$=M===w,K=c||($||!P?[en(w)]:ks(w)),C=[w].concat(K).reduce(function(B,D){return B.concat(me(D)===sr?Vr(e,{placement:D,boundary:m,rootBoundary:y,padding:d,flipVariations:P,allowedAutoPlacements:k}):D)},[]),H=e.rects.reference,I=e.rects.popper,J=new Map,te=!0,ne=C[0],Q=0;Q=0,be=Me?"width":"height",Ae=qe(e,{placement:h,boundary:m,rootBoundary:y,altBoundary:b,padding:d}),_e=Me?f?ce:ae:f?ue:ie;H[be]>I[be]&&(_e=en(_e));var Ke=en(_e),Ee=[];if(o&&Ee.push(Ae[S]<=0),l&&Ee.push(Ae[_e]<=0,Ae[Ke]<=0),Ee.every(function(B){return B})){ne=h,te=!1;break}J.set(h,Ee)}if(te)for(var $t=P?3:1,Re=function(D){var q=C.find(function(ee){var et=J.get(ee);if(et)return et.slice(0,D).every(function(W){return W})});if(q)return ne=q,"break"},Ze=$t;Ze>0;Ze--){var xe=Re(Ze);if(xe==="break")break}e.placement!==ne&&(e.modifiersData[r]._skip=!0,e.placement=ne,e.reset=!0)}}var xo={name:"flip",enabled:!0,phase:"main",fn:Ss,requiresIfExists:["offset"],data:{_skip:!1}};function yo(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function jo(n){return[ie,ce,ue,ae].some(function(e){return n[e]>=0})}function Cs(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=qe(e,{elementContext:"reference"}),l=qe(e,{altBoundary:!0}),c=yo(a,r),d=yo(l,i,o),m=jo(c),y=jo(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:m,hasPopperEscaped:y},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":y})}var vo={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Cs};function Ds(n,e,t){var r=me(n),i=[ae,ie].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=o[0],l=o[1];return a=a||0,l=(l||0)*i,[ae,ce].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function Ps(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,a=lr.reduce(function(m,y){return m[y]=Ds(y,e.rects,o),m},{}),l=a[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=a}var wo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ps};function Ns(n){var e=n.state,t=n.name;e.modifiersData[t]=vn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var bo={name:"popperOffsets",enabled:!0,phase:"read",fn:Ns,data:{}};function zr(n){return n==="x"?"y":"x"}function Os(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,l=a===void 0?!1:a,c=t.boundary,d=t.rootBoundary,m=t.altBoundary,y=t.padding,b=t.tether,E=b===void 0?!0:b,P=t.tetherOffset,k=P===void 0?0:P,w=qe(e,{boundary:c,rootBoundary:d,padding:y,altBoundary:m}),M=me(e.placement),$=Ne(e.placement),K=!$,C=Bt(M),H=zr(C),I=e.modifiersData.popperOffsets,J=e.rects.reference,te=e.rects.popper,ne=typeof k=="function"?k(Object.assign({},e.rects,{placement:e.placement})):k,Q=typeof ne=="number"?{mainAxis:ne,altAxis:ne}:Object.assign({mainAxis:0,altAxis:0},ne),h=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(!!I){if(o){var f,Me=C==="y"?ie:ae,be=C==="y"?ue:ce,Ae=C==="y"?"height":"width",_e=I[C],Ke=_e+w[Me],Ee=_e-w[be],$t=E?-te[Ae]/2:0,Re=$===lt?J[Ae]:te[Ae],Ze=$===lt?-te[Ae]:-J[Ae],xe=e.elements.arrow,B=E&&xe?Mt(xe):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:xn(),q=D[Me],ee=D[be],et=Ft(0,J[Ae],B[Ae]),W=K?J[Ae]/2-$t-et-q-Q.mainAxis:Re-et-q-Q.mainAxis,ye=K?-J[Ae]/2+$t+et+ee+Q.mainAxis:Ze+et+ee+Q.mainAxis,bt=e.elements.arrow&&Ie(e.elements.arrow),Sn=bt?C==="y"?bt.clientTop||0:bt.clientLeft||0:0,tt=(f=h==null?void 0:h[C])!=null?f:0,nt=_e+W-tt-Sn,gt=_e+ye-tt,Et=Ft(E?Ot(Ke,nt):Ke,_e,E?Fe(Ee,gt):Ee);I[C]=Et,S[C]=Et-_e}if(l){var Cn,Dn=C==="x"?ie:ae,Pn=C==="x"?ue:ce,rt=I[H],Kt=H==="y"?"height":"width",Nn=rt+w[Dn],On=rt-w[Pn],an=[ie,ae].indexOf(M)!==-1,Tt=(Cn=h==null?void 0:h[H])!=null?Cn:0,Mn=an?Nn:rt-J[Kt]-te[Kt]-Tt+Q.altAxis,Ye=an?rt+J[Kt]+te[Kt]-Tt-Q.altAxis:On,se=E&&an?fo(Mn,rt,Ye):Ft(E?Mn:Nn,rt,E?Ye:On);I[H]=se,S[H]=se-rt}e.modifiersData[r]=S}}var Eo={name:"preventOverflow",enabled:!0,phase:"main",fn:Os,requiresIfExists:["offset"]};function Jr(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Qr(n){return n===Z(n)||!fe(n)?It(n):Jr(n)}function Ms(n){var e=n.getBoundingClientRect(),t=pt(e.width)/n.offsetWidth||1,r=pt(e.height)/n.offsetHeight||1;return t!==1||r!==1}function Xr(n,e,t){t===void 0&&(t=!1);var r=fe(e),i=fe(e)&&Ms(e),o=he(e),a=Pe(n,i,t),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((de(e)!=="body"||Lt(o))&&(l=Qr(e)),fe(e)?(c=Pe(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=qt(o))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Bs(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!t.has(l)){var c=e.get(l);c&&i(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function Zr(n){var e=Bs(n);return lo.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function ei(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ti(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var To={placement:"bottom",modifiers:[],strategy:"absolute"};function ko(){for(var n=arguments.length,e=new Array(n),t=0;t(n%e+e)%e,Do=class{constructor(e,t,r){this.owner=e,this.containerEl=t,t.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),t.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",i=>{if(!i.isComposing)return this.useSelectedItem(i),!1})}onSuggestionClick(e,t){e.preventDefault();let r=this.suggestions.indexOf(t);this.setSelectedItem(r,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,t){let r=this.suggestions.indexOf(t);this.setSelectedItem(r,!1)}setSuggestions(e){this.containerEl.empty();let t=[];e.forEach(r=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,i),t.push(i)}),this.values=e,this.suggestions=t,this.setSelectedItem(0,!1)}useSelectedItem(e){let t=this.values[this.selectedItem];t&&this.owner.selectSuggestion(t,e)}setSelectedItem(e,t){let r=Is(e,this.suggestions.length),i=this.suggestions[this.selectedItem],o=this.suggestions[r];i?.removeClass("is-selected"),o?.addClass("is-selected"),this.selectedItem=r,t&&o.scrollIntoView(!1)}},wn=class{constructor(e,t){this.app=e,this.inputEl=t,this.scope=new Co.Scope,this.suggestEl=createDiv("suggestion-container");let r=this.suggestEl.createDiv("suggestion");this.suggest=new Do(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",i=>{i.preventDefault()})}onInputChanged(){let e=this.inputEl.value,t=this.getSuggestions(e);if(!t){this.close();return}t.length>0?(this.suggest.setSuggestions(t),this.open(this.app.dom.appContainerEl,this.inputEl)):this.close()}open(e,t){this.app.keymap.pushScope(this.scope),e.appendChild(this.suggestEl),this.popper=ni(t,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:i})=>{let o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,i.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){this.app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};var Le;(function(t){t[t.TemplateFiles=0]="TemplateFiles",t[t.ScriptFiles=1]="ScriptFiles"})(Le||(Le={}));var nn=class extends wn{constructor(e,t,r){super(t.app,e);this.inputEl=e;this.plugin=t;this.mode=r}get_folder(e){switch(e){case 0:return this.plugin.settings.templates_folder;case 1:return this.plugin.settings.user_scripts_folder}}get_error_msg(e){switch(e){case 0:return"Templates folder doesn't exist";case 1:return"User Scripts folder doesn't exist"}}getSuggestions(e){let t=ke(()=>ze(this.plugin.app,this.get_folder(this.mode)),this.get_error_msg(this.mode));if(!t)return[];let r=[],i=e.toLowerCase();return t.forEach(o=>{o instanceof Po.TFile&&o.extension==="md"&&o.path.toLowerCase().contains(i)&&r.push(o)}),r.slice(0,1e3)}renderSuggestion(e,t){t.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var No=X(require("obsidian"));var bn=class extends wn{constructor(e,t){super(e,t)}getSuggestions(e){let t=this.app.vault.getAllLoadedFiles(),r=[],i=e.toLowerCase();return t.forEach(o=>{o instanceof No.TFolder&&o.path.toLowerCase().contains(i)&&r.push(o)}),r.slice(0,1e3)}renderSuggestion(e,t){t.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var ft;(function(o){o[o.Off=0]="Off",o[o.RenderDescriptionParameterReturn=1]="RenderDescriptionParameterReturn",o[o.RenderDescriptionParameterList=2]="RenderDescriptionParameterList",o[o.RenderDescriptionReturn=3]="RenderDescriptionReturn",o[o.RenderDescriptionOnly=4]="RenderDescriptionOnly"})(ft||(ft={}));function Oo(n){return isBoolean(n)?n:[1,3].includes(n)}function Mo(n){return isBoolean(n)?n:[1,2].includes(n)}function Bo(n){return isBoolean(n)?n:n!=0}var Fo={command_timeout:5,templates_folder:"",templates_pairs:[["",""]],trigger_on_file_creation:!1,auto_jump_to_cursor:!1,enable_system_commands:!1,shell_path:"",user_scripts_folder:"",enable_folder_templates:!0,folder_templates:[{folder:"",template:""}],enable_file_templates:!1,file_templates:[{regex:".*",template:""}],syntax_highlighting:!0,syntax_highlighting_mobile:!1,enabled_templates_hotkeys:[""],startup_templates:[""],intellisense_render:ft.RenderDescriptionParameterReturn},ri=class extends L.PluginSettingTab{constructor(e){super(e.app,e);this.plugin=e}display(){this.containerEl.empty(),this.add_template_folder_setting(),this.add_internal_functions_setting(),this.add_syntax_highlighting_settings(),this.add_auto_jump_to_cursor(),this.add_trigger_on_new_file_creation_setting(),this.plugin.settings.trigger_on_file_creation&&(this.add_folder_templates_setting(),this.add_file_templates_setting()),this.add_templates_hotkeys_setting(),this.add_startup_templates_setting(),this.add_user_script_functions_setting(),this.add_user_system_command_functions_setting(),this.add_donating_setting()}add_template_folder_setting(){new L.Setting(this.containerEl).setName("Template folder location").setDesc("Files in this folder will be available as templates.").addSearch(e=>{new bn(this.app,e.inputEl),e.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.templates_folder).onChange(t=>{t=t.trim(),t=t.replace(/\/$/,""),this.plugin.settings.templates_folder=t,this.plugin.save_settings()}),e.containerEl.addClass("templater_search")})}add_internal_functions_setting(){let e=document.createDocumentFragment();e.append("Templater provides multiples predefined variables / functions that you can use.",e.createEl("br"),"Check the ",e.createEl("a",{href:"https://silentvoid13.github.io/Templater/",text:"documentation"})," to get a list of all the available internal variables / functions."),new L.Setting(this.containerEl).setName("Internal variables and functions").setDesc(e)}add_syntax_highlighting_settings(){let e=document.createDocumentFragment();e.append("Adds syntax highlighting for Templater commands in edit mode.");let t=document.createDocumentFragment();t.append("Adds syntax highlighting for Templater commands in edit mode on mobile. Use with caution: this may break live preview on mobile platforms."),new L.Setting(this.containerEl).setName("Syntax highlighting on desktop").setDesc(e).addToggle(r=>{r.setValue(this.plugin.settings.syntax_highlighting).onChange(i=>{this.plugin.settings.syntax_highlighting=i,this.plugin.save_settings(),this.plugin.event_handler.update_syntax_highlighting()})}),new L.Setting(this.containerEl).setName("Syntax highlighting on mobile").setDesc(t).addToggle(r=>{r.setValue(this.plugin.settings.syntax_highlighting_mobile).onChange(i=>{this.plugin.settings.syntax_highlighting_mobile=i,this.plugin.save_settings(),this.plugin.event_handler.update_syntax_highlighting()})})}add_auto_jump_to_cursor(){let e=document.createDocumentFragment();e.append("Automatically triggers ",e.createEl("code",{text:"tp.file.cursor"})," after inserting a template.",e.createEl("br"),"You can also set a hotkey to manually trigger ",e.createEl("code",{text:"tp.file.cursor"}),"."),new L.Setting(this.containerEl).setName("Automatic jump to cursor").setDesc(e).addToggle(t=>{t.setValue(this.plugin.settings.auto_jump_to_cursor).onChange(r=>{this.plugin.settings.auto_jump_to_cursor=r,this.plugin.save_settings()})})}add_trigger_on_new_file_creation_setting(){let e=document.createDocumentFragment();e.append("Templater will listen for the new file creation event, and, if it matches a rule you've set, replace every command it finds in the new file's content. ","This makes Templater compatible with other plugins like the Daily note core plugin, Calendar plugin, Review plugin, Note refactor plugin, etc. ",e.createEl("br"),e.createEl("br"),"Make sure to set up rules under either folder templates or file regex template below.",e.createEl("br"),e.createEl("br"),e.createEl("b",{text:"Warning: "}),"This can be dangerous if you create new files with unknown / unsafe content on creation. Make sure that every new file's content is safe on creation."),new L.Setting(this.containerEl).setName("Trigger Templater on new file creation").setDesc(e).addToggle(t=>{t.setValue(this.plugin.settings.trigger_on_file_creation).onChange(r=>{this.plugin.settings.trigger_on_file_creation=r,this.plugin.save_settings(),this.plugin.event_handler.update_trigger_file_on_creation(),this.display()})})}add_templates_hotkeys_setting(){new L.Setting(this.containerEl).setName("Template hotkeys").setHeading();let e=document.createDocumentFragment();e.append("Template hotkeys allows you to bind a template to a hotkey."),new L.Setting(this.containerEl).setDesc(e),this.plugin.settings.enabled_templates_hotkeys.forEach((t,r)=>{new L.Setting(this.containerEl).addSearch(o=>{new nn(o.inputEl,this.plugin,Le.TemplateFiles),o.setPlaceholder("Example: folder1/template_file").setValue(t).onChange(a=>{if(a&&this.plugin.settings.enabled_templates_hotkeys.contains(a)){oe(new O("This template is already bound to a hotkey"));return}this.plugin.command_handler.add_template_hotkey(this.plugin.settings.enabled_templates_hotkeys[r],a),this.plugin.settings.enabled_templates_hotkeys[r]=a,this.plugin.save_settings()}),o.containerEl.addClass("templater_search")}).addExtraButton(o=>{o.setIcon("any-key").setTooltip("Configure Hotkey").onClick(()=>{this.app.setting.openTabById("hotkeys");let a=this.app.setting.activeTab;a.searchComponent.inputEl.value=t,a.updateHotkeyVisibility()})}).addExtraButton(o=>{o.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{Pt(this.plugin.settings.enabled_templates_hotkeys,r,r-1),this.plugin.save_settings(),this.display()})}).addExtraButton(o=>{o.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{Pt(this.plugin.settings.enabled_templates_hotkeys,r,r+1),this.plugin.save_settings(),this.display()})}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.command_handler.remove_template_hotkey(this.plugin.settings.enabled_templates_hotkeys[r]),this.plugin.settings.enabled_templates_hotkeys.splice(r,1),this.plugin.save_settings(),this.display()})}).infoEl.remove()}),new L.Setting(this.containerEl).addButton(t=>{t.setButtonText("Add new hotkey for template").setCta().onClick(()=>{this.plugin.settings.enabled_templates_hotkeys.push(""),this.plugin.save_settings(),this.display()})})}add_folder_templates_setting(){new L.Setting(this.containerEl).setName("Folder templates").setHeading();let e=document.createDocumentFragment();e.append("Folder templates are triggered when a new ",e.createEl("strong",{text:"empty "}),"file is created in a given folder.",e.createEl("br"),"Templater will fill the empty file with the specified template.",e.createEl("br"),"The deepest match is used. A global default template would be defined on the root ",e.createEl("code",{text:"/"}),"."),new L.Setting(this.containerEl).setDesc(e);let t=document.createDocumentFragment();t.append("When enabled, Templater will make use of the folder templates defined below. This option is mutually exclusive with file regex templates below, so enabling one will disable the other."),new L.Setting(this.containerEl).setName("Enable folder templates").setDesc(t).addToggle(r=>{r.setValue(this.plugin.settings.enable_folder_templates).onChange(i=>{this.plugin.settings.enable_folder_templates=i,i&&(this.plugin.settings.enable_file_templates=!1),this.plugin.save_settings(),this.display()})}),!!this.plugin.settings.enable_folder_templates&&(this.plugin.settings.folder_templates.forEach((r,i)=>{new L.Setting(this.containerEl).addSearch(a=>{new bn(this.app,a.inputEl),a.setPlaceholder("Folder").setValue(r.folder).onChange(l=>{if(l&&this.plugin.settings.folder_templates.some(c=>c.folder==l)){oe(new O("This folder already has a template associated with it"));return}this.plugin.settings.folder_templates[i].folder=l,this.plugin.save_settings()}),a.containerEl.addClass("templater_search")}).addSearch(a=>{new nn(a.inputEl,this.plugin,Le.TemplateFiles),a.setPlaceholder("Template").setValue(r.template).onChange(l=>{this.plugin.settings.folder_templates[i].template=l,this.plugin.save_settings()}),a.containerEl.addClass("templater_search")}).addExtraButton(a=>{a.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{Pt(this.plugin.settings.folder_templates,i,i-1),this.plugin.save_settings(),this.display()})}).addExtraButton(a=>{a.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{Pt(this.plugin.settings.folder_templates,i,i+1),this.plugin.save_settings(),this.display()})}).addExtraButton(a=>{a.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.settings.folder_templates.splice(i,1),this.plugin.save_settings(),this.display()})}).infoEl.remove()}),new L.Setting(this.containerEl).addButton(r=>{r.setButtonText("Add new folder template").setTooltip("Add additional folder template").setCta().onClick(()=>{this.plugin.settings.folder_templates.push({folder:"",template:""}),this.plugin.save_settings(),this.display()})}))}add_file_templates_setting(){new L.Setting(this.containerEl).setName("File regex templates").setHeading();let e=document.createDocumentFragment();e.append("File regex templates are triggered when a new ",e.createEl("strong",{text:"empty"})," file is created that matches one of them. Templater will fill the empty file with the specified template.",e.createEl("br"),"The first match from the top is used, so the order of the rules is important.",e.createEl("br"),"Use ",e.createEl("code",{text:".*"})," as a final catch-all, if you need it."),new L.Setting(this.containerEl).setDesc(e);let t=document.createDocumentFragment();t.append("When enabled, Templater will make use of the file regex templates defined below. This option is mutually exclusive with folder templates above, so enabling one will disable the other."),new L.Setting(this.containerEl).setName("Enable file regex templates").setDesc(t).addToggle(r=>{r.setValue(this.plugin.settings.enable_file_templates).onChange(i=>{this.plugin.settings.enable_file_templates=i,i&&(this.plugin.settings.enable_folder_templates=!1),this.plugin.save_settings(),this.display()})}),!!this.plugin.settings.enable_file_templates&&(this.plugin.settings.file_templates.forEach((r,i)=>{new L.Setting(this.containerEl).addText(a=>{a.setPlaceholder("File regex").setValue(r.regex).onChange(l=>{this.plugin.settings.file_templates[i].regex=l,this.plugin.save_settings()}),a.inputEl.addClass("templater_search")}).addSearch(a=>{new nn(a.inputEl,this.plugin,Le.TemplateFiles),a.setPlaceholder("Template").setValue(r.template).onChange(l=>{this.plugin.settings.file_templates[i].template=l,this.plugin.save_settings()}),a.containerEl.addClass("templater_search")}).addExtraButton(a=>{a.setIcon("up-chevron-glyph").setTooltip("Move up").onClick(()=>{Pt(this.plugin.settings.file_templates,i,i-1),this.plugin.save_settings(),this.display()})}).addExtraButton(a=>{a.setIcon("down-chevron-glyph").setTooltip("Move down").onClick(()=>{Pt(this.plugin.settings.file_templates,i,i+1),this.plugin.save_settings(),this.display()})}).addExtraButton(a=>{a.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.settings.file_templates.splice(i,1),this.plugin.save_settings(),this.display()})}).infoEl.remove()}),new L.Setting(this.containerEl).addButton(r=>{r.setButtonText("Add new file regex").setTooltip("Add additional file regex").setCta().onClick(()=>{this.plugin.settings.file_templates.push({regex:"",template:""}),this.plugin.save_settings(),this.display()})}))}add_startup_templates_setting(){new L.Setting(this.containerEl).setName("Startup templates").setHeading();let e=document.createDocumentFragment();e.append("Startup templates are templates that will get executed once when Templater starts.",e.createEl("br"),"These templates won't output anything.",e.createEl("br"),"This can be useful to set up templates adding hooks to Obsidian events for example."),new L.Setting(this.containerEl).setDesc(e),this.plugin.settings.startup_templates.forEach((t,r)=>{new L.Setting(this.containerEl).addSearch(o=>{new nn(o.inputEl,this.plugin,Le.TemplateFiles),o.setPlaceholder("Example: folder1/template_file").setValue(t).onChange(a=>{if(a&&this.plugin.settings.startup_templates.contains(a)){oe(new O("This startup template already exist"));return}this.plugin.settings.startup_templates[r]=a,this.plugin.save_settings()}),o.containerEl.addClass("templater_search")}).addExtraButton(o=>{o.setIcon("cross").setTooltip("Delete").onClick(()=>{this.plugin.settings.startup_templates.splice(r,1),this.plugin.save_settings(),this.display()})}).infoEl.remove()}),new L.Setting(this.containerEl).addButton(t=>{t.setButtonText("Add new startup template").setCta().onClick(()=>{this.plugin.settings.startup_templates.push(""),this.plugin.save_settings(),this.display()})})}add_user_script_functions_setting(){new L.Setting(this.containerEl).setName("User script functions").setHeading();let e=document.createDocumentFragment();e.append("All JavaScript files in this folder will be loaded as CommonJS modules, to import custom user functions.",e.createEl("br"),"The folder needs to be accessible from the vault.",e.createEl("br"),"Check the ",e.createEl("a",{href:"https://silentvoid13.github.io/Templater/",text:"documentation"})," for more information."),new L.Setting(this.containerEl).setName("Script files folder location").setDesc(e).addSearch(r=>{new bn(this.app,r.inputEl),r.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.user_scripts_folder).onChange(i=>{this.plugin.settings.user_scripts_folder=i,this.plugin.save_settings()}),r.containerEl.addClass("templater_search")}),new L.Setting(this.containerEl).setName("User script intellisense").setDesc("Determine how you'd like to have user script intellisense render. Note values will not render if not in the script.").addDropdown(r=>{r.addOption("0","Turn off intellisense").addOption("1","Render method description, parameters list, and return").addOption("2","Render method description and parameters list").addOption("3","Render method description and return").addOption("4","Render method description").setValue(this.plugin.settings.intellisense_render.toString()).onChange(i=>{this.plugin.settings.intellisense_render=parseInt(i),this.plugin.save_settings()})}),e=document.createDocumentFragment();let t;if(!this.plugin.settings.user_scripts_folder)t="No user scripts folder set";else{let r=ke(()=>ze(this.app,this.plugin.settings.user_scripts_folder),"User scripts folder doesn't exist");if(!r||r.length===0)t="No user scripts detected";else{let i=0;for(let o of r)o.extension==="js"&&(i++,e.append(e.createEl("li",{text:`tp.user.${o.basename}`})));t=`Detected ${i} User Script(s)`}}new L.Setting(this.containerEl).setName(t).setDesc(e).addExtraButton(r=>{r.setIcon("sync").setTooltip("Refresh").onClick(()=>{this.display()})})}add_user_system_command_functions_setting(){let e=document.createDocumentFragment();if(e.append("Allows you to create user functions linked to system commands.",e.createEl("br"),e.createEl("b",{text:"Warning: "}),"It can be dangerous to execute arbitrary system commands from untrusted sources. Only run system commands that you understand, from trusted sources."),new L.Setting(this.containerEl).setName("User system command functions").setHeading(),new L.Setting(this.containerEl).setName("Enable user system command functions").setDesc(e).addToggle(t=>{t.setValue(this.plugin.settings.enable_system_commands).onChange(r=>{this.plugin.settings.enable_system_commands=r,this.plugin.save_settings(),this.display()})}),this.plugin.settings.enable_system_commands){new L.Setting(this.containerEl).setName("Timeout").setDesc("Maximum timeout in seconds for a system command.").addText(o=>{o.setPlaceholder("Timeout").setValue(this.plugin.settings.command_timeout.toString()).onChange(a=>{let l=Number(a);if(isNaN(l)){oe(new O("Timeout must be a number"));return}this.plugin.settings.command_timeout=l,this.plugin.save_settings()})}),e=document.createDocumentFragment(),e.append("Full path to the shell binary to execute the command with.",e.createEl("br"),"This setting is optional and will default to the system's default shell if not specified.",e.createEl("br"),"You can use forward slashes ('/') as path separators on all platforms if in doubt."),new L.Setting(this.containerEl).setName("Shell binary location").setDesc(e).addText(o=>{o.setPlaceholder("Example: /bin/bash, ...").setValue(this.plugin.settings.shell_path).onChange(a=>{this.plugin.settings.shell_path=a,this.plugin.save_settings()})});let t=1;this.plugin.settings.templates_pairs.forEach(o=>{let a=this.containerEl.createEl("div");a.addClass("templater_div");let l=this.containerEl.createEl("h4",{text:"User function n\xB0"+t});l.addClass("templater_title"),new L.Setting(this.containerEl).addExtraButton(d=>{d.setIcon("cross").setTooltip("Delete").onClick(()=>{let m=this.plugin.settings.templates_pairs.indexOf(o);m>-1&&(this.plugin.settings.templates_pairs.splice(m,1),this.plugin.save_settings(),this.display())})}).addText(d=>{let m=d.setPlaceholder("Function name").setValue(o[0]).onChange(y=>{let b=this.plugin.settings.templates_pairs.indexOf(o);b>-1&&(this.plugin.settings.templates_pairs[b][0]=y,this.plugin.save_settings())});return m.inputEl.addClass("templater_template"),m}).addTextArea(d=>{let m=d.setPlaceholder("System command").setValue(o[1]).onChange(y=>{let b=this.plugin.settings.templates_pairs.indexOf(o);b>-1&&(this.plugin.settings.templates_pairs[b][1]=y,this.plugin.save_settings())});return m.inputEl.setAttr("rows",2),m.inputEl.addClass("templater_cmd"),m}).infoEl.remove(),a.appendChild(l),a.appendChild(this.containerEl.lastChild),t+=1});let r=this.containerEl.createEl("div");r.addClass("templater_div2"),new L.Setting(this.containerEl).addButton(o=>{o.setButtonText("Add new user function").setCta().onClick(()=>{this.plugin.settings.templates_pairs.push(["",""]),this.plugin.save_settings(),this.display()})}).infoEl.remove(),r.appendChild(this.containerEl.lastChild)}}add_donating_setting(){let e=new L.Setting(this.containerEl).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development."),t=document.createElement("a");t.setAttribute("href","https://github.com/sponsors/silentvoid13"),t.addClass("templater_donating");let r=document.createElement("img");r.src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86",t.appendChild(r);let i=document.createElement("a");i.setAttribute("href","https://www.paypal.com/donate?hosted_button_id=U2SRGAFYXT32Q"),i.addClass("templater_donating");let o=document.createElement("img");o.src="https://img.shields.io/badge/paypal-silentvoid13-yellow?style=social&logo=paypal",i.appendChild(o),e.settingEl.appendChild(t),e.settingEl.appendChild(i)}};var dr=X(require("obsidian"));var rn;(function(t){t[t.InsertTemplate=0]="InsertTemplate",t[t.CreateNoteTemplate=1]="CreateNoteTemplate"})(rn||(rn={}));var ii=class extends dr.FuzzySuggestModal{constructor(e){super(e.app);this.plugin=e,this.setPlaceholder("Type name of a template...")}getItems(){if(!this.plugin.settings.templates_folder)return this.app.vault.getMarkdownFiles();let e=ke(()=>ze(this.plugin.app,this.plugin.settings.templates_folder),`Couldn't retrieve template files from templates folder ${this.plugin.settings.templates_folder}`);return e||[]}getItemText(e){let t=e.path;if(e.path.startsWith(this.plugin.settings.templates_folder)&&(0,dr.normalizePath)(this.plugin.settings.templates_folder)!="/"){let r=this.plugin.settings.templates_folder.length,i=this.plugin.settings.templates_folder.endsWith("/")?r:r+1;t=e.path.slice(i)}return t.split(".").slice(0,-1).join(".")}onChooseItem(e){switch(this.open_mode){case 0:this.plugin.templater.append_template_to_active_file(e);break;case 1:this.plugin.templater.create_new_note_from_template(e,this.creation_folder);break}}start(){try{this.open()}catch(e){oe(e)}}insert_template(){this.open_mode=0,this.start()}create_new_note_from_template(e){this.creation_folder=e,this.open_mode=1,this.start()}};var Io="Error_MobileUnsupportedTemplate",qo='';var Oe=X(require("obsidian"));var dt=X(require("obsidian"));var we=class{constructor(e){this.plugin=e;this.static_functions=new Map;this.dynamic_functions=new Map}getName(){return this.name}async init(){await this.create_static_templates(),this.static_object=Object.fromEntries(this.static_functions)}async generate_object(e){return this.config=e,await this.create_dynamic_templates(),{...this.static_object,...Object.fromEntries(this.dynamic_functions)}}};var oi=class extends we{constructor(){super(...arguments);this.name="date"}async create_static_templates(){this.static_functions.set("now",this.generate_now()),this.static_functions.set("tomorrow",this.generate_tomorrow()),this.static_functions.set("weekday",this.generate_weekday()),this.static_functions.set("yesterday",this.generate_yesterday())}async create_dynamic_templates(){}async teardown(){}generate_now(){return(e="YYYY-MM-DD",t,r,i)=>{if(r&&!(0,dt.moment)(r,i).isValid())throw new O("Invalid reference date format, try specifying one with the argument 'reference_format'");let o;return typeof t=="string"?o=dt.moment.duration(t):typeof t=="number"&&(o=dt.moment.duration(t,"days")),(0,dt.moment)(r,i).add(o).format(e)}}generate_tomorrow(){return(e="YYYY-MM-DD")=>(0,dt.moment)().add(1,"days").format(e)}generate_weekday(){return(e="YYYY-MM-DD",t,r,i)=>{if(r&&!(0,dt.moment)(r,i).isValid())throw new O("Invalid reference date format, try specifying one with the argument 'reference_format'");return(0,dt.moment)(r,i).weekday(t).format(e)}}generate_yesterday(){return(e="YYYY-MM-DD")=>(0,dt.moment)().add(-1,"days").format(e)}};var le=X(require("obsidian"));var Lo=10,ai=class extends we{constructor(){super(...arguments);this.name="file";this.include_depth=0;this.create_new_depth=0;this.linkpath_regex=new RegExp("^\\[\\[(.*)\\]\\]$")}async create_static_templates(){this.static_functions.set("creation_date",this.generate_creation_date()),this.static_functions.set("create_new",this.generate_create_new()),this.static_functions.set("cursor",this.generate_cursor()),this.static_functions.set("cursor_append",this.generate_cursor_append()),this.static_functions.set("exists",this.generate_exists()),this.static_functions.set("find_tfile",this.generate_find_tfile()),this.static_functions.set("folder",this.generate_folder()),this.static_functions.set("include",this.generate_include()),this.static_functions.set("last_modified_date",this.generate_last_modified_date()),this.static_functions.set("move",this.generate_move()),this.static_functions.set("path",this.generate_path()),this.static_functions.set("rename",this.generate_rename()),this.static_functions.set("selection",this.generate_selection())}async create_dynamic_templates(){this.dynamic_functions.set("content",await this.generate_content()),this.dynamic_functions.set("tags",this.generate_tags()),this.dynamic_functions.set("title",this.generate_title())}async teardown(){}async generate_content(){return await this.plugin.app.vault.read(this.config.target_file)}generate_create_new(){return async(e,t,r=!1,i)=>{if(this.create_new_depth+=1,this.create_new_depth>Lo)throw this.create_new_depth=0,new O("Reached create_new depth limit (max = 10)");let o=await this.plugin.templater.create_new_note_from_template(e,i,t,r);return this.create_new_depth-=1,o}}generate_creation_date(){return(e="YYYY-MM-DD HH:mm")=>(0,le.moment)(this.config.target_file.stat.ctime).format(e)}generate_cursor(){return e=>`<% tp.file.cursor(${e??""}) %>`}generate_cursor_append(){return e=>{let t=this.plugin.app.workspace.activeEditor;if(!t||!t.editor){oe(new O("No active editor, can't append to cursor."));return}return t.editor.getDoc().replaceSelection(e),""}}generate_exists(){return async e=>{let t=(0,le.normalizePath)(e);return await this.plugin.app.vault.exists(t)}}generate_find_tfile(){return e=>{let t=(0,le.normalizePath)(e);return this.plugin.app.metadataCache.getFirstLinkpathDest(t,"")}}generate_folder(){return(e=!1)=>{let t=this.config.target_file.parent,r;return e?r=t.path:r=t.name,r}}generate_include(){return async e=>{if(this.include_depth+=1,this.include_depth>Lo)throw this.include_depth-=1,new O("Reached inclusion depth limit (max = 10)");let t;if(e instanceof le.TFile)t=await this.plugin.app.vault.read(e);else{let r;if((r=this.linkpath_regex.exec(e))===null)throw this.include_depth-=1,new O("Invalid file format, provide an obsidian link between quotes.");let{path:i,subpath:o}=(0,le.parseLinktext)(r[1]),a=this.plugin.app.metadataCache.getFirstLinkpathDest(i,"");if(!a)throw this.include_depth-=1,new O(`File ${e} doesn't exist`);if(t=await this.plugin.app.vault.read(a),o){let l=this.plugin.app.metadataCache.getFileCache(a);if(l){let c=(0,le.resolveSubpath)(l,o);c&&(t=t.slice(c.start.offset,c.end?.offset))}}}try{let r=await this.plugin.templater.parser.parse_commands(t,this.plugin.templater.current_functions_object);return this.include_depth-=1,r}catch(r){throw this.include_depth-=1,r}}}generate_last_modified_date(){return(e="YYYY-MM-DD HH:mm")=>(0,le.moment)(this.config.target_file.stat.mtime).format(e)}generate_move(){return async(e,t)=>{let r=t||this.config.target_file,i=(0,le.normalizePath)(`${e}.${r.extension}`),o=i.replace(/\\/g,"/").split("/");if(o.pop(),o.length){let a=o.join("/");this.plugin.app.vault.getAbstractFileByPath(a)||await this.plugin.app.vault.createFolder(a)}return await this.plugin.app.fileManager.renameFile(r,i),""}}generate_path(){return(e=!1)=>{let t="";if(le.Platform.isMobile){let r=this.plugin.app.vault.adapter.fs.uri,i=this.plugin.app.vault.adapter.basePath;t=`${r}/${i}`}else if(this.plugin.app.vault.adapter instanceof le.FileSystemAdapter)t=this.plugin.app.vault.adapter.getBasePath();else throw new O("app.vault is not a FileSystemAdapter instance");return e?this.config.target_file.path:`${t}/${this.config.target_file.path}`}}generate_rename(){return async e=>{if(e.match(/[\\/:]+/g))throw new O("File name cannot contain any of these characters: \\ / :");let t=(0,le.normalizePath)(`${this.config.target_file.parent.path}/${e}.${this.config.target_file.extension}`);return await this.plugin.app.fileManager.renameFile(this.config.target_file,t),""}}generate_selection(){return()=>{let e=this.plugin.app.workspace.activeEditor;if(!e||!e.editor)throw new O("Active editor is null, can't read selection.");return e.editor.getSelection()}}generate_tags(){let e=this.plugin.app.metadataCache.getFileCache(this.config.target_file);return e?(0,le.getAllTags)(e):null}generate_title(){return this.config.target_file.basename}};var Ho=X(require("obsidian"));var si=class extends we{constructor(){super(...arguments);this.name="web"}async create_static_templates(){this.static_functions.set("daily_quote",this.generate_daily_quote()),this.static_functions.set("request",this.generate_request()),this.static_functions.set("random_picture",this.generate_random_picture())}async create_dynamic_templates(){}async teardown(){}async getRequest(e){try{let t=await(0,Ho.requestUrl)(e);if(t.status<200&&t.status>=300)throw new O("Error performing GET request");return t}catch{throw new O("Error performing GET request")}}generate_daily_quote(){return async()=>{try{let t=(await this.getRequest("https://raw.githubusercontent.com/Zachatoo/quotes-database/refs/heads/main/quotes.json")).json,r=t[Math.floor(Math.random()*t.length)],{quote:i,author:o}=r;return`> [!quote] ${i} +> \u2014 ${o}`}catch{return new O("Error generating daily quote"),"Error generating daily quote"}}}generate_random_picture(){return async(e,t,r=!1)=>{try{let i=await this.getRequest(`https://templater-unsplash-2.fly.dev/${t?"?q="+t:""}`).then(a=>a.json),o=i.full;if(e&&!r)if(e.includes("x")){let[a,l]=e.split("x");o=o.concat(`&w=${a}&h=${l}`)}else o=o.concat(`&w=${e}`);return r?`![photo by ${i.photog}(${i.photogUrl}) on Unsplash|${e}](${o})`:`![photo by ${i.photog}(${i.photogUrl}) on Unsplash](${o})`}catch{return new O("Error generating random picture"),"Error generating random picture"}}}generate_request(){return async(e,t)=>{try{let i=await(await this.getRequest(e)).json;return t&&i?t.split(".").reduce((o,a)=>{if(o&&o.hasOwnProperty(a))return o[a];throw new Error(`Path ${t} not found in the JSON response`)},i):i}catch(r){throw console.error(r),new O("Error fetching and extracting value")}}}};var ci=class extends we{constructor(){super(...arguments);this.name="hooks";this.event_refs=[]}async create_static_templates(){this.static_functions.set("on_all_templates_executed",this.generate_on_all_templates_executed())}async create_dynamic_templates(){}async teardown(){this.event_refs.forEach(e=>{e.e.offref(e)}),this.event_refs=[]}generate_on_all_templates_executed(){return e=>{let t=this.plugin.app.workspace.on("templater:all-templates-executed",async()=>{await ar(1),e()});t&&this.event_refs.push(t)}}};var li=class extends we{constructor(){super(...arguments);this.name="frontmatter"}async create_static_templates(){}async create_dynamic_templates(){let e=this.plugin.app.metadataCache.getFileCache(this.config.target_file);this.dynamic_functions=new Map(Object.entries(e?.frontmatter||{}))}async teardown(){}};var Je=X(require("obsidian"));var pi=class extends Je.Modal{constructor(e,t,r,i){super(e);this.prompt_text=t;this.default_value=r;this.multi_line=i;this.submitted=!1}onOpen(){this.titleEl.setText(this.prompt_text),this.createForm()}onClose(){this.contentEl.empty(),this.submitted||this.reject(new O("Cancelled prompt"))}createForm(){let e=this.contentEl.createDiv();e.addClass("templater-prompt-div");let t;if(this.multi_line){t=new Je.TextAreaComponent(e);let r=this.contentEl.createDiv();r.addClass("templater-button-div");let i=new Je.ButtonComponent(r);i.buttonEl.addClass("mod-cta"),i.setButtonText("Submit").onClick(o=>{this.resolveAndClose(o)})}else t=new Je.TextComponent(e);this.value=this.default_value??"",t.inputEl.addClass("templater-prompt-input"),t.setPlaceholder("Type text here"),t.setValue(this.value),t.onChange(r=>this.value=r),t.inputEl.focus(),t.inputEl.addEventListener("keydown",r=>this.enterCallback(r))}enterCallback(e){e.isComposing||e.keyCode===229||(this.multi_line?Je.Platform.isDesktop&&e.key==="Enter"&&!e.shiftKey&&this.resolveAndClose(e):e.key==="Enter"&&this.resolveAndClose(e))}resolveAndClose(e){this.submitted=!0,e.preventDefault(),this.resolve(this.value),this.close()}async openAndGetValue(e,t){this.resolve=e,this.reject=t,this.open()}};var $o=X(require("obsidian")),ui=class extends $o.FuzzySuggestModal{constructor(e,t,r,i,o){super(e);this.text_items=t;this.items=r;this.submitted=!1;this.setPlaceholder(i),o&&(this.limit=o)}getItems(){return this.items}onClose(){this.submitted||this.reject(new O("Cancelled prompt"))}selectSuggestion(e,t){this.submitted=!0,this.close(),this.onChooseSuggestion(e,t)}getItemText(e){return this.text_items instanceof Function?this.text_items(e):this.text_items[this.items.indexOf(e)]||"Undefined Text Item"}onChooseItem(e){this.resolve(e)}async openAndGetValue(e,t){this.resolve=e,this.reject=t,this.open()}};var fi=class extends we{constructor(){super(...arguments);this.name="system"}async create_static_templates(){this.static_functions.set("clipboard",this.generate_clipboard()),this.static_functions.set("prompt",this.generate_prompt()),this.static_functions.set("suggester",this.generate_suggester())}async create_dynamic_templates(){}async teardown(){}generate_clipboard(){return async()=>await navigator.clipboard.readText()}generate_prompt(){return async(e,t,r=!1,i=!1)=>{let o=new pi(this.plugin.app,e,t,i),a=new Promise((l,c)=>o.openAndGetValue(l,c));try{return await a}catch(l){if(r)throw l;return null}}}generate_suggester(){return async(e,t,r=!1,i="",o)=>{let a=new ui(this.plugin.app,e,t,i,o),l=new Promise((c,d)=>a.openAndGetValue(c,d));try{return await l}catch(c){if(r)throw c;return null}}}};var di=class extends we{constructor(){super(...arguments);this.name="config"}async create_static_templates(){}async create_dynamic_templates(){}async teardown(){}async generate_object(e){return e}};var mi=class{constructor(e){this.plugin=e;this.modules_array=[];this.modules_array.push(new oi(this.plugin)),this.modules_array.push(new ai(this.plugin)),this.modules_array.push(new si(this.plugin)),this.modules_array.push(new li(this.plugin)),this.modules_array.push(new ci(this.plugin)),this.modules_array.push(new fi(this.plugin)),this.modules_array.push(new di(this.plugin))}async init(){for(let e of this.modules_array)await e.init()}async teardown(){for(let e of this.modules_array)await e.teardown()}async generate_object(e){let t={};for(let r of this.modules_array)t[r.getName()]=await r.generate_object(e);return t}};var En=X(require("obsidian"));var gi=class{constructor(e){this.plugin=e;if(En.Platform.isMobile||!(this.plugin.app.vault.adapter instanceof En.FileSystemAdapter))this.cwd="";else{this.cwd=this.plugin.app.vault.adapter.getBasePath();let{promisify:t}=require("util"),{exec:r}=require("child_process");this.exec_promise=t(r)}}async generate_system_functions(e){let t=new Map,r=await this.plugin.templater.functions_generator.generate_object(e,Qe.INTERNAL);for(let i of this.plugin.settings.templates_pairs){let o=i[0],a=i[1];!o||!a||(En.Platform.isMobile?t.set(o,()=>new Promise(l=>l(Io))):(a=await this.plugin.templater.parser.parse_commands(a,r),t.set(o,async l=>{let c={...process.env,...l},d={timeout:this.plugin.settings.command_timeout*1e3,cwd:this.cwd,env:c,...this.plugin.settings.shell_path&&{shell:this.plugin.settings.shell_path}};try{let{stdout:m}=await this.exec_promise(a,d);return m.trimRight()}catch(m){throw new O(`Error with User Template ${o}`,m)}})))}return t}async generate_object(e){let t=await this.generate_system_functions(e);return Object.fromEntries(t)}};var hi=class{constructor(e){this.plugin=e}async generate_user_script_functions(){let e=new Map,t=ke(()=>ze(this.plugin.app,this.plugin.settings.user_scripts_folder),`Couldn't find user script folder "${this.plugin.settings.user_scripts_folder}"`);if(!t)return new Map;for(let r of t)r.extension.toLowerCase()==="js"&&await this.load_user_script_function(r,e);return e}async load_user_script_function(e,t){let r=c=>window.require&&window.require(c),i={},o={exports:i},a=await this.plugin.app.vault.read(e);try{window.eval("(function anonymous(require, module, exports){"+a+` +})`)(r,o,i)}catch(c){throw new O(`Failed to load user script at "${e.path}".`,c.message)}let l=i.default||o.exports;if(!l)throw new O(`Failed to load user script at "${e.path}". No exports detected.`);if(!(l instanceof Function))throw new O(`Failed to load user script at "${e.path}". Default export is not a function.`);t.set(`${e.basename}`,l)}async generate_object(){let e=await this.generate_user_script_functions();return Object.fromEntries(e)}};var Ai=class{constructor(e){this.plugin=e;this.user_system_functions=new gi(e),this.user_script_functions=new hi(e)}async generate_object(e){let t={},r={};return this.plugin.settings.enable_system_commands&&(t=await this.user_system_functions.generate_object(e)),this.plugin.settings.user_scripts_folder&&(r=await this.user_script_functions.generate_object()),{...t,...r}}};var qs=X(require("obsidian")),Qe;(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.USER_INTERNAL=1]="USER_INTERNAL"})(Qe||(Qe={}));var _i=class{constructor(e){this.plugin=e;this.internal_functions=new mi(this.plugin),this.user_functions=new Ai(this.plugin)}async init(){await this.internal_functions.init()}async teardown(){await this.internal_functions.teardown()}additional_functions(){return{app:this.plugin.app,obsidian:qs}}async generate_object(e,t=1){let r={},i=this.additional_functions(),o=await this.internal_functions.generate_object(e),a={};switch(Object.assign(r,i),t){case 0:Object.assign(r,o);break;case 1:a=await this.user_functions.generate_object(e),Object.assign(r,{...o,user:a});break}return r}};var Vs={},N,He=new Array(32).fill(void 0);He.push(void 0,null,!0,!1);function Se(n){return He[n]}var Tn=He.length;function Ls(n){n<36||(He[n]=Tn,Tn=n)}function xi(n){let e=Se(n);return Ls(n),e}var Ko=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Ko.decode();var mr=new Uint8Array;function gr(){return mr.byteLength===0&&(mr=new Uint8Array(N.memory.buffer)),mr}function vt(n,e){return Ko.decode(gr().subarray(n,n+e))}function wt(n){Tn===He.length&&He.push(He.length+1);let e=Tn;return Tn=He[e],He[e]=n,e}var $e=0,hr=new TextEncoder("utf-8"),Hs=typeof hr.encodeInto=="function"?function(n,e){return hr.encodeInto(n,e)}:function(n,e){let t=hr.encode(n);return e.set(t),{read:n.length,written:t.length}};function mt(n,e,t){if(t===void 0){let l=hr.encode(n),c=e(l.length);return gr().subarray(c,c+l.length).set(l),$e=l.length,c}let r=n.length,i=e(r),o=gr(),a=0;for(;a127)break;o[i+a]=l}if(a!==r){a!==0&&(n=n.slice(a)),i=t(i,r,r=a+n.length*3);let l=gr().subarray(i+a,i+r);a+=Hs(n,l).written}return $e=a,i}function $s(n){return n==null}var Ar=new Int32Array;function Ce(){return Ar.byteLength===0&&(Ar=new Int32Array(N.memory.buffer)),Ar}function yi(n){let e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){let i=n.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=n.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(n)){let i=n.length,o="[";i>0&&(o+=yi(n[0]));for(let a=1;a1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} +${n.stack}`:r}function Ks(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);return n.ptr}var _r=32;function Rs(n){if(_r==1)throw new Error("out of js stack");return He[--_r]=n,_r}function ji(n,e){try{return n.apply(this,e)}catch(t){N.__wbindgen_exn_store(wt(t))}}var Ht=class{static __wrap(e){let t=Object.create(Ht.prototype);return t.ptr=e,t}__destroy_into_raw(){let e=this.ptr;return this.ptr=0,e}free(){let e=this.__destroy_into_raw();N.__wbg_parserconfig_free(e)}get interpolate(){let e=N.__wbg_get_parserconfig_interpolate(this.ptr);return String.fromCodePoint(e)}set interpolate(e){N.__wbg_set_parserconfig_interpolate(this.ptr,e.codePointAt(0))}get execution(){let e=N.__wbg_get_parserconfig_execution(this.ptr);return String.fromCodePoint(e)}set execution(e){N.__wbg_set_parserconfig_execution(this.ptr,e.codePointAt(0))}get single_whitespace(){let e=N.__wbg_get_parserconfig_single_whitespace(this.ptr);return String.fromCodePoint(e)}set single_whitespace(e){N.__wbg_set_parserconfig_single_whitespace(this.ptr,e.codePointAt(0))}get multiple_whitespace(){let e=N.__wbg_get_parserconfig_multiple_whitespace(this.ptr);return String.fromCodePoint(e)}set multiple_whitespace(e){N.__wbg_set_parserconfig_multiple_whitespace(this.ptr,e.codePointAt(0))}constructor(e,t,r,i,o,a,l){let c=mt(e,N.__wbindgen_malloc,N.__wbindgen_realloc),d=$e,m=mt(t,N.__wbindgen_malloc,N.__wbindgen_realloc),y=$e,b=mt(l,N.__wbindgen_malloc,N.__wbindgen_realloc),E=$e,P=N.parserconfig_new(c,d,m,y,r.codePointAt(0),i.codePointAt(0),o.codePointAt(0),a.codePointAt(0),b,E);return Ht.__wrap(P)}get opening_tag(){try{let r=N.__wbindgen_add_to_stack_pointer(-16);N.parserconfig_opening_tag(r,this.ptr);var e=Ce()[r/4+0],t=Ce()[r/4+1];return vt(e,t)}finally{N.__wbindgen_add_to_stack_pointer(16),N.__wbindgen_free(e,t)}}set opening_tag(e){let t=mt(e,N.__wbindgen_malloc,N.__wbindgen_realloc),r=$e;N.parserconfig_set_opening_tag(this.ptr,t,r)}get closing_tag(){try{let r=N.__wbindgen_add_to_stack_pointer(-16);N.parserconfig_closing_tag(r,this.ptr);var e=Ce()[r/4+0],t=Ce()[r/4+1];return vt(e,t)}finally{N.__wbindgen_add_to_stack_pointer(16),N.__wbindgen_free(e,t)}}set closing_tag(e){let t=mt(e,N.__wbindgen_malloc,N.__wbindgen_realloc),r=$e;N.parserconfig_set_closing_tag(this.ptr,t,r)}get global_var(){try{let r=N.__wbindgen_add_to_stack_pointer(-16);N.parserconfig_global_var(r,this.ptr);var e=Ce()[r/4+0],t=Ce()[r/4+1];return vt(e,t)}finally{N.__wbindgen_add_to_stack_pointer(16),N.__wbindgen_free(e,t)}}set global_var(e){let t=mt(e,N.__wbindgen_malloc,N.__wbindgen_realloc),r=$e;N.parserconfig_set_global_var(this.ptr,t,r)}},on=class{static __wrap(e){let t=Object.create(on.prototype);return t.ptr=e,t}__destroy_into_raw(){let e=this.ptr;return this.ptr=0,e}free(){let e=this.__destroy_into_raw();N.__wbg_renderer_free(e)}constructor(e){Ks(e,Ht);var t=e.ptr;e.ptr=0;let r=N.renderer_new(t);return on.__wrap(r)}render_content(e,t){try{let a=N.__wbindgen_add_to_stack_pointer(-16),l=mt(e,N.__wbindgen_malloc,N.__wbindgen_realloc),c=$e;N.renderer_render_content(a,this.ptr,l,c,Rs(t));var r=Ce()[a/4+0],i=Ce()[a/4+1],o=Ce()[a/4+2];if(o)throw xi(i);return xi(r)}finally{N.__wbindgen_add_to_stack_pointer(16),He[_r++]=void 0}}};async function Ys(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(r){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let t=await n.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{let t=await WebAssembly.instantiate(n,e);return t instanceof WebAssembly.Instance?{instance:t,module:n}:t}}function Us(){let n={};return n.wbg={},n.wbg.__wbindgen_object_drop_ref=function(e){xi(e)},n.wbg.__wbindgen_string_new=function(e,t){let r=vt(e,t);return wt(r)},n.wbg.__wbindgen_string_get=function(e,t){let r=Se(t),i=typeof r=="string"?r:void 0;var o=$s(i)?0:mt(i,N.__wbindgen_malloc,N.__wbindgen_realloc),a=$e;Ce()[e/4+1]=a,Ce()[e/4+0]=o},n.wbg.__wbg_call_97ae9d8645dc388b=function(){return ji(function(e,t){let r=Se(e).call(Se(t));return wt(r)},arguments)},n.wbg.__wbg_new_8d2af00bc1e329ee=function(e,t){let r=new Error(vt(e,t));return wt(r)},n.wbg.__wbg_message_fe2af63ccc8985bc=function(e){let t=Se(e).message;return wt(t)},n.wbg.__wbg_newwithargs_8fe23e3842840c8e=function(e,t,r,i){let o=new Function(vt(e,t),vt(r,i));return wt(o)},n.wbg.__wbg_call_168da88779e35f61=function(){return ji(function(e,t,r){let i=Se(e).call(Se(t),Se(r));return wt(i)},arguments)},n.wbg.__wbg_call_3999bee59e9f7719=function(){return ji(function(e,t,r,i){let o=Se(e).call(Se(t),Se(r),Se(i));return wt(o)},arguments)},n.wbg.__wbindgen_debug_string=function(e,t){let r=yi(Se(t)),i=mt(r,N.__wbindgen_malloc,N.__wbindgen_realloc),o=$e;Ce()[e/4+1]=o,Ce()[e/4+0]=i},n.wbg.__wbindgen_throw=function(e,t){throw new Error(vt(e,t))},n}function Gs(n,e){}function Ws(n,e){return N=n.exports,Ro.__wbindgen_wasm_module=e,Ar=new Int32Array,mr=new Uint8Array,N}async function Ro(n){typeof n=="undefined"&&(n=new URL("rusty_engine_bg.wasm",Vs.url));let e=Us();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n)),Gs(e);let{instance:t,module:r}=await Ys(await n,e);return Ws(t,r)}var Yo=Ro;var Uo=Ui("AGFzbQEAAAABvwEaYAJ/fwBgAn9/AX9gAX8Bf2ADf39/AX9gA39/fwBgAX8AYAV/f39/fwBgBH9/f38AYAR/f39/AX9gAABgBX9/f39/AX9gAX8BfmA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BC0AA0E/cSAIQQZ0cnIiBUGAgMQARg0BIARBBGoLIQMgBUEgRiAFQXdqQQVJckUEQCAFQYABSQ0DIAUQLEUNAwsgByAEayADaiEHIAMgCUcNAQsLIAIhBwsgASAHaiEBIAIgB2shAgsgACACNgIEIAAgATYCACAGQRBqJAALyAsBCH8jAEHgAGsiAyQAIABCATcCACAAQQhqIgRBADYCACAAQQBBEBBBIAQoAgAiBSAAKAIAaiIGQdSDwAApAAA3AAAgBCAFQRBqNgIAIAZBCGpB3IPAACkAADcAACADQQE2AiwgAyABKAIIQShqIgU2AiggAyAANgIYIANB3ABqQQE2AgAgA0ICNwJMIANB8IPAADYCSCADIANBKGo2AlgCQAJAAkACQAJAAkAgA0EYakGYisAAIANByABqEB5FBEAgAigCACEIAkAgAigCCCIBRQ0AIAFBBHQhCkGQhMAAIQZBACEBQQAhBANAAn8gASAIaiIHQQRqIgkgBygCAEUNABoCQCAERQ0AIANBEGogBCgCACAEKAIEQQAgBiAGLQAAQQJGG0EBEBAgA0EIaiADKAIQIAMoAhRBACAHQQ1qIgQgBC0AAEECRhtBABAQIANBGGogAygCCCADKAIMEBIgA0EBNgI0IANBATYCLCADIAU2AiggAyADQRhqNgIwIAMgADYCRCADQQI2AlwgA0IDNwJMIANBmITAADYCSCADIANBKGo2AlggA0HEAGpBmIrAACADQcgAahAeDQUgAygCHEUNACADKAIYEBULIAdBDmohBgJAIAdBDGotAABFBEAgA0ECNgIsIAMgCTYCKCADIAA2AhggA0EBNgJcIANCAjcCTCADQfSEwAA2AkggAyADQShqNgJYIANBGGpBmIrAACADQcgAahAeDQcgA0ECNgI0IANBoIXAADYCMCADQQE2AiwgAyAFNgIoIAMgADYCGCADQQI2AlwgA0IDNwJMIANBmITAADYCSCADIANBKGo2AlggA0EYakGYisAAIANByABqEB5FDQFBq4HAAEErIANByABqQdiBwABBqIXAABBSAAsgA0ECNgIsIAMgCTYCKCADIAA2AhggA0EBNgJcIANCAjcCTCADQcSEwAA2AkggAyADQShqNgJYIANBGGpBmIrAACADQcgAahAeDQcLQQALIQQgCiABQRBqIgFHDQALIARFDQAgAyAEKAIAIAQoAgRBACAGIAYtAABBAkYbQQEQECADQRhqIAMoAgAgAygCBBASIANBNGpBATYCACADQQE2AiwgAyAFNgIoIAMgA0EYajYCMCADIAA2AkQgA0HcAGpBAjYCACADQgM3AkwgA0GYhMAANgJIIAMgA0EoajYCWCADQcQAakGYisAAIANByABqEB4NBSADKAIcRQ0AIAMoAhgQFQsgAEEEaigCACAAQQhqIgQoAgAiAWtBJ00EQCAAIAFBKBBBIAQoAgAhAQsgBCABQShqNgIAIAAoAgAgAWoiAUHIhcAAKQAANwAAIAFBCGpB0IXAACkAADcAACABQRBqQdiFwAApAAA3AAAgAUEYakHghcAAKQAANwAAIAFBIGpB6IXAACkAADcAACADQTxqQQI2AgAgA0E0akEBNgIAIANBoIXAADYCOCADIAU2AjAgA0EBNgIsIAMgBTYCKCADIAA2AhggA0HcAGoiAUEDNgIAIANCBDcCTCADQZiGwAA2AkggAyADQShqNgJYIANBGGpBmIrAACADQcgAahAeDQUgA0EBNgIsIAMgBTYCKCADIAA2AhggAUEBNgIAIANCAjcCTCADQdCGwAA2AkggAyADQShqNgJYIANBGGpBmIrAACADQcgAahAeDQYgAkEEaigCAARAIAgQFQsgA0HgAGokAA8LQauBwABBKyADQcgAakHYgcAAQYCEwAAQUgALQauBwABBKyADQcgAakHYgcAAQbCEwAAQUgALQauBwABBKyADQcgAakHYgcAAQYSFwAAQUgALQauBwABBKyADQcgAakHYgcAAQdSEwAAQUgALQauBwABBKyADQcgAakHYgcAAQbiFwAAQUgALQauBwABBKyADQcgAakHYgcAAQbiGwAAQUgALQauBwABBKyADQcgAakHYgcAAQeCGwAAQUgAL7QkCCH8GfiMAQdAAayIDJAACQAJAAkAQVCIEBEAgA0EgakIANwMAIANBHGpBkIrAADYCACAEIAQpAwAiC0IBfDcDACADQQA2AhggAyALNwMIIAMgBEEIaikDADcDECADQqeAgIDwBDcDSCADQo2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QRBqKQIANwMAIAFBgAFqIgMgAEEIaikCADcDACABQZABaiIEIABBGGopAgA3AwAgAUGYAWoiBSAAQSBqKQIANwMAIAFBoAFqIgYgAEEoaikCADcDACABQagBaiIHIABBMGopAgA3AwAgAUEQaiIIIAFBhAFqKQIANwMAIAFBGGoiCSABQYwBaikCADcDACABQSBqIgogAUGUAWopAgA3AwAgAUEoaiILIAFBnAFqKQIANwMAIAFBMGoiDCABQaQBaikCADcDACABQThqIg0gAUGsAWooAgA2AgAgASAAKQIANwN4IAEgASkCfDcDCCAAEBUgAUHwAGogDSgCADYCACABQegAaiAMKQMANwMAIAFB4ABqIAspAwA3AwAgAUHYAGogCikDADcDACABQdAAaiAJKQMANwMAIAFByABqIAgpAwA3AwAgASABKQMINwNAIAFB+ABqIAFBQGsQOkE8QQQQngEiAEUNAiAAQQA2AgAgACABKQN4NwIEIABBDGogAykDADcCACAAQRRqIAIpAwA3AgAgAEEcaiAEKQMANwIAIABBJGogBSkDADcCACAAQSxqIAYpAwA3AgAgAEE0aiAHKQMANwIAIAFBsAFqJAAgAA8LEK0BAAsQrgEAC0E8QQQQswEAC9cEAQR/IAAgARC6ASECAkACQAJAIAAQsAENACAAKAIAIQMCQCAAEKUBRQRAIAEgA2ohASAAIAMQuwEiAEHAscAAKAIARw0BIAIoAgRBA3FBA0cNAkG4scAAIAE2AgAgACABIAIQhgEPCyABIANqQRBqIQAMAgsgA0GAAk8EQCAAEDUMAQsgAEEMaigCACIEIABBCGooAgAiBUcEQCAFIAQ2AgwgBCAFNgIIDAELQaiuwABBqK7AACgCAEF+IANBA3Z3cTYCAAsgAhCiAQRAIAAgASACEIYBDAILAkBBxLHAACgCACACRwRAIAJBwLHAACgCAEcNAUHAscAAIAA2AgBBuLHAAEG4scAAKAIAIAFqIgE2AgAgACABEJQBDwtBxLHAACAANgIAQbyxwABBvLHAACgCACABaiIBNgIAIAAgAUEBcjYCBCAAQcCxwAAoAgBHDQFBuLHAAEEANgIAQcCxwABBADYCAA8L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gAXI6AAwgAiABQQZ2QT9xQYABcjoADUEDDAMLIAAoAggiAyAAQQRqKAIARgR/IAAgAxBAIAAoAggFIAMLIAAoAgBqIAE6AAAgACAAKAIIQQFqNgIIDAMLIAIgAUE/cUGAAXI6AA0gAiABQQZ2QcABcjoADEECDAELIAIgAUE/cUGAAXI6AA8gAiABQQZ2QT9xQYABcjoADiACIAFBDHZBP3FBgAFyOgANIAIgAUESdkEHcUHwAXI6AAxBBAshASAAQQRqKAIAIABBCGoiBCgCACIDayABSQRAIAAgAyABEEEgBCgCACEDCyAAKAIAIANqIAJBDGogARC5ARogBCABIANqNgIACyACQRBqJABBAAvVAgEDfyMAQRBrIgIkAAJAAn8CQCABQYABTwRAIAJBADYCDCABQYAQTw0BIAIgAUE/cUGAAXI6AA0gAiABQQZ2QcABcjoADEECDAILIAAoAggiAyAAQQRqKAIARgRAIAAgAxBDIAAoAgghAwsgACADQQFqNgIIIAAoAgAgA2ogAToAAAwCCyABQYCABE8EQCACIAFBP3FBgAFyOgAPIAIgAUEGdkE/cUGAAXI6AA4gAiABQQx2QT9xQYABcjoADSACIAFBEnZBB3FB8AFyOgAMQQQMAQsgAiABQT9xQYABcjoADiACIAFBDHZB4AFyOgAMIAIgAUEGdkE/cUGAAXI6AA1BAwshASAAQQRqKAIAIABBCGoiBCgCACIDayABSQRAIAAgAyABEEIgBCgCACEDCyAAKAIAIANqIAJBDGogARC5ARogBCABIANqNgIACyACQRBqJAAL1wIBA38jAEEQayICJAACQAJ/AkACQCABQYABTwRAIAJBADYCDCABQYAQSQ0BIAFBgIAETw0CIAIgAUE/cUGAAXI6AA4gAiABQQx2QeABcjoADCACIAFBBnZBP3FBgAFyOgANQQMMAwsgACgCCCIDIABBBGooAgBGBEAgACADEEMgACgCCCEDCyAAIANBAWo2AgggACgCACADaiABOgAADAMLIAIgAUE/cUGAAXI6AA0gAiABQQZ2QcABcjoADEECDAELIAIgAUE/cUGAAXI6AA8gAiABQQZ2QT9xQYABcjoADiACIAFBD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DwsgACABQQRqNgIAIARBEnRBgIDwAHEgAS0AA0E/cSACQQZ0cnIFIAMLC68BAQN/IwBBIGsiAiQAAkAgAUEBaiIDIAFJDQAgAEEEaigCACIBQQF0IgQgAyAEIANLGyIDQQggA0EISxshAyACIAEEfyACIAE2AhQgAiAAKAIANgIQQQEFQQALNgIYIAIgA0EBIAJBEGoQSyACKAIABEAgAkEIaigCACIARQ0BIAIoAgQgABCzAQALIAIoAgQhASAAQQRqIAM2AgAgACABNgIAIAJBIGokAA8LEHMAC68BAQJ/IwBBIGsiAyQAAkAgASACaiICIAFJDQAgAEEEaigCACIBQQF0IgQgAiAEIAJLGyICQQggAkEISxshBCADIAEEfyADIAE2AhQgAyAAKAIANgIQQQEFQQALNgIYIAMgBEEBIANBEGoQSyADKAIABEAgA0EIaigCACIARQ0BIAMoAgQgABCzAQALIAMoAgQhASAAQQRqIAQ2AgAgACABNgIAIANBIGokAA8LEHMAC60BAQJ/IwBBIGsiAyQAAkAgASACaiICIAFJDQAgAEEEaigCACIBQQF0IgQgAiAEIAJLGyICQQggAkEISxshBCADIAEEfyADIAE2AhQgAyAAKAIANgIQQQEFQQALNgIYIAMgBCADQRBqEEogAygCAARAIANBCGooAgAiAEUNASADKAIEIAAQswEACyADKAIEIQEgAEEEaiAENgIAIAAgATYCACADQSBqJAAPCxBzAAutAQEDfyMAQSBrIgIkAAJAIAFBAWoiAyABSQ0AIABBBGooAgAiAUEBdCIEIAMgBCADSxsiA0EIIANBCEsbIQMgAiABBH8gAiABNgIUIAIgACgCADYCEEEBBUEACzYCGCACIAMgAkEQahBKIAIoAgAEQCACQQhqKAIAIgBFDQEgAigCBCAAELMBAAsgAigCBCEBIABBBGogAzYCACAAIAE2AgAgAkEgaiQADwsQcwAL7wEBA38jAEEgayIFJABBjK7AAEGMrsAAKAIAIgdBAWo2AgBB7LHAAEHsscAAKAIAQQFqIgY2AgACQAJAIAdBAEggBkECS3INACAFIAQ6ABggBSADNgIUIAUgAjYCEEGArsAAKAIAIgJBf0wNAEGArsAAIAJBAWoiAjYCAEGArsAAQYiuwAAoAgAiAwR/QYSuwAAoAgAgBSAAIAEoAhARAAAgBSAFKQMANwMIIAVBCGogAygCFBEAAEGArsAAKAIABSACC0F/ajYCACAGQQFLDQAgBA0BCwALIwBBEGsiAiQAIAIgATYCDCACIAA2AggAC58BAQN/AkAgAUEPTQRAIAAhAgwBCyAAQQAgAGtBA3EiBGohAyAEBEAgACECA0AgAkH/AToAACACQQFqIgIgA0kNAAsLIAMgASAEayIBQXxxIgRqIQIgBEEBTgRAA0AgA0F/NgIAIANBBGoiAyACSQ0ACwsgAUEDcSEBCyABBEAgASACaiEBA0AgAkH/AToAACACQQFqIgIgAUkNAAsLIAALrAEBA38jAEEQayIDJAACQAJAIAEEQCABKAIAIgJBf0YNASABIAJBAWo2AgAgAyABQQRqEGEgASABKAIAQX9qNgIAIAMoAgAhAQJAIAMoAgQiAiADKAIIIgRNBEAgASECDAELIARFBEBBASECIAEQFQwBCyABIAJBASAEEJkBIgJFDQMLIAAgBDYCBCAAIAI2AgAgA0EQaiQADwsQrQEACxCuAQALIARBARCzAQALrAEBA38jAEEQayIDJAACQAJAIAEEQCABKAIAIgJBf0YNASABIAJBAWo2AgAgAyABQRBqEGEgASABKAIAQX9qNgIAIAMoAgAhAQJAIAMoAgQiAiADKAIIIgRNBEAgASECDAELIARFBEBBASECIAEQFQwBCyABIAJBASAEEJkBIgJFDQMLIAAgBDYCBCAAIAI2AgAgA0EQaiQADwsQrQEACxCuAQALIARBARCzAQALrAEBA38jAEEQayIDJAACQAJAIAEEQCABKAIAIgJBf0YNASABIAJBAWo2AgAgAyABQSxqEGEgASABKAIAQX9qNgIAIAMoAgAhAQJAIAMoAgQiAiADKAIIIgRNBEAgASECDAELIARFBEBBASECIAEQFQwBCyABIAJBASAEEJkBIgJFDQMLIAAgBDYCBCAAIAI2AgAgA0EQaiQADwsQrQEACxCuAQALIARBARCzAQALrAEBA38jAEEwayICJAAgAUEEaiEDIAEoA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AogCTYCNCAKIAk2AjAgCiAINgIsIAogBzYCKCAKIAY2AiQgCiAFNgIgIAogBDYCHCAKIAM2AhggCiADNgIUIAogAjYCECAKIAE2AgwgCiABNgIIIAogADYCBCAKQQA2AgAgCgt8AQN/IAAgABC8ASIAQQgQlwEgAGsiAhC6ASEAQbyxwAAgASACayIBNgIAQcSxwAAgADYCACAAIAFBAXI2AgRBCEEIEJcBIQJBFEEIEJcBIQNBEEEIEJcBIQQgACABELoBIAQgAyACQQhramo2AgRB4LHAAEGAgIABNgIAC28BBH8jAEEgayICJABBASEDAkAgACABEDMNACABQRxqKAIAIQQgASgCGCACQRxqQQA2AgAgAkGAk8AANgIYIAJCATcCDCACQYSTwAA2AgggBCACQQhqEB4NACAAQQRqIAEQMyEDCyACQSBqJAAgAwtvAQF/IwBBMGsiAiQAIAIgATYCBCACIAA2AgAgAkEcakECNgIAIAJBLGpBAzYCACACQgI3AgwgAkGklsAANgIIIAJBAzYCJCACIAJBIGo2AhggAiACQQRqNgIoIAIgAjYCICACQQhqQdSWwAAQdAALbwEBfyMAQTBrIgIkACACIAE2AgQgAiAANgIAIAJBHGpBAjYCACACQSxqQQM2AgAgAkICNwIMIAJBuJfAADYCCCACQQM2AiQgAiACQSBqNgIYIAIgAkEEajYCKCACIAI2AiAgAkEIakHIl8AAEHQAC28BAX8jAEEwayICJAAgAiABNgIEIAIgADYCACACQRxqQQI2AgAgAkEsakEDNgIAIAJCAjcCDCACQfSWwAA2AgggAkEDNgIkIAIgAkEgajYCGCACIAJBBGo2AiggAiACNgIgIAJBCGpBhJfAABB0AAtsAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBAzYCACADQgI3AgwgA0HAk8AANgIIIANBAzYCJCADIANBIGo2AhggAyADNgIoIAMgA0EEajYCICADQQhqIAIQdAALVgECfyMAQSBrIgIkACAAQRxqKAIAIQMgACgCGCACQRhqIAFBEGopAgA3AwAgAkEQaiABQQhqKQIANwMAIAIgASkCADcDCCADIAJBCGoQHiACQSBqJAALWQEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEakGYisAAIAJBCGoQHiACQSBqJAALWQEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEakGAjsAAIAJBCGoQHiACQSBqJAALZwAjAEEwayIBJABB2K3AAC0AAARAIAFBHGpBATYCACABQgI3AgwgAUH0jsAANgIIIAFBAzYCJCABIAA2AiwgASABQSBqNgIYIAEgAUEsajYCICABQQhqQZyPwAAQdAALIAFBMGokAAtZAQF/IwBBIGsiAiQAIAIgACgCADYCBCACQRhqIAFBEGopAgA3AwAgAkEQaiABQQhqKQIANwMAIAIgASkCADcDCCACQQRqQbSRwAAgAkEIahAeIAJBIGokAAtnAQJ/IAEoAgAhAwJAAkACQCABQQhqKAIAIgFFBEBBASECDAELIAFBf0wNASABQQEQngEiAkUNAgsgAiADIAEQuQEhAiAAIAE2AgggACABNgIEIAAgAjYCAA8LEHMACyABQQEQswEAC1YBAX8jAEEgayICJAAgAiAANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpBmIrAACACQQhqEB4gAkEgaiQAC1YBAX8CQCAABEAgACgCAA0BIABBfzYCACAAQQhqIgMoAgAEQCAAKAIEEBULIAAgATYCBCAAQQA2AgAgAEEMaiACNgIAIAMgAjYCAA8LEK0BAAsQrgEAC1YBAX8CQCAABEAgACgCAA0BIABBfzYCACAAQRRqIgMoAgAEQCAAKAIQEBULIAAgATYCECAAQQA2AgAgAEEYaiACNgIAIAMgAjYCAA8LEK0BAAsQrgEAC1YBAX8CQCAABEAgACgCAA0BIABBfzYCACAAQTBqIgMoAgAEQCAAKAIsEBULIAAgATYCLCAAQQA2AgAgAEE0aiACNgIAIAMgAjYCAA8LEK0BAAsQrgEAC1YBAX8jAEEQayIFJAAgASgCACACKAIAIAMoAgAgBCgCABAIIQEgBUEIahCDASAFKAIMIQIgACAFKAIIIgNBAEc2AgAgACACIAEgAxs2AgQgBUEQaiQAC08BAn8gACgCACIDQQRqKAIAIANBCGoiBCgCACIAayACSQRAIAMgACACEEEgBCgCACEACyADKAIAIABqIAEgAhC5ARogBCAAIAJqNgIAQQALTwECfyAAKAIAIgNBBGooAgAgA0EIaiIEKAIAIgBrIAJJBEAgAyAAIAIQQiAEKAIAIQALIAMoAgAgAGogASACELkBGiAEIAAgAmo2AgBBAAtRAQF/IwBBEGsiBCQAIAEoAgAgAigCACADKAIAEAchASAEQQhqEIMBIAQoAgwhAiAAIAQoAggiA0EARzYCACAAIAIgASADGzYCBCAEQRBqJAALSgECfyAAQQRqKAIAIABBCGoiBCgCACIDayACSQRAIAAgAyACEEEgBCgCACEDCyAAKAIAIANqIAEgAhC5ARogBCACIANqNgIAQQALPwEBfyMAQSBrIgAkACAAQRxqQQA2AgAgAEGwkMAANgIYIABCATcCDCAAQcyQwAA2AgggAEEIakGkkcAAEHQAC0MBA38CQCACRQ0AA0AgAC0AACIEIAEtAAAiBUYEQCAAQQFqIQAgAUEBaiEBIAJBf2oiAg0BDAILCyAEIAVrIQMLIAMLTAECfyMAQRBrIgMkACABKAIAIAIoAgAQAyEBIANBCGoQgwEgAygCDCECIAAgAygCCCIEQQBHNgIAIAAgAiABIAQbNgIEIANBEGokAAtLAAJAAn8gAUGAgMQARwRAQQEgACgCGCABIABBHGooAgAoAhARAQANARoLIAINAUEACw8LIAAoAhggAiADIABBHGooAgAoAgwRAwALRwEBfyMAQSBrIgIkACACQRRqQQA2AgAgAkGAk8AANgIQIAJCATcCBCACQSs2AhwgAiAANgIYIAIgAkEYajYCACACIAEQdAALRgECfyABKAIEIQIgASgCACEDQQhBBBCeASIBRQRAQQhBBBCzAQALIAEgAjYCBCABIAM2AgAgAEH4j8AANgIEIAAgATYCAAs5AQF/IAFBEHZAACECIABBADYCCCAAQQAgAUGAgHxxIAJBf0YiARs2AgQgAEEAIAJBEHQgARs2AgALZAEDfyMAQRBrIgEkACAAKAIMIgJFBEBBmI7AAEHIj8AAEG8ACyAAKAIIIgNFBEBBmI7AAEHYj8AAEG8ACyABIAI2AgggASAANgIEIAEgAzYCACABKAIAIAEoAgQgASgCCBBQAAs/AQF/IwBBIGsiACQAIABBHGpBADYCACAAQcyRwAA2AhggAEIBNwIMIABBjJLAADYCCCAAQQhqQZSSwAAQdAALPgEBfyMAQSBrIgIkACACQQE6ABggAiABNgIUIAIgADYCECACQfyTwAA2AgwgAkGAk8AANgIIIAJBCGoQcgALKwACQCAAQXxLDQAgAEUEQEEEDwsgACAAQX1JQQJ0EJ4BIgBFDQAgAA8LAAsiACMAQRBrIgAkACAAQQhqIAEQfSAAQQhqEFMgAEEQaiQACysAAkAgAARAIAAoAgANASAAQQA2AgAgAEEcaiABNgIADwsQrQEACxCuAQALKwACQCAABEAgACgCAA0BIABBADYCACAAQSBqIAE2AgAPCxCtAQALEK4BAAsrAAJAIAAEQCAAKAIADQEgAEEANgIAIABBJGogATYCAA8LEK0BAAsQrgEACysAAkAgAARAIAAoAgANASAAQQA2AgAgAEEoaiABNgIADwsQrQEACxCuAQALQAEBfyMAQRBrIgQkACAEIAM2AgwgBCACNgIIIAQgATYCBCAEIAA2AgAgBCgCACAEKAIEIAQoAgggBCgCDBATAAs3ACAAQQM6ACAgAEKAgICAgAQ3AgAgACABNgIYIABBADYCECAAQQA2AgggAEEcakHEh8AANgIACzUBAX8gASgCGEHDjsAAQQsgAUEcaigCACgCDBEDACECIABBADoABSAAIAI6AAQgACABNgIACyUAAkAgAARAIAAoAgBBf0YNASAAQRxqKAIADwsQrQEACxCuAQALJQACQCAABEAgACgCAEF/Rg0BIABBIGooAgAPCxCtAQALEK4BAAslAAJAIAAEQCAAKAIAQX9GDQEgAEEkaigCAA8LEK0BAAsQrgEACyUAAkAgAARAIAAoAgBBf0YNASAAQShqKAIADwsQrQEACxCuAQALJwAgACAAKAIEQQFxIAFyQQJyNgIEIAAgAWoiACAAKAIEQQFyNgIECzoBAn9B3K3AAC0AACEBQdytwABBADoAAEHgrcAAKAIAIQJB4K3AAEEANgIAIAAgAjYCBCAAIAE2AgALIAEBfwJAIAAoAgQiAUUNACAAQQhqKAIARQ0AIAEQFQsLHwACQCABQXxNBEAgACABQQQgAhCZASIADQELAAsgAAsjACACIAIoAgRBfnE2AgQgACABQQFyNgIEIAAgAWogATYCAAslACAARQRAQciMwABBMBCsAQALIAAgAiADIAQgBSABKAIQEQoACyMAIABFBEBByIzAAEEwEKwBAAsgACACIAMgBCABKAIQEQgACyMAIABFBEBByIzAAEEwEKwBAAsgACACIAMgBCABKAIQEQcACyMAIABFBEBByIzAAEEwEKwBAAsgACACIAMgBCABKAIQERUACyMAIABFBEBByIzAAEEwEKwBAAsgACACIAMgBCABKAIQERIACyMAIABFBEBByIzAAEEwEKwBAAsgACACIAMgBCABKAIQERQACx4AIAAgAUEDcjYCBCAAIAFqIgAgACgCBEEBcjYCBAsUACAAQQRqKAIABEAgACgCABAVCwshACAARQRAQciMwABBMBCsAQALIAAgAiADIAEoAhARBAALHwAgAEUEQEHIjMAAQTAQrAEACyAAIAIgASgCEBEBAAsZAQF/IAAoAhAiAQR/IAEFIABBFGooAgALCxkAIAAoAgAiACgCACAAQQhqKAIAIAEQtwELEgBBAEEZIABBAXZrIABBH0YbCxYAIAAgAUEBcjYCBCAAIAFqIAE2AgALHAAgASgCGEHgpsAAQQUgAUEcaigCACgCDBEDAAsTACAAKAIAIgBBJE8EQCAAEAALCxAAIAAgAWpBf2pBACABa3ELFAAgACgCACAAQQhqKAIAIAEQtwELDAAgACABIAIgAxAYCwsAIAEEQCAAEBULCw8AIABBAXQiAEEAIABrcgsUACAAKAIAIAEgACgCBCgCDBEBAAsRACAAKAIAIAAoAgQgARC3AQsIACAAIAEQJwsWAEHgrcAAIAA2AgBB3K3AAEEBOgAACw0AIAAoAgAgARAuQQALEwAgAEH4j8AANg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EMAQkBKAEDATcBAQMFAwEEBwILAh0BOgECAQIBAwEFAgcCCwIcAjkCAQECBAgBCQEKAh0BSAEEAQIDAQEIAVEBAgcMCGIBAgkLBkoCGwEBAQEBNw4BBQECBQsBJAkBZgQBBgECAgIZAgQDEAQNAQICBgEPAQADAAMdAh4CHgJAAgEHCAECCwkBLQMBAXUCIgF2AwQCCQEGA9sCAgE6AQEHAQEBAQIIBgoCATAfMQQwBwEBBQEoCQwCIAQCAgEDOAEBAgMBAQM6CAICmAMBDQEHBAEGAQMCxkAAAcMhAAONAWAgAAZpAgAEAQogAlACAAEDAQQBGQIFAZcCGhINASYIGQsuAzABAgQCAicBQwYCAgICDAEIAS8BMwEBAwICBQIBASoCCAHuAQIBBAEAAQAQEBAAAgAB4gGVBQADAQIFBCgDBAGlAgAEAAKZCzEEewE2DykBAgIKAzEEAgIHAT0DJAUBCD4BDAI0CQoEAgFfAwIBAQIGAaABAwgVAjkCAQEBARYBDgcDBcMIAgMBARcBUQECBgEBAgEBAgEC6wECBAYCAQIbAlUIAgEBAmoBAQECBgEBZQMCBAEFAAkBAvUBCgIBAQQBkAQCAgQBIAooBgIECAEJBgIDLg0BAgAHAQYBAVIWAgcBAgECegYDAQECAQcBAUgCAwEBAQACAAU7BwABPwRRAQACAC4CFwABAQMEBQgIAgceBJQDADcEMggBDgEWBQEPAAcBEQIHAQIBBQAHAAE9BAAHbQcAYIDwAACAFgAAACAgAQAwYAEBMHECCQUSAWQBGgEAAQALHQIFAS8BAAEAewlwcm9kdWNlcnMCCGxhbmd1YWdlAQRSdXN0AAxwcm9jZXNzZWQtYnkDBXJ1c3RjHTEuNjQuMCAoYTU1ZGQ3MWQ1IDIwMjItMDktMTkpBndhbHJ1cwYwLjE5LjAMd2FzbS1iaW5kZ2VuEjAuMi44MyAoZWJhNjkxZjM4KQ==");var vi=class{async init(){await Yo(Uo);let e=new Ht("<%","%>","\0","*","-","_","tR");this.renderer=new on(e)}async parse_commands(e,t){return this.renderer.render_content(e,t)}};var Xe;(function(a){a[a.CreateNewFromTemplate=0]="CreateNewFromTemplate",a[a.AppendActiveFile=1]="AppendActiveFile",a[a.OverwriteFile=2]="OverwriteFile",a[a.OverwriteActiveFile=3]="OverwriteActiveFile",a[a.DynamicProcessor=4]="DynamicProcessor",a[a.StartupTemplate=5]="StartupTemplate"})(Xe||(Xe={}));var kn=class{constructor(e){this.plugin=e;this.functions_generator=new _i(this.plugin),this.parser=new vi}async setup(){this.files_with_pending_templates=new Set,await this.parser.init(),await this.functions_generator.init(),this.plugin.registerMarkdownPostProcessor((e,t)=>this.process_dynamic_templates(e,t))}create_running_config(e,t,r){let i=Jt(this.plugin.app);return{template_file:e,target_file:t,run_mode:r,active_file:i}}async read_and_parse_template(e){let t=await this.plugin.app.vault.read(e.template_file);return this.parse_template(e,t)}async parse_template(e,t){let r=await this.functions_generator.generate_object(e,Qe.USER_INTERNAL);return this.current_functions_object=r,await this.parser.parse_commands(t,r)}start_templater_task(e){this.files_with_pending_templates.add(e)}async end_templater_task(e){this.files_with_pending_templates.delete(e),this.files_with_pending_templates.size===0&&(this.plugin.app.workspace.trigger("templater:all-templates-executed"),await this.functions_generator.teardown())}async create_new_note_from_template(e,t,r,i=!0){if(!t)switch(this.plugin.app.vault.getConfig("newFileLocation")){case"current":{let y=Jt(this.plugin.app);y&&(t=y.parent);break}case"folder":t=this.plugin.app.fileManager.getNewFileParent("");break;case"root":t=this.plugin.app.vault.getRoot();break;default:break}let o=e instanceof Oe.TFile&&e.extension||"md",a=await Te(async()=>{let m=t instanceof Oe.TFolder?t.path:t,y=this.plugin.app.vault.getAvailablePath((0,Oe.normalizePath)(`${m??""}/${r||"Untitled"}`),o),b=oo(y);return b&&!this.plugin.app.vault.getAbstractFileByPathInsensitive(b)&&await this.plugin.app.vault.createFolder(b),this.plugin.app.vault.create(y,"")},`Couldn't create ${o} file.`);if(a==null)return;let{path:l}=a;this.start_templater_task(l);let c,d;if(e instanceof Oe.TFile?(c=this.create_running_config(e,a,0),d=await Te(async()=>this.read_and_parse_template(c),"Template parsing error, aborting.")):(c=this.create_running_config(void 0,a,0),d=await Te(async()=>this.parse_template(c,e),"Template parsing error, aborting.")),d==null){await this.plugin.app.vault.delete(a),await this.end_templater_task(l);return}if(await this.plugin.app.vault.modify(a,d),this.plugin.app.workspace.trigger("templater:new-note-from-template",{file:a,content:d}),i){let m=this.plugin.app.workspace.getLeaf(!1);if(!m){oe(new O("No active leaf"));return}await m.openFile(a,{state:{mode:"source"}}),await this.plugin.editor_handler.jump_to_next_cursor_location(a,!0),m.setEphemeralState({rename:"all"})}return await this.end_templater_task(l),a}async append_template_to_active_file(e){let t=this.plugin.app.workspace.getActiveViewOfType(Oe.MarkdownView),r=this.plugin.app.workspace.activeEditor;if(!r||!r.file||!r.editor){oe(new O("No active editor, can't append templates."));return}let{path:i}=r.file;this.start_templater_task(i);let o=this.create_running_config(e,r.file,1),a=await Te(async()=>this.read_and_parse_template(o),"Template parsing error, aborting.");if(a==null){await this.end_templater_task(i);return}let c=r.editor.getDoc(),d=c.listSelections();c.replaceSelection(a),r.file&&await this.plugin.app.vault.append(r.file,""),this.plugin.app.workspace.trigger("templater:template-appended",{view:t,editor:r,content:a,oldSelections:d,newSelections:c.listSelections()}),await this.plugin.editor_handler.jump_to_next_cursor_location(r.file,!0),await this.end_templater_task(i)}async write_template_to_file(e,t){let{path:r}=t;this.start_templater_task(r);let i=this.plugin.app.workspace.activeEditor,o=Jt(this.plugin.app),a=this.create_running_config(e,t,2),l=await Te(async()=>this.read_and_parse_template(a),"Template parsing error, aborting.");if(l==null){await this.end_templater_task(r);return}await this.plugin.app.vault.modify(t,l),o?.path===t.path&&i&&i.editor&&i.editor.setSelection({line:0,ch:0},{line:0,ch:0}),this.plugin.app.workspace.trigger("templater:new-note-from-template",{file:t,content:l}),await this.plugin.editor_handler.jump_to_next_cursor_location(t,!0),await this.end_templater_task(r)}overwrite_active_file_commands(){let e=this.plugin.app.workspace.activeEditor;if(!e||!e.file){oe(new O("Active editor is null, can't overwrite content"));return}this.overwrite_file_commands(e.file,!0)}async overwrite_file_commands(e,t=!1){let{path:r}=e;this.start_templater_task(r);let i=this.create_running_config(e,e,t?3:2),o=await Te(async()=>this.read_and_parse_template(i),"Template parsing error, aborting.");if(o==null){await this.end_templater_task(r);return}await this.plugin.app.vault.modify(e,o),this.plugin.app.workspace.trigger("templater:overwrite-file",{file:e,content:o}),await this.plugin.editor_handler.jump_to_next_cursor_location(e,!0),await this.end_templater_task(r)}async process_dynamic_templates(e,t){let r=ro(),i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT),o,a=!1,l;for(;o=i.nextNode();){let c=o.nodeValue;if(c!==null){let d=r.exec(c);if(d!==null){let m=this.plugin.app.metadataCache.getFirstLinkpathDest("",t.sourcePath);if(!m||!(m instanceof Oe.TFile))return;if(!a){a=!0;let y=this.create_running_config(m,m,4);l=await this.functions_generator.generate_object(y,Qe.USER_INTERNAL),this.current_functions_object=l}}for(;d!=null;){let m=d[1]+d[2],y=await Te(async()=>await this.parser.parse_commands(m,l),`Command Parsing error in dynamic command '${m}'`);if(y==null)return;let b=r.lastIndex-d[0].length,E=r.lastIndex;c=c.substring(0,b)+y+c.substring(E),r.lastIndex+=y.length-d[0].length,d=r.exec(c)}o.nodeValue=c}}}get_new_file_template_for_folder(e){do{let t=this.plugin.settings.folder_templates.find(r=>r.folder==e.path);if(t&&t.template)return t.template;e=e.parent}while(e)}get_new_file_template_for_file(e){let t=this.plugin.settings.file_templates.find(r=>new RegExp(r.regex).test(e.path));if(t&&t.template)return t.template}static async on_file_creation(e,t,r){if(!(r instanceof Oe.TFile)||r.extension!=="md")return;let i=(0,Oe.normalizePath)(e.plugin.settings.templates_folder);if(!(r.path.includes(i)&&i!=="/")&&(await ar(300),!e.files_with_pending_templates.has(r.path)))if(r.stat.size==0&&e.plugin.settings.enable_folder_templates){let o=e.get_new_file_template_for_folder(r.parent);if(!o)return;let a=await Te(async()=>Dt(t,o),`Couldn't find template ${o}`);if(a==null)return;await e.write_template_to_file(a,r)}else if(r.stat.size==0&&e.plugin.settings.enable_file_templates){let o=e.get_new_file_template_for_file(r);if(!o)return;let a=await Te(async()=>Dt(t,o),`Couldn't find template ${o}`);if(a==null)return;await e.write_template_to_file(a,r)}else r.stat.size<=1e5?await e.overwrite_file_commands(r):console.log(`Templater skipped parsing ${r.path} because file size exceeds 10000`)}async execute_startup_scripts(){for(let e of this.plugin.settings.startup_templates){if(!e)continue;let t=ke(()=>Dt(this.plugin.app,e),`Couldn't find startup template "${e}"`);if(!t)continue;let{path:r}=t;this.start_templater_task(r);let i=this.create_running_config(t,t,5);await Te(async()=>this.read_and_parse_template(i),"Startup Template parsing error, aborting."),await this.end_templater_task(r)}}};var Go=X(require("obsidian")),xr=class{constructor(e,t,r){this.plugin=e;this.templater=t;this.settings=r}setup(){Array.isArray(this.plugin.app.workspace.onLayoutReadyCallbacks)?this.plugin.app.workspace.onLayoutReadyCallbacks.push({pluginId:this.plugin.manifest.id,callback:()=>{this.update_trigger_file_on_creation()}}):this.plugin.app.workspace.onLayoutReady(()=>{this.update_trigger_file_on_creation()}),this.update_syntax_highlighting(),this.update_file_menu()}update_syntax_highlighting(){let e=this.plugin.editor_handler.desktopShouldHighlight(),t=this.plugin.editor_handler.mobileShouldHighlight();e||t?this.plugin.editor_handler.enable_highlighter():this.plugin.editor_handler.disable_highlighter()}update_trigger_file_on_creation(){this.settings.trigger_on_file_creation?(this.trigger_on_file_creation_event=this.plugin.app.vault.on("create",e=>kn.on_file_creation(this.templater,this.plugin.app,e)),this.plugin.registerEvent(this.trigger_on_file_creation_event)):this.trigger_on_file_creation_event&&(this.plugin.app.vault.offref(this.trigger_on_file_creation_event),this.trigger_on_file_creation_event=void 0)}update_file_menu(){this.plugin.registerEvent(this.plugin.app.workspace.on("file-menu",(e,t)=>{t instanceof Go.TFolder&&e.addItem(r=>{r.setTitle("Create new note from template").setIcon("templater-icon").onClick(()=>{this.plugin.fuzzy_suggester.create_new_note_from_template(t)})})}))}};var yr=X(require("obsidian"));var wi=class{constructor(e){this.plugin=e}setup(){this.plugin.addCommand({id:"insert-templater",name:"Open insert template modal",icon:"templater-icon",hotkeys:yr.Platform.isMacOS?void 0:[{modifiers:["Alt"],key:"e"}],callback:()=>{this.plugin.fuzzy_suggester.insert_template()}}),this.plugin.addCommand({id:"replace-in-file-templater",name:"Replace templates in the active file",icon:"templater-icon",hotkeys:yr.Platform.isMacOS?void 0:[{modifiers:["Alt"],key:"r"}],callback:()=>{this.plugin.templater.overwrite_active_file_commands()}}),this.plugin.addCommand({id:"jump-to-next-cursor-location",name:"Jump to next cursor location",icon:"text-cursor",hotkeys:[{modifiers:["Alt"],key:"Tab"}],callback:()=>{this.plugin.editor_handler.jump_to_next_cursor_location()}}),this.plugin.addCommand({id:"create-new-note-from-template",name:"Create new note from template",icon:"templater-icon",hotkeys:yr.Platform.isMacOS?void 0:[{modifiers:["Alt"],key:"n"}],callback:()=>{this.plugin.fuzzy_suggester.create_new_note_from_template()}}),this.register_templates_hotkeys()}register_templates_hotkeys(){this.plugin.settings.enabled_templates_hotkeys.forEach(e=>{e&&this.add_template_hotkey(null,e)})}add_template_hotkey(e,t){this.remove_template_hotkey(e),t&&(this.plugin.addCommand({id:t,name:`Insert ${t}`,icon:"templater-icon",callback:()=>{let r=ke(()=>Dt(this.plugin.app,t),"Couldn't find the template file associated with this hotkey");!r||this.plugin.templater.append_template_to_active_file(r)}}),this.plugin.addCommand({id:`create-${t}`,name:`Create ${t}`,icon:"templater-icon",callback:()=>{let r=ke(()=>Dt(this.plugin.app,t),"Couldn't find the template file associated with this hotkey");!r||this.plugin.templater.create_new_note_from_template(r)}}))}remove_template_hotkey(e){e&&(this.plugin.removeCommand(`${e}`),this.plugin.removeCommand(`create-${e}`))}};var Ci=X(require("obsidian"));var bi=X(require("obsidian"));var Ei=class{constructor(e){this.app=e}async jump_to_next_cursor_location(){let e=this.app.workspace.activeEditor;if(!e||!e.editor)return;let t=e.editor.getValue(),{new_content:r,positions:i}=this.replace_and_get_cursor_positions(t);if(i){let o=e instanceof bi.MarkdownView?e.currentMode.getFoldInfo():null;e.editor.setValue(r),o&&Array.isArray(o.folds)&&(i.forEach(a=>{o.folds=o.folds.filter(l=>l.from>a.line||l.to[0-9]*)\\)\\s*%>","g");for(;(r=i.exec(e))!=null;)t.push(r);if(t.length===0)return{};t.sort((c,d)=>Number(c.groups&&c.groups.order)-Number(d.groups&&d.groups.order));let o=t[0][0];t=t.filter(c=>c[0]===o);let a=[],l=0;for(let c of t){let d=c.index-l;if(a.push(this.get_editor_position_from_index(e,d)),e=e.replace(new RegExp(no(c[0])),""),l+=c[0].length,c[1]==="")break}return{new_content:e,positions:a}}set_cursor_location(e){let t=this.app.workspace.activeEditor;if(!t||!t.editor)return;let r=t.editor,i=[];for(let a of e)i.push({from:a});let o={selections:i};r.transaction(o)}};var Jo=X(require("obsidian"));var Js={app:{name:"app",description:"This module exposes the app instance. Prefer to use this over the global app instance."},user:{name:"user",description:"This module exposes custom made scripts, written by yourself within the script file folder location"},config:{name:"config",description:`This module exposes Templater's running configuration. + +This is mostly useful when writing scripts requiring some context information. +`,functions:{template_file:{name:"template_file",description:"The `TFile` object representing the template file.",definition:"tp.config.template_file"},target_file:{name:"target_file",description:"The `TFile` object representing the target file where the template will be inserted.",definition:"tp.config.target_file"},run_mode:{name:"run_mode",description:"The `RunMode`, representing the way Templater was launched (Create new from template, Append to active file, ...).",definition:"tp.config.run_mode"},active_file:{name:"active_file",description:"The active file (if existing) when launching Templater.",definition:"tp.config.active_file?"}}},date:{name:"date",description:"This module contains every internal function related to dates.",functions:{now:{name:"now",description:"Retrieves the date.",definition:'tp.date.now(format: string = "YYYY-MM-DD", offset?: number\u23AEstring, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"offset",description:"Duration to offset the date from. If a number is provided, duration will be added to the date in days. You can also specify the offset as a string using the ISO 8601 format."},{name:"reference",description:"The date referential, e.g. set this to the note's title."},{name:"reference_format",description:"The format for the reference date. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"Date now",example:"<% tp.date.now() %>"},{name:"Date now with format",example:'<% tp.date.now("Do MMMM YYYY") %>'},{name:"Last week",example:'<% tp.date.now("YYYY-MM-DD", -7) %>'},{name:"Next week",example:'<% tp.date.now("YYYY-MM-DD", 7) %>'},{name:"Last month",example:'<% tp.date.now("YYYY-MM-DD", "P-1M") %>'},{name:"Next year",example:'<% tp.date.now("YYYY-MM-DD", "P1Y") %>'},{name:"File's title date + 1 day (tomorrow)",example:'<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>'},{name:"File's title date - 1 day (yesterday)",example:'<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>'}]},tomorrow:{name:"tomorrow",description:"Retrieves tomorrow's date.",definition:'tp.date.tomorrow(format: string = "YYYY-MM-DD")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Date tomorrow",example:"<% tp.date.tomorrow() %>"},{name:"Date tomorrow with format",example:'<% tp.date.tomorrow("Do MMMM YYYY") %>'}]},yesterday:{name:"yesterday",description:"Retrieves yesterday's date.",definition:'tp.date.yesterday(format: string = "YYYY-MM-DD")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"Date yesterday",example:"<% tp.date.yesterday() %>"},{name:"Date yesterday with format",example:'<% tp.date.yesterday("Do MMMM YYYY") %>'}]},weekday:{name:"weekday",description:"",definition:'tp.date.weekday(format: string = "YYYY-MM-DD", weekday: number, reference?: string, reference_format?: string)',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'},{name:"weekday",description:"Week day number. If the locale assigns Monday as the first day of the week, `0` will be Monday, `-7` will be last week's day."},{name:"reference",description:"The date referential, e.g. set this to the note's title."},{name:"reference_format",description:"The format for the reference date. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/)."}],examples:[{name:"This week's Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 0) %>'},{name:"Next Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 7) %>'},{name:"File's title Monday",example:'<% tp.date.weekday("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-DD") %>'},{name:"File's title previous Monday",example:'<% tp.date.weekday("YYYY-MM-DD", -7, tp.file.title, "YYYY-MM-DD") %>'}]}},momentjs:{examples:[{name:"Date now",example:'<% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>'},{name:"Get start of month from note title",example:'<% moment(tp.file.title, "YYYY-MM-DD").startOf("month").format("YYYY-MM-DD") %>'},{name:"Get end of month from note title",example:'<% moment(tp.file.title, "YYYY-MM-DD").endOf("month").format("YYYY-MM-DD") %>'}]}},file:{name:"file",description:"This module contains every internal function related to files.",functions:{content:{name:"content",description:"The string contents of the file at the time that Templater was executed. Manipulating this string will *not* update the current file.",definition:"tp.file.content",examples:[{name:"Retrieve file content",example:"<% tp.file.content %>"}]},create_new:{name:"create_new",description:"Creates a new file using a specified template or with a specified content.",definition:"tp.file.create_new(template: TFile \u23AE string, filename?: string, open_new: boolean = false, folder?: TFolder | string)",args:[{name:"template",description:"Either the template used for the new file content, or the file content as a string. If it is the template to use, you retrieve it with `tp.file.find_tfile(TEMPLATENAME)`."},{name:"filename",description:'The filename of the new file, defaults to "Untitled".'},{name:"open_new",description:"Whether to open or not the newly created file. Warning: if you use this option, since commands are executed asynchronously, the file can be opened first and then other commands are appended to that new file and not the previous file."},{name:"folder",description:'The folder to put the new file in, defaults to Obsidian\'s default location. If you want the file to appear in a different folder, specify it with `"PATH/TO/FOLDERNAME"` or `app.vault.getAbstractFileByPath("PATH/TO/FOLDERNAME")`.'}],examples:[{name:"File creation",example:'<%* await tp.file.create_new("MyFileContent", "MyFilename") %>'},{name:"File creation with template",example:'<%* await tp.file.create_new(tp.file.find_tfile("MyTemplate"), "MyFilename") %>'},{name:"File creation and open created note",example:'<%* await tp.file.create_new("MyFileContent", "MyFilename", true) %>'},{name:"File creation in current folder",example:'<%* await tp.file.create_new("MyFileContent", "MyFilename", false, tp.file.folder(true)) %>'},{name:"File creation in specified folder with string path",example:'<%* await tp.file.create_new("MyFileContent", "MyFilename", false, "Path/To/MyFolder") %>'},{name:"File creation in specified folder with TFolder",example:'<%* await tp.file.create_new("MyFileContent", "MyFilename", false, app.vault.getAbstractFileByPath("MyFolder")) %>'},{name:"File creation and append link to current note",example:'[[<% (await tp.file.create_new("MyFileContent", "MyFilename")).basename %>]]'}]},creation_date:{name:"creation_date",description:"Retrieves the file's creation date.",definition:'tp.file.creation_date(format: string = "YYYY-MM-DD HH:mm")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD HH:mm"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"File creation date",example:"<% tp.file.creation_date() %>"},{name:"File creation date with format",example:'<% tp.file.creation_date("dddd Do MMMM YYYY HH:mm") %>'}]},cursor:{name:"cursor",description:`Sets the cursor to this location after the template has been inserted. + +You can navigate between the different cursors using the configured hotkey in Obsidian settings. +`,definition:"tp.file.cursor(order?: number)",args:[{name:"order",description:`The order of the different cursors jump, e.g. it will jump from 1 to 2 to 3, and so on. +If you specify multiple tp.file.cursor with the same order, the editor will switch to multi-cursor. +`}],examples:[{name:"File cursor",example:"<% tp.file.cursor() %>"},{name:"File multi-cursor",example:"<% tp.file.cursor(1) %>Content<% tp.file.cursor(1) %>"}]},cursor_append:{name:"cursor_append",description:"Appends some content after the active cursor in the file.",definition:"tp.file.cursor_append(content: string)",args:[{name:"content",description:"The content to append after the active cursor."}],examples:[{name:"File cursor append",example:'<% tp.file.cursor_append("Some text") %>'}]},exists:{name:"exists",description:"Check to see if a file exists by it's file path. The full path to the file, relative to the Vault and containing the extension, must be provided.",definition:"tp.file.exists(filepath: string)",args:[{name:"filepath",description:"The full file path of the file we want to check existence for."}],examples:[{name:"File existence",example:'<% await tp.file.exists("MyFolder/MyFile.md") %>'},{name:"File existence of current file",example:'<% await tp.file.exists(tp.file.folder(true) + "/" + tp.file.title + ".md") %>'}]},find_tfile:{name:"find_tfile",description:"Search for a file and returns its `TFile` instance.",definition:"tp.file.find_tfile(filename: string)",args:[{name:"filename",description:"The filename we want to search and resolve as a `TFile`."}],examples:[{name:"File find TFile",example:'<% tp.file.find_tfile("MyFile").basename %>'}]},folder:{name:"folder",description:"Retrieves the file's folder name.",definition:"tp.file.folder(absolute: boolean = false)",args:[{name:"absolute",description:"If set to `true`, returns the vault-absolute path of the folder. If `false`, only returns the basename of the folder (the last part). Defaults to `false`."}],examples:[{name:"File folder (Folder)",example:"<% tp.file.folder() %>"},{name:"File folder with vault-absolute path (Path/To/Folder)",example:"<% tp.file.folder(true) %>"}]},include:{name:"include",description:"Includes the file's link content. Templates in the included content will be resolved.",definition:"tp.file.include(include_link: string \u23AE TFile)",args:[{name:"include_link",description:'The link to the file to include, e.g. `"[[MyFile]]"`, or a TFile object. Also supports sections or blocks inclusions.'}],examples:[{name:"File include",example:'<% tp.file.include("[[Template1]]") %>'},{name:"File include TFile",example:'<% tp.file.include(tp.file.find_tfile("MyFile")) %>'},{name:"File include section",example:'<% tp.file.include("[[MyFile#Section1]]") %>'},{name:"File include block",example:'<% tp.file.include("[[MyFile#^block1]]") %>'}]},last_modified_date:{name:"last_modified_date",description:"Retrieves the file's last modification date.",definition:'tp.file.last_modified_date(format: string = "YYYY-MM-DD HH:mm")',args:[{name:"format",description:'The format for the date. Defaults to `"YYYY-MM-DD HH:mm"`. Refer to [format reference](https://momentjs.com/docs/#/displaying/format/).'}],examples:[{name:"File last modified date",example:"<% tp.file.last_modified_date() %>"},{name:"File last modified date with format",example:'<% tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm") %>'}]},move:{name:"move",description:"Moves the file to the desired vault location.",definition:"tp.file.move(new_path: string, file_to_move?: TFile)",args:[{name:"new_path",description:'The new vault relative path of the file, without the file extension. Note: the new path needs to include the folder and the filename, e.g. `"/Notes/MyNote"`.'},{name:"file_to_move",description:"The file to move, defaults to the current file."}],examples:[{name:"File move",example:'<% await tp.file.move("/A/B/" + tp.file.title) %>'},{name:"File move and rename",example:'<% await tp.file.move("/A/B/NewTitle") %>'}]},path:{name:"path",description:"Retrieves the file's absolute path on the system.",definition:"tp.file.path(relative: boolean = false)",args:[{name:"relative",description:"If set to `true`, only retrieves the vault's relative path."}],examples:[{name:"File path",example:"<% tp.file.path() %>"},{name:"File relative path (relative to vault root)",example:"<% tp.file.path(true) %>"}]},rename:{name:"rename",description:"Renames the file (keeps the same file extension).",definition:"tp.file.rename(new_title: string)",args:[{name:"new_title",description:"The new file title."}],examples:[{name:"File rename",example:'<% await tp.file.rename("MyNewName") %>'},{name:"File append a 2 to the file name",example:'<% await tp.file.rename(tp.file.title + "2") %>'}]},selection:{name:"selection",description:"Retrieves the active file's text selection.",definition:"tp.file.selection()",examples:[{name:"File selection",example:"<% tp.file.selection() %>"}]},tags:{name:"tags",description:"Retrieves the file's tags (array of string).",definition:"tp.file.tags",examples:[{name:"File tags",example:"<% tp.file.tags %>"}]},title:{name:"title",definition:"tp.file.title",description:"Retrieves the file's title.",examples:[{name:"File title",example:"<% tp.file.title %>"},{name:"Strip the Zettelkasten ID of title (if space separated)",example:'<% tp.file.title.split(" ")[1] %>'}]}}},frontmatter:{name:"frontmatter",description:"This modules exposes all the frontmatter variables of a file as variables."},hooks:{name:"hooks",description:"This module exposes hooks that allow you to execute code when a Templater event occurs.",functions:{on_all_templates_executed:{name:"on_all_templates_executed",description:"Hooks into when all actively running templates have finished executing. Most of the time this will be a single template, unless you are using `tp.file.include` or `tp.file.create_new`.\n\nMultiple invokations of this method will have their callback functions run in parallel.",definition:"tp.hooks.on_all_templates_executed(callback_function: () => any)",args:[{name:"callback_function",description:"Callback function that will be executed when all actively running templates have finished executing."}]}}},obsidian:{name:"obsidian",description:"This module exposes all the functions and classes from the Obsidian API."},system:{name:"system",description:"This module contains system related functions.",functions:{clipboard:{name:"clipboard",description:"Retrieves the clipboard's content.",definition:"tp.system.clipboard()",examples:[{name:"Clipboard",example:"<% tp.system.clipboard() %>"}]},prompt:{name:"prompt",description:"Spawns a prompt modal and returns the user's input.",definition:"tp.system.prompt(prompt_text?: string, default_value?: string, throw_on_cancel: boolean = false, multiline?: boolean = false)",args:[{name:"prompt_text",description:"Text placed above the input field."},{name:"default_value",description:"A default value for the input field."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"multiline",description:"If set to `true`, the input field will be a multiline textarea. Defaults to `false`."}],examples:[{name:"Prompt",example:'<% tp.system.prompt("Please enter a value") %>'},{name:"Prompt with default value",example:'<% tp.system.prompt("What is your mood today?", "happy") %>'},{name:"Multiline prompt",example:'<% tp.system.prompt("What is your mood today?", null, false, true) %>'}]},suggester:{name:"suggester",description:"Spawns a suggester prompt and returns the user's chosen item.",definition:'tp.system.suggester(text_items: string[] \u23AE ((item: T) => string), items: T[], throw_on_cancel: boolean = false, placeholder: string = "", limit?: number = undefined)',args:[{name:"text_items",description:"Array of strings representing the text that will be displayed for each item in the suggester prompt. This can also be a function that maps an item to its text representation."},{name:"items",description:"Array containing the values of each item in the correct order."},{name:"throw_on_cancel",description:"Throws an error if the prompt is canceled, instead of returning a `null` value."},{name:"placeholder",description:"Placeholder string of the prompt."},{name:"limit",description:"Limit the number of items rendered at once (useful to improve performance when displaying large lists)."}],examples:[{name:"Suggester",example:'<% tp.system.suggester(["Happy", "Sad", "Confused"], ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester with mapping function (same as above example)",example:'<% tp.system.suggester((item) => item, ["Happy", "Sad", "Confused"]) %>'},{name:"Suggester for files",example:"[[<% (await tp.system.suggester((item) => item.basename, app.vault.getMarkdownFiles())).basename %>]]"},{name:"Suggester for tags",example:'<% tp.system.suggester(item => item, Object.keys(app.metadataCache.getTags()).map(x => x.replace("#", ""))) %>'}]}}},web:{name:"web",description:"This modules contains every internal function related to the web (making web requests).",functions:{daily_quote:{name:"daily_quote",description:"Retrieves and parses the daily quote from `https://github.com/Zachatoo/quotes-database` as a callout.",definition:"tp.web.daily_quote()",examples:[{name:"Daily quote",example:"<% tp.web.daily_quote() %>"}]},random_picture:{name:"random_picture",description:"Gets a random image from `https://unsplash.com/`.",definition:"tp.web.random_picture(size?: string, query?: string, include_size?: boolean)",args:[{name:"size",description:"Image size in the format `x`."},{name:"query",description:"Limits selection to photos matching a search term. Multiple search terms can be passed separated by a comma."},{name:"include_size",description:"Optional argument to include the specified size in the image link markdown. Defaults to false."}],examples:[{name:"Random picture",example:"<% tp.web.random_picture() %>"},{name:"Random picture with size",example:'<% tp.web.random_picture("200x200") %>'},{name:"Random picture with size and query",example:'<% tp.web.random_picture("200x200", "landscape,water") %>'}]},request:{name:"request",description:"Makes a HTTP request to the specified URL. Optionally, you can specify a path to extract specific data from the response.",definition:"tp.web.request(url: string, path?: string)",args:[{name:"url",description:"The URL to which the HTTP request will be made."},{name:"path",description:"A path within the response JSON to extract specific data."}],examples:[{name:"Simple request",example:'<% tp.web.request("https://jsonplaceholder.typicode.com/todos/1") %>'},{name:"Request with path",example:'<% tp.web.request("https://jsonplaceholder.typicode.com/todos", "0.title") %>'}]}}}},Vo={tp:Js};var Qs=["app","config","date","file","frontmatter","hooks","obsidian","system","user","web"],Xs=new Set(Qs);function zo(n){return typeof n=="string"&&Xs.has(n)}function Ti(n){return!!(n.definition||n.returns||n.args)}var ki=class{constructor(e){this.plugin=e;this.documentation=Vo}get_all_modules_documentation(){let e=this.documentation.tp;return(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)&&(e=Object.values(e).filter(t=>t.name!=="user")),Object.values(e).map(t=>(t.queryKey=t.name,t))}async get_all_functions_documentation(e,t){if(e==="app")return this.get_app_functions_documentation(this.plugin.app,t);if(e==="user"){if(!this.plugin.settings||!this.plugin.settings.user_scripts_folder)return;let r=await Te(async()=>{let i=ze(this.plugin.app,this.plugin.settings.user_scripts_folder).filter(a=>a.extension=="js");return await io(this.plugin.app,i)},"User Scripts folder doesn't exist");return!r||r.length===0?void 0:r.reduce((i,o)=>o.extension!=="js"?i:[...i,{name:o.basename,queryKey:o.basename,definition:"",description:o.description,returns:o.returns,args:o.arguments.reduce((l,c)=>(l[c.name]={name:c.name,description:c.description},l),{}),example:""}],[])}if(!!this.documentation.tp[e].functions)return Object.values(this.documentation.tp[e].functions).map(r=>(r.queryKey=r.name,r))}get_app_functions_documentation(e,t){if(!$r(e))return[];let r=t.split(".");if(r.length===0)return[];let i=e;for(let c=0;c[a-z]*)?(?\.(?[a-zA-Z_.]*)?)?$/;this.documentation=new ki(e),this.intellisense_render_setting=e.settings.intellisense_render}onTrigger(e,t,r){let i=t.getRange({line:e.line,ch:0},{line:e.line,ch:e.ch}),o=this.tp_keyword_regex.exec(i);if(!o)return null;let a,l=o.groups&&o.groups.module||"";if(this.module_name=l,o.groups&&o.groups.fn_trigger){if(l==""||!zo(l))return null;this.function_trigger=!0,this.function_name=o.groups.fn||"",a=this.function_name}else this.function_trigger=!1,a=this.module_name;let c={start:{line:e.line,ch:e.ch-a.length},end:{line:e.line,ch:e.ch},query:a};return this.latest_trigger_info=c,c}async getSuggestions(e){let t;return this.module_name&&this.function_trigger?t=await this.documentation.get_all_functions_documentation(this.module_name,this.function_name):t=this.documentation.get_all_modules_documentation(),t?t.filter(r=>r.queryKey.toLowerCase().startsWith(e.query.toLowerCase())):[]}renderSuggestion(e,t){if(t.createEl("b",{text:e.name}),Ti(e)){if(e.args&&this.getNumberOfArguments(e.args)>0&&Mo(this.intellisense_render_setting)){t.createEl("p",{text:"Parameter list:"});let r=t.createEl("ol");for(let[i,o]of Object.entries(e.args))Kr(r,i,o.description)}e.returns&&Oo(this.intellisense_render_setting)&&Kr(t,"Returns",e.returns)}this.function_trigger&&Ti(e)&&t.createEl("code",{text:e.definition}),e.description&&Bo(this.intellisense_render_setting)&&t.createEl("div",{text:e.description})}selectSuggestion(e,t){let r=this.app.workspace.activeEditor;if(!(!r||!r.editor)&&(r.editor.replaceRange(e.queryKey,this.latest_trigger_info.start,this.latest_trigger_info.end),this.latest_trigger_info.start.ch==this.latest_trigger_info.end.ch)){let i=this.latest_trigger_info.end;i.ch+=e.queryKey.length,r.editor.setCursor(i)}}getNumberOfArguments(e){try{return new Map(Object.entries(e)).size}catch{return 0}}updateAutocompleteIntellisenseSetting(e){this.intellisense_render_setting=e}};(function(n){n(window.CodeMirror)})(function(n){"use strict";n.defineMode("javascript",function(e,t){var r=e.indentUnit,i=t.statementIndent,o=t.jsonld,a=t.json||o,l=t.trackScope!==!1,c=t.typescript,d=t.wordCharacters||/[\w$\xa1-\uffff]/,m=function(){function s(je){return{type:je,style:"keyword"}}var p=s("keyword a"),A=s("keyword b"),_=s("keyword c"),F=s("keyword d"),Y=s("operator"),z={type:"atom",style:"atom"};return{if:s("if"),while:p,with:p,else:A,do:A,try:A,finally:A,return:F,break:F,continue:F,new:s("new"),delete:_,void:_,throw:_,debugger:s("debugger"),var:s("var"),const:s("var"),let:s("var"),function:s("function"),catch:s("catch"),for:s("for"),switch:s("switch"),case:s("case"),default:s("default"),in:Y,typeof:Y,instanceof:Y,true:z,false:z,null:z,undefined:z,NaN:z,Infinity:z,this:s("this"),class:s("class"),super:s("atom"),yield:_,export:s("export"),import:s("import"),extends:_,await:_}}(),y=/[+\-*&%=<>!?|~^@]/,b=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function E(s){for(var p=!1,A,_=!1;(A=s.next())!=null;){if(!p){if(A=="/"&&!_)return;A=="["?_=!0:_&&A=="]"&&(_=!1)}p=!p&&A=="\\"}}var P,k;function w(s,p,A){return P=s,k=A,p}function M(s,p){var A=s.next();if(A=='"'||A=="'")return p.tokenize=$(A),p.tokenize(s,p);if(A=="."&&s.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if(A=="."&&s.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(A))return w(A);if(A=="="&&s.eat(">"))return w("=>","operator");if(A=="0"&&s.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(A))return s.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if(A=="/")return s.eat("*")?(p.tokenize=K,K(s,p)):s.eat("/")?(s.skipToEnd(),w("comment","comment")):Ri(s,p,1)?(E(s),s.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(s.eat("="),w("operator","operator",s.current()));if(A=="`")return p.tokenize=C,C(s,p);if(A=="#"&&s.peek()=="!")return s.skipToEnd(),w("meta","meta");if(A=="#"&&s.eatWhile(d))return w("variable","property");if(A=="<"&&s.match("!--")||A=="-"&&s.match("->")&&!/\S/.test(s.string.slice(0,s.start)))return s.skipToEnd(),w("comment","comment");if(y.test(A))return(A!=">"||!p.lexical||p.lexical.type!=">")&&(s.eat("=")?(A=="!"||A=="=")&&s.eat("="):/[<>*+\-|&?]/.test(A)&&(s.eat(A),A==">"&&s.eat(A))),A=="?"&&s.eat(".")?w("."):w("operator","operator",s.current());if(d.test(A)){s.eatWhile(d);var _=s.current();if(p.lastType!="."){if(m.propertyIsEnumerable(_)){var F=m[_];return w(F.type,F.style,_)}if(_=="async"&&s.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",_)}return w("variable","variable",_)}}function $(s){return function(p,A){var _=!1,F;if(o&&p.peek()=="@"&&p.match(b))return A.tokenize=M,w("jsonld-keyword","meta");for(;(F=p.next())!=null&&!(F==s&&!_);)_=!_&&F=="\\";return _||(A.tokenize=M),w("string","string")}}function K(s,p){for(var A=!1,_;_=s.next();){if(_=="/"&&A){p.tokenize=M;break}A=_=="*"}return w("comment","comment")}function C(s,p){for(var A=!1,_;(_=s.next())!=null;){if(!A&&(_=="`"||_=="$"&&s.eat("{"))){p.tokenize=M;break}A=!A&&_=="\\"}return w("quasi","string-2",s.current())}var H="([{}])";function I(s,p){p.fatArrowAt&&(p.fatArrowAt=null);var A=s.string.indexOf("=>",s.start);if(!(A<0)){if(c){var _=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(s.string.slice(s.start,A));_&&(A=_.index)}for(var F=0,Y=!1,z=A-1;z>=0;--z){var je=s.string.charAt(z),Ue=H.indexOf(je);if(Ue>=0&&Ue<3){if(!F){++z;break}if(--F==0){je=="("&&(Y=!0);break}}else if(Ue>=3&&Ue<6)++F;else if(d.test(je))Y=!0;else if(/["'\/`]/.test(je))for(;;--z){if(z==0)return;var ha=s.string.charAt(z-1);if(ha==je&&s.string.charAt(z-2)!="\\"){z--;break}}else if(Y&&!F){++z;break}}Y&&!F&&(p.fatArrowAt=z)}}var J={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function te(s,p,A,_,F,Y){this.indented=s,this.column=p,this.type=A,this.prev=F,this.info=Y,_!=null&&(this.align=_)}function ne(s,p){if(!l)return!1;for(var A=s.localVars;A;A=A.next)if(A.name==p)return!0;for(var _=s.context;_;_=_.prev)for(var A=_.vars;A;A=A.next)if(A.name==p)return!0}function Q(s,p,A,_,F){var Y=s.cc;for(h.state=s,h.stream=F,h.marked=null,h.cc=Y,h.style=p,s.lexical.hasOwnProperty("align")||(s.lexical.align=!0);;){var z=Y.length?Y.pop():a?W:ee;if(z(A,_)){for(;Y.length&&Y[Y.length-1].lex;)Y.pop()();return h.marked?h.marked:A=="variable"&&ne(s,_)?"variable-2":p}}}var h={state:null,column:null,marked:null,cc:null};function S(){for(var s=arguments.length-1;s>=0;s--)h.cc.push(arguments[s])}function f(){return S.apply(null,arguments),!0}function Me(s,p){for(var A=p;A;A=A.next)if(A.name==s)return!0;return!1}function be(s){var p=h.state;if(h.marked="def",!!l){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var A=Ae(s,p.context);if(A!=null){p.context=A;return}}else if(!Me(s,p.localVars)){p.localVars=new Ee(s,p.localVars);return}}t.globalVars&&!Me(s,p.globalVars)&&(p.globalVars=new Ee(s,p.globalVars))}}function Ae(s,p){if(p)if(p.block){var A=Ae(s,p.prev);return A?A==p.prev?p:new Ke(A,p.vars,!0):null}else return Me(s,p.vars)?p:new Ke(p.prev,new Ee(s,p.vars),!1);else return null}function _e(s){return s=="public"||s=="private"||s=="protected"||s=="abstract"||s=="readonly"}function Ke(s,p,A){this.prev=s,this.vars=p,this.block=A}function Ee(s,p){this.name=s,this.next=p}var $t=new Ee("this",new Ee("arguments",null));function Re(){h.state.context=new Ke(h.state.context,h.state.localVars,!1),h.state.localVars=$t}function Ze(){h.state.context=new Ke(h.state.context,h.state.localVars,!0),h.state.localVars=null}function xe(){h.state.localVars=h.state.context.vars,h.state.context=h.state.context.prev}xe.lex=!0;function B(s,p){var A=function(){var _=h.state,F=_.indented;if(_.lexical.type=="stat")F=_.lexical.indented;else for(var Y=_.lexical;Y&&Y.type==")"&&Y.align;Y=Y.prev)F=Y.indented;_.lexical=new te(F,h.stream.column(),s,null,_.lexical,p)};return A.lex=!0,A}function D(){var s=h.state;s.lexical.prev&&(s.lexical.type==")"&&(s.indented=s.lexical.indented),s.lexical=s.lexical.prev)}D.lex=!0;function q(s){function p(A){return A==s?f():s==";"||A=="}"||A==")"||A=="]"?S():f(p)}return p}function ee(s,p){return s=="var"?f(B("vardef",p),Er,q(";"),D):s=="keyword a"?f(B("form"),bt,ee,D):s=="keyword b"?f(B("form"),ee,D):s=="keyword d"?h.stream.match(/^\s*$/,!1)?f():f(B("stat"),tt,q(";"),D):s=="debugger"?f(q(";")):s=="{"?f(B("}"),Ze,Bn,D,xe):s==";"?f():s=="if"?(h.state.lexical.info=="else"&&h.state.cc[h.state.cc.length-1]==D&&h.state.cc.pop()(),f(B("form"),bt,ee,D,Fi)):s=="function"?f(At):s=="for"?f(B("form"),Ze,Ii,ee,xe,D):s=="class"||c&&p=="interface"?(h.marked="keyword",f(B("form",s=="class"?s:p),Li,D)):s=="variable"?c&&p=="declare"?(h.marked="keyword",f(ee)):c&&(p=="module"||p=="enum"||p=="type")&&h.stream.match(/^\s*\w/,!1)?(h.marked="keyword",p=="enum"?f(Ki):p=="type"?f(qi,q("operator"),V,q(";")):f(B("form"),Be,q("{"),B("}"),Bn,D,D)):c&&p=="namespace"?(h.marked="keyword",f(B("form"),W,ee,D)):c&&p=="abstract"?(h.marked="keyword",f(ee)):f(B("stat"),On):s=="switch"?f(B("form"),bt,q("{"),B("}","switch"),Ze,Bn,D,D,xe):s=="case"?f(W,q(":")):s=="default"?f(q(":")):s=="catch"?f(B("form"),Re,et,ee,D,xe):s=="export"?f(B("stat"),pa,D):s=="import"?f(B("stat"),ua,D):s=="async"?f(ee):p=="@"?f(W,ee):S(B("stat"),W,q(";"),D)}function et(s){if(s=="(")return f(kt,q(")"))}function W(s,p){return Sn(s,p,!1)}function ye(s,p){return Sn(s,p,!0)}function bt(s){return s!="("?S():f(B(")"),tt,q(")"),D)}function Sn(s,p,A){if(h.state.fatArrowAt==h.stream.start){var _=A?Pn:Dn;if(s=="(")return f(Re,B(")"),se(kt,")"),D,q("=>"),_,xe);if(s=="variable")return S(Re,Be,q("=>"),_,xe)}var F=A?gt:nt;return J.hasOwnProperty(s)?f(F):s=="function"?f(At,F):s=="class"||c&&p=="interface"?(h.marked="keyword",f(B("form"),la,D)):s=="keyword c"||s=="async"?f(A?ye:W):s=="("?f(B(")"),tt,q(")"),D,F):s=="operator"||s=="spread"?f(A?ye:W):s=="["?f(B("]"),da,D,F):s=="{"?sn(Tt,"}",null,F):s=="quasi"?S(Et,F):s=="new"?f(rt(A)):f()}function tt(s){return s.match(/[;\}\)\],]/)?S():S(W)}function nt(s,p){return s==","?f(tt):gt(s,p,!1)}function gt(s,p,A){var _=A==!1?nt:gt,F=A==!1?W:ye;if(s=="=>")return f(Re,A?Pn:Dn,xe);if(s=="operator")return/\+\+|--/.test(p)||c&&p=="!"?f(_):c&&p=="<"&&h.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?f(B(">"),se(V,">"),D,_):p=="?"?f(W,q(":"),F):f(F);if(s=="quasi")return S(Et,_);if(s!=";"){if(s=="(")return sn(ye,")","call",_);if(s==".")return f(an,_);if(s=="[")return f(B("]"),tt,q("]"),D,_);if(c&&p=="as")return h.marked="keyword",f(V,_);if(s=="regexp")return h.state.lastType=h.marked="operator",h.stream.backUp(h.stream.pos-h.stream.start-1),f(F)}}function Et(s,p){return s!="quasi"?S():p.slice(p.length-2)!="${"?f(Et):f(tt,Cn)}function Cn(s){if(s=="}")return h.marked="string-2",h.state.tokenize=C,f(Et)}function Dn(s){return I(h.stream,h.state),S(s=="{"?ee:W)}function Pn(s){return I(h.stream,h.state),S(s=="{"?ee:ye)}function rt(s){return function(p){return p=="."?f(s?Nn:Kt):p=="variable"&&c?f(ia,s?gt:nt):S(s?ye:W)}}function Kt(s,p){if(p=="target")return h.marked="keyword",f(nt)}function Nn(s,p){if(p=="target")return h.marked="keyword",f(gt)}function On(s){return s==":"?f(D,ee):S(nt,q(";"),D)}function an(s){if(s=="variable")return h.marked="property",f()}function Tt(s,p){if(s=="async")return h.marked="property",f(Tt);if(s=="variable"||h.style=="keyword"){if(h.marked="property",p=="get"||p=="set")return f(Mn);var A;return c&&h.state.fatArrowAt==h.stream.start&&(A=h.stream.match(/^\s*:\s*/,!1))&&(h.state.fatArrowAt=h.stream.pos+A[0].length),f(Ye)}else{if(s=="number"||s=="string")return h.marked=o?"property":h.style+" property",f(Ye);if(s=="jsonld-keyword")return f(Ye);if(c&&_e(p))return h.marked="keyword",f(Tt);if(s=="[")return f(W,Rt,q("]"),Ye);if(s=="spread")return f(ye,Ye);if(p=="*")return h.marked="keyword",f(Tt);if(s==":")return S(Ye)}}function Mn(s){return s!="variable"?S(Ye):(h.marked="property",f(At))}function Ye(s){if(s==":")return f(ye);if(s=="(")return S(At)}function se(s,p,A){function _(F,Y){if(A?A.indexOf(F)>-1:F==","){var z=h.state.lexical;return z.info=="call"&&(z.pos=(z.pos||0)+1),f(function(je,Ue){return je==p||Ue==p?S():S(s)},_)}return F==p||Y==p?f():A&&A.indexOf(";")>-1?S(s):f(q(p))}return function(F,Y){return F==p||Y==p?f():S(s,_)}}function sn(s,p,A){for(var _=3;_"),V);if(s=="quasi")return S(wr,it)}function na(s){if(s=="=>")return f(V)}function vr(s){return s.match(/[\}\)\]]/)?f():s==","||s==";"?f(vr):S(cn,vr)}function cn(s,p){if(s=="variable"||h.style=="keyword")return h.marked="property",f(cn);if(p=="?"||s=="number"||s=="string")return f(cn);if(s==":")return f(V);if(s=="[")return f(q("variable"),ea,q("]"),cn);if(s=="(")return S(Ut,cn);if(!s.match(/[;\}\)\],]/))return f()}function wr(s,p){return s!="quasi"?S():p.slice(p.length-2)!="${"?f(wr):f(V,ra)}function ra(s){if(s=="}")return h.marked="string-2",h.state.tokenize=C,f(wr)}function br(s,p){return s=="variable"&&h.stream.match(/^\s*[?:]/,!1)||p=="?"?f(br):s==":"?f(V):s=="spread"?f(br):S(V)}function it(s,p){if(p=="<")return f(B(">"),se(V,">"),D,it);if(p=="|"||s=="."||p=="&")return f(V);if(s=="[")return f(V,q("]"),it);if(p=="extends"||p=="implements")return h.marked="keyword",f(V);if(p=="?")return f(V,q(":"),V)}function ia(s,p){if(p=="<")return f(B(">"),se(V,">"),D,it)}function Fn(){return S(V,oa)}function oa(s,p){if(p=="=")return f(V)}function Er(s,p){return p=="enum"?(h.marked="keyword",f(Ki)):S(Be,Rt,ht,sa)}function Be(s,p){if(c&&_e(p))return h.marked="keyword",f(Be);if(s=="variable")return be(p),f();if(s=="spread")return f(Be);if(s=="[")return sn(aa,"]");if(s=="{")return sn(Bi,"}")}function Bi(s,p){return s=="variable"&&!h.stream.match(/^\s*:/,!1)?(be(p),f(ht)):(s=="variable"&&(h.marked="property"),s=="spread"?f(Be):s=="}"?S():s=="["?f(W,q("]"),q(":"),Bi):f(q(":"),Be,ht))}function aa(){return S(Be,ht)}function ht(s,p){if(p=="=")return f(ye)}function sa(s){if(s==",")return f(Er)}function Fi(s,p){if(s=="keyword b"&&p=="else")return f(B("form","else"),ee,D)}function Ii(s,p){if(p=="await")return f(Ii);if(s=="(")return f(B(")"),ca,D)}function ca(s){return s=="var"?f(Er,Yt):s=="variable"?f(Yt):S(Yt)}function Yt(s,p){return s==")"?f():s==";"?f(Yt):p=="in"||p=="of"?(h.marked="keyword",f(W,Yt)):S(W,Yt)}function At(s,p){if(p=="*")return h.marked="keyword",f(At);if(s=="variable")return be(p),f(At);if(s=="(")return f(Re,B(")"),se(kt,")"),D,Mi,ee,xe);if(c&&p=="<")return f(B(">"),se(Fn,">"),D,At)}function Ut(s,p){if(p=="*")return h.marked="keyword",f(Ut);if(s=="variable")return be(p),f(Ut);if(s=="(")return f(Re,B(")"),se(kt,")"),D,Mi,xe);if(c&&p=="<")return f(B(">"),se(Fn,">"),D,Ut)}function qi(s,p){if(s=="keyword"||s=="variable")return h.marked="type",f(qi);if(p=="<")return f(B(">"),se(Fn,">"),D)}function kt(s,p){return p=="@"&&f(W,kt),s=="spread"?f(kt):c&&_e(p)?(h.marked="keyword",f(kt)):c&&s=="this"?f(Rt,ht):S(Be,Rt,ht)}function la(s,p){return s=="variable"?Li(s,p):In(s,p)}function Li(s,p){if(s=="variable")return be(p),f(In)}function In(s,p){if(p=="<")return f(B(">"),se(Fn,">"),D,In);if(p=="extends"||p=="implements"||c&&s==",")return p=="implements"&&(h.marked="keyword"),f(c?V:W,In);if(s=="{")return f(B("}"),ot,D)}function ot(s,p){if(s=="async"||s=="variable"&&(p=="static"||p=="get"||p=="set"||c&&_e(p))&&h.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return h.marked="keyword",f(ot);if(s=="variable"||h.style=="keyword")return h.marked="property",f(ln,ot);if(s=="number"||s=="string")return f(ln,ot);if(s=="[")return f(W,Rt,q("]"),ln,ot);if(p=="*")return h.marked="keyword",f(ot);if(c&&s=="(")return S(Ut,ot);if(s==";"||s==",")return f(ot);if(s=="}")return f();if(p=="@")return f(W,ot)}function ln(s,p){if(p=="!"||p=="?")return f(ln);if(s==":")return f(V,ht);if(p=="=")return f(ye);var A=h.state.lexical.prev,_=A&&A.info=="interface";return S(_?Ut:At)}function pa(s,p){return p=="*"?(h.marked="keyword",f(Tr,q(";"))):p=="default"?(h.marked="keyword",f(W,q(";"))):s=="{"?f(se(Hi,"}"),Tr,q(";")):S(ee)}function Hi(s,p){if(p=="as")return h.marked="keyword",f(q("variable"));if(s=="variable")return S(ye,Hi)}function ua(s){return s=="string"?f():s=="("?S(W):s=="."?S(nt):S(qn,$i,Tr)}function qn(s,p){return s=="{"?sn(qn,"}"):(s=="variable"&&be(p),p=="*"&&(h.marked="keyword"),f(fa))}function $i(s){if(s==",")return f(qn,$i)}function fa(s,p){if(p=="as")return h.marked="keyword",f(qn)}function Tr(s,p){if(p=="from")return h.marked="keyword",f(W)}function da(s){return s=="]"?f():S(se(ye,"]"))}function Ki(){return S(B("form"),Be,q("{"),B("}"),se(ma,"}"),D,D)}function ma(){return S(Be,ht)}function ga(s,p){return s.lastType=="operator"||s.lastType==","||y.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Ri(s,p,A){return p.tokenize==M&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(s.string.slice(0,s.pos-(A||0)))}return{startState:function(s){var p={tokenize:M,lastType:"sof",cc:[],lexical:new te((s||0)-r,0,"block",!1),localVars:t.localVars,context:t.localVars&&new Ke(null,null,!1),indented:s||0};return t.globalVars&&typeof t.globalVars=="object"&&(p.globalVars=t.globalVars),p},token:function(s,p){if(s.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=s.indentation(),I(s,p)),p.tokenize!=K&&s.eatSpace())return null;var A=p.tokenize(s,p);return P=="comment"?A:(p.lastType=P=="operator"&&(k=="++"||k=="--")?"incdec":P,Q(p,A,P,k,s))},indent:function(s,p){if(s.tokenize==K||s.tokenize==C)return n.Pass;if(s.tokenize!=M)return 0;var A=p&&p.charAt(0),_=s.lexical,F;if(!/^\s*else\b/.test(p))for(var Y=s.cc.length-1;Y>=0;--Y){var z=s.cc[Y];if(z==D)_=_.prev;else if(z!=Fi&&z!=xe)break}for(;(_.type=="stat"||_.type=="form")&&(A=="}"||(F=s.cc[s.cc.length-1])&&(F==nt||F==gt)&&!/^[,\.=+\-*:?[\(]/.test(p));)_=_.prev;i&&_.type==")"&&_.prev.type=="stat"&&(_=_.prev);var je=_.type,Ue=A==je;return je=="vardef"?_.indented+(s.lastType=="operator"||s.lastType==","?_.info.length+1:0):je=="form"&&A=="{"?_.indented:je=="form"?_.indented+r:je=="stat"?_.indented+(ga(s,p)?i||r:0):_.info=="switch"&&!Ue&&t.doubleIndentSwitch!=!1?_.indented+(/^(?:case|default)\b/.test(p)?r:2*r):_.align?_.column+(Ue?0:1):_.indented+(Ue?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:o,jsonMode:a,expressionAllowed:Ri,skipExpression:function(s){Q(s,"atom","atom","true",new n.StringStream("",2,null))}}}),n.registerHelper("wordChars","javascript",/[\w$]/),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/x-javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/manifest+json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})});(function(n){n(window.CodeMirror)})(function(n){"use strict";n.customOverlayMode=function(e,t,r){return{startState:function(){return{base:n.startState(e),overlay:n.startState(t),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:n.copyState(e,i.base),overlay:n.copyState(t,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(i,o){return(i!=o.streamSeen||Math.min(o.basePos,o.overlayPos)0&&(this.activeEditorExtensions.pop(),this.plugin.app.workspace.updateOptions())}async jump_to_next_cursor_location(e=null,t=!1){t&&!this.plugin.settings.auto_jump_to_cursor||e&&Jt(this.plugin.app)!==e||await this.cursor_jumper.jump_to_next_cursor_location()}async registerCodeMirrorMode(){if(!this.desktopShouldHighlight()&&!this.mobileShouldHighlight())return;let e=window.CodeMirror.getMode({},"javascript");if(e.name==="null"){oe(new O("Javascript syntax mode couldn't be found, can't enable syntax highlighting."));return}let t=window.CodeMirror.customOverlayMode;if(t==null){oe(new O("Couldn't find customOverlayMode, can't enable syntax highlighting."));return}window.CodeMirror.defineMode(Zo,function(r){let i={startState:function(){return{...window.CodeMirror.startState(e),inCommand:!1,tag_class:"",freeLine:!1}},copyState:function(o){return{...window.CodeMirror.startState(e),inCommand:o.inCommand,tag_class:o.tag_class,freeLine:o.freeLine}},blankLine:function(o){return o.inCommand?"line-background-templater-command-bg":null},token:function(o,a){if(o.sol()&&a.inCommand&&(a.freeLine=!0),a.inCommand){let c="";if(o.match(/[-_]{0,1}%>/,!0)){a.inCommand=!1,a.freeLine=!1;let m=a.tag_class;return a.tag_class="",`line-${Pi} ${Di} ${ec} ${m}`}let d=e.token&&e.token(o,a);return o.peek()==null&&a.freeLine&&(c+=" line-background-templater-command-bg"),a.freeLine||(c+=` line-${Pi}`),`${c} ${Di} ${d}`}let l=o.match(/<%[-_]{0,1}\s*([*+]{0,1})/,!0);if(l!=null){switch(l[1]){case"*":a.tag_class=nc;break;default:a.tag_class=tc;break}return a.inCommand=!0,`line-${Pi} ${Di} ${Zs} ${a.tag_class}`}for(;o.next()!=null&&!o.match(/<%/,!1););return null}};return t(window.CodeMirror.getMode(r,"hypermd"),i)})}updateEditorIntellisenseSetting(e){this.autocomplete.updateAutocompleteIntellisenseSetting(e)}};var Oi=class extends jr.Plugin{async onload(){await this.load_settings(),this.templater=new kn(this),await this.templater.setup(),this.editor_handler=new Ni(this),await this.editor_handler.setup(),this.fuzzy_suggester=new ii(this),this.event_handler=new xr(this,this.templater,this.settings),this.event_handler.setup(),this.command_handler=new wi(this),this.command_handler.setup(),(0,jr.addIcon)("templater-icon",qo),this.addRibbonIcon("templater-icon","Templater",async()=>{this.fuzzy_suggester.insert_template()}).setAttribute("id","rb-templater-icon"),this.addSettingTab(new ri(this)),this.app.workspace.onLayoutReady(()=>{this.templater.execute_startup_scripts()})}onunload(){this.templater.functions_generator.teardown()}async save_settings(){await this.saveData(this.settings),this.editor_handler.updateEditorIntellisenseSetting(this.settings.intellisense_render)}async load_settings(){this.settings=Object.assign({},Fo,await this.loadData())}}; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/templater-obsidian/manifest.json b/.obsidian/plugins/templater-obsidian/manifest.json new file mode 100644 index 0000000..0c646aa --- /dev/null +++ b/.obsidian/plugins/templater-obsidian/manifest.json @@ -0,0 +1,11 @@ +{ + "id": "templater-obsidian", + "name": "Templater", + "version": "2.11.1", + "description": "Create and use templates", + "minAppVersion": "1.5.0", + "author": "SilentVoid", + "authorUrl": "https://github.com/SilentVoid13", + "helpUrl": "https://silentvoid13.github.io/Templater/", + "isDesktopOnly": false +} diff --git a/.obsidian/plugins/templater-obsidian/styles.css b/.obsidian/plugins/templater-obsidian/styles.css new file mode 100644 index 0000000..c9ece98 --- /dev/null +++ b/.obsidian/plugins/templater-obsidian/styles.css @@ -0,0 +1,220 @@ +.templater_search { + width: calc(100% - 20px); +} + +.templater_div { + border-top: 1px solid var(--background-modifier-border); +} + +.templater_div > .setting-item { + border-top: none !important; + align-self: center; +} + +.templater_div > .setting-item > .setting-item-control { + justify-content: space-around; + padding: 0; + width: 100%; +} + +.templater_div + > .setting-item + > .setting-item-control + > .setting-editor-extra-setting-button { + align-self: center; +} + +.templater_donating { + margin: 10px; +} + +.templater_title { + margin: 0; + padding: 0; + margin-top: 5px; + text-align: center; +} + +.templater_template { + align-self: center; + margin-left: 5px; + margin-right: 5px; + width: 70%; +} + +.templater_cmd { + margin-left: 5px; + margin-right: 5px; + font-size: 14px; + width: 100%; +} + +.templater_div2 > .setting-item { + align-content: center; + justify-content: center; +} + +.templater-prompt-div { + display: flex; +} + +.templater-prompt-form { + display: flex; + flex-grow: 1; +} + +.templater-prompt-input { + flex-grow: 1; +} + +.templater-button-div { + display: flex; + flex-direction: column; + align-items: center; + margin-top: 1rem; +} + +textarea.templater-prompt-input { + height: 10rem; +} + +textarea.templater-prompt-input:focus { + border-color: var(--interactive-accent); +} + +.cm-s-obsidian .templater-command-bg { + left: 0px; + right: 0px; + background-color: var(--background-primary-alt); +} + +.cm-s-obsidian .cm-templater-command { + font-size: 0.85em; + font-family: var(--font-monospace); + line-height: 1.3; +} + +.cm-s-obsidian .templater-inline .cm-templater-command { + background-color: var(--background-primary-alt); +} + +.cm-s-obsidian .cm-templater-command.cm-templater-opening-tag { + font-weight: bold; +} + +.cm-s-obsidian .cm-templater-command.cm-templater-closing-tag { + font-weight: bold; +} + +.cm-s-obsidian .cm-templater-command.cm-templater-interpolation-tag { + color: var(--code-property, #008bff); +} + +.cm-s-obsidian .cm-templater-command.cm-templater-execution-tag { + color: var(--code-function, #c0d700); +} + +.cm-s-obsidian .cm-templater-command.cm-keyword { + color: var(--code-keyword, #00a7aa); + font-weight: normal; +} + +.cm-s-obsidian .cm-templater-command.cm-atom { + color: var(--code-normal, #f39b35); +} + +.cm-s-obsidian .cm-templater-command.cm-value, +.cm-s-obsidian .cm-templater-command.cm-number, +.cm-s-obsidian .cm-templater-command.cm-type { + color: var(--code-value, #a06fca); +} + +.cm-s-obsidian .cm-templater-command.cm-def, +.cm-s-obsidian .cm-templater-command.cm-type.cm-def { + color: var(--code-normal, var(--text-normal)); +} + +.cm-s-obsidian .cm-templater-command.cm-property, +.cm-s-obsidian .cm-templater-command.cm-property.cm-def, +.cm-s-obsidian .cm-templater-command.cm-attribute { + color: var(--code-function, #98e342); +} + +.cm-s-obsidian .cm-templater-command.cm-variable, +.cm-s-obsidian .cm-templater-command.cm-variable-2, +.cm-s-obsidian .cm-templater-command.cm-variable-3, +.cm-s-obsidian .cm-templater-command.cm-meta { + color: var(--code-property, #d4d4d4); +} + +.cm-s-obsidian .cm-templater-command.cm-callee, +.cm-s-obsidian .cm-templater-command.cm-operator, +.cm-s-obsidian .cm-templater-command.cm-qualifier, +.cm-s-obsidian .cm-templater-command.cm-builtin { + color: var(--code-operator, #fc4384); +} + +.cm-s-obsidian .cm-templater-command.cm-tag { + color: var(--code-tag, #fc4384); +} + +.cm-s-obsidian .cm-templater-command.cm-comment, +.cm-s-obsidian .cm-templater-command.cm-comment.cm-tag, +.cm-s-obsidian .cm-templater-command.cm-comment.cm-attribute { + color: var(--code-comment, #696d70); +} + +.cm-s-obsidian .cm-templater-command.cm-string, +.cm-s-obsidian .cm-templater-command.cm-string-2 { + color: var(--code-string, #e6db74); +} + +.cm-s-obsidian .cm-templater-command.cm-header, +.cm-s-obsidian .cm-templater-command.cm-hr { + color: var(--code-keyword, #da7dae); +} + +.cm-s-obsidian .cm-templater-command.cm-link { + color: var(--code-normal, #696d70); +} + +.cm-s-obsidian .cm-templater-command.cm-error { + border-bottom: 1px solid #c42412; +} + +.CodeMirror-hints { + position: absolute; + z-index: 10; + overflow: hidden; + list-style: none; + + margin: 0; + padding: 2px; + + -webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2); + box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2); + border-radius: 3px; + border: 1px solid silver; + + background: white; + font-size: 90%; + font-family: monospace; + + max-height: 20em; + overflow-y: auto; +} + +.CodeMirror-hint { + margin: 0; + padding: 0 4px; + border-radius: 2px; + white-space: pre; + color: black; + cursor: pointer; +} + +li.CodeMirror-hint-active { + background: #08f; + color: white; +} diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 9ca621e..343528a 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,39 +4,44 @@ "type": "split", "children": [ { - "id": "d0afed41b8685973", + "id": "a6f094df0e179c24", "type": "tabs", "children": [ { - "id": "74d64848bffd2359", + "id": "4694fd15b957885a", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "new notes/快捷键设置.md", - "mode": "source", - "source": false - }, - "icon": "lucide-file", - "title": "快捷键设置" - } - }, - { - "id": "3985a6d657d77461", - "type": "leaf", - "state": { - "type": "markdown", - "state": { - "file": "new notes/快捷键设置.md", + "file": "templates/daily_template.md", "mode": "source", "source": true }, "icon": "lucide-file", - "title": "快捷键设置" + "title": "daily_template" } } - ], - "currentTab": 1 + ] + }, + { + "id": "aa1061ad0c81038b", + "type": "tabs", + "children": [ + { + "id": "f18a369645815ad1", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "new notes/学习看板和其他 1.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "学习看板和其他 1" + } + } + ] } ], "direction": "vertical" @@ -157,13 +162,13 @@ "state": { "type": "outline", "state": { - "file": "new notes/快捷键设置.md", + "file": "templates/daily_template.md", "followCursor": false, "showSearch": false, "searchQuery": "" }, "icon": "lucide-list", - "title": "Outline of 快捷键设置" + "title": "Outline of daily_template" } }, { @@ -181,7 +186,8 @@ } ], "direction": "horizontal", - "width": 409.5 + "width": 337.5, + "collapsed": true }, "left-ribbon": { "hiddenItems": { @@ -196,30 +202,35 @@ "terminal:Open terminal": false, "table-editor-obsidian:Advanced Tables Toolbar": false, "weather-fetcher:Insert Weather": false, - "obsidian-kanban:Create new board": false + "obsidian-kanban:Create new board": false, + "card-board:CardBoard": false, + "templater-obsidian:Templater": false } }, - "active": "3985a6d657d77461", + "active": "4694fd15b957885a", "lastOpenFiles": [ - "new notes/快捷键设置.md", "templates/base_template.md", - "new notes/Untitled Kanban 1.md", - "new notes/Untitled Kanban.md", - "templates/kanban_template.md", - "kanban", "templates/daily_template.md", - "new notes/2025-04-06.md", - "new notes/pdf 插件的学习.md", - "new notes/2025-04-05.md", - "new notes/2025-04-04.md", + "kanban/mainboard.md", + "new notes/学习看板和其他 1.md", + "templates/kanban_template.md", + "new notes/学习看板和其他.md", "new notes/设置 nodeTest这个项目目录作为练手的项目.md", - "new notes/chat history.md", - "new notes/找到了如何入门obsidian的途径.md", "copilot-conversations/ubuntu lvm bindfs.md", "copilot-conversations/dataview ob q&a.md", + "new notes/2025-04-06.md", + "new notes/快捷键设置.md", + "Task.md", + "new notes/找到了如何入门obsidian的途径.md", + "new notes/2025-04-04.md", + "new notes/2025-04-05.md", + "new notes/Untitled Kanban 1.md", + "new notes/Untitled Kanban.md", + "kanban", + "new notes/pdf 插件的学习.md", + "new notes/chat history.md", "Chats/New Chat.md", "new notes/Untitled.md", - "Task.md", "欢迎.md", "Welcome.md", "templates/daily.md", diff --git a/kanban/mainboard.md b/kanban/mainboard.md new file mode 100644 index 0000000..e4a64c7 --- /dev/null +++ b/kanban/mainboard.md @@ -0,0 +1,32 @@ +--- + +kanban-plugin: board + +--- + +## may be do + +- [ ] [[学习看板和其他 1]] + + +## will be do + +- [ ] [[设置 nodeTest这个项目目录作为练手的项目]] + + +## doing + + + +## done + +**Complete** + + + + +%% kanban:settings +``` +{"kanban-plugin":"board","list-collapse":[false,false,false,false],"metadata-keys":[{"metadataKey":"status","label":"","shouldHideLabel":false,"containsMarkdown":false}]} +``` +%% \ No newline at end of file diff --git a/new notes/学习看板和其他 1.md b/new notes/学习看板和其他 1.md new file mode 100644 index 0000000..b6e21c6 --- /dev/null +++ b/new notes/学习看板和其他 1.md @@ -0,0 +1,19 @@ +--- +date: 2025-04-06 +tags: + - kanban + - project +title: 看板 - +project_name: 练手 +status: may be do +privority: 低 +--- + +## 学习看板和其他 1 + + +### 备注 + +- + + diff --git a/new notes/设置 nodeTest这个项目目录作为练手的项目.md b/new notes/设置 nodeTest这个项目目录作为练手的项目.md index 79592cd..4e29242 100644 --- a/new notes/设置 nodeTest这个项目目录作为练手的项目.md +++ b/new notes/设置 nodeTest这个项目目录作为练手的项目.md @@ -1,7 +1,18 @@ --- +date: 2025-04-06 tags: - - test - - job -links: obsidian://open?vault=notesTest&file=new%20notes%2F2025-04-04 + - kanban + - project +title: 看板 - +project_name: +status: will be do --- -并以此充实起 \ No newline at end of file + +## 设置 nodeTest这个项目目录作为练手的项目 + + +### 备注 + +- + + diff --git a/templates/daily_template.md b/templates/daily_template.md index 805cafe..8a24f40 100644 --- a/templates/daily_template.md +++ b/templates/daily_template.md @@ -8,13 +8,6 @@ mood: # {{title}} -## 今日目标 - -- - -## 完成事项 - -- ## 学到的新东西 @@ -22,11 +15,7 @@ mood: ## 遇到的问题及解决方案 -- - -## 明日计划 - -- + ## 其他备注 diff --git a/templates/kanban_template.md b/templates/kanban_template.md index 34c17c8..ac512c8 100644 --- a/templates/kanban_template.md +++ b/templates/kanban_template.md @@ -1,36 +1,18 @@ --- -date: {{date:YYYY-MM-DD}} -tags: [kanban, project] -title: 看板 - {{date:YYYY-MM-DD}} -project_name: -status: +date: 2025-04-06 +tags: + - kanban + - project +title: 看板 - +project_name: <% tp.system.suggester(["练手", "量化", "云服务", "其他"], ["练手", "量化", "云服务", "其他"]) %> +status: may be do +privority: <% tp.system.suggester(["高", "中", "低"], ["高", "中", "低"]) %> --- -# {{title}} +## <% tp.file.title %> -## 项目描述 -- - -## 看板状态 - -```dataview -TASK FROM "看板名称" -``` - -## 待办事项 (To Do) - -- [ ] - -## 进行中 (In Progress) - -- [ ] - -## 已完成 (Done) - -- [ ] - -## 备注 +### 备注 -