From 42532904dd5ee0683620aae9c35daa1e0136481c Mon Sep 17 00:00:00 2001 From: Olexii Bulhakov Date: Sat, 6 Jan 2024 23:05:43 +0200 Subject: [PATCH] Tested publishing from obsidian --- .gitignore | 1 + docs/_obsidian/.obsidian/.DS_Store | Bin 0 -> 6148 bytes docs/_obsidian/.obsidian/app.json | 1 + docs/_obsidian/.obsidian/appearance.json | 3 + .../.obsidian/community-plugins.json | 4 + .../.obsidian/core-plugins-migration.json | 30 + docs/_obsidian/.obsidian/core-plugins.json | 20 + docs/_obsidian/.obsidian/graph.json | 22 + docs/_obsidian/.obsidian/plugins/.DS_Store | Bin 0 -> 6148 bytes .../number-headings-obsidian/data.json | 13 + .../plugins/number-headings-obsidian/main.js | 1136 +++++++++++++++++ .../number-headings-obsidian/manifest.json | 10 + .../number-headings-obsidian/styles.css | 8 + .../obsidian-mkdocs-publisher/data.json | 86 ++ .../plugins/obsidian-mkdocs-publisher/main.js | 48 + .../obsidian-mkdocs-publisher/manifest.json | 12 + .../obsidian-mkdocs-publisher/styles.css | 1 + docs/_obsidian/.obsidian/workspace.json | 158 +++ .../calculation-method/appendix-a.md | 1021 +++++++++++++++ .../calculation-method/calculation-method.md | 172 +++ docs/_obsidian/index.md | 14 + 21 files changed, 2760 insertions(+) create mode 100644 docs/_obsidian/.obsidian/.DS_Store create mode 100644 docs/_obsidian/.obsidian/app.json create mode 100644 docs/_obsidian/.obsidian/appearance.json create mode 100644 docs/_obsidian/.obsidian/community-plugins.json create mode 100644 docs/_obsidian/.obsidian/core-plugins-migration.json create mode 100644 docs/_obsidian/.obsidian/core-plugins.json create mode 100644 docs/_obsidian/.obsidian/graph.json create mode 100644 docs/_obsidian/.obsidian/plugins/.DS_Store create mode 100644 docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json create mode 100644 docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js create mode 100644 docs/_obsidian/.obsidian/plugins/number-headings-obsidian/manifest.json create mode 100644 docs/_obsidian/.obsidian/plugins/number-headings-obsidian/styles.css create mode 100644 docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/data.json create mode 100644 docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/main.js create mode 100644 docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/manifest.json create mode 100644 docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/styles.css create mode 100644 docs/_obsidian/.obsidian/workspace.json create mode 100644 docs/_obsidian/calculation-method/appendix-a.md create mode 100644 docs/_obsidian/calculation-method/calculation-method.md create mode 100644 docs/_obsidian/index.md diff --git a/.gitignore b/.gitignore index 74a9223..cd32001 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ _site/ # Ignore folders generated by Bundler .bundle/ vendor/ +docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/env diff --git a/docs/_obsidian/.obsidian/.DS_Store b/docs/_obsidian/.obsidian/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8e80f32acd221ab17ef8bb3adb422055ffd71bf3 GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO({YSiXIod7ObrlikDF93mDOZN^MA~!I&*gYY(N6tG#2n8txLgqqO$p#Y&Jx2ryq`@Mc1aZMc zf6+wWUWEz7Fo!XG`hFFl=Pj7TQ95fj-$kih+1jo;Rj2OU`44L0&xW&k+8a)9XmqJm z9OU{ixQa%LfxCOAlG!jyMpK;-g(D2Py^fMlEqZF6gsIN;jl-!qwSl|8Ty|Ow*=~1N z4Y};LnhklHGa27G=-YZ{^WhE3w^UBcZsA6cp6gE&({8edItpjbDS5T32oZV;gdMUM+!3sxi-T0> zdS-w-+^H8A2ZKswqa-%V!;%4*^)kZt}@Tg=G z1H=F^@G}h91BTE3%ycvhF+dFbBL>v@AW#*$7BhqT=)gvo0El^XYe8Gp5-LYnbS-8E zaRh~#R78`?Y>B~4I{Jl;b1h~DO*$}Jd@#E*vlR-{tKDj~E~Z{uKi(U-N2J+>*Up$2O<#T7i0oszk+Q2H#WA&{r|Ws;hVjRSWus XG7w#hnL+fR(2szoff{1qR~dK%TLN^R literal 0 HcmV?d00001 diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json new file mode 100644 index 0000000..6cdef25 --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/data.json @@ -0,0 +1,13 @@ +{ + "skipTopLevel": false, + "firstLevel": 2, + "maxLevel": 6, + "styleLevel1": "1", + "styleLevelOther": "1", + "auto": false, + "separator": "", + "contents": "", + "skipHeadings": "", + "startAt": "", + "off": false +} \ No newline at end of file diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js new file mode 100644 index 0000000..ff3e07f --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/main.js @@ -0,0 +1,1136 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ROLLUP +if you want to view the source visit the plugins github repository +*/ + +'use strict'; + +var obsidian = require('obsidian'); + +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function getActiveView(app) { + const activeView = app.workspace.getActiveViewOfType(obsidian.MarkdownView); + return activeView !== null && activeView !== void 0 ? activeView : undefined; +} +function isViewActive(app) { + const activeView = getActiveView(app); + if (activeView && activeView.file) + return true; + return false; +} +function getViewMetadata(app) { + const activeView = getActiveView(app); + if (activeView && activeView.file) { + const data = app.metadataCache.getFileCache(activeView.file) || {}; + return data; + } + return undefined; +} +function getViewInfo(app) { + const activeView = getActiveView(app); + const data = getViewMetadata(app); + const editor = activeView ? activeView.editor : undefined; + if (activeView && data && editor) { + return { + activeView, data, editor + }; + } + return undefined; +} + +const roman_map = { + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1 +}; + +const allChars = Object.keys(roman_map); +const allNumerals = Object.values(roman_map); +const romanPattern = + /^(M{1,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|C?D|D?C{1,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|X?L|L?X{1,3})(IX|IV|V?I{0,3})|M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|I?V|V?I{1,3}))$/; + +const romanize = (decimal) => { + if ( + decimal <= 0 || + typeof decimal !== 'number' || + Math.floor(decimal) !== decimal + ) { + throw new Error('requires an unsigned integer') + } + if (decimal >= 4000) { + throw new Error('requires max value of less than 3999 or less') + } + let roman = ''; + for (let i = 0; i < allChars.length; i++) { + while (decimal >= allNumerals[i]) { + decimal -= allNumerals[i]; + roman += allChars[i]; + } + } + return roman +}; + +const deromanize = (romanStr) => { + if (typeof romanStr !== 'string') { + throw new Error('requires a string') + } + if (!romanPattern.test(romanStr)) { + throw new Error('requires valid roman numeral string') + } + let romanString = romanStr.toUpperCase(); + let arabic = 0; + let iteration = romanString.length; + while (iteration--) { + let cumulative = roman_map[romanString[iteration]]; + if (cumulative < roman_map[romanString[iteration + 1]]) { + arabic -= cumulative; + } else { + arabic += cumulative; + } + } + return arabic +}; + +var romans = { + deromanize, + romanize, + allChars, + allNumerals +}; + +// Validates the string using a regex to ensure is is a valid arabic numbering value +function isValidArabicNumberingValueString(s) { + const regex = /^[0-9]+$/; + return regex.test(s); +} +// Validates the string using a regex to ensure is is a valid alphabet numbering value +function isValidAlphabetNumberingValueString(s) { + const regex = /^[A-Z]$/; + return regex.test(s); +} +// Validates the string using a regex to ensure is is a valid roman numbering value +function isValidRomanNumberingValueString(s) { + const regex = /^[0IVXLCDM]+$/; // This includes zero for zeroth testing + return regex.test(s); +} +function printableNumberingToken(t) { + switch (t.style) { + case '1': + return t.value.toString(); + case 'A': + return t.value; + case 'I': + return t.value; + } +} +function zerothNumberingTokenInStyle(style) { + switch (style) { + case '1': + return { style: '1', value: 0 }; + case 'A': + return { style: 'A', value: 'Z' }; + case 'I': + return { style: 'I', value: '0' }; + } +} +function firstNumberingTokenInStyle(style) { + switch (style) { + case '1': + return { style: '1', value: 1 }; + case 'A': + return { style: 'A', value: 'A' }; + case 'I': + return { style: 'I', value: 'I' }; + } +} +function nextNumberingToken(t) { + switch (t.style) { + case '1': + return { style: '1', value: t.value + 1 }; + case 'A': + if (t.value === 'Z') + return { style: 'A', value: 'A' }; + else + return { style: 'A', value: String.fromCharCode(t.value.charCodeAt(0) + 1) }; + case 'I': + if (t.value === '0') + return { style: 'I', value: 'I' }; + else + return { style: 'I', value: romans.romanize(romans.deromanize(t.value) + 1) }; + } +} +function previousNumberingToken(t) { + switch (t.style) { + case '1': + return { style: '1', value: t.value - 1 }; + case 'A': + if (t.value === 'A') + return { style: 'A', value: 'Z' }; + else + return { style: 'A', value: String.fromCharCode(t.value.charCodeAt(0) - 1) }; + case 'I': + if (t.value === 'I') + return { style: 'I', value: '0' }; + else + return { style: 'I', value: romans.romanize(romans.deromanize(t.value) - 1) }; + } +} +function makeNumberingString(numberingStack) { + let numberingString = ''; + for (let i = 0; i < numberingStack.length; i++) { + if (i === 0) { + numberingString += ' '; + } + else { + numberingString += '.'; + } + numberingString += printableNumberingToken(numberingStack[i]); + } + return numberingString; +} +function startAtOrZerothInStyle(startAtSettingString, style) { + if (startAtSettingString === '') + return zerothNumberingTokenInStyle(style); + let firstNumberingTokenFromSetting; + switch (style) { + case '1': + if (!isValidArabicNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: '1', value: parseInt(startAtSettingString) }; + break; + case 'A': + if (!isValidAlphabetNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: 'A', value: startAtSettingString }; + break; + case 'I': + if (!isValidRomanNumberingValueString(startAtSettingString)) + return zerothNumberingTokenInStyle(style); + firstNumberingTokenFromSetting = { style: 'I', value: startAtSettingString }; + break; + } + // Convert the first numbering token to a zeroth numbering token + return previousNumberingToken(firstNumberingTokenFromSetting); +} + +const DEFAULT_SETTINGS = { + skipTopLevel: false, + firstLevel: 1, + maxLevel: 6, + styleLevel1: '1', + styleLevelOther: '1', + auto: false, + separator: '', + contents: '', + skipHeadings: '', + startAt: '', + off: false +}; +function isValidNumberingStyleString(s) { + if (s === 'A' || s === '1' || s === 'I') + return true; + return false; +} +function isValidNumberingValueString(s) { + if (s === '' || isValidArabicNumberingValueString(s) || isValidAlphabetNumberingValueString(s) || isValidRomanNumberingValueString(s)) + return true; + return false; +} +function isValidFlag(f) { + if (f === true || f === false) + return true; + return false; +} +function isValidFirstOrMaxLevel(x) { + if (typeof x === 'number' && x >= 1 && x <= 6) + return true; + return false; +} +function isValidSeparator(x) { + return typeof x === 'string' && + (x === '' || + x === ':' || x === ' :' || + x === '.' || x === ' .' || + x === '-' || x === ' -' || + x === '—' || x === ' —' || /* em-dash */ + x === ')' || x === ' )'); +} +function isValidBlockIdSetting(x) { + if (typeof x === 'string' && (x === '' || x.startsWith('^'))) + return true; + return false; +} +function isNonEmptyBlockId(x) { + if (x.length > 2 && x.startsWith('^')) + return true; + return false; +} + +function createSupportFlagsFromSettings(styleLevel1, styleLevelOther) { + return { + alphabet: styleLevel1 === 'A' || styleLevelOther === 'A', + roman: styleLevel1 === 'I' || styleLevelOther === 'I' + }; +} +// Get the regex for the header string, based on the support flags. The generated regex is used to find the range of the header prefix. +// The regex is generated dynamically, because the regex is different depending on the support flags. +function getRegexForHeaderString(flags) { + if (flags.alphabet && flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[A-Z]\.|[IVXLCDM]+\.)*([0-9]+|[A-Z]|[IVXLCDM]+)?( )?[)—:.-]?( )+/g; + } + else if (!flags.alphabet && flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[IVXLCDM]+\.)*([0-9]+|[IVXLCDM]+)?( )?[)—:.-]?( )+/g; + } + else if (flags.alphabet && !flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.|[A-Z]\.)*([0-9]+|[A-Z])?( )?[)—:.-]?( )+/g; + } + else if (!flags.alphabet && !flags.roman) { + // Regex to match the heading prefix, including the space after the hash(es), but not the heading text + return /^\s{0,4}#+( )?([0-9]+\.)*([0-9]+)?( )?[)—:.-]?( )+/g; + } + throw new Error('Unexpected combination of support flags'); +} +// Find the range of the heading prefix, including the space after any numbering, but not the heading text +function findRangeInHeaderString(lineText, lineNumber, flags) { + const regex = getRegexForHeaderString(flags); + if (!lineText) + return undefined; + const matches = lineText.match(regex); + if (matches && matches.length !== 1) { + // eslint-disable-next-line no-console + console.log("Unexpected heading format: '" + lineText + "'"); + return undefined; + } + const match = matches ? matches[0] : ''; + const from = { + line: lineNumber, + ch: 0 + }; + const to = { + line: lineNumber, + ch: match.length + }; + return { from, to }; +} +function updateSettingsFromFrontMatterFormatPart(part, settings) { + // Parse the separator + let partWithoutSeparator = part; + const potentialTwoCharSeparator = part.slice(-2); + if (isValidSeparator(potentialTwoCharSeparator)) { + settings.separator = potentialTwoCharSeparator; + partWithoutSeparator = part.slice(0, -2); + } + else { + const potentialOneCharSeparator = part.slice(-1); + if (isValidSeparator(potentialOneCharSeparator)) { + settings.separator = potentialOneCharSeparator; + partWithoutSeparator = part.slice(0, -1); + } + else { + settings.separator = ''; + } + } + // Parse the numbering style + const descriptors = partWithoutSeparator.split('.'); + let firstNumberedDescriptor = 0; + // Handle the case where the first descriptor is an underscore + if (descriptors.length > 1 && descriptors[0] === '_') { + // The first descriptor is an instruction to skip top levels, so skip them + settings.skipTopLevel = true; + firstNumberedDescriptor = 1; + } + else { + settings.skipTopLevel = false; + } + if (descriptors.length - firstNumberedDescriptor >= 2) { + const styleLevel1 = descriptors[firstNumberedDescriptor]; + if (isValidNumberingStyleString(styleLevel1)) { + settings.styleLevel1 = styleLevel1; + } + const styleLevelOther = descriptors[firstNumberedDescriptor + 1]; + if (isValidNumberingStyleString(styleLevelOther)) { + settings.styleLevelOther = styleLevelOther; + } + } + return settings; +} + +const AUTO_PART_KEY = 'auto'; +const FIRST_LEVEL_PART_KEY = 'first-level'; +const MAX_LEVEL_PART_KEY = 'max'; +const CONTENTS_PART_KEY = 'contents'; +const SKIP_PART_KEY = 'skip'; +const START_AT_PART_KEY = 'start-at'; +const OFF_PART_KEY = 'off'; +function parseCompactFrontMatterSettings(fm) { + const entry = obsidian.parseFrontMatterEntry(fm, 'number headings'); + if (entry) { + const entryString = String(entry); + const parts = entryString.split(','); + let settings = Object.assign({}, DEFAULT_SETTINGS); + for (const part of parts) { + const trimmedPart = part.trim(); + if (trimmedPart.length === 0) + continue; + if (trimmedPart === OFF_PART_KEY) { + // Parse off part + settings.off = true; + } + else if (trimmedPart === AUTO_PART_KEY) { + // Parse auto numbering part + settings.auto = true; + } + else if (trimmedPart.startsWith(FIRST_LEVEL_PART_KEY)) { + // Parse first level part + const nstring = trimmedPart.substring(FIRST_LEVEL_PART_KEY.length + 1); + const n = parseInt(nstring); + if (isValidFirstOrMaxLevel(n)) { + settings.firstLevel = n; + } + } + else if (trimmedPart.startsWith(MAX_LEVEL_PART_KEY)) { + // Parse max level part + const nstring = trimmedPart.substring(MAX_LEVEL_PART_KEY.length + 1); + const n = parseInt(nstring); + if (isValidFirstOrMaxLevel(n)) { + settings.maxLevel = n; + } + } + else if (trimmedPart.startsWith(START_AT_PART_KEY)) { + // Parse "start at" part + const value = trimmedPart.substring(START_AT_PART_KEY.length + 1); + if (isValidNumberingValueString(value)) { + settings.startAt = value; + } + } + else if (trimmedPart.startsWith(CONTENTS_PART_KEY)) { + if (trimmedPart.length <= CONTENTS_PART_KEY.length + 1) + continue; + // Parse contents heading part + const tocHeadingBlockIdName = trimmedPart.substring(CONTENTS_PART_KEY.length + 1); + if (isValidBlockIdSetting(tocHeadingBlockIdName)) { + settings.contents = tocHeadingBlockIdName; + } + } + else if (trimmedPart.startsWith(SKIP_PART_KEY)) { + if (trimmedPart.length <= SKIP_PART_KEY.length + 1) + continue; + // Parse skip heading part + const skipHeadingBlockIdName = trimmedPart.substring(SKIP_PART_KEY.length + 1); + if (isValidBlockIdSetting(skipHeadingBlockIdName)) { + settings.skipHeadings = skipHeadingBlockIdName; + } + } + else { + // Parse formatting part + settings = updateSettingsFromFrontMatterFormatPart(trimmedPart, settings); + } + } + return settings; + } + return undefined; +} +const getFrontMatterSettingsOrAlternative = ({ frontmatter }, alternativeSettings) => { + var _a, _b, _c, _d, _e; + if (frontmatter !== undefined) { + const decompactedSettings = parseCompactFrontMatterSettings(frontmatter); + if (decompactedSettings !== undefined) + return decompactedSettings; + // NOTE: Everything below is for backwards compatibility only + const skipTopLevelEntry = (_a = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-skip-top-level')) !== null && _a !== void 0 ? _a : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-skip-top-level'); + const skipTopLevel = isValidFlag(skipTopLevelEntry) ? skipTopLevelEntry : alternativeSettings.skipTopLevel; + const maxLevelEntry = (_b = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-max-level')) !== null && _b !== void 0 ? _b : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-max-level'); + const maxLevel = isValidFirstOrMaxLevel(maxLevelEntry) ? maxLevelEntry : alternativeSettings.maxLevel; + const styleLevel1Entry = String((_c = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-style-level-1')) !== null && _c !== void 0 ? _c : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-style-level-1')); + const styleLevel1 = isValidNumberingStyleString(styleLevel1Entry) ? styleLevel1Entry : alternativeSettings.styleLevel1; + const styleLevelOtherEntry = String((_d = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-style-level-other')) !== null && _d !== void 0 ? _d : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-style-level-other')); + const styleLevelOther = isValidNumberingStyleString(styleLevelOtherEntry) ? styleLevelOtherEntry : alternativeSettings.styleLevelOther; + const autoEntry = (_e = obsidian.parseFrontMatterEntry(frontmatter, 'number-headings-auto')) !== null && _e !== void 0 ? _e : obsidian.parseFrontMatterEntry(frontmatter, 'header-numbering-auto'); + const auto = isValidFlag(autoEntry) ? autoEntry : alternativeSettings.auto; + return Object.assign(Object.assign({}, alternativeSettings), { skipTopLevel, maxLevel, styleLevel1, styleLevelOther, auto }); + } + else { + return alternativeSettings; + } +}; +function settingsToCompactFrontMatterValue(settings) { + if (settings.off) + return OFF_PART_KEY; + const autoPart = settings.auto ? 'auto, ' : ''; + const firstLevelPart = `first-level ${settings.firstLevel}, `; + const maxPart = `max ${settings.maxLevel}, `; + const contentsPart = settings.contents && settings.contents.length > 0 ? `contents ${settings.contents}, ` : ''; + const skipHeadingsPart = settings.skipHeadings && settings.skipHeadings.length > 0 ? `skip ${settings.skipHeadings}, ` : ''; + const skipTopLevelString = settings.skipTopLevel ? '_.' : ''; + const stylePart = `${skipTopLevelString}${settings.styleLevel1}.${settings.styleLevelOther}${settings.separator}`; + const startAtPart = settings.startAt !== '' ? `start-at ${settings.startAt}, ` : ''; + return autoPart + firstLevelPart + maxPart + contentsPart + skipHeadingsPart + startAtPart + stylePart; +} +const saveSettingsToFrontMatter = (fileManager, file, settings) => { + fileManager.processFrontMatter(file, frontmatter => { + const v = settingsToCompactFrontMatterValue(settings); + frontmatter['number headings'] = v; + }); +}; + +class NumberingDoneModal extends obsidian.Modal { + constructor(app, config) { + super(app); + this.config = config; + } + onOpen() { + const { contentEl, titleEl } = this; + titleEl.setText('Number Headings - Successfully Completed'); + contentEl.createEl('div', { text: this.config.message }); + contentEl.createEl('pre', { text: this.config.preformattedMessage }); + contentEl.createEl('div', { text: "Do you want to save these settings in the document's front matter?", cls: 'number-headings-question' }); + const containerForButtons = contentEl.createEl('div', { cls: 'number-headings-button-container' }); + const noButton = containerForButtons.createEl('button', {}); + noButton.setText('No'); + noButton.onClickEvent((ev) => { + this.close(); + return ev; + }); + const yesButton = containerForButtons.createEl('button', {}); + yesButton.setText('Yes, save settings in document'); + yesButton.onClickEvent((ev) => { + this.config.saveSettingsCallback(false); + this.close(); + return ev; + }); + const yesAndAutoButton = containerForButtons.createEl('button', {}); + yesAndAutoButton.setText('Yes, save settings in document, and automatically number'); + yesAndAutoButton.onClickEvent((ev) => { + this.config.saveSettingsCallback(true); + this.close(); + return ev; + }); + } + onClose() { + const { contentEl, titleEl } = this; + contentEl.empty(); + titleEl.empty(); + } +} +function showNumberingDoneMessage(app, settings) { + const saveSettingsCallback = (shouldAddAutoFlag) => { + const tweakedSettings = Object.assign({}, settings); + if (shouldAddAutoFlag) + tweakedSettings.auto = true; + const file = app.workspace.getActiveFile(); + if (file) { + saveSettingsToFrontMatter(app.fileManager, file, tweakedSettings); + } + }; + const config = { + message: `Successfully updated all heading numbers in the document, using the settings below. + See settings panel to change how headings are numbered, or use front matter + (see settings panel).`, + preformattedMessage: `Skip top heading level: ${settings.skipTopLevel} +First heading level: ${settings.firstLevel} +Start numbering first heading at: ${settings.startAt} +Maximum heading level: ${settings.maxLevel} +Style for level 1 headings: ${settings.styleLevel1} +Style for lower level headings (below level 1): ${settings.styleLevelOther} +Separator: ${settings.separator} +Table of Contents Anchor: ${settings.contents} +Skip Headings Anchor: ${settings.skipHeadings}`, + saveSettingsCallback + }; + const leaf = app.workspace.activeLeaf; + if (leaf) { + new NumberingDoneModal(app, config).open(); + } +} + +const TOC_LIST_ITEM_BULLET = '-'; +function makeHeadingHashString(editor, heading) { + const regex = /^\s{0,4}#+/g; + const headingLineString = editor.getLine(heading.position.start.line); + if (!headingLineString) + return undefined; + const matches = headingLineString.match(regex); + if (!matches) + return undefined; + if (matches.length !== 1) { + // eslint-disable-next-line no-console + console.log("Unexpected heading format: '" + headingLineString + "'"); + return undefined; + } + const match = matches[0]; + return match.trimLeft(); +} +function findHeadingPrefixRange(editor, heading, flags) { + const lineNumber = heading.position.start.line; + const lineText = editor.getLine(lineNumber); + return findRangeInHeaderString(lineText, lineNumber, flags); +} +function cleanHeadingTextForToc(htext) { + if (htext.contains('^')) { + const x = htext.split('^'); + if (x.length > 1) { + return x[0].trim(); + } + } + return htext.trim(); +} +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function createTocEntry(h, settings, initialHeadingLevel) { + const text = h.heading; + const cleanText = cleanHeadingTextForToc(text); + let bulletIndent = ''; + const startLevel = initialHeadingLevel; + for (let i = startLevel; i < h.level; i++) { + bulletIndent += '\t'; + } + const entryLink = `[[#${text}|${cleanText}]]`; + return bulletIndent + TOC_LIST_ITEM_BULLET + ' ' + entryLink; +} +// Replace a range, but only if there is a change in text, to prevent poluting the undo stack +function replaceRangeEconomically(editor, changes, range, text) { + const previousText = editor.getRange(range.from, range.to); + if (previousText !== text) { + changes.push({ + text: text, + from: range.from, + to: range.to + }); + } +} +const updateHeadingNumbering = (viewInfo, settings) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + const supportFlags = createSupportFlagsFromSettings(settings.styleLevel1, settings.styleLevelOther); + let previousLevel = 1; + let numberingStack = [startAtOrZerothInStyle(settings.startAt, settings.styleLevel1)]; + if (settings.firstLevel > 1) { + previousLevel = settings.firstLevel; + } + else if (settings.skipTopLevel) { + previousLevel = 2; + } + const changes = []; + for (const heading of headings) { + // Update the numbering stack based on the level and previous level + const level = heading.level; + // Handle skipped & ignored levels. + if ((settings.firstLevel > level) || (settings.skipTopLevel && level === 1)) { + // Resets the numbering when a level is skipped. + // Note: This leaves headings as they are, allowing people to have numbers at the start of + // ignored headings. + numberingStack = [startAtOrZerothInStyle(settings.startAt, settings.styleLevel1)]; + if (settings.firstLevel > 1) { + previousLevel = settings.firstLevel; + } + else if (settings.skipTopLevel) { + previousLevel = 2; + } + continue; + } + // Handle skipped headings + if (settings.skipHeadings.length > 0) { + if (heading.heading.endsWith(settings.skipHeadings)) { + continue; + } + } + // Adjust numbering stack + if (level === previousLevel) { + const x = numberingStack.pop(); + if (x !== undefined) { + numberingStack.push(nextNumberingToken(x)); + } + } + else if (level < previousLevel) { + for (let i = previousLevel; i > level; i--) { + numberingStack.pop(); + } + const x = numberingStack.pop(); + if (x !== undefined) { + numberingStack.push(nextNumberingToken(x)); + } + } + else if (level > previousLevel) { + for (let i = previousLevel; i < level; i++) { + numberingStack.push(firstNumberingTokenInStyle(settings.styleLevelOther)); + } + } + // Set the previous level to this level for the next iteration + previousLevel = level; + if (level > settings.maxLevel) { + // If we are above the max level, just don't number it + continue; + } + // Find the range to replace, and then do it + const prefixRange = findHeadingPrefixRange(editor, heading, supportFlags); + if (prefixRange === undefined) + return; + const headingHashString = makeHeadingHashString(editor, heading); + if (headingHashString === undefined) + return; + const prefixString = makeNumberingString(numberingStack); + replaceRangeEconomically(editor, changes, prefixRange, headingHashString + prefixString + settings.separator + ' '); + } + // Execute the transaction to make all the changes at once + if (changes.length > 0) { + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Applying headings numbering changes:', changes.length); + editor.transaction({ + changes: changes + }); + } +}; +const updateTableOfContents = (viewInfo, settings) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + if (!isNonEmptyBlockId(settings.contents)) + return; + let tocHeading; + let tocBuilder = '\n'; + const changes = []; + // In case headings start above level 1, we don't want to indent the bullets too much + let initialHeadingLevel = 1; + if (headings.length > 0) { + initialHeadingLevel = headings[0].level; + } + for (const heading of headings) { + // ORDERING: Important to find the TOC heading before skipping skipped headings, since that is for numbering + // Find the TOC heading + if (heading.heading.endsWith(settings.contents)) { + tocHeading = heading; + } + /* This code lets us skip TOC lines for skipped headings, but doesn't work well with first-level setting + if ((settings.skipTopLevel && heading.level === 1) || (heading.level > settings.maxLevel)) { + continue + } + */ + const tocEntry = createTocEntry(heading, settings, initialHeadingLevel); + tocBuilder += tocEntry + '\n'; + } + // Insert the generated table of contents + if (tocHeading) { + const from = { + line: tocHeading.position.start.line + 1, + ch: 0 + }; + // Find the end of the TOC section + const startingLine = tocHeading.position.start.line + 1; + let endingLine = startingLine; + let foundList = false; + const lastLineInEditor = editor.lastLine(); + for (;; endingLine++) { + const line = editor.getLine(endingLine); + if (line === undefined || endingLine > lastLineInEditor) { + // Reached end of file, insert at the start of the TOC section + endingLine = startingLine; + break; + } + const trimmedLineText = line.trimStart(); + if (foundList) { + if (!trimmedLineText.startsWith(TOC_LIST_ITEM_BULLET)) + break; + if (trimmedLineText.startsWith('#')) + break; + } + else { + if (trimmedLineText.startsWith(TOC_LIST_ITEM_BULLET)) { + foundList = true; + } + else if (trimmedLineText.startsWith('#')) { + // Reached the next heading without finding existing TOC list, insert at the start of the TOC section + endingLine = startingLine; + break; + } + else { + continue; + } + } + } + if (tocBuilder === '\n') { + tocBuilder = ''; + } + const to = { + line: endingLine, + ch: 0 + }; + const range = { from, to }; + replaceRangeEconomically(editor, changes, range, tocBuilder); + } + // Execute the transaction to make all the changes at once + if (changes.length > 0) { + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Applying table of contents changes:', changes.length); + editor.transaction({ + changes: changes + }); + } +}; +const removeHeadingNumbering = (viewInfo) => { + var _a; + if (!viewInfo) + return; + const headings = (_a = viewInfo.data.headings) !== null && _a !== void 0 ? _a : []; + const editor = viewInfo.editor; + const changes = []; + for (const heading of headings) { + const prefixRange = findHeadingPrefixRange(editor, heading, { alphabet: true, roman: true }); + if (prefixRange === undefined) + return; + const headingHashString = makeHeadingHashString(editor, heading); + if (headingHashString === undefined) + return; + replaceRangeEconomically(editor, changes, prefixRange, headingHashString + ' '); + } + if (changes.length > 0) { + editor.transaction({ + changes: changes + }); + } +}; + +class NumberHeadingsPluginSettingTab extends obsidian.PluginSettingTab { + constructor(app, plugin) { + super(app, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl('h2', { text: 'Number Headings - Settings' }); + containerEl.createEl('div', { text: 'To add numbering to your document, bring up the command window (on Mac, type CMD+P), and then type "Number Headings" to see a list of available commands.' }); + containerEl.createEl('br', {}); + containerEl.createEl('div', { text: 'If the document has front matter defined with the below settings, the project-wide settings defined on this screen will be ignored. You can define front matter like this:' }); + containerEl.createEl('pre', { + text: ` --- + alias: + - Example Alias + tags: + - example-tag + number headings: first-level 1, start-at 2, max 6, 1.1, auto, contents ^toc + ---` + }); + containerEl.createEl('div', { + text: ` + The 'number headings' front matter key is used to store numbering settings specific to the file. There are four possible options + in the value to the right of the colon, separated by commas. + ` + }); + const ul = containerEl.createEl('ul', {}); + const li0 = ul.createEl('li', {}); + li0.createEl('b', { text: 'Automatic numbering' }); + li0.createEl('span', { text: ': If \'auto\' appears, the document will be automatically numbered.' }); + const li1 = ul.createEl('li', {}); + li1.createEl('b', { text: 'First level to number' }); + li1.createEl('span', { text: ': If \'first-level 2\' appears, the numbering will start at the second level' }); + const li2 = ul.createEl('li', {}); + li2.createEl('b', { text: 'Start numbering first heading at' }); + li2.createEl('span', { text: ': If \'start-at C\' appears, the numbering of the first level will start at C, instead of A' }); + const li3 = ul.createEl('li', {}); + li3.createEl('b', { text: 'Maximum level to number' }); + li3.createEl('span', { text: ': If \'max 6\' appears, the headings above level 6 will be skipped.' }); + const li4 = ul.createEl('li', {}); + li4.createEl('b', { text: 'Table of contents anchor' }); + li4.createEl('span', { text: ': If \'contents ^toc\' appears, the heading that ends with the anchor ^toc will have a table of contents inserted beneath it.' }); + const li41 = ul.createEl('li', {}); + li41.createEl('b', { text: 'Skip headings anchor' }); + li41.createEl('span', { text: ': If \'skip ^skipped\' appears, the heading that ends with the anchor ^skipped will not be numbered.' }); + const li5 = ul.createEl('li', {}); + li5.createEl('b', { text: 'Numbering style' }); + li5.createEl('span', { + text: `: + A style text like '1.1', 'A.1', or '_.1.1' tells the plugin how to format the headings. + If a style string ends with '.' (a dot), ':' (a colon), '-' (a dash), '—' (an emdash), or ')' (a right parenthesis), the heading numbers will be separated from the heading title + with that symbol.` + }); + const ul3 = li5.createEl('ul', {}); + ul3.createEl('li', { + text: ` + For example, '1.1' means both top level and other headings will be numbered starting from '1'. + ` + }); + ul3.createEl('li', { + text: ` + For example, 'A.1' means top level headings will be numbered starting from 'A'. + ` + }); + ul3.createEl('li', { + text: ` + For example, '_.A.1' means top level headings will NOT be numbered, but the next levels will be numbered with letters and numbers. + ` + }); + ul3.createEl('li', { + text: ` + For example, '1.1:' means headings will look like '## 2.4: Example Heading' + ` + }); + ul3.createEl('li', { + text: ` + For example, 'A.1-' means headings will look like '## B.5- Example Heading' + ` + }); + ul3.createEl('li', { + text: ` + For example, 'I.A —' means headings will look like '## IV.A — Example Heading' (with Roman numerals) + ` + }); + const li100 = ul.createEl('li', {}); + li100.createEl('b', { text: 'Numbering off' }); + li100.createEl('span', { text: ': If \'off\' appears, the document will not be numbered.' }); + new obsidian.Setting(containerEl) + .setName('Skip top heading level') + .setDesc('If selected, numbering will not be applied to the top heading level.') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.skipTopLevel) + .setTooltip('Skip top heading level') + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.skipTopLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('First heading level') + .setDesc('First heading level to number.') + .addSlider(slider => slider + .setLimits(1, 6, 1) + .setValue(this.plugin.settings.firstLevel) + .setDynamicTooltip() + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.firstLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Start numbering at') + .setDesc('Start numbering the first heading level from this value.') + .addText(text => text + .setValue(this.plugin.settings.startAt) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.startAt = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Maximum heading level') + .setDesc('Maximum heading level to number.') + .addSlider(slider => slider + .setLimits(1, 6, 1) + .setValue(this.plugin.settings.maxLevel) + .setDynamicTooltip() + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.maxLevel = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Style for level 1 headings') + .setDesc('Defines the numbering style for level one headings. Valid values are 1 (for numbers) or A (for capital letters) or I (for Roman numerals).') + .addText(text => text + .setValue(this.plugin.settings.styleLevel1) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.styleLevel1 = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Style for lower level headings (below level 1)') + .setDesc('Defines the numbering style for headings below level one. Valid values are 1 (for numbers) or A (for capital letters) or I (for Roman numerals).') + .addText(text => text + .setValue(this.plugin.settings.styleLevelOther) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.styleLevelOther = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Automatic numbering') + .setDesc('Turns on automatic numbering of documents.') + .addToggle(toggle => toggle + .setValue(this.plugin.settings.auto) + .setTooltip('Turn on automatic numbering') + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.auto = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Separator style') + .setDesc('Defines the separator style between the heading number and the heading text. Valid values are : (colon) or . (dot) or - (dash) or — (emdash) or ) (a right parenthesis). You can also leave it blank for no separator, or have a space before the separator.') + .addText(text => text + .setValue(this.plugin.settings.separator) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.separator = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Table of Contents Anchor') + .setDesc('Anchor which labels the header where a table of contents should be inserted. The anchor should be added at the end of a header. For example, ^toc.') + .addText(text => text + .setValue(this.plugin.settings.contents) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.contents = value; + yield this.plugin.saveSettings(); + }))); + new obsidian.Setting(containerEl) + .setName('Skip Headings Anchor') + .setDesc('Anchor which labels the headers that should not be numbered. The anchor should be added at the end of a header. For example, ^skipped.') + .addText(text => text + .setValue(this.plugin.settings.skipHeadings) + .onChange((value) => __awaiter(this, void 0, void 0, function* () { + this.plugin.settings.skipHeadings = value; + yield this.plugin.saveSettings(); + }))); + } +} +class NumberHeadingsPlugin extends obsidian.Plugin { + onload() { + return __awaiter(this, void 0, void 0, function* () { + // eslint-disable-next-line no-console + console.info('Loading Number Headings Plugin, version ' + this.manifest.version); + yield this.loadSettings(); + this.addCommand({ + id: 'number-headings-with-options', + name: 'Number all headings in document (and show options)', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return false; + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + showNumberingDoneMessage(this.app, settings); + } + return false; + } + }); + this.addCommand({ + id: 'number-headings', + name: 'Number all headings in document', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return false; + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + // NOTE: The line below is intentionally commented out, since this command is the same as + // the above command, except for this line + // showNumberingDoneMessage(this.app, settings, viewInfo) + } + return false; + } + }); + this.addCommand({ + id: 'remove-number-headings', + name: 'Remove numbering from all headings in document', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + removeHeadingNumbering(viewInfo); + return true; + } + }); + this.addCommand({ + id: 'save-settings-to-front-matter', + name: 'Save settings to front matter', + checkCallback: (checking) => { + if (checking) + return isViewActive(this.app); + const viewInfo = getViewInfo(this.app); + const file = this.app.workspace.getActiveFile(); + if (viewInfo && file) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + saveSettingsToFrontMatter(this.app.fileManager, file, settings); + } + return false; + } + }); + this.addSettingTab(new NumberHeadingsPluginSettingTab(this.app, this)); + this.registerInterval(window.setInterval(() => { + const viewInfo = getViewInfo(this.app); + if (viewInfo) { + const settings = getFrontMatterSettingsOrAlternative(viewInfo.data, this.settings); + if (settings.off) + return; + if (settings.auto) { + updateHeadingNumbering(viewInfo, settings); + setTimeout(() => { + // HACK: This must happen after a timeout so that there is time for the editor transaction to complete + const postNumberingViewInfo = getViewInfo(this.app); + updateTableOfContents(postNumberingViewInfo, settings); + }, 3000); + // eslint-disable-next-line no-console + console.log('Number Headings Plugin: Automatically numbered document'); + } + } + }, 10 * 1000)); + }); + } + loadSettings() { + return __awaiter(this, void 0, void 0, function* () { + this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); + }); + } + saveSettings() { + return __awaiter(this, void 0, void 0, function* () { + yield this.saveData(this.settings); + }); + } +} + +module.exports = NumberHeadingsPlugin; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsInNyYy9hY3RpdmVWaWV3SGVscGVycy50cyIsIm5vZGVfbW9kdWxlcy9yb21hbnMvcm9tYW5zLmpzIiwic3JjL251bWJlcmluZ1Rva2Vucy50cyIsInNyYy9zZXR0aW5nc1R5cGVzLnRzIiwic3JjL3RleHRQcm9jZXNzaW5nLnRzIiwic3JjL2Zyb250TWF0dGVyLnRzIiwic3JjL21lc3NhZ2VzLnRzIiwic3JjL251bWJlcmluZy50cyIsInNyYy9tYWluLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcclxuQ29weXJpZ2h0IChjKSBNaWNyb3NvZnQgQ29ycG9yYXRpb24uXHJcblxyXG5QZXJtaXNzaW9uIHRvIHVzZSwgY29weSwgbW9kaWZ5LCBhbmQvb3IgZGlzdHJpYnV0ZSB0aGlzIHNvZnR3YXJlIGZvciBhbnlcclxucHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZm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wocywgcCkpIHRbcF0gPSBzW3BdO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdDtcclxuICAgIH1cclxuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZXN0KHMsIGUpIHtcclxuICAgIHZhciB0ID0ge307XHJcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcclxuICAgICAgICB0W3BdID0gc1twXTtcclxuICAgIGlmIChzICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09IFwiZnVuY3Rpb25cIilcclxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcclxuICAgICAgICAgICAgICAgIHRbcFtpXV0gPSBzW3BbaV1dO1xyXG4gICAgICAgIH1cclxuICAgIHJldHVybiB0O1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19kZWNvcmF0ZShkZWNvcmF0b3JzLCB0YXJnZXQsIGtleSwgZGVzYykge1xyXG4gICAgdmFyIGMgPSBhcmd1bWVudHMubGVuZ3RoLCByID0gYyA8IDMgPyB0YXJnZXQgOiBkZXNjID09PSBudWxsID8gZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGFyZ2V0LCBrZXkpIDogZGVzYywgZDtcclxuICAgIGlmICh0eXBlb2YgUmVmbGVjdCA9PT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WzFdLCBkb25lOiBmYWxzZSB9O1xyXG4gICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA3OiBvcCA9IF8ub3BzLnBvcCgpOyBfLnRyeXMucG9wKCk7IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gNiAmJiBfLmxhYmVsIDwgdFsxXSkgeyBfLmxhYmVsID0gdFsxXTsgdCA9IG9wOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodFsyXSkgXy5vcHMucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBvcCA9IGJvZHkuY2FsbCh0aGlzQXJnLCBfKTtcclxuICAgICAgICB9IGNhdGNoIChlKSB7IG9wID0gWzYsIGVdOyB5ID0gMDsgfSBmaW5hbGx5IHsgZiA9IHQgPSAwOyB9XHJcbiAgICAgICAgaWYg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BQUMsQ0FBQTtBQUN2RSxxQkFBQTtBQUNGLGlCQUFBO0FBQ0gsYUFBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FBQyxDQUFBO1NBQ2YsQ0FBQSxDQUFBO0FBQUEsS0FBQTtJQUVLLFlBQVksR0FBQTs7QUFDaEIsWUFBQSxJQUFJLENBQUMsUUFBUSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLGdCQUFnQixFQUFFLE1BQU0sSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUE7U0FDM0UsQ0FBQSxDQUFBO0FBQUEsS0FBQTtJQUVLLFlBQVksR0FBQTs7WUFDaEIsTUFBTSxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQTtTQUNuQyxDQUFBLENBQUE7QUFBQSxLQUFBO0FBQ0Y7Ozs7In0= diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/manifest.json b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/manifest.json new file mode 100644 index 0000000..9c3cd9a --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "number-headings-obsidian", + "name": "Number Headings", + "version": "1.16.0", + "minAppVersion": "1.4.0", + "description": "Automatically number or re-number headings in an Obsidian document", + "author": "Kevin Albrecht (onlyafly@gmail.com)", + "authorUrl": "https://www.kevinalbrecht.com", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/styles.css b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/styles.css new file mode 100644 index 0000000..12a666b --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/number-headings-obsidian/styles.css @@ -0,0 +1,8 @@ +div.number-headings-button-container > button { + font-weight: normal; +} + +div.number-headings-question { + font-weight: bold; + margin-bottom: 10px; +} \ No newline at end of file diff --git a/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/data.json b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/data.json new file mode 100644 index 0000000..6c2de36 --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/data.json @@ -0,0 +1,86 @@ +{ + "github": { + "user": "bulhakovolexii", + "repo": "bilux-calc", + "branch": "main", + "automaticallyMergePR": true, + "tokenPath": "%configDir%/plugins/%pluginID%/env", + "api": { + "tiersForApi": "Github Free/Pro/Team (default)", + "hostname": "" + }, + "workflow": { + "commitMessage": "[PUBLISHER] Merge", + "name": "" + }, + "otherRepo": [], + "verifiedRepo": true, + "rateLimit": 4970 + }, + "upload": { + "behavior": "obsidian", + "defaultName": "docs", + "rootFolder": "", + "yamlFolderKey": "", + "frontmatterTitle": { + "enable": false, + "key": "title" + }, + "replaceTitle": [], + "replacePath": [], + "autoclean": { + "enable": false, + "excluded": [] + }, + "folderNote": { + "enable": true, + "rename": "index.md", + "addTitle": { + "enable": false, + "key": "title" + } + }, + "metadataExtractorPath": "" + }, + "conversion": { + "hardbreak": false, + "dataview": true, + "censorText": [], + "tags": { + "inline": false, + "exclude": [], + "fields": [] + }, + "links": { + "internal": true, + "unshared": true, + "wiki": true, + "slugify": true + } + }, + "embed": { + "attachments": true, + "overrideAttachments": [], + "keySendFile": [], + "notes": false, + "folder": "", + "convertEmbedToLinks": "keep", + "charConvert": "->" + }, + "plugin": { + "shareKey": "share", + "fileMenu": false, + "editorMenu": false, + "excludedFolder": [], + "copyLink": { + "enable": false, + "links": "", + "removePart": [], + "addCmd": false + }, + "noticeError": false, + "displayModalRepoEditing": false, + "migrated": true + }, + "tabsID": "plugin-settings" +} \ No newline at end of file diff --git a/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/main.js b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/main.js new file mode 100644 index 0000000..844b09b --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/main.js @@ -0,0 +1,48 @@ +/** GENERATED BY OBSIDIAN-PLUGIN-CLI, DO NOT EDIT */ +var xc=Object.create;var si=Object.defineProperty;var Ec=Object.getOwnPropertyDescriptor;var kc=Object.getOwnPropertyNames;var Cc=Object.getPrototypeOf,Sc=Object.prototype.hasOwnProperty;var qr=t=>si(t,"__esModule",{value:!0});var rt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),os=(t,e)=>{qr(t);for(var n in e)si(t,n,{get:e[n],enumerable:!0})},Tc=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kc(e))!Sc.call(t,i)&&i!=="default"&&si(t,i,{get:()=>e[i],enumerable:!(n=Ec(e,i))||n.enumerable});return t},q=t=>Tc(qr(si(t!=null?xc(Cc(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var m=(t,e,n)=>new Promise((i,s)=>{var r=l=>{try{o(n.next(l))}catch(c){s(c)}},a=l=>{try{o(n.throw(l))}catch(c){s(c)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,a);o((n=n.apply(t,e)).next())});var zr=rt((Np,Kr)=>{Kr.exports=Wr;function Wr(t,e,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(e)?e.reverse().reduce(function(s,r){return Wr.bind(null,t,r,s,i)},n)():Promise.resolve().then(function(){return t.registry[e]?t.registry[e].reduce(function(s,r){return r.hook.bind(null,s,i)},n)():n(i)})}});var Yr=rt((Ap,Zr)=>{Zr.exports=Pc;function Pc(t,e,n,i){var s=i;t.registry[n]||(t.registry[n]=[]),e==="before"&&(i=function(r,a){return Promise.resolve().then(s.bind(null,a)).then(r.bind(null,a))}),e==="after"&&(i=function(r,a){var o;return Promise.resolve().then(r.bind(null,a)).then(function(l){return o=l,s(o,a)}).then(function(){return o})}),e==="error"&&(i=function(r,a){return Promise.resolve().then(r.bind(null,a)).catch(function(o){return s(o,a)})}),t.registry[n].push({hook:i,orig:s})}});var Qr=rt((Lp,Jr)=>{Jr.exports=Oc;function Oc(t,e,n){if(!!t.registry[e]){var i=t.registry[e].map(function(s){return s.orig}).indexOf(n);i!==-1&&t.registry[e].splice(i,1)}}});var ra=rt((Mp,Dn)=>{var Xr=zr(),Rc=Yr(),Nc=Qr(),ea=Function.bind,ta=ea.bind(ea);function na(t,e,n){var i=ta(Nc,null).apply(null,n?[e,n]:[e]);t.api={remove:i},t.remove=i,["before","error","after","wrap"].forEach(function(s){var r=n?[e,s,n]:[e,s];t[s]=t.api[s]=ta(Rc,null).apply(null,r)})}function Ac(){var t="h",e={registry:{}},n=Xr.bind(null,e,t);return na(n,e,t),n}function ia(){var t={registry:{}},e=Xr.bind(null,t);return na(e,t),e}var sa=!1;function jt(){return sa||(console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'),sa=!0),ia()}jt.Singular=Ac.bind();jt.Collection=ia.bind();Dn.exports=jt;Dn.exports.Hook=jt;Dn.exports.Singular=jt.Singular;Dn.exports.Collection=jt.Collection});var ma=rt((_t,pa)=>{"use strict";var Wc=function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")},Ft=Wc();pa.exports=_t=Ft.fetch;Ft.fetch&&(_t.default=Ft.fetch.bind(Ft));_t.Headers=Ft.Headers;_t.Request=Ft.Request;_t.Response=Ft.Response});var ya=rt((jp,ba)=>{ba.exports=ga;function ga(t,e){if(t&&e)return ga(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){n[i]=t[i]}),n;function n(){for(var i=new Array(arguments.length),s=0;s{var Da=ya();cs.exports=Da(oi);cs.exports.strict=Da(wa);oi.proto=oi(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return oi(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return wa(this)},configurable:!0})});function oi(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function wa(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}});var Qa=rt((xs,Es)=>{(function(t,e,n){typeof xs=="object"?(Es.exports=n(),Es.exports.default=n()):typeof define=="function"&&define.amd?define(n):e[t]=n()})("slugify",xs,function(){var t=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`),e=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function n(i,s){if(typeof i!="string")throw new Error("slugify: string argument expected");s=typeof s=="string"?{replacement:s}:s||{};var r=e[s.locale]||{},a=s.replacement===void 0?"-":s.replacement,o=s.trim===void 0?!0:s.trim,l=i.normalize().split("").reduce(function(c,d){var f=r[d];return f===void 0&&(f=t[d]),f===void 0&&(f=d),f===a&&(f=" "),c+f.replace(s.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return s.strict&&(l=l.replace(/[^A-Za-z0-9\s]/g,"")),o&&(l=l.trim()),l=l.replace(/\s+/g,a),s.lower&&(l=l.toLowerCase()),l}return n.extend=function(i){Object.assign(t,i)},n})});var es=rt(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});require("obsidian");var pt=class extends Error{},Uo=class extends pt{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},_o=class extends pt{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},qo=class extends pt{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},en=class extends pt{},Gs=class extends pt{constructor(e){super(`Invalid unit ${e}`)}},Re=class extends pt{},ot=class extends pt{constructor(){super("Zone is an abstract class")}},O="numeric",Ve="short",Ne="long",Ni={year:O,month:O,day:O},Wo={year:O,month:Ve,day:O},eh={year:O,month:Ve,day:O,weekday:Ve},Ko={year:O,month:Ne,day:O},zo={year:O,month:Ne,day:O,weekday:Ne},Zo={hour:O,minute:O},Yo={hour:O,minute:O,second:O},Jo={hour:O,minute:O,second:O,timeZoneName:Ve},Qo={hour:O,minute:O,second:O,timeZoneName:Ne},Xo={hour:O,minute:O,hourCycle:"h23"},el={hour:O,minute:O,second:O,hourCycle:"h23"},tl={hour:O,minute:O,second:O,hourCycle:"h23",timeZoneName:Ve},nl={hour:O,minute:O,second:O,hourCycle:"h23",timeZoneName:Ne},il={year:O,month:O,day:O,hour:O,minute:O},sl={year:O,month:O,day:O,hour:O,minute:O,second:O},rl={year:O,month:Ve,day:O,hour:O,minute:O},al={year:O,month:Ve,day:O,hour:O,minute:O,second:O},th={year:O,month:Ve,day:O,weekday:Ve,hour:O,minute:O},ol={year:O,month:Ne,day:O,hour:O,minute:O,timeZoneName:Ve},ll={year:O,month:Ne,day:O,hour:O,minute:O,second:O,timeZoneName:Ve},ul={year:O,month:Ne,day:O,weekday:Ne,hour:O,minute:O,timeZoneName:Ne},cl={year:O,month:Ne,day:O,weekday:Ne,hour:O,minute:O,second:O,timeZoneName:Ne},tn=class{get type(){throw new ot}get name(){throw new ot}get ianaName(){return this.name}get isUniversal(){throw new ot}offsetName(e,n){throw new ot}formatOffset(e,n){throw new ot}offset(e){throw new ot}equals(e){throw new ot}get isValid(){throw new ot}},js=null,In=class extends tn{static get instance(){return js===null&&(js=new In),js}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:i}){return kl(e,n,i)}formatOffset(e,n){return jn(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},Ai={};function nh(t){return Ai[t]||(Ai[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ai[t]}var ih={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sh(t,e){let n=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,a,o,l,c,d]=i;return[a,s,r,o,l,c,d]}function rh(t,e){let n=t.formatToParts(e),i=[];for(let s=0;s=0?F:1e3+F,(p-w)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},dl={};function ah(t,e={}){let n=JSON.stringify([t,e]),i=dl[n];return i||(i=new Intl.ListFormat(t,e),dl[n]=i),i}var Hs={};function Us(t,e={}){let n=JSON.stringify([t,e]),i=Hs[n];return i||(i=new Intl.DateTimeFormat(t,e),Hs[n]=i),i}var _s={};function oh(t,e={}){let n=JSON.stringify([t,e]),i=_s[n];return i||(i=new Intl.NumberFormat(t,e),_s[n]=i),i}var qs={};function lh(t,e={}){let{base:n,...i}=e,s=JSON.stringify([t,i]),r=qs[s];return r||(r=new Intl.RelativeTimeFormat(t,e),qs[s]=r),r}var $n=null;function uh(){return $n||($n=new Intl.DateTimeFormat().resolvedOptions().locale,$n)}function ch(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let i,s;try{i=Us(t).resolvedOptions(),s=t}catch(o){let l=t.substring(0,n);i=Us(l).resolvedOptions(),s=l}let{numberingSystem:r,calendar:a}=i;return[s,r,a]}}function dh(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function hh(t){let e=[];for(let n=1;n<=12;n++){let i=L.utc(2009,n,1);e.push(t(i))}return e}function fh(t){let e=[];for(let n=1;n<=7;n++){let i=L.utc(2016,11,13+n);e.push(t(i))}return e}function Mi(t,e,n,i){let s=t.listingMode();return s==="error"?null:s==="en"?n(e):i(e)}function ph(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}var hl=class{constructor(e,n,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:s,floor:r,...a}=i;if(!n||Object.keys(a).length>0){let o={useGrouping:!1,...i};i.padTo>0&&(o.minimumIntegerDigits=i.padTo),this.inf=oh(e,o)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):zs(e,3);return ae(n,this.padTo)}}},fl=class{constructor(e,n,i){this.opts=i,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&Xe.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let r={...this.opts};r.timeZone=r.timeZone||s,this.dtf=Us(n,r)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:i}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},pl=class{constructor(e,n,i){this.opts={style:"long",...i},!n&&xl()&&(this.rtf=lh(e,i))}format(e,n){return this.rtf?this.rtf.format(e,n):Oh(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},Q=class{static fromOpts(e){return Q.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,n,i,s=!1){let r=e||se.defaultLocale,a=r||(s?"en-US":uh()),o=n||se.defaultNumberingSystem,l=i||se.defaultOutputCalendar;return new Q(a,o,l,r)}static resetCache(){$n=null,Hs={},_s={},qs={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:i}={}){return Q.create(e,n,i)}constructor(e,n,i,s){let[r,a,o]=ch(e);this.locale=r,this.numberingSystem=n||a||null,this.outputCalendar=i||o||null,this.intl=dh(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ph(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Q.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Mi(this,e,Tl,()=>{let i=n?{month:e,day:"numeric"}:{month:e},s=n?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=hh(r=>this.extract(r,i,"month"))),this.monthsCache[s][e]})}weekdays(e,n=!1){return Mi(this,e,Rl,()=>{let i=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=n?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=fh(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Mi(this,void 0,()=>Nl,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[L.utc(2016,11,13,9),L.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Mi(this,e,Al,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[L.utc(-40,1,1),L.utc(2017,1,1)].map(i=>this.extract(i,n,"era"))),this.eraCache[e]})}extract(e,n,i){let s=this.dtFormatter(e,n),r=s.formatToParts(),a=r.find(o=>o.type.toLowerCase()===i);return a?a.value:null}numberFormatter(e={}){return new hl(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new fl(e,this.intl,n)}relFormatter(e={}){return new pl(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ah(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}},Ws=null,ve=class extends tn{static get utcInstance(){return Ws===null&&(Ws=new ve(0)),Ws}static instance(e){return e===0?ve.utcInstance:new ve(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ve(Gi(n[1],n[2]))}return null}constructor(e){super();this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${jn(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${jn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return jn(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},ml=class extends tn{constructor(e){super();this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function mt(t,e){if(H(t)||t===null)return e;if(t instanceof tn)return t;if(mh(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?In.instance:n==="utc"||n==="gmt"?ve.utcInstance:ve.parseSpecifier(n)||Xe.create(t)}else return Tt(t)?ve.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new ml(t)}var gl=()=>Date.now(),bl="system",yl=null,Dl=null,wl=null,Fl=60,vl,se=class{static get now(){return gl}static set now(e){gl=e}static set defaultZone(e){bl=e}static get defaultZone(){return mt(bl,In.instance)}static get defaultLocale(){return yl}static set defaultLocale(e){yl=e}static get defaultNumberingSystem(){return Dl}static set defaultNumberingSystem(e){Dl=e}static get defaultOutputCalendar(){return wl}static set defaultOutputCalendar(e){wl=e}static get twoDigitCutoffYear(){return Fl}static set twoDigitCutoffYear(e){Fl=e%100}static get throwOnInvalid(){return vl}static set throwOnInvalid(e){vl=e}static resetCaches(){Q.resetCache(),Xe.resetCache()}};function H(t){return typeof t=="undefined"}function Tt(t){return typeof t=="number"}function Bi(t){return typeof t=="number"&&t%1==0}function mh(t){return typeof t=="string"}function gh(t){return Object.prototype.toString.call(t)==="[object Date]"}function xl(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function bh(t){return Array.isArray(t)?t:[t]}function El(t,e,n){if(t.length!==0)return t.reduce((i,s)=>{let r=[e(s),s];return i&&n(i[0],r[0])===i[0]?i:r},null)[1]}function yh(t,e){return e.reduce((n,i)=>(n[i]=t[i],n),{})}function nn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function lt(t,e,n){return Bi(t)&&t>=e&&t<=n}function Dh(t,e){return t-e*Math.floor(t/e)}function ae(t,e=2){let n=t<0,i;return n?i="-"+(""+-t).padStart(e,"0"):i=(""+t).padStart(e,"0"),i}function gt(t){if(!(H(t)||t===null||t===""))return parseInt(t,10)}function Pt(t){if(!(H(t)||t===null||t===""))return parseFloat(t)}function Ks(t){if(!(H(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function zs(t,e,n=!1){let i=10**e;return(n?Math.trunc:Math.round)(t*i)/i}function Vn(t){return t%4==0&&(t%100!=0||t%400==0)}function Gn(t){return Vn(t)?366:365}function Ii(t,e){let n=Dh(e-1,12)+1,i=t+(e-n)/12;return n===2?Vn(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function $i(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Vi(t){let e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,i=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return e===4||i===3?53:52}function Zs(t){return t>99?t:t>se.twoDigitCutoffYear?1900+t:2e3+t}function kl(t,e,n,i=null){let s=new Date(t),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);let a={timeZoneName:e,...r},o=new Intl.DateTimeFormat(n,a).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return o?o.value:null}function Gi(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let i=parseInt(e,10)||0,s=n<0||Object.is(n,-0)?-i:i;return n*60+s}function Cl(t){let e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Re(`Invalid unit value ${t}`);return e}function ji(t,e){let n={};for(let i in t)if(nn(t,i)){let s=t[i];if(s==null)continue;n[e(i)]=Cl(s)}return n}function jn(t,e){let n=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${ae(n,2)}:${ae(i,2)}`;case"narrow":return`${s}${n}${i>0?`:${i}`:""}`;case"techie":return`${s}${ae(n,2)}${ae(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Hi(t){return yh(t,["hour","minute","second","millisecond"])}var wh=["January","February","March","April","May","June","July","August","September","October","November","December"],Sl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fh=["J","F","M","A","M","J","J","A","S","O","N","D"];function Tl(t){switch(t){case"narrow":return[...Fh];case"short":return[...Sl];case"long":return[...wh];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Pl=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ol=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],vh=["M","T","W","T","F","S","S"];function Rl(t){switch(t){case"narrow":return[...vh];case"short":return[...Ol];case"long":return[...Pl];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Nl=["AM","PM"],xh=["Before Christ","Anno Domini"],Eh=["BC","AD"],kh=["B","A"];function Al(t){switch(t){case"narrow":return[...kh];case"short":return[...Eh];case"long":return[...xh];default:return null}}function Ch(t){return Nl[t.hour<12?0:1]}function Sh(t,e){return Rl(e)[t.weekday-1]}function Th(t,e){return Tl(e)[t.month-1]}function Ph(t,e){return Al(e)[t.year<0?0:1]}function Oh(t,e,n="always",i=!1){let s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&r){let f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${s[t][0]}`;case-1:return f?"yesterday":`last ${s[t][0]}`;case 0:return f?"today":`this ${s[t][0]}`}}let a=Object.is(e,-0)||e<0,o=Math.abs(e),l=o===1,c=s[t],d=i?l?c[1]:c[2]||c[1]:l?s[t][0]:t;return a?`${o} ${d} ago`:`in ${o} ${d}`}function Ll(t,e){let n="";for(let i of t)i.literal?n+=i.val:n+=e(i.val);return n}var Rh={D:Ni,DD:Wo,DDD:Ko,DDDD:zo,t:Zo,tt:Yo,ttt:Jo,tttt:Qo,T:Xo,TT:el,TTT:tl,TTTT:nl,f:il,ff:rl,fff:ol,ffff:ul,F:sl,FF:al,FFF:ll,FFFF:cl},be=class{static create(e,n={}){return new be(e,n)}static parseFormat(e){let n=null,i="",s=!1,r=[];for(let a=0;a0&&r.push({literal:s||/^\s+$/.test(i),val:i}),n=null,i="",s=!s):s||o===n?i+=o:(i.length>0&&r.push({literal:/^\s+$/.test(i),val:i}),i=o,n=o)}return i.length>0&&r.push({literal:s||/^\s+$/.test(i),val:i}),r}static macroTokenToFormatOpts(e){return Rh[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ae(e,n);let i={...this.opts};return n>0&&(i.padTo=n),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){let i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(w,F)=>this.loc.extract(e,w,F),a=w=>e.isOffsetFixed&&e.offset===0&&w.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,w.format):"",o=()=>i?Ch(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(w,F)=>i?Th(e,w):r(F?{month:w}:{month:w,day:"numeric"},"month"),c=(w,F)=>i?Sh(e,w):r(F?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),d=w=>{let F=be.macroTokenToFormatOpts(w);return F?this.formatWithSystemDefault(e,F):w},f=w=>i?Ph(e,w):r({era:w},"era"),p=w=>{switch(w){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?r({day:"numeric"},"day"):this.num(e.day);case"dd":return s?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return s?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return s?r({month:"numeric"},"month"):this.num(e.month);case"MM":return s?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return s?r({year:"numeric"},"year"):this.num(e.year);case"yy":return s?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(w)}};return Ll(be.parseFormat(n),p)}formatDurationFromString(e,n){let i=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=l=>c=>{let d=i(c);return d?this.num(l.get(d),c.length):c},r=be.parseFormat(n),a=r.reduce((l,{literal:c,val:d})=>c?l:l.concat(d),[]),o=e.shiftTo(...a.map(i).filter(l=>l));return Ll(r,s(o))}},Le=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},Ml=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sn(...t){let e=t.reduce((n,i)=>n+i.source,"");return RegExp(`^${e}$`)}function rn(...t){return e=>t.reduce(([n,i,s],r)=>{let[a,o,l]=r(e,s);return[{...n,...a},o||i,l]},[{},null,1]).slice(0,2)}function an(t,...e){if(t==null)return[null,null];for(let[n,i]of e){let s=n.exec(t);if(s)return i(s)}return[null,null]}function Bl(...t){return(e,n)=>{let i={},s;for(s=0;sw!==void 0&&(F||w&&d)?-w:w;return[{years:p(Pt(n)),months:p(Pt(i)),weeks:p(Pt(s)),days:p(Pt(r)),hours:p(Pt(a)),minutes:p(Pt(o)),seconds:p(Pt(l),l==="-0"),milliseconds:p(Ks(c),f)}]}var _h={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Qs(t,e,n,i,s,r,a){let o={year:e.length===2?Zs(gt(e)):gt(e),month:Sl.indexOf(n)+1,day:gt(i),hour:gt(s),minute:gt(r)};return a&&(o.second=gt(a)),t&&(o.weekday=t.length>3?Pl.indexOf(t)+1:Ol.indexOf(t)+1),o}var qh=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Wh(t){let[,e,n,i,s,r,a,o,l,c,d,f]=t,p=Qs(e,s,i,n,r,a,o),w;return l?w=_h[l]:c?w=0:w=Gi(d,f),[p,new ve(w)]}function Kh(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var zh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Zh=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Yh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Gl(t){let[,e,n,i,s,r,a,o]=t;return[Qs(e,s,i,n,r,a,o),ve.utcInstance]}function Jh(t){let[,e,n,i,s,r,a,o]=t;return[Qs(e,o,n,i,s,r,a),ve.utcInstance]}var Qh=sn(Ah,Js),Xh=sn(Lh,Js),ef=sn(Mh,Js),tf=sn($l),jl=rn(Gh,ln,Hn,Un),nf=rn(Bh,ln,Hn,Un),sf=rn(Ih,ln,Hn,Un),rf=rn(ln,Hn,Un);function af(t){return an(t,[Qh,jl],[Xh,nf],[ef,sf],[tf,rf])}function of(t){return an(Kh(t),[qh,Wh])}function lf(t){return an(t,[zh,Gl],[Zh,Gl],[Yh,Jh])}function uf(t){return an(t,[Hh,Uh])}var cf=rn(ln);function df(t){return an(t,[jh,cf])}var hf=sn($h,Vh),ff=sn(Vl),pf=rn(ln,Hn,Un);function mf(t){return an(t,[hf,jl],[ff,pf])}var Hl="Invalid Duration",Ul={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},gf={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Ul},Me=146097/400,un=146097/4800,bf={years:{quarters:4,months:12,weeks:Me/7,days:Me,hours:Me*24,minutes:Me*24*60,seconds:Me*24*60*60,milliseconds:Me*24*60*60*1e3},quarters:{months:3,weeks:Me/28,days:Me/4,hours:Me*24/4,minutes:Me*24*60/4,seconds:Me*24*60*60/4,milliseconds:Me*24*60*60*1e3/4},months:{weeks:un/7,days:un,hours:un*24,minutes:un*24*60,seconds:un*24*60*60,milliseconds:un*24*60*60*1e3},...Ul},Ot=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],yf=Ot.slice(0).reverse();function bt(t,e,n=!1){let i={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new N(i)}function _l(t,e){let n=e.milliseconds??0;for(let i of yf.slice(1))e[i]&&(n+=e[i]*t[i].milliseconds);return n}function ql(t,e){let n=_l(t,e)<0?-1:1;Ot.reduceRight((i,s)=>{if(H(e[s]))return i;if(i){let r=e[i]*n,a=t[s][i],o=Math.floor(r/a);e[s]+=o*n,e[i]-=o*a*n}return s},null),Ot.reduce((i,s)=>{if(H(e[s]))return i;if(i){let r=e[i]%1;e[i]-=r,e[s]+=r*t[i][s]}return s},null)}function Df(t){let e={};for(let[n,i]of Object.entries(t))i!==0&&(e[n]=i);return e}var N=class{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,i=n?bf:gf;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Q.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,n){return N.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Re(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new N({values:ji(e,N.normalizeUnit),loc:Q.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Tt(e))return N.fromMillis(e);if(N.isDuration(e))return e;if(typeof e=="object")return N.fromObject(e);throw new Re(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[i]=uf(e);return i?N.fromObject(i,n):N.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[i]=df(e);return i?N.fromObject(i,n):N.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Re("need to specify a reason the Duration is invalid");let i=e instanceof Le?e:new Le(e,n);if(se.throwOnInvalid)throw new qo(i);return new N({invalid:i})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Gs(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let i={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?be.create(this.loc,i).formatDurationFromString(this,e):Hl}toHuman(e={}){if(!this.isValid)return Hl;let n=Ot.map(i=>{let s=this.values[i];return H(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=zs(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},L.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?_l(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=N.fromDurationLike(e),i={};for(let s of Ot)(nn(n.values,s)||nn(this.values,s))&&(i[s]=n.get(s)+this.get(s));return bt(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let n=N.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let i of Object.keys(this.values))n[i]=Cl(e(this.values[i],i));return bt(this,{values:n},!0)}get(e){return this[N.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...ji(e,N.normalizeUnit)};return bt(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:i,matrix:s}={}){let a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:s,conversionAccuracy:i};return bt(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return ql(this.matrix,e),bt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=Df(this.normalize().shiftToAll().toObject());return bt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>N.normalizeUnit(a));let n={},i={},s=this.toObject(),r;for(let a of Ot)if(e.indexOf(a)>=0){r=a;let o=0;for(let c in i)o+=this.matrix[c][a]*i[c],i[c]=0;Tt(s[a])&&(o+=s[a]);let l=Math.trunc(o);n[a]=l,i[a]=(o*1e3-l*1e3)/1e3}else Tt(s[a])&&(i[a]=s[a]);for(let a in i)i[a]!==0&&(n[r]+=a===r?i[a]:i[a]/this.matrix[r][a]);return ql(this.matrix,n),bt(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return bt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(let i of Ot)if(!n(this.values[i],e.values[i]))return!1;return!0}},cn="Invalid Interval";function wf(t,e){return!t||!t.isValid?ee.invalid("missing or invalid start"):!e||!e.isValid?ee.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?ee.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(Wn).filter(a=>this.contains(a)).sort(),i=[],{s}=this,r=0;for(;s+this.e?this.e:a;i.push(ee.fromDateTimes(s,o)),s=o,r+=1}return i}splitBy(e){let n=N.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:i}=this,s=1,r,a=[];for(;il*s));r=+o>+this.e?this.e:o,a.push(ee.fromDateTimes(i,r)),i=r,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,i=this.e=i?null:ee.fromDateTimes(n,i)}union(e){if(!this.isValid)return this;let n=this.se.e?this.e:e.e;return ee.fromDateTimes(n,i)}static merge(e){let[n,i]=e.sort((s,r)=>s.s-r.s).reduce(([s,r],a)=>r?r.overlaps(a)||r.abutsStart(a)?[s,r.union(a)]:[s.concat([r]),a]:[s,a],[[],null]);return i&&n.push(i),n}static xor(e){let n=null,i=0,s=[],r=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),a=Array.prototype.concat(...r),o=a.sort((l,c)=>l.time-c.time);for(let l of o)i+=l.type==="s"?1:-1,i===1?n=l.time:(n&&+n!=+l.time&&s.push(ee.fromDateTimes(n,l.time)),n=null);return ee.merge(s)}difference(...e){return ee.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:cn}toLocaleString(e=Ni,n={}){return this.isValid?be.create(this.s.loc.clone(n),e).formatInterval(this):cn}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:cn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:cn}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:cn}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:cn}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):N.invalid(this.invalidReason)}mapEndpoints(e){return ee.fromDateTimes(e(this.s),e(this.e))}},_n=class{static hasDST(e=se.defaultZone){let n=L.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return Xe.isValidZone(e)}static normalizeZone(e){return mt(e,se.defaultZone)}static months(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Q.create(n,i,r)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Q.create(n,i,r)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Q.create(n,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Q.create(n,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Q.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Q.create(n,null,"gregory").eras(e)}static features(){return{relative:xl()}}};function Wl(t,e){let n=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=n(e)-n(t);return Math.floor(N.fromMillis(i).as("days"))}function Ff(t,e,n){let i=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{let d=Wl(l,c);return(d-d%7)/7}],["days",Wl]],s={},r=t,a,o;for(let[l,c]of i)n.indexOf(l)>=0&&(a=l,s[l]=c(t,e),o=r.plus(s),o>e?(s[l]--,t=r.plus(s),t>e&&(o=t,s[l]--,t=r.plus(s))):t=o);return[t,s,o,a]}function vf(t,e,n,i){let[s,r,a,o]=Ff(t,e,n),l=e-s,c=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);c.length===0&&(a0?N.fromMillis(l,i).shiftTo(...c).plus(d):d}var Xs={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Kl={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},xf=Xs.hanidec.replace(/[\[|\]]/g,"").split("");function Ef(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=r&&i<=a&&(e+=i-r)}}return parseInt(e,10)}else return e}function Ge({numberingSystem:t},e=""){return new RegExp(`${Xs[t||"latn"]}${e}`)}var kf="missing Intl.DateTimeFormat.formatToParts support";function z(t,e=n=>n){return{regex:t,deser:([n])=>e(Ef(n))}}var Cf=String.fromCharCode(160),zl=`[ ${Cf}]`,Zl=new RegExp(zl,"g");function Sf(t){return t.replace(/\./g,"\\.?").replace(Zl,zl)}function Yl(t){return t.replace(/\./g,"").replace(Zl," ").toLowerCase()}function je(t,e){return t===null?null:{regex:RegExp(t.map(Sf).join("|")),deser:([n])=>t.findIndex(i=>Yl(n)===Yl(i))+e}}function Jl(t,e){return{regex:t,deser:([,n,i])=>Gi(n,i),groups:e}}function Ui(t){return{regex:t,deser:([e])=>e}}function Tf(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Pf(t,e){let n=Ge(e),i=Ge(e,"{2}"),s=Ge(e,"{3}"),r=Ge(e,"{4}"),a=Ge(e,"{6}"),o=Ge(e,"{1,2}"),l=Ge(e,"{1,3}"),c=Ge(e,"{1,6}"),d=Ge(e,"{1,9}"),f=Ge(e,"{2,4}"),p=Ge(e,"{4,6}"),w=v=>({regex:RegExp(Tf(v.val)),deser:([V])=>V,literal:!0}),C=(v=>{if(t.literal)return w(v);switch(v.val){case"G":return je(e.eras("short"),0);case"GG":return je(e.eras("long"),0);case"y":return z(c);case"yy":return z(f,Zs);case"yyyy":return z(r);case"yyyyy":return z(p);case"yyyyyy":return z(a);case"M":return z(o);case"MM":return z(i);case"MMM":return je(e.months("short",!0),1);case"MMMM":return je(e.months("long",!0),1);case"L":return z(o);case"LL":return z(i);case"LLL":return je(e.months("short",!1),1);case"LLLL":return je(e.months("long",!1),1);case"d":return z(o);case"dd":return z(i);case"o":return z(l);case"ooo":return z(s);case"HH":return z(i);case"H":return z(o);case"hh":return z(i);case"h":return z(o);case"mm":return z(i);case"m":return z(o);case"q":return z(o);case"qq":return z(i);case"s":return z(o);case"ss":return z(i);case"S":return z(l);case"SSS":return z(s);case"u":return Ui(d);case"uu":return Ui(o);case"uuu":return z(n);case"a":return je(e.meridiems(),0);case"kkkk":return z(r);case"kk":return z(f,Zs);case"W":return z(o);case"WW":return z(i);case"E":case"c":return z(n);case"EEE":return je(e.weekdays("short",!1),1);case"EEEE":return je(e.weekdays("long",!1),1);case"ccc":return je(e.weekdays("short",!0),1);case"cccc":return je(e.weekdays("long",!0),1);case"Z":case"ZZ":return Jl(new RegExp(`([+-]${o.source})(?::(${i.source}))?`),2);case"ZZZ":return Jl(new RegExp(`([+-]${o.source})(${i.source})?`),2);case"z":return Ui(/[a-z_+-/]{1,256}?/i);case" ":return Ui(/[^\S\n\r]/);default:return w(v)}})(t)||{invalidReason:kf};return C.token=t,C}var Of={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Rf(t,e,n){let{type:i,value:s}=t;if(i==="literal"){let l=/^\s+$/.test(s);return{literal:!l,val:l?" ":s}}let r=e[i],a=i;i==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=n.hour12?"hour12":"hour24");let o=Of[a];if(typeof o=="object"&&(o=o[r]),o)return{literal:!1,val:o}}function Nf(t){return[`^${t.map(n=>n.regex).reduce((n,i)=>`${n}(${i.source})`,"")}$`,t]}function Af(t,e,n){let i=t.match(e);if(i){let s={},r=1;for(let a in n)if(nn(n,a)){let o=n[a],l=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(i.slice(r,r+l))),r+=l}return[i,s]}else return[i,{}]}function Lf(t){let e=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,i;return H(t.z)||(n=Xe.create(t.z)),H(t.Z)||(n||(n=new ve(t.Z)),i=t.Z),H(t.q)||(t.M=(t.q-1)*3+1),H(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),H(t.u)||(t.S=Ks(t.u)),[Object.keys(t).reduce((r,a)=>{let o=e(a);return o&&(r[o]=t[a]),r},{}),n,i]}var er=null;function Mf(){return er||(er=L.fromMillis(1555555555555)),er}function Bf(t,e){if(t.literal)return t;let n=be.macroTokenToFormatOpts(t.val),i=eu(n,e);return i==null||i.includes(void 0)?t:i}function Ql(t,e){return Array.prototype.concat(...t.map(n=>Bf(n,e)))}function Xl(t,e,n){let i=Ql(be.parseFormat(n),t),s=i.map(a=>Pf(a,t)),r=s.find(a=>a.invalidReason);if(r)return{input:e,tokens:i,invalidReason:r.invalidReason};{let[a,o]=Nf(s),l=RegExp(a,"i"),[c,d]=Af(e,l,o),[f,p,w]=d?Lf(d):[null,null,void 0];if(nn(d,"a")&&nn(d,"H"))throw new en("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:l,rawMatches:c,matches:d,result:f,zone:p,specificOffset:w}}}function If(t,e,n){let{result:i,zone:s,specificOffset:r,invalidReason:a}=Xl(t,e,n);return[i,s,r,a]}function eu(t,e){if(!t)return null;let i=be.create(e,t).dtFormatter(Mf()),s=i.formatToParts(),r=i.resolvedOptions();return s.map(a=>Rf(a,t,r))}var tu=[0,31,59,90,120,151,181,212,243,273,304,334],nu=[0,31,60,91,121,152,182,213,244,274,305,335];function Be(t,e){return new Le("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function iu(t,e,n){let i=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let s=i.getUTCDay();return s===0?7:s}function su(t,e,n){return n+(Vn(t)?nu:tu)[e-1]}function ru(t,e){let n=Vn(t)?nu:tu,i=n.findIndex(r=>rVi(e)?(o=e+1,a=1):o=e,{weekYear:o,weekNumber:a,weekday:r,...Hi(t)}}function au(t){let{weekYear:e,weekNumber:n,weekday:i}=t,s=iu(e,1,4),r=Gn(e),a=n*7+i-s-3,o;a<1?(o=e-1,a+=Gn(o)):a>r?(o=e+1,a-=Gn(e)):o=e;let{month:l,day:c}=ru(o,a);return{year:o,month:l,day:c,...Hi(t)}}function nr(t){let{year:e,month:n,day:i}=t,s=su(e,n,i);return{year:e,ordinal:s,...Hi(t)}}function ou(t){let{year:e,ordinal:n}=t,{month:i,day:s}=ru(e,n);return{year:e,month:i,day:s,...Hi(t)}}function $f(t){let e=Bi(t.weekYear),n=lt(t.weekNumber,1,Vi(t.weekYear)),i=lt(t.weekday,1,7);return e?n?i?!1:Be("weekday",t.weekday):Be("week",t.week):Be("weekYear",t.weekYear)}function Vf(t){let e=Bi(t.year),n=lt(t.ordinal,1,Gn(t.year));return e?n?!1:Be("ordinal",t.ordinal):Be("year",t.year)}function lu(t){let e=Bi(t.year),n=lt(t.month,1,12),i=lt(t.day,1,Ii(t.year,t.month));return e?n?i?!1:Be("day",t.day):Be("month",t.month):Be("year",t.year)}function uu(t){let{hour:e,minute:n,second:i,millisecond:s}=t,r=lt(e,0,23)||e===24&&n===0&&i===0&&s===0,a=lt(n,0,59),o=lt(i,0,59),l=lt(s,0,999);return r?a?o?l?!1:Be("millisecond",s):Be("second",i):Be("minute",n):Be("hour",e)}var ir="Invalid DateTime",cu=864e13;function _i(t){return new Le("unsupported zone",`the zone "${t.name}" is not supported`)}function sr(t){return t.weekData===null&&(t.weekData=tr(t.c)),t.weekData}function Rt(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new L({...n,...e,old:n})}function du(t,e,n){let i=t-e*60*1e3,s=n.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;let r=n.offset(i);return s===r?[i,s]:[t-Math.min(s,r)*60*1e3,Math.max(s,r)]}function qi(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Wi(t,e,n){return du($i(t),e,n)}function hu(t,e){let n=t.o,i=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,r={...t.c,year:i,month:s,day:Math.min(t.c.day,Ii(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=N.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=$i(r),[l,c]=du(o,n,t.zone);return a!==0&&(l+=a,c=t.zone.offset(l)),{ts:l,o:c}}function qn(t,e,n,i,s,r){let{setZone:a,zone:o}=n;if(t&&Object.keys(t).length!==0||e){let l=e||o,c=L.fromObject(t,{...n,zone:l,specificOffset:r});return a?c:c.setZone(o)}else return L.invalid(new Le("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ki(t,e,n=!0){return t.isValid?be.create(Q.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function rr(t,e){let n=t.c.year>9999||t.c.year<0,i="";return n&&t.c.year>=0&&(i+="+"),i+=ae(t.c.year,n?6:4),e?(i+="-",i+=ae(t.c.month),i+="-",i+=ae(t.c.day)):(i+=ae(t.c.month),i+=ae(t.c.day)),i}function fu(t,e,n,i,s,r){let a=ae(t.c.hour);return e?(a+=":",a+=ae(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=":")):a+=ae(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(a+=ae(t.c.second),(t.c.millisecond!==0||!i)&&(a+=".",a+=ae(t.c.millisecond,3))),s&&(t.isOffsetFixed&&t.offset===0&&!r?a+="Z":t.o<0?(a+="-",a+=ae(Math.trunc(-t.o/60)),a+=":",a+=ae(Math.trunc(-t.o%60))):(a+="+",a+=ae(Math.trunc(t.o/60)),a+=":",a+=ae(Math.trunc(t.o%60)))),r&&(a+="["+t.zone.ianaName+"]"),a}var pu={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Gf={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},jf={ordinal:1,hour:0,minute:0,second:0,millisecond:0},mu=["year","month","day","hour","minute","second","millisecond"],Hf=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Uf=["year","ordinal","hour","minute","second","millisecond"];function gu(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Gs(t);return e}function bu(t,e){let n=mt(e.zone,se.defaultZone),i=Q.fromObject(e),s=se.now(),r,a;if(H(t.year))r=s;else{for(let c of mu)H(t[c])&&(t[c]=pu[c]);let o=lu(t)||uu(t);if(o)return L.invalid(o);let l=n.offset(s);[r,a]=Wi(t,l,n)}return new L({ts:r,zone:n,loc:i,o:a})}function yu(t,e,n){let i=H(n.round)?!0:n.round,s=(a,o)=>(a=zs(a,i||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,o)),r=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return s(r(n.unit),n.unit);for(let a of n.units){let o=r(a);if(Math.abs(o)>=1)return s(o,a)}return s(t>e?-0:0,n.units[n.units.length-1])}function Du(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var L=class{constructor(e){let n=e.zone||se.defaultZone,i=e.invalid||(Number.isNaN(e.ts)?new Le("invalid input"):null)||(n.isValid?null:_i(n));this.ts=H(e.ts)?se.now():e.ts;let s=null,r=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[s,r]=[e.old.c,e.old.o];else{let o=n.offset(this.ts);s=qi(this.ts,o),i=Number.isNaN(s.year)?new Le("invalid input"):null,s=i?null:s,r=i?null:o}this._zone=n,this.loc=e.loc||Q.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=r,this.isLuxonDateTime=!0}static now(){return new L({})}static local(){let[e,n]=Du(arguments),[i,s,r,a,o,l,c]=n;return bu({year:i,month:s,day:r,hour:a,minute:o,second:l,millisecond:c},e)}static utc(){let[e,n]=Du(arguments),[i,s,r,a,o,l,c]=n;return e.zone=ve.utcInstance,bu({year:i,month:s,day:r,hour:a,minute:o,second:l,millisecond:c},e)}static fromJSDate(e,n={}){let i=gh(e)?e.valueOf():NaN;if(Number.isNaN(i))return L.invalid("invalid input");let s=mt(n.zone,se.defaultZone);return s.isValid?new L({ts:i,zone:s,loc:Q.fromObject(n)}):L.invalid(_i(s))}static fromMillis(e,n={}){if(Tt(e))return e<-cu||e>cu?L.invalid("Timestamp out of range"):new L({ts:e,zone:mt(n.zone,se.defaultZone),loc:Q.fromObject(n)});throw new Re(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Tt(e))return new L({ts:e*1e3,zone:mt(n.zone,se.defaultZone),loc:Q.fromObject(n)});throw new Re("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let i=mt(n.zone,se.defaultZone);if(!i.isValid)return L.invalid(_i(i));let s=se.now(),r=H(n.specificOffset)?i.offset(s):n.specificOffset,a=ji(e,gu),o=!H(a.ordinal),l=!H(a.year),c=!H(a.month)||!H(a.day),d=l||c,f=a.weekYear||a.weekNumber,p=Q.fromObject(n);if((d||o)&&f)throw new en("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new en("Can't mix ordinal dates with month/day");let w=f||a.weekday&&!d,F,C,v=qi(s,r);w?(F=Hf,C=Gf,v=tr(v)):o?(F=Uf,C=jf,v=nr(v)):(F=mu,C=pu);let V=!1;for(let $ of F){let I=a[$];H(I)?V?a[$]=C[$]:a[$]=v[$]:V=!0}let M=w?$f(a):o?Vf(a):lu(a),G=M||uu(a);if(G)return L.invalid(G);let y=w?au(a):o?ou(a):a,[E,B]=Wi(y,r,i),k=new L({ts:E,zone:i,o:B,loc:p});return a.weekday&&d&&e.weekday!==k.weekday?L.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${k.toISO()}`):k}static fromISO(e,n={}){let[i,s]=af(e);return qn(i,s,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[i,s]=of(e);return qn(i,s,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[i,s]=lf(e);return qn(i,s,n,"HTTP",n)}static fromFormat(e,n,i={}){if(H(e)||H(n))throw new Re("fromFormat requires an input string and a format");let{locale:s=null,numberingSystem:r=null}=i,a=Q.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0}),[o,l,c,d]=If(a,e,n);return d?L.invalid(d):qn(o,l,i,`format ${n}`,e,c)}static fromString(e,n,i={}){return L.fromFormat(e,n,i)}static fromSQL(e,n={}){let[i,s]=mf(e);return qn(i,s,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Re("need to specify a reason the DateTime is invalid");let i=e instanceof Le?e:new Le(e,n);if(se.throwOnInvalid)throw new Uo(i);return new L({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let i=eu(e,Q.fromObject(n));return i?i.map(s=>s?s.val:null).join(""):null}static expandFormat(e,n={}){return Ql(be.parseFormat(e),Q.fromObject(n)).map(s=>s.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?sr(this).weekYear:NaN}get weekNumber(){return this.isValid?sr(this).weekNumber:NaN}get weekday(){return this.isValid?sr(this).weekday:NaN}get ordinal(){return this.isValid?nr(this.c).ordinal:NaN}get monthShort(){return this.isValid?_n.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?_n.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?_n.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?_n.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,i=$i(this.c),s=this.zone.offset(i-e),r=this.zone.offset(i+e),a=this.zone.offset(i-s*n),o=this.zone.offset(i-r*n);if(a===o)return[this];let l=i-a*n,c=i-o*n,d=qi(l,a),f=qi(c,o);return d.hour===f.hour&&d.minute===f.minute&&d.second===f.second&&d.millisecond===f.millisecond?[Rt(this,{ts:l}),Rt(this,{ts:c})]:[this]}get isInLeapYear(){return Vn(this.year)}get daysInMonth(){return Ii(this.year,this.month)}get daysInYear(){return this.isValid?Gn(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vi(this.weekYear):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:i,calendar:s}=be.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:i,outputCalendar:s}}toUTC(e=0,n={}){return this.setZone(ve.instance(e),n)}toLocal(){return this.setZone(se.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:i=!1}={}){if(e=mt(e,se.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(n||i){let r=e.offset(this.ts),a=this.toObject();[s]=Wi(a,r,e)}return Rt(this,{ts:s,zone:e})}else return L.invalid(_i(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:i}={}){let s=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:i});return Rt(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=ji(e,gu),i=!H(n.weekYear)||!H(n.weekNumber)||!H(n.weekday),s=!H(n.ordinal),r=!H(n.year),a=!H(n.month)||!H(n.day),o=r||a,l=n.weekYear||n.weekNumber;if((o||s)&&l)throw new en("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new en("Can't mix ordinal dates with month/day");let c;i?c=au({...tr(this.c),...n}):H(n.ordinal)?(c={...this.toObject(),...n},H(n.day)&&(c.day=Math.min(Ii(c.year,c.month),c.day))):c=ou({...nr(this.c),...n});let[d,f]=Wi(c,this.o,this.zone);return Rt(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;let n=N.fromDurationLike(e);return Rt(this,hu(this,n))}minus(e){if(!this.isValid)return this;let n=N.fromDurationLike(e).negate();return Rt(this,hu(this,n))}startOf(e){if(!this.isValid)return this;let n={},i=N.normalizeUnit(e);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(i==="weeks"&&(n.weekday=1),i==="quarters"){let s=Math.ceil(this.month/3);n.month=(s-1)*3+1}return this.set(n)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,n={}){return this.isValid?be.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):ir}toLocaleString(e=Ni,n={}){return this.isValid?be.create(this.loc.clone(n),e).formatDateTime(this):ir}toLocaleParts(e={}){return this.isValid?be.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;let a=e==="extended",o=rr(this,a);return o+="T",o+=fu(this,a,n,i,s,r),o}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return Ki(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:r=!1,format:a="extended"}={}){return this.isValid?(s?"T":"")+fu(this,a==="extended",n,e,i,r):null}toRFC2822(){return Ki(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ki(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(n||e)&&(i&&(s+=" "),n?s+="z":e&&(s+="ZZ")),Ki(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ir}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",i={}){if(!this.isValid||!e.isValid)return N.invalid("created by diffing an invalid DateTime");let s={locale:this.locale,numberingSystem:this.numberingSystem,...i},r=bh(n).map(N.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,l=a?e:this,c=vf(o,l,r,s);return a?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(L.now(),e,n)}until(e){return this.isValid?ee.fromDateTimes(this,e):this}hasSame(e,n){if(!this.isValid)return!1;let i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(n)<=i&&i<=s.endOf(n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||L.fromObject({},{zone:this.zone}),i=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(L.isDateTime))throw new Re("max requires all arguments be DateTimes");return El(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,i={}){let{locale:s=null,numberingSystem:r=null}=i,a=Q.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0});return Xl(a,e,n)}static fromStringExplain(e,n,i={}){return L.fromFormatExplain(e,n,i)}static get DATE_SHORT(){return Ni}static get DATE_MED(){return Wo}static get DATE_MED_WITH_WEEKDAY(){return eh}static get DATE_FULL(){return Ko}static get DATE_HUGE(){return zo}static get TIME_SIMPLE(){return Zo}static get TIME_WITH_SECONDS(){return Yo}static get TIME_WITH_SHORT_OFFSET(){return Jo}static get TIME_WITH_LONG_OFFSET(){return Qo}static get TIME_24_SIMPLE(){return Xo}static get TIME_24_WITH_SECONDS(){return el}static get TIME_24_WITH_SHORT_OFFSET(){return tl}static get TIME_24_WITH_LONG_OFFSET(){return nl}static get DATETIME_SHORT(){return il}static get DATETIME_SHORT_WITH_SECONDS(){return sl}static get DATETIME_MED(){return rl}static get DATETIME_MED_WITH_SECONDS(){return al}static get DATETIME_MED_WITH_WEEKDAY(){return th}static get DATETIME_FULL(){return ol}static get DATETIME_FULL_WITH_SECONDS(){return ll}static get DATETIME_HUGE(){return ul}static get DATETIME_HUGE_WITH_SECONDS(){return cl}};function Wn(t){if(L.isDateTime(t))return t;if(t&&t.valueOf&&Tt(t.valueOf()))return L.fromJSDate(t);if(t&&typeof t=="object")return L.fromObject(t);throw new Re(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var ar={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},_f={allowHtml:!0};({...ar,..._f});var zi=class{constructor(e){this.value=e,this.successful=!0}map(e){return new zi(e(this.value))}flatMap(e){return e(this.value)}mapErr(e){return this}bimap(e,n){return this.map(e)}orElse(e){return this.value}cast(){return this}orElseThrow(e){return this.value}},Zi=class{constructor(e){this.error=e,this.successful=!1}map(e){return this}flatMap(e){return this}mapErr(e){return new Zi(e(this.error))}bimap(e,n){return this.mapErr(n)}orElse(e){return e}cast(){return this}orElseThrow(e){throw e?new Error(e(this.error)):new Error(""+this.error)}},Yi;(function(t){function e(r){return new zi(r)}t.success=e;function n(r){return new Zi(r)}t.failure=n;function i(r,a,o){return r.successful?a.successful?o(r.value,a.value):n(a.error):n(r.error)}t.flatMap2=i;function s(r,a,o){return i(r,a,(l,c)=>e(o(l,c)))}t.map2=s})(Yi||(Yi={}));var qf=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Ji={exports:{}};Ji.exports;(function(t,e){(function(n,i){t.exports=i()})(typeof self!="undefined"?self:qf,function(){return function(n){var i={};function s(r){if(i[r])return i[r].exports;var a=i[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=n,s.c=i,s.d=function(r,a,o){s.o(r,a)||Object.defineProperty(r,a,{configurable:!1,enumerable:!0,get:o})},s.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},s.n=function(r){var a=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(a,"a",a),a},s.o=function(r,a){return Object.prototype.hasOwnProperty.call(r,a)},s.p="",s(s.s=0)}([function(n,i,s){function r(h){if(!(this instanceof r))return new r(h);this._=h}var a=r.prototype;function o(h,b){for(var D=0;D>7),buf:function(S){var T=l(function(P,j,Y,Ee){return P.concat(Y===Ee.length-1?Buffer.from([j,0]).readUInt16BE(0):Ee.readUInt16BE(Y))},[],S);return Buffer.from(c(function(P){return(P<<1&65535)>>8},T))}(D.buf)}}),D}function f(){return typeof Buffer!="undefined"}function p(){if(!f())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function w(h){p();var b=l(function(T,P){return T+P},0,h);if(b%8!=0)throw new Error("The bits ["+h.join(", ")+"] add up to "+b+" which is not an even number of bytes; the total should be divisible by 8");var D,x=b/8,S=(D=function(T){return T>48},l(function(T,P){return T||(D(P)?P:T)},null,h));if(S)throw new Error(S+" bit range requested exceeds 48 bit (6 byte) Number max.");return new r(function(T,P){var j=x+P;return j>T.length?$(P,x.toString()+" bytes"):k(j,l(function(Y,Ee){var pe=d(Ee,Y.buf);return{coll:Y.coll.concat(pe.v),buf:pe.buf}},{coll:[],buf:T.slice(P,j)},h).coll)})}function F(h,b){return new r(function(D,x){return p(),x+b>D.length?$(x,b+" bytes for "+h):k(x+b,D.slice(x,x+b))})}function C(h,b){if(typeof(D=b)!="number"||Math.floor(D)!==D||b<0||b>6)throw new Error(h+" requires integer length in range [0, 6].");var D}function v(h){return C("uintBE",h),F("uintBE("+h+")",h).map(function(b){return b.readUIntBE(0,h)})}function V(h){return C("uintLE",h),F("uintLE("+h+")",h).map(function(b){return b.readUIntLE(0,h)})}function M(h){return C("intBE",h),F("intBE("+h+")",h).map(function(b){return b.readIntBE(0,h)})}function G(h){return C("intLE",h),F("intLE("+h+")",h).map(function(b){return b.readIntLE(0,h)})}function y(h){return h instanceof r}function E(h){return{}.toString.call(h)==="[object Array]"}function B(h){return f()&&Buffer.isBuffer(h)}function k(h,b){return{status:!0,index:h,value:b,furthest:-1,expected:[]}}function $(h,b){return E(b)||(b=[b]),{status:!1,index:-1,value:null,furthest:h,expected:b}}function I(h,b){if(!b||h.furthest>b.furthest)return h;var D=h.furthest===b.furthest?function(x,S){if(function(){if(r._supportsSet!==void 0)return r._supportsSet;var st=typeof Set!="undefined";return r._supportsSet=st,st}()&&Array.from){for(var T=new Set(x),P=0;P=0;){if(P in D){x=D[P].line,T===0&&(T=D[P].lineStart);break}(h.charAt(P)===` +`||h.charAt(P)==="\r"&&h.charAt(P+1)!==` +`)&&(S++,T===0&&(T=P+1)),P--}var j=x+S,Y=b-T;return D[b]={line:j,lineStart:T},{offset:b,line:j+1,column:Y+1}}function ce(h){if(!y(h))throw new Error("not a parser: "+h)}function we(h,b){return typeof h=="string"?h.charAt(b):h[b]}function X(h){if(typeof h!="number")throw new Error("not a number: "+h)}function de(h){if(typeof h!="function")throw new Error("not a function: "+h)}function xe(h){if(typeof h!="string")throw new Error("not a string: "+h)}var te=2,Ce=3,ne=8,qe=5*ne,Qn=4*ne,gn=" ";function Se(h,b){return new Array(b+1).join(h)}function We(h,b,D){var x=b-h.length;return x<=0?h:Se(D,x)+h}function Mr(h,b,D,x){return{from:h-b>0?h-b:0,to:h+D>x?x:h+D}}function hc(h,b){var D,x,S,T,P,j=b.index,Y=j.offset,Ee=1;if(Y===h.length)return"Got the end of the input";if(B(h)){var pe=Y-Y%ne,it=Y-pe,Pe=Mr(pe,qe,Qn+ne,h.length),st=c(function(oe){return c(function(It){return We(It.toString(16),2,"0")},oe)},function(oe,It){var $t=oe.length,wt=[],Vt=0;if($t<=It)return[oe.slice()];for(var Gt=0;Gt<$t;Gt++)wt[Vt]||wt.push([]),wt[Vt].push(oe[Gt]),(Gt+1)%It==0&&Vt++;return wt}(h.slice(Pe.from,Pe.to).toJSON().data,ne));T=function(oe){return oe.from===0&&oe.to===1?{from:oe.from,to:oe.to}:{from:oe.from/ne,to:Math.floor(oe.to/ne)}}(Pe),x=pe/ne,D=3*it,it>=4&&(D+=1),Ee=2,S=c(function(oe){return oe.length<=4?oe.join(" "):oe.slice(0,4).join(" ")+" "+oe.slice(4).join(" ")},st),(P=(8*(T.to>0?T.to-1:T.to)).toString(16).length)<2&&(P=2)}else{var Bt=h.split(/\r\n|[\n\r\u2028\u2029]/);D=j.column-1,x=j.line-1,T=Mr(x,te,Ce,Bt.length),S=Bt.slice(T.from,T.to),P=T.to.toString().length}var vc=x-T.from;return B(h)&&(P=(8*(T.to>0?T.to-1:T.to)).toString(16).length)<2&&(P=2),l(function(oe,It,$t){var wt,Vt=$t===vc,Gt=Vt?"> ":gn;return wt=B(h)?We((8*(T.from+$t)).toString(16),P,"0"):We((T.from+$t+1).toString(),P," "),[].concat(oe,[Gt+wt+" | "+It],Vt?[gn+Se(" ",P)+" | "+We("",D," ")+Se("^",Ee)]:[])},[],S).join(` +`)}function Br(h,b){return[` +`,"-- PARSING FAILED "+Se("-",50),` + +`,hc(h,b),` + +`,(D=b.expected,D.length===1?`Expected: + +`+D[0]:`Expected one of the following: + +`+D.join(", ")),` +`].join("");var D}function Ir(h){return h.flags!==void 0?h.flags:[h.global?"g":"",h.ignoreCase?"i":"",h.multiline?"m":"",h.unicode?"u":"",h.sticky?"y":""].join("")}function Xn(){for(var h=[].slice.call(arguments),b=h.length,D=0;D=2?X(b):b=0;var D=function(S){return RegExp("^(?:"+S.source+")",Ir(S))}(h),x=""+h;return r(function(S,T){var P=D.exec(S.slice(T));if(P){if(0<=b&&b<=P.length){var j=P[0],Y=P[b];return k(T+j.length,Y)}return $(T,"valid match group (0 to "+P.length+") in "+x)}return $(T,x)})}function Dt(h){return r(function(b,D){return k(D,h)})}function ti(h){return r(function(b,D){return $(D,h)})}function ni(h){if(y(h))return r(function(b,D){var x=h._(b,D);return x.index=D,x.value="",x});if(typeof h=="string")return ni(bn(h));if(h instanceof RegExp)return ni(nt(h));throw new Error("not a string, regexp, or parser: "+h)}function Vr(h){return ce(h),r(function(b,D){var x=h._(b,D),S=b.slice(D,x.index);return x.status?$(D,'not "'+S+'"'):k(D,null)})}function ii(h){return de(h),r(function(b,D){var x=we(b,D);return D=h.length?$(b,"any character/byte"):k(b+1,we(h,b))}),pc=r(function(h,b){return k(h.length,h.slice(b))}),as=r(function(h,b){return b=0}).desc(b)},r.optWhitespace=Dc,r.Parser=r,r.range=function(h,b){return ii(function(D){return h<=D&&D<=b}).desc(h+"-"+b)},r.regex=nt,r.regexp=nt,r.sepBy=$r,r.sepBy1=ss,r.seq=Xn,r.seqMap=yt,r.seqObj=function(){for(var h,b={},D=0,x=(h=arguments,Array.prototype.slice.call(h)),S=x.length,T=0;T255)throw new Error("Value specified to byte constructor ("+h+"=0x"+h.toString(16)+") is larger in value than a single byte.");var b=(h>15?"0x":"0x0")+h.toString(16);return r(function(D,x){var S=we(D,x);return S===h?k(x+1,S):$(x,b)})},buffer:function(h){return F("buffer",h).map(function(b){return Buffer.from(b)})},encodedString:function(h,b){return F("string",b).map(function(D){return D.toString(h)})},uintBE:v,uint8BE:v(1),uint16BE:v(2),uint32BE:v(4),uintLE:V,uint8LE:V(1),uint16LE:V(2),uint32LE:V(4),intBE:M,int8BE:M(1),int16BE:M(2),int32BE:M(4),intLE:G,int8LE:G(1),int16LE:G(2),int32LE:G(4),floatBE:F("floatBE",4).map(function(h){return h.readFloatBE(0)}),floatLE:F("floatLE",4).map(function(h){return h.readFloatLE(0)}),doubleBE:F("doubleBE",8).map(function(h){return h.readDoubleBE(0)}),doubleLE:F("doubleLE",8).map(function(h){return h.readDoubleLE(0)})},n.exports=r}])})})(Ji,Ji.exports);var g=Ji.exports,or=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D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DECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function wu(t){return t==null?t:t.shiftToAll().normalize()}function Fu(t){return t.includes("/")&&(t=t.substring(t.lastIndexOf("/")+1)),t.endsWith(".md")&&(t=t.substring(0,t.length-3)),t}g.alt(g.regex(new RegExp(or(),"")),g.regex(/[0-9\p{Letter}_-]+/u).map(t=>t.toLocaleLowerCase()),g.whitespace.map(t=>"-"),g.any.map(t=>"")).many().map(t=>t.join(""));var Wf=g.alt(g.regex(new RegExp(or(),"")),g.regex(/[0-9\p{Letter}_-]+/u),g.whitespace.map(t=>" "),g.any.map(t=>" ")).many().map(t=>t.join("").split(/\s+/).join(" ").trim());function Kf(t){return Wf.tryParse(t)}function zf(t){return t=wu(t),t=N.fromObject(Object.fromEntries(Object.entries(t.toObject()).filter(([,e])=>e!=0))),t.toHuman()}var Kn;(function(t){function e(y,E=ar,B=!1){let k=n(y);if(!k)return E.renderNullAs;switch(k.type){case"null":return E.renderNullAs;case"string":return k.value;case"number":case"boolean":return""+k.value;case"html":return k.value.outerHTML;case"widget":return k.value.markdown();case"link":return k.value.markdown();case"function":return"";case"array":let $="";return B&&($+="["),$+=k.value.map(I=>e(I,E,!0)).join(", "),B&&($+="]"),$;case"object":return"{ "+Object.entries(k.value).map(I=>I[0]+": "+e(I[1],E,!0)).join(", ")+" }";case"date":return k.value.second==0&&k.value.hour==0&&k.value.minute==0?k.value.toFormat(E.defaultDateFormat):k.value.toFormat(E.defaultDateTimeFormat);case"duration":return zf(k.value)}}t.toString=e;function n(y){return p(y)?{type:"null",value:y}:c(y)?{type:"number",value:y}:l(y)?{type:"string",value:y}:F(y)?{type:"boolean",value:y}:f(y)?{type:"duration",value:y}:d(y)?{type:"date",value:y}:v(y)?{type:"widget",value:y}:w(y)?{type:"array",value:y}:C(y)?{type:"link",value:y}:G(y)?{type:"function",value:y}:V(y)?{type:"html",value:y}:M(y)?{type:"object",value:y}:void 0}t.wrapValue=n;function i(y,E){if(M(y)){let B={};for(let[k,$]of Object.entries(y))B[k]=i($,E);return B}else if(w(y)){let B=[];for(let k of y)B.push(i(k,E));return B}else return E(y)}t.mapLeaves=i;function s(y,E,B){var k,$;if(y===void 0&&(y=null),E===void 0&&(E=null),y===null&&E===null)return 0;if(y===null)return-1;if(E===null)return 1;let I=n(y),K=n(E);if(I===void 0&&K===void 0)return 0;if(I===void 0)return-1;if(K===void 0)return 1;if(I.type!=K.type)return I.type.localeCompare(K.type);if(I.value===K.value)return 0;switch(I.type){case"string":return I.value.localeCompare(K.value);case"number":return I.valueSe),X=we(Ae.path).localeCompare(we(ce.path));if(X!=0)return X;let de=Ae.type.localeCompare(ce.type);return de!=0?de:Ae.subpath&&!ce.subpath?1:!Ae.subpath&&ce.subpath?-1:!Ae.subpath&&!ce.subpath?0:((k=Ae.subpath)!==null&&k!==void 0?k:"").localeCompare(($=ce.subpath)!==null&&$!==void 0?$:"");case"date":return I.value0;case"boolean":return E.value;case"link":return!!E.value.path;case"date":return E.value.toMillis()!=0;case"duration":return E.value.as("seconds")!=0;case"object":return Object.keys(E.value).length>0;case"array":return E.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}t.isTruthy=a;function o(y){if(y==null)return y;if(t.isArray(y))return[].concat(y.map(E=>o(E)));if(t.isObject(y)){let E={};for(let[B,k]of Object.entries(y))E[B]=o(k);return E}else return y}t.deepCopy=o;function l(y){return typeof y=="string"}t.isString=l;function c(y){return typeof y=="number"}t.isNumber=c;function d(y){return y instanceof L}t.isDate=d;function f(y){return y instanceof N}t.isDuration=f;function p(y){return y==null}t.isNull=p;function w(y){return Array.isArray(y)}t.isArray=w;function F(y){return typeof y=="boolean"}t.isBoolean=F;function C(y){return y instanceof ye}t.isLink=C;function v(y){return y instanceof Qi}t.isWidget=v;function V(y){return typeof HTMLElement!="undefined"?y instanceof HTMLElement:!1}t.isHtml=V;function M(y){return typeof y=="object"&&!V(y)&&!v(y)&&!w(y)&&!f(y)&&!d(y)&&!C(y)&&y!==void 0&&!p(y)}t.isObject=M;function G(y){return typeof y=="function"}t.isFunction=G})(Kn||(Kn={}));var vu;(function(t){function e(s){return Kn.isObject(s)&&Object.keys(s).length==2&&"key"in s&&"rows"in s}t.isElementGroup=e;function n(s){for(let r of s)if(!e(r))return!1;return!0}t.isGrouping=n;function i(s){if(n(s)){let r=0;for(let a of s)r+=i(a.rows);return r}else return s.length}t.count=i})(vu||(vu={}));var ye=class{static file(e,n=!1,i){return new ye({path:e,embed:n,display:i,subpath:void 0,type:"file"})}static infer(e,n=!1,i){if(e.includes("#^")){let s=e.split("#^");return ye.block(s[0],s[1],n,i)}else if(e.includes("#")){let s=e.split("#");return ye.header(s[0],s[1],n,i)}else return ye.file(e,n,i)}static header(e,n,i,s){return new ye({path:e,embed:i,display:s,subpath:Kf(n),type:"header"})}static block(e,n,i,s){return new ye({path:e,embed:i,display:s,subpath:n,type:"block"})}static fromObject(e){return new ye(e)}constructor(e){Object.assign(this,e)}equals(e){return e==null||e==null?!1:this.path==e.path&&this.type==e.type&&this.subpath==e.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(e){return new ye(Object.assign({},this,{path:e}))}withDisplay(e){return new ye(Object.assign({},this,{display:e}))}withHeader(e){return ye.header(this.path,e,this.embed,this.display)}toFile(){return ye.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let e=new ye(this);return e.embed=!0,e}}fromEmbed(){if(this.embed){let e=new ye(this);return e.embed=!1,e}else return this}markdown(){let e=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?e+="|"+this.display:(e+="|"+Fu(this.path),(this.type=="header"||this.type=="block")&&(e+=" > "+this.subpath)),e+="]]",e}obsidianLink(){var e,n;let i=this.path.replace("|","\\|");return this.type=="header"?i+"#"+((e=this.subpath)===null||e===void 0?void 0:e.replace("|","\\|")):this.type=="block"?i+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):i}fileName(){return Fu(this.path).replace(".md","")}},Qi=class{constructor(e){this.$widget=e}},xu=class extends Qi{constructor(e,n){super("dataview:list-pair");this.key=e,this.value=n}markdown(){return`${Kn.toString(this.key)}: ${Kn.toString(this.value)}`}},Eu=class extends Qi{constructor(e,n){super("dataview:external-link");this.url=e,this.display=n}markdown(){var e;return`[${(e=this.display)!==null&&e!==void 0?e:this.url}](${this.url})`}},ku;(function(t){function e(a,o){return new xu(a,o)}t.listPair=e;function n(a,o){return new Eu(a,o)}t.externalLink=n;function i(a){return a.$widget==="dataview:list-pair"}t.isListPair=i;function s(a){return a.$widget==="dataview:external-link"}t.isExternalLink=s;function r(a){return i(a)||s(a)}t.isBuiltin=r})(ku||(ku={}));var ie;(function(t){function e(p){return{type:"variable",name:p}}t.variable=e;function n(p){return{type:"literal",value:p}}t.literal=n;function i(p,w,F){return{type:"binaryop",left:p,op:w,right:F}}t.binaryOp=i;function s(p,w){return{type:"index",object:p,index:w}}t.index=s;function r(p){let w=p.split("."),F=t.variable(w[0]);for(let C=1;C"||p==">="||p=="!="||p=="="}t.isCompareOp=f,t.NULL=t.literal(null)})(ie||(ie={}));var et;(function(t){function e(d){return{type:"tag",tag:d}}t.tag=e;function n(d){return{type:"csv",path:d}}t.csv=n;function i(d){return{type:"folder",folder:d}}t.folder=i;function s(d,f){return{type:"link",file:d,direction:f?"incoming":"outgoing"}}t.link=s;function r(d,f,p){return{type:"binaryop",left:d,op:f,right:p}}t.binaryOp=r;function a(d,f){return{type:"binaryop",left:d,op:"&",right:f}}t.and=a;function o(d,f){return{type:"binaryop",left:d,op:"|",right:f}}t.or=o;function l(d){return{type:"negate",child:d}}t.negate=l;function c(){return{type:"empty"}}t.empty=c})(et||(et={}));var Cu=new RegExp(or(),""),lr={year:N.fromObject({years:1}),years:N.fromObject({years:1}),yr:N.fromObject({years:1}),yrs:N.fromObject({years:1}),month:N.fromObject({months:1}),months:N.fromObject({months:1}),mo:N.fromObject({months:1}),mos:N.fromObject({months:1}),week:N.fromObject({weeks:1}),weeks:N.fromObject({weeks:1}),wk:N.fromObject({weeks:1}),wks:N.fromObject({weeks:1}),w:N.fromObject({weeks:1}),day:N.fromObject({days:1}),days:N.fromObject({days:1}),d:N.fromObject({days:1}),hour:N.fromObject({hours:1}),hours:N.fromObject({hours:1}),hr:N.fromObject({hours:1}),hrs:N.fromObject({hours:1}),h:N.fromObject({hours:1}),minute:N.fromObject({minutes:1}),minutes:N.fromObject({minutes:1}),min:N.fromObject({minutes:1}),mins:N.fromObject({minutes:1}),m:N.fromObject({minutes:1}),second:N.fromObject({seconds:1}),seconds:N.fromObject({seconds:1}),sec:N.fromObject({seconds:1}),secs:N.fromObject({seconds:1}),s:N.fromObject({seconds:1})},ur={now:()=>L.local(),today:()=>L.local().startOf("day"),yesterday:()=>L.local().startOf("day").minus(N.fromObject({days:1})),tomorrow:()=>L.local().startOf("day").plus(N.fromObject({days:1})),sow:()=>L.local().startOf("week"),"start-of-week":()=>L.local().startOf("week"),eow:()=>L.local().endOf("week"),"end-of-week":()=>L.local().endOf("week"),soy:()=>L.local().startOf("year"),"start-of-year":()=>L.local().startOf("year"),eoy:()=>L.local().endOf("year"),"end-of-year":()=>L.local().endOf("year"),som:()=>L.local().startOf("month"),"start-of-month":()=>L.local().startOf("month"),eom:()=>L.local().endOf("month"),"end-of-month":()=>L.local().endOf("month")},cr=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function Zf(t){let e=-1;for(;(e=t.indexOf("|",e+1))>=0;)if(!(e>0&&t[e-1]=="\\"))return[t.substring(0,e).replace(/\\\|/g,"|"),t.substring(e+1)];return[t.replace(/\\\|/g,"|"),void 0]}function Yf(t){let[e,n]=Zf(t);return ye.infer(e,!1,n)}function zn(t,e,n){return g.seqMap(t,g.seq(g.optWhitespace,e,g.optWhitespace,t).many(),(i,s)=>{if(s.length==0)return i;let r=n(i,s[0][1],s[0][3]);for(let a=1;a(s,r)=>{let a=t._(s,r);if(!a.status)return a;for(let o of e){let l=o(a.value)._(s,a.index);if(!l.status)return a;a=l}return a})}var He=g.createLanguage({number:t=>g.regexp(/-?[0-9]+(\.[0-9]+)?/).map(e=>Number.parseFloat(e)).desc("number"),string:t=>g.string('"').then(g.alt(t.escapeCharacter,g.noneOf('"\\')).atLeast(0).map(e=>e.join(""))).skip(g.string('"')).desc("string"),escapeCharacter:t=>g.string("\\").then(g.any).map(e=>e==='"'?'"':e==="\\"?"\\":"\\"+e),bool:t=>g.regexp(/true|false|True|False/).map(e=>e.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:t=>g.seqMap(g.string("#"),g.alt(g.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(e,n)=>e+n.join("")).desc("tag ('#hello/stuff')"),identifier:t=>g.seqMap(g.alt(g.regexp(/\p{Letter}/u),g.regexp(Cu).desc("text")),g.alt(g.regexp(/[0-9\p{Letter}_-]/u),g.regexp(Cu).desc("text")).many(),(e,n)=>e+n.join("")).desc("variable identifier"),link:t=>g.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(e=>Yf(e)).desc("file link"),embedLink:t=>g.seqMap(g.string("!").atMost(1),t.link,(e,n)=>(e.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:t=>g.regexp(/\+|-/).map(e=>e).desc("'+' or '-'"),binaryMulDiv:t=>g.regexp(/\*|\/|%/).map(e=>e).desc("'*' or '/' or '%'"),binaryCompareOp:t=>g.regexp(/>=|<=|!=|>|<|=/).map(e=>e).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:t=>g.regexp(/and|or|&|\|/i).map(e=>e.toLowerCase()=="and"?"&":e.toLowerCase()=="or"?"|":e).desc("'and' or 'or'"),rootDate:t=>g.seqMap(g.regexp(/\d{4}/),g.string("-"),g.regexp(/\d{2}/),(e,n,i)=>L.fromObject({year:Number.parseInt(e),month:Number.parseInt(i)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:t=>g.alt(...Object.keys(ur).sort((e,n)=>n.length-e.length).map(g.string)),date:t=>Jf(t.rootDate,e=>g.seqMap(g.string("-"),g.regexp(/\d{2}/),(n,i)=>e.set({day:Number.parseInt(i)})),e=>g.seqMap(g.string("T"),g.regexp(/\d{2}/),(n,i)=>e.set({hour:Number.parseInt(i)})),e=>g.seqMap(g.string(":"),g.regexp(/\d{2}/),(n,i)=>e.set({minute:Number.parseInt(i)})),e=>g.seqMap(g.string(":"),g.regexp(/\d{2}/),(n,i)=>e.set({second:Number.parseInt(i)})),e=>g.alt(g.seqMap(g.string("."),g.regexp(/\d{3}/),(n,i)=>e.set({millisecond:Number.parseInt(i)})),g.succeed(e)),e=>g.alt(g.seqMap(g.string("+").or(g.string("-")),g.regexp(/\d{1,2}(:\d{2})?/),(n,i)=>e.setZone("UTC"+n+i,{keepLocalTime:!0})),g.seqMap(g.string("Z"),()=>e.setZone("utc",{keepLocalTime:!0})),g.seqMap(g.string("["),g.regexp(/[0-9A-Za-z+-\/]+/u),g.string("]"),(n,i,s)=>e.setZone(i,{keepLocalTime:!0})))).assert(e=>e.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:t=>g.alt(t.dateShorthand.map(e=>ur[e]()),t.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:t=>g.alt(...Object.keys(lr).sort((e,n)=>n.length-e.length).map(g.string)),duration:t=>g.seqMap(t.number,g.optWhitespace,t.durationType,(e,n,i)=>lr[i].mapUnits(s=>s*e)).sepBy1(g.string(",").trim(g.optWhitespace).or(g.optWhitespace)).map(e=>e.reduce((n,i)=>n.plus(i))).desc("duration like 4hr2min"),rawNull:t=>g.string("null"),tagSource:t=>t.tag.map(e=>et.tag(e)),csvSource:t=>g.seqMap(g.string("csv(").skip(g.optWhitespace),t.string,g.string(")"),(e,n,i)=>et.csv(n)),linkIncomingSource:t=>t.link.map(e=>et.link(e.path,!0)),linkOutgoingSource:t=>g.seqMap(g.string("outgoing(").skip(g.optWhitespace),t.link,g.string(")"),(e,n,i)=>et.link(n.path,!1)),folderSource:t=>t.string.map(e=>et.folder(e)),parensSource:t=>g.seqMap(g.string("("),g.optWhitespace,t.source,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>i),negateSource:t=>g.seqMap(g.alt(g.string("-"),g.string("!")),t.atomSource,(e,n)=>et.negate(n)),atomSource:t=>g.alt(t.parensSource,t.negateSource,t.linkOutgoingSource,t.linkIncomingSource,t.folderSource,t.tagSource,t.csvSource),binaryOpSource:t=>zn(t.atomSource,t.binaryBooleanOp.map(e=>e),et.binaryOp),source:t=>t.binaryOpSource,variableField:t=>t.identifier.chain(e=>cr.includes(e.toUpperCase())?g.fail("Variable fields cannot be a keyword ("+cr.join(" or ")+")"):g.succeed(ie.variable(e))).desc("variable"),numberField:t=>t.number.map(e=>ie.literal(e)).desc("number"),stringField:t=>t.string.map(e=>ie.literal(e)).desc("string"),boolField:t=>t.bool.map(e=>ie.literal(e)).desc("boolean"),dateField:t=>g.seqMap(g.string("date("),g.optWhitespace,t.datePlus,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>ie.literal(i)).desc("date"),durationField:t=>g.seqMap(g.string("dur("),g.optWhitespace,t.duration,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>ie.literal(i)).desc("duration"),nullField:t=>t.rawNull.map(e=>ie.NULL),linkField:t=>t.link.map(e=>ie.literal(e)),listField:t=>t.field.sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("[").skip(g.optWhitespace),g.optWhitespace.then(g.string("]"))).map(e=>ie.list(e)).desc("list ('[1, 2, 3]')"),objectField:t=>g.seqMap(t.identifier.or(t.string),g.string(":").trim(g.optWhitespace),t.field,(e,n,i)=>({name:e,value:i})).sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("{").skip(g.optWhitespace),g.optWhitespace.then(g.string("}"))).map(e=>{let n={};for(let i of e)n[i.name]=i.value;return ie.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:t=>g.alt(t.date,t.duration.map(e=>wu(e)),t.string,t.tag,t.embedLink,t.bool,t.number,t.rawNull),inlineFieldList:t=>t.atomInlineField.sepBy(g.string(",").trim(g.optWhitespace).lookahead(t.atomInlineField)),inlineField:t=>g.alt(g.seqMap(t.atomInlineField,g.string(",").trim(g.optWhitespace),t.inlineFieldList,(e,n,i)=>[e].concat(i)),t.atomInlineField),atomField:t=>g.alt(t.embedLink.map(e=>ie.literal(e)),t.negatedField,t.linkField,t.listField,t.objectField,t.lambdaField,t.parensField,t.boolField,t.numberField,t.stringField,t.dateField,t.durationField,t.nullField,t.variableField),indexField:t=>g.seqMap(t.atomField,g.alt(t.dotPostfix,t.indexPostfix,t.functionPostfix).many(),(e,n)=>{let i=e;for(let s of n)switch(s.type){case"dot":i=ie.index(i,ie.literal(s.field));break;case"index":i=ie.index(i,s.field);break;case"function":i=ie.func(i,s.fields);break}return i}),negatedField:t=>g.seqMap(g.string("!"),t.indexField,(e,n)=>ie.negate(n)).desc("negated field"),parensField:t=>g.seqMap(g.string("("),g.optWhitespace,t.field,g.optWhitespace,g.string(")"),(e,n,i,s,r)=>i),lambdaField:t=>g.seqMap(t.identifier.sepBy(g.string(",").trim(g.optWhitespace)).wrap(g.string("(").trim(g.optWhitespace),g.string(")").trim(g.optWhitespace)),g.string("=>").trim(g.optWhitespace),t.field,(e,n,i)=>({type:"lambda",arguments:e,value:i})),dotPostfix:t=>g.seqMap(g.string("."),t.identifier,(e,n)=>({type:"dot",field:n})),indexPostfix:t=>g.seqMap(g.string("["),g.optWhitespace,t.field,g.optWhitespace,g.string("]"),(e,n,i,s,r)=>({type:"index",field:i})),functionPostfix:t=>g.seqMap(g.string("("),g.optWhitespace,t.field.sepBy(g.string(",").trim(g.optWhitespace)),g.optWhitespace,g.string(")"),(e,n,i,s,r)=>({type:"function",fields:i})),binaryMulDivField:t=>zn(t.indexField,t.binaryMulDiv,ie.binaryOp),binaryPlusMinusField:t=>zn(t.binaryMulDivField,t.binaryPlusMinus,ie.binaryOp),binaryCompareField:t=>zn(t.binaryPlusMinusField,t.binaryCompareOp,ie.binaryOp),binaryBooleanField:t=>zn(t.binaryCompareField,t.binaryBooleanOp,ie.binaryOp),binaryOpField:t=>t.binaryBooleanField,field:t=>t.binaryOpField});function Qf(t){try{return Yi.success(He.field.tryParse(t))}catch(e){return Yi.failure(""+e)}}var Xi;(function(t){function e(i,s){return{name:i,field:s}}t.named=e;function n(i,s){return{field:i,direction:s}}t.sortBy=n})(Xi||(Xi={}));function Xf(t){return g.custom((e,n)=>(i,s)=>{let r=t._(i,s);return r.status?Object.assign({},r,{value:[r.value,i.substring(s,r.index)]}):r})}function ep(t){return t.split(/[\r\n]+/).map(e=>e.trim()).join("")}function Su(t,e){return g.eof.map(t).or(g.whitespace.then(e))}var tp=g.createLanguage({queryType:t=>g.alt(g.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(e=>e.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:t=>g.seqMap(He.field.skip(g.whitespace),g.regexp(/AS/i).skip(g.whitespace),He.identifier.or(He.string),(e,n,i)=>Xi.named(i,e)),namedField:t=>g.alt(t.explicitNamedField,Xf(He.field).map(([e,n])=>Xi.named(ep(n),e))),sortField:t=>g.seqMap(He.field.skip(g.optWhitespace),g.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(e,n)=>{let i=n.length==0?"ascending":n[0].toLowerCase();return i=="desc"&&(i="descending"),i=="asc"&&(i="ascending"),{field:e,direction:i}}),headerClause:t=>t.queryType.chain(e=>{switch(e){case"table":return Su(()=>({type:e,fields:[],showId:!0}),g.seqMap(g.regexp(/WITHOUT\s+ID/i).skip(g.optWhitespace).atMost(1),g.sepBy(t.namedField,g.string(",").trim(g.optWhitespace)),(n,i)=>({type:e,fields:i,showId:n.length==0})));case"list":return Su(()=>({type:e,format:void 0,showId:!0}),g.seqMap(g.regexp(/WITHOUT\s+ID/i).skip(g.optWhitespace).atMost(1),He.field.atMost(1),(n,i)=>({type:e,format:i.length==1?i[0]:void 0,showId:n.length==0})));case"task":return g.succeed({type:e});case"calendar":return g.whitespace.then(g.seqMap(t.namedField,n=>({type:e,showId:!0,field:n})));default:return g.fail(`Unrecognized query type '${e}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:t=>g.seqMap(g.regexp(/FROM/i),g.whitespace,He.source,(e,n,i)=>i),whereClause:t=>g.seqMap(g.regexp(/WHERE/i),g.whitespace,He.field,(e,n,i)=>({type:"where",clause:i})).desc("WHERE "),sortByClause:t=>g.seqMap(g.regexp(/SORT/i),g.whitespace,t.sortField.sepBy1(g.string(",").trim(g.optWhitespace)),(e,n,i)=>({type:"sort",fields:i})).desc("SORT field [ASC/DESC]"),limitClause:t=>g.seqMap(g.regexp(/LIMIT/i),g.whitespace,He.field,(e,n,i)=>({type:"limit",amount:i})).desc("LIMIT "),flattenClause:t=>g.seqMap(g.regexp(/FLATTEN/i).skip(g.whitespace),t.namedField,(e,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:t=>g.seqMap(g.regexp(/GROUP BY/i).skip(g.whitespace),t.namedField,(e,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:t=>g.alt(t.fromClause,t.whereClause,t.sortByClause,t.limitClause,t.groupByClause,t.flattenClause),query:t=>g.seqMap(t.headerClause.trim(g.optWhitespace),t.fromClause.trim(g.optWhitespace).atMost(1),t.clause.trim(g.optWhitespace).many(),(e,n,i)=>({header:e,source:n.length==0?et.folder(""):n[0],operations:i,settings:ar}))}),np=t=>{var e;return t?(e=t.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},ip=t=>t.plugins.enabledPlugins.has("dataview");tt.DATE_SHORTHANDS=ur;tt.DURATION_TYPES=lr;tt.EXPRESSION=He;tt.KEYWORDS=cr;tt.QUERY_LANGUAGE=tp;tt.getAPI=np;tt.isPluginEnabled=ip;tt.parseField=Qf});os(exports,{default:()=>Lr});function ct(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}var Sa=q(ra());function aa(t){return Object.prototype.toString.call(t)==="[object Object]"}function ri(t){var e,n;return aa(t)===!1?!1:(e=t.constructor,e===void 0?!0:(n=e.prototype,!(aa(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function Lc(t){return t?Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{}):{}}function oa(t,e){let n=Object.assign({},t);return Object.keys(e).forEach(i=>{ri(e[i])?i in t?n[i]=oa(t[i],e[i]):Object.assign(n,{[i]:e[i]}):Object.assign(n,{[i]:e[i]})}),n}function la(t){for(let e in t)t[e]===void 0&&delete t[e];return t}function ls(t,e,n){if(typeof e=="string"){let[s,r]=e.split(" ");n=Object.assign(r?{method:s,url:r}:{url:s},n)}else n=Object.assign({},e);n.headers=Lc(n.headers),la(n),la(n.headers);let i=oa(t||{},n);return t&&t.mediaType.previews.length&&(i.mediaType.previews=t.mediaType.previews.filter(s=>!i.mediaType.previews.includes(s)).concat(i.mediaType.previews)),i.mediaType.previews=i.mediaType.previews.map(s=>s.replace(/-preview/,"")),i}function Mc(t,e){let n=/\?/.test(t)?"&":"?",i=Object.keys(e);return i.length===0?t:t+n+i.map(s=>s==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${s}=${encodeURIComponent(e[s])}`).join("&")}var Bc=/\{[^}]+\}/g;function Ic(t){return t.replace(/^\W+|\W+$/g,"").split(/,/)}function $c(t){let e=t.match(Bc);return e?e.map(Ic).reduce((n,i)=>n.concat(i),[]):[]}function ua(t,e){return Object.keys(t).filter(n=>!e.includes(n)).reduce((n,i)=>(n[i]=t[i],n),{})}function ca(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}function Ht(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function wn(t,e,n){return e=t==="+"||t==="#"?ca(e):Ht(e),n?Ht(n)+"="+e:e}function Ut(t){return t!=null}function us(t){return t===";"||t==="&"||t==="?"}function Vc(t,e,n,i){var s=t[n],r=[];if(Ut(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),r.push(wn(e,s,us(e)?n:""));else if(i==="*")Array.isArray(s)?s.filter(Ut).forEach(function(a){r.push(wn(e,a,us(e)?n:""))}):Object.keys(s).forEach(function(a){Ut(s[a])&&r.push(wn(e,s[a],a))});else{let a=[];Array.isArray(s)?s.filter(Ut).forEach(function(o){a.push(wn(e,o))}):Object.keys(s).forEach(function(o){Ut(s[o])&&(a.push(Ht(o)),a.push(wn(e,s[o].toString())))}),us(e)?r.push(Ht(n)+"="+a.join(",")):a.length!==0&&r.push(a.join(","))}else e===";"?Ut(s)&&r.push(Ht(n)):s===""&&(e==="&"||e==="?")?r.push(Ht(n)+"="):s===""&&r.push("");return r}function Gc(t){return{expand:jc.bind(null,t)}}function jc(t,e){var n=["+","#",".","/",";","?","&"];return t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,s,r){if(s){let o="",l=[];if(n.indexOf(s.charAt(0))!==-1&&(o=s.charAt(0),s=s.substr(1)),s.split(/,/g).forEach(function(c){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(c);l.push(Vc(e,o,d[1],d[2]||d[3]))}),o&&o!=="+"){var a=",";return o==="?"?a="&":o!=="#"&&(a=o),(l.length!==0?o:"")+l.join(a)}else return l.join(",")}else return ca(r)})}function da(t){let e=t.method.toUpperCase(),n=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},t.headers),s,r=ua(t,["method","baseUrl","url","headers","request","mediaType"]),a=$c(n);n=Gc(n).expand(r),/^http/.test(n)||(n=t.baseUrl+n);let o=Object.keys(t).filter(d=>a.includes(d)).concat("baseUrl"),l=ua(r,o);if(!/application\/octet-stream/i.test(i.accept)&&(t.mediaType.format&&(i.accept=i.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),t.mediaType.previews.length)){let d=i.accept.match(/[\w-]+(?=-preview)/g)||[];i.accept=d.concat(t.mediaType.previews).map(f=>{let p=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${f}-preview${p}`}).join(",")}return["GET","HEAD"].includes(e)?n=Mc(n,l):"data"in l?s=l.data:Object.keys(l).length&&(s=l),!i["content-type"]&&typeof s!="undefined"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof s=="undefined"&&(s=""),Object.assign({method:e,url:n,headers:i},typeof s!="undefined"?{body:s}:null,t.request?{request:t.request}:null)}function Hc(t,e,n){return da(ls(t,e,n))}function ha(t,e){let n=ls(t,e),i=Hc.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:ha.bind(null,n),merge:ls.bind(null,n),parse:da})}var Uc="7.0.6",_c=`octokit-endpoint.js/${Uc} ${ct()}`,qc={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":_c},mediaType:{format:"",previews:[]}},fa=ha(null,qc);var va=q(ma());var ai=class extends Error{constructor(e){super(e);Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}};var ds=q(Fa()),Kc=(0,ds.default)(t=>console.warn(t)),zc=(0,ds.default)(t=>console.warn(t)),vt=class extends Error{constructor(e,n,i){super(e);Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=n;let s;"headers"in i&&typeof i.headers!="undefined"&&(s=i.headers),"response"in i&&(this.response=i.response,s=i.response.headers);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),r.url=r.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=r,Object.defineProperty(this,"code",{get(){return Kc(new ai("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),n}}),Object.defineProperty(this,"headers",{get(){return zc(new ai("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),s||{}}})}};var Zc="6.2.8";function Yc(t){return t.arrayBuffer()}function xa(t){let e=t.request&&t.request.log?t.request.log:console;(ri(t.body)||Array.isArray(t.body))&&(t.body=JSON.stringify(t.body));let n={},i,s;return(t.request&&t.request.fetch||globalThis.fetch||va.default)(t.url,Object.assign({method:t.method,body:t.body,headers:t.headers,redirect:t.redirect,...t.body&&{duplex:"half"}},t.request)).then(async a=>{s=a.url,i=a.status;for(let o of a.headers)n[o[0]]=o[1];if("deprecation"in n){let o=n.link&&n.link.match(/<([^>]+)>; rel="deprecation"/),l=o&&o.pop();e.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${n.sunset}${l?`. See ${l}`:""}`)}if(!(i===204||i===205)){if(t.method==="HEAD"){if(i<400)return;throw new vt(a.statusText,i,{response:{url:s,status:i,headers:n,data:void 0},request:t})}if(i===304)throw new vt("Not modified",i,{response:{url:s,status:i,headers:n,data:await hs(a)},request:t});if(i>=400){let o=await hs(a);throw new vt(Jc(o),i,{response:{url:s,status:i,headers:n,data:o},request:t})}return hs(a)}}).then(a=>({status:i,url:s,headers:n,data:a})).catch(a=>{throw a instanceof vt||a.name==="AbortError"?a:new vt(a.message,500,{request:t})})}async function hs(t){let e=t.headers.get("content-type");return/application\/json/.test(e)?t.json():!e||/^text\/|charset=utf-8$/.test(e)?t.text():Yc(t)}function Jc(t){return typeof t=="string"?t:"message"in t?Array.isArray(t.errors)?`${t.message}: ${t.errors.map(JSON.stringify).join(", ")}`:t.message:`Unknown error: ${JSON.stringify(t)}`}function fs(t,e){let n=t.defaults(e);return Object.assign(function(s,r){let a=n.merge(s,r);if(!a.request||!a.request.hook)return xa(n.parse(a));let o=(l,c)=>xa(n.parse(n.merge(l,c)));return Object.assign(o,{endpoint:n,defaults:fs.bind(null,n)}),a.request.hook(o,a)},{endpoint:n,defaults:fs.bind(null,n)})}var Fn=fs(fa,{headers:{"user-agent":`octokit-request.js/${Zc} ${ct()}`}});var Qc="5.0.6";function Xc(t){return`Request failed due to following response errors: +`+t.errors.map(e=>` - ${e.message}`).join(` +`)}var ed=class extends Error{constructor(t,e,n){super(Xc(n));this.request=t,this.headers=e,this.response=n,this.name="GraphqlResponseError",this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},td=["method","baseUrl","url","headers","request","query","mediaType"],nd=["query","method","url"],Ea=/\/api\/v3\/?$/;function id(t,e,n){if(n){if(typeof e=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let a in n)if(!!nd.includes(a))return Promise.reject(new Error(`[@octokit/graphql] "${a}" cannot be used as variable name`))}let i=typeof e=="string"?Object.assign({query:e},n):e,s=Object.keys(i).reduce((a,o)=>td.includes(o)?(a[o]=i[o],a):(a.variables||(a.variables={}),a.variables[o]=i[o],a),{}),r=i.baseUrl||t.endpoint.DEFAULTS.baseUrl;return Ea.test(r)&&(s.url=r.replace(Ea,"/api/graphql")),t(s).then(a=>{if(a.data.errors){let o={};for(let l of Object.keys(a.headers))o[l]=a.headers[l];throw new ed(s,o,a.data)}return a.data.data})}function ps(t,e){let n=t.defaults(e);return Object.assign((s,r)=>id(n,s,r),{defaults:ps.bind(null,n),endpoint:n.endpoint})}var Qp=ps(Fn,{headers:{"user-agent":`octokit-graphql.js/${Qc} ${ct()}`},method:"POST",url:"/graphql"});function ka(t){return ps(t,{method:"POST",url:"/graphql"})}var sd=/^v1\./,rd=/^ghs_/,ad=/^ghu_/;async function od(t){let e=t.split(/\./).length===3,n=sd.test(t)||rd.test(t),i=ad.test(t);return{type:"token",token:t,tokenType:e?"app":n?"installation":i?"user-to-server":"oauth"}}function ld(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function ud(t,e,n,i){let s=e.endpoint.merge(n,i);return s.headers.authorization=ld(t),e(s)}var Ca=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(od.bind(null,e),{hook:ud.bind(null,e)})};var Ta="4.2.4",vn=class{static defaults(t){return class extends this{constructor(...n){let i=n[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var e;let n=this.plugins;return e=class extends this{},e.plugins=n.concat(t.filter(s=>!n.includes(s))),e}constructor(t={}){let e=new Sa.Collection,n={baseUrl:Fn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:e.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=[t.userAgent,`octokit-core.js/${Ta} ${ct()}`].filter(Boolean).join(" "),t.baseUrl&&(n.baseUrl=t.baseUrl),t.previews&&(n.mediaType.previews=t.previews),t.timeZone&&(n.headers["time-zone"]=t.timeZone),this.request=Fn.defaults(n),this.graphql=ka(this.request).defaults(n),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},t.log),this.hook=e,t.authStrategy){let{authStrategy:s,...r}=t,a=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},t.auth));e.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=Ca(t.auth);e.wrap("request",s.hook),this.auth=s}this.constructor.plugins.forEach(s=>{Object.assign(this,s(this,t))})}};vn.VERSION=Ta;vn.plugins=[];var cd={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}},xn=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||cd,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),i=0;i{this.observers[i]=this.observers[i]||[],this.observers[i].push(n)}),this}off(e,n){if(!!this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e]=this.observers[e].filter(i=>i!==n)}}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s{a(...i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[e,...i])})}};function kn(){let t,e,n=new Promise((i,s)=>{t=i,e=s});return n.resolve=t,n.reject=e,n}function Pa(t){return t==null?"":""+t}function dd(t,e,n){t.forEach(i=>{e[i]&&(n[i]=e[i])})}function ms(t,e,n){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function s(){return!t||typeof t=="string"}let r=typeof e!="string"?[].concat(e):e.split(".");for(;r.length>1;){if(s())return{};let a=i(r.shift());!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={}}return s()?{}:{obj:t,k:i(r.shift())}}function Oa(t,e,n){let{obj:i,k:s}=ms(t,e,Object);i[s]=n}function hd(t,e,n,i){let{obj:s,k:r}=ms(t,e,Object);s[r]=s[r]||[],i&&(s[r]=s[r].concat(n)),i||s[r].push(n)}function li(t,e){let{obj:n,k:i}=ms(t,e);if(!!n)return n[i]}function fd(t,e,n){let i=li(t,n);return i!==void 0?i:li(e,n)}function Ra(t,e,n){for(let i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?typeof t[i]=="string"||t[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?n&&(t[i]=e[i]):Ra(t[i],e[i],n):t[i]=e[i]);return t}function qt(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var pd={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function md(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>pd[e]):t}var gd=[" ",",","?","!",";"];function bd(t,e,n){e=e||"",n=n||"";let i=gd.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(i.length===0)return!0;let s=new RegExp(`(${i.map(a=>a==="?"?"\\?":a).join("|")})`),r=!s.test(t);if(!r){let a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(r=!0)}return r}function ui(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];let i=e.split(n),s=t;for(let r=0;rr+a;)a++,o=i.slice(r,r+a).join(n),l=s[o];if(l===void 0)return;if(l===null)return null;if(e.endsWith(o)){if(typeof l=="string")return l;if(o&&typeof l[o]=="string")return l[o]}let c=i.slice(r+a).join(n);return c?ui(l,c,n):void 0}s=s[i[r]]}return s}function ci(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}var gs=class extends En{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super();this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,n];i&&typeof i!="string"&&(o=o.concat(i)),i&&typeof i=="string"&&(o=o.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(o=e.split("."));let l=li(this.data,o);return l||!a||typeof i!="string"?l:ui(this.data&&this.data[e]&&this.data[e][n],i,r)}addResource(e,n,i,s){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=[e,n];i&&(o=o.concat(a?i.split(a):i)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),Oa(this.data,o,s),r.silent||this.emit("added",e,n,i,s)}addResources(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in i)(typeof i[r]=="string"||Object.prototype.toString.apply(i[r])==="[object Array]")&&this.addResource(e,n,r,i[r],{silent:!0});s.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,s,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=i,i=n,n=o[1]),this.addNamespaces(n);let l=li(this.data,o)||{};s?Ra(l,i,r):l={...l,...i},Oa(this.data,o,l),a.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}},Na={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,s){return t.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,n,i,s))}),e}},Aa={},Cn=class extends En{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super();dd(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ke.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let i=this.resolve(e,n);return i&&i.res!==void 0}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");let s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,r=n.ns||this.options.defaultNS||[],a=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!bd(e,i,s);if(a&&!o){let l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:r};let c=e.split(i);(i!==s||i===s&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(s)}return typeof r=="string"&&(r=[r]),{key:e,namespaces:r}}translate(e,n,i){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);let s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),l=o[o.length-1],c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){let y=n.nsSeparator||this.options.nsSeparator;return s?{res:`${l}${y}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${y}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}let f=this.resolve(e,n),p=f&&f.res,w=f&&f.usedKey||a,F=f&&f.exactUsedKey||a,C=Object.prototype.toString.apply(p),v=["[object Number]","[object Function]","[object RegExp]"],V=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject;if(M&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&v.indexOf(C)<0&&!(typeof V=="string"&&C==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,p,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(f.res=y,f.usedParams=this.getUsedParamsDetails(n),f):y}if(r){let y=C==="[object Array]",E=y?[]:{},B=y?F:w;for(let k in p)if(Object.prototype.hasOwnProperty.call(p,k)){let $=`${B}${r}${k}`;E[k]=this.translate($,{...n,joinArrays:!1,ns:o}),E[k]===$&&(E[k]=p[k])}p=E}}else if(M&&typeof V=="string"&&C==="[object Array]")p=p.join(V),p&&(p=this.extendTranslation(p,e,n,i));else{let y=!1,E=!1,B=n.count!==void 0&&typeof n.count!="string",k=Cn.hasDefaultValue(n),$=B?this.pluralResolver.getSuffix(c,n.count,n):"",I=n.ordinal&&B?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",K=n[`defaultValue${$}`]||n[`defaultValue${I}`]||n.defaultValue;!this.isValidLookup(p)&&k&&(y=!0,p=K),this.isValidLookup(p)||(E=!0,p=a);let ce=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:p,we=k&&K!==p&&this.options.updateMissing;if(E||y||we){if(this.logger.log(we?"updateKey":"missingKey",c,l,a,we?K:p),r){let te=this.resolve(a,{...n,keySeparator:!1});te&&te.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let X=[],de=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&de&&de[0])for(let te=0;te{let qe=k&&ne!==p?ne:ce;this.options.missingKeyHandler?this.options.missingKeyHandler(te,l,Ce,qe,we,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(te,l,Ce,qe,we,n),this.emit("missingKey",te,l,Ce,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?X.forEach(te=>{this.pluralResolver.getSuffixes(te,n).forEach(Ce=>{xe([te],a+Ce,n[`defaultValue${Ce}`]||K)})}):xe(X,a,K))}p=this.extendTranslation(p,e,n,f,i),E&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${a}`),(E||y)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,y?p:void 0):p=this.options.parseMissingKeyHandler(p))}return s?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,n,i,s,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});let c=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){let p=e.match(this.interpolator.nestingRegexp);d=p&&p.length}let f=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,i.lng||this.language,i),c){let p=e.match(this.interpolator.nestingRegexp),w=p&&p.length;d1&&arguments[1]!==void 0?arguments[1]:{},i,s,r,a,o;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(i))return;let c=this.extractFromKey(l,n),d=c.key;s=d;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));let p=n.count!==void 0&&typeof n.count!="string",w=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),F=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{this.isValidLookup(i)||(o=v,!Aa[`${C[0]}-${v}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(Aa[`${C[0]}-${v}`]=!0,this.logger.warn(`key "${s}" for languages "${C.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(V=>{if(this.isValidLookup(i))return;a=V;let M=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(M,d,V,v,n);else{let y;p&&(y=this.pluralResolver.getSuffix(V,n.count,n));let E=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(M.push(d+y),n.ordinal&&y.indexOf(B)===0&&M.push(d+y.replace(B,this.options.pluralSeparator)),w&&M.push(d+E)),F){let k=`${d}${this.options.contextSeparator}${n.context}`;M.push(k),p&&(M.push(k+y),n.ordinal&&y.indexOf(B)===0&&M.push(k+y.replace(B,this.options.pluralSeparator)),w&&M.push(k+E))}}let G;for(;G=M.pop();)this.isValidLookup(i)||(r=G,i=this.getResource(V,v,G,n))}))})}),{res:i,usedKey:s,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,i,s):this.resourceStore.getResource(e,n,i,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&typeof e.replace!="string",s=i?e.replace:e;if(i&&typeof e.count!="undefined"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(let r of n)delete s[r]}return s}static hasDefaultValue(e){let n="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}};function bs(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ys=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ke.create("languageUtils")}getScriptPartFromCode(e){if(e=ci(e),!e||e.indexOf("-")<0)return null;let n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=ci(e),!e||e.indexOf("-")<0)return e;let n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){let n=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map(s=>s.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=bs(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;let s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;let s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(r=>{if(r===s)return r;if(!(r.indexOf("-")<0&&s.indexOf("-")<0)&&r.indexOf(s)===0)return r})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){let i=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],r=a=>{!a||(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):typeof e=="string"&&r(this.formatLanguageCode(e)),i.forEach(a=>{s.indexOf(a)<0&&r(this.formatLanguageCode(a))}),s}},yd=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Dd={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},wd=["v1","v2","v3"],Fd=["v4"],La={zero:0,one:1,two:2,few:3,many:4,other:5};function vd(){let t={};return yd.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:Dd[e.fc]}})}),t}var Ma=class{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Ke.create("pluralResolver"),(!this.options.compatibilityJSON||Fd.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=vd()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(ci(e),{type:n.ordinal?"ordinal":"cardinal"})}catch(i){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(e,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((s,r)=>La[s]-La[r]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):i.numbers.map(s=>this.getSuffix(e,s,n)):[]}getSuffix(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.getRule(e,i);return s?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){let i=e.noAbs?e.plurals(n):e.plurals(Math.abs(n)),s=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));let r=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!wd.includes(this.options.compatibilityJSON)}};function Ba(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=fd(t,e,n);return!r&&s&&typeof n=="string"&&(r=ui(t,n,i),r===void 0&&(r=ui(e,n,i))),r}var Ia=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let n=e.interpolation;this.escape=n.escape!==void 0?n.escape:md,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?qt(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?qt(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?qt(n.nestingPrefix):n.nestingPrefixEscaped||qt("$t("),this.nestingSuffix=n.nestingSuffix?qt(n.nestingSuffix):n.nestingSuffixEscaped||qt(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");let n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");let i=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(i,"g")}interpolate(e,n,i,s){let r,a,o,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(F){return F.replace(/\$/g,"$$$$")}let d=F=>{if(F.indexOf(this.formatSeparator)<0){let M=Ba(n,l,F,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,i,{...s,...n,interpolationkey:F}):M}let C=F.split(this.formatSeparator),v=C.shift().trim(),V=C.join(this.formatSeparator).trim();return this.format(Ba(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),V,i,{...s,...n,interpolationkey:v})};this.resetRegExp();let f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:F=>c(F)},{regex:this.regexp,safeValue:F=>this.escapeValue?c(this.escape(F)):c(F)}].forEach(F=>{for(o=0;r=F.regex.exec(e);){let C=r[1].trim();if(a=d(C),a===void 0)if(typeof f=="function"){let V=f(e,r,s);a=typeof V=="string"?V:""}else if(s&&Object.prototype.hasOwnProperty.call(s,C))a="";else if(p){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${e}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=Pa(a));let v=F.safeValue(a);if(e=e.replace(r[0],v),p?(F.regex.lastIndex+=a.length,F.regex.lastIndex-=r[0].length):F.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a;function o(l,c){let d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;let f=l.split(new RegExp(`${d}[ ]*{`)),p=`{${f[1]}`;l=f[0],p=this.interpolate(p,a);let w=p.match(/'/g),F=p.match(/"/g);(w&&w.length%2==0&&!F||F.length%2!=0)&&(p=p.replace(/'/g,'"'));try{a=JSON.parse(p),c&&(a={...c,...a})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,C),`${l}${d}${p}`}return delete a.defaultValue,l}for(;s=this.nestingRegexp.exec(e);){let l=[];a={...i},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){let d=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=d.shift(),l=d,c=!0}if(r=n(o.call(this,s[1].trim(),a),a),r&&s[0]===e&&typeof r!="string")return r;typeof r!="string"&&(r=Pa(r)),r||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),r=""),c&&(r=l.reduce((d,f)=>this.format(d,f,i.lng,{...i,interpolationkey:s[1].trim()}),r.trim())),e=e.replace(s[0],r),this.regexp.lastIndex=0}return e}};function xd(t){let e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){let i=t.split("(");e=i[0].toLowerCase().trim();let s=i[1].substring(0,i[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(!a)return;let[o,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=c),c==="false"&&(n[o.trim()]=!1),c==="true"&&(n[o.trim()]=!0),isNaN(c)||(n[o.trim()]=parseInt(c,10))})}return{formatName:e,formatOptions:n}}function Wt(t){let e={};return function(i,s,r){let a=s+JSON.stringify(r),o=e[a];return o||(o=t(ci(s),r),e[a]=o),o(i)}}var $a=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ke.create("formatter"),this.options=e,this.formats={number:Wt((n,i)=>{let s=new Intl.NumberFormat(n,{...i});return r=>s.format(r)}),currency:Wt((n,i)=>{let s=new Intl.NumberFormat(n,{...i,style:"currency"});return r=>s.format(r)}),datetime:Wt((n,i)=>{let s=new Intl.DateTimeFormat(n,{...i});return r=>s.format(r)}),relativetime:Wt((n,i)=>{let s=new Intl.RelativeTimeFormat(n,{...i});return r=>s.format(r,i.range||"day")}),list:Wt((n,i)=>{let s=new Intl.ListFormat(n,{...i});return r=>s.format(r)})},this.init(e)}init(e){let i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Wt(n)}format(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((o,l)=>{let{formatName:c,formatOptions:d}=xd(l);if(this.formats[c]){let f=o;try{let p=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},w=p.locale||p.lng||s.locale||s.lng||i;f=this.formats[c](o,w,{...d,...s,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return o},e)}};function Ed(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var Va=class extends En{constructor(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super();this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Ke.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,s.backend,s)}queueLoad(e,n,i,s){let r={},a={},o={},l={};return e.forEach(c=>{let d=!0;n.forEach(f=>{let p=`${c}|${f}`;!i.reload&&this.store.hasResourceBundle(c,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?a[p]===void 0&&(a[p]=!0):(this.state[p]=1,d=!1,a[p]===void 0&&(a[p]=!0),r[p]===void 0&&(r[p]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,n,i){let s=e.split("|"),r=s[0],a=s[1];n&&this.emit("failedLoading",r,a,n),i&&this.store.addResourceBundle(r,a,i),this.state[e]=n?-1:2;let o={};this.queue.forEach(l=>{hd(l.loaded,[r],a),Ed(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});let d=l.loaded[c];d.length&&d.forEach(f=>{o[c][f]===void 0&&(o[c][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,n,i){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:s,wait:r,callback:a});return}this.readingCalls++;let o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){let f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&d&&s{this.read.call(this,e,n,i,s+1,r*2,a)},r);return}a(c,d)},l=this.backend[i].bind(this.backend);if(l.length===2){try{let c=l(e,n);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,n,o)}prepareLoading(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);let r=this.queueLoad(e,n,i,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=e.split("|"),s=i[0],r=i[1];this.read(s,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${r} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${r} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,i,s,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){let l={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,n,i,s,l):d=c(e,n,i,s),d&&typeof d.then=="function"?d.then(f=>o(null,f)).catch(o):o(null,d)}catch(d){o(d)}else c(e,n,i,s,o,l)}!e||!e[0]||this.store.addResource(e[0],n,i,s)}}};function Ga(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let n={};if(typeof e[1]=="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){let i=e[3]||e[2];Object.keys(i).forEach(s=>{n[s]=i[s]})}return n},interpolation:{escapeValue:!0,format:(t,e,n,i)=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ja(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function di(){}function kd(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var Kt=class extends En{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;super();if(this.options=ja(e),this.services={},this.logger=Ke,this.modules={external:[]},kd(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(i=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));let s=Ga();this.options={...s,...this.options,...ja(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function r(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Ke.init(r(this.modules.logger),this.options):Ke.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl!="undefined"&&(d=$a);let f=new ys(this.options);this.store=new gs(this.options.resources,this.options);let p=this.services;p.logger=Ke,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new Ma(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=r(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new Ia(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Va(r(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(w){for(var F=arguments.length,C=new Array(F>1?F-1:0),v=1;v1?F-1:0),v=1;v{w.init&&w.init(this)})}if(this.format=this.options.interpolation.format,i||(i=di),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});let l=kn(),c=()=>{let d=(f,p)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),i(f,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:di,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();let r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(o)})}else i(null)}reloadResources(e,n,i){let s=kn();return e||(e=this.languages),n||(n=this.options.ns),i||(i=di),this.services.backendConnector.reload(e,n,r=>{s.resolve(),i(r)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Na.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,n){var i=this;this.isLanguageChangingTo=e;let s=kn();this.emit("languageChanging",e);let r=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,s.resolve(function(){return i.t(...arguments)}),n&&n(l,function(){return i.t(...arguments)})},o=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);let c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,i){var s=this;let r=function(a,o){let l;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),f=2;f`${l.keyPrefix}${p}${F}`):w=l.keyPrefix?`${l.keyPrefix}${p}${a}`:a,s.t(w,l)};return typeof e=="string"?r.lng=e:r.lngs=e,r.ns=n,r.keyPrefix=i,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let i=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;let a=(o,l)=>{let c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===2};if(n.precheck){let o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(i,e)&&(!s||a(r,e)))}loadNamespaces(e,n){let i=kn();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){let i=kn();typeof e=="string"&&(e=[e]);let s=this.options.preload||[],r=e.filter(a=>s.indexOf(a)<0);return r.length?(this.options.preload=s.concat(r),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";let n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new ys(Ga());return n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Kt(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:di,i=e.forkResourceStore;i&&delete e.forkResourceStore;let s={...this.options,...e,isClone:!0},r=new Kt(s);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i&&(r.store=new gs(this.store.data,s),r.services.resourceStore=r.store),r.translator=new Cn(r.services,s),r.translator.on("*",function(o){for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d{if(typeof t=="object"&&t!==null){if(typeof Object.getPrototypeOf=="function"){let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}return Object.prototype.toString.call(t)==="[object Object]"}return!1},ze=(...t)=>t.reduce((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach(i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(e[i])&&Array.isArray(n[i])?e[i]=ze.options.mergeArrays?ze.options.uniqueArrayItems?Array.from(new Set(e[i].concat(n[i]))):[...e[i],...n[i]]:n[i]:Ha(e[i])&&Ha(n[i])?e[i]=ze(e[i],n[i]):e[i]=n[i]===void 0?ze.options.allowUndefinedOverrides?n[i]:e[i]:n[i])}),e},{}),Ds={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};ze.options=Ds;ze.withOptions=(t,...e)=>{ze.options=Object.assign(Object.assign({},Ds),t);let n=ze(...e);return ze.options=Ds,n};var Ua=ze;var No=q(require("obsidian"));var $e=q(require("obsidian"));var me=q(require("obsidian"));var ke;(function(n){n.path="path",n.title="title"})(ke||(ke={}));var le;(function(a){a.github="github-configuration",a.upload="upload-configuration",a.text="text-conversion",a.embed="embed-configuration",a.plugin="plugin-settings",a.help="help"})(le||(le={}));var W;(function(i){i.yaml="yaml",i.obsidian="obsidian",i.fixed="fixed"})(W||(W={}));var Oe;(function(n){n.free="Github Free/Pro/Team (default)",n.entreprise="Enterprise"})(Oe||(Oe={}));var dt="%configDir%/plugins/%pluginID%/env",ws={github:{user:"",repo:"",branch:"main",automaticallyMergePR:!0,tokenPath:dt,api:{tiersForApi:Oe.free,hostname:""},workflow:{commitMessage:"[PUBLISHER] Merge",name:""},otherRepo:[],verifiedRepo:!1,rateLimit:0},upload:{behavior:W.fixed,defaultName:"",rootFolder:"",yamlFolderKey:"",frontmatterTitle:{enable:!1,key:"title"},replaceTitle:[],replacePath:[],autoclean:{enable:!1,excluded:[]},folderNote:{enable:!1,rename:"index.md",addTitle:{enable:!1,key:"title"}},metadataExtractorPath:""},conversion:{hardbreak:!1,dataview:!0,censorText:[],tags:{inline:!1,exclude:[],fields:[]},links:{internal:!1,unshared:!1,wiki:!1,slugify:!1}},embed:{attachments:!0,overrideAttachments:[],keySendFile:[],notes:!1,folder:"",convertEmbedToLinks:"keep",charConvert:"->"},plugin:{shareKey:"share",fileMenu:!1,editorMenu:!1,excludedFolder:[],copyLink:{enable:!1,links:"",removePart:[],addCmd:!1},noticeError:!1,displayModalRepoEditing:!1}},ht=/^\/(.*)\/[igmsuy]*$/;var xt=q(require("obsidian"));var _a=q(require("obsidian"));function hi(t,e,n){var r,a;let i={convertWiki:e.conversion.links.wiki,attachment:e.embed.attachments,embed:e.embed.notes,links:!0,removeEmbed:e.embed.convertEmbedToLinks,charEmbedLinks:e.embed.charConvert,dataview:e.conversion.dataview,hardbreak:e.conversion.hardbreak,unshared:e.conversion.links.unshared,convertInternalLinks:e.conversion.links.internal};return(n?(r=n.shareAll)==null?void 0:r.enable:(a=e.plugin.shareAll)==null?void 0:a.enable)&&(i.unshared=!0),t&&(t.links!==void 0&&(typeof t.links=="object"?(t.links.convert!==void 0&&(i.links=t.links.convert),t.links.internals!==void 0&&(i.convertInternalLinks=t.links.internals),t.links.mdlinks!==void 0&&(i.convertWiki=t.links.mdlinks),t.links.nonShared!==void 0&&(i.unshared=t.links.nonShared)):i.links=t.links),t.embed!==void 0&&(typeof t.embed=="object"?(t.embed.send!==void 0&&(i.embed=t.embed.send),t.embed.remove!==void 0&&(i.removeEmbed=qa(t.embed.remove)),t.embed.char!==void 0&&(i.charEmbedLinks=t.embed.char)):i.embed=t.embed),t.attachment!==void 0&&(typeof t.attachment=="object"?(t.attachment.send!==void 0&&(i.attachment=t.attachment.send),t.attachment.folder!==void 0&&(i.attachmentLinks=t.attachment.folder)):i.attachment=t.attachment),t.attachmentLinks!==void 0&&(i.attachmentLinks=(0,_a.normalizePath)(t.attachmentLinks.toString().replace(/\/$/,""))),t.mdlinks!==void 0&&(i.convertWiki=t.mdlinks),t.removeEmbed!==void 0&&(i.removeEmbed=qa(t.removeEmbed)),t.dataview!==void 0&&(i.dataview=t.dataview),t.hardbreak!==void 0&&(i.hardbreak=t.hardbreak),t.internals!==void 0&&(i.convertInternalLinks=t.internals),t.nonShared!==void 0&&(i.unshared=t.nonShared)),i}function qa(t){return t==="true"?"keep":t==="false"?"remove":t==="links"?"links":t==="bake"||t==="include"?"bake":"keep"}function J(t,e,n){var a;let i=e!=null?e:t.github;if(n&&typeof n.shortRepo=="string"&&n.shortRepo!=="default"){let o=n.shortRepo.toLowerCase(),c=t.github.otherRepo.find(d=>d.smartKey.toLowerCase()===o);i=c!=null?c:i}let s={branch:i.branch,repo:i.repo,owner:i.user,autoclean:t.upload.autoclean.enable,workflowName:i.workflow.name,commitMsg:i.workflow.commitMessage,automaticallyMergePR:i.automaticallyMergePR,verifiedRepo:(a=i.verifiedRepo)!=null?a:!1};if(t.upload.behavior===W.fixed&&(s.autoclean=!1),!n||n.multipleRepo===void 0&&n.repo===void 0&&n.shortRepo===void 0)return s;let r=null;if(n.multipleRepo){let o=Cd(n,s);return o.length===1?o[0]:o}else if(n.repo)if(typeof n.repo=="object")n.repo.branch!==void 0&&(s.branch=n.repo.branch),n.repo.repo!==void 0&&(s.repo=n.repo.repo),n.repo.owner!==void 0&&(s.owner=n.repo.owner),n.repo.autoclean!==void 0&&(s.autoclean=n.repo.autoclean,r=!0);else{let o=n.repo.split("/");r=o.length>4?!0:null,s=Wa(o,s)}else if(n.shortRepo instanceof Array)return Sd(n,t.github.otherRepo,s);return n.autoclean!==void 0&&r===null&&(s.autoclean=n.autoclean),s}function Cd(t,e){let n=[];if(t.multipleRepo instanceof Array&&t.multipleRepo.length>0)for(let i of t.multipleRepo)if(typeof i=="object"){let s={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};i.branch!==void 0&&(s.branch=i.branch),i.repo!==void 0&&(s.repo=i.repo),i.owner!==void 0&&(s.owner=i.owner),i.autoclean!==void 0&&(s.autoclean=i.autoclean),n.push(s)}else{let s=i.split("/"),r={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};n.push(Wa(s,r))}return n.filter((i,s,r)=>r.findIndex(a=>a.repo===i.repo&&a.owner===i.owner&&a.branch===i.branch&&a.autoclean===i.autoclean)===s)}function Sd(t,e,n){if(t.shortRepo instanceof Array){let i=[];for(let s of t.shortRepo){let r=s.toLowerCase();if(r==="default")i.push(n);else{let a=e.filter(o=>o.smartKey.toLowerCase()===r)[0];a&&i.push({branch:a.branch,repo:a.repo,owner:a.user,autoclean:n.autoclean,automaticallyMergePR:a.automaticallyMergePR,workflowName:a.workflow.name,commitMsg:a.workflow.commitMessage})}}return i}return n}function Wa(t,e){let n={branch:e.branch,repo:e.repo,owner:e.owner,autoclean:!1,automaticallyMergePR:e.automaticallyMergePR,workflowName:e.workflowName,commitMsg:e.commitMsg};return t.length>=4&&(n.branch=t[2],n.repo=t[1],n.owner=t[0],n.autoclean=t[3]==="true"),t.length===3?(n.branch=t[2],n.repo=t[1],n.owner=t[0]):t.length===2?(n.repo=t[1],n.owner=t[0]):t.length===1&&(n.repo=t[0]),n}function Fs(t,e){let n=e.upload.yamlFolderKey,i=t&&t[n]!==void 0?t[n]:e.upload.defaultName;return i instanceof Array?i.join("/"):i}function Ka(t,e,n){var r,a,o;if(e.frontmatter.general.unshared)return!0;if((a=(r=e.repository)==null?void 0:r.shareAll)==null?void 0:a.enable){let l=e.repository.shareAll.excludedFileName;return!n.basename.startsWith(l)}if(!t||vs(e.settings,n))return!1;let s=((o=e.repository)==null?void 0:o.shareKey)||e.settings.plugin.shareKey;return R({settings:e.settings},"shareKey",s,"frontmatter",t[s]),t[s]==null||t[s]===void 0||["false","0","no"].includes(t[s].toString().toLowerCase())?!1:["true","1","yes"].includes(t[s].toString().toLowerCase())}function fi(t,e){var i;let n=t.github.otherRepo;if(((i=t.plugin.shareAll)==null?void 0:i.enable)&&!e)return ft(t);if(!e)return null;for(let s of n)if(e[s.shareKey])return s;return R({settings:t},"No other repo found, using default repo"),ft(t)}function he(t,e,n,i){var r,a;if(!n||n.extension!=="md")return!1;let s=e.github.otherRepo.filter(o=>{var l;return(l=o.shareAll)==null?void 0:l.enable});if(!((r=e.plugin.shareAll)==null?void 0:r.enable)&&s.length===0){let o=i?i.shareKey:e.plugin.shareKey;if(t==null||!t[o]||t[o]==null||vs(e,n)||t[o]===void 0||["false","0","no"].includes(t[o].toString().toLowerCase()))return!1;let l=t[o].toString().toLowerCase();return["true","1","yes"].includes(l)}else if(((a=e.plugin.shareAll)==null?void 0:a.enable)||s.length>0){let o=s.map(l=>l.shareAll.excludedFileName);if(o.push(e.plugin.shareAll.excludedFileName),o.some(l=>!n.basename.startsWith(l))&&!vs(e,n))return!0}return!1}function vs(t,e){let n=t.plugin.excludedFolder;for(let i of n){let s=i.match(ht),r=s?new RegExp(s[1],s[2]):null;if(r&&r.test(e.path)||e.path.contains(i.trim()))return!0}return!1}function za(t,e){var r;let n=[];((r=e.plugin.shareAll)==null?void 0:r.enable)&&n.push("share");let i=e.github.otherRepo.filter(a=>a.shareAll);if(i.length>0)for(let a of i)n.push(a.smartKey);if(!t)return n;let s=e.github.otherRepo.map(a=>a.shareKey);s.push(e.plugin.shareKey);for(let a of s)t[a]&&n.push(a);return n}function Fe(t){return t.match(/(png|jpe?g|gif|bmp|svg|mp[34]|web[mp]|wav|m4a|ogg|3gp|flac|ogv|mov|mkv|pdf)$/i)}function pi(t,e){t=t instanceof Array?t:[t],e=e instanceof Array?e:[e];let n=(i,s)=>i.owner===s.owner&&i.repo===s.repo&&i.branch===s.branch;for(let i of e)for(let s of t)if(n(i,s))return!0;for(let i of t)for(let s of e)if(n(i,s))return!0;return!1}function mi(t,e,n=!1){return m(this,null,function*(){t=Array.isArray(t)?t:[t];let i=[];if((yield e.loadToken()).length===0){i.push(!0);let a=u.t("common.ghToken");n||new xt.Notice(u.t("error.isEmpty",{what:a}))}else for(let a of t)if(a.repo.length===0){i.push(!0);let o=u.t("common.repository");n||new xt.Notice(u.t("error.isEmpty",{what:o}))}else if(a.owner.length===0){i.push(!0);let o=u.t("error.whatEmpty.owner");n||new xt.Notice(u.t("error.isEmpty",{what:o}))}else if(a.branch.length===0){i.push(!0);let o=u.t("error.whatEmpty.branch");n||new xt.Notice(u.t("error.isEmpty",{what:o}))}else i.push(!1);return!i.every(a=>a===!0)})}function Za(t){let e=t.convertWiki,n=t.attachment,i=t.embed,s=t.links;return!e&&s&&n&&i&&!t.removeEmbed}function Ze(t,e=null,n,i=!1){return m(this,null,function*(){var a;let s=t.settings,r=t.plugin.app.metadataCache;try{let o=n?(a=r.getFileCache(n))==null?void 0:a.frontmatter:void 0,l=J(s,e,o);if(yield mi(l,t.plugin,i))return yield t.checkRepository(l,i),!0}catch(o){return _({settings:s,e:!0},o),!1}return!1})}function Et(t,e,n=1){return m(this,null,function*(){let i=t.settings;try{let s=!1;if(e instanceof Array?s=e.every(a=>a.verifiedRepo):e.verifiedRepo&&(s=!0),s&&i.github.rateLimit>0)return!0;if(yield mi(e,t.plugin))return yield t.checkRepository(e,!0),i.github.rateLimit===0||n>20?(yield Ye(t.octokit,i,!1,n))>0:!0}catch(s){return _({settings:i,e:!0},s),!1}return!1})}function ft(t){return{smartKey:"default",user:t.github.user,repo:t.github.repo,branch:t.github.branch,automaticallyMergePR:t.github.automaticallyMergePR,verifiedRepo:t.github.verifiedRepo,api:{tiersForApi:t.github.api.tiersForApi,hostname:t.github.api.hostname},workflow:{commitMessage:t.github.workflow.commitMessage,name:t.github.workflow.name},createShortcuts:!1,shareKey:t.plugin.shareKey.length>0?t.plugin.shareKey:"share",copyLink:{links:t.plugin.copyLink.links,removePart:t.plugin.copyLink.removePart}}}function Ye(t,e,n=!1,i=1){return m(this,null,function*(){let s=yield t.request("GET /rate_limit"),r=s.data.resources.core.remaining,a=s.data.resources.core.reset,l=new Date(a*1e3).toLocaleTimeString();return r<=i?(new xt.Notice(u.t("commands.checkValidity.rateLimit.limited",{resetTime:l})),0):(n?new xt.Notice(u.t("commands.checkValidity.rateLimit.notLimited",{remaining:r,resetTime:l})):_({settings:e},u.t("commands.checkValidity.rateLimit.notLimited",{remaining:r,resetTime:l})),r)})}function Ya(t,e){return e.embed.overrideAttachments.filter(i=>{let s=i.path.match(ht),r=s?new RegExp(s[1],s[2]):null;return i.forcePush&&((r==null?void 0:r.test(t.path))||t.path===i.path||i.path.contains("{{all}}"))}).length!==0}function Ja(t){if(t.settings.upload.folderNote.enable){let n=t.settings.upload.folderNote.rename;return t.filepath.split("/").pop()===n}return!1}var ks=q(Qa());function gi(t,e,n,i,s){let r=e.convertWiki,a=e.attachment,o=e.links;if(Za(e))return t;let l=/!?\[\[.*?\]\]/g,c=t.match(l);if(c){let d=/(\[\[).*?([\]|])/;for(let f of c){let p=f.match(d),w=f.startsWith("!")?"!":"",F=f.startsWith("!");if(p){let C=f,v=p[0].replaceAll("[","").replaceAll("|","").replaceAll("]","").replaceAll("\\",""),V=p[0].replaceAll("[","").replaceAll("|","").replaceAll("]","").replaceAll("\\","").replaceAll("../","").replaceAll("./","").replace(/#.*/,""),M=n.find(G=>G.linkFrom.replace(/#.*/,"")===V);if(M&&!Cs(M,s)){let G;M.linked.extension!=="md"?G=M.altText?M.altText:"":(G=M.altText?M.altText:M.linked.basename,G=G.replace("#"," > ").replace(/ > \^\w*/,""));let y=(e.removeEmbed==="remove"||e.removeEmbed==="bake")&&F&&M.linked.extension==="md";if(F&&M.linked.extension==="md"&&e.removeEmbed==="links"&&(w=`${e.charEmbedLinks} `,C=C.replace("!",w)),r){let E=f.match(/(\|).*(]])/),B=v.split("/"),k=to(E,B,v.split(".").at(-1),v);k=k.replace("#"," > ").replace(/ > \^\w*/,""),C=eo(v,w,k,i)}else{let E=f.match(/(\|).*(]])/);C=Xa(E,C)}M.linked.extension==="md"&&!o&&!F&&(C=G),(!a&&Fe(M.linked.extension)||y)&&(C=""),t=zt(t,f,C,i,!0)}else if(!v.startsWith("http")&&!no(v,s)){let G=f.match(/(\|).*(]])/),y=v.split("/"),E=to(G,y,v.split(".").at(-1),v);E=E.replace("#"," > ").replace(/ > \^\w*/,"");let B=!Fe(v.trim())&&e.removeEmbed==="remove"&&F;F&&e.removeEmbed==="links"&&!Fe(v.trim())&&(w=e.charEmbedLinks+" ",C=C.replace("!",w)),r?C=eo(v,w,E,i):C=Xa(G,C),!Fe(v.trim())&&!o&&!F&&(C=E),(!a&&Fe(v.trim())||B)&&(C=""),t=zt(t,f,C,i,!0)}}}}return t}function Xa(t,e){if(!t){let n=e.match(/\[{2}(.*)\]{2}/),i=n?n[1].replace("#"," > ").replace(/ > \^\w*/,""):"";return e.replace(/\[{2}(.*)\]{2}/,`[[$1|${i}]]`)}return e}function eo(t,e,n,i){let s=Fe(t.trim())?t.trim():t.replace(/#.*/,"").trim()+".md",r=t.match(/(#.*)/)?t.match(/(#.*)/)[0].replaceAll(" ","%20"):"",a=encodeURI(s);return i.conversion.links.slugify&&(r=t.match(/(#.*)/)?(0,ks.default)(t.match(/(#.*)/)[0],{lower:!0,strict:!0}):"",r.length>0&&(r=`#${r}`)),`${e}[${n}](${a}${r})`}function Td(t,e){return t.match(/\[{2}.*\]{2}/)&&!t.match(/(\|).*(]])/)?t.replace("|","").replace("]]",`|${e.altText}]]`):t}function Te(t){return t.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}function bi(t,e,n,i,s,r){return m(this,null,function*(){let a=r.frontmatter.general,o=r.settings;if(!a.convertInternalLinks)return t;for(let l of e){if(Cs(l,s))continue;let c=yield yi(n,l,s,i,r);c=c.replace(".md","");let d=l.anchor?l.anchor:"",f=Te(l.linkFrom.replace(d,"")).replaceAll(" ","%20")+d.replace("^","\\^");f=f.replaceAll(" ","%20");let p=Te(l.linkFrom),w=new RegExp(`(\\[{2}${p}(\\\\?\\|.*?)?\\]{2})|(\\[.*?\\]\\((${p}|${f})\\))`,"g"),F=t.match(w);if(F)for(let C of F){let v=new RegExp(`((${p})|(${f}))`),V=c;l.anchor&&(c=c.replace(/#.*/,""),V+=l.anchor);let M=C.replace(v,V);C.match(/\[.*\]\(.*\)/)&&(l.linked.extension==="md"&&(d=o.conversion.links.slugify?(0,ks.default)(d,{lower:!0,strict:!0}):d,d.length>0&&(d=`#${d}`),c=`${c.replaceAll(" ","%20")}.md${d}`,c=!c.match(/(#.*)/)&&!c.endsWith(".md")?`${c}.md`:c),M=`[${C.match(/\[(.*)\]/)[1]}](${c})`),M=Td(M,l),t=zt(t,C,M,o,!0)}}return t})}function to(t,e,n,i){return t?t[0].replace("]]","").replace("|",""):n==="md"?e.length>1?e[e.length-1]:e[0]:i.split("/").at(-1)}function Ss(t,e){let n=e;if(!e){let i=t.match(/\/([gimy]+)$/);n=i?Array.from(new Set(i[1].split(""))).join(""):""}return new RegExp(t.replace(/\/(.+)\/.*/,"$1"),n)}function Di(t,e,n){if(!e.conversion.censorText)return t;let i=n?e.conversion.censorText.filter(s=>s.after):e.conversion.censorText.filter(s=>!s.after);for(let s of i)if(s.entry.trim().length>0){let r=s.entry,a=s.replace;if(r.match(/^\/.+\/[gimy]*$/)){let o=Ss(r,s.flags);s.inCodeBlocks?t=t.replace(o,a):t=zt(t,o,a,e)}else s.inCodeBlocks?t=t.replace(r,a):t=zt(t,r,a,e)}return t}function zt(t,e,n,i,s){let r,a;return e instanceof RegExp?(r="```[\\s\\S]*?```|`[^`]*`|",s&&(r+="\\\\?!?"),r+=e.source,a=new RegExp(r,`g${e.flags}`)):(r="```[\\s\\S]*?```|`[^`]*`|\\\\?!?",s&&(r+="\\\\?!?"),r+=Te(e),a=new RegExp(r,"g")),t.replace(a,o=>{if(o.match(/`[^`]*`/)||o.match(/```[\s\S]*?```/))return o;if(s&&o.match(/^\\/))return o;try{let l=JSON.parse(`"${n}"`);return o.replace(e,l)}catch(l){return R({settings:i,e:!0},l),o.replace(e,n)}})}function Cs(t,e){if(e)for(let n in e){let i=`[[${t.linkFrom}]]`;if(e[n]===i)return!0}return!1}function no(t,e){if(e){for(let n in e)if(e[n]===`[[${t}]]`)return!0}return!1}function yi(t,e,n,i,s){return m(this,null,function*(){let{metadataCache:r}=i,a=s.settings,o=s.repository,l=Je(t,a,o,i),c=r.getFileCache(e.linked).frontmatter,d=J(a,o,c),f=pi(s.frontmatter.repo,d),p=Ka(c,s,e.linked);if(R({settings:a},`Shared: ${p} for ${e.linked.path}`),e.linked.extension==="md"&&(!f||!p))return e.destinationFilePath?e.destinationFilePath:e.linked.basename;if(e.linked.path===t.path)return Je(e.linked,a,o,i).split("/").at(-1);let w=e.linked.extension==="md"?Je(e.linked,a,o,i):Zt(e.linked,a,hi(n,a,o)),F=l.split("/"),C=w.split("/"),v=(B,k)=>{let $=0;for(;B[$]===k[$];)$++;return B.slice($)},V=v(F,C),M=v(C,F),y=function(B){let k=[];for(let $ of B)$!=B.at(-1)&&k.push("..");return k}(V);y.length===0&&y.push(".");let E=y.concat(M).join("/");return E.trim()==="."||E.trim()===""?Je(e.linked,a,o,i).split("/").at(-1):E})}function Pd(t,e,n,i){let s=n.upload.folderNote.rename,a=`${t.parent?`/${t.parent.path}/`:"/"}${at(i,n)}`;if(!n.upload.folderNote.enable)return a;let o=t.parent?t.parent.name:"";if(i.replace(".md","")===o)return`/${t.parent.path}/${s}`;let l=e.getAbstractFileByPath(t.path.replace(".md",""));return l&&l instanceof me.TFolder?`/${l.path}/${s}`:a}function Od(t,e,n,i){var l;i=Pd(t,n,e,i);let r=(e.upload.defaultName.length>0?e.upload.defaultName:"")+i,a=r.split("/").slice(0,-1).join("/"),o=(l=r.split("/").at(-1))!=null?l:"";return a=Sn(a,e),a.trim().length===0?o:`${a}/${o}`.replace(/^\//,"")}function Rd(t,e,n){let i=Fs(e,n);R({settings:n},`Category: ${i}`);let s=i.split("/"),r=i.endsWith("/")?s.at(-2):s.at(-1);return n.upload.folderNote.enable&&t.replace(".md","").toLowerCase()===(r==null?void 0:r.toLowerCase())?n.upload.folderNote.rename:at(t,n)}function Nd(t,e,n){let i=t.upload,s=Fs(e,t),r=Rd(n,e,t),a=i.rootFolder.length>0&&!s.includes(i.rootFolder)?`${i.rootFolder}/`:"";if(s.trim().length===0)return r;let o=Sn(a+s,t);return o.trim().length===0?r:`${o}/${r}`.replace(/^\//,"")}function at(t,e){var s,r,a;let n=e.upload;if(t===n.folderNote.rename&&n.folderNote.enable||n.replaceTitle.length===0)return t;let i=(r=(s=t.match(/\.[0-9a-z]+$/i))==null?void 0:s.at(-1))!=null?r:"";t=t.replace(i,"");for(let o of n.replaceTitle)if(((a=o.regex)==null?void 0:a.trim().length)>0){let l=o.regex,c=o.replacement;if(l.match(/\/.+\//)){let d=Ss(l);t=t.replace(d,c)}else t=t.replaceAll(l,c)}return`${t}${i}`}function Sn(t,e){let n=e.upload;if(n.behavior===W.fixed||n.replacePath.length===0)return t;for(let i of n.replacePath)if(i.regex.trim().length>0){let s=i.regex,r=i.replacement;if(s.match(/\/.+\//)){let a=s.match(/\/([gimy]+)$/),o=a?Array.from(new Set(a[1].split(""))).join(""):"",l=new RegExp(s.replace(/\/(.+)\/.*/,"$1"),o);t=t.replace(l,r)}else t=t.replaceAll(s,r)}return t}function Tn(t,e,n){let i=e.name;return t&&n.upload.frontmatterTitle.enable&&t[n.upload.frontmatterTitle.key]&&t[n.upload.frontmatterTitle.key]!==i?`${t[n.upload.frontmatterTitle.key]}.md`:i}function Je(t,e,n,i){var a;let{vault:s,metadataCache:r}=i;if(t.extension==="md"){let o=(a=r.getCache(t.path))==null?void 0:a.frontmatter,l=Tn(o,t,e),c=at(l,e);if(!he(o,e,t,n))return(0,me.normalizePath)(l);if(o==null?void 0:o.path){let d=o.path instanceof Array?o.path.join("/"):o.path;return d==""||d=="/"?(0,me.normalizePath)(c):(0,me.normalizePath)(`${d}/${c}`)}else return e.upload.behavior===W.yaml?(0,me.normalizePath)(Nd(e,o,l)):e.upload.behavior===W.obsidian?(0,me.normalizePath)(Od(t,e,s,l)):e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${c}`):(0,me.normalizePath)(c)}return t.path}function Zt(t,e,n){let i=Ad(t,e,n);return i=Sn(i,e),at(i,e)}function Ad(t,e,n){if(!n||!n.attachmentLinks){if(e.embed.useObsidianFolder)return e.upload.behavior===W.yaml?e.upload.rootFolder.length>0?(0,me.normalizePath)(`${e.upload.rootFolder}/${t.path}`):t.path:e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${t.path}`):t.path;let i=e.embed.folder,s=e.embed.overrideAttachments.filter(r=>{let a=r.path.match(ht),o=a?new RegExp(a[1],a[2]):void 0;return((o==null?void 0:o.test(t.path))||t.path===r.path||r.path.contains("{{all}}"))&&!r.destination.contains("{{default}}")});if(s.length>0){let r=t.path;for(let a of s){let o=a.path.match(ht),l=o?new RegExp(o[1],o[2]):null,c=a.destination.replace("{{name}}",t.name);r=l?(0,me.normalizePath)(r.replace(l,c)):(0,me.normalizePath)(r.replace(a.path,c))}return R({settings:e},`Overridden path for ${t.name} : ${r}`),r}else return i.length>0?(0,me.normalizePath)(`${i}/${t.name}`):e.upload.defaultName.length>0?(0,me.normalizePath)(`${e.upload.defaultName}/${t.name}`):t.path}else if(n==null?void 0:n.attachmentLinks)return(0,me.normalizePath)(`${n.attachmentLinks}/${t.name}`);return t.path}var Ts='',wi='',Pn='',Ps='',kt='';function _(t,...e){var o;let{settings:n,e:i}=t;if((o=n.plugin)==null?void 0:o.noticeError){new $e.Notice(e.join(" "));return}let s=io();s.contains("logs")&&(s=io(!0));let r=new Date().toISOString().slice(11,23),a=t.logs?`DEV LOGS [${r}] ${s}: +`:`[GitHub Publisher](${s}): +`;i?console.error(a,...e):console.log(a,...e)}function On(t,e,n){if(!$e.Platform.isMobile)return;let i=document.createDocumentFragment();return i.createEl("span",{text:n,cls:["obsidian-publisher",t,"icons"]}).innerHTML=e,i.createEl("span",{cls:["obsidian-publisher",t,"notification"]}).innerHTML=n,new $e.Notice(i,0)}function io(t){var i;let e=t?4:3,n=(i=new Error().stack)==null?void 0:i.split(` +`)[e].trim();return n=n==null?void 0:n.substring(n.indexOf("at ")+3,n.lastIndexOf(" (")),n=n==null?void 0:n.replace("Object.callback",""),n=n||"main",n=n==="eval"?"main":n,n}function R(t,...e){var i;let n=t.settings;t.logs=!0,((i=n.plugin)==null?void 0:i.dev)&&_(t,...e)}function Os(t,e,n){let i={added:[],edited:[],deleted:[],unpublished:[],notDeleted:[]};return t.forEach(s=>{s.isUpdated?i.edited.push(s.file):i.added.push(s.file)}),i.unpublished=n,e&&(i.deleted=e.deleted,i.notDeleted=e.undeleted),i}function Rs(t,e){return m(this,null,function*(){if($e.Platform.isMobile||!t.plugins.enabledPlugins.has("metadata-extractor")||e.upload.metadataExtractorPath.length===0)return null;let n={allExceptMdFile:null,metadataFile:null,tagsFile:null},i=`${t.vault.configDir}/plugins/metadata-extractor`,s=t.plugins.plugins["metadata-extractor"];return s&&s.settings?(s.settings.allExceptMdFile.length>0&&(n.allExceptMdFile=i+"/"+s.settings.allExceptMdFile),s.settings.metadataFile.length>0&&(n.metadataFile=i+"/"+s.settings.metadataFile),s.settings.tagFile.length>0&&(n.tagsFile=i+"/"+s.settings.tagFile),n):null})}function Ns(t){let e=t.match(/\/*$/);return e&&e[0].length!=1?t.replace(/\/*$/,"")+"/":t}function Yt(t,e,n,i){return m(this,null,function*(){var w;let s=e.repo,r=e.frontmatter,a=s?s.copyLink:n.plugin.copyLink,o=s||n.github;if(!n.plugin.copyLink.enable)return;let l=Je(t,n,s,i),c=a.links;c.length===0&&(c=r instanceof Array?`https://${o.user}.github.io/${n.github.repo}/`:`https://${r.owner}.github.io/${r.repo}/`);let d=i.metadataCache.getFileCache(t).frontmatter,f=a.removePart;if(d&&(d.baselink!==void 0?(c=d.baselink,f=[]):d.copylink&&typeof d.copylink=="object"&&(c=d.copylink.base,f=(w=d.copylink.remove)!=null?w:[])),c=Ns(c),f.length>0)for(let F of f)F.length>0&&(l=l.replace(F.trim(),""));l=Ns(l);let p=Ns(encodeURI(c+l));yield navigator.clipboard.writeText(p)})}function As(t,e,n,i){return m(this,null,function*(){i=Array.isArray(i)?i:[i];for(let s of i)yield Ld(t,e,n,s)})}function Ld(t,e,n,i){return m(this,null,function*(){let s=e instanceof $e.TFile?`"${e.basename}"`:e,r=document.createDocumentFragment(),a;if(e instanceof String?a=u.t("informations.successfulPublish",{nbNotes:s,repo:i}):(R({settings:n},"file published :",s),a=u.t("informations.successPublishOneNote",{file:s,repo:i})),r.createEl("span",{text:a,cls:["obsidian-publisher","success","icons"]}).innerHTML=wi,r.createEl("span",{cls:["obsidian-publisher","success","notification"]}).innerHTML=a,n.github.workflow.name.length>0){let o=document.createDocumentFragment();o.createEl("span",{text:u.t("informations.successfulPublish",{nbNotes:s,repo:i}),cls:["obsidian-publisher","wait","icons"]}).innerHTML=Pn;let l=`${u.t("informations.sendMessage",{nbNotes:s,repo:i})}.
${u.t("informations.waitingWorkflow")}`;o.createEl("span",{cls:["obsidian-publisher","wait","notification"]}).innerHTML=l,new $e.Notice(o),(yield t.workflowGestion(i))&&new $e.Notice(r,0)}else new $e.Notice(r,0)})}function so(t){let e=JSON.stringify(t,(n,i)=>typeof i=="string"?i.trim().toLowerCase():i);return JSON.parse(e)}function Jt(t,e){let n=t.app.vault;return e||(e=dt),e=e.replace("%configDir%",n.configDir),e=e.replace("%pluginID%",t.manifest.id),e}var fe=q(require("obsidian"));var ro="3.7.5",Md=ro,Bd=typeof atob=="function",Id=typeof btoa=="function",Qt=typeof Buffer=="function",ao=typeof TextDecoder=="function"?new TextDecoder:void 0,oo=typeof TextEncoder=="function"?new TextEncoder:void 0,$d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Rn=Array.prototype.slice.call($d),Fi=(t=>{let e={};return t.forEach((n,i)=>e[n]=i),e})(Rn),Vd=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ge=String.fromCharCode.bind(String),lo=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),uo=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),co=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),ho=t=>{let e,n,i,s,r="",a=t.length%3;for(let o=0;o255||(i=t.charCodeAt(o++))>255||(s=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|i<<8|s,r+=Rn[e>>18&63]+Rn[e>>12&63]+Rn[e>>6&63]+Rn[e&63]}return a?r.slice(0,a-3)+"===".substring(a):r},Ls=Id?t=>btoa(t):Qt?t=>Buffer.from(t,"binary").toString("base64"):ho,Ms=Qt?t=>Buffer.from(t).toString("base64"):t=>{let e=4096,n=[];for(let i=0,s=t.length;ie?uo(Ms(t)):Ms(t),Gd=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?ge(192|e>>>6)+ge(128|e&63):ge(224|e>>>12&15)+ge(128|e>>>6&63)+ge(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return ge(240|e>>>18&7)+ge(128|e>>>12&63)+ge(128|e>>>6&63)+ge(128|e&63)}},jd=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,fo=t=>t.replace(jd,Gd),po=Qt?t=>Buffer.from(t,"utf8").toString("base64"):oo?t=>Ms(oo.encode(t)):t=>Ls(fo(t)),Xt=(t,e=!1)=>e?uo(po(t)):po(t),mo=t=>Xt(t,!0),Hd=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ud=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return ge((n>>>10)+55296)+ge((n&1023)+56320);case 3:return ge((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return ge((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},go=t=>t.replace(Hd,Ud),bo=t=>{if(t=t.replace(/\s+/g,""),!Vd.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",i,s;for(let r=0;r>16&255):s===64?ge(e>>16&255,e>>8&255):ge(e>>16&255,e>>8&255,e&255);return n},Bs=Bd?t=>atob(co(t)):Qt?t=>Buffer.from(t,"base64").toString("binary"):bo,yo=Qt?t=>lo(Buffer.from(t,"base64")):t=>lo(Bs(t).split("").map(e=>e.charCodeAt(0))),Do=t=>yo(wo(t)),_d=Qt?t=>Buffer.from(t,"base64").toString("utf8"):ao?t=>ao.decode(yo(t)):t=>go(Bs(t)),wo=t=>co(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Is=t=>_d(wo(t)),qd=t=>{if(typeof t!="string")return!1;let e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},Fo=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),vo=function(){let t=(e,n)=>Object.defineProperty(String.prototype,e,Fo(n));t("fromBase64",function(){return Is(this)}),t("toBase64",function(e){return Xt(this,e)}),t("toBase64URI",function(){return Xt(this,!0)}),t("toBase64URL",function(){return Xt(this,!0)}),t("toUint8Array",function(){return Do(this)})},xo=function(){let t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,Fo(n));t("toBase64",function(e){return vi(this,e)}),t("toBase64URI",function(){return vi(this,!0)}),t("toBase64URL",function(){return vi(this,!0)})},Wd=()=>{vo(),xo()},xi={version:ro,VERSION:Md,atob:Bs,atobPolyfill:bo,btoa:Ls,btoaPolyfill:ho,fromBase64:Is,toBase64:Xt,encode:Xt,encodeURI:mo,encodeURL:mo,utob:fo,btou:go,decode:Is,isValid:qd,fromUint8Array:vi,toUint8Array:Do,extendString:vo,extendUint8Array:xo,extendBuiltins:Wd};var Nn=q(require("obsidian"));function An(t=!1,e,n,i){return m(this,null,function*(){let s=Array.isArray(i.frontmatter)?i.frontmatter:[i.frontmatter],r=[];for(let a of s){let o={frontmatter:a,repo:i.repo};r.push(yield Kd(t,e,n,o))}return r[0]})}function Kd(t=!1,e,n,i){return m(this,null,function*(){let s=i.frontmatter;if(!s.autoclean)return{success:!1,deleted:[],undeleted:[]};let r=yield n.getAllFileFromRepo(e,s),a=n.settings,o=n.octokit,l=yield Zd(r,a);if((a.github.rateLimit===0||l.length>a.github.rateLimit)&&(yield Ye(o,a,!1,l.length))===0)return{success:!1,deleted:[],undeleted:[]};if(!l){let v="";return a.upload.defaultName.length>0&&(a.upload.defaultName.length>0?v=u.t("deletion.defaultFolder"):a.upload.behavior===W.yaml&&a.upload.rootFolder.length===0&&(v=u.t("deletion.rootFolder"))),t||new Nn.Notice("Error : "+v),{success:!1,deleted:[],undeleted:[]}}let d=n.getAllFileWithPath(i.repo).map(v=>({converted:v.converted,repo:v.repoFrontmatter})),f=0,p=0,w={deleted:[],undeleted:[],success:!1};for(let v of l){let V=d.some(y=>y.converted===v.file),M=v.file.trim().endsWith(".md")?!d.some(y=>y.converted===v.file&&JSON.stringify(y.repo)==JSON.stringify(s)):!1;if(V?M:!0){let y=v.file.contains(a.upload.folderNote.rename)?yield Jd(o,a,v.file,s):!1;try{y||(_({settings:a},`trying to delete file : ${v.file} from ${s.owner}/${s.repo}`),(yield o.request("DELETE /repos/{owner}/{repo}/contents/{path}",{owner:s.owner,repo:s.repo,path:v.file,message:`DELETE FILE : ${v.file}`,sha:v.sha,branch:e})).status===200?(f++,w.deleted.push(v.file)):(p++,w.undeleted.push(v.file)))}catch(E){E instanceof DOMException||R({settings:a,e:!0},E)}}}let F=u.t("deletion.noFile"),C="";return f>0&&(F=u.t("deletion.success",{nb:f.toString()})),p>0&&(C=u.t("deletion.failed",{nb:p.toString()})),t||new Nn.Notice(F+C),w.success=p===0,w})}function zd(t,e){let n=e.upload.autoclean.excluded;if(n.length>0)for(let i of n){let s=i.match(ht),r=s?new RegExp(s[1],s[2]):null;if(r&&r.test(t))return!0;if(t.trim().includes(i.trim())&&i.length>0)return!0}return!1}function Zd(t,e){return m(this,null,function*(){let n=[];for(let i of t){let s=e.upload.behavior,r=e.upload.rootFolder,a=e.upload.defaultName,o=e.embed.folder;if(s===W.yaml&&r.length===0||a.length===0||s===W.fixed)return[];(i.file.includes(a)||s===W.yaml&&i.file.includes(r)||o.length>0&&i.file.includes(o))&&!zd(i.file,e)&&(Fe(i.file)||i.file.match("md$"))&&n.push(i)}return n})}function Yd(t){let e=t.split("---")[1],n=(0,Nn.parseYaml)(e);return so(n)}function Jd(t,e,n,i){return m(this,null,function*(){try{let s=yield t.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:i.owner,repo:i.repo,path:n});if(s.status===200){let r=xi.decode(s.data.content),a=Yd(r);return a.index==="true"||a.delete==="false"||!a.share}}catch(s){if(!(s instanceof DOMException))return _({settings:e,e:!0},s),!1}return!1})}var Eo=q(require("obsidian")),Ln=class extends Eo.Modal{constructor(e,n){super(e);this.listChanged=n}displayListOfFile(e,n){if(!e.length)return;let i=n.createEl("ul");e.forEach(s=>{var l;let r="\u2753",a=(l=s.split(".").pop())!=null?l:"";["md"].includes(a)?r="\u{1F5D2}\uFE0F":[".png",".jpg",".jpeg",".gif",".svg",".webp"].includes(`.${a}`)?r="\u{1F5BC}\uFE0F":[".mp3",".wav",".ogg",".flac",".aac"].includes(`.${a}`)?r="\u{1F3B5}":[".mp4",".avi",".mov",".mkv",".webm"].includes(`.${a}`)?r="\u{1F3A5}":[".pdf"].includes(`.${a}`)&&(r="\u{1F4C4}");let o=i.createEl("li");o.createEl("span",{text:r,cls:"emoji"}),o.createEl("code",{text:s,cls:"code-title"})})}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","list-changed"]),e.createEl("h2",{text:u.t("modals.listChangedFiles.title"),cls:"success"}),Object.keys(this.listChanged).contains("edited")?(this.listChanged=this.listChanged,e.createEl("h3",{text:`\u{1F4E4} ${u.t("modals.listChangedFiles.added")}`}),this.displayListOfFile(this.listChanged.added,e),e.createEl("h3",{text:`\u2712\uFE0F ${u.t("modals.listChangedFiles.edited")}`}),this.displayListOfFile(this.listChanged.edited,e),e.createEl("h3",{text:`\u{1F5D1}\uFE0F ${u.t("modals.listChangedFiles.deleted")}`}),this.displayListOfFile(this.listChanged.deleted,e),e.createEl("h2",{text:`\u274C ${u.t("modals.listChangedFiles.error")}`,cls:"error"}),e.createEl("h3",{text:`\u{1F4E4} ${u.t("modals.listChangedFiles.unpublished")}`}),this.displayListOfFile(this.listChanged.unpublished,e),e.createEl("h3",{text:`\u267B\uFE0F ${u.t("modals.listChangedFiles.notDeleted")}`}),this.displayListOfFile(this.listChanged.notDeleted,e)):(this.listChanged=this.listChanged,e.createEl("h3",{text:`\u{1F5D1}\uFE0F ${u.t("modals.listChangedFiles.deleted")}`}),this.displayListOfFile(this.listChanged.deleted,e),e.createEl("h3",{text:`\u274C ${u.t("modals.listChangedFiles.error")}`,cls:"error"}),e.createEl("h3",{text:`\u267B\uFE0F ${u.t("modals.listChangedFiles.notDeleted")}`}),this.displayListOfFile(this.listChanged.undeleted,e))}onClose(){let{contentEl:e}=this;e.empty()}};var Mn=class{constructor(e,n,i=!1){this.attachment=!1;this.statusBarItem=e,this.counter=0,this.numberOfNotesToPublish=n,this.attachment=i;let s=this.attachment?u.t("common.attachments"):u.t("common.files"),r=u.t("statusBar.markedForSharing",{nb:this.numberOfNotesToPublish,type:s});this.icon=this.statusBarItem.createEl("span",{cls:["obsidian-publisher","icons"]}),this.statusBarItem.addClass("found-attachments"),this.icon.innerHTML=Ps,this.status=this.statusBarItem.createEl("span",{text:`${r}`}),this.status.addClass("found-attachments"),this.noticeMobile=On("wait",Ps,r)}increment(){var i;let e=this.attachment?u.t("common.attachments"):u.t("common.files"),n=u.t("statusBar.sharing",{type:e.toLowerCase()});this.icon.innerHTML=Pn,this.status.setText(u.t("statusBar.counter",{msg:n,counter:++this.counter,nb:this.numberOfNotesToPublish})),this.statusBarItem.addClass("sharing"),this.statusBarItem.removeClass("found-attachments"),((i=this.noticeMobile)==null?void 0:i.noticeEl.children[0].classList.contains("load"))||(setTimeout(()=>{var s;(s=this.noticeMobile)==null||s.hide()},4e3),this.noticeMobile=On("load",Pn,n))}finish(e){var i;let n=this.attachment?u.t("statusBar.success",{action:u.t("common.shared"),type:u.t("common.attachments")}):u.t("statusBar.success",{action:u.t("common.published"),type:u.t("common.files")});this.icon.innerHTML=wi,this.status.setText(u.t("statusBar.counter",{msg:n,counter:this.counter,nb:this.numberOfNotesToPublish})),this.statusBarItem.addClass("success"),this.statusBarItem.removeClass("sharing"),(i=this.noticeMobile)==null||i.hide(),setTimeout(()=>{this.statusBarItem.remove()},e),setTimeout(()=>{var s;(s=this.noticeMobile)==null||s.hide()},e-4e3)}error(){var e;this.statusBarItem.addClass("error"),this.statusBarItem.removeClass("sharing"),this.statusBarItem.removeClass("found-attachments"),this.icon.innerHTML=kt,this.status.innerHTML=u.t("error.errorPublish"),(e=this.noticeMobile)==null||e.hide(),setTimeout(()=>{this.statusBarItem.remove()},8e3),setTimeout(()=>{var n;(n=this.noticeMobile)==null||n.hide()},4e3)}};function Ct(t,e,n,i,s,r=!0){return m(this,null,function*(){let a=new Mn(e,s.length),o=i.frontmatter;try{let l=0,c=[],d=[];if(s.length>0){let f=s.map(v=>v.name);if(r){if(!Et(t,o,s.length))return!1;yield t.newBranch(o)}for(let v of s)try{a.increment();let V=yield t.publish(v,!1,i);V&&d.push(...V.uploaded)}catch(V){l++,c.push(v.name),new fe.Notice(u.t("error.unablePublishNote",{file:v.name})),R({settings:t.settings,e:!0},V)}a.finish(8e3);let p=`${f.length-l} notes`,w=yield An(!0,n,t,i),F=t.settings;if(F.upload.metadataExtractorPath.length>0&&fe.Platform.isDesktop){let v=yield Rs(t.plugin.app,F);v&&(yield t.uploadMetadataExtractorFiles(v,o))}if(yield t.updateRepository(o)){if(yield As(t,p,F,o),F.plugin.displayModalRepoEditing){let v=Os(d,w,c);new Ln(t.plugin.app,v).open()}}else{let v=document.createDocumentFragment();v.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=kt,v.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=u.t("error.errorPublish",{repo:o}),new fe.Notice(v)}}}catch(l){R({settings:t.settings,e:!0},l);let c=document.createDocumentFragment();c.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=kt,c.createSpan({cls:["error","obsidian-publisher","notification"],text:u.t("error.unablePublishMultiNotes")}),a.error()}})}function Ei(t,e,n){return m(this,null,function*(){try{if(new fe.Notice(u.t("informations.startingClean",{repo:n.frontmatter})),!Et(t,n.frontmatter))return!1;yield t.newBranch(n.frontmatter);let s=yield An(!1,e,t,n);yield t.updateRepository(n.frontmatter),t.settings.plugin.displayModalRepoEditing&&new Ln(t.plugin.app,s).open()}catch(i){_({settings:t.settings,e:!0},i)}})}function Qe(t,e,n,i=null,s){return m(this,null,function*(){var l,c;let r=e.settings,a=e.plugin.app,o=a.metadataCache;try{let d=(l=o.getFileCache(n))==null?void 0:l.frontmatter,f=J(r,i,d),p=yield Et(e,f),w={frontmatter:f,repo:i};if(!p)return!1;yield e.newBranch(f);let F=yield e.publish(n,!0,w,[],!0);if(F){if(r.upload.metadataExtractorPath.length>0&&fe.Platform.isDesktop){let v=yield Rs(a,r);v&&(yield e.uploadMetadataExtractorFiles(v,f))}if(yield e.updateRepository(f)){if(yield As(e,s,r,f),yield Yt(n,w,r,a),r.plugin.displayModalRepoEditing){let v=Os(F.uploaded,F.deleted,F.error);new Ln(a,v).open()}}else{let v=document.createDocumentFragment();v.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=kt,v.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=u.t("error.errorPublish",{repo:f}),new fe.Notice(v)}}}catch(d){if(!(d instanceof DOMException)){R({settings:r,e:!0},d);let f=document.createDocumentFragment();f.createSpan({cls:["error","obsidian-publisher","icons","notification"]}).innerHTML=kt,f.createSpan({cls:["error","obsidian-publisher","notification"]}).innerHTML=u.t("error.errorPublish",{repo:J(r,i,(c=o.getFileCache(n))==null?void 0:c.frontmatter)}),new fe.Notice(f)}}})}function ko(t,e,n){return m(this,null,function*(){let i=t.plugin;new fe.Notice(u.t("informations.scanningRepo"));let s=t.getAllFileWithPath(n.repo),r=yield t.getAllFileFromRepo(n.frontmatter.branch,n.frontmatter),a=t.getNewFiles(s,r);if(a.length>0){new fe.Notice(u.t("informations.foundNoteToSend",{nbNotes:a.length}));let o=i.addStatusBarItem();if(!Et(t,n.frontmatter,a.length))return!1;yield t.newBranch(n.frontmatter),yield Ct(t,o,e,n,a,!1);return}new fe.Notice(u.t("informations.noNewNote"))})}function Co(t,e,n){return m(this,null,function*(){let i=t.plugin;new fe.Notice(u.t("informations.scanningRepo"));let s=t.getAllFileWithPath(n.repo),r=yield t.getAllFileFromRepo(n.frontmatter.branch,n.frontmatter),a=t.getNewFiles(s,r),o=yield t.getEditedFiles(s,r,a);if(o.length>0){new fe.Notice(u.t("informations.foundNoteToSend",{nbNotes:o.length}));let l=i.addStatusBarItem();if(!Et(t,n.frontmatter,o.length))return!1;yield t.newBranch(n.frontmatter),yield Ct(t,l,e,n,o,!1);return}new fe.Notice(u.t("informations.noNewNote"))})}function So(t,e,n){return m(this,null,function*(){let i=n.repo,s=n.frontmatter;new fe.Notice(u.t("informations.scanningRepo"));let r=t.getAllFileWithPath(i),a=yield t.getAllFileFromRepo(s.branch,s),o=[],l=yield t.getEditedFiles(r,a,o);if(l.length>0){new fe.Notice(u.t("informations.foundNoteToSend",{nbNotes:l.length}));let c=t.plugin.addStatusBarItem();if(!Et(t,s,l.length))return!1;yield t.newBranch(s),yield Ct(t,c,e,n,l,!1);return}new fe.Notice(u.t("informations.noNewNote"))})}var Bn=q(require("obsidian"));function To(t,e){return m(this,null,function*(){var s;let n=e.app.workspace.getActiveFile(),i=n?(s=e.app.metadataCache.getFileCache(n))==null?void 0:s.frontmatter:null;if(n&&i&&he(i,e.settings,n,t)){let r={frontmatter:J(e.settings,t,i),repo:t};yield Yt(n,r,e.settings,e.app),new Bn.Notice(u.t("commands.copyLink.onActivation"));return}new Bn.Notice(u.t("commands.runOtherRepo.noFile"))})}function Po(t,e,n){return m(this,null,function*(){var r;let i=t.app.workspace.getActiveFile(),s=i?(r=t.app.metadataCache.getFileCache(i))==null?void 0:r.frontmatter:null;i&&s&&he(s,t.settings,i,e)?yield Qe(n,yield t.reloadOctokit(),i,e):new Bn.Notice(u.t("commands.runOtherRepo.noFile"))})}function Oo(t,e,n){return m(this,null,function*(){let i=J(t.settings,e),s=yield t.reloadOctokit();yield Ei(s,n,{frontmatter:i,repo:e})})}function ki(t,e,n){return m(this,null,function*(){let i=t.addStatusBarItem(),s=yield t.reloadOctokit(),r=s.getSharedFiles(e),a={frontmatter:J(t.settings,e),repo:e};yield Ct(s,i,n,a,r,!0)})}function Ci(t,e,n){return m(this,null,function*(){let i=yield t.reloadOctokit();yield ko(i,e,{frontmatter:J(t.settings,n),repo:n})})}function Ro(t,e,n){return m(this,null,function*(){let i=t.app.workspace.getActiveFile();i?yield Ze(yield t.reloadOctokit(),n,i):new Bn.Notice("No file is active")})}function Si(t,e,n=null){return m(this,null,function*(){let i=yield t.reloadOctokit();yield Co(i,e,{frontmatter:J(t.settings,n),repo:n})})}function Ti(t,e,n){return m(this,null,function*(){let i=yield n.reloadOctokit();yield So(i,t,{frontmatter:J(n.settings,e),repo:e})})}function Ao(t,e){return m(this,null,function*(){let n=t?`publisher-copy-link-K${t.smartKey}`:"publisher-copy-link",i=u.t("common.repository"),s=u.t("commands.copyLink.title");return s=t?`${s} (${i} : ${t.smartKey})`:s,{id:n,name:s,hotkeys:[],checkCallback:r=>{var l;let a=e.app.workspace.getActiveFile(),o=a?(l=e.app.metadataCache.getFileCache(a))==null?void 0:l.frontmatter:null;if(a&&o&&he(o,e.settings,a,t)){if(!r){let c={frontmatter:J(e.settings,t,o),repo:t};Yt(a,c,e.settings,e.app),new No.Notice(u.t("commands.copyLink.onActivation"))}return!0}return!1}}})}function Lo(t,e,n){return m(this,null,function*(){let i=e?`publisher-delete-clean-K${e.smartKey}`:"publisher-delete-clean",s=u.t("commands.publisherDeleteClean"),r=u.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,hotkeys:[],callback:()=>m(this,null,function*(){R({settings:t.settings},"Enabling purge command");let a={frontmatter:J(t.settings,e),repo:e},o=yield t.reloadOctokit();yield Ei(o,n,a)})}})}function Mo(t,e,n){return m(this,null,function*(){let i=t?`publisher-one-K${t.smartKey}`:"publisher-one",s=u.t("commands.shareActiveFile"),r=u.t("common.repository");return s=t?`${s} (${r} : ${t.smartKey})`:s,{id:i,name:s,hotkeys:[],checkCallback:a=>m(this,null,function*(){var c;let o=e.app.workspace.getActiveFile(),l=o?(c=e.app.metadataCache.getFileCache(o))==null?void 0:c.frontmatter:null;return o&&l&&he(l,e.settings,o,t)?(a||Qe(n,yield e.reloadOctokit(),o,t,o.basename),!0):!1})}})}function Bo(t,e,n){return m(this,null,function*(){let i=e?`publisher-publish-all-K${e.smartKey}`:"publisher-publish-all",s=u.t("commands.uploadAllNotes"),r=u.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield ki(t,e,n)})}})}function Io(t,e,n){return m(this,null,function*(){let i=e?`publisher-upload-new-K${e.smartKey}`:"publisher-upload-new",s=u.t("commands.uploadNewNotes"),r=u.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Ci(t,n,e)})}})}function $o(t,e,n){return m(this,null,function*(){let i=e?`publisher-upload-all-edited-new-K${e.smartKey}`:"publisher-upload-all-edited-new",s=u.t("commands.uploadAllNewEditedNote"),r=u.t("common.repository");return s=e?`${s} (${r} : ${e.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Si(t,n,e)})}})}function Vo(t,e,n){return m(this,null,function*(){let i=t?`publisher-upload-edited-K${t.smartKey}`:"publisher-upload-edited",s=u.t("commands.uploadAllEditedNote"),r=u.t("common.repository");return s=t?`${s} (${r} : ${t.smartKey})`:s,{id:i,name:s,callback:()=>m(this,null,function*(){yield Ti(e,t,n)})}})}function Go(t,e){return m(this,null,function*(){let n=e?`check-plugin-repo-validy-K${e.smartKey}`:"check-plugin-repo-validy",i=u.t("commands.checkValidity.title"),s=u.t("common.repository");return i=e?`${i} (${s} : ${e.smartKey})`:i,{id:n,name:i,checkCallback:r=>m(this,null,function*(){return t.app.workspace.getActiveFile()?(r||(yield Ze(yield t.reloadOctokit(),e,t.app.workspace.getActiveFile())),!0):!1})}})}var St=q(require("obsidian"));var Pi=q(require("obsidian"));var $s=class extends Pi.FuzzySuggestModal{constructor(e,n,i){super(e);this.plugin=n,this.branchName=i}getItems(){return this.plugin.settings.github.otherRepo}getItemText(e){return e.smartKey}onChooseItem(e,n){new jo(this.plugin.app,this.plugin,this.branchName,e).open()}},Oi=class extends Pi.FuzzySuggestModal{constructor(e,n,i=null,s,r,a,o){super(e);this.plugin=n,this.branchName=s,this.keyToFind=i,this.onSubmit=o,this.fileName=a,this.type=r}getItems(){var i,s,r;let e=[],n=ft(this.plugin.settings);return this.type==="file"&&(((i=this.plugin.settings.plugin.shareAll)==null?void 0:i.enable)&&!((r=this.fileName)==null?void 0:r.startsWith((s=this.plugin.settings.plugin.shareAll)==null?void 0:s.excludedFileName))&&e.push(n),this.keyToFind&&(e=e.concat(this.plugin.settings.github.otherRepo.filter(a=>a.shareKey==this.keyToFind)),this.keyToFind===n.shareKey&&e.push(n))),e=e.concat(this.plugin.settings.github.otherRepo.filter(a=>{var o,l,c;return((o=a.shareAll)==null?void 0:o.enable)&&!((c=this.fileName)==null?void 0:c.startsWith((l=a.shareAll)==null?void 0:l.excludedFileName))})),e.push(n),e=[...new Set(e)],e.length===0?this.plugin.settings.github.otherRepo:e}getItemText(e){return e.smartKey}onChooseItem(e,n){this.onSubmit(e)}},jo=class extends Pi.FuzzySuggestModal{constructor(e,n,i,s){super(e);this.plugin=n,this.branchName=i,this.repo=s}getItems(){let e=[{commands:"shareAllMarkedNotes",name:u.t("commands.uploadAllNotes")},{commands:"shareOneNote",name:u.t("commands.shareActiveFile")},{commands:"shareNewNote",name:u.t("commands.uploadNewNotes")},{commands:"shareAllEditedNotes",name:u.t("commands.uploadAllNewEditedNote")},{commands:"shareOnlyEdited",name:u.t("commands.uploadAllEditedNote")},{commands:"checkRepositoryValidity",name:u.t("commands.checkValidity.title")}];return this.plugin.settings.plugin.copyLink&&e.push({commands:"createLink",name:u.t("commands.copyLink.title")}),this.plugin.settings.upload.autoclean.enable&&this.plugin.settings.upload.behavior!==W.fixed&&e.push({commands:"deleteUnsharedDeletedNotes",name:u.t("commands.publisherDeleteClean")}),e}getItemText(e){return e.name}onChooseItem(e,n){switch(e.commands){case"shareAllMarkedNotes":ki(this.plugin,this.repo,this.branchName);break;case"deleteUnsharedDeletedNotes":Oo(this.plugin,this.repo,this.branchName);break;case"shareNewNote":Ci(this.plugin,this.branchName,this.repo);break;case"shareAllEditedNotes":Si(this.plugin,this.branchName,this.repo);break;case"shareOnlyEdited":Ti(this.branchName,this.repo,this.plugin);break;case"shareOneNote":Po(this.plugin,this.repo,this.branchName);break;case"createLink":To(this.repo,this.plugin);break;case"checkRepositoryValidity":Ro(this.plugin,this.branchName,this.repo);break}R({settings:this.plugin.settings},`run command ${e.commands}`)}};function Ri(t,e,n,i){return m(this,null,function*(){let s=yield t.reloadOctokit(),r=t.addStatusBarItem(),a={frontmatter:J(t.settings,i,void 0),repo:i};yield Ct(s,r,n,a,s.getSharedFileOfFolder(e,i),!0)})}function Qd(t,e,n,i,s){let r=St.Platform.isDesktop?e.setSubmenu():s;r.addItem(o=>{o.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:u.t("common.default").toUpperCase(),doc:n.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){let l=fi(t.settings,void 0);yield Ri(t,n,i,l)}))});let a=t.settings.github.otherRepo.filter(o=>o.createShortcuts);return a.length>0&&a.forEach(o=>{r.addItem(l=>{l.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:o.smartKey.toUpperCase(),doc:n.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){yield Ri(t,n,i,o)}))})}),r.addItem(o=>{o.setTitle(u.t("commands.shareViewFiles.multiple.other")).setIcon("folder-symlink").onClick(()=>m(this,null,function*(){new Oi(t.app,t,null,i,"folder",null,l=>m(this,null,function*(){yield Ri(t,n,i,l)})).open()}))}),r}function Vs(t,e,n,i){let s=e instanceof St.TFile?t.app.metadataCache.getFileCache(e).frontmatter:void 0,r=fi(t.settings,s),a=za(s,t.settings);if(he(s,t.settings,e,r)&&t.settings.plugin.fileMenu){let o=J(t.settings,r,s);i.addItem(l=>{var d,f;if(a.length>1||o instanceof Array&&o.length>1){St.Platform.isDesktop?l.setTitle("Github Publisher").setIcon("upload-cloud"):(i.addSeparator(),l.setIsLabel(!0)),Xd(t,l,e,n,r,i);return}let c=t.getTitleFieldForCommand(e,(d=t.app.metadataCache.getFileCache(e))==null?void 0:d.frontmatter).replace(".md","");if(!s||!s[t.settings.plugin.shareKey]){let p=t.settings.github.otherRepo.find(w=>{var F;return(F=w.shareAll)==null?void 0:F.enable});p?r=p:((f=t.settings.plugin.shareAll)==null?void 0:f.enable)&&(r=ft(t.settings))}else s[t.settings.plugin.shareKey]&&(r=ft(t.settings));l.setTitle(u.t("commands.shareViewFiles.multiple.on",{doc:c,smartKey:(r==null?void 0:r.smartKey.toUpperCase())||u.t("common.default").toUpperCase()})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(n,yield t.reloadOctokit(),e,r,c)}))})}}function Xd(t,e,n,i,s,r){var f;let a=(f=t.app.metadataCache.getFileCache(n))==null?void 0:f.frontmatter,o=t.getTitleFieldForCommand(n,a).replace(".md",""),l=St.Platform.isDesktop?e.setSubmenu():r,c=J(t.settings,s,a);c=c instanceof Array?c:[c],((s==null?void 0:s.shareKey)===t.settings.plugin.shareKey||(a==null?void 0:a[t.settings.plugin.shareKey]))&&(!(a==null?void 0:a.repo)||!(a==null?void 0:a.multipleRepo))&&l.addItem(p=>{p.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:u.t("common.default").toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,ft(t.settings),o)}))});let d=t.settings.github.otherRepo.filter(p=>p.createShortcuts);return d.length>0&&d.forEach(p=>{(p.shareKey===(s==null?void 0:s.shareKey)||(a==null?void 0:a[p.shareKey]))&&l.addItem(w=>{w.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:p.smartKey.toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,p,o)}))})}),c.length>1&&c.forEach(p=>{l.addItem(w=>{w.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:p.repo.toUpperCase(),doc:o})).setIcon("file-up").onClick(()=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,s,o)}))})}),l.addItem(p=>{p.setTitle(u.t("commands.shareViewFiles.multiple.other")).setIcon("file-input").onClick(()=>m(this,null,function*(){new Oi(t.app,t,s==null?void 0:s.shareKey,i,"file",n.basename,w=>m(this,null,function*(){yield Qe(i,yield t.reloadOctokit(),n,w,o)})).open()}))}),l}function Ho(t,e,n,i){return m(this,null,function*(){t.addItem(s=>{var a,o;if(((o=(a=i.settings.github)==null?void 0:a.otherRepo)==null?void 0:o.length)>0){St.Platform.isDesktop?(s.setTitle("Github Publisher"),s.setIcon("upload-cloud")):(t.addSeparator(),s.setIsLabel(!0)),Qd(i,s,e,n,t);return}s.setSection("action"),s.setTitle(u.t("commands.shareViewFiles.multiple.on",{smartKey:u.t("common.default").toUpperCase(),doc:e.name})).setIcon("folder-up").onClick(()=>m(this,null,function*(){let l=fi(i.settings,void 0);yield Ri(i,e,n,l)}))})})}var ut=q(require("obsidian"));var hn=q(require("obsidian")),Bu=q(es());var At=q(require("obsidian"));var dn=q(require("obsidian"));var Nt=q(require("obsidian")),Tu=q(es());function Pu(t,e,n,i,s,r){return m(this,null,function*(){let a=t,o=/```dataview\s(.+?)```/gsm,l=(0,Tu.getAPI)();if(!l)return a;let c=t.matchAll(o),d=l.settings.dataviewJsKeyword,f=new RegExp(`\`\`\`${Te(d)}\\s(.+?)\`\`\``,"gsm"),p=t.matchAll(f),w=l.settings.inlineQueryPrefix,F=new RegExp(`\`${Te(w)}(.+?)\``,"gsm"),C=t.matchAll(F),v=l.settings.inlineJsQueryPrefix,V=new RegExp(`\`${Te(v)}(.+?)\``,"gsm"),M=t.matchAll(V);if(!c&&!C&&!p&&!M)return R({settings:r.settings},"No dataview queries found"),a;let G=u.t("error.dataview");for(let y of c)try{let E=y[0],B=y[1],{isInsideCallout:k,finalQuery:$}=ap(B),I=Zn(yield l.tryQueryMarkdown($,e),r.frontmatter.general);k&&(I=op(I)),a=a.replace(E,I)}catch(E){return R({settings:r.settings,e:!0},E),_({settings:r.settings},G),y[0]}for(let y of p)try{let E=y[0],B=y[1],k=createEl("div"),$=new Nt.Component;yield l.executeJs(B,k,$,e),$.load();let I=Zn(k.innerHTML,r.frontmatter.general);a=a.replace(E,I)}catch(E){return R({settings:r.settings,e:!0},E),_({settings:r.settings},G),y[0]}for(let y of C)try{let E=y[0],B=y[1].trim(),k=l.evaluateInline(B,e);k.successful?(k=k,a=a.replace(E,Zn(k.value,r.frontmatter.general))):a=a.replace(E,Zn(l.settings.renderNullAs,r.frontmatter.general))}catch(E){return R({settings:r.settings,e:!0},E),_({settings:r.settings},G),y[0]}for(let y of M)try{let E=y[0],k=` + const query = ${y[1].trim()}; + dv.paragraph(query); + `,$=createEl("div"),I=new Nt.Component;yield l.executeJs(k,$,I,e),I.load();let K=Zn((0,Nt.htmlToMarkdown)($.innerHTML),r.frontmatter.general);a=a.replace(E,K)}catch(E){return R({settings:r.settings,e:!0},E),_({settings:r.settings},G),y[0]}return yield sp(a,i,s,n,r)})}function Zn(t,e){let n=t==null?void 0:t.toString();return e.dataview&&t&&n?n:""}function sp(t,e,n,i,s){return m(this,null,function*(){let r=rp(t,s.settings,i.vault);return t=yield bi(t,r,n,i,e,s),gi(t,s.frontmatter.general,r,s.settings,e)})}function rp(t,e,n){if(!e.conversion.dataview)return[];let i=/\[\[(.*?)\]\]/gim,s=t.matchAll(i),r=[];if(!s)return[];if(s)for(let a of s){let o=a[1].replace(/(.*)\\?\|/i,""),l=a[1].replace(/\\?\|(.*)/,""),c=n.getAbstractFileByPath(l)instanceof Nt.TFile?n.getAbstractFileByPath(l):null;c&&r.push({linked:c,linkFrom:l,altText:o,type:"link"})}return r}function ap(t){let e=!1,n=t.split(` +`),i=[];for(let r of n)r.startsWith(">")?(e=!0,i.push(r.substring(1).trim())):i.push(r);let s=t;return e&&(s=i.join(` +`)),{isInsideCallout:e,finalQuery:s}}function op(t){let e=t.split(` +`);return" "+e.join(` +> `)}var ts=q(require("obsidian")),Ou=q(es());function lp(t,e){return e?t.trim().replace(/(\r?\n)/g,`$1${e}`):t}function up(t){return t.replace(/^[ \t]*(?:[-*+]|[0-9]+[.)]) +/,"")}function cp(t){let e=t.match(/^([ \t]*)/);return e?t.replace(new RegExp(`^${e[0].replace(/\\/g,"\\$&")}`,"gm"),""):t}function dr(t){return t.replace(/ +\^[^ \n\r]+$/gm,"")}function dp(t){return t&&t.replace(/^---[\s\S]+?\r?\n---(?:\r?\n\s*|$)/,"")}function hp(t){return dr(dp(t))}function fp(t,e,n){if(e.type==="block"&&e.list&&n.listItems){let r=e.list,a=new Set([r.position.start.line]),o=r.position.start.offset-r.position.start.col,l=r.position.end.offset,c=!1;for(let d of n.listItems){if(r===d){c=!0;continue}else if(!c)continue;if(!a.has(d.parent))break;a.add(d.position.start.line),l=d.position.end.offset}return dr(cp(t.substring(o,l)))}let i=e.start.offset,s=e.end?e.end.offset:t.length;return dr(t.substring(i,s))}function hr(t,e,n,i,s,r){return m(this,null,function*(){var C;let{vault:a,metadataCache:o}=n,l=yield a.cachedRead(t),c=o.getFileCache(t);if(!c)return l;let d=s?(0,ts.resolveSubpath)(c,s):null;d&&(l=fp(l,d,c));let f=c.embeds;if(!f||f.length===0)return l;let p=[...f];p.sort((v,V)=>v.position.start.offset-V.position.start.offset);let w=new Set(e);w.add(t);let F=0;for(let v of p){let{path:V,subpath:M}=(0,ts.parseLinktext)(v.link),G=o.getFirstLinkpathDest(V,t.path);if(G===null||(G==null?void 0:G.extension)!=="md")continue;let y=v.position.start.offset+F,E=v.position.end.offset+F,B=E-y,k=l.substring(0,y),$=l.substring(E),I=X=>m(this,null,function*(){var de,xe,te,Ce;if((de=i.settings.embed.bake)==null?void 0:de.textAfter){let ne=yield Ru((xe=i.settings.embed.bake)==null?void 0:xe.textAfter,i,G,t,n,r);ne=Nu(ne,G,n,i.settings);let qe=X.match(/[\s\n]/g)?"":` +`;X=`${X}${qe}${ne}`}if((te=i.settings.embed.bake)==null?void 0:te.textBefore){let ne=yield Ru((Ce=i.settings.embed.bake)==null?void 0:Ce.textBefore,i,G,t,n,r);ne=Nu(ne,G,n,i.settings),X=`${ne} +${X}`}l=k+X+$,F+=X.length-B}),K=(C=o.getFileCache(G))==null?void 0:C.frontmatter,Ae=he(K,i.settings,G,i.repository),ce=k.match(/(?:^|\n)([ \t]*)(?:[-*+]|[0-9]+[.)]) +$/);if(w.has(G)||!Ae)continue;let we=hp(yield hr(G,w,n,i,M,r));yield I(ce?lp(up(we),ce[1]):we)}return l})}function Ru(t,e,n,i,s,r){return m(this,null,function*(){var l;let a=(l=s.metadataCache.getFileCache(n))==null?void 0:l.frontmatter;if(!a)return t;let o=r.find(c=>c.linked===n);if(!o)return t;if(e.frontmatter.general.convertInternalLinks){let c=yield yi(i,o,a,s,e);return t.replace(/\{{2}url\}{2}/gmi,c)}return t.replace(/\{{2}url\}{2}/gmi,o.linked.path)})}function Nu(t,e,n,i){var o;let s=e.basename,r=(o=n.metadataCache.getFileCache(e))==null?void 0:o.frontmatter;if(!r)return t.replace(/\{{2}title\}{2}/gmi,s);let a=at(Tn(r,e,i),i).replace(".md","");return t.replace(/\{{2}title\}{2}/gmi,a)}function Au(t,e,n,i){return m(this,null,function*(){if(e.conversion.tags.fields.length===0||!i.plugins.enabledPlugins.has("dataview"))return t;let s=(0,Ou.getAPI)();if(!s)return t;let r=s.page(n.path);if(!r)return t;let a=[];for(let o of e.conversion.tags.fields){let l=r[o];if(l)if(l.constructor.name==="Link"){l=l;let c=Lu(l,e);c&&a.push(c)}else if(l instanceof Array)for(let c of l){let d=c;c&&c.constructor.name==="Link"?(d=Lu(c,e),d&&a.push(d)):d&&!e.conversion.tags.exclude.includes(d.toString())&&a.push(d.toString())}else e.conversion.tags.exclude.includes(l.toString())||a.push(l.toString())}return a.length>0?fr(t,a.filter(Boolean),e):t})}function Lu(t,e){let i=(r=>/([^/\\.]*)(\..*)?$/.exec(r)[1])(t.path).toString(),s=t.display?t.display.toString():i;return!e.conversion.tags.exclude.includes(s)&&!e.conversion.tags.fields.includes(i)?s:null}function pp(t,e,n){try{return t=t.replace(/^\s*\\\s*$/gim,"
"),n.hardbreak&&(t=t.replace(/\n/gm,` +`)),t}catch(i){return _({settings:e,e:!0},i),t}}function mp(t,e,n){if(n.tag)try{t=[...new Set([...t,...n.tag.map(i=>i.replaceAll("/","_"))])],delete n.tag}catch(i){_({settings:e,e:!0},i)}if(n.tags)try{n.tags=[...new Set([...n.tags.map(i=>i.replaceAll("/","_")),...t])]}catch(i){_({settings:e,e:!0},i)}else n.tags=t;return n}function fr(t,e,n,i){let s=t.split("---")[1],r=(0,dn.parseYaml)(s);e.length>0&&(r=mp(e,n,r)),i&&(r=gp(r,i.properties,i.file));let a=(0,dn.stringifyYaml)(r),o=t.split("---").slice(2).join("---");return`--- +${a}--- +${o}`}function gp(t,e,n){let i=e.settings.upload.folderNote.addTitle;return i&&!t[i.key]&&Ja(e)&&i.enable&&(t[i.key]=n.basename),t}function bp(t,e,n,i){var l;if(!t.conversion.tags.inline)return[];let s=(l=n.getFileCache(e))==null?void 0:l.tags,r=s?s.map(c=>c.tag.replace("#","").replaceAll("/","_")):[],a=(0,dn.parseFrontMatterTags)(i),o=a?a.map(c=>c.replace("#","").replaceAll("/","_")):[];return[...new Set([...r,...o])]}function yp(t,e,n,i,s,r){return m(this,null,function*(){let a=bp(t,e,n,i);return fr(s,a,t,{properties:r,file:e})})}function Mu(t,e,n,i,s,r,a){return m(this,null,function*(){return a.frontmatter.general.removeEmbed==="bake"&&(t=yield hr(e,new Set,n,a,null,s)),t=Di(t,a.settings,!1),t=yield yp(a.settings,e,r.app.metadataCache,i,t,a),t=yield bi(t,s,e,n,i,a),t=gi(t,a.frontmatter.general,s,a.settings,i),t=yield Pu(t,e.path,r.app,i,e,a),t=yield Au(t,a.settings,e,r.app),t=pp(t,a.settings,a.frontmatter.general),Di(t,a.settings,!0)})}var ns=class{constructor(e,n){this.vault=n.app.vault,this.metadataCache=n.app.metadataCache,this.settings=n.settings,this.octokit=e,this.plugin=n,this.branchName=n.branchName}statusBarForEmbed(e,n,i,s){return m(this,null,function*(){let r=[],a=[];if(e.length>0){let o=this.plugin.addStatusBarItem(),l=new Mn(o,e.length,!0),c=s.frontmatter.repo,d={frontmatter:s.frontmatter.repo,repo:s.repository};try{for(let f of e)try{if(!n.includes(f)){if(f.extension==="md"&&i){let p=yield this.publish(f,!1,d,n,!0);p&&r.push(...p.uploaded)}else if(Fe(f.extension)&&s.frontmatter.general.attachment){let p=yield this.uploadImage(f,s);n.push(f),p&&r.push(p)}}l.increment()}catch(p){new At.Notice(u.t("error.unablePublishNote",{file:f.name})),a.push(f.name),R({settings:this.settings,e:!0},p)}l.finish(8e3)}catch(f){R({settings:this.settings,e:!0},f),new At.Notice(u.t("error.errorPublish",{repo:c})),l.error()}}return{fileHistory:n,uploaded:r,error:a}})}publish(a){return m(this,arguments,function*(e,n=!1,i,s=[],r=!1){var d;let o=new Yn(this.octokit,this.plugin),l=(d=this.metadataCache.getFileCache(e))==null?void 0:d.frontmatter,c=mi(J(this.settings,i.repo,l),this.plugin);if(!he(l,this.settings,e,i.repo)||s.includes(e)||!pi(J(this.settings,i.repo,l),i.frontmatter)||!c)return!1;try{R({settings:this.settings},`Publishing file: ${e.path}`),s.push(e);let f=hi(l,this.settings,i.repo),p=o.getSharedEmbed(e,f);p=yield o.getMetadataLinks(e,p,l,f);let w=o.getLinkedByEmbedding(e),F=yield this.vault.cachedRead(e),C={settings:this.settings,frontmatter:{general:f,repo:i.frontmatter},repository:i.repo,filepath:Je(e,this.settings,i.repo,this.plugin.app)};F=yield Mu(F,e,this.plugin.app,l,w,this.plugin,C);let v=C.filepath,V=Array.isArray(i.frontmatter)?i.frontmatter:[i.frontmatter],M="";for(let k of V)M+=`[${k.owner}/${k.repo}/${k.branch}] `;let G=`Publishing ${e.name} to ${M}`;R({settings:this.settings},G);let y=[],E=[],B=[];for(let k of V){let $={settings:this.settings,frontmatter:{general:f,repo:k},repository:C.repository,filepath:C.filepath},I=yield this.uploadOnMultipleRepo(e,F,v,p,s,r,o,n,$);y.push(I.deleted),E.push(I.uploaded),B.push(...I.error)}return{deleted:y[0],uploaded:E[0],error:B}}catch(f){return R({settings:this.settings,e:!0},f),!1}})}uploadOnMultipleRepo(e,n,i,s,r,a,o,l,c){return m(this,null,function*(){let d=this.plugin.addStatusBarItem();d.createEl("span",{cls:["obsidian-publisher","loading","icons"]}).innerHTML=Ts,d.createEl("span",{text:u.t("statusBar.loading"),cls:["obsidian-publisher","loading","icons"]}),s=yield this.cleanLinkedImageIfAlreadyInRepo(s,c);let f=c.frontmatter.repo;_({settings:this.settings},`Upload ${e.name}:${i} on ${f.owner}/${f.repo}:${this.branchName}`);let p=On("wait",Ts,u.t("statusBar.loading")),w={success:!1,deleted:[],undeleted:[]};d.remove(),p==null||p.hide();let F=yield this.uploadText(n,i,e.name,f);if(!F)return{deleted:w,uploaded:[],error:[`Error while uploading ${e.name} to ${f.owner}/${f.repo}/${f.branch}`]};R({settings:this.settings},`length: ${s.length}`,s);let C=yield this.statusBarForEmbed(s,r,a,c),v=C.uploaded;return v.push(F),l&&f.autoclean&&(w=yield An(!0,this.branchName,o,{frontmatter:f,repo:c.repository})),{deleted:w,uploaded:v,error:C.error}})}upload(e,n,i="",s){return m(this,null,function*(){if(!s.repo)throw new At.Notice("Config error : You need to define a github repo in the plugin settings"),{};if(!s.owner)throw new At.Notice("Config error : You need to define your github username in the plugin settings"),{};let r=this.octokit,a=`PUSH NOTE : ${i}`;Fe(n)&&(i=n.split("/")[n.split("/").length-1],a=`PUSH ATTACHMENT : ${i}`);let o={owner:s.owner,repo:s.repo,path:n,message:`Adding ${i}`,content:e,sha:"",branch:this.branchName},l={isUpdated:!1,file:i};try{let c=yield r.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:s.owner,repo:s.repo,path:n,ref:this.branchName});c.status===200&&c.data.type==="file"&&(o.sha=c.data.sha,l.isUpdated=!0)}catch(c){_({settings:this.settings},u.t("error.normal"))}return o.message=a,yield r.request("PUT /repos/{owner}/{repo}/contents/{path}",o),l})}uploadImage(e,n){return m(this,null,function*(){let i=yield this.vault.readBinary(e),s=(0,At.arrayBufferToBase64)(i),r=Zt(e,this.settings,n.frontmatter.general);return yield this.upload(s,r,"",n.frontmatter.repo)})}uploadText(e,n,i="",s){return m(this,null,function*(){try{let r=xi.encode(e).toString();return yield this.upload(r,n,i,s)}catch(r){_({settings:this.settings,e:!0},r);return}})}uploadMetadataExtractorFiles(e,n){return m(this,null,function*(){if(e){for(let i of Object.values(e))if(i){let s=yield this.vault.adapter.read(i),r=this.settings.upload.metadataExtractorPath+"/"+i.split("/").pop();n=Array.isArray(n)?n:[n];for(let a of n)yield this.uploadText(s,r,i.split("/").pop(),a)}}})}workflowGestion(e){return m(this,null,function*(){let n=!1;if(e.workflowName.length===0)return!1;let i=this.octokit;for(yield i.request("POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches",{owner:e.owner,repo:e.repo,workflow_id:e.workflowName,ref:e.branch});!n;){yield sleep(1e4);let s=yield i.request("GET /repos/{owner}/{repo}/actions/runs",{owner:e.owner,repo:e.repo});if(s.data.workflow_runs.length>0){let r=s.data.workflow_runs.find(a=>a.name===e.workflowName.replace(".yml","").replace(".yaml",""));if(r&&r.status==="completed")return n=!0,!0}}return!1})}cleanLinkedImageIfAlreadyInRepo(e,n){return m(this,null,function*(){var s,r,a;let i=[];for(let o of e)if(Fe(o.name)){let l=Zt(o,this.settings,n.frontmatter.general),c=n.frontmatter;try{if(Ya(o,this.settings)){i.push(o);continue}if((yield this.octokit.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:c.repo.owner,repo:c.repo.repo,path:l,ref:this.branchName})).status===200){let f=yield this.octokit.request("GET /repos/{owner}/{repo}/commits",{owner:c.repo.owner,repo:c.repo.repo,path:l,sha:this.branchName});if(f.status===200){let w=(a=(r=(s=f.data[0])==null?void 0:s.commit)==null?void 0:r.committer)==null?void 0:a.date,F=w?new Date(w):void 0,C=new Date(o.stat.mtime);F&&C>F||!F?i.push(o):R({settings:this.settings},u.t("error.alreadyExists",{file:o.name}))}}}catch(d){i.push(o)}}else i.push(o);return i})}};var Yn=class extends ns{constructor(e,n){super(e,n)}getSharedFiles(e){var s;let n=this.vault.getMarkdownFiles(),i=[];for(let r of n)try{let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;he(a,this.settings,r,e)&&i.push(r)}catch(a){R({settings:this.settings,e:!0},a)}return i}getSharedFileOfFolder(e,n){var s;let i=[];for(let r of e.children)if(r instanceof hn.TFolder)i.push(...this.getSharedFileOfFolder(r,n));else try{let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;he(a,this.settings,r,n)&&i.push(r)}catch(a){R({settings:this.settings,e:!0},a)}return R({settings:this.settings},i),i}getAllFileWithPath(e){var s;let n=this.vault.getFiles(),i=[];for(let r of n)if(Fe(r.extension)){let a=Zt(r,this.settings,null);i.push({converted:a,real:r.path})}else if(r.extension=="md"){let a=(s=this.metadataCache.getCache(r.path))==null?void 0:s.frontmatter;if(he(a,this.settings,r,e)){let o=Je(r,this.settings,e,this.plugin.app);i.push({converted:o,real:r.path,repoFrontmatter:J(this.settings,e,a)})}}return i}getLinkedByEmbedding(e){var s,r;let n=this.getLinkedFiles(e),i=(s=this.metadataCache.getFileCache(e))==null?void 0:s.embeds;if(i!=null)for(let a of i)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#.*/,""),e.path);if(o!==null){let l=a.displayText!==o.path.replace(".md","")?a.displayText:o.basename,c;if(this.settings.upload.frontmatterTitle.enable){let f=(r=this.metadataCache.getCache(o.path))==null?void 0:r.frontmatter;(f==null?void 0:f[this.settings.upload.frontmatterTitle.key])&&(c=f[this.settings.upload.frontmatterTitle.key],l===o.basename&&(l=c))}let d={linked:o,linkFrom:a.link,altText:l,destinationFilePath:c,type:"embed",position:{start:a.position.start.offset,end:a.position.end.offset}};a.link.includes("#")&&(d.anchor=`#${a.link.split("#")[1]}`),n.push(d)}}catch(o){R({settings:this.settings},o)}return[...new Set(n)]}getLinkedFiles(e){var s,r;let n=(s=this.metadataCache.getCache(e.path))==null?void 0:s.links,i=[];if(n!=null){for(let a of n)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#.*/,""),e.path);if(o){let l=a.original.match(/\[.*\]\(.*\)/)?a.original.match(/\[(.*)\]/)[1]:a.displayText!==o.path.replace(".md","")?a.displayText:o.basename,c;if(this.settings.upload.frontmatterTitle.enable){let f=(r=this.metadataCache.getCache(o.path))==null?void 0:r.frontmatter;f&&f[this.settings.upload.frontmatterTitle.key]&&(c=f[this.settings.upload.frontmatterTitle.key],l===o.basename&&(l=c))}let d={linked:o,linkFrom:a.link,altText:l,destinationFilePath:c,type:"link"};a.link.includes("#")&&(d.anchor=`#${a.link.split("#")[1]}`),i.push(d)}}catch(o){R({settings:this.settings,e:!0},`Error with this links : ${a.link}`,o)}return[...new Set(i)]}return[]}getSharedEmbed(e,n){var r;let i=(r=this.metadataCache.getCache(e.path))==null?void 0:r.embeds,s=[];if(i!=null){for(let a of i)try{let o=this.metadataCache.getFirstLinkpathDest(a.link.replace(/#(.*)/,""),e.path);o&&s.push(this.imageSharedOrNote(o,n))}catch(o){R({settings:this.settings,e:!0},`Error with this file : ${a.displayText}`,o)}return[...new Set(s)].filter(a=>a!==null)}return[]}getLastEditedTimeRepo(e){return m(this,null,function*(){let i=(yield this.octokit.request("GET /repos/{owner}/{repo}/commits",{owner:this.settings.github.user,repo:this.settings.github.repo,path:e.file})).data[0];return!i||!i.commit||!i.commit.committer||!i.commit.committer.date?null:new Date(i.commit.committer.date)})}getAllFileFromRepo(e,n){return m(this,null,function*(){let i=[];try{let s=yield this.octokit.request("GET /repos/{owner}/{repo}/git/trees/{tree_sha}",{owner:n.owner,repo:n.repo,tree_sha:e,recursive:"true"});if(s.status===200){let r=s.data.tree;for(let a of r){if(!a.path||!a.sha)continue;let o=l=>/([^/\\.]*)(\..*)?$/.exec(l)[1];a.type==="blob"&&o(a.path).length>0&&i.push({file:a.path,sha:a.sha})}}}catch(s){R({settings:this.settings,e:!0},s)}return i})}getNewFiles(e,n){let i=[];for(let s of e)if(!n.some(r=>r.file===s.converted.trim())){let r=this.vault.getAbstractFileByPath(s.real.trim());r&&r instanceof hn.TFile&&r.extension==="md"&&i.push(r)}return i}getImageByPath(e,n,i){n.constructor.name==="Link"&&(n=n.path),e.constructor.name==="Link"&&(e=e.path);let s=this.metadataCache.getFirstLinkpathDest(n,e);if(s)return this.imageSharedOrNote(s,i)}imageSharedOrNote(e,n){let i=n.attachment,s=n.embed;if(Fe(e.extension)&&i||s&&e.extension==="md")return e}getMetadataLinks(e,n,i,s){return m(this,null,function*(){var r,a;for(let o of this.settings.embed.keySendFile){let l=(r=this.metadataCache.getFileCache(e))==null?void 0:r.frontmatterLinks,c=[];l&&l.forEach(d=>{let f=new RegExp(`${o}(\\.\\d+)?`,"g");d.key.match(f)&&c.push(d.link)});for(let d of c){let f=(a=this.metadataCache.getFirstLinkpathDest(d,e.path))!=null?a:this.vault.getAbstractFileByPath(d);f instanceof hn.TFile&&!n.includes(f)&&n.push(this.imageSharedOrNote(f,s))}}if(n=[...new Set(n)].filter(o=>o!=null),R({settings:this.settings},n),this.plugin.app.plugins.enabledPlugins.has("dataview")){let o=(0,Bu.getAPI)();if(!o)return n;let l=o.page(e.path);if(!l)return n;for(let c of this.settings.embed.keySendFile){let d=l[c];if(d!=null)if(d.constructor.name==="Array")for(let f of d){let p=this.getImageByPath(e.path,f,s);p&&n.push(p)}else{let f=this.getImageByPath(e.path,d.toString(),s);f&&n.push(f)}}}return[...new Set(n)].filter(o=>o!=null)})}getEditedFiles(e,n,i){return m(this,null,function*(){for(let s of e)if(n.some(r=>r.file===s.converted.trim())){let r=n.find(l=>l.file===s.converted.trim());if(!r)continue;let a=yield this.getLastEditedTimeRepo(r),o=this.vault.getAbstractFileByPath(s.real.trim());if(o&&o instanceof hn.TFile&&o.extension==="md"){let l=new Date(o.stat.mtime);a&&l>a&&(R({settings:this.settings},`edited file : ${o.path} / ${l} vs ${a}`),i.push(o))}}return i})}};var pr=class extends Yn{constructor(e,n){super(e,n)}newBranch(e){return m(this,null,function*(){e=Array.isArray(e)?e:[e];for(let n of e)yield this.newBranchOnRepo(n)})}newBranchOnRepo(e){return m(this,null,function*(){let i=(yield this.octokit.request("GET /repos/{owner}/{repo}/branches",{owner:e.owner,repo:e.repo})).data.find(s=>s.name===e.branch);if(!i)return!1;try{let s=i.commit.sha,r=yield this.octokit.request("POST /repos/{owner}/{repo}/git/refs",{owner:e.owner,repo:e.repo,ref:`refs/heads/${this.branchName}`,sha:s});return _({settings:this.settings},u.t("publish.branch.success",{branchStatus:r.status,repo:e})),r.status===201}catch(s){try{R({settings:this.settings,e:!0},s);let a=(yield this.octokit.request("GET /repos/{owner}/{repo}/branches",{owner:e.owner,repo:e.repo})).data.find(o=>o.name===this.branchName);return _({settings:this.settings},u.t("publish.branch.alreadyExists",{branchName:this.branchName,repo:e})),!!a}catch(r){return _({settings:this.settings,e:!0},r),!1}}})}pullRequestOnRepo(e){return m(this,null,function*(){var n;try{return(yield this.octokit.request("POST /repos/{owner}/{repo}/pulls",{owner:e.owner,repo:e.repo,title:u.t("publish.branch.prMessage",{branchName:this.branchName}),body:"",head:this.branchName,base:e.branch})).data.number}catch(i){R({settings:this.settings,e:!0},i);try{return((n=(yield this.octokit.request("GET /repos/{owner}/{repo}/pulls",{owner:e.owner,repo:e.repo,state:"open"})).data[0])==null?void 0:n.number)||0}catch(s){return _({settings:this.settings,e:!0},u.t("publish.branch.error",{error:s,repo:e})),0}}})}deleteBranchOnRepo(e){return m(this,null,function*(){try{return(yield this.octokit.request("DELETE /repos/{owner}/{repo}/git/refs/heads/"+this.branchName,{owner:e.owner,repo:e.repo})).status===200}catch(n){return R({settings:this.settings,e:!0},n),!1}})}mergePullRequestOnRepo(e,n){return m(this,null,function*(){let i=n.commitMsg||n.commitMsg.trim().length>0?`${n.commitMsg} #${e}`:`[PUBLISHER] Merge #${e}`;try{return(yield this.octokit.request("PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge",{owner:n.owner,repo:n.repo,pull_number:e,commit_title:i,merge_method:"squash"})).status===200}catch(s){return _({settings:this.settings,e:!0},s),new ut.Notice(u.t("error.mergeconflic")),!1}})}updateRepository(e){return m(this,null,function*(){e=Array.isArray(e)?e:[e];let n=[];for(let i of e)n.push(yield this.updateRepositoryOnOne(i));return!n.every(i=>i===!1)})}updateRepositoryOnOne(e){return m(this,null,function*(){try{let n=yield this.pullRequestOnRepo(e);return e.automaticallyMergePR&&n!==0?(yield this.mergePullRequestOnRepo(n,e))?(yield this.deleteBranchOnRepo(e),!0):!1:!0}catch(n){return R({settings:this.settings,e:!0},n),new ut.Notice(u.t("error.errorConfig",{repo:e})),!1}})}checkRepository(e,n=!0){return m(this,null,function*(){e=Array.isArray(e)?e:[e];for(let i of e)try{(yield this.octokit.request("GET /repos/{owner}/{repo}",{owner:i.owner,repo:i.repo}).catch(r=>{r.status===404?new ut.Notice(u.t("commands.checkValidity.inRepo.error404",{repo:i})):r.status===403?new ut.Notice(u.t("commands.checkValidity.inRepo.error403",{repo:i})):r.status===301&&new ut.Notice(u.t("commands.checkValidity.inRepo.error301",{repo:i}))})).status===200&&(_({settings:this.settings},u.t("commands.checkValidity.repoExistsTestBranch",{repo:i})),(yield this.octokit.request("GET /repos/{owner}/{repo}/branches/{branch}",{owner:i.owner,repo:i.repo,branch:i.branch}).catch(a=>{a.status===404?new ut.Notice(u.t("commands.checkValidity.inBranch.error404",{repo:i})):a.status===403&&new ut.Notice(u.t("commands.checkValidity.inBranch.error403",{repo:i}))})).status===200&&!n&&new ut.Notice(u.t("commands.checkValidity.success",{repo:i})))}catch(s){R({settings:this.settings,e:!0},s);break}})}};var br=q(require("obsidian"));var mr={};os(mr,{commands:()=>Iu,common:()=>$u,default:()=>Dp,deletion:()=>Vu,error:()=>Gu,informations:()=>ju,modals:()=>Hu,publish:()=>Uu,regex:()=>_u,settings:()=>qu,statusBar:()=>Wu});var Iu={checkValidity:{inBranch:{error403:"Error 403: {{- repo.owner}}/{{- repo.repo}} was moved permanently (from {{- repo.branch}}).",error404:"Error 404: The branch {{- repo.branch}} was not found in {{- repo.owner}}/{{- repo.repo}}."},inRepo:{error301:"Error 301: {{- repo.owner}}/{{- repo.repo}} was moved permanently.",error403:"Error 403: this action is forbidden for {{- repo.owner}}/{{- repo.repo}}.",error404:"Error 404: {{- repo.owner}}/{{- repo.repo}}: is not found."},rateLimit:{command:"Check the rate limit of the GitHub API",limited:"You have reached the rate limit of the GitHub API. The limit will be reset at {{- resetTime}}.",notLimited:"You are not rate limited. You can make {{- remaining}} requests before the limit is reset at {{- resetTime}}."},repoExistsTestBranch:"Repository {{- repo.owner}}/{{- repo.repo}} exists. Now testing the {{- repo.branch}} branch.",success:"{{- repo.owner}}/{{- repo.repo}} seems to be valid!",title:"Test the connection to the configured repository"},copyLink:{onActivation:"Link copied to your clipboard",title:"Create a link to this note"},publisherDeleteClean:"Purge depublished and deleted files",runOtherRepo:{noFile:"No file is active or the file is not shared",title:"Run command for a repository"},shareActiveFile:"Upload single current active note",shareViewFiles:{multiple:{on:"Upload {{- doc}} to {{- smartKey }}",other:"Upload to\u2026"}},uploadAllEditedNote:"Refresh all published notes",uploadAllNewEditedNote:"Refresh published and upload new notes",uploadAllNotes:"Upload all shared notes",uploadNewNotes:"Upload unpublished notes"},$u={add:"Add {{- things}}",after:"After",attachments:"Attachments",before:"Before",cancel:"Cancel",close:"Close",default:"default",defaultName:"default folder",delete:"Delete {{- things}}",edit:"Edit {{- things}}",error:"Error",files:"Files",ghToken:"GitHub token",here:"here",or:"or",path:{file:"File name",folder:"Folder path",full:"Filepath"},published:"published",regex:"regex",rename:"Renamed key(s)...",repository:"Repository",rootFolder:"root folder",save:"Save",shared:"shared",text:"text",warning:"Warning"},Vu={defaultFolder:"You need a default folder name in the settings to use this command.",failed:"Failed to delete {{- nb}} files.",noFile:"No files have been deleted.",rootFolder:"You need to configure a root folder in the settings to use this command.",success:"Successfully deleted {{- nb}} files."},Gu={alreadyExists:"{{- file}} already exists.",autoClean:"Since {{- what}} is empty, auto-cleaning is disabled.",dataview:"Unable to render dataview query. Please update the dataview plugin to the last version.",errorConfig:"Error configuring {{- repo.owner}}/{{- repo.repo}}. Please check your settings.",errorPublish:"Error during upload to {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}",isEmpty:"{{- what}} is empty.",mergeconflic:"Pull-request is not mergeable, you need to do it manually.",normal:"The 404 error is normal ! It means that the file does not exist yet. Don't worry \u2764\uFE0F.","reading-token-file":"Error: the path seems incorrect.",unablePublishMultiNotes:"Unable to upload multiple notes, something went wrong.",unablePublishNote:"Unable to upload note {{- file}}, skipping it",whatEmpty:{branch:"Branch",owner:"Owner"}},ju={foundNoteToSend:"Found {{- nbNotes}} new notes to send",migrating:{fileReplace:"Migration of filename replace to the new format...",normalFormat:"Migrating settings...",oldSettings:"Migration of old settings to new settings format...",subFolder:"Adding replacing subfolder to the folderpath replacement..."},noNewNote:"No new notes to upload.",scanningRepo:"Scanning the repository, may take a while...",sendMessage:"Upload {{- nbNotes}} notes to {{- repo.owner}}/{{- repo.repo}}",startingClean:"Starting cleaning {{- repo.owner}}/{{- repo.repo}}",successPublishOneNote:"Successfully uploaded {{- file}} to {{- repo.owner}}/{{- repo.repo}}",successfulPublish:"Successfully uploaded {{- nbNotes}} to {{- repo.owner}}/{{- repo.repo}}",waitingWorkflow:"Now, waiting for the workflow to be completed..."},Hu={export:{copy:"Copy to clipboard",desc:"Export settings to clipboard or a file.",download:"Download",title:"Export settings"},import:{desc:"Import settings from text or a file. Note : this will overwrite your current settings (except for username, repo name and token).",error:{isEmpty:"the configuration is empty.",span:"Error importing configuration: "},importFromFile:"Import from file",paste:"Paste configuration here...",presets:{desc:'Load presets from the repository "plugin-presets"',title:"Presets"},title:"Import settings"},listChangedFiles:{added:"Added",deleted:"Deleted",edited:"Edited",error:"Errors",notDeleted:"Cannot be deleted",title:"List of files edited in the repository",unpublished:"Cannot be published"}},Uu={branch:{alreadyExists:"Branch already exists ({{- branchName}} on {{- repo.owner}}/{{- repo.repo}} - Using it.",error:"Error with {{- repo.owner}}/{{- repo.repo}}: {{- error}}",prMessage:"Pull-Request [{{- branchName}}] from Obsidian",success:"Branch successfully created (status: {{- branchStatus}}) on {{- repo.owner}}/{{- repo.repo}}"}},_u={entry:"Value to replace",replace:"Replacement"},qu={conversion:{dataview:{desc:"Convert dataview to markdown.",title:"Dataview"},desc:"Theses option won't change the content of the file in your Obsidian Vault, but will change the content of the file in GitHub.",hardBreak:{desc:"Add a markdown hard line break (double whitespace) after each line.",title:"Markdown hard line break"},links:{desc:"Put `links: false` in the frontmatter of a note to prevent links to it to be converted and keep the alt text (or filename)",folderNote:{desc:"Rename files to a specified name (default: index.md) if it has the same name as their parent folder/category (also works if the note is outside of the folder).",title:"Folder note"},internals:{desc:"Convert internal links to their counterpart in the repository, with relative path.",shareAll:'Includes all links for the "share all" settings, as it impossible without frontmatter to know the sharing state of a file.',title:"Internals links"},nonShared:{desc:"Same option as internals, but for notes that are not yet published. Disabled, only the filename will be conserved.",title:"Convert internal links pointing to unpublished notes"},slugify:{desc:"Standardize the slug of anchor links (pointing to heading title). Transform the slug into all lower case. Replace space with hyphen. Applicable only for anchor links in markdown link syntax.",title:"Sluglify anchor in markdown links"},title:"Links",wikilinks:{desc:"Convert Wikilinks to MDlinks, without changing the contents.",title:"[[Wikilinks]] to [MDlinks](links)"}},sectionTitle:"Main text",tags:{desc:"This will convert any properties or dataview inline field into properties tags. Separate fields with a comma.",exclude:{desc:"This will exclude value from being converted. Separate fields with a comma.",placeholder:"Field value",title:"Exclude value from conversion"},inlineTags:{desc:'Add your inline tags in your properties tags field and converting nested tags with replacing "/" with "_"',title:"Inline tags"},title:"Convert properties/dataview fields into tags"},title:"Content"},embed:{attachment:"Attachments",bake:{text:"Allow you to add text before and after each embed, for example adding HTML or stylize the block with markdown.",textAfter:{title:"Text after the block"},textBefore:{title:"Text before the block"},title:"Include embed settings",variable:{desc:"It is possible to use the following variable:",title:": note embedded title",url:": path to the embedded note"},warning:"If you use HTML, depending of your host settings, the markdown will broke."},char:{desc:"Character(s) to add before the link.",title:"Embed characters"},defaultImageFolder:{desc:"To use a folder different from default",title:"Default attachment folder"},forcePush:{all:"Use {{all}} to change the destination of all attachments (and/or force them to be sent).",default:"Use {{default}} to use the default destination path.",desc:"The following extensions will always be published, regardless of the last sending date.",info:"By default, attachments are only sent if they have been modified since they were last sent, or if they do not exist in the repository.",separateByComma:`Separate extensions with commas. +You can use regex by enclosing it with "/", like /regex/. Use {{all}} to force all attachments to be sent.`,title:"Force attachments to be sent"},imagePath:{desc:"Use the obsidian folder structure or configure a default folder below",title:"Structure"},links:{desc:"Allow to edit the links of the embeds, removing entirely the citation, or transform to a simple link",dp:{bake:"Include embed contents",keep:"No change",links:"Transform to link",remove:"Remove link completely"},title:"Change embed markup"},notes:"Embed notes",overrides:{desc:"Allow to send an attachment into a specific path and force push attachments.",modal:{dest:"Destination",path:"Path or extension",title:"Override attachments path"}},title:"Attachment & embeds ",transferImage:{title:"Transfer attachments"},transferMetaFile:{desc:"Set the names of the metadata field you want to use to send files. Separate fields with a comma. Dataview inline field are supported.",title:"Send files using a metadata field"},transferNotes:{desc:"Send embedded notes in a shared file to GitHub. Only shared files will be send!",title:"Transfer embedded notes"}},github:{apiType:{desc:"Choose between the GitHub API or the GitHub Enterprise API (only GitHub Enterprise users \u2014 Advanced user!).",dropdown:{enterprise:"Enterprise",free:"Free/Pro/Team (default)"},hostname:{desc:"The hostname of your GitHub Enterprise instance.",title:"GitHub Enterprise Hostname"},title:"API Type"},automaticallyMergePR:"Automatically merge pull requests",branch:{desc:'If you use a different branch than "main"',title:"Main branch"},ghToken:{button:{configDir:": The configuration folder of Obsidian",default:"By default, it will be in:",description:"You can edit the file path where the token will be stored.",pluginID:": The plugin ID",tooltip:"Modify the path of the file containing the token",variables:"You can use the following variables:"},desc:"A GitHub token with repository permission. You can generate it ",error:"The token mustn't be empty!"},repoName:{desc:"The name of the repository where you store your blog.",placeholder:"mkdocs-template",title:"Repository name"},smartRepo:{button:"Manage more repository",modals:{default:'The name "default" is reserved for your primary configuration.',desc:'These "other repositories" allow you to use all the commands on the repositories added below.',duplicate:"Smartkey must be unique!",empty:"Smartkeys cannot be empty",frontmatterInfo:'Using the "shortRepo" properties key with the "smartKey" also allows you to use this repository in a file without having to write its path.',newRepo:"a new repository",otherConfig:"Other settings",shortcuts:{desc:"Add all commands for this repository in the command palette",title:"Shortcuts"},title:"Manage others repositories"}},testConnection:"Test connection",title:"GitHub config",username:{desc:"The username or organization hosting the repo in GitHub",title:"GitHub username"}},githubWorkflow:{autoCleanUp:{desc:"Remove depublished files (stopped sharing or deleted) from GitHub",title:"Auto clean up"},excludedFiles:{desc:'If you want to exclude some folder or file from the autoclean, add them here. You can use regex by surrounding the string with "/". Separate files with a comma.',title:"Excluded files and folder"},githubAction:{desc:'If you want to activate a GitHub action when the plugin push the file, set the name of the file (in your .github/worfklows folder). Only workflow with the "workflow_dispatch" event will be triggered.',title:"GitHub action name"},prRequest:{desc:"The message send when the pull-request is merged. Will always followed by the pull-request number.",error:"You can't use an empty string here!",title:"Commit message"},useMetadataExtractor:{desc:"Send the files generated by the metadata-extractor plugin in this folder.",title:"Metadata-extractor files"}},help:{frontmatter:{attachment:{folder:"Change the default folder for the attachments",send:"Send all attachments to GitHub"},autoclean:"Disable or enable autocleaning",baselink:{desc:"Change the base link for the copy link command. Also disable the link replacer part. Can be used as an properties object with the name ",remove:"Remove part of the link. It must be a list!"},convert:{enableOrDisable:"Enable or disable the conversion of links. Disabling this will remove the",syntax:"syntax, while keeping the file name or the alternative text."},dataview:"Convert dataview queries to markdown.",desc:"Moreover, there are some properties keys that can be useful for your workflow. The code below show the default settings, but feel free to change it to your needs in each notes!",embed:{char:'Add a character(s) before the embedded links. Used only if you set "remove" to "links".',remove:{bake:"Include the content of the embed (support blocks, heading and entire file)",desc:"Modify the aspect of the embedded files link. Can take the followed value:",keep:"Leave as in Obsidian",links:'Convert to links (delete or edit the "!")',remove:"Delete the citation completely and leave an empty line"},send:"Send embedded note to GitHub"},hardBreak:"Convert all linebreaks to markdown \xABhard break\xBB.",internals:"Convert internals links to their counterpart in the website, with relative path. Disabled, the plugin will keep the internal link as is.",mdlinks:"Convert all [[wikilinks]] to [markdown](links)",nonShared:"Convert internal links pointing to a unshared file to their counterpart in the website, with relative path. Disabled, the plugin will keep the filename.",path:"You can override all path settings using this key. The path will be relative to the root of your repository.",repo:{branch:"Branch of the repo",desc:"Change the default repo for the note.",owner:"Owner of the repo"},share:{other:"You could also use another shareKey based on the key set in \xAB Manage other repo \xBB. It allows you to separate your different repository. If the main and secondaries key are used, the main repo will be used.",title:"This key is used to share a note with the plugin."},shortRepo:"Allow to use one of the repo set in other repo settings.",title:"Property key cheatsheet",titleKey:"Change the title of the note."},multiRepoHelp:{desc:"If you want to send your notes to multiple repository, you can use the ",desc2:"key in your properties. The value of this key must be a list of repository. Each repository must have the following keys ",exampleDesc:"The code below show an example based on your settings.",title:"Send to multiple repository"},title:"Help",usefulLinks:{discussion:"Discussion",documentation:"Documentation",issue:"Issue",links:"https://obsidian-publisher.netlify.app/",title:"Useful links"}},overrides:{},plugin:{copyLink:{baselink:{desc:"The base link of your website. By default : https://username.github.io/repo/",title:"Base link"},command:{desc:"Add a command to copy the link of the note (need reloading the plugin to take effect)"},desc:"Send a link to your note in your clipboard",linkPathRemover:{desc:"Delete this part of the links created. Separate with a comma if several values are to be deleted.",title:"Deleting part of the link"},title:"Copy link"},dev:{desc:"Advanced user only. Will display as notice according to the previous setting.",title:"Display developper logs"},editorMenu:{desc:"Add a sharing command in the right-click menu",title:"Editor menu"},embedEditRepo:{desc:"Display a modal how the new version differs",title:"Show what files are edited, added, or deleted after uploaded"},excludedFolder:{desc:"Never publish file in these folders, regardless of the share key. Read the docs for more info.",title:"Excluded folders"},fileMenu:{desc:"Add a sharing command in the file menu",title:"File menu"},head:{copyLinks:"Link building & copy",log:"Logs",menu:"Menu",other:"Others",share:"Sharing config"},logNoticeHeader:{desc:"On mobile, it can be hard to debug the plugin. Enable this option to log every error in a Notice.",title:"Notice every error"},saveTab:{desc:"Allows you to reopen the settings on the previously used tab",title:"Save tab"},shareKey:{all:{desc:"Share all files regardless of the state of the share key of the notes",title:"Share all files"},desc:"The YAML frontmatter key to publish your file on the website. Default is `share`.",excludedFileName:{title:"Exclude files with names starting with ..."},otherRepo:"You can also define a share key to separate with others, without using the shortRepo key.",title:"Share key"},title:"Plugin settings"},regexReplacing:{empty:"Replacement can be empty to remove the whole string.",emptyRegex:"The value to replace cannot be empty",forbiddenValue:"The {{- what}} cannont contain the character: {{- forbiddenChar}}",inCodeBlocks:{runIn:"Runned in code-blocks",runOut:"Not runned in the code blocks"},invalidRegex:"An error has occurred: {{- e}}",modal:{desc:'Replace text in the file with the given value. Enclose the text with "//" to use regex.',force:"Force push",keywords:"Keywords",name:"Use {{name}} to use the filename.",title:{all:"Folder path & filename replacer",only:"Replace filename",text:"Text replacer"}},momentReplaceRegex:"Run replacement {{- moment}} the other plugin conversion (dataview, internals links...)",warningPath:'Warning! Using the character "/" will edit the path, be careful with this option.'},upload:{defaultFolder:{desc:"Set the default reception folder. Leave it empty to use the root of the repository.",other:"Use this folder as root within the repository (each path will be prepend by it)",placeholder:"docs",title:"Default folder"},folderBehavior:{desc:"Choose the file tree in the repository, with using a property key, a fixed folder or your Obsidian file tree.",fixedFolder:"Fixed Folder",obsidianPath:"Obsidian Path",title:"File tree in repository",yaml:"Property key"},folderNote:{addTitle:{key:'Use a key other than "title"',title:'Automatically add the "title" key with the file name'}},frontmatterKey:{desc:"Set the key where to get the folder's value.",placeholder:"category",title:"Property key"},regexFilePathTitle:{desc:'If the text is between "//", it will be used as a regex. Otherwise, it will be used as a string.',title:{FolderPathTitle:"Apply edit on the folder path or the filename (automatically)",titleOnly:"Apply edit on the filename (automatically)"}},rootFolder:{desc:"Append this path to the folder set by the properties key",other:"Use this folder as root within the repository (each path will be prepend by it).",title:"Root folder"},title:"File paths",useFrontmatterTitle:{desc:'Use a property value to generate the filename. By default, "title" is used. ',title:"Set the key where to get the value of the filename"}}},Wu={counter:"{{- msg}}: {{- counter}}/{{- nb}}",loading:"Loading...",markedForSharing:"{{- nb}} {{- type}} marked for sharing",sharing:"Sharing {{- type}}",success:"{{- type}} {{- action}}"},Dp={commands:Iu,common:$u,deletion:Vu,error:Gu,informations:ju,modals:Hu,publish:Uu,regex:_u,settings:qu,statusBar:Wu};var gr={};os(gr,{commands:()=>Ku,common:()=>zu,default:()=>wp,deletion:()=>Zu,error:()=>Yu,informations:()=>Ju,modals:()=>Qu,publish:()=>Xu,regex:()=>ec,settings:()=>tc,statusBar:()=>nc});var Ku={checkValidity:{inBranch:{error403:"Erreur 403: {{- repo.owner}}/{{- repo.repo}} a \xE9t\xE9 d\xE9plac\xE9 de mani\xE8re permanente (depuis {{- branchInfo}}",error404:"Erreur 404 : La branche {{- repo.branch}} est introuvable depuis {{- repo.owner}}/{{- repo.repo}}"},inRepo:{error301:"Erreur 301 : {{- repo.owner}}/{{- repo.repo}} a \xE9t\xE9 d\xE9plac\xE9 de mani\xE8re permanente",error403:"Erreur 403 : Cette action est interdite pour {{- repo.owner}}/{{- repo.repo}}",error404:"Erreur 404 : {{- repo.owner}}/{{- repo.repo}} est introuvable"},rateLimit:{command:"V\xE9rifier la limite de requ\xEAtes de l'API GitHub",limited:"Vous avez atteint la limite de requ\xEAtes Github. La limite sera r\xE9initialis\xE9e \xE0 {{- resetTime}}. minutes.",notLimited:"Vous n'\xEAtes pas limit\xE9 par Github. Vous pouvez encore faire {{- remaining}} requ\xEAtes, et la limite sera r\xE9initialis\xE9e \xE0 {{- resetTime}}."},repoExistsTestBranch:"Le d\xE9p\xF4t {{- repo.owner}}/{{- repo.repo}} existe. Maintenant, nous allons tester la branche {{- repo.branch}}",success:"{{- repo.owner}}/{{- repo.repo}} semble valide !",title:"Tester la connexion au d\xE9p\xF4t configur\xE9"},copyLink:{onActivation:"Lien copi\xE9 dans le presse-papier !",title:"Cr\xE9er un lien vers cette note"},publisherDeleteClean:"Purger les fichiers d\xE9publi\xE9s et supprim\xE9s",runOtherRepo:{noFile:"Aucun fichier actif, ou le fichier n'est pas partag\xE9.",title:"Lancer une commande pour un d\xE9p\xF4t"},shareActiveFile:"Transf\xE9rer la note active",shareViewFiles:{multiple:{on:"Transf\xE9rer {{- doc}} vers {{- smartKey }}",other:"Transf\xE9rer vers\u2026"}},uploadAllEditedNote:"Rafra\xEEchir toutes les notes publi\xE9es",uploadAllNewEditedNote:"Rafra\xEEchir les notes publi\xE9es et transf\xE9rer les nouvelles notes",uploadAllNotes:"Transf\xE9rer toutes les notes",uploadNewNotes:"Transf\xE9rer les nouvelles notes"},zu={add:"Ajouter {{- things}}",after:"Apr\xE8s",attachments:"Pi\xE8ces-jointes",before:"Avant",cancel:"Annuler",close:"Fermer",default:"d\xE9faut",defaultName:"dossier par d\xE9faut",delete:"Supprimer {{- things}}",edit:"\xC9diter {{- things}}",error:"Erreur",files:"Fichiers",ghToken:"Token GitHub",here:"ici",or:"ou",path:{file:"Nom du fichier",folder:"Chemin du dossier",full:"Chemin du fichier"},published:"publi\xE9s",regex:"regex",rename:"Cl\xE9(s) renomm\xE9e(s)...",repository:"D\xE9p\xF4t",rootFolder:"dossier racine",save:"Sauvegarder",shared:"partag\xE9es",text:"texte",warning:"Attention"},Zu={defaultFolder:"Vous avez besoin d'un dossier par d\xE9faut dans les param\xE8tres pour utiliser cette commande.",failed:"\xC9chec de la suppression de {{- nb}} notes.",noFile:"Aucun fichier n'a \xE9t\xE9 supprim\xE9.",rootFolder:"Vous devez configurer un dossier racine dans les param\xE8tres pour utiliser cette commande.",success:"Suppression r\xE9ussie de {{- nb}} fichiers."},Yu={alreadyExists:"{{- file}} existe d\xE9j\xE0.",autoClean:"Le {{- what}} \xE9tant vide, l'auto-nettoyage est d\xE9sactiv\xE9e.",dataview:"Impossible de convertir la requ\xEAte Dataview. Veuillez mettre \xE0 jour le module Dataview \xE0 la derni\xE8re version;",errorConfig:"Erreur de configuration pour {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}. Merci de v\xE9rifier vos param\xE8tres.",errorPublish:"Erreur lors de la publication sur {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}",isEmpty:"{{- what}} est vide.",mergeconflic:"La Pull-Request n'est pas fusionnable, vous avez besoin de le faire manuellement.",normal:"L'erreur 404 est normale ! Elle signifie que le fichier n'existe pas encore. Ne vous inqui\xE9tez pas \u2764\uFE0F.","reading-token-file":"Erreur : Le chemin est incorrect.",unablePublishMultiNotes:"Impossible de transf\xE9rer plusieurs notes, quelque chose s'est mal pass\xE9.",unablePublishNote:"Impossible de transf\xE9rer {{- file}}, le fichier a \xE9t\xE9 ignor\xE9.",whatEmpty:{branch:"Branch",owner:"Propri\xE9taire"}},Ju={foundNoteToSend:"Trouv\xE9 {{- nbNotes}} nouvelles notes \xE0 transf\xE9rer.",migrating:{fileReplace:"Migration du remplacement du nom du fichier au nouveau format...",normalFormat:"Migration des param\xE8tres...",oldSettings:"Migration des anciens param\xE8tres au nouveau format...",subFolder:"Ajout du remplacement du sous-dossier au remplacement de chemin de fichier..."},noNewNote:"Aucune note \xE0 transf\xE9rer.",scanningRepo:"Scan du d\xE9p\xF4t, veuillez patienter...",sendMessage:"Transfert de {{- nbNotes}} notes vers {{- repo.owner}}/{{- repo.repo}}",startingClean:"D\xE9but du nettoyage de {{- repo.owner}}/{{- repo.repo}}",successPublishOneNote:"Transfert r\xE9ussi de {{- file}} vers {{- repo.owner}}/{{- repo.repo}}",successfulPublish:"Transfert r\xE9ussi de {{- nbNotes}} notes vers {{- repo.owner}}/{{- repo.repo}}",waitingWorkflow:"Maintenant, attente de la fin du workflow..."},Qu={export:{copy:"Copier vers le presse-papier",desc:"Exporter les param\xE8tres vers un fichier ou dans le presse-papier.",download:"T\xE9l\xE9charger",title:"Exporter les param\xE8tres"},import:{desc:"Importer des param\xE8tres depuis un fichier ou un texte. Cela \xE9crasera vos param\xE8tres actuels (sauf le nom du d\xE9p\xF4t, le nom d'utilisateur et votre token)",error:{isEmpty:"la configuration est vide",span:"Erreur lors de l'importation de la configuration :"},importFromFile:"Import depuis le fichier",paste:"Coller la configuration ici...",presets:{desc:'Charger des pr\xE9-r\xE9glages du d\xE9p\xF4t "plugin-presets"',title:"Pr\xE9-r\xE9glages"},title:"Importer des param\xE8tres"},listChangedFiles:{added:"Ajout\xE9",deleted:"Supprim\xE9",edited:"Modifi\xE9",error:"Erreurs",notDeleted:"Impossible \xE0 supprimer",title:"Liste des fichiers \xE9dit\xE9s sur le d\xE9p\xF4t",unpublished:"Impossible \xE0 publier"}},Xu={branch:{alreadyExists:"La branche {{- branchName}} sur {{- repo.owner}}/{{- repo.repo}} existe d\xE9j\xE0 - Utilisation de celle-ci.",error:"Erreur avec {{- repo.owner}}/{{- repo.repo}} : {{- error}}",prMessage:"Pull-Request [{{- branchName}}] depuis Obsidian",success:"La branche a \xE9t\xE9 cr\xE9e avec succ\xE8s (status: {{- branchStatus}} sur {{- repo.owner}}/{{- repo.repo}})"}},ec={entry:"Valeur \xE0 remplacer",replace:"Remplacement"},tc={conversion:{dataview:{desc:"Convertir les requ\xEAtes Dataview en markdown.",title:"Dataview"},desc:"Ces options ne changent pas le contenu du fichier dans votre coffre Obsidian, mais changeront le contenu du fichier publi\xE9 sur GitHub.",hardBreak:{desc:"Ajoutez un retour \xE0 la ligne Markdown (double espace) apr\xE8s chaque ligne.",title:"Saut de ligne strict"},links:{desc:'Vous pouvez emp\xEAcher la conversion des liens et conserver le texte alt (ou le nom du fichier) en utilisant la cl\xE9 de propri\xE9t\xE9s "links" avec la valeur "false".',folderNote:{desc:`Renommer les fichiers en un nom sp\xE9cifique (d\xE9faut : "index.md") s'il porte le m\xEAme nom que leur dossier/cat\xE9gorie parent (fonctionne aussi si la note est \xE0 l'ext\xE9rieur du dossier).`,title:"Folder Note"},internals:{desc:"Convertir les liens internes pointant vers les notes publi\xE9es vers leur homologue dans le d\xE9p\xF4t, sous forme de chemin relatif.",shareAll:`Inclut tous les liens pour les param\xE8tres "partager tout", car il est impossible sans frontmatter de conna\xEEtre l'\xE9tat de partage d'un fichier.`,title:"Liens internes"},nonShared:{desc:"L'option pr\xE9c\xE9dente, mais appliqu\xE9es aux liens internes pointant vers des notes non-publi\xE9es. D\xE9sactiv\xE9, seul le nom du fichier sera conserv\xE9.",title:"Conversion des liens internes pointant vers des notes non-publi\xE9es"},slugify:{desc:"Normaliser le lien (slug) des liens d'ancrage (pointant vers le titre de la rubrique). Transforme le texte en minuscules. Remplace l'espace par un tiret. Applicable uniquement aux liens d'ancrage dans la syntaxe de lien markdown.",title:"Slugifier l'ancre des liens markdown"},title:"Liens",wikilinks:{desc:"Conversion des liens wikilinks en liens Markdown, sans en modifier le contenu.",title:"Convertir [[WikiLinks]] en [liens](Markdown)"}},sectionTitle:"Texte principal",tags:{desc:"Ceci convertira tous les champs des propri\xE9t\xE9s/dataview en tags. S\xE9parez les champs par une virgule.",exclude:{desc:"Exclusion de champs de la conversion. S\xE9parer les valeurs par une virgule.",placeholder:"Valeur du chemin",title:"Exclusion de tags"},inlineTags:{desc:'Ajoute vos inlines tags dans votre bloc propri\xE9t\xE9s et converti les tags imbriqu\xE9s en rempla\xE7ant "/" par "_".',title:"Inlines tags"},title:"Convertir des champs dataview ou propri\xE9t\xE9s en tags"},title:"Contenu"},embed:{attachment:"Pi\xE8ces-jointes",bake:{text:"Permet d'ajouter du texte avant et apr\xE8s chaque int\xE9gration, par exemple en ajoutant du HTML ou en stylisant le bloc avec du markdown.",textAfter:{title:"Texte apr\xE8s le block"},textBefore:{title:"Texte \xE0 ajouter avant le block"},title:"Param\xE8tres pour l'inclusion des embeds",variable:{desc:"Il est possible d'utiliser les variables suivantes :",title:" : Titre de la note inclue",url:" : Chemin vers la note inclue"},warning:"Si vous utilisez du HTML, selon les param\xE8tres de votre h\xE9bergeur, le Markdown sera cass\xE9."},char:{desc:"Caract\xE8re(s) \xE0 ajouter devant le lien.",title:"Caract\xE8re d'embed"},defaultImageFolder:{desc:"Pour utiliser un dossier diff\xE9rent de celui par d\xE9faut pour les pi\xE8ces-jointes.",title:"Dossier de pi\xE8ces-jointes par d\xE9faut"},forcePush:{all:"Utiliser {{all}} pour modifier la destination de toutes les pi\xE8ces jointes (et/ou forcer leur envoie).",default:"Utiliser {{default}} pour utiliser le chemin de destination par d\xE9faut.",desc:"Les extensions suivantes seront toujours publi\xE9es, quelque soit la derni\xE8re date d'envoi.",info:"Par d\xE9faut, les pi\xE8ces-jointes ne sont envoy\xE9s que si elles ont \xE9t\xE9 modifi\xE9es depuis leur dernier envoi, ou si elles n'existent pas dans le d\xE9p\xF4t.",title:"Forcer l'envoi des pi\xE8ces-jointes"},imagePath:{desc:"Utilisez la structure de dossier Obsidian ou configurer un dossier par d\xE9faut ci-dessous",title:"Structure"},links:{desc:"Permet d'\xE9diter les liens des embeds, en supprimant enti\xE8rement la citation, ou en la transformant en un simple lien.",dp:{bake:"Inclure le contenu des embeds",keep:"Pas de changement",links:"Transformer en lien simple",remove:"Supprimer le lien compl\xE8tement"},title:"Changer les balises d'embed"},notes:"Note (Markdown)",overrides:{desc:"Permet d'envoyer une pi\xE8ce jointe dans un chemin sp\xE9cifique et de forcer les pi\xE8ces jointes \xE0 \xEAtre pouss\xE9es.",modal:{dest:"Destination",path:"Chemin ou extension",title:"Remplacer le chemin des pi\xE8ces jointes"}},title:"Pi\xE8ces-jointes & Embeds",transferImage:{title:"Envoyer les pi\xE8ces-jointes int\xE9gr\xE9es dans un fichier dans le d\xE9p\xF4t."},transferMetaFile:{desc:"Permet d'envoyer des fichiers en utilisant une cl\xE9 propri\xE9t\xE9s/dataview. S\xE9parer les champs par une virgule.",title:"Envoyer des fichiers en utilisant une cl\xE9 propri\xE9t\xE9s/dataview"},transferNotes:{desc:"Envoyer les notes int\xE9gr\xE9es dans un fichier publi\xE9 dans le d\xE9p\xF4t. Seul les fichiers publi\xE9s seront envoy\xE9s !",title:"Transf\xE9rer les notes int\xE9gr\xE9es"}},github:{apiType:{desc:"Choisir entre l'API GitHub ou l'API pour GitHub Entreprise (uniquement pour les utilisateurs de GitHub Enterprise \u2014 Utilisateur avanc\xE9 !).",dropdown:{enterprise:"Entreprise",free:"Free/Pro/Team (d\xE9faut)"},hostname:{desc:"Le nom de l'instance Github de votre entreprise.",title:"Instance Github Entreprise"},title:"Type d'API"},automaticallyMergePR:"Fusionner automatiquement les pull-request",branch:{desc:'Dans le cas o\xF9 vous souhaitez utiliser une branche diff\xE9rente de "main".',title:"Branche principale"},ghToken:{button:{configDir:" : Le dossier de configuration d'Obsidian",default:"Par d\xE9faut, il sera dans :",description:"Vous pouvez \xE9diter le chemin du fichier dans lequel sera stock\xE9 le token.",pluginID:" : L'ID du plugin",tooltip:"Modifier le chemin du fichier contenant le token",variables:"Vous pouvez utiliser les variables suivantes :"},desc:"Un token GitHub avec autorisation de d\xE9p\xF4t. Vous pouvez le g\xE9n\xE9rer ",error:"Le token ne doit pas \xEAtre vide !"},repoName:{desc:"Le nom du d\xE9p\xF4t dans lequel vos fichiers seront transf\xE9r\xE9s.",placeholder:"mkdocs-template",title:"Nom du d\xE9p\xF4t"},smartRepo:{button:"G\xE9rer plus de d\xE9p\xF4t",modals:{default:'Le nom "default" est r\xE9serv\xE9 pour votre configuration principale.',desc:`Ces "autres d\xE9p\xF4ts" vous permettent d'utiliser toutes les commandes sur les d\xE9p\xF4ts ajout\xE9s ci-dessous.`,duplicate:"Les smartKey doivent \xEAtre uniques !",empty:"Les smartkeys ne peuvent pas \xEAtre vide",frontmatterInfo:`L'utilisation de la cl\xE9 propri\xE9t\xE9 "shortRepo" avec la "smartKey" permet \xE9galement d'utiliser ce d\xE9p\xF4t dans un fichier sans avoir \xE0 \xE9crire son chemin.`,newRepo:"un nouveau d\xE9p\xF4t",otherConfig:"Autres param\xE8tres",shortcuts:{desc:"Ajoute toutes les commandes de ce d\xE9p\xF4t dans la palette de commandes",title:"Raccourci"},title:"G\xE9rer d'autres d\xE9p\xF4ts"}},testConnection:"Tester la connexion",title:"Configuration GitHub",username:{desc:"Votre username sur GitHub.",title:"Nom d'utilisateur GitHub"}},githubWorkflow:{autoCleanUp:{desc:"Si le plugin doit supprimer de votre d\xE9p\xF4t les fichiers d\xE9publi\xE9s (arr\xEAt du partage ou suppression).",title:"Auto-nettoyage"},excludedFiles:{desc:"Si vous voulez exclure certains dossier ou fichier du nettoyage automatique, d\xE9finissez leur chemin. Les regex sont accept\xE9es en les encadrant par des slashs. S\xE9parer les valeurs par une virgule.",title:"fichiers et dossier exclus"},githubAction:{desc:"Si vous souhaitez activer une action GitHub lorsque le plugin push les fichiers dans le d\xE9p\xF4t, il vous faut indiquer le nom du fichier issus du dossier .github/workflows/. Seules les actions activ\xE9es par un workflow_dispatch sont activ\xE9es.",title:"Nom de l'action GitHub"},prRequest:{desc:"Le message envoy\xE9 lorsque la pull-request est fusionn\xE9e. Sera toujours suivi par le num\xE9ro de la pull-request.",error:"Vous ne pouvez pas utiliser une valeur vide pour le message de commit.",title:"Message de commit"},useMetadataExtractor:{desc:"Envoyer les fichiers g\xE9n\xE9r\xE9s par metadata-extractor dans ce dossier.",title:"Fichier de metadata-extractor"}},help:{frontmatter:{attachment:{folder:"Change le dossier par d\xE9faut pour les pi\xE8ces-jointes.",send:"Envoie toutes les pi\xE8ces-jointes dans le d\xE9p\xF4t GitHub."},autoclean:"D\xE9sactive ou active le nettoyage automatique du d\xE9p\xF4t GitHub.",baselink:{desc:"Change le lien de base pour la commande de copie de lien. D\xE9sactive aussi la suppression de partie de lien. Peut \xEAtre utilis\xE9e en tant qu'objet sous le nom de ",remove:"Supprime les parties de lien. \xC0 mettre sous forme de liste !"},convert:{enableOrDisable:"Active ou d\xE9sactive la conversion des liens. En d\xE9sactivant cette option, vous supprimez les",syntax:"syntaxes, tout en gardant le nom du fichier ou son text alternatif."},dataview:"Convertit les requ\xEAtes dataview en markdown.",desc:"Il existe quelques cl\xE9s de propri\xE9t\xE9s qui peuvent vous \xEAtes utile. Le code ci-dessous montre les param\xE8tres par d\xE9faut, mais n'h\xE9sitez pas \xE0 le modifier selon vos besoins pour chaque note !",embed:{char:'Ajoutez un ou plusieurs caract\xE8res avant les liens. Utiliser uniquement si vous avez fix\xE9 "remove" \xE0 "links".',remove:{bake:"Inclure le contenu des embeds (blocs de support, titre et fichier entier)",desc:"Modifie l'aspect des liens des notes incorpor\xE9es. Peut prendre les valeurs suivantes :",keep:"Laisse comme dans Obsidian",links:"Convertit le lien vers la note incorpor\xE9e en lien simple",remove:"Supprime le lien compl\xE8tement et laisse une ligne vide"},send:"Envoie les notes int\xE9gr\xE9es de la note publi\xE9es dans le d\xE9p\xF4t. Seules les notes partag\xE9es seront envoy\xE9es !"},hardBreak:'Convertit tous les sauts de lignes en "hard break" markdown.',internals:"Convertit les liens internes vers leur homologue du d\xE9p\xF4t, sous forme de liens relatifs. D\xE9sactiv\xE9s, les liens seront conserv\xE9s tels quels.",mdlinks:"Convertir tous les liens [[wikilinks]] en [liens](Markdown)",nonShared:"Convertit les liens internes pointant vers une notes non publi\xE9es vers son futur homologue. D\xE9sactiv\xE9, le plugin conservera le nom du fichier ou son texte alternatif.",path:"Vous pouvez \xE9craser tous les param\xE8tres de chemins en utilisant cette cl\xE9. Le chemin sera cr\xE9\xE9e \xE0 partir de la racine du d\xE9p\xF4t.",repo:{branch:"Nom de la branche",desc:"Changer le d\xE9p\xF4t GitHub pour cette note",owner:"Pseudo GitHub du propri\xE9taire du d\xE9p\xF4t"},share:{other:"Vous pouvez \xE9galement utiliser une autre shareKey bas\xE9e sur la cl\xE9 d\xE9finie dans \xAB G\xE9rer plus de d\xE9p\xF4t \xBB. Cela vous permet de s\xE9parer vos diff\xE9rents d\xE9p\xF4ts. Si vous utilisez les cl\xE9s principales et secondaires, le d\xE9p\xF4t principal sera utilis\xE9.",title:"La cl\xE9 utilis\xE9e pour partager une note"},shortRepo:"Autorise l'utilisation de l'un des d\xE9p\xF4ts d\xE9finis dans les param\xE8tres",title:"Aide-m\xE9moire des propri\xE9t\xE9s",titleKey:"Change le titre de la note"},multiRepoHelp:{desc:"Si vous souhaitez envoyer vos notes dans plusieurs d\xE9p\xF4t en m\xEAme temps, vous pouvez utiliser la cl\xE9 ",desc2:"dans vos propri\xE9t\xE9s. La valeur de cette cl\xE9 doit \xEAtre une liste. Chaque d\xE9p\xF4t doit avoir les cl\xE9s suivantes :",exampleDesc:"Le code ci-dessous montre un exemple bas\xE9 sur vos param\xE8tres.",title:"Envoie dans plusieurs d\xE9p\xF4t"},title:"Aide",usefulLinks:{discussion:"Discussion",documentation:"Documentation (en anglais)",issue:"Issue",links:"https://obsidian-publisher.netlify.app",title:"Liens utiles"}},overrides:{},plugin:{copyLink:{baselink:{desc:'Permet de cr\xE9er un lien dans le presse-papier avec cette base. Par d\xE9faut : "https://username.github.io/repo/"',title:"Lien du d\xE9p\xF4t/blog"},command:{desc:"Ajouter une commande permettant de copier le lien de la note publi\xE9e dans le presse-papier (n\xE9cessite de recharger le plugin pour prendre effet)"},desc:"Envoie d'un lien vers la note publi\xE9es dans votre presse-papier.",linkPathRemover:{desc:"Supprimer cette partie des liens cr\xE9\xE9s. S\xE9parer par une virgule si plusieurs valeurs doivent \xEAtre supprim\xE9es.",title:"Suppression d'une partie du lien"},title:"Copie de lien"},dev:{desc:'Utilisateur avanc\xE9 seulement. Affichera sous forme de "Notice" selon le param\xE8tre pr\xE9c\xE9dents.',title:"Affiche les logs d\xE9veloppeurs"},editorMenu:{desc:"Ajouter une commande de partage dans le menu du clic droit.",title:'Menu "Edition"'},embedEditRepo:{desc:"Permet d'afficher la liste des fichiers \xE9diter, ajout\xE9, supprim\xE9... Du d\xE9p\xF4t principal (dans un modal).",title:"Afficher les \xE9ditions sur le d\xE9p\xF4t"},excludedFolder:{desc:`Les fichiers dans ses dossiers ne seront jamais publi\xE9s, quelle que soit l'\xE9tat de la cl\xE9 de partage. S\xE9parez les noms de dossier par une virgule. Les regex sont support\xE9s en les encadrant par "//"`,title:"Dossiers exclus"},fileMenu:{desc:'Ajouter une commande de partage dans le menu "Fichier"',title:'Menu "Fichier"'},head:{copyLinks:"Cr\xE9ation et copie de liens",log:"Logs",menu:"Menu",other:"Autres",share:"Partage & cl\xE9 de partage"},logNoticeHeader:{desc:"Sur mobile, il peut \xEAtre difficile de debug le module. Activer cette option pour notifier toutes les erreurs via une notification Obsidian.",title:"Notifier toutes les erreurs"},saveTab:{desc:"Permet de rouvrir les param\xE8tres sur l'onglet pr\xE9c\xE9demment utilis\xE9",title:"Sauvegarder l'onglet"},shareKey:{all:{desc:"Autoriser le partage de tous les fichiers et ignorer l'\xE9tat de la cl\xE9 de partage",title:"Partager tous les fichiers sans cl\xE9 de partage"},desc:"Cl\xE9 de partage",excludedFileName:{title:"Exclure les fichiers dont le nom commence par ..."},otherRepo:"Vous pouvez \xE9galement d\xE9finir une cl\xE9 de partage pour s\xE9parer avec des autres, sans utiliser la cl\xE9 shortRepo.",title:"La cl\xE9 de propri\xE9t\xE9 pour publier la note sur le d\xE9p\xF4t."},title:"Param\xE8tres du plugin"},regexReplacing:{empty:"Le remplacement peut \xEAtre vide pour supprimer l'ensemble de la cha\xEEne de caract\xE8re.",emptyRegex:"La valeur \xE0 remplacer ne peut pas \xEAtre vide",forbiddenValue:"Le {{- what}} ne peut contenir le caract\xE8re : {{- forbiddenChar}}.",inCodeBlocks:{runIn:"Lanc\xE9 dans les bloc de code",runOut:"N'est pas lanc\xE9 dans les bloc de codes"},invalidRegex:"Une erreur est survenue : {{- e}}",modal:{desc:'Replace des textes dans le fichier par la valeur donn\xE9e. Vous pouvez encadrer le texte \xE0 remplacer avec "//" pour utiliser un regex.',force:"Forcer l'envoi",keywords:"Mots cl\xE9s",name:"Utiliser {{name}} pour utiliser le nom du fichier.",title:{all:"Remplacement du nom ou du chemin du fichier",only:"Remplacement du titre uniquement",text:"Remplacement de texte"}},momentReplaceRegex:"Ex\xE9cuter le remplacement {{- moment}} les autres conversions (dataview, liens internes...)",warningPath:'Attention ! Utiliser le caract\xE8re "/" modifiera le chemin du fichier. Veuillez faire attention avec cette option.'},upload:{defaultFolder:{desc:"D\xE9finir le dossier de r\xE9ception par d\xE9faut. Laisser vide pour utiliser la racine du d\xE9p\xF4t.",placeholder:"docs",title:"Dossier par d\xE9faut"},folderBehavior:{desc:"Choisir la hi\xE9rarchie des dossiers dans le d\xE9p\xF4t, en se basant sur une cl\xE9 frontmatter, un dossier fixe ou la hi\xE9rarchie des dossiers dans Obsidian.",fixedFolder:"Dossier fix\xE9",obsidianPath:"Chemin Obsidian",title:"Hi\xE9rarchie des dossiers",yaml:"Valeur d'une cl\xE9 de propri\xE9t\xE9"},folderNote:{addTitle:{key:'Utiliser une autre cl\xE9 que "title"',title:'Ajouter automatiquement la cl\xE9 "title" avec le nom du fichier'}},frontmatterKey:{desc:"D\xE9finir le nom de la cl\xE9 o\xF9 obtenir le dossier",placeholder:"category",title:"Cl\xE9 de propri\xE9t\xE9"},regexFilePathTitle:{desc:'Si le texte est entre "//", il sera interpr\xE9t\xE9 comme une expression r\xE9guli\xE8re. Sinon, il sera interpr\xE9t\xE9 comme du texte brut.',title:{FolderPathTitle:"\xC9diter le titre et le chemin du dossier (automatiquement)",titleOnly:"\xC9diter le titre (automatiquement)"}},rootFolder:{desc:"Ajouter ce chemin au dossier d\xE9finit par la cl\xE9 de propri\xE9t\xE9.",other:"Utilisez ce dossier comme racine dans le r\xE9f\xE9rentiel (chaque chemin sera pr\xE9c\xE9d\xE9 de ce nom).",title:"Dossier racine"},title:"Chemins des fichiers",useFrontmatterTitle:{desc:'Utiliser un champ des propri\xE9t\xE9s pour g\xE9n\xE9rer le nom du fichier. Par d\xE9faut, "title" est utilis\xE9.',title:"Utiliser une cl\xE9 de propri\xE9t\xE9 pour d\xE9finir le titre"}}},nc={counter:"{{- msg}} : {{- counter}}/{{- nb}}",loading:"Chargement en cours...",markedForSharing:"{{- nb}} {{- type}} \xE0 partager",sharing:"Partage de {{- type}}",success:"{{- type}} {{- action}}"},wp={commands:Ku,common:zu,deletion:Zu,error:Yu,informations:Ju,modals:Qu,publish:Xu,regex:ec,settings:tc,statusBar:nc};var yr={en:{translation:mr},fr:{translation:gr}},Dr=Object.keys(yr).find(t=>t==br.moment.locale())?br.moment.locale():"en";var A=q(require("obsidian"));var wr=q(require("obsidian"));function U(t,e,n=!0){return n&&e.createEl("br"),e.createEl("span",{text:t,cls:["token","key","atrule"]})}function Ie(t,e){let n=t?"true":"false";return e.createEl("span",{text:n,cls:["token","boolean","important"]})}function Fp(t,e){return e.createEl("span",{text:t,cls:["token","comment"]})}function De(t,e){return e.createEl("span",{text:t,cls:["token","string"]})}function vp(t,e){if(t.upload.behavior===W.yaml){let n=t.upload.defaultName.length>0?`${t.upload.defaultName}`:"/";return{rule:U(t.upload.yamlFolderKey.length>0?`${t.upload.yamlFolderKey}: `:"category: ",e),token:De((0,wr.normalizePath)(n),e)}}}function ic(t){let e=document.createDocumentFragment(),n=t.upload.defaultName.length>0?`${t.upload.defaultName}`:"/",i=`${n}/file.md`;t.upload.behavior===W.yaml&&(i=`${t.upload.rootFolder.length>0?t.upload.rootFolder:""}/${n}/file.md`),i=(0,wr.normalizePath)(Sn(i,t)),U(`${t.plugin.shareKey}: `,e,!1),Ie(!0,e),vp(t,e),U("path: ",e),De(i,e),Fp(" #given as an example path",e),U("links: ",e),U(" mdlinks: ",e),Ie(t.conversion.links.wiki,e),U(" convert: ",e),Ie(!0,e),U(" internals: ",e),Ie(t.conversion.links.internal,e),U(" nonShared: ",e),Ie(t.conversion.links.unshared,e),U("embed: ",e),U(" send: ",e),Ie(t.embed.notes,e),U(" remove: ",e),De(t.embed.convertEmbedToLinks,e),U(" char: ",e),De(t.embed.charConvert,e),U("attachment: ",e),U(" send: ",e),Ie(t.embed.attachments,e),U(" folder: ",e),De(t.embed.folder,e),U("dataview: ",e),Ie(t.conversion.dataview,e),U("hardBreak: ",e),Ie(t.conversion.hardbreak,e),t.github.otherRepo.length>0&&(U("shortRepo: ",e),De(t.github.otherRepo[0].smartKey.length>0?t.github.otherRepo[0].smartKey:"smartkey",e)),U("repo: ",e),U(" owner: ",e),De(t.github.user,e),U(" repo: ",e),De(t.github.repo,e),U(" branch: ",e),De(t.github.branch,e),U(" autoclean: ",e),Ie(t.upload.autoclean.enable,e),U("copylink: ",e),U(" base: ",e),De(t.plugin.copyLink.links.length>0?t.plugin.copyLink.links:`https://${t.github.repo}.github.io/${t.github.repo}`,e);let s=t.plugin.copyLink.removePart.map(r=>`"${r}"`).join(", ");return s.length>0&&(U(" remove: ",e),De(s,e)),e}function sc(t){let e=document.createDocumentFragment();return e.createEl("ul",void 0,n=>{n.createEl("li",void 0,i=>{i.createEl("code",{text:`${t.plugin.shareKey}:`,cls:"code-title"}),i.createEl("span",{text:`${u.t("settings.help.frontmatter.share.title")}`}),i.createEl("ul",void 0,s=>{s.createEl("span",{text:u.t("settings.help.frontmatter.share.other")})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"path:",cls:"code-title"}),i.createEl("span",{text:` ${u.t("settings.help.frontmatter.path")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"links:",cls:"code-title"})}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"mdlinks"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.mdlinks")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"convert"}),s.createEl("span",void 0,r=>{r.createEl("span",{text:`: ${u.t("settings.help.frontmatter.convert.enableOrDisable")} `}),r.createEl("code",{text:" [[link]] "}),r.createEl("span",{text:u.t("common.or")}),r.createEl("code",{text:" [](link) "}),r.createEl("span",{text:u.t("settings.help.frontmatter.convert.syntax")})})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"internals"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.internals")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"nonShared"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.nonShared")}`})})}),n.createEl("li",{text:"embed:",cls:"code code-title"}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"send"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.send")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"remove"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.remove.desc")}`}),s.createEl("ul",void 0,r=>{r.createEl("li",void 0,a=>{a.createEl("code",{text:"remove | true"}),a.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.remove.remove")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"keep | false"}),a.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.remove.keep")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"links"}),a.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.remove.links")}`})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"bake"}),a.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.remove.bake")}`})})})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"char"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.embed.char")}`})})}),n.createEl("li",{text:"attachment:",cls:"code code-title"}),n.createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"send"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.attachment.send")}`})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"folder"}),s.createEl("span",{text:`: ${u.t("settings.help.frontmatter.attachment.folder")}`})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"dataview",cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.dataview")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"hardbreak",cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.hardBreak")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"shortRepo",cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.shortRepo")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"repo",cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.repo.desc")}`}),i.createEl("ul",void 0,s=>{s.createEl("li",void 0,r=>{r.createEl("code",{text:"owner"}),r.createEl("span",{text:`: ${u.t("settings.help.frontmatter.repo.owner")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"repo"}),r.createEl("span",{text:`: ${u.t("settings.github.repoName.title")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"branch"}),r.createEl("span",{text:`: ${u.t("settings.help.frontmatter.repo.branch")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"autoclean"}),r.createEl("span",{text:`: ${u.t("settings.help.frontmatter.autoclean")}`})})})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:`${t.upload.frontmatterTitle.key}`,cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.titleKey")}`})}),n.createEl("li",void 0,i=>{i.createEl("code",{text:"baseLink",cls:"code-title"}),i.createEl("span",{text:`: ${u.t("settings.help.frontmatter.baselink.desc")}`}),i.createEl("code",{text:"copylink:",cls:"code-title"}),i.createEl("ul",void 0,s=>{s.createEl("li",void 0,r=>{r.createEl("code",{text:"base"}),r.createEl("span",{text:`: ${u.t("settings.plugin.copyLink.baselink.title")}`})}),s.createEl("li",void 0,r=>{r.createEl("code",{text:"remove"}),r.createEl("span",{text:`: ${u.t("settings.help.frontmatter.baselink.remove")}`})})})})}),e}function rc(){let t=document.createDocumentFragment();return t.createEl("ul",void 0,e=>{e.createEl("li",void 0,n=>{n.createEl("a",{text:u.t("settings.help.usefulLinks.documentation"),href:u.t("settings.help.usefulLinks.links")})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:u.t("common.repository"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher"})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:u.t("settings.help.usefulLinks.issue"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher/issues"})}),e.createEl("li",void 0,n=>{n.createEl("a",{text:u.t("settings.help.usefulLinks.discussion"),href:"https://github.com/ObsidianPublisher/obsidian-github-publisher/discussions"})})}),t}function ac(t){let e=document.createDocumentFragment();e.createEl("p",void 0,i=>{i.createEl("span",{text:u.t("settings.help.multiRepoHelp.desc")}),i.createEl("code",{text:"multipleRepo"}),i.createEl("span",{text:` ${u.t("settings.help.multiRepoHelp.desc2")}:`}),i.createEl("ul",void 0,s=>{s.createEl("li",{text:"owner"}).addClass("code"),s.createEl("li",{text:"repo"}).addClass("code"),s.createEl("li",{text:"branch"}).addClass("code"),s.createEl("li",{text:"autoclean"}).addClass("code")}),i.createEl("span",{text:u.t("settings.help.multiRepoHelp.exampleDesc")})});let n=document.createDocumentFragment();return U("multipleRepo: ",n,!1),U(" - owner: ",n),De(t.github.user,n),U(" repo: ",n),De(t.github.repo,n),U(" branch: ",n),De(t.github.branch,n),U(" autoclean: ",n),Ie(!1,n),U(" - owner: ",n),De(t.github.user,n),U(" repo: ",n),De("my_second_blog",n),U(" branch: ",n),De("master",n),U(" autoclean: ",n),Ie(!1,n),e.createEl("pre",{cls:"language-yaml"}).createEl("code",{text:n,cls:"language-yaml"}),e}function oc(){let t=document.createDocumentFragment();return t.createEl("p",void 0,e=>{e.createEl("a",void 0,n=>{n.createEl("img",void 0,i=>{i.setAttr("src","https://storage.ko-fi.com/cdn/kofi2.png?v=3"),i.setAttr("alt","Buy Me A Coffee"),i.setAttr("style","height: 60px !important;width: 217px !important;")}),n.setAttr("href","https://ko-fi.com/lisandra_dev")}),e.setAttr("style","text-align: center;")}),t}function is(t,e,n){return m(this,null,function*(){e.settings.plugin.migrated&&!n||(yield Tp(e,t),yield xp(e),yield Ep(e),yield kp(e),yield Cp(e),yield Lt(e),yield Sp(e),e.settings.plugin.migrated=!0,yield e.saveSettings())})}function xp(t){return m(this,null,function*(){t.settings.upload.replaceTitle instanceof Array||(R({settings:t.settings},u.t("informations.migrating.fileReplace")),t.settings.upload.replaceTitle=[t.settings.upload.replaceTitle],yield t.saveSettings())})}function Ep(t){return m(this,null,function*(){t.settings.upload.subFolder&&!t.settings.upload.replacePath.find(e=>e.regex==="/"+t.settings.upload.subFolder)&&(R({settings:t.settings},u.t("informations.migrating.subFolder")),t.settings.upload.subFolder.length>0&&t.settings.upload.replacePath.push({regex:"/"+t.settings.upload.subFolder,replacement:"",type:ke.path}),delete t.settings.upload.subFolder,yield t.saveSettings())})}function kp(t){return m(this,null,function*(){for(let e of t.settings.conversion.censorText)e.flags&&(e.entry="/"+e.entry+"/"+e.flags,delete e.flags,yield t.saveSettings())})}function Cp(t){return m(this,null,function*(){if(R({settings:t.settings},"Migrating workflow"),!t.settings.github.worflow)return;let e=t.settings.github.worflow;t.settings.github.workflow={name:e.workflowName,commitMessage:e.customCommitMsg},delete t.settings.github.worflow,yield t.saveSettings()})}function Lt(t,e){return m(this,null,function*(){R({settings:t.settings},"migrating token");let n=Jt(t,t.settings.github.tokenPath);if(t.settings.github.token&&!e&&(R({settings:t.settings},`Moving the GitHub Token in the file : ${n}`),e=t.settings.github.token,delete t.settings.github.token,yield t.saveSettings()),e!==void 0)if(R({settings:t.settings},`Moving the GitHub Token in the file : ${n}`),n.endsWith(".json")){let i={GITHUB_PUBLISHER_TOKEN:e};yield t.app.vault.adapter.write(n,JSON.stringify(i))}else{let i=`GITHUB_TOKEN=${e}`;yield t.app.vault.adapter.write(n,i)}})}function Sp(t){return m(this,null,function*(){var n,i,s,r,a,o;R({settings:t.settings},"Configuring other repositories");let e=(i=(n=t.settings.github)==null?void 0:n.otherRepo)!=null?i:[];for(let l of e){let c={name:(r=(s=t.settings.github.worflow)==null?void 0:s.workflowName)!=null?r:t.settings.github.workflow.name,commitMessage:(o=(a=t.settings.github.worflow)==null?void 0:a.customCommitMsg)!=null?o:t.settings.github.workflow.commitMessage};if(l.workflow||(l.workflow=c,yield t.saveSettings()),l.worflow){let d=l.worflow;d.workflowName&&(l.workflow.name=d.workflowName),d.customCommitMsg&&(l.workflow.commitMessage=d.customCommitMsg),delete l.worflow,yield t.saveSettings()}l.copyLink||(l.copyLink={links:"",removePart:[]},yield t.saveSettings())}})}function Tp(t,e){return m(this,null,function*(){var i,s;if(!Object.keys(e).includes("editorMenu"))return;R({settings:t.settings},u.t("informations.migrating.oldSettings")),t.settings={github:{user:e.githubName?e.githubName:t.settings.github.user?t.settings.github.user:"",repo:e.githubRepo?e.githubRepo:t.settings.github.repo?t.settings.github.repo:"",branch:e.githubBranch,automaticallyMergePR:e.automaticallyMergePR,tokenPath:dt,api:{tiersForApi:e.tiersForApi,hostname:e.hostname},workflow:{name:e.workflowName,commitMessage:(s=(i=e.customCommitMsg)!=null?i:t.settings.github.workflow.commitMessage)!=null?s:"[PUBLISHER] MERGE"},otherRepo:[],rateLimit:0,verifiedRepo:!1},upload:{behavior:e.downloadedFolder,defaultName:e.folderDefaultName,rootFolder:e.rootFolder,yamlFolderKey:e.yamlFolderKey,frontmatterTitle:{enable:e.useFrontmatterTitle,key:e.frontmatterTitleKey},replaceTitle:[{regex:e.frontmatterTitleRegex,replacement:e.frontmatterTitleReplacement,type:ke.title}],replacePath:[{regex:e.subFolder,replacement:"",type:ke.path}],autoclean:{enable:e.autoCleanUp,excluded:e.autoCleanUpExcluded},folderNote:{enable:e.folderNote,rename:e.folderNoteRename,addTitle:{enable:e.folderNote,key:e.frontmatterTitleKey}},metadataExtractorPath:e.metadataExtractorPath},conversion:{hardbreak:e.hardBreak,dataview:e.migrateDataview,censorText:e.censorText,tags:{inline:e.inlineTags,exclude:e.excludeDataviewValue,fields:e.dataviewFields},links:{internal:e.migrateForGithub,unshared:e.migrateInternalNonShared,wiki:e.migrateWikiLinks,slugify:!1}},embed:{forcePushAttachments:[],attachments:e.embedImage,keySendFile:e.metadataFileFields,notes:e.embedNotes,folder:e.defaultImageFolder,charConvert:"->",convertEmbedToLinks:"keep"},plugin:{shareKey:e.shareKey,fileMenu:e.fileMenu,editorMenu:e.editorMenu,excludedFolder:e.excludedFolder,copyLink:{enable:e.copyLink,links:e.mainLink,removePart:e.linkRemover.split(/[,\n]\W*/).map(r=>r.trim()),addCmd:!1},noticeError:e.logNotice,displayModalRepoEditing:!1}};let n=e.GhToken?e.GhToken:t.settings.github.token?t.settings.github.token:"";yield Lt(t,n),yield t.saveSettings()})}var ue=q(require("obsidian"));function Fr(t){return JSON.parse(JSON.stringify(t))}var vr=class extends ue.Modal{constructor(e,n,i,s){super(e);this.plugin=n,this.settingsPage=i,this.settingsTab=s}censorRepositoryData(e){return m(this,null,function*(){R({settings:e},"original settings:",e),this.plugin.settings.plugin=e.plugin,this.plugin.settings.github.repo=e.github.repo,this.plugin.settings.github.user=e.github.user,this.plugin.settings.github.otherRepo=e.github.otherRepo,yield this.plugin.saveSettings()})}onOpen(){let{contentEl:e}=this;new ue.Setting(e).setName(u.t("modals.import.title")).setDesc(u.t("modals.import.desc")),new ue.Setting(e).then(n=>{let i=createSpan({cls:"github-publisher-import-error",text:u.t("modals.import.error.span")});n.nameEl.appendChild(i);let s=a=>m(this,null,function*(){if(a)try{let o=JSON.parse(a);if(Object.keys(o).includes("editorMenu"))yield is(o,this.plugin,!0),R({settings:this.plugin.settings},u.t("informations.migrating.oldSettings"));else{R({settings:this.plugin.settings},u.t("informations.migrating.normalFormat")),o=o;let l=Fr(this.plugin.settings);o.upload.replaceTitle instanceof Array||(o.upload.replaceTitle=[o.upload.replaceTitle]);for(let[c,d]of Object.entries(o))this.plugin.settings[c]=d;yield this.censorRepositoryData(l),yield this.plugin.saveSettings()}this.close()}catch(o){i.addClass("active"),i.setText(`${u.t("modals.import.error.span")}${o}`)}else i.addClass("active"),i.setText(`${u.t("modals.import.error.span")}: ${u.t("modals.import.error.isEmpty")}`)});n.controlEl.createEl("input",{cls:"github-publisher-import-input",attr:{id:"github-publisher-import-input",name:"github-publisher-import-input",type:"file",accept:".json"}},a=>{a.addEventListener("change",o=>{let l=new FileReader;l.onload=c=>m(this,null,function*(){yield s(c.target.result.toString().trim())}),l.readAsText(o.target.files[0])})}),n.controlEl.createEl("label",{cls:"github-publisher-import-label",text:u.t("modals.import.importFromFile"),attr:{for:"github-publisher-import-input"}}),new ue.TextAreaComponent(e).setPlaceholder(u.t("modals.import.paste")).then(a=>{new ue.ButtonComponent(e).setButtonText(u.t("common.save")).onClick(()=>m(this,null,function*(){yield s(a.getValue().trim())})).buttonEl.addClass("github-publisher-import-save-button")}).inputEl.addClass("github-publisher-import-textarea")})}onClose(){var i;let{contentEl:e}=this;e.empty(),this.settingsPage.empty();let n=((i=this.plugin.settings.tabsID)!=null?i:document.querySelector(".settings-tab.settings-tab-active"))?document.querySelector(".settings-tab.settings-tab-active .settings-tab-name").innerText:u.t("settings.github.title");switch(n=n.trim(),n){case u.t("settings.github.title"):this.settingsTab.renderGithubConfiguration();break;case u.t("settings.upload.title"):this.settingsTab.renderUploadConfiguration();break;case u.t("settings.conversion.title"):this.settingsTab.renderTextConversion();break;case u.t("settings.embed.title"):this.settingsTab.renderEmbedConfiguration();break;case u.t("settings.plugin.title"):this.settingsTab.renderPluginSettings();break;case u.t("settings.help.title"):this.settingsTab.renderHelp();break}}},xr=class extends ue.Modal{constructor(e,n){super(e);this.plugin=n}censorGithubSettingsData(e){let n=Object(e),{github:i}=n;return n.tabsID&&delete n.tabsID,i&&(delete i.repo,delete i.user,delete i.otherRepo,delete i.rateLimit),delete n.plugin,n}onOpen(){let{contentEl:e,modalEl:n}=this;n.addClass("modal-github-publisher"),new ue.Setting(e).setName(u.t("modals.export.title")).setDesc(u.t("modals.export.desc")).then(i=>{let s=this.censorGithubSettingsData(Fr(this.plugin.settings)),r=JSON.stringify(s,null,2);i.controlEl.createEl("a",{cls:"github-publisher-copy",text:u.t("modals.export.copy"),href:"#"},a=>{new ue.TextAreaComponent(e).setValue(r).then(l=>{a.addEventListener("click",c=>{c.preventDefault(),l.inputEl.select(),l.inputEl.setSelectionRange(0,99999),document.execCommand("copy"),a.addClass("success"),setTimeout(()=>{a.parentNode&&a.removeClass("success")},2e3)})}).inputEl.addClass("github-publisher-export-textarea")}),ue.Platform.isDesktop?i.controlEl.createEl("a",{cls:"github-publisher-download",text:u.t("modals.export.download"),attr:{download:"github-publisher.json",href:`data:application/json;charset=utf-8,${encodeURIComponent(r)}`}}):ue.Platform.isMobile&&i.addButton(a=>a.setButtonText(u.t("modals.export.download")).onClick(()=>{this.app.vault.adapter.write(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`,r),this.app.openWithDefaultApp(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`)}))})}onClose(){try{this.app.vault.adapter.trashSystem(`${this.app.vault.configDir}/plugins/obsidian-mkdocs-publisher/._tempSettings.json`)}catch(n){R({settings:this.plugin.settings},"Error while deleting temporary file",n)}let{contentEl:e}=this;e.empty()}},Er=class extends ue.FuzzySuggestModal{constructor(e,n,i,s,r){super(e);this.plugin=n,this.presetList=i,this.octokit=s,this.page=r,this.settings=n.settings}getItems(){return this.presetList}getItemText(e){return e.name}onChooseItem(e,n){let i=e.settings;R({settings:i},"onChooseItem");try{let s=Fr(this.plugin.settings);i.upload.replaceTitle instanceof Array||(i.upload.replaceTitle=[i.upload.replaceTitle]);for(let[r,a]of Object.entries(i))this.settings[r]=a;this.settings.plugin=s.plugin,this.settings.github.repo=s.github.repo,this.settings.github.user=s.github.user,this.settings.github.otherRepo=s.github.otherRepo,this.settings.github.rateLimit=s.github.rateLimit,this.settings.tabsID=s.tabsID,this.plugin.saveSettings(),this.page.renderSettingsPage("github-configuration")}catch(s){new ue.Notice(u.t("modals.import.error.span")+s),_({settings:this.settings},"onChooseItem",s)}}};function lc(t,e){return m(this,null,function*(){let n=yield t.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:"ObsidianPublisher",repo:"plugin-presets",path:"presets"}),i=[];if(!Array.isArray(n.data))return i;R({settings:e.settings},"LoadAllPreset",n);for(let s of n.data)if(s.name.endsWith(".json")){let r=s.name.replace(".json","");i.push({name:r,settings:yield Pp(s.path,t,e)})}return i})}function Pp(t,e,n){return m(this,null,function*(){var r;let i=yield e.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:"ObsidianPublisher",repo:"plugin-presets",path:t});if(!((r=i.data)==null?void 0:r.content))return n.settings;let s=atob(i.data.content);return JSON.parse(s)})}var Z=q(require("obsidian"));var kr=class extends Z.Modal{constructor(e,n,i,s,r,a){super(e);this.settings=n,this.repository=r,this.plugin=s,this.onSubmit=a,this.branchName=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","manage-repo","add"]),e.createEl("h2",{text:u.t("settings.github.smartRepo.modals.title")}),e.createEl("p",{text:u.t("settings.github.smartRepo.modals.desc")}),e.createEl("p",{text:u.t("settings.github.smartRepo.modals.frontmatterInfo")}),e.createEl("p",{text:u.t("settings.plugin.shareKey.otherRepo")});let n={smartKey:"smartkey",user:this.settings.github.user,repo:this.settings.github.repo,branch:this.settings.github.branch,automaticallyMergePR:this.settings.github.automaticallyMergePR,api:{tiersForApi:this.settings.github.api.tiersForApi,hostname:this.settings.github.api.hostname},workflow:{commitMessage:this.settings.github.workflow.commitMessage,name:""},createShortcuts:!1,shareKey:this.settings.plugin.shareKey,copyLink:{links:this.settings.plugin.copyLink.links,removePart:[]}};new Z.Setting(e).setClass("max-width").setClass("display-none").addButton(i=>{i.setButtonText(u.t("common.add",{things:u.t("settings.github.smartRepo.modals.newRepo").toLowerCase()})).onClick(()=>{this.repository.push(n),this.onOpen()})});for(let i of this.repository){let s=new Z.Setting(e).setClass("max-width").setClass("display-none").addText(r=>{r.setPlaceholder("smartKey").setValue(i.smartKey).onChange(a=>{i.smartKey=a.toLowerCase(),s.controlEl.setAttribute("smartKey",a.toLowerCase())})}).addExtraButton(r=>{r.setIcon("trash").onClick(()=>{this.repository.splice(this.repository.indexOf(i),1),this.onOpen()})}).addExtraButton(r=>{r.setIcon("pencil").onClick(()=>{new uc(this.app,i,this.plugin,this.branchName,a=>{this.repository[this.repository.indexOf(i)]=a}).open()})})}new Z.Setting(e).addButton(i=>{i.setButtonText(u.t("common.save")).onClick(()=>{let s=this.foundError(),r=s.repo.length>0?this.containerEl.querySelector(`[smartkey="${s.repo}"] input`):e.querySelector('[placeholder="smartKey"] input');s.type==="None"&&(r==null||r.classList.remove("error"),this.onSubmit(this.repository),this.close()),r==null||r.classList.add("error"),s.type==="duplicate"?new Z.Notice(u.t("settings.github.smartRepo.modals.duplicate")):s.type==="default"?new Z.Notice(u.t("settings.github.smartRepo.modals.default")):s.type==="empty"&&new Z.Notice(u.t("settings.github.smartRepo.modals.empty"))})})}foundError(){for(let e of this.repository){if(this.plugin.settings.github.otherRepo.filter(n=>n.smartKey===e.smartKey).length>1)return{repo:e.smartKey,type:"duplicate"};if(e.smartKey==="default")return{repo:e.smartKey,type:"default"};if(e.smartKey.length===0)return{repo:"",type:"empty"}}return{repo:"",type:"None"}}onClose(){let{contentEl:e}=this,n=this.foundError();if(n.type==="empty"){let i=this.repository.filter(s=>s.smartKey===n.repo);for(let s=0;ss.smartKey===n.repo);for(let s=0;ss.smartKey===n.repo);for(let s of i){let r=Math.random().toString(36).substring(2,8);s.smartKey=`${s.smartKey}-${r}`}new Z.Notice(`${u.t("settings.github.smartRepo.modals.default")} ${u.t("common.rename")}`)}this.onSubmit(this.repository),e.empty()}},uc=class extends Z.Modal{constructor(e,n,i,s,r){super(e);this.repository=n,this.onSubmit=r,this.branchName=s,this.plugin=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","manage-repo"]),e.createEl("h2",{text:u.t("common.edit",{things:this.repository.smartKey})}),new Z.Setting(e).setName(u.t("settings.github.apiType.title")).setDesc(u.t("settings.github.apiType.desc")).addDropdown(n=>{n.addOption(Oe.free,u.t("settings.github.apiType.dropdown.free")).addOption(Oe.entreprise,u.t("settings.github.apiType.dropdown.enterprise")).setValue(this.repository.api.tiersForApi).onChange(i=>{this.repository.api.tiersForApi=i,this.onOpen()})}),this.repository.api.tiersForApi===Oe.entreprise&&new Z.Setting(e).setName(u.t("settings.github.apiType.hostname.title")).setDesc(u.t("settings.github.apiType.hostname.desc")).addText(n=>n.setPlaceholder("https://github.mycompany.com").setValue(this.repository.api.hostname).onChange(i=>m(this,null,function*(){this.repository.api.hostname=i.trim()}))),new Z.Setting(e).setName(u.t("settings.github.username.title")).setDesc(u.t("settings.github.username.desc")).addText(n=>n.setPlaceholder(u.t("settings.github.username.title")).setValue(this.repository.user).onChange(i=>m(this,null,function*(){this.repository.user=i.trim()}))),new Z.Setting(e).setName(u.t("settings.github.repoName.title")).setDesc(u.t("settings.github.repoName.desc")).addText(n=>n.setPlaceholder(u.t("settings.github.repoName.placeholder")).setValue(this.repository.repo).onChange(i=>m(this,null,function*(){this.repository.repo=i.trim()}))),new Z.Setting(e).setName(u.t("settings.github.branch.title")).setDesc(u.t("settings.github.branch.desc")).addText(n=>n.setPlaceholder("main").setValue(this.repository.branch).onChange(i=>m(this,null,function*(){this.repository.branch=i.trim()}))),new Z.Setting(e).setName(u.t("settings.github.automaticallyMergePR")).addToggle(n=>n.setValue(this.repository.automaticallyMergePR).onChange(i=>m(this,null,function*(){this.repository.automaticallyMergePR=i}))),new Z.Setting(e).setClass("github-publisher-no-display").addButton(n=>n.setButtonText(u.t("settings.github.testConnection")).setClass("connect").onClick(()=>m(this,null,function*(){let i=yield this.plugin.reloadOctokit();this.repository.verifiedRepo=yield Ze(i,this.repository,null),this.plugin.settings.github.rateLimit=yield Ye(i.octokit,this.plugin.settings)}))),new Z.Setting(e).setName(u.t("settings.github.smartRepo.modals.shortcuts.title")).setDesc(u.t("settings.github.smartRepo.modals.shortcuts.desc")).addToggle(n=>n.setValue(this.repository.createShortcuts).onChange(i=>m(this,null,function*(){this.repository.createShortcuts=i}))),e.createEl("h3",{text:"GitHub Workflow"}),new Z.Setting(e).setName(u.t("settings.githubWorkflow.prRequest.title")).setDesc(u.t("settings.githubWorkflow.prRequest.desc")).addText(n=>n.setPlaceholder("[PUBLISHER] MERGE").setValue(this.repository.workflow.commitMessage).onChange(i=>m(this,null,function*(){i.trim().length===0&&(i="[PUBLISHER] MERGE",new Z.Notice(u.t("settings.githubWorkflow.prRequest.error"))),this.repository.workflow.commitMessage=i}))),new Z.Setting(e).setName(u.t("settings.githubWorkflow.githubAction.title")).setDesc(u.t("settings.githubWorkflow.githubAction.desc")).addText(n=>{n.setPlaceholder("ci").setValue(this.repository.workflow.name).onChange(i=>m(this,null,function*(){if(i.length>0){i=i.trim();let s=[".yml",".yaml"];s.some(r=>i.endsWith(r))||(i+=s[0])}this.repository.workflow.name=i}))}),e.createEl("h3",{text:u.t("settings.github.smartRepo.modals.otherConfig")}),new Z.Setting(e).setName(u.t("settings.plugin.shareKey.all.title")).setDesc(u.t("settings.plugin.shareKey.all.desc")).addToggle(n=>{var i,s;return n.setValue((s=(i=this.repository.shareAll)==null?void 0:i.enable)!=null?s:!1).onChange(r=>m(this,null,function*(){var a,o;this.repository.shareAll={enable:r,excludedFileName:(o=(a=this.plugin.settings.plugin.shareAll)==null?void 0:a.excludedFileName)!=null?o:"DRAFT"},this.onOpen()}))}),!this.repository.shareAll||!this.repository.shareAll.enable?new Z.Setting(e).setName(u.t("settings.plugin.shareKey.title")).setDesc(u.t("settings.plugin.shareKey.desc")).addText(n=>n.setPlaceholder("share").setValue(this.repository.shareKey).onChange(i=>m(this,null,function*(){this.repository.shareKey=i.trim(),yield this.plugin.saveSettings()}))):new Z.Setting(e).setName(u.t("settings.plugin.shareKey.excludedFileName.title")).addText(n=>{var i,s,r,a;return n.setPlaceholder("DRAFT").setValue((a=(r=(i=this.repository.shareAll)==null?void 0:i.excludedFileName)!=null?r:(s=this.plugin.settings.plugin.shareAll)==null?void 0:s.excludedFileName)!=null?a:"DRAFT").onChange(o=>m(this,null,function*(){this.repository.shareAll.excludedFileName=o.trim()}))}),this.plugin.settings.plugin.copyLink.enable&&(new Z.Setting(e).setName(u.t("settings.plugin.copyLink.baselink.title")).setDesc(u.t("settings.plugin.copyLink.baselink.desc")).addText(n=>n.setPlaceholder(this.plugin.settings.plugin.copyLink.links).setValue(this.repository.copyLink.links).onChange(i=>m(this,null,function*(){this.repository.copyLink.links=i.trim()}))),new Z.Setting(e).setName(u.t("settings.plugin.copyLink.linkPathRemover.title")).setDesc(u.t("settings.plugin.copyLink.linkPathRemover.desc")).addText(n=>{n.setPlaceholder("docs").setValue(this.repository.copyLink.removePart.join(", ")).onChange(i=>m(this,null,function*(){this.repository.copyLink.removePart=i.split(/[,\n]\s*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))})),new Z.Setting(e).addButton(n=>n.setButtonText(u.t("common.save")).onClick(()=>m(this,null,function*(){this.onSubmit(this.repository),this.close()})))}onClose(){let{contentEl:e}=this;e.empty(),this.onSubmit(this.repository)}};var re=q(require("obsidian"));function fn(t){try{return new RegExp(t),{error:null,isValid:!0}}catch(e){return{error:e,isValid:!1}}}var Cr=class extends re.Modal{constructor(e,n,i,s){super(e);this.allOverrides=i,this.settings=n,this.onSubmit=s}forbiddenValue(e){if(fn(e).isValid){if(e.match(/[\\><:"|?*]/)&&!e.match(/^\/(.*)\/[gmisuvdy]*$/))return new re.Notice(u.t("settings.regexReplacing.forbiddenValue",{what:u.t("common.path.folder"),forbiddenChar:e.match(/[\\><:"|?*]/)[0]})),{value:"",isForbidden:!0}}else{let n=fn(e).error;return new re.Notice(u.t("settings.regexReplacing.invalidRegex",{e:n})),{value:"",isForbidden:!0}}return{value:e,isForbidden:!1}}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","file-path-name"]),e.createEl("h2",{text:u.t("settings.embed.overrides.modal.title")}),e.createEl("p",{text:u.t("settings.regexReplacing.modal.desc")}),e.createEl("h3",{text:u.t("settings.regexReplacing.modal.keywords")});let n=e.createEl("ul",{cls:"keywords"});n.createEl("li",{text:u.t("settings.embed.forcePush.all")}),n.createEl("li",{text:u.t("settings.embed.forcePush.default")}),n.createEl("li",{text:u.t("settings.regexReplacing.modal.name")}),e.createEl("h3",{text:u.t("settings.regexReplacing.modal.force")}),e.createEl("p",{text:u.t("settings.embed.forcePush.info")}),this.settings.embed.overrideAttachments||(this.settings.embed.overrideAttachments=[]);for(let i of this.allOverrides){let s=new re.Setting(e).setClass("entry").addText(r=>{r.setPlaceholder(u.t("settings.embed.overrides.modal.path")).setValue(i.path).onChange(a=>{i.path=a,s.controlEl.setAttribute("value",a)})}).addText(r=>{r.setPlaceholder(u.t("settings.embed.overrides.modal.dest")).setValue(i.destination).onChange(a=>{i.destination=a,s.controlEl.setAttribute("replace",a)})}).addToggle(r=>{r.setTooltip(u.t("settings.embed.forcePush.title")).setValue(i.forcePush).onChange(a=>{i.forcePush=a})});s.controlEl.setAttribute("value",i.path),s.controlEl.setAttribute("replace",i.destination),s.addExtraButton(r=>{r.setIcon("trash").onClick(()=>{this.allOverrides.splice(this.allOverrides.indexOf(i),1),this.onOpen()})})}new re.Setting(e).addButton(i=>{i.setIcon("plus").onClick(()=>{this.allOverrides.push({path:"",destination:"",forcePush:!1}),this.onOpen()})}).addButton(i=>{i.setButtonText(u.t("common.save")).onClick(()=>{let s=[];this.allOverrides.forEach(r=>{let a=this.forbiddenValue(r.path),o=this.forbiddenValue(r.destination);if(s.push(a.isForbidden),s.push(o.isForbidden),a.isForbidden||o.isForbidden){r.path=a.value,r.destination=o.value;let l=e.querySelector(`[value="${Te(r.path)}"] input`),c=e.querySelector(`[replace="${Te(r.destination)}"] input`);l==null||l.classList.add("error"),c==null||c.classList.add("error")}}),s.includes(!0)||(this.onSubmit(this.allOverrides),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}},Sr=class extends re.Modal{constructor(e,n,i,s){super(e);this.allRegex=i,this.settings=n,this.onSubmit=s}classValue(e){this.settings.upload.replacePath=e.filter(n=>n.type===ke.path),this.settings.upload.replaceTitle=e.filter(n=>n.type===ke.title)}forbiddenValue(e,n){let i=/\/(.*)(\\[dwstrnvfb0cxup])(.*)\//i,s=n===ke.path?u.t("common.path.folder"):u.t("common.path.file");s=s.toLowerCase();let r=!1;if(e=="/")new re.Notice(u.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e})),e="",r=!0;else if(fn(e).isValid)e.match(/[><:"|?*]|(\\\/)|(^\w+\/\w+)|(\\)/)&&n===ke.title&&!e.match(i)?(new re.Notice(u.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e.match(/[><:"|?*]|(\\\/)|(^\w+\/\w+)|(\\)/)[0]})),e="",r=!0):n===ke.path&&(e.match(/[\\><:"|?*]/)&&!e.match(/^\/(.*)\/[gmisuvdy]*$/)?(new re.Notice(u.t("settings.regexReplacing.forbiddenValue",{what:s,forbiddenChar:e.match(/[\\><:"|?*]/)[0]})),e="",r=!0):e.match(/(^\w+\/\w+)|(\\\/)/)&&!e.match(i)&&new re.Notice(u.t("settings.regexReplacing.warningPath")));else{let a=fn(e).error;new re.Notice(u.t("settings.regexReplacing.invalidRegex",{e:a})),r=!0}return{value:e,isForbidden:r}}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","file-path-name"]),this.settings.upload.behavior===W.fixed?e.createEl("h2",{text:u.t("settings.regexReplacing.modal.title.only")}):e.createEl("h2",{text:u.t("settings.regexReplacing.modal.title.all")}),this.settings.upload.replacePath?this.settings.upload.replaceTitle||(this.settings.upload.replaceTitle=[]):this.settings.upload.replacePath=[],this.settings.upload.replacePath.forEach(n=>{n.type||(n.type=ke.path)}),this.settings.upload.replaceTitle.forEach(n=>{n.type||(n.type=ke.title)});for(let n of this.allRegex){let i=new re.Setting(e).setClass("entry").addText(s=>{s.setPlaceholder(u.t("regex.entry")).setValue(n.regex).onChange(r=>{n.regex=r,i.controlEl.setAttribute("value",r)})}).addText(s=>{s.setPlaceholder(u.t("regex.replace")).setValue(n.replacement).onChange(r=>{n.replacement=r,i.controlEl.setAttribute("replace",r)})});i.controlEl.setAttribute("value",n.regex),i.controlEl.setAttribute("replace",n.replacement),this.settings.upload.behavior!==W.fixed?i.addDropdown(s=>{s.addOption("path",u.t("common.path.folder")).addOption("title",u.t("common.path.file")).setValue(n.type).onChange(r=>{n.type=r})}):i.addButton(s=>{s.buttonEl.classList.add("disabled"),s.setButtonText(u.t("common.path.file"))}),i.addExtraButton(s=>{s.setIcon("trash").onClick(()=>{this.allRegex.splice(this.allRegex.indexOf(n),1),this.onOpen()})})}new re.Setting(e).addButton(n=>{n.setIcon("plus").onClick(()=>{this.allRegex.push({regex:"",replacement:"",type:ke.title}),this.onOpen()})}).addButton(n=>{n.setButtonText(u.t("common.save")).onClick(()=>{let i=[];this.allRegex.forEach(s=>{s.regex||(s.regex=""),s.replacement||(s.replacement="");let r=this.forbiddenValue(s.regex,s.type);s.regex.length===0&&(new re.Notice(u.t("settings.regexReplacing.emptyRegex")),r.isForbidden=!0,r.value="");let a=this.forbiddenValue(s.replacement,s.type);if(i.push(r.isForbidden),i.push(a.isForbidden),r.isForbidden||a.isForbidden){s.regex=r.value,s.replacement=a.value;let o=e.querySelector(`[value="${Te(s.regex)}"] input`),l=e.querySelector(`[replace="${Te(s.replacement)}"] input`);o==null||o.classList.add("error"),l==null||l.classList.add("error")}}),i.includes(!0)||(this.onSubmit(this.allRegex),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}},Tr=class extends re.Modal{constructor(e,n,i){super(e);this.settings=n,this.onSubmit=i}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","regex","on-contents"]),e.createEl("p",{text:u.t("settings.regexReplacing.modal.title.text")}).createEl("p",{text:u.t("settings.regexReplacing.modal.desc")}).createEl("p",{text:u.t("settings.regexReplacing.empty")});for(let n of this.settings.conversion.censorText){let i=n.after?"arrow-down":"arrow-up",s=(n==null?void 0:n.inCodeBlocks)?"code":"scan",r=n.after?u.t("common.after").toLowerCase():u.t("common.before").toLowerCase(),a=u.t("settings.regexReplacing.momentReplaceRegex",{moment:r}),o=u.t("settings.regexReplacing.inCodeBlocks.runIn");n.inCodeBlocks||(o=u.t("settings.regexReplacing.inCodeBlocks.runOut"));let l=new re.Setting(e).setClass("entry").addText(c=>{c.setPlaceholder(u.t("regex.entry")).setValue(n.entry).onChange(d=>m(this,null,function*(){n.entry=d,l.controlEl.setAttribute("value",d)}))}).addText(c=>{c.setPlaceholder(u.t("regex.replace")).setValue(n.replace).onChange(d=>m(this,null,function*(){n.replace=d}))}).addExtraButton(c=>{c.setIcon("trash").setTooltip(u.t("common.delete",{things:"Regex"})).onClick(()=>m(this,null,function*(){this.settings.conversion.censorText.splice(this.settings.conversion.censorText.indexOf(n),1),this.onOpen()}))}).addExtraButton(c=>{c.setTooltip(a).setIcon(i).onClick(()=>m(this,null,function*(){n.after=!n.after,this.onOpen()}))}).addExtraButton(c=>{c.setTooltip(o).setIcon(s).onClick(()=>m(this,null,function*(){n.inCodeBlocks=!n.inCodeBlocks,this.onOpen()}))});l.controlEl.setAttribute("value",n.entry)}new re.Setting(e).addButton(n=>{n.setIcon("plus").setTooltip(u.t("common.add",{things:"Regex"})).onClick(()=>m(this,null,function*(){let i={entry:"",replace:"",flags:"",after:!1};this.settings.conversion.censorText.push(i),this.onOpen()}))}).addButton(n=>{n.setButtonText(u.t("common.save")).onClick(()=>{let i=[];for(let s of this.settings.conversion.censorText)if(!fn(s.entry).isValid){new re.Notice(u.t("settings.regexReplacing.invalidRegex",{e:fn(s.entry).error}));let r=e.querySelector(`[value="${Te(s.entry)}"] input`);r==null||r.classList.add("error"),i.push(!1)}i.includes(!1)||(this.onSubmit(this.settings),this.close())})})}onClose(){let{contentEl:e}=this;e.empty()}};var Mt=q(require("obsidian"));var Pr=class extends Mt.Modal{constructor(e,n,i){super(e);this.plugin=n,this.token=i,this.tokenPath=""}onOpen(){let{contentEl:e}=this;e.empty(),e.addClasses(["github-publisher","modals","token-path"]);let n=Jt(this.plugin,dt),i=e.createEl("p",void 0,r=>{r.appendText(u.t("settings.github.ghToken.button.description")),r.createDiv({text:u.t("settings.github.ghToken.button.default")}).createEl("code",{text:` ${n}`},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"})});i.createEl("br"),i.createEl("p",{text:u.t("settings.github.ghToken.button.variables")}),i.createEl("ul",void 0,r=>{r.createEl("li",void 0,a=>{a.createEl("code",{text:"%configDir%"},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"}),a.createEl("span",void 0,o=>{o.appendText(`${u.t("settings.github.ghToken.button.configDir")} (`),o.createEl("code",{text:this.app.vault.configDir},l=>{l.classList.add("cm-inline-code"),l.style.fontFamily="var(--font-monospace)"}),o.appendText(")")})}),r.createEl("li",void 0,a=>{a.createEl("code",{text:"%pluginID%"},o=>{o.classList.add("cm-inline-code"),o.style.fontFamily="var(--font-monospace)"}),a.createEl("span",void 0,o=>{o.appendText(`${u.t("settings.github.ghToken.button.pluginID")} (`),o.createEl("code",{text:this.plugin.manifest.id},l=>{l.classList.add("cm-inline-code"),l.style.fontFamily="var(--font-monospace)"}),o.appendText(")")})})});let s=new Mt.Setting(e).setClass("display-none").setClass("max-width").addText(r=>{var o;let a=(o=this.plugin.settings.github.tokenPath)!=null?o:n;r.setPlaceholder(n).setValue(a).onChange(l=>m(this,null,function*(){let c=l.trim();c.length===0&&(c=n),this.plugin.settings.github.tokenPath=c,this.tokenPath=c}))});new Mt.Setting(e).addButton(r=>{r.setButtonText(u.t("common.save")).onClick(()=>m(this,null,function*(){try{yield this.plugin.saveSettings(),yield Lt(this.plugin,this.token),this.close()}catch(a){s.controlEl.querySelector("input").style.border="1px solid red",new Mt.Notice(u.t("error.reading-token-file")),this.tokenPath="error",R({settings:this.plugin.settings,e:!0},a)}}))})}onClose(){return m(this,null,function*(){let{contentEl:e}=this;e.empty(),this.tokenPath==="error"&&(this.plugin.settings.github.tokenPath=dt,yield this.plugin.saveSettings(),yield Lt(this.plugin,this.token))})}};var Or=q(require("obsidian"));function pn(t){for(let[e,n]of Object.entries(t))e!="components"&&n.show()}function Jn(t){for(let[e,n]of Object.entries(t))e!="components"&&n.hide()}function cc(t,e,n,i){let s=t.upload;s.behavior===W.yaml?(pn(e),pn(n),pn(i)):(Jn(e),Jn(n),s.behavior===W.obsidian?pn(i):Jn(i))}function Rr(t,e,n,i="defaultName",s){return m(this,null,function*(){let r=n.settings.upload,a=i==="rootFolder"?u.t("common.rootFolder"):u.t("common.defaultName");t.length===0&&r.defaultName&&(r.autoclean.enable&&new Or.Notice(u.t("error.autoClean",{what:a})),r.autoclean.enable=!1,yield n.saveSettings(),e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),s.renderSettingsPage(le.upload)),t.length===0&&r.behavior!==W.yaml&&(r.autoclean.enable&&new Or.Notice(u.t("error.autoClean",{what:u.t("common.defaultName")})),r.autoclean.enable=!1,e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),s.renderSettingsPage(le.upload)),e.setDisabled(!1),r.autoclean.enable&&e.components[0].toggleEl.classList.add("is-enabled")})}function Nr(t,e,n,i,s){return m(this,null,function*(){let r=s.settings.upload;i===W.yaml?(pn(t),pn(e)):(r.defaultName.length>0&&(n.setDisabled(!1),r.autoclean.enable&&n.components[0].toggleEl.classList.add("is-enabled")),Jn(t),Jn(e))})}function dc(t,e,n){let i=n.settings.upload;t?(e.setDisabled(!0),e.components[0].toggleEl.classList.remove("is-enabled"),i.autoclean.enable=!1,n.saveSettings().then()):(e.setDisabled(!1),i.autoclean.enable&&e.components[0].toggleEl.classList.add("is-enabled"))}var Ar=class extends A.PluginSettingTab{constructor(e,n,i){super(e,n);this.plugin=n,this.branchName=i,this.settings=n.settings}display(){var a;let{containerEl:e}=this;e.empty(),e.addClass("github-publisher");let n=le.github,i=(a=this.settings.tabsID)!=null?a:n;this.settings.plugin.saveTabId!==void 0&&!this.settings.plugin.saveTabId&&(this.settings.tabsID=n,i=n,this.plugin.saveSettings());let s={"github-configuration":{name:u.t("settings.github.title"),icon:"cloud"},"upload-configuration":{name:u.t("settings.upload.title"),icon:"upload"},"text-conversion":{name:u.t("settings.conversion.title"),icon:"file-text"},"embed-configuration":{name:u.t("settings.embed.title"),icon:"link"},"plugin-settings":{name:u.t("settings.plugin.title"),icon:"gear"},help:{name:u.t("settings.help.title"),icon:"info"}};new A.Setting(e).setClass("import-export").addButton(o=>{o.setButtonText(u.t("modals.export.title")).onClick(()=>{new xr(this.app,this.plugin).open()})}).addButton(o=>{o.setButtonText(u.t("modals.import.title")).onClick(()=>{new vr(this.app,this.plugin,this.settingsPage,this).open()})}).addButton(o=>{o.setButtonText(u.t("modals.import.presets.title")).setTooltip(u.t("modals.import.presets.desc")).onClick(()=>m(this,null,function*(){let l=yield this.plugin.reloadOctokit(),c=yield lc(l.octokit,this.plugin);new Er(this.app,this.plugin,c,l.octokit,this).open()}))});let r=e.createEl("nav",{cls:"settings-tab-bar"});for(let[o,l]of Object.entries(s)){let c=r.createEl("div",{cls:"settings-tab"}),d=c.createEl("div",{cls:"settings-tab-icon"});(0,A.setIcon)(d,l.icon),c.createEl("div",{cls:"settings-tab-name",text:l.name}),o===i&&c.addClass("settings-tab-active"),c.addEventListener("click",()=>m(this,null,function*(){for(let f of r.children)f.removeClass("settings-tab-active");c.addClass("settings-tab-active"),this.renderSettingsPage(o)}))}this.settingsPage=e.createEl("div",{cls:"settings-tab-page"}),this.renderSettingsPage(i)}renderSettingsPage(e){return m(this,null,function*(){switch((this.settings.plugin.saveTabId||this.settings.plugin.saveTabId===void 0)&&(this.settings.tabsID=e,yield this.plugin.saveSettings()),this.settingsPage.empty(),e){case"github-configuration":this.renderGithubConfiguration();break;case"upload-configuration":this.renderUploadConfiguration();break;case"text-conversion":this.renderTextConversion();break;case"embed-configuration":this.renderEmbedConfiguration();break;case"plugin-settings":this.renderPluginSettings();break;case"help":this.renderHelp();break}})}renderGithubConfiguration(){let e=this.settings.github;new A.Setting(this.settingsPage).setName(u.t("settings.github.apiType.title")).setDesc(u.t("settings.github.apiType.desc")).addDropdown(s=>{s.addOption(Oe.free,u.t("settings.github.apiType.dropdown.free")).addOption(Oe.entreprise,u.t("settings.github.apiType.dropdown.enterprise")).setValue(e.api.tiersForApi).onChange(r=>m(this,null,function*(){e.api.tiersForApi=r,yield this.plugin.saveSettings(),this.renderSettingsPage(le.github)}))}),e.api.tiersForApi===Oe.entreprise&&new A.Setting(this.settingsPage).setName(u.t("settings.github.apiType.hostname.title")).setDesc(u.t("settings.github.apiType.hostname.desc")).addText(s=>s.setPlaceholder("https://github.mycompany.com").setValue(e.api.hostname).onChange(r=>m(this,null,function*(){e.api.hostname=r.trim(),yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.github.username.title")).setDesc(u.t("settings.github.username.desc")).addText(s=>s.setPlaceholder(u.t("settings.github.username.title")).setValue(e.user).onChange(r=>m(this,null,function*(){e.user=r.trim(),yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.github.repoName.title")).setDesc(u.t("settings.github.repoName.desc")).addText(s=>s.setPlaceholder(u.t("settings.github.repoName.placeholder")).setValue(e.repo).onChange(r=>m(this,null,function*(){e.repo=r.trim(),yield this.plugin.saveSettings()})));let n=document.createDocumentFragment();n.createEl("span",void 0,s=>{s.innerText=u.t("settings.github.ghToken.desc"),s.createEl("a",void 0,r=>{r.innerText=`${u.t("common.here")}.`,r.href="https://github.com/settings/tokens/new?scopes=repo,workflow"})});let i=new A.Setting(this.settingsPage).setName(u.t("common.ghToken")).setDesc(n).addText(s=>m(this,null,function*(){let r=yield this.plugin.loadToken();s.setPlaceholder("ghp_15457498545647987987112184").setValue(r).onChange(a=>m(this,null,function*(){a.trim().length===0?(i.controlEl.addClass("error"),new A.Notice(u.t("settings.github.ghToken.error"))):(i.controlEl.removeClass("error"),yield Lt(this.plugin,a.trim())),yield this.plugin.saveSettings()}))})).addExtraButton(s=>{s.setIcon("edit").setTooltip(u.t("settings.github.ghToken.button.tooltip")).onClick(()=>m(this,null,function*(){let r=yield this.plugin.loadToken();new Pr(this.app,this.plugin,r).open(),yield this.plugin.saveSettings()}))});new A.Setting(this.settingsPage).setName(u.t("settings.github.branch.title")).setDesc(u.t("settings.github.branch.desc")).addText(s=>s.setPlaceholder("main").setValue(e.branch).onChange(r=>m(this,null,function*(){e.branch=r.trim(),yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.github.automaticallyMergePR")).addToggle(s=>s.setValue(e.automaticallyMergePR).onChange(r=>m(this,null,function*(){e.automaticallyMergePR=r,yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setClass("no-display").addButton(s=>s.setButtonText(u.t("settings.github.testConnection")).setClass("connect-button").onClick(()=>m(this,null,function*(){let r=yield this.plugin.reloadOctokit();this.settings.github.verifiedRepo=yield Ze(r,null,null),this.settings.github.rateLimit=yield Ye(r.octokit,this.settings),yield this.plugin.saveSettings()}))).addButton(s=>s.setButtonText(u.t("settings.github.smartRepo.button")).onClick(()=>m(this,null,function*(){var a,o;let r=this.copy((o=(a=this.settings.github)==null?void 0:a.otherRepo)!=null?o:[]);new kr(this.app,this.settings,this.branchName,this.plugin,r,l=>m(this,null,function*(){this.settings.github.otherRepo=l,yield this.plugin.saveSettings(),this.plugin.reloadCommands()})).open()}))),this.settingsPage.createEl("h3",{text:"Github Workflow"}),new A.Setting(this.settingsPage).setName(u.t("settings.githubWorkflow.prRequest.title")).setDesc(u.t("settings.githubWorkflow.prRequest.desc")).addText(s=>s.setPlaceholder("[PUBLISHER] MERGE").setValue(e.workflow.commitMessage).onChange(r=>m(this,null,function*(){r.trim().length===0&&(r="[PUBLISHER] MERGE",new A.Notice(u.t("settings.githubWorkflow.prRequest.error"))),e.workflow.commitMessage=r,yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.githubWorkflow.githubAction.title")).setDesc(u.t("settings.githubWorkflow.githubAction.desc")).addText(s=>{s.setPlaceholder("ci").setValue(e.workflow.name).onChange(r=>m(this,null,function*(){if(r.length>0){r=r.trim();let a=[".yml",".yaml"];a.some(o=>r.endsWith(o))||(r+=a[0])}e.workflow.name=r,yield this.plugin.saveSettings()}))})}renderUploadConfiguration(){let e=this.settings.upload;new A.Setting(this.settingsPage).setName(u.t("settings.upload.folderBehavior.title")).setDesc(u.t("settings.upload.folderBehavior.desc")).addDropdown(d=>{d.addOptions({fixed:u.t("settings.upload.folderBehavior.fixedFolder"),yaml:u.t("settings.upload.folderBehavior.yaml"),obsidian:u.t("settings.upload.folderBehavior.obsidianPath")}).setValue(e.behavior).onChange(f=>m(this,null,function*(){e.behavior=f,yield Nr(i,s,c,f,this.plugin),yield this.plugin.saveSettings(),this.renderSettingsPage(le.upload)}))});let n=e.behavior===W.yaml?{desc:u.t("settings.upload.defaultFolder.desc"),title:u.t("settings.upload.defaultFolder.title")}:{desc:u.t("settings.upload.rootFolder.other"),title:u.t("settings.upload.rootFolder.title")};new A.Setting(this.settingsPage).setName(n.title).setDesc(n.desc).addText(d=>{d.setPlaceholder(u.t("settings.upload.defaultFolder.placeholder")).setValue(e.defaultName).onChange(f=>m(this,null,function*(){e.defaultName=f.replace(/\/$/,""),yield Rr(f,c,this.plugin,"defaultName",this),yield this.plugin.saveSettings()}))});let i=new A.Setting(this.settingsPage).setName(u.t("settings.upload.frontmatterKey.title")).setDesc(u.t("settings.upload.frontmatterKey.desc")).addText(d=>{d.setPlaceholder(u.t("settings.upload.frontmatterKey.placeholder")).setValue(e.yamlFolderKey).onChange(f=>m(this,null,function*(){e.yamlFolderKey=f.trim(),yield this.plugin.saveSettings()}))}),s=new A.Setting(this.settingsPage).setName(u.t("settings.upload.rootFolder.title")).setDesc(u.t("settings.upload.rootFolder.desc")).addText(d=>{d.setPlaceholder("docs").setValue(e.rootFolder).onChange(f=>m(this,null,function*(){e.rootFolder=f.replace(/\/$/,""),yield Rr(f,c,this.plugin,"rootFolder",this),yield this.plugin.saveSettings()}))}),r=new A.Setting(this.settingsPage).setName(u.t("settings.upload.useFrontmatterTitle.title")).setDesc(u.t("settings.upload.useFrontmatterTitle.desc")).setClass("title").addToggle(d=>{d.setValue(e.frontmatterTitle.enable).onChange(f=>m(this,null,function*(){e.frontmatterTitle.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(le.upload)}))});e.frontmatterTitle.enable&&r.addText(d=>{d.setPlaceholder("title").setValue(e.frontmatterTitle.key).onChange(f=>m(this,null,function*(){e.frontmatterTitle.key=f.trim(),yield this.plugin.saveSettings()}))});let a=e.behavior===W.fixed?u.t("settings.upload.regexFilePathTitle.title.titleOnly"):u.t("settings.upload.regexFilePathTitle.title.FolderPathTitle");new A.Setting(this.settingsPage).setName(a).setDesc(u.t("settings.upload.regexFilePathTitle.desc")).addButton(d=>{d.setIcon("pencil").onClick(()=>m(this,null,function*(){let f=e.replaceTitle;e.behavior!==W.fixed&&(f=f.concat(e.replacePath)),new Sr(this.app,this.settings,this.copy(f),p=>m(this,null,function*(){e.replacePath=p.filter(w=>w.type==="path"),e.replaceTitle=p.filter(w=>w.type==="title"),yield this.plugin.saveSettings()})).open()}))});let o=new A.Setting(this.settingsPage).setName(u.t("settings.conversion.links.folderNote.title")).setDesc(u.t("settings.conversion.links.folderNote.desc")).addToggle(d=>{d.setValue(e.folderNote.enable).onChange(f=>m(this,null,function*(){e.folderNote.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(le.upload)}))});e.folderNote.enable&&(o.addText(d=>{d.setPlaceholder("folderNote").setValue(e.folderNote.rename).onChange(f=>m(this,null,function*(){e.folderNote.rename=f,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.upload.folderNote.addTitle.title")).addToggle(d=>{d.setValue(e.folderNote.addTitle.enable).onChange(f=>m(this,null,function*(){e.folderNote.addTitle.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(le.upload)}))}),e.folderNote.addTitle.enable&&new A.Setting(this.settingsPage).setName(u.t("settings.upload.folderNote.addTitle.key")).addText(d=>{d.setPlaceholder("title").setValue(e.folderNote.addTitle.key).onChange(f=>m(this,null,function*(){e.folderNote.addTitle.key=f,yield this.plugin.saveSettings()}))})),cc(this.settings,i,s,o),this.app.plugins.manifests["metadata-extractor"]&&new A.Setting(this.settingsPage).setName(u.t("settings.githubWorkflow.useMetadataExtractor.title")).setDesc(u.t("settings.githubWorkflow.useMetadataExtractor.desc")).addText(d=>{d.setPlaceholder("docs/_assets/metadata").setValue(e.metadataExtractorPath).onChange(f=>m(this,null,function*(){e.metadataExtractorPath=f.trim(),yield this.plugin.saveSettings()}))});let l=e.behavior===W.yaml&&e.rootFolder.length===0||e.defaultName.length===0,c=new A.Setting(this.settingsPage).setName(u.t("settings.githubWorkflow.autoCleanUp.title")).setDesc(u.t("settings.githubWorkflow.autoCleanUp.desc")).setDisabled(l).addToggle(d=>{d.setValue(e.autoclean.enable).onChange(f=>m(this,null,function*(){e.autoclean.enable=f,yield this.plugin.saveSettings(),this.renderSettingsPage(le.upload),this.plugin.cleanOldCommands(),yield this.plugin.chargeAllCommands(null,this.plugin)}))});e.autoclean.enable&&!l&&new A.Setting(this.settingsPage).setName(u.t("settings.githubWorkflow.excludedFiles.title")).setDesc(u.t("settings.githubWorkflow.excludedFiles.desc")).addTextArea(d=>{d.setPlaceholder("docs/assets/js, docs/assets/logo, /\\.js$/").setValue(e.autoclean.excluded.join(", ")).onChange(f=>m(this,null,function*(){e.autoclean.excluded=f.split(/[,\n]\W*/).map(p=>p.trim()).filter(p=>p.length>0),yield this.plugin.saveSettings()}))}),dc(l,c,this.plugin),Nr(i,s,c,e.behavior,this.plugin)}renderTextConversion(){var i,s;let e=this.settings.conversion;this.settingsPage.createEl("p",{text:u.t("settings.conversion.desc")}),this.settingsPage.createEl("h5",{text:u.t("settings.conversion.links.title")}),this.settingsPage.createEl("p",{text:u.t("settings.conversion.links.desc")});let n=((i=this.settings.plugin.shareAll)==null?void 0:i.enable)?` ${u.t("settings.conversion.links.internals.shareAll")}`:"";new A.Setting(this.settingsPage).setName(u.t("settings.conversion.links.internals.title")).setDesc(u.t("settings.conversion.links.internals.desc")+n).addToggle(r=>{r.setValue(e.links.internal).onChange(a=>m(this,null,function*(){var o;e.links.internal=a,((o=this.settings.plugin.shareAll)==null?void 0:o.enable)&&(e.links.unshared=!0),yield this.plugin.saveSettings(),this.renderSettingsPage("text-conversion")}))}),e.links.internal&&!((s=this.settings.plugin.shareAll)==null?void 0:s.enable)&&new A.Setting(this.settingsPage).setName(u.t("settings.conversion.links.nonShared.title")).setDesc(u.t("settings.conversion.links.nonShared.desc")).addToggle(r=>{r.setValue(e.links.unshared).onChange(a=>m(this,null,function*(){e.links.unshared=a,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.links.wikilinks.title")).setDesc(u.t("settings.conversion.links.wikilinks.desc")).addToggle(r=>{r.setValue(e.links.wiki).onChange(a=>m(this,null,function*(){e.links.wiki=a,yield this.plugin.saveSettings(),this.renderSettingsPage("text-conversion")}))}),(e.links.wiki||e.links.internal)&&new A.Setting(this.settingsPage).setName(u.t("settings.conversion.links.slugify.title")).setDesc(u.t("settings.conversion.links.slugify.desc")).addToggle(r=>{r.setValue(e.links.slugify).onChange(a=>m(this,null,function*(){e.links.slugify=a,yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h5",{text:u.t("settings.conversion.sectionTitle")}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.hardBreak.title")).setDesc(u.t("settings.conversion.hardBreak.desc")).addToggle(r=>{r.setValue(e.hardbreak).onChange(a=>m(this,null,function*(){e.hardbreak=a,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.dataview.title")).setDesc(u.t("settings.conversion.dataview.desc")).addToggle(r=>{r.setValue(e.dataview).onChange(a=>m(this,null,function*(){e.dataview=a,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.regexReplacing.modal.title.text")).setDesc(u.t("settings.regexReplacing.modal.desc")).addButton(r=>{r.setIcon("pencil").onClick(()=>m(this,null,function*(){new Tr(this.app,this.copy(this.settings),a=>m(this,null,function*(){this.settings.conversion.censorText=a.conversion.censorText,yield this.plugin.saveSettings()})).open()}))}),this.settingsPage.createEl("h5",{text:"Tags"}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.tags.inlineTags.title")).setDesc(u.t("settings.conversion.tags.inlineTags.desc")).addToggle(r=>{r.setValue(e.tags.inline).onChange(a=>m(this,null,function*(){e.tags.inline=a,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.tags.title")).setDesc(u.t("settings.conversion.tags.desc")).addTextArea(r=>{r.inputEl.addClass("mid-height"),r.setPlaceholder("field_name").setValue(e.tags.fields.join(",")).onChange(a=>m(this,null,function*(){e.tags.fields=a.split(/[,\n]\W*/).map(o=>o.trim()).filter(o=>o.length>0),yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.conversion.tags.exclude.title")).setDesc(u.t("settings.conversion.tags.exclude.desc")).addTextArea(r=>{r.setPlaceholder(u.t("settings.conversion.tags.exclude.placeholder")).setValue(e.tags.exclude.join(",")).onChange(a=>m(this,null,function*(){e.tags.exclude=a.split(/[,\n]\W*/).map(o=>o.trim()).filter(o=>o.length>0),yield this.plugin.saveSettings()}))})}renderEmbedConfiguration(){return m(this,null,function*(){this.settingsPage.empty(),this.settingsPage.createEl("h5",{text:u.t("settings.embed.attachment"),cls:"center"});let e=this.settings.embed;new A.Setting(this.settingsPage).setName(u.t("settings.embed.transferImage.title")).addToggle(n=>{n.setValue(e.attachments).onChange(i=>m(this,null,function*(){e.attachments=i,yield this.plugin.saveSettings(),this.renderSettingsPage(le.embed)}))}),e.attachments&&(new A.Setting(this.settingsPage).setName(u.t("settings.embed.imagePath.title")).setDesc(u.t("settings.embed.imagePath.desc")).addToggle(n=>{var i;n.setValue((i=e.useObsidianFolder)!=null?i:!1).onChange(s=>m(this,null,function*(){e.useObsidianFolder=s,yield this.plugin.saveSettings(),this.renderSettingsPage(le.embed)}))}),e.useObsidianFolder||new A.Setting(this.settingsPage).setName(u.t("settings.embed.defaultImageFolder.title")).setDesc(u.t("settings.embed.defaultImageFolder.desc")).addText(n=>{n.setPlaceholder("docs/images").setValue(e.folder).onChange(i=>m(this,null,function*(){e.folder=i.replace(/\/$/,""),yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.embed.overrides.modal.title")).setDesc(u.t("settings.embed.overrides.desc")).addButton(n=>{n.setIcon("pencil").onClick(()=>m(this,null,function*(){new Cr(this.app,this.settings,this.copy(e.overrideAttachments),i=>m(this,null,function*(){e.overrideAttachments=i,yield this.plugin.saveSettings()})).open()}))})),new A.Setting(this.settingsPage).setName(u.t("settings.embed.transferMetaFile.title")).setDesc(u.t("settings.embed.transferMetaFile.desc")).addTextArea(n=>{n.setPlaceholder("banner").setValue(e.keySendFile.join(", ")).onChange(i=>m(this,null,function*(){e.keySendFile=i.split(/[,\n]\W*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h5",{text:u.t("settings.embed.notes"),cls:"center"}),new A.Setting(this.settingsPage).setName(u.t("settings.embed.transferNotes.title")).setDesc(u.t("settings.embed.transferNotes.desc")).addToggle(n=>{n.setValue(e.notes).onChange(i=>m(this,null,function*(){e.notes=i,yield this.plugin.saveSettings(),yield this.renderEmbedConfiguration()}))}),e.notes&&(new A.Setting(this.settingsPage).setName(u.t("settings.embed.links.title")).setDesc(u.t("settings.embed.links.desc")).addDropdown(n=>{var i;n.addOption("keep",u.t("settings.embed.links.dp.keep")).addOption("remove",u.t("settings.embed.links.dp.remove")).addOption("links",u.t("settings.embed.links.dp.links")).addOption("bake",u.t("settings.embed.links.dp.bake")).setValue((i=e.convertEmbedToLinks)!=null?i:"keep").onChange(s=>m(this,null,function*(){e.convertEmbedToLinks=s,yield this.plugin.saveSettings(),yield this.renderEmbedConfiguration()}))}),e.convertEmbedToLinks==="links"?new A.Setting(this.settingsPage).setName(u.t("settings.embed.char.title")).setDesc(u.t("settings.embed.char.desc")).addText(n=>{var i;n.setPlaceholder("->").setValue((i=e.charConvert)!=null?i:"->").onChange(s=>m(this,null,function*(){e.charConvert=s,yield this.plugin.saveSettings()}))}):e.convertEmbedToLinks==="bake"&&(e.bake||(e.bake={textBefore:"",textAfter:""},yield this.plugin.saveSettings()),yield this.plugin.saveSettings(),this.settingsPage.createEl("h5",{text:u.t("settings.embed.bake.title"),cls:"border-bottom"}),this.settingsPage.createEl("p",{text:u.t("settings.embed.bake.text")}),this.settingsPage.createEl("p",void 0,n=>{n.createEl("span",{text:u.t("settings.embed.bake.variable.desc"),cls:["bake"]}).createEl("ul",void 0,i=>{i.createEl("li",void 0,s=>{s.createEl("code",{text:"{{title}}"}),s.createEl("span",{text:u.t("settings.embed.bake.variable.title")})}),i.createEl("li",void 0,s=>{s.createEl("code",{text:"{{url}}"}),s.createEl("span",{text:u.t("settings.embed.bake.variable.url")})})})}),this.settingsPage.createEl("p",{text:`\u26A0\uFE0F ${u.t("settings.embed.bake.warning")}`,cls:["warning","embed"]}),new A.Setting(this.settingsPage).setName(u.t("settings.embed.bake.textBefore.title")).addTextArea(n=>{var i,s;n.setValue((s=(i=e.bake)==null?void 0:i.textBefore)!=null?s:"").onChange(r=>m(this,null,function*(){e.bake.textBefore=r,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.embed.bake.textAfter.title")).addTextArea(n=>{var i,s;n.setValue((s=(i=e.bake)==null?void 0:i.textAfter)!=null?s:"").onChange(r=>m(this,null,function*(){e.bake.textAfter=r,yield this.plugin.saveSettings()}))})))})}renderPluginSettings(){let e=this.settings.plugin;this.settingsPage.createEl("h3",{text:u.t("settings.plugin.head.share")}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.shareKey.all.title")).setDesc(u.t("settings.plugin.shareKey.all.desc")).addToggle(n=>{var i,s;return n.setValue((s=(i=e.shareAll)==null?void 0:i.enable)!=null?s:!1).onChange(r=>m(this,null,function*(){var a,o;e.shareAll={enable:r,excludedFileName:(o=(a=e.shareAll)==null?void 0:a.excludedFileName)!=null?o:"DRAFT"},r&&(this.settings.conversion.links.internal=!0),yield this.plugin.saveSettings(),this.renderSettingsPage(le.plugin)}))}),!e.shareAll||!e.shareAll.enable?new A.Setting(this.settingsPage).setName(u.t("settings.plugin.shareKey.title")).setDesc(u.t("settings.plugin.shareKey.desc")).addText(n=>n.setPlaceholder("share").setValue(e.shareKey).onChange(i=>m(this,null,function*(){e.shareKey=i.trim(),yield this.plugin.saveSettings()}))):new A.Setting(this.settingsPage).setName(u.t("settings.plugin.shareKey.excludedFileName.title")).addText(n=>{var i,s;return n.setPlaceholder("DRAFT").setValue((s=(i=e.shareAll)==null?void 0:i.excludedFileName)!=null?s:"DRAFT").onChange(r=>m(this,null,function*(){e.shareAll.excludedFileName=r.trim(),yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.excludedFolder.title")).setDesc(u.t("settings.plugin.excludedFolder.desc")).addTextArea(n=>n.setPlaceholder("_assets, Archive, /^_(.*)/gi").setValue(e.excludedFolder.join(", ")).onChange(i=>m(this,null,function*(){e.excludedFolder=i.split(/[,\n]\W*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))),this.settingsPage.createEl("h3",{text:u.t("settings.plugin.head.menu")}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.fileMenu.title")).setDesc(u.t("settings.plugin.fileMenu.desc")).addToggle(n=>n.setValue(e.fileMenu).onChange(i=>m(this,null,function*(){e.fileMenu=i,yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.editorMenu.title")).setDesc(u.t("settings.plugin.editorMenu.desc")).addToggle(n=>n.setValue(e.editorMenu).onChange(i=>m(this,null,function*(){e.editorMenu=i,yield this.plugin.saveSettings()}))),this.settingsPage.createEl("h3",{text:u.t("settings.plugin.head.copyLinks")}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.copyLink.title")).setDesc(u.t("settings.plugin.copyLink.desc")).addToggle(n=>n.setValue(e.copyLink.enable).onChange(i=>m(this,null,function*(){e.copyLink.enable=i,yield this.plugin.saveSettings(),this.renderSettingsPage(le.plugin)}))),e.copyLink.enable&&(new A.Setting(this.settingsPage).setName(u.t("settings.plugin.copyLink.baselink.title")).setDesc(u.t("settings.plugin.copyLink.baselink.desc")).addText(n=>{n.setPlaceholder("my_blog.com").setValue(e.copyLink.links).onChange(i=>m(this,null,function*(){e.copyLink.links=i,yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.copyLink.linkPathRemover.title")).setDesc(u.t("settings.plugin.copyLink.linkPathRemover.desc")).addText(n=>{n.setPlaceholder("docs").setValue(e.copyLink.removePart.join(", ")).onChange(i=>m(this,null,function*(){e.copyLink.removePart=i.split(/[,\n]\s*/).map(s=>s.trim()).filter(s=>s.length>0),yield this.plugin.saveSettings()}))}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.copyLink.command.desc")).addToggle(n=>n.setValue(e.copyLink.addCmd).onChange(i=>m(this,null,function*(){e.copyLink.addCmd=i,yield this.plugin.saveSettings()})))),this.settingsPage.createEl("h3",{text:u.t("settings.plugin.head.other")}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.embedEditRepo.title")).setDesc(u.t("settings.plugin.embedEditRepo.desc")).addToggle(n=>n.setValue(e.displayModalRepoEditing).onChange(i=>m(this,null,function*(){e.displayModalRepoEditing=i,yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.saveTab.title")).setDesc(u.t("settings.plugin.saveTab.desc")).addToggle(n=>{var i;return n.setValue((i=e.saveTabId)!=null?i:!0).onChange(s=>m(this,null,function*(){e.saveTabId=s,this.settings.tabsID=s?le.plugin:le.github,yield this.plugin.saveSettings()}))}),this.settingsPage.createEl("h4",{text:u.t("settings.plugin.head.log")}),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.logNoticeHeader.title")).setDesc(u.t("settings.plugin.logNoticeHeader.desc")).addToggle(n=>n.setValue(e.noticeError).onChange(i=>m(this,null,function*(){e.noticeError=i,yield this.plugin.saveSettings()}))),new A.Setting(this.settingsPage).setName(u.t("settings.plugin.dev.title")).setDesc(u.t("settings.plugin.dev.desc")).addToggle(n=>{var i;return n.setValue((i=e.dev)!=null?i:!1).onChange(s=>m(this,null,function*(){e.dev=s,yield this.plugin.saveSettings()}))})}renderHelp(){this.settingsPage.createEl("h2",{text:u.t("settings.help.usefulLinks.title")}),this.settingsPage.appendChild(rc()),this.settingsPage.createEl("hr"),this.settingsPage.createEl("h2",{text:u.t("settings.help.frontmatter.title")}),this.settingsPage.createEl("p",{text:u.t("settings.help.frontmatter.desc")}),this.settingsPage.createEl("pre",{cls:"language-yaml"}).createEl("code",{text:ic(this.settings),cls:"language-yaml"}),this.settingsPage.appendChild(sc(this.settings)),this.settingsPage.createEl("h2",{text:u.t("settings.help.multiRepoHelp.title")}),this.settingsPage.appendChild(ac(this.settings)),this.settingsPage.appendChild(oc())}copy(e){return JSON.parse(JSON.stringify(e))}};var Lr=class extends mn.Plugin{constructor(){super(...arguments);this.branchName=""}getTitleFieldForCommand(e,n){return at(Tn(n,e,this.settings),this.settings)}chargeAllCommands(e,n){return m(this,null,function*(){n.settings.plugin.copyLink.addCmd&&this.addCommand(yield Ao(e,this)),this.addCommand(yield Mo(e,this,this.branchName)),n.settings.upload.autoclean.enable&&(R({settings:this.settings},"Adding purge command"),this.addCommand(yield Lo(this,e,this.branchName))),this.addCommand(yield Bo(this,e,this.branchName)),this.addCommand(yield Io(this,e,this.branchName)),this.addCommand(yield $o(this,e,this.branchName)),this.addCommand(yield Vo(e,this.branchName,this)),this.addCommand(yield Go(this,e))})}cleanSpecificCommands(e){let n=this.app.commands.listCommands();for(let i of n)if(i.id.startsWith("obsidian-mkdocs-publisher")){let s=i.id.replace("obsidian-mkdocs-publisher:","").split("-"),r=s[s.length-1];r.startsWith("K")&&e.smartKey===r.replace("K","")&&this.app.commands.removeCommand(i.id)}}cleanOldCommands(){var i,s;let e=(s=(i=this.settings.github)==null?void 0:i.otherRepo)!=null?s:[],n=this.app.commands.listCommands();for(let r of n)if(r.id.startsWith("obsidian-mkdocs-publisher")){let a=r.id.replace("obsidian-mkdocs-publisher:",""),o=a.split("-")[a.split("-").length-1];o.startsWith("K")&&e.findIndex(c=>c.smartKey===o.replace("K",""))===-1&&this.app.commands.removeCommand(r.id),this.settings.upload.autoclean.enable||a==="publisher-delete-clean"&&(R({settings:this.settings},"Removing purge/clean commands"),this.app.commands.removeCommand(r.id))}}reloadCommands(){return m(this,null,function*(){var n,i;R({settings:this.settings},"Reloading commands");let e=(i=(n=this.settings.github)==null?void 0:n.otherRepo)!=null?i:[];this.cleanOldCommands();for(let s of e)s.createShortcuts?yield this.chargeAllCommands(s,this):this.cleanSpecificCommands(s)})}loadToken(){return m(this,null,function*(){let e=Jt(this,this.settings.github.tokenPath);if(!(yield this.app.vault.adapter.exists(`${e}`)))return"";try{let i=yield this.app.vault.adapter.read(`${e}`);if(e.endsWith(".json"))return JSON.parse(i).GITHUB_PUBLISHER_TOKEN;if(i)return i.split("=")[1]}catch(i){return _({settings:this.settings,e:!0},i),""}return""})}reloadOctokit(){return m(this,null,function*(){let e,n=this.settings.github.api,i=yield this.loadToken();return n.tiersForApi===Oe.entreprise&&n.hostname.length>0?e=new vn({baseUrl:`${n.hostname}/api/v3`,auth:i}):e=new vn({auth:i}),new pr(e,this)})}onload(){return m(this,null,function*(){console.info(`[GITHUB PUBLISHER] v.${this.manifest.version} (lang: ${Dr}) loaded`),yield this.loadSettings(),yield u.init({lng:Dr,fallbackLng:"en",resources:yr,returnNull:!1});let e=this.settings;if(yield is(e,this),this.branchName=this.app.vault.getName().replaceAll(" ","-").replaceAll(".","-")+"-"+new Date().toLocaleDateString("en-US").replace(/\//g,"-"),this.addSettingTab(new Ar(this.app,this,this.branchName)),!this.settings.github.verifiedRepo&&(yield this.loadToken())!==""){let i=yield this.reloadOctokit();this.settings.github.verifiedRepo=yield Ze(i,null,null,!0),this.settings.github.rateLimit=yield Ye(i.octokit,this.settings,!1),yield this.saveSettings()}this.registerEvent(this.app.workspace.on("file-menu",(i,s)=>{this.settings.plugin.fileMenu&&s instanceof mn.TFolder?Ho(i,s,this.branchName,this):s instanceof mn.TFile&&Vs(this,s,this.branchName,i)})),this.registerEvent(this.app.workspace.on("editor-menu",(i,s,r)=>{r.file&&Vs(this,r.file,this.branchName,i)})),yield this.chargeAllCommands(null,this),this.addCommand({id:"check-rate-limit",name:u.t("commands.checkValidity.rateLimit.command"),callback:()=>m(this,null,function*(){let i=yield this.reloadOctokit();this.settings.github.rateLimit=yield Ye(i.octokit,this.settings),yield this.saveSettings()})}),this.settings.github.otherRepo.length>0&&this.addCommand({id:"run-cmd-for-repo",name:u.t("commands.runOtherRepo.title"),callback:()=>m(this,null,function*(){new $s(this.app,this,this.branchName).open()})});let n=this.settings.github.otherRepo.filter(i=>i.createShortcuts);for(let i of n)yield this.chargeAllCommands(i,this)})}onunload(){console.info("[Github Publisher] unloaded")}loadSettings(){return m(this,null,function*(){let e=yield this.loadData();try{this.settings=Ua(ws,e)}catch(n){console.warn("[Github Publisher] Error while deep merging settings, using default loading method"),this.settings=Object.assign({},ws,yield this.loadData())}})}saveSettings(){return m(this,null,function*(){yield this.saveData(this.settings)})}};0&&(module.exports={}); +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ +/** + * The majority of the code was taken from obsidian-easy-bake + * @credit mgmeyers + * @source https://github.com/mgmeyers/obsidian-easy-bake + * @license GPL-3.0 + * Each function is modified to fit the needs of this plugin, but citation are done in the code for each function + */ diff --git a/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/manifest.json b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/manifest.json new file mode 100644 index 0000000..73fe54c --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/manifest.json @@ -0,0 +1,12 @@ +{ + "id": "obsidian-mkdocs-publisher", + "name": "Github Publisher", + "version": "6.12.5", + "minAppVersion": "0.15.4", + "description": "Github Publisher helps you to publish your notes on a preconfigured GitHub repository, for free, and more!", + "author": "Mara-Li", + "authorUrl": "https://github.com/Mara-Li", + "fundingUrl": "https://ko-fi.com/lisandra_dev", + "isDesktopOnly": false, + "helpUrl": "https://obsidian-publisher.netlify.app" +} diff --git a/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/styles.css b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/styles.css new file mode 100644 index 0000000..3f61982 --- /dev/null +++ b/docs/_obsidian/.obsidian/plugins/obsidian-mkdocs-publisher/styles.css @@ -0,0 +1 @@ +.github-publisher.modals .setting-item.entry{border:0!important;padding:5px!important}hr.github-publisher-hr{margin:1px!important;padding-bottom:1px}.github-publisher.modals .setting-item.entry input{width:100%}.github-publisher.modals .setting-item.entry .setting-item-info{display:none}.github-publisher .setting-item.import-export{padding-bottom:10px}.github-publisher-export-import>.setting-item-info{display:flex;flex-direction:row;gap:4px;overflow:hidden;padding:0}.setting-item.github-publisher-export-import>.setting-item-control{padding-bottom:10px}.github-publisher-import-error{display:none;color:var(--text-error)}.github-publisher-import-error.active{display:block}.github-publisher.modals .error{border-color:var(--text-error);box-shadow:0 0 0 1px var(--text-error)}.github-publisher-import-input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.github-publisher-import-label,a.github-publisher-copy,a.github-publisher-download{color:var(--text-normal);font-size:var(--font-ui-small);border-radius:var(--button-radius);border:0;padding:var(--size-4-1) var(--size-4-3);font-weight:var(--input-font-weight);font-family:inherit;cursor:pointer;background-color:var(--interactive-normal);box-shadow:var(--input-shadow);text-align:center;white-space:nowrap;text-decoration:none;transition:background-color .1s ease,box-shadow .1s ease}.github-publisher-import-label:hover,a.github-publisher-copy:hover,a.github-publisher-download:hover{background-color:var(--interactive-hover);box-shadow:var(--input-shadow-hover)}.github-publisher-import-save-button{text-align:center;width:100%}.github-publisher-copy,.github-publisher-download{position:relative;display:inline-block;margin-left:10px}.github-publisher.modals h1,.github-publisher.modals h2,.github-publisher.modals h3,.github-publisher.modals h4,.github-publisher.modals h5,.github-publisher.modals h6{margin-top:0;margin-bottom:0}.github-publisher-copy:before{color:var(--interactive-success);content:"\2713";position:absolute;left:-18px;font-weight:bold;opacity:0;transition:.15s opacity ease-in-out}.github-publisher-copy.success:before{opacity:1}.github-publisher-export-textarea,.github-publisher-import-textarea{width:100%;height:200px;font-family:var(--font-monospace);font-size:14px}.github-publisher{-webkit-user-select:text;-moz-user-select:text;user-select:text}.github-publisher textarea{width:250px;height:100px}.github-publisher .mini textarea{height:50px}.github-publisher .border-bottom{border-bottom:1px solid var(--background-modifier-border);padding-bottom:10px}.github-publisher .mini textarea{width:100%;height:50px}.github-publisher .mid-height{height:50%}.github-publisher .bake ul{margin-top:0}.github-publisher .settings-tab-bar{display:flex;flex-direction:row;gap:4px;overflow:hidden;padding:0}.github-publisher .settings-tab{padding:10px;border:1px solid var(--background-modifier-border);border-radius:5px}.github-publisher .settings-tab:hover{background-color:var(--background-modifier-hover)}@media screen and (max-width: 900px){.github-publisher .settings-tab-bar,.setting-item.github-publisher-export-import>.setting-item-control{flex-direction:column;width:100%}.setting-item.github-publisher-export-import>.setting-item-control button{width:100%}a.github-publisher-copy+button{height:10%}.github-publisher .connect-button{margin:0!important}}@media screen and (max-width: 1200px){.github-publisher .settings-tab-bar{flex-wrap:wrap}.github-publisher .settings-tab{border-bottom:1px solid var(--background-modifier-border)}.github-publisher .settings-tab-bar{border-bottom:0}.github-publisher.manage-repo button.connect{margin:0!important}}.github-publisher.manage-repo button.connect{margin:0 50%}.github-publisher .settings-tab-active{background-color:var(--color-accent);color:var(--text-on-accent);border:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.github-publisher .settings-tab-name{font-weight:bold;text-align:center}.github-publisher .settings-tab-icon{text-align:center}span.obsidian-publisher.icons{vertical-align:middle;position:relative;padding-right:5px}.github-publisher .settings-tab-page>.setting-item:first-child{margin-top:15px}.github-publisher .settings-tab-page h5{margin-bottom:10px!important}.settings-tab-page code,.github-publisher.list-changed code.code-title,.code{color:var(--code-normal);font-family:var(--font-monospace);background-color:var(--color-background);border-radius:var(--radius-s);font-size:var(--code-size)}.github-publisher.list-changed .settings-tab-page code.code-title,.code.code-title{font-size:calc(var(--code-size) * 12px);font-weight:bolder;text-decoration:underline}.github-publisher .setting-item.title input[type=text][placeholder=title]{width:100%}.github-publisher .setting-item.no-display>.setting-item-info{display:none}.github-publisher.github-publisher.modals.regex.file-path-name .disabled{pointer-events:none;opacity:.5;font-style:italic;color:var(--text-muted);cursor:default;box-shadow:none!important;border:none!important;background-color:transparent!important;font-family:var(--font-monospace)}.github-publisher.modals.github-publisher.modals{border-top:0!important}.github-publisher.list-changed h2.success{text-align:center;color:var(--color-green)}.github-publisher.list-changed h2.error{color:var(--text-error);padding:10px}.github-publisher.list-changed .emoji{padding-right:5px;font-size:18px}.github-publisher .important:not(.token){color:var(--text-error);font-weight:bold}.github-publisher .warning.embed{color:var(--color-orange);font-weight:bold;border-left:3px solid var(--color-orange);padding-left:5px}.github-publisher .error input{border:1px solid var(--text-error)}.github-publisher .max-width input,.github-publisher .max-width button{width:100%}.github-publisher .display-none .setting-item-info{display:none}@keyframes bumpAnimation{0%{transform:translateY(0)}50%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes hourglassRotation{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}span.obsidian-publisher.loading svg{animation:spin 1s linear infinite;vertical-align:middle}span.obsidian-publisher.icons svg{margin-right:2px}span.obsidian-publisher.icons svg.lucide.lucide-mail-check{animation:bumpAnimation .5s ease-in-out}.status-bar-item.plugin-obsidian-mkdocs-publisher.success{color:var(--text-success)}.notice:has(.obsidian-publisher.success.notification){background-color:var(--text-success);color:green;font-weight:bold}.notice:has(.obsidian-publisher.error.notification){background-color:var(--text-error);color:#000}.notice:has(.obsidian-publisher.load.notification),.notice:has(.obsidian-publisher.wait.notification){background-color:var(--color-yellow);color:#000}.status-bar-item.plugin-obsidian-mkdocs-publisher.error{color:var(--text-error)}span.obsidian-publisher.icons svg.lucide.lucide-hourglass{animation:hourglassRotation 1s linear infinite} diff --git a/docs/_obsidian/.obsidian/workspace.json b/docs/_obsidian/.obsidian/workspace.json new file mode 100644 index 0000000..60d4f8b --- /dev/null +++ b/docs/_obsidian/.obsidian/workspace.json @@ -0,0 +1,158 @@ +{ + "main": { + "id": "a3492329185ce8f4", + "type": "split", + "children": [ + { + "id": "5837da3ab4f01cd8", + "type": "tabs", + "children": [ + { + "id": "8e22e1b4931dbf39", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "calculation-method/calculation-method.md", + "mode": "source", + "source": false + } + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "1ee7a6042d13da88", + "type": "split", + "children": [ + { + "id": "5eb2218b1f3b4285", + "type": "tabs", + "children": [ + { + "id": "79108e1565e24d52", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical" + } + } + }, + { + "id": "0b4c8959f4f0c135", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + }, + { + "id": "617f1b736a5156f7", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {} + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "0da2cd0212dbcab5", + "type": "split", + "children": [ + { + "id": "278bcada3ac6fd96", + "type": "tabs", + "children": [ + { + "id": "c2e2afb6e520c2e3", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "calculation-method/calculation-method.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + }, + { + "id": "bf4c43a90bd67841", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "calculation-method/calculation-method.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + } + } + }, + { + "id": "6e4c11fb7ab37e0a", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true + } + } + }, + { + "id": "3f1d5359c305fcb3", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "calculation-method/calculation-method.md" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Відкрити провідник файлів": false, + "graph:Граф": false, + "canvas:Створити нове полотно": false, + "daily-notes:Сьогоднішня нотатка": false, + "templates:Вставити шаблон": false, + "command-palette:Відкрити меню команд": false + } + }, + "active": "8e22e1b4931dbf39", + "lastOpenFiles": [ + "calculation-method/appendix-a.md", + "calculation-method/calculation-method.md", + "index.md", + "calculation-method", + "Welcome.md", + "create a link.md" + ] +} \ No newline at end of file diff --git a/docs/_obsidian/calculation-method/appendix-a.md b/docs/_obsidian/calculation-method/appendix-a.md new file mode 100644 index 0000000..b131340 --- /dev/null +++ b/docs/_obsidian/calculation-method/appendix-a.md @@ -0,0 +1,1021 @@ +--- +share: "true" +layout: minimal +title: Додаток А +parent: Методика розрахунку +--- + +# Таблиця А — Середньомісячна температура зовнішнього повітря + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Область, містоСередньомісячна температура зовнішнього повітря, ℃Середня за рік
IIIIIIIVVVIVIIVIIIIXXXIXII
Автономна Республіка Крим
Ай-Петрі-3,40-3,30-0,704,809,6013,0015,5015,1011,006,702,50-1,605,80
Клепиніне-1,00-0,203,4010,0015,7020,0022,7021,8016,7010,705,701,6010,60
Сімферополь-0,300,403,7010,1016,1019,2021,8021,3016,7011,006,102,1010,60
Феодосія1,201,604,6010,6016,1020,8023,2023,1018,4012,607,603,8012,00
Ялта4,104,206,0010,6015,7019,8023,6023,2019,0013,609,506,1013,00
Вінницька область
Вінниця-5,10-3,800,508,1014,2017,2018,7018,0013,307,601,80-2,907,30
Волинська область
Ковель-3,90-2,701,308,1013,9016,9018,2017,6013,007,902,50-1,907,60
Луцьк-4,20-3,001,108,1013,9016,9018,4017,7013,207,902,40-2,407,50
Дніпропетровська область
Дніпро-4,70-3,801,109,6016,0019,6021,6020,7015,408,602,20-2,508,70
Комісарівка-4,90-3,801,009,3016,6019,0020,9020,0014,708,202,20-2,408,30
Кривий Ріг-4,30-3,301,609,6016,8019,4021,5020,7015,508,902,70-2,008,80
Донецька область
Донецьк-5,20-4,400,709,4016,4019,0021,2019,8014,908,001,80-2,908,10
Житомирська область
Житомир-5,10-4,000,407,9014,0017,1018,5017,7013,007,401,70-2,807,20
Овруч-5,10-4,100,307,9014,1017,1018,5017,6012,807,101,50-3,107,10
Закарпатська область
Берегове-2,700,105,0010,9016,9018,7020,2019,6015,7010,304,80-0,209,90
Міжгір'я-5,00-2,601,407,2012,3015,0016,4015,8012,307,402,502,406,70
Плай-6,30-6,00-2,901,907,609,9011,4011,507,703,60-1,40-5,102,70
Рахів-4,30-1,702,308,0013,0015,6017,0016,4012,907,802,80-1,807,30
Ужгород-2,40-0,204,7010,8016,8018,7020,3019,8015,5010,204,70-0,509,80
Хуст-4,30-1,303,8010,1016,1017,8019,2018,5014,508,903,70-1,308,70
Запорізька область
Гуляйполе-4,10-3,401,509,6016,6019,4021,6020,5015,108,402,50-1,908,70
Запоріжжя-3,50-2,602,0010,1016,4020,2022,4021,4016,209,603,50-1,109,60
Кирилівка-4,40-3,801,009,1015,0018,8020,6020,1014,908,102,30-2,208,30
Івано-Франківська область
Івано-Франківськ-4,30-2,601,708,1013,6016,7018,3017,7013,408,002,50-2,407,60
Пожежівська-6,20-6,00-3,301,807,2010,1011,7011,808,004,10-0,70-4,902,80
Кіровоградська область
Гайворон-4,30-3,001,609,4015,3018,4020,0019,2014,408,402,70-1,908,40
Знам'янка-5,30-4,200,708,8015,1018,5020,3019,5014,407,902,00-2,807,90
Кропивницький-4,90-3,900,809,1015,2018,6020,4019,7014,708,202,10-2,608,10
Київська область
Київ-4,70-3,601,009,0015,2018,3019,8019,0013,908,101,90-2,508,00
Миронівка-5,00-4,400,808,8015,0018,0019,8019,0014,108,001,80-2,707,80
Луганська область
Луганськ-5,00-4,201,1010,1016,1019,9022,0020,7015,108,202,20-2,508,60
Львівська область
Львів-4,00-2,701,407,9013,4016,3017,7017,2013,008,002,50-2,207,40
Миколаївська область
Миколаїв-2,60-1,602,8010,2016,4020,3022,7022,0016,8010,404,20-0,4010,10
Одеська область
Ізмаїл-1,300,204,3010,6016,3020,3022,3021,7017,0011,205,700,7010,80
Любашівка-4,30-3,001,509,3015,3018,6020,5019,9015,108,902,80-1,908,60
Одеса-1,30-0,602,909,2015,3019,6022,0021,6017,0011,305,801,1010,30
Роздільна-3,10-1,902,509,8015,8019,4021,5021,0016,109,903,90-0,909,50
Сарата-1,80-0,503,6010,0016,0020,0022,1021,3016,4010,505,100,2010,20
Полтавська область
Лубни-5,40-4,600,308,6015,3018,5020,2019,1013,707,601,30-3,307,60
Полтава-5,60-4,700,309,0015,4018,7020,5019,7014,307,701,30-3,307,80
Рівненська область
Рівне-4,60-3,400,708,0013,8016,7018,2017,5013,107,702,10-2,607,30
Сарни-4,50-3,400,908,2014,4017,1018,6017,7013,007,702,10-2,407,40
Сумська область
Ромни-6,20-5,40-0,408,2014,6018,0019,4018,4013,106,800,70-4,006,90
Суми-6,60-5,80-0,808,1014,6017,9019,5018,4013,006,700,40-4,306,80
Тернопільська область
Тернопіль-5,00-3,700,407,6013,5016,4017,8017,2012,807,501,80-3,106,90
Харківська область
Лозова-5,60-3,700,407,6013,5016,4017,8017,2012,807,501,80-3,106,90
Харків-5,90-5,100,009,0015,5018,9020,7019,7014,107,501,00-3,707,60
Херсонська область
Асканія-Нова-2,50-1,702,609,6015,6020,0022,5021,8016,509,904,200,009,90
Генічеськ-1,80-1,302,409,5016,1020,6023,1022,4017,5011,006,206,7010,50
Херсон-2,50-1,602,8010,1016,1020,0022,4021,6016,5010,104,30-0,2010,00
Хмельницька область
Хмельницький-4,90-3,600,607,9013,9016,8018,4017,7013,107,601,90-2,907,20
Черкаська область
Золотоноша-4,90-4,000,909,1015,4018,6020,2019,1014,007,801,90-2,907,20
Умань-4,80-3,700,908,7014,6017,8019,4018,6013,607,702,00-2,507,70
Черкаси-5,00-4,000,708,9015,2018,4020,1019,3014,207,902,00-2,707,90
Чернівецька область
Чернівці-4,10-2,402,008,9014,5017,6019,1018,4014,108,702,70-2,108,10
Чернігівська область
Семенівка-6,70-5,80-1,007,3013,7017,0018,5017,4012,206,200,20-4,006,30
Чернігів-5,90-4,90-0,108,0014,4017,6019,2018,1012,906,901,00-3,507,00
diff --git a/docs/_obsidian/calculation-method/calculation-method.md b/docs/_obsidian/calculation-method/calculation-method.md new file mode 100644 index 0000000..2237c60 --- /dev/null +++ b/docs/_obsidian/calculation-method/calculation-method.md @@ -0,0 +1,172 @@ +--- +share: "true" +layout: default +title: Методика розрахунку +nav_order: "2" +has_children: "true" +--- + +# Методика визначення енергоспоживання + +## 1 Визначення енергопотреби на опалення + +Згідно з ДСТУ Б EN 13790:2011[^1] енергопотреба для опалення — це теплота, яку необхідно подати або видалити з кондиціонованого об'єму для підтримання встановлених температурних умов. + +Кондиціонований об'єм — опалюваний та/або охолоджуваний об'єм. + +> [!IMPORTANT] +> В даному розрахунку розглядається лише визначення потреб на опалення, тому тут і далі поняття кондиціонований об'єм і опалюваний об'єм є тотожними. + +Річна енергопотреба на опалення, кВт·год, визначається згідно з розділами 7-14 ДСТУ Б А.2.2-12 (замінений на ДСТУ 9190:2022[^2]). + +Для кожного місяця енергопотребу для опалення $Q_{H,nd}$ Вт·год, розраховують за формулою: + +$$Q_{H,nd}=Q_{H,ht}-η_{H,gn}·Q_{H,gn}, \tag{1}$$ + +де $Q_{H,ht}$ — сумарна теплопередача в режимі опалення, Вт·год, +$Q_{H,gn}$ — сумарні теплонадходження в режимі опалення, Вт·год, +$η_{H,gn}$ — безрозмірний коефіцієнт використання надходжень. + +Для кожного місяця сумарну теплопередачу, $Q_{H,ht}$, Вт·год визначають за формулою: + +$$Q_{H,ht}=Q_{tr}+Q_{ve}, \tag{2}$$ + +де $Q_{tr}$ — сумарна теплопередача трансмісією, Вт·год, визначена згідно з розділом [[#1.1 Теплопередача трансмісією]], +$Q_{tr}$ — сумарна теплопередача вентиляцією, Вт·год, визначена згідно з розділом [1.3](#13-теплопередача-вентиляцією). + +Сумарні теплові надходження, $Q_{H,gn}$, Вт·год, для кожного місяця визначають за формулою: + +$$Q_{H,gn}=Q_{int}+Q_{sol}, \tag{3}$$ + +де $Q_{int}$ — сума внутрішніх теплонадходжень протягом кожного місяця, Вт·год, визначена згідно [1.4](#14-внутрішні-теплонадходження), +$Q_{sol}$ — сума сонячних теплонадходжень протягом кожного місяця, Вт·год, визначена згідно з розділом [1.5](#15-сонячні-теплонадходження). + +### 1.1 Теплопередача трансмісією + +Сумарну теплопередачу [трансмісією](https://en.wikipedia.org/wiki/Thermal_transmittance) $Q_{tr}$, Вт·год, розраховують для кожного місяця за формулою: + +$$Q_{tr}=H_{tr,adj}(θ_{int,set,H}-θ_e)t,\tag{4}$$ + +де $H_{tr,adj}$ — загальний коефіцієнт теплопередачі трансмісією зони, Вт/К, встановлений для різниці температур всередині-ззовні, визначений згідно з [1.2.1](#121-узагальнені-коефіцієнти-теплопередачі-трансмісією); +$θ_{int,set,H}$ — розрахункова (задана) внутрішня скоригована температура будівлі під час опалення, ℃, визначена згідно з [таблицею 1](#таблиця-1-значення-скоригованої-температури). +$θ_e$ — середньомісячна температура зовнішнього середовища, ℃, визначена згідно з [додатком А](appendix-a.md); +$t$ — тривалість місяця, для якого проводять розрахунок, год, визначена згідно з [таблицею 2](#таблиця-2-щомісячна-тривалість-часових-інтервалів). + +#### 1-1-1 Значення скоригованої температури + +| Призначення будівлі | Скоригована температура опалення, ℃ | +| :------------------------------------------------------ | :---------------------------------: | +| Одноквартирні будинки | 19 | +| Багатоквартирні будинки, гуртожитки | 19 | +| Громадські будівлі адміністративного призначення, офіси | 19 | +| Будівлі закладів освіти | 19 | +| Будівлі закладів дошкільної освіти | 21 | +| Будівлі закладів охорони здоров'я | 21 | +| Готелі | 19 | +| Ресторани | 19 | +| Спортивні заклади | 17 | +| Будівлі закладів гуртової та роздрібної торгівлі | 19 | +| Будівлі культурно-розважальних установ | 19 | +| Інші види будівель | 19 | + +#### 1-1-2 Щомісячна тривалість часових інтервалів + +| Період | Кількість діб | Кількість годин | +| :------- | :-----------: | :-------------: | +| Січень | 31 | 744 | +| Лютий | 28 | 672 | +| Березень | 31 | 744 | +| Квітень | 30 | 720 | +| Травень | 31 | 744 | +| Червень | 30 | 720 | +| Липень | 31 | 744 | +| Серпень | 31 | 744 | +| Вересень | 30 | 720 | +| Жовтень | 31 | 744 | +| Листопад | 30 | 720 | +| Грудень | 31 | 744 | +| Рік | 365 | 8760 | + +#### 1-1-3 Узагальнені коефіцієнти теплопередачі трансмісією + +Сумарне значення узагальненого коефіцієнта теплопередачі трансмісією $H_{tr,adj}$, BT/K, розраховують за формулою: + +$$H_{tr,adj}=H_D+H_g+H_U,\tag{5}$$ + +де $H_D$ — безпосередній узагальнений коефіцієнт теплопередачі трансмісією до зовнішнього середовища, Вт/К; +$H_g$ — стаціонарний узагальнений коефіцієнт теплопередачі трансмісією до ґрунту, Вт/К; + +> [!WARNING] +> Трансмісія до ґрунту враховується тільки у разі безпосереднього контакту до ґрунту огороджувальних конструкцій, що розділюють кондиціонований і некондиціонований об'єм. + +$H_U$ — узагальнений коефіцієнт теплопередачі трансмісією через некондиціоновані об'єми, Вт/К. + +> [!NOTE] +> +> - Некондиціонованим об'ємом, наприклад, є неопалюване (холодне) горище, неопалювані технічні поверхи (приміщення), неопалювана сходова клітка тощо. +> - Частковим випадком некондиціонованого об'єму є приміщення оранжерейного типу — приміщення, що не входить до кондиціонованого об'єму з переважним світлопрозорим огородженням. Наприклад, засклений балкон, лоджія, оранжерея, зимовий сад тощо. + +У загальному випадку, $H_X$ що відображає $H_D$, $H_g$ або $H_U$ сформований з трьох співмножників та його розраховують за формулою: + +$$H_X=b_{tr,x}∑_iA_iU_i,\tag{6}$$ + +де $A_i$ — площа $i$-гo елемента теплоізоляційної оболонки будівлі виміряна за внутрішніми розмірами, включно з площею внутрішніх дверних та віконних укосів, м²; +$U_i$ — приведений коефіцієнт теплопередачі $i$-го елемента теплоізоляційної оболонки будівлі, Вт/(м²·K), що визначають згідно з [1.2.1.2](#1212-приведений-коефіцієнт-теплопередачі); +$b_{tr,x}$ — поправковий коефіцієнт, що становить: + +- $b_{tr,x}=1$ — під час розрахунків $H_D$ та $H_g$; +- $b_{tr,x}≠1$ — під час розрахунків $H_U$, значення потрібно визначити згідно [1.2.1.1](#1211-поправковий-коефіцієнт-b_trx). + +> [!NOTE] +> Поправковий коефіцієнт $b_{tr,x}$ коригує коефіцієнт $H_X$ замість різниці температур. + +##### 1-1-3-1 Поправковий коефіцієнт $b_{tr,x}$ + +Коригування узагальненого коефіцієнта теплопередачі враховують поправковим коефіцієнтом $b_{tr,x}=b_U$ що базується на температурі суміжного некондиціонованого об'єму/суміжного приміщення оранжерейного типу. +Згідно з п. 8.2.2.3.9 ДСТУ 9190:2022[^2] якщо збирання повних потрібних вхідних даних є занадто трудомістким тa економічно недоцільним, а також для наявних будівель допустимо використовувати значення поправкового коефіцієнта $b_U$, наведені в [таблиці 3](#таблиця-3-значення-поправкового-коефіцієнта-b_u). + +##### 1-1-3-2 Значення поправкового коефіцієнта $b_U$ + +| Тип некондиціонованого об'єму | $b_U$ для опалювального періоду | +| :------------------------------------------------------------------------------------------------------- | :-----------------------------: | +| Технічне підпілля | 0,3 | +| Технічне (тепле) горище | 0,7 | +| Холодне горище багатоповерхових будівель | 0,9 | +| Холодне горище односімейних будівель | 1,0 | +| Неопалювана сходова клітка всередині будівлі | 0,4 | +| Неопалюване приміщення з трьома зовнішніми стінами (наприклад, зовнішні сходи) | 0,8 | +| Неопалюване приміщення з двома зовнішніми стінами тa дверима (наприклад, тамбур, хол, гараж) | 0,6 | +| Неопалюване приміщення з двома зовнішніми стінами без дверей | 0,5 | +| Неопалюване приміщення з однією зовнішньою стіною | 0,4 | +| Засклена лоджія для нового проєктування | 0,5 | +| Засклений балкон для нового проектування | 0,6 | +| Засклена лоджія наявних будівель
- задовільний стан огородження;
- незадовільний стан огородження |
0,7
0,85 | +| Засклений балкон наявних будівель
- задовільний стан огородження;
- незадовільний стан огородження |
0,8
0,9 | + +###### 1-1-3-2-1 Приведений коефіцієнт теплопередачі + +Приведений коефіцієнт теплопередачі $i$-го елемента оболонки будівлі для світлопрозорих конструкції та дверей визначають за формулою: + +### 1-2 Теплопередача вентиляцією + +### 1-3 Внутрішні теплонадходження + +### 1-4 Сонячні теплонадходження + +## 2 Іменування змінних + +| Назва величини | Символьна позначка | Назва змінної | +| :--------------------------------- | :----------------: | :-----------------------------: | +| Енергопотреба | $Q_{H,nd}$ | energyNeed | +| Сумарна теплопередача | $Q_{H,ht}$ | totalHeatTransfer | +| Сумарні теплонадходження | $Q_{H,gn}$ | totalHeatGains | +| Коефіцієнт використання надходжень | $η_{H,gn}$ | gainUtilisationFactor | +| Сумарна теплопередача трансмісією | $Q_{tr}$ | totalHeatTransferByTransmission | +| Сумарна теплопередача вентиляцією | $Q_{ve}$ | totalHeatTransferByVentilation | +| Сума внутрішніх теплонадходжень | $Q_{int}$ | SumOfInternalHeatGains | +| Сума сонячних теплонадходжень | $Q_{sol}$ | sumOfSolarHeatGains | + +## 3 Список використаних джерел + +[^1]: [ДСТУ Б EN ISO 13790:2011 Енергетична ефективність будівель. Розрахунок енергоспоживання на опалення та охолодження (EN ISO 13790:2008, IDT)](https://online.budstandart.com/ua/catalog/doc-page?id_doc=28005) +[^2]: [ДСТУ 9190:2022 Енергетична ефективність будівель. Метод розрахунку енергоспоживання під час опалення, охолодження, вентиляції, освітлення та гарячого водопостачання](https://online.budstandart.com/ua/catalog/doc-page.html?id_doc=98995) diff --git a/docs/_obsidian/index.md b/docs/_obsidian/index.md new file mode 100644 index 0000000..061bf3e --- /dev/null +++ b/docs/_obsidian/index.md @@ -0,0 +1,14 @@ +--- +share: "true" +layout: default +title: Головна +nav_order: "1" +--- + +# Мета проєкту + +Мета проєкту – розробити онлайн калькулятор (далі Калькулятор) для проведення техніко-економічної оцінки інфрачервоних довгохвильових обігрівачів ["Bilux"](https://bilux.ua/), що виконується на базі теплотехнічного розрахунку що визначає енергоспоживання системи опалення будівлі користувача відповідно до діючих державних стандартів, та порівнює його із енергоспоживанням системи стельового променевого опалення. + +# Методика розрахунку + +Визначення орієнтовного енергоспоживання будівлі виконується за методикою що бере за основу методику розрахунку енергетичного сертифікату будівлі, та описана у розділі [Методика визначення енергоспоживання](./calculation-method.md).