commit 50d7d1de3d2ad5cad73db348906d8cdd07ec0db8 Author: Yaojia Wang Date: Sat Mar 7 17:27:51 2026 +0100 feat: initialize Knowledge vault with PARA + Zettelkasten system - PARA folder structure (Inbox, Projects, Areas, Resources, Archive) - Zettelkasten folder for atomic permanent notes - Daily Notes folder with template - 6 note templates (Inbox, Daily, Zettelkasten, Project, Resource, MOC) - System folder for Attachments and Templates - Home dashboard with Dataview query - CLAUDE.md with knowledge-vault skill integration - README with complete usage guide Co-Authored-By: Claude Opus 4.6 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff499a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Obsidian +.obsidian/workspace.json +.obsidian/workspace-mobile.json +.obsidian/graph.json +.trash/ +*.base + +# Claude Code +.claude/ diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..13ed932 --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-checklist-plugin" +] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..639b90d --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/daily-notes.json b/.obsidian/daily-notes.json new file mode 100644 index 0000000..6b66188 --- /dev/null +++ b/.obsidian/daily-notes.json @@ -0,0 +1,4 @@ +{ + "folder": "0 - Daily Notes", + "template": "System/Templates/Daily Note" +} \ No newline at end of file diff --git a/.obsidian/plugins/calendar/main.js b/.obsidian/plugins/calendar/main.js new file mode 100644 index 0000000..ed6cea3 --- /dev/null +++ b/.obsidian/plugins/calendar/main.js @@ -0,0 +1,4459 @@ +'use strict'; + +var obsidian = require('obsidian'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var obsidian__default = /*#__PURE__*/_interopDefaultLegacy(obsidian); + +const DEFAULT_WEEK_FORMAT = "gggg-[W]ww"; +const DEFAULT_WORDS_PER_DOT = 250; +const VIEW_TYPE_CALENDAR = "calendar"; +const TRIGGER_ON_OPEN = "calendar:open"; + +const DEFAULT_DAILY_NOTE_FORMAT = "YYYY-MM-DD"; +const DEFAULT_WEEKLY_NOTE_FORMAT = "gggg-[W]ww"; +const DEFAULT_MONTHLY_NOTE_FORMAT = "YYYY-MM"; + +function shouldUsePeriodicNotesSettings(periodicity) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const periodicNotes = window.app.plugins.getPlugin("periodic-notes"); + return periodicNotes && periodicNotes.settings?.[periodicity]?.enabled; +} +/** + * Read the user settings for the `daily-notes` plugin + * to keep behavior of creating a new note in-sync. + */ +function getDailyNoteSettings() { + try { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const { internalPlugins, plugins } = window.app; + if (shouldUsePeriodicNotesSettings("daily")) { + const { format, folder, template } = plugins.getPlugin("periodic-notes")?.settings?.daily || {}; + return { + format: format || DEFAULT_DAILY_NOTE_FORMAT, + folder: folder?.trim() || "", + template: template?.trim() || "", + }; + } + const { folder, format, template } = internalPlugins.getPluginById("daily-notes")?.instance?.options || {}; + return { + format: format || DEFAULT_DAILY_NOTE_FORMAT, + folder: folder?.trim() || "", + template: template?.trim() || "", + }; + } + catch (err) { + console.info("No custom daily note settings found!", err); + } +} +/** + * Read the user settings for the `weekly-notes` plugin + * to keep behavior of creating a new note in-sync. + */ +function getWeeklyNoteSettings() { + try { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const pluginManager = window.app.plugins; + const calendarSettings = pluginManager.getPlugin("calendar")?.options; + const periodicNotesSettings = pluginManager.getPlugin("periodic-notes") + ?.settings?.weekly; + if (shouldUsePeriodicNotesSettings("weekly")) { + return { + format: periodicNotesSettings.format || DEFAULT_WEEKLY_NOTE_FORMAT, + folder: periodicNotesSettings.folder?.trim() || "", + template: periodicNotesSettings.template?.trim() || "", + }; + } + const settings = calendarSettings || {}; + return { + format: settings.weeklyNoteFormat || DEFAULT_WEEKLY_NOTE_FORMAT, + folder: settings.weeklyNoteFolder?.trim() || "", + template: settings.weeklyNoteTemplate?.trim() || "", + }; + } + catch (err) { + console.info("No custom weekly note settings found!", err); + } +} +/** + * Read the user settings for the `periodic-notes` plugin + * to keep behavior of creating a new note in-sync. + */ +function getMonthlyNoteSettings() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const pluginManager = window.app.plugins; + try { + const settings = (shouldUsePeriodicNotesSettings("monthly") && + pluginManager.getPlugin("periodic-notes")?.settings?.monthly) || + {}; + return { + format: settings.format || DEFAULT_MONTHLY_NOTE_FORMAT, + folder: settings.folder?.trim() || "", + template: settings.template?.trim() || "", + }; + } + catch (err) { + console.info("No custom monthly note settings found!", err); + } +} + +/** + * dateUID is a way of weekly identifying daily/weekly/monthly notes. + * They are prefixed with the granularity to avoid ambiguity. + */ +function getDateUID$1(date, granularity = "day") { + const ts = date.clone().startOf(granularity).format(); + return `${granularity}-${ts}`; +} +function removeEscapedCharacters(format) { + return format.replace(/\[[^\]]*\]/g, ""); // remove everything within brackets +} +/** + * XXX: When parsing dates that contain both week numbers and months, + * Moment choses to ignore the week numbers. For the week dateUID, we + * want the opposite behavior. Strip the MMM from the format to patch. + */ +function isFormatAmbiguous(format, granularity) { + if (granularity === "week") { + const cleanFormat = removeEscapedCharacters(format); + return (/w{1,2}/i.test(cleanFormat) && + (/M{1,4}/.test(cleanFormat) || /D{1,4}/.test(cleanFormat))); + } + return false; +} +function getDateFromFile(file, granularity) { + const getSettings = { + day: getDailyNoteSettings, + week: getWeeklyNoteSettings, + month: getMonthlyNoteSettings, + }; + const format = getSettings[granularity]().format.split("/").pop(); + const noteDate = window.moment(file.basename, format, true); + if (!noteDate.isValid()) { + return null; + } + if (isFormatAmbiguous(format, granularity)) { + if (granularity === "week") { + const cleanFormat = removeEscapedCharacters(format); + if (/w{1,2}/i.test(cleanFormat)) { + return window.moment(file.basename, + // If format contains week, remove day & month formatting + format.replace(/M{1,4}/g, "").replace(/D{1,4}/g, ""), false); + } + } + } + return noteDate; +} + +// Credit: @creationix/path.js +function join(...partSegments) { + // Split the inputs into a list of path commands. + let parts = []; + for (let i = 0, l = partSegments.length; i < l; i++) { + parts = parts.concat(partSegments[i].split("/")); + } + // Interpret the path commands to get the new resolved path. + const newParts = []; + for (let i = 0, l = parts.length; i < l; i++) { + const part = parts[i]; + // Remove leading and trailing slashes + // Also remove "." segments + if (!part || part === ".") + continue; + // Push new path segments. + else + newParts.push(part); + } + // Preserve the initial slash if there was one. + if (parts[0] === "") + newParts.unshift(""); + // Turn back into a single string path. + return newParts.join("/"); +} +async function ensureFolderExists(path) { + const dirs = path.replace(/\\/g, "/").split("/"); + dirs.pop(); // remove basename + if (dirs.length) { + const dir = join(...dirs); + if (!window.app.vault.getAbstractFileByPath(dir)) { + await window.app.vault.createFolder(dir); + } + } +} +async function getNotePath(directory, filename) { + if (!filename.endsWith(".md")) { + filename += ".md"; + } + const path = obsidian__default['default'].normalizePath(join(directory, filename)); + await ensureFolderExists(path); + return path; +} +async function getTemplateInfo(template) { + const { metadataCache, vault } = window.app; + const templatePath = obsidian__default['default'].normalizePath(template); + if (templatePath === "/") { + return Promise.resolve(["", null]); + } + try { + const templateFile = metadataCache.getFirstLinkpathDest(templatePath, ""); + const contents = await vault.cachedRead(templateFile); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const IFoldInfo = window.app.foldManager.load(templateFile); + return [contents, IFoldInfo]; + } + catch (err) { + console.error(`Failed to read the daily note template '${templatePath}'`, err); + new obsidian__default['default'].Notice("Failed to read the daily note template"); + return ["", null]; + } +} + +class DailyNotesFolderMissingError extends Error { +} +/** + * This function mimics the behavior of the daily-notes plugin + * so it will replace {{date}}, {{title}}, and {{time}} with the + * formatted timestamp. + * + * Note: it has an added bonus that it's not 'today' specific. + */ +async function createDailyNote(date) { + const app = window.app; + const { vault } = app; + const moment = window.moment; + const { template, format, folder } = getDailyNoteSettings(); + const [templateContents, IFoldInfo] = await getTemplateInfo(template); + const filename = date.format(format); + const normalizedPath = await getNotePath(folder, filename); + try { + const createdFile = await vault.create(normalizedPath, templateContents + .replace(/{{\s*date\s*}}/gi, filename) + .replace(/{{\s*time\s*}}/gi, moment().format("HH:mm")) + .replace(/{{\s*title\s*}}/gi, filename) + .replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { + const now = moment(); + const currentDate = date.clone().set({ + hour: now.get("hour"), + minute: now.get("minute"), + second: now.get("second"), + }); + if (calc) { + currentDate.add(parseInt(timeDelta, 10), unit); + } + if (momentFormat) { + return currentDate.format(momentFormat.substring(1).trim()); + } + return currentDate.format(format); + }) + .replace(/{{\s*yesterday\s*}}/gi, date.clone().subtract(1, "day").format(format)) + .replace(/{{\s*tomorrow\s*}}/gi, date.clone().add(1, "d").format(format))); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + app.foldManager.save(createdFile, IFoldInfo); + return createdFile; + } + catch (err) { + console.error(`Failed to create file: '${normalizedPath}'`, err); + new obsidian__default['default'].Notice("Unable to create new file."); + } +} +function getDailyNote(date, dailyNotes) { + return dailyNotes[getDateUID$1(date, "day")] ?? null; +} +function getAllDailyNotes() { + /** + * Find all daily notes in the daily note folder + */ + const { vault } = window.app; + const { folder } = getDailyNoteSettings(); + const dailyNotesFolder = vault.getAbstractFileByPath(obsidian__default['default'].normalizePath(folder)); + if (!dailyNotesFolder) { + throw new DailyNotesFolderMissingError("Failed to find daily notes folder"); + } + const dailyNotes = {}; + obsidian__default['default'].Vault.recurseChildren(dailyNotesFolder, (note) => { + if (note instanceof obsidian__default['default'].TFile) { + const date = getDateFromFile(note, "day"); + if (date) { + const dateString = getDateUID$1(date, "day"); + dailyNotes[dateString] = note; + } + } + }); + return dailyNotes; +} + +class WeeklyNotesFolderMissingError extends Error { +} +function getDaysOfWeek$1() { + const { moment } = window; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let weekStart = moment.localeData()._week.dow; + const daysOfWeek = [ + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + ]; + while (weekStart) { + daysOfWeek.push(daysOfWeek.shift()); + weekStart--; + } + return daysOfWeek; +} +function getDayOfWeekNumericalValue(dayOfWeekName) { + return getDaysOfWeek$1().indexOf(dayOfWeekName.toLowerCase()); +} +async function createWeeklyNote(date) { + const { vault } = window.app; + const { template, format, folder } = getWeeklyNoteSettings(); + const [templateContents, IFoldInfo] = await getTemplateInfo(template); + const filename = date.format(format); + const normalizedPath = await getNotePath(folder, filename); + try { + const createdFile = await vault.create(normalizedPath, templateContents + .replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { + const now = window.moment(); + const currentDate = date.clone().set({ + hour: now.get("hour"), + minute: now.get("minute"), + second: now.get("second"), + }); + if (calc) { + currentDate.add(parseInt(timeDelta, 10), unit); + } + if (momentFormat) { + return currentDate.format(momentFormat.substring(1).trim()); + } + return currentDate.format(format); + }) + .replace(/{{\s*title\s*}}/gi, filename) + .replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")) + .replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi, (_, dayOfWeek, momentFormat) => { + const day = getDayOfWeekNumericalValue(dayOfWeek); + return date.weekday(day).format(momentFormat.trim()); + })); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + window.app.foldManager.save(createdFile, IFoldInfo); + return createdFile; + } + catch (err) { + console.error(`Failed to create file: '${normalizedPath}'`, err); + new obsidian__default['default'].Notice("Unable to create new file."); + } +} +function getWeeklyNote(date, weeklyNotes) { + return weeklyNotes[getDateUID$1(date, "week")] ?? null; +} +function getAllWeeklyNotes() { + const { vault } = window.app; + const { folder } = getWeeklyNoteSettings(); + const weeklyNotesFolder = vault.getAbstractFileByPath(obsidian__default['default'].normalizePath(folder)); + if (!weeklyNotesFolder) { + throw new WeeklyNotesFolderMissingError("Failed to find weekly notes folder"); + } + const weeklyNotes = {}; + obsidian__default['default'].Vault.recurseChildren(weeklyNotesFolder, (note) => { + if (note instanceof obsidian__default['default'].TFile) { + const date = getDateFromFile(note, "week"); + if (date) { + const dateString = getDateUID$1(date, "week"); + weeklyNotes[dateString] = note; + } + } + }); + return weeklyNotes; +} + +function appHasDailyNotesPluginLoaded() { + const { app } = window; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const dailyNotesPlugin = app.internalPlugins.plugins["daily-notes"]; + if (dailyNotesPlugin && dailyNotesPlugin.enabled) { + return true; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const periodicNotes = app.plugins.getPlugin("periodic-notes"); + return periodicNotes && periodicNotes.settings?.daily?.enabled; +} +var appHasDailyNotesPluginLoaded_1 = appHasDailyNotesPluginLoaded; +var createDailyNote_1 = createDailyNote; +var createWeeklyNote_1 = createWeeklyNote; +var getAllDailyNotes_1 = getAllDailyNotes; +var getAllWeeklyNotes_1 = getAllWeeklyNotes; +var getDailyNote_1 = getDailyNote; +var getDailyNoteSettings_1 = getDailyNoteSettings; +var getDateFromFile_1 = getDateFromFile; +var getDateUID_1$1 = getDateUID$1; +var getWeeklyNote_1 = getWeeklyNote; +var getWeeklyNoteSettings_1 = getWeeklyNoteSettings; + +function noop$1() { } +function run$1(fn) { + return fn(); +} +function blank_object$1() { + return Object.create(null); +} +function run_all$1(fns) { + fns.forEach(run$1); +} +function is_function$1(thing) { + return typeof thing === 'function'; +} +function safe_not_equal$1(a, b) { + return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); +} +function not_equal$1(a, b) { + return a != a ? b == b : a !== b; +} +function is_empty$1(obj) { + return Object.keys(obj).length === 0; +} +function subscribe(store, ...callbacks) { + if (store == null) { + return noop$1; + } + const unsub = store.subscribe(...callbacks); + return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; +} +function get_store_value(store) { + let value; + subscribe(store, _ => value = _)(); + return value; +} +function component_subscribe(component, store, callback) { + component.$$.on_destroy.push(subscribe(store, callback)); +} +function detach$1(node) { + node.parentNode.removeChild(node); +} +function children$1(element) { + return Array.from(element.childNodes); +} + +let current_component$1; +function set_current_component$1(component) { + current_component$1 = component; +} +function get_current_component$1() { + if (!current_component$1) + throw new Error('Function called outside component initialization'); + return current_component$1; +} +function onDestroy(fn) { + get_current_component$1().$$.on_destroy.push(fn); +} + +const dirty_components$1 = []; +const binding_callbacks$1 = []; +const render_callbacks$1 = []; +const flush_callbacks$1 = []; +const resolved_promise$1 = Promise.resolve(); +let update_scheduled$1 = false; +function schedule_update$1() { + if (!update_scheduled$1) { + update_scheduled$1 = true; + resolved_promise$1.then(flush$1); + } +} +function add_render_callback$1(fn) { + render_callbacks$1.push(fn); +} +function add_flush_callback(fn) { + flush_callbacks$1.push(fn); +} +let flushing$1 = false; +const seen_callbacks$1 = new Set(); +function flush$1() { + if (flushing$1) + return; + flushing$1 = true; + do { + // first, call beforeUpdate functions + // and update components + for (let i = 0; i < dirty_components$1.length; i += 1) { + const component = dirty_components$1[i]; + set_current_component$1(component); + update$1(component.$$); + } + set_current_component$1(null); + dirty_components$1.length = 0; + while (binding_callbacks$1.length) + binding_callbacks$1.pop()(); + // then, once components are updated, call + // afterUpdate functions. This may cause + // subsequent updates... + for (let i = 0; i < render_callbacks$1.length; i += 1) { + const callback = render_callbacks$1[i]; + if (!seen_callbacks$1.has(callback)) { + // ...so guard against infinite loops + seen_callbacks$1.add(callback); + callback(); + } + } + render_callbacks$1.length = 0; + } while (dirty_components$1.length); + while (flush_callbacks$1.length) { + flush_callbacks$1.pop()(); + } + update_scheduled$1 = false; + flushing$1 = false; + seen_callbacks$1.clear(); +} +function update$1($$) { + if ($$.fragment !== null) { + $$.update(); + run_all$1($$.before_update); + const dirty = $$.dirty; + $$.dirty = [-1]; + $$.fragment && $$.fragment.p($$.ctx, dirty); + $$.after_update.forEach(add_render_callback$1); + } +} +const outroing$1 = new Set(); +let outros$1; +function transition_in$1(block, local) { + if (block && block.i) { + outroing$1.delete(block); + block.i(local); + } +} +function transition_out$1(block, local, detach, callback) { + if (block && block.o) { + if (outroing$1.has(block)) + return; + outroing$1.add(block); + outros$1.c.push(() => { + outroing$1.delete(block); + if (callback) { + if (detach) + block.d(1); + callback(); + } + }); + block.o(local); + } +} + +function bind(component, name, callback) { + const index = component.$$.props[name]; + if (index !== undefined) { + component.$$.bound[index] = callback; + callback(component.$$.ctx[index]); + } +} +function create_component$1(block) { + block && block.c(); +} +function mount_component$1(component, target, anchor, customElement) { + const { fragment, on_mount, on_destroy, after_update } = component.$$; + fragment && fragment.m(target, anchor); + if (!customElement) { + // onMount happens before the initial afterUpdate + add_render_callback$1(() => { + const new_on_destroy = on_mount.map(run$1).filter(is_function$1); + if (on_destroy) { + on_destroy.push(...new_on_destroy); + } + else { + // Edge case - component was destroyed immediately, + // most likely as a result of a binding initialising + run_all$1(new_on_destroy); + } + component.$$.on_mount = []; + }); + } + after_update.forEach(add_render_callback$1); +} +function destroy_component$1(component, detaching) { + const $$ = component.$$; + if ($$.fragment !== null) { + run_all$1($$.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$1(component, i) { + if (component.$$.dirty[0] === -1) { + dirty_components$1.push(component); + schedule_update$1(); + component.$$.dirty.fill(0); + } + component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); +} +function init$1(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { + const parent_component = current_component$1; + set_current_component$1(component); + const $$ = component.$$ = { + fragment: null, + ctx: null, + // state + props, + update: noop$1, + not_equal, + bound: blank_object$1(), + // lifecycle + on_mount: [], + on_destroy: [], + on_disconnect: [], + before_update: [], + after_update: [], + context: new Map(parent_component ? parent_component.$$.context : []), + // everything else + callbacks: blank_object$1(), + dirty, + skip_bound: false + }; + 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$1(component, i); + } + return ret; + }) + : []; + $$.update(); + ready = true; + run_all$1($$.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$1(options.target); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.l(nodes); + nodes.forEach(detach$1); + } + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.c(); + } + if (options.intro) + transition_in$1(component.$$.fragment); + mount_component$1(component, options.target, options.anchor, options.customElement); + flush$1(); + } + set_current_component$1(parent_component); +} +/** + * Base class for Svelte components. Used when dev=false. + */ +class SvelteComponent$1 { + $destroy() { + destroy_component$1(this, 1); + this.$destroy = noop$1; + } + $on(type, callback) { + 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$1($$props)) { + this.$$.skip_bound = true; + this.$$set($$props); + this.$$.skip_bound = false; + } + } +} + +const subscriber_queue = []; +/** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions + */ +function writable(value, start = noop$1) { + let stop; + const subscribers = []; + function set(new_value) { + if (safe_not_equal$1(value, new_value)) { + value = new_value; + if (stop) { // store is ready + const run_queue = !subscriber_queue.length; + for (let i = 0; i < subscribers.length; i += 1) { + const s = subscribers[i]; + s[1](); + subscriber_queue.push(s, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop$1) { + const subscriber = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) { + stop = start(set) || noop$1; + } + run(value); + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; +} + +const weekdays$1 = [ + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", +]; +const defaultSettings = Object.freeze({ + shouldConfirmBeforeCreate: true, + weekStart: "locale", + wordsPerDot: DEFAULT_WORDS_PER_DOT, + showWeeklyNote: false, + weeklyNoteFormat: "", + weeklyNoteTemplate: "", + weeklyNoteFolder: "", + localeOverride: "system-default", +}); +function appHasPeriodicNotesPluginLoaded() { + var _a, _b; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const periodicNotes = window.app.plugins.getPlugin("periodic-notes"); + return periodicNotes && ((_b = (_a = periodicNotes.settings) === null || _a === void 0 ? void 0 : _a.weekly) === null || _b === void 0 ? void 0 : _b.enabled); +} +class CalendarSettingsTab extends obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + this.containerEl.empty(); + if (!appHasDailyNotesPluginLoaded_1()) { + this.containerEl.createDiv("settings-banner", (banner) => { + banner.createEl("h3", { + text: "⚠️ Daily Notes plugin not enabled", + }); + banner.createEl("p", { + cls: "setting-item-description", + text: "The calendar is best used in conjunction with either the Daily Notes plugin or the Periodic Notes plugin (available in the Community Plugins catalog).", + }); + }); + } + this.containerEl.createEl("h3", { + text: "General Settings", + }); + this.addDotThresholdSetting(); + this.addWeekStartSetting(); + this.addConfirmCreateSetting(); + this.addShowWeeklyNoteSetting(); + if (this.plugin.options.showWeeklyNote && + !appHasPeriodicNotesPluginLoaded()) { + this.containerEl.createEl("h3", { + text: "Weekly Note Settings", + }); + this.containerEl.createEl("p", { + cls: "setting-item-description", + text: "Note: Weekly Note settings are moving. You are encouraged to install the 'Periodic Notes' plugin to keep the functionality in the future.", + }); + this.addWeeklyNoteFormatSetting(); + this.addWeeklyNoteTemplateSetting(); + this.addWeeklyNoteFolderSetting(); + } + this.containerEl.createEl("h3", { + text: "Advanced Settings", + }); + this.addLocaleOverrideSetting(); + } + addDotThresholdSetting() { + new obsidian.Setting(this.containerEl) + .setName("Words per dot") + .setDesc("How many words should be represented by a single dot?") + .addText((textfield) => { + textfield.setPlaceholder(String(DEFAULT_WORDS_PER_DOT)); + textfield.inputEl.type = "number"; + textfield.setValue(String(this.plugin.options.wordsPerDot)); + textfield.onChange(async (value) => { + this.plugin.writeOptions(() => ({ + wordsPerDot: value !== "" ? Number(value) : undefined, + })); + }); + }); + } + addWeekStartSetting() { + const { moment } = window; + const localizedWeekdays = moment.weekdays(); + const localeWeekStartNum = window._bundledLocaleWeekSpec.dow; + const localeWeekStart = moment.weekdays()[localeWeekStartNum]; + new obsidian.Setting(this.containerEl) + .setName("Start week on:") + .setDesc("Choose what day of the week to start. Select 'Locale default' to use the default specified by moment.js") + .addDropdown((dropdown) => { + dropdown.addOption("locale", `Locale default (${localeWeekStart})`); + localizedWeekdays.forEach((day, i) => { + dropdown.addOption(weekdays$1[i], day); + }); + dropdown.setValue(this.plugin.options.weekStart); + dropdown.onChange(async (value) => { + this.plugin.writeOptions(() => ({ + weekStart: value, + })); + }); + }); + } + addConfirmCreateSetting() { + new obsidian.Setting(this.containerEl) + .setName("Confirm before creating new note") + .setDesc("Show a confirmation modal before creating a new note") + .addToggle((toggle) => { + toggle.setValue(this.plugin.options.shouldConfirmBeforeCreate); + toggle.onChange(async (value) => { + this.plugin.writeOptions(() => ({ + shouldConfirmBeforeCreate: value, + })); + }); + }); + } + addShowWeeklyNoteSetting() { + new obsidian.Setting(this.containerEl) + .setName("Show week number") + .setDesc("Enable this to add a column with the week number") + .addToggle((toggle) => { + toggle.setValue(this.plugin.options.showWeeklyNote); + toggle.onChange(async (value) => { + this.plugin.writeOptions(() => ({ showWeeklyNote: value })); + this.display(); // show/hide weekly settings + }); + }); + } + addWeeklyNoteFormatSetting() { + new obsidian.Setting(this.containerEl) + .setName("Weekly note format") + .setDesc("For more syntax help, refer to format reference") + .addText((textfield) => { + textfield.setValue(this.plugin.options.weeklyNoteFormat); + textfield.setPlaceholder(DEFAULT_WEEK_FORMAT); + textfield.onChange(async (value) => { + this.plugin.writeOptions(() => ({ weeklyNoteFormat: value })); + }); + }); + } + addWeeklyNoteTemplateSetting() { + new obsidian.Setting(this.containerEl) + .setName("Weekly note template") + .setDesc("Choose the file you want to use as the template for your weekly notes") + .addText((textfield) => { + textfield.setValue(this.plugin.options.weeklyNoteTemplate); + textfield.onChange(async (value) => { + this.plugin.writeOptions(() => ({ weeklyNoteTemplate: value })); + }); + }); + } + addWeeklyNoteFolderSetting() { + new obsidian.Setting(this.containerEl) + .setName("Weekly note folder") + .setDesc("New weekly notes will be placed here") + .addText((textfield) => { + textfield.setValue(this.plugin.options.weeklyNoteFolder); + textfield.onChange(async (value) => { + this.plugin.writeOptions(() => ({ weeklyNoteFolder: value })); + }); + }); + } + addLocaleOverrideSetting() { + var _a; + const { moment } = window; + const sysLocale = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase(); + new obsidian.Setting(this.containerEl) + .setName("Override locale:") + .setDesc("Set this if you want to use a locale different from the default") + .addDropdown((dropdown) => { + dropdown.addOption("system-default", `Same as system (${sysLocale})`); + moment.locales().forEach((locale) => { + dropdown.addOption(locale, locale); + }); + dropdown.setValue(this.plugin.options.localeOverride); + dropdown.onChange(async (value) => { + this.plugin.writeOptions(() => ({ + localeOverride: value, + })); + }); + }); + } +} + +const classList = (obj) => { + return Object.entries(obj) + .filter(([_k, v]) => !!v) + .map(([k, _k]) => k); +}; +function clamp(num, lowerBound, upperBound) { + return Math.min(Math.max(lowerBound, num), upperBound); +} +function partition(arr, predicate) { + const pass = []; + const fail = []; + arr.forEach((elem) => { + if (predicate(elem)) { + pass.push(elem); + } + else { + fail.push(elem); + } + }); + return [pass, fail]; +} +/** + * Lookup the dateUID for a given file. It compares the filename + * to the daily and weekly note formats to find a match. + * + * @param file + */ +function getDateUIDFromFile(file) { + if (!file) { + return null; + } + // TODO: I'm not checking the path! + let date = getDateFromFile_1(file, "day"); + if (date) { + return getDateUID_1$1(date, "day"); + } + date = getDateFromFile_1(file, "week"); + if (date) { + return getDateUID_1$1(date, "week"); + } + return null; +} +function getWordCount(text) { + const spaceDelimitedChars = /A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/ + .source; + const nonSpaceDelimitedWords = /\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/ + .source; + const pattern = new RegExp([ + `(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${spaceDelimitedChars}])+`, + nonSpaceDelimitedWords, + ].join("|"), "g"); + return (text.match(pattern) || []).length; +} + +function createDailyNotesStore() { + let hasError = false; + const store = writable(null); + return Object.assign({ reindex: () => { + try { + const dailyNotes = getAllDailyNotes_1(); + store.set(dailyNotes); + hasError = false; + } + catch (err) { + if (!hasError) { + // Avoid error being shown multiple times + console.log("[Calendar] Failed to find daily notes folder", err); + } + store.set({}); + hasError = true; + } + } }, store); +} +function createWeeklyNotesStore() { + let hasError = false; + const store = writable(null); + return Object.assign({ reindex: () => { + try { + const weeklyNotes = getAllWeeklyNotes_1(); + store.set(weeklyNotes); + hasError = false; + } + catch (err) { + if (!hasError) { + // Avoid error being shown multiple times + console.log("[Calendar] Failed to find weekly notes folder", err); + } + store.set({}); + hasError = true; + } + } }, store); +} +const settings = writable(defaultSettings); +const dailyNotes = createDailyNotesStore(); +const weeklyNotes = createWeeklyNotesStore(); +function createSelectedFileStore() { + const store = writable(null); + return Object.assign({ setFile: (file) => { + const id = getDateUIDFromFile(file); + store.set(id); + } }, store); +} +const activeFile = createSelectedFileStore(); + +class ConfirmationModal extends obsidian.Modal { + constructor(app, config) { + super(app); + const { cta, onAccept, text, title } = config; + this.contentEl.createEl("h2", { text: title }); + this.contentEl.createEl("p", { text }); + this.contentEl.createDiv("modal-button-container", (buttonsEl) => { + buttonsEl + .createEl("button", { text: "Never mind" }) + .addEventListener("click", () => this.close()); + buttonsEl + .createEl("button", { + cls: "mod-cta", + text: cta, + }) + .addEventListener("click", async (e) => { + await onAccept(e); + this.close(); + }); + }); + } +} +function createConfirmationDialog({ cta, onAccept, text, title, }) { + new ConfirmationModal(window.app, { cta, onAccept, text, title }).open(); +} + +/** + * Create a Daily Note for a given date. + */ +async function tryToCreateDailyNote(date, inNewSplit, settings, cb) { + const { workspace } = window.app; + const { format } = getDailyNoteSettings_1(); + const filename = date.format(format); + const createFile = async () => { + const dailyNote = await createDailyNote_1(date); + const leaf = inNewSplit + ? workspace.splitActiveLeaf() + : workspace.getUnpinnedLeaf(); + await leaf.openFile(dailyNote); + cb === null || cb === void 0 ? void 0 : cb(dailyNote); + }; + if (settings.shouldConfirmBeforeCreate) { + createConfirmationDialog({ + cta: "Create", + onAccept: createFile, + text: `File ${filename} does not exist. Would you like to create it?`, + title: "New Daily Note", + }); + } + else { + await createFile(); + } +} + +/** + * Create a Weekly Note for a given date. + */ +async function tryToCreateWeeklyNote(date, inNewSplit, settings, cb) { + const { workspace } = window.app; + const { format } = getWeeklyNoteSettings_1(); + const filename = date.format(format); + const createFile = async () => { + const dailyNote = await createWeeklyNote_1(date); + const leaf = inNewSplit + ? workspace.splitActiveLeaf() + : workspace.getUnpinnedLeaf(); + await leaf.openFile(dailyNote); + cb === null || cb === void 0 ? void 0 : cb(dailyNote); + }; + if (settings.shouldConfirmBeforeCreate) { + createConfirmationDialog({ + cta: "Create", + onAccept: createFile, + text: `File ${filename} does not exist. Would you like to create it?`, + title: "New Weekly Note", + }); + } + else { + await createFile(); + } +} + +function noop() { } +function assign(tar, src) { + // @ts-ignore + for (const k in src) + tar[k] = src[k]; + return tar; +} +function is_promise(value) { + return value && typeof value === 'object' && typeof value.then === 'function'; +} +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 not_equal(a, b) { + return a != a ? b == b : a !== b; +} +function is_empty(obj) { + return Object.keys(obj).length === 0; +} +function create_slot(definition, ctx, $$scope, fn) { + if (definition) { + const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); + return definition[0](slot_ctx); + } +} +function get_slot_context(definition, ctx, $$scope, fn) { + return definition[1] && fn + ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) + : $$scope.ctx; +} +function get_slot_changes(definition, $$scope, dirty, fn) { + if (definition[2] && fn) { + const lets = definition[2](fn(dirty)); + if ($$scope.dirty === undefined) { + return lets; + } + if (typeof lets === 'object') { + const merged = []; + const len = Math.max($$scope.dirty.length, lets.length); + for (let i = 0; i < len; i += 1) { + merged[i] = $$scope.dirty[i] | lets[i]; + } + return merged; + } + return $$scope.dirty | lets; + } + return $$scope.dirty; +} +function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) { + const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn); + if (slot_changes) { + const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); + slot.p(slot_context, slot_changes); + } +} +function null_to_empty(value) { + return value == null ? '' : value; +} + +function append(target, node) { + target.appendChild(node); +} +function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); +} +function detach(node) { + 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 svg_element(name) { + return document.createElementNS('http://www.w3.org/2000/svg', name); +} +function text(data) { + return document.createTextNode(data); +} +function space() { + return text(' '); +} +function empty() { + 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 set_attributes(node, attributes) { + // @ts-ignore + const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); + for (const key in attributes) { + if (attributes[key] == null) { + node.removeAttribute(key); + } + else if (key === 'style') { + node.style.cssText = attributes[key]; + } + else if (key === '__value') { + node.value = node[key] = attributes[key]; + } + else if (descriptors[key] && descriptors[key].set) { + node[key] = attributes[key]; + } + else { + attr(node, key, attributes[key]); + } + } +} +function children(element) { + return Array.from(element.childNodes); +} +function set_data(text, data) { + data = '' + data; + if (text.wholeText !== data) + text.data = data; +} +function toggle_class(element, name, toggle) { + element.classList[toggle ? 'add' : 'remove'](name); +} + +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; +} + +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); +} +let flushing = false; +const seen_callbacks = new Set(); +function flush() { + if (flushing) + return; + flushing = true; + do { + // first, call beforeUpdate functions + // and update components + for (let i = 0; i < dirty_components.length; i += 1) { + const component = dirty_components[i]; + set_current_component(component); + update(component.$$); + } + set_current_component(null); + dirty_components.length = 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; + flushing = false; + seen_callbacks.clear(); +} +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(); +let outros; +function group_outros() { + outros = { + r: 0, + c: [], + p: outros // parent group + }; +} +function check_outros() { + if (!outros.r) { + run_all(outros.c); + } + outros = outros.p; +} +function transition_in(block, local) { + if (block && block.i) { + outroing.delete(block); + block.i(local); + } +} +function transition_out(block, local, detach, callback) { + if (block && block.o) { + if (outroing.has(block)) + return; + outroing.add(block); + outros.c.push(() => { + outroing.delete(block); + if (callback) { + if (detach) + block.d(1); + callback(); + } + }); + block.o(local); + } +} + +function handle_promise(promise, info) { + const token = info.token = {}; + function update(type, index, key, value) { + if (info.token !== token) + return; + info.resolved = value; + let child_ctx = info.ctx; + if (key !== undefined) { + child_ctx = child_ctx.slice(); + child_ctx[key] = value; + } + const block = type && (info.current = type)(child_ctx); + let needs_flush = false; + if (info.block) { + if (info.blocks) { + info.blocks.forEach((block, i) => { + if (i !== index && block) { + group_outros(); + transition_out(block, 1, 1, () => { + if (info.blocks[i] === block) { + info.blocks[i] = null; + } + }); + check_outros(); + } + }); + } + else { + info.block.d(1); + } + block.c(); + transition_in(block, 1); + block.m(info.mount(), info.anchor); + needs_flush = true; + } + info.block = block; + if (info.blocks) + info.blocks[index] = block; + if (needs_flush) { + flush(); + } + } + if (is_promise(promise)) { + const current_component = get_current_component(); + promise.then(value => { + set_current_component(current_component); + update(info.then, 1, info.value, value); + set_current_component(null); + }, error => { + set_current_component(current_component); + update(info.catch, 2, info.error, error); + set_current_component(null); + if (!info.hasCatch) { + throw error; + } + }); + // if we previously had a then/catch block, destroy it + if (info.current !== info.pending) { + update(info.pending, 0); + return true; + } + } + else { + if (info.current !== info.then) { + update(info.then, 1, info.value, promise); + return true; + } + info.resolved = promise; + } +} +function outro_and_destroy_block(block, lookup) { + transition_out(block, 1, 1, () => { + lookup.delete(block.key); + }); +} +function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { + let o = old_blocks.length; + let n = list.length; + let i = o; + const old_indexes = {}; + while (i--) + old_indexes[old_blocks[i].key] = i; + const new_blocks = []; + const new_lookup = new Map(); + const deltas = new Map(); + i = n; + while (i--) { + const child_ctx = get_context(ctx, list, i); + const key = get_key(child_ctx); + let block = lookup.get(key); + if (!block) { + block = create_each_block(key, child_ctx); + block.c(); + } + else if (dynamic) { + block.p(child_ctx, dirty); + } + new_lookup.set(key, new_blocks[i] = block); + if (key in old_indexes) + deltas.set(key, Math.abs(i - old_indexes[key])); + } + const will_move = new Set(); + const did_move = new Set(); + function insert(block) { + transition_in(block, 1); + block.m(node, next); + lookup.set(block.key, block); + next = block.first; + n--; + } + while (o && n) { + const new_block = new_blocks[n - 1]; + const old_block = old_blocks[o - 1]; + const new_key = new_block.key; + const old_key = old_block.key; + if (new_block === old_block) { + // do nothing + next = new_block.first; + o--; + n--; + } + else if (!new_lookup.has(old_key)) { + // remove old block + destroy(old_block, lookup); + o--; + } + else if (!lookup.has(new_key) || will_move.has(new_key)) { + insert(new_block); + } + else if (did_move.has(old_key)) { + o--; + } + else if (deltas.get(new_key) > deltas.get(old_key)) { + did_move.add(new_key); + insert(new_block); + } + else { + will_move.add(old_key); + o--; + } + } + while (o--) { + const old_block = old_blocks[o]; + if (!new_lookup.has(old_block.key)) + destroy(old_block, lookup); + } + while (n) + insert(new_blocks[n - 1]); + return new_blocks; +} + +function get_spread_update(levels, updates) { + const update = {}; + const to_null_out = {}; + const accounted_for = { $$scope: 1 }; + let i = levels.length; + while (i--) { + const o = levels[i]; + const n = updates[i]; + if (n) { + for (const key in o) { + if (!(key in n)) + to_null_out[key] = 1; + } + for (const key in n) { + if (!accounted_for[key]) { + update[key] = n[key]; + accounted_for[key] = 1; + } + } + levels[i] = n; + } + else { + for (const key in o) { + accounted_for[key] = 1; + } + } + } + for (const key in to_null_out) { + if (!(key in update)) + update[key] = undefined; + } + return update; +} +function get_spread_object(spread_props) { + return typeof spread_props === 'object' && spread_props !== null ? spread_props : {}; +} +function create_component(block) { + block && block.c(); +} +function mount_component(component, target, anchor, customElement) { + const { fragment, on_mount, on_destroy, after_update } = component.$$; + fragment && fragment.m(target, anchor); + if (!customElement) { + // onMount happens before the initial afterUpdate + add_render_callback(() => { + const new_on_destroy = on_mount.map(run).filter(is_function); + if (on_destroy) { + 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, dirty = [-1]) { + const parent_component = current_component; + set_current_component(component); + const $$ = component.$$ = { + fragment: null, + ctx: null, + // state + props, + update: noop, + not_equal, + bound: blank_object(), + // lifecycle + on_mount: [], + on_destroy: [], + on_disconnect: [], + before_update: [], + after_update: [], + context: new Map(parent_component ? parent_component.$$.context : []), + // everything else + callbacks: blank_object(), + dirty, + skip_bound: false + }; + 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) { + 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; + } + } +} + +/** + * dateUID is a way of weekly identifying daily/weekly/monthly notes. + * They are prefixed with the granularity to avoid ambiguity. + */ +function getDateUID(date, granularity = "day") { + const ts = date.clone().startOf(granularity).format(); + return `${granularity}-${ts}`; +} +var getDateUID_1 = getDateUID; + +/* src/components/Dot.svelte generated by Svelte v3.35.0 */ + +function add_css$5() { + var style = element("style"); + style.id = "svelte-1widvzq-style"; + style.textContent = ".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}"; + append(document.head, style); +} + +// (14:0) {:else} +function create_else_block$1(ctx) { + let svg; + let circle; + let svg_class_value; + + return { + c() { + svg = svg_element("svg"); + circle = svg_element("circle"); + attr(circle, "cx", "3"); + attr(circle, "cy", "3"); + attr(circle, "r", "2"); + attr(svg, "class", svg_class_value = "" + (null_to_empty(`hollow ${/*className*/ ctx[0]}`) + " svelte-1widvzq")); + attr(svg, "viewBox", "0 0 6 6"); + attr(svg, "xmlns", "http://www.w3.org/2000/svg"); + toggle_class(svg, "active", /*isActive*/ ctx[2]); + }, + m(target, anchor) { + insert(target, svg, anchor); + append(svg, circle); + }, + p(ctx, dirty) { + if (dirty & /*className*/ 1 && svg_class_value !== (svg_class_value = "" + (null_to_empty(`hollow ${/*className*/ ctx[0]}`) + " svelte-1widvzq"))) { + attr(svg, "class", svg_class_value); + } + + if (dirty & /*className, isActive*/ 5) { + toggle_class(svg, "active", /*isActive*/ ctx[2]); + } + }, + d(detaching) { + if (detaching) detach(svg); + } + }; +} + +// (6:0) {#if isFilled} +function create_if_block$2(ctx) { + let svg; + let circle; + let svg_class_value; + + return { + c() { + svg = svg_element("svg"); + circle = svg_element("circle"); + attr(circle, "cx", "3"); + attr(circle, "cy", "3"); + attr(circle, "r", "2"); + attr(svg, "class", svg_class_value = "" + (null_to_empty(`dot filled ${/*className*/ ctx[0]}`) + " svelte-1widvzq")); + attr(svg, "viewBox", "0 0 6 6"); + attr(svg, "xmlns", "http://www.w3.org/2000/svg"); + toggle_class(svg, "active", /*isActive*/ ctx[2]); + }, + m(target, anchor) { + insert(target, svg, anchor); + append(svg, circle); + }, + p(ctx, dirty) { + if (dirty & /*className*/ 1 && svg_class_value !== (svg_class_value = "" + (null_to_empty(`dot filled ${/*className*/ ctx[0]}`) + " svelte-1widvzq"))) { + attr(svg, "class", svg_class_value); + } + + if (dirty & /*className, isActive*/ 5) { + toggle_class(svg, "active", /*isActive*/ ctx[2]); + } + }, + d(detaching) { + if (detaching) detach(svg); + } + }; +} + +function create_fragment$6(ctx) { + let if_block_anchor; + + function select_block_type(ctx, dirty) { + if (/*isFilled*/ ctx[1]) return create_if_block$2; + return create_else_block$1; + } + + let current_block_type = select_block_type(ctx); + let if_block = current_block_type(ctx); + + return { + c() { + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx, [dirty]) { + if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { + if_block.p(ctx, dirty); + } else { + if_block.d(1); + if_block = current_block_type(ctx); + + if (if_block) { + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } + }, + i: noop, + o: noop, + d(detaching) { + if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; +} + +function instance$6($$self, $$props, $$invalidate) { + let { className = "" } = $$props; + let { isFilled } = $$props; + let { isActive } = $$props; + + $$self.$$set = $$props => { + if ("className" in $$props) $$invalidate(0, className = $$props.className); + if ("isFilled" in $$props) $$invalidate(1, isFilled = $$props.isFilled); + if ("isActive" in $$props) $$invalidate(2, isActive = $$props.isActive); + }; + + return [className, isFilled, isActive]; +} + +class Dot extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-1widvzq-style")) add_css$5(); + init(this, options, instance$6, create_fragment$6, safe_not_equal, { className: 0, isFilled: 1, isActive: 2 }); + } +} + +/* src/components/MetadataResolver.svelte generated by Svelte v3.35.0 */ + +const get_default_slot_changes_1 = dirty => ({}); +const get_default_slot_context_1 = ctx => ({ metadata: null }); +const get_default_slot_changes = dirty => ({ metadata: dirty & /*metadata*/ 1 }); +const get_default_slot_context = ctx => ({ metadata: /*resolvedMeta*/ ctx[3] }); + +// (11:0) {:else} +function create_else_block(ctx) { + let current; + const default_slot_template = /*#slots*/ ctx[2].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], get_default_slot_context_1); + + return { + c() { + if (default_slot) default_slot.c(); + }, + m(target, anchor) { + if (default_slot) { + default_slot.m(target, anchor); + } + + current = true; + }, + p(ctx, dirty) { + if (default_slot) { + if (default_slot.p && dirty & /*$$scope*/ 2) { + update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[1], dirty, get_default_slot_changes_1, get_default_slot_context_1); + } + } + }, + i(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o(local) { + transition_out(default_slot, local); + current = false; + }, + d(detaching) { + if (default_slot) default_slot.d(detaching); + } + }; +} + +// (7:0) {#if metadata} +function create_if_block$1(ctx) { + let await_block_anchor; + let promise; + let current; + + let info = { + ctx, + current: null, + token: null, + hasCatch: false, + pending: create_pending_block, + then: create_then_block, + catch: create_catch_block, + value: 3, + blocks: [,,,] + }; + + handle_promise(promise = /*metadata*/ ctx[0], info); + + return { + c() { + await_block_anchor = empty(); + info.block.c(); + }, + m(target, anchor) { + insert(target, await_block_anchor, anchor); + info.block.m(target, info.anchor = anchor); + info.mount = () => await_block_anchor.parentNode; + info.anchor = await_block_anchor; + current = true; + }, + p(new_ctx, dirty) { + ctx = new_ctx; + info.ctx = ctx; + + if (dirty & /*metadata*/ 1 && promise !== (promise = /*metadata*/ ctx[0]) && handle_promise(promise, info)) ; else { + const child_ctx = ctx.slice(); + child_ctx[3] = info.resolved; + info.block.p(child_ctx, dirty); + } + }, + i(local) { + if (current) return; + transition_in(info.block); + current = true; + }, + o(local) { + for (let i = 0; i < 3; i += 1) { + const block = info.blocks[i]; + transition_out(block); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(await_block_anchor); + info.block.d(detaching); + info.token = null; + info = null; + } + }; +} + +// (1:0) {#if metadata} +function create_catch_block(ctx) { + return { + c: noop, + m: noop, + p: noop, + i: noop, + o: noop, + d: noop + }; +} + +// (8:37) ; export let metadata; {#if metadata} +function create_pending_block(ctx) { + return { + c: noop, + m: noop, + p: noop, + i: noop, + o: noop, + d: noop + }; +} + +function create_fragment$5(ctx) { + let current_block_type_index; + let if_block; + let if_block_anchor; + let current; + const if_block_creators = [create_if_block$1, create_else_block]; + const if_blocks = []; + + function select_block_type(ctx, dirty) { + if (/*metadata*/ ctx[0]) return 0; + return 1; + } + + current_block_type_index = select_block_type(ctx); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + + return { + c() { + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if_blocks[current_block_type_index].m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx); + + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } else { + group_outros(); + + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + + check_outros(); + if_block = if_blocks[current_block_type_index]; + + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + if_block.c(); + } else { + if_block.p(ctx, dirty); + } + + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach(if_block_anchor); + } + }; +} + +function instance$5($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + + let { metadata } = $$props; + + $$self.$$set = $$props => { + if ("metadata" in $$props) $$invalidate(0, metadata = $$props.metadata); + if ("$$scope" in $$props) $$invalidate(1, $$scope = $$props.$$scope); + }; + + return [metadata, $$scope, slots]; +} + +class MetadataResolver extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$5, create_fragment$5, not_equal, { metadata: 0 }); + } +} + +function isMacOS() { + return navigator.appVersion.indexOf("Mac") !== -1; +} +function isMetaPressed(e) { + return isMacOS() ? e.metaKey : e.ctrlKey; +} +function getDaysOfWeek(..._args) { + return window.moment.weekdaysShort(true); +} +function isWeekend(date) { + return date.isoWeekday() === 6 || date.isoWeekday() === 7; +} +function getStartOfWeek(days) { + return days[0].weekday(0); +} +/** + * Generate a 2D array of daily information to power + * the calendar view. + */ +function getMonth(displayedMonth, ..._args) { + const locale = window.moment().locale(); + const month = []; + let week; + const startOfMonth = displayedMonth.clone().locale(locale).date(1); + const startOffset = startOfMonth.weekday(); + let date = startOfMonth.clone().subtract(startOffset, "days"); + for (let _day = 0; _day < 42; _day++) { + if (_day % 7 === 0) { + week = { + days: [], + weekNum: date.week(), + }; + month.push(week); + } + week.days.push(date); + date = date.clone().add(1, "days"); + } + return month; +} + +/* src/components/Day.svelte generated by Svelte v3.35.0 */ + +function add_css$4() { + var style = element("style"); + style.id = "svelte-q3wqg9-style"; + style.textContent = ".day.svelte-q3wqg9{background-color:var(--color-background-day);border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:4px;position:relative;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.day.svelte-q3wqg9:hover{background-color:var(--interactive-hover)}.day.active.svelte-q3wqg9:hover{background-color:var(--interactive-accent-hover)}.adjacent-month.svelte-q3wqg9{opacity:0.25}.today.svelte-q3wqg9{color:var(--color-text-today)}.day.svelte-q3wqg9:active,.active.svelte-q3wqg9,.active.today.svelte-q3wqg9{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-q3wqg9{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}"; + append(document.head, style); +} + +function get_each_context$2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[11] = list[i]; + return child_ctx; +} + +// (36:8) {#each metadata.dots as dot} +function create_each_block$2(ctx) { + let dot; + let current; + const dot_spread_levels = [/*dot*/ ctx[11]]; + let dot_props = {}; + + for (let i = 0; i < dot_spread_levels.length; i += 1) { + dot_props = assign(dot_props, dot_spread_levels[i]); + } + + dot = new Dot({ props: dot_props }); + + return { + c() { + create_component(dot.$$.fragment); + }, + m(target, anchor) { + mount_component(dot, target, anchor); + current = true; + }, + p(ctx, dirty) { + const dot_changes = (dirty & /*metadata*/ 128) + ? get_spread_update(dot_spread_levels, [get_spread_object(/*dot*/ ctx[11])]) + : {}; + + dot.$set(dot_changes); + }, + i(local) { + if (current) return; + transition_in(dot.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(dot.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(dot, detaching); + } + }; +} + +// (22:2) +function create_default_slot$1(ctx) { + let div1; + let t0_value = /*date*/ ctx[0].format("D") + ""; + let t0; + let t1; + let div0; + let div1_class_value; + let current; + let mounted; + let dispose; + let each_value = /*metadata*/ ctx[7].dots; + 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)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + + let div1_levels = [ + { + class: div1_class_value = `day ${/*metadata*/ ctx[7].classes.join(" ")}` + }, + /*metadata*/ ctx[7].dataAttributes || {} + ]; + + let div1_data = {}; + + for (let i = 0; i < div1_levels.length; i += 1) { + div1_data = assign(div1_data, div1_levels[i]); + } + + return { + c() { + div1 = element("div"); + t0 = text(t0_value); + t1 = space(); + div0 = element("div"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(div0, "class", "dot-container svelte-q3wqg9"); + set_attributes(div1, div1_data); + toggle_class(div1, "active", /*selectedId*/ ctx[6] === getDateUID_1(/*date*/ ctx[0], "day")); + toggle_class(div1, "adjacent-month", !/*date*/ ctx[0].isSame(/*displayedMonth*/ ctx[5], "month")); + toggle_class(div1, "today", /*date*/ ctx[0].isSame(/*today*/ ctx[4], "day")); + toggle_class(div1, "svelte-q3wqg9", true); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, t0); + append(div1, t1); + append(div1, div0); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(div0, null); + } + + current = true; + + if (!mounted) { + dispose = [ + listen(div1, "click", function () { + if (is_function(/*onClick*/ ctx[2] && /*click_handler*/ ctx[8])) (/*onClick*/ ctx[2] && /*click_handler*/ ctx[8]).apply(this, arguments); + }), + listen(div1, "contextmenu", function () { + if (is_function(/*onContextMenu*/ ctx[3] && /*contextmenu_handler*/ ctx[9])) (/*onContextMenu*/ ctx[3] && /*contextmenu_handler*/ ctx[9]).apply(this, arguments); + }), + listen(div1, "pointerover", function () { + if (is_function(/*onHover*/ ctx[1] && /*pointerover_handler*/ ctx[10])) (/*onHover*/ ctx[1] && /*pointerover_handler*/ ctx[10]).apply(this, arguments); + }) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + if ((!current || dirty & /*date*/ 1) && t0_value !== (t0_value = /*date*/ ctx[0].format("D") + "")) set_data(t0, t0_value); + + if (dirty & /*metadata*/ 128) { + each_value = /*metadata*/ ctx[7].dots; + 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); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block$2(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(div0, null); + } + } + + group_outros(); + + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } + + set_attributes(div1, div1_data = get_spread_update(div1_levels, [ + (!current || dirty & /*metadata*/ 128 && div1_class_value !== (div1_class_value = `day ${/*metadata*/ ctx[7].classes.join(" ")}`)) && { class: div1_class_value }, + dirty & /*metadata*/ 128 && (/*metadata*/ ctx[7].dataAttributes || {}) + ])); + + toggle_class(div1, "active", /*selectedId*/ ctx[6] === getDateUID_1(/*date*/ ctx[0], "day")); + toggle_class(div1, "adjacent-month", !/*date*/ ctx[0].isSame(/*displayedMonth*/ ctx[5], "month")); + toggle_class(div1, "today", /*date*/ ctx[0].isSame(/*today*/ ctx[4], "day")); + toggle_class(div1, "svelte-q3wqg9", true); + }, + i(local) { + if (current) return; + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$4(ctx) { + let td; + let metadataresolver; + let current; + + metadataresolver = new MetadataResolver({ + props: { + metadata: /*metadata*/ ctx[7], + $$slots: { + default: [ + create_default_slot$1, + ({ metadata }) => ({ 7: metadata }), + ({ metadata }) => metadata ? 128 : 0 + ] + }, + $$scope: { ctx } + } + }); + + return { + c() { + td = element("td"); + create_component(metadataresolver.$$.fragment); + }, + m(target, anchor) { + insert(target, td, anchor); + mount_component(metadataresolver, td, null); + current = true; + }, + p(ctx, [dirty]) { + const metadataresolver_changes = {}; + if (dirty & /*metadata*/ 128) metadataresolver_changes.metadata = /*metadata*/ ctx[7]; + + if (dirty & /*$$scope, metadata, selectedId, date, displayedMonth, today, onClick, onContextMenu, onHover*/ 16639) { + metadataresolver_changes.$$scope = { dirty, ctx }; + } + + metadataresolver.$set(metadataresolver_changes); + }, + i(local) { + if (current) return; + transition_in(metadataresolver.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(metadataresolver.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(td); + destroy_component(metadataresolver); + } + }; +} + +function instance$4($$self, $$props, $$invalidate) { + + + let { date } = $$props; + let { metadata } = $$props; + let { onHover } = $$props; + let { onClick } = $$props; + let { onContextMenu } = $$props; + let { today } = $$props; + let { displayedMonth = null } = $$props; + let { selectedId = null } = $$props; + const click_handler = e => onClick(date, isMetaPressed(e)); + const contextmenu_handler = e => onContextMenu(date, e); + const pointerover_handler = e => onHover(date, e.target, isMetaPressed(e)); + + $$self.$$set = $$props => { + if ("date" in $$props) $$invalidate(0, date = $$props.date); + if ("metadata" in $$props) $$invalidate(7, metadata = $$props.metadata); + if ("onHover" in $$props) $$invalidate(1, onHover = $$props.onHover); + if ("onClick" in $$props) $$invalidate(2, onClick = $$props.onClick); + if ("onContextMenu" in $$props) $$invalidate(3, onContextMenu = $$props.onContextMenu); + if ("today" in $$props) $$invalidate(4, today = $$props.today); + if ("displayedMonth" in $$props) $$invalidate(5, displayedMonth = $$props.displayedMonth); + if ("selectedId" in $$props) $$invalidate(6, selectedId = $$props.selectedId); + }; + + return [ + date, + onHover, + onClick, + onContextMenu, + today, + displayedMonth, + selectedId, + metadata, + click_handler, + contextmenu_handler, + pointerover_handler + ]; +} + +class Day extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-q3wqg9-style")) add_css$4(); + + init(this, options, instance$4, create_fragment$4, not_equal, { + date: 0, + metadata: 7, + onHover: 1, + onClick: 2, + onContextMenu: 3, + today: 4, + displayedMonth: 5, + selectedId: 6 + }); + } +} + +/* src/components/Arrow.svelte generated by Svelte v3.35.0 */ + +function add_css$3() { + var style = element("style"); + style.id = "svelte-156w7na-style"; + style.textContent = ".arrow.svelte-156w7na.svelte-156w7na{align-items:center;cursor:pointer;display:flex;justify-content:center;width:24px}.arrow.is-mobile.svelte-156w7na.svelte-156w7na{width:32px}.right.svelte-156w7na.svelte-156w7na{transform:rotate(180deg)}.arrow.svelte-156w7na svg.svelte-156w7na{color:var(--color-arrow);height:16px;width:16px}"; + append(document.head, style); +} + +function create_fragment$3(ctx) { + let div; + let svg; + let path; + let mounted; + let dispose; + + return { + c() { + div = element("div"); + svg = svg_element("svg"); + path = svg_element("path"); + attr(path, "fill", "currentColor"); + attr(path, "d", "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"); + attr(svg, "focusable", "false"); + attr(svg, "role", "img"); + attr(svg, "xmlns", "http://www.w3.org/2000/svg"); + attr(svg, "viewBox", "0 0 320 512"); + attr(svg, "class", "svelte-156w7na"); + attr(div, "class", "arrow svelte-156w7na"); + attr(div, "aria-label", /*tooltip*/ ctx[1]); + toggle_class(div, "is-mobile", /*isMobile*/ ctx[3]); + toggle_class(div, "right", /*direction*/ ctx[2] === "right"); + }, + m(target, anchor) { + insert(target, div, anchor); + append(div, svg); + append(svg, path); + + if (!mounted) { + dispose = listen(div, "click", function () { + if (is_function(/*onClick*/ ctx[0])) /*onClick*/ ctx[0].apply(this, arguments); + }); + + mounted = true; + } + }, + p(new_ctx, [dirty]) { + ctx = new_ctx; + + if (dirty & /*tooltip*/ 2) { + attr(div, "aria-label", /*tooltip*/ ctx[1]); + } + + if (dirty & /*direction*/ 4) { + toggle_class(div, "right", /*direction*/ ctx[2] === "right"); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div); + mounted = false; + dispose(); + } + }; +} + +function instance$3($$self, $$props, $$invalidate) { + let { onClick } = $$props; + let { tooltip } = $$props; + let { direction } = $$props; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let isMobile = window.app.isMobile; + + $$self.$$set = $$props => { + if ("onClick" in $$props) $$invalidate(0, onClick = $$props.onClick); + if ("tooltip" in $$props) $$invalidate(1, tooltip = $$props.tooltip); + if ("direction" in $$props) $$invalidate(2, direction = $$props.direction); + }; + + return [onClick, tooltip, direction, isMobile]; +} + +class Arrow extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-156w7na-style")) add_css$3(); + init(this, options, instance$3, create_fragment$3, safe_not_equal, { onClick: 0, tooltip: 1, direction: 2 }); + } +} + +/* src/components/Nav.svelte generated by Svelte v3.35.0 */ + +function add_css$2() { + var style = element("style"); + style.id = "svelte-1vwr9dd-style"; + style.textContent = ".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}"; + append(document.head, style); +} + +function create_fragment$2(ctx) { + let div2; + let h3; + let span0; + let t0_value = /*displayedMonth*/ ctx[0].format("MMM") + ""; + let t0; + let t1; + let span1; + let t2_value = /*displayedMonth*/ ctx[0].format("YYYY") + ""; + let t2; + let t3; + let div1; + let arrow0; + let t4; + let div0; + let t6; + let arrow1; + let current; + let mounted; + let dispose; + + arrow0 = new Arrow({ + props: { + direction: "left", + onClick: /*decrementDisplayedMonth*/ ctx[3], + tooltip: "Previous Month" + } + }); + + arrow1 = new Arrow({ + props: { + direction: "right", + onClick: /*incrementDisplayedMonth*/ ctx[2], + tooltip: "Next Month" + } + }); + + return { + c() { + div2 = element("div"); + h3 = element("h3"); + span0 = element("span"); + t0 = text(t0_value); + t1 = space(); + span1 = element("span"); + t2 = text(t2_value); + t3 = space(); + div1 = element("div"); + create_component(arrow0.$$.fragment); + t4 = space(); + div0 = element("div"); + div0.textContent = `${/*todayDisplayStr*/ ctx[4]}`; + t6 = space(); + create_component(arrow1.$$.fragment); + attr(span0, "class", "month svelte-1vwr9dd"); + attr(span1, "class", "year svelte-1vwr9dd"); + attr(h3, "class", "title svelte-1vwr9dd"); + attr(div0, "class", "reset-button svelte-1vwr9dd"); + attr(div1, "class", "right-nav svelte-1vwr9dd"); + attr(div2, "class", "nav svelte-1vwr9dd"); + toggle_class(div2, "is-mobile", /*isMobile*/ ctx[5]); + }, + m(target, anchor) { + insert(target, div2, anchor); + append(div2, h3); + append(h3, span0); + append(span0, t0); + append(h3, t1); + append(h3, span1); + append(span1, t2); + append(div2, t3); + append(div2, div1); + mount_component(arrow0, div1, null); + append(div1, t4); + append(div1, div0); + append(div1, t6); + mount_component(arrow1, div1, null); + current = true; + + if (!mounted) { + dispose = [ + listen(h3, "click", function () { + if (is_function(/*resetDisplayedMonth*/ ctx[1])) /*resetDisplayedMonth*/ ctx[1].apply(this, arguments); + }), + listen(div0, "click", function () { + if (is_function(/*resetDisplayedMonth*/ ctx[1])) /*resetDisplayedMonth*/ ctx[1].apply(this, arguments); + }) + ]; + + mounted = true; + } + }, + p(new_ctx, [dirty]) { + ctx = new_ctx; + if ((!current || dirty & /*displayedMonth*/ 1) && t0_value !== (t0_value = /*displayedMonth*/ ctx[0].format("MMM") + "")) set_data(t0, t0_value); + if ((!current || dirty & /*displayedMonth*/ 1) && t2_value !== (t2_value = /*displayedMonth*/ ctx[0].format("YYYY") + "")) set_data(t2, t2_value); + const arrow0_changes = {}; + if (dirty & /*decrementDisplayedMonth*/ 8) arrow0_changes.onClick = /*decrementDisplayedMonth*/ ctx[3]; + arrow0.$set(arrow0_changes); + const arrow1_changes = {}; + if (dirty & /*incrementDisplayedMonth*/ 4) arrow1_changes.onClick = /*incrementDisplayedMonth*/ ctx[2]; + arrow1.$set(arrow1_changes); + }, + i(local) { + if (current) return; + transition_in(arrow0.$$.fragment, local); + transition_in(arrow1.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(arrow0.$$.fragment, local); + transition_out(arrow1.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(div2); + destroy_component(arrow0); + destroy_component(arrow1); + mounted = false; + run_all(dispose); + } + }; +} + +function instance$2($$self, $$props, $$invalidate) { + + let { displayedMonth } = $$props; + let { today } = $$props; + let { resetDisplayedMonth } = $$props; + let { incrementDisplayedMonth } = $$props; + let { decrementDisplayedMonth } = $$props; + + // Get the word 'Today' but localized to the current language + const todayDisplayStr = today.calendar().split(/\d|\s/)[0]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let isMobile = window.app.isMobile; + + $$self.$$set = $$props => { + if ("displayedMonth" in $$props) $$invalidate(0, displayedMonth = $$props.displayedMonth); + if ("today" in $$props) $$invalidate(6, today = $$props.today); + if ("resetDisplayedMonth" in $$props) $$invalidate(1, resetDisplayedMonth = $$props.resetDisplayedMonth); + if ("incrementDisplayedMonth" in $$props) $$invalidate(2, incrementDisplayedMonth = $$props.incrementDisplayedMonth); + if ("decrementDisplayedMonth" in $$props) $$invalidate(3, decrementDisplayedMonth = $$props.decrementDisplayedMonth); + }; + + return [ + displayedMonth, + resetDisplayedMonth, + incrementDisplayedMonth, + decrementDisplayedMonth, + todayDisplayStr, + isMobile, + today + ]; +} + +class Nav extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-1vwr9dd-style")) add_css$2(); + + init(this, options, instance$2, create_fragment$2, safe_not_equal, { + displayedMonth: 0, + today: 6, + resetDisplayedMonth: 1, + incrementDisplayedMonth: 2, + decrementDisplayedMonth: 3 + }); + } +} + +/* src/components/WeekNum.svelte generated by Svelte v3.35.0 */ + +function add_css$1() { + var style = element("style"); + style.id = "svelte-egt0yd-style"; + style.textContent = "td.svelte-egt0yd{border-right:1px solid var(--background-modifier-border)}.week-num.svelte-egt0yd{background-color:var(--color-background-weeknum);border-radius:4px;color:var(--color-text-weeknum);cursor:pointer;font-size:0.65em;height:100%;padding:4px;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.week-num.svelte-egt0yd:hover{background-color:var(--interactive-hover)}.week-num.active.svelte-egt0yd:hover{background-color:var(--interactive-accent-hover)}.active.svelte-egt0yd{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-egt0yd{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}"; + append(document.head, style); +} + +function get_each_context$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[11] = list[i]; + return child_ctx; +} + +// (35:8) {#each metadata.dots as dot} +function create_each_block$1(ctx) { + let dot; + let current; + const dot_spread_levels = [/*dot*/ ctx[11]]; + let dot_props = {}; + + for (let i = 0; i < dot_spread_levels.length; i += 1) { + dot_props = assign(dot_props, dot_spread_levels[i]); + } + + dot = new Dot({ props: dot_props }); + + return { + c() { + create_component(dot.$$.fragment); + }, + m(target, anchor) { + mount_component(dot, target, anchor); + current = true; + }, + p(ctx, dirty) { + const dot_changes = (dirty & /*metadata*/ 64) + ? get_spread_update(dot_spread_levels, [get_spread_object(/*dot*/ ctx[11])]) + : {}; + + dot.$set(dot_changes); + }, + i(local) { + if (current) return; + transition_in(dot.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(dot.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(dot, detaching); + } + }; +} + +// (24:2) +function create_default_slot(ctx) { + let div1; + let t0; + let t1; + let div0; + let div1_class_value; + let current; + let mounted; + let dispose; + let each_value = /*metadata*/ ctx[6].dots; + 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)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + + return { + c() { + div1 = element("div"); + t0 = text(/*weekNum*/ ctx[0]); + t1 = space(); + div0 = element("div"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(div0, "class", "dot-container svelte-egt0yd"); + attr(div1, "class", div1_class_value = "" + (null_to_empty(`week-num ${/*metadata*/ ctx[6].classes.join(" ")}`) + " svelte-egt0yd")); + toggle_class(div1, "active", /*selectedId*/ ctx[5] === getDateUID_1(/*days*/ ctx[1][0], "week")); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, t0); + append(div1, t1); + append(div1, div0); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(div0, null); + } + + current = true; + + if (!mounted) { + dispose = [ + listen(div1, "click", function () { + if (is_function(/*onClick*/ ctx[3] && /*click_handler*/ ctx[8])) (/*onClick*/ ctx[3] && /*click_handler*/ ctx[8]).apply(this, arguments); + }), + listen(div1, "contextmenu", function () { + if (is_function(/*onContextMenu*/ ctx[4] && /*contextmenu_handler*/ ctx[9])) (/*onContextMenu*/ ctx[4] && /*contextmenu_handler*/ ctx[9]).apply(this, arguments); + }), + listen(div1, "pointerover", function () { + if (is_function(/*onHover*/ ctx[2] && /*pointerover_handler*/ ctx[10])) (/*onHover*/ ctx[2] && /*pointerover_handler*/ ctx[10]).apply(this, arguments); + }) + ]; + + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + if (!current || dirty & /*weekNum*/ 1) set_data(t0, /*weekNum*/ ctx[0]); + + if (dirty & /*metadata*/ 64) { + each_value = /*metadata*/ ctx[6].dots; + 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); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block$1(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(div0, null); + } + } + + group_outros(); + + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } + + if (!current || dirty & /*metadata*/ 64 && div1_class_value !== (div1_class_value = "" + (null_to_empty(`week-num ${/*metadata*/ ctx[6].classes.join(" ")}`) + " svelte-egt0yd"))) { + attr(div1, "class", div1_class_value); + } + + if (dirty & /*metadata, selectedId, getDateUID, days*/ 98) { + toggle_class(div1, "active", /*selectedId*/ ctx[5] === getDateUID_1(/*days*/ ctx[1][0], "week")); + } + }, + i(local) { + if (current) return; + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + mounted = false; + run_all(dispose); + } + }; +} + +function create_fragment$1(ctx) { + let td; + let metadataresolver; + let current; + + metadataresolver = new MetadataResolver({ + props: { + metadata: /*metadata*/ ctx[6], + $$slots: { + default: [ + create_default_slot, + ({ metadata }) => ({ 6: metadata }), + ({ metadata }) => metadata ? 64 : 0 + ] + }, + $$scope: { ctx } + } + }); + + return { + c() { + td = element("td"); + create_component(metadataresolver.$$.fragment); + attr(td, "class", "svelte-egt0yd"); + }, + m(target, anchor) { + insert(target, td, anchor); + mount_component(metadataresolver, td, null); + current = true; + }, + p(ctx, [dirty]) { + const metadataresolver_changes = {}; + if (dirty & /*metadata*/ 64) metadataresolver_changes.metadata = /*metadata*/ ctx[6]; + + if (dirty & /*$$scope, metadata, selectedId, days, onClick, startOfWeek, onContextMenu, onHover, weekNum*/ 16639) { + metadataresolver_changes.$$scope = { dirty, ctx }; + } + + metadataresolver.$set(metadataresolver_changes); + }, + i(local) { + if (current) return; + transition_in(metadataresolver.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(metadataresolver.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(td); + destroy_component(metadataresolver); + } + }; +} + +function instance$1($$self, $$props, $$invalidate) { + + + let { weekNum } = $$props; + let { days } = $$props; + let { metadata } = $$props; + let { onHover } = $$props; + let { onClick } = $$props; + let { onContextMenu } = $$props; + let { selectedId = null } = $$props; + let startOfWeek; + const click_handler = e => onClick(startOfWeek, isMetaPressed(e)); + const contextmenu_handler = e => onContextMenu(days[0], e); + const pointerover_handler = e => onHover(startOfWeek, e.target, isMetaPressed(e)); + + $$self.$$set = $$props => { + if ("weekNum" in $$props) $$invalidate(0, weekNum = $$props.weekNum); + if ("days" in $$props) $$invalidate(1, days = $$props.days); + if ("metadata" in $$props) $$invalidate(6, metadata = $$props.metadata); + if ("onHover" in $$props) $$invalidate(2, onHover = $$props.onHover); + if ("onClick" in $$props) $$invalidate(3, onClick = $$props.onClick); + if ("onContextMenu" in $$props) $$invalidate(4, onContextMenu = $$props.onContextMenu); + if ("selectedId" in $$props) $$invalidate(5, selectedId = $$props.selectedId); + }; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*days*/ 2) { + $$invalidate(7, startOfWeek = getStartOfWeek(days)); + } + }; + + return [ + weekNum, + days, + onHover, + onClick, + onContextMenu, + selectedId, + metadata, + startOfWeek, + click_handler, + contextmenu_handler, + pointerover_handler + ]; +} + +class WeekNum extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-egt0yd-style")) add_css$1(); + + init(this, options, instance$1, create_fragment$1, not_equal, { + weekNum: 0, + days: 1, + metadata: 6, + onHover: 2, + onClick: 3, + onContextMenu: 4, + selectedId: 5 + }); + } +} + +async function metadataReducer(promisedMetadata) { + const meta = { + dots: [], + classes: [], + dataAttributes: {}, + }; + const metas = await Promise.all(promisedMetadata); + return metas.reduce((acc, meta) => ({ + classes: [...acc.classes, ...(meta.classes || [])], + dataAttributes: Object.assign(acc.dataAttributes, meta.dataAttributes), + dots: [...acc.dots, ...(meta.dots || [])], + }), meta); +} +function getDailyMetadata(sources, date, ..._args) { + return metadataReducer(sources.map((source) => source.getDailyMetadata(date))); +} +function getWeeklyMetadata(sources, date, ..._args) { + return metadataReducer(sources.map((source) => source.getWeeklyMetadata(date))); +} + +/* src/components/Calendar.svelte generated by Svelte v3.35.0 */ + +function add_css() { + var style = element("style"); + style.id = "svelte-pcimu8-style"; + style.textContent = ".container.svelte-pcimu8{--color-background-heading:transparent;--color-background-day:transparent;--color-background-weeknum:transparent;--color-background-weekend:transparent;--color-dot:var(--text-muted);--color-arrow:var(--text-muted);--color-button:var(--text-muted);--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--interactive-accent);--color-text-weeknum:var(--text-muted)}.container.svelte-pcimu8{padding:0 8px}.container.is-mobile.svelte-pcimu8{padding:0}th.svelte-pcimu8{text-align:center}.weekend.svelte-pcimu8{background-color:var(--color-background-weekend)}.calendar.svelte-pcimu8{border-collapse:collapse;width:100%}th.svelte-pcimu8{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase}"; + append(document.head, style); +} + +function get_each_context(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[18] = list[i]; + return child_ctx; +} + +function get_each_context_1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[21] = list[i]; + return child_ctx; +} + +function get_each_context_2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[24] = list[i]; + return child_ctx; +} + +function get_each_context_3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[27] = list[i]; + return child_ctx; +} + +// (55:6) {#if showWeekNums} +function create_if_block_2(ctx) { + let col; + + return { + c() { + col = element("col"); + }, + m(target, anchor) { + insert(target, col, anchor); + }, + d(detaching) { + if (detaching) detach(col); + } + }; +} + +// (58:6) {#each month[1].days as date} +function create_each_block_3(ctx) { + let col; + + return { + c() { + col = element("col"); + attr(col, "class", "svelte-pcimu8"); + toggle_class(col, "weekend", isWeekend(/*date*/ ctx[27])); + }, + m(target, anchor) { + insert(target, col, anchor); + }, + p(ctx, dirty) { + if (dirty & /*isWeekend, month*/ 16384) { + toggle_class(col, "weekend", isWeekend(/*date*/ ctx[27])); + } + }, + d(detaching) { + if (detaching) detach(col); + } + }; +} + +// (64:8) {#if showWeekNums} +function create_if_block_1(ctx) { + let th; + + return { + c() { + th = element("th"); + th.textContent = "W"; + attr(th, "class", "svelte-pcimu8"); + }, + m(target, anchor) { + insert(target, th, anchor); + }, + d(detaching) { + if (detaching) detach(th); + } + }; +} + +// (67:8) {#each daysOfWeek as dayOfWeek} +function create_each_block_2(ctx) { + let th; + let t_value = /*dayOfWeek*/ ctx[24] + ""; + let t; + + return { + c() { + th = element("th"); + t = text(t_value); + attr(th, "class", "svelte-pcimu8"); + }, + m(target, anchor) { + insert(target, th, anchor); + append(th, t); + }, + p(ctx, dirty) { + if (dirty & /*daysOfWeek*/ 32768 && t_value !== (t_value = /*dayOfWeek*/ ctx[24] + "")) set_data(t, t_value); + }, + d(detaching) { + if (detaching) detach(th); + } + }; +} + +// (75:10) {#if showWeekNums} +function create_if_block(ctx) { + let weeknum; + let current; + + const weeknum_spread_levels = [ + /*week*/ ctx[18], + { + metadata: getWeeklyMetadata(/*sources*/ ctx[8], /*week*/ ctx[18].days[0], /*today*/ ctx[10]) + }, + { onClick: /*onClickWeek*/ ctx[7] }, + { + onContextMenu: /*onContextMenuWeek*/ ctx[5] + }, + { onHover: /*onHoverWeek*/ ctx[3] }, + { selectedId: /*selectedId*/ ctx[9] } + ]; + + let weeknum_props = {}; + + for (let i = 0; i < weeknum_spread_levels.length; i += 1) { + weeknum_props = assign(weeknum_props, weeknum_spread_levels[i]); + } + + weeknum = new WeekNum({ props: weeknum_props }); + + return { + c() { + create_component(weeknum.$$.fragment); + }, + m(target, anchor) { + mount_component(weeknum, target, anchor); + current = true; + }, + p(ctx, dirty) { + const weeknum_changes = (dirty & /*month, getWeeklyMetadata, sources, today, onClickWeek, onContextMenuWeek, onHoverWeek, selectedId*/ 18344) + ? get_spread_update(weeknum_spread_levels, [ + dirty & /*month*/ 16384 && get_spread_object(/*week*/ ctx[18]), + dirty & /*getWeeklyMetadata, sources, month, today*/ 17664 && { + metadata: getWeeklyMetadata(/*sources*/ ctx[8], /*week*/ ctx[18].days[0], /*today*/ ctx[10]) + }, + dirty & /*onClickWeek*/ 128 && { onClick: /*onClickWeek*/ ctx[7] }, + dirty & /*onContextMenuWeek*/ 32 && { + onContextMenu: /*onContextMenuWeek*/ ctx[5] + }, + dirty & /*onHoverWeek*/ 8 && { onHover: /*onHoverWeek*/ ctx[3] }, + dirty & /*selectedId*/ 512 && { selectedId: /*selectedId*/ ctx[9] } + ]) + : {}; + + weeknum.$set(weeknum_changes); + }, + i(local) { + if (current) return; + transition_in(weeknum.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(weeknum.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(weeknum, detaching); + } + }; +} + +// (85:10) {#each week.days as day (day.format())} +function create_each_block_1(key_1, ctx) { + let first; + let day; + let current; + + day = new Day({ + props: { + date: /*day*/ ctx[21], + today: /*today*/ ctx[10], + displayedMonth: /*displayedMonth*/ ctx[0], + onClick: /*onClickDay*/ ctx[6], + onContextMenu: /*onContextMenuDay*/ ctx[4], + onHover: /*onHoverDay*/ ctx[2], + metadata: getDailyMetadata(/*sources*/ ctx[8], /*day*/ ctx[21], /*today*/ ctx[10]), + selectedId: /*selectedId*/ ctx[9] + } + }); + + return { + key: key_1, + first: null, + c() { + first = empty(); + create_component(day.$$.fragment); + this.first = first; + }, + m(target, anchor) { + insert(target, first, anchor); + mount_component(day, target, anchor); + current = true; + }, + p(new_ctx, dirty) { + ctx = new_ctx; + const day_changes = {}; + if (dirty & /*month*/ 16384) day_changes.date = /*day*/ ctx[21]; + if (dirty & /*today*/ 1024) day_changes.today = /*today*/ ctx[10]; + if (dirty & /*displayedMonth*/ 1) day_changes.displayedMonth = /*displayedMonth*/ ctx[0]; + if (dirty & /*onClickDay*/ 64) day_changes.onClick = /*onClickDay*/ ctx[6]; + if (dirty & /*onContextMenuDay*/ 16) day_changes.onContextMenu = /*onContextMenuDay*/ ctx[4]; + if (dirty & /*onHoverDay*/ 4) day_changes.onHover = /*onHoverDay*/ ctx[2]; + if (dirty & /*sources, month, today*/ 17664) day_changes.metadata = getDailyMetadata(/*sources*/ ctx[8], /*day*/ ctx[21], /*today*/ ctx[10]); + if (dirty & /*selectedId*/ 512) day_changes.selectedId = /*selectedId*/ ctx[9]; + day.$set(day_changes); + }, + i(local) { + if (current) return; + transition_in(day.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(day.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(first); + destroy_component(day, detaching); + } + }; +} + +// (73:6) {#each month as week (week.weekNum)} +function create_each_block(key_1, ctx) { + let tr; + let t0; + let each_blocks = []; + let each_1_lookup = new Map(); + let t1; + let current; + let if_block = /*showWeekNums*/ ctx[1] && create_if_block(ctx); + let each_value_1 = /*week*/ ctx[18].days; + const get_key = ctx => /*day*/ ctx[21].format(); + + for (let i = 0; i < each_value_1.length; i += 1) { + let child_ctx = get_each_context_1(ctx, each_value_1, i); + let key = get_key(child_ctx); + each_1_lookup.set(key, each_blocks[i] = create_each_block_1(key, child_ctx)); + } + + return { + key: key_1, + first: null, + c() { + tr = element("tr"); + if (if_block) if_block.c(); + t0 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t1 = space(); + this.first = tr; + }, + m(target, anchor) { + insert(target, tr, anchor); + if (if_block) if_block.m(tr, null); + append(tr, t0); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(tr, null); + } + + append(tr, t1); + current = true; + }, + p(new_ctx, dirty) { + ctx = new_ctx; + + if (/*showWeekNums*/ ctx[1]) { + if (if_block) { + if_block.p(ctx, dirty); + + if (dirty & /*showWeekNums*/ 2) { + transition_in(if_block, 1); + } + } else { + if_block = create_if_block(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(tr, t0); + } + } else if (if_block) { + group_outros(); + + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + + check_outros(); + } + + if (dirty & /*month, today, displayedMonth, onClickDay, onContextMenuDay, onHoverDay, getDailyMetadata, sources, selectedId*/ 18261) { + each_value_1 = /*week*/ ctx[18].days; + group_outros(); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value_1, each_1_lookup, tr, outro_and_destroy_block, create_each_block_1, t1, get_each_context_1); + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + + for (let i = 0; i < each_value_1.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + transition_out(if_block); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(tr); + if (if_block) if_block.d(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].d(); + } + } + }; +} + +function create_fragment$7(ctx) { + let div; + let nav; + let t0; + let table; + let colgroup; + let t1; + let t2; + let thead; + let tr; + let t3; + let t4; + let tbody; + let each_blocks = []; + let each2_lookup = new Map(); + let current; + + nav = new Nav({ + props: { + today: /*today*/ ctx[10], + displayedMonth: /*displayedMonth*/ ctx[0], + incrementDisplayedMonth: /*incrementDisplayedMonth*/ ctx[11], + decrementDisplayedMonth: /*decrementDisplayedMonth*/ ctx[12], + resetDisplayedMonth: /*resetDisplayedMonth*/ ctx[13] + } + }); + + let if_block0 = /*showWeekNums*/ ctx[1] && create_if_block_2(); + let each_value_3 = /*month*/ ctx[14][1].days; + let each_blocks_2 = []; + + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks_2[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + } + + let if_block1 = /*showWeekNums*/ ctx[1] && create_if_block_1(); + let each_value_2 = /*daysOfWeek*/ ctx[15]; + let each_blocks_1 = []; + + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks_1[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); + } + + let each_value = /*month*/ ctx[14]; + const get_key = ctx => /*week*/ ctx[18].weekNum; + + for (let i = 0; i < each_value.length; i += 1) { + let child_ctx = get_each_context(ctx, each_value, i); + let key = get_key(child_ctx); + each2_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx)); + } + + return { + c() { + div = element("div"); + create_component(nav.$$.fragment); + t0 = space(); + table = element("table"); + colgroup = element("colgroup"); + if (if_block0) if_block0.c(); + t1 = space(); + + for (let i = 0; i < each_blocks_2.length; i += 1) { + each_blocks_2[i].c(); + } + + t2 = space(); + thead = element("thead"); + tr = element("tr"); + if (if_block1) if_block1.c(); + t3 = space(); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].c(); + } + + t4 = space(); + tbody = element("tbody"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(table, "class", "calendar svelte-pcimu8"); + attr(div, "id", "calendar-container"); + attr(div, "class", "container svelte-pcimu8"); + toggle_class(div, "is-mobile", /*isMobile*/ ctx[16]); + }, + m(target, anchor) { + insert(target, div, anchor); + mount_component(nav, div, null); + append(div, t0); + append(div, table); + append(table, colgroup); + if (if_block0) if_block0.m(colgroup, null); + append(colgroup, t1); + + for (let i = 0; i < each_blocks_2.length; i += 1) { + each_blocks_2[i].m(colgroup, null); + } + + append(table, t2); + append(table, thead); + append(thead, tr); + if (if_block1) if_block1.m(tr, null); + append(tr, t3); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].m(tr, null); + } + + append(table, t4); + append(table, tbody); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(tbody, null); + } + + current = true; + }, + p(ctx, [dirty]) { + const nav_changes = {}; + if (dirty & /*today*/ 1024) nav_changes.today = /*today*/ ctx[10]; + if (dirty & /*displayedMonth*/ 1) nav_changes.displayedMonth = /*displayedMonth*/ ctx[0]; + nav.$set(nav_changes); + + if (/*showWeekNums*/ ctx[1]) { + if (if_block0) ; else { + if_block0 = create_if_block_2(); + if_block0.c(); + if_block0.m(colgroup, t1); + } + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + + if (dirty & /*isWeekend, month*/ 16384) { + each_value_3 = /*month*/ ctx[14][1].days; + let i; + + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx, each_value_3, i); + + if (each_blocks_2[i]) { + each_blocks_2[i].p(child_ctx, dirty); + } else { + each_blocks_2[i] = create_each_block_3(child_ctx); + each_blocks_2[i].c(); + each_blocks_2[i].m(colgroup, null); + } + } + + for (; i < each_blocks_2.length; i += 1) { + each_blocks_2[i].d(1); + } + + each_blocks_2.length = each_value_3.length; + } + + if (/*showWeekNums*/ ctx[1]) { + if (if_block1) ; else { + if_block1 = create_if_block_1(); + if_block1.c(); + if_block1.m(tr, t3); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + + if (dirty & /*daysOfWeek*/ 32768) { + each_value_2 = /*daysOfWeek*/ ctx[15]; + let i; + + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx, each_value_2, i); + + if (each_blocks_1[i]) { + each_blocks_1[i].p(child_ctx, dirty); + } else { + each_blocks_1[i] = create_each_block_2(child_ctx); + each_blocks_1[i].c(); + each_blocks_1[i].m(tr, null); + } + } + + for (; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].d(1); + } + + each_blocks_1.length = each_value_2.length; + } + + if (dirty & /*month, today, displayedMonth, onClickDay, onContextMenuDay, onHoverDay, getDailyMetadata, sources, selectedId, getWeeklyMetadata, onClickWeek, onContextMenuWeek, onHoverWeek, showWeekNums*/ 18431) { + each_value = /*month*/ ctx[14]; + group_outros(); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each2_lookup, tbody, outro_and_destroy_block, create_each_block, null, get_each_context); + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(nav.$$.fragment, local); + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + transition_out(nav.$$.fragment, local); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(div); + destroy_component(nav); + if (if_block0) if_block0.d(); + destroy_each(each_blocks_2, detaching); + if (if_block1) if_block1.d(); + destroy_each(each_blocks_1, detaching); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].d(); + } + } + }; +} + +function instance$7($$self, $$props, $$invalidate) { + + + let { localeData } = $$props; + let { showWeekNums = false } = $$props; + let { onHoverDay } = $$props; + let { onHoverWeek } = $$props; + let { onContextMenuDay } = $$props; + let { onContextMenuWeek } = $$props; + let { onClickDay } = $$props; + let { onClickWeek } = $$props; + let { sources = [] } = $$props; + let { selectedId } = $$props; + let { today = window.moment() } = $$props; + let { displayedMonth = today } = $$props; + let month; + let daysOfWeek; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let isMobile = window.app.isMobile; + + function incrementDisplayedMonth() { + $$invalidate(0, displayedMonth = displayedMonth.clone().add(1, "month")); + } + + function decrementDisplayedMonth() { + $$invalidate(0, displayedMonth = displayedMonth.clone().subtract(1, "month")); + } + + function resetDisplayedMonth() { + $$invalidate(0, displayedMonth = today.clone()); + } + + $$self.$$set = $$props => { + if ("localeData" in $$props) $$invalidate(17, localeData = $$props.localeData); + if ("showWeekNums" in $$props) $$invalidate(1, showWeekNums = $$props.showWeekNums); + if ("onHoverDay" in $$props) $$invalidate(2, onHoverDay = $$props.onHoverDay); + if ("onHoverWeek" in $$props) $$invalidate(3, onHoverWeek = $$props.onHoverWeek); + if ("onContextMenuDay" in $$props) $$invalidate(4, onContextMenuDay = $$props.onContextMenuDay); + if ("onContextMenuWeek" in $$props) $$invalidate(5, onContextMenuWeek = $$props.onContextMenuWeek); + if ("onClickDay" in $$props) $$invalidate(6, onClickDay = $$props.onClickDay); + if ("onClickWeek" in $$props) $$invalidate(7, onClickWeek = $$props.onClickWeek); + if ("sources" in $$props) $$invalidate(8, sources = $$props.sources); + if ("selectedId" in $$props) $$invalidate(9, selectedId = $$props.selectedId); + if ("today" in $$props) $$invalidate(10, today = $$props.today); + if ("displayedMonth" in $$props) $$invalidate(0, displayedMonth = $$props.displayedMonth); + }; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*displayedMonth, localeData*/ 131073) { + $$invalidate(14, month = getMonth(displayedMonth, localeData)); + } + + if ($$self.$$.dirty & /*today, localeData*/ 132096) { + $$invalidate(15, daysOfWeek = getDaysOfWeek(today, localeData)); + } + }; + + return [ + displayedMonth, + showWeekNums, + onHoverDay, + onHoverWeek, + onContextMenuDay, + onContextMenuWeek, + onClickDay, + onClickWeek, + sources, + selectedId, + today, + incrementDisplayedMonth, + decrementDisplayedMonth, + resetDisplayedMonth, + month, + daysOfWeek, + isMobile, + localeData + ]; +} + +class Calendar$1 extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-pcimu8-style")) add_css(); + + init(this, options, instance$7, create_fragment$7, not_equal, { + localeData: 17, + showWeekNums: 1, + onHoverDay: 2, + onHoverWeek: 3, + onContextMenuDay: 4, + onContextMenuWeek: 5, + onClickDay: 6, + onClickWeek: 7, + sources: 8, + selectedId: 9, + today: 10, + displayedMonth: 0, + incrementDisplayedMonth: 11, + decrementDisplayedMonth: 12, + resetDisplayedMonth: 13 + }); + } + + get incrementDisplayedMonth() { + return this.$$.ctx[11]; + } + + get decrementDisplayedMonth() { + return this.$$.ctx[12]; + } + + get resetDisplayedMonth() { + return this.$$.ctx[13]; + } +} + +const langToMomentLocale = { + en: "en-gb", + zh: "zh-cn", + "zh-TW": "zh-tw", + ru: "ru", + ko: "ko", + it: "it", + id: "id", + ro: "ro", + "pt-BR": "pt-br", + cz: "cs", + da: "da", + de: "de", + es: "es", + fr: "fr", + no: "nn", + pl: "pl", + pt: "pt", + tr: "tr", + hi: "hi", + nl: "nl", + ar: "ar", + ja: "ja", +}; +const weekdays = [ + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", +]; +function overrideGlobalMomentWeekStart(weekStart) { + const { moment } = window; + const currentLocale = moment.locale(); + // Save the initial locale weekspec so that we can restore + // it when toggling between the different options in settings. + if (!window._bundledLocaleWeekSpec) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + window._bundledLocaleWeekSpec = moment.localeData()._week; + } + if (weekStart === "locale") { + moment.updateLocale(currentLocale, { + week: window._bundledLocaleWeekSpec, + }); + } + else { + moment.updateLocale(currentLocale, { + week: { + dow: weekdays.indexOf(weekStart) || 0, + }, + }); + } +} +/** + * Sets the locale used by the calendar. This allows the calendar to + * default to the user's locale (e.g. Start Week on Sunday/Monday/Friday) + * + * @param localeOverride locale string (e.g. "en-US") + */ +function configureGlobalMomentLocale(localeOverride = "system-default", weekStart = "locale") { + var _a; + const obsidianLang = localStorage.getItem("language") || "en"; + const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase(); + let momentLocale = langToMomentLocale[obsidianLang]; + if (localeOverride !== "system-default") { + momentLocale = localeOverride; + } + else if (systemLang.startsWith(obsidianLang)) { + // If the system locale is more specific (en-gb vs en), use the system locale. + momentLocale = systemLang; + } + const currentLocale = window.moment.locale(momentLocale); + console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`); + overrideGlobalMomentWeekStart(weekStart); + return currentLocale; +} + +/* src/ui/Calendar.svelte generated by Svelte v3.35.0 */ + +function create_fragment(ctx) { + let calendarbase; + let updating_displayedMonth; + let current; + + function calendarbase_displayedMonth_binding(value) { + /*calendarbase_displayedMonth_binding*/ ctx[12](value); + } + + let calendarbase_props = { + sources: /*sources*/ ctx[1], + today: /*today*/ ctx[9], + onHoverDay: /*onHoverDay*/ ctx[2], + onHoverWeek: /*onHoverWeek*/ ctx[3], + onContextMenuDay: /*onContextMenuDay*/ ctx[6], + onContextMenuWeek: /*onContextMenuWeek*/ ctx[7], + onClickDay: /*onClickDay*/ ctx[4], + onClickWeek: /*onClickWeek*/ ctx[5], + localeData: /*today*/ ctx[9].localeData(), + selectedId: /*$activeFile*/ ctx[10], + showWeekNums: /*$settings*/ ctx[8].showWeeklyNote + }; + + if (/*displayedMonth*/ ctx[0] !== void 0) { + calendarbase_props.displayedMonth = /*displayedMonth*/ ctx[0]; + } + + calendarbase = new Calendar$1({ props: calendarbase_props }); + binding_callbacks$1.push(() => bind(calendarbase, "displayedMonth", calendarbase_displayedMonth_binding)); + + return { + c() { + create_component$1(calendarbase.$$.fragment); + }, + m(target, anchor) { + mount_component$1(calendarbase, target, anchor); + current = true; + }, + p(ctx, [dirty]) { + const calendarbase_changes = {}; + if (dirty & /*sources*/ 2) calendarbase_changes.sources = /*sources*/ ctx[1]; + if (dirty & /*today*/ 512) calendarbase_changes.today = /*today*/ ctx[9]; + if (dirty & /*onHoverDay*/ 4) calendarbase_changes.onHoverDay = /*onHoverDay*/ ctx[2]; + if (dirty & /*onHoverWeek*/ 8) calendarbase_changes.onHoverWeek = /*onHoverWeek*/ ctx[3]; + if (dirty & /*onContextMenuDay*/ 64) calendarbase_changes.onContextMenuDay = /*onContextMenuDay*/ ctx[6]; + if (dirty & /*onContextMenuWeek*/ 128) calendarbase_changes.onContextMenuWeek = /*onContextMenuWeek*/ ctx[7]; + if (dirty & /*onClickDay*/ 16) calendarbase_changes.onClickDay = /*onClickDay*/ ctx[4]; + if (dirty & /*onClickWeek*/ 32) calendarbase_changes.onClickWeek = /*onClickWeek*/ ctx[5]; + if (dirty & /*today*/ 512) calendarbase_changes.localeData = /*today*/ ctx[9].localeData(); + if (dirty & /*$activeFile*/ 1024) calendarbase_changes.selectedId = /*$activeFile*/ ctx[10]; + if (dirty & /*$settings*/ 256) calendarbase_changes.showWeekNums = /*$settings*/ ctx[8].showWeeklyNote; + + if (!updating_displayedMonth && dirty & /*displayedMonth*/ 1) { + updating_displayedMonth = true; + calendarbase_changes.displayedMonth = /*displayedMonth*/ ctx[0]; + add_flush_callback(() => updating_displayedMonth = false); + } + + calendarbase.$set(calendarbase_changes); + }, + i(local) { + if (current) return; + transition_in$1(calendarbase.$$.fragment, local); + current = true; + }, + o(local) { + transition_out$1(calendarbase.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component$1(calendarbase, detaching); + } + }; +} + +function instance($$self, $$props, $$invalidate) { + let $settings; + let $activeFile; + component_subscribe($$self, settings, $$value => $$invalidate(8, $settings = $$value)); + component_subscribe($$self, activeFile, $$value => $$invalidate(10, $activeFile = $$value)); + + + let today; + let { displayedMonth = today } = $$props; + let { sources } = $$props; + let { onHoverDay } = $$props; + let { onHoverWeek } = $$props; + let { onClickDay } = $$props; + let { onClickWeek } = $$props; + let { onContextMenuDay } = $$props; + let { onContextMenuWeek } = $$props; + + function tick() { + $$invalidate(9, today = window.moment()); + } + + function getToday(settings) { + configureGlobalMomentLocale(settings.localeOverride, settings.weekStart); + dailyNotes.reindex(); + weeklyNotes.reindex(); + return window.moment(); + } + + // 1 minute heartbeat to keep `today` reflecting the current day + let heartbeat = setInterval( + () => { + tick(); + const isViewingCurrentMonth = displayedMonth.isSame(today, "day"); + + if (isViewingCurrentMonth) { + // if it's midnight on the last day of the month, this will + // update the display to show the new month. + $$invalidate(0, displayedMonth = today); + } + }, + 1000 * 60 + ); + + onDestroy(() => { + clearInterval(heartbeat); + }); + + function calendarbase_displayedMonth_binding(value) { + displayedMonth = value; + $$invalidate(0, displayedMonth); + } + + $$self.$$set = $$props => { + if ("displayedMonth" in $$props) $$invalidate(0, displayedMonth = $$props.displayedMonth); + if ("sources" in $$props) $$invalidate(1, sources = $$props.sources); + if ("onHoverDay" in $$props) $$invalidate(2, onHoverDay = $$props.onHoverDay); + if ("onHoverWeek" in $$props) $$invalidate(3, onHoverWeek = $$props.onHoverWeek); + if ("onClickDay" in $$props) $$invalidate(4, onClickDay = $$props.onClickDay); + if ("onClickWeek" in $$props) $$invalidate(5, onClickWeek = $$props.onClickWeek); + if ("onContextMenuDay" in $$props) $$invalidate(6, onContextMenuDay = $$props.onContextMenuDay); + if ("onContextMenuWeek" in $$props) $$invalidate(7, onContextMenuWeek = $$props.onContextMenuWeek); + }; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*$settings*/ 256) { + $$invalidate(9, today = getToday($settings)); + } + }; + + return [ + displayedMonth, + sources, + onHoverDay, + onHoverWeek, + onClickDay, + onClickWeek, + onContextMenuDay, + onContextMenuWeek, + $settings, + today, + $activeFile, + tick, + calendarbase_displayedMonth_binding + ]; +} + +class Calendar extends SvelteComponent$1 { + constructor(options) { + super(); + + init$1(this, options, instance, create_fragment, not_equal$1, { + displayedMonth: 0, + sources: 1, + onHoverDay: 2, + onHoverWeek: 3, + onClickDay: 4, + onClickWeek: 5, + onContextMenuDay: 6, + onContextMenuWeek: 7, + tick: 11 + }); + } + + get tick() { + return this.$$.ctx[11]; + } +} + +function showFileMenu(app, file, position) { + const fileMenu = new obsidian.Menu(app); + fileMenu.addItem((item) => item + .setTitle("Delete") + .setIcon("trash") + .onClick(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + app.fileManager.promptForFileDeletion(file); + })); + app.workspace.trigger("file-menu", fileMenu, file, "calendar-context-menu", null); + fileMenu.showAtPosition(position); +} + +const getStreakClasses = (file) => { + return classList({ + "has-note": !!file, + }); +}; +const streakSource = { + getDailyMetadata: async (date) => { + const file = getDailyNote_1(date, get_store_value(dailyNotes)); + return { + classes: getStreakClasses(file), + dots: [], + }; + }, + getWeeklyMetadata: async (date) => { + const file = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + return { + classes: getStreakClasses(file), + dots: [], + }; + }, +}; + +function getNoteTags(note) { + var _a; + if (!note) { + return []; + } + const { metadataCache } = window.app; + const frontmatter = (_a = metadataCache.getFileCache(note)) === null || _a === void 0 ? void 0 : _a.frontmatter; + const tags = []; + if (frontmatter) { + const frontmatterTags = obsidian.parseFrontMatterTags(frontmatter) || []; + tags.push(...frontmatterTags); + } + // strip the '#' at the beginning + return tags.map((tag) => tag.substring(1)); +} +function getFormattedTagAttributes(note) { + const attrs = {}; + const tags = getNoteTags(note); + const [emojiTags, nonEmojiTags] = partition(tags, (tag) => /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/.test(tag)); + if (nonEmojiTags) { + attrs["data-tags"] = nonEmojiTags.join(" "); + } + if (emojiTags) { + attrs["data-emoji-tag"] = emojiTags[0]; + } + return attrs; +} +const customTagsSource = { + getDailyMetadata: async (date) => { + const file = getDailyNote_1(date, get_store_value(dailyNotes)); + return { + dataAttributes: getFormattedTagAttributes(file), + dots: [], + }; + }, + getWeeklyMetadata: async (date) => { + const file = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + return { + dataAttributes: getFormattedTagAttributes(file), + dots: [], + }; + }, +}; + +async function getNumberOfRemainingTasks(note) { + if (!note) { + return 0; + } + const { vault } = window.app; + const fileContents = await vault.cachedRead(note); + return (fileContents.match(/(-|\*) \[ \]/g) || []).length; +} +async function getDotsForDailyNote$1(dailyNote) { + if (!dailyNote) { + return []; + } + const numTasks = await getNumberOfRemainingTasks(dailyNote); + const dots = []; + if (numTasks) { + dots.push({ + className: "task", + color: "default", + isFilled: false, + }); + } + return dots; +} +const tasksSource = { + getDailyMetadata: async (date) => { + const file = getDailyNote_1(date, get_store_value(dailyNotes)); + const dots = await getDotsForDailyNote$1(file); + return { + dots, + }; + }, + getWeeklyMetadata: async (date) => { + const file = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + const dots = await getDotsForDailyNote$1(file); + return { + dots, + }; + }, +}; + +const NUM_MAX_DOTS = 5; +async function getWordLengthAsDots(note) { + const { wordsPerDot = DEFAULT_WORDS_PER_DOT } = get_store_value(settings); + if (!note || wordsPerDot <= 0) { + return 0; + } + const fileContents = await window.app.vault.cachedRead(note); + const wordCount = getWordCount(fileContents); + const numDots = wordCount / wordsPerDot; + return clamp(Math.floor(numDots), 1, NUM_MAX_DOTS); +} +async function getDotsForDailyNote(dailyNote) { + if (!dailyNote) { + return []; + } + const numSolidDots = await getWordLengthAsDots(dailyNote); + const dots = []; + for (let i = 0; i < numSolidDots; i++) { + dots.push({ + color: "default", + isFilled: true, + }); + } + return dots; +} +const wordCountSource = { + getDailyMetadata: async (date) => { + const file = getDailyNote_1(date, get_store_value(dailyNotes)); + const dots = await getDotsForDailyNote(file); + return { + dots, + }; + }, + getWeeklyMetadata: async (date) => { + const file = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + const dots = await getDotsForDailyNote(file); + return { + dots, + }; + }, +}; + +class CalendarView extends obsidian.ItemView { + constructor(leaf) { + super(leaf); + this.openOrCreateDailyNote = this.openOrCreateDailyNote.bind(this); + this.openOrCreateWeeklyNote = this.openOrCreateWeeklyNote.bind(this); + this.onNoteSettingsUpdate = this.onNoteSettingsUpdate.bind(this); + this.onFileCreated = this.onFileCreated.bind(this); + this.onFileDeleted = this.onFileDeleted.bind(this); + this.onFileModified = this.onFileModified.bind(this); + this.onFileOpen = this.onFileOpen.bind(this); + this.onHoverDay = this.onHoverDay.bind(this); + this.onHoverWeek = this.onHoverWeek.bind(this); + this.onContextMenuDay = this.onContextMenuDay.bind(this); + this.onContextMenuWeek = this.onContextMenuWeek.bind(this); + this.registerEvent( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.app.workspace.on("periodic-notes:settings-updated", this.onNoteSettingsUpdate)); + this.registerEvent(this.app.vault.on("create", this.onFileCreated)); + this.registerEvent(this.app.vault.on("delete", this.onFileDeleted)); + this.registerEvent(this.app.vault.on("modify", this.onFileModified)); + this.registerEvent(this.app.workspace.on("file-open", this.onFileOpen)); + this.settings = null; + settings.subscribe((val) => { + this.settings = val; + // Refresh the calendar if settings change + if (this.calendar) { + this.calendar.tick(); + } + }); + } + getViewType() { + return VIEW_TYPE_CALENDAR; + } + getDisplayText() { + return "Calendar"; + } + getIcon() { + return "calendar-with-checkmark"; + } + onClose() { + if (this.calendar) { + this.calendar.$destroy(); + } + return Promise.resolve(); + } + async onOpen() { + // Integration point: external plugins can listen for `calendar:open` + // to feed in additional sources. + const sources = [ + customTagsSource, + streakSource, + wordCountSource, + tasksSource, + ]; + this.app.workspace.trigger(TRIGGER_ON_OPEN, sources); + this.calendar = new Calendar({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + target: this.contentEl, + props: { + onClickDay: this.openOrCreateDailyNote, + onClickWeek: this.openOrCreateWeeklyNote, + onHoverDay: this.onHoverDay, + onHoverWeek: this.onHoverWeek, + onContextMenuDay: this.onContextMenuDay, + onContextMenuWeek: this.onContextMenuWeek, + sources, + }, + }); + } + onHoverDay(date, targetEl, isMetaPressed) { + if (!isMetaPressed) { + return; + } + const { format } = getDailyNoteSettings_1(); + const note = getDailyNote_1(date, get_store_value(dailyNotes)); + this.app.workspace.trigger("link-hover", this, targetEl, date.format(format), note === null || note === void 0 ? void 0 : note.path); + } + onHoverWeek(date, targetEl, isMetaPressed) { + if (!isMetaPressed) { + return; + } + const note = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + const { format } = getWeeklyNoteSettings_1(); + this.app.workspace.trigger("link-hover", this, targetEl, date.format(format), note === null || note === void 0 ? void 0 : note.path); + } + onContextMenuDay(date, event) { + const note = getDailyNote_1(date, get_store_value(dailyNotes)); + if (!note) { + // If no file exists for a given day, show nothing. + return; + } + showFileMenu(this.app, note, { + x: event.pageX, + y: event.pageY, + }); + } + onContextMenuWeek(date, event) { + const note = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + if (!note) { + // If no file exists for a given day, show nothing. + return; + } + showFileMenu(this.app, note, { + x: event.pageX, + y: event.pageY, + }); + } + onNoteSettingsUpdate() { + dailyNotes.reindex(); + weeklyNotes.reindex(); + this.updateActiveFile(); + } + async onFileDeleted(file) { + if (getDateFromFile_1(file, "day")) { + dailyNotes.reindex(); + this.updateActiveFile(); + } + if (getDateFromFile_1(file, "week")) { + weeklyNotes.reindex(); + this.updateActiveFile(); + } + } + async onFileModified(file) { + const date = getDateFromFile_1(file, "day") || getDateFromFile_1(file, "week"); + if (date && this.calendar) { + this.calendar.tick(); + } + } + onFileCreated(file) { + if (this.app.workspace.layoutReady && this.calendar) { + if (getDateFromFile_1(file, "day")) { + dailyNotes.reindex(); + this.calendar.tick(); + } + if (getDateFromFile_1(file, "week")) { + weeklyNotes.reindex(); + this.calendar.tick(); + } + } + } + onFileOpen(_file) { + if (this.app.workspace.layoutReady) { + this.updateActiveFile(); + } + } + updateActiveFile() { + const { view } = this.app.workspace.activeLeaf; + let file = null; + if (view instanceof obsidian.FileView) { + file = view.file; + } + activeFile.setFile(file); + if (this.calendar) { + this.calendar.tick(); + } + } + revealActiveNote() { + const { moment } = window; + const { activeLeaf } = this.app.workspace; + if (activeLeaf.view instanceof obsidian.FileView) { + // Check to see if the active note is a daily-note + let date = getDateFromFile_1(activeLeaf.view.file, "day"); + if (date) { + this.calendar.$set({ displayedMonth: date }); + return; + } + // Check to see if the active note is a weekly-note + const { format } = getWeeklyNoteSettings_1(); + date = moment(activeLeaf.view.file.basename, format, true); + if (date.isValid()) { + this.calendar.$set({ displayedMonth: date }); + return; + } + } + } + async openOrCreateWeeklyNote(date, inNewSplit) { + const { workspace } = this.app; + const startOfWeek = date.clone().startOf("week"); + const existingFile = getWeeklyNote_1(date, get_store_value(weeklyNotes)); + if (!existingFile) { + // File doesn't exist + tryToCreateWeeklyNote(startOfWeek, inNewSplit, this.settings, (file) => { + activeFile.setFile(file); + }); + return; + } + const leaf = inNewSplit + ? workspace.splitActiveLeaf() + : workspace.getUnpinnedLeaf(); + await leaf.openFile(existingFile); + activeFile.setFile(existingFile); + } + async openOrCreateDailyNote(date, inNewSplit) { + const { workspace } = this.app; + const existingFile = getDailyNote_1(date, get_store_value(dailyNotes)); + if (!existingFile) { + // File doesn't exist + tryToCreateDailyNote(date, inNewSplit, this.settings, (dailyNote) => { + activeFile.setFile(dailyNote); + }); + return; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const mode = this.app.vault.getConfig("defaultViewMode"); + const leaf = inNewSplit + ? workspace.splitActiveLeaf() + : workspace.getUnpinnedLeaf(); + await leaf.openFile(existingFile, { mode }); + activeFile.setFile(existingFile); + } +} + +class CalendarPlugin extends obsidian.Plugin { + onunload() { + this.app.workspace + .getLeavesOfType(VIEW_TYPE_CALENDAR) + .forEach((leaf) => leaf.detach()); + } + async onload() { + this.register(settings.subscribe((value) => { + this.options = value; + })); + this.registerView(VIEW_TYPE_CALENDAR, (leaf) => (this.view = new CalendarView(leaf))); + this.addCommand({ + id: "show-calendar-view", + name: "Open view", + checkCallback: (checking) => { + if (checking) { + return (this.app.workspace.getLeavesOfType(VIEW_TYPE_CALENDAR).length === 0); + } + this.initLeaf(); + }, + }); + this.addCommand({ + id: "open-weekly-note", + name: "Open Weekly Note", + checkCallback: (checking) => { + if (checking) { + return !appHasPeriodicNotesPluginLoaded(); + } + this.view.openOrCreateWeeklyNote(window.moment(), false); + }, + }); + this.addCommand({ + id: "reveal-active-note", + name: "Reveal active note", + callback: () => this.view.revealActiveNote(), + }); + await this.loadOptions(); + this.addSettingTab(new CalendarSettingsTab(this.app, this)); + if (this.app.workspace.layoutReady) { + this.initLeaf(); + } + else { + this.registerEvent(this.app.workspace.on("layout-ready", this.initLeaf.bind(this))); + } + } + initLeaf() { + if (this.app.workspace.getLeavesOfType(VIEW_TYPE_CALENDAR).length) { + return; + } + this.app.workspace.getRightLeaf(false).setViewState({ + type: VIEW_TYPE_CALENDAR, + }); + } + async loadOptions() { + const options = await this.loadData(); + settings.update((old) => { + return Object.assign(Object.assign({}, old), (options || {})); + }); + await this.saveData(this.options); + } + async writeOptions(changeOpts) { + settings.update((old) => (Object.assign(Object.assign({}, old), changeOpts(old)))); + await this.saveData(this.options); + } +} + +module.exports = CalendarPlugin; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/calendar/manifest.json b/.obsidian/plugins/calendar/manifest.json new file mode 100644 index 0000000..028bfa5 --- /dev/null +++ b/.obsidian/plugins/calendar/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "calendar", + "name": "Calendar", + "description": "Calendar view of your daily notes", + "version": "1.5.10", + "author": "Liam Cain", + "authorUrl": "https://github.com/liamcain/", + "isDesktopOnly": false, + "minAppVersion": "0.9.11" +} diff --git a/.obsidian/plugins/obsidian-checklist-plugin/main.js b/.obsidian/plugins/obsidian-checklist-plugin/main.js new file mode 100644 index 0000000..4025075 --- /dev/null +++ b/.obsidian/plugins/obsidian-checklist-plugin/main.js @@ -0,0 +1,8299 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// node_modules/entities/lib/maps/entities.json +var require_entities = __commonJS({ + "node_modules/entities/lib/maps/entities.json"(exports, module2) { + module2.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angmsd: "\u2221", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\u{1D538}", aopf: "\u{1D552}", apacir: "\u2A6F", ap: "\u2248", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\u{1D49C}", ascr: "\u{1D4B6}", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", barwed: "\u2305", Barwed: "\u2306", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", because: "\u2235", Because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\u{1D505}", bfr: "\u{1D51F}", bigcap: "\u22C2", bigcirc: "\u25EF", bigcup: "\u22C3", bigodot: "\u2A00", bigoplus: "\u2A01", bigotimes: "\u2A02", bigsqcup: "\u2A06", bigstar: "\u2605", bigtriangledown: "\u25BD", bigtriangleup: "\u25B3", biguplus: "\u2A04", bigvee: "\u22C1", bigwedge: "\u22C0", bkarow: "\u290D", blacklozenge: "\u29EB", blacksquare: "\u25AA", blacktriangle: "\u25B4", blacktriangledown: "\u25BE", blacktriangleleft: "\u25C2", blacktriangleright: "\u25B8", blank: "\u2423", blk12: "\u2592", blk14: "\u2591", blk34: "\u2593", block: "\u2588", bne: "=\u20E5", bnequiv: "\u2261\u20E5", bNot: "\u2AED", bnot: "\u2310", Bopf: "\u{1D539}", bopf: "\u{1D553}", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxdl: "\u2510", boxdL: "\u2555", boxDl: "\u2556", boxDL: "\u2557", boxdr: "\u250C", boxdR: "\u2552", boxDr: "\u2553", boxDR: "\u2554", boxh: "\u2500", boxH: "\u2550", boxhd: "\u252C", boxHd: "\u2564", boxhD: "\u2565", boxHD: "\u2566", boxhu: "\u2534", boxHu: "\u2567", boxhU: "\u2568", boxHU: "\u2569", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxul: "\u2518", boxuL: "\u255B", boxUl: "\u255C", boxUL: "\u255D", boxur: "\u2514", boxuR: "\u2558", boxUr: "\u2559", boxUR: "\u255A", boxv: "\u2502", boxV: "\u2551", boxvh: "\u253C", boxvH: "\u256A", boxVh: "\u256B", boxVH: "\u256C", boxvl: "\u2524", boxvL: "\u2561", boxVl: "\u2562", boxVL: "\u2563", boxvr: "\u251C", boxvR: "\u255E", boxVr: "\u255F", boxVR: "\u2560", bprime: "\u2035", breve: "\u02D8", Breve: "\u02D8", brvbar: "\xA6", bscr: "\u{1D4B7}", Bscr: "\u212C", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsolb: "\u29C5", bsol: "\\", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", cap: "\u2229", Cap: "\u22D2", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", centerdot: "\xB7", CenterDot: "\xB7", cfr: "\u{1D520}", Cfr: "\u212D", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cir: "\u25CB", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", colon: ":", Colon: "\u2237", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", conint: "\u222E", Conint: "\u222F", ContourIntegral: "\u222E", copf: "\u{1D554}", Copf: "\u2102", coprod: "\u2210", Coproduct: "\u2210", copy: "\xA9", COPY: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", cross: "\u2717", Cross: "\u2A2F", Cscr: "\u{1D49E}", cscr: "\u{1D4B8}", csub: "\u2ACF", csube: "\u2AD1", csup: "\u2AD0", csupe: "\u2AD2", ctdot: "\u22EF", cudarrl: "\u2938", cudarrr: "\u2935", cuepr: "\u22DE", cuesc: "\u22DF", cularr: "\u21B6", cularrp: "\u293D", cupbrcap: "\u2A48", cupcap: "\u2A46", CupCap: "\u224D", cup: "\u222A", Cup: "\u22D3", cupcup: "\u2A4A", cupdot: "\u228D", cupor: "\u2A45", cups: "\u222A\uFE00", curarr: "\u21B7", curarrm: "\u293C", curlyeqprec: "\u22DE", curlyeqsucc: "\u22DF", curlyvee: "\u22CE", curlywedge: "\u22CF", curren: "\xA4", curvearrowleft: "\u21B6", curvearrowright: "\u21B7", cuvee: "\u22CE", cuwed: "\u22CF", cwconint: "\u2232", cwint: "\u2231", cylcty: "\u232D", dagger: "\u2020", Dagger: "\u2021", daleth: "\u2138", darr: "\u2193", Darr: "\u21A1", dArr: "\u21D3", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", ddagger: "\u2021", ddarr: "\u21CA", DD: "\u2145", dd: "\u2146", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\u{1D507}", dfr: "\u{1D521}", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", diamond: "\u22C4", Diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\u{1D53B}", dopf: "\u{1D555}", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", DoubleContourIntegral: "\u222F", DoubleDot: "\xA8", DoubleDownArrow: "\u21D3", DoubleLeftArrow: "\u21D0", DoubleLeftRightArrow: "\u21D4", DoubleLeftTee: "\u2AE4", DoubleLongLeftArrow: "\u27F8", DoubleLongLeftRightArrow: "\u27FA", DoubleLongRightArrow: "\u27F9", DoubleRightArrow: "\u21D2", DoubleRightTee: "\u22A8", DoubleUpArrow: "\u21D1", DoubleUpDownArrow: "\u21D5", DoubleVerticalBar: "\u2225", DownArrowBar: "\u2913", downarrow: "\u2193", DownArrow: "\u2193", Downarrow: "\u21D3", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVectorBar: "\u2956", DownLeftVector: "\u21BD", DownRightTeeVector: "\u295F", DownRightVectorBar: "\u2957", DownRightVector: "\u21C1", DownTeeArrow: "\u21A7", DownTee: "\u22A4", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\u{1D49F}", dscr: "\u{1D4B9}", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", Ecirc: "\xCA", ecirc: "\xEA", ecir: "\u2256", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", edot: "\u0117", eDot: "\u2251", ee: "\u2147", efDot: "\u2252", Efr: "\u{1D508}", efr: "\u{1D522}", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp13: "\u2004", emsp14: "\u2005", emsp: "\u2003", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\u{1D53C}", eopf: "\u{1D556}", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", escr: "\u212F", Escr: "\u2130", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", exponentiale: "\u2147", ExponentialE: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\u{1D509}", ffr: "\u{1D523}", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\u{1D53D}", fopf: "\u{1D557}", forall: "\u2200", ForAll: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", fpartint: "\u2A0D", frac12: "\xBD", frac13: "\u2153", frac14: "\xBC", frac15: "\u2155", frac16: "\u2159", frac18: "\u215B", frac23: "\u2154", frac25: "\u2156", frac34: "\xBE", frac35: "\u2157", frac38: "\u215C", frac45: "\u2158", frac56: "\u215A", frac58: "\u215D", frac78: "\u215E", frasl: "\u2044", frown: "\u2322", fscr: "\u{1D4BB}", Fscr: "\u2131", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", ge: "\u2265", gE: "\u2267", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", gescc: "\u2AA9", ges: "\u2A7E", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\u{1D50A}", gfr: "\u{1D524}", gg: "\u226B", Gg: "\u22D9", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gla: "\u2AA5", gl: "\u2277", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gne: "\u2A88", gnE: "\u2269", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\u{1D53E}", gopf: "\u{1D558}", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\u{1D4A2}", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", gtcc: "\u2AA7", gtcir: "\u2A7A", gt: ">", GT: ">", Gt: "\u226B", gtdot: "\u22D7", gtlPar: "\u2995", gtquest: "\u2A7C", gtrapprox: "\u2A86", gtrarr: "\u2978", gtrdot: "\u22D7", gtreqless: "\u22DB", gtreqqless: "\u2A8C", gtrless: "\u2277", gtrsim: "\u2273", gvertneqq: "\u2269\uFE00", gvnE: "\u2269\uFE00", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", harrcir: "\u2948", harr: "\u2194", hArr: "\u21D4", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", hfr: "\u{1D525}", Hfr: "\u210C", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", hopf: "\u{1D559}", Hopf: "\u210D", horbar: "\u2015", HorizontalLine: "\u2500", hscr: "\u{1D4BD}", Hscr: "\u210B", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", ifr: "\u{1D526}", Ifr: "\u2111", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", Im: "\u2111", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", incare: "\u2105", in: "\u2208", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", intcal: "\u22BA", int: "\u222B", Int: "\u222C", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\u{1D540}", iopf: "\u{1D55A}", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", iscr: "\u{1D4BE}", Iscr: "\u2110", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\u{1D50D}", jfr: "\u{1D527}", jmath: "\u0237", Jopf: "\u{1D541}", jopf: "\u{1D55B}", Jscr: "\u{1D4A5}", jscr: "\u{1D4BF}", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\u{1D50E}", kfr: "\u{1D528}", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\u{1D542}", kopf: "\u{1D55C}", Kscr: "\u{1D4A6}", kscr: "\u{1D4C0}", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", lang: "\u27E8", Lang: "\u27EA", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", larrb: "\u21E4", larrbfs: "\u291F", larr: "\u2190", Larr: "\u219E", lArr: "\u21D0", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", latail: "\u2919", lAtail: "\u291B", lat: "\u2AAB", late: "\u2AAD", lates: "\u2AAD\uFE00", lbarr: "\u290C", lBarr: "\u290E", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", le: "\u2264", lE: "\u2266", LeftAngleBracket: "\u27E8", LeftArrowBar: "\u21E4", leftarrow: "\u2190", LeftArrow: "\u2190", Leftarrow: "\u21D0", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVectorBar: "\u2959", LeftDownVector: "\u21C3", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", leftrightarrow: "\u2194", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTeeArrow: "\u21A4", LeftTee: "\u22A3", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangleBar: "\u29CF", LeftTriangle: "\u22B2", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVectorBar: "\u2958", LeftUpVector: "\u21BF", LeftVectorBar: "\u2952", LeftVector: "\u21BC", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", lescc: "\u2AA8", les: "\u2A7D", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\u{1D50F}", lfr: "\u{1D529}", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", llarr: "\u21C7", ll: "\u226A", Ll: "\u22D8", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoustache: "\u23B0", lmoust: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lne: "\u2A87", lnE: "\u2268", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", longleftarrow: "\u27F5", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftrightarrow: "\u27F7", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longmapsto: "\u27FC", longrightarrow: "\u27F6", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\u{1D543}", lopf: "\u{1D55D}", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", loz: "\u25CA", lozenge: "\u25CA", lozf: "\u29EB", lpar: "(", lparlt: "\u2993", lrarr: "\u21C6", lrcorner: "\u231F", lrhar: "\u21CB", lrhard: "\u296D", lrm: "\u200E", lrtri: "\u22BF", lsaquo: "\u2039", lscr: "\u{1D4C1}", Lscr: "\u2112", lsh: "\u21B0", Lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", ltcc: "\u2AA6", ltcir: "\u2A79", lt: "<", LT: "<", Lt: "\u226A", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\u{1D510}", mfr: "\u{1D52A}", mho: "\u2127", micro: "\xB5", midast: "*", midcir: "\u2AF0", mid: "\u2223", middot: "\xB7", minusb: "\u229F", minus: "\u2212", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\u{1D544}", mopf: "\u{1D55E}", mp: "\u2213", mscr: "\u{1D4C2}", Mscr: "\u2133", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natural: "\u266E", naturals: "\u2115", natur: "\u266E", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", nearhk: "\u2924", nearr: "\u2197", neArr: "\u21D7", nearrow: "\u2197", ne: "\u2260", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\u{1D511}", nfr: "\u{1D52B}", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nharr: "\u21AE", nhArr: "\u21CE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlarr: "\u219A", nlArr: "\u21CD", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nleftarrow: "\u219A", nLeftarrow: "\u21CD", nleftrightarrow: "\u21AE", nLeftrightarrow: "\u21CE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", nopf: "\u{1D55F}", Nopf: "\u2115", Not: "\u2AEC", not: "\xAC", NotCongruent: "\u2262", NotCupCap: "\u226D", NotDoubleVerticalBar: "\u2226", NotElement: "\u2209", NotEqual: "\u2260", NotEqualTilde: "\u2242\u0338", NotExists: "\u2204", NotGreater: "\u226F", NotGreaterEqual: "\u2271", NotGreaterFullEqual: "\u2267\u0338", NotGreaterGreater: "\u226B\u0338", NotGreaterLess: "\u2279", NotGreaterSlantEqual: "\u2A7E\u0338", NotGreaterTilde: "\u2275", NotHumpDownHump: "\u224E\u0338", NotHumpEqual: "\u224F\u0338", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangle: "\u22EA", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangle: "\u22EB", NotRightTriangleEqual: "\u22ED", NotSquareSubset: "\u228F\u0338", NotSquareSubsetEqual: "\u22E2", NotSquareSuperset: "\u2290\u0338", NotSquareSupersetEqual: "\u22E3", NotSubset: "\u2282\u20D2", NotSubsetEqual: "\u2288", NotSucceeds: "\u2281", NotSucceedsEqual: "\u2AB0\u0338", NotSucceedsSlantEqual: "\u22E1", NotSucceedsTilde: "\u227F\u0338", NotSuperset: "\u2283\u20D2", NotSupersetEqual: "\u2289", NotTilde: "\u2241", NotTildeEqual: "\u2244", NotTildeFullEqual: "\u2247", NotTildeTilde: "\u2249", NotVerticalBar: "\u2224", nparallel: "\u2226", npar: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", nprec: "\u2280", npreceq: "\u2AAF\u0338", npre: "\u2AAF\u0338", nrarrc: "\u2933\u0338", nrarr: "\u219B", nrArr: "\u21CF", nrarrw: "\u219D\u0338", nrightarrow: "\u219B", nRightarrow: "\u21CF", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\u{1D4A9}", nscr: "\u{1D4C3}", nshortmid: "\u2224", nshortparallel: "\u2226", nsim: "\u2241", nsime: "\u2244", nsimeq: "\u2244", nsmid: "\u2224", nspar: "\u2226", nsqsube: "\u22E2", nsqsupe: "\u22E3", nsub: "\u2284", nsubE: "\u2AC5\u0338", nsube: "\u2288", nsubset: "\u2282\u20D2", nsubseteq: "\u2288", nsubseteqq: "\u2AC5\u0338", nsucc: "\u2281", nsucceq: "\u2AB0\u0338", nsup: "\u2285", nsupE: "\u2AC6\u0338", nsupe: "\u2289", nsupset: "\u2283\u20D2", nsupseteq: "\u2289", nsupseteqq: "\u2AC6\u0338", ntgl: "\u2279", Ntilde: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nvdash: "\u22AC", nvDash: "\u22AD", nVdash: "\u22AE", nVDash: "\u22AF", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwarr: "\u2196", nwArr: "\u21D6", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", Ocirc: "\xD4", ocirc: "\xF4", ocir: "\u229A", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\u{1D512}", ofr: "\u{1D52C}", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\u{1D546}", oopf: "\u{1D560}", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", orarr: "\u21BB", Or: "\u2A54", or: "\u2228", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\u{1D4AA}", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", otimesas: "\u2A36", Otimes: "\u2A37", otimes: "\u2297", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", para: "\xB6", parallel: "\u2225", par: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\u{1D513}", pfr: "\u{1D52D}", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plus: "+", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", popf: "\u{1D561}", Popf: "\u2119", pound: "\xA3", prap: "\u2AB7", Pr: "\u2ABB", pr: "\u227A", prcue: "\u227C", precapprox: "\u2AB7", prec: "\u227A", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", pre: "\u2AAF", prE: "\u2AB3", precsim: "\u227E", prime: "\u2032", Prime: "\u2033", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportional: "\u221D", Proportion: "\u2237", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\u{1D4AB}", pscr: "\u{1D4C5}", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\u{1D514}", qfr: "\u{1D52E}", qint: "\u2A0C", qopf: "\u{1D562}", Qopf: "\u211A", qprime: "\u2057", Qscr: "\u{1D4AC}", qscr: "\u{1D4C6}", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", quot: '"', QUOT: '"', rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", rang: "\u27E9", Rang: "\u27EB", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarr: "\u2192", Rarr: "\u21A0", rArr: "\u21D2", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", ratail: "\u291A", rAtail: "\u291C", ratio: "\u2236", rationals: "\u211A", rbarr: "\u290D", rBarr: "\u290F", RBarr: "\u2910", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", Re: "\u211C", rect: "\u25AD", reg: "\xAE", REG: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", rfr: "\u{1D52F}", Rfr: "\u211C", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrowBar: "\u21E5", rightarrow: "\u2192", RightArrow: "\u2192", Rightarrow: "\u21D2", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVectorBar: "\u2955", RightDownVector: "\u21C2", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTeeArrow: "\u21A6", RightTee: "\u22A2", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangleBar: "\u29D0", RightTriangle: "\u22B3", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVectorBar: "\u2954", RightUpVector: "\u21BE", RightVectorBar: "\u2953", RightVector: "\u21C0", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoustache: "\u23B1", rmoust: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", ropf: "\u{1D563}", Ropf: "\u211D", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", rscr: "\u{1D4C7}", Rscr: "\u211B", rsh: "\u21B1", Rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", Sc: "\u2ABC", sc: "\u227B", sccue: "\u227D", sce: "\u2AB0", scE: "\u2AB4", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdotb: "\u22A1", sdot: "\u22C5", sdote: "\u2A66", searhk: "\u2925", searr: "\u2198", seArr: "\u21D8", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\u{1D516}", sfr: "\u{1D530}", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", sigma: "\u03C3", sigmaf: "\u03C2", sigmav: "\u03C2", sim: "\u223C", simdot: "\u2A6A", sime: "\u2243", simeq: "\u2243", simg: "\u2A9E", simgE: "\u2AA0", siml: "\u2A9D", simlE: "\u2A9F", simne: "\u2246", simplus: "\u2A24", simrarr: "\u2972", slarr: "\u2190", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", solbar: "\u233F", solb: "\u29C4", sol: "/", Sopf: "\u{1D54A}", sopf: "\u{1D564}", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", square: "\u25A1", Square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squ: "\u25A1", squf: "\u25AA", srarr: "\u2192", Sscr: "\u{1D4AE}", sscr: "\u{1D4C8}", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", sub: "\u2282", Sub: "\u22D0", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", subset: "\u2282", Subset: "\u22D0", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succapprox: "\u2AB8", succ: "\u227B", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", sum: "\u2211", Sum: "\u2211", sung: "\u266A", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", sup: "\u2283", Sup: "\u22D1", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", supset: "\u2283", Supset: "\u22D1", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swarr: "\u2199", swArr: "\u21D9", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: " ", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\u{1D517}", tfr: "\u{1D531}", there4: "\u2234", therefore: "\u2234", Therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", ThinSpace: "\u2009", thinsp: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", tilde: "\u02DC", Tilde: "\u223C", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", timesbar: "\u2A31", timesb: "\u22A0", times: "\xD7", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", topbot: "\u2336", topcir: "\u2AF1", top: "\u22A4", Topf: "\u{1D54B}", topf: "\u{1D565}", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", trade: "\u2122", TRADE: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\u{1D4AF}", tscr: "\u{1D4C9}", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", uarr: "\u2191", Uarr: "\u219F", uArr: "\u21D1", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\u{1D518}", ufr: "\u{1D532}", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\u{1D54C}", uopf: "\u{1D566}", UpArrowBar: "\u2912", uparrow: "\u2191", UpArrow: "\u2191", Uparrow: "\u21D1", UpArrowDownArrow: "\u21C5", updownarrow: "\u2195", UpDownArrow: "\u2195", Updownarrow: "\u21D5", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", upsi: "\u03C5", Upsi: "\u03D2", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTeeArrow: "\u21A5", UpTee: "\u22A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\u{1D4B0}", uscr: "\u{1D4CA}", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", varr: "\u2195", vArr: "\u21D5", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", vBar: "\u2AE8", Vbar: "\u2AEB", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", vdash: "\u22A2", vDash: "\u22A8", Vdash: "\u22A9", VDash: "\u22AB", Vdashl: "\u2AE6", veebar: "\u22BB", vee: "\u2228", Vee: "\u22C1", veeeq: "\u225A", vellip: "\u22EE", verbar: "|", Verbar: "\u2016", vert: "|", Vert: "\u2016", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\u{1D519}", vfr: "\u{1D533}", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\u{1D54D}", vopf: "\u{1D567}", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\u{1D4B1}", vscr: "\u{1D4CB}", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", wedge: "\u2227", Wedge: "\u22C0", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\u{1D51A}", wfr: "\u{1D534}", Wopf: "\u{1D54E}", wopf: "\u{1D568}", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\u{1D4B2}", wscr: "\u{1D4CC}", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\u{1D51B}", xfr: "\u{1D535}", xharr: "\u27F7", xhArr: "\u27FA", Xi: "\u039E", xi: "\u03BE", xlarr: "\u27F5", xlArr: "\u27F8", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\u{1D54F}", xopf: "\u{1D569}", xoplus: "\u2A01", xotime: "\u2A02", xrarr: "\u27F6", xrArr: "\u27F9", Xscr: "\u{1D4B3}", xscr: "\u{1D4CD}", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\u{1D51C}", yfr: "\u{1D536}", YIcy: "\u0407", yicy: "\u0457", Yopf: "\u{1D550}", yopf: "\u{1D56A}", Yscr: "\u{1D4B4}", yscr: "\u{1D4CE}", YUcy: "\u042E", yucy: "\u044E", yuml: "\xFF", Yuml: "\u0178", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", zfr: "\u{1D537}", Zfr: "\u2128", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", zopf: "\u{1D56B}", Zopf: "\u2124", Zscr: "\u{1D4B5}", zscr: "\u{1D4CF}", zwj: "\u200D", zwnj: "\u200C" }; + } +}); + +// node_modules/markdown-it/lib/common/entities.js +var require_entities2 = __commonJS({ + "node_modules/markdown-it/lib/common/entities.js"(exports, module2) { + "use strict"; + module2.exports = require_entities(); + } +}); + +// node_modules/uc.micro/categories/P/regex.js +var require_regex = __commonJS({ + "node_modules/uc.micro/categories/P/regex.js"(exports, module2) { + module2.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; + } +}); + +// node_modules/mdurl/encode.js +var require_encode = __commonJS({ + "node_modules/mdurl/encode.js"(exports, module2) { + "use strict"; + var encodeCache = {}; + function getEncodeCache(exclude) { + var i, ch, cache = encodeCache[exclude]; + if (cache) { + return cache; + } + cache = encodeCache[exclude] = []; + for (i = 0; i < 128; i++) { + ch = String.fromCharCode(i); + if (/^[0-9a-z]$/i.test(ch)) { + cache.push(ch); + } else { + cache.push("%" + ("0" + i.toString(16).toUpperCase()).slice(-2)); + } + } + for (i = 0; i < exclude.length; i++) { + cache[exclude.charCodeAt(i)] = exclude[i]; + } + return cache; + } + function encode(string, exclude, keepEscaped) { + var i, l, code, nextCode, cache, result = ""; + if (typeof exclude !== "string") { + keepEscaped = exclude; + exclude = encode.defaultChars; + } + if (typeof keepEscaped === "undefined") { + keepEscaped = true; + } + cache = getEncodeCache(exclude); + for (i = 0, l = string.length; i < l; i++) { + code = string.charCodeAt(i); + if (keepEscaped && code === 37 && i + 2 < l) { + if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { + result += string.slice(i, i + 3); + i += 2; + continue; + } + } + if (code < 128) { + result += cache[code]; + continue; + } + if (code >= 55296 && code <= 57343) { + if (code >= 55296 && code <= 56319 && i + 1 < l) { + nextCode = string.charCodeAt(i + 1); + if (nextCode >= 56320 && nextCode <= 57343) { + result += encodeURIComponent(string[i] + string[i + 1]); + i++; + continue; + } + } + result += "%EF%BF%BD"; + continue; + } + result += encodeURIComponent(string[i]); + } + return result; + } + encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; + encode.componentChars = "-_.!~*'()"; + module2.exports = encode; + } +}); + +// node_modules/mdurl/decode.js +var require_decode = __commonJS({ + "node_modules/mdurl/decode.js"(exports, module2) { + "use strict"; + var decodeCache = {}; + function getDecodeCache(exclude) { + var i, ch, cache = decodeCache[exclude]; + if (cache) { + return cache; + } + cache = decodeCache[exclude] = []; + for (i = 0; i < 128; i++) { + ch = String.fromCharCode(i); + cache.push(ch); + } + for (i = 0; i < exclude.length; i++) { + ch = exclude.charCodeAt(i); + cache[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2); + } + return cache; + } + function decode(string, exclude) { + var cache; + if (typeof exclude !== "string") { + exclude = decode.defaultChars; + } + cache = getDecodeCache(exclude); + return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) { + var i, l, b1, b2, b3, b4, chr, result = ""; + for (i = 0, l = seq.length; i < l; i += 3) { + b1 = parseInt(seq.slice(i + 1, i + 3), 16); + if (b1 < 128) { + result += cache[b1]; + continue; + } + if ((b1 & 224) === 192 && i + 3 < l) { + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + if ((b2 & 192) === 128) { + chr = b1 << 6 & 1984 | b2 & 63; + if (chr < 128) { + result += "\uFFFD\uFFFD"; + } else { + result += String.fromCharCode(chr); + } + i += 3; + continue; + } + } + if ((b1 & 240) === 224 && i + 6 < l) { + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + b3 = parseInt(seq.slice(i + 7, i + 9), 16); + if ((b2 & 192) === 128 && (b3 & 192) === 128) { + chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63; + if (chr < 2048 || chr >= 55296 && chr <= 57343) { + result += "\uFFFD\uFFFD\uFFFD"; + } else { + result += String.fromCharCode(chr); + } + i += 6; + continue; + } + } + if ((b1 & 248) === 240 && i + 9 < l) { + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + b3 = parseInt(seq.slice(i + 7, i + 9), 16); + b4 = parseInt(seq.slice(i + 10, i + 12), 16); + if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) { + chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63; + if (chr < 65536 || chr > 1114111) { + result += "\uFFFD\uFFFD\uFFFD\uFFFD"; + } else { + chr -= 65536; + result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023)); + } + i += 9; + continue; + } + } + result += "\uFFFD"; + } + return result; + }); + } + decode.defaultChars = ";/?:@&=+$,#"; + decode.componentChars = ""; + module2.exports = decode; + } +}); + +// node_modules/mdurl/format.js +var require_format = __commonJS({ + "node_modules/mdurl/format.js"(exports, module2) { + "use strict"; + module2.exports = function format(url) { + var result = ""; + result += url.protocol || ""; + result += url.slashes ? "//" : ""; + result += url.auth ? url.auth + "@" : ""; + if (url.hostname && url.hostname.indexOf(":") !== -1) { + result += "[" + url.hostname + "]"; + } else { + result += url.hostname || ""; + } + result += url.port ? ":" + url.port : ""; + result += url.pathname || ""; + result += url.search || ""; + result += url.hash || ""; + return result; + }; + } +}); + +// node_modules/mdurl/parse.js +var require_parse = __commonJS({ + "node_modules/mdurl/parse.js"(exports, module2) { + "use strict"; + function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.pathname = null; + } + var protocolPattern = /^([a-z0-9.+-]+:)/i; + var portPattern = /:[0-9]*$/; + var simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; + var delims = ["<", ">", '"', "`", " ", "\r", "\n", " "]; + var unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims); + var autoEscape = ["'"].concat(unwise); + var nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape); + var hostEndingChars = ["/", "?", "#"]; + var hostnameMaxLen = 255; + var hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; + var hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; + var hostlessProtocol = { + "javascript": true, + "javascript:": true + }; + var slashedProtocol = { + "http": true, + "https": true, + "ftp": true, + "gopher": true, + "file": true, + "http:": true, + "https:": true, + "ftp:": true, + "gopher:": true, + "file:": true + }; + function urlParse(url, slashesDenoteHost) { + if (url && url instanceof Url) { + return url; + } + var u = new Url(); + u.parse(url, slashesDenoteHost); + return u; + } + Url.prototype.parse = function(url, slashesDenoteHost) { + var i, l, lowerProto, hec, slashes, rest = url; + rest = rest.trim(); + if (!slashesDenoteHost && url.split("#").length === 1) { + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + } + return this; + } + } + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + lowerProto = proto.toLowerCase(); + this.protocol = proto; + rest = rest.substr(proto.length); + } + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + slashes = rest.substr(0, 2) === "//"; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { + var hostEnd = -1; + for (i = 0; i < hostEndingChars.length; i++) { + hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + var auth, atSign; + if (hostEnd === -1) { + atSign = rest.lastIndexOf("@"); + } else { + atSign = rest.lastIndexOf("@", hostEnd); + } + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = auth; + } + hostEnd = -1; + for (i = 0; i < nonHostChars.length; i++) { + hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + if (hostEnd === -1) { + hostEnd = rest.length; + } + if (rest[hostEnd - 1] === ":") { + hostEnd--; + } + var host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + this.parseHost(host); + this.hostname = this.hostname || ""; + var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]"; + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) { + continue; + } + if (!part.match(hostnamePartPattern)) { + var newpart = ""; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + newpart += "x"; + } else { + newpart += part[j]; + } + } + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = notHost.join(".") + rest; + } + this.hostname = validParts.join("."); + break; + } + } + } + } + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ""; + } + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + } + } + var hash = rest.indexOf("#"); + if (hash !== -1) { + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf("?"); + if (qm !== -1) { + this.search = rest.substr(qm); + rest = rest.slice(0, qm); + } + if (rest) { + this.pathname = rest; + } + if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { + this.pathname = ""; + } + return this; + }; + Url.prototype.parseHost = function(host) { + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ":") { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) { + this.hostname = host; + } + }; + module2.exports = urlParse; + } +}); + +// node_modules/mdurl/index.js +var require_mdurl = __commonJS({ + "node_modules/mdurl/index.js"(exports, module2) { + "use strict"; + module2.exports.encode = require_encode(); + module2.exports.decode = require_decode(); + module2.exports.format = require_format(); + module2.exports.parse = require_parse(); + } +}); + +// node_modules/uc.micro/properties/Any/regex.js +var require_regex2 = __commonJS({ + "node_modules/uc.micro/properties/Any/regex.js"(exports, module2) { + module2.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + } +}); + +// node_modules/uc.micro/categories/Cc/regex.js +var require_regex3 = __commonJS({ + "node_modules/uc.micro/categories/Cc/regex.js"(exports, module2) { + module2.exports = /[\0-\x1F\x7F-\x9F]/; + } +}); + +// node_modules/uc.micro/categories/Cf/regex.js +var require_regex4 = __commonJS({ + "node_modules/uc.micro/categories/Cf/regex.js"(exports, module2) { + module2.exports = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; + } +}); + +// node_modules/uc.micro/categories/Z/regex.js +var require_regex5 = __commonJS({ + "node_modules/uc.micro/categories/Z/regex.js"(exports, module2) { + module2.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; + } +}); + +// node_modules/uc.micro/index.js +var require_uc = __commonJS({ + "node_modules/uc.micro/index.js"(exports) { + "use strict"; + exports.Any = require_regex2(); + exports.Cc = require_regex3(); + exports.Cf = require_regex4(); + exports.P = require_regex(); + exports.Z = require_regex5(); + } +}); + +// node_modules/markdown-it/lib/common/utils.js +var require_utils = __commonJS({ + "node_modules/markdown-it/lib/common/utils.js"(exports) { + "use strict"; + function _class(obj) { + return Object.prototype.toString.call(obj); + } + function isString(obj) { + return _class(obj) === "[object String]"; + } + var _hasOwnProperty = Object.prototype.hasOwnProperty; + function has(object, key) { + return _hasOwnProperty.call(object, key); + } + function assign(obj) { + var sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function(source) { + if (!source) { + return; + } + if (typeof source !== "object") { + throw new TypeError(source + "must be object"); + } + Object.keys(source).forEach(function(key) { + obj[key] = source[key]; + }); + }); + return obj; + } + function arrayReplaceAt(src, pos, newElements) { + return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); + } + function isValidEntityCode(c) { + if (c >= 55296 && c <= 57343) { + return false; + } + if (c >= 64976 && c <= 65007) { + return false; + } + if ((c & 65535) === 65535 || (c & 65535) === 65534) { + return false; + } + if (c >= 0 && c <= 8) { + return false; + } + if (c === 11) { + return false; + } + if (c >= 14 && c <= 31) { + return false; + } + if (c >= 127 && c <= 159) { + return false; + } + if (c > 1114111) { + return false; + } + return true; + } + function fromCodePoint(c) { + if (c > 65535) { + c -= 65536; + var surrogate1 = 55296 + (c >> 10), surrogate2 = 56320 + (c & 1023); + return String.fromCharCode(surrogate1, surrogate2); + } + return String.fromCharCode(c); + } + var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; + var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; + var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi"); + var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; + var entities = require_entities2(); + function replaceEntityPattern(match, name) { + var code = 0; + if (has(entities, name)) { + return entities[name]; + } + if (name.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name)) { + code = name[1].toLowerCase() === "x" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); + if (isValidEntityCode(code)) { + return fromCodePoint(code); + } + } + return match; + } + function unescapeMd(str) { + if (str.indexOf("\\") < 0) { + return str; + } + return str.replace(UNESCAPE_MD_RE, "$1"); + } + function unescapeAll(str) { + if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) { + return str; + } + return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) { + if (escaped) { + return escaped; + } + return replaceEntityPattern(match, entity); + }); + } + var HTML_ESCAPE_TEST_RE = /[&<>"]/; + var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; + var HTML_REPLACEMENTS = { + "&": "&", + "<": "<", + ">": ">", + '"': """ + }; + function replaceUnsafeChar(ch) { + return HTML_REPLACEMENTS[ch]; + } + function escapeHtml(str) { + if (HTML_ESCAPE_TEST_RE.test(str)) { + return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); + } + return str; + } + var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; + function escapeRE(str) { + return str.replace(REGEXP_ESCAPE_RE, "\\$&"); + } + function isSpace(code) { + switch (code) { + case 9: + case 32: + return true; + } + return false; + } + function isWhiteSpace(code) { + if (code >= 8192 && code <= 8202) { + return true; + } + switch (code) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 160: + case 5760: + case 8239: + case 8287: + case 12288: + return true; + } + return false; + } + var UNICODE_PUNCT_RE = require_regex(); + function isPunctChar(ch) { + return UNICODE_PUNCT_RE.test(ch); + } + function isMdAsciiPunct(ch) { + switch (ch) { + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 123: + case 124: + case 125: + case 126: + return true; + default: + return false; + } + } + function normalizeReference(str) { + str = str.trim().replace(/\s+/g, " "); + if ("\u1E9E".toLowerCase() === "\u1E7E") { + str = str.replace(/ẞ/g, "\xDF"); + } + return str.toLowerCase().toUpperCase(); + } + exports.lib = {}; + exports.lib.mdurl = require_mdurl(); + exports.lib.ucmicro = require_uc(); + exports.assign = assign; + exports.isString = isString; + exports.has = has; + exports.unescapeMd = unescapeMd; + exports.unescapeAll = unescapeAll; + exports.isValidEntityCode = isValidEntityCode; + exports.fromCodePoint = fromCodePoint; + exports.escapeHtml = escapeHtml; + exports.arrayReplaceAt = arrayReplaceAt; + exports.isSpace = isSpace; + exports.isWhiteSpace = isWhiteSpace; + exports.isMdAsciiPunct = isMdAsciiPunct; + exports.isPunctChar = isPunctChar; + exports.escapeRE = escapeRE; + exports.normalizeReference = normalizeReference; + } +}); + +// node_modules/markdown-it/lib/helpers/parse_link_label.js +var require_parse_link_label = __commonJS({ + "node_modules/markdown-it/lib/helpers/parse_link_label.js"(exports, module2) { + "use strict"; + module2.exports = function parseLinkLabel(state, start, disableNested) { + var level, found, marker, prevPos, labelEnd = -1, max = state.posMax, oldPos = state.pos; + state.pos = start + 1; + level = 1; + while (state.pos < max) { + marker = state.src.charCodeAt(state.pos); + if (marker === 93) { + level--; + if (level === 0) { + found = true; + break; + } + } + prevPos = state.pos; + state.md.inline.skipToken(state); + if (marker === 91) { + if (prevPos === state.pos - 1) { + level++; + } else if (disableNested) { + state.pos = oldPos; + return -1; + } + } + } + if (found) { + labelEnd = state.pos; + } + state.pos = oldPos; + return labelEnd; + }; + } +}); + +// node_modules/markdown-it/lib/helpers/parse_link_destination.js +var require_parse_link_destination = __commonJS({ + "node_modules/markdown-it/lib/helpers/parse_link_destination.js"(exports, module2) { + "use strict"; + var unescapeAll = require_utils().unescapeAll; + module2.exports = function parseLinkDestination(str, pos, max) { + var code, level, lines = 0, start = pos, result = { + ok: false, + pos: 0, + lines: 0, + str: "" + }; + if (str.charCodeAt(pos) === 60) { + pos++; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 10) { + return result; + } + if (code === 60) { + return result; + } + if (code === 62) { + result.pos = pos + 1; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } + if (code === 92 && pos + 1 < max) { + pos += 2; + continue; + } + pos++; + } + return result; + } + level = 0; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 32) { + break; + } + if (code < 32 || code === 127) { + break; + } + if (code === 92 && pos + 1 < max) { + if (str.charCodeAt(pos + 1) === 32) { + break; + } + pos += 2; + continue; + } + if (code === 40) { + level++; + if (level > 32) { + return result; + } + } + if (code === 41) { + if (level === 0) { + break; + } + level--; + } + pos++; + } + if (start === pos) { + return result; + } + if (level !== 0) { + return result; + } + result.str = unescapeAll(str.slice(start, pos)); + result.lines = lines; + result.pos = pos; + result.ok = true; + return result; + }; + } +}); + +// node_modules/markdown-it/lib/helpers/parse_link_title.js +var require_parse_link_title = __commonJS({ + "node_modules/markdown-it/lib/helpers/parse_link_title.js"(exports, module2) { + "use strict"; + var unescapeAll = require_utils().unescapeAll; + module2.exports = function parseLinkTitle(str, pos, max) { + var code, marker, lines = 0, start = pos, result = { + ok: false, + pos: 0, + lines: 0, + str: "" + }; + if (pos >= max) { + return result; + } + marker = str.charCodeAt(pos); + if (marker !== 34 && marker !== 39 && marker !== 40) { + return result; + } + pos++; + if (marker === 40) { + marker = 41; + } + while (pos < max) { + code = str.charCodeAt(pos); + if (code === marker) { + result.pos = pos + 1; + result.lines = lines; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } else if (code === 40 && marker === 41) { + return result; + } else if (code === 10) { + lines++; + } else if (code === 92 && pos + 1 < max) { + pos++; + if (str.charCodeAt(pos) === 10) { + lines++; + } + } + pos++; + } + return result; + }; + } +}); + +// node_modules/markdown-it/lib/helpers/index.js +var require_helpers = __commonJS({ + "node_modules/markdown-it/lib/helpers/index.js"(exports) { + "use strict"; + exports.parseLinkLabel = require_parse_link_label(); + exports.parseLinkDestination = require_parse_link_destination(); + exports.parseLinkTitle = require_parse_link_title(); + } +}); + +// node_modules/markdown-it/lib/renderer.js +var require_renderer = __commonJS({ + "node_modules/markdown-it/lib/renderer.js"(exports, module2) { + "use strict"; + var assign = require_utils().assign; + var unescapeAll = require_utils().unescapeAll; + var escapeHtml = require_utils().escapeHtml; + var default_rules = {}; + default_rules.code_inline = function(tokens, idx, options, env, slf) { + var token = tokens[idx]; + return "" + escapeHtml(tokens[idx].content) + ""; + }; + default_rules.code_block = function(tokens, idx, options, env, slf) { + var token = tokens[idx]; + return "" + escapeHtml(tokens[idx].content) + "\n"; + }; + default_rules.fence = function(tokens, idx, options, env, slf) { + var token = tokens[idx], info = token.info ? unescapeAll(token.info).trim() : "", langName = "", langAttrs = "", highlighted, i, arr, tmpAttrs, tmpToken; + if (info) { + arr = info.split(/(\s+)/g); + langName = arr[0]; + langAttrs = arr.slice(2).join(""); + } + if (options.highlight) { + highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); + } else { + highlighted = escapeHtml(token.content); + } + if (highlighted.indexOf("" + highlighted + "\n"; + } + return "
" + highlighted + "
\n"; + }; + default_rules.image = function(tokens, idx, options, env, slf) { + var token = tokens[idx]; + token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env); + return slf.renderToken(tokens, idx, options); + }; + default_rules.hardbreak = function(tokens, idx, options) { + return options.xhtmlOut ? "
\n" : "
\n"; + }; + default_rules.softbreak = function(tokens, idx, options) { + return options.breaks ? options.xhtmlOut ? "
\n" : "
\n" : "\n"; + }; + default_rules.text = function(tokens, idx) { + return escapeHtml(tokens[idx].content); + }; + default_rules.html_block = function(tokens, idx) { + return tokens[idx].content; + }; + default_rules.html_inline = function(tokens, idx) { + return tokens[idx].content; + }; + function Renderer() { + this.rules = assign({}, default_rules); + } + Renderer.prototype.renderAttrs = function renderAttrs(token) { + var i, l, result; + if (!token.attrs) { + return ""; + } + result = ""; + for (i = 0, l = token.attrs.length; i < l; i++) { + result += " " + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; + } + return result; + }; + Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { + var nextToken, result = "", needLf = false, token = tokens[idx]; + if (token.hidden) { + return ""; + } + if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { + result += "\n"; + } + result += (token.nesting === -1 ? "\n" : ">"; + return result; + }; + Renderer.prototype.renderInline = function(tokens, options, env) { + var type, result = "", rules = this.rules; + for (var i = 0, len = tokens.length; i < len; i++) { + type = tokens[i].type; + if (typeof rules[type] !== "undefined") { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options); + } + } + return result; + }; + Renderer.prototype.renderInlineAsText = function(tokens, options, env) { + var result = ""; + for (var i = 0, len = tokens.length; i < len; i++) { + if (tokens[i].type === "text") { + result += tokens[i].content; + } else if (tokens[i].type === "image") { + result += this.renderInlineAsText(tokens[i].children, options, env); + } else if (tokens[i].type === "softbreak") { + result += "\n"; + } + } + return result; + }; + Renderer.prototype.render = function(tokens, options, env) { + var i, len, type, result = "", rules = this.rules; + for (i = 0, len = tokens.length; i < len; i++) { + type = tokens[i].type; + if (type === "inline") { + result += this.renderInline(tokens[i].children, options, env); + } else if (typeof rules[type] !== "undefined") { + result += rules[tokens[i].type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options, env); + } + } + return result; + }; + module2.exports = Renderer; + } +}); + +// node_modules/markdown-it/lib/ruler.js +var require_ruler = __commonJS({ + "node_modules/markdown-it/lib/ruler.js"(exports, module2) { + "use strict"; + function Ruler() { + this.__rules__ = []; + this.__cache__ = null; + } + Ruler.prototype.__find__ = function(name) { + for (var i = 0; i < this.__rules__.length; i++) { + if (this.__rules__[i].name === name) { + return i; + } + } + return -1; + }; + Ruler.prototype.__compile__ = function() { + var self = this; + var chains = [""]; + self.__rules__.forEach(function(rule) { + if (!rule.enabled) { + return; + } + rule.alt.forEach(function(altName) { + if (chains.indexOf(altName) < 0) { + chains.push(altName); + } + }); + }); + self.__cache__ = {}; + chains.forEach(function(chain) { + self.__cache__[chain] = []; + self.__rules__.forEach(function(rule) { + if (!rule.enabled) { + return; + } + if (chain && rule.alt.indexOf(chain) < 0) { + return; + } + self.__cache__[chain].push(rule.fn); + }); + }); + }; + Ruler.prototype.at = function(name, fn, options) { + var index = this.__find__(name); + var opt = options || {}; + if (index === -1) { + throw new Error("Parser rule not found: " + name); + } + this.__rules__[index].fn = fn; + this.__rules__[index].alt = opt.alt || []; + this.__cache__ = null; + }; + Ruler.prototype.before = function(beforeName, ruleName, fn, options) { + var index = this.__find__(beforeName); + var opt = options || {}; + if (index === -1) { + throw new Error("Parser rule not found: " + beforeName); + } + this.__rules__.splice(index, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; + }; + Ruler.prototype.after = function(afterName, ruleName, fn, options) { + var index = this.__find__(afterName); + var opt = options || {}; + if (index === -1) { + throw new Error("Parser rule not found: " + afterName); + } + this.__rules__.splice(index + 1, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; + }; + Ruler.prototype.push = function(ruleName, fn, options) { + var opt = options || {}; + this.__rules__.push({ + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; + }; + Ruler.prototype.enable = function(list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + var result = []; + list.forEach(function(name) { + var idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error("Rules manager: invalid rule name " + name); + } + this.__rules__[idx].enabled = true; + result.push(name); + }, this); + this.__cache__ = null; + return result; + }; + Ruler.prototype.enableOnly = function(list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + this.__rules__.forEach(function(rule) { + rule.enabled = false; + }); + this.enable(list, ignoreInvalid); + }; + Ruler.prototype.disable = function(list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + var result = []; + list.forEach(function(name) { + var idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error("Rules manager: invalid rule name " + name); + } + this.__rules__[idx].enabled = false; + result.push(name); + }, this); + this.__cache__ = null; + return result; + }; + Ruler.prototype.getRules = function(chainName) { + if (this.__cache__ === null) { + this.__compile__(); + } + return this.__cache__[chainName] || []; + }; + module2.exports = Ruler; + } +}); + +// node_modules/markdown-it/lib/rules_core/normalize.js +var require_normalize = __commonJS({ + "node_modules/markdown-it/lib/rules_core/normalize.js"(exports, module2) { + "use strict"; + var NEWLINES_RE = /\r\n?|\n/g; + var NULL_RE = /\0/g; + module2.exports = function normalize(state) { + var str; + str = state.src.replace(NEWLINES_RE, "\n"); + str = str.replace(NULL_RE, "\uFFFD"); + state.src = str; + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/block.js +var require_block = __commonJS({ + "node_modules/markdown-it/lib/rules_core/block.js"(exports, module2) { + "use strict"; + module2.exports = function block(state) { + var token; + if (state.inlineMode) { + token = new state.Token("inline", "", 0); + token.content = state.src; + token.map = [0, 1]; + token.children = []; + state.tokens.push(token); + } else { + state.md.block.parse(state.src, state.md, state.env, state.tokens); + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/inline.js +var require_inline = __commonJS({ + "node_modules/markdown-it/lib/rules_core/inline.js"(exports, module2) { + "use strict"; + module2.exports = function inline(state) { + var tokens = state.tokens, tok, i, l; + for (i = 0, l = tokens.length; i < l; i++) { + tok = tokens[i]; + if (tok.type === "inline") { + state.md.inline.parse(tok.content, state.md, state.env, tok.children); + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/linkify.js +var require_linkify = __commonJS({ + "node_modules/markdown-it/lib/rules_core/linkify.js"(exports, module2) { + "use strict"; + var arrayReplaceAt = require_utils().arrayReplaceAt; + function isLinkOpen(str) { + return /^\s]/i.test(str); + } + function isLinkClose(str) { + return /^<\/a\s*>/i.test(str); + } + module2.exports = function linkify(state) { + var i, j, l, tokens, token, currentToken, nodes, ln, text2, pos, lastPos, level, htmlLinkLevel, url, fullUrl, urlText, blockTokens = state.tokens, links; + if (!state.md.options.linkify) { + return; + } + for (j = 0, l = blockTokens.length; j < l; j++) { + if (blockTokens[j].type !== "inline" || !state.md.linkify.pretest(blockTokens[j].content)) { + continue; + } + tokens = blockTokens[j].children; + htmlLinkLevel = 0; + for (i = tokens.length - 1; i >= 0; i--) { + currentToken = tokens[i]; + if (currentToken.type === "link_close") { + i--; + while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") { + i--; + } + continue; + } + if (currentToken.type === "html_inline") { + if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) { + htmlLinkLevel--; + } + if (isLinkClose(currentToken.content)) { + htmlLinkLevel++; + } + } + if (htmlLinkLevel > 0) { + continue; + } + if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) { + text2 = currentToken.content; + links = state.md.linkify.match(text2); + nodes = []; + level = currentToken.level; + lastPos = 0; + if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === "text_special") { + links = links.slice(1); + } + for (ln = 0; ln < links.length; ln++) { + url = links[ln].url; + fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + continue; + } + urlText = links[ln].text; + if (!links[ln].schema) { + urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, ""); + } else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) { + urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, ""); + } else { + urlText = state.md.normalizeLinkText(urlText); + } + pos = links[ln].index; + if (pos > lastPos) { + token = new state.Token("text", "", 0); + token.content = text2.slice(lastPos, pos); + token.level = level; + nodes.push(token); + } + token = new state.Token("link_open", "a", 1); + token.attrs = [["href", fullUrl]]; + token.level = level++; + token.markup = "linkify"; + token.info = "auto"; + nodes.push(token); + token = new state.Token("text", "", 0); + token.content = urlText; + token.level = level; + nodes.push(token); + token = new state.Token("link_close", "a", -1); + token.level = --level; + token.markup = "linkify"; + token.info = "auto"; + nodes.push(token); + lastPos = links[ln].lastIndex; + } + if (lastPos < text2.length) { + token = new state.Token("text", "", 0); + token.content = text2.slice(lastPos); + token.level = level; + nodes.push(token); + } + blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); + } + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/replacements.js +var require_replacements = __commonJS({ + "node_modules/markdown-it/lib/rules_core/replacements.js"(exports, module2) { + "use strict"; + var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; + var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i; + var SCOPED_ABBR_RE = /\((c|tm|r)\)/ig; + var SCOPED_ABBR = { + c: "\xA9", + r: "\xAE", + tm: "\u2122" + }; + function replaceFn(match, name) { + return SCOPED_ABBR[name.toLowerCase()]; + } + function replace_scoped(inlineTokens) { + var i, token, inside_autolink = 0; + for (i = inlineTokens.length - 1; i >= 0; i--) { + token = inlineTokens[i]; + if (token.type === "text" && !inside_autolink) { + token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); + } + if (token.type === "link_open" && token.info === "auto") { + inside_autolink--; + } + if (token.type === "link_close" && token.info === "auto") { + inside_autolink++; + } + } + } + function replace_rare(inlineTokens) { + var i, token, inside_autolink = 0; + for (i = inlineTokens.length - 1; i >= 0; i--) { + token = inlineTokens[i]; + if (token.type === "text" && !inside_autolink) { + if (RARE_RE.test(token.content)) { + token.content = token.content.replace(/\+-/g, "\xB1").replace(/\.{2,}/g, "\u2026").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1\u2014").replace(/(^|\s)--(?=\s|$)/mg, "$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1\u2013"); + } + } + if (token.type === "link_open" && token.info === "auto") { + inside_autolink--; + } + if (token.type === "link_close" && token.info === "auto") { + inside_autolink++; + } + } + } + module2.exports = function replace(state) { + var blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== "inline") { + continue; + } + if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { + replace_scoped(state.tokens[blkIdx].children); + } + if (RARE_RE.test(state.tokens[blkIdx].content)) { + replace_rare(state.tokens[blkIdx].children); + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/smartquotes.js +var require_smartquotes = __commonJS({ + "node_modules/markdown-it/lib/rules_core/smartquotes.js"(exports, module2) { + "use strict"; + var isWhiteSpace = require_utils().isWhiteSpace; + var isPunctChar = require_utils().isPunctChar; + var isMdAsciiPunct = require_utils().isMdAsciiPunct; + var QUOTE_TEST_RE = /['"]/; + var QUOTE_RE = /['"]/g; + var APOSTROPHE = "\u2019"; + function replaceAt(str, index, ch) { + return str.slice(0, index) + ch + str.slice(index + 1); + } + function process_inlines(tokens, state) { + var i, token, text2, t, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j, isSingle, stack, openQuote, closeQuote; + stack = []; + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + thisLevel = tokens[i].level; + for (j = stack.length - 1; j >= 0; j--) { + if (stack[j].level <= thisLevel) { + break; + } + } + stack.length = j + 1; + if (token.type !== "text") { + continue; + } + text2 = token.content; + pos = 0; + max = text2.length; + OUTER: + while (pos < max) { + QUOTE_RE.lastIndex = pos; + t = QUOTE_RE.exec(text2); + if (!t) { + break; + } + canOpen = canClose = true; + pos = t.index + 1; + isSingle = t[0] === "'"; + lastChar = 32; + if (t.index - 1 >= 0) { + lastChar = text2.charCodeAt(t.index - 1); + } else { + for (j = i - 1; j >= 0; j--) { + if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") + break; + if (!tokens[j].content) + continue; + lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); + break; + } + } + nextChar = 32; + if (pos < max) { + nextChar = text2.charCodeAt(pos); + } else { + for (j = i + 1; j < tokens.length; j++) { + if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") + break; + if (!tokens[j].content) + continue; + nextChar = tokens[j].content.charCodeAt(0); + break; + } + } + isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + isLastWhiteSpace = isWhiteSpace(lastChar); + isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + canOpen = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + canOpen = false; + } + } + if (isLastWhiteSpace) { + canClose = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + canClose = false; + } + } + if (nextChar === 34 && t[0] === '"') { + if (lastChar >= 48 && lastChar <= 57) { + canClose = canOpen = false; + } + } + if (canOpen && canClose) { + canOpen = isLastPunctChar; + canClose = isNextPunctChar; + } + if (!canOpen && !canClose) { + if (isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + continue; + } + if (canClose) { + for (j = stack.length - 1; j >= 0; j--) { + item = stack[j]; + if (stack[j].level < thisLevel) { + break; + } + if (item.single === isSingle && stack[j].level === thisLevel) { + item = stack[j]; + if (isSingle) { + openQuote = state.md.options.quotes[2]; + closeQuote = state.md.options.quotes[3]; + } else { + openQuote = state.md.options.quotes[0]; + closeQuote = state.md.options.quotes[1]; + } + token.content = replaceAt(token.content, t.index, closeQuote); + tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); + pos += closeQuote.length - 1; + if (item.token === i) { + pos += openQuote.length - 1; + } + text2 = token.content; + max = text2.length; + stack.length = j; + continue OUTER; + } + } + } + if (canOpen) { + stack.push({ + token: i, + pos: t.index, + single: isSingle, + level: thisLevel + }); + } else if (canClose && isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + } + } + } + module2.exports = function smartquotes(state) { + var blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { + continue; + } + process_inlines(state.tokens[blkIdx].children, state); + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_core/text_join.js +var require_text_join = __commonJS({ + "node_modules/markdown-it/lib/rules_core/text_join.js"(exports, module2) { + "use strict"; + module2.exports = function text_join(state) { + var j, l, tokens, curr, max, last, blockTokens = state.tokens; + for (j = 0, l = blockTokens.length; j < l; j++) { + if (blockTokens[j].type !== "inline") + continue; + tokens = blockTokens[j].children; + max = tokens.length; + for (curr = 0; curr < max; curr++) { + if (tokens[curr].type === "text_special") { + tokens[curr].type = "text"; + } + } + for (curr = last = 0; curr < max; curr++) { + if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") { + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } + } + }; + } +}); + +// node_modules/markdown-it/lib/token.js +var require_token = __commonJS({ + "node_modules/markdown-it/lib/token.js"(exports, module2) { + "use strict"; + function Token(type, tag, nesting) { + this.type = type; + this.tag = tag; + this.attrs = null; + this.map = null; + this.nesting = nesting; + this.level = 0; + this.children = null; + this.content = ""; + this.markup = ""; + this.info = ""; + this.meta = null; + this.block = false; + this.hidden = false; + } + Token.prototype.attrIndex = function attrIndex(name) { + var attrs, i, len; + if (!this.attrs) { + return -1; + } + attrs = this.attrs; + for (i = 0, len = attrs.length; i < len; i++) { + if (attrs[i][0] === name) { + return i; + } + } + return -1; + }; + Token.prototype.attrPush = function attrPush(attrData) { + if (this.attrs) { + this.attrs.push(attrData); + } else { + this.attrs = [attrData]; + } + }; + Token.prototype.attrSet = function attrSet(name, value) { + var idx = this.attrIndex(name), attrData = [name, value]; + if (idx < 0) { + this.attrPush(attrData); + } else { + this.attrs[idx] = attrData; + } + }; + Token.prototype.attrGet = function attrGet(name) { + var idx = this.attrIndex(name), value = null; + if (idx >= 0) { + value = this.attrs[idx][1]; + } + return value; + }; + Token.prototype.attrJoin = function attrJoin(name, value) { + var idx = this.attrIndex(name); + if (idx < 0) { + this.attrPush([name, value]); + } else { + this.attrs[idx][1] = this.attrs[idx][1] + " " + value; + } + }; + module2.exports = Token; + } +}); + +// node_modules/markdown-it/lib/rules_core/state_core.js +var require_state_core = __commonJS({ + "node_modules/markdown-it/lib/rules_core/state_core.js"(exports, module2) { + "use strict"; + var Token = require_token(); + function StateCore(src, md, env) { + this.src = src; + this.env = env; + this.tokens = []; + this.inlineMode = false; + this.md = md; + } + StateCore.prototype.Token = Token; + module2.exports = StateCore; + } +}); + +// node_modules/markdown-it/lib/parser_core.js +var require_parser_core = __commonJS({ + "node_modules/markdown-it/lib/parser_core.js"(exports, module2) { + "use strict"; + var Ruler = require_ruler(); + var _rules = [ + ["normalize", require_normalize()], + ["block", require_block()], + ["inline", require_inline()], + ["linkify", require_linkify()], + ["replacements", require_replacements()], + ["smartquotes", require_smartquotes()], + ["text_join", require_text_join()] + ]; + function Core() { + this.ruler = new Ruler(); + for (var i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } + } + Core.prototype.process = function(state) { + var i, l, rules; + rules = this.ruler.getRules(""); + for (i = 0, l = rules.length; i < l; i++) { + rules[i](state); + } + }; + Core.prototype.State = require_state_core(); + module2.exports = Core; + } +}); + +// node_modules/markdown-it/lib/rules_block/table.js +var require_table = __commonJS({ + "node_modules/markdown-it/lib/rules_block/table.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + function getLine(state, line) { + var pos = state.bMarks[line] + state.tShift[line], max = state.eMarks[line]; + return state.src.slice(pos, max); + } + function escapedSplit(str) { + var result = [], pos = 0, max = str.length, ch, isEscaped = false, lastPos = 0, current = ""; + ch = str.charCodeAt(pos); + while (pos < max) { + if (ch === 124) { + if (!isEscaped) { + result.push(current + str.substring(lastPos, pos)); + current = ""; + lastPos = pos + 1; + } else { + current += str.substring(lastPos, pos - 1); + lastPos = pos; + } + } + isEscaped = ch === 92; + pos++; + ch = str.charCodeAt(pos); + } + result.push(current + str.substring(lastPos)); + return result; + } + module2.exports = function table(state, startLine, endLine, silent) { + var ch, lineText, pos, i, l, nextLine, columns, columnCount, token, aligns, t, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh; + if (startLine + 2 > endLine) { + return false; + } + nextLine = startLine + 1; + if (state.sCount[nextLine] < state.blkIndent) { + return false; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + if (pos >= state.eMarks[nextLine]) { + return false; + } + firstCh = state.src.charCodeAt(pos++); + if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) { + return false; + } + if (pos >= state.eMarks[nextLine]) { + return false; + } + secondCh = state.src.charCodeAt(pos++); + if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) { + return false; + } + if (firstCh === 45 && isSpace(secondCh)) { + return false; + } + while (pos < state.eMarks[nextLine]) { + ch = state.src.charCodeAt(pos); + if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) { + return false; + } + pos++; + } + lineText = getLine(state, startLine + 1); + columns = lineText.split("|"); + aligns = []; + for (i = 0; i < columns.length; i++) { + t = columns[i].trim(); + if (!t) { + if (i === 0 || i === columns.length - 1) { + continue; + } else { + return false; + } + } + if (!/^:?-+:?$/.test(t)) { + return false; + } + if (t.charCodeAt(t.length - 1) === 58) { + aligns.push(t.charCodeAt(0) === 58 ? "center" : "right"); + } else if (t.charCodeAt(0) === 58) { + aligns.push("left"); + } else { + aligns.push(""); + } + } + lineText = getLine(state, startLine).trim(); + if (lineText.indexOf("|") === -1) { + return false; + } + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === "") + columns.shift(); + if (columns.length && columns[columns.length - 1] === "") + columns.pop(); + columnCount = columns.length; + if (columnCount === 0 || columnCount !== aligns.length) { + return false; + } + if (silent) { + return true; + } + oldParentType = state.parentType; + state.parentType = "table"; + terminatorRules = state.md.block.ruler.getRules("blockquote"); + token = state.push("table_open", "table", 1); + token.map = tableLines = [startLine, 0]; + token = state.push("thead_open", "thead", 1); + token.map = [startLine, startLine + 1]; + token = state.push("tr_open", "tr", 1); + token.map = [startLine, startLine + 1]; + for (i = 0; i < columns.length; i++) { + token = state.push("th_open", "th", 1); + if (aligns[i]) { + token.attrs = [["style", "text-align:" + aligns[i]]]; + } + token = state.push("inline", "", 0); + token.content = columns[i].trim(); + token.children = []; + token = state.push("th_close", "th", -1); + } + token = state.push("tr_close", "tr", -1); + token = state.push("thead_close", "thead", -1); + for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + lineText = getLine(state, nextLine).trim(); + if (!lineText) { + break; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === "") + columns.shift(); + if (columns.length && columns[columns.length - 1] === "") + columns.pop(); + if (nextLine === startLine + 2) { + token = state.push("tbody_open", "tbody", 1); + token.map = tbodyLines = [startLine + 2, 0]; + } + token = state.push("tr_open", "tr", 1); + token.map = [nextLine, nextLine + 1]; + for (i = 0; i < columnCount; i++) { + token = state.push("td_open", "td", 1); + if (aligns[i]) { + token.attrs = [["style", "text-align:" + aligns[i]]]; + } + token = state.push("inline", "", 0); + token.content = columns[i] ? columns[i].trim() : ""; + token.children = []; + token = state.push("td_close", "td", -1); + } + token = state.push("tr_close", "tr", -1); + } + if (tbodyLines) { + token = state.push("tbody_close", "tbody", -1); + tbodyLines[1] = nextLine; + } + token = state.push("table_close", "table", -1); + tableLines[1] = nextLine; + state.parentType = oldParentType; + state.line = nextLine; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/code.js +var require_code = __commonJS({ + "node_modules/markdown-it/lib/rules_block/code.js"(exports, module2) { + "use strict"; + module2.exports = function code(state, startLine, endLine) { + var nextLine, last, token; + if (state.sCount[startLine] - state.blkIndent < 4) { + return false; + } + last = nextLine = startLine + 1; + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + nextLine++; + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++; + last = nextLine; + continue; + } + break; + } + state.line = last; + token = state.push("code_block", "code", 0); + token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n"; + token.map = [startLine, state.line]; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/fence.js +var require_fence = __commonJS({ + "node_modules/markdown-it/lib/rules_block/fence.js"(exports, module2) { + "use strict"; + module2.exports = function fence(state, startLine, endLine, silent) { + var marker, len, params, nextLine, mem, token, markup, haveEndMarker = false, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (pos + 3 > max) { + return false; + } + marker = state.src.charCodeAt(pos); + if (marker !== 126 && marker !== 96) { + return false; + } + mem = pos; + pos = state.skipChars(pos, marker); + len = pos - mem; + if (len < 3) { + return false; + } + markup = state.src.slice(mem, pos); + params = state.src.slice(pos, max); + if (marker === 96) { + if (params.indexOf(String.fromCharCode(marker)) >= 0) { + return false; + } + } + if (silent) { + return true; + } + nextLine = startLine; + for (; ; ) { + nextLine++; + if (nextLine >= endLine) { + break; + } + pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max && state.sCount[nextLine] < state.blkIndent) { + break; + } + if (state.src.charCodeAt(pos) !== marker) { + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + continue; + } + pos = state.skipChars(pos, marker); + if (pos - mem < len) { + continue; + } + pos = state.skipSpaces(pos); + if (pos < max) { + continue; + } + haveEndMarker = true; + break; + } + len = state.sCount[startLine]; + state.line = nextLine + (haveEndMarker ? 1 : 0); + token = state.push("fence", "code", 0); + token.info = params; + token.content = state.getLines(startLine + 1, nextLine, len, true); + token.markup = markup; + token.map = [startLine, state.line]; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/blockquote.js +var require_blockquote = __commonJS({ + "node_modules/markdown-it/lib/rules_block/blockquote.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + module2.exports = function blockquote(state, startLine, endLine, silent) { + var adjustTab, ch, i, initial, l, lastLineEmpty, lines, nextLine, offset, oldBMarks, oldBSCount, oldIndent, oldParentType, oldSCount, oldTShift, spaceAfterMarker, terminate, terminatorRules, token, isOutdented, oldLineMax = state.lineMax, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.src.charCodeAt(pos++) !== 62) { + return false; + } + if (silent) { + return true; + } + initial = offset = state.sCount[startLine] + 1; + if (state.src.charCodeAt(pos) === 32) { + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 9) { + spaceAfterMarker = true; + if ((state.bsCount[startLine] + offset) % 4 === 3) { + pos++; + initial++; + offset++; + adjustTab = false; + } else { + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + oldBMarks = [state.bMarks[startLine]]; + state.bMarks[startLine] = pos; + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 9) { + offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + pos++; + } + oldBSCount = [state.bsCount[startLine]]; + state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0); + lastLineEmpty = pos >= max; + oldSCount = [state.sCount[startLine]]; + state.sCount[startLine] = offset - initial; + oldTShift = [state.tShift[startLine]]; + state.tShift[startLine] = pos - state.bMarks[startLine]; + terminatorRules = state.md.block.ruler.getRules("blockquote"); + oldParentType = state.parentType; + state.parentType = "blockquote"; + for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { + isOutdented = state.sCount[nextLine] < state.blkIndent; + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos >= max) { + break; + } + if (state.src.charCodeAt(pos++) === 62 && !isOutdented) { + initial = offset = state.sCount[nextLine] + 1; + if (state.src.charCodeAt(pos) === 32) { + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 9) { + spaceAfterMarker = true; + if ((state.bsCount[nextLine] + offset) % 4 === 3) { + pos++; + initial++; + offset++; + adjustTab = false; + } else { + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + oldBMarks.push(state.bMarks[nextLine]); + state.bMarks[nextLine] = pos; + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 9) { + offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + pos++; + } + lastLineEmpty = pos >= max; + oldBSCount.push(state.bsCount[nextLine]); + state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = offset - initial; + oldTShift.push(state.tShift[nextLine]); + state.tShift[nextLine] = pos - state.bMarks[nextLine]; + continue; + } + if (lastLineEmpty) { + break; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + state.lineMax = nextLine; + if (state.blkIndent !== 0) { + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= state.blkIndent; + } + break; + } + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = -1; + } + oldIndent = state.blkIndent; + state.blkIndent = 0; + token = state.push("blockquote_open", "blockquote", 1); + token.markup = ">"; + token.map = lines = [startLine, 0]; + state.md.block.tokenize(state, startLine, nextLine); + token = state.push("blockquote_close", "blockquote", -1); + token.markup = ">"; + state.lineMax = oldLineMax; + state.parentType = oldParentType; + lines[1] = state.line; + for (i = 0; i < oldTShift.length; i++) { + state.bMarks[i + startLine] = oldBMarks[i]; + state.tShift[i + startLine] = oldTShift[i]; + state.sCount[i + startLine] = oldSCount[i]; + state.bsCount[i + startLine] = oldBSCount[i]; + } + state.blkIndent = oldIndent; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/hr.js +var require_hr = __commonJS({ + "node_modules/markdown-it/lib/rules_block/hr.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + module2.exports = function hr(state, startLine, endLine, silent) { + var marker, cnt, ch, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + marker = state.src.charCodeAt(pos++); + if (marker !== 42 && marker !== 45 && marker !== 95) { + return false; + } + cnt = 1; + while (pos < max) { + ch = state.src.charCodeAt(pos++); + if (ch !== marker && !isSpace(ch)) { + return false; + } + if (ch === marker) { + cnt++; + } + } + if (cnt < 3) { + return false; + } + if (silent) { + return true; + } + state.line = startLine + 1; + token = state.push("hr", "hr", 0); + token.map = [startLine, state.line]; + token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/list.js +var require_list = __commonJS({ + "node_modules/markdown-it/lib/rules_block/list.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + function skipBulletListMarker(state, startLine) { + var marker, pos, max, ch; + pos = state.bMarks[startLine] + state.tShift[startLine]; + max = state.eMarks[startLine]; + marker = state.src.charCodeAt(pos++); + if (marker !== 42 && marker !== 45 && marker !== 43) { + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + return -1; + } + } + return pos; + } + function skipOrderedListMarker(state, startLine) { + var ch, start = state.bMarks[startLine] + state.tShift[startLine], pos = start, max = state.eMarks[startLine]; + if (pos + 1 >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch < 48 || ch > 57) { + return -1; + } + for (; ; ) { + if (pos >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch >= 48 && ch <= 57) { + if (pos - start >= 10) { + return -1; + } + continue; + } + if (ch === 41 || ch === 46) { + break; + } + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + return -1; + } + } + return pos; + } + function markTightParagraphs(state, idx) { + var i, l, level = state.level + 2; + for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) { + if (state.tokens[i].level === level && state.tokens[i].type === "paragraph_open") { + state.tokens[i + 2].hidden = true; + state.tokens[i].hidden = true; + i += 2; + } + } + } + module2.exports = function list(state, startLine, endLine, silent) { + var ch, contentStart, i, indent, indentAfterMarker, initial, isOrdered, itemLines, l, listLines, listTokIdx, markerCharCode, markerValue, max, nextLine, offset, oldListIndent, oldParentType, oldSCount, oldTShift, oldTight, pos, posAfterMarker, prevEmptyEnd, start, terminate, terminatorRules, token, isTerminatingParagraph = false, tight = true; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) { + return false; + } + if (silent && state.parentType === "paragraph") { + if (state.sCount[startLine] >= state.blkIndent) { + isTerminatingParagraph = true; + } + } + if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) { + isOrdered = true; + start = state.bMarks[startLine] + state.tShift[startLine]; + markerValue = Number(state.src.slice(start, posAfterMarker - 1)); + if (isTerminatingParagraph && markerValue !== 1) + return false; + } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) { + isOrdered = false; + } else { + return false; + } + if (isTerminatingParagraph) { + if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) + return false; + } + markerCharCode = state.src.charCodeAt(posAfterMarker - 1); + if (silent) { + return true; + } + listTokIdx = state.tokens.length; + if (isOrdered) { + token = state.push("ordered_list_open", "ol", 1); + if (markerValue !== 1) { + token.attrs = [["start", markerValue]]; + } + } else { + token = state.push("bullet_list_open", "ul", 1); + } + token.map = listLines = [startLine, 0]; + token.markup = String.fromCharCode(markerCharCode); + nextLine = startLine; + prevEmptyEnd = false; + terminatorRules = state.md.block.ruler.getRules("list"); + oldParentType = state.parentType; + state.parentType = "list"; + while (nextLine < endLine) { + pos = posAfterMarker; + max = state.eMarks[nextLine]; + initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]); + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (ch === 9) { + offset += 4 - (offset + state.bsCount[nextLine]) % 4; + } else if (ch === 32) { + offset++; + } else { + break; + } + pos++; + } + contentStart = pos; + if (contentStart >= max) { + indentAfterMarker = 1; + } else { + indentAfterMarker = offset - initial; + } + if (indentAfterMarker > 4) { + indentAfterMarker = 1; + } + indent = initial + indentAfterMarker; + token = state.push("list_item_open", "li", 1); + token.markup = String.fromCharCode(markerCharCode); + token.map = itemLines = [startLine, 0]; + if (isOrdered) { + token.info = state.src.slice(start, posAfterMarker - 1); + } + oldTight = state.tight; + oldTShift = state.tShift[startLine]; + oldSCount = state.sCount[startLine]; + oldListIndent = state.listIndent; + state.listIndent = state.blkIndent; + state.blkIndent = indent; + state.tight = true; + state.tShift[startLine] = contentStart - state.bMarks[startLine]; + state.sCount[startLine] = offset; + if (contentStart >= max && state.isEmpty(startLine + 1)) { + state.line = Math.min(state.line + 2, endLine); + } else { + state.md.block.tokenize(state, startLine, endLine, true); + } + if (!state.tight || prevEmptyEnd) { + tight = false; + } + prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1); + state.blkIndent = state.listIndent; + state.listIndent = oldListIndent; + state.tShift[startLine] = oldTShift; + state.sCount[startLine] = oldSCount; + state.tight = oldTight; + token = state.push("list_item_close", "li", -1); + token.markup = String.fromCharCode(markerCharCode); + nextLine = startLine = state.line; + itemLines[1] = nextLine; + contentStart = state.bMarks[startLine]; + if (nextLine >= endLine) { + break; + } + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + if (state.sCount[startLine] - state.blkIndent >= 4) { + break; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + if (isOrdered) { + posAfterMarker = skipOrderedListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + start = state.bMarks[nextLine] + state.tShift[nextLine]; + } else { + posAfterMarker = skipBulletListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + } + if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { + break; + } + } + if (isOrdered) { + token = state.push("ordered_list_close", "ol", -1); + } else { + token = state.push("bullet_list_close", "ul", -1); + } + token.markup = String.fromCharCode(markerCharCode); + listLines[1] = nextLine; + state.line = nextLine; + state.parentType = oldParentType; + if (tight) { + markTightParagraphs(state, listTokIdx); + } + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/reference.js +var require_reference = __commonJS({ + "node_modules/markdown-it/lib/rules_block/reference.js"(exports, module2) { + "use strict"; + var normalizeReference = require_utils().normalizeReference; + var isSpace = require_utils().isSpace; + module2.exports = function reference(state, startLine, _endLine, silent) { + var ch, destEndPos, destEndLineNo, endLine, href, i, l, label, labelEnd, oldParentType, res, start, str, terminate, terminatorRules, title, lines = 0, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine], nextLine = startLine + 1; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.src.charCodeAt(pos) !== 91) { + return false; + } + while (++pos < max) { + if (state.src.charCodeAt(pos) === 93 && state.src.charCodeAt(pos - 1) !== 92) { + if (pos + 1 === max) { + return false; + } + if (state.src.charCodeAt(pos + 1) !== 58) { + return false; + } + break; + } + } + endLine = state.lineMax; + terminatorRules = state.md.block.ruler.getRules("reference"); + oldParentType = state.parentType; + state.parentType = "reference"; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + if (state.sCount[nextLine] < 0) { + continue; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + str = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + max = str.length; + for (pos = 1; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 91) { + return false; + } else if (ch === 93) { + labelEnd = pos; + break; + } else if (ch === 10) { + lines++; + } else if (ch === 92) { + pos++; + if (pos < max && str.charCodeAt(pos) === 10) { + lines++; + } + } + } + if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) { + return false; + } + for (pos = labelEnd + 2; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 10) { + lines++; + } else if (isSpace(ch)) { + } else { + break; + } + } + res = state.md.helpers.parseLinkDestination(str, pos, max); + if (!res.ok) { + return false; + } + href = state.md.normalizeLink(res.str); + if (!state.md.validateLink(href)) { + return false; + } + pos = res.pos; + lines += res.lines; + destEndPos = pos; + destEndLineNo = lines; + start = pos; + for (; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 10) { + lines++; + } else if (isSpace(ch)) { + } else { + break; + } + } + res = state.md.helpers.parseLinkTitle(str, pos, max); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + lines += res.lines; + } else { + title = ""; + pos = destEndPos; + lines = destEndLineNo; + } + while (pos < max) { + ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + if (pos < max && str.charCodeAt(pos) !== 10) { + if (title) { + title = ""; + pos = destEndPos; + lines = destEndLineNo; + while (pos < max) { + ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + } + } + if (pos < max && str.charCodeAt(pos) !== 10) { + return false; + } + label = normalizeReference(str.slice(1, labelEnd)); + if (!label) { + return false; + } + if (silent) { + return true; + } + if (typeof state.env.references === "undefined") { + state.env.references = {}; + } + if (typeof state.env.references[label] === "undefined") { + state.env.references[label] = { title, href }; + } + state.parentType = oldParentType; + state.line = startLine + lines + 1; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/common/html_blocks.js +var require_html_blocks = __commonJS({ + "node_modules/markdown-it/lib/common/html_blocks.js"(exports, module2) { + "use strict"; + module2.exports = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "section", + "source", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" + ]; + } +}); + +// node_modules/markdown-it/lib/common/html_re.js +var require_html_re = __commonJS({ + "node_modules/markdown-it/lib/common/html_re.js"(exports, module2) { + "use strict"; + var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*"; + var unquoted = "[^\"'=<>`\\x00-\\x20]+"; + var single_quoted = "'[^']*'"; + var double_quoted = '"[^"]*"'; + var attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")"; + var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)"; + var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>"; + var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>"; + var comment = "|"; + var processing = "<[?][\\s\\S]*?[?]>"; + var declaration = "]*>"; + var cdata = ""; + var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")"); + var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")"); + module2.exports.HTML_TAG_RE = HTML_TAG_RE; + module2.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE; + } +}); + +// node_modules/markdown-it/lib/rules_block/html_block.js +var require_html_block = __commonJS({ + "node_modules/markdown-it/lib/rules_block/html_block.js"(exports, module2) { + "use strict"; + var block_names = require_html_blocks(); + var HTML_OPEN_CLOSE_TAG_RE = require_html_re().HTML_OPEN_CLOSE_TAG_RE; + var HTML_SEQUENCES = [ + [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], + [/^/, true], + [/^<\?/, /\?>/, true], + [/^/, true], + [/^/, true], + [new RegExp("^|$))", "i"), /^$/, true], + [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false] + ]; + module2.exports = function html_block(state, startLine, endLine, silent) { + var i, nextLine, token, lineText, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (!state.md.options.html) { + return false; + } + if (state.src.charCodeAt(pos) !== 60) { + return false; + } + lineText = state.src.slice(pos, max); + for (i = 0; i < HTML_SEQUENCES.length; i++) { + if (HTML_SEQUENCES[i][0].test(lineText)) { + break; + } + } + if (i === HTML_SEQUENCES.length) { + return false; + } + if (silent) { + return HTML_SEQUENCES[i][2]; + } + nextLine = startLine + 1; + if (!HTML_SEQUENCES[i][1].test(lineText)) { + for (; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + lineText = state.src.slice(pos, max); + if (HTML_SEQUENCES[i][1].test(lineText)) { + if (lineText.length !== 0) { + nextLine++; + } + break; + } + } + } + state.line = nextLine; + token = state.push("html_block", "", 0); + token.map = [startLine, nextLine]; + token.content = state.getLines(startLine, nextLine, state.blkIndent, true); + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/heading.js +var require_heading = __commonJS({ + "node_modules/markdown-it/lib/rules_block/heading.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + module2.exports = function heading(state, startLine, endLine, silent) { + var ch, level, tmp, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + ch = state.src.charCodeAt(pos); + if (ch !== 35 || pos >= max) { + return false; + } + level = 1; + ch = state.src.charCodeAt(++pos); + while (ch === 35 && pos < max && level <= 6) { + level++; + ch = state.src.charCodeAt(++pos); + } + if (level > 6 || pos < max && !isSpace(ch)) { + return false; + } + if (silent) { + return true; + } + max = state.skipSpacesBack(max, pos); + tmp = state.skipCharsBack(max, 35, pos); + if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { + max = tmp; + } + state.line = startLine + 1; + token = state.push("heading_open", "h" + String(level), 1); + token.markup = "########".slice(0, level); + token.map = [startLine, state.line]; + token = state.push("inline", "", 0); + token.content = state.src.slice(pos, max).trim(); + token.map = [startLine, state.line]; + token.children = []; + token = state.push("heading_close", "h" + String(level), -1); + token.markup = "########".slice(0, level); + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/lheading.js +var require_lheading = __commonJS({ + "node_modules/markdown-it/lib/rules_block/lheading.js"(exports, module2) { + "use strict"; + module2.exports = function lheading(state, startLine, endLine) { + var content, terminate, i, l, token, pos, max, level, marker, nextLine = startLine + 1, oldParentType, terminatorRules = state.md.block.ruler.getRules("paragraph"); + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + oldParentType = state.parentType; + state.parentType = "paragraph"; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + if (state.sCount[nextLine] >= state.blkIndent) { + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max) { + marker = state.src.charCodeAt(pos); + if (marker === 45 || marker === 61) { + pos = state.skipChars(pos, marker); + pos = state.skipSpaces(pos); + if (pos >= max) { + level = marker === 61 ? 1 : 2; + break; + } + } + } + } + if (state.sCount[nextLine] < 0) { + continue; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + if (!level) { + return false; + } + content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine + 1; + token = state.push("heading_open", "h" + String(level), 1); + token.markup = String.fromCharCode(marker); + token.map = [startLine, state.line]; + token = state.push("inline", "", 0); + token.content = content; + token.map = [startLine, state.line - 1]; + token.children = []; + token = state.push("heading_close", "h" + String(level), -1); + token.markup = String.fromCharCode(marker); + state.parentType = oldParentType; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/paragraph.js +var require_paragraph = __commonJS({ + "node_modules/markdown-it/lib/rules_block/paragraph.js"(exports, module2) { + "use strict"; + module2.exports = function paragraph(state, startLine) { + var content, terminate, i, l, token, oldParentType, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules("paragraph"), endLine = state.lineMax; + oldParentType = state.parentType; + state.parentType = "paragraph"; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + if (state.sCount[nextLine] < 0) { + continue; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine; + token = state.push("paragraph_open", "p", 1); + token.map = [startLine, state.line]; + token = state.push("inline", "", 0); + token.content = content; + token.map = [startLine, state.line]; + token.children = []; + token = state.push("paragraph_close", "p", -1); + state.parentType = oldParentType; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_block/state_block.js +var require_state_block = __commonJS({ + "node_modules/markdown-it/lib/rules_block/state_block.js"(exports, module2) { + "use strict"; + var Token = require_token(); + var isSpace = require_utils().isSpace; + function StateBlock(src, md, env, tokens) { + var ch, s, start, pos, len, indent, offset, indent_found; + this.src = src; + this.md = md; + this.env = env; + this.tokens = tokens; + this.bMarks = []; + this.eMarks = []; + this.tShift = []; + this.sCount = []; + this.bsCount = []; + this.blkIndent = 0; + this.line = 0; + this.lineMax = 0; + this.tight = false; + this.ddIndent = -1; + this.listIndent = -1; + this.parentType = "root"; + this.level = 0; + this.result = ""; + s = this.src; + indent_found = false; + for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) { + ch = s.charCodeAt(pos); + if (!indent_found) { + if (isSpace(ch)) { + indent++; + if (ch === 9) { + offset += 4 - offset % 4; + } else { + offset++; + } + continue; + } else { + indent_found = true; + } + } + if (ch === 10 || pos === len - 1) { + if (ch !== 10) { + pos++; + } + this.bMarks.push(start); + this.eMarks.push(pos); + this.tShift.push(indent); + this.sCount.push(offset); + this.bsCount.push(0); + indent_found = false; + indent = 0; + offset = 0; + start = pos + 1; + } + } + this.bMarks.push(s.length); + this.eMarks.push(s.length); + this.tShift.push(0); + this.sCount.push(0); + this.bsCount.push(0); + this.lineMax = this.bMarks.length - 1; + } + StateBlock.prototype.push = function(type, tag, nesting) { + var token = new Token(type, tag, nesting); + token.block = true; + if (nesting < 0) + this.level--; + token.level = this.level; + if (nesting > 0) + this.level++; + this.tokens.push(token); + return token; + }; + StateBlock.prototype.isEmpty = function isEmpty(line) { + return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; + }; + StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { + for (var max = this.lineMax; from < max; from++) { + if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { + break; + } + } + return from; + }; + StateBlock.prototype.skipSpaces = function skipSpaces(pos) { + var ch; + for (var max = this.src.length; pos < max; pos++) { + ch = this.src.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + } + return pos; + }; + StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (!isSpace(this.src.charCodeAt(--pos))) { + return pos + 1; + } + } + return pos; + }; + StateBlock.prototype.skipChars = function skipChars(pos, code) { + for (var max = this.src.length; pos < max; pos++) { + if (this.src.charCodeAt(pos) !== code) { + break; + } + } + return pos; + }; + StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (code !== this.src.charCodeAt(--pos)) { + return pos + 1; + } + } + return pos; + }; + StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { + var i, lineIndent, ch, first, last, queue, lineStart, line = begin; + if (begin >= end) { + return ""; + } + queue = new Array(end - begin); + for (i = 0; line < end; line++, i++) { + lineIndent = 0; + lineStart = first = this.bMarks[line]; + if (line + 1 < end || keepLastLF) { + last = this.eMarks[line] + 1; + } else { + last = this.eMarks[line]; + } + while (first < last && lineIndent < indent) { + ch = this.src.charCodeAt(first); + if (isSpace(ch)) { + if (ch === 9) { + lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; + } else { + lineIndent++; + } + } else if (first - lineStart < this.tShift[line]) { + lineIndent++; + } else { + break; + } + first++; + } + if (lineIndent > indent) { + queue[i] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last); + } else { + queue[i] = this.src.slice(first, last); + } + } + return queue.join(""); + }; + StateBlock.prototype.Token = Token; + module2.exports = StateBlock; + } +}); + +// node_modules/markdown-it/lib/parser_block.js +var require_parser_block = __commonJS({ + "node_modules/markdown-it/lib/parser_block.js"(exports, module2) { + "use strict"; + var Ruler = require_ruler(); + var _rules = [ + ["table", require_table(), ["paragraph", "reference"]], + ["code", require_code()], + ["fence", require_fence(), ["paragraph", "reference", "blockquote", "list"]], + ["blockquote", require_blockquote(), ["paragraph", "reference", "blockquote", "list"]], + ["hr", require_hr(), ["paragraph", "reference", "blockquote", "list"]], + ["list", require_list(), ["paragraph", "reference", "blockquote"]], + ["reference", require_reference()], + ["html_block", require_html_block(), ["paragraph", "reference", "blockquote"]], + ["heading", require_heading(), ["paragraph", "reference", "blockquote"]], + ["lheading", require_lheading()], + ["paragraph", require_paragraph()] + ]; + function ParserBlock() { + this.ruler = new Ruler(); + for (var i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() }); + } + } + ParserBlock.prototype.tokenize = function(state, startLine, endLine) { + var ok, i, rules = this.ruler.getRules(""), len = rules.length, line = startLine, hasEmptyLines = false, maxNesting = state.md.options.maxNesting; + while (line < endLine) { + state.line = line = state.skipEmptyLines(line); + if (line >= endLine) { + break; + } + if (state.sCount[line] < state.blkIndent) { + break; + } + if (state.level >= maxNesting) { + state.line = endLine; + break; + } + for (i = 0; i < len; i++) { + ok = rules[i](state, line, endLine, false); + if (ok) { + break; + } + } + state.tight = !hasEmptyLines; + if (state.isEmpty(state.line - 1)) { + hasEmptyLines = true; + } + line = state.line; + if (line < endLine && state.isEmpty(line)) { + hasEmptyLines = true; + line++; + state.line = line; + } + } + }; + ParserBlock.prototype.parse = function(src, md, env, outTokens) { + var state; + if (!src) { + return; + } + state = new this.State(src, md, env, outTokens); + this.tokenize(state, state.line, state.lineMax); + }; + ParserBlock.prototype.State = require_state_block(); + module2.exports = ParserBlock; + } +}); + +// node_modules/markdown-it/lib/rules_inline/text.js +var require_text = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/text.js"(exports, module2) { + "use strict"; + function isTerminatorChar(ch) { + switch (ch) { + case 10: + case 33: + case 35: + case 36: + case 37: + case 38: + case 42: + case 43: + case 45: + case 58: + case 60: + case 61: + case 62: + case 64: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 123: + case 125: + case 126: + return true; + default: + return false; + } + } + module2.exports = function text2(state, silent) { + var pos = state.pos; + while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { + pos++; + } + if (pos === state.pos) { + return false; + } + if (!silent) { + state.pending += state.src.slice(state.pos, pos); + } + state.pos = pos; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/linkify.js +var require_linkify2 = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/linkify.js"(exports, module2) { + "use strict"; + var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i; + module2.exports = function linkify(state, silent) { + var pos, max, match, proto, link, url, fullUrl, token; + if (!state.md.options.linkify) + return false; + if (state.linkLevel > 0) + return false; + pos = state.pos; + max = state.posMax; + if (pos + 3 > max) + return false; + if (state.src.charCodeAt(pos) !== 58) + return false; + if (state.src.charCodeAt(pos + 1) !== 47) + return false; + if (state.src.charCodeAt(pos + 2) !== 47) + return false; + match = state.pending.match(SCHEME_RE); + if (!match) + return false; + proto = match[1]; + link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)); + if (!link) + return false; + url = link.url; + url = url.replace(/\*+$/, ""); + fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) + return false; + if (!silent) { + state.pending = state.pending.slice(0, -proto.length); + token = state.push("link_open", "a", 1); + token.attrs = [["href", fullUrl]]; + token.markup = "linkify"; + token.info = "auto"; + token = state.push("text", "", 0); + token.content = state.md.normalizeLinkText(url); + token = state.push("link_close", "a", -1); + token.markup = "linkify"; + token.info = "auto"; + } + state.pos += url.length - proto.length; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/newline.js +var require_newline = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/newline.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + module2.exports = function newline(state, silent) { + var pmax, max, ws, pos = state.pos; + if (state.src.charCodeAt(pos) !== 10) { + return false; + } + pmax = state.pending.length - 1; + max = state.posMax; + if (!silent) { + if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) { + if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) { + ws = pmax - 1; + while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) + ws--; + state.pending = state.pending.slice(0, ws); + state.push("hardbreak", "br", 0); + } else { + state.pending = state.pending.slice(0, -1); + state.push("softbreak", "br", 0); + } + } else { + state.push("softbreak", "br", 0); + } + } + pos++; + while (pos < max && isSpace(state.src.charCodeAt(pos))) { + pos++; + } + state.pos = pos; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/escape.js +var require_escape = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/escape.js"(exports, module2) { + "use strict"; + var isSpace = require_utils().isSpace; + var ESCAPED = []; + for (i = 0; i < 256; i++) { + ESCAPED.push(0); + } + var i; + "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) { + ESCAPED[ch.charCodeAt(0)] = 1; + }); + module2.exports = function escape2(state, silent) { + var ch1, ch2, origStr, escapedStr, token, pos = state.pos, max = state.posMax; + if (state.src.charCodeAt(pos) !== 92) + return false; + pos++; + if (pos >= max) + return false; + ch1 = state.src.charCodeAt(pos); + if (ch1 === 10) { + if (!silent) { + state.push("hardbreak", "br", 0); + } + pos++; + while (pos < max) { + ch1 = state.src.charCodeAt(pos); + if (!isSpace(ch1)) + break; + pos++; + } + state.pos = pos; + return true; + } + escapedStr = state.src[pos]; + if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) { + ch2 = state.src.charCodeAt(pos + 1); + if (ch2 >= 56320 && ch2 <= 57343) { + escapedStr += state.src[pos + 1]; + pos++; + } + } + origStr = "\\" + escapedStr; + if (!silent) { + token = state.push("text_special", "", 0); + if (ch1 < 256 && ESCAPED[ch1] !== 0) { + token.content = escapedStr; + } else { + token.content = origStr; + } + token.markup = origStr; + token.info = "escape"; + } + state.pos = pos + 1; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/backticks.js +var require_backticks = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/backticks.js"(exports, module2) { + "use strict"; + module2.exports = function backtick(state, silent) { + var start, max, marker, token, matchStart, matchEnd, openerLength, closerLength, pos = state.pos, ch = state.src.charCodeAt(pos); + if (ch !== 96) { + return false; + } + start = pos; + pos++; + max = state.posMax; + while (pos < max && state.src.charCodeAt(pos) === 96) { + pos++; + } + marker = state.src.slice(start, pos); + openerLength = marker.length; + if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { + if (!silent) + state.pending += marker; + state.pos += openerLength; + return true; + } + matchStart = matchEnd = pos; + while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) { + matchEnd = matchStart + 1; + while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) { + matchEnd++; + } + closerLength = matchEnd - matchStart; + if (closerLength === openerLength) { + if (!silent) { + token = state.push("code_inline", "code", 0); + token.markup = marker; + token.content = state.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1"); + } + state.pos = matchEnd; + return true; + } + state.backticks[closerLength] = matchStart; + } + state.backticksScanned = true; + if (!silent) + state.pending += marker; + state.pos += openerLength; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/strikethrough.js +var require_strikethrough = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/strikethrough.js"(exports, module2) { + "use strict"; + module2.exports.tokenize = function strikethrough(state, silent) { + var i, scanned, token, len, ch, start = state.pos, marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 126) { + return false; + } + scanned = state.scanDelims(state.pos, true); + len = scanned.length; + ch = String.fromCharCode(marker); + if (len < 2) { + return false; + } + if (len % 2) { + token = state.push("text", "", 0); + token.content = ch; + len--; + } + for (i = 0; i < len; i += 2) { + token = state.push("text", "", 0); + token.content = ch + ch; + state.delimiters.push({ + marker, + length: 0, + token: state.tokens.length - 1, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; + }; + function postProcess(state, delimiters) { + var i, j, startDelim, endDelim, token, loneMarkers = [], max = delimiters.length; + for (i = 0; i < max; i++) { + startDelim = delimiters[i]; + if (startDelim.marker !== 126) { + continue; + } + if (startDelim.end === -1) { + continue; + } + endDelim = delimiters[startDelim.end]; + token = state.tokens[startDelim.token]; + token.type = "s_open"; + token.tag = "s"; + token.nesting = 1; + token.markup = "~~"; + token.content = ""; + token = state.tokens[endDelim.token]; + token.type = "s_close"; + token.tag = "s"; + token.nesting = -1; + token.markup = "~~"; + token.content = ""; + if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") { + loneMarkers.push(endDelim.token - 1); + } + } + while (loneMarkers.length) { + i = loneMarkers.pop(); + j = i + 1; + while (j < state.tokens.length && state.tokens[j].type === "s_close") { + j++; + } + j--; + if (i !== j) { + token = state.tokens[j]; + state.tokens[j] = state.tokens[i]; + state.tokens[i] = token; + } + } + } + module2.exports.postProcess = function strikethrough(state) { + var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/emphasis.js +var require_emphasis = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/emphasis.js"(exports, module2) { + "use strict"; + module2.exports.tokenize = function emphasis(state, silent) { + var i, scanned, token, start = state.pos, marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 95 && marker !== 42) { + return false; + } + scanned = state.scanDelims(state.pos, marker === 42); + for (i = 0; i < scanned.length; i++) { + token = state.push("text", "", 0); + token.content = String.fromCharCode(marker); + state.delimiters.push({ + marker, + length: scanned.length, + token: state.tokens.length - 1, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; + }; + function postProcess(state, delimiters) { + var i, startDelim, endDelim, token, ch, isStrong, max = delimiters.length; + for (i = max - 1; i >= 0; i--) { + startDelim = delimiters[i]; + if (startDelim.marker !== 95 && startDelim.marker !== 42) { + continue; + } + if (startDelim.end === -1) { + continue; + } + endDelim = delimiters[startDelim.end]; + isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1; + ch = String.fromCharCode(startDelim.marker); + token = state.tokens[startDelim.token]; + token.type = isStrong ? "strong_open" : "em_open"; + token.tag = isStrong ? "strong" : "em"; + token.nesting = 1; + token.markup = isStrong ? ch + ch : ch; + token.content = ""; + token = state.tokens[endDelim.token]; + token.type = isStrong ? "strong_close" : "em_close"; + token.tag = isStrong ? "strong" : "em"; + token.nesting = -1; + token.markup = isStrong ? ch + ch : ch; + token.content = ""; + if (isStrong) { + state.tokens[delimiters[i - 1].token].content = ""; + state.tokens[delimiters[startDelim.end + 1].token].content = ""; + i--; + } + } + } + module2.exports.postProcess = function emphasis(state) { + var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/link.js +var require_link = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/link.js"(exports, module2) { + "use strict"; + var normalizeReference = require_utils().normalizeReference; + var isSpace = require_utils().isSpace; + module2.exports = function link(state, silent) { + var attrs, code, label, labelEnd, labelStart, pos, res, ref, token, href = "", title = "", oldPos = state.pos, max = state.posMax, start = state.pos, parseReference = true; + if (state.src.charCodeAt(state.pos) !== 91) { + return false; + } + labelStart = state.pos + 1; + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 40) { + parseReference = false; + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + if (pos >= max) { + return false; + } + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ""; + } + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + } + } + if (pos >= max || state.src.charCodeAt(pos) !== 41) { + parseReference = true; + } + pos++; + } + if (parseReference) { + if (typeof state.env.references === "undefined") { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 91) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + if (!silent) { + state.pos = labelStart; + state.posMax = labelEnd; + token = state.push("link_open", "a", 1); + token.attrs = attrs = [["href", href]]; + if (title) { + attrs.push(["title", title]); + } + state.linkLevel++; + state.md.inline.tokenize(state); + state.linkLevel--; + token = state.push("link_close", "a", -1); + } + state.pos = pos; + state.posMax = max; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/image.js +var require_image = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/image.js"(exports, module2) { + "use strict"; + var normalizeReference = require_utils().normalizeReference; + var isSpace = require_utils().isSpace; + module2.exports = function image(state, silent) { + var attrs, code, content, label, labelEnd, labelStart, pos, ref, res, title, token, tokens, start, href = "", oldPos = state.pos, max = state.posMax; + if (state.src.charCodeAt(state.pos) !== 33) { + return false; + } + if (state.src.charCodeAt(state.pos + 1) !== 91) { + return false; + } + labelStart = state.pos + 2; + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 40) { + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + if (pos >= max) { + return false; + } + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ""; + } + } + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 10) { + break; + } + } + } else { + title = ""; + } + if (pos >= max || state.src.charCodeAt(pos) !== 41) { + state.pos = oldPos; + return false; + } + pos++; + } else { + if (typeof state.env.references === "undefined") { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 91) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + if (!silent) { + content = state.src.slice(labelStart, labelEnd); + state.md.inline.parse(content, state.md, state.env, tokens = []); + token = state.push("image", "img", 0); + token.attrs = attrs = [["src", href], ["alt", ""]]; + token.children = tokens; + token.content = content; + if (title) { + attrs.push(["title", title]); + } + } + state.pos = pos; + state.posMax = max; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/autolink.js +var require_autolink = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/autolink.js"(exports, module2) { + "use strict"; + var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; + var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/; + module2.exports = function autolink(state, silent) { + var url, fullUrl, token, ch, start, max, pos = state.pos; + if (state.src.charCodeAt(pos) !== 60) { + return false; + } + start = state.pos; + max = state.posMax; + for (; ; ) { + if (++pos >= max) + return false; + ch = state.src.charCodeAt(pos); + if (ch === 60) + return false; + if (ch === 62) + break; + } + url = state.src.slice(start + 1, pos); + if (AUTOLINK_RE.test(url)) { + fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + token = state.push("link_open", "a", 1); + token.attrs = [["href", fullUrl]]; + token.markup = "autolink"; + token.info = "auto"; + token = state.push("text", "", 0); + token.content = state.md.normalizeLinkText(url); + token = state.push("link_close", "a", -1); + token.markup = "autolink"; + token.info = "auto"; + } + state.pos += url.length + 2; + return true; + } + if (EMAIL_RE.test(url)) { + fullUrl = state.md.normalizeLink("mailto:" + url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + token = state.push("link_open", "a", 1); + token.attrs = [["href", fullUrl]]; + token.markup = "autolink"; + token.info = "auto"; + token = state.push("text", "", 0); + token.content = state.md.normalizeLinkText(url); + token = state.push("link_close", "a", -1); + token.markup = "autolink"; + token.info = "auto"; + } + state.pos += url.length + 2; + return true; + } + return false; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/html_inline.js +var require_html_inline = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/html_inline.js"(exports, module2) { + "use strict"; + var HTML_TAG_RE = require_html_re().HTML_TAG_RE; + function isLinkOpen(str) { + return /^\s]/i.test(str); + } + function isLinkClose(str) { + return /^<\/a\s*>/i.test(str); + } + function isLetter(ch) { + var lc = ch | 32; + return lc >= 97 && lc <= 122; + } + module2.exports = function html_inline(state, silent) { + var ch, match, max, token, pos = state.pos; + if (!state.md.options.html) { + return false; + } + max = state.posMax; + if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) { + return false; + } + ch = state.src.charCodeAt(pos + 1); + if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) { + return false; + } + match = state.src.slice(pos).match(HTML_TAG_RE); + if (!match) { + return false; + } + if (!silent) { + token = state.push("html_inline", "", 0); + token.content = state.src.slice(pos, pos + match[0].length); + if (isLinkOpen(token.content)) + state.linkLevel++; + if (isLinkClose(token.content)) + state.linkLevel--; + } + state.pos += match[0].length; + return true; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/entity.js +var require_entity = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/entity.js"(exports, module2) { + "use strict"; + var entities = require_entities2(); + var has = require_utils().has; + var isValidEntityCode = require_utils().isValidEntityCode; + var fromCodePoint = require_utils().fromCodePoint; + var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; + var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; + module2.exports = function entity(state, silent) { + var ch, code, match, token, pos = state.pos, max = state.posMax; + if (state.src.charCodeAt(pos) !== 38) + return false; + if (pos + 1 >= max) + return false; + ch = state.src.charCodeAt(pos + 1); + if (ch === 35) { + match = state.src.slice(pos).match(DIGITAL_RE); + if (match) { + if (!silent) { + code = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); + token = state.push("text_special", "", 0); + token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533); + token.markup = match[0]; + token.info = "entity"; + } + state.pos += match[0].length; + return true; + } + } else { + match = state.src.slice(pos).match(NAMED_RE); + if (match) { + if (has(entities, match[1])) { + if (!silent) { + token = state.push("text_special", "", 0); + token.content = entities[match[1]]; + token.markup = match[0]; + token.info = "entity"; + } + state.pos += match[0].length; + return true; + } + } + } + return false; + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/balance_pairs.js +var require_balance_pairs = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(exports, module2) { + "use strict"; + function processDelimiters(state, delimiters) { + var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, isOddMatch, lastJump, openersBottom = {}, max = delimiters.length; + if (!max) + return; + var headerIdx = 0; + var lastTokenIdx = -2; + var jumps = []; + for (closerIdx = 0; closerIdx < max; closerIdx++) { + closer = delimiters[closerIdx]; + jumps.push(0); + if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { + headerIdx = closerIdx; + } + lastTokenIdx = closer.token; + closer.length = closer.length || 0; + if (!closer.close) + continue; + if (!openersBottom.hasOwnProperty(closer.marker)) { + openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; + } + minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; + openerIdx = headerIdx - jumps[headerIdx] - 1; + newMinOpenerIdx = openerIdx; + for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { + opener = delimiters[openerIdx]; + if (opener.marker !== closer.marker) + continue; + if (opener.open && opener.end < 0) { + isOddMatch = false; + if (opener.close || closer.open) { + if ((opener.length + closer.length) % 3 === 0) { + if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { + isOddMatch = true; + } + } + } + if (!isOddMatch) { + lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0; + jumps[closerIdx] = closerIdx - openerIdx + lastJump; + jumps[openerIdx] = lastJump; + closer.open = false; + opener.end = closerIdx; + opener.close = false; + newMinOpenerIdx = -1; + lastTokenIdx = -2; + break; + } + } + } + if (newMinOpenerIdx !== -1) { + openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; + } + } + } + module2.exports = function link_pairs(state) { + var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length; + processDelimiters(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + processDelimiters(state, tokens_meta[curr].delimiters); + } + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/fragments_join.js +var require_fragments_join = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/fragments_join.js"(exports, module2) { + "use strict"; + module2.exports = function fragments_join(state) { + var curr, last, level = 0, tokens = state.tokens, max = state.tokens.length; + for (curr = last = 0; curr < max; curr++) { + if (tokens[curr].nesting < 0) + level--; + tokens[curr].level = level; + if (tokens[curr].nesting > 0) + level++; + if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") { + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } + }; + } +}); + +// node_modules/markdown-it/lib/rules_inline/state_inline.js +var require_state_inline = __commonJS({ + "node_modules/markdown-it/lib/rules_inline/state_inline.js"(exports, module2) { + "use strict"; + var Token = require_token(); + var isWhiteSpace = require_utils().isWhiteSpace; + var isPunctChar = require_utils().isPunctChar; + var isMdAsciiPunct = require_utils().isMdAsciiPunct; + function StateInline(src, md, env, outTokens) { + this.src = src; + this.env = env; + this.md = md; + this.tokens = outTokens; + this.tokens_meta = Array(outTokens.length); + this.pos = 0; + this.posMax = this.src.length; + this.level = 0; + this.pending = ""; + this.pendingLevel = 0; + this.cache = {}; + this.delimiters = []; + this._prev_delimiters = []; + this.backticks = {}; + this.backticksScanned = false; + this.linkLevel = 0; + } + StateInline.prototype.pushPending = function() { + var token = new Token("text", "", 0); + token.content = this.pending; + token.level = this.pendingLevel; + this.tokens.push(token); + this.pending = ""; + return token; + }; + StateInline.prototype.push = function(type, tag, nesting) { + if (this.pending) { + this.pushPending(); + } + var token = new Token(type, tag, nesting); + var token_meta = null; + if (nesting < 0) { + this.level--; + this.delimiters = this._prev_delimiters.pop(); + } + token.level = this.level; + if (nesting > 0) { + this.level++; + this._prev_delimiters.push(this.delimiters); + this.delimiters = []; + token_meta = { delimiters: this.delimiters }; + } + this.pendingLevel = this.level; + this.tokens.push(token); + this.tokens_meta.push(token_meta); + return token; + }; + StateInline.prototype.scanDelims = function(start, canSplitWord) { + var pos = start, lastChar, nextChar, count, can_open, can_close, isLastWhiteSpace, isLastPunctChar, isNextWhiteSpace, isNextPunctChar, left_flanking = true, right_flanking = true, max = this.posMax, marker = this.src.charCodeAt(start); + lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32; + while (pos < max && this.src.charCodeAt(pos) === marker) { + pos++; + } + count = pos - start; + nextChar = pos < max ? this.src.charCodeAt(pos) : 32; + isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + isLastWhiteSpace = isWhiteSpace(lastChar); + isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + left_flanking = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + left_flanking = false; + } + } + if (isLastWhiteSpace) { + right_flanking = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + right_flanking = false; + } + } + if (!canSplitWord) { + can_open = left_flanking && (!right_flanking || isLastPunctChar); + can_close = right_flanking && (!left_flanking || isNextPunctChar); + } else { + can_open = left_flanking; + can_close = right_flanking; + } + return { + can_open, + can_close, + length: count + }; + }; + StateInline.prototype.Token = Token; + module2.exports = StateInline; + } +}); + +// node_modules/markdown-it/lib/parser_inline.js +var require_parser_inline = __commonJS({ + "node_modules/markdown-it/lib/parser_inline.js"(exports, module2) { + "use strict"; + var Ruler = require_ruler(); + var _rules = [ + ["text", require_text()], + ["linkify", require_linkify2()], + ["newline", require_newline()], + ["escape", require_escape()], + ["backticks", require_backticks()], + ["strikethrough", require_strikethrough().tokenize], + ["emphasis", require_emphasis().tokenize], + ["link", require_link()], + ["image", require_image()], + ["autolink", require_autolink()], + ["html_inline", require_html_inline()], + ["entity", require_entity()] + ]; + var _rules2 = [ + ["balance_pairs", require_balance_pairs()], + ["strikethrough", require_strikethrough().postProcess], + ["emphasis", require_emphasis().postProcess], + ["fragments_join", require_fragments_join()] + ]; + function ParserInline() { + var i; + this.ruler = new Ruler(); + for (i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } + this.ruler2 = new Ruler(); + for (i = 0; i < _rules2.length; i++) { + this.ruler2.push(_rules2[i][0], _rules2[i][1]); + } + } + ParserInline.prototype.skipToken = function(state) { + var ok, i, pos = state.pos, rules = this.ruler.getRules(""), len = rules.length, maxNesting = state.md.options.maxNesting, cache = state.cache; + if (typeof cache[pos] !== "undefined") { + state.pos = cache[pos]; + return; + } + if (state.level < maxNesting) { + for (i = 0; i < len; i++) { + state.level++; + ok = rules[i](state, true); + state.level--; + if (ok) { + break; + } + } + } else { + state.pos = state.posMax; + } + if (!ok) { + state.pos++; + } + cache[pos] = state.pos; + }; + ParserInline.prototype.tokenize = function(state) { + var ok, i, rules = this.ruler.getRules(""), len = rules.length, end = state.posMax, maxNesting = state.md.options.maxNesting; + while (state.pos < end) { + if (state.level < maxNesting) { + for (i = 0; i < len; i++) { + ok = rules[i](state, false); + if (ok) { + break; + } + } + } + if (ok) { + if (state.pos >= end) { + break; + } + continue; + } + state.pending += state.src[state.pos++]; + } + if (state.pending) { + state.pushPending(); + } + }; + ParserInline.prototype.parse = function(str, md, env, outTokens) { + var i, rules, len; + var state = new this.State(str, md, env, outTokens); + this.tokenize(state); + rules = this.ruler2.getRules(""); + len = rules.length; + for (i = 0; i < len; i++) { + rules[i](state); + } + }; + ParserInline.prototype.State = require_state_inline(); + module2.exports = ParserInline; + } +}); + +// node_modules/linkify-it/lib/re.js +var require_re = __commonJS({ + "node_modules/linkify-it/lib/re.js"(exports, module2) { + "use strict"; + module2.exports = function(opts) { + var re = {}; + opts = opts || {}; + re.src_Any = require_regex2().source; + re.src_Cc = require_regex3().source; + re.src_Z = require_regex5().source; + re.src_P = require_regex().source; + re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|"); + re.src_ZCc = [re.src_Z, re.src_Cc].join("|"); + var text_separators = "[><\uFF5C]"; + re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")"; + re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; + re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?"; + re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"; + re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))"; + re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + re.src_ZCc + "|$)|;(?!" + re.src_ZCc + "|$)|\\!+(?!" + re.src_ZCc + "|[!]|$)|\\?(?!" + re.src_ZCc + "|[?]|$))+|\\/)?"; + re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; + re.src_xn = "xn--[a-z0-9\\-]{1,59}"; + re.src_domain_root = "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})"; + re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))"; + re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))"; + re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))"; + re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))"; + re.src_host_strict = re.src_host + re.src_host_terminator; + re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; + re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; + re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; + re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; + re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))"; + re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")"; + re.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")"; + re.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")"; + return re; + }; + } +}); + +// node_modules/linkify-it/index.js +var require_linkify_it = __commonJS({ + "node_modules/linkify-it/index.js"(exports, module2) { + "use strict"; + function assign(obj) { + var sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function(source) { + if (!source) { + return; + } + Object.keys(source).forEach(function(key) { + obj[key] = source[key]; + }); + }); + return obj; + } + function _class(obj) { + return Object.prototype.toString.call(obj); + } + function isString(obj) { + return _class(obj) === "[object String]"; + } + function isObject(obj) { + return _class(obj) === "[object Object]"; + } + function isRegExp(obj) { + return _class(obj) === "[object RegExp]"; + } + function isFunction(obj) { + return _class(obj) === "[object Function]"; + } + function escapeRE(str) { + return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); + } + var defaultOptions = { + fuzzyLink: true, + fuzzyEmail: true, + fuzzyIP: false + }; + function isOptionsObj(obj) { + return Object.keys(obj || {}).reduce(function(acc, k) { + return acc || defaultOptions.hasOwnProperty(k); + }, false); + } + var defaultSchemas = { + "http:": { + validate: function(text2, pos, self) { + var tail = text2.slice(pos); + if (!self.re.http) { + self.re.http = new RegExp("^\\/\\/" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, "i"); + } + if (self.re.http.test(tail)) { + return tail.match(self.re.http)[0].length; + } + return 0; + } + }, + "https:": "http:", + "ftp:": "http:", + "//": { + validate: function(text2, pos, self) { + var tail = text2.slice(pos); + if (!self.re.no_http) { + self.re.no_http = new RegExp("^" + self.re.src_auth + "(?:localhost|(?:(?:" + self.re.src_domain + ")\\.)+" + self.re.src_domain_root + ")" + self.re.src_port + self.re.src_host_terminator + self.re.src_path, "i"); + } + if (self.re.no_http.test(tail)) { + if (pos >= 3 && text2[pos - 3] === ":") { + return 0; + } + if (pos >= 3 && text2[pos - 3] === "/") { + return 0; + } + return tail.match(self.re.no_http)[0].length; + } + return 0; + } + }, + "mailto:": { + validate: function(text2, pos, self) { + var tail = text2.slice(pos); + if (!self.re.mailto) { + self.re.mailto = new RegExp("^" + self.re.src_email_name + "@" + self.re.src_host_strict, "i"); + } + if (self.re.mailto.test(tail)) { + return tail.match(self.re.mailto)[0].length; + } + return 0; + } + } + }; + var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"; + var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|"); + function resetScanCache(self) { + self.__index__ = -1; + self.__text_cache__ = ""; + } + function createValidator(re) { + return function(text2, pos) { + var tail = text2.slice(pos); + if (re.test(tail)) { + return tail.match(re)[0].length; + } + return 0; + }; + } + function createNormalizer() { + return function(match, self) { + self.normalize(match); + }; + } + function compile(self) { + var re = self.re = require_re()(self.__opts__); + var tlds = self.__tlds__.slice(); + self.onCompile(); + if (!self.__tlds_replaced__) { + tlds.push(tlds_2ch_src_re); + } + tlds.push(re.src_xn); + re.src_tlds = tlds.join("|"); + function untpl(tpl) { + return tpl.replace("%TLDS%", re.src_tlds); + } + re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i"); + re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i"); + re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i"); + re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i"); + var aliases = []; + self.__compiled__ = {}; + function schemaError(name, val) { + throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); + } + Object.keys(self.__schemas__).forEach(function(name) { + var val = self.__schemas__[name]; + if (val === null) { + return; + } + var compiled = { validate: null, link: null }; + self.__compiled__[name] = compiled; + if (isObject(val)) { + if (isRegExp(val.validate)) { + compiled.validate = createValidator(val.validate); + } else if (isFunction(val.validate)) { + compiled.validate = val.validate; + } else { + schemaError(name, val); + } + if (isFunction(val.normalize)) { + compiled.normalize = val.normalize; + } else if (!val.normalize) { + compiled.normalize = createNormalizer(); + } else { + schemaError(name, val); + } + return; + } + if (isString(val)) { + aliases.push(name); + return; + } + schemaError(name, val); + }); + aliases.forEach(function(alias) { + if (!self.__compiled__[self.__schemas__[alias]]) { + return; + } + self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; + self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; + }); + self.__compiled__[""] = { validate: null, normalize: createNormalizer() }; + var slist = Object.keys(self.__compiled__).filter(function(name) { + return name.length > 0 && self.__compiled__[name]; + }).map(escapeRE).join("|"); + self.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i"); + self.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig"); + self.re.schema_at_start = RegExp("^" + self.re.schema_search.source, "i"); + self.re.pretest = RegExp("(" + self.re.schema_test.source + ")|(" + self.re.host_fuzzy_test.source + ")|@", "i"); + resetScanCache(self); + } + function Match(self, shift) { + var start = self.__index__, end = self.__last_index__, text2 = self.__text_cache__.slice(start, end); + this.schema = self.__schema__.toLowerCase(); + this.index = start + shift; + this.lastIndex = end + shift; + this.raw = text2; + this.text = text2; + this.url = text2; + } + function createMatch(self, shift) { + var match = new Match(self, shift); + self.__compiled__[match.schema].normalize(match, self); + return match; + } + function LinkifyIt(schemas, options) { + if (!(this instanceof LinkifyIt)) { + return new LinkifyIt(schemas, options); + } + if (!options) { + if (isOptionsObj(schemas)) { + options = schemas; + schemas = {}; + } + } + this.__opts__ = assign({}, defaultOptions, options); + this.__index__ = -1; + this.__last_index__ = -1; + this.__schema__ = ""; + this.__text_cache__ = ""; + this.__schemas__ = assign({}, defaultSchemas, schemas); + this.__compiled__ = {}; + this.__tlds__ = tlds_default; + this.__tlds_replaced__ = false; + this.re = {}; + compile(this); + } + LinkifyIt.prototype.add = function add(schema, definition) { + this.__schemas__[schema] = definition; + compile(this); + return this; + }; + LinkifyIt.prototype.set = function set(options) { + this.__opts__ = assign(this.__opts__, options); + return this; + }; + LinkifyIt.prototype.test = function test(text2) { + this.__text_cache__ = text2; + this.__index__ = -1; + if (!text2.length) { + return false; + } + var m, ml, me, len, shift, next, re, tld_pos, at_pos; + if (this.re.schema_test.test(text2)) { + re = this.re.schema_search; + re.lastIndex = 0; + while ((m = re.exec(text2)) !== null) { + len = this.testSchemaAt(text2, m[2], re.lastIndex); + if (len) { + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + break; + } + } + } + if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) { + tld_pos = text2.search(this.re.host_fuzzy_test); + if (tld_pos >= 0) { + if (this.__index__ < 0 || tld_pos < this.__index__) { + if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { + shift = ml.index + ml[1].length; + if (this.__index__ < 0 || shift < this.__index__) { + this.__schema__ = ""; + this.__index__ = shift; + this.__last_index__ = ml.index + ml[0].length; + } + } + } + } + } + if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) { + at_pos = text2.indexOf("@"); + if (at_pos >= 0) { + if ((me = text2.match(this.re.email_fuzzy)) !== null) { + shift = me.index + me[1].length; + next = me.index + me[0].length; + if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { + this.__schema__ = "mailto:"; + this.__index__ = shift; + this.__last_index__ = next; + } + } + } + } + return this.__index__ >= 0; + }; + LinkifyIt.prototype.pretest = function pretest(text2) { + return this.re.pretest.test(text2); + }; + LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema, pos) { + if (!this.__compiled__[schema.toLowerCase()]) { + return 0; + } + return this.__compiled__[schema.toLowerCase()].validate(text2, pos, this); + }; + LinkifyIt.prototype.match = function match(text2) { + var shift = 0, result = []; + if (this.__index__ >= 0 && this.__text_cache__ === text2) { + result.push(createMatch(this, shift)); + shift = this.__last_index__; + } + var tail = shift ? text2.slice(shift) : text2; + while (this.test(tail)) { + result.push(createMatch(this, shift)); + tail = tail.slice(this.__last_index__); + shift += this.__last_index__; + } + if (result.length) { + return result; + } + return null; + }; + LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) { + this.__text_cache__ = text2; + this.__index__ = -1; + if (!text2.length) + return null; + var m = this.re.schema_at_start.exec(text2); + if (!m) + return null; + var len = this.testSchemaAt(text2, m[2], m[0].length); + if (!len) + return null; + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + return createMatch(this, 0); + }; + LinkifyIt.prototype.tlds = function tlds(list, keepOld) { + list = Array.isArray(list) ? list : [list]; + if (!keepOld) { + this.__tlds__ = list.slice(); + this.__tlds_replaced__ = true; + compile(this); + return this; + } + this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) { + return el !== arr[idx - 1]; + }).reverse(); + compile(this); + return this; + }; + LinkifyIt.prototype.normalize = function normalize(match) { + if (!match.schema) { + match.url = "http://" + match.url; + } + if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) { + match.url = "mailto:" + match.url; + } + }; + LinkifyIt.prototype.onCompile = function onCompile() { + }; + module2.exports = LinkifyIt; + } +}); + +// node_modules/markdown-it/lib/presets/default.js +var require_default = __commonJS({ + "node_modules/markdown-it/lib/presets/default.js"(exports, module2) { + "use strict"; + module2.exports = { + options: { + html: false, + xhtmlOut: false, + breaks: false, + langPrefix: "language-", + linkify: false, + typographer: false, + quotes: "\u201C\u201D\u2018\u2019", + highlight: null, + maxNesting: 100 + }, + components: { + core: {}, + block: {}, + inline: {} + } + }; + } +}); + +// node_modules/markdown-it/lib/presets/zero.js +var require_zero = __commonJS({ + "node_modules/markdown-it/lib/presets/zero.js"(exports, module2) { + "use strict"; + module2.exports = { + options: { + html: false, + xhtmlOut: false, + breaks: false, + langPrefix: "language-", + linkify: false, + typographer: false, + quotes: "\u201C\u201D\u2018\u2019", + highlight: null, + maxNesting: 20 + }, + components: { + core: { + rules: [ + "normalize", + "block", + "inline", + "text_join" + ] + }, + block: { + rules: [ + "paragraph" + ] + }, + inline: { + rules: [ + "text" + ], + rules2: [ + "balance_pairs", + "fragments_join" + ] + } + } + }; + } +}); + +// node_modules/markdown-it/lib/presets/commonmark.js +var require_commonmark = __commonJS({ + "node_modules/markdown-it/lib/presets/commonmark.js"(exports, module2) { + "use strict"; + module2.exports = { + options: { + html: true, + xhtmlOut: true, + breaks: false, + langPrefix: "language-", + linkify: false, + typographer: false, + quotes: "\u201C\u201D\u2018\u2019", + highlight: null, + maxNesting: 20 + }, + components: { + core: { + rules: [ + "normalize", + "block", + "inline", + "text_join" + ] + }, + block: { + rules: [ + "blockquote", + "code", + "fence", + "heading", + "hr", + "html_block", + "lheading", + "list", + "reference", + "paragraph" + ] + }, + inline: { + rules: [ + "autolink", + "backticks", + "emphasis", + "entity", + "escape", + "html_inline", + "image", + "link", + "newline", + "text" + ], + rules2: [ + "balance_pairs", + "emphasis", + "fragments_join" + ] + } + } + }; + } +}); + +// node_modules/markdown-it/lib/index.js +var require_lib = __commonJS({ + "node_modules/markdown-it/lib/index.js"(exports, module2) { + "use strict"; + var utils2 = require_utils(); + var helpers = require_helpers(); + var Renderer = require_renderer(); + var ParserCore = require_parser_core(); + var ParserBlock = require_parser_block(); + var ParserInline = require_parser_inline(); + var LinkifyIt = require_linkify_it(); + var mdurl = require_mdurl(); + var punycode = require("punycode"); + var config = { + default: require_default(), + zero: require_zero(), + commonmark: require_commonmark() + }; + var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/; + var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; + function validateLink(url) { + var str = url.trim().toLowerCase(); + return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) ? true : false : true; + } + var RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"]; + function normalizeLink(url) { + var parsed = mdurl.parse(url, true); + if (parsed.hostname) { + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toASCII(parsed.hostname); + } catch (er) { + } + } + } + return mdurl.encode(mdurl.format(parsed)); + } + function normalizeLinkText(url) { + var parsed = mdurl.parse(url, true); + if (parsed.hostname) { + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toUnicode(parsed.hostname); + } catch (er) { + } + } + } + return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%"); + } + function MarkdownIt(presetName, options) { + if (!(this instanceof MarkdownIt)) { + return new MarkdownIt(presetName, options); + } + if (!options) { + if (!utils2.isString(presetName)) { + options = presetName || {}; + presetName = "default"; + } + } + this.inline = new ParserInline(); + this.block = new ParserBlock(); + this.core = new ParserCore(); + this.renderer = new Renderer(); + this.linkify = new LinkifyIt(); + this.validateLink = validateLink; + this.normalizeLink = normalizeLink; + this.normalizeLinkText = normalizeLinkText; + this.utils = utils2; + this.helpers = utils2.assign({}, helpers); + this.options = {}; + this.configure(presetName); + if (options) { + this.set(options); + } + } + MarkdownIt.prototype.set = function(options) { + utils2.assign(this.options, options); + return this; + }; + MarkdownIt.prototype.configure = function(presets) { + var self = this, presetName; + if (utils2.isString(presets)) { + presetName = presets; + presets = config[presetName]; + if (!presets) { + throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); + } + } + if (!presets) { + throw new Error("Wrong `markdown-it` preset, can't be empty"); + } + if (presets.options) { + self.set(presets.options); + } + if (presets.components) { + Object.keys(presets.components).forEach(function(name) { + if (presets.components[name].rules) { + self[name].ruler.enableOnly(presets.components[name].rules); + } + if (presets.components[name].rules2) { + self[name].ruler2.enableOnly(presets.components[name].rules2); + } + }); + } + return this; + }; + MarkdownIt.prototype.enable = function(list, ignoreInvalid) { + var result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ["core", "block", "inline"].forEach(function(chain) { + result = result.concat(this[chain].ruler.enable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.enable(list, true)); + var missed = list.filter(function(name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed); + } + return this; + }; + MarkdownIt.prototype.disable = function(list, ignoreInvalid) { + var result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ["core", "block", "inline"].forEach(function(chain) { + result = result.concat(this[chain].ruler.disable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.disable(list, true)); + var missed = list.filter(function(name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed); + } + return this; + }; + MarkdownIt.prototype.use = function(plugin) { + var args = [this].concat(Array.prototype.slice.call(arguments, 1)); + plugin.apply(plugin, args); + return this; + }; + MarkdownIt.prototype.parse = function(src, env) { + if (typeof src !== "string") { + throw new Error("Input data should be a String"); + } + var state = new this.core.State(src, this, env); + this.core.process(state); + return state.tokens; + }; + MarkdownIt.prototype.render = function(src, env) { + env = env || {}; + return this.renderer.render(this.parse(src, env), this.options, env); + }; + MarkdownIt.prototype.parseInline = function(src, env) { + var state = new this.core.State(src, this, env); + state.inlineMode = true; + this.core.process(state); + return state.tokens; + }; + MarkdownIt.prototype.renderInline = function(src, env) { + env = env || {}; + return this.renderer.render(this.parseInline(src, env), this.options, env); + }; + module2.exports = MarkdownIt; + } +}); + +// node_modules/markdown-it/index.js +var require_markdown_it = __commonJS({ + "node_modules/markdown-it/index.js"(exports, module2) { + "use strict"; + module2.exports = require_lib(); + } +}); + +// node_modules/minimatch/lib/path.js +var require_path = __commonJS({ + "node_modules/minimatch/lib/path.js"(exports, module2) { + var isWindows = typeof process === "object" && process && process.platform === "win32"; + module2.exports = isWindows ? { sep: "\\" } : { sep: "/" }; + } +}); + +// node_modules/balanced-match/index.js +var require_balanced_match = __commonJS({ + "node_modules/balanced-match/index.js"(exports, module2) { + "use strict"; + module2.exports = balanced; + function balanced(a, b, str) { + if (a instanceof RegExp) + a = maybeMatch(a, str); + if (b instanceof RegExp) + b = maybeMatch(b, str); + var r = range(a, b, str); + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; + } + function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; + } + balanced.range = range; + function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length) { + result = [left, right]; + } + } + return result; + } + } +}); + +// node_modules/brace-expansion/index.js +var require_brace_expansion = __commonJS({ + "node_modules/brace-expansion/index.js"(exports, module2) { + var balanced = require_balanced_match(); + module2.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str) { + return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); + } + function escapeBraces(str) { + return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str) { + return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str) { + if (!str) + return [""]; + var parts = []; + var m = balanced("{", "}", str); + if (!m) + return str.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; + } + function expandTop(str) { + if (!str) + return []; + if (str.substr(0, 2) === "{}") { + str = "\\{\\}" + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); + } + function embrace(str) { + return "{" + str + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte(i, y) { + return i >= y; + } + function expand(str, isTop) { + var expansions = []; + var m = balanced("{", "}", str); + if (!m) + return [str]; + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + "{" + m.body + "}" + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m.post.match(/,.*\}/)) { + str = m.pre + "{" + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === "\\") + c = ""; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join("0"); + if (i < 0) + c = "-" + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + return expansions; + } + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports, module2) { + var minimatch2 = module2.exports = (p, pattern, options = {}) => { + assertValidPattern(pattern); + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; + } + return new Minimatch(pattern, options).match(p); + }; + module2.exports = minimatch2; + var path = require_path(); + minimatch2.sep = path.sep; + var GLOBSTAR = Symbol("globstar **"); + minimatch2.GLOBSTAR = GLOBSTAR; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var charSet = (s) => s.split("").reduce((set, c) => { + set[c] = true; + return set; + }, {}); + var reSpecials = charSet("().*{}+?[]^$\\!"); + var addPatternStartSet = charSet("[.("); + var slashSplit = /\/+/; + minimatch2.filter = (pattern, options = {}) => (p, i, list) => minimatch2(p, pattern, options); + var ext = (a, b = {}) => { + const t = {}; + Object.keys(a).forEach((k) => t[k] = a[k]); + Object.keys(b).forEach((k) => t[k] = b[k]); + return t; + }; + minimatch2.defaults = (def) => { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch2; + } + const orig = minimatch2; + const m = (p, pattern, options) => orig(p, pattern, ext(def, options)); + m.Minimatch = class Minimatch extends orig.Minimatch { + constructor(pattern, options) { + super(pattern, ext(def, options)); + } + }; + m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch; + m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)); + m.defaults = (options) => orig.defaults(ext(def, options)); + m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)); + m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)); + m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)); + return m; + }; + minimatch2.braceExpand = (pattern, options) => braceExpand(pattern, options); + var braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + }; + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = (pattern) => { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + var SUBPARSE = Symbol("subparse"); + minimatch2.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe(); + minimatch2.match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter((f) => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + var globUnescape = (s) => s.replace(/\\(.)/g, "$1"); + var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + var Minimatch = class { + constructor(pattern, options) { + assertValidPattern(pattern); + if (!options) + options = {}; + this.options = options; + this.set = []; + this.pattern = pattern; + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, "/"); + } + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + debug() { + } + make() { + const pattern = this.pattern; + const options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + this.parseNegate(); + let set = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = (...args) => console.error(...args); + this.debug(this.pattern, set); + set = this.globParts = set.map((s) => s.split(slashSplit)); + this.debug(this.pattern, set); + set = set.map((s, si, set2) => s.map(this.parse, this)); + this.debug(this.pattern, set); + set = set.filter((s) => s.indexOf(false) === -1); + this.debug(this.pattern, set); + this.set = set; + } + parseNegate() { + if (this.options.nonegate) + return; + const pattern = this.pattern; + let negate = false; + let negateOffset = 0; + for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) + this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + matchOne(file, pattern, partial) { + var options = this.options; + this.debug("matchOne", { "this": this, file, pattern }); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p = pattern[pi]; + var f = file[fi]; + this.debug(pattern, p, f); + if (p === false) + return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) + return true; + } + return false; + } + var hit; + if (typeof p === "string") { + hit = f === p; + this.debug("string match", p, f, hit); + } else { + hit = f.match(p); + this.debug("pattern match", p, f, hit); + } + if (!hit) + return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; + } + throw new Error("wtf?"); + } + braceExpand() { + return braceExpand(this.pattern, this.options); + } + parse(pattern, isSub) { + assertValidPattern(pattern); + const options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; + } + if (pattern === "") + return ""; + let re = ""; + let hasMagic = !!options.nocase; + let escaping = false; + const patternListStack = []; + const negativeLists = []; + let stateChar; + let inClass = false; + let reClassStart = -1; + let classStart = -1; + let cs; + let pl; + let sp; + const patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + const clearStateChar = () => { + if (stateChar) { + switch (stateChar) { + case "*": + re += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; + } + this.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; + } + }; + for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) { + this.debug("%s %s %s %j", pattern, i, re, c); + if (escaping) { + if (c === "/") { + return false; + } + if (reSpecials[c]) { + re += "\\"; + } + re += c; + escaping = false; + continue; + } + switch (c) { + case "/": { + return false; + } + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c); + if (inClass) { + this.debug(" in class"); + if (c === "!" && i === classStart + 1) + c = "^"; + re += c; + continue; + } + this.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re += "("; + continue; + } + if (!stateChar) { + re += "\\("; + continue; + } + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re += "\\)"; + continue; + } + clearStateChar(); + hasMagic = true; + pl = patternListStack.pop(); + re += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); + } + pl.reEnd = re.length; + continue; + case "|": + if (inClass || !patternListStack.length) { + re += "\\|"; + continue; + } + clearStateChar(); + re += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re += "\\" + c; + continue; + } + inClass = true; + classStart = i; + reClassStart = re.length; + re += c; + continue; + case "]": + if (i === classStart + 1 || !inClass) { + re += "\\" + c; + continue; + } + cs = pattern.substring(classStart + 1, i); + try { + RegExp("[" + cs + "]"); + } catch (er) { + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + hasMagic = true; + inClass = false; + re += c; + continue; + default: + clearStateChar(); + if (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + break; + } + } + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail; + tail = re.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re, pl); + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + const t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + const addPatternStart = addPatternStartSet[re.charAt(0)]; + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n]; + const nlBefore = re.slice(0, nl.reStart); + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + let nlAfter = re.slice(nl.reEnd); + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter; + const openParensBefore = nlBefore.split("(").length - 1; + let cleanAfter = nlAfter; + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); + } + nlAfter = cleanAfter; + const dollar = nlAfter === "" && isSub !== SUBPARSE ? "$" : ""; + re = nlBefore + nlFirst + nlAfter + dollar + nlLast; + } + if (re !== "" && hasMagic) { + re = "(?=.)" + re; + } + if (addPatternStart) { + re = patternStart + re; + } + if (isSub === SUBPARSE) { + return [re, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern); + } + const flags = options.nocase ? "i" : ""; + try { + return Object.assign(new RegExp("^" + re + "$", flags), { + _glob: pattern, + _src: re + }); + } catch (er) { + return new RegExp("$."); + } + } + makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + const set = this.set; + if (!set.length) { + this.regexp = false; + return this.regexp; + } + const options = this.options; + const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + const flags = options.nocase ? "i" : ""; + let re = set.map((pattern) => { + pattern = pattern.map((p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src).reduce((set2, p) => { + if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) { + set2.push(p); + } + return set2; + }, []); + pattern.forEach((p, i) => { + if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) { + return; + } + if (i === 0) { + if (pattern.length > 1) { + pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1]; + } else { + pattern[i] = twoStar; + } + } else if (i === pattern.length - 1) { + pattern[i - 1] += "(?:\\/|" + twoStar + ")?"; + } else { + pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1]; + pattern[i + 1] = GLOBSTAR; + } + }); + return pattern.filter((p) => p !== GLOBSTAR).join("/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) + re = "^(?!" + re + ").*$"; + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp; + } + match(f, partial = this.partial) { + this.debug("match", f, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f === ""; + if (f === "/" && partial) + return true; + const options = this.options; + if (path.sep !== "/") { + f = f.split(path.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + const set = this.set; + this.debug(this.pattern, "set", set); + let filename; + for (let i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) + break; + } + for (let i = 0; i < set.length; i++) { + const pattern = set[i]; + let file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; + } + const hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; + } + } + if (options.flipNegate) + return false; + return this.negate; + } + static defaults(def) { + return minimatch2.defaults(def).Minimatch; + } + }; + minimatch2.Minimatch = Minimatch; + } +}); + +// src/main.ts +var main_exports = {}; +__export(main_exports, { + default: () => TodoPlugin +}); +module.exports = __toCommonJS(main_exports); +var import_obsidian5 = require("obsidian"); + +// src/constants.ts +var TODO_VIEW_TYPE = "todo"; +var LOCAL_SORT_OPT = { + numeric: true, + ignorePunctuation: true +}; + +// src/settings.ts +var import_obsidian = require("obsidian"); +var DEFAULT_SETTINGS = { + todoPageName: "todo", + showChecked: false, + showAllTodos: false, + showOnlyActiveFile: false, + autoRefresh: true, + subGroups: false, + groupBy: "page", + sortDirectionItems: "new->old", + sortDirectionGroups: "new->old", + sortDirectionSubGroups: "new->old", + includeFiles: "", + lookAndFeel: "classic", + _collapsedSections: [], + _hiddenTags: [] +}; +var TodoSettingTab = class extends import_obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + this.containerEl.empty(); + this.containerEl.createEl("h3", { + text: "General Settings" + }); + this.buildSettings(); + } + buildSettings() { + new import_obsidian.Setting(this.containerEl).setName("General"); + new import_obsidian.Setting(this.containerEl).setName("Tag name").setDesc('e.g. "todo" will match #todo. You may add mutliple tags separated by a newline. Leave empty to capture all').addTextArea((text2) => text2.setPlaceholder("todo").setValue(this.plugin.getSettingValue("todoPageName")).onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ + todoPageName: value + }); + }))); + new import_obsidian.Setting(this.containerEl).setName("Show Completed?").addToggle((toggle) => { + toggle.setValue(this.plugin.getSettingValue("showChecked")); + toggle.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ showChecked: value }); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("Show All Todos In File?").setDesc("Show all items in file if tag is present, or only items attached to the block where the tag is located. Only has an effect if Tag Name is not empty").addToggle((toggle) => { + toggle.setValue(this.plugin.getSettingValue("showAllTodos")); + toggle.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ showAllTodos: value }); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("Show only in currently active file?").setDesc("Show only todos present in currently active file?").addToggle((toggle) => { + toggle.setValue(this.plugin.getSettingValue("showOnlyActiveFile")); + toggle.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ showOnlyActiveFile: value }); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("Grouping & Sorting"); + new import_obsidian.Setting(this.containerEl).setName("Group By").addDropdown((dropdown) => { + dropdown.addOption("page", "Page"); + dropdown.addOption("tag", "Tag"); + dropdown.setValue(this.plugin.getSettingValue("groupBy")); + dropdown.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ groupBy: value }); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("Item Sort").addDropdown((dropdown) => { + dropdown.addOption("a->z", "A -> Z"); + dropdown.addOption("z->a", "Z -> A"); + dropdown.addOption("new->old", "New -> Old"); + dropdown.addOption("old->new", "Old -> New"); + dropdown.setValue(this.plugin.getSettingValue("sortDirectionItems")); + dropdown.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ + sortDirectionItems: value + }); + })); + }).setDesc("Time sorts are based on last time the file for a particular item was edited"); + new import_obsidian.Setting(this.containerEl).setName("Group Sort").addDropdown((dropdown) => { + dropdown.addOption("a->z", "A -> Z"); + dropdown.addOption("z->a", "Z -> A"); + dropdown.addOption("new->old", "New -> Old"); + dropdown.addOption("old->new", "Old -> New"); + dropdown.setValue(this.plugin.getSettingValue("sortDirectionGroups")); + dropdown.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ + sortDirectionGroups: value + }); + })); + }).setDesc("Time sorts are based on last time the file for the newest or oldest item in a group was edited"); + new import_obsidian.Setting(this.containerEl).setName("Styling"); + new import_obsidian.Setting(this.containerEl).setName("Look and Feel").addDropdown((dropdown) => { + dropdown.addOption("classic", "Classic"); + dropdown.addOption("compact", "Compact"); + dropdown.setValue(this.plugin.getSettingValue("lookAndFeel")); + dropdown.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ lookAndFeel: value }); + })); + }); + new import_obsidian.Setting(this.containerEl).setName("Advanced"); + new import_obsidian.Setting(this.containerEl).setName("Include Files").setDesc("Include all files that match this glob pattern. Examples on plugin page/github readme. Leave empty to check all files.").setTooltip("**/*").addText((text2) => text2.setValue(this.plugin.getSettingValue("includeFiles")).onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ + includeFiles: value + }); + }))); + new import_obsidian.Setting(this.containerEl).setName("Auto Refresh List?").addToggle((toggle) => { + toggle.setValue(this.plugin.getSettingValue("autoRefresh")); + toggle.onChange((value) => __async(this, null, function* () { + yield this.plugin.updateSettings({ autoRefresh: value }); + })); + }).setDesc(`It's recommended to leave this on unless you are expereince performance issues due to a large vault. You can then reload manually using the "Checklist: refresh" command`); + } +}; + +// src/view.ts +var import_obsidian4 = require("obsidian"); + +// node_modules/svelte/internal/index.mjs +function noop() { +} +function run(fn) { + return fn(); +} +function blank_object() { + return /* @__PURE__ */ 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 null_to_empty(value) { + return value == null ? "" : value; +} +function action_destroyer(action_result) { + return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; +} +var is_hydrating = false; +function start_hydrating() { + is_hydrating = true; +} +function end_hydrating() { + is_hydrating = false; +} +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); +} +function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); +} +function detach(node) { + 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 svg_element(name) { + return document.createElementNS("http://www.w3.org/2000/svg", name); +} +function text(data) { + return document.createTextNode(data); +} +function space() { + return text(" "); +} +function empty() { + return text(""); +} +function listen(node, event, handler, options) { + node.addEventListener(event, handler, options); + return () => node.removeEventListener(event, handler, options); +} +function prevent_default(fn) { + return function(event) { + event.preventDefault(); + return fn.call(this, event); + }; +} +function attr(node, attribute, value) { + if (value == null) + node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) + node.setAttribute(attribute, value); +} +function children(element2) { + return Array.from(element2.childNodes); +} +function set_data(text2, data) { + data = "" + data; + if (text2.wholeText !== data) + text2.data = data; +} +function set_input_value(input, value) { + input.value = value == null ? "" : value; +} +function toggle_class(element2, name, toggle) { + element2.classList[toggle ? "add" : "remove"](name); +} +function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { + const e = document.createEvent("CustomEvent"); + e.initCustomEvent(type, bubbles, cancelable, detail); + return e; +} +var 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; +} +function createEventDispatcher() { + const component = get_current_component(); + return (type, detail, { cancelable = false } = {}) => { + const callbacks = component.$$.callbacks[type]; + if (callbacks) { + const event = custom_event(type, detail, { cancelable }); + callbacks.slice().forEach((fn) => { + fn.call(component, event); + }); + return !event.defaultPrevented; + } + return true; + }; +} +var dirty_components = []; +var binding_callbacks = []; +var render_callbacks = []; +var flush_callbacks = []; +var resolved_promise = Promise.resolve(); +var 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); +} +var seen_callbacks = /* @__PURE__ */ new Set(); +var flushidx = 0; +function flush() { + const saved_component = current_component; + do { + while (flushidx < dirty_components.length) { + const component = dirty_components[flushidx]; + flushidx++; + set_current_component(component); + update(component.$$); + } + set_current_component(null); + dirty_components.length = 0; + flushidx = 0; + while (binding_callbacks.length) + binding_callbacks.pop()(); + for (let i = 0; i < render_callbacks.length; i += 1) { + const callback = render_callbacks[i]; + if (!seen_callbacks.has(callback)) { + 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); + } +} +var outroing = /* @__PURE__ */ new Set(); +var outros; +function group_outros() { + outros = { + r: 0, + c: [], + p: outros + }; +} +function check_outros() { + if (!outros.r) { + run_all(outros.c); + } + outros = outros.p; +} +function transition_in(block, local) { + if (block && block.i) { + outroing.delete(block); + block.i(local); + } +} +function transition_out(block, local, detach2, callback) { + if (block && block.o) { + if (outroing.has(block)) + return; + outroing.add(block); + outros.c.push(() => { + outroing.delete(block); + if (callback) { + if (detach2) + block.d(1); + callback(); + } + }); + block.o(local); + } else if (callback) { + callback(); + } +} +var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global; +function create_component(block) { + block && block.c(); +} +function mount_component(component, target, anchor, customElement) { + const { fragment, on_mount, on_destroy, after_update } = component.$$; + fragment && fragment.m(target, anchor); + if (!customElement) { + add_render_callback(() => { + const new_on_destroy = on_mount.map(run).filter(is_function); + if (on_destroy) { + on_destroy.push(...new_on_destroy); + } else { + 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); + $$.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, instance7, create_fragment7, not_equal, props, append_styles2, dirty = [-1]) { + const parent_component = current_component; + set_current_component(component); + const $$ = component.$$ = { + fragment: null, + ctx: null, + props, + update: noop, + not_equal, + bound: blank_object(), + on_mount: [], + on_destroy: [], + on_disconnect: [], + before_update: [], + after_update: [], + context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), + callbacks: blank_object(), + dirty, + skip_bound: false, + root: options.target || parent_component.$$.root + }; + append_styles2 && append_styles2($$.root); + let ready = false; + $$.ctx = instance7 ? instance7(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); + $$.fragment = create_fragment7 ? create_fragment7($$.ctx) : false; + if (options.target) { + if (options.hydrate) { + start_hydrating(); + const nodes = children(options.target); + $$.fragment && $$.fragment.l(nodes); + nodes.forEach(detach); + } else { + $$.fragment && $$.fragment.c(); + } + if (options.intro) + transition_in(component.$$.fragment); + mount_component(component, options.target, options.anchor, options.customElement); + end_hydrating(); + flush(); + } + set_current_component(parent_component); +} +var SvelteElement; +if (typeof HTMLElement === "function") { + SvelteElement = class extends HTMLElement { + constructor() { + super(); + this.attachShadow({ mode: "open" }); + } + connectedCallback() { + const { on_mount } = this.$$; + this.$$.on_disconnect = on_mount.map(run).filter(is_function); + for (const key in this.$$.slotted) { + this.appendChild(this.$$.slotted[key]); + } + } + attributeChangedCallback(attr2, _oldValue, newValue) { + this[attr2] = newValue; + } + disconnectedCallback() { + run_all(this.$$.on_disconnect); + } + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + $on(type, callback) { + 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 SvelteComponent = class { + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + $on(type, callback) { + 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; + } + } +}; + +// src/utils/files.ts +var import_obsidian3 = require("obsidian"); + +// src/utils/helpers.ts +var import_obsidian2 = require("obsidian"); +var classifyString = (str) => { + const sanitzedGroupName = (str != null ? str : "").replace(/[^A-Za-z0-9]/g, ""); + const dasherizedGroupName = sanitzedGroupName.replace(/^([A-Z])|[\s\._](\w)/g, function(_, p1, p2) { + if (p2) + return "-" + p2.toLowerCase(); + return p1.toLowerCase(); + }); + return dasherizedGroupName; +}; +var removeTagFromText = (text2, tag) => { + if (!text2) + return ""; + if (!tag) + return text2.trim(); + return text2.replace(new RegExp(`\\s?\\#${tag}[^\\s]*`, "g"), "").trim(); +}; +var getTagMeta = (tag) => { + const tagMatch = /^\#([^\/]+)\/?(.*)?$/.exec(tag); + if (!tagMatch) + return { main: null, sub: null }; + const [full, main, sub] = tagMatch; + return { main, sub }; +}; +var retrieveTag = (tagMeta) => { + return tagMeta.main ? tagMeta.main : tagMeta.sub ? tagMeta.sub : ""; +}; +var mapLinkMeta = (linkMeta) => { + const map = /* @__PURE__ */ new Map(); + for (const link of linkMeta) + map.set(link.filePath, link); + return map; +}; +var setLineTo = (line, setTo) => line.replace(/^((\s|\>)*([\-\*]|[0-9]+\.)\s\[)([^\]]+)(\].*$)/, `$1${setTo ? "x" : " "}$5`); +var getAllLinesFromFile = (cache) => cache.split(/\r?\n/); +var combineFileLines = (lines) => lines.join("\n"); +var lineIsValidTodo = (line) => { + return /^(\s|\>)*([\-\*]|[0-9]+\.)\s\[(.{1})\]\s{1,4}\S+/.test(line); +}; +var extractTextFromTodoLine = (line) => { + var _a; + return (_a = /^(\s|\>)*([\-\*]|[0-9]+\.)\s\[(.{1})\]\s{1,4}(\S{1}.*)$/.exec(line)) == null ? void 0 : _a[4]; +}; +var getIndentationSpacesFromTodoLine = (line) => { + var _a, _b, _c; + return (_c = (_b = (_a = /^(\s*)([\-\*]|[0-9]+\.)\s\[(.{1})\]\s{1,4}(\S+)/.exec(line)) == null ? void 0 : _a[1]) == null ? void 0 : _b.length) != null ? _c : 0; +}; +var todoLineIsChecked = (line) => /^(\s|\>)*([\-\*]|[0-9]+\.)\s\[(\S{1})\]/.test(line); +var getFileLabelFromName = (filename) => { + var _a; + return (_a = /^(.+)\.md$/.exec(filename)) == null ? void 0 : _a[1]; +}; +var sortGenericItemsInplace = (items, direction, sortByNameKey, sortByTimeKey) => { + if (direction === "a->z") + items.sort((a, b) => a[sortByNameKey].localeCompare(b[sortByNameKey], navigator.language, LOCAL_SORT_OPT)); + if (direction === "z->a") + items.sort((a, b) => b[sortByNameKey].localeCompare(a[sortByNameKey], navigator.language, LOCAL_SORT_OPT)); + if (direction === "new->old") + items.sort((a, b) => b[sortByTimeKey] - a[sortByTimeKey]); + if (direction === "old->new") + items.sort((a, b) => a[sortByTimeKey] - b[sortByTimeKey]); +}; +var ensureMdExtension = (path) => { + if (!/\.md$/.test(path)) + return `${path}.md`; + return path; +}; +var getFrontmatterTags = (cache, todoTags = []) => { + var _a; + const frontMatterTags = (_a = (0, import_obsidian2.parseFrontMatterTags)(cache == null ? void 0 : cache.frontmatter)) != null ? _a : []; + if (todoTags.length > 0) + return frontMatterTags.filter((tag) => todoTags.includes(getTagMeta(tag).main)); + return frontMatterTags; +}; +var getAllTagsFromMetadata = (cache) => { + var _a; + if (!cache) + return []; + const frontmatterTags = getFrontmatterTags(cache); + const blockTags = ((_a = cache.tags) != null ? _a : []).map((e) => e.tag); + return [...frontmatterTags, ...blockTags]; +}; +var getFileFromPath = (vault, path) => { + let file = vault.getAbstractFileByPath(path); + if (file instanceof import_obsidian2.TFile) + return file; + const files = vault.getMarkdownFiles(); + file = files.find((e) => e.name === path); + if (file instanceof import_obsidian2.TFile) + return file; +}; + +// src/utils/files.ts +var navToFile = (app, path, ev, line) => __async(void 0, null, function* () { + path = ensureMdExtension(path); + const file = getFileFromPath(app.vault, path); + if (!file) + return; + const mod = import_obsidian3.Keymap.isModEvent(ev); + const leaf = app.workspace.getLeaf(mod); + yield leaf.openFile(file); + if (line) { + app.workspace.getActiveViewOfType(import_obsidian3.MarkdownView).editor.setCursor(line); + } +}); + +// src/utils/groups.ts +var groupTodos = (items, groupBy, sortGroups, sortItems, subGroups, subGroupSort) => { + var _a, _b, _c; + const groups = []; + for (const item of items) { + const itemKey = groupBy === "page" ? item.filePath : `#${[item.mainTag, item.subTag].filter((e) => e != null).join("/")}`; + let group = groups.find((g) => g.id === itemKey); + if (!group) { + const newGroup = { + id: itemKey, + sortName: "", + className: "", + type: groupBy, + todos: [], + oldestItem: Infinity, + newestItem: 0 + }; + if (newGroup.type === "page") { + newGroup.pageName = item.fileLabel; + newGroup.sortName = item.fileLabel; + newGroup.className = classifyString(item.fileLabel); + } else if (newGroup.type === "tag") { + newGroup.mainTag = item.mainTag; + newGroup.subTags = item.subTag; + newGroup.sortName = item.mainTag + ((_a = item.subTag) != null ? _a : "0"); + newGroup.className = classifyString(((_b = newGroup.mainTag) != null ? _b : "") + ((_c = newGroup.subTags) != null ? _c : "")); + } + groups.push(newGroup); + group = newGroup; + } + if (group.newestItem < item.fileCreatedTs) + group.newestItem = item.fileCreatedTs; + if (group.oldestItem > item.fileCreatedTs) + group.oldestItem = item.fileCreatedTs; + group.todos.push(item); + } + const nonEmptyGroups = groups.filter((g) => g.todos.length > 0); + sortGenericItemsInplace(nonEmptyGroups, sortGroups, "sortName", sortGroups === "new->old" ? "newestItem" : "oldestItem"); + if (!subGroups) + for (const g of groups) + sortGenericItemsInplace(g.todos, sortItems, "originalText", "fileCreatedTs"); + else + for (const g of nonEmptyGroups) + g.groups = groupTodos(g.todos, groupBy === "page" ? "tag" : "page", subGroupSort, sortItems, false, null); + return nonEmptyGroups; +}; + +// src/utils/tasks.ts +var import_markdown_it = __toESM(require_markdown_it()); +var import_minimatch = __toESM(require_minimatch()); + +// src/plugins/plugin-helper.ts +var escape = (html) => String(html).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">"); +var utils = { + escape +}; +var counter = 0; +var regexPlugin = (regexp, replacer) => { + const flags = (regexp.global ? "g" : "") + (regexp.multiline ? "m" : "") + (regexp.ignoreCase ? "i" : ""); + const _regexp = RegExp("^" + regexp.source, flags); + const id = "regexp-" + counter++; + return (md) => { + md.inline.ruler.push(id, (state, silent) => { + var match = _regexp.exec(state.src.slice(state.pos)); + if (!match) + return false; + state.pos += match[0].length; + if (silent) + return true; + var token = state.push(id, "", 0); + token.meta = { match }; + return true; + }); + md.renderer.rules[id] = (tokens, idx) => { + return replacer(tokens[idx].meta.match, utils); + }; + }; +}; + +// src/plugins/comment.ts +var commentPlugin = regexPlugin(/\%\%([^\%]+)\%\%/, (match, utils2) => { + return ``; +}); + +// src/plugins/highlight.ts +var highlightPlugin = regexPlugin(/\=\=([^\=]+)\=\=/, (match, utils2) => { + return `${utils2.escape(match[1])}`; +}); + +// src/plugins/link.ts +var linkPlugin = (linkMap) => regexPlugin(/\[\[([^\]]+)\]\]/, (match, utils2) => { + const content = match[1]; + const [link, label] = content.trim().split("|"); + const linkItem = linkMap.get(link); + let displayText = label ? label : linkItem ? linkItem.linkName : link; + if (label) { + displayText = label; + } else if (linkItem) { + displayText = linkItem.linkName; + } else { + displayText = link; + } + if (!linkItem) + return `[[${content}]]`; + return `${utils2.escape(displayText)}`; +}); + +// src/plugins/tag.ts +var tagPlugin = regexPlugin(/\#\S+/, (match, utils2) => { + const content = match[0]; + return `${utils2.escape(content)}`; +}); + +// src/utils/tasks.ts +var parseTodos = (files, todoTags, cache, vault, includeFiles, showChecked, showAllTodos, lastRerender) => __async(void 0, null, function* () { + const includePattern = includeFiles.trim() ? includeFiles.trim().split("\n") : ["**/*"]; + const filesWithCache = yield Promise.all(files.filter((file) => { + if (file.stat.mtime < lastRerender) + return false; + if (!includePattern.some((p) => (0, import_minimatch.default)(file.path, p))) + return false; + if (todoTags.length === 1 && todoTags[0] === "*") + return true; + const fileCache = cache.getFileCache(file); + const allTags = getAllTagsFromMetadata(fileCache); + const tagsOnPage = allTags.filter((tag) => todoTags.includes(retrieveTag(getTagMeta(tag)).toLowerCase())); + return tagsOnPage.length > 0; + }).map((file) => __async(void 0, null, function* () { + var _a, _b; + const fileCache = cache.getFileCache(file); + const tagsOnPage = (_b = (_a = fileCache == null ? void 0 : fileCache.tags) == null ? void 0 : _a.filter((e) => todoTags.includes(retrieveTag(getTagMeta(e.tag)).toLowerCase()))) != null ? _b : []; + const frontMatterTags = getFrontmatterTags(fileCache, todoTags); + const hasFrontMatterTag = frontMatterTags.length > 0; + const parseEntireFile = todoTags[0] === "*" || hasFrontMatterTag || showAllTodos; + const content = yield vault.cachedRead(file); + return { + content, + cache: fileCache, + validTags: tagsOnPage.map((e) => __spreadProps(__spreadValues({}, e), { + tag: e.tag.toLowerCase() + })), + file, + parseEntireFile, + frontmatterTag: todoTags.length ? frontMatterTags[0] : void 0 + }; + }))); + const todosForUpdatedFiles = /* @__PURE__ */ new Map(); + for (const fileInfo of filesWithCache) { + let todos = findAllTodosInFile(fileInfo); + if (!showChecked) { + todos = todos.filter((todo) => !todo.checked); + } + todosForUpdatedFiles.set(fileInfo.file, todos); + } + return todosForUpdatedFiles; +}); +var toggleTodoItem = (item, app) => __async(void 0, null, function* () { + const file = getFileFromPath(app.vault, item.filePath); + if (!file) + return; + const currentFileContents = yield app.vault.read(file); + const currentFileLines = getAllLinesFromFile(currentFileContents); + if (!currentFileLines[item.line].includes(item.originalText)) + return; + const newData = setTodoStatusAtLineTo(currentFileLines, item.line, !item.checked); + app.vault.modify(file, newData); + item.checked = !item.checked; +}); +var findAllTodosInFile = (file) => { + var _a, _b; + if (!file.parseEntireFile) + return file.validTags.flatMap((tag) => findAllTodosFromTagBlock(file, tag)); + if (!file.content) + return []; + const fileLines = getAllLinesFromFile(file.content); + const links = []; + if ((_a = file.cache) == null ? void 0 : _a.links) { + links.push(...file.cache.links); + } + if ((_b = file.cache) == null ? void 0 : _b.embeds) { + links.push(...file.cache.embeds); + } + const tagMeta = file.frontmatterTag ? getTagMeta(file.frontmatterTag) : void 0; + const todos = []; + for (let i = 0; i < fileLines.length; i++) { + const line = fileLines[i]; + if (line.length === 0) + continue; + if (lineIsValidTodo(line)) { + todos.push(formTodo(line, file, links, i, tagMeta)); + } + } + return todos; +}; +var findAllTodosFromTagBlock = (file, tag) => { + var _a, _b; + const fileContents = file.content; + const links = []; + if ((_a = file.cache) == null ? void 0 : _a.links) { + links.push(...file.cache.links); + } + if ((_b = file.cache) == null ? void 0 : _b.embeds) { + links.push(...file.cache.embeds); + } + if (!fileContents) + return []; + const fileLines = getAllLinesFromFile(fileContents); + const tagMeta = getTagMeta(tag.tag); + const tagLine = fileLines[tag.position.start.line]; + if (lineIsValidTodo(tagLine)) { + return [formTodo(tagLine, file, links, tag.position.start.line, tagMeta)]; + } + const todos = []; + for (let i = tag.position.start.line; i < fileLines.length; i++) { + const line = fileLines[i]; + if (i === tag.position.start.line + 1 && line.length === 0) + continue; + if (line.length === 0) + break; + if (lineIsValidTodo(line)) { + todos.push(formTodo(line, file, links, i, tagMeta)); + } + } + return todos; +}; +var formTodo = (line, file, links, lineNum, tagMeta) => { + const relevantLinks = links.filter((link) => link.position.start.line === lineNum).map((link) => ({ filePath: link.link, linkName: link.displayText })); + const linkMap = mapLinkMeta(relevantLinks); + const rawText = extractTextFromTodoLine(line); + const spacesIndented = getIndentationSpacesFromTodoLine(line); + const tagStripped = removeTagFromText(rawText, tagMeta == null ? void 0 : tagMeta.main); + const md = new import_markdown_it.default().use(commentPlugin).use(linkPlugin(linkMap)).use(tagPlugin).use(highlightPlugin); + return { + mainTag: tagMeta == null ? void 0 : tagMeta.main, + subTag: tagMeta == null ? void 0 : tagMeta.sub, + checked: todoLineIsChecked(line), + filePath: file.file.path, + fileName: file.file.name, + fileLabel: getFileLabelFromName(file.file.name), + fileCreatedTs: file.file.stat.ctime, + rawHTML: md.render(tagStripped), + line: lineNum, + spacesIndented, + fileInfo: file, + originalText: rawText + }; +}; +var setTodoStatusAtLineTo = (fileLines, line, setTo) => { + fileLines[line] = setLineTo(fileLines[line], setTo); + return combineFileLines(fileLines); +}; + +// src/svelte/CheckCircle.svelte +function add_css(target) { + append_styles(target, "svelte-1wagsqu", ".checkbox.svelte-1wagsqu{width:var(--checklist-checkboxSize);height:var(--checklist-checkboxSize);min-width:var(--checklist-checkboxSize);min-height:var(--checklist-checkboxSize);border-radius:50%;border:var(--checklist-checkboxBorder);padding:2px;position:relative}.checked.svelte-1wagsqu{background-color:var(--text-muted);width:var(--checklist-checkboxCheckedSize);height:var(--checklist-checkboxCheckedSize);border-radius:50%;position:absolute;top:calc(calc(var(--checklist-checkboxSize) - var(--checklist-checkboxCheckedSize)) / 4);left:calc(calc(var(--checklist-checkboxSize) - var(--checklist-checkboxCheckedSize)) / 4)}"); +} +function create_fragment(ctx) { + let div1; + let div0; + return { + c() { + div1 = element("div"); + div0 = element("div"); + attr(div0, "class", "svelte-1wagsqu"); + toggle_class(div0, "checked", ctx[0]); + attr(div1, "class", "checkbox svelte-1wagsqu"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, div0); + }, + p(ctx2, [dirty]) { + if (dirty & 1) { + toggle_class(div0, "checked", ctx2[0]); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) + detach(div1); + } + }; +} +function instance($$self, $$props, $$invalidate) { + let { checked = false } = $$props; + $$self.$$set = ($$props2) => { + if ("checked" in $$props2) + $$invalidate(0, checked = $$props2.checked); + }; + return [checked]; +} +var CheckCircle = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance, create_fragment, safe_not_equal, { checked: 0 }, add_css); + } +}; +var CheckCircle_default = CheckCircle; + +// src/svelte/ChecklistItem.svelte +function add_css2(target) { + append_styles(target, "svelte-sx5ktw", "li.svelte-sx5ktw.svelte-sx5ktw{display:flex;align-items:center;background-color:var(--checklist-listItemBackground);border-radius:var(--checklist-listItemBorderRadius);margin:var(--checklist-listItemMargin);cursor:pointer;transition:background-color 100ms ease-in-out}li.svelte-sx5ktw.svelte-sx5ktw:hover{background-color:var(--checklist-listItemBackground--hover)}.toggle.svelte-sx5ktw.svelte-sx5ktw{padding:var(--checklist-togglePadding);background:transparent;box-shadow:var(--checklist-listItemBoxShadow);flex-shrink:1;width:initial}.content.svelte-sx5ktw.svelte-sx5ktw{padding:var(--checklist-contentPadding);flex:1;font-size:var(--checklist-contentFontSize)}.compact.svelte-sx5ktw.svelte-sx5ktw{bottom:var(--checklist-listItemMargin--compact)}.compact.svelte-sx5ktw>.content.svelte-sx5ktw{padding:var(--checklist-contentPadding--compact)}.compact.svelte-sx5ktw>.toggle.svelte-sx5ktw{padding:var(--checklist-togglePadding--compact)}.toggle.svelte-sx5ktw.svelte-sx5ktw:hover{opacity:0.8}"); +} +function create_fragment2(ctx) { + let li; + let button; + let checkcircle; + let t; + let div; + let li_class_value; + let current; + let mounted; + let dispose; + checkcircle = new CheckCircle_default({ + props: { checked: ctx[0].checked } + }); + return { + c() { + li = element("li"); + button = element("button"); + create_component(checkcircle.$$.fragment); + t = space(); + div = element("div"); + attr(button, "class", "toggle svelte-sx5ktw"); + attr(div, "class", "content svelte-sx5ktw"); + attr(li, "class", li_class_value = null_to_empty(`${ctx[1]}`) + " svelte-sx5ktw"); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, button); + mount_component(checkcircle, button, null); + append(li, t); + append(li, div); + ctx[7](div); + current = true; + if (!mounted) { + dispose = [ + listen(button, "click", ctx[6]), + listen(div, "click", ctx[8]) + ]; + mounted = true; + } + }, + p(ctx2, [dirty]) { + const checkcircle_changes = {}; + if (dirty & 1) + checkcircle_changes.checked = ctx2[0].checked; + checkcircle.$set(checkcircle_changes); + if (!current || dirty & 2 && li_class_value !== (li_class_value = null_to_empty(`${ctx2[1]}`) + " svelte-sx5ktw")) { + attr(li, "class", li_class_value); + } + }, + i(local) { + if (current) + return; + transition_in(checkcircle.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(checkcircle.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) + detach(li); + destroy_component(checkcircle); + ctx[7](null); + mounted = false; + run_all(dispose); + } + }; +} +function instance2($$self, $$props, $$invalidate) { + let { item } = $$props; + let { lookAndFeel } = $$props; + let { app } = $$props; + let contentDiv; + const toggleItem = (item2) => __async(this, null, function* () { + toggleTodoItem(item2, app); + }); + const handleClick = (ev, item2) => { + const target = ev.target; + if (target.tagName === "A") { + ev.stopPropagation(); + if (target.dataset.type === "link") { + navToFile(app, target.dataset.filepath, ev, item2 === null || item2 === void 0 ? void 0 : item2.line); + } else if (target.dataset.type === "tag") { + } + } else { + navToFile(app, item2.filePath, ev, item2 === null || item2 === void 0 ? void 0 : item2.line); + } + }; + const click_handler = (ev) => { + toggleItem(item); + ev.stopPropagation(); + }; + function div_binding($$value) { + binding_callbacks[$$value ? "unshift" : "push"](() => { + contentDiv = $$value; + $$invalidate(2, contentDiv), $$invalidate(0, item); + }); + } + const click_handler_1 = (ev) => handleClick(ev, item); + $$self.$$set = ($$props2) => { + if ("item" in $$props2) + $$invalidate(0, item = $$props2.item); + if ("lookAndFeel" in $$props2) + $$invalidate(1, lookAndFeel = $$props2.lookAndFeel); + if ("app" in $$props2) + $$invalidate(5, app = $$props2.app); + }; + $$self.$$.update = () => { + if ($$self.$$.dirty & 5) { + $: { + if (contentDiv) + $$invalidate(2, contentDiv.innerHTML = item.rawHTML, contentDiv); + } + } + }; + return [ + item, + lookAndFeel, + contentDiv, + toggleItem, + handleClick, + app, + click_handler, + div_binding, + click_handler_1 + ]; +} +var ChecklistItem = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance2, create_fragment2, safe_not_equal, { item: 0, lookAndFeel: 1, app: 5 }, add_css2); + } +}; +var ChecklistItem_default = ChecklistItem; + +// src/svelte/Icon.svelte +function add_css3(target) { + append_styles(target, "svelte-9fjno5", ".svg.svelte-9fjno5{width:var(--checklist-iconSize);height:var(--checklist-iconSize);transition:transform 150ms ease;cursor:pointer}.up.svelte-9fjno5{transform:rotate(180deg)}.down.svelte-9fjno5{transform:rotate(0deg)}.left.svelte-9fjno5{transform:rotate(90deg)}.right.svelte-9fjno5{transform:rotate(270deg)}.button.svelte-9fjno5{fill:var(--checklist-iconFill--accent);transition:fill 150ms ease}.button.svelte-9fjno5:hover{fill:var(--checklist-textColor)}.static.svelte-9fjno5{fill:var(--checklist-iconFill)}"); +} +function create_if_block_1(ctx) { + let svg; + let path; + let svg_class_value; + let mounted; + let dispose; + return { + c() { + svg = svg_element("svg"); + path = svg_element("path"); + attr(path, "d", "M44.4,4c-1,0-1.8,0.7-2,1.7l-1.9,11.9c-2.3,0.7-4.6,1.6-6.7,2.7l-9.8-7c-0.8-0.6-1.9-0.5-2.6,0.2l-7.8,7.8 c-0.7,0.7-0.8,1.8-0.2,2.6l6.9,9.9c-1.2,2.1-2.1,4.4-2.8,6.7l-11.9,2c-1,0.2-1.7,1-1.7,2v11c0,1,0.7,1.8,1.6,2l11.9,2.1 c0.7,2.4,1.6,4.6,2.8,6.7l-7,9.8c-0.6,0.8-0.5,1.9,0.2,2.6l7.8,7.8c0.7,0.7,1.8,0.8,2.6,0.2l9.9-6.9c2.1,1.2,4.3,2.1,6.7,2.8 l2,11.9c0.2,1,1,1.7,2,1.7h11c1,0,1.8-0.7,2-1.7l2.1-12c2.3-0.7,4.6-1.6,6.7-2.8l10,7c0.8,0.6,1.9,0.5,2.6-0.2l7.8-7.8 c0.7-0.7,0.8-1.8,0.2-2.6l-7.1-9.9c1.1-2.1,2.1-4.3,2.7-6.6l12-2.1c1-0.2,1.7-1,1.7-2v-11c0-1-0.7-1.8-1.7-2l-12-2 c-0.7-2.3-1.6-4.5-2.7-6.6l7-10c0.6-0.8,0.5-1.9-0.2-2.6l-7.8-7.8c-0.7-0.7-1.8-0.8-2.6-0.2l-9.8,7.1c-2.1-1.2-4.3-2.1-6.7-2.8 l-2.1-12c-0.2-1-1-1.7-2-1.7L44.4,4z M46.1,8h7.6l2,11.4c0.1,0.8,0.7,1.4,1.5,1.6c2.9,0.7,5.7,1.9,8.2,3.4 c0.7,0.4,1.6,0.4,2.2-0.1l9.4-6.7l5.4,5.4l-6.7,9.5c-0.5,0.6-0.5,1.5-0.1,2.2c1.5,2.5,2.6,5.2,3.4,8.1c0.2,0.8,0.8,1.4,1.6,1.5 L92,46.1v7.6l-11.4,2c-0.8,0.1-1.4,0.7-1.6,1.5c-0.7,2.9-1.9,5.6-3.4,8.1c-0.4,0.7-0.4,1.6,0.1,2.2l6.8,9.4l-5.4,5.4l-9.5-6.7 c-0.7-0.5-1.5-0.5-2.2-0.1c-2.5,1.5-5.2,2.7-8.2,3.4c-0.8,0.2-1.3,0.8-1.5,1.6l-2,11.4h-7.6l-1.9-11.3c-0.1-0.8-0.7-1.4-1.5-1.6 c-2.9-0.7-5.7-1.9-8.2-3.4c-0.7-0.4-1.5-0.4-2.2,0.1l-9.4,6.6l-5.4-5.4l6.6-9.3c0.5-0.7,0.5-1.5,0.1-2.2c-1.5-2.5-2.7-5.3-3.4-8.2 c-0.2-0.8-0.8-1.3-1.6-1.5L8,53.7v-7.6l11.3-1.9c0.8-0.1,1.4-0.7,1.6-1.5c0.7-2.9,1.9-5.7,3.4-8.2c0.4-0.7,0.4-1.5-0.1-2.2 l-6.6-9.4l5.4-5.4l9.3,6.7c0.6,0.5,1.5,0.5,2.2,0.1c2.5-1.5,5.3-2.7,8.2-3.4c0.8-0.2,1.4-0.8,1.5-1.6L46.1,8z M50,34 c-8.8,0-16,7.2-16,16s7.2,16,16,16s16-7.2,16-16S58.8,34,50,34z M50,38c6.7,0,12,5.3,12,12s-5.3,12-12,12s-12-5.3-12-12 S43.3,38,50,38z"); + attr(svg, "viewBox", "0 0 100 100"); + attr(svg, "width", "18"); + attr(svg, "height", "18"); + attr(svg, "class", svg_class_value = null_to_empty(`svg settings ${ctx[2]}`) + " svelte-9fjno5"); + }, + m(target, anchor) { + insert(target, svg, anchor); + append(svg, path); + if (!mounted) { + dispose = listen(svg, "click", ctx[3]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty & 4 && svg_class_value !== (svg_class_value = null_to_empty(`svg settings ${ctx2[2]}`) + " svelte-9fjno5")) { + attr(svg, "class", svg_class_value); + } + }, + d(detaching) { + if (detaching) + detach(svg); + mounted = false; + dispose(); + } + }; +} +function create_if_block(ctx) { + let svg; + let path; + let svg_class_value; + let mounted; + let dispose; + return { + c() { + svg = svg_element("svg"); + path = svg_element("path"); + attr(path, "d", "M119.5 326.9L3.5 209.1c-4.7-4.7-4.7-12.3 0-17l7.1-7.1c4.7-4.7 12.3-4.7 17 0L128 287.3l100.4-102.2c4.7-4.7 12.3-4.7 17 0l7.1 7.1c4.7 4.7 4.7 12.3 0 17L136.5 327c-4.7 4.6-12.3 4.6-17-.1z"); + attr(svg, "focusable", "false"); + attr(svg, "xmlns", "http://www.w3.org/2000/svg"); + attr(svg, "viewBox", "0 0 256 512"); + attr(svg, "class", svg_class_value = null_to_empty(`svg ${ctx[1]} ${ctx[2]}`) + " svelte-9fjno5"); + }, + m(target, anchor) { + insert(target, svg, anchor); + append(svg, path); + if (!mounted) { + dispose = listen(svg, "click", ctx[3]); + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty & 6 && svg_class_value !== (svg_class_value = null_to_empty(`svg ${ctx2[1]} ${ctx2[2]}`) + " svelte-9fjno5")) { + attr(svg, "class", svg_class_value); + } + }, + d(detaching) { + if (detaching) + detach(svg); + mounted = false; + dispose(); + } + }; +} +function create_fragment3(ctx) { + let if_block_anchor; + function select_block_type(ctx2, dirty) { + if (ctx2[0] === "chevron") + return create_if_block; + if (ctx2[0] === "settings") + return create_if_block_1; + } + let current_block_type = select_block_type(ctx, -1); + let if_block = current_block_type && current_block_type(ctx); + return { + c() { + if (if_block) + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) + if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx2, [dirty]) { + if (current_block_type === (current_block_type = select_block_type(ctx2, dirty)) && if_block) { + if_block.p(ctx2, dirty); + } else { + if (if_block) + if_block.d(1); + if_block = current_block_type && current_block_type(ctx2); + if (if_block) { + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } + }, + i: noop, + o: noop, + d(detaching) { + if (if_block) { + if_block.d(detaching); + } + if (detaching) + detach(if_block_anchor); + } + }; +} +function instance3($$self, $$props, $$invalidate) { + let { name } = $$props; + let { direction = "down" } = $$props; + let { style = "static" } = $$props; + const onClickDispatcher = createEventDispatcher(); + const onClick = (ev) => { + onClickDispatcher("click", ev); + }; + $$self.$$set = ($$props2) => { + if ("name" in $$props2) + $$invalidate(0, name = $$props2.name); + if ("direction" in $$props2) + $$invalidate(1, direction = $$props2.direction); + if ("style" in $$props2) + $$invalidate(2, style = $$props2.style); + }; + return [name, direction, style, onClick]; +} +var Icon = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance3, create_fragment3, safe_not_equal, { name: 0, direction: 1, style: 2 }, add_css3); + } +}; +var Icon_default = Icon; + +// src/svelte/ChecklistGroup.svelte +function add_css4(target) { + append_styles(target, "svelte-1tzpg3c", ".page.svelte-1tzpg3c{margin:var(--checklist-pageMargin);color:var(--checklist-textColor);transition:opacity 150ms ease-in-out;cursor:pointer}.file-link.svelte-1tzpg3c:hover{opacity:0.8}header.svelte-1tzpg3c{font-weight:var(--checklist-headerFontWeight);font-size:var(--checklist-headerFontSize);margin:var(--checklist-headerMargin);display:flex;gap:var(--checklist-headerGap);align-items:center}.space.svelte-1tzpg3c{flex:1}button.svelte-1tzpg3c,.count.svelte-1tzpg3c,.title.svelte-1tzpg3c{flex-shrink:1}.count.svelte-1tzpg3c{padding:var(--checklist-countPadding);background:var(--checklist-countBackground);border-radius:var(--checklist-countBorderRadius);font-size:var(--checklist-countFontSize)}.title.svelte-1tzpg3c{min-width:0;overflow:hidden;text-overflow:ellipsis;display:flex}button.svelte-1tzpg3c{display:flex;padding:var(--checklist-buttonPadding);background:transparent;box-shadow:var(--checklist-buttonBoxShadow)}.tag-base.svelte-1tzpg3c{color:var(--checklist-tagBaseColor)}.tag-sub.svelte-1tzpg3c{color:var(--checklist-tagSubColor)}ul.svelte-1tzpg3c{list-style:none;padding:0;margin:0;padding-inline-start:initial !important}.group.svelte-1tzpg3c{margin-bottom:var(--checklist-groupMargin)}.collapse.svelte-1tzpg3c{width:initial}"); +} +function get_each_context(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[7] = list[i]; + return child_ctx; +} +function create_else_block(ctx) { + let span; + return { + c() { + span = element("span"); + span.textContent = "All Tags"; + attr(span, "class", "tag-base svelte-1tzpg3c"); + }, + m(target, anchor) { + insert(target, span, anchor); + }, + p: noop, + d(detaching) { + if (detaching) + detach(span); + } + }; +} +function create_if_block_2(ctx) { + let span0; + let t1; + let span1; + let t2_value = `${ctx[0].mainTag}${ctx[0].subTags != null ? "/" : ""}`; + let t2; + let span1_class_value; + let t3; + let if_block_anchor; + let if_block = ctx[0].subTags != null && create_if_block_3(ctx); + return { + c() { + span0 = element("span"); + span0.textContent = "#"; + t1 = space(); + span1 = element("span"); + t2 = text(t2_value); + t3 = space(); + if (if_block) + if_block.c(); + if_block_anchor = empty(); + attr(span0, "class", "tag-base svelte-1tzpg3c"); + attr(span1, "class", span1_class_value = null_to_empty(ctx[0].subTags == null ? "tag-sub" : "tag-base") + " svelte-1tzpg3c"); + }, + m(target, anchor) { + insert(target, span0, anchor); + insert(target, t1, anchor); + insert(target, span1, anchor); + append(span1, t2); + insert(target, t3, anchor); + if (if_block) + if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx2, dirty) { + if (dirty & 1 && t2_value !== (t2_value = `${ctx2[0].mainTag}${ctx2[0].subTags != null ? "/" : ""}`)) + set_data(t2, t2_value); + if (dirty & 1 && span1_class_value !== (span1_class_value = null_to_empty(ctx2[0].subTags == null ? "tag-sub" : "tag-base") + " svelte-1tzpg3c")) { + attr(span1, "class", span1_class_value); + } + if (ctx2[0].subTags != null) { + if (if_block) { + if_block.p(ctx2, dirty); + } else { + if_block = create_if_block_3(ctx2); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + d(detaching) { + if (detaching) + detach(span0); + if (detaching) + detach(t1); + if (detaching) + detach(span1); + if (detaching) + detach(t3); + if (if_block) + if_block.d(detaching); + if (detaching) + detach(if_block_anchor); + } + }; +} +function create_if_block_12(ctx) { + let t_value = ctx[0].pageName + ""; + let t; + return { + c() { + t = text(t_value); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + p(ctx2, dirty) { + if (dirty & 1 && t_value !== (t_value = ctx2[0].pageName + "")) + set_data(t, t_value); + }, + d(detaching) { + if (detaching) + detach(t); + } + }; +} +function create_if_block_3(ctx) { + let span; + let t_value = ctx[0].subTags + ""; + let t; + return { + c() { + span = element("span"); + t = text(t_value); + attr(span, "class", "tag-sub svelte-1tzpg3c"); + }, + m(target, anchor) { + insert(target, span, anchor); + append(span, t); + }, + p(ctx2, dirty) { + if (dirty & 1 && t_value !== (t_value = ctx2[0].subTags + "")) + set_data(t, t_value); + }, + d(detaching) { + if (detaching) + detach(span); + } + }; +} +function create_if_block2(ctx) { + let ul; + let current; + let each_value = ctx[0].todos; + 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)); + } + const out = (i) => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + return { + c() { + ul = element("ul"); + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + attr(ul, "class", "svelte-1tzpg3c"); + }, + m(target, anchor) { + insert(target, ul, anchor); + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(ul, null); + } + current = true; + }, + p(ctx2, dirty) { + if (dirty & 13) { + each_value = ctx2[0].todos; + let i; + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context(ctx2, each_value, i); + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(ul, null); + } + } + group_outros(); + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + check_outros(); + } + }, + i(local) { + if (current) + return; + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + current = false; + }, + d(detaching) { + if (detaching) + detach(ul); + destroy_each(each_blocks, detaching); + } + }; +} +function create_each_block(ctx) { + let checklistitem; + let current; + checklistitem = new ChecklistItem_default({ + props: { + item: ctx[7], + lookAndFeel: ctx[2], + app: ctx[3] + } + }); + return { + c() { + create_component(checklistitem.$$.fragment); + }, + m(target, anchor) { + mount_component(checklistitem, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const checklistitem_changes = {}; + if (dirty & 1) + checklistitem_changes.item = ctx2[7]; + if (dirty & 4) + checklistitem_changes.lookAndFeel = ctx2[2]; + if (dirty & 8) + checklistitem_changes.app = ctx2[3]; + checklistitem.$set(checklistitem_changes); + }, + i(local) { + if (current) + return; + transition_in(checklistitem.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(checklistitem.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(checklistitem, detaching); + } + }; +} +function create_fragment4(ctx) { + let section; + let header; + let div0; + let t0; + let div1; + let t1; + let div2; + let t2_value = ctx[0].todos.length + ""; + let t2; + let t3; + let button; + let icon; + let header_class_value; + let t4; + let section_class_value; + let current; + let mounted; + let dispose; + function select_block_type(ctx2, dirty) { + if (ctx2[0].type === "page") + return create_if_block_12; + if (ctx2[0].mainTag) + return create_if_block_2; + return create_else_block; + } + let current_block_type = select_block_type(ctx, -1); + let if_block0 = current_block_type(ctx); + icon = new Icon_default({ + props: { + name: "chevron", + direction: ctx[1] ? "left" : "down" + } + }); + let if_block1 = !ctx[1] && create_if_block2(ctx); + return { + c() { + section = element("section"); + header = element("header"); + div0 = element("div"); + if_block0.c(); + t0 = space(); + div1 = element("div"); + t1 = space(); + div2 = element("div"); + t2 = text(t2_value); + t3 = space(); + button = element("button"); + create_component(icon.$$.fragment); + t4 = space(); + if (if_block1) + if_block1.c(); + attr(div0, "class", "title svelte-1tzpg3c"); + attr(div1, "class", "space svelte-1tzpg3c"); + attr(div2, "class", "count svelte-1tzpg3c"); + attr(button, "class", "collapse svelte-1tzpg3c"); + attr(button, "title", "Toggle Group"); + attr(header, "class", header_class_value = null_to_empty(`group-header ${ctx[0].type}`) + " svelte-1tzpg3c"); + attr(section, "class", section_class_value = "group " + ctx[0].className + " svelte-1tzpg3c"); + }, + m(target, anchor) { + insert(target, section, anchor); + append(section, header); + append(header, div0); + if_block0.m(div0, null); + append(header, t0); + append(header, div1); + append(header, t1); + append(header, div2); + append(div2, t2); + append(header, t3); + append(header, button); + mount_component(icon, button, null); + append(section, t4); + if (if_block1) + if_block1.m(section, null); + current = true; + if (!mounted) { + dispose = [ + listen(div0, "click", ctx[5]), + listen(button, "click", ctx[6]) + ]; + mounted = true; + } + }, + p(ctx2, [dirty]) { + if (current_block_type === (current_block_type = select_block_type(ctx2, dirty)) && if_block0) { + if_block0.p(ctx2, dirty); + } else { + if_block0.d(1); + if_block0 = current_block_type(ctx2); + if (if_block0) { + if_block0.c(); + if_block0.m(div0, null); + } + } + if ((!current || dirty & 1) && t2_value !== (t2_value = ctx2[0].todos.length + "")) + set_data(t2, t2_value); + const icon_changes = {}; + if (dirty & 2) + icon_changes.direction = ctx2[1] ? "left" : "down"; + icon.$set(icon_changes); + if (!current || dirty & 1 && header_class_value !== (header_class_value = null_to_empty(`group-header ${ctx2[0].type}`) + " svelte-1tzpg3c")) { + attr(header, "class", header_class_value); + } + if (!ctx2[1]) { + if (if_block1) { + if_block1.p(ctx2, dirty); + if (dirty & 2) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block2(ctx2); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(section, null); + } + } else if (if_block1) { + group_outros(); + transition_out(if_block1, 1, 1, () => { + if_block1 = null; + }); + check_outros(); + } + if (!current || dirty & 1 && section_class_value !== (section_class_value = "group " + ctx2[0].className + " svelte-1tzpg3c")) { + attr(section, "class", section_class_value); + } + }, + i(local) { + if (current) + return; + transition_in(icon.$$.fragment, local); + transition_in(if_block1); + current = true; + }, + o(local) { + transition_out(icon.$$.fragment, local); + transition_out(if_block1); + current = false; + }, + d(detaching) { + if (detaching) + detach(section); + if_block0.d(); + destroy_component(icon); + if (if_block1) + if_block1.d(); + mounted = false; + run_all(dispose); + } + }; +} +function instance4($$self, $$props, $$invalidate) { + let { group } = $$props; + let { isCollapsed } = $$props; + let { lookAndFeel } = $$props; + let { app } = $$props; + let { onToggle } = $$props; + function clickTitle(ev) { + if (group.type === "page") + navToFile(app, group.id, ev); + } + const click_handler = () => onToggle(group.id); + $$self.$$set = ($$props2) => { + if ("group" in $$props2) + $$invalidate(0, group = $$props2.group); + if ("isCollapsed" in $$props2) + $$invalidate(1, isCollapsed = $$props2.isCollapsed); + if ("lookAndFeel" in $$props2) + $$invalidate(2, lookAndFeel = $$props2.lookAndFeel); + if ("app" in $$props2) + $$invalidate(3, app = $$props2.app); + if ("onToggle" in $$props2) + $$invalidate(4, onToggle = $$props2.onToggle); + }; + return [group, isCollapsed, lookAndFeel, app, onToggle, clickTitle, click_handler]; +} +var ChecklistGroup = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance4, create_fragment4, safe_not_equal, { + group: 0, + isCollapsed: 1, + lookAndFeel: 2, + app: 3, + onToggle: 4 + }, add_css4); + } +}; +var ChecklistGroup_default = ChecklistGroup; + +// src/svelte/clickOutside.directive.ts +function clickOutside(node) { + const handleClick = (event) => { + if (node && !node.contains(event.target) && !event.defaultPrevented) { + node.dispatchEvent(new CustomEvent("click_outside", node)); + } + }; + document.addEventListener("mousedown", handleClick, true); + return { + destroy() { + document.removeEventListener("mousedown", handleClick, true); + } + }; +} + +// src/svelte/Header.svelte +function add_css5(target) { + append_styles(target, "svelte-rdace4", ".empty.svelte-rdace4.svelte-rdace4{color:var(--text-faint);text-align:center;margin-top:32px;font-style:italic}.container.svelte-rdace4.svelte-rdace4{height:32px;margin-bottom:12px;display:flex;flex-direction:row;gap:12px;align-items:center}.search.svelte-rdace4.svelte-rdace4{flex:1;background:var(--checklist-searchBackground);border:none;font-size:var(--checklist-contentFontSize);border-radius:var(--checklist-listItemBorderRadius);padding:0px 8px;color:var(--checklist-textColor);height:100%}.search.svelte-rdace4.svelte-rdace4:focus{box-shadow:0 0 0 2px var(--checklist-accentColor)}.settings-container.svelte-rdace4.svelte-rdace4{flex-shrink:1;display:flex;align-items:center;position:relative}.popover.svelte-rdace4.svelte-rdace4{position:absolute;top:32px;right:0px;width:300px;padding:12px;border-radius:var(--checklist-listItemBorderRadius);background:var(--checklist-searchBackground);box-shadow:0 2px 4px var(--background-modifier-cover);z-index:10}.section-title.svelte-rdace4.svelte-rdace4{font-weight:bold;margin-bottom:8px}section.svelte-rdace4.svelte-rdace4{margin-bottom:24px}.checkbox-item.svelte-rdace4 label.svelte-rdace4{gap:4px;display:flex;align-items:center;height:28px}.hash.svelte-rdace4.svelte-rdace4{color:var(--checklist-tagBaseColor)}"); +} +function get_each_context2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[12] = list[i]; + return child_ctx; +} +function create_if_block3(ctx) { + let div1; + let section; + let div0; + let t1; + let t2; + let clickOutside_action; + let mounted; + let dispose; + let each_value = ctx[0]; + let each_blocks = []; + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); + } + let if_block = ctx[0].length === 0 && create_if_block_13(ctx); + return { + c() { + div1 = element("div"); + section = element("section"); + div0 = element("div"); + div0.textContent = "Show Tags?"; + t1 = space(); + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + t2 = space(); + if (if_block) + if_block.c(); + attr(div0, "class", "section-title svelte-rdace4"); + attr(section, "class", "svelte-rdace4"); + attr(div1, "class", "popover svelte-rdace4"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, section); + append(section, div0); + append(section, t1); + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(section, null); + } + append(section, t2); + if (if_block) + if_block.m(section, null); + if (!mounted) { + dispose = [ + action_destroyer(clickOutside_action = clickOutside.call(null, div1)), + listen(div1, "click_outside", ctx[11]) + ]; + mounted = true; + } + }, + p(ctx2, dirty) { + if (dirty & 11) { + each_value = ctx2[0]; + let i; + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context2(ctx2, each_value, i); + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block2(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(section, t2); + } + } + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + each_blocks.length = each_value.length; + } + if (ctx2[0].length === 0) { + if (if_block) { + } else { + if_block = create_if_block_13(ctx2); + if_block.c(); + if_block.m(section, null); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + d(detaching) { + if (detaching) + detach(div1); + destroy_each(each_blocks, detaching); + if (if_block) + if_block.d(); + mounted = false; + run_all(dispose); + } + }; +} +function create_each_block2(ctx) { + let div; + let label; + let input; + let input_checked_value; + let span; + let t1_value = ctx[12] + ""; + let t1; + let mounted; + let dispose; + function click_handler_1(...args) { + return ctx[10](ctx[12], ...args); + } + return { + c() { + div = element("div"); + label = element("label"); + input = element("input"); + span = element("span"); + span.textContent = "#"; + t1 = text(t1_value); + attr(input, "type", "checkbox"); + input.checked = input_checked_value = !ctx[1].includes(ctx[12]); + attr(span, "class", "hash svelte-rdace4"); + attr(label, "class", "svelte-rdace4"); + attr(div, "class", "checkbox-item svelte-rdace4"); + }, + m(target, anchor) { + insert(target, div, anchor); + append(div, label); + append(label, input); + append(label, span); + append(label, t1); + if (!mounted) { + dispose = listen(input, "click", prevent_default(click_handler_1)); + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + if (dirty & 3 && input_checked_value !== (input_checked_value = !ctx[1].includes(ctx[12]))) { + input.checked = input_checked_value; + } + if (dirty & 1 && t1_value !== (t1_value = ctx[12] + "")) + set_data(t1, t1_value); + }, + d(detaching) { + if (detaching) + detach(div); + mounted = false; + dispose(); + } + }; +} +function create_if_block_13(ctx) { + let div; + return { + c() { + div = element("div"); + div.textContent = "No tags specified"; + attr(div, "class", "empty svelte-rdace4"); + }, + m(target, anchor) { + insert(target, div, anchor); + }, + d(detaching) { + if (detaching) + detach(div); + } + }; +} +function create_fragment5(ctx) { + let div1; + let input; + let input_disabled_value; + let t0; + let div0; + let icon; + let t1; + let current; + let mounted; + let dispose; + icon = new Icon_default({ + props: { name: "settings", style: "button" } + }); + icon.$on("click", ctx[9]); + let if_block = ctx[5] && create_if_block3(ctx); + return { + c() { + div1 = element("div"); + input = element("input"); + t0 = space(); + div0 = element("div"); + create_component(icon.$$.fragment); + t1 = space(); + if (if_block) + if_block.c(); + input.disabled = input_disabled_value = ctx[2] && !ctx[6]; + attr(input, "class", "search svelte-rdace4"); + attr(input, "placeholder", "Search tasks"); + attr(div0, "class", "settings-container svelte-rdace4"); + attr(div1, "class", "container svelte-rdace4"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, input); + set_input_value(input, ctx[6]); + append(div1, t0); + append(div1, div0); + mount_component(icon, div0, null); + append(div0, t1); + if (if_block) + if_block.m(div0, null); + current = true; + if (!mounted) { + dispose = [ + listen(input, "input", ctx[7]), + listen(input, "input", ctx[8]) + ]; + mounted = true; + } + }, + p(ctx2, [dirty]) { + if (!current || dirty & 68 && input_disabled_value !== (input_disabled_value = ctx2[2] && !ctx2[6])) { + input.disabled = input_disabled_value; + } + if (dirty & 64 && input.value !== ctx2[6]) { + set_input_value(input, ctx2[6]); + } + if (ctx2[5]) { + if (if_block) { + if_block.p(ctx2, dirty); + } else { + if_block = create_if_block3(ctx2); + if_block.c(); + if_block.m(div0, null); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + i(local) { + if (current) + return; + transition_in(icon.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(icon.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) + detach(div1); + destroy_component(icon); + if (if_block) + if_block.d(); + mounted = false; + run_all(dispose); + } + }; +} +function instance5($$self, $$props, $$invalidate) { + let { todoTags } = $$props; + let { hiddenTags } = $$props; + let { disableSearch } = $$props; + let { onTagStatusChange } = $$props; + let { onSearch } = $$props; + let showPopover = false; + let search = ""; + function input_input_handler() { + search = this.value; + $$invalidate(6, search); + } + const input_handler = () => onSearch(search); + const click_handler = (ev) => { + $$invalidate(5, showPopover = !showPopover); + }; + const click_handler_1 = (tag, ev) => onTagStatusChange(tag, hiddenTags.includes(tag)); + const click_outside_handler = (ev) => { + $$invalidate(5, showPopover = false); + }; + $$self.$$set = ($$props2) => { + if ("todoTags" in $$props2) + $$invalidate(0, todoTags = $$props2.todoTags); + if ("hiddenTags" in $$props2) + $$invalidate(1, hiddenTags = $$props2.hiddenTags); + if ("disableSearch" in $$props2) + $$invalidate(2, disableSearch = $$props2.disableSearch); + if ("onTagStatusChange" in $$props2) + $$invalidate(3, onTagStatusChange = $$props2.onTagStatusChange); + if ("onSearch" in $$props2) + $$invalidate(4, onSearch = $$props2.onSearch); + }; + return [ + todoTags, + hiddenTags, + disableSearch, + onTagStatusChange, + onSearch, + showPopover, + search, + input_input_handler, + input_handler, + click_handler, + click_handler_1, + click_outside_handler + ]; +} +var Header = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance5, create_fragment5, safe_not_equal, { + todoTags: 0, + hiddenTags: 1, + disableSearch: 2, + onTagStatusChange: 3, + onSearch: 4 + }, add_css5); + } +}; +var Header_default = Header; + +// src/svelte/App.svelte +function add_css6(target) { + append_styles(target, "svelte-j2kqyp", ".empty.svelte-j2kqyp{color:var(--text-faint);text-align:center;margin-top:32px;font-style:italic}.checklist-plugin-main.svelte-j2kqyp{padding:initial;width:initial;height:initial;position:initial;overflow-y:initial;overflow-wrap:initial}"); +} +function get_each_context3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[11] = list[i]; + return child_ctx; +} +function create_else_block_1(ctx) { + let each_1_anchor; + let current; + let each_value = ctx[6]; + let each_blocks = []; + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block3(get_each_context3(ctx, each_value, i)); + } + const out = (i) => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + return { + c() { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + each_1_anchor = empty(); + }, + m(target, anchor) { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(target, anchor); + } + insert(target, each_1_anchor, anchor); + current = true; + }, + p(ctx2, dirty) { + if (dirty & 358) { + each_value = ctx2[6]; + let i; + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context3(ctx2, each_value, i); + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block3(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); + } + } + group_outros(); + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + check_outros(); + } + }, + i(local) { + if (current) + return; + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + current = false; + }, + d(detaching) { + destroy_each(each_blocks, detaching); + if (detaching) + detach(each_1_anchor); + } + }; +} +function create_if_block4(ctx) { + let div; + function select_block_type_1(ctx2, dirty) { + if (ctx2[3].length === ctx2[0].length) + return create_if_block_14; + if (ctx2[7].length) + return create_if_block_22; + return create_else_block2; + } + let current_block_type = select_block_type_1(ctx, -1); + let if_block = current_block_type(ctx); + return { + c() { + div = element("div"); + if_block.c(); + attr(div, "class", "empty svelte-j2kqyp"); + }, + m(target, anchor) { + insert(target, div, anchor); + if_block.m(div, null); + }, + p(ctx2, dirty) { + if (current_block_type === (current_block_type = select_block_type_1(ctx2, dirty)) && if_block) { + if_block.p(ctx2, dirty); + } else { + if_block.d(1); + if_block = current_block_type(ctx2); + if (if_block) { + if_block.c(); + if_block.m(div, null); + } + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) + detach(div); + if_block.d(); + } + }; +} +function create_each_block3(ctx) { + let checklistgroup; + let current; + checklistgroup = new ChecklistGroup_default({ + props: { + group: ctx[11], + app: ctx[5], + lookAndFeel: ctx[1], + isCollapsed: ctx[2].includes(ctx[11].id), + onToggle: ctx[8] + } + }); + return { + c() { + create_component(checklistgroup.$$.fragment); + }, + m(target, anchor) { + mount_component(checklistgroup, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const checklistgroup_changes = {}; + if (dirty & 64) + checklistgroup_changes.group = ctx2[11]; + if (dirty & 32) + checklistgroup_changes.app = ctx2[5]; + if (dirty & 2) + checklistgroup_changes.lookAndFeel = ctx2[1]; + if (dirty & 68) + checklistgroup_changes.isCollapsed = ctx2[2].includes(ctx2[11].id); + checklistgroup.$set(checklistgroup_changes); + }, + i(local) { + if (current) + return; + transition_in(checklistgroup.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(checklistgroup.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(checklistgroup, detaching); + } + }; +} +function create_else_block2(ctx) { + let t; + return { + c() { + t = text("No checklists found in all files"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + p: noop, + d(detaching) { + if (detaching) + detach(t); + } + }; +} +function create_if_block_22(ctx) { + let t0; + let t1_value = ctx[7].length > 1 ? "s" : ""; + let t1; + let t2; + let t3_value = ctx[7].map(func).join(" ") + ""; + let t3; + return { + c() { + t0 = text("No checklists found for tag"); + t1 = text(t1_value); + t2 = text(": "); + t3 = text(t3_value); + }, + m(target, anchor) { + insert(target, t0, anchor); + insert(target, t1, anchor); + insert(target, t2, anchor); + insert(target, t3, anchor); + }, + p: noop, + d(detaching) { + if (detaching) + detach(t0); + if (detaching) + detach(t1); + if (detaching) + detach(t2); + if (detaching) + detach(t3); + } + }; +} +function create_if_block_14(ctx) { + let t; + return { + c() { + t = text("All checklist set to hidden"); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + p: noop, + d(detaching) { + if (detaching) + detach(t); + } + }; +} +function create_fragment6(ctx) { + let div; + let header; + let t; + let current_block_type_index; + let if_block; + let current; + header = new Header_default({ + props: { + disableSearch: ctx[6].length === 0, + todoTags: ctx[0], + hiddenTags: ctx[3], + onTagStatusChange: ctx[9], + onSearch: ctx[4] + } + }); + const if_block_creators = [create_if_block4, create_else_block_1]; + const if_blocks = []; + function select_block_type(ctx2, dirty) { + if (ctx2[6].length === 0) + return 0; + return 1; + } + current_block_type_index = select_block_type(ctx, -1); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + return { + c() { + div = element("div"); + create_component(header.$$.fragment); + t = space(); + if_block.c(); + attr(div, "class", "checklist-plugin-main markdown-preview-view svelte-j2kqyp"); + }, + m(target, anchor) { + insert(target, div, anchor); + mount_component(header, div, null); + append(div, t); + if_blocks[current_block_type_index].m(div, null); + current = true; + }, + p(ctx2, [dirty]) { + const header_changes = {}; + if (dirty & 64) + header_changes.disableSearch = ctx2[6].length === 0; + if (dirty & 1) + header_changes.todoTags = ctx2[0]; + if (dirty & 8) + header_changes.hiddenTags = ctx2[3]; + if (dirty & 16) + header_changes.onSearch = ctx2[4]; + header.$set(header_changes); + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx2, dirty); + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx2, dirty); + } else { + group_outros(); + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + check_outros(); + if_block = if_blocks[current_block_type_index]; + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); + if_block.c(); + } else { + if_block.p(ctx2, dirty); + } + transition_in(if_block, 1); + if_block.m(div, null); + } + }, + i(local) { + if (current) + return; + transition_in(header.$$.fragment, local); + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(header.$$.fragment, local); + transition_out(if_block); + current = false; + }, + d(detaching) { + if (detaching) + detach(div); + destroy_component(header); + if_blocks[current_block_type_index].d(); + } + }; +} +var func = (e) => `#${e}`; +function instance6($$self, $$props, $$invalidate) { + let { todoTags } = $$props; + let { lookAndFeel } = $$props; + let { _collapsedSections } = $$props; + let { _hiddenTags } = $$props; + let { updateSetting } = $$props; + let { onSearch } = $$props; + let { app } = $$props; + let { todoGroups = [] } = $$props; + const visibleTags = todoTags.filter((t) => !_hiddenTags.includes(t)); + const toggleGroup = (id) => { + const newCollapsedSections = _collapsedSections.includes(id) ? _collapsedSections.filter((e) => e !== id) : [..._collapsedSections, id]; + updateSetting({ _collapsedSections: newCollapsedSections }); + }; + const updateTagStatus = (tag, status) => { + const newHiddenTags = _hiddenTags.filter((t) => t !== tag); + if (!status) + newHiddenTags.push(tag); + updateSetting({ _hiddenTags: newHiddenTags }); + }; + $$self.$$set = ($$props2) => { + if ("todoTags" in $$props2) + $$invalidate(0, todoTags = $$props2.todoTags); + if ("lookAndFeel" in $$props2) + $$invalidate(1, lookAndFeel = $$props2.lookAndFeel); + if ("_collapsedSections" in $$props2) + $$invalidate(2, _collapsedSections = $$props2._collapsedSections); + if ("_hiddenTags" in $$props2) + $$invalidate(3, _hiddenTags = $$props2._hiddenTags); + if ("updateSetting" in $$props2) + $$invalidate(10, updateSetting = $$props2.updateSetting); + if ("onSearch" in $$props2) + $$invalidate(4, onSearch = $$props2.onSearch); + if ("app" in $$props2) + $$invalidate(5, app = $$props2.app); + if ("todoGroups" in $$props2) + $$invalidate(6, todoGroups = $$props2.todoGroups); + }; + return [ + todoTags, + lookAndFeel, + _collapsedSections, + _hiddenTags, + onSearch, + app, + todoGroups, + visibleTags, + toggleGroup, + updateTagStatus, + updateSetting + ]; +} +var App3 = class extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance6, create_fragment6, safe_not_equal, { + todoTags: 0, + lookAndFeel: 1, + _collapsedSections: 2, + _hiddenTags: 3, + updateSetting: 10, + onSearch: 4, + app: 5, + todoGroups: 6 + }, add_css6); + } +}; +var App_default = App3; + +// src/view.ts +var TodoListView = class extends import_obsidian4.ItemView { + constructor(leaf, plugin) { + super(leaf); + this.plugin = plugin; + this.lastRerender = 0; + this.groupedItems = []; + this.itemsByFile = /* @__PURE__ */ new Map(); + this.searchTerm = ""; + } + getViewType() { + return TODO_VIEW_TYPE; + } + getDisplayText() { + return "Todo List"; + } + getIcon() { + return "checkmark"; + } + get todoTagArray() { + return this.plugin.getSettingValue("todoPageName").trim().split("\n").map((e) => e.toLowerCase()).filter((e) => e); + } + get visibleTodoTagArray() { + return this.todoTagArray.filter((t) => !this.plugin.getSettingValue("_hiddenTags").includes(t)); + } + onClose() { + return __async(this, null, function* () { + this._app.$destroy(); + }); + } + onOpen() { + return __async(this, null, function* () { + this._app = new App_default({ + target: this.contentEl, + props: this.props() + }); + this.registerEvent(this.app.metadataCache.on("resolved", () => __async(this, null, function* () { + if (!this.plugin.getSettingValue("autoRefresh")) + return; + yield this.refresh(); + }))); + this.registerEvent(this.app.workspace.on("active-leaf-change", () => __async(this, null, function* () { + if (!this.plugin.getSettingValue("showOnlyActiveFile")) + return; + yield this.refresh(); + }))); + this.registerEvent(this.app.vault.on("delete", (file) => this.deleteFile(file.path))); + this.refresh(); + }); + } + refresh(all = false) { + return __async(this, null, function* () { + if (all) { + this.lastRerender = 0; + this.itemsByFile.clear(); + } + yield this.calculateAllItems(); + this.groupItems(); + this.renderView(); + this.lastRerender = +new Date(); + }); + } + rerender() { + this.renderView(); + } + deleteFile(path) { + this.itemsByFile.delete(path); + this.groupItems(); + this.renderView(); + } + props() { + return { + todoTags: this.todoTagArray, + lookAndFeel: this.plugin.getSettingValue("lookAndFeel"), + subGroups: this.plugin.getSettingValue("subGroups"), + _collapsedSections: this.plugin.getSettingValue("_collapsedSections"), + _hiddenTags: this.plugin.getSettingValue("_hiddenTags"), + app: this.app, + todoGroups: this.groupedItems, + updateSetting: (updates) => this.plugin.updateSettings(updates), + onSearch: (val) => { + this.searchTerm = val; + this.refresh(); + } + }; + } + calculateAllItems() { + return __async(this, null, function* () { + const todosForUpdatedFiles = yield parseTodos(this.app.vault.getMarkdownFiles(), this.todoTagArray.length === 0 ? ["*"] : this.visibleTodoTagArray, this.app.metadataCache, this.app.vault, this.plugin.getSettingValue("includeFiles"), this.plugin.getSettingValue("showChecked"), this.plugin.getSettingValue("showAllTodos"), this.lastRerender); + for (const [file, todos] of todosForUpdatedFiles) { + this.itemsByFile.set(file.path, todos); + } + }); + } + groupItems() { + const flattenedItems = Array.from(this.itemsByFile.values()).flat(); + const viewOnlyOpen = this.plugin.getSettingValue("showOnlyActiveFile"); + const openFile = this.app.workspace.getActiveFile(); + const filteredItems = viewOnlyOpen ? flattenedItems.filter((i) => i.filePath === openFile.path) : flattenedItems; + const searchedItems = filteredItems.filter((e) => e.originalText.toLowerCase().includes(this.searchTerm.toLowerCase())); + this.groupedItems = groupTodos(searchedItems, this.plugin.getSettingValue("groupBy"), this.plugin.getSettingValue("sortDirectionGroups"), this.plugin.getSettingValue("sortDirectionItems"), this.plugin.getSettingValue("subGroups"), this.plugin.getSettingValue("sortDirectionSubGroups")); + } + renderView() { + this._app.$set(this.props()); + } +}; + +// src/main.ts +var TodoPlugin = class extends import_obsidian5.Plugin { + get view() { + var _a; + return (_a = this.app.workspace.getLeavesOfType(TODO_VIEW_TYPE)[0]) == null ? void 0 : _a.view; + } + onload() { + return __async(this, null, function* () { + yield this.loadSettings(); + this.addSettingTab(new TodoSettingTab(this.app, this)); + this.addCommand({ + id: "show-checklist-view", + name: "Show Checklist Pane", + callback: () => { + const workspace = this.app.workspace; + const views = workspace.getLeavesOfType(TODO_VIEW_TYPE); + if (views.length === 0) { + workspace.getRightLeaf(false).setViewState({ + type: TODO_VIEW_TYPE, + active: true + }).then(() => { + const todoLeaf = workspace.getLeavesOfType(TODO_VIEW_TYPE)[0]; + workspace.revealLeaf(todoLeaf); + workspace.setActiveLeaf(todoLeaf, true, true); + }); + } else { + views[0].setViewState({ + active: true, + type: TODO_VIEW_TYPE + }); + workspace.revealLeaf(views[0]); + workspace.setActiveLeaf(views[0], true, true); + } + } + }); + this.addCommand({ + id: "refresh-checklist-view", + name: "Refresh List", + callback: () => { + this.view.refresh(); + } + }); + this.registerView(TODO_VIEW_TYPE, (leaf) => { + const newView = new TodoListView(leaf, this); + return newView; + }); + if (this.app.workspace.layoutReady) + this.initLeaf(); + else + this.app.workspace.onLayoutReady(() => this.initLeaf()); + }); + } + initLeaf() { + if (this.app.workspace.getLeavesOfType(TODO_VIEW_TYPE).length) + return; + this.app.workspace.getRightLeaf(false).setViewState({ + type: TODO_VIEW_TYPE, + active: true + }); + } + onunload() { + return __async(this, null, function* () { + var _a; + (_a = this.app.workspace.getLeavesOfType(TODO_VIEW_TYPE)[0]) == null ? void 0 : _a.detach(); + }); + } + loadSettings() { + return __async(this, null, function* () { + const loadedData = yield this.loadData(); + this.settings = __spreadValues(__spreadValues({}, DEFAULT_SETTINGS), loadedData); + }); + } + updateSettings(updates) { + return __async(this, null, function* () { + Object.assign(this.settings, updates); + yield this.saveData(this.settings); + const onlyRepaintWhenChanges = [ + "autoRefresh", + "lookAndFeel", + "_collapsedSections" + ]; + const onlyReGroupWhenChanges = [ + "subGroups", + "groupBy", + "sortDirectionGroups", + "sortDirectionSubGroups", + "sortDirectionItems" + ]; + if (onlyRepaintWhenChanges.includes(Object.keys(updates)[0])) + this.view.rerender(); + else + this.view.refresh(!onlyReGroupWhenChanges.includes(Object.keys(updates)[0])); + }); + } + getSettingValue(setting) { + return this.settings[setting]; + } +}; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-checklist-plugin/manifest.json b/.obsidian/plugins/obsidian-checklist-plugin/manifest.json new file mode 100644 index 0000000..97a07f6 --- /dev/null +++ b/.obsidian/plugins/obsidian-checklist-plugin/manifest.json @@ -0,0 +1,9 @@ +{ + "id": "obsidian-checklist-plugin", + "name": "Checklist", + "version": "2.2.14", + "minAppVersion": "0.14.5", + "description": "Combines checklists across pages into users sidebar", + "author": "delashum", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-checklist-plugin/styles.css b/.obsidian/plugins/obsidian-checklist-plugin/styles.css new file mode 100644 index 0000000..836a535 --- /dev/null +++ b/.obsidian/plugins/obsidian-checklist-plugin/styles.css @@ -0,0 +1,51 @@ +/* no content */ +.checklist-plugin-main { + --checklist-checkboxSize: 20px; + --checklist-checkboxCheckedSize: 12px; + --checklist-checkboxBorder: 2px solid var(--text-muted); + --checklist-checkboxFill: var(--text-muted); + --checklist-listItemBorderRadius: 8px; + --checklist-listItemMargin: 0 0 12px; + --checklist-listItemBackground: var(--interactive-normal); + --checklist-listItemBackground--hover: var(--interactive-hover); + --checklist-listItemMargin--compact: 0 0 8px; + --checklist-listItemBoxShadow: none; + --checklist-headerMargin: 0 0 8px; + --checklist-headerGap: 4px; + --checklist-headerFontSize: 18px; + --checklist-headerFontWeight: 600; + --checklist-iconSize: 24px; + --checklist-iconFill: var(--text-normal); + --checklist-iconFill--accent: #777; + --checklist-textColor: var(--text-muted); + --checklist-accentColor: var(--text-accent); + --checklist-accentColor--active: var(--text-accent-hover); + --checklist-pageMargin: 0 0 4px; + --checklist-loaderSize: 16px; + --checklist-loaderBorderColor: var(--text-muted) var(--text-muted) + var(--text-normal); + --checklist-buttonPadding: 0 5px; + --checklist-buttonBoxShadow: none; + --checklist-countPadding: 0 6px; + --checklist-countBackground: var(--interactive-normal); + --checklist-countFontSize: 13px; + --checklist-togglePadding: 8px 8px 8px 12px; + --checklist-contentPadding: 8px 12px 8px 0; + --checklist-contentPadding--compact: 4px 8px; + --checklist-togglePadding--compact: 4px 8px; + --checklist-countBorderRadius: 4px; + --checklist-tagBaseColor: var(--text-faint); + --checklist-tagSubColor: #bbb; + --checklist-groupMargin: 8px; + --checklist-contentFontSize: var(--editor-font-size); + --checklist-searchBackground: var(--background-primary); +} + +.checklist-plugin-main button { + margin: initial; +} + +.checklist-plugin-main p { + margin: initial; + word-break: break-word; +} diff --git a/0 - Daily Notes/2026-03-07.md b/0 - Daily Notes/2026-03-07.md new file mode 100644 index 0000000..dc1d713 --- /dev/null +++ b/0 - Daily Notes/2026-03-07.md @@ -0,0 +1,19 @@ +--- +created: "2026-03-07" +type: daily +--- + +# 2026-03-07 Saturday + +## 今日捕捉 + +- + +## 待办 + +- [ ] + +## 回顾 + + + diff --git a/0 - Daily Notes/README.md b/0 - Daily Notes/README.md new file mode 100644 index 0000000..b54b500 --- /dev/null +++ b/0 - Daily Notes/README.md @@ -0,0 +1,9 @@ +# Daily Notes + +每日笔记存放在此文件夹。 + +## 使用方式 + +- 每天打开 Obsidian 时,通过 Calendar 插件或快捷键自动创建当天日记 +- 文件名格式:`YYYY-MM-DD`(由 Obsidian 自动生成) +- 使用 `System/Templates/Daily Note` 模板 diff --git a/1 - Inbox/README.md b/1 - Inbox/README.md new file mode 100644 index 0000000..7784bd4 --- /dev/null +++ b/1 - Inbox/README.md @@ -0,0 +1,13 @@ +# Inbox + +快速捕捉想法、链接、灵感的地方。 + +## 使用原则 + +- 任何新想法先丢到这里,不用管格式 +- 定期(每周)清理 Inbox,将笔记移到适当位置: + - 可执行的任务 → `2 - Projects` + - 持续关注的主题 → `3 - Areas` + - 参考资料 → `4 - Resources` + - 值得发展的想法 → `6 - Zettelkasten`(用原子笔记模板重写) + - 不需要的 → 删除 diff --git a/2 - Projects/README.md b/2 - Projects/README.md new file mode 100644 index 0000000..664bab4 --- /dev/null +++ b/2 - Projects/README.md @@ -0,0 +1,9 @@ +# Projects + +有明确目标和截止日期的项目。 + +## 使用原则 + +- 每个项目一个文件夹或一个 MOC(Map of Content)笔记 +- 项目完成后移到 `5 - Archive` +- 问自己:"这件事有明确的完成标准吗?" — 有的话就是 Project diff --git a/3 - Areas/README.md b/3 - Areas/README.md new file mode 100644 index 0000000..9ab1ee2 --- /dev/null +++ b/3 - Areas/README.md @@ -0,0 +1,9 @@ +# Areas + +持续关注、没有截止日期的责任领域。 + +## 使用原则 + +- 例如:健康、财务、职业发展、技术学习 +- 每个 Area 可以有自己的 MOC 笔记来组织相关内容 +- 问自己:"这是我需要长期维护的标准吗?" — 是的话就是 Area diff --git a/4 - Resources/README.md b/4 - Resources/README.md new file mode 100644 index 0000000..a7e2900 --- /dev/null +++ b/4 - Resources/README.md @@ -0,0 +1,9 @@ +# Resources + +感兴趣的主题参考资料。 + +## 使用原则 + +- 按主题分类,例如:编程、读书笔记、工具教程 +- 不需要是你自己的想法,可以是外部资料的整理 +- 问自己:"这个信息未来可能有用吗?" — 是的话就是 Resource diff --git a/5 - Archive/README.md b/5 - Archive/README.md new file mode 100644 index 0000000..897ed21 --- /dev/null +++ b/5 - Archive/README.md @@ -0,0 +1,9 @@ +# Archive + +已完成的项目、不再活跃的领域。 + +## 使用原则 + +- 完成的 Project 整个移到这里 +- 不再关注的 Area 移到这里 +- 不要删除,留着以备未来查询 diff --git a/6 - Zettelkasten/20260307120000 PARA 与 Zettelkasten 的互补关系.md b/6 - Zettelkasten/20260307120000 PARA 与 Zettelkasten 的互补关系.md new file mode 100644 index 0000000..12e72df --- /dev/null +++ b/6 - Zettelkasten/20260307120000 PARA 与 Zettelkasten 的互补关系.md @@ -0,0 +1,25 @@ +--- +created: "2026-03-07 12:00" +type: zettel +tags: [concept, PKM] +source: "Tiago Forte - Building a Second Brain / Niklas Luhmann - Zettelkasten" +--- + +# PARA 与 Zettelkasten 的互补关系 + +PARA 提供"行动导向"的组织框架 — 按照可执行性分类(Projects > Areas > Resources > Archive),让你知道现在该做什么。 + +Zettelkasten 提供"知识导向"的思考框架 — 把想法拆成原子单位,通过链接产生新洞察。 + +两者结合:PARA 管理你的"做",Zettelkasten 管理你的"想"。当你在 Project 中产生了有价值的洞察,就提炼成 Zettel;当你的 Zettel 积累到足以支撑一个行动,就建立 Project。 + +--- + +## Related + +- [[1 - Inbox/README|Inbox 是两个系统的入口]] + +## Source + +- Tiago Forte, *Building a Second Brain* +- Sonke Ahrens, *How to Take Smart Notes* diff --git a/6 - Zettelkasten/README.md b/6 - Zettelkasten/README.md new file mode 100644 index 0000000..d41c44b --- /dev/null +++ b/6 - Zettelkasten/README.md @@ -0,0 +1,19 @@ +# Zettelkasten + +原子化的永久笔记 — 你的"第二大脑"核心。 + +## 使用原则 + +- **一则笔记 = 一个想法**(原子性) +- 用自己的话写(不是复制粘贴) +- 重点是**笔记之间的链接** `[[]]`,而非分类 +- 用 tags 辅助搜索,例如 `#concept` `#insight` `#question` +- 文件名格式:`YYYYMMDDHHMMSS 标题`(时间戳确保唯一性) + +## 常用 Tags + +- `#concept` — 概念定义 +- `#insight` — 个人洞察 +- `#question` — 待探索的问题 +- `#principle` — 原则或心法 +- `#connection` — 跨领域链接 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d9900f5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,19 @@ +# Knowledge Vault + +This is an Obsidian knowledge base using PARA + Zettelkasten methodology. + +## Skill + +Use the `knowledge-vault` skill (`~/.claude/skills/knowledge-vault/SKILL.md`) for all note management operations. + +## Quick Reference + +| Command | Action | +|---------|--------| +| "新建笔记 [内容]" | Create an Inbox note in `1 - Inbox/` | +| "新建日记" | Create today's Daily Note in `0 - Daily Notes/` | +| "新建卡片 [想法]" | Create a Zettelkasten note in `6 - Zettelkasten/` | +| "整理收件箱" | Review and organize `1 - Inbox/` | +| "搜索 [关键词]" | Search across all notes | +| "找关联" | Find related notes and suggest links | +| "健康检查" | Review orphan notes, missing tags, suggest connections | diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..bd09160 --- /dev/null +++ b/Home.md @@ -0,0 +1,29 @@ +# Home + +> 个人知识管理系统 — PARA + Zettelkasten + +## Quick Capture + +- [[1 - Inbox/新笔记]] + +## Navigation + +| Folder | Purpose | +|--------|---------| +| [[0 - Daily Notes]] | 每日笔记 | +| [[1 - Inbox]] | 快速捕捉,稍后整理 | +| [[2 - Projects]] | 进行中的项目 | +| [[3 - Areas]] | 持续关注的领域 | +| [[4 - Resources]] | 主题参考资料 | +| [[5 - Archive]] | 已完成或暂停的内容 | +| [[6 - Zettelkasten]] | 原子化永久笔记 | + +## Recent Notes + +```dataview +TABLE file.mtime AS "Modified" +FROM "" +WHERE file.name != "Home" +SORT file.mtime DESC +LIMIT 10 +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..8be0d61 --- /dev/null +++ b/README.md @@ -0,0 +1,164 @@ +# Knowledge — 个人知识管理系统 + +基于 PARA 方法论和 Zettelkasten 卡片盒笔记法的 Obsidian 知识库。 + +## 系统结构 + +``` +Knowledge/ +├── Home.md # 仪表板,每次打开 Obsidian 的起点 +├── 0 - Daily Notes/ # 每日笔记 +├── 1 - Inbox/ # 快速捕捉,稍后整理 +├── 2 - Projects/ # 有明确目标和截止日期的项目 +├── 3 - Areas/ # 长期关注的责任领域 +├── 4 - Resources/ # 主题参考资料 +├── 5 - Archive/ # 已完成或暂停的内容 +├── 6 - Zettelkasten/ # 原子化永久笔记 +└── System/ # 系统文件 + ├── Attachments/ # 图片、PDF 等附件 + └── Templates/ # 笔记模板 +``` + +## 两套方法论如何协作 + +**PARA** 管理"做" — 按可执行性组织内容,让你知道现在该做什么。 + +**Zettelkasten** 管理"想" — 把想法拆成原子单位,通过链接产生新洞察。 + +``` +捕捉想法 → Inbox → 整理到 PARA 或提炼到 Zettelkasten + ↓ ↓ + 执行和推进 积累和连接 + ↓ ↓ + 项目完成 → Archive 洞察成熟 → 新项目 +``` + +## 快速开始 + +### 第一步:设置 Obsidian + +1. 打开 Settings → Core plugins → 启用 **Templates** +2. 设置 Template folder location 为 `System/Templates` +3. 打开 Settings → Core plugins → 启用 **Daily notes** +4. 设置 Daily notes 的 New file location 为 `0 - Daily Notes`,Template file 为 `System/Templates/Daily Note` +5. 设置 Settings → Files & Links → Default location for new notes 为 `1 - Inbox` +6. 设置 Settings → Files & Links → Attachment folder path 为 `System/Attachments` +7. 安装社区插件 **Dataview**(让 Home 页面的最近笔记查询生效) +8. 安装社区插件 **Calendar**(侧边栏日历视图,点击日期自动创建/跳转日记) +9. 安装社区插件 **Checklist**(汇总所有笔记中的待办事项到一个面板) +10. 安装社区插件 **HomeTab**(打开 Obsidian 时显示自定义首页,可配合 Home.md 使用) + +### 第二步:开始记笔记 + +任何想法,直接在 `1 - Inbox` 新建笔记,插入 `Inbox Note` 模板,写下内容。不用纠结分类,先写下来再说。 + +### 第三步:每周清理 Inbox + +每周花 15 分钟,把 Inbox 里的笔记移到合适的位置: + +| 笔记类型 | 移动到 | 使用模板 | +|---------|--------|---------| +| 可执行的任务 | `2 - Projects` | Project Note | +| 持续关注的主题 | `3 - Areas` | — | +| 参考资料 | `4 - Resources` | Resource Note | +| 有价值的个人想法 | `6 - Zettelkasten` | Zettelkasten Note | +| 过时或无用的 | 直接删除 | — | + +## 判断笔记放哪里 + +问自己三个问题,按顺序判断: + +1. **这件事有明确的完成标准吗?** → `2 - Projects` +2. **这是我需要长期维护的标准吗?** → `3 - Areas` +3. **这个信息未来可能有用吗?** → `4 - Resources` + +如果是**你自己的原创想法、洞察或概念**,不管属于哪个类别,都值得在 `6 - Zettelkasten` 写一则原子笔记。 + +不确定?先丢 `1 - Inbox`。 + +## 写好 Zettelkasten 笔记的要点 + +Zettelkasten 是这套系统的核心,笔记质量决定了知识库的长期价值。 + +### 原则 + +- **一则笔记 = 一个想法** — 如果你想写两件事,就写两则笔记然后互相链接 +- **用自己的话写** — 不是复制粘贴,而是消化后用自己的语言表达 +- **重链接、轻分类** — 用 `[[]]` 把相关笔记连起来,不用纠结它该放哪个子文件夹 +- **写给未来的自己** — 几个月后再看,你还能理解这则笔记在说什么 + +### 文件命名 + +使用时间戳前缀确保唯一性:`YYYYMMDDHHMMSS 标题` + +例如:`20260307120000 PARA 与 Zettelkasten 的互补关系` + +### 常用 Tags + +| Tag | 用途 | +|-----|------| +| `#concept` | 概念定义 | +| `#insight` | 个人洞察 | +| `#question` | 待探索的问题 | +| `#principle` | 原则或心法 | +| `#connection` | 跨领域链接 | + +## 模板说明 + +| 模板 | 用途 | 使用场景 | +|------|------|---------| +| Inbox Note | 快速捕捉 | 任何新想法 | +| Daily Note | 每日日记 | 每天打开 Obsidian 时自动创建 | +| Zettelkasten Note | 原子笔记 | 提炼个人洞察 | +| Project Note | 项目管理 | 新项目启动 | +| Resource Note | 资料整理 | 收集参考信息 | +| MOC | 主题索引 | 某个领域笔记积累到 5+ 则时建立 | + +使用方式:新建笔记 → Ctrl/Cmd + T → 选择模板 + +## 日常习惯建议 + +| 频率 | 动作 | +|------|------| +| 随时 | 有想法就丢进 Inbox | +| 每天 | 花 5 分钟回顾今天的笔记,补充链接 | +| 每周 | 花 15 分钟清理 Inbox,整理到对应文件夹 | +| 每月 | 用 Graph View 浏览笔记网络,发现新连接 | +| 每季 | 把完成的 Project 移到 Archive,审视 Areas 是否需要调整 | + +## Daily Notes 使用方式 + +Daily Note 存放在独立的 `0 - Daily Notes/` 文件夹,与 Inbox 分开管理。 + +- 每天打开 Obsidian 时点击左侧日历图标(或 Ctrl/Cmd + P 搜索 "Daily note")自动创建当天日记 +- 在"今日捕捉"里随手记录想法 +- 在"回顾"里思考哪些想法值得发展成 Zettelkasten 笔记 +- 安装 **Calendar** 插件后,侧边栏会出现日历视图,点击日期即可跳转或创建对应日记 + +## MOC 使用方式 + +MOC(Map of Content)是主题索引笔记,当某个领域的笔记积累到 5 则以上时,建一个 MOC 把它们串起来。 + +例如在 `3 - Areas` 中建一个 `技术学习 MOC.md`: + +```markdown +# 技术学习 MOC + +## Python +- [[20260307xxxx 装饰器的本质是闭包]] +- [[20260308xxxx Python 类型提示最佳实践]] + +## 架构 +- [[20260310xxxx 六边形架构的核心思想]] +``` + +MOC 不是死板的目录,而是你对某个领域理解的地图,随时可以重新组织。 + +## 进阶建议 + +随着笔记增多,可以逐步引入: + +- **Templater 插件** — 自动生成时间戳文件名,简化 Zettelkasten 笔记创建流程 +- **Excalidraw 插件** — 在笔记中画概念图,可视化笔记之间的关系 +- **Git 同步** — 已配置 `.gitignore`,可以用 Git 做版本管理和多设备同步 +- **外部捕捉工具**(如 Antigravity)— 用 AI 工具快速整理想法,再导入 Obsidian 做长期知识管理 diff --git a/System/Attachments/README.md b/System/Attachments/README.md new file mode 100644 index 0000000..2d7338f --- /dev/null +++ b/System/Attachments/README.md @@ -0,0 +1,5 @@ +# Attachments + +图片、PDF、音频等附件统一存放在此文件夹。 + +在 Obsidian 中设置:Settings → Files & Links → Attachment folder path → `System/Attachments` diff --git a/System/Templates/Daily Note.md b/System/Templates/Daily Note.md new file mode 100644 index 0000000..af2f91d --- /dev/null +++ b/System/Templates/Daily Note.md @@ -0,0 +1,19 @@ +--- +created: "{{date:YYYY-MM-DD}}" +type: daily +--- + +# {{date:YYYY-MM-DD dddd}} + +## 今日捕捉 + +- + +## 待办 + +- [ ] + +## 回顾 + + + diff --git a/System/Templates/Inbox Note.md b/System/Templates/Inbox Note.md new file mode 100644 index 0000000..c33af39 --- /dev/null +++ b/System/Templates/Inbox Note.md @@ -0,0 +1,10 @@ +--- +created: "{{date:YYYY-MM-DD HH:mm}}" +type: inbox +--- + +# {{title}} + + + + diff --git a/System/Templates/MOC.md b/System/Templates/MOC.md new file mode 100644 index 0000000..85f4a51 --- /dev/null +++ b/System/Templates/MOC.md @@ -0,0 +1,20 @@ +--- +created: "{{date:YYYY-MM-DD}}" +type: moc +--- + +# {{title}} + + + +## Overview + +- + +## Key Notes + +- + +## Related MOCs + +- diff --git a/System/Templates/Project Note.md b/System/Templates/Project Note.md new file mode 100644 index 0000000..9b21c3f --- /dev/null +++ b/System/Templates/Project Note.md @@ -0,0 +1,24 @@ +--- +created: "{{date:YYYY-MM-DD}}" +type: project +status: active +deadline: "" +--- + +# {{title}} + +## Goal + + + +## Tasks + +- [ ] + +## Notes + +- + +## Related + +- diff --git a/System/Templates/Resource Note.md b/System/Templates/Resource Note.md new file mode 100644 index 0000000..827edbb --- /dev/null +++ b/System/Templates/Resource Note.md @@ -0,0 +1,20 @@ +--- +created: "{{date:YYYY-MM-DD}}" +type: resource +tags: [] +source: "" +--- + +# {{title}} + +## Summary + + + +## Key Points + +- + +## Related + +- diff --git a/System/Templates/Zettelkasten Note.md b/System/Templates/Zettelkasten Note.md new file mode 100644 index 0000000..8b601a5 --- /dev/null +++ b/System/Templates/Zettelkasten Note.md @@ -0,0 +1,22 @@ +--- +created: "{{date:YYYY-MM-DD HH:mm}}" +type: zettel +tags: [] +source: "" +--- + +# {{title}} + + + + + +--- + +## Related + +- + +## Source + +-