diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 81a65f3e..858ab734 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -60,5 +60,6 @@ "obsidian-open-weather", "obsidian-bulk-rename-plugin", "msg-handler", - "obsidian-timelines" + "obsidian-timelines", + "cron" ] \ No newline at end of file diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json new file mode 100644 index 00000000..84a84baa --- /dev/null +++ b/.obsidian/plugins/cron/data.json @@ -0,0 +1,25 @@ +{ + "cronInterval": 15, + "runOnStartup": true, + "enableMobile": true, + "watchObsidianSync": true, + "crons": [ + { + "id": "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d", + "name": "Add daily note", + "job": "daily-notes", + "frequency": "0 7 * * *", + "settings": { + "enableMobile": true, + "disableSyncCheck": true + } + } + ], + "locks": { + "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": { + "locked": false, + "lockedDeviceName": "iPhone", + "lastRun": "2023-04-07T08:27:00+02:00" + } + } +} \ No newline at end of file diff --git a/.obsidian/plugins/cron/main.js b/.obsidian/plugins/cron/main.js new file mode 100644 index 00000000..34aabce9 --- /dev/null +++ b/.obsidian/plugins/cron/main.js @@ -0,0 +1,9344 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/luxon/build/node/luxon.js +var require_luxon = __commonJS({ + "node_modules/luxon/build/node/luxon.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var LuxonError = class extends Error { + }; + var InvalidDateTimeError = class extends LuxonError { + constructor(reason) { + super(`Invalid DateTime: ${reason.toMessage()}`); + } + }; + var InvalidIntervalError = class extends LuxonError { + constructor(reason) { + super(`Invalid Interval: ${reason.toMessage()}`); + } + }; + var InvalidDurationError = class extends LuxonError { + constructor(reason) { + super(`Invalid Duration: ${reason.toMessage()}`); + } + }; + var ConflictingSpecificationError = class extends LuxonError { + }; + var InvalidUnitError = class extends LuxonError { + constructor(unit) { + super(`Invalid unit ${unit}`); + } + }; + var InvalidArgumentError = class extends LuxonError { + }; + var ZoneIsAbstractError = class extends LuxonError { + constructor() { + super("Zone is an abstract class"); + } + }; + var n = "numeric"; + var s = "short"; + var l = "long"; + var DATE_SHORT = { + year: n, + month: n, + day: n + }; + var DATE_MED = { + year: n, + month: s, + day: n + }; + var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s + }; + var DATE_FULL = { + year: n, + month: l, + day: n + }; + var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l + }; + var TIME_SIMPLE = { + hour: n, + minute: n + }; + var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n + }; + var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s + }; + var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l + }; + var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n + }; + var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n + }; + var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n + }; + var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s + }; + var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l + }; + var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var Zone = class { + /** + * The type of zone + * @abstract + * @type {string} + */ + get type() { + throw new ZoneIsAbstractError(); + } + /** + * The name of this zone. + * @abstract + * @type {string} + */ + get name() { + throw new ZoneIsAbstractError(); + } + get ianaName() { + return this.name; + } + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + get isUniversal() { + throw new ZoneIsAbstractError(); + } + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format2) { + throw new ZoneIsAbstractError(); + } + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + throw new ZoneIsAbstractError(); + } + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + throw new ZoneIsAbstractError(); + } + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */ + get isValid() { + throw new ZoneIsAbstractError(); + } + }; + var singleton$1 = null; + var SystemZone = class extends Zone { + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + static get instance() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + /** @override **/ + get type() { + return "system"; + } + /** @override **/ + get name() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + /** @override **/ + get isUniversal() { + return false; + } + /** @override **/ + offsetName(ts, { + format: format2, + locale + }) { + return parseZoneInfo(ts, format2, locale); + } + /** @override **/ + formatOffset(ts, format2) { + return formatOffset(this.offset(ts), format2); + } + /** @override **/ + offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + /** @override **/ + equals(otherZone) { + return otherZone.type === "system"; + } + /** @override **/ + get isValid() { + return true; + } + }; + var dtfCache = {}; + function makeDTF(zone) { + if (!dtfCache[zone]) { + dtfCache[zone] = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zone, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + } + return dtfCache[zone]; + } + var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 + }; + function hackyOffset(dtf, date) { + const formatted = dtf.format(date).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; + } + function partsOffset(dtf, date) { + const formatted = dtf.formatToParts(date); + const filled = []; + for (let i = 0; i < formatted.length; i++) { + const { + type, + value + } = formatted[i]; + const pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; + } + var ianaZoneCache = {}; + var IANAZone = class extends Zone { + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + static create(name) { + if (!ianaZoneCache[name]) { + ianaZoneCache[name] = new IANAZone(name); + } + return ianaZoneCache[name]; + } + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCache() { + ianaZoneCache = {}; + dtfCache = {}; + } + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated This method returns false for some valid IANA names. Use isValidZone instead. + * @return {boolean} + */ + static isValidSpecifier(s2) { + return this.isValidZone(s2); + } + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */ + static isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + } + constructor(name) { + super(); + this.zoneName = name; + this.valid = IANAZone.isValidZone(name); + } + /** @override **/ + get type() { + return "iana"; + } + /** @override **/ + get name() { + return this.zoneName; + } + /** @override **/ + get isUniversal() { + return false; + } + /** @override **/ + offsetName(ts, { + format: format2, + locale + }) { + return parseZoneInfo(ts, format2, locale, this.name); + } + /** @override **/ + formatOffset(ts, format2) { + return formatOffset(this.offset(ts), format2); + } + /** @override **/ + offset(ts) { + const date = new Date(ts); + if (isNaN(date)) + return NaN; + const dtf = makeDTF(this.name); + let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date); + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + const adjustedHour = hour === 24 ? 0 : hour; + const asUTC = objToLocalTS({ + year, + month, + day, + hour: adjustedHour, + minute, + second, + millisecond: 0 + }); + let asTS = +date; + const over = asTS % 1e3; + asTS -= over >= 0 ? over : 1e3 + over; + return (asUTC - asTS) / (60 * 1e3); + } + /** @override **/ + equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + /** @override **/ + get isValid() { + return this.valid; + } + }; + var intlLFCache = {}; + function getCachedLF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; + } + var intlDTCache = {}; + function getCachedDTF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlDTCache[key]; + if (!dtf) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache[key] = dtf; + } + return dtf; + } + var intlNumCache = {}; + function getCachedINF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let inf = intlNumCache[key]; + if (!inf) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache[key] = inf; + } + return inf; + } + var intlRelCache = {}; + function getCachedRTF(locString, opts = {}) { + const { + base, + ...cacheKeyOpts + } = opts; + const key = JSON.stringify([locString, cacheKeyOpts]); + let inf = intlRelCache[key]; + if (!inf) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache[key] = inf; + } + return inf; + } + var sysLocaleCache = null; + function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } + } + function parseLocaleString(localeStr) { + const xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + const uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + let options; + let selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + const smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + const { + numberingSystem, + calendar + } = options; + return [selectedStr, numberingSystem, calendar]; + } + } + function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += `-ca-${outputCalendar}`; + } + if (numberingSystem) { + localeStr += `-nu-${numberingSystem}`; + } + return localeStr; + } else { + return localeStr; + } + } + function mapMonths(f) { + const ms = []; + for (let i = 1; i <= 12; i++) { + const dt = DateTime.utc(2016, i, 1); + ms.push(f(dt)); + } + return ms; + } + function mapWeekdays(f) { + const ms = []; + for (let i = 1; i <= 7; i++) { + const dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; + } + function listStuff(loc, length, defaultOK, englishFn, intlFn) { + const mode = loc.listingMode(defaultOK); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } + } + function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn"; + } + } + var PolyNumberFormatter = class { + constructor(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + const { + padTo, + floor, + ...otherOpts + } = opts; + if (!forceSimple || Object.keys(otherOpts).length > 0) { + const intlOpts = { + useGrouping: false, + ...opts + }; + if (opts.padTo > 0) + intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + format(i) { + if (this.inf) { + const fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + const fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(fixed, this.padTo); + } + } + }; + var PolyDateFormatter = class { + constructor(dt, intl, opts) { + this.opts = opts; + this.originalZone = void 0; + let z = void 0; + if (this.opts.timeZone) { + this.dt = dt; + } else if (dt.zone.type === "fixed") { + const gmtOffset = -1 * (dt.offset / 60); + const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + const intlOpts = { + ...this.opts + }; + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + format() { + if (this.originalZone) { + return this.formatToParts().map(({ + value + }) => value).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + } + formatToParts() { + const parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map((part) => { + if (part.type === "timeZoneName") { + const offsetName = this.originalZone.offsetName(this.dt.ts, { + locale: this.dt.locale, + format: this.opts.timeZoneName + }); + return { + ...part, + value: offsetName + }; + } else { + return part; + } + }); + } + return parts; + } + resolvedOptions() { + return this.dtf.resolvedOptions(); + } + }; + var PolyRelFormatter = class { + constructor(intl, isEnglish, opts) { + this.opts = { + style: "long", + ...opts + }; + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + } + formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + } + }; + var Locale = class { + static fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN); + } + static create(locale, numberingSystem, outputCalendar, defaultToEN = false) { + const specifiedLocale = locale || Settings.defaultLocale; + const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale); + } + static resetCache() { + sysLocaleCache = null; + intlDTCache = {}; + intlNumCache = {}; + intlRelCache = {}; + } + static fromObject({ + locale, + numberingSystem, + outputCalendar + } = {}) { + return Locale.create(locale, numberingSystem, outputCalendar); + } + constructor(locale, numbering, outputCalendar, specifiedLocale) { + const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + get fastNumbers() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + listingMode() { + const isActuallyEn = this.isEnglish(); + const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + } + clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false); + } + } + redefaultToEN(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: true + }); + } + redefaultToSystem(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: false + }); + } + months(length, format2 = false, defaultOK = true) { + return listStuff(this, length, defaultOK, months, () => { + const intl = format2 ? { + month: length, + day: "numeric" + } : { + month: length + }, formatStr = format2 ? "format" : "standalone"; + if (!this.monthsCache[formatStr][length]) { + this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month")); + } + return this.monthsCache[formatStr][length]; + }); + } + weekdays(length, format2 = false, defaultOK = true) { + return listStuff(this, length, defaultOK, weekdays, () => { + const intl = format2 ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, formatStr = format2 ? "format" : "standalone"; + if (!this.weekdaysCache[formatStr][length]) { + this.weekdaysCache[formatStr][length] = mapWeekdays((dt) => this.extract(dt, intl, "weekday")); + } + return this.weekdaysCache[formatStr][length]; + }); + } + meridiems(defaultOK = true) { + return listStuff(this, void 0, defaultOK, () => meridiems, () => { + if (!this.meridiemCache) { + const intl = { + hour: "numeric", + hourCycle: "h12" + }; + this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map((dt) => this.extract(dt, intl, "dayperiod")); + } + return this.meridiemCache; + }); + } + eras(length, defaultOK = true) { + return listStuff(this, length, defaultOK, eras, () => { + const intl = { + era: length + }; + if (!this.eraCache[length]) { + this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) => this.extract(dt, intl, "era")); + } + return this.eraCache[length]; + }); + } + extract(dt, intlOpts, field) { + const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m) => m.type.toLowerCase() === field); + return matching ? matching.value : null; + } + numberFormatter(opts = {}) { + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + } + dtFormatter(dt, intlOpts = {}) { + return new PolyDateFormatter(dt, this.intl, intlOpts); + } + relFormatter(opts = {}) { + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + } + listFormatter(opts = {}) { + return getCachedLF(this.intl, opts); + } + isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us"); + } + equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + } + }; + var singleton = null; + var FixedOffsetZone = class extends Zone { + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + static get utcInstance() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + static instance(offset3) { + return offset3 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset3); + } + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */ + static parseSpecifier(s2) { + if (s2) { + const r = s2.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + } + constructor(offset3) { + super(); + this.fixed = offset3; + } + /** @override **/ + get type() { + return "fixed"; + } + /** @override **/ + get name() { + return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`; + } + get ianaName() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`; + } + } + /** @override **/ + offsetName() { + return this.name; + } + /** @override **/ + formatOffset(ts, format2) { + return formatOffset(this.fixed, format2); + } + /** @override **/ + get isUniversal() { + return true; + } + /** @override **/ + offset() { + return this.fixed; + } + /** @override **/ + equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + /** @override **/ + get isValid() { + return true; + } + }; + var InvalidZone = class extends Zone { + constructor(zoneName) { + super(); + this.zoneName = zoneName; + } + /** @override **/ + get type() { + return "invalid"; + } + /** @override **/ + get name() { + return this.zoneName; + } + /** @override **/ + get isUniversal() { + return false; + } + /** @override **/ + offsetName() { + return null; + } + /** @override **/ + formatOffset() { + return ""; + } + /** @override **/ + offset() { + return NaN; + } + /** @override **/ + equals() { + return false; + } + /** @override **/ + get isValid() { + return false; + } + }; + function normalizeZone(input, defaultZone2) { + if (isUndefined(input) || input === null) { + return defaultZone2; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + const lowered = input.toLowerCase(); + if (lowered === "default") + return defaultZone2; + else if (lowered === "local" || lowered === "system") + return SystemZone.instance; + else if (lowered === "utc" || lowered === "gmt") + return FixedOffsetZone.utcInstance; + else + return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && input.offset && typeof input.offset === "number") { + return input; + } else { + return new InvalidZone(input); + } + } + var now = () => Date.now(); + var defaultZone = "system"; + var defaultLocale = null; + var defaultNumberingSystem = null; + var defaultOutputCalendar = null; + var twoDigitCutoffYear = 60; + var throwOnInvalid; + var Settings = class { + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + static get now() { + return now; + } + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */ + static set now(n2) { + now = n2; + } + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + static set defaultZone(zone) { + defaultZone = zone; + } + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + static get defaultZone() { + return normalizeZone(defaultZone, SystemZone.instance); + } + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultLocale() { + return defaultLocale; + } + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultLocale(locale) { + defaultLocale = locale; + } + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultNumberingSystem() { + return defaultNumberingSystem; + } + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultNumberingSystem(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultOutputCalendar() { + return defaultOutputCalendar; + } + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultOutputCalendar(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + /** + * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + */ + static get twoDigitCutoffYear() { + return twoDigitCutoffYear; + } + /** + * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpretted as current century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 + * @example Settings.twoDigitCutoffYear = 1950 // interpretted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpretted as 50 + */ + static set twoDigitCutoffYear(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static get throwOnInvalid() { + return throwOnInvalid; + } + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static set throwOnInvalid(t) { + throwOnInvalid = t; + } + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + } + }; + function isUndefined(o) { + return typeof o === "undefined"; + } + function isNumber(o) { + return typeof o === "number"; + } + function isInteger(o) { + return typeof o === "number" && o % 1 === 0; + } + function isString(o) { + return typeof o === "string"; + } + function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; + } + function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } + } + function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; + } + function bestBy(arr, by, compare) { + if (arr.length === 0) { + return void 0; + } + return arr.reduce((best, next) => { + const pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; + } + function pick(obj, keys) { + return keys.reduce((a, k) => { + a[k] = obj[k]; + return a; + }, {}); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function integerBetween(thing, bottom2, top2) { + return isInteger(thing) && thing >= bottom2 && thing <= top2; + } + function floorMod(x, n2) { + return x - n2 * Math.floor(x / n2); + } + function padStart(input, n2 = 2) { + const isNeg = input < 0; + let padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n2, "0"); + } else { + padded = ("" + input).padStart(n2, "0"); + } + return padded; + } + function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return void 0; + } else { + return parseInt(string, 10); + } + } + function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return void 0; + } else { + return parseFloat(string); + } + } + function parseMillis(fraction) { + if (isUndefined(fraction) || fraction === null || fraction === "") { + return void 0; + } else { + const f = parseFloat("0." + fraction) * 1e3; + return Math.floor(f); + } + } + function roundTo(number, digits, towardZero = false) { + const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round; + return rounder(number * factor) / factor; + } + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + function daysInMonth(year, month) { + const modMonth = floorMod(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } + } + function objToLocalTS(obj) { + let d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; + } + function weeksInWeekYear(weekYear) { + const p1 = (weekYear + Math.floor(weekYear / 4) - Math.floor(weekYear / 100) + Math.floor(weekYear / 400)) % 7, last = weekYear - 1, p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7; + return p1 === 4 || p2 === 3 ? 53 : 52; + } + function untruncateYear(year) { + if (year > 99) { + return year; + } else + return year > Settings.twoDigitCutoffYear ? 1900 + year : 2e3 + year; + } + function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { + const date = new Date(ts), intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + const modified = { + timeZoneName: offsetFormat, + ...intlOpts + }; + const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m) => m.type.toLowerCase() === "timezonename"); + return parsed ? parsed.value : null; + } + function signedOffset(offHourStr, offMinuteStr) { + let offHour = parseInt(offHourStr, 10); + if (Number.isNaN(offHour)) { + offHour = 0; + } + const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; + } + function asNumber(value) { + const numericValue = Number(value); + if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue)) + throw new InvalidArgumentError(`Invalid unit value ${value}`); + return numericValue; + } + function normalizeObject(obj, normalizer) { + const normalized = {}; + for (const u in obj) { + if (hasOwnProperty(obj, u)) { + const v = obj[u]; + if (v === void 0 || v === null) + continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; + } + function formatOffset(offset3, format2) { + const hours = Math.trunc(Math.abs(offset3 / 60)), minutes = Math.trunc(Math.abs(offset3 % 60)), sign = offset3 >= 0 ? "+" : "-"; + switch (format2) { + case "short": + return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`; + case "narrow": + return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; + case "techie": + return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`; + default: + throw new RangeError(`Value format ${format2} is out of range for property format`); + } + } + function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); + } + var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + function months(length) { + switch (length) { + case "narrow": + return [...monthsNarrow]; + case "short": + return [...monthsShort]; + case "long": + return [...monthsLong]; + 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 weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; + var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + function weekdays(length) { + switch (length) { + case "narrow": + return [...weekdaysNarrow]; + case "short": + return [...weekdaysShort]; + case "long": + return [...weekdaysLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } + } + var meridiems = ["AM", "PM"]; + var erasLong = ["Before Christ", "Anno Domini"]; + var erasShort = ["BC", "AD"]; + var erasNarrow = ["B", "A"]; + function eras(length) { + switch (length) { + case "narrow": + return [...erasNarrow]; + case "short": + return [...erasShort]; + case "long": + return [...erasLong]; + default: + return null; + } + } + function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; + } + function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; + } + function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; + } + function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; + } + function formatRelativeTime(unit, count, numeric = "always", narrow = false) { + const units = { + 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."] + }; + const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + const isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : `next ${units[unit][0]}`; + case -1: + return isDay ? "yesterday" : `last ${units[unit][0]}`; + case 0: + return isDay ? "today" : `this ${units[unit][0]}`; + } + } + const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; + } + function stringifyTokens(splits, tokenToString) { + let s2 = ""; + for (const token of splits) { + if (token.literal) { + s2 += token.val; + } else { + s2 += tokenToString(token.val); + } + } + return s2; + } + var macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS + }; + var Formatter = class { + static create(locale, opts = {}) { + return new Formatter(locale, opts); + } + static parseFormat(fmt) { + let current = null, currentFull = "", bracketed = false; + const splits = []; + for (let i = 0; i < fmt.length; i++) { + const c = fmt.charAt(i); + if (c === "'") { + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + } + static macroTokenToFormatOpts(token) { + return macroTokenToFormatOpts[token]; + } + constructor(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + const df = this.systemLoc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.format(); + } + formatDateTime(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.format(); + } + formatDateTimeParts(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.formatToParts(); + } + formatInterval(interval, opts = {}) { + const df = this.loc.dtFormatter(interval.start, { + ...this.opts, + ...opts + }); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + } + resolvedOptions(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.resolvedOptions(); + } + num(n2, p = 0) { + if (this.opts.forceSimple) { + return padStart(n2, p); + } + const opts = { + ...this.opts + }; + if (p > 0) { + opts.padTo = p; + } + return this.loc.numberFormatter(opts).format(n2); + } + formatDateTimeFromString(dt, fmt) { + const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string = (opts, extract) => this.loc.extract(dt, opts, extract), formatOffset2 = (opts) => { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"), month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"), weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"), maybeMacro = (token) => { + const formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"), tokenToString = (token) => { + switch (token) { + case "S": + return this.num(dt.millisecond); + case "u": + case "SSS": + return this.num(dt.millisecond, 3); + case "s": + return this.num(dt.second); + case "ss": + return this.num(dt.second, 2); + case "uu": + return this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return this.num(Math.floor(dt.millisecond / 100)); + case "m": + return this.num(dt.minute); + case "mm": + return this.num(dt.minute, 2); + case "h": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return this.num(dt.hour); + case "HH": + return this.num(dt.hour, 2); + case "Z": + return formatOffset2({ + format: "narrow", + allowZ: this.opts.allowZ + }); + case "ZZ": + return formatOffset2({ + format: "short", + allowZ: this.opts.allowZ + }); + case "ZZZ": + return formatOffset2({ + format: "techie", + allowZ: this.opts.allowZ + }); + case "ZZZZ": + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: this.loc.locale + }); + case "ZZZZZ": + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: this.loc.locale + }); + case "z": + return dt.zoneName; + case "a": + return meridiem(); + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : this.num(dt.day, 2); + case "c": + return this.num(dt.weekday); + case "ccc": + return weekday("short", true); + case "cccc": + return weekday("long", true); + case "ccccc": + return weekday("narrow", true); + case "E": + return this.num(dt.weekday); + case "EEE": + return weekday("short", false); + case "EEEE": + return weekday("long", false); + case "EEEEE": + return weekday("narrow", false); + case "L": + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : this.num(dt.month); + case "LL": + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : this.num(dt.month, 2); + case "LLL": + return month("short", true); + case "LLLL": + return month("long", true); + case "LLLLL": + return month("narrow", true); + case "M": + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : this.num(dt.month); + case "MM": + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : this.num(dt.month, 2); + case "MMM": + return month("short", false); + case "MMMM": + return month("long", false); + case "MMMMM": + return month("narrow", false); + case "y": + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year); + case "yy": + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 4); + case "yyyyyy": + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 6); + case "G": + return era("short"); + case "GG": + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return this.num(dt.weekYear, 4); + case "W": + return this.num(dt.weekNumber); + case "WW": + return this.num(dt.weekNumber, 2); + case "o": + return this.num(dt.ordinal); + case "ooo": + return this.num(dt.ordinal, 3); + case "q": + return this.num(dt.quarter); + case "qq": + return this.num(dt.quarter, 2); + case "X": + return this.num(Math.floor(dt.ts / 1e3)); + case "x": + return this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + } + formatDurationFromString(dur, fmt) { + const tokenToField = (token) => { + switch (token[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; + } + }, tokenToString = (lildur) => (token) => { + const mapped = tokenToField(token); + if (mapped) { + return this.num(lildur.get(mapped), token.length); + } else { + return token; + } + }, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce((found, { + literal, + val + }) => literal ? found : found.concat(val), []), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)); + return stringifyTokens(tokens, tokenToString(collapsed)); + } + }; + var Invalid = class { + constructor(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + toMessage() { + if (this.explanation) { + return `${this.reason}: ${this.explanation}`; + } else { + return this.reason; + } + } + }; + var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + function combineRegexes(...regexes) { + const full = regexes.reduce((f, r) => f + r.source, ""); + return RegExp(`^${full}$`); + } + function combineExtractors(...extractors) { + return (m) => extractors.reduce(([mergedVals, mergedZone, cursor], ex) => { + const [val, zone, next] = ex(m, cursor); + return [{ + ...mergedVals, + ...val + }, zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + } + function parse(s2, ...patterns) { + if (s2 == null) { + return [null, null]; + } + for (const [regex, extractor] of patterns) { + const m = regex.exec(s2); + if (m) { + return extractor(m); + } + } + return [null, null]; + } + function simpleParse(...keys) { + return (match2, cursor) => { + const ret = {}; + let i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match2[cursor + i]); + } + return [ret, null, cursor + i]; + }; + } + var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/; + var isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`; + var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; + var isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`); + var isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`); + var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; + var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; + var isoOrdinalRegex = /(\d{4})-?(\d{3})/; + var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); + var extractISOOrdinalData = simpleParse("year", "ordinal"); + var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; + var sqlTimeRegex = RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`); + var sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`); + function int(match2, pos, fallback) { + const m = match2[pos]; + return isUndefined(m) ? fallback : parseInteger(m); + } + function extractISOYmd(match2, cursor) { + const item = { + year: int(match2, cursor), + month: int(match2, cursor + 1, 1), + day: int(match2, cursor + 2, 1) + }; + return [item, null, cursor + 3]; + } + function extractISOTime(match2, cursor) { + const item = { + hours: int(match2, cursor, 0), + minutes: int(match2, cursor + 1, 0), + seconds: int(match2, cursor + 2, 0), + milliseconds: parseMillis(match2[cursor + 3]) + }; + return [item, null, cursor + 4]; + } + function extractISOOffset(match2, cursor) { + const local = !match2[cursor] && !match2[cursor + 1], fullOffset = signedOffset(match2[cursor + 1], match2[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; + } + function extractIANAZone(match2, cursor) { + const zone = match2[cursor] ? IANAZone.create(match2[cursor]) : null; + return [{}, zone, cursor + 1]; + } + var isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`); + var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + function extractISODuration(match2) { + const [s2, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2; + const hasNegativePrefix = s2[0] === "-"; + const negativeSeconds = secondStr && secondStr[0] === "-"; + const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; + } + var obsOffsets = { + 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 fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + const result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) + result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; + } + var rfc2822 = /^(?:(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 extractRFC2822(match2) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr, obsOffset, milOffset, offHourStr, offMinuteStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + let offset3; + if (obsOffset) { + offset3 = obsOffsets[obsOffset]; + } else if (milOffset) { + offset3 = 0; + } else { + offset3 = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset3)]; + } + function preprocessRFC2822(s2) { + return s2.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); + } + var rfc1123 = /^(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$/; + var rfc850 = /^(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$/; + var ascii = /^(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 extractRFC1123Or850(match2) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + function extractASCII(match2) { + const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); + var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); + var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); + var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseISODate(s2) { + return parse(s2, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); + } + function parseRFC2822Date(s2) { + return parse(preprocessRFC2822(s2), [rfc2822, extractRFC2822]); + } + function parseHTTPDate(s2) { + return parse(s2, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); + } + function parseISODuration(s2) { + return parse(s2, [isoDuration, extractISODuration]); + } + var extractISOTimeOnly = combineExtractors(extractISOTime); + function parseISOTimeOnly(s2) { + return parse(s2, [isoTimeOnly, extractISOTimeOnly]); + } + var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); + var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseSQL(s2) { + return parse(s2, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); + } + var INVALID$2 = "Invalid Duration"; + var lowOrderMatrix = { + 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 + } + }; + var casualMatrix = { + 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 + }, + ...lowOrderMatrix + }; + var daysInYearAccurate = 146097 / 400; + var daysInMonthAccurate = 146097 / 4800; + var accurateMatrix = { + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3 + }, + ...lowOrderMatrix + }; + var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; + var reverseUnits = orderedUnits$1.slice(0).reverse(); + function clone$1(dur, alts, clear = false) { + const conf = { + values: clear ? alts.values : { + ...dur.values, + ...alts.values || {} + }, + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); + } + function antiTrunc(n2) { + return n2 < 0 ? Math.floor(n2) : Math.ceil(n2); + } + function convert(matrix, fromMap, fromUnit, toMap, toUnit) { + const conv = matrix[toUnit][fromUnit], raw = fromMap[fromUnit] / conv, sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]), added = !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw); + toMap[toUnit] += added; + fromMap[fromUnit] -= added * conv; + } + function normalizeValues(matrix, vals) { + reverseUnits.reduce((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + convert(matrix, vals, previous, vals, current); + } + return current; + } else { + return previous; + } + }, null); + } + function removeZeroes(vals) { + const newVals = {}; + for (const [key, value] of Object.entries(vals)) { + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; + } + var Duration = class { + /** + * @private + */ + constructor(config) { + const accurate = config.conversionAccuracy === "longterm" || false; + let matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + this.values = config.values; + this.loc = config.loc || Locale.create(); + this.conversionAccuracy = accurate ? "longterm" : "casual"; + this.invalid = config.invalid || null; + this.matrix = matrix; + this.isLuxonDuration = true; + } + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + static fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */ + static fromObject(obj, opts = {}) { + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */ + static fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`); + } + } + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */ + static fromISO(text, opts) { + const [parsed] = parseISODuration(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */ + static fromISOTime(text, opts) { + const [parsed] = parseISOTimeOnly(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid + }); + } + } + /** + * @private + */ + static normalizeUnit(unit) { + const normalized = { + 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" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) + throw new InvalidUnitError(unit); + return normalized; + } + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDuration(o) { + return o && o.isLuxonDuration || false; + } + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @return {string} + */ + toFormat(fmt, opts = {}) { + const fmtOpts = { + ...opts, + floor: opts.round !== false && opts.floor !== false + }; + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat + * @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`. + * @example + * ```js + * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * ``` + */ + toHuman(opts = {}) { + const l2 = orderedUnits$1.map((unit) => { + const val = this.values[unit]; + if (isUndefined(val)) { + return null; + } + return this.loc.numberFormatter({ + style: "unit", + unitDisplay: "long", + ...opts, + unit: unit.slice(0, -1) + }).format(val); + }).filter((n2) => n2); + return this.loc.listFormatter({ + type: "conjunction", + style: opts.listStyle || "narrow", + ...opts + }).format(l2); + } + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */ + toObject() { + if (!this.isValid) + return {}; + return { + ...this.values + }; + } + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */ + toISO() { + if (!this.isValid) + return null; + let s2 = "P"; + if (this.years !== 0) + s2 += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) + s2 += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) + s2 += this.weeks + "W"; + if (this.days !== 0) + s2 += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) + s2 += "T"; + if (this.hours !== 0) + s2 += this.hours + "H"; + if (this.minutes !== 0) + s2 += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + s2 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S"; + if (s2 === "P") + s2 += "T0S"; + return s2; + } + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */ + toISOTime(opts = {}) { + if (!this.isValid) + return null; + const millis = this.toMillis(); + if (millis < 0 || millis >= 864e5) + return null; + opts = { + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended", + ...opts + }; + const value = this.shiftTo("hours", "minutes", "seconds", "milliseconds"); + let fmt = opts.format === "basic" ? "hhmm" : "hh:mm"; + if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) { + fmt += opts.format === "basic" ? "ss" : ":ss"; + if (!opts.suppressMilliseconds || value.milliseconds !== 0) { + fmt += ".SSS"; + } + } + let str = value.toFormat(fmt); + if (opts.includePrefix) { + str = "T" + str; + } + return str; + } + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */ + toString() { + return this.toISO(); + } + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */ + toMillis() { + return this.as("milliseconds"); + } + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + plus(duration) { + if (!this.isValid) + return this; + const dur = Duration.fromDurationLike(duration), result = {}; + for (const k of orderedUnits$1) { + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + minus(duration) { + if (!this.isValid) + return this; + const dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */ + mapUnits(fn2) { + if (!this.isValid) + return this; + const result = {}; + for (const k of Object.keys(this.values)) { + result[k] = asNumber(fn2(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */ + get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */ + set(values) { + if (!this.isValid) + return this; + const mixed = { + ...this.values, + ...normalizeObject(values, Duration.normalizeUnit) + }; + return clone$1(this, { + values: mixed + }); + } + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */ + reconfigure({ + locale, + numberingSystem, + conversionAccuracy, + matrix + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem + }); + const opts = { + loc, + matrix, + conversionAccuracy + }; + return clone$1(this, opts); + } + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */ + as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + /** + * Reduce this Duration to its canonical representation in its current units. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @return {Duration} + */ + normalize() { + if (!this.isValid) + return this; + const vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */ + rescale() { + if (!this.isValid) + return this; + const vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */ + shiftTo(...units) { + if (!this.isValid) + return this; + if (units.length === 0) { + return this; + } + units = units.map((u) => Duration.normalizeUnit(u)); + const built = {}, accumulated = {}, vals = this.toObject(); + let lastUnit; + for (const k of orderedUnits$1) { + if (units.indexOf(k) >= 0) { + lastUnit = k; + let own = 0; + for (const ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + if (isNumber(vals[k])) { + own += vals[k]; + } + const i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1e3 - i * 1e3) / 1e3; + for (const down in vals) { + if (orderedUnits$1.indexOf(down) > orderedUnits$1.indexOf(k)) { + convert(this.matrix, vals, down, built, k); + } + } + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + for (const key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + return clone$1(this, { + values: built + }, true).normalize(); + } + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */ + shiftToAll() { + if (!this.isValid) + return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */ + negate() { + if (!this.isValid) + return this; + const negated = {}; + for (const k of Object.keys(this.values)) { + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + /** + * Get the years. + * @type {number} + */ + get years() { + return this.isValid ? this.values.years || 0 : NaN; + } + /** + * Get the quarters. + * @type {number} + */ + get quarters() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + /** + * Get the months. + * @type {number} + */ + get months() { + return this.isValid ? this.values.months || 0 : NaN; + } + /** + * Get the weeks + * @type {number} + */ + get weeks() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + /** + * Get the days. + * @type {number} + */ + get days() { + return this.isValid ? this.values.days || 0 : NaN; + } + /** + * Get the hours. + * @type {number} + */ + get hours() { + return this.isValid ? this.values.hours || 0 : NaN; + } + /** + * Get the minutes. + * @type {number} + */ + get minutes() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + /** + * Get the seconds. + * @return {number} + */ + get seconds() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + /** + * Get the milliseconds. + * @return {number} + */ + get milliseconds() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + get isValid() { + return this.invalid === null; + } + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + if (v1 === void 0 || v1 === 0) + return v2 === void 0 || v2 === 0; + return v1 === v2; + } + for (const u of orderedUnits$1) { + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + } + }; + var INVALID$1 = "Invalid Interval"; + function validateStartEnd(start2, end2) { + if (!start2 || !start2.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end2 || !end2.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end2 < start2) { + return Interval.invalid("end before start", `The end of an interval must be after its start, but you had start=${start2.toISO()} and end=${end2.toISO()}`); + } else { + return null; + } + } + var Interval = class { + /** + * @private + */ + constructor(config) { + this.s = config.start; + this.e = config.end; + this.invalid = config.invalid || null; + this.isLuxonInterval = true; + } + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid + }); + } + } + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */ + static fromDateTimes(start2, end2) { + const builtStart = friendlyDateTime(start2), builtEnd = friendlyDateTime(end2); + const validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static after(start2, duration) { + const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(start2); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static before(end2, duration) { + const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(end2); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */ + static fromISO(text, opts) { + const [s2, e] = (text || "").split("/", 2); + if (s2 && e) { + let start2, startIsValid; + try { + start2 = DateTime.fromISO(s2, opts); + startIsValid = start2.isValid; + } catch (e2) { + startIsValid = false; + } + let end2, endIsValid; + try { + end2 = DateTime.fromISO(e, opts); + endIsValid = end2.isValid; + } catch (e2) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start2, end2); + } + if (startIsValid) { + const dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start2, dur); + } + } else if (endIsValid) { + const dur = Duration.fromISO(s2, opts); + if (dur.isValid) { + return Interval.before(end2, dur); + } + } + } + return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isInterval(o) { + return o && o.isLuxonInterval || false; + } + /** + * Returns the start of the Interval + * @type {DateTime} + */ + get start() { + return this.isValid ? this.s : null; + } + /** + * Returns the end of the Interval + * @type {DateTime} + */ + get end() { + return this.isValid ? this.e : null; + } + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + get isValid() { + return this.invalidReason === null; + } + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + length(unit = "milliseconds") { + return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; + } + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @return {number} + */ + count(unit = "milliseconds") { + if (!this.isValid) + return NaN; + const start2 = this.start.startOf(unit), end2 = this.end.startOf(unit); + return Math.floor(end2.diff(start2, unit).get(unit)) + (end2.valueOf() !== this.end.valueOf()); + } + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */ + hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */ + isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isAfter(dateTime) { + if (!this.isValid) + return false; + return this.s > dateTime; + } + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isBefore(dateTime) { + if (!this.isValid) + return false; + return this.e <= dateTime; + } + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + contains(dateTime) { + if (!this.isValid) + return false; + return this.s <= dateTime && this.e > dateTime; + } + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */ + set({ + start: start2, + end: end2 + } = {}) { + if (!this.isValid) + return this; + return Interval.fromDateTimes(start2 || this.s, end2 || this.e); + } + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */ + splitAt(...dateTimes) { + if (!this.isValid) + return []; + const sorted = dateTimes.map(friendlyDateTime).filter((d) => this.contains(d)).sort(), results = []; + let { + s: s2 + } = this, i = 0; + while (s2 < this.e) { + const added = sorted[i] || this.e, next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s2, next)); + s2 = next; + i += 1; + } + return results; + } + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */ + splitBy(duration) { + const dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + let { + s: s2 + } = this, idx = 1, next; + const results = []; + while (s2 < this.e) { + const added = this.start.plus(dur.mapUnits((x) => x * idx)); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s2, next)); + s2 = next; + idx += 1; + } + return results; + } + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */ + divideEqually(numberOfParts) { + if (!this.isValid) + return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */ + overlaps(other) { + return this.e > other.s && this.s < other.e; + } + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */ + abutsStart(other) { + if (!this.isValid) + return false; + return +this.e === +other.s; + } + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */ + abutsEnd(other) { + if (!this.isValid) + return false; + return +other.e === +this.s; + } + /** + * Return whether this Interval engulfs the start and end of the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + engulfs(other) { + if (!this.isValid) + return false; + return this.s <= other.s && this.e >= other.e; + } + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */ + intersection(other) { + if (!this.isValid) + return this; + const s2 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e; + if (s2 >= e) { + return null; + } else { + return Interval.fromDateTimes(s2, e); + } + } + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */ + union(other) { + if (!this.isValid) + return this; + const s2 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s2, e); + } + /** + * Merge an array of Intervals into a equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * @param {Array} intervals + * @return {Array} + */ + static merge(intervals) { + const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce(([sofar, current], item) => { + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]); + if (final) { + found.push(final); + } + return found; + } + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */ + static xor(intervals) { + let start2 = null, currentCount = 0; + const results = [], ends = intervals.map((i) => [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b) => a.time - b.time); + for (const i of arr) { + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start2 = i.time; + } else { + if (start2 && +start2 !== +i.time) { + results.push(Interval.fromDateTimes(start2, i.time)); + } + start2 = null; + } + } + return Interval.merge(results); + } + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */ + difference(...intervals) { + return Interval.xor([this].concat(intervals)).map((i) => this.intersection(i)).filter((i) => i && !i.isEmpty()); + } + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */ + toString() { + if (!this.isValid) + return INVALID$1; + return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`; + } + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISO(opts) { + if (!this.isValid) + return INVALID$1; + return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; + } + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */ + toISODate() { + if (!this.isValid) + return INVALID$1; + return `${this.s.toISODate()}/${this.e.toISODate()}`; + } + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISOTime(opts) { + if (!this.isValid) + return INVALID$1; + return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; + } + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */ + toFormat(dateFormat, { + separator = " \u2013 " + } = {}) { + if (!this.isValid) + return INVALID$1; + return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; + } + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */ + toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */ + mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + } + }; + var Info = class { + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + static hasDST(zone = Settings.defaultZone) { + const proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */ + static isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */ + static normalizeZone(input) { + return normalizeZone(input, Settings.defaultZone); + } + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */ + static months(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */ + static monthsFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */ + static weekdays(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */ + static weekdaysFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */ + static meridiems({ + locale = null + } = {}) { + return Locale.create(locale).meridiems(); + } + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */ + static eras(length = "short", { + locale = null + } = {}) { + return Locale.create(locale, null, "gregory").eras(length); + } + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * @example Info.features() //=> { relative: false } + * @return {Object} + */ + static features() { + return { + relative: hasRelative() + }; + } + }; + function dayDiff(earlier, later) { + const utcDayStart = (dt) => dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); + } + function highOrderDiffs(cursor, later, units) { + const differs = [["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], ["weeks", (a, b) => { + const days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + const results = {}; + const earlier = cursor; + let lowestOrder, highWater; + for (const [unit, differ] of differs) { + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + results[unit]--; + cursor = earlier.plus(results); + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; + } + function diff(earlier, later, units, opts) { + let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units); + const remainingMillis = later - cursor; + const lowerOrderUnits = units.filter((u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + highWater = cursor.plus({ + [lowestOrder]: 1 + }); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + const duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration); + } else { + return duration; + } + } + var numberingSystems = { + 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" + }; + var numberingSystemsUTF16 = { + 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] + }; + var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + function parseDigits(str) { + let value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (const key in numberingSystemsUTF16) { + const [min2, max2] = numberingSystemsUTF16[key]; + if (code >= min2 && code <= max2) { + value += code - min2; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } + } + function digitRegex({ + numberingSystem + }, append = "") { + return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`); + } + var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + function intUnit(regex, post = (i) => i) { + return { + regex, + deser: ([s2]) => post(parseDigits(s2)) + }; + } + var NBSP = String.fromCharCode(160); + var spaceOrNBSP = `[ ${NBSP}]`; + var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + function fixListRegex(s2) { + return s2.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); + } + function stripInsensitivities(s2) { + return s2.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase(); + } + function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: ([s2]) => strings.findIndex((i) => stripInsensitivities(s2) === stripInsensitivities(i)) + startIndex + }; + } + } + function offset2(regex, groups) { + return { + regex, + deser: ([, h, m]) => signedOffset(h, m), + groups + }; + } + function simple(regex) { + return { + regex, + deser: ([s2]) => s2 + }; + } + function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + } + function unitForToken(token, loc) { + const one = digitRegex(loc), two = digitRegex(loc, "{2}"), three = digitRegex(loc, "{3}"), four = digitRegex(loc, "{4}"), six = digitRegex(loc, "{6}"), oneOrTwo = digitRegex(loc, "{1,2}"), oneToThree = digitRegex(loc, "{1,3}"), oneToSix = digitRegex(loc, "{1,6}"), oneToNine = digitRegex(loc, "{1,9}"), twoToFour = digitRegex(loc, "{2,4}"), fourToSix = digitRegex(loc, "{4,6}"), literal = (t) => ({ + regex: RegExp(escapeToken(t.val)), + deser: ([s2]) => s2, + literal: true + }), unitate = (t) => { + if (token.literal) { + return literal(t); + } + switch (t.val) { + case "G": + return oneOf(loc.eras("short", false), 0); + case "GG": + return oneOf(loc.eras("long", false), 0); + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true, false), 1); + case "MMMM": + return oneOf(loc.months("long", true, false), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false, false), 1); + case "LLLL": + return oneOf(loc.months("long", false, false), 1); + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + case "a": + return oneOf(loc.meridiems(), 0); + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false, false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false, false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true, false), 1); + case "cccc": + return oneOf(loc.weekdays("long", true, false), 1); + case "Z": + case "ZZ": + return offset2(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); + case "ZZZ": + return offset2(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + const unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; + } + var partTypeStyleToTokenVal = { + 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", + hour: { + numeric: "h", + "2-digit": "hh" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } + }; + function tokenForPart(part, formatOpts) { + const { + type, + value + } = part; + if (type === "literal") { + const isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + const style = formatOpts[type]; + let val = partTypeStyleToTokenVal[type]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val + }; + } + return void 0; + } + function buildRegex(units) { + const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); + return [`^${re}$`, units]; + } + function match(input, regex, handlers) { + const matches = input.match(regex); + if (matches) { + const all = {}; + let matchIndex = 1; + for (const i in handlers) { + if (hasOwnProperty(handlers, i)) { + const h = handlers[i], groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } + } + function dateTimeFromMatches(matches) { + const toField = (token) => { + switch (token) { + 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; + } + }; + let zone = null; + let specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + const vals = Object.keys(matches).reduce((r, k) => { + const f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; + } + var dummyDateTimeCache = null; + function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; + } + function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + const formatOpts = Formatter.macroTokenToFormatOpts(token.val); + const tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(void 0)) { + return token; + } + return tokens; + } + function expandMacroTokens(tokens, locale) { + return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale))); + } + function explainFromTokens(locale, input, format2) { + const tokens = expandMacroTokens(Formatter.parseFormat(format2), locale), units = tokens.map((t) => unitForToken(t, locale)), disqualifyingUnit = units.find((t) => t.invalidReason); + if (disqualifyingUnit) { + return { + input, + tokens, + invalidReason: disqualifyingUnit.invalidReason + }; + } else { + const [regexString, handlers] = buildRegex(units), regex = RegExp(regexString, "i"), [rawMatches, matches] = match(input, regex, handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, void 0]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input, + tokens, + regex, + rawMatches, + matches, + result, + zone, + specificOffset + }; + } + } + function parseFromTokens(locale, input, format2) { + const { + result, + zone, + specificOffset, + invalidReason + } = explainFromTokens(locale, input, format2); + return [result, zone, specificOffset, invalidReason]; + } + function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + const formatter = Formatter.create(locale, formatOpts); + const parts = formatter.formatDateTimeParts(getDummyDateTime()); + return parts.map((p) => tokenForPart(p, formatOpts)); + } + var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; + var leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`); + } + function dayOfWeek(year, month, day) { + const d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + const js = d.getUTCDay(); + return js === 0 ? 7 : js; + } + function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; + } + function uncomputeOrdinal(year, ordinal) { + const table = isLeapYear(year) ? leapLadder : nonLeapLadder, month0 = table.findIndex((i) => i < ordinal), day = ordinal - table[month0]; + return { + month: month0 + 1, + day + }; + } + function gregorianToWeek(gregObj) { + const { + year, + month, + day + } = gregObj, ordinal = computeOrdinal(year, month, day), weekday = dayOfWeek(year, month, day); + let weekNumber = Math.floor((ordinal - weekday + 10) / 7), weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear); + } else if (weekNumber > weeksInWeekYear(year)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return { + weekYear, + weekNumber, + weekday, + ...timeObject(gregObj) + }; + } + function weekToGregorian(weekData) { + const { + weekYear, + weekNumber, + weekday + } = weekData, weekdayOfJan4 = dayOfWeek(weekYear, 1, 4), yearInDays = daysInYear(weekYear); + let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3, year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(weekData) + }; + } + function gregorianToOrdinal(gregData) { + const { + year, + month, + day + } = gregData; + const ordinal = computeOrdinal(year, month, day); + return { + year, + ordinal, + ...timeObject(gregData) + }; + } + function ordinalToGregorian(ordinalData) { + const { + year, + ordinal + } = ordinalData; + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(ordinalData) + }; + } + function hasInvalidWeekData(obj) { + const validYear = isInteger(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)), validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.week); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else + return false; + } + function hasInvalidOrdinalData(obj) { + const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else + return false; + } + function hasInvalidGregorianData(obj) { + const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else + return false; + } + function hasInvalidTimeData(obj) { + const { + hour, + minute, + second, + millisecond + } = obj; + const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween(minute, 0, 59), validSecond = integerBetween(second, 0, 59), validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else + return false; + } + var INVALID = "Invalid DateTime"; + var MAX_DATE = 864e13; + function unsupportedZone(zone) { + return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`); + } + function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; + } + function clone(inst, alts) { + const current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime({ + ...current, + ...alts, + old: current + }); + } + function fixOffset(localTS, o, tz) { + let utcGuess = localTS - o * 60 * 1e3; + const o2 = tz.offset(utcGuess); + if (o === o2) { + return [utcGuess, o]; + } + utcGuess -= (o2 - o) * 60 * 1e3; + const o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + return [localTS - Math.min(o2, o3) * 60 * 1e3, Math.max(o2, o3)]; + } + function tsToObj(ts, offset3) { + ts += offset3 * 60 * 1e3; + const d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; + } + function objToTS(obj, offset3, zone) { + return fixOffset(objToLocalTS(obj), offset3, zone); + } + function adjustTime(inst, dur) { + const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = { + ...inst.c, + year, + month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }, millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), localTS = objToLocalTS(c); + let [ts, o] = fixOffset(localTS, oPre, inst.zone); + if (millisToAdd !== 0) { + ts += millisToAdd; + o = inst.zone.offset(ts); + } + return { + ts, + o + }; + } + function parseDataToDateTime(parsed, parsedZone, opts, format2, text, specificOffset) { + const { + setZone, + zone + } = opts; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, { + ...opts, + zone: interpretationZone, + specificOffset + }); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", `the input "${text}" can't be parsed as ${format2}`)); + } + } + function toTechFormat(dt, format2, allowZ = true) { + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format2) : null; + } + function toISODate(o, extended) { + const longFormat = o.c.year > 9999 || o.c.year < 0; + let c = ""; + if (longFormat && o.c.year >= 0) + c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (extended) { + c += "-"; + c += padStart(o.c.month); + c += "-"; + c += padStart(o.c.day); + } else { + c += padStart(o.c.month); + c += padStart(o.c.day); + } + return c; + } + function toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { + let c = padStart(o.c.hour); + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (o.c.second !== 0 || !suppressSeconds) { + c += ":"; + } + } else { + c += padStart(o.c.minute); + } + if (o.c.second !== 0 || !suppressSeconds) { + c += padStart(o.c.second); + if (o.c.millisecond !== 0 || !suppressMilliseconds) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; + } + var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + var defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + var defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"]; + var orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"]; + var orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + function normalizeUnit(unit) { + const normalized = { + 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" + }[unit.toLowerCase()]; + if (!normalized) + throw new InvalidUnitError(unit); + return normalized; + } + function quickDT(obj, opts) { + const zone = normalizeZone(opts.zone, Settings.defaultZone), loc = Locale.fromObject(opts), tsNow = Settings.now(); + let ts, o; + if (!isUndefined(obj.year)) { + for (const u of orderedUnits) { + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + const offsetProvis = zone.offset(tsNow); + [ts, o] = objToTS(obj, offsetProvis, zone); + } else { + ts = tsNow; + } + return new DateTime({ + ts, + zone, + loc, + o + }); + } + function diffRelative(start2, end2, opts) { + const round2 = isUndefined(opts.round) ? true : opts.round, format2 = (c, unit) => { + c = roundTo(c, round2 || opts.calendary ? 0 : 2, true); + const formatter = end2.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, differ = (unit) => { + if (opts.calendary) { + if (!end2.hasSame(start2, unit)) { + return end2.startOf(unit).diff(start2.startOf(unit), unit).get(unit); + } else + return 0; + } else { + return end2.diff(start2, unit).get(unit); + } + }; + if (opts.unit) { + return format2(differ(opts.unit), opts.unit); + } + for (const unit of opts.units) { + const count = differ(unit); + if (Math.abs(count) >= 1) { + return format2(count, unit); + } + } + return format2(start2 > end2 ? -0 : 0, opts.units[opts.units.length - 1]); + } + function lastOpts(argList) { + let opts = {}, args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; + } + var DateTime = class { + /** + * @access private + */ + constructor(config) { + const zone = config.zone || Settings.defaultZone; + let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + let c = null, o = null; + if (!invalid) { + const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + [c, o] = [config.old.c, config.old.o]; + } else { + const ot = zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + this._zone = zone; + this.loc = config.loc || Locale.create(); + this.invalid = invalid; + this.weekData = null; + this.c = c; + this.o = o; + this.isLuxonDateTime = true; + } + // CONSTRUCT + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + static now() { + return new DateTime({}); + } + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */ + static local() { + const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */ + static utc() { + const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */ + static fromJSDate(date, options = {}) { + const ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + const zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromMillis(milliseconds, options = {}) { + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromSeconds(seconds, options = {}) { + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1e3, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @return {DateTime} + */ + static fromObject(obj, opts = {}) { + obj = obj || {}; + const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + const tsNow = Settings.now(), offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), normalized = normalizeObject(obj, normalizeUnit), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber, loc = Locale.fromObject(opts); + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + let foundFirst = false; + for (const u of units) { + const v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + const gregorian = useWeekData ? weekToGregorian(normalized) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc + }); + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`); + } + return inst; + } + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */ + static fromISO(text, opts = {}) { + const [vals, parsedZone] = parseISODate(text); + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */ + static fromRFC2822(text, opts = {}) { + const [vals, parsedZone] = parseRFC2822Date(text); + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */ + static fromHTTP(text, opts = {}) { + const [vals, parsedZone] = parseHTTPDate(text); + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromFormat(text, fmt, opts = {}) { + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + const { + locale = null, + numberingSystem = null + } = opts, localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt); + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); + } + } + /** + * @deprecated use fromFormat instead + */ + static fromString(text, fmt, opts = {}) { + return DateTime.fromFormat(text, fmt, opts); + } + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */ + static fromSQL(text, opts = {}) { + const [vals, parsedZone] = parseSQL(text); + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + /** + * Create an invalid DateTime. + * @param {DateTime} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid + }); + } + } + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */ + static parseFormatForOpts(formatOpts, localeOpts = {}) { + const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map((t) => t ? t.val : null).join(""); + } + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */ + static expandFormat(fmt, localeOpts = {}) { + const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map((t) => t.val).join(""); + } + // INFO + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */ + get(unit) { + return this[unit]; + } + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */ + get isValid() { + return this.invalid === null; + } + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + get outputCalendar() { + return this.isValid ? this.loc.outputCalendar : null; + } + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + get zone() { + return this._zone; + } + /** + * Get the name of the time zone. + * @type {string} + */ + get zoneName() { + return this.isValid ? this.zone.name : null; + } + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + get year() { + return this.isValid ? this.c.year : NaN; + } + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + get quarter() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + get month() { + return this.isValid ? this.c.month : NaN; + } + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + get day() { + return this.isValid ? this.c.day : NaN; + } + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + get hour() { + return this.isValid ? this.c.hour : NaN; + } + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + get minute() { + return this.isValid ? this.c.minute : NaN; + } + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + get second() { + return this.isValid ? this.c.second : NaN; + } + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + get millisecond() { + return this.isValid ? this.c.millisecond : NaN; + } + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + get weekYear() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + get weekNumber() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + get weekday() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + get ordinal() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + get monthShort() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + get monthLong() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + get weekdayShort() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + get weekdayLong() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + get offset() { + return this.isValid ? +this.o : NaN; + } + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameShort() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameLong() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + get isOffsetFixed() { + return this.isValid ? this.zone.isUniversal : null; + } + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + get isInDST() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */ + get isInLeapYear() { + return isLeapYear(this.year); + } + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + get daysInMonth() { + return daysInMonth(this.year, this.month); + } + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + get daysInYear() { + return this.isValid ? daysInYear(this.year) : NaN; + } + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + get weeksInWeekYear() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + resolvedLocaleOptions(opts = {}) { + const { + locale, + numberingSystem, + calendar + } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this); + return { + locale, + numberingSystem, + outputCalendar: calendar + }; + } + // TRANSFORM + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */ + toUTC(offset3 = 0, opts = {}) { + return this.setZone(FixedOffsetZone.instance(offset3), opts); + } + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */ + toLocal() { + return this.setZone(Settings.defaultZone); + } + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */ + setZone(zone, { + keepLocalTime = false, + keepCalendarTime = false + } = {}) { + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + let newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + const offsetGuess = zone.offset(this.ts); + const asObj = this.toObject(); + [newTS] = objToTS(asObj, offsetGuess, zone); + } + return clone(this, { + ts: newTS, + zone + }); + } + } + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */ + reconfigure({ + locale, + numberingSystem, + outputCalendar + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem, + outputCalendar + }); + return clone(this, { + loc + }); + } + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */ + setLocale(locale) { + return this.reconfigure({ + locale + }); + } + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */ + set(values) { + if (!this.isValid) + return this; + const normalized = normalizeObject(values, normalizeUnit), settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + let mixed; + if (settingWeekStuff) { + mixed = weekToGregorian({ + ...gregorianToWeek(this.c), + ...normalized + }); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian({ + ...gregorianToOrdinal(this.c), + ...normalized + }); + } else { + mixed = { + ...this.toObject(), + ...normalized + }; + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + const [ts, o] = objToTS(mixed, this.o, this.zone); + return clone(this, { + ts, + o + }); + } + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */ + plus(duration) { + if (!this.isValid) + return this; + const dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */ + minus(duration) { + if (!this.isValid) + return this; + const dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */ + startOf(unit) { + if (!this.isValid) + return this; + const o = {}, normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + case "quarters": + case "months": + o.day = 1; + case "weeks": + case "days": + o.hour = 0; + case "hours": + o.minute = 0; + case "minutes": + o.second = 0; + case "seconds": + o.millisecond = 0; + break; + } + if (normalizedUnit === "weeks") { + o.weekday = 1; + } + if (normalizedUnit === "quarters") { + const q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */ + endOf(unit) { + return this.isValid ? this.plus({ + [unit]: 1 + }).startOf(unit).minus(1) : this; + } + // OUTPUT + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */ + toFormat(fmt, opts = {}) { + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */ + toLocaleParts(opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @return {string} + */ + toISO({ + format: format2 = "extended", + suppressSeconds = false, + suppressMilliseconds = false, + includeOffset = true, + extendedZone = false + } = {}) { + if (!this.isValid) { + return null; + } + const ext = format2 === "extended"; + let c = toISODate(this, ext); + c += "T"; + c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + return c; + } + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @return {string} + */ + toISODate({ + format: format2 = "extended" + } = {}) { + if (!this.isValid) { + return null; + } + return toISODate(this, format2 === "extended"); + } + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */ + toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @return {string} + */ + toISOTime({ + suppressMilliseconds = false, + suppressSeconds = false, + includeOffset = true, + includePrefix = false, + extendedZone = false, + format: format2 = "extended" + } = {}) { + if (!this.isValid) { + return null; + } + let c = includePrefix ? "T" : ""; + return c + toISOTime(this, format2 === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone); + } + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */ + toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */ + toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string} + */ + toSQLDate() { + if (!this.isValid) { + return null; + } + return toISODate(this, true); + } + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */ + toSQLTime({ + includeOffset = true, + includeZone = false, + includeOffsetSpace = true + } = {}) { + let fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */ + toSQL(opts = {}) { + if (!this.isValid) { + return null; + } + return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; + } + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */ + toString() { + return this.isValid ? this.toISO() : INVALID; + } + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */ + toMillis() { + return this.isValid ? this.ts : NaN; + } + /** + * Returns the epoch seconds of this DateTime. + * @return {number} + */ + toSeconds() { + return this.isValid ? this.ts / 1e3 : NaN; + } + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */ + toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1e3) : NaN; + } + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */ + toBSON() { + return this.toJSDate(); + } + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */ + toObject(opts = {}) { + if (!this.isValid) + return {}; + const base = { + ...this.c + }; + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */ + toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + // COMPARE + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */ + diff(otherDateTime, unit = "milliseconds", opts = {}) { + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + const durOpts = { + locale: this.locale, + numberingSystem: this.numberingSystem, + ...opts + }; + const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + diffNow(unit = "milliseconds", opts = {}) { + return this.diff(DateTime.now(), unit, opts); + } + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval} + */ + until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */ + hasSame(otherDateTime, unit) { + if (!this.isValid) + return false; + const inputMs = otherDateTime.valueOf(); + const adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit); + } + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */ + equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds down by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */ + toRelative(options = {}) { + if (!this.isValid) + return null; + const base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), padding = options.padding ? this < base ? -options.padding : options.padding : 0; + let units = ["years", "months", "days", "hours", "minutes", "seconds"]; + let unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = void 0; + } + return diffRelative(base, this.plus(padding), { + ...options, + numeric: "always", + units, + unit + }); + } + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */ + toRelativeCalendar(options = {}) { + if (!this.isValid) + return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, { + ...options, + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + }); + } + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */ + static min(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.min); + } + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */ + static max(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.max); + } + // MISC + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */ + static fromFormatExplain(text, fmt, options = {}) { + const { + locale = null, + numberingSystem = null + } = options, localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + /** + * @deprecated use fromFormatExplain instead + */ + static fromStringExplain(text, fmt, options = {}) { + return DateTime.fromFormatExplain(text, fmt, options); + } + // FORMAT PRESETS + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */ + static get DATE_SHORT() { + return DATE_SHORT; + } + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED() { + return DATE_MED; + } + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED_WITH_WEEKDAY() { + return DATE_MED_WITH_WEEKDAY; + } + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + static get DATE_FULL() { + return DATE_FULL; + } + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + static get DATE_HUGE() { + return DATE_HUGE; + } + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_SIMPLE() { + return TIME_SIMPLE; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SECONDS() { + return TIME_WITH_SECONDS; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SHORT_OFFSET() { + return TIME_WITH_SHORT_OFFSET; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_LONG_OFFSET() { + return TIME_WITH_LONG_OFFSET; + } + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + static get TIME_24_SIMPLE() { + return TIME_24_SIMPLE; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SECONDS() { + return TIME_24_WITH_SECONDS; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SHORT_OFFSET() { + return TIME_24_WITH_SHORT_OFFSET; + } + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_LONG_OFFSET() { + return TIME_24_WITH_LONG_OFFSET; + } + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT() { + return DATETIME_SHORT; + } + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT_WITH_SECONDS() { + return DATETIME_SHORT_WITH_SECONDS; + } + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED() { + return DATETIME_MED; + } + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_SECONDS() { + return DATETIME_MED_WITH_SECONDS; + } + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_WEEKDAY() { + return DATETIME_MED_WITH_WEEKDAY; + } + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL() { + return DATETIME_FULL; + } + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL_WITH_SECONDS() { + return DATETIME_FULL_WITH_SECONDS; + } + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE() { + return DATETIME_HUGE; + } + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE_WITH_SECONDS() { + return DATETIME_HUGE_WITH_SECONDS; + } + }; + function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`); + } + } + var VERSION = "3.3.0"; + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.FixedOffsetZone = FixedOffsetZone; + exports.IANAZone = IANAZone; + exports.Info = Info; + exports.Interval = Interval; + exports.InvalidZone = InvalidZone; + exports.Settings = Settings; + exports.SystemZone = SystemZone; + exports.VERSION = VERSION; + exports.Zone = Zone; + } +}); + +// node_modules/cron-parser/lib/date.js +var require_date = __commonJS({ + "node_modules/cron-parser/lib/date.js"(exports, module2) { + "use strict"; + var luxon = require_luxon(); + CronDate.prototype.addYear = function() { + this._date = this._date.plus({ years: 1 }); + }; + CronDate.prototype.addMonth = function() { + this._date = this._date.plus({ months: 1 }).startOf("month"); + }; + CronDate.prototype.addDay = function() { + this._date = this._date.plus({ days: 1 }).startOf("day"); + }; + CronDate.prototype.addHour = function() { + var prev = this._date; + this._date = this._date.plus({ hours: 1 }).startOf("hour"); + if (this._date <= prev) { + this._date = this._date.plus({ hours: 1 }); + } + }; + CronDate.prototype.addMinute = function() { + var prev = this._date; + this._date = this._date.plus({ minutes: 1 }).startOf("minute"); + if (this._date < prev) { + this._date = this._date.plus({ hours: 1 }); + } + }; + CronDate.prototype.addSecond = function() { + var prev = this._date; + this._date = this._date.plus({ seconds: 1 }).startOf("second"); + if (this._date < prev) { + this._date = this._date.plus({ hours: 1 }); + } + }; + CronDate.prototype.subtractYear = function() { + this._date = this._date.minus({ years: 1 }); + }; + CronDate.prototype.subtractMonth = function() { + this._date = this._date.minus({ months: 1 }).endOf("month").startOf("second"); + }; + CronDate.prototype.subtractDay = function() { + this._date = this._date.minus({ days: 1 }).endOf("day").startOf("second"); + }; + CronDate.prototype.subtractHour = function() { + var prev = this._date; + this._date = this._date.minus({ hours: 1 }).endOf("hour").startOf("second"); + if (this._date >= prev) { + this._date = this._date.minus({ hours: 1 }); + } + }; + CronDate.prototype.subtractMinute = function() { + var prev = this._date; + this._date = this._date.minus({ minutes: 1 }).endOf("minute").startOf("second"); + if (this._date > prev) { + this._date = this._date.minus({ hours: 1 }); + } + }; + CronDate.prototype.subtractSecond = function() { + var prev = this._date; + this._date = this._date.minus({ seconds: 1 }).startOf("second"); + if (this._date > prev) { + this._date = this._date.minus({ hours: 1 }); + } + }; + CronDate.prototype.getDate = function() { + return this._date.day; + }; + CronDate.prototype.getFullYear = function() { + return this._date.year; + }; + CronDate.prototype.getDay = function() { + var weekday = this._date.weekday; + return weekday == 7 ? 0 : weekday; + }; + CronDate.prototype.getMonth = function() { + return this._date.month - 1; + }; + CronDate.prototype.getHours = function() { + return this._date.hour; + }; + CronDate.prototype.getMinutes = function() { + return this._date.minute; + }; + CronDate.prototype.getSeconds = function() { + return this._date.second; + }; + CronDate.prototype.getMilliseconds = function() { + return this._date.millisecond; + }; + CronDate.prototype.getTime = function() { + return this._date.valueOf(); + }; + CronDate.prototype.getUTCDate = function() { + return this._getUTC().day; + }; + CronDate.prototype.getUTCFullYear = function() { + return this._getUTC().year; + }; + CronDate.prototype.getUTCDay = function() { + var weekday = this._getUTC().weekday; + return weekday == 7 ? 0 : weekday; + }; + CronDate.prototype.getUTCMonth = function() { + return this._getUTC().month - 1; + }; + CronDate.prototype.getUTCHours = function() { + return this._getUTC().hour; + }; + CronDate.prototype.getUTCMinutes = function() { + return this._getUTC().minute; + }; + CronDate.prototype.getUTCSeconds = function() { + return this._getUTC().second; + }; + CronDate.prototype.toISOString = function() { + return this._date.toUTC().toISO(); + }; + CronDate.prototype.toJSON = function() { + return this._date.toJSON(); + }; + CronDate.prototype.setDate = function(d) { + this._date = this._date.set({ day: d }); + }; + CronDate.prototype.setFullYear = function(y) { + this._date = this._date.set({ year: y }); + }; + CronDate.prototype.setDay = function(d) { + this._date = this._date.set({ weekday: d }); + }; + CronDate.prototype.setMonth = function(m) { + this._date = this._date.set({ month: m + 1 }); + }; + CronDate.prototype.setHours = function(h) { + this._date = this._date.set({ hour: h }); + }; + CronDate.prototype.setMinutes = function(m) { + this._date = this._date.set({ minute: m }); + }; + CronDate.prototype.setSeconds = function(s) { + this._date = this._date.set({ second: s }); + }; + CronDate.prototype.setMilliseconds = function(s) { + this._date = this._date.set({ millisecond: s }); + }; + CronDate.prototype._getUTC = function() { + return this._date.toUTC(); + }; + CronDate.prototype.toString = function() { + return this.toDate().toString(); + }; + CronDate.prototype.toDate = function() { + return this._date.toJSDate(); + }; + CronDate.prototype.isLastDayOfMonth = function() { + var newDate = this._date.plus({ days: 1 }).startOf("day"); + return this._date.month !== newDate.month; + }; + CronDate.prototype.isLastWeekdayOfMonth = function() { + var newDate = this._date.plus({ days: 7 }).startOf("day"); + return this._date.month !== newDate.month; + }; + function CronDate(timestamp, tz) { + var dateOpts = { zone: tz }; + if (!timestamp) { + this._date = luxon.DateTime.local(); + } else if (timestamp instanceof CronDate) { + this._date = timestamp._date; + } else if (timestamp instanceof Date) { + this._date = luxon.DateTime.fromJSDate(timestamp, dateOpts); + } else if (typeof timestamp === "number") { + this._date = luxon.DateTime.fromMillis(timestamp, dateOpts); + } else if (typeof timestamp === "string") { + this._date = luxon.DateTime.fromISO(timestamp, dateOpts); + this._date.isValid || (this._date = luxon.DateTime.fromRFC2822(timestamp, dateOpts)); + this._date.isValid || (this._date = luxon.DateTime.fromSQL(timestamp, dateOpts)); + this._date.isValid || (this._date = luxon.DateTime.fromFormat(timestamp, "EEE, d MMM yyyy HH:mm:ss", dateOpts)); + } + if (!this._date || !this._date.isValid) { + throw new Error("CronDate: unhandled timestamp: " + JSON.stringify(timestamp)); + } + if (tz && tz !== this._date.zoneName) { + this._date = this._date.setZone(tz); + } + } + module2.exports = CronDate; + } +}); + +// node_modules/cron-parser/lib/field_compactor.js +var require_field_compactor = __commonJS({ + "node_modules/cron-parser/lib/field_compactor.js"(exports, module2) { + "use strict"; + function buildRange(item) { + return { + start: item, + count: 1 + }; + } + function completeRangeWithItem(range, item) { + range.end = item; + range.step = item - range.start; + range.count = 2; + } + function finalizeCurrentRange(results, currentRange, currentItemRange) { + if (currentRange) { + if (currentRange.count === 2) { + results.push(buildRange(currentRange.start)); + results.push(buildRange(currentRange.end)); + } else { + results.push(currentRange); + } + } + if (currentItemRange) { + results.push(currentItemRange); + } + } + function compactField(arr) { + var results = []; + var currentRange = void 0; + for (var i = 0; i < arr.length; i++) { + var currentItem = arr[i]; + if (typeof currentItem !== "number") { + finalizeCurrentRange(results, currentRange, buildRange(currentItem)); + currentRange = void 0; + } else if (!currentRange) { + currentRange = buildRange(currentItem); + } else if (currentRange.count === 1) { + completeRangeWithItem(currentRange, currentItem); + } else { + if (currentRange.step === currentItem - currentRange.end) { + currentRange.count++; + currentRange.end = currentItem; + } else if (currentRange.count === 2) { + results.push(buildRange(currentRange.start)); + currentRange = buildRange(currentRange.end); + completeRangeWithItem(currentRange, currentItem); + } else { + finalizeCurrentRange(results, currentRange); + currentRange = buildRange(currentItem); + } + } + } + finalizeCurrentRange(results, currentRange); + return results; + } + module2.exports = compactField; + } +}); + +// node_modules/cron-parser/lib/field_stringify.js +var require_field_stringify = __commonJS({ + "node_modules/cron-parser/lib/field_stringify.js"(exports, module2) { + "use strict"; + var compactField = require_field_compactor(); + function stringifyField(arr, min2, max2) { + var ranges = compactField(arr); + if (ranges.length === 1) { + var singleRange = ranges[0]; + var step = singleRange.step; + if (step === 1 && singleRange.start === min2 && singleRange.end === max2) { + return "*"; + } + if (step !== 1 && singleRange.start === min2 && singleRange.end === max2 - step + 1) { + return "*/" + step; + } + } + var result = []; + for (var i = 0, l = ranges.length; i < l; ++i) { + var range = ranges[i]; + if (range.count === 1) { + result.push(range.start); + continue; + } + var step = range.step; + if (range.step === 1) { + result.push(range.start + "-" + range.end); + continue; + } + var multiplier = range.start == 0 ? range.count - 1 : range.count; + if (range.step * multiplier > range.end) { + result = result.concat( + Array.from({ length: range.end - range.start + 1 }).map(function(_, index) { + var value = range.start + index; + if ((value - range.start) % range.step === 0) { + return value; + } + return null; + }).filter(function(value) { + return value != null; + }) + ); + } else if (range.end === max2 - range.step + 1) { + result.push(range.start + "/" + range.step); + } else { + result.push(range.start + "-" + range.end + "/" + range.step); + } + } + return result.join(","); + } + module2.exports = stringifyField; + } +}); + +// node_modules/cron-parser/lib/expression.js +var require_expression = __commonJS({ + "node_modules/cron-parser/lib/expression.js"(exports, module2) { + "use strict"; + var CronDate = require_date(); + var stringifyField = require_field_stringify(); + var LOOP_LIMIT = 1e4; + function CronExpression(fields, options) { + this._options = options; + this._utc = options.utc || false; + this._tz = this._utc ? "UTC" : options.tz; + this._currentDate = new CronDate(options.currentDate, this._tz); + this._startDate = options.startDate ? new CronDate(options.startDate, this._tz) : null; + this._endDate = options.endDate ? new CronDate(options.endDate, this._tz) : null; + this._isIterator = options.iterator || false; + this._hasIterated = false; + this._nthDayOfWeek = options.nthDayOfWeek || 0; + this.fields = CronExpression._freezeFields(fields); + } + CronExpression.map = ["second", "minute", "hour", "dayOfMonth", "month", "dayOfWeek"]; + CronExpression.predefined = { + "@yearly": "0 0 1 1 *", + "@monthly": "0 0 1 * *", + "@weekly": "0 0 * * 0", + "@daily": "0 0 * * *", + "@hourly": "0 * * * *" + }; + CronExpression.constraints = [ + { min: 0, max: 59, chars: [] }, + // Second + { min: 0, max: 59, chars: [] }, + // Minute + { min: 0, max: 23, chars: [] }, + // Hour + { min: 1, max: 31, chars: ["L"] }, + // Day of month + { min: 1, max: 12, chars: [] }, + // Month + { min: 0, max: 7, chars: ["L"] } + // Day of week + ]; + CronExpression.daysInMonth = [ + 31, + 29, + 31, + 30, + 31, + 30, + 31, + 31, + 30, + 31, + 30, + 31 + ]; + CronExpression.aliases = { + month: { + jan: 1, + feb: 2, + mar: 3, + apr: 4, + may: 5, + jun: 6, + jul: 7, + aug: 8, + sep: 9, + oct: 10, + nov: 11, + dec: 12 + }, + dayOfWeek: { + sun: 0, + mon: 1, + tue: 2, + wed: 3, + thu: 4, + fri: 5, + sat: 6 + } + }; + CronExpression.parseDefaults = ["0", "*", "*", "*", "*", "*"]; + CronExpression.standardValidCharacters = /^[,*\d/-]+$/; + CronExpression.dayOfWeekValidCharacters = /^[?,*\dL#/-]+$/; + CronExpression.dayOfMonthValidCharacters = /^[?,*\dL/-]+$/; + CronExpression.validCharacters = { + second: CronExpression.standardValidCharacters, + minute: CronExpression.standardValidCharacters, + hour: CronExpression.standardValidCharacters, + dayOfMonth: CronExpression.dayOfMonthValidCharacters, + month: CronExpression.standardValidCharacters, + dayOfWeek: CronExpression.dayOfWeekValidCharacters + }; + CronExpression._isValidConstraintChar = function _isValidConstraintChar(constraints, value) { + if (typeof value !== "string") { + return false; + } + return constraints.chars.some(function(char) { + return value.indexOf(char) > -1; + }); + }; + CronExpression._parseField = function _parseField(field, value, constraints) { + switch (field) { + case "month": + case "dayOfWeek": + var aliases = CronExpression.aliases[field]; + value = value.replace(/[a-z]{3}/gi, function(match) { + match = match.toLowerCase(); + if (typeof aliases[match] !== "undefined") { + return aliases[match]; + } else { + throw new Error('Validation error, cannot resolve alias "' + match + '"'); + } + }); + break; + } + if (!CronExpression.validCharacters[field].test(value)) { + throw new Error("Invalid characters, got value: " + value); + } + if (value.indexOf("*") !== -1) { + value = value.replace(/\*/g, constraints.min + "-" + constraints.max); + } else if (value.indexOf("?") !== -1) { + value = value.replace(/\?/g, constraints.min + "-" + constraints.max); + } + function parseSequence(val) { + var stack = []; + function handleResult(result) { + if (result instanceof Array) { + for (var i2 = 0, c2 = result.length; i2 < c2; i2++) { + var value2 = result[i2]; + if (CronExpression._isValidConstraintChar(constraints, value2)) { + stack.push(value2); + continue; + } + if (typeof value2 !== "number" || Number.isNaN(value2) || value2 < constraints.min || value2 > constraints.max) { + throw new Error( + "Constraint error, got value " + value2 + " expected range " + constraints.min + "-" + constraints.max + ); + } + stack.push(value2); + } + } else { + if (CronExpression._isValidConstraintChar(constraints, result)) { + stack.push(result); + return; + } + var numResult = +result; + if (Number.isNaN(numResult) || numResult < constraints.min || numResult > constraints.max) { + throw new Error( + "Constraint error, got value " + result + " expected range " + constraints.min + "-" + constraints.max + ); + } + if (field === "dayOfWeek") { + numResult = numResult % 7; + } + stack.push(numResult); + } + } + var atoms = val.split(","); + if (!atoms.every(function(atom) { + return atom.length > 0; + })) { + throw new Error("Invalid list value format"); + } + if (atoms.length > 1) { + for (var i = 0, c = atoms.length; i < c; i++) { + handleResult(parseRepeat(atoms[i])); + } + } else { + handleResult(parseRepeat(val)); + } + stack.sort(CronExpression._sortCompareFn); + return stack; + } + function parseRepeat(val) { + var repeatInterval = 1; + var atoms = val.split("/"); + if (atoms.length > 2) { + throw new Error("Invalid repeat: " + val); + } + if (atoms.length > 1) { + if (atoms[0] == +atoms[0]) { + atoms = [atoms[0] + "-" + constraints.max, atoms[1]]; + } + return parseRange(atoms[0], atoms[atoms.length - 1]); + } + return parseRange(val, repeatInterval); + } + function parseRange(val, repeatInterval) { + var stack = []; + var atoms = val.split("-"); + if (atoms.length > 1) { + if (atoms.length < 2) { + return +val; + } + if (!atoms[0].length) { + if (!atoms[1].length) { + throw new Error("Invalid range: " + val); + } + return +val; + } + var min2 = +atoms[0]; + var max2 = +atoms[1]; + if (Number.isNaN(min2) || Number.isNaN(max2) || min2 < constraints.min || max2 > constraints.max) { + throw new Error( + "Constraint error, got range " + min2 + "-" + max2 + " expected range " + constraints.min + "-" + constraints.max + ); + } else if (min2 > max2) { + throw new Error("Invalid range: " + val); + } + var repeatIndex = +repeatInterval; + if (Number.isNaN(repeatIndex) || repeatIndex <= 0) { + throw new Error("Constraint error, cannot repeat at every " + repeatIndex + " time."); + } + if (field === "dayOfWeek" && max2 % 7 === 0) { + stack.push(0); + } + for (var index = min2, count = max2; index <= count; index++) { + var exists = stack.indexOf(index) !== -1; + if (!exists && repeatIndex > 0 && repeatIndex % repeatInterval === 0) { + repeatIndex = 1; + stack.push(index); + } else { + repeatIndex++; + } + } + return stack; + } + return Number.isNaN(+val) ? val : +val; + } + return parseSequence(value); + }; + CronExpression._sortCompareFn = function(a, b) { + var aIsNumber = typeof a === "number"; + var bIsNumber = typeof b === "number"; + if (aIsNumber && bIsNumber) { + return a - b; + } + if (!aIsNumber && bIsNumber) { + return 1; + } + if (aIsNumber && !bIsNumber) { + return -1; + } + return a.localeCompare(b); + }; + CronExpression._handleMaxDaysInMonth = function(mappedFields) { + if (mappedFields.month.length === 1) { + var daysInMonth = CronExpression.daysInMonth[mappedFields.month[0] - 1]; + if (mappedFields.dayOfMonth[0] > daysInMonth) { + throw new Error("Invalid explicit day of month definition"); + } + return mappedFields.dayOfMonth.filter(function(dayOfMonth) { + return dayOfMonth === "L" ? true : dayOfMonth <= daysInMonth; + }).sort(CronExpression._sortCompareFn); + } + }; + CronExpression._freezeFields = function(fields) { + for (var i = 0, c = CronExpression.map.length; i < c; ++i) { + var field = CronExpression.map[i]; + var value = fields[field]; + fields[field] = Object.freeze(value); + } + return Object.freeze(fields); + }; + CronExpression.prototype._applyTimezoneShift = function(currentDate, dateMathVerb, method) { + if (method === "Month" || method === "Day") { + var prevTime = currentDate.getTime(); + currentDate[dateMathVerb + method](); + var currTime = currentDate.getTime(); + if (prevTime === currTime) { + if (currentDate.getMinutes() === 0 && currentDate.getSeconds() === 0) { + currentDate.addHour(); + } else if (currentDate.getMinutes() === 59 && currentDate.getSeconds() === 59) { + currentDate.subtractHour(); + } + } + } else { + var previousHour = currentDate.getHours(); + currentDate[dateMathVerb + method](); + var currentHour = currentDate.getHours(); + var diff = currentHour - previousHour; + if (diff === 2) { + if (this.fields.hour.length !== 24) { + this._dstStart = currentHour; + } + } else if (diff === 0 && currentDate.getMinutes() === 0 && currentDate.getSeconds() === 0) { + if (this.fields.hour.length !== 24) { + this._dstEnd = currentHour; + } + } + } + }; + CronExpression.prototype._findSchedule = function _findSchedule(reverse) { + function matchSchedule(value, sequence) { + for (var i = 0, c = sequence.length; i < c; i++) { + if (sequence[i] >= value) { + return sequence[i] === value; + } + } + return sequence[0] === value; + } + function isNthDayMatch(date, nthDayOfWeek) { + if (nthDayOfWeek < 6) { + if (date.getDate() < 8 && nthDayOfWeek === 1) { + return true; + } + var offset2 = date.getDate() % 7 ? 1 : 0; + var adjustedDate = date.getDate() - date.getDate() % 7; + var occurrence = Math.floor(adjustedDate / 7) + offset2; + return occurrence === nthDayOfWeek; + } + return false; + } + function isLInExpressions(expressions) { + return expressions.length > 0 && expressions.some(function(expression) { + return typeof expression === "string" && expression.indexOf("L") >= 0; + }); + } + reverse = reverse || false; + var dateMathVerb = reverse ? "subtract" : "add"; + var currentDate = new CronDate(this._currentDate, this._tz); + var startDate = this._startDate; + var endDate = this._endDate; + var startTimestamp = currentDate.getTime(); + var stepCount = 0; + function isLastWeekdayOfMonthMatch(expressions) { + return expressions.some(function(expression) { + if (!isLInExpressions([expression])) { + return false; + } + var weekday = Number.parseInt(expression[0]) % 7; + if (Number.isNaN(weekday)) { + throw new Error("Invalid last weekday of the month expression: " + expression); + } + return currentDate.getDay() === weekday && currentDate.isLastWeekdayOfMonth(); + }); + } + while (stepCount < LOOP_LIMIT) { + stepCount++; + if (reverse) { + if (startDate && currentDate.getTime() - startDate.getTime() < 0) { + throw new Error("Out of the timespan range"); + } + } else { + if (endDate && endDate.getTime() - currentDate.getTime() < 0) { + throw new Error("Out of the timespan range"); + } + } + var dayOfMonthMatch = matchSchedule(currentDate.getDate(), this.fields.dayOfMonth); + if (isLInExpressions(this.fields.dayOfMonth)) { + dayOfMonthMatch = dayOfMonthMatch || currentDate.isLastDayOfMonth(); + } + var dayOfWeekMatch = matchSchedule(currentDate.getDay(), this.fields.dayOfWeek); + if (isLInExpressions(this.fields.dayOfWeek)) { + dayOfWeekMatch = dayOfWeekMatch || isLastWeekdayOfMonthMatch(this.fields.dayOfWeek); + } + var isDayOfMonthWildcardMatch = this.fields.dayOfMonth.length >= CronExpression.daysInMonth[currentDate.getMonth()]; + var isDayOfWeekWildcardMatch = this.fields.dayOfWeek.length === CronExpression.constraints[5].max - CronExpression.constraints[5].min + 1; + var currentHour = currentDate.getHours(); + if (!dayOfMonthMatch && (!dayOfWeekMatch || isDayOfWeekWildcardMatch)) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Day"); + continue; + } + if (!isDayOfMonthWildcardMatch && isDayOfWeekWildcardMatch && !dayOfMonthMatch) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Day"); + continue; + } + if (isDayOfMonthWildcardMatch && !isDayOfWeekWildcardMatch && !dayOfWeekMatch) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Day"); + continue; + } + if (this._nthDayOfWeek > 0 && !isNthDayMatch(currentDate, this._nthDayOfWeek)) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Day"); + continue; + } + if (!matchSchedule(currentDate.getMonth() + 1, this.fields.month)) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Month"); + continue; + } + if (!matchSchedule(currentHour, this.fields.hour)) { + if (this._dstStart !== currentHour) { + this._dstStart = null; + this._applyTimezoneShift(currentDate, dateMathVerb, "Hour"); + continue; + } else if (!matchSchedule(currentHour - 1, this.fields.hour)) { + currentDate[dateMathVerb + "Hour"](); + continue; + } + } else if (this._dstEnd === currentHour) { + if (!reverse) { + this._dstEnd = null; + this._applyTimezoneShift(currentDate, "add", "Hour"); + continue; + } + } + if (!matchSchedule(currentDate.getMinutes(), this.fields.minute)) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Minute"); + continue; + } + if (!matchSchedule(currentDate.getSeconds(), this.fields.second)) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Second"); + continue; + } + if (startTimestamp === currentDate.getTime()) { + if (dateMathVerb === "add" || currentDate.getMilliseconds() === 0) { + this._applyTimezoneShift(currentDate, dateMathVerb, "Second"); + } else { + currentDate.setMilliseconds(0); + } + continue; + } + break; + } + if (stepCount >= LOOP_LIMIT) { + throw new Error("Invalid expression, loop limit exceeded"); + } + this._currentDate = new CronDate(currentDate, this._tz); + this._hasIterated = true; + return currentDate; + }; + CronExpression.prototype.next = function next() { + var schedule = this._findSchedule(); + if (this._isIterator) { + return { + value: schedule, + done: !this.hasNext() + }; + } + return schedule; + }; + CronExpression.prototype.prev = function prev() { + var schedule = this._findSchedule(true); + if (this._isIterator) { + return { + value: schedule, + done: !this.hasPrev() + }; + } + return schedule; + }; + CronExpression.prototype.hasNext = function() { + var current = this._currentDate; + var hasIterated = this._hasIterated; + try { + this._findSchedule(); + return true; + } catch (err) { + return false; + } finally { + this._currentDate = current; + this._hasIterated = hasIterated; + } + }; + CronExpression.prototype.hasPrev = function() { + var current = this._currentDate; + var hasIterated = this._hasIterated; + try { + this._findSchedule(true); + return true; + } catch (err) { + return false; + } finally { + this._currentDate = current; + this._hasIterated = hasIterated; + } + }; + CronExpression.prototype.iterate = function iterate(steps, callback) { + var dates = []; + if (steps >= 0) { + for (var i = 0, c = steps; i < c; i++) { + try { + var item = this.next(); + dates.push(item); + if (callback) { + callback(item, i); + } + } catch (err) { + break; + } + } + } else { + for (var i = 0, c = steps; i > c; i--) { + try { + var item = this.prev(); + dates.push(item); + if (callback) { + callback(item, i); + } + } catch (err) { + break; + } + } + } + return dates; + }; + CronExpression.prototype.reset = function reset(newDate) { + this._currentDate = new CronDate(newDate || this._options.currentDate); + }; + CronExpression.prototype.stringify = function stringify(includeSeconds) { + var resultArr = []; + for (var i = includeSeconds ? 0 : 1, c = CronExpression.map.length; i < c; ++i) { + var field = CronExpression.map[i]; + var value = this.fields[field]; + var constraint = CronExpression.constraints[i]; + if (field === "dayOfMonth" && this.fields.month.length === 1) { + constraint = { min: 1, max: CronExpression.daysInMonth[this.fields.month[0] - 1] }; + } else if (field === "dayOfWeek") { + constraint = { min: 0, max: 6 }; + value = value[value.length - 1] === 7 ? value.slice(0, -1) : value; + } + resultArr.push(stringifyField(value, constraint.min, constraint.max)); + } + return resultArr.join(" "); + }; + CronExpression.parse = function parse(expression, options) { + var self = this; + if (typeof options === "function") { + options = {}; + } + function parse2(expression2, options2) { + if (!options2) { + options2 = {}; + } + if (typeof options2.currentDate === "undefined") { + options2.currentDate = new CronDate(void 0, self._tz); + } + if (CronExpression.predefined[expression2]) { + expression2 = CronExpression.predefined[expression2]; + } + var fields = []; + var atoms = (expression2 + "").trim().split(/\s+/); + if (atoms.length > 6) { + throw new Error("Invalid cron expression"); + } + var start2 = CronExpression.map.length - atoms.length; + for (var i = 0, c = CronExpression.map.length; i < c; ++i) { + var field = CronExpression.map[i]; + var value = atoms[atoms.length > c ? i : i - start2]; + if (i < start2 || !value) { + fields.push( + CronExpression._parseField( + field, + CronExpression.parseDefaults[i], + CronExpression.constraints[i] + ) + ); + } else { + var val = field === "dayOfWeek" ? parseNthDay(value) : value; + fields.push( + CronExpression._parseField( + field, + val, + CronExpression.constraints[i] + ) + ); + } + } + var mappedFields = {}; + for (var i = 0, c = CronExpression.map.length; i < c; i++) { + var key = CronExpression.map[i]; + mappedFields[key] = fields[i]; + } + var dayOfMonth = CronExpression._handleMaxDaysInMonth(mappedFields); + mappedFields.dayOfMonth = dayOfMonth || mappedFields.dayOfMonth; + return new CronExpression(mappedFields, options2); + function parseNthDay(val2) { + var atoms2 = val2.split("#"); + if (atoms2.length > 1) { + var nthValue = +atoms2[atoms2.length - 1]; + if (/,/.test(val2)) { + throw new Error("Constraint error, invalid dayOfWeek `#` and `,` special characters are incompatible"); + } + if (/\//.test(val2)) { + throw new Error("Constraint error, invalid dayOfWeek `#` and `/` special characters are incompatible"); + } + if (/-/.test(val2)) { + throw new Error("Constraint error, invalid dayOfWeek `#` and `-` special characters are incompatible"); + } + if (atoms2.length > 2 || Number.isNaN(nthValue) || (nthValue < 1 || nthValue > 5)) { + throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)"); + } + options2.nthDayOfWeek = nthValue; + return atoms2[0]; + } + return val2; + } + } + return parse2(expression, options); + }; + CronExpression.fieldsToExpression = function fieldsToExpression(fields, options) { + function validateConstraints(field2, values2, constraints) { + if (!values2) { + throw new Error("Validation error, Field " + field2 + " is missing"); + } + if (values2.length === 0) { + throw new Error("Validation error, Field " + field2 + " contains no values"); + } + for (var i2 = 0, c2 = values2.length; i2 < c2; i2++) { + var value = values2[i2]; + if (CronExpression._isValidConstraintChar(constraints, value)) { + continue; + } + if (typeof value !== "number" || Number.isNaN(value) || value < constraints.min || value > constraints.max) { + throw new Error( + "Constraint error, got value " + value + " expected range " + constraints.min + "-" + constraints.max + ); + } + } + } + var mappedFields = {}; + for (var i = 0, c = CronExpression.map.length; i < c; ++i) { + var field = CronExpression.map[i]; + var values = fields[field]; + validateConstraints( + field, + values, + CronExpression.constraints[i] + ); + var copy = []; + var j = -1; + while (++j < values.length) { + copy[j] = values[j]; + } + values = copy.sort(CronExpression._sortCompareFn).filter(function(item, pos, ary) { + return !pos || item !== ary[pos - 1]; + }); + if (values.length !== copy.length) { + throw new Error("Validation error, Field " + field + " contains duplicate values"); + } + mappedFields[field] = values; + } + var dayOfMonth = CronExpression._handleMaxDaysInMonth(mappedFields); + mappedFields.dayOfMonth = dayOfMonth || mappedFields.dayOfMonth; + return new CronExpression(mappedFields, options || {}); + }; + module2.exports = CronExpression; + } +}); + +// node_modules/cron-parser/lib/parser.js +var require_parser = __commonJS({ + "node_modules/cron-parser/lib/parser.js"(exports, module2) { + "use strict"; + var CronExpression = require_expression(); + function CronParser() { + } + CronParser._parseEntry = function _parseEntry(entry) { + var atoms = entry.split(" "); + if (atoms.length === 6) { + return { + interval: CronExpression.parse(entry) + }; + } else if (atoms.length > 6) { + return { + interval: CronExpression.parse( + atoms.slice(0, 6).join(" ") + ), + command: atoms.slice(6, atoms.length) + }; + } else { + throw new Error("Invalid entry: " + entry); + } + }; + CronParser.parseExpression = function parseExpression2(expression, options) { + return CronExpression.parse(expression, options); + }; + CronParser.fieldsToExpression = function fieldsToExpression(fields, options) { + return CronExpression.fieldsToExpression(fields, options); + }; + CronParser.parseString = function parseString(data) { + var blocks = data.split("\n"); + var response = { + variables: {}, + expressions: [], + errors: {} + }; + for (var i = 0, c = blocks.length; i < c; i++) { + var block = blocks[i]; + var matches = null; + var entry = block.trim(); + if (entry.length > 0) { + if (entry.match(/^#/)) { + continue; + } else if (matches = entry.match(/^(.*)=(.*)$/)) { + response.variables[matches[1]] = matches[2]; + } else { + var result = null; + try { + result = CronParser._parseEntry("0 " + entry); + response.expressions.push(result.interval); + } catch (err) { + response.errors[entry] = err; + } + } + } + } + return response; + }; + CronParser.parseFile = function parseFile(filePath, callback) { + require("fs").readFile(filePath, function(err, data) { + if (err) { + callback(err); + return; + } + return callback(null, CronParser.parseString(data.toString())); + }); + }; + module2.exports = CronParser; + } +}); + +// src/main.ts +var main_exports = {}; +__export(main_exports, { + default: () => Cron +}); +module.exports = __toCommonJS(main_exports); +var import_obsidian3 = require("obsidian"); + +// src/lockManager.ts +var CronLockManager = class { + constructor(job, jobSettings, plugin, syncChecker) { + this.syncChecker = syncChecker; + this.job = job; + this.settings = jobSettings; + this.plugin = plugin; + if (!this.plugin.settings.locks[this.job]) { + this.plugin.settings.locks[this.job] = {}; + } + this.plugin.saveSettings(); + } + updateLastrun() { + this.plugin.settings.locks[this.job].lastRun = window.moment().format(); + return this.plugin.saveSettings(); + } + async updateLockJob(status) { + this.plugin.settings.locks[this.job].locked = status; + this.plugin.settings.locks[this.job].lockedDeviceName = this.syncChecker.deviceName(); + await this.plugin.saveSettings(); + return this.syncChecker.waitForSync(this.settings); + } + lockJob() { + return this.updateLockJob(true); + } + unlockJob() { + return this.updateLockJob(false); + } + clearLock() { + this.plugin.settings.locks[this.job].locked = false; + } + lastRun() { + return this.plugin.settings.locks[this.job].lastRun; + } + resetLastRun() { + this.plugin.settings.locks[this.job].lastRun = void 0; + } + jobLocked() { + return this.plugin.settings.locks[this.job].locked || false; + } +}; + +// src/job.ts +var import_cron_parser = __toESM(require_parser()); +var Job = class { + constructor(id, name, job, frequency, settings, app2, plugin, syncChecker) { + this.syncChecker = syncChecker; + this.plugin = plugin; + this.app = app2; + this.lockManager = new CronLockManager(id, settings, plugin, syncChecker); + this.name = name; + this.id = id; + this.job = job; + this.frequency = frequency; + this.settings = settings; + } + async runJob() { + console.log(`Running ${this.name}`); + await this.lockManager.lockJob(); + typeof this.job == "string" ? await this.runJobCommand() : await this.runJobFunction(); + await this.lockManager.updateLastrun(); + await this.lockManager.unlockJob(); + } + canRunJob() { + if (this.lockManager.jobLocked() && !this.settings.disableJobLock) { + this.noRunReason = "job locked"; + return false; + } + if (this.app.isMobile && !this.settings.enableMobile) { + this.noRunReason = "disabled on mobile"; + return false; + } + if (!this.jobIntervalPassed()) { + this.noRunReason = "job interval hasnt passed"; + return false; + } + return true; + } + clearJobLock() { + this.lockManager.clearLock(); + } + jobIntervalPassed() { + const lastRun = this.lockManager.lastRun(); + if (!lastRun) + return true; + const prevRun = window.moment((0, import_cron_parser.parseExpression)(this.frequency).prev().toDate()); + return prevRun.isAfter(lastRun); + } + async runJobFunction() { + if (typeof this.job !== "function") { + return; + } + try { + await this.job(this.app); + console.log(`${this.name} completed`); + } catch (error) { + console.log(`${this.name} failed to run`); + console.log(error); + } + } + async runJobCommand() { + if (typeof this.job !== "string") { + return; + } + const jobCommand = this.app.commands.commands[this.job]; + if (!jobCommand) { + console.log(`${this.name} failed to run: Command unknown`); + } + await this.app.commands.executeCommand(jobCommand); + } +}; + +// src/settings.ts +var import_obsidian2 = require("obsidian"); + +// node_modules/uuid/dist/esm-browser/rng.js +var getRandomValues; +var rnds8 = new Uint8Array(16); +function rng() { + if (!getRandomValues) { + getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); + if (!getRandomValues) { + throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); + } + } + return getRandomValues(rnds8); +} + +// node_modules/uuid/dist/esm-browser/stringify.js +var byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 256).toString(16).slice(1)); +} +function unsafeStringify(arr, offset2 = 0) { + return (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase(); +} + +// node_modules/uuid/dist/esm-browser/native.js +var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); +var native_default = { + randomUUID +}; + +// node_modules/uuid/dist/esm-browser/v4.js +function v4(options, buf, offset2) { + if (native_default.randomUUID && !buf && !options) { + return native_default.randomUUID(); + } + options = options || {}; + const rnds = options.random || (options.rng || rng)(); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset2 = offset2 || 0; + for (let i = 0; i < 16; ++i) { + buf[offset2 + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +var v4_default = v4; + +// src/suggest.ts +var import_obsidian = require("obsidian"); + +// node_modules/@popperjs/core/lib/enums.js +var top = "top"; +var bottom = "bottom"; +var right = "right"; +var left = "left"; +var auto = "auto"; +var basePlacements = [top, bottom, right, left]; +var start = "start"; +var end = "end"; +var clippingParents = "clippingParents"; +var viewport = "viewport"; +var popper = "popper"; +var reference = "reference"; +var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); +}, []); +var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); +}, []); +var beforeRead = "beforeRead"; +var read = "read"; +var afterRead = "afterRead"; +var beforeMain = "beforeMain"; +var main = "main"; +var afterMain = "afterMain"; +var beforeWrite = "beforeWrite"; +var write = "write"; +var afterWrite = "afterWrite"; +var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + +// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +function getNodeName(element) { + return element ? (element.nodeName || "").toLowerCase() : null; +} + +// node_modules/@popperjs/core/lib/dom-utils/getWindow.js +function getWindow(node) { + if (node == null) { + return window; + } + if (node.toString() !== "[object Window]") { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; + } + return node; +} + +// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; +} +function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; +} +function isShadowRoot(node) { + if (typeof ShadowRoot === "undefined") { + return false; + } + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} + +// node_modules/@popperjs/core/lib/modifiers/applyStyles.js +function applyStyles(_ref) { + var state = _ref.state; + Object.keys(state.elements).forEach(function(name) { + var style = state.styles[name] || {}; + var attributes = state.attributes[name] || {}; + var element = state.elements[name]; + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(name2) { + var value = attributes[name2]; + if (value === false) { + element.removeAttribute(name2); + } else { + element.setAttribute(name2, value === true ? "" : value); + } + }); + }); +} +function effect(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } + return function() { + Object.keys(state.elements).forEach(function(name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); + var style = styleProperties.reduce(function(style2, property) { + style2[property] = ""; + return style2; + }, {}); + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(attribute) { + element.removeAttribute(attribute); + }); + }); + }; +} +var applyStyles_default = { + name: "applyStyles", + enabled: true, + phase: "write", + fn: applyStyles, + effect, + requires: ["computeStyles"] +}; + +// node_modules/@popperjs/core/lib/utils/getBasePlacement.js +function getBasePlacement(placement) { + return placement.split("-")[0]; +} + +// node_modules/@popperjs/core/lib/utils/math.js +var max = Math.max; +var min = Math.min; +var round = Math.round; + +// node_modules/@popperjs/core/lib/utils/userAgent.js +function getUAString() { + var uaData = navigator.userAgentData; + if (uaData != null && uaData.brands) { + return uaData.brands.map(function(item) { + return item.brand + "/" + item.version; + }).join(" "); + } + return navigator.userAgent; +} + +// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); +} + +// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; + } + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; + } + var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport; + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width, + height, + top: y, + right: x + width, + bottom: y + height, + left: x, + x, + y + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); + var width = element.offsetWidth; + var height = element.offsetHeight; + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; + } + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + return { + x: element.offsetLeft, + y: element.offsetTop, + width, + height + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/contains.js +function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); + if (parent.contains(child)) { + return true; + } else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + do { + if (next && parent.isSameNode(next)) { + return true; + } + next = next.parentNode || next.host; + } while (next); + } + return false; +} + +// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +function getComputedStyle(element) { + return getWindow(element).getComputedStyle(element); +} + +// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +function isTableElement(element) { + return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; +} + +// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +function getDocumentElement(element) { + return ((isElement(element) ? element.ownerDocument : ( + // $FlowFixMe[prop-missing] + element.document + )) || window.document).documentElement; +} + +// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +function getParentNode(element) { + if (getNodeName(element) === "html") { + return element; + } + return ( + // this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || // DOM Element detected + (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) + ); +} + +// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle(element).position === "fixed") { + return null; + } + return element.offsetParent; +} +function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + if (isIE && isHTMLElement(element)) { + var elementCss = getComputedStyle(element); + if (elementCss.position === "fixed") { + return null; + } + } + var currentNode = getParentNode(element); + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; + } + while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle(currentNode); + if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { + return currentNode; + } else { + currentNode = currentNode.parentNode; + } + } + return null; +} +function getOffsetParent(element) { + var window2 = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") { + offsetParent = getTrueOffsetParent(offsetParent); + } + if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) { + return window2; + } + return offsetParent || getContainingBlock(element) || window2; +} + +// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +function getMainAxisFromPlacement(placement) { + return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; +} + +// node_modules/@popperjs/core/lib/utils/within.js +function within(min2, value, max2) { + return max(min2, min(value, max2)); +} +function withinMaxClamp(min2, value, max2) { + var v = within(min2, value, max2); + return v > max2 ? max2 : v; +} + +// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; +} + +// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); +} + +// node_modules/@popperjs/core/lib/utils/expandToHashMap.js +function expandToHashMap(value, keys) { + return keys.reduce(function(hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); +} + +// node_modules/@popperjs/core/lib/modifiers/arrow.js +var toPaddingObject = function toPaddingObject2(padding, state) { + padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); +}; +function arrow(_ref) { + var _state$modifiersData$; + var state = _ref.state, name = _ref.name, options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets2 = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? "height" : "width"; + if (!arrowElement || !popperOffsets2) { + return; + } + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === "y" ? top : left; + var maxProp = axis === "y" ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; + var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; + var min2 = paddingObject[minProp]; + var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset2 = within(min2, center, max2); + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); +} +function effect2(_ref2) { + var state = _ref2.state, options = _ref2.options; + var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; + if (arrowElement == null) { + return; + } + if (typeof arrowElement === "string") { + arrowElement = state.elements.popper.querySelector(arrowElement); + if (!arrowElement) { + return; + } + } + if (true) { + if (!isHTMLElement(arrowElement)) { + console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" ")); + } + } + if (!contains(state.elements.popper, arrowElement)) { + if (true) { + console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" ")); + } + return; + } + state.elements.arrow = arrowElement; +} +var arrow_default = { + name: "arrow", + enabled: true, + phase: "main", + fn: arrow, + effect: effect2, + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"] +}; + +// node_modules/@popperjs/core/lib/utils/getVariation.js +function getVariation(placement) { + return placement.split("-")[1]; +} + +// node_modules/@popperjs/core/lib/modifiers/computeStyles.js +var unsetSides = { + top: "auto", + right: "auto", + bottom: "auto", + left: "auto" +}; +function roundOffsetsByDPR(_ref) { + var x = _ref.x, y = _ref.y; + var win = window; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x * dpr) / dpr || 0, + y: round(y * dpr) / dpr || 0 + }; +} +function mapToStyles(_ref2) { + var _Object$assign2; + var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y; + var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ + x, + y + }) : { + x, + y + }; + x = _ref3.x; + y = _ref3.y; + var hasX = offsets.hasOwnProperty("x"); + var hasY = offsets.hasOwnProperty("y"); + var sideX = left; + var sideY = top; + var win = window; + if (adaptive) { + var offsetParent = getOffsetParent(popper2); + var heightProp = "clientHeight"; + var widthProp = "clientWidth"; + if (offsetParent === getWindow(popper2)) { + offsetParent = getDocumentElement(popper2); + if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") { + heightProp = "scrollHeight"; + widthProp = "scrollWidth"; + } + } + offsetParent = offsetParent; + if (placement === top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : ( + // $FlowFixMe[prop-missing] + offsetParent[heightProp] + ); + y -= offsetY - popperRect.height; + y *= gpuAcceleration ? 1 : -1; + } + if (placement === left || (placement === top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : ( + // $FlowFixMe[prop-missing] + offsetParent[widthProp] + ); + x -= offsetX - popperRect.width; + x *= gpuAcceleration ? 1 : -1; + } + } + var commonStyles = Object.assign({ + position + }, adaptive && unsetSides); + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x, + y + }) : { + x, + y + }; + x = _ref4.x; + y = _ref4.y; + if (gpuAcceleration) { + var _Object$assign; + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + } + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2)); +} +function computeStyles(_ref5) { + var state = _ref5.state, options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + if (true) { + var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ""; + if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) { + return transitionProperty.indexOf(property) >= 0; + })) { + console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" ")); + } + } + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration, + isFixed: state.options.strategy === "fixed" + }; + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive, + roundOffsets + }))); + } + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: "absolute", + adaptive: false, + roundOffsets + }))); + } + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-placement": state.placement + }); +} +var computeStyles_default = { + name: "computeStyles", + enabled: true, + phase: "beforeWrite", + fn: computeStyles, + data: {} +}; + +// node_modules/@popperjs/core/lib/modifiers/eventListeners.js +var passive = { + passive: true +}; +function effect3(_ref) { + var state = _ref.state, instance = _ref.instance, options = _ref.options; + var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; + var window2 = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.addEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.addEventListener("resize", instance.update, passive); + } + return function() { + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.removeEventListener("scroll", instance.update, passive); + }); + } + if (resize) { + window2.removeEventListener("resize", instance.update, passive); + } + }; +} +var eventListeners_default = { + name: "eventListeners", + enabled: true, + phase: "write", + fn: function fn() { + }, + effect: effect3, + data: {} +}; + +// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +var hash = { + left: "right", + right: "left", + bottom: "top", + top: "bottom" +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function(matched) { + return hash[matched]; + }); +} + +// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +var hash2 = { + start: "end", + end: "start" +}; +function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function(matched) { + return hash2[matched]; + }); +} + +// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft, + scrollTop + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +function getWindowScrollBarX(element) { + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; +} + +// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x = 0; + var y = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + if (layoutViewport || !layoutViewport && strategy === "fixed") { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + return { + width, + height, + x: x + getWindowScrollBarX(element), + y + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +function getDocumentRect(element) { + var _element$ownerDocumen; + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y = -winScroll.scrollTop; + if (getComputedStyle(body || html).direction === "rtl") { + x += max(html.clientWidth, body ? body.clientWidth : 0) - width; + } + return { + width, + height, + x, + y + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +function isScrollParent(element) { + var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); +} + +// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +function getScrollParent(node) { + if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { + return node.ownerDocument.body; + } + if (isHTMLElement(node) && isScrollParent(node)) { + return node; + } + return getScrollParent(getParentNode(node)); +} + +// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +function listScrollParents(element, list) { + var _element$ownerDocumen; + if (list === void 0) { + list = []; + } + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : ( + // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))) + ); +} + +// node_modules/@popperjs/core/lib/utils/rectToClientRect.js +function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); +} + +// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === "fixed"); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; +} +function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); +} +function getClippingParents(element) { + var clippingParents2 = listScrollParents(getParentNode(element)); + var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + if (!isElement(clipperElement)) { + return []; + } + return clippingParents2.filter(function(clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; + }); +} +function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); + var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents2[0]; + var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; +} + +// node_modules/@popperjs/core/lib/utils/computeOffsets.js +function computeOffsets(_ref) { + var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference2.x + reference2.width / 2 - element.width / 2; + var commonY = reference2.y + reference2.height / 2 - element.height / 2; + var offsets; + switch (basePlacement) { + case top: + offsets = { + x: commonX, + y: reference2.y - element.height + }; + break; + case bottom: + offsets = { + x: commonX, + y: reference2.y + reference2.height + }; + break; + case right: + offsets = { + x: reference2.x + reference2.width, + y: commonY + }; + break; + case left: + offsets = { + x: reference2.x - element.width, + y: commonY + }; + break; + default: + offsets = { + x: reference2.x, + y: reference2.y + }; + } + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + if (mainAxis != null) { + var len = mainAxis === "y" ? "height" : "width"; + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); + break; + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); + break; + default: + } + } + return offsets; +} + +// node_modules/@popperjs/core/lib/utils/detectOverflow.js +function detectOverflow(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets2 = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: "absolute", + placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; + if (elementContext === popper && offsetData) { + var offset2 = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function(key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; + overflowOffsets[key] += offset2[axis] * multiply; + }); + } + return overflowOffsets; +} + +// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { + return getVariation(placement2) === variation; + }) : basePlacements; + var allowedPlacements = placements2.filter(function(placement2) { + return allowedAutoPlacements.indexOf(placement2) >= 0; + }); + if (allowedPlacements.length === 0) { + allowedPlacements = placements2; + if (true) { + console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")); + } + } + var overflows = allowedPlacements.reduce(function(acc, placement2) { + acc[placement2] = detectOverflow(state, { + placement: placement2, + boundary, + rootBoundary, + padding + })[getBasePlacement(placement2)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function(a, b) { + return overflows[a] - overflows[b]; + }); +} + +// node_modules/@popperjs/core/lib/modifiers/flip.js +function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; +} +function flip(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + if (state.modifiersData[name]._skip) { + return; + } + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { + return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { + placement: placement2, + boundary, + rootBoundary, + padding, + flipVariations, + allowedAutoPlacements + }) : placement2); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = /* @__PURE__ */ new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements2[0]; + for (var i = 0; i < placements2.length; i++) { + var placement = placements2[i]; + var _basePlacement = getBasePlacement(placement); + var isStartVariation = getVariation(placement) === start; + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? "width" : "height"; + var overflow = detectOverflow(state, { + placement, + boundary, + rootBoundary, + altBoundary, + padding + }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + if (checks.every(function(check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + checksMap.set(placement, checks); + } + if (makeFallbackChecks) { + var numberOfChecks = flipVariations ? 3 : 1; + var _loop = function _loop2(_i2) { + var fittingPlacement = placements2.find(function(placement2) { + var checks2 = checksMap.get(placement2); + if (checks2) { + return checks2.slice(0, _i2).every(function(check) { + return check; + }); + } + }); + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + if (_ret === "break") + break; + } + } + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; + } +} +var flip_default = { + name: "flip", + enabled: true, + phase: "main", + fn: flip, + requiresIfExists: ["offset"], + data: { + _skip: false + } +}; + +// node_modules/@popperjs/core/lib/modifiers/hide.js +function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; +} +function isAnySideFullyClipped(overflow) { + return [top, right, bottom, left].some(function(side) { + return overflow[side] >= 0; + }); +} +function hide(_ref) { + var state = _ref.state, name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: "reference" + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets, + popperEscapeOffsets, + isReferenceHidden, + hasPopperEscaped + }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-reference-hidden": isReferenceHidden, + "data-popper-escaped": hasPopperEscaped + }); +} +var hide_default = { + name: "hide", + enabled: true, + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: hide +}; + +// node_modules/@popperjs/core/lib/modifiers/offset.js +function distanceAndSkiddingToXY(placement, rects, offset2) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; + var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { + placement + })) : offset2, skidding = _ref[0], distance = _ref[1]; + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; +} +function offset(_ref2) { + var state = _ref2.state, options = _ref2.options, name = _ref2.name; + var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = placements.reduce(function(acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); + return acc; + }, {}); + var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y; + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x; + state.modifiersData.popperOffsets.y += y; + } + state.modifiersData[name] = data; +} +var offset_default = { + name: "offset", + enabled: true, + phase: "main", + requires: ["popperOffsets"], + fn: offset +}; + +// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +function popperOffsets(_ref) { + var state = _ref.state, name = _ref.name; + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: "absolute", + placement: state.placement + }); +} +var popperOffsets_default = { + name: "popperOffsets", + enabled: true, + phase: "read", + fn: popperOffsets, + data: {} +}; + +// node_modules/@popperjs/core/lib/utils/getAltAxis.js +function getAltAxis(axis) { + return axis === "x" ? "y" : "x"; +} + +// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +function preventOverflow(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + var overflow = detectOverflow(state, { + boundary, + rootBoundary, + padding, + altBoundary + }); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets2 = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + if (!popperOffsets2) { + return; + } + if (checkMainAxis) { + var _offsetModifierState$; + var mainSide = mainAxis === "y" ? top : left; + var altSide = mainAxis === "y" ? bottom : right; + var len = mainAxis === "y" ? "height" : "width"; + var offset2 = popperOffsets2[mainAxis]; + var min2 = offset2 + overflow[mainSide]; + var max2 = offset2 - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset2 + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2); + popperOffsets2[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset2; + } + if (checkAltAxis) { + var _offsetModifierState$2; + var _mainSide = mainAxis === "x" ? top : left; + var _altSide = mainAxis === "x" ? bottom : right; + var _offset = popperOffsets2[altAxis]; + var _len = altAxis === "y" ? "height" : "width"; + var _min = _offset + overflow[_mainSide]; + var _max = _offset - overflow[_altSide]; + var isOriginSide = [top, left].indexOf(basePlacement) !== -1; + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + popperOffsets2[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; + } + state.modifiersData[name] = data; +} +var preventOverflow_default = { + name: "preventOverflow", + enabled: true, + phase: "main", + fn: preventOverflow, + requiresIfExists: ["offset"] +}; + +// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; +} + +// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); + } else { + return getHTMLElementScroll(node); + } +} + +// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; +} +function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} + +// node_modules/@popperjs/core/lib/utils/orderModifiers.js +function order(modifiers) { + var map = /* @__PURE__ */ new Map(); + var visited = /* @__PURE__ */ new Set(); + var result = []; + modifiers.forEach(function(modifier) { + map.set(modifier.name, modifier); + }); + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function(dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + if (depModifier) { + sort(depModifier); + } + } + }); + result.push(modifier); + } + modifiers.forEach(function(modifier) { + if (!visited.has(modifier.name)) { + sort(modifier); + } + }); + return result; +} +function orderModifiers(modifiers) { + var orderedModifiers = order(modifiers); + return modifierPhases.reduce(function(acc, phase) { + return acc.concat(orderedModifiers.filter(function(modifier) { + return modifier.phase === phase; + })); + }, []); +} + +// node_modules/@popperjs/core/lib/utils/debounce.js +function debounce(fn2) { + var pending; + return function() { + if (!pending) { + pending = new Promise(function(resolve) { + Promise.resolve().then(function() { + pending = void 0; + resolve(fn2()); + }); + }); + } + return pending; + }; +} + +// node_modules/@popperjs/core/lib/utils/format.js +function format(str) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return [].concat(args).reduce(function(p, c) { + return p.replace(/%s/, c); + }, str); +} + +// node_modules/@popperjs/core/lib/utils/validateModifiers.js +var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; +var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; +var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"]; +function validateModifiers(modifiers) { + modifiers.forEach(function(modifier) { + [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self) { + return self.indexOf(value) === index; + }).forEach(function(key) { + switch (key) { + case "name": + if (typeof modifier.name !== "string") { + console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"')); + } + break; + case "enabled": + if (typeof modifier.enabled !== "boolean") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"')); + } + break; + case "phase": + if (modifierPhases.indexOf(modifier.phase) < 0) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"')); + } + break; + case "fn": + if (typeof modifier.fn !== "function") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"')); + } + break; + case "effect": + if (modifier.effect != null && typeof modifier.effect !== "function") { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"')); + } + break; + case "requires": + if (modifier.requires != null && !Array.isArray(modifier.requires)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"')); + } + break; + case "requiresIfExists": + if (!Array.isArray(modifier.requiresIfExists)) { + console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"')); + } + break; + case "options": + case "data": + break; + default: + console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) { + return '"' + s + '"'; + }).join(", ") + '; but "' + key + '" was provided.'); + } + modifier.requires && modifier.requires.forEach(function(requirement) { + if (modifiers.find(function(mod) { + return mod.name === requirement; + }) == null) { + console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); + } + }); + }); + }); +} + +// node_modules/@popperjs/core/lib/utils/uniqueBy.js +function uniqueBy(arr, fn2) { + var identifiers = /* @__PURE__ */ new Set(); + return arr.filter(function(item) { + var identifier = fn2(item); + if (!identifiers.has(identifier)) { + identifiers.add(identifier); + return true; + } + }); +} + +// node_modules/@popperjs/core/lib/utils/mergeByName.js +function mergeByName(modifiers) { + var merged = modifiers.reduce(function(merged2, current) { + var existing = merged2[current.name]; + merged2[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged2; + }, {}); + return Object.keys(merged).map(function(key) { + return merged[key]; + }); +} + +// node_modules/@popperjs/core/lib/createPopper.js +var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element."; +var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash."; +var DEFAULT_OPTIONS = { + placement: "bottom", + modifiers: [], + strategy: "absolute" +}; +function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return !args.some(function(element) { + return !(element && typeof element.getBoundingClientRect === "function"); + }); +} +function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; + } + var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper2(reference2, popper2, options) { + if (options === void 0) { + options = defaultOptions; + } + var state = { + placement: "bottom", + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference2, + popper: popper2 + }, + attributes: {}, + styles: {} + }; + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state, + setOptions: function setOptions(setOptionsAction) { + var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options2); + state.scrollParents = { + reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], + popper: listScrollParents(popper2) + }; + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); + state.orderedModifiers = orderedModifiers.filter(function(m) { + return m.enabled; + }); + if (true) { + var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) { + var name = _ref.name; + return name; + }); + validateModifiers(modifiers); + if (getBasePlacement(state.options.placement) === auto) { + var flipModifier = state.orderedModifiers.find(function(_ref2) { + var name = _ref2.name; + return name === "flip"; + }); + if (!flipModifier) { + console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" ")); + } + } + var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft; + if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) { + return parseFloat(margin); + })) { + console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" ")); + } + } + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; + } + var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; + if (!areValidElements(reference3, popper3)) { + if (true) { + console.error(INVALID_ELEMENT_ERROR); + } + return; + } + state.rects = { + reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), + popper: getLayoutRect(popper3) + }; + state.reset = false; + state.placement = state.options.placement; + state.orderedModifiers.forEach(function(modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + var __debug_loops__ = 0; + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (true) { + __debug_loops__ += 1; + if (__debug_loops__ > 100) { + console.error(INFINITE_LOOP_ERROR); + break; + } + } + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; + if (typeof fn2 === "function") { + state = fn2({ + state, + options: _options, + name, + instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function() { + return new Promise(function(resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } + }; + if (!areValidElements(reference2, popper2)) { + if (true) { + console.error(INVALID_ELEMENT_ERROR); + } + return instance; + } + instance.setOptions(options).then(function(state2) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state2); + } + }); + function runModifierEffects() { + state.orderedModifiers.forEach(function(_ref3) { + var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect4 = _ref3.effect; + if (typeof effect4 === "function") { + var cleanupFn = effect4({ + state, + name, + instance, + options: options2 + }); + var noopFn = function noopFn2() { + }; + effectCleanupFns.push(cleanupFn || noopFn); + } + }); + } + function cleanupModifierEffects() { + effectCleanupFns.forEach(function(fn2) { + return fn2(); + }); + effectCleanupFns = []; + } + return instance; + }; +} + +// node_modules/@popperjs/core/lib/popper.js +var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default]; +var createPopper = /* @__PURE__ */ popperGenerator({ + defaultModifiers +}); + +// src/suggest.ts +var wrapAround = (value, size) => { + return (value % size + size) % size; +}; +var Suggest = class { + constructor(owner, containerEl, scope) { + this.owner = owner; + this.containerEl = containerEl; + containerEl.on( + "click", + ".suggestion-item", + this.onSuggestionClick.bind(this) + ); + containerEl.on( + "mousemove", + ".suggestion-item", + this.onSuggestionMouseover.bind(this) + ); + scope.register([], "ArrowUp", (event) => { + if (!event.isComposing) { + this.setSelectedItem(this.selectedItem - 1, true); + return false; + } + }); + scope.register([], "ArrowDown", (event) => { + if (!event.isComposing) { + this.setSelectedItem(this.selectedItem + 1, true); + return false; + } + }); + scope.register([], "Enter", (event) => { + if (!event.isComposing) { + this.useSelectedItem(event); + return false; + } + }); + } + onSuggestionClick(event, el) { + event.preventDefault(); + const item = this.suggestions.indexOf(el); + this.setSelectedItem(item, false); + this.useSelectedItem(event); + } + onSuggestionMouseover(_event, el) { + const item = this.suggestions.indexOf(el); + this.setSelectedItem(item, false); + } + setSuggestions(values) { + this.containerEl.empty(); + const suggestionEls = []; + values.forEach((value) => { + const suggestionEl = this.containerEl.createDiv("suggestion-item"); + this.owner.renderSuggestion(value, suggestionEl); + suggestionEls.push(suggestionEl); + }); + this.values = values; + this.suggestions = suggestionEls; + this.setSelectedItem(0, false); + } + useSelectedItem(event) { + const currentValue = this.values[this.selectedItem]; + if (currentValue) { + this.owner.selectSuggestion(currentValue, event); + } + } + setSelectedItem(selectedIndex, scrollIntoView) { + const normalizedIndex = wrapAround( + selectedIndex, + this.suggestions.length + ); + const prevSelectedSuggestion = this.suggestions[this.selectedItem]; + const selectedSuggestion = this.suggestions[normalizedIndex]; + prevSelectedSuggestion == null ? void 0 : prevSelectedSuggestion.removeClass("is-selected"); + selectedSuggestion == null ? void 0 : selectedSuggestion.addClass("is-selected"); + this.selectedItem = normalizedIndex; + if (scrollIntoView) { + selectedSuggestion.scrollIntoView(false); + } + } +}; +var TextInputSuggest = class { + constructor(inputEl) { + this.inputEl = inputEl; + this.scope = new import_obsidian.Scope(); + this.suggestEl = createDiv("suggestion-container"); + const suggestion = this.suggestEl.createDiv("suggestion"); + this.suggest = new Suggest(this, suggestion, this.scope); + this.scope.register([], "Escape", this.close.bind(this)); + this.inputEl.addEventListener("input", this.onInputChanged.bind(this)); + this.inputEl.addEventListener("focus", this.onInputChanged.bind(this)); + this.inputEl.addEventListener("blur", this.close.bind(this)); + this.suggestEl.on( + "mousedown", + ".suggestion-container", + (event) => { + event.preventDefault(); + } + ); + } + onInputChanged() { + const inputStr = this.inputEl.value; + const suggestions = this.getSuggestions(inputStr); + if (!suggestions) { + this.close(); + return; + } + if (suggestions.length > 0) { + this.suggest.setSuggestions(suggestions); + this.open(app.dom.appContainerEl, this.inputEl); + } else { + this.close(); + } + } + open(container, inputEl) { + app.keymap.pushScope(this.scope); + container.appendChild(this.suggestEl); + this.popper = createPopper(inputEl, this.suggestEl, { + placement: "bottom-start", + modifiers: [ + { + name: "sameWidth", + enabled: true, + fn: ({ state, instance }) => { + const targetWidth = "20000px"; + if (state.styles.popper.width === targetWidth) { + return; + } + state.styles.popper.width = targetWidth; + instance.update(); + }, + phase: "beforeWrite", + requires: ["computeStyles"] + } + ] + }); + } + close() { + app.keymap.popScope(this.scope); + this.suggest.setSuggestions([]); + if (this.popper) + this.popper.destroy(); + this.suggestEl.detach(); + } +}; + +// src/commandSuggest.ts +var CommandSuggest = class extends TextInputSuggest { + getSuggestions(inputStr) { + const abstractCommands = app.commands.commands; + const commands = []; + const lowerCaseInputStr = inputStr.toLowerCase(); + for (const [, command] of Object.entries(abstractCommands)) { + if (command.name.toLowerCase().contains(lowerCaseInputStr)) { + commands.push(command); + } + } + return commands; + } + renderSuggestion(command, el) { + el.setText(command.name); + } + selectSuggestion(command) { + this.inputEl.value = command.id; + this.inputEl.trigger("input"); + this.close(); + } +}; + +// src/settings.ts +var CronSettingTab = class extends import_obsidian2.PluginSettingTab { + constructor(app2, plugin) { + super(app2, plugin); + this.plugin = plugin; + } + display() { + const { containerEl } = this; + containerEl.empty(); + containerEl.createEl("h2", { text: "Settings for Cron." }); + new import_obsidian2.Setting(containerEl).setName("Cron Interval").setDesc("The interval the cron will run in minutes").addText( + (text) => text.setValue(this.plugin.settings.cronInterval.toString()).onChange(async (value) => { + if (value == "") { + return; + } + this.plugin.settings.cronInterval = parseInt(value); + await this.plugin.saveSettings(); + this.plugin.loadInterval(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Run cron on startup").setDesc("Do a cron run on startup instead of waiting for the first interval to pass").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.runOnStartup).onChange(async (value) => { + this.plugin.settings.runOnStartup = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Enable Obsidian Sync Checker").setDesc("Whether or not to wait for Obsidian sync before running any CRONs globally.").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.watchObsidianSync).onChange(async (value) => { + this.plugin.settings.watchObsidianSync = value; + await this.plugin.saveSettings(); + }) + ); + new import_obsidian2.Setting(containerEl).setName("Enable Obsidian on Mobile").setDesc("Whether or not to load jobs at all on Mobile devices. If disabled even jobs with mobile enabled will not run.").addToggle( + (toggle) => toggle.setValue(this.plugin.settings.enableMobile).onChange(async (value) => { + this.plugin.settings.enableMobile = value; + await this.plugin.saveSettings(); + }) + ); + const desc = document.createDocumentFragment(); + desc.append( + "List of CRON Jobs to run. Jobs will not be ran until all 3 fields have been filled", + desc.createEl("br"), + "Cron Frequency is a cron schedule expression. Use ", + desc.createEl("a", { + href: "https://crontab.guru/", + text: "crontab guru" + }), + " for help with creating cron schedule expressions." + ); + new import_obsidian2.Setting(containerEl).setName("Cron Jobs").setDesc(desc); + this.addCommandSearch(); + } + addCommandSearch() { + this.plugin.settings.crons.forEach((cronjob, index) => { + const jobSetting = new import_obsidian2.Setting(this.containerEl).addText( + (text) => text.setValue(cronjob.name).setPlaceholder("Job name").onChange(async (value) => { + this.plugin.settings.crons[index].name = value; + await this.plugin.saveSettings(); + this.plugin.loadCrons(); + }).inputEl.addClass("cron-plugin-text-input") + ).addSearch((cb) => { + new CommandSuggest(cb.inputEl); + cb.setPlaceholder("Command").setValue(cronjob.job).onChange(async (command) => { + if (!command) { + return; + } + this.plugin.settings.crons[index].job = command; + await this.plugin.saveSettings(); + this.plugin.loadCrons(); + }).inputEl.addClass("cron-plugin-text-input"); + }).addText( + (text) => text.setPlaceholder("CronJob frequency").setValue(cronjob.frequency).onChange(async (value) => { + this.plugin.settings.crons[index].frequency = value; + await this.plugin.saveSettings(); + this.plugin.loadCrons(); + }).inputEl.addClass("cron-plugin-text-input") + ).addExtraButton((button) => { + button.setIcon(cronjob.settings.enableMobile ? "lucide-phone" : "lucide-phone-off").setTooltip("Toggle job on mobile").onClick(async () => { + this.plugin.settings.crons[index].settings.enableMobile = !cronjob.settings.enableMobile; + await this.plugin.saveSettings(); + this.display(); + }); + }); + const jobLocked = this.plugin.settings.locks[cronjob.name] && this.plugin.settings.locks[cronjob.name].locked; + jobSetting.addExtraButton((button) => { + button.setIcon(jobLocked ? "lucide-lock" : "lucide-unlock").setTooltip("Toggle job lock (clear lock if accidentally left locked)").onClick(() => { + this.plugin.settings.locks[cronjob.id].locked = !jobLocked; + this.plugin.saveSettings(); + this.display(); + }); + }); + jobSetting.addExtraButton((button) => { + button.setIcon(cronjob.settings.disableSyncCheck ? "paused" : "lucide-check-circle-2").setTooltip("Toggle Sync check for this job. Presently: " + (cronjob.settings.disableSyncCheck ? "disabled" : "enabled")).onClick(() => { + this.plugin.settings.crons[index].settings.disableSyncCheck = !cronjob.settings.disableSyncCheck; + this.plugin.saveSettings(); + this.display(); + }); + }).addExtraButton((button) => { + button.setIcon("cross").setTooltip("Delete Job").onClick(() => { + this.plugin.settings.crons.splice(index, 1); + delete this.plugin.settings.locks[cronjob.id]; + this.plugin.saveSettings(); + this.display(); + }); + }); + jobSetting.controlEl.addClass("cron-plugin-job"); + }); + new import_obsidian2.Setting(this.containerEl).addButton((cb) => { + cb.setButtonText("Add cron job").setCta().onClick(() => { + this.plugin.settings.crons.push({ + id: v4_default(), + name: "", + job: "", + frequency: "", + settings: { + enableMobile: false + } + }); + this.plugin.saveSettings(); + this.display(); + }); + }); + } +}; + +// src/syncChecker.ts +var syncEmitterName = "status-change"; +var syncCompletedStatus = "synced"; +var syncWaiterCtxID = "syncWaiter"; +var SyncChecker = class { + constructor(app2, plugin) { + this.syncInstance = app2.internalPlugins.plugins["sync"].instance; + this.plugin = plugin; + this.syncWaiters = []; + this.syncInstance.on(syncEmitterName, this.handleSyncStatusChange.bind(this), syncWaiterCtxID); + } + deviceName() { + return this.syncInstance.deviceName ? this.syncInstance.deviceName : this.syncInstance.getDefaultDeviceName(); + } + handleSyncStatusChange() { + if (this.syncInstance.getStatus() === syncCompletedStatus) { + this.clearSyncWaiters(); + } + } + clearSyncWaiters() { + this.syncWaiters.forEach((waiter) => { + waiter.resolve(); + }); + } + handleUnload() { + this.syncWaiters.forEach((waiter) => { + waiter.reject("Unloading plugin"); + }); + this.syncInstance._[syncEmitterName] = this.syncInstance._[syncEmitterName].filter((listener) => { + if (listener.ctx === syncWaiterCtxID) + return false; + return true; + }); + } + waitForSync(settings) { + return new Promise((resolve, reject) => { + if (settings.disableSyncCheck) + resolve(); + if (!this.plugin.settings.watchObsidianSync) + resolve(); + if (this.syncInstance.getStatus() === syncCompletedStatus) { + resolve(); + } + this.syncWaiters.push({ resolve, reject }); + }); + } +}; + +// src/api.ts +var CronAPI = class { + static get(plugin) { + return { + addCronJob(name, frequency, settings, job) { + return plugin.addCronJob(name, frequency, settings, job); + }, + runJob(name) { + return plugin.runJob(name); + }, + clearJobLock(name) { + return plugin.clearJobLock(name); + }, + getJob(name) { + return plugin.getJob(name); + } + }; + } +}; + +// src/main.ts +var DEFAULT_SETTINGS = { + cronInterval: 15, + runOnStartup: true, + enableMobile: true, + watchObsidianSync: true, + crons: [], + locks: {} +}; +var Cron = class extends import_obsidian3.Plugin { + async onload() { + console.log("Loading Obsidian CRON!"); + Cron.instance = this; + await this.loadSettings(); + this.addSettingTab(new CronSettingTab(this.app, this)); + this.syncChecker = new SyncChecker(this.app, this); + this.jobs = {}; + this.loadCrons(); + this.loadInterval(); + this.api = CronAPI.get(this); + this.app.workspace.onLayoutReady(() => { + if (this.settings.runOnStartup) { + if (this.app.isMobile && !this.settings.enableMobile) { + return; + } + this.runCron(); + } + }); + } + async runCron() { + for (const [, job] of Object.entries(this.jobs)) { + await this.syncChecker.waitForSync(job.settings); + await this.loadSettings(); + if (!job.canRunJob()) { + continue; + } + await job.runJob(); + } + } + addCronJob(name, frequency, settings, job) { + const existingJob = this.getJob(name); + if (existingJob) + throw new Error("CRON Job already exists"); + this.jobs[name] = new Job(name, name, job, frequency, settings, this.app, this, this.syncChecker); + } + async runJob(name) { + const job = this.getJob(name); + if (!job) + throw new Error("CRON Job doesn't exist"); + await job.runJob(); + } + clearJobLock(name) { + const job = this.getJob(name); + if (!job) + throw new Error("CRON Job doesn't exist"); + job.clearJobLock(); + } + getJob(name) { + for (const [, job] of Object.entries(this.jobs)) { + if (job.name == name) + return job; + } + return null; + } + onunload() { + if (this.settings.watchObsidianSync) + this.syncChecker.handleUnload(); + console.log("Cron unloaded"); + } + loadCrons() { + this.settings.crons.forEach((cronjob) => { + if (cronjob.frequency === "" || cronjob.job === "") { + return; + } + this.jobs[cronjob.id] = new Job(cronjob.id, cronjob.name, cronjob.job, cronjob.frequency, cronjob.settings, this.app, this, this.syncChecker); + }); + } + loadInterval() { + clearInterval(this.interval); + if (this.app.isMobile && !this.settings.enableMobile) { + return; + } + this.interval = window.setInterval(async () => { + await this.runCron(); + }, this.settings.cronInterval * 60 * 1e3); + this.registerInterval(this.interval); + } + async loadSettings() { + this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + } + async saveSettings() { + await this.saveData(this.settings); + } +}; diff --git a/.obsidian/plugins/cron/manifest.json b/.obsidian/plugins/cron/manifest.json new file mode 100644 index 00000000..d2bef3ac --- /dev/null +++ b/.obsidian/plugins/cron/manifest.json @@ -0,0 +1 @@ +{"id":"cron","name":"Cron","version":"1.1.0","minAppVersion":"0.15.0","description":"Simple CRON / schedular plugin to regularly run user scripts or Obsidian commands.","author":"Callum Loh","authorUrl":"https://github.com/cdloh","isDesktopOnly":false} \ No newline at end of file diff --git a/.obsidian/plugins/cron/styles.css b/.obsidian/plugins/cron/styles.css new file mode 100644 index 00000000..7b2d8dd8 --- /dev/null +++ b/.obsidian/plugins/cron/styles.css @@ -0,0 +1,17 @@ +/* + +This CSS file will be included with your plugin, and +available in the app when your plugin is enabled. + +If your plugin does not need CSS, delete this file. + +*/ + +.cron-plugin-text-input { + width: 10vw; + min-width: 180px; +} + +.cron-plugin-job { + flex-wrap: wrap; +} diff --git a/.obsidian/plugins/emoji-shortcodes/data.json b/.obsidian/plugins/emoji-shortcodes/data.json index a0ff2104..bce7ed02 100644 --- a/.obsidian/plugins/emoji-shortcodes/data.json +++ b/.obsidian/plugins/emoji-shortcodes/data.json @@ -4,10 +4,11 @@ "historyPriority": true, "historyLimit": 100, "history": [ - ":racehorse:", - ":book:", ":tv:", ":plate_with_cutlery:", + ":train2:", + ":racehorse:", + ":book:", ":fork_and_knife:", ":broken_heart:", ":warning:", @@ -27,7 +28,6 @@ ":racing_car:", ":hotel:", ":classical_building:", - ":train2:", ":ski:", ":small_airplane:", ":bar_chart:", diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index e6458d4e..d89e5f1a 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2023-04-03", - "size": 14281676 + "date": "2023-04-07", + "size": 14348477 } ], "activityHistory": [ @@ -1814,7 +1814,23 @@ }, { "date": "2023-04-03", - "value": 1289 + "value": 62683 + }, + { + "date": "2023-04-04", + "value": 1303 + }, + { + "date": "2023-04-05", + "value": 1372 + }, + { + "date": "2023-04-06", + "value": 5993 + }, + { + "date": "2023-04-07", + "value": 1321 } ] } diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index 9298e328..b3a2b07f 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -490,7 +490,7 @@ "links": 4 }, "05.01 Computer setup/Storage and Syncing.md": { - "size": 6682, + "size": 4892, "tags": 4, "links": 13 }, @@ -910,7 +910,7 @@ "links": 5 }, "04.01 lebv.org/Hosting Tasks.md": { - "size": 2400, + "size": 2793, "tags": 4, "links": 8 }, @@ -1575,7 +1575,7 @@ "links": 1 }, "01.02 Home/Household.md": { - "size": 4513, + "size": 5038, "tags": 2, "links": 2 }, @@ -9082,7 +9082,7 @@ "00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md": { "size": 12951, "tags": 4, - "links": 1 + "links": 2 }, "00.01 Admin/Calendars/2023-03-29.md": { "size": 1412, @@ -9117,9 +9117,54 @@ "00.01 Admin/Calendars/2023-04-02.md": { "size": 1412, "tags": 0, - "links": 4 + "links": 6 }, "00.01 Admin/Calendars/2023-04-03.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "03.04 Cinematheque/Thank You for Smoking (2005).md": { + "size": 2031, + "tags": 0, + "links": 1 + }, + "00.03 News/We want objective judges and doctors. Why not journalists too.md": { + "size": 21046, + "tags": 2, + "links": 1 + }, + "00.03 News/The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow.md": { + "size": 8932, + "tags": 4, + "links": 1 + }, + "00.03 News/The Big Coin Heist.md": { + "size": 28914, + "tags": 3, + "links": 1 + }, + "00.01 Admin/Calendars/2023-04-04.md": { + "size": 1412, + "tags": 0, + "links": 7 + }, + "00.01 Admin/Calendars/2023-04-05.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2023-04-06.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "03.04 Cinematheque/The Guard (2011).md": { + "size": 2033, + "tags": 0, + "links": 1 + }, + "00.01 Admin/Calendars/2023-04-07.md": { "size": 1412, "tags": 0, "links": 4 @@ -9127,10 +9172,10 @@ }, "commitTypes": { "/": { - "Refactor": 2767, - "Create": 1630, - "Link": 3944, - "Expand": 1586 + "Refactor": 2775, + "Create": 1640, + "Link": 3961, + "Expand": 1588 } }, "dailyCommits": { @@ -9142,32 +9187,32 @@ "4": 17, "5": 13, "6": 64, - "7": 617, - "8": 824, - "9": 693, + "7": 623, + "8": 826, + "9": 694, "10": 519, - "11": 403, + "11": 404, "12": 379, - "13": 420, + "13": 421, "14": 414, - "15": 417, - "16": 532, + "15": 418, + "16": 535, "17": 565, "18": 760, "19": 482, - "20": 445, - "21": 449, - "22": 439, + "20": 447, + "21": 453, + "22": 455, "23": 1231 } }, "weeklyCommits": { "/": { - "Mon": 2263, - "Tue": 1268, - "Wed": 1277, - "Thu": 853, - "Fri": 930, + "Mon": 2282, + "Tue": 1272, + "Wed": 1280, + "Thu": 862, + "Fri": 932, "Sat": 0, "Sun": 3336 } @@ -9175,6 +9220,8 @@ "recentCommits": { "/": { "Expanded": [ + " Hosting Tasks ", + " Household ", " Mallorca ", " @@Travels ", " Server Alias ", @@ -9223,11 +9270,19 @@ " Checkup ", " Template Timeline ", " Checkup ", - " Health ", - " Dr Awad Abuawad ", - " The Power And The Glory " + " Health " ], "Created": [ + " 2023-04-07 ", + " The Guard (2011) ", + " 2023-04-06 ", + " 2023-04-05 ", + " 2023-04-04 ", + " The Big Coin Heist Hazlitt ", + " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", + " We want objective judges and doctors. Why not journalists too ", + " Why are Americans dying so young ", + " Thank You for Smoking (2005) ", " 2023-04-03 ", " 2023-04-02 ", " 2023-04-01 ", @@ -9268,19 +9323,15 @@ " 2023-03-19 ", " Untitled ", " Striking French workers dispute that they want a right to ‘laziness’ ", - " Les Combrailles, à la découverte de l’Auvergne secrète ", - " 2023-03-18 ", - " Law Roach on Why He Retired From Celebrity Fashion Styling ", - " Is Fox News Really Doomed ", - " Untitled ", - " Untitled ", - " Untitled ", - " The Camp of the Saints - 2017 ", - " 2023-03-17 ", - " 2023-03-16 ", - " Korean Barbecue-Style Meatballs Recipe " + " Les Combrailles, à la découverte de l’Auvergne secrète " ], "Renamed": [ + " The Guard (2011) ", + " The Big Coin Heist ", + " The Big Coin Heist ", + " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", + " We want objective judges and doctors. Why not journalists too ", + " Thank You for Smoking (2005) ", " The Fran Lebowitz Reader ", " Au Revoir Là-Haut ", " How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution ", @@ -9325,15 +9376,12 @@ " John Wick - Chapter 2 (2017) ", " Bull elephants – their importance as individuals in elephant societies - Africa Geographic ", " The Silicon Valley Bank Contagion Is Just Beginning ", - " John Wick (2014) ", - " An Icelandic Town Goes All Out to Save Baby Puffins ", - " The Untold Story Of Notorious Influencer Andrew Tate ", - " How a civil war erupted at Fox News after the 2020 election ", - " Mel Brooks Isn’t Done Punching Up the History of the World ", - " William's Butcherstable ", - " The One Big Question Bernie Sanders Won’t Answer " + " John Wick (2014) " ], "Tagged": [ + " The Big Coin Heist ", + " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", + " We want objective judges and doctors. Why not journalists too ", " How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution ", " Gisele Bündchen on Tom Brady, FTX Blind Side, and Being a “Witch of Love” ", " Jaylen Brown Is Trying to Find a Balance ", @@ -9381,12 +9429,10 @@ " 2021-06-29 COVID Vaccine 2 ", " 2021-12-22 Covid booster ", " Portofino am See ", - " 2023-02-24 Kidney inflammation ", - " 2023-01-23 Checkup ", - " Checkup ", - " Template Timeline " + " 2023-02-24 Kidney inflammation " ], "Refactored": [ + " Storage and Syncing ", " Korean Barbecue-Style Meatballs Recipe ", " Aglaé de Villeneuve ", " Bookmarks - Mac applications ", @@ -9436,10 +9482,10 @@ " @Short breaks ", " @Short breaks ", " League Tables ", - " 2022-10-03 Meggi leaving to Belfast ", - " Zürich - Practical info " + " 2022-10-03 Meggi leaving to Belfast " ], "Deleted": [ + " Why are Americans dying so young ", " How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution ", " Les Combrailles, à la découverte de l’Auvergne secrète ", " Untitled ", @@ -9489,10 +9535,23 @@ " ‘The Hole’ Gruesome Accounts of Russian Occupation Emerge From Ukrainian Nuclear Plant ", " 2022-11-10 Dinner @ Swiss Re ", " 2022-11-06 ", - " Lemon Chicken Recipe (with Lemon Butter Sauce) - NatashasKitchen.com ", - " aglaedevilleneuve@yahoo.fr " + " Lemon Chicken Recipe (with Lemon Butter Sauce) - NatashasKitchen.com " ], "Linked": [ + " 2023-04-07 ", + " 2023-04-06 ", + " The Guard (2011) ", + " How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution ", + " 2023-04-06 ", + " 2023-04-05 ", + " 2023-04-04 ", + " 2023-04-04 ", + " The Big Coin Heist ", + " The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow ", + " We want objective judges and doctors. Why not journalists too ", + " 2023-04-03 ", + " 2023-04-02 ", + " Thank You for Smoking (2005) ", " 2023-04-03 ", " 2023-04-02 ", " 2023-04-01 ", @@ -9529,21 +9588,7 @@ " Zaalouk ", " 2023-03-22 ", " 2023-03-23 ", - " Esterno notte (2022) ", - " Law Roach on Why He Retired From Celebrity Fashion Styling ", - " Why Joe Biden’s Honeymoon With Progressives Is Coming to an End ", - " The Purposeful Presence of Lance Reddick ", - " 2023-03-23 ", - " Batman Begins (2005) ", - " Batman (1989) ", - " Batman Robin (1997) ", - " The Dark Knight Rises (2012) ", - " Batman Returns (1992) ", - " The Dark Knight (2008) ", - " Batman Forever (1995) ", - " 2023-03-22 ", - " The Dark Knight Rises (2012) ", - " Are Helicopter Parents Actually Lazy " + " Esterno notte (2022) " ], "Removed Tags from": [ " ‘Incredibly intelligent, highly elusive’ US faces new threat from Canadian ‘super pig’ ", diff --git a/.obsidian/plugins/obsidian-full-calendar/main.js b/.obsidian/plugins/obsidian-full-calendar/main.js index 715d6179..42607a86 100644 --- a/.obsidian/plugins/obsidian-full-calendar/main.js +++ b/.obsidian/plugins/obsidian-full-calendar/main.js @@ -64674,9 +64674,9 @@ var EventCache = class { console.debug("Last revalidation was too soon."); return; } - this.revalidating = true; - console.warn("Revalidating remote calendars..."); const remoteCalendars = [...this.calendars.values()].flatMap((c3) => c3 instanceof RemoteCalendar ? c3 : []); + console.warn("Revalidating remote calendars..."); + this.revalidating = true; const promises = remoteCalendars.map((calendar) => { return calendar.revalidate().then(() => calendar.getEvents()).then((events) => { const deletedEvents = [ @@ -64707,7 +64707,7 @@ var EventCache = class { Promise.allSettled(promises).then((results) => { this.revalidating = false; this.lastRevalidation = Date.now(); - new import_obsidian9.Notice("All remote calendars have been fetched."); + console.debug("All remote calendars have been fetched."); const errors = results.flatMap((result) => result.status === "rejected" ? result.reason : []); if (errors.length > 0) { new import_obsidian9.Notice("A remote calendar failed to load. Check the console for more details."); diff --git a/.obsidian/plugins/obsidian-full-calendar/manifest.json b/.obsidian/plugins/obsidian-full-calendar/manifest.json index 49f35c39..d0361b08 100644 --- a/.obsidian/plugins/obsidian-full-calendar/manifest.json +++ b/.obsidian/plugins/obsidian-full-calendar/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-full-calendar", "name": "Full Calendar", - "version": "0.10.6", + "version": "0.10.7", "minAppVersion": "0.16.3", "description": "Obsidian integration with Full Calendar (fullcalendar.io)", "author": "Davis Haupt", diff --git a/.obsidian/plugins/obsidian-reminder-plugin/data.json b/.obsidian/plugins/obsidian-reminder-plugin/data.json index 7a9eb517..dc566d7b 100644 --- a/.obsidian/plugins/obsidian-reminder-plugin/data.json +++ b/.obsidian/plugins/obsidian-reminder-plugin/data.json @@ -2,35 +2,30 @@ "scanned": true, "reminders": { "05.01 Computer setup/Storage and Syncing.md": [ - { - "title": "Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%%", - "time": "2023-04-06", - "rowNumber": 177 - }, - { - "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Standard Notes (PC) %%done_del%%", - "time": "2023-04-07", - "rowNumber": 174 - }, - { - "title": ":floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%%", - "time": "2023-04-07", - "rowNumber": 183 - }, { "title": ":iphone: Backup [[Storage and Syncing#Instructions for iPhone|iPhone]] %%done_del%%", "time": "2023-04-11", - "rowNumber": 180 + "rowNumber": 175 }, { "title": ":camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%%", "time": "2023-04-13", - "rowNumber": 190 + "rowNumber": 179 }, { "title": ":cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%%", "time": "2023-06-12", - "rowNumber": 186 + "rowNumber": 178 + }, + { + "title": "Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%%", + "time": "2023-07-06", + "rowNumber": 174 + }, + { + "title": ":floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%%", + "time": "2023-07-07", + "rowNumber": 176 } ], "06.01 Finances/hLedger.md": [ @@ -70,49 +65,49 @@ } ], "05.02 Networks/Server Tools.md": [ - { - "title": ":hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%%", - "time": "2023-04-04", - "rowNumber": 576 - }, { "title": ":closed_lock_with_key: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Bitwarden & Health checks %%done_del%%", "time": "2023-04-18", - "rowNumber": 588 + "rowNumber": 589 }, { "title": ":hammer_and_wrench: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Standard Notes & Health checks %%done_del%%", "time": "2023-05-18", - "rowNumber": 593 + "rowNumber": 594 }, { "title": ":desktop_computer: [[Selfhosting]], [[Server Tools|Tools]]: Upgrader Gitea & Health checks %%done_del%%", "time": "2023-06-18", - "rowNumber": 583 + "rowNumber": 584 + }, + { + "title": ":hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%%", + "time": "2023-10-03", + "rowNumber": 576 } ], "05.02 Networks/Server VPN.md": [ - { - "title": ":shield: [[Server VPN]]: Backup server %%done_del%%", - "time": "2023-04-04", - "rowNumber": 285 - }, { "title": ":shield: [[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard %%done_del%%", "time": "2023-06-18", - "rowNumber": 291 + "rowNumber": 292 + }, + { + "title": ":shield: [[Server VPN]]: Backup server %%done_del%%", + "time": "2023-10-03", + "rowNumber": 285 } ], "04.01 lebv.org/Hosting Tasks.md": [ { "title": ":fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#Backup procedure|backup]] the DB & Files %%done_del%%", - "time": "2023-04-05", + "time": "2023-07-05", "rowNumber": 71 }, { "title": ":fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#PHP versioning|Check the php version]] of the website %%done_del%%", - "time": "2023-04-05", - "rowNumber": 72 + "time": "2023-07-05", + "rowNumber": 73 }, { "title": ":fleur_de_lis: [[Hosting Tasks|Hosting]]: Explore the possibility of webhosting through [[Hosting Tasks#Decentralised hosting|decentralised services]] (Blockchain)", @@ -356,35 +351,35 @@ } ], "01.02 Home/Household.md": [ - { - "title": ":bed: [[Household]] Change bedsheets %%done_del%%", - "time": "2023-04-01", - "rowNumber": 106 - }, { "title": "🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%%", - "time": "2023-04-03", - "rowNumber": 97 - }, - { - "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", - "time": "2023-04-04", - "rowNumber": 81 + "time": "2023-04-10", + "rowNumber": 98 }, { "title": "♻ [[Household]]: *Paper* recycling collection %%done_del%%", "time": "2023-04-11", "rowNumber": 75 }, + { + "title": ":bed: [[Household]] Change bedsheets %%done_del%%", + "time": "2023-04-15", + "rowNumber": 108 + }, + { + "title": "♻ [[Household]]: *Cardboard* recycling collection %%done_del%%", + "time": "2023-04-18", + "rowNumber": 81 + }, { "title": "🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%%", "time": "2023-04-29", - "rowNumber": 94 + "rowNumber": 95 }, { "title": "🛎️ :house: [[Household]]: Pay rent %%done_del%%", "time": "2023-04-30", - "rowNumber": 91 + "rowNumber": 92 }, { "title": ":couch_and_lamp: [[Household]]: Replace the sofa", @@ -458,27 +453,27 @@ } ], "06.02 Investments/Crypto Tasks.md": [ - { - "title": ":ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%%", - "time": "2023-04-04", - "rowNumber": 72 - }, { "title": ":chart: Check [[Nimbus]] earnings %%done_del%%", "time": "2023-04-10", - "rowNumber": 76 + "rowNumber": 77 + }, + { + "title": ":ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%%", + "time": "2023-05-02", + "rowNumber": 72 } ], "05.02 Networks/Configuring UFW.md": [ { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%%", - "time": "2023-04-01", + "time": "2023-04-08", "rowNumber": 239 }, { "title": "🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%%", - "time": "2023-04-01", - "rowNumber": 248 + "time": "2023-04-08", + "rowNumber": 249 } ], "01.03 Family/Amélie Solanet.md": [ diff --git a/.obsidian/plugins/obsidian-tasks-plugin/main.js b/.obsidian/plugins/obsidian-tasks-plugin/main.js index c8f38f17..971b9cd1 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/main.js +++ b/.obsidian/plugins/obsidian-tasks-plugin/main.js @@ -122,16 +122,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"use strict";var mE=Object.create;var Li=Object.defineProperty,yE=Object.defineProperties,gE=Object.getOwnPropertyDescriptor,_E=Object.getOwnPropertyDescriptors,TE=Object.getOwnPropertyNames,Gp=Object.getOwnPropertySymbols,bE=Object.getPrototypeOf,zp=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable;var Hp=(r,e,t)=>e in r?Li(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qe=(r,e)=>{for(var t in e||(e={}))zp.call(e,t)&&Hp(r,t,e[t]);if(Gp)for(var t of Gp(e))vE.call(e,t)&&Hp(r,t,e[t]);return r},tr=(r,e)=>yE(r,_E(e));var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),wE=(r,e)=>{for(var t in e)Li(r,t,{get:e[t],enumerable:!0})},Vp=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of TE(e))!zp.call(r,s)&&s!==t&&Li(r,s,{get:()=>e[s],enumerable:!(n=gE(e,s))||n.enumerable});return r};var ns=(r,e,t)=>(t=r!=null?mE(bE(r)):{},Vp(e||!r||!r.__esModule?Li(t,"default",{value:r,enumerable:!0}):t,r)),EE=r=>Vp(Li({},"__esModule",{value:!0}),r);var J=(r,e,t)=>new Promise((n,s)=>{var a=c=>{try{l(t.next(c))}catch(h){s(h)}},o=c=>{try{l(t.throw(c))}catch(h){s(h)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);l((t=t.apply(r,e)).next())});var Tm=O((DF,So)=>{var Qp,Jp,em,tm,rm,nm,sm,im,am,ko,Ml,om,um,lm,js,cm,dm,fm,hm,pm,mm,ym,gm,_m,Do;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof So=="object"&&typeof So.exports=="object"?r(t(e,t(So.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=s?s(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])};Qp=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function a(){this.constructor=n}n.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)},Jp=Object.assign||function(n){for(var s,a=1,o=arguments.length;a=0;m--)(h=n[m])&&(c=(l<3?h(c):l>3?h(s,a,c):h(s,a))||c);return l>3&&c&&Object.defineProperty(s,a,c),c},rm=function(n,s){return function(a,o){s(a,o,n)}},nm=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},sm=function(n,s,a,o){function l(c){return c instanceof a?c:new a(function(h){h(c)})}return new(a||(a=Promise))(function(c,h){function m(D){try{T(o.next(D))}catch(v){h(v)}}function _(D){try{T(o.throw(D))}catch(v){h(v)}}function T(D){D.done?c(D.value):l(D.value).then(m,_)}T((o=o.apply(n,s||[])).next())})},im=function(n,s){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,l,c,h;return h={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function m(T){return function(D){return _([T,D])}}function _(T){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,l&&(c=T[0]&2?l.return:T[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,T[1])).done)return c;switch(l=0,c&&(T=[T[0]&2,c.value]),T[0]){case 0:case 1:c=T;break;case 4:return a.label++,{value:T[1],done:!1};case 5:a.label++,l=T[1],T=[0];continue;case 7:T=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(T[0]===6||T[0]===2)){a=0;continue}if(T[0]===3&&(!c||T[1]>c[0]&&T[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},Ml=function(n,s){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),l,c=[],h;try{for(;(s===void 0||s-- >0)&&!(l=o.next()).done;)c.push(l.value)}catch(m){h={error:m}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(h)throw h.error}}return c},om=function(){for(var n=[],s=0;s1||m(R,I)})})}function m(R,I){try{_(o[R](I))}catch(q){v(c[0][3],q)}}function _(R){R.value instanceof js?Promise.resolve(R.value.v).then(T,D):v(c[0][2],R)}function T(R){m("next",R)}function D(R){m("throw",R)}function v(R,I){R(I),c.shift(),c.length&&m(c[0][0],c[0][1])}},dm=function(n){var s,a;return s={},o("next"),o("throw",function(l){throw l}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(l,c){s[l]=n[l]?function(h){return(a=!a)?{value:js(n[l](h)),done:l==="return"}:c?c(h):h}:c}},fm=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],a;return s?s.call(n):(n=typeof ko=="function"?ko(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(c){a[c]=n[c]&&function(h){return new Promise(function(m,_){h=n[c](h),l(m,_,h.done,h.value)})}}function l(c,h,m,_){Promise.resolve(_).then(function(T){c({value:T,done:m})},h)}},hm=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};pm=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&Do(s,n,a);return t(s,n),s},mm=function(n){return n&&n.__esModule?n:{default:n}},ym=function(n,s,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:s.get(n)},gm=function(n,s,a,o,l){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!l:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?l.call(n,a):l?l.value=a:s.set(n,a),a},_m=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",Qp),r("__assign",Jp),r("__rest",em),r("__decorate",tm),r("__param",rm),r("__metadata",nm),r("__awaiter",sm),r("__generator",im),r("__exportStar",am),r("__createBinding",Do),r("__values",ko),r("__read",Ml),r("__spread",om),r("__spreadArrays",um),r("__spreadArray",lm),r("__await",js),r("__asyncGenerator",cm),r("__asyncDelegator",dm),r("__asyncValues",fm),r("__makeTemplateObject",hm),r("__importStar",pm),r("__importDefault",mm),r("__classPrivateFieldGet",ym),r("__classPrivateFieldSet",gm),r("__classPrivateFieldIn",_m)})});var Fl=O((Il,Hs)=>{(function(r,e){typeof Il=="object"&&typeof Hs!="undefined"?Hs.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Il,function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function s(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,u){return Object.prototype.hasOwnProperty.call(i,u)}function o(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var u;for(u in i)if(a(i,u))return!1;return!0}function l(i){return i===void 0}function c(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function h(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function m(i,u){var d=[],f,p=i.length;for(f=0;f>>0,f;for(f=0;f0)for(d=0;d=0;return(b?d?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+f}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,S={},M={};function k(i,u,d,f){var p=f;typeof f=="string"&&(p=function(){return this[f]()}),i&&(M[i]=p),u&&(M[u[0]]=function(){return g(p.apply(this,arguments),u[1],u[2])}),d&&(M[d]=function(){return this.localeData().ordinal(p.apply(this,arguments),i)})}function C(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function A(i){var u=i.match(w),d,f;for(d=0,f=u.length;d=0&&E.test(i);)i=i.replace(E,f),E.lastIndex=0,d-=1;return i}var ke={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ye(i){var u=this._longDateFormat[i],d=this._longDateFormat[i.toUpperCase()];return u||!d?u:(this._longDateFormat[i]=d.match(w).map(function(f){return f==="MMMM"||f==="MM"||f==="DD"||f==="dddd"?f.slice(1):f}).join(""),this._longDateFormat[i])}var ce="Invalid date";function Ie(){return this._invalidDate}var K="%d",We=/\d{1,2}/;function Je(i){return this._ordinal.replace("%d",i)}var Ke={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Dr(i,u,d,f){var p=this._relativeTime[d];return V(p)?p(i,u,d,f):p.replace(/%d/i,i)}function Mt(i,u){var d=this._relativeTime[i>0?"future":"past"];return V(d)?d(u):d.replace(/%s/i,u)}var Ae={};function st(i,u){var d=i.toLowerCase();Ae[d]=Ae[d+"s"]=Ae[u]=i}function gt(i){return typeof i=="string"?Ae[i]||Ae[i.toLowerCase()]:void 0}function kn(i){var u={},d,f;for(f in i)a(i,f)&&(d=gt(f),d&&(u[d]=i[f]));return u}var Ri={};function qe(i,u){Ri[i]=u}function Ns(i){var u=[],d;for(d in i)a(i,d)&&u.push({unit:d,priority:Ri[d]});return u.sort(function(f,p){return f.priority-p.priority}),u}function Kn(i){return i%4===0&&i%100!==0||i%400===0}function ft(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function de(i){var u=+i,d=0;return u!==0&&isFinite(u)&&(d=ft(u)),d}function Vr(i,u){return function(d){return d!=null?(Zn(this,i,d),e.updateOffset(this,u),this):Rt(this,i)}}function Rt(i,u){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+u]():NaN}function Zn(i,u,d){i.isValid()&&!isNaN(d)&&(u==="FullYear"&&Kn(i.year())&&i.month()===1&&i.date()===29?(d=de(d),i._d["set"+(i._isUTC?"UTC":"")+u](d,i.month(),uo(d,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+u](d))}function so(i){return i=gt(i),V(this[i])?this[i]():this}function Lr(i,u){if(typeof i=="object"){i=kn(i);var d=Ns(i),f,p=d.length;for(f=0;f68?1900:2e3)};var hp=Vr("FullYear",!0);function Jv(){return Kn(this.year())}function ew(i,u,d,f,p,b,x){var re;return i<100&&i>=0?(re=new Date(i+400,u,d,f,p,b,x),isFinite(re.getFullYear())&&re.setFullYear(i)):re=new Date(i,u,d,f,p,b,x),re}function Ai(i){var u,d;return i<100&&i>=0?(d=Array.prototype.slice.call(arguments),d[0]=i+400,u=new Date(Date.UTC.apply(null,d)),isFinite(u.getUTCFullYear())&&u.setUTCFullYear(i)):u=new Date(Date.UTC.apply(null,arguments)),u}function lo(i,u,d){var f=7+u-d,p=(7+Ai(i,0,f).getUTCDay()-u)%7;return-p+f-1}function pp(i,u,d,f,p){var b=(7+d-f)%7,x=lo(i,f,p),re=1+7*(u-1)+b+x,ge,Ye;return re<=0?(ge=i-1,Ye=Pi(ge)+re):re>Pi(i)?(ge=i+1,Ye=re-Pi(i)):(ge=i,Ye=re),{year:ge,dayOfYear:Ye}}function Ni(i,u,d){var f=lo(i.year(),u,d),p=Math.floor((i.dayOfYear()-f-1)/7)+1,b,x;return p<1?(x=i.year()-1,b=p+Xr(x,u,d)):p>Xr(i.year(),u,d)?(b=p-Xr(i.year(),u,d),x=i.year()+1):(x=i.year(),b=p),{week:b,year:x}}function Xr(i,u,d){var f=lo(i,u,d),p=lo(i+1,u,d);return(Pi(i)-f+p)/7}k("w",["ww",2],"wo","week"),k("W",["WW",2],"Wo","isoWeek"),st("week","w"),st("isoWeek","W"),qe("week",5),qe("isoWeek",5),H("w",Le),H("ww",Le,_t),H("W",Le),H("WW",Le,_t),pr(["w","ww","W","WW"],function(i,u,d,f){u[f.substr(0,1)]=de(i)});function tw(i){return Ni(i,this._week.dow,this._week.doy).week}var rw={dow:0,doy:6};function nw(){return this._week.dow}function sw(){return this._week.doy}function iw(i){var u=this.localeData().week(this);return i==null?u:this.add((i-u)*7,"d")}function aw(i){var u=Ni(this,1,4).week;return i==null?u:this.add((i-u)*7,"d")}k("d",0,"do","day"),k("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),k("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),k("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),k("e",0,0,"weekday"),k("E",0,0,"isoWeekday"),st("day","d"),st("weekday","e"),st("isoWeekday","E"),qe("day",11),qe("weekday",11),qe("isoWeekday",11),H("d",Le),H("e",Le),H("E",Le),H("dd",function(i,u){return u.weekdaysMinRegex(i)}),H("ddd",function(i,u){return u.weekdaysShortRegex(i)}),H("dddd",function(i,u){return u.weekdaysRegex(i)}),pr(["dd","ddd","dddd"],function(i,u,d,f){var p=d._locale.weekdaysParse(i,f,d._strict);p!=null?u.d=p:v(d).invalidWeekday=i}),pr(["d","e","E"],function(i,u,d,f){u[f]=de(i)});function ow(i,u){return typeof i!="string"?i:isNaN(i)?(i=u.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function uw(i,u){return typeof i=="string"?u.weekdaysParse(i)%7||7:isNaN(i)?null:i}function ll(i,u){return i.slice(u,7).concat(i.slice(0,u))}var lw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),cw="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),dw=fr,fw=fr,hw=fr;function pw(i,u){var d=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(u)?"format":"standalone"];return i===!0?ll(d,this._week.dow):i?d[i.day()]:d}function mw(i){return i===!0?ll(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function yw(i){return i===!0?ll(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function gw(i,u,d){var f,p,b,x=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],f=0;f<7;++f)b=T([2e3,1]).day(f),this._minWeekdaysParse[f]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[f]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[f]=this.weekdays(b,"").toLocaleLowerCase();return d?u==="dddd"?(p=it.call(this._weekdaysParse,x),p!==-1?p:null):u==="ddd"?(p=it.call(this._shortWeekdaysParse,x),p!==-1?p:null):(p=it.call(this._minWeekdaysParse,x),p!==-1?p:null):u==="dddd"?(p=it.call(this._weekdaysParse,x),p!==-1||(p=it.call(this._shortWeekdaysParse,x),p!==-1)?p:(p=it.call(this._minWeekdaysParse,x),p!==-1?p:null)):u==="ddd"?(p=it.call(this._shortWeekdaysParse,x),p!==-1||(p=it.call(this._weekdaysParse,x),p!==-1)?p:(p=it.call(this._minWeekdaysParse,x),p!==-1?p:null)):(p=it.call(this._minWeekdaysParse,x),p!==-1||(p=it.call(this._weekdaysParse,x),p!==-1)?p:(p=it.call(this._shortWeekdaysParse,x),p!==-1?p:null))}function _w(i,u,d){var f,p,b;if(this._weekdaysParseExact)return gw.call(this,i,u,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),f=0;f<7;f++){if(p=T([2e3,1]).day(f),d&&!this._fullWeekdaysParse[f]&&(this._fullWeekdaysParse[f]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[f]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[f]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[f]||(b="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[f]=new RegExp(b.replace(".",""),"i")),d&&u==="dddd"&&this._fullWeekdaysParse[f].test(i))return f;if(d&&u==="ddd"&&this._shortWeekdaysParse[f].test(i))return f;if(d&&u==="dd"&&this._minWeekdaysParse[f].test(i))return f;if(!d&&this._weekdaysParse[f].test(i))return f}}function Tw(i){if(!this.isValid())return i!=null?this:NaN;var u=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=ow(i,this.localeData()),this.add(i-u,"d")):u}function bw(i){if(!this.isValid())return i!=null?this:NaN;var u=(this.day()+7-this.localeData()._week.dow)%7;return i==null?u:this.add(i-u,"d")}function vw(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var u=uw(i,this.localeData());return this.day(this.day()%7?u:u-7)}else return this.day()||7}function ww(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||cl.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=dw),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ew(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||cl.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fw),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function kw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||cl.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=hw),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cl(){function i($t,rn){return rn.length-$t.length}var u=[],d=[],f=[],p=[],b,x,re,ge,Ye;for(b=0;b<7;b++)x=T([2e3,1]).day(b),re=ht(this.weekdaysMin(x,"")),ge=ht(this.weekdaysShort(x,"")),Ye=ht(this.weekdays(x,"")),u.push(re),d.push(ge),f.push(Ye),p.push(re),p.push(ge),p.push(Ye);u.sort(i),d.sort(i),f.sort(i),p.sort(i),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+f.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+u.join("|")+")","i")}function dl(){return this.hours()%12||12}function Dw(){return this.hours()||24}k("H",["HH",2],0,"hour"),k("h",["hh",2],0,dl),k("k",["kk",2],0,Dw),k("hmm",0,0,function(){return""+dl.apply(this)+g(this.minutes(),2)}),k("hmmss",0,0,function(){return""+dl.apply(this)+g(this.minutes(),2)+g(this.seconds(),2)}),k("Hmm",0,0,function(){return""+this.hours()+g(this.minutes(),2)}),k("Hmmss",0,0,function(){return""+this.hours()+g(this.minutes(),2)+g(this.seconds(),2)});function yp(i,u){k(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),u)})}yp("a",!0),yp("A",!1),st("hour","h"),qe("hour",13);function gp(i,u){return u._meridiemParse}H("a",gp),H("A",gp),H("H",Le),H("h",Le),H("k",Le),H("HH",Le,_t),H("hh",Le,_t),H("kk",Le,_t),H("hmm",Sn),H("hmmss",Cs),H("Hmm",Sn),H("Hmmss",Cs),Ne(["H","HH"],ne),Ne(["k","kk"],function(i,u,d){var f=de(i);u[ne]=f===24?0:f}),Ne(["a","A"],function(i,u,d){d._isPm=d._locale.isPM(i),d._meridiem=i}),Ne(["h","hh"],function(i,u,d){u[ne]=de(i),v(d).bigHour=!0}),Ne("hmm",function(i,u,d){var f=i.length-2;u[ne]=de(i.substr(0,f)),u[le]=de(i.substr(f)),v(d).bigHour=!0}),Ne("hmmss",function(i,u,d){var f=i.length-4,p=i.length-2;u[ne]=de(i.substr(0,f)),u[le]=de(i.substr(f,2)),u[jt]=de(i.substr(p)),v(d).bigHour=!0}),Ne("Hmm",function(i,u,d){var f=i.length-2;u[ne]=de(i.substr(0,f)),u[le]=de(i.substr(f))}),Ne("Hmmss",function(i,u,d){var f=i.length-4,p=i.length-2;u[ne]=de(i.substr(0,f)),u[le]=de(i.substr(f,2)),u[jt]=de(i.substr(p))});function Sw(i){return(i+"").toLowerCase().charAt(0)==="p"}var Ow=/[ap]\.?m?\.?/i,Mw=Vr("Hours",!0);function Rw(i,u,d){return i>11?d?"pm":"PM":d?"am":"AM"}var _p={calendar:ue,longDateFormat:ke,invalidDate:ce,ordinal:K,dayOfMonthOrdinalParse:We,relativeTime:Ke,months:$v,monthsShort:up,week:rw,weekdays:lw,weekdaysMin:cw,weekdaysShort:mp,meridiemParse:Ow},Xe={},Ci={},Ii;function xw(i,u){var d,f=Math.min(i.length,u.length);for(d=0;d0;){if(p=co(b.slice(0,d).join("-")),p)return p;if(f&&f.length>=d&&xw(b,f)>=d-1)break;d--}u++}return Ii}function Aw(i){return i.match("^[^/\\\\]*$")!=null}function co(i){var u=null,d;if(Xe[i]===void 0&&typeof Hs!="undefined"&&Hs&&Hs.exports&&Aw(i))try{u=Ii._abbr,d=require,d("./locale/"+i),Rn(u)}catch(f){Xe[i]=null}return Xe[i]}function Rn(i,u){var d;return i&&(l(u)?d=Qr(i):d=fl(i,u),d?Ii=d:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),Ii._abbr}function fl(i,u){if(u!==null){var d,f=_p;if(u.abbr=i,Xe[i]!=null)yt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),f=Xe[i]._config;else if(u.parentLocale!=null)if(Xe[u.parentLocale]!=null)f=Xe[u.parentLocale]._config;else if(d=co(u.parentLocale),d!=null)f=d._config;else return Ci[u.parentLocale]||(Ci[u.parentLocale]=[]),Ci[u.parentLocale].push({name:i,config:u}),null;return Xe[i]=new Q(P(f,u)),Ci[i]&&Ci[i].forEach(function(p){fl(p.name,p.config)}),Rn(i),Xe[i]}else return delete Xe[i],null}function Nw(i,u){if(u!=null){var d,f,p=_p;Xe[i]!=null&&Xe[i].parentLocale!=null?Xe[i].set(P(Xe[i]._config,u)):(f=co(i),f!=null&&(p=f._config),u=P(p,u),f==null&&(u.abbr=i),d=new Q(u),d.parentLocale=Xe[i],Xe[i]=d),Rn(i)}else Xe[i]!=null&&(Xe[i].parentLocale!=null?(Xe[i]=Xe[i].parentLocale,i===Rn()&&Rn(i)):Xe[i]!=null&&delete Xe[i]);return Xe[i]}function Qr(i){var u;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return Ii;if(!n(i)){if(u=co(i),u)return u;i=[i]}return Pw(i)}function Cw(){return Y(Xe)}function hl(i){var u,d=i._a;return d&&v(i).overflow===-2&&(u=d[Ze]<0||d[Ze]>11?Ze:d[G]<1||d[G]>uo(d[et],d[Ze])?G:d[ne]<0||d[ne]>24||d[ne]===24&&(d[le]!==0||d[jt]!==0||d[es]!==0)?ne:d[le]<0||d[le]>59?le:d[jt]<0||d[jt]>59?jt:d[es]<0||d[es]>999?es:-1,v(i)._overflowDayOfYear&&(uG)&&(u=G),v(i)._overflowWeeks&&u===-1&&(u=Wv),v(i)._overflowWeekday&&u===-1&&(u=qv),v(i).overflow=u),i}var Iw=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Fw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Lw=/Z|[+-]\d\d(?::?\d\d)?/,fo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Yw=/^\/?Date\((-?\d+)/i,Uw=/^(?:(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{4}))$/,Ww={UT:0,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 bp(i){var u,d,f=i._i,p=Iw.exec(f)||Fw.exec(f),b,x,re,ge,Ye=fo.length,$t=pl.length;if(p){for(v(i).iso=!0,u=0,d=Ye;uPi(x)||i._dayOfYear===0)&&(v(i)._overflowDayOfYear=!0),d=Ai(x,0,i._dayOfYear),i._a[Ze]=d.getUTCMonth(),i._a[G]=d.getUTCDate()),u=0;u<3&&i._a[u]==null;++u)i._a[u]=f[u]=p[u];for(;u<7;u++)i._a[u]=f[u]=i._a[u]==null?u===2?1:0:i._a[u];i._a[ne]===24&&i._a[le]===0&&i._a[jt]===0&&i._a[es]===0&&(i._nextDay=!0,i._a[ne]=0),i._d=(i._useUTC?Ai:ew).apply(null,f),b=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ne]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==b&&(v(i).weekdayMismatch=!0)}}function Vw(i){var u,d,f,p,b,x,re,ge,Ye;u=i._w,u.GG!=null||u.W!=null||u.E!=null?(b=1,x=4,d=Fs(u.GG,i._a[et],Ni(He(),1,4).year),f=Fs(u.W,1),p=Fs(u.E,1),(p<1||p>7)&&(ge=!0)):(b=i._locale._week.dow,x=i._locale._week.doy,Ye=Ni(He(),b,x),d=Fs(u.gg,i._a[et],Ye.year),f=Fs(u.w,Ye.week),u.d!=null?(p=u.d,(p<0||p>6)&&(ge=!0)):u.e!=null?(p=u.e+b,(u.e<0||u.e>6)&&(ge=!0)):p=b),f<1||f>Xr(d,b,x)?v(i)._overflowWeeks=!0:ge!=null?v(i)._overflowWeekday=!0:(re=pp(d,f,p,b,x),i._a[et]=re.year,i._dayOfYear=re.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function yl(i){if(i._f===e.ISO_8601){bp(i);return}if(i._f===e.RFC_2822){vp(i);return}i._a=[],v(i).empty=!0;var u=""+i._i,d,f,p,b,x,re=u.length,ge=0,Ye,$t;for(p=j(i._f,i._locale).match(w)||[],$t=p.length,d=0;d<$t;d++)b=p[d],f=(u.match(Is(b,i))||[])[0],f&&(x=u.substr(0,u.indexOf(f)),x.length>0&&v(i).unusedInput.push(x),u=u.slice(u.indexOf(f)+f.length),ge+=f.length),M[b]?(f?v(i).empty=!1:v(i).unusedTokens.push(b),Ft(b,f,i)):i._strict&&!f&&v(i).unusedTokens.push(b);v(i).charsLeftOver=re-ge,u.length>0&&v(i).unusedInput.push(u),i._a[ne]<=12&&v(i).bigHour===!0&&i._a[ne]>0&&(v(i).bigHour=void 0),v(i).parsedDateParts=i._a.slice(0),v(i).meridiem=i._meridiem,i._a[ne]=Kw(i._locale,i._a[ne],i._meridiem),Ye=v(i).era,Ye!==null&&(i._a[et]=i._locale.erasConvertYear(Ye,i._a[et])),ml(i),hl(i)}function Kw(i,u,d){var f;return d==null?u:i.meridiemHour!=null?i.meridiemHour(u,d):(i.isPM!=null&&(f=i.isPM(d),f&&u<12&&(u+=12),!f&&u===12&&(u=0)),u)}function Zw(i){var u,d,f,p,b,x,re=!1,ge=i._f.length;if(ge===0){v(i).invalidFormat=!0,i._d=new Date(NaN);return}for(p=0;pthis?this:i:q()});function kp(i,u){var d,f;if(u.length===1&&n(u[0])&&(u=u[0]),!u.length)return He();for(d=u[0],f=1;fthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function g0(){if(!l(this._isDSTShifted))return this._isDSTShifted;var i={},u;return me(i,this),i=wp(i),i._a?(u=i._isUTC?T(i._a):He(i._a),this._isDSTShifted=this.isValid()&&u0(i._a,u.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function _0(){return this.isValid()?!this._isUTC:!1}function T0(){return this.isValid()?this._isUTC:!1}function Sp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var b0=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,v0=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Sr(i,u){var d=i,f=null,p,b,x;return po(i)?d={ms:i._milliseconds,d:i._days,M:i._months}:c(i)||!isNaN(+i)?(d={},u?d[u]=+i:d.milliseconds=+i):(f=b0.exec(i))?(p=f[1]==="-"?-1:1,d={y:0,d:de(f[G])*p,h:de(f[ne])*p,m:de(f[le])*p,s:de(f[jt])*p,ms:de(gl(f[es]*1e3))*p}):(f=v0.exec(i))?(p=f[1]==="-"?-1:1,d={y:ts(f[2],p),M:ts(f[3],p),w:ts(f[4],p),d:ts(f[5],p),h:ts(f[6],p),m:ts(f[7],p),s:ts(f[8],p)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(x=w0(He(d.from),He(d.to)),d={},d.ms=x.milliseconds,d.M=x.months),b=new ho(d),po(i)&&a(i,"_locale")&&(b._locale=i._locale),po(i)&&a(i,"_isValid")&&(b._isValid=i._isValid),b}Sr.fn=ho.prototype,Sr.invalid=o0;function ts(i,u){var d=i&&parseFloat(i.replace(",","."));return(isNaN(d)?0:d)*u}function Op(i,u){var d={};return d.months=u.month()-i.month()+(u.year()-i.year())*12,i.clone().add(d.months,"M").isAfter(u)&&--d.months,d.milliseconds=+u-+i.clone().add(d.months,"M"),d}function w0(i,u){var d;return i.isValid()&&u.isValid()?(u=Tl(u,i),i.isBefore(u)?d=Op(i,u):(d=Op(u,i),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function Mp(i,u){return function(d,f){var p,b;return f!==null&&!isNaN(+f)&&(yt(u,"moment()."+u+"(period, number) is deprecated. Please use moment()."+u+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=d,d=f,f=b),p=Sr(d,f),Rp(this,p,i),this}}function Rp(i,u,d,f){var p=u._milliseconds,b=gl(u._days),x=gl(u._months);!i.isValid()||(f=f==null?!0:f,x&&cp(i,Rt(i,"Month")+x*d),b&&Zn(i,"Date",Rt(i,"Date")+b*d),p&&i._d.setTime(i._d.valueOf()+p*d),f&&e.updateOffset(i,b||x))}var E0=Mp(1,"add"),k0=Mp(-1,"subtract");function xp(i){return typeof i=="string"||i instanceof String}function D0(i){return ve(i)||h(i)||xp(i)||c(i)||O0(i)||S0(i)||i===null||i===void 0}function S0(i){var u=s(i)&&!o(i),d=!1,f=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,b,x=f.length;for(p=0;pd.valueOf():d.valueOf()9999?N(d,u?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?u?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",N(d,"Z")):N(d,u?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function q0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",u="",d,f,p,b;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",u="Z"),d="["+i+'("]',f=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",b=u+'[")]',this.format(d+f+p+b)}function j0(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var u=N(this,i);return this.localeData().postformat(u)}function $0(i,u){return this.isValid()&&(ve(i)&&i.isValid()||He(i).isValid())?Sr({to:this,from:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function B0(i){return this.from(He(),i)}function G0(i,u){return this.isValid()&&(ve(i)&&i.isValid()||He(i).isValid())?Sr({from:this,to:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function H0(i){return this.to(He(),i)}function Pp(i){var u;return i===void 0?this._locale._abbr:(u=Qr(i),u!=null&&(this._locale=u),this)}var Ap=te("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Np(){return this._locale}var yo=1e3,Ls=60*yo,go=60*Ls,Cp=(365*400+97)*24*go;function Ys(i,u){return(i%u+u)%u}function Ip(i,u,d){return i<100&&i>=0?new Date(i+400,u,d)-Cp:new Date(i,u,d).valueOf()}function Fp(i,u,d){return i<100&&i>=0?Date.UTC(i+400,u,d)-Cp:Date.UTC(i,u,d)}function z0(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Fp:Ip,i){case"year":u=d(this.year(),0,1);break;case"quarter":u=d(this.year(),this.month()-this.month()%3,1);break;case"month":u=d(this.year(),this.month(),1);break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":u=d(this.year(),this.month(),this.date());break;case"hour":u=this._d.valueOf(),u-=Ys(u+(this._isUTC?0:this.utcOffset()*Ls),go);break;case"minute":u=this._d.valueOf(),u-=Ys(u,Ls);break;case"second":u=this._d.valueOf(),u-=Ys(u,yo);break}return this._d.setTime(u),e.updateOffset(this,!0),this}function V0(i){var u,d;if(i=gt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Fp:Ip,i){case"year":u=d(this.year()+1,0,1)-1;break;case"quarter":u=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":u=d(this.year(),this.month()+1,1)-1;break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":u=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":u=this._d.valueOf(),u+=go-Ys(u+(this._isUTC?0:this.utcOffset()*Ls),go)-1;break;case"minute":u=this._d.valueOf(),u+=Ls-Ys(u,Ls)-1;break;case"second":u=this._d.valueOf(),u+=yo-Ys(u,yo)-1;break}return this._d.setTime(u),e.updateOffset(this,!0),this}function K0(){return this._d.valueOf()-(this._offset||0)*6e4}function Z0(){return Math.floor(this.valueOf()/1e3)}function X0(){return new Date(this.valueOf())}function Q0(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function J0(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function e1(){return this.isValid()?this.toISOString():null}function t1(){return I(this)}function r1(){return _({},v(this))}function n1(){return v(this).overflow}function s1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}k("N",0,0,"eraAbbr"),k("NN",0,0,"eraAbbr"),k("NNN",0,0,"eraAbbr"),k("NNNN",0,0,"eraName"),k("NNNNN",0,0,"eraNarrow"),k("y",["y",1],"yo","eraYear"),k("y",["yy",2],0,"eraYear"),k("y",["yyy",3],0,"eraYear"),k("y",["yyyy",4],0,"eraYear"),H("N",vl),H("NN",vl),H("NNN",vl),H("NNNN",m1),H("NNNNN",y1),Ne(["N","NN","NNN","NNNN","NNNNN"],function(i,u,d,f){var p=d._locale.erasParse(i,f,d._strict);p?v(d).era=p:v(d).invalidEra=i}),H("y",dr),H("yy",dr),H("yyy",dr),H("yyyy",dr),H("yo",g1),Ne(["y","yy","yyy","yyyy"],et),Ne(["yo"],function(i,u,d,f){var p;d._locale._eraYearOrdinalRegex&&(p=i.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?u[et]=d._locale.eraYearOrdinalParse(i,p):u[et]=parseInt(i,10)});function i1(i,u){var d,f,p,b=this._eras||Qr("en")._eras;for(d=0,f=b.length;d=0)return b[f]}function o1(i,u){var d=i.since<=i.until?1:-1;return u===void 0?e(i.since).year():e(i.since).year()+(u-i.offset)*d}function u1(){var i,u,d,f=this.localeData().eras();for(i=0,u=f.length;ib&&(u=b),k1.call(this,i,u,d,f,p))}function k1(i,u,d,f,p){var b=pp(i,u,d,f,p),x=Ai(b.year,0,b.dayOfYear);return this.year(x.getUTCFullYear()),this.month(x.getUTCMonth()),this.date(x.getUTCDate()),this}k("Q",0,"Qo","quarter"),st("quarter","Q"),qe("quarter",7),H("Q",Dn),Ne("Q",function(i,u){u[Ze]=(de(i)-1)*3});function D1(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}k("D",["DD",2],"Do","date"),st("date","D"),qe("date",9),H("D",Le),H("DD",Le,_t),H("Do",function(i,u){return i?u._dayOfMonthOrdinalParse||u._ordinalParse:u._dayOfMonthOrdinalParseLenient}),Ne(["D","DD"],G),Ne("Do",function(i,u){u[G]=de(i.match(Le)[0])});var Yp=Vr("Date",!0);k("DDD",["DDDD",3],"DDDo","dayOfYear"),st("dayOfYear","DDD"),qe("dayOfYear",4),H("DDD",Xn),H("DDDD",xi),Ne(["DDD","DDDD"],function(i,u,d){d._dayOfYear=de(i)});function S1(i){var u=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?u:this.add(i-u,"d")}k("m",["mm",2],0,"minute"),st("minute","m"),qe("minute",14),H("m",Le),H("mm",Le,_t),Ne(["m","mm"],le);var O1=Vr("Minutes",!1);k("s",["ss",2],0,"second"),st("second","s"),qe("second",15),H("s",Le),H("ss",Le,_t),Ne(["s","ss"],jt);var M1=Vr("Seconds",!1);k("S",0,0,function(){return~~(this.millisecond()/100)}),k(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),k(0,["SSS",3],0,"millisecond"),k(0,["SSSS",4],0,function(){return this.millisecond()*10}),k(0,["SSSSS",5],0,function(){return this.millisecond()*100}),k(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),k(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),k(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),k(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),st("millisecond","ms"),qe("millisecond",16),H("S",Xn,Dn),H("SS",Xn,_t),H("SSS",Xn,xi);var xn,Up;for(xn="SSSS";xn.length<=9;xn+="S")H(xn,dr);function R1(i,u){u[es]=de(("0."+i)*1e3)}for(xn="S";xn.length<=9;xn+="S")Ne(xn,R1);Up=Vr("Milliseconds",!1),k("z",0,0,"zoneAbbr"),k("zz",0,0,"zoneName");function x1(){return this._isUTC?"UTC":""}function P1(){return this._isUTC?"Coordinated Universal Time":""}var F=fe.prototype;F.add=E0,F.calendar=x0,F.clone=P0,F.diff=Y0,F.endOf=V0,F.format=j0,F.from=$0,F.fromNow=B0,F.to=G0,F.toNow=H0,F.get=so,F.invalidAt=n1,F.isAfter=A0,F.isBefore=N0,F.isBetween=C0,F.isSame=I0,F.isSameOrAfter=F0,F.isSameOrBefore=L0,F.isValid=t1,F.lang=Ap,F.locale=Pp,F.localeData=Np,F.max=t0,F.min=e0,F.parsingFlags=r1,F.set=Lr,F.startOf=z0,F.subtract=k0,F.toArray=Q0,F.toObject=J0,F.toDate=X0,F.toISOString=W0,F.inspect=q0,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=e1,F.toString=U0,F.unix=Z0,F.valueOf=K0,F.creationData=s1,F.eraName=u1,F.eraNarrow=l1,F.eraAbbr=c1,F.eraYear=d1,F.year=hp,F.isLeapYear=Jv,F.weekYear=_1,F.isoWeekYear=T1,F.quarter=F.quarters=D1,F.month=dp,F.daysInMonth=Zv,F.week=F.weeks=iw,F.isoWeek=F.isoWeeks=aw,F.weeksInYear=w1,F.weeksInWeekYear=E1,F.isoWeeksInYear=b1,F.isoWeeksInISOWeekYear=v1,F.date=Yp,F.day=F.days=Tw,F.weekday=bw,F.isoWeekday=vw,F.dayOfYear=S1,F.hour=F.hours=Mw,F.minute=F.minutes=O1,F.second=F.seconds=M1,F.millisecond=F.milliseconds=Up,F.utcOffset=c0,F.utc=f0,F.local=h0,F.parseZone=p0,F.hasAlignedHourOffset=m0,F.isDST=y0,F.isLocal=_0,F.isUtcOffset=T0,F.isUtc=Sp,F.isUTC=Sp,F.zoneAbbr=x1,F.zoneName=P1,F.dates=te("dates accessor is deprecated. Use date instead.",Yp),F.months=te("months accessor is deprecated. Use month instead",dp),F.years=te("years accessor is deprecated. Use year instead",hp),F.zone=te("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",d0),F.isDSTShifted=te("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",g0);function A1(i){return He(i*1e3)}function N1(){return He.apply(null,arguments).parseZone()}function Wp(i){return i}var Re=Q.prototype;Re.calendar=y,Re.longDateFormat=ye,Re.invalidDate=Ie,Re.ordinal=Je,Re.preparse=Wp,Re.postformat=Wp,Re.relativeTime=Dr,Re.pastFuture=Mt,Re.set=W,Re.eras=i1,Re.erasParse=a1,Re.erasConvertYear=o1,Re.erasAbbrRegex=h1,Re.erasNameRegex=f1,Re.erasNarrowRegex=p1,Re.months=Hv,Re.monthsShort=zv,Re.monthsParse=Kv,Re.monthsRegex=Qv,Re.monthsShortRegex=Xv,Re.week=tw,Re.firstDayOfYear=sw,Re.firstDayOfWeek=nw,Re.weekdays=pw,Re.weekdaysMin=yw,Re.weekdaysShort=mw,Re.weekdaysParse=_w,Re.weekdaysRegex=ww,Re.weekdaysShortRegex=Ew,Re.weekdaysMinRegex=kw,Re.isPM=Sw,Re.meridiem=Rw;function To(i,u,d,f){var p=Qr(),b=T().set(f,u);return p[d](b,i)}function qp(i,u,d){if(c(i)&&(u=i,i=void 0),i=i||"",u!=null)return To(i,u,d,"month");var f,p=[];for(f=0;f<12;f++)p[f]=To(i,f,d,"month");return p}function El(i,u,d,f){typeof i=="boolean"?(c(u)&&(d=u,u=void 0),u=u||""):(u=i,d=u,i=!1,c(u)&&(d=u,u=void 0),u=u||"");var p=Qr(),b=i?p._week.dow:0,x,re=[];if(d!=null)return To(u,(d+b)%7,f,"day");for(x=0;x<7;x++)re[x]=To(u,(x+b)%7,f,"day");return re}function C1(i,u){return qp(i,u,"months")}function I1(i,u){return qp(i,u,"monthsShort")}function F1(i,u,d){return El(i,u,d,"weekdays")}function L1(i,u,d){return El(i,u,d,"weekdaysShort")}function Y1(i,u,d){return El(i,u,d,"weekdaysMin")}Rn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var u=i%10,d=de(i%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th";return i+d}}),e.lang=te("moment.lang is deprecated. Use moment.locale instead.",Rn),e.langData=te("moment.langData is deprecated. Use moment.localeData instead.",Qr);var Jr=Math.abs;function U1(){var i=this._data;return this._milliseconds=Jr(this._milliseconds),this._days=Jr(this._days),this._months=Jr(this._months),i.milliseconds=Jr(i.milliseconds),i.seconds=Jr(i.seconds),i.minutes=Jr(i.minutes),i.hours=Jr(i.hours),i.months=Jr(i.months),i.years=Jr(i.years),this}function jp(i,u,d,f){var p=Sr(u,d);return i._milliseconds+=f*p._milliseconds,i._days+=f*p._days,i._months+=f*p._months,i._bubble()}function W1(i,u){return jp(this,i,u,1)}function q1(i,u){return jp(this,i,u,-1)}function $p(i){return i<0?Math.floor(i):Math.ceil(i)}function j1(){var i=this._milliseconds,u=this._days,d=this._months,f=this._data,p,b,x,re,ge;return i>=0&&u>=0&&d>=0||i<=0&&u<=0&&d<=0||(i+=$p(kl(d)+u)*864e5,u=0,d=0),f.milliseconds=i%1e3,p=ft(i/1e3),f.seconds=p%60,b=ft(p/60),f.minutes=b%60,x=ft(b/60),f.hours=x%24,u+=ft(x/24),ge=ft(Bp(u)),d+=ge,u-=$p(kl(ge)),re=ft(d/12),d%=12,f.days=u,f.months=d,f.years=re,this}function Bp(i){return i*4800/146097}function kl(i){return i*146097/4800}function $1(i){if(!this.isValid())return NaN;var u,d,f=this._milliseconds;if(i=gt(i),i==="month"||i==="quarter"||i==="year")switch(u=this._days+f/864e5,d=this._months+Bp(u),i){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(u=this._days+Math.round(kl(this._months)),i){case"week":return u/7+f/6048e5;case"day":return u+f/864e5;case"hour":return u*24+f/36e5;case"minute":return u*1440+f/6e4;case"second":return u*86400+f/1e3;case"millisecond":return Math.floor(u*864e5)+f;default:throw new Error("Unknown unit "+i)}}function B1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+de(this._months/12)*31536e6:NaN}function en(i){return function(){return this.as(i)}}var G1=en("ms"),H1=en("s"),z1=en("m"),V1=en("h"),K1=en("d"),Z1=en("w"),X1=en("M"),Q1=en("Q"),J1=en("y");function eE(){return Sr(this)}function tE(i){return i=gt(i),this.isValid()?this[i+"s"]():NaN}function rs(i){return function(){return this.isValid()?this._data[i]:NaN}}var rE=rs("milliseconds"),nE=rs("seconds"),sE=rs("minutes"),iE=rs("hours"),aE=rs("days"),oE=rs("months"),uE=rs("years");function lE(){return ft(this.days()/7)}var tn=Math.round,Us={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function cE(i,u,d,f,p){return p.relativeTime(u||1,!!d,i,f)}function dE(i,u,d,f){var p=Sr(i).abs(),b=tn(p.as("s")),x=tn(p.as("m")),re=tn(p.as("h")),ge=tn(p.as("d")),Ye=tn(p.as("M")),$t=tn(p.as("w")),rn=tn(p.as("y")),Pn=b<=d.ss&&["s",b]||b0,Pn[4]=f,cE.apply(null,Pn)}function fE(i){return i===void 0?tn:typeof i=="function"?(tn=i,!0):!1}function hE(i,u){return Us[i]===void 0?!1:u===void 0?Us[i]:(Us[i]=u,i==="s"&&(Us.ss=u-1),!0)}function pE(i,u){if(!this.isValid())return this.localeData().invalidDate();var d=!1,f=Us,p,b;return typeof i=="object"&&(u=i,i=!1),typeof i=="boolean"&&(d=i),typeof u=="object"&&(f=Object.assign({},Us,u),u.s!=null&&u.ss==null&&(f.ss=u.s-1)),p=this.localeData(),b=dE(this,!d,f,p),d&&(b=p.pastFuture(+this,b)),p.postformat(b)}var Dl=Math.abs;function Ws(i){return(i>0)-(i<0)||+i}function bo(){if(!this.isValid())return this.localeData().invalidDate();var i=Dl(this._milliseconds)/1e3,u=Dl(this._days),d=Dl(this._months),f,p,b,x,re=this.asSeconds(),ge,Ye,$t,rn;return re?(f=ft(i/60),p=ft(f/60),i%=60,f%=60,b=ft(d/12),d%=12,x=i?i.toFixed(3).replace(/\.?0+$/,""):"",ge=re<0?"-":"",Ye=Ws(this._months)!==Ws(re)?"-":"",$t=Ws(this._days)!==Ws(re)?"-":"",rn=Ws(this._milliseconds)!==Ws(re)?"-":"",ge+"P"+(b?Ye+b+"Y":"")+(d?Ye+d+"M":"")+(u?$t+u+"D":"")+(p||f||i?"T":"")+(p?rn+p+"H":"")+(f?rn+f+"M":"")+(i?rn+x+"S":"")):"P0D"}var Oe=ho.prototype;Oe.isValid=a0,Oe.abs=U1,Oe.add=W1,Oe.subtract=q1,Oe.as=$1,Oe.asMilliseconds=G1,Oe.asSeconds=H1,Oe.asMinutes=z1,Oe.asHours=V1,Oe.asDays=K1,Oe.asWeeks=Z1,Oe.asMonths=X1,Oe.asQuarters=Q1,Oe.asYears=J1,Oe.valueOf=B1,Oe._bubble=j1,Oe.clone=eE,Oe.get=tE,Oe.milliseconds=rE,Oe.seconds=nE,Oe.minutes=sE,Oe.hours=iE,Oe.days=aE,Oe.weeks=lE,Oe.months=oE,Oe.years=uE,Oe.humanize=pE,Oe.toISOString=bo,Oe.toString=bo,Oe.toJSON=bo,Oe.locale=Pp,Oe.localeData=Np,Oe.toIsoString=te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bo),Oe.lang=Ap,k("X",0,0,"unix"),k("x",0,0,"valueOf"),H("x",Mn),H("X",ao),Ne("X",function(i,u,d){d._d=new Date(parseFloat(i)*1e3)}),Ne("x",function(i,u,d){d._d=new Date(de(i))});return e.version="2.29.4",t(He),e.fn=F,e.min=r0,e.max=n0,e.now=s0,e.utc=T,e.unix=A1,e.months=C1,e.isDate=h,e.locale=Rn,e.invalid=q,e.duration=Sr,e.isMoment=ve,e.weekdays=F1,e.parseZone=N1,e.localeData=Qr,e.isDuration=po,e.monthsShort=I1,e.weekdaysMin=Y1,e.defineLocale=fl,e.updateLocale=Nw,e.locales=Cw,e.weekdaysShort=L1,e.normalizeUnits=gt,e.relativeTimeRounding=fE,e.relativeTimeThreshold=hE,e.calendarFormat=R0,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var sy=O((ry,ny)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(g){return Object.prototype.toString.call(g)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",o=typeof Reflect=="object",l=typeof setImmediate=="function",c=l?setImmediate:setTimeout,h=a?o&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(y){var g=Object.getOwnPropertyNames(y);return g.push.apply(g,Object.getOwnPropertySymbols(y)),g}:Object.keys;function m(){this._events={},this._conf&&_.call(this,this._conf)}function _(y){y&&(this._conf=y,y.delimiter&&(this.delimiter=y.delimiter),y.maxListeners!==r&&(this._maxListeners=y.maxListeners),y.wildcard&&(this.wildcard=y.wildcard),y.newListener&&(this._newListener=y.newListener),y.removeListener&&(this._removeListener=y.removeListener),y.verboseMemoryLeak&&(this.verboseMemoryLeak=y.verboseMemoryLeak),y.ignoreErrors&&(this.ignoreErrors=y.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function T(y,g){var w="(node) warning: possible EventEmitter memory leak detected. "+y+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+g+"."),typeof process!="undefined"&&process.emitWarning){var E=new Error(w);E.name="MaxListenersExceededWarning",E.emitter=this,E.count=y,process.emitWarning(E)}else console.error(w),console.trace&&console.trace()}var D=function(y,g,w){var E=arguments.length;switch(E){case 0:return[];case 1:return[y];case 2:return[y,g];case 3:return[y,g,w];default:for(var S=new Array(E);E--;)S[E]=arguments[E];return S}};function v(y,g){for(var w={},E,S=y.length,M=g?g.length:0,k=0;k0;)y=M[A],k.call(C,y,w[y]);this._listeners={},this._listenersCount=0,N()}}});function I(y,g,w,E){var S=Object.assign({},g);if(!y)return S;if(typeof y!="object")throw TypeError("options must be an object");var M=Object.keys(y),k=M.length,C,A,N;function j(ye){throw Error('Invalid "'+C+'" option value'+(ye?". Reason: "+ye:""))}for(var ke=0;ke0;)if(C===y[A])return M;k(g)}}var B=$(["function"]),me=$(["object","function"]);function fe(y,g,w){var E,S,M=0,k,C=new y(function(A,N,j){w=I(w,{timeout:0,overload:!1},{timeout:function(Ie,K){return Ie*=1,(typeof Ie!="number"||Ie<0||!Number.isFinite(Ie))&&K("timeout must be a positive number"),Ie}}),E=!w.overload&&typeof y.prototype.cancel=="function"&&typeof j=="function";function ke(){S&&(S=null),M&&(clearTimeout(M),M=0)}var ye=function(Ie){ke(),A(Ie)},ce=function(Ie){ke(),N(Ie)};E?g(ye,ce,j):(S=[function(Ie){ce(Ie||Error("canceled"))}],g(ye,ce,function(Ie){if(k)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Ie!="function")throw TypeError("onCancel callback must be a function");S.push(Ie)}),k=!0),w.timeout>0&&(M=setTimeout(function(){var Ie=Error("timeout");Ie.code="ETIMEDOUT",M=0,C.cancel(Ie),N(Ie)},w.timeout))});return E||(C.cancel=function(A){if(!!S){for(var N=S.length,j=1;j0;)ce=Mt[C],ce!=="_listeners"&&(Ae=ee(y,g,w[ce],E+1,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae));return ye}else if(Ke==="**"){for(Je=E+1===S||E+2===S&&Dr==="*",Je&&w._listeners&&(ye=ee(y,g,w,S,S)),Mt=h(w),C=Mt.length;C-- >0;)ce=Mt[C],ce!=="_listeners"&&(ce==="*"||ce==="**"?(w[ce]._listeners&&!Je&&(Ae=ee(y,g,w[ce],S,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae)),Ae=ee(y,g,w[ce],E,S)):ce===Dr?Ae=ee(y,g,w[ce],E+2,S):Ae=ee(y,g,w[ce],E,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae));return ye}else w[Ke]&&(ye=ee(y,g,w[Ke],E+1,S));if(Ie=w["*"],Ie&&ee(y,g,Ie,E+1,S),K=w["**"],K)if(E0;)ce=Mt[C],ce!=="_listeners"&&(ce===Dr?ee(y,g,K[ce],E+2,S):ce===Ke?ee(y,g,K[ce],E+1,S):(We={},We[ce]=K[ce],ee(y,g,{"**":We},E+1,S)));else K._listeners?ee(y,g,K,S,S):K["*"]&&K["*"]._listeners&&ee(y,g,K["*"],S,S);return ye}function te(y,g,w){var E=0,S=0,M,k=this.delimiter,C=k.length,A;if(typeof y=="string")if((M=y.indexOf(k))!==-1){A=new Array(5);do A[E++]=y.slice(S,M),S=M+C;while((M=y.indexOf(k,S))!==-1);A[E++]=y.slice(S)}else A=[y],E=1;else A=y,E=y.length;if(E>1){for(M=0;M+10&&N._listeners.length>this._maxListeners&&(N._listeners.warned=!0,T.call(this,N._listeners.length,j))):N._listeners=g,!0;return!0}function It(y,g,w,E){for(var S=h(y),M=S.length,k,C,A,N=y._listeners,j;M-- >0;)C=S[M],k=y[C],C==="_listeners"?A=w:A=w?w.concat(C):[C],j=E||typeof C=="symbol",N&&g.push(j?A:A.join(this.delimiter)),typeof k=="object"&&It.call(this,k,g,A,j);return g}function yt(y){for(var g=h(y),w=g.length,E,S,M;w-- >0;)S=g[w],E=y[S],E&&(M=!0,S!=="_listeners"&&!yt(E)&&delete y[S]);return M}function V(y,g,w){this.emitter=y,this.event=g,this.listener=w}V.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function W(y,g,w){if(w===!0)S=!0;else if(w===!1)E=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var E=w.async,S=w.promisify,M=w.nextTick,k=w.objectify}if(E||M||S){var C=g,A=g._origin||g;if(M&&!s)throw Error("process.nextTick is not supported");S===r&&(S=g.constructor.name==="AsyncFunction"),g=function(){var N=arguments,j=this,ke=this.event;return S?M?Promise.resolve():new Promise(function(ye){c(ye)}).then(function(){return j.event=ke,C.apply(j,N)}):(M?process.nextTick:c)(function(){j.event=ke,C.apply(j,N)})},g._async=!0,g._origin=A}return[g,k?new V(this,y,g):this]}function P(y){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,_.call(this,y)}P.EventEmitter2=P,P.prototype.listenTo=function(y,g,w){if(typeof y!="object")throw TypeError("target musts be an object");var E=this;w=I(w,{on:r,off:r,reducers:r},{on:B,off:B,reducers:me});function S(M){if(typeof M!="object")throw TypeError("events must be an object");var k=w.reducers,C=ve.call(E,y),A;C===-1?A=new R(E,y,w):A=E._observers[C];for(var N=h(M),j=N.length,ke,ye=typeof k=="function",ce=0;ce0;)S=w[E],(!y||S._target===y)&&(S.unsubscribe(g),M=!0);return M},P.prototype.delimiter=".",P.prototype.setMaxListeners=function(y){y!==r&&(this._maxListeners=y,this._conf||(this._conf={}),this._conf.maxListeners=y)},P.prototype.getMaxListeners=function(){return this._maxListeners},P.prototype.event="",P.prototype.once=function(y,g,w){return this._once(y,g,!1,w)},P.prototype.prependOnceListener=function(y,g,w){return this._once(y,g,!0,w)},P.prototype._once=function(y,g,w,E){return this._many(y,1,g,w,E)},P.prototype.many=function(y,g,w,E){return this._many(y,g,w,!1,E)},P.prototype.prependMany=function(y,g,w,E){return this._many(y,g,w,!0,E)},P.prototype._many=function(y,g,w,E,S){var M=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function k(){return--g===0&&M.off(y,k),w.apply(this,arguments)}return k._origin=w,this._on(y,k,E,S)},P.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||m.call(this);var y=arguments[0],g,w=this.wildcard,E,S,M,k,C;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(g=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(S=y.length,a){for(M=0;M3)for(E=new Array(A-1),k=1;k3)for(S=new Array(N-1),C=1;C0&&this._events[y].length>this._maxListeners&&(this._events[y].warned=!0,T.call(this,this._events[y].length,y))):this._events[y]=g,S)},P.prototype.off=function(y,g){if(typeof g!="function")throw new Error("removeListener only takes instances of Function");var w,E=[];if(this.wildcard){var S=typeof y=="string"?y.split(this.delimiter):y.slice();if(E=ee.call(this,null,S,this.listenerTree,0),!E)return this}else{if(!this._events[y])return this;w=this._events[y],E.push({_listeners:w})}for(var M=0;M0){for(E=this._all,g=0,w=E.length;g0;)E=g[w[M]],typeof E=="function"?S.push(E):S.push.apply(S,E);return S}else{if(this.wildcard){if(k=this.listenerTree,!k)return[];var C=[],A=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,C,A,k,0),C}return g?(E=g[y],E?typeof E=="function"?[E]:E:[]):[]}},P.prototype.eventNames=function(y){var g=this._events;return this.wildcard?It.call(this,this.listenerTree,[],null,y):g?h(g):[]},P.prototype.listenerCount=function(y){return this.listeners(y).length},P.prototype.hasListeners=function(y){if(this.wildcard){var g=[],w=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,g,w,this.listenerTree,0),g.length>0}var E=this._events,S=this._all;return!!(S&&S.length||E&&(y===r?h(E).length:E[y]))},P.prototype.listenersAny=function(){return this._all?this._all:[]},P.prototype.waitFor=function(y,g){var w=this,E=typeof g;return E==="number"?g={timeout:g}:E==="function"&&(g={filter:g}),g=I(g,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:B,Promise:q}),fe(g.Promise,function(S,M,k){function C(){var A=g.filter;if(!(A&&!A.apply(w,arguments)))if(w.off(y,C),g.handleError){var N=arguments[0];N?M(N):S(D.apply(null,arguments).slice(1))}else S(D.apply(null,arguments))}k(function(){w.off(y,C)}),w._on(y,C,!1)},{timeout:g.timeout,overload:g.overload})};function Q(y,g,w){w=I(w,{Promise,timeout:0,overload:!1},{Promise:q});var E=w.Promise;return fe(E,function(S,M,k){var C;if(typeof y.addEventListener=="function"){C=function(){S(D.apply(null,arguments))},k(function(){y.removeEventListener(g,C)}),y.addEventListener(g,C,{once:!0});return}var A=function(){N&&y.removeListener("error",N),S(D.apply(null,arguments))},N;g!=="error"&&(N=function(j){y.removeListener(g,A),M(j)},y.once("error",N)),k(function(){N&&y.removeListener("error",N),y.removeListener(g,A)}),y.once(g,A)},{timeout:w.timeout,overload:w.overload})}var Y=P.prototype;if(Object.defineProperties(P,{defaultMaxListeners:{get:function(){return Y._maxListeners},set:function(y){if(typeof y!="number"||y<0||Number.isNaN(y))throw TypeError("n must be a non-negative number");Y._maxListeners=y},enumerable:!0},once:{value:Q,writable:!0,configurable:!0}}),Object.defineProperties(Y,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return P});else if(typeof ry=="object")ny.exports=P;else{var ue=new Function("","return this")();ue.EventEmitter2=P}})()});var Fe=O(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.matchAnyPattern=Ln.extractTerms=Ln.repeatedTimeunitPattern=void 0;function Ok(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}Ln.repeatedTimeunitPattern=Ok;function Dy(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}Ln.extractTerms=Dy;function Mk(r){return`(?:${Dy(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}Ln.matchAnyPattern=Mk});var xe=O((Xl,Ql)=>{(function(r,e){typeof Xl=="object"&&typeof Ql!="undefined"?Ql.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Xl,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",a="minute",o="hour",l="day",c="week",h="month",m="quarter",_="year",T="date",D="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},q=function(V,W,P){var Q=String(V);return!Q||Q.length>=W?V:""+Array(W+1-Q.length).join(P)+V},$={s:q,z:function(V){var W=-V.utcOffset(),P=Math.abs(W),Q=Math.floor(P/60),Y=P%60;return(W<=0?"+":"-")+q(Q,2,"0")+":"+q(Y,2,"0")},m:function V(W,P){if(W.date(){"use strict";var Rk=Yn&&Yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.findYearClosestToRef=Yn.findMostLikelyADYear=void 0;var xk=Rk(xe());function Pk(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}Yn.findMostLikelyADYear=Pk;function Ak(r,e,t){let n=xk.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let a=s.add(1,"y"),o=s.add(-1,"y");return Math.abs(a.diff(n)){"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.parseTimeUnits=_e.TIME_UNITS_PATTERN=_e.parseYear=_e.YEAR_PATTERN=_e.parseOrdinalNumberPattern=_e.ORDINAL_NUMBER_PATTERN=_e.parseNumberPattern=_e.NUMBER_PATTERN=_e.TIME_UNIT_DICTIONARY=_e.ORDINAL_WORD_DICTIONARY=_e.INTEGER_WORD_DICTIONARY=_e.MONTH_DICTIONARY=_e.FULL_MONTH_NAME_DICTIONARY=_e.WEEKDAY_DICTIONARY=void 0;var Yo=Fe(),Nk=At();_e.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};_e.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};_e.MONTH_DICTIONARY=Object.assign(Object.assign({},_e.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});_e.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};_e.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};_e.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};_e.NUMBER_PATTERN=`(?:${Yo.matchAnyPattern(_e.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function Oy(r){let e=r.toLowerCase();return _e.INTEGER_WORD_DICTIONARY[e]!==void 0?_e.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}_e.parseNumberPattern=Oy;_e.ORDINAL_NUMBER_PATTERN=`(?:${Yo.matchAnyPattern(_e.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Ck(r){let e=r.toLowerCase();return _e.ORDINAL_WORD_DICTIONARY[e]!==void 0?_e.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}_e.parseOrdinalNumberPattern=Ck;_e.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function Ik(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return Nk.findMostLikelyADYear(e)}_e.parseYear=Ik;var My=`(${_e.NUMBER_PATTERN})\\s{0,3}(${Yo.matchAnyPattern(_e.TIME_UNIT_DICTIONARY)})`,Sy=new RegExp(My,"i");_e.TIME_UNITS_PATTERN=Yo.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",My);function Fk(r){let e={},t=r,n=Sy.exec(t);for(;n;)Lk(e,n),t=t.substring(n[0].length).trim(),n=Sy.exec(t);return e}_e.parseTimeUnits=Fk;function Lk(r,e){let t=Oy(e[1]),n=_e.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Ry=O((Jl,ec)=>{(function(r,e){typeof Jl=="object"&&typeof ec!="undefined"?ec.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Jl,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var a=s.add;s.add=function(l,c){return l=Number(l),this.$utils().p(c)===e?this.add(3*l,r):a.bind(this)(l,c)};var o=s.startOf;s.startOf=function(l,c){var h=this.$utils(),m=!!h.u(c)||c;if(h.p(l)===e){var _=this.quarter()-1;return m?this.month(3*_).startOf(r).startOf("day"):this.month(3*_+2).endOf(r).endOf("day")}return o.bind(this)(l,c)}}})});var _r=O(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.implySimilarTime=qr.assignSimilarTime=qr.assignSimilarDate=qr.assignTheNextDay=void 0;var xy=mt();function Yk(r,e){e=e.add(1,"day"),Py(r,e),Ay(r,e)}qr.assignTheNextDay=Yk;function Py(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}qr.assignSimilarDate=Py;function Uk(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",xy.Meridiem.AM):r.assign("meridiem",xy.Meridiem.PM)}qr.assignSimilarTime=Uk;function Ay(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}qr.implySimilarTime=Ay});var Ny=O(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.toTimezoneOffset=hs.TIMEZONE_ABBR_MAP=void 0;hs.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function Wk(r){var e;return r==null?null:typeof r=="number"?r:(e=hs.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}hs.toTimezoneOffset=Wk});var rt=O(jr=>{"use strict";var Cy=jr&&jr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jr,"__esModule",{value:!0});jr.ParsingResult=jr.ParsingComponents=jr.ReferenceWithTimezone=void 0;var qk=Cy(Ry()),Uo=Cy(xe()),tc=_r(),jk=Ny();Uo.default.extend(qk.default);var rc=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=jk.toTimezoneOffset(e.timezone))}};jr.ReferenceWithTimezone=rc;var ps=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=Uo.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new ps(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return Uo.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let s=-e.getTimezoneOffset(),a=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-a}static createRelativeFromReference(e,t){let n=Uo.default(e.instant);for(let a in t)n=n.add(t[a],a);let s=new ps(e);return t.hour||t.minute||t.second?(tc.assignSimilarTime(s,n),tc.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(tc.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};jr.ParsingComponents=ps;var ea=class{constructor(e,t,n,s,a){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new ps(e),this.end=a}clone(){let e=new ea(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};jr.ParsingResult=ea});var Z=O(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.AbstractParserWithWordBoundaryChecking=void 0;var nc=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let a=2;a{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});var ic=Nt(),$k=rt(),Bk=Z(),Gk=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ic.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Hk=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ic.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),sc=class extends Bk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?Hk:Gk}innerExtract(e,t){let n=ic.parseTimeUnits(t[1]);return $k.ParsingComponents.createRelativeFromReference(e.reference,n)}};ac.default=sc});var qy=O(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var zk=At(),Uy=Nt(),Wy=Nt(),qo=Nt(),Vk=Fe(),Kk=Z(),Zk=new RegExp(`(?:on\\s{0,3})?(${qo.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${qo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Vk.matchAnyPattern(Uy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${Wy.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Fy=1,Ly=2,Xk=3,Yy=4,oc=class extends Kk.AbstractParserWithWordBoundaryChecking{innerPattern(){return Zk}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Uy.MONTH_DICTIONARY[t[Xk].toLowerCase()],a=qo.parseOrdinalNumberPattern(t[Fy]);if(a>31)return t.index=t.index+t[Fy].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Yy]){let o=Wy.parseYear(t[Yy]);n.start.assign("year",o)}else{let o=zk.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Ly]){let o=qo.parseOrdinalNumberPattern(t[Ly]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};uc.default=oc});var Hy=O(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var Qk=At(),By=Nt(),jo=Nt(),Gy=Nt(),Jk=Fe(),eD=Z(),tD=new RegExp(`(${Jk.matchAnyPattern(By.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${jo.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${jo.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${Gy.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),rD=1,nD=2,jy=3,$y=4,lc=class extends eD.AbstractParserWithWordBoundaryChecking{innerPattern(){return tD}innerExtract(e,t){let n=By.MONTH_DICTIONARY[t[rD].toLowerCase()],s=jo.parseOrdinalNumberPattern(t[nD]);if(s>31)return null;let a=e.createParsingComponents({day:s,month:n});if(t[$y]){let c=Gy.parseYear(t[$y]);a.assign("year",c)}else{let c=Qk.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[jy])return a;let o=jo.parseOrdinalNumberPattern(t[jy]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};cc.default=lc});var Ky=O(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});var dc=Nt(),sD=At(),iD=Fe(),Vy=Nt(),aD=Z(),oD=new RegExp(`((?:in)\\s*)?(${iD.matchAnyPattern(dc.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Vy.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),uD=1,lD=2,zy=3,fc=class extends aD.AbstractParserWithWordBoundaryChecking{innerPattern(){return oD}innerExtract(e,t){let n=t[lD].toLowerCase();if(t[0].length<=3&&!dc.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[uD]||"").length,t.index+t[0].length);s.start.imply("day",1);let a=dc.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[zy]){let o=Vy.parseYear(t[zy]);s.start.assign("year",o)}else{let o=sD.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};hc.default=fc});var Qy=O(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});var Xy=Nt(),cD=Fe(),dD=Z(),fD=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${cD.matchAnyPattern(Xy.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),hD=1,pD=2,Zy=3,mD=4,pc=class extends dD.AbstractParserWithWordBoundaryChecking{innerPattern(){return fD}innerExtract(e,t){let n=t[Zy]?parseInt(t[Zy]):Xy.MONTH_DICTIONARY[t[pD].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[hD]);return{day:parseInt(t[mD]),month:n,year:s}}};mc.default=pc});var Jy=O(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var yD=Z(),gD=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),_D=1,TD=2,yc=class extends yD.AbstractParserWithWordBoundaryChecking{innerPattern(){return gD}innerExtract(e,t){let n=parseInt(t[TD]),s=parseInt(t[_D]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};gc.default=yc});var ms=O(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.AbstractTimeExpressionParser=void 0;var zt=mt();function bD(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function vD(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var eg=2,Ks=3,$o=4,Bo=5,ta=6,_c=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let s=t.index+t[1].length,a=t[0].substring(t[1].length),o=e.createParsingResult(s,a,n);t.index+=t[0].length;let l=e.text.substring(t.index),h=this.getFollowingTimePatternThroughCache().exec(l);return a.match(/^\d{3,4}/)&&h&&h[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!h||h[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(o):(o.end=this.extractFollowingTimeComponents(e,h,o),o.end&&(o.text+=h[0]),this.checkAndReturnWithFollowingPattern(o))}extractPrimaryTimeComponents(e,t,n=!1){let s=e.createParsingComponents(),a=0,o=null,l=parseInt(t[eg]);if(l>100){if(this.strictMode||t[Ks]!=null)return null;a=l%100,l=Math.floor(l/100)}if(l>24)return null;if(t[Ks]!=null){if(t[Ks].length==1&&!t[ta])return null;a=parseInt(t[Ks])}if(a>=60)return null;if(l>12&&(o=zt.Meridiem.PM),t[ta]!=null){if(l>12)return null;let c=t[ta][0].toLowerCase();c=="a"&&(o=zt.Meridiem.AM,l==12&&(l=0)),c=="p"&&(o=zt.Meridiem.PM,l!=12&&(l+=12))}if(s.assign("hour",l),s.assign("minute",a),o!==null?s.assign("meridiem",o):l<12?s.imply("meridiem",zt.Meridiem.AM):s.imply("meridiem",zt.Meridiem.PM),t[Bo]!=null){let c=parseInt(t[Bo].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[$o]!=null){let c=parseInt(t[$o]);if(c>=60)return null;s.assign("second",c)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[Bo]!=null){let c=parseInt(t[Bo].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[$o]!=null){let c=parseInt(t[$o]);if(c>=60)return null;s.assign("second",c)}let a=parseInt(t[eg]),o=0,l=-1;if(t[Ks]!=null?o=parseInt(t[Ks]):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=zt.Meridiem.PM),t[ta]!=null){if(a>12)return null;let c=t[ta][0].toLowerCase();c=="a"&&(l=zt.Meridiem.AM,a==12&&(a=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),c=="p"&&(l=zt.Meridiem.PM,a!=12&&(a+=12)),n.start.isCertain("meridiem")||(l==zt.Meridiem.AM?(n.start.imply("meridiem",zt.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",zt.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",a),s.assign("minute",o),l>=0?s.assign("meridiem",l):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>a?s.imply("meridiem",zt.Meridiem.AM):a<=12&&(s.assign("hour",a+12),s.assign("meridiem",zt.Meridiem.PM)):a>12?s.imply("meridiem",zt.Meridiem.PM):a<=12&&s.imply("meridiem",zt.Meridiem.AM),s.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let a=parseInt(s),o=parseInt(n);if(a>24||o>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=bD(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=vD(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};Go.AbstractTimeExpressionParser=_c});var tg=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var Ho=mt(),wD=ms(),Tc=class extends wD.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Ho.Meridiem.PM)):s<6&&n.assign("meridiem",Ho.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Ho.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Ho.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};bc.default=Tc});var Tr=O(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.addImpliedTimeUnits=Zs.reverseTimeUnits=void 0;function ED(r){let e={};for(let t in r)e[t]=-r[t];return e}Zs.reverseTimeUnits=ED;function kD(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}Zs.addImpliedTimeUnits=kD});var rg=O(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var wc=Nt(),DD=rt(),SD=Z(),OD=Tr(),MD=new RegExp(`(${wc.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),RD=new RegExp(`(${wc.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),vc=class extends SD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?RD:MD}innerExtract(e,t){let n=wc.parseTimeUnits(t[1]),s=OD.reverseTimeUnits(n);return DD.ParsingComponents.createRelativeFromReference(e.reference,s)}};Ec.default=vc});var ng=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var Dc=Nt(),xD=rt(),PD=Z(),AD=new RegExp(`(${Dc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),ND=new RegExp("("+Dc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),CD=1,kc=class extends PD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?ND:AD}innerExtract(e,t){let n=Dc.parseTimeUnits(t[CD]);return xD.ParsingComponents.createRelativeFromReference(e.reference,n)}};Sc.default=kc});var Qs=O(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.MergingRefiner=Xs.Filter=void 0;var Oc=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};Xs.Filter=Oc;var Mc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],a=null;for(let o=1;o{console.log(`${this.constructor.name} merged ${c} and ${h} into ${m}`)}),s=m}}return s!=null&&n.push(s),n}};Xs.MergingRefiner=Mc});var $r=O(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var ID=Qs(),Rc=class extends ID.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(a=>{t.start.isCertain(a)||t.start.assign(a,n.start.get(a))}),t.start.getCertainComponents().forEach(a=>{n.start.isCertain(a)||n.start.assign(a,t.start.get(a))})),t.start.date().getTime()>n.start.date().getTime()){let a=t.start.dayjs(),o=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&a.add(-7,"days").isBefore(o)?(a=a.add(-7,"days"),t.start.imply("day",a.date()),t.start.imply("month",a.month()+1),t.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(7,"days").isAfter(a)?(o=o.add(7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):[n,t]=[t,n]}let s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index{"use strict";var FD=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0});var LD=FD($r()),Pc=class extends LD.default{patternBetween(){return/^\s*(to|-)\s*$/i}};ra.default=Pc});var ig=O(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.mergeDateTimeComponent=Js.mergeDateTimeResult=void 0;var YD=mt();function UD(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=Ac(n,s),r.end!=null||e.end!=null){let a=r.end==null?r.start:r.end,o=e.end==null?e.start:e.end,l=Ac(a,o);r.end==null&&l.date().getTime(){"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});var WD=Qs(),ag=ig(),Nc=class extends WD.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let s=t.start.isOnlyDate()?ag.mergeDateTimeResult(t,n):ag.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};Cc.default=Nc});var og=O(na=>{"use strict";var qD=na&&na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(na,"__esModule",{value:!0});var jD=qD(un()),Ic=class extends jD.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};na.default=Ic});var ug=O(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var $D=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),BD={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},Fc=class{constructor(e){this.timezone=Object.assign(Object.assign({},BD),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(a=>{var o,l;let c=e.text.substring(a.index+a.text.length),h=$D.exec(c);if(!h)return;let m=h[1].toUpperCase(),_=(l=(o=s[m])!==null&&o!==void 0?o:this.timezone[m])!==null&&l!==void 0?l:null;if(_===null)return;e.debug(()=>{console.log(`Extracting timezone: '${m}' into: ${_} for: ${a.start}`)});let T=a.start.get("timezoneOffset");T!==null&&_!=T&&(a.start.isCertain("timezoneOffset")||m!=h[1])||a.start.isOnlyDate()&&m!=h[1]||(a.text+=h[0],a.start.isCertain("timezoneOffset")||a.start.assign("timezoneOffset",_),a.end!=null&&!a.end.isCertain("timezoneOffset")&&a.end.assign("timezoneOffset",_))}),t}};Lc.default=Fc});var zo=O(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var GD=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),HD=1,zD=2,VD=3,Yc=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),a=GD.exec(s);if(!a)return;e.debug(()=>{console.log(`Extracting timezone: '${a[0]}' into : ${n}`)});let o=parseInt(a[zD]),l=parseInt(a[VD]||"0"),c=o*60+l;c>14*60||(a[HD]==="-"&&(c=-c),n.end!=null&&n.end.assign("timezoneOffset",c),n.start.assign("timezoneOffset",c),n.text+=a[0])}),t}};Uc.default=Yc});var lg=O(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var Wc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let a=1;as.text.length&&(s=o):(n.push(s),s=o)}return s!=null&&n.push(s),n}};qc.default=Wc});var cg=O(sa=>{"use strict";var KD=sa&&sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sa,"__esModule",{value:!0});var ZD=KD(xe()),jc=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=ZD.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let a=0;a<3&&s.isAfter(n.start.dayjs());a++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};sa.default=jc});var dg=O(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var XD=Qs(),$c=class extends XD.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};Bc.default=$c});var zc=O(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var QD=Z(),JD=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),eS=1,tS=2,rS=3,fg=4,nS=5,hg=6,pg=7,mg=8,yg=9,Gc=class extends QD.AbstractParserWithWordBoundaryChecking{innerPattern(){return JD}innerExtract(e,t){let n={};if(n.year=parseInt(t[eS]),n.month=parseInt(t[tS]),n.day=parseInt(t[rS]),t[fg]!=null)if(n.hour=parseInt(t[fg]),n.minute=parseInt(t[nS]),t[hg]!=null&&(n.second=parseInt(t[hg])),t[pg]!=null&&(n.millisecond=parseInt(t[pg])),t[mg]==null)n.timezoneOffset=0;else{let s=parseInt(t[mg]),a=0;t[yg]!=null&&(a=parseInt(t[yg]));let o=s*60;o<0?o-=a:o+=a,n.timezoneOffset=o}return n}};Hc.default=Gc});var gg=O(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var sS=Qs(),Vc=class extends sS.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Kc.default=Vc});var ln=O(ei=>{"use strict";var ys=ei&&ei.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ei,"__esModule",{value:!0});ei.includeCommonConfiguration=void 0;var iS=ys(ug()),aS=ys(zo()),_g=ys(lg()),oS=ys(cg()),uS=ys(dg()),lS=ys(zc()),cS=ys(gg());function dS(r,e=!1){return r.parsers.unshift(new lS.default),r.refiners.unshift(new cS.default),r.refiners.unshift(new iS.default),r.refiners.unshift(new aS.default),r.refiners.unshift(new _g.default),r.refiners.push(new _g.default),r.refiners.push(new oS.default),r.refiners.push(new uS.default(e)),r}ei.includeCommonConfiguration=dS});var dn=O(Ce=>{"use strict";var fS=Ce&&Ce.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.noon=Ce.morning=Ce.midnight=Ce.yesterdayEvening=Ce.evening=Ce.lastNight=Ce.tonight=Ce.theDayAfter=Ce.tomorrow=Ce.theDayBefore=Ce.yesterday=Ce.today=Ce.now=void 0;var Br=rt(),ti=fS(xe()),cn=_r(),ia=mt();function hS(r){let e=ti.default(r.instant),t=new Br.ParsingComponents(r,{});return cn.assignSimilarDate(t,e),cn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Ce.now=hS;function pS(r){let e=ti.default(r.instant),t=new Br.ParsingComponents(r,{});return cn.assignSimilarDate(t,e),cn.implySimilarTime(t,e),t}Ce.today=pS;function mS(r){return Tg(r,1)}Ce.yesterday=mS;function Tg(r,e){return Zc(r,-e)}Ce.theDayBefore=Tg;function yS(r){return Zc(r,1)}Ce.tomorrow=yS;function Zc(r,e){let t=ti.default(r.instant),n=new Br.ParsingComponents(r,{});return t=t.add(e,"day"),cn.assignSimilarDate(n,t),cn.implySimilarTime(n,t),n}Ce.theDayAfter=Zc;function gS(r,e=22){let t=ti.default(r.instant),n=new Br.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",ia.Meridiem.PM),cn.assignSimilarDate(n,t),n}Ce.tonight=gS;function _S(r,e=0){let t=ti.default(r.instant),n=new Br.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),cn.assignSimilarDate(n,t),n.imply("hour",e),n}Ce.lastNight=_S;function TS(r,e=20){let t=new Br.ParsingComponents(r,{});return t.imply("meridiem",ia.Meridiem.PM),t.imply("hour",e),t}Ce.evening=TS;function bS(r,e=20){let t=ti.default(r.instant),n=new Br.ParsingComponents(r,{});return t=t.add(-1,"day"),cn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",ia.Meridiem.PM),n}Ce.yesterdayEvening=bS;function vS(r){let e=new Br.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Ce.midnight=vS;function wS(r,e=6){let t=new Br.ParsingComponents(r,{});return t.imply("meridiem",ia.Meridiem.AM),t.imply("hour",e),t}Ce.morning=wS;function ES(r){let e=new Br.ParsingComponents(r,{});return e.imply("meridiem",ia.Meridiem.AM),e.imply("hour",12),e}Ce.noon=ES});var bg=O(Rr=>{"use strict";var kS=Rr&&Rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),DS=Rr&&Rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SS=Rr&&Rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&kS(e,r,t);return DS(e,r),e},OS=Rr&&Rr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Rr,"__esModule",{value:!0});var MS=OS(xe()),RS=Z(),xS=_r(),aa=SS(dn()),PS=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Xc=class extends RS.AbstractParserWithWordBoundaryChecking{innerPattern(e){return PS}innerExtract(e,t){let n=MS.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"now":return aa.now(e.reference);case"today":return aa.today(e.reference);case"yesterday":return aa.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return aa.tomorrow(e.reference);case"tonight":return aa.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),xS.assignSimilarDate(a,n),a.imply("hour",0));break}return a}};Rr.default=Xc});var vg=O(oa=>{"use strict";var AS=oa&&oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oa,"__esModule",{value:!0});var Vo=mt(),NS=Z(),CS=AS(xe()),IS=_r(),FS=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Qc=class extends NS.AbstractParserWithWordBoundaryChecking{innerPattern(){return FS}innerExtract(e,t){let n=CS.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",Vo.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",Vo.Meridiem.PM),s.imply("hour",20);break;case"midnight":IS.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",Vo.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",Vo.Meridiem.AM),s.imply("hour",12);break}return s}};oa.default=Qc});var gs=O(Un=>{"use strict";var LS=Un&&Un.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Un,"__esModule",{value:!0});Un.toDayJSClosestWeekday=Un.toDayJSWeekday=void 0;var wg=LS(xe());function YS(r,e,t){if(!t)return Eg(r,e);let n=wg.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}Un.toDayJSWeekday=YS;function Eg(r,e){let t=wg.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var kg=Nt(),US=Fe(),WS=Z(),qS=gs(),jS=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${US.matchAnyPattern(kg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),$S=1,BS=2,GS=3,Jc=class extends WS.AbstractParserWithWordBoundaryChecking{innerPattern(){return jS}innerExtract(e,t){let n=t[BS].toLowerCase(),s=kg.WEEKDAY_DICTIONARY[n],a=t[$S],o=t[GS],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="last"||l=="past"?c="last":l=="next"?c="next":l=="this"&&(c="this");let h=qS.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};ed.default=Jc});var Mg=O(ua=>{"use strict";var HS=ua&&ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ua,"__esModule",{value:!0});var Og=Nt(),Sg=rt(),zS=HS(xe()),VS=Z(),KS=Fe(),ZS=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${KS.matchAnyPattern(Og.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),XS=1,QS=2,td=class extends VS.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZS}innerExtract(e,t){let n=t[XS].toLowerCase(),s=t[QS].toLowerCase(),a=Og.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let c={};return c[a]=1,Sg.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="last"||n=="past"){let c={};return c[a]=-1,Sg.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=zS.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};ua.default=td});var xr=O(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.ParsingContext=si.Chrono=void 0;var ri=rt(),JS=rd(),ni=class{constructor(e){e=e||JS.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new ni({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new Ko(e,t,n),a=[];return this.parsers.forEach(o=>{let l=ni.executeParser(s,o);a=a.concat(l)}),a.sort((o,l)=>o.index-l.index),this.refiners.forEach(function(o){a=o.refine(s,a)}),a}static executeParser(e,t){let n=[],s=t.pattern(e),a=e.text,o=e.text,l=s.exec(o);for(;l;){let c=l.index+a.length-o.length;l.index=c;let h=t.extract(e,l);if(!h){o=a.substring(l.index+1),l=s.exec(o);continue}let m=null;h instanceof ri.ParsingResult?m=h:h instanceof ri.ParsingComponents?(m=e.createParsingResult(l.index,l[0]),m.start=h):m=e.createParsingResult(l.index,l[0],h),e.debug(()=>console.log(`${t.constructor.name} extracted result ${m}`)),n.push(m),o=a.substring(c+m.text.length),l=s.exec(o)}return n}};si.Chrono=ni;var Ko=class{constructor(e,t,n){this.text=e,this.reference=new ri.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof ri.ParsingComponents?e:new ri.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let a=typeof t=="string"?t:this.text.substring(e,t),o=n?this.createParsingComponents(n):null,l=s?this.createParsingComponents(s):null;return new ri.ParsingResult(this.reference,e,a,o,l)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};si.ParsingContext=Ko});var _s=O(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var Rg=At(),eO=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Zo=1,xg=5,Pg=2,Ag=3,nd=4,sd=class{constructor(e){this.groupNumberMonth=e?Ag:Pg,this.groupNumberDay=e?Pg:Ag}pattern(){return eO}extract(e,t){if(t[Zo]=="/"||t[xg]=="/"){t.index+=t[0].length;return}let n=t.index+t[Zo].length,s=t[0].substr(t[Zo].length,t[0].length-t[Zo].length-t[xg].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[nd]&&t[0].indexOf("/")<0)return;let a=e.createParsingResult(n,s),o=parseInt(t[this.groupNumberMonth]),l=parseInt(t[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),t[nd]){let c=parseInt(t[nd]),h=Rg.findMostLikelyADYear(c);a.start.assign("year",h)}else{let c=Rg.findYearClosestToRef(e.refDate,l,o);a.start.imply("year",c)}return a}};id.default=sd});var Cg=O(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var Ng=Nt(),tO=rt(),rO=Z(),nO=Tr(),sO=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Ng.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),ad=class extends rO.AbstractParserWithWordBoundaryChecking{innerPattern(){return sO}innerExtract(e,t){let n=t[1].toLowerCase(),s=Ng.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=nO.reverseTimeUnits(s);break}return tO.ParsingComponents.createRelativeFromReference(e.reference,s)}};od.default=ad});var Fg=O(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var iO=Qs(),ud=rt(),aO=Nt(),oO=Tr();function Ig(r){return r.text.match(/\s+(before|from)$/i)!=null}function uO(r){return r.text.match(/\s+(after|since)$/i)!=null}var ld=class extends iO.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!Ig(t)&&!uO(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=aO.parseTimeUnits(t.text);Ig(t)&&(s=oO.reverseTimeUnits(s));let a=ud.ParsingComponents.createRelativeFromReference(new ud.ReferenceWithTimezone(n.start.date()),s);return new ud.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,a)}};cd.default=ld});var rd=O(lt=>{"use strict";var vt=lt&<.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lt,"__esModule",{value:!0});lt.createConfiguration=lt.createCasualConfiguration=lt.parseDate=lt.parse=lt.GB=lt.strict=lt.casual=void 0;var lO=vt(Iy()),cO=vt(qy()),dO=vt(Hy()),fO=vt(Ky()),hO=vt(Qy()),pO=vt(Jy()),mO=vt(tg()),yO=vt(rg()),gO=vt(ng()),_O=vt(sg()),TO=vt(og()),bO=ln(),vO=vt(bg()),wO=vt(vg()),EO=vt(Dg()),kO=vt(Mg()),dd=xr(),DO=vt(_s()),SO=vt(Cg()),OO=vt(Fg());lt.casual=new dd.Chrono(Lg(!1));lt.strict=new dd.Chrono(Xo(!0,!1));lt.GB=new dd.Chrono(Xo(!1,!0));function MO(r,e,t){return lt.casual.parse(r,e,t)}lt.parse=MO;function RO(r,e,t){return lt.casual.parseDate(r,e,t)}lt.parseDate=RO;function Lg(r=!1){let e=Xo(!1,r);return e.parsers.unshift(new vO.default),e.parsers.unshift(new wO.default),e.parsers.unshift(new fO.default),e.parsers.unshift(new kO.default),e.parsers.unshift(new SO.default),e}lt.createCasualConfiguration=Lg;function Xo(r=!0,e=!1){return bO.includeCommonConfiguration({parsers:[new DO.default(e),new lO.default,new cO.default,new dO.default,new EO.default,new hO.default,new pO.default,new mO.default(r),new yO.default(r),new gO.default(r)],refiners:[new OO.default,new TO.default,new _O.default]},r)}lt.createConfiguration=Xo});var Yg=O(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var xO=ms(),fd=class extends xO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};hd.default=fd});var la=O(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseTimeUnits=Ue.TIME_UNITS_PATTERN=Ue.parseYear=Ue.YEAR_PATTERN=Ue.parseNumberPattern=Ue.NUMBER_PATTERN=Ue.TIME_UNIT_DICTIONARY=Ue.INTEGER_WORD_DICTIONARY=Ue.MONTH_DICTIONARY=Ue.WEEKDAY_DICTIONARY=void 0;var pd=Fe(),PO=At();Ue.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};Ue.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};Ue.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};Ue.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};Ue.NUMBER_PATTERN=`(?:${pd.matchAnyPattern(Ue.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function Wg(r){let e=r.toLowerCase();return Ue.INTEGER_WORD_DICTIONARY[e]!==void 0?Ue.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}Ue.parseNumberPattern=Wg;Ue.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function AO(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return PO.findMostLikelyADYear(e)}Ue.parseYear=AO;var qg=`(${Ue.NUMBER_PATTERN})\\s{0,5}(${pd.matchAnyPattern(Ue.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ug=new RegExp(qg,"i");Ue.TIME_UNITS_PATTERN=pd.repeatedTimeunitPattern("",qg);function NO(r){let e={},t=r,n=Ug.exec(t);for(;n;)CO(e,n),t=t.substring(n[0].length),n=Ug.exec(t);return e}Ue.parseTimeUnits=NO;function CO(r,e){let t=Wg(e[1]),n=Ue.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var $g=O(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var jg=la(),IO=Fe(),FO=Z(),LO=gs(),YO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${IO.matchAnyPattern(jg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),UO=1,WO=3,qO=2,md=class extends FO.AbstractParserWithWordBoundaryChecking{innerPattern(){return YO}innerExtract(e,t){let n=t[qO].toLowerCase(),s=jg.WEEKDAY_DICTIONARY[n],a=t[UO],o=t[WO],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l.match(/letzte/)?c="last":l.match(/chste/)?c="next":l.match(/diese/)&&(c="this");let h=LO.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};yd.default=md});var zg=O(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var Wn=mt(),jO=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),$O=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),BO=2,Bg=3,Gg=4,Hg=5,ii=class{pattern(e){return jO}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ii.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=$O.exec(s);return a&&(n.end=ii.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[BO]),t[Bg]!=null&&(s=parseInt(t[Bg])),s>=60||n>24)return null;if(n>=12&&(a=Wn.Meridiem.PM),t[Hg]!=null){if(n>12)return null;let o=t[Hg].toLowerCase();o.match(/morgen|vormittag/)&&(a=Wn.Meridiem.AM,n==12&&(n=0)),o.match(/nachmittag|abend/)&&(a=Wn.Meridiem.PM,n!=12&&(n+=12)),o.match(/nacht/)&&(n==12?(a=Wn.Meridiem.AM,n=0):n<6?a=Wn.Meridiem.AM:(a=Wn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",Wn.Meridiem.AM):e.imply("meridiem",Wn.Meridiem.PM),t[Gg]!=null){let o=parseInt(t[Gg]);if(o>=60)return null;e.assign("second",o)}return e}};gd.default=ii});var Vg=O(ca=>{"use strict";var GO=ca&&ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ca,"__esModule",{value:!0});var HO=GO($r()),_d=class extends HO.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};ca.default=_d});var Kg=O(da=>{"use strict";var zO=da&&da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(da,"__esModule",{value:!0});var VO=zO(un()),Td=class extends VO.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};da.default=Td});var bd=O(ha=>{"use strict";var KO=ha&&ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ha,"__esModule",{value:!0});var ZO=KO(xe()),Ts=mt(),XO=Z(),QO=_r(),JO=Tr(),fa=class extends XO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=ZO.default(e.refDate),s=t[2].toLowerCase(),a=e.createParsingComponents();return QO.implySimilarTime(a,n),fa.extractTimeComponents(a,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=JO.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",Ts.Meridiem.AM);break}return e}};ha.default=fa});var Qg=O(Pr=>{"use strict";var eM=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tM=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),rM=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&eM(e,r,t);return tM(e,r),e},Xg=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var nM=Xg(xe()),sM=Z(),bs=_r(),iM=Xg(bd()),Zg=rM(dn()),aM=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),oM=1,uM=2,vd=class extends sM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return aM}innerExtract(e,t){let n=nM.default(e.refDate),s=(t[oM]||"").toLowerCase(),a=(t[uM]||"").toLowerCase(),o=e.createParsingComponents();switch(s){case"jetzt":o=Zg.now(e.reference);break;case"heute":o=Zg.today(e.reference);break;case"morgen":bs.assignTheNextDay(o,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),bs.assignTheNextDay(o,n);break;case"gestern":n=n.add(-1,"day"),bs.assignSimilarDate(o,n),bs.implySimilarTime(o,n);break;case"vorgestern":n=n.add(-2,"day"),bs.assignSimilarDate(o,n),bs.implySimilarTime(o,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),bs.assignSimilarDate(o,n),o.imply("hour",0));break}return a&&(o=iM.default.extractTimeComponents(o,a)),o}};Pr.default=vd});var s_=O(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var lM=At(),r_=la(),n_=la(),cM=Fe(),dM=Z(),fM=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${cM.matchAnyPattern(r_.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${n_.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Jg=1,e_=2,hM=3,t_=4,wd=class extends dM.AbstractParserWithWordBoundaryChecking{innerPattern(){return fM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=r_.MONTH_DICTIONARY[t[hM].toLowerCase()],a=parseInt(t[Jg]);if(a>31)return t.index=t.index+t[Jg].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[t_]){let o=n_.parseYear(t[t_]);n.start.assign("year",o)}else{let o=lM.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[e_]){let o=parseInt(t[e_]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Ed.default=wd});var i_=O(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Qo=la(),pM=rt(),mM=Z(),yM=Tr(),gM=Fe(),kd=class extends mM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${Qo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${gM.matchAnyPattern(Qo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?Qo.parseNumberPattern(t[2]):1,s=Qo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],a={};a[s]=n;let o=t[1]||t[3]||"";if(o=o.toLowerCase(),!!o)return(/vor/.test(o)||/letzte/.test(o)||/vergangen/.test(o))&&(a=yM.reverseTimeUnits(a)),pM.ParsingComponents.createRelativeFromReference(e.reference,a)}};Dd.default=kd});var u_=O(wt=>{"use strict";var Ar=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0});wt.createConfiguration=wt.createCasualConfiguration=wt.parseDate=wt.parse=wt.strict=wt.casual=void 0;var _M=ln(),a_=xr(),TM=Ar(_s()),bM=Ar(zc()),vM=Ar(Yg()),wM=Ar($g()),EM=Ar(zg()),kM=Ar(Vg()),DM=Ar(Kg()),SM=Ar(Qg()),OM=Ar(bd()),MM=Ar(s_()),RM=Ar(i_());wt.casual=new a_.Chrono(o_());wt.strict=new a_.Chrono(Sd(!0));function xM(r,e,t){return wt.casual.parse(r,e,t)}wt.parse=xM;function PM(r,e,t){return wt.casual.parseDate(r,e,t)}wt.parseDate=PM;function o_(r=!0){let e=Sd(!1,r);return e.parsers.unshift(new OM.default),e.parsers.unshift(new SM.default),e.parsers.unshift(new RM.default),e}wt.createCasualConfiguration=o_;function Sd(r=!0,e=!0){return _M.includeCommonConfiguration({parsers:[new bM.default,new TM.default(e),new vM.default,new EM.default,new MM.default,new wM.default],refiners:[new kM.default,new DM.default]},r)}wt.createConfiguration=Sd});var c_=O(Nr=>{"use strict";var AM=Nr&&Nr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NM=Nr&&Nr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CM=Nr&&Nr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AM(e,r,t);return NM(e,r),e},IM=Nr&&Nr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nr,"__esModule",{value:!0});var FM=IM(xe()),LM=mt(),YM=Z(),l_=_r(),Jo=CM(dn()),Od=class extends YM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=FM.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"maintenant":return Jo.now(e.reference);case"aujourd'hui":return Jo.today(e.reference);case"hier":return Jo.yesterday(e.reference);case"demain":return Jo.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?(l_.assignSimilarDate(a,n),a.imply("hour",22),a.imply("meridiem",LM.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),l_.assignSimilarDate(a,n),a.imply("hour",0))}return a}};Nr.default=Od});var d_=O(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var pa=mt(),UM=Z(),Md=class extends UM.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",pa.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",pa.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",pa.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",pa.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",pa.Meridiem.AM);break}return s}};Rd.default=Md});var f_=O(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var WM=ms(),xd=class extends WM.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Pd.default=xd});var h_=O(ma=>{"use strict";var qM=ma&&ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ma,"__esModule",{value:!0});var jM=qM(un()),Ad=class extends jM.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};ma.default=Ad});var p_=O(ya=>{"use strict";var $M=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var BM=$M($r()),Nd=class extends BM.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};ya.default=Nd});var qn=O(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.parseTimeUnits=Pe.TIME_UNITS_PATTERN=Pe.parseYear=Pe.YEAR_PATTERN=Pe.parseOrdinalNumberPattern=Pe.ORDINAL_NUMBER_PATTERN=Pe.parseNumberPattern=Pe.NUMBER_PATTERN=Pe.TIME_UNIT_DICTIONARY=Pe.INTEGER_WORD_DICTIONARY=Pe.MONTH_DICTIONARY=Pe.WEEKDAY_DICTIONARY=void 0;var Cd=Fe();Pe.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};Pe.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};Pe.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};Pe.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};Pe.NUMBER_PATTERN=`(?:${Cd.matchAnyPattern(Pe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function y_(r){let e=r.toLowerCase();return Pe.INTEGER_WORD_DICTIONARY[e]!==void 0?Pe.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}Pe.parseNumberPattern=y_;Pe.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function GM(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}Pe.parseOrdinalNumberPattern=GM;Pe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function HM(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}Pe.parseYear=HM;var g_=`(${Pe.NUMBER_PATTERN})\\s{0,5}(${Cd.matchAnyPattern(Pe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,m_=new RegExp(g_,"i");Pe.TIME_UNITS_PATTERN=Cd.repeatedTimeunitPattern("",g_);function zM(r){let e={},t=r,n=m_.exec(t);for(;n;)VM(e,n),t=t.substring(n[0].length),n=m_.exec(t);return e}Pe.parseTimeUnits=zM;function VM(r,e){let t=y_(e[1]),n=Pe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var T_=O(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var __=qn(),KM=Fe(),ZM=Z(),XM=gs(),QM=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${KM.matchAnyPattern(__.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),JM=1,eR=2,Id=class extends ZM.AbstractParserWithWordBoundaryChecking{innerPattern(){return QM}innerExtract(e,t){let n=t[JM].toLowerCase(),s=__.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[eR];a=a||"",a=a.toLowerCase();let o=null;a=="dernier"?o="last":a=="prochain"&&(o="next");let l=XM.toDayJSWeekday(e.refDate,s,o);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};Fd.default=Id});var E_=O(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var ga=mt(),tR=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),rR=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),nR=2,b_=3,v_=4,w_=5,ai=class{pattern(e){return tR}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=ai.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=rR.exec(s);return a&&(n.end=ai.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[nR]),t[b_]!=null&&(s=parseInt(t[b_])),s>=60||n>24)return null;if(n>=12&&(a=ga.Meridiem.PM),t[w_]!=null){if(n>12)return null;let o=t[w_][0].toLowerCase();o=="a"&&(a=ga.Meridiem.AM,n==12&&(n=0)),o=="p"&&(a=ga.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",ga.Meridiem.AM):e.imply("meridiem",ga.Meridiem.PM),t[v_]!=null){let o=parseInt(t[v_]);if(o>=60)return null;e.assign("second",o)}return e}};Ld.default=ai});var R_=O(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var sR=At(),O_=qn(),M_=qn(),eu=qn(),iR=Fe(),aR=Z(),oR=new RegExp(`(?:on\\s*?)?(${eu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${eu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${iR.matchAnyPattern(O_.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${M_.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),k_=1,D_=2,uR=3,S_=4,Yd=class extends aR.AbstractParserWithWordBoundaryChecking{innerPattern(){return oR}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=O_.MONTH_DICTIONARY[t[uR].toLowerCase()],a=eu.parseOrdinalNumberPattern(t[k_]);if(a>31)return t.index=t.index+t[k_].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[S_]){let o=M_.parseYear(t[S_]);n.start.assign("year",o)}else{let o=sR.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[D_]){let o=eu.parseOrdinalNumberPattern(t[D_]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Ud.default=Yd});var P_=O(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var x_=qn(),lR=rt(),cR=Z(),dR=Tr(),Wd=class extends cR.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${x_.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=x_.parseTimeUnits(t[1]),s=dR.reverseTimeUnits(n);return lR.ParsingComponents.createRelativeFromReference(e.reference,s)}};qd.default=Wd});var N_=O($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var A_=qn(),fR=rt(),hR=Z(),jd=class extends hR.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${A_.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=A_.parseTimeUnits(t[1]);return fR.ParsingComponents.createRelativeFromReference(e.reference,n)}};$d.default=jd});var C_=O(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var tu=qn(),pR=rt(),mR=Z(),yR=Tr(),gR=Fe(),Bd=class extends mR.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${tu.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${gR.matchAnyPattern(tu.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?tu.parseNumberPattern(t[1]):1,s=tu.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],a={};a[s]=n;let o=t[2]||t[4]||"";if(o=o.toLowerCase(),!!o)return(/derni[eè]re?s?/.test(o)||/pass[ée]e?s?/.test(o)||/pr[ée]c[ée]dents?/.test(o))&&(a=yR.reverseTimeUnits(a)),pR.ParsingComponents.createRelativeFromReference(e.reference,a)}};Gd.default=Bd});var L_=O(Et=>{"use strict";var br=Et&&Et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Et,"__esModule",{value:!0});Et.createConfiguration=Et.createCasualConfiguration=Et.parseDate=Et.parse=Et.strict=Et.casual=void 0;var _R=ln(),I_=xr(),TR=br(c_()),bR=br(d_()),vR=br(_s()),wR=br(f_()),ER=br(h_()),kR=br(p_()),DR=br(T_()),SR=br(E_()),OR=br(R_()),MR=br(P_()),RR=br(N_()),xR=br(C_());Et.casual=new I_.Chrono(F_());Et.strict=new I_.Chrono(Hd(!0));function PR(r,e,t){return Et.casual.parse(r,e,t)}Et.parse=PR;function AR(r,e,t){return Et.casual.parseDate(r,e,t)}Et.parseDate=AR;function F_(r=!0){let e=Hd(!1,r);return e.parsers.unshift(new TR.default),e.parsers.unshift(new bR.default),e.parsers.unshift(new xR.default),e}Et.createCasualConfiguration=F_;function Hd(r=!0,e=!0){return _R.includeCommonConfiguration({parsers:[new vR.default(e),new OR.default,new wR.default,new SR.default,new MR.default,new RR.default,new DR.default],refiners:[new ER.default,new kR.default]},r)}Et.createConfiguration=Hd});var Y_=O(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.toHankaku=void 0;function NR(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,CR)}ru.toHankaku=NR;function CR(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var W_=O(_a=>{"use strict";var IR=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var zd=Y_(),FR=At(),LR=IR(xe()),YR=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,U_=1,UR=2,Vd=3,WR=4,qR=5,jR=6,Kd=class{pattern(){return YR}extract(e,t){let n=parseInt(zd.toHankaku(t[qR])),s=parseInt(zd.toHankaku(t[jR])),a=e.createParsingComponents({day:s,month:n});if(t[U_]&&t[U_].match("\u540C|\u4ECA|\u672C")){let o=LR.default(e.refDate);a.assign("year",o.year())}if(t[UR]){let o=t[WR],l=o=="\u5143"?1:parseInt(zd.toHankaku(o));t[Vd]=="\u4EE4\u548C"?l+=2018:t[Vd]=="\u5E73\u6210"?l+=1988:t[Vd]=="\u662D\u548C"&&(l+=1925),a.assign("year",l)}else{let o=FR.findYearClosestToRef(e.refDate,s,n);a.imply("year",o)}return a}};_a.default=Kd});var q_=O(Ta=>{"use strict";var $R=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var BR=$R($r()),Zd=class extends BR.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};Ta.default=Zd});var $_=O(Cr=>{"use strict";var GR=Cr&&Cr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),HR=Cr&&Cr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zR=Cr&&Cr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&GR(e,r,t);return HR(e,r),e},VR=Cr&&Cr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});var KR=VR(xe()),j_=mt(),Xd=zR(dn()),ZR=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Qd=class{pattern(){return ZR}extract(e,t){let n=t[0],s=KR.default(e.refDate),a=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Xd.yesterday(e.reference);case"\u660E\u65E5":return Xd.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Xd.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(a.imply("hour",22),a.assign("meridiem",j_.Meridiem.PM)):n.match("\u4ECA\u671D")&&(a.imply("hour",6),a.assign("meridiem",j_.Meridiem.AM)),a.assign("day",s.date()),a.assign("month",s.month()+1),a.assign("year",s.year()),a}};Cr.default=Qd});var H_=O(kt=>{"use strict";var Jd=kt&&kt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kt,"__esModule",{value:!0});kt.createConfiguration=kt.createCasualConfiguration=kt.parseDate=kt.parse=kt.strict=kt.casual=void 0;var XR=Jd(W_()),QR=Jd(q_()),JR=Jd($_()),B_=xr();kt.casual=new B_.Chrono(G_());kt.strict=new B_.Chrono(ef());function ex(r,e,t){return kt.casual.parse(r,e,t)}kt.parse=ex;function tx(r,e,t){return kt.casual.parseDate(r,e,t)}kt.parseDate=tx;function G_(){let r=ef();return r.parsers.unshift(new JR.default),r}kt.createCasualConfiguration=G_;function ef(){return{parsers:[new XR.default],refiners:[new QR.default]}}kt.createConfiguration=ef});var nu=O(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.parseYear=Gr.YEAR_PATTERN=Gr.MONTH_DICTIONARY=Gr.WEEKDAY_DICTIONARY=void 0;Gr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};Gr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};Gr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function rx(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}Gr.parseYear=rx});var V_=O(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var z_=nu(),nx=Fe(),sx=Z(),ix=gs(),ax=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${nx.matchAnyPattern(z_.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),ox=1,ux=2,lx=3,tf=class extends sx.AbstractParserWithWordBoundaryChecking{innerPattern(){return ax}innerExtract(e,t){let n=t[ux].toLowerCase(),s=z_.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[ox],o=t[lx],l=a||o||"";l=l.toLowerCase();let c=null;l=="passado"?c="this":l=="pr\xF3ximo"||l=="proximo"?c="next":l=="este"&&(c="this");let h=ix.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};rf.default=tf});var K_=O(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});var cx=ms(),nf=class extends cx.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};sf.default=nf});var Z_=O(ba=>{"use strict";var dx=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var fx=dx(un()),af=class extends fx.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};ba.default=af});var X_=O(va=>{"use strict";var hx=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var px=hx($r()),of=class extends px.default{patternBetween(){return/^\s*(?:-)\s*$/i}};va.default=of});var nT=O(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var mx=At(),tT=nu(),rT=nu(),yx=Fe(),gx=Z(),_x=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${yx.matchAnyPattern(tT.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${rT.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Q_=1,J_=2,Tx=3,eT=4,uf=class extends gx.AbstractParserWithWordBoundaryChecking{innerPattern(){return _x}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=tT.MONTH_DICTIONARY[t[Tx].toLowerCase()],a=parseInt(t[Q_]);if(a>31)return t.index=t.index+t[Q_].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[eT]){let o=rT.parseYear(t[eT]);n.start.assign("year",o)}else{let o=mx.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[J_]){let o=parseInt(t[J_]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};lf.default=uf});var sT=O(fn=>{"use strict";var bx=fn&&fn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),vx=fn&&fn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),wx=fn&&fn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&bx(e,r,t);return vx(e,r),e};Object.defineProperty(fn,"__esModule",{value:!0});var Ex=Z(),su=wx(dn()),cf=class extends Ex.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return su.now(e.reference);case"hoje":return su.today(e.reference);case"amanha":case"amanh\xE3":return su.tomorrow(e.reference);case"ontem":return su.yesterday(e.reference)}return s}};fn.default=cf});var iT=O(wa=>{"use strict";var kx=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var iu=mt(),Dx=Z(),Sx=_r(),Ox=kx(xe()),df=class extends Dx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=Ox.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",iu.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",iu.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",iu.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":Sx.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",iu.Meridiem.AM),s.imply("hour",12);break}return s}};wa.default=df});var uT=O(Dt=>{"use strict";var jn=Dt&&Dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.createConfiguration=Dt.createCasualConfiguration=Dt.parseDate=Dt.parse=Dt.strict=Dt.casual=void 0;var Mx=ln(),aT=xr(),Rx=jn(_s()),xx=jn(V_()),Px=jn(K_()),Ax=jn(Z_()),Nx=jn(X_()),Cx=jn(nT()),Ix=jn(sT()),Fx=jn(iT());Dt.casual=new aT.Chrono(oT());Dt.strict=new aT.Chrono(ff(!0));function Lx(r,e,t){return Dt.casual.parse(r,e,t)}Dt.parse=Lx;function Yx(r,e,t){return Dt.casual.parseDate(r,e,t)}Dt.parseDate=Yx;function oT(r=!0){let e=ff(!1,r);return e.parsers.push(new Ix.default),e.parsers.push(new Fx.default),e}Dt.createCasualConfiguration=oT;function ff(r=!0,e=!0){return Mx.includeCommonConfiguration({parsers:[new Rx.default(e),new xx.default,new Px.default,new Cx.default],refiners:[new Ax.default,new Nx.default]},r)}Dt.createConfiguration=ff});var lT=O(Ea=>{"use strict";var Ux=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var Wx=Ux($r()),hf=class extends Wx.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};Ea.default=hf});var cT=O(ka=>{"use strict";var qx=ka&&ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ka,"__esModule",{value:!0});var jx=qx(un()),pf=class extends jx.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};ka.default=pf});var dT=O(hn=>{"use strict";var $x=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Bx=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Gx=hn&&hn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$x(e,r,t);return Bx(e,r),e};Object.defineProperty(hn,"__esModule",{value:!0});var Hx=Z(),au=Gx(dn()),mf=class extends Hx.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return au.now(e.reference);case"vandaag":return au.today(e.reference);case"morgen":case"morgend":return au.tomorrow(e.reference);case"gisteren":return au.yesterday(e.reference)}return s}};hn.default=mf});var fT=O(Da=>{"use strict";var zx=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var ou=mt(),Vx=Z(),Kx=zx(xe()),Zx=_r(),Xx=1,Qx=2,yf=class extends Vx.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=Kx.default(e.refDate),s=e.createParsingComponents();switch(t[Xx]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[Qx].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",ou.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",ou.Meridiem.PM),s.imply("hour",20);break;case"middernacht":Zx.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",ou.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",ou.Meridiem.AM),s.imply("hour",12);break}return s}};Da.default=yf});var ir=O(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.parseTimeUnits=we.TIME_UNITS_PATTERN=we.parseYear=we.YEAR_PATTERN=we.parseOrdinalNumberPattern=we.ORDINAL_NUMBER_PATTERN=we.parseNumberPattern=we.NUMBER_PATTERN=we.TIME_UNIT_DICTIONARY=we.ORDINAL_WORD_DICTIONARY=we.INTEGER_WORD_DICTIONARY=we.MONTH_DICTIONARY=we.WEEKDAY_DICTIONARY=void 0;var uu=Fe(),Jx=At();we.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};we.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};we.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};we.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};we.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};we.NUMBER_PATTERN=`(?:${uu.matchAnyPattern(we.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function pT(r){let e=r.toLowerCase();return we.INTEGER_WORD_DICTIONARY[e]!==void 0?we.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}we.parseNumberPattern=pT;we.ORDINAL_NUMBER_PATTERN=`(?:${uu.matchAnyPattern(we.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function eP(r){let e=r.toLowerCase();return we.ORDINAL_WORD_DICTIONARY[e]!==void 0?we.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}we.parseOrdinalNumberPattern=eP;we.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function tP(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return Jx.findMostLikelyADYear(e)}we.parseYear=tP;var mT=`(${we.NUMBER_PATTERN})\\s{0,5}(${uu.matchAnyPattern(we.TIME_UNIT_DICTIONARY)})\\s{0,5}`,hT=new RegExp(mT,"i");we.TIME_UNITS_PATTERN=uu.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",mT);function rP(r){let e={},t=r,n=hT.exec(t);for(;n;)nP(e,n),t=t.substring(n[0].length),n=hT.exec(t);return e}we.parseTimeUnits=rP;function nP(r,e){let t=pT(e[1]),n=we.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var gT=O(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var yT=ir(),sP=rt(),iP=Z(),gf=class extends iP.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+yT.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=yT.parseTimeUnits(t[1]);return sP.ParsingComponents.createRelativeFromReference(e.reference,n)}};_f.default=gf});var TT=O(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var _T=ir(),aP=Fe(),oP=Z(),uP=gs(),lP=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${aP.matchAnyPattern(_T.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),cP=1,dP=2,fP=3,Tf=class extends oP.AbstractParserWithWordBoundaryChecking{innerPattern(){return lP}innerExtract(e,t){let n=t[dP].toLowerCase(),s=_T.WEEKDAY_DICTIONARY[n],a=t[cP],o=t[fP],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="vorige"?c="last":l=="volgende"?c="next":l=="deze"&&(c="this");let h=uP.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};bf.default=Tf});var DT=O(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var hP=At(),ET=ir(),lu=ir(),kT=ir(),pP=Fe(),mP=Z(),yP=new RegExp(`(?:on\\s*?)?(${lu.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${lu.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+pP.matchAnyPattern(ET.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${kT.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),gP=3,bT=1,vT=2,wT=4,vf=class extends mP.AbstractParserWithWordBoundaryChecking{innerPattern(){return yP}innerExtract(e,t){let n=ET.MONTH_DICTIONARY[t[gP].toLowerCase()],s=lu.parseOrdinalNumberPattern(t[bT]);if(s>31)return t.index=t.index+t[bT].length,null;let a=e.createParsingComponents({day:s,month:n});if(t[wT]){let c=kT.parseYear(t[wT]);a.assign("year",c)}else{let c=hP.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[vT])return a;let o=lu.parseOrdinalNumberPattern(t[vT]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};wf.default=vf});var RT=O(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var OT=ir(),_P=At(),TP=Fe(),MT=ir(),bP=Z(),vP=new RegExp(`(${TP.matchAnyPattern(OT.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${MT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),wP=1,ST=2,Ef=class extends bP.AbstractParserWithWordBoundaryChecking{innerPattern(){return vP}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[wP],a=OT.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",a),t[ST]){let o=MT.parseYear(t[ST]);n.assign("year",o)}else{let o=_P.findYearClosestToRef(e.refDate,1,a);n.imply("year",o)}return n}};kf.default=Ef});var xT=O(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var EP=Z(),kP=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),DP=1,SP=2,Df=class extends EP.AbstractParserWithWordBoundaryChecking{innerPattern(){return kP}innerExtract(e,t){let n=parseInt(t[SP]),s=parseInt(t[DP]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Sf.default=Df});var PT=O(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var OP=ms(),Of=class extends OP.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Mf.default=Of});var CT=O(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var NT=ir(),MP=Fe(),RP=Z(),xP=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${MP.matchAnyPattern(NT.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),PP=1,AP=2,AT=3,NP=4,Rf=class extends RP.AbstractParserWithWordBoundaryChecking{innerPattern(){return xP}innerExtract(e,t){let n=t[AT]?parseInt(t[AT]):NT.MONTH_DICTIONARY[t[AP].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[PP]);return{day:parseInt(t[NP]),month:n,year:s}}};xf.default=Rf});var IT=O(Sa=>{"use strict";var CP=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var IP=Z(),cu=mt(),Pf=_r(),FP=CP(xe()),LP=1,YP=2,Af=class extends IP.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[LP].toLowerCase(),s=t[YP].toLowerCase(),a=e.createParsingComponents(),o=FP.default(e.refDate);switch(n){case"gisteren":Pf.assignSimilarDate(a,o.add(-1,"day"));break;case"van":Pf.assignSimilarDate(a,o);break;case"morgen":Pf.assignTheNextDay(a,o);break}switch(s){case"ochtend":a.imply("meridiem",cu.Meridiem.AM),a.imply("hour",6);break;case"middag":a.imply("meridiem",cu.Meridiem.AM),a.imply("hour",12);break;case"namiddag":a.imply("meridiem",cu.Meridiem.PM),a.imply("hour",15);break;case"avond":a.imply("meridiem",cu.Meridiem.PM),a.imply("hour",20);break}return a}};Sa.default=Af});var LT=O(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var FT=ir(),UP=rt(),WP=Z(),qP=Tr(),jP=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${FT.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Nf=class extends WP.AbstractParserWithWordBoundaryChecking{innerPattern(){return jP}innerExtract(e,t){let n=t[1].toLowerCase(),s=FT.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=qP.reverseTimeUnits(s);break}return UP.ParsingComponents.createRelativeFromReference(e.reference,s)}};Cf.default=Nf});var WT=O(Oa=>{"use strict";var $P=Oa&&Oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oa,"__esModule",{value:!0});var UT=ir(),YT=rt(),BP=$P(xe()),GP=Z(),HP=Fe(),zP=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${HP.matchAnyPattern(UT.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),VP=1,KP=2,If=class extends GP.AbstractParserWithWordBoundaryChecking{innerPattern(){return zP}innerExtract(e,t){let n=t[VP].toLowerCase(),s=t[KP].toLowerCase(),a=UT.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let c={};return c[a]=1,YT.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="afgelopen"||n=="vorige"){let c={};return c[a]=-1,YT.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=BP.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/maand/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/jaar/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Oa.default=If});var qT=O(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var Lf=ir(),ZP=rt(),XP=Z(),QP=Tr(),JP=new RegExp("("+Lf.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),eA=new RegExp("("+Lf.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),Ff=class extends XP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?eA:JP}innerExtract(e,t){let n=Lf.parseTimeUnits(t[1]),s=QP.reverseTimeUnits(n);return ZP.ParsingComponents.createRelativeFromReference(e.reference,s)}};Yf.default=Ff});var jT=O(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});var Wf=ir(),tA=rt(),rA=Z(),nA=new RegExp("("+Wf.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),sA=new RegExp("("+Wf.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),iA=1,Uf=class extends rA.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?sA:nA}innerExtract(e,t){let n=Wf.parseTimeUnits(t[iA]);return tA.ParsingComponents.createRelativeFromReference(e.reference,n)}};qf.default=Uf});var HT=O(St=>{"use strict";var Ct=St&&St.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(St,"__esModule",{value:!0});St.createConfiguration=St.createCasualConfiguration=St.parseDate=St.parse=St.strict=St.casual=void 0;var aA=ln(),$T=xr(),oA=Ct(lT()),uA=Ct(cT()),lA=Ct(dT()),cA=Ct(fT()),dA=Ct(_s()),fA=Ct(gT()),hA=Ct(TT()),pA=Ct(DT()),BT=Ct(RT()),mA=Ct(xT()),yA=Ct(PT()),gA=Ct(CT()),_A=Ct(IT()),TA=Ct(LT()),bA=Ct(WT()),vA=Ct(qT()),wA=Ct(jT());St.casual=new $T.Chrono(GT());St.strict=new $T.Chrono(jf(!0));function EA(r,e,t){return St.casual.parse(r,e,t)}St.parse=EA;function kA(r,e,t){return St.casual.parseDate(r,e,t)}St.parseDate=kA;function GT(r=!0){let e=jf(!1,r);return e.parsers.unshift(new lA.default),e.parsers.unshift(new cA.default),e.parsers.unshift(new _A.default),e.parsers.unshift(new BT.default),e.parsers.unshift(new bA.default),e.parsers.unshift(new TA.default),e}St.createCasualConfiguration=GT;function jf(r=!0,e=!0){return aA.includeCommonConfiguration({parsers:[new dA.default(e),new fA.default,new pA.default,new BT.default,new hA.default,new gA.default,new mA.default,new yA.default(r),new vA.default(r),new wA.default(r)],refiners:[new uA.default,new oA.default]},r)}St.createConfiguration=jf});var ZT=O(Ma=>{"use strict";var DA=Ma&&Ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ma,"__esModule",{value:!0});var SA=DA(xe()),OA=Z(),MA=1,zT=2,RA=3,VT=4,KT=5,xA=6,$f=class extends OA.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=SA.default(e.refDate),o=a;if(t[MA])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[zT]){let l=t[zT],c=t[RA];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day")),c=="\u65E9"||c=="\u671D"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[VT]){let c=t[VT][0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[KT]){let l=t[KT];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day"));let c=t[xA];if(c){let h=c[0];h=="\u65E9"||h=="\u671D"||h=="\u4E0A"?s.start.imply("hour",6):h=="\u4E0B"||h=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):h=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):h=="\u591C"||h=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):h=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};Ma.default=$f});var oi=O(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.zhStringToYear=Xt.zhStringToNumber=Xt.WEEKDAY_OFFSET=Xt.NUMBER=void 0;Xt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};Xt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function PA(r){let e=0;for(let t=0;t{"use strict";var NA=Ra&&Ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ra,"__esModule",{value:!0});var CA=NA(xe()),IA=Z(),vs=oi(),Bf=1,XT=2,Gf=3,Hf=class extends IA.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(vs.NUMBER).join("")+"]{4}|["+Object.keys(vs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(vs.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(vs.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=CA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[XT]);if(isNaN(a)&&(a=vs.zhStringToNumber(t[XT])),s.start.assign("month",a),t[Gf]){let o=parseInt(t[Gf]);isNaN(o)&&(o=vs.zhStringToNumber(t[Gf])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[Bf]){let o=parseInt(t[Bf]);isNaN(o)&&(o=vs.zhStringToYear(t[Bf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};Ra.default=Hf});var eb=O(xa=>{"use strict";var FA=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var LA=FA(xe()),YA=Z(),JT=oi(),UA=new RegExp("(\\d+|["+Object.keys(JT.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),zf=1,WA=2,Vf=class extends YA.AbstractParserWithWordBoundaryChecking{innerPattern(){return UA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[zf]);if(isNaN(s)&&(s=JT.zhStringToNumber(t[zf])),isNaN(s)){let c=t[zf];if(c==="\u5E7E")s=3;else if(c==="\u534A")s=.5;else return null}let a=LA.default(e.refDate),l=t[WA][0];return l.match(/[日天星禮月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u79AE"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u9418")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};xa.default=Vf});var rb=O(Pa=>{"use strict";var qA=Pa&&Pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pa,"__esModule",{value:!0});var jA=qA(xe()),$A=Z(),tb=oi(),BA=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(tb.WEEKDAY_OFFSET).join("|")+")"),Kf=class extends $A.AbstractParserWithWordBoundaryChecking{innerPattern(){return BA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=tb.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":(l=="\u4ECA"||l=="\u9019"||l=="\u5462")&&(o="this");let c=jA.default(e.refDate),h=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),h=!0):o=="next"?(c=c.day(a+7),h=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var GA=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var HA=GA(xe()),zA=Z(),wr=oi(),VA=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),KA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(wr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),du=1,fu=2,hu=3,pu=4,mu=5,yu=6,vr=7,ui=8,gu=9,Zf=class extends zA.AbstractParserWithWordBoundaryChecking{innerPattern(){return VA}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=HA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[du]){var o=t[du];o=="\u660E"||o=="\u807D"?n.hour()>1&&a.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a.add(-1,"day"):o=="\u524D"?a.add(-2,"day"):o=="\u5927\u524D"?a.add(-3,"day"):o=="\u5F8C"?a.add(2,"day"):o=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[pu]){var l=t[pu];l=="\u660E"||l=="\u807D"?a.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?a.add(-1,"day"):l=="\u524D"?a.add(-2,"day"):l=="\u5927\u524D"?a.add(-3,"day"):l=="\u5F8C"?a.add(2,"day"):l=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let c=0,h=0,m=-1;if(t[ui]){var _=parseInt(t[ui]);if(isNaN(_)&&(_=wr.zhStringToNumber(t[ui])),_>=60)return null;s.start.assign("second",_)}if(c=parseInt(t[yu]),isNaN(c)&&(c=wr.zhStringToNumber(t[yu])),t[vr]?t[vr]=="\u534A"?h=30:t[vr]=="\u6B63"||t[vr]=="\u6574"?h=0:(h=parseInt(t[vr]),isNaN(h)&&(h=wr.zhStringToNumber(t[vr]))):c>100&&(h=c%100,c=Math.floor(c/100)),h>=60||c>24)return null;if(c>=12&&(m=1),t[gu]){if(c>12)return null;var T=t[gu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12))}else if(t[fu]){var D=t[fu],v=D[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[hu]){var R=t[hu],I=R[0];I=="\u4E0A"||I=="\u671D"||I=="\u65E9"||I=="\u51CC"?(m=0,c==12&&(c=0)):(I=="\u4E0B"||I=="\u664F"||I=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[mu]){var q=t[mu],$=q[0];$=="\u4E0A"||$=="\u671D"||$=="\u65E9"||$=="\u51CC"?(m=0,c==12&&(c=0)):($=="\u4E0B"||$=="\u664F"||$=="\u665A")&&(m=1,c!=12&&(c+=12))}if(s.start.assign("hour",c),s.start.assign("minute",h),m>=0?s.start.assign("meridiem",m):c<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=KA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let B=a.clone();if(s.end=e.createParsingComponents(),t[du]){var o=t[du];o=="\u660E"||o=="\u807D"?n.hour()>1&&B.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?B.add(-1,"day"):o=="\u524D"?B.add(-2,"day"):o=="\u5927\u524D"?B.add(-3,"day"):o=="\u5F8C"?B.add(2,"day"):o=="\u5927\u5F8C"&&B.add(3,"day"),s.end.assign("day",B.date()),s.end.assign("month",B.month()+1),s.end.assign("year",B.year())}else if(t[pu]){var l=t[pu];l=="\u660E"||l=="\u807D"?B.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?B.add(-1,"day"):l=="\u524D"?B.add(-2,"day"):l=="\u5927\u524D"?B.add(-3,"day"):l=="\u5F8C"?B.add(2,"day"):l=="\u5927\u5F8C"&&B.add(3,"day"),s.end.assign("day",B.date()),s.end.assign("month",B.month()+1),s.end.assign("year",B.year())}else s.end.imply("day",B.date()),s.end.imply("month",B.month()+1),s.end.imply("year",B.year());if(c=0,h=0,m=-1,t[ui]){var _=parseInt(t[ui]);if(isNaN(_)&&(_=wr.zhStringToNumber(t[ui])),_>=60)return null;s.end.assign("second",_)}if(c=parseInt(t[yu]),isNaN(c)&&(c=wr.zhStringToNumber(t[yu])),t[vr]?t[vr]=="\u534A"?h=30:t[vr]=="\u6B63"||t[vr]=="\u6574"?h=0:(h=parseInt(t[vr]),isNaN(h)&&(h=wr.zhStringToNumber(t[vr]))):c>100&&(h=c%100,c=Math.floor(c/100)),h>=60||c>24)return null;if(c>=12&&(m=1),t[gu]){if(c>12)return null;var T=t[gu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12)),s.start.isCertain("meridiem")||(m==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[fu]){var D=t[fu],v=D[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[hu]){var R=t[hu],I=R[0];I=="\u4E0A"||I=="\u671D"||I=="\u65E9"||I=="\u51CC"?(m=0,c==12&&(c=0)):(I=="\u4E0B"||I=="\u664F"||I=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[mu]){var q=t[mu],$=q[0];$=="\u4E0A"||$=="\u671D"||$=="\u65E9"||$=="\u51CC"?(m=0,c==12&&(c=0)):($=="\u4E0B"||$=="\u664F"||$=="\u665A")&&(m=1,c!=12&&(c+=12))}return s.text=s.text+t[0],s.end.assign("hour",c),s.end.assign("minute",h),m>=0?s.end.assign("meridiem",m):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>c?s.end.imply("meridiem",0):c>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var ZA=Na&&Na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Na,"__esModule",{value:!0});var XA=ZA(xe()),QA=Z(),sb=oi(),JA=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(sb.WEEKDAY_OFFSET).join("|")+")"),Xf=class extends QA.AbstractParserWithWordBoundaryChecking{innerPattern(){return JA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=sb.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=XA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var eN=Ca&&Ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ca,"__esModule",{value:!0});var tN=eN($r()),Qf=class extends tN.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};Ca.default=Qf});var ob=O(Ia=>{"use strict";var rN=Ia&&Ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ia,"__esModule",{value:!0});var nN=rN(un()),Jf=class extends nN.default{patternBetween(){return/^\s*$/i}};Ia.default=Jf});var ub=O(ct=>{"use strict";var pn=ct&&ct.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ct,"__esModule",{value:!0});ct.createConfiguration=ct.createCasualConfiguration=ct.parseDate=ct.parse=ct.strict=ct.casual=ct.hant=void 0;var eh=xr(),sN=pn(zo()),iN=ln(),aN=pn(ZT()),oN=pn(QT()),uN=pn(eb()),lN=pn(rb()),cN=pn(nb()),dN=pn(ib()),fN=pn(ab()),hN=pn(ob());ct.hant=new eh.Chrono(th());ct.casual=new eh.Chrono(th());ct.strict=new eh.Chrono(rh());function pN(r,e,t){return ct.casual.parse(r,e,t)}ct.parse=pN;function mN(r,e,t){return ct.casual.parseDate(r,e,t)}ct.parseDate=mN;function th(){let r=rh();return r.parsers.unshift(new aN.default),r}ct.createCasualConfiguration=th;function rh(){let r=iN.includeCommonConfiguration({parsers:[new oN.default,new lN.default,new dN.default,new cN.default,new uN.default],refiners:[new fN.default,new hN.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof sN.default)),r}ct.createConfiguration=rh});var fb=O(Fa=>{"use strict";var yN=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var gN=yN(xe()),_N=Z(),TN=1,lb=2,bN=3,cb=4,db=5,vN=6,nh=class extends _N.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=gN.default(e.refDate),o=a;if(t[TN])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[lb]){let l=t[lb],c=t[bN];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day")),c=="\u65E9"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[cb]){let c=t[cb][0];c=="\u65E9"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[db]){let l=t[db];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day"));let c=t[vN];if(c){let h=c[0];h=="\u65E9"||h=="\u4E0A"?s.start.imply("hour",6):h=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):h=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):h=="\u591C"||h=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):h=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};Fa.default=nh});var li=O(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.zhStringToYear=Qt.zhStringToNumber=Qt.WEEKDAY_OFFSET=Qt.NUMBER=void 0;Qt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Qt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function wN(r){let e=0;for(let t=0;t{"use strict";var kN=La&&La.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(La,"__esModule",{value:!0});var DN=kN(xe()),SN=Z(),ws=li(),sh=1,hb=2,ih=3,ah=class extends SN.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(ws.NUMBER).join("")+"]{4}|["+Object.keys(ws.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(ws.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(ws.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=DN.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[hb]);if(isNaN(a)&&(a=ws.zhStringToNumber(t[hb])),s.start.assign("month",a),t[ih]){let o=parseInt(t[ih]);isNaN(o)&&(o=ws.zhStringToNumber(t[ih])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[sh]){let o=parseInt(t[sh]);isNaN(o)&&(o=ws.zhStringToYear(t[sh])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};La.default=ah});var yb=O(Ya=>{"use strict";var ON=Ya&&Ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ya,"__esModule",{value:!0});var MN=ON(xe()),RN=Z(),mb=li(),xN=new RegExp("(\\d+|["+Object.keys(mb.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),oh=1,PN=2,uh=class extends RN.AbstractParserWithWordBoundaryChecking{innerPattern(){return xN}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[oh]);if(isNaN(s)&&(s=mb.zhStringToNumber(t[oh])),isNaN(s)){let c=t[oh];if(c==="\u51E0")s=3;else if(c==="\u534A")s=.5;else return null}let a=MN.default(e.refDate),l=t[PN][0];return l.match(/[日天星礼月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u793C"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u949F")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};Ya.default=uh});var _b=O(Ua=>{"use strict";var AN=Ua&&Ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ua,"__esModule",{value:!0});var NN=AN(xe()),CN=Z(),gb=li(),IN=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(gb.WEEKDAY_OFFSET).join("|")+")"),lh=class extends CN.AbstractParserWithWordBoundaryChecking{innerPattern(){return IN}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=gb.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":l=="\u8FD9"&&(o="this");let c=NN.default(e.refDate),h=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),h=!0):o=="next"?(c=c.day(a+7),h=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var FN=Wa&&Wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wa,"__esModule",{value:!0});var LN=FN(xe()),YN=Z(),kr=li(),UN=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(kr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(kr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(kr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),WN=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(kr.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(kr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(kr.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),_u=1,Tu=2,bu=3,vu=4,wu=5,Eu=6,Er=7,ci=8,ku=9,ch=class extends YN.AbstractParserWithWordBoundaryChecking{innerPattern(){return UN}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=LN.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[_u]){let m=t[_u];m=="\u660E"?n.hour()>1&&a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[vu]){let m=t[vu];m=="\u660E"?a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let o=0,l=0,c=-1;if(t[ci]){let m=parseInt(t[ci]);if(isNaN(m)&&(m=kr.zhStringToNumber(t[ci])),m>=60)return null;s.start.assign("second",m)}if(o=parseInt(t[Eu]),isNaN(o)&&(o=kr.zhStringToNumber(t[Eu])),t[Er]?t[Er]=="\u534A"?l=30:t[Er]=="\u6B63"||t[Er]=="\u6574"?l=0:(l=parseInt(t[Er]),isNaN(l)&&(l=kr.zhStringToNumber(t[Er]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[ku]){if(o>12)return null;let m=t[ku][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12))}else if(t[Tu]){let _=t[Tu][0];_=="\u65E9"?(c=0,o==12&&(o=0)):_=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[bu]){let _=t[bu][0];_=="\u4E0A"||_=="\u65E9"||_=="\u51CC"?(c=0,o==12&&(o=0)):(_=="\u4E0B"||_=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[wu]){let _=t[wu][0];_=="\u4E0A"||_=="\u65E9"||_=="\u51CC"?(c=0,o==12&&(o=0)):(_=="\u4E0B"||_=="\u665A")&&(c=1,o!=12&&(o+=12))}if(s.start.assign("hour",o),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):o<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=WN.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let h=a.clone();if(s.end=e.createParsingComponents(),t[_u]){let m=t[_u];m=="\u660E"?n.hour()>1&&h.add(1,"day"):m=="\u6628"?h.add(-1,"day"):m=="\u524D"?h.add(-2,"day"):m=="\u5927\u524D"?h.add(-3,"day"):m=="\u540E"?h.add(2,"day"):m=="\u5927\u540E"&&h.add(3,"day"),s.end.assign("day",h.date()),s.end.assign("month",h.month()+1),s.end.assign("year",h.year())}else if(t[vu]){let m=t[vu];m=="\u660E"?h.add(1,"day"):m=="\u6628"?h.add(-1,"day"):m=="\u524D"?h.add(-2,"day"):m=="\u5927\u524D"?h.add(-3,"day"):m=="\u540E"?h.add(2,"day"):m=="\u5927\u540E"&&h.add(3,"day"),s.end.assign("day",h.date()),s.end.assign("month",h.month()+1),s.end.assign("year",h.year())}else s.end.imply("day",h.date()),s.end.imply("month",h.month()+1),s.end.imply("year",h.year());if(o=0,l=0,c=-1,t[ci]){let m=parseInt(t[ci]);if(isNaN(m)&&(m=kr.zhStringToNumber(t[ci])),m>=60)return null;s.end.assign("second",m)}if(o=parseInt(t[Eu]),isNaN(o)&&(o=kr.zhStringToNumber(t[Eu])),t[Er]?t[Er]=="\u534A"?l=30:t[Er]=="\u6B63"||t[Er]=="\u6574"?l=0:(l=parseInt(t[Er]),isNaN(l)&&(l=kr.zhStringToNumber(t[Er]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[ku]){if(o>12)return null;let m=t[ku][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Tu]){let _=t[Tu][0];_=="\u65E9"?(c=0,o==12&&(o=0)):_=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[bu]){let _=t[bu][0];_=="\u4E0A"||_=="\u65E9"||_=="\u51CC"?(c=0,o==12&&(o=0)):(_=="\u4E0B"||_=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[wu]){let _=t[wu][0];_=="\u4E0A"||_=="\u65E9"||_=="\u51CC"?(c=0,o==12&&(o=0)):(_=="\u4E0B"||_=="\u665A")&&(c=1,o!=12&&(o+=12))}return s.text=s.text+t[0],s.end.assign("hour",o),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>o?s.end.imply("meridiem",0):o>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var qN=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0});var jN=qN(xe()),$N=Z(),bb=li(),BN=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(bb.WEEKDAY_OFFSET).join("|")+")"),dh=class extends $N.AbstractParserWithWordBoundaryChecking{innerPattern(){return BN}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=bb.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=jN.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var GN=ja&&ja.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ja,"__esModule",{value:!0});var HN=GN($r()),fh=class extends HN.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};ja.default=fh});var Eb=O($a=>{"use strict";var zN=$a&&$a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($a,"__esModule",{value:!0});var VN=zN(un()),hh=class extends VN.default{patternBetween(){return/^\s*$/i}};$a.default=hh});var kb=O(dt=>{"use strict";var mn=dt&&dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dt,"__esModule",{value:!0});dt.createConfiguration=dt.createCasualConfiguration=dt.parseDate=dt.parse=dt.strict=dt.casual=dt.hans=void 0;var ph=xr(),KN=mn(zo()),ZN=ln(),XN=mn(fb()),QN=mn(pb()),JN=mn(yb()),eC=mn(_b()),tC=mn(Tb()),rC=mn(vb()),nC=mn(wb()),sC=mn(Eb());dt.hans=new ph.Chrono(mh());dt.casual=new ph.Chrono(mh());dt.strict=new ph.Chrono(yh());function iC(r,e,t){return dt.casual.parse(r,e,t)}dt.parse=iC;function aC(r,e,t){return dt.casual.parseDate(r,e,t)}dt.parseDate=aC;function mh(){let r=yh();return r.parsers.unshift(new XN.default),r}dt.createCasualConfiguration=mh;function yh(){let r=ZN.includeCommonConfiguration({parsers:[new QN.default,new eC.default,new rC.default,new tC.default,new JN.default],refiners:[new nC.default,new sC.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof KN.default)),r}dt.createConfiguration=yh});var Sb=O(ar=>{"use strict";var Db=ar&&ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),oC=ar&&ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),uC=ar&&ar.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Db(e,r,t)},lC=ar&&ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Db(e,r,t);return oC(e,r),e};Object.defineProperty(ar,"__esModule",{value:!0});ar.hans=void 0;uC(ub(),ar);ar.hans=lC(kb())});var Jt=O(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseTimeUnits=pe.TIME_UNITS_PATTERN=pe.parseYear=pe.YEAR_PATTERN=pe.parseOrdinalNumberPattern=pe.ORDINAL_NUMBER_PATTERN=pe.parseNumberPattern=pe.NUMBER_PATTERN=pe.TIME_UNIT_DICTIONARY=pe.ORDINAL_WORD_DICTIONARY=pe.INTEGER_WORD_DICTIONARY=pe.MONTH_DICTIONARY=pe.FULL_MONTH_NAME_DICTIONARY=pe.WEEKDAY_DICTIONARY=pe.REGEX_PARTS=void 0;var Du=Fe(),cC=At();pe.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};pe.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};pe.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};pe.MONTH_DICTIONARY=Object.assign(Object.assign({},pe.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});pe.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};pe.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};pe.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};pe.NUMBER_PATTERN=`(?:${Du.matchAnyPattern(pe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function Mb(r){let e=r.toLowerCase();return pe.INTEGER_WORD_DICTIONARY[e]!==void 0?pe.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}pe.parseNumberPattern=Mb;pe.ORDINAL_NUMBER_PATTERN=`(?:${Du.matchAnyPattern(pe.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function dC(r){let e=r.toLowerCase();return pe.ORDINAL_WORD_DICTIONARY[e]!==void 0?pe.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}pe.parseOrdinalNumberPattern=dC;var gh="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";pe.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${gh}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${gh}|[5-9][0-9]${gh})`;function fC(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return cC.findMostLikelyADYear(e)}pe.parseYear=fC;var Rb=`(${pe.NUMBER_PATTERN})\\s{0,3}(${Du.matchAnyPattern(pe.TIME_UNIT_DICTIONARY)})`,Ob=new RegExp(Rb,"i");pe.TIME_UNITS_PATTERN=Du.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",Rb);function hC(r){let e={},t=r,n=Ob.exec(t);for(;n;)pC(e,n),t=t.substring(n[0].length).trim(),n=Ob.exec(t);return e}pe.parseTimeUnits=hC;function pC(r,e){let t=Mb(e[1]),n=pe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Pb=O(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var Ba=Jt(),mC=rt(),yC=Z(),xb=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Ba.TIME_UNITS_PATTERN})${Ba.REGEX_PARTS.rightBoundary}`,gC=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${xb}`,Ba.REGEX_PARTS.flags),_C=new RegExp(xb,"i"),_h=class extends yC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ba.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?_C:gC}innerExtract(e,t){let n=Ba.parseTimeUnits(t[1]);return mC.ParsingComponents.createRelativeFromReference(e.reference,n)}};Th.default=_h});var Fb=O(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var TC=At(),Ga=Jt(),Ib=Jt(),Su=Jt(),bC=Fe(),vC=Z(),wC=new RegExp(`(?:\u0441)?\\s*(${Su.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${Su.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${bC.matchAnyPattern(Ga.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${Ib.YEAR_PATTERN}(?![^\\s]\\d)))?${Ga.REGEX_PARTS.rightBoundary}`,Ga.REGEX_PARTS.flags),Ab=1,Nb=2,EC=3,Cb=4,bh=class extends vC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ga.REGEX_PARTS.leftBoundary}innerPattern(){return wC}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ga.MONTH_DICTIONARY[t[EC].toLowerCase()],a=Su.parseOrdinalNumberPattern(t[Ab]);if(a>31)return t.index=t.index+t[Ab].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Cb]){let o=Ib.parseYear(t[Cb]);n.start.assign("year",o)}else{let o=TC.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Nb]){let o=Su.parseOrdinalNumberPattern(t[Nb]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};vh.default=bh});var Ub=O(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var Ha=Jt(),kC=At(),DC=Fe(),Yb=Jt(),SC=Z(),OC=new RegExp(`((?:\u0432)\\s*)?(${DC.matchAnyPattern(Ha.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${Yb.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Ha.REGEX_PARTS.flags),MC=2,Lb=3,wh=class extends SC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ha.REGEX_PARTS.leftBoundary}innerPattern(){return OC}innerExtract(e,t){let n=t[MC].toLowerCase();if(t[0].length<=3&&!Ha.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let a=Ha.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[Lb]){let o=Yb.parseYear(t[Lb]);s.start.assign("year",o)}else{let o=kC.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};Eh.default=wh});var qb=O(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var Ou=mt(),RC=ms(),Wb=Jt(),kh=class extends RC.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return Wb.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${Wb.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Ou.Meridiem.PM)):s<6&&n.assign("meridiem",Ou.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",Ou.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",Ou.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Dh.default=kh});var jb=O(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var Mu=Jt(),xC=rt(),PC=Z(),AC=Tr(),NC=new RegExp(`(${Mu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,Mu.REGEX_PARTS.flags),Sh=class extends PC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Mu.REGEX_PARTS.leftBoundary}innerPattern(){return NC}innerExtract(e,t){let n=Mu.parseTimeUnits(t[1]),s=AC.reverseTimeUnits(n);return xC.ParsingComponents.createRelativeFromReference(e.reference,s)}};Oh.default=Sh});var $b=O(za=>{"use strict";var CC=za&&za.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(za,"__esModule",{value:!0});var IC=CC($r()),Mh=class extends IC.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};za.default=Mh});var Bb=O(Va=>{"use strict";var FC=Va&&Va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Va,"__esModule",{value:!0});var LC=FC(un()),Rh=class extends LC.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};Va.default=Rh});var Gb=O(yn=>{"use strict";var YC=yn&&yn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),UC=yn&&yn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),WC=yn&&yn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&YC(e,r,t);return UC(e,r),e};Object.defineProperty(yn,"__esModule",{value:!0});var qC=Z(),Ka=WC(dn()),xh=Jt(),jC=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${xh.REGEX_PARTS.rightBoundary}`,xh.REGEX_PARTS.flags),Ph=class extends qC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return xh.REGEX_PARTS.leftBoundary}innerPattern(e){return jC}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return Ka.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return Ka.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return Ka.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Ka.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Ka.theDayBefore(e.reference,2)}return s}};yn.default=Ph});var Hb=O(Ir=>{"use strict";var $C=Ir&&Ir.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),BC=Ir&&Ir.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),GC=Ir&&Ir.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$C(e,r,t);return BC(e,r),e},HC=Ir&&Ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ir,"__esModule",{value:!0});var zC=Z(),Es=GC(dn()),VC=_r(),KC=HC(xe()),Ah=Jt(),ZC=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${Ah.REGEX_PARTS.rightBoundary}`,Ah.REGEX_PARTS.flags),Nh=class extends zC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ah.REGEX_PARTS.leftBoundary}innerPattern(){return ZC}innerExtract(e,t){let n=KC.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return Es.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return Es.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return Es.morning(e.reference);if(s.match(/в\s*полдень/))return Es.noon(e.reference);if(s.match(/прошлой\s*ночью/))return Es.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return Es.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let o=n.hour()<22?1:2;n=n.add(o,"day"),VC.assignSimilarDate(a,n),a.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?Es.midnight(e.reference):a}};Ir.default=Nh});var zb=O(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});var Za=Jt(),XC=Fe(),QC=Z(),JC=gs(),eI=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${XC.matchAnyPattern(Za.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${Za.REGEX_PARTS.rightBoundary}`,Za.REGEX_PARTS.flags),tI=1,rI=2,nI=3,Ch=class extends QC.AbstractParserWithWordBoundaryChecking{innerPattern(){return eI}patternLeftBoundary(){return Za.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[rI].toLowerCase(),s=Za.WEEKDAY_DICTIONARY[n],a=t[tI],o=t[nI],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||l=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||l=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?c="last":l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?c="next":(l=="\u044D\u0442\u043E\u0442"||l=="\u044D\u0442\u0443"||l=="\u044D\u0442\u043E\u0439")&&(c="this");let h=JC.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",h.date()).imply("month",h.month()+1).imply("year",h.year())}};Ih.default=Ch});var Kb=O(Qa=>{"use strict";var sI=Qa&&Qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qa,"__esModule",{value:!0});var Xa=Jt(),Vb=rt(),iI=sI(xe()),aI=Z(),oI=Fe(),uI=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${oI.matchAnyPattern(Xa.TIME_UNIT_DICTIONARY)})(?=\\s*)${Xa.REGEX_PARTS.rightBoundary}`,Xa.REGEX_PARTS.flags),lI=1,cI=2,Fh=class extends aI.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Xa.REGEX_PARTS.leftBoundary}innerPattern(){return uI}innerExtract(e,t){let n=t[lI].toLowerCase(),s=t[cI].toLowerCase(),a=Xa.TIME_UNIT_DICTIONARY[s];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let c={};return c[a]=1,Vb.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let c={};return c[a]=-1,Vb.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=iI.default(e.reference.instant);return a.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):a.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):a.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Qa.default=Fh});var Zb=O(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});var Ja=Jt(),dI=rt(),fI=Z(),hI=Tr(),pI=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${Ja.TIME_UNITS_PATTERN})${Ja.REGEX_PARTS.rightBoundary}`,Ja.REGEX_PARTS.flags),Lh=class extends fI.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ja.REGEX_PARTS.leftBoundary}innerPattern(){return pI}innerExtract(e,t){let n=t[1].toLowerCase(),s=Ja.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=hI.reverseTimeUnits(s);break}return dI.ParsingComponents.createRelativeFromReference(e.reference,s)}};Yh.default=Lh});var Jb=O(Ot=>{"use strict";var or=Ot&&Ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.createConfiguration=Ot.createCasualConfiguration=Ot.parseDate=Ot.parse=Ot.strict=Ot.casual=void 0;var mI=or(Pb()),yI=or(Fb()),gI=or(Ub()),_I=or(qb()),TI=or(jb()),bI=or($b()),vI=or(Bb()),wI=ln(),EI=or(Gb()),kI=or(Hb()),DI=or(zb()),SI=or(Kb()),Xb=xr(),OI=or(_s()),MI=or(Zb());Ot.casual=new Xb.Chrono(Qb());Ot.strict=new Xb.Chrono(Uh(!0));function RI(r,e,t){return Ot.casual.parse(r,e,t)}Ot.parse=RI;function xI(r,e,t){return Ot.casual.parseDate(r,e,t)}Ot.parseDate=xI;function Qb(){let r=Uh(!1);return r.parsers.unshift(new EI.default),r.parsers.unshift(new kI.default),r.parsers.unshift(new gI.default),r.parsers.unshift(new SI.default),r.parsers.unshift(new MI.default),r}Ot.createCasualConfiguration=Qb;function Uh(r=!0){return wI.includeCommonConfiguration({parsers:[new OI.default(!0),new mI.default,new yI.default,new DI.default,new _I.default(r),new TI.default],refiners:[new vI.default,new bI.default]},r)}Ot.createConfiguration=Uh});var mt=O(Te=>{"use strict";var PI=Te&&Te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),AI=Te&&Te.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$n=Te&&Te.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&PI(e,r,t);return AI(e,r),e};Object.defineProperty(Te,"__esModule",{value:!0});Te.parseDate=Te.parse=Te.casual=Te.strict=Te.ru=Te.zh=Te.nl=Te.pt=Te.ja=Te.fr=Te.de=Te.Meridiem=Te.Chrono=Te.en=void 0;var Wh=$n(rd());Te.en=Wh;var NI=xr();Object.defineProperty(Te,"Chrono",{enumerable:!0,get:function(){return NI.Chrono}});var CI;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(CI=Te.Meridiem||(Te.Meridiem={}));var II=$n(u_());Te.de=II;var FI=$n(L_());Te.fr=FI;var LI=$n(H_());Te.ja=LI;var YI=$n(uT());Te.pt=YI;var UI=$n(HT());Te.nl=UI;var WI=$n(Sb());Te.zh=WI;var qI=$n(Jb());Te.ru=qI;Te.strict=Wh.strict;Te.casual=Wh.casual;function jI(r,e,t){return Te.casual.parse(r,e,t)}Te.parse=jI;function $I(r,e,t){return Te.casual.parseDate(r,e,t)}Te.parseDate=$I});var zr=O(zn=>{"use strict";zn.__esModule=!0;var ZI;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(ZI=zn.Operators||(zn.Operators={}));var XI;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(XI=zn.StructuralCharacters||(zn.StructuralCharacters={}));var QI;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(QI=zn.Tokens||(zn.Tokens={}))});var Vh=O($u=>{"use strict";$u.__esModule=!0;var nt=zr();$u.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};$u.VALID_TOKENS={identifierOnly:[{name:nt.Tokens.IDENTIFIER},{name:nt.Tokens.STRUCTURAL_CHARACTER,value:nt.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:nt.Tokens.IDENTIFIER},{name:nt.Tokens.STRUCTURAL_CHARACTER,value:nt.StructuralCharacters.OPEN_PARENTHESIS},{name:nt.Tokens.OPERATOR,value:nt.Operators.NOT}],binaryOperator:[{name:nt.Tokens.OPERATOR,value:nt.Operators.AND},{name:nt.Tokens.OPERATOR,value:nt.Operators.OR},{name:nt.Tokens.OPERATOR,value:nt.Operators.XOR}],binaryOperatorOrClose:[{name:nt.Tokens.OPERATOR,value:nt.Operators.AND},{name:nt.Tokens.OPERATOR,value:nt.Operators.OR},{name:nt.Tokens.OPERATOR,value:nt.Operators.XOR},{name:nt.Tokens.STRUCTURAL_CHARACTER,value:nt.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Kh=O(Tn=>{"use strict";Tn.__esModule=!0;var vi=zr();Tn.STRUCTURAL_CHARACTERS={"(":vi.StructuralCharacters.OPEN_PARENTHESIS,")":vi.StructuralCharacters.CLOSE_PARENTHESIS};Tn.OPERATORS={AND:vi.Operators.AND,OR:vi.Operators.OR,XOR:vi.Operators.XOR,NOT:vi.Operators.NOT};Tn.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));Tn.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);Tn.COMMENT_DELIMITER=String.fromCodePoint(35);Tn.EOL=String.fromCodePoint(10);Tn.ESCAPE_CHARACTER=String.fromCodePoint(92)});var fv=O(bn=>{"use strict";var Zh=bn&&bn.__assign||function(){return Zh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";Xh.__esModule=!0;var wi=zr(),ur=Kh(),Ei=fv();Xh.lex=function(r){for(var e=null,t=null,n=null,s=0;s{"use strict";var JI=vn&&vn.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";var Di=eo&&eo.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";wn.__esModule=!0;var gv=zr();wn.andUtil=function(r,e){return r&&e};wn.orUtil=function(r,e){return r||e};wn.xorUtil=function(r,e){return r!==e};wn.notUtil=function(r){return!r};wn.isIdentifier=function(r){var e=r.name,t=r.value;return e===gv.Tokens.IDENTIFIER&&typeof t=="string"};wn.isOperator=function(r){var e=r.name,t=r.value;return e===gv.Tokens.OPERATOR&&typeof t=="string"};wn.throwInvalidExpression=function(r){throw new TypeError("Invalid postfix expression: "+r)}});var _v=O(np=>{"use strict";var to;np.__esModule=!0;var tp=zr(),rp=ep();np.OPERATOR_MAP=(to={},to[tp.Operators.AND]=rp.andUtil,to[tp.Operators.OR]=rp.orUtil,to[tp.Operators.XOR]=rp.xorUtil,to)});var bv=O(xs=>{"use strict";var sp=xs&&xs.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";ro.__esModule=!0;var vv=bv();ro.getEvaluator=vv.getEvaluator;ro.evaluate=vv.evaluate;var nF=Jh();ro.parse=nF.parse});var hF={};wE(hF,{default:()=>ul});module.exports=EE(hF);var Uv=require("obsidian");var zs=require("obsidian");var mF=new Error("timeout while waiting for mutex to become available"),yF=new Error("mutex already locked"),kE=new Error("request for lock canceled"),Kp=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{h(n.next(m))}catch(_){o(_)}}function c(m){try{h(n.throw(m))}catch(_){o(_)}}function h(m){m.done?a(m.value):s(m.value).then(l,c)}h((n=n.apply(r,e||[])).next())})},Sl=class{constructor(e,t=kE){if(this._maxConcurrency=e,this._cancelError=t,this._queue=[],this._waiters=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}acquire(){let e=this.isLocked(),t=new Promise((n,s)=>this._queue.push({resolve:n,reject:s}));return e||this._dispatch(),t}runExclusive(e){return Kp(this,void 0,void 0,function*(){let[t,n]=yield this.acquire();try{return yield e(t)}finally{n()}})}waitForUnlock(){return Kp(this,void 0,void 0,function*(){return this.isLocked()?new Promise(t=>this._waiters.push({resolve:t})):Promise.resolve()})}isLocked(){return this._value<=0}release(){if(this._maxConcurrency>1)throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){let e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatch(){let e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._value++,this._resolveWaiters(),this._dispatch())},e.resolve([this._value--,this._currentReleaser])}_resolveWaiters(){this._waiters.forEach(e=>e.resolve()),this._waiters=[]}},DE=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{h(n.next(m))}catch(_){o(_)}}function c(m){try{h(n.throw(m))}catch(_){o(_)}}function h(m){m.done?a(m.value):s(m.value).then(l,c)}h((n=n.apply(r,e||[])).next())})},vo=class{constructor(e){this._semaphore=new Sl(1,e)}acquire(){return DE(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var Yi=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}},qs=class{constructor(e,t){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];e?this.options=e:this.options=new Yi,t?this.layoutComponents=t:this.layoutComponents=this.defaultLayout,this.layoutComponents=this.applyOptions(this.options)}applyOptions(e){let t=(s,a,o)=>a?s.filter(l=>l!=o):s,n=this.layoutComponents;return n=t(n,e.hidePriority,"priority"),n=t(n,e.hideRecurrenceRule,"recurrenceRule"),n=t(n,e.hideCreatedDate,"createdDate"),n=t(n,e.hideStartDate,"startDate"),n=t(n,e.hideScheduledDate,"scheduledDate"),n=t(n,e.hideDueDate,"dueDate"),n=t(n,e.hideDoneDate,"doneDate"),n}};var wo=["MO","TU","WE","TH","FR","SA","SU"],ut=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(wo.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=wo[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var Ge=function(r){return r!=null},rr=function(r){return typeof r=="number"},Ol=function(r){return typeof r=="string"&&wo.includes(r)},xt=Array.isArray,mr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=Ee(t,e/t.length)),t.slice(0,e)+String(n))}var Xp=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Lt=function(r,e){var t=r%e;return t*e<0?t+e:t},Eo=function(r,e){return{div:Math.floor(r/e),mod:Lt(r,e)}},nr=function(r){return!Ge(r)||r.length===0},at=function(r){return!nr(r)},De=function(r,e){return at(r)&&r.indexOf(e)!==-1};var An;(function(r){r.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],r.ONE_DAY=1e3*60*60*24,r.MAXYEAR=9999,r.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),r.PY_WEEKDAYS=[6,0,1,2,3,4,5],r.getYearDay=function(e){var t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((t.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/r.ONE_DAY)+1},r.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},r.isDate=function(e){return e instanceof Date},r.isValidDate=function(e){return r.isDate(e)&&!isNaN(e.getTime())},r.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},r.daysBetween=function(e,t){var n=e.getTime()-r.tzOffset(e),s=t.getTime()-r.tzOffset(t),a=n-s;return Math.round(a/r.ONE_DAY)},r.toOrdinal=function(e){return r.daysBetween(e,r.ORDINAL_BASE)},r.fromOrdinal=function(e){return new Date(r.ORDINAL_BASE.getTime()+e*r.ONE_DAY)},r.getMonthDays=function(e){var t=e.getUTCMonth();return t===1&&r.isLeapYear(e.getUTCFullYear())?29:r.MONTH_DAYS[t]},r.getWeekday=function(e){return r.PY_WEEKDAYS[e.getUTCDay()]},r.monthRange=function(e,t){var n=new Date(Date.UTC(e,t,1));return[r.getWeekday(n),r.getMonthDays(n)]},r.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},r.clone=function(e){var t=new Date(e.getTime());return t},r.cloneDates=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),nn=SE;var bm=ns(Tm(),1),{__extends:$s,__assign:Bt,__rest:SF,__decorate:OF,__param:MF,__metadata:RF,__awaiter:xF,__generator:PF,__exportStar:AF,__createBinding:NF,__values:CF,__read:IF,__spread:FF,__spreadArrays:LF,__spreadArray:U,__await:YF,__asyncGenerator:UF,__asyncDelegator:WF,__asyncValues:qF,__makeTemplateObject:jF,__importStar:$F,__importDefault:BF,__classPrivateFieldGet:GF,__classPrivateFieldSet:HF,__classPrivateFieldIn:zF}=bm.default;var OE=function(r){$s(e,r);function e(t,n,s){var a=r.call(this,t,n)||this;return a.iterator=s,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(nn),Rl=OE;var ME={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},is=ME;var vm=function(r,e){return r.indexOf(e)!==-1},RE=function(r){return r.toString()},xE=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},PE=function(){function r(e,t,n,s){if(t===void 0&&(t=RE),n===void 0&&(n=is),s===void 0&&(s=xE),this.text=[],this.language=n||is,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);a.sort(function(m,_){return m-_}),o.sort(function(m,_){return _-m}),this.bymonthday=a.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(Ge(this.origOptions.byweekday)){var l=xt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(l);this.byweekday={allWeeks:l.filter(function(m){return!m.n}),someWeeks:l.filter(function(m){return Boolean(m.n)}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var h=function(m,_){return m.weekday-_.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(vm(["dtstart","wkst","freq"],n))return!0;if(!vm(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[X.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=rr(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,s){var a=this;s===void 0&&(s=","),xt(e)||(e=[e]);var o=function(c,h,m){for(var _="",T=0;Te[0].length)&&(e=a,t=s)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function Ui(r,e){e===void 0&&(e=is);var t={},n=new AE(e.tokens);if(!n.start(r))return null;return s(),t;function s(){n.expect("every");var T=n.acceptNumber();if(T&&(t.interval=parseInt(T[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=X.DAILY,n.nextSymbol()&&(o(),_());break;case"weekday(s)":t.freq=X.WEEKLY,t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR],n.nextSymbol(),_();break;case"week(s)":t.freq=X.WEEKLY,n.nextSymbol()&&(a(),_());break;case"hour(s)":t.freq=X.HOURLY,n.nextSymbol()&&(a(),_());break;case"minute(s)":t.freq=X.MINUTELY,n.nextSymbol()&&(a(),_());break;case"month(s)":t.freq=X.MONTHLY,n.nextSymbol()&&(a(),_());break;case"year(s)":t.freq=X.YEARLY,n.nextSymbol()&&(a(),_());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=X.WEEKLY;var D=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[X[D]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=c();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(X[v]),n.nextSymbol()}m(),_();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=X.YEARLY,t.bymonth=[l()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var R=l();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(R),n.nextSymbol()}a(),_();break;default:throw new Error("Unknown symbol")}}function a(){var T=n.accept("on"),D=n.accept("the");if(!!(T||D))do{var v=h(),R=c(),I=l();if(v)R?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R].nth(v))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(v),n.accept("day(s)"));else if(R)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var q=n.acceptNumber();if(!q)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(q[0],10)];n.accept("comma");){if(q=n.acceptNumber(),!q)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(q[0],10))}}else if(I)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(I);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var T=n.accept("at");if(!!T)do{var D=n.acceptNumber();if(!D)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(D[0],10)];n.accept("comma");){if(D=n.acceptNumber(),!D)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(D[0],10))}}while(n.accept("comma")||n.accept("at"))}function l(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var T=parseInt(n.value[1],10);if(T<-366||T>366)throw new Error("Nth out of range: "+T);return n.nextSymbol(),n.accept("last")?-T:T;default:return!1}}function m(){n.accept("on"),n.accept("the");var T=h();if(!!T)for(t.bymonthday=[T],n.nextSymbol();n.accept("comma");){if(T=h(),!T)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(T),n.nextSymbol()}}function _(){if(n.symbol==="until"){var T=Date.parse(n.text);if(!T)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(T)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var be;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(be||(be={}));function Wi(r){return r12){var n=Math.floor(this.month/12),s=Lt(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=Eo(this.hour,24),o=a.div,l=a.mod;if(o&&(this.hour=l,this.addDaily(o)),nr(s)||De(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var o=Eo(this.minute,60),l=o.div,c=o.mod;if(l&&(this.minute=c,this.addHours(l,!1,s)),(nr(s)||De(s,this.hour))&&(nr(a)||De(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var l=Eo(this.second,60),c=l.div,h=l.mod;if(c&&(this.second=h,this.addMinutes(c,!1,s,a)),(nr(s)||De(s,this.hour))&&(nr(a)||De(a,this.minute))&&(nr(o)||De(o,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=An.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>An.MAXYEAR))return;t=An.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,a=t.interval,o=t.wkst,l=t.byhour,c=t.byminute,h=t.bysecond;switch(s){case be.YEARLY:return this.addYears(a);case be.MONTHLY:return this.addMonths(a);case be.WEEKLY:return this.addWeekly(a,o);case be.DAILY:return this.addDaily(a);case be.HOURLY:return this.addHours(a,n,l);case be.MINUTELY:return this.addMinutes(a,n,l,c);case be.SECONDLY:return this.addSeconds(a,n,l,c,h)}},e}(Gs);function xl(r){for(var e=[],t=Object.keys(r),n=0,s=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||at(e.byweekno)||at(e.byyearday)||Boolean(e.bymonthday)||at(e.bymonthday)||Ge(e.byweekday)||Ge(e.byeaster)))switch(e.freq){case X.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case X.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case X.WEEKLY:e.byweekday=[ie.getWeekday(e.dtstart)];break}if(Ge(e.bymonth)&&!xt(e.bymonth)&&(e.bymonth=[e.bymonth]),Ge(e.byyearday)&&!xt(e.byyearday)&&rr(e.byyearday)&&(e.byyearday=[e.byyearday]),!Ge(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(xt(e.bymonthday)){for(var s=[],a=[],t=0;t0?s.push(n):n<0&&a.push(n)}e.bymonthday=s,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Ge(e.byweekno)&&!xt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Ge(e.byweekday))e.bynweekday=null;else if(rr(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Ol(e.byweekday))e.byweekday=[ut.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof ut)!e.byweekday.n||e.freq>X.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var o=[],l=[],t=0;tX.MONTHLY?o.push(c.weekday):l.push([c.weekday,c.n])}e.byweekday=at(o)?o:null,e.bynweekday=at(l)?l:null}return Ge(e.byhour)?rr(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(m=0,h=l.yearlen+Lt(o-e.wkst,7)):h=n-m;for(var _=Math.floor(h/7),T=Lt(h,7),D=Math.floor(_+T/4),v=0;v0&&R<=D){var I=void 0;R>1?(I=m+(R-1)*7,m!==c&&(I-=7-c)):I=m;for(var q=0;q<7&&(l.wnomask[I]=1,I++,l.wdaymask[I]!==e.wkst);q++);}}if(De(e.byweekno,1)){var I=m+D*7;if(m!==c&&(I-=7-c),I=4?(me=0,ve=fe+Lt(B-e.wkst,7)):ve=n-m,$=Math.floor(52+Lt(ve,7)/4)}if(De(e.byweekno,$))for(var I=0;Ia)return sn(r);if($>=t){var B=Gm($,e);if(!r.accept(B)||l&&(--l,!l))return sn(r)}}else for(var q=D;qa)return sn(r);if($>=t){var B=Gm($,e);if(!r.accept(B)||l&&(--l,!l))return sn(r)}}}if(e.interval===0||(c.add(e,R),c.year>ie.MAXYEAR))return sn(r);Wi(n)||(m=h.gettimeset(n)(c.hour,c.minute,c.second,0)),h.rebuild(c.year,c.month)}}function BE(r,e,t){var n=t.bymonth,s=t.byweekno,a=t.byweekday,o=t.byeaster,l=t.bymonthday,c=t.bynmonthday,h=t.byyearday;return at(n)&&!De(n,r.mmask[e])||at(s)&&!r.wnomask[e]||at(a)&&!De(a,r.wdaymask[e])||at(r.nwdaymask)&&!r.nwdaymask[e]||o!==null&&!De(r.eastermask,e)||(at(l)||at(c))&&!De(l,r.mdaymask[e])&&!De(c,r.nmdaymask[e])||at(h)&&(e=r.yearlen&&!De(h,e+1-r.yearlen)&&!De(h,-r.nextyearlen+e-r.yearlen))}function Gm(r,e){return new as(r,e.tzid).rezonedDate()}function sn(r){return r.getValue()}function GE(r,e,t,n,s){for(var a=!1,o=e;o=X.HOURLY&&at(s)&&!De(s,e.hour)||n>=X.MINUTELY&&at(a)&&!De(a,e.minute)||n>=X.SECONDLY&&at(o)&&!De(o,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var yr={MO:new ut(0),TU:new ut(1),WE:new ut(2),TH:new ut(3),FR:new ut(4),SA:new ut(5),SU:new ut(6)},qi={freq:be.YEARLY,dtstart:null,interval:1,wkst:yr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Mm=Object.keys(qi),X=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new Pm,this.origOptions=xl(e);var n=Sm(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ui(e,t)},r.fromText=function(e,t){return wm(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return Oo(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new Rl("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new nn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!ie.isValidDate(e)||!ie.isValidDate(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(s)return this._iter(new Rl("between",a,s));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new nn("between",a)),this._cacheAdd("between",o,a)),o},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!ie.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new nn("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!ie.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new nn("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return Bi(this.origOptions)},r.prototype.toText=function(e,t,n){return Em(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return km(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=be.YEARLY,r.MONTHLY=be.MONTHLY,r.WEEKLY=be.WEEKLY,r.DAILY=be.DAILY,r.HOURLY=be.HOURLY,r.MINUTELY=be.MINUTELY,r.SECONDLY=be.SECONDLY,r.MO=yr.MO,r.TU=yr.TU,r.WE=yr.WE,r.TH=yr.TH,r.FR=yr.FR,r.SA=yr.SA,r.SU=yr.SU,r.parseString=$i,r.optionsToString=Bi,r}();function Hm(r,e,t,n,s,a){var o={},l=r.accept;function c(T,D){t.forEach(function(v){v.between(T,D,!0).forEach(function(R){o[Number(R)]=!0})})}s.forEach(function(T){var D=new as(T,a).rezonedDate();o[Number(D)]=!0}),r.accept=function(T){var D=Number(T);return isNaN(D)?l.call(this,T):!o[D]&&(c(new Date(D-1),new Date(D+1)),!o[D])?(o[D]=!0,l.call(this,T)):!0},r.method==="between"&&(c(r.args.after,r.args.before),r.accept=function(T){var D=Number(T);return o[D]?!0:(o[D]=!0,l.call(this,T))});for(var h=0;h1||s.length||a.length||o.length){var m=new Nl(h);return m.dtstart(l),m.tzid(c||void 0),n.forEach(function(T){m.rrule(new X(Al(T,l,c),h))}),s.forEach(function(T){m.rdate(T)}),a.forEach(function(T){m.exrule(new X(Al(T,l,c),h))}),o.forEach(function(T){m.exdate(T)}),e.compatible&&e.dtstart&&m.rdate(l),m}var _=n[0]||{};return new X(Al(_,_.dtstart||e.dtstart||l,_.tzid||e.tzid||c),h)}function Mo(r,e){return e===void 0&&(e={}),VE(r,KE(e))}function Al(r,e,t){return Bt(Bt({},r),{dtstart:e,tzid:t})}function KE(r){var e=[],t=Object.keys(r),n=Object.keys(zm);if(t.forEach(function(s){De(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Bt(Bt({},zm),r)}function ZE(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Xp(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function XE(r){var e=ZE(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function QE(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` -`),n=0;n0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function JE(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Vm(r,e){return JE(e),r.split(",").map(function(t){return ie.untilStringToDate(t)})}function Km(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;ne in r?Li(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ce=(r,e)=>{for(var t in e||(e={}))Kp.call(e,t)&&Vp(r,t,e[t]);if(zp)for(var t of zp(e))vk.call(e,t)&&Vp(r,t,e[t]);return r},er=(r,e)=>yk(r,_k(e));var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),wk=(r,e)=>{for(var t in e)Li(r,t,{get:e[t],enumerable:!0})},Zp=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Tk(e))!Kp.call(r,s)&&s!==t&&Li(r,s,{get:()=>e[s],enumerable:!(n=gk(e,s))||n.enumerable});return r};var ns=(r,e,t)=>(t=r!=null?mk(bk(r)):{},Zp(e||!r||!r.__esModule?Li(t,"default",{value:r,enumerable:!0}):t,r)),kk=r=>Zp(Li({},"__esModule",{value:!0}),r);var J=(r,e,t)=>new Promise((n,s)=>{var a=c=>{try{l(t.next(c))}catch(f){s(f)}},o=c=>{try{l(t.throw(c))}catch(f){s(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);l((t=t.apply(r,e)).next())});var Le=O(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.matchAnyPattern=xn.extractTerms=xn.repeatedTimeunitPattern=void 0;function Ok(r,e){let t=e.replace(/\((?!\?)/g,"(?:");return`${r}${t}\\s{0,5}(?:,?\\s{0,5}${t}){0,10}`}xn.repeatedTimeunitPattern=Ok;function Xp(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}xn.extractTerms=Xp;function Mk(r){return`(?:${Xp(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}xn.matchAnyPattern=Mk});var Pe=O((Ml,Rl)=>{(function(r,e){typeof Ml=="object"&&typeof Rl!="undefined"?Rl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(Ml,function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",s="second",a="minute",o="hour",l="day",c="week",f="month",m="quarter",g="year",T="date",E="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},q=function(V,W,x){var Q=String(V);return!Q||Q.length>=W?V:""+Array(W+1-Q.length).join(x)+V},$={s:q,z:function(V){var W=-V.utcOffset(),x=Math.abs(W),Q=Math.floor(x/60),Y=x%60;return(W<=0?"+":"-")+q(Q,2,"0")+":"+q(Y,2,"0")},m:function V(W,x){if(W.date(){"use strict";var Rk=An&&An.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(An,"__esModule",{value:!0});An.findYearClosestToRef=An.findMostLikelyADYear=void 0;var Pk=Rk(Pe());function xk(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}An.findMostLikelyADYear=xk;function Ak(r,e,t){let n=Pk.default(r),s=n;s=s.month(t-1),s=s.date(e),s=s.year(n.year());let a=s.add(1,"y"),o=s.add(-1,"y");return Math.abs(a.diff(n)){"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.parseTimeUnits=_e.TIME_UNITS_PATTERN=_e.parseYear=_e.YEAR_PATTERN=_e.parseOrdinalNumberPattern=_e.ORDINAL_NUMBER_PATTERN=_e.parseNumberPattern=_e.NUMBER_PATTERN=_e.TIME_UNIT_DICTIONARY=_e.ORDINAL_WORD_DICTIONARY=_e.INTEGER_WORD_DICTIONARY=_e.MONTH_DICTIONARY=_e.FULL_MONTH_NAME_DICTIONARY=_e.WEEKDAY_DICTIONARY=void 0;var Do=Le(),Nk=Rt();_e.WEEKDAY_DICTIONARY={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6};_e.FULL_MONTH_NAME_DICTIONARY={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12};_e.MONTH_DICTIONARY=Object.assign(Object.assign({},_e.FULL_MONTH_NAME_DICTIONARY),{jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12});_e.INTEGER_WORD_DICTIONARY={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12};_e.ORDINAL_WORD_DICTIONARY={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31};_e.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconds:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year"};_e.NUMBER_PATTERN=`(?:${Do.matchAnyPattern(_e.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function Jp(r){let e=r.toLowerCase();return _e.INTEGER_WORD_DICTIONARY[e]!==void 0?_e.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}_e.parseNumberPattern=Jp;_e.ORDINAL_NUMBER_PATTERN=`(?:${Do.matchAnyPattern(_e.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Ck(r){let e=r.toLowerCase();return _e.ORDINAL_WORD_DICTIONARY[e]!==void 0?_e.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}_e.parseOrdinalNumberPattern=Ck;_e.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function Ik(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return Nk.findMostLikelyADYear(e)}_e.parseYear=Ik;var em=`(${_e.NUMBER_PATTERN})\\s{0,3}(${Do.matchAnyPattern(_e.TIME_UNIT_DICTIONARY)})`,Qp=new RegExp(em,"i");_e.TIME_UNITS_PATTERN=Do.repeatedTimeunitPattern("(?:(?:about|around)\\s{0,3})?",em);function Fk(r){let e={},t=r,n=Qp.exec(t);for(;n;)Lk(e,n),t=t.substring(n[0].length).trim(),n=Qp.exec(t);return e}_e.parseTimeUnits=Fk;function Lk(r,e){let t=Jp(e[1]),n=_e.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var tm=O((Pl,xl)=>{(function(r,e){typeof Pl=="object"&&typeof xl!="undefined"?xl.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(Pl,function(){"use strict";var r="month",e="quarter";return function(t,n){var s=n.prototype;s.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var a=s.add;s.add=function(l,c){return l=Number(l),this.$utils().p(c)===e?this.add(3*l,r):a.bind(this)(l,c)};var o=s.startOf;s.startOf=function(l,c){var f=this.$utils(),m=!!f.u(c)||c;if(f.p(l)===e){var g=this.quarter()-1;return m?this.month(3*g).startOf(r).startOf("day"):this.month(3*g+2).endOf(r).endOf("day")}return o.bind(this)(l,c)}}})});var pr=O(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.implySimilarTime=Lr.assignSimilarTime=Lr.assignSimilarDate=Lr.assignTheNextDay=void 0;var rm=ht();function Yk(r,e){e=e.add(1,"day"),nm(r,e),sm(r,e)}Lr.assignTheNextDay=Yk;function nm(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}Lr.assignSimilarDate=nm;function Uk(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",rm.Meridiem.AM):r.assign("meridiem",rm.Meridiem.PM)}Lr.assignSimilarTime=Uk;function sm(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}Lr.implySimilarTime=sm});var im=O(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.toTimezoneOffset=ss.TIMEZONE_ABBR_MAP=void 0;ss.TIMEZONE_ABBR_MAP={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function Wk(r){var e;return r==null?null:typeof r=="number"?r:(e=ss.TIMEZONE_ABBR_MAP[r])!==null&&e!==void 0?e:null}ss.toTimezoneOffset=Wk});var tt=O(Yr=>{"use strict";var am=Yr&&Yr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.ParsingResult=Yr.ParsingComponents=Yr.ReferenceWithTimezone=void 0;var qk=am(tm()),Eo=am(Pe()),Al=pr(),jk=im();Eo.default.extend(qk.default);var Nl=class{constructor(e){var t;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(t=e.instant)!==null&&t!==void 0?t:new Date,this.timezoneOffset=jk.toTimezoneOffset(e.timezone))}};Yr.ReferenceWithTimezone=Nl;var is=class{constructor(e,t){if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let s in t)this.knownValues[s]=t[s];let n=Eo.default(e.instant);this.imply("day",n.date()),this.imply("month",n.month()+1),this.imply("year",n.year()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new is(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isOnlyDayMonthComponent(){return this.isCertain("day")&&this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return Eo.default(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment();return new Date(e.getTime()+this.getSystemTimezoneAdjustmentMinute(e)*6e4)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}getSystemTimezoneAdjustmentMinute(e){var t,n;(!e||e.getTime()<0)&&(e=new Date);let s=-e.getTimezoneOffset(),a=(n=(t=this.get("timezoneOffset"))!==null&&t!==void 0?t:this.reference.timezoneOffset)!==null&&n!==void 0?n:s;return s-a}static createRelativeFromReference(e,t){let n=Eo.default(e.instant);for(let a in t)n=n.add(t[a],a);let s=new is(e);return t.hour||t.minute||t.second?(Al.assignSimilarTime(s,n),Al.assignSimilarDate(s,n),e.timezoneOffset!==null&&s.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(Al.implySimilarTime(s,n),e.timezoneOffset!==null&&s.imply("timezoneOffset",-e.instant.getTimezoneOffset()),t.d?(s.assign("day",n.date()),s.assign("month",n.month()+1),s.assign("year",n.year())):(t.week&&s.imply("weekday",n.day()),s.imply("day",n.date()),t.month?(s.assign("month",n.month()+1),s.assign("year",n.year())):(s.imply("month",n.month()+1),t.year?s.assign("year",n.year()):s.imply("year",n.year())))),s}};Yr.ParsingComponents=is;var Yi=class{constructor(e,t,n,s,a){this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=s||new is(e),this.end=a}clone(){let e=new Yi(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};Yr.ParsingResult=Yi});var Z=O(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.AbstractParserWithWordBoundaryChecking=void 0;var Cl=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let t=this.innerPattern(e);return t==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${t.source}`,t.flags),this.cachedInnerPattern=t,this.cachedPattern)}extract(e,t){var n;let s=(n=t[1])!==null&&n!==void 0?n:"";t.index=t.index+s.length,t[0]=t[0].substring(s.length);for(let a=2;a{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Fl=Pt(),$k=tt(),Bk=Z(),Gk=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Fl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Hk=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Fl.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Il=class extends Bk.AbstractParserWithWordBoundaryChecking{innerPattern(e){return e.option.forwardDate?Hk:Gk}innerExtract(e,t){let n=Fl.parseTimeUnits(t[1]);return $k.ParsingComponents.createRelativeFromReference(e.reference,n)}};Ll.default=Il});var hm=O(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var zk=Rt(),dm=Pt(),fm=Pt(),Oo=Pt(),Vk=Le(),Kk=Z(),Zk=new RegExp(`(?:on\\s{0,3})?(${Oo.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Oo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Vk.matchAnyPattern(dm.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s{0,3})(${fm.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),um=1,lm=2,Xk=3,cm=4,Yl=class extends Kk.AbstractParserWithWordBoundaryChecking{innerPattern(){return Zk}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=dm.MONTH_DICTIONARY[t[Xk].toLowerCase()],a=Oo.parseOrdinalNumberPattern(t[um]);if(a>31)return t.index=t.index+t[um].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[cm]){let o=fm.parseYear(t[cm]);n.start.assign("year",o)}else{let o=zk.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[lm]){let o=Oo.parseOrdinalNumberPattern(t[lm]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Ul.default=Yl});var _m=O(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var Qk=Rt(),ym=Pt(),Mo=Pt(),gm=Pt(),Jk=Le(),eD=Z(),tD=new RegExp(`(${Jk.matchAnyPattern(ym.MONTH_DICTIONARY)})(?:-|/|\\s*,?\\s*)(${Mo.ORDINAL_NUMBER_PATTERN})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Mo.ORDINAL_NUMBER_PATTERN})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${gm.YEAR_PATTERN}))?(?=\\W|$)(?!\\:\\d)`,"i"),rD=1,nD=2,pm=3,mm=4,Wl=class extends eD.AbstractParserWithWordBoundaryChecking{innerPattern(){return tD}innerExtract(e,t){let n=ym.MONTH_DICTIONARY[t[rD].toLowerCase()],s=Mo.parseOrdinalNumberPattern(t[nD]);if(s>31)return null;let a=e.createParsingComponents({day:s,month:n});if(t[mm]){let c=gm.parseYear(t[mm]);a.assign("year",c)}else{let c=Qk.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[pm])return a;let o=Mo.parseOrdinalNumberPattern(t[pm]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};ql.default=Wl});var vm=O(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var jl=Pt(),sD=Rt(),iD=Le(),bm=Pt(),aD=Z(),oD=new RegExp(`((?:in)\\s*)?(${iD.matchAnyPattern(jl.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${bm.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),uD=1,lD=2,Tm=3,$l=class extends aD.AbstractParserWithWordBoundaryChecking{innerPattern(){return oD}innerExtract(e,t){let n=t[lD].toLowerCase();if(t[0].length<=3&&!jl.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index+(t[uD]||"").length,t.index+t[0].length);s.start.imply("day",1);let a=jl.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[Tm]){let o=bm.parseYear(t[Tm]);s.start.assign("year",o)}else{let o=sD.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};Bl.default=$l});var Dm=O(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var km=Pt(),cD=Le(),dD=Z(),fD=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${cD.matchAnyPattern(km.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),hD=1,pD=2,wm=3,mD=4,Gl=class extends dD.AbstractParserWithWordBoundaryChecking{innerPattern(){return fD}innerExtract(e,t){let n=t[wm]?parseInt(t[wm]):km.MONTH_DICTIONARY[t[pD].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[hD]);return{day:parseInt(t[mD]),month:n,year:s}}};Hl.default=Gl});var Em=O(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var yD=Z(),gD=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),_D=1,TD=2,zl=class extends yD.AbstractParserWithWordBoundaryChecking{innerPattern(){return gD}innerExtract(e,t){let n=parseInt(t[TD]),s=parseInt(t[_D]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};Vl.default=zl});var as=O(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.AbstractTimeExpressionParser=void 0;var $t=ht();function bD(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function vD(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Sm=2,qs=3,Ro=4,Po=5,Ui=6,Kl=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,this.cachedFollowingTimePatten=null,this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?=\\W|$)"}followingSuffix(){return"(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t.index+=t[0].length,null;let s=t.index+t[1].length,a=t[0].substring(t[1].length),o=e.createParsingResult(s,a,n);t.index+=t[0].length;let l=e.text.substring(t.index),f=this.getFollowingTimePatternThroughCache().exec(l);return a.match(/^\d{3,4}/)&&f&&f[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!f||f[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(o):(o.end=this.extractFollowingTimeComponents(e,f,o),o.end&&(o.text+=f[0]),this.checkAndReturnWithFollowingPattern(o))}extractPrimaryTimeComponents(e,t,n=!1){let s=e.createParsingComponents(),a=0,o=null,l=parseInt(t[Sm]);if(l>100){if(this.strictMode||t[qs]!=null)return null;a=l%100,l=Math.floor(l/100)}if(l>24)return null;if(t[qs]!=null){if(t[qs].length==1&&!t[Ui])return null;a=parseInt(t[qs])}if(a>=60)return null;if(l>12&&(o=$t.Meridiem.PM),t[Ui]!=null){if(l>12)return null;let c=t[Ui][0].toLowerCase();c=="a"&&(o=$t.Meridiem.AM,l==12&&(l=0)),c=="p"&&(o=$t.Meridiem.PM,l!=12&&(l+=12))}if(s.assign("hour",l),s.assign("minute",a),o!==null?s.assign("meridiem",o):l<12?s.imply("meridiem",$t.Meridiem.AM):s.imply("meridiem",$t.Meridiem.PM),t[Po]!=null){let c=parseInt(t[Po].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Ro]!=null){let c=parseInt(t[Ro]);if(c>=60)return null;s.assign("second",c)}return s}extractFollowingTimeComponents(e,t,n){let s=e.createParsingComponents();if(t[Po]!=null){let c=parseInt(t[Po].substring(0,3));if(c>=1e3)return null;s.assign("millisecond",c)}if(t[Ro]!=null){let c=parseInt(t[Ro]);if(c>=60)return null;s.assign("second",c)}let a=parseInt(t[Sm]),o=0,l=-1;if(t[qs]!=null?o=parseInt(t[qs]):a>100&&(o=a%100,a=Math.floor(a/100)),o>=60||a>24)return null;if(a>=12&&(l=$t.Meridiem.PM),t[Ui]!=null){if(a>12)return null;let c=t[Ui][0].toLowerCase();c=="a"&&(l=$t.Meridiem.AM,a==12&&(a=0,s.isCertain("day")||s.imply("day",s.get("day")+1))),c=="p"&&(l=$t.Meridiem.PM,a!=12&&(a+=12)),n.start.isCertain("meridiem")||(l==$t.Meridiem.AM?(n.start.imply("meridiem",$t.Meridiem.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",$t.Meridiem.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return s.assign("hour",a),s.assign("minute",o),l>=0?s.assign("meridiem",l):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>a?s.imply("meridiem",$t.Meridiem.AM):a<=12&&(s.assign("hour",a+12),s.assign("meridiem",$t.Meridiem.PM)):a>12?s.imply("meridiem",$t.Meridiem.PM):a<=12&&s.imply("meridiem",$t.Meridiem.AM),s.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],s=t[2];if(s.includes(".")&&!s.match(/\d(\.\d{2})+$/))return null;let a=parseInt(s),o=parseInt(n);if(a>24||o>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=bD(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=vD(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}};xo.AbstractTimeExpressionParser=Kl});var Om=O(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var Ao=ht(),wD=as(),Zl=class extends wD.AbstractTimeExpressionParser{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("night")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",Ao.Meridiem.PM)):s<6&&n.assign("meridiem",Ao.Meridiem.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",Ao.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("morning")&&(n.assign("meridiem",Ao.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};Xl.default=Zl});var mr=O(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.addImpliedTimeUnits=js.reverseTimeUnits=void 0;function kD(r){let e={};for(let t in r)e[t]=-r[t];return e}js.reverseTimeUnits=kD;function DD(r,e){let t=r.clone(),n=r.dayjs();for(let s in e)n=n.add(e[s],s);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}js.addImpliedTimeUnits=DD});var Mm=O(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var Jl=Pt(),ED=tt(),SD=Z(),OD=mr(),MD=new RegExp(`(${Jl.TIME_UNITS_PATTERN})\\s{0,5}(?:ago|before|earlier)(?=(?:\\W|$))`,"i"),RD=new RegExp(`(${Jl.TIME_UNITS_PATTERN})\\s{0,5}ago(?=(?:\\W|$))`,"i"),Ql=class extends SD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?RD:MD}innerExtract(e,t){let n=Jl.parseTimeUnits(t[1]),s=OD.reverseTimeUnits(n);return ED.ParsingComponents.createRelativeFromReference(e.reference,s)}};ec.default=Ql});var Rm=O(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var rc=Pt(),PD=tt(),xD=Z(),AD=new RegExp(`(${rc.TIME_UNITS_PATTERN})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),ND=new RegExp("("+rc.TIME_UNITS_PATTERN+")(later|from now)(?=(?:\\W|$))","i"),CD=1,tc=class extends xD.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?ND:AD}innerExtract(e,t){let n=rc.parseTimeUnits(t[CD]);return PD.ParsingComponents.createRelativeFromReference(e.reference,n)}};nc.default=tc});var Bs=O($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.MergingRefiner=$s.Filter=void 0;var sc=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}};$s.Filter=sc;var ic=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0],a=null;for(let o=1;o{console.log(`${this.constructor.name} merged ${c} and ${f} into ${m}`)}),s=m}}return s!=null&&n.push(s),n}};$s.MergingRefiner=ic});var Ur=O(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var ID=Bs(),ac=class extends ID.MergingRefiner{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(a=>{t.start.isCertain(a)||t.start.assign(a,n.start.get(a))}),t.start.getCertainComponents().forEach(a=>{n.start.isCertain(a)||n.start.assign(a,t.start.get(a))})),t.start.date().getTime()>n.start.date().getTime()){let a=t.start.dayjs(),o=n.start.dayjs();t.start.isOnlyWeekdayComponent()&&a.add(-7,"days").isBefore(o)?(a=a.add(-7,"days"),t.start.imply("day",a.date()),t.start.imply("month",a.month()+1),t.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(7,"days").isAfter(a)?(o=o.add(7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):[n,t]=[t,n]}let s=t.clone();return s.start=t.start,s.end=n.start,s.index=Math.min(t.index,n.index),t.index{"use strict";var FD=Wi&&Wi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wi,"__esModule",{value:!0});var LD=FD(Ur()),uc=class extends LD.default{patternBetween(){return/^\s*(to|-)\s*$/i}};Wi.default=uc});var xm=O(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.mergeDateTimeComponent=Gs.mergeDateTimeResult=void 0;var YD=ht();function UD(r,e){let t=r.clone(),n=r.start,s=e.start;if(t.start=lc(n,s),r.end!=null||e.end!=null){let a=r.end==null?r.start:r.end,o=e.end==null?e.start:e.end,l=lc(a,o);r.end==null&&l.date().getTime(){"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var WD=Bs(),Am=xm(),cc=class extends WD.MergingRefiner{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let s=t.start.isOnlyDate()?Am.mergeDateTimeResult(t,n):Am.mergeDateTimeResult(n,t);return s.index=t.index,s.text=t.text+e+n.text,s}};dc.default=cc});var Nm=O(qi=>{"use strict";var qD=qi&&qi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qi,"__esModule",{value:!0});var jD=qD(rn()),fc=class extends jD.default{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};qi.default=fc});var Cm=O(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});var $D=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),BD={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:60,CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:-300,FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:240,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:-480,PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360},hc=class{constructor(e){this.timezone=Object.assign(Object.assign({},BD),e)}refine(e,t){var n;let s=(n=e.option.timezones)!==null&&n!==void 0?n:{};return t.forEach(a=>{var o,l;let c=e.text.substring(a.index+a.text.length),f=$D.exec(c);if(!f)return;let m=f[1].toUpperCase(),g=(l=(o=s[m])!==null&&o!==void 0?o:this.timezone[m])!==null&&l!==void 0?l:null;if(g===null)return;e.debug(()=>{console.log(`Extracting timezone: '${m}' into: ${g} for: ${a.start}`)});let T=a.start.get("timezoneOffset");T!==null&&g!=T&&(a.start.isCertain("timezoneOffset")||m!=f[1])||a.start.isOnlyDate()&&m!=f[1]||(a.text+=f[0],a.start.isCertain("timezoneOffset")||a.start.assign("timezoneOffset",g),a.end!=null&&!a.end.isCertain("timezoneOffset")&&a.end.assign("timezoneOffset",g))}),t}};pc.default=hc});var No=O(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var GD=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),HD=1,zD=2,VD=3,mc=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let s=e.text.substring(n.index+n.text.length),a=GD.exec(s);if(!a)return;e.debug(()=>{console.log(`Extracting timezone: '${a[0]}' into : ${n}`)});let o=parseInt(a[zD]),l=parseInt(a[VD]||"0"),c=o*60+l;c>14*60||(a[HD]==="-"&&(c=-c),n.end!=null&&n.end.assign("timezoneOffset",c),n.start.assign("timezoneOffset",c),n.text+=a[0])}),t}};yc.default=mc});var Im=O(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});var gc=class{refine(e,t){if(t.length<2)return t;let n=[],s=t[0];for(let a=1;as.text.length&&(s=o):(n.push(s),s=o)}return s!=null&&n.push(s),n}};_c.default=gc});var Fm=O(ji=>{"use strict";var KD=ji&&ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ji,"__esModule",{value:!0});var ZD=KD(Pe()),Tc=class{refine(e,t){return e.option.forwardDate&&t.forEach(function(n){let s=ZD.default(e.refDate);if(n.start.isOnlyDayMonthComponent()&&s.isAfter(n.start.dayjs()))for(let a=0;a<3&&s.isAfter(n.start.dayjs());a++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${n} (${n.end})`)}));n.start.isOnlyWeekdayComponent()&&s.isAfter(n.start.dayjs())&&(s.day()>=n.start.get("weekday")?s=s.day(n.start.get("weekday")+7):s=s.day(n.start.get("weekday")),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(s.day()>n.end.get("weekday")?s=s.day(n.end.get("weekday")+7):s=s.day(n.end.get("weekday")),n.end.imply("day",s.date()),n.end.imply("month",s.month()+1),n.end.imply("year",s.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${n} (${n.end})`)})))}),t}};ji.default=Tc});var Lm=O(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});var XD=Bs(),bc=class extends XD.Filter{constructor(e){super(),this.strictMode=e}isValid(e,t){return t.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${t.text}'`)}),!1):t.start.isValidDate()?t.end&&!t.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,t):!0:(e.debug(()=>{console.log(`Removing invalid result: ${t} (${t.start})`)}),!1)}isStrictModeValid(e,t){return t.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${t} (${t.end})`)}),!1):t.start.isOnlyTime()&&(!t.start.isCertain("hour")||!t.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${t} (${t.end})`)}),!1):!0}};vc.default=bc});var Dc=O(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});var QD=Z(),JD=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(?:Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),eE=1,tE=2,rE=3,Ym=4,nE=5,Um=6,Wm=7,qm=8,jm=9,wc=class extends QD.AbstractParserWithWordBoundaryChecking{innerPattern(){return JD}innerExtract(e,t){let n={};if(n.year=parseInt(t[eE]),n.month=parseInt(t[tE]),n.day=parseInt(t[rE]),t[Ym]!=null)if(n.hour=parseInt(t[Ym]),n.minute=parseInt(t[nE]),t[Um]!=null&&(n.second=parseInt(t[Um])),t[Wm]!=null&&(n.millisecond=parseInt(t[Wm])),t[qm]==null)n.timezoneOffset=0;else{let s=parseInt(t[qm]),a=0;t[jm]!=null&&(a=parseInt(t[jm]));let o=s*60;o<0?o-=a:o+=a,n.timezoneOffset=o}return n}};kc.default=wc});var $m=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var sE=Bs(),Ec=class extends sE.MergingRefiner{mergeResults(e,t,n){let s=n.clone();return s.index=t.index,s.text=t.text+e+s.text,s.start.assign("weekday",t.start.get("weekday")),s.end&&s.end.assign("weekday",t.start.get("weekday")),s}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};Sc.default=Ec});var nn=O(Hs=>{"use strict";var os=Hs&&Hs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.includeCommonConfiguration=void 0;var iE=os(Cm()),aE=os(No()),Bm=os(Im()),oE=os(Fm()),uE=os(Lm()),lE=os(Dc()),cE=os($m());function dE(r,e=!1){return r.parsers.unshift(new lE.default),r.refiners.unshift(new cE.default),r.refiners.unshift(new iE.default),r.refiners.unshift(new aE.default),r.refiners.unshift(new Bm.default),r.refiners.push(new Bm.default),r.refiners.push(new oE.default),r.refiners.push(new uE.default(e)),r}Hs.includeCommonConfiguration=dE});var an=O(Ie=>{"use strict";var fE=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.noon=Ie.morning=Ie.midnight=Ie.yesterdayEvening=Ie.evening=Ie.lastNight=Ie.tonight=Ie.theDayAfter=Ie.tomorrow=Ie.theDayBefore=Ie.yesterday=Ie.today=Ie.now=void 0;var Wr=tt(),zs=fE(Pe()),sn=pr(),$i=ht();function hE(r){let e=zs.default(r.instant),t=new Wr.ParsingComponents(r,{});return sn.assignSimilarDate(t,e),sn.assignSimilarTime(t,e),r.timezoneOffset!==null&&t.assign("timezoneOffset",e.utcOffset()),t}Ie.now=hE;function pE(r){let e=zs.default(r.instant),t=new Wr.ParsingComponents(r,{});return sn.assignSimilarDate(t,e),sn.implySimilarTime(t,e),t}Ie.today=pE;function mE(r){return Gm(r,1)}Ie.yesterday=mE;function Gm(r,e){return Oc(r,-e)}Ie.theDayBefore=Gm;function yE(r){return Oc(r,1)}Ie.tomorrow=yE;function Oc(r,e){let t=zs.default(r.instant),n=new Wr.ParsingComponents(r,{});return t=t.add(e,"day"),sn.assignSimilarDate(n,t),sn.implySimilarTime(n,t),n}Ie.theDayAfter=Oc;function gE(r,e=22){let t=zs.default(r.instant),n=new Wr.ParsingComponents(r,{});return n.imply("hour",e),n.imply("meridiem",$i.Meridiem.PM),sn.assignSimilarDate(n,t),n}Ie.tonight=gE;function _E(r,e=0){let t=zs.default(r.instant),n=new Wr.ParsingComponents(r,{});return t.hour()<6&&(t=t.add(-1,"day")),sn.assignSimilarDate(n,t),n.imply("hour",e),n}Ie.lastNight=_E;function TE(r,e=20){let t=new Wr.ParsingComponents(r,{});return t.imply("meridiem",$i.Meridiem.PM),t.imply("hour",e),t}Ie.evening=TE;function bE(r,e=20){let t=zs.default(r.instant),n=new Wr.ParsingComponents(r,{});return t=t.add(-1,"day"),sn.assignSimilarDate(n,t),n.imply("hour",e),n.imply("meridiem",$i.Meridiem.PM),n}Ie.yesterdayEvening=bE;function vE(r){let e=new Wr.ParsingComponents(r,{});return e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e}Ie.midnight=vE;function wE(r,e=6){let t=new Wr.ParsingComponents(r,{});return t.imply("meridiem",$i.Meridiem.AM),t.imply("hour",e),t}Ie.morning=wE;function kE(r){let e=new Wr.ParsingComponents(r,{});return e.imply("meridiem",$i.Meridiem.AM),e.imply("hour",12),e}Ie.noon=kE});var Hm=O(Sr=>{"use strict";var DE=Sr&&Sr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EE=Sr&&Sr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SE=Sr&&Sr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&DE(e,r,t);return EE(e,r),e},OE=Sr&&Sr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sr,"__esModule",{value:!0});var ME=OE(Pe()),RE=Z(),PE=pr(),Bi=SE(an()),xE=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Mc=class extends RE.AbstractParserWithWordBoundaryChecking{innerPattern(e){return xE}innerExtract(e,t){let n=ME.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"now":return Bi.now(e.reference);case"today":return Bi.today(e.reference);case"yesterday":return Bi.yesterday(e.reference);case"tomorrow":case"tmr":case"tmrw":return Bi.tomorrow(e.reference);case"tonight":return Bi.tonight(e.reference);default:s.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),PE.assignSimilarDate(a,n),a.imply("hour",0));break}return a}};Sr.default=Mc});var zm=O(Gi=>{"use strict";var AE=Gi&&Gi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gi,"__esModule",{value:!0});var Co=ht(),NE=Z(),CE=AE(Pe()),IE=pr(),FE=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|noon)(?=\W|$)/i,Rc=class extends NE.AbstractParserWithWordBoundaryChecking{innerPattern(){return FE}innerExtract(e,t){let n=CE.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"afternoon":s.imply("meridiem",Co.Meridiem.PM),s.imply("hour",15);break;case"evening":case"night":s.imply("meridiem",Co.Meridiem.PM),s.imply("hour",20);break;case"midnight":IE.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"morning":s.imply("meridiem",Co.Meridiem.AM),s.imply("hour",6);break;case"noon":s.imply("meridiem",Co.Meridiem.AM),s.imply("hour",12);break}return s}};Gi.default=Rc});var us=O(Nn=>{"use strict";var LE=Nn&&Nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.toDayJSClosestWeekday=Nn.toDayJSWeekday=void 0;var Vm=LE(Pe());function YE(r,e,t){if(!t)return Km(r,e);let n=Vm.default(r);switch(t){case"this":n=n.day(e);break;case"next":n=n.day(e+7);break;case"last":n=n.day(e-7);break}return n}Nn.toDayJSWeekday=YE;function Km(r,e){let t=Vm.default(r),n=t.day();return Math.abs(e-7-n){"use strict";Object.defineProperty(xc,"__esModule",{value:!0});var Zm=Pt(),UE=Le(),WE=Z(),qE=us(),jE=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${UE.matchAnyPattern(Zm.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),$E=1,BE=2,GE=3,Pc=class extends WE.AbstractParserWithWordBoundaryChecking{innerPattern(){return jE}innerExtract(e,t){let n=t[BE].toLowerCase(),s=Zm.WEEKDAY_DICTIONARY[n],a=t[$E],o=t[GE],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="last"||l=="past"?c="last":l=="next"?c="next":l=="this"&&(c="this");let f=qE.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};xc.default=Pc});var ey=O(Hi=>{"use strict";var HE=Hi&&Hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hi,"__esModule",{value:!0});var Jm=Pt(),Qm=tt(),zE=HE(Pe()),VE=Z(),KE=Le(),ZE=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${KE.matchAnyPattern(Jm.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),XE=1,QE=2,Ac=class extends VE.AbstractParserWithWordBoundaryChecking{innerPattern(){return ZE}innerExtract(e,t){let n=t[XE].toLowerCase(),s=t[QE].toLowerCase(),a=Jm.TIME_UNIT_DICTIONARY[s];if(n=="next"||n.startsWith("after")){let c={};return c[a]=1,Qm.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="last"||n=="past"){let c={};return c[a]=-1,Qm.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=zE.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Hi.default=Ac});var Or=O(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.ParsingContext=Zs.Chrono=void 0;var Vs=tt(),JE=Nc(),Ks=class{constructor(e){e=e||JE.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new Ks({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let s=this.parse(e,t,n);return s.length>0?s[0].start.date():null}parse(e,t,n){let s=new Io(e,t,n),a=[];return this.parsers.forEach(o=>{let l=Ks.executeParser(s,o);a=a.concat(l)}),a.sort((o,l)=>o.index-l.index),this.refiners.forEach(function(o){a=o.refine(s,a)}),a}static executeParser(e,t){let n=[],s=t.pattern(e),a=e.text,o=e.text,l=s.exec(o);for(;l;){let c=l.index+a.length-o.length;l.index=c;let f=t.extract(e,l);if(!f){o=a.substring(l.index+1),l=s.exec(o);continue}let m=null;f instanceof Vs.ParsingResult?m=f:f instanceof Vs.ParsingComponents?(m=e.createParsingResult(l.index,l[0]),m.start=f):m=e.createParsingResult(l.index,l[0],f),e.debug(()=>console.log(`${t.constructor.name} extracted result ${m}`)),n.push(m),o=a.substring(c+m.text.length),l=s.exec(o)}return n}};Zs.Chrono=Ks;var Io=class{constructor(e,t,n){this.text=e,this.reference=new Vs.ReferenceWithTimezone(t),this.option=n!=null?n:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof Vs.ParsingComponents?e:new Vs.ParsingComponents(this.reference,e)}createParsingResult(e,t,n,s){let a=typeof t=="string"?t:this.text.substring(e,t),o=n?this.createParsingComponents(n):null,l=s?this.createParsingComponents(s):null;return new Vs.ParsingResult(this.reference,e,a,o,l)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};Zs.ParsingContext=Io});var ls=O(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});var ty=Rt(),eS=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Fo=1,ry=5,ny=2,sy=3,Cc=4,Ic=class{constructor(e){this.groupNumberMonth=e?sy:ny,this.groupNumberDay=e?ny:sy}pattern(){return eS}extract(e,t){if(t[Fo]=="/"||t[ry]=="/"){t.index+=t[0].length;return}let n=t.index+t[Fo].length,s=t[0].substr(t[Fo].length,t[0].length-t[Fo].length-t[ry].length);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!t[Cc]&&t[0].indexOf("/")<0)return;let a=e.createParsingResult(n,s),o=parseInt(t[this.groupNumberMonth]),l=parseInt(t[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),t[Cc]){let c=parseInt(t[Cc]),f=ty.findMostLikelyADYear(c);a.start.assign("year",f)}else{let c=ty.findYearClosestToRef(e.refDate,l,o);a.start.imply("year",c)}return a}};Fc.default=Ic});var ay=O(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var iy=Pt(),tS=tt(),rS=Z(),nS=mr(),sS=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${iy.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),Lc=class extends rS.AbstractParserWithWordBoundaryChecking{innerPattern(){return sS}innerExtract(e,t){let n=t[1].toLowerCase(),s=iy.parseTimeUnits(t[2]);switch(n){case"last":case"past":case"-":s=nS.reverseTimeUnits(s);break}return tS.ParsingComponents.createRelativeFromReference(e.reference,s)}};Yc.default=Lc});var uy=O(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var iS=Bs(),Uc=tt(),aS=Pt(),oS=mr();function oy(r){return r.text.match(/\s+(before|from)$/i)!=null}function uS(r){return r.text.match(/\s+(after|since)$/i)!=null}var Wc=class extends iS.MergingRefiner{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!oy(t)&&!uS(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let s=aS.parseTimeUnits(t.text);oy(t)&&(s=oS.reverseTimeUnits(s));let a=Uc.ParsingComponents.createRelativeFromReference(new Uc.ReferenceWithTimezone(n.start.date()),s);return new Uc.ParsingResult(n.reference,t.index,`${t.text}${e}${n.text}`,a)}};qc.default=Wc});var Nc=O(ot=>{"use strict";var _t=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.createConfiguration=ot.createCasualConfiguration=ot.parseDate=ot.parse=ot.GB=ot.strict=ot.casual=void 0;var lS=_t(om()),cS=_t(hm()),dS=_t(_m()),fS=_t(vm()),hS=_t(Dm()),pS=_t(Em()),mS=_t(Om()),yS=_t(Mm()),gS=_t(Rm()),_S=_t(Pm()),TS=_t(Nm()),bS=nn(),vS=_t(Hm()),wS=_t(zm()),kS=_t(Xm()),DS=_t(ey()),jc=Or(),ES=_t(ls()),SS=_t(ay()),OS=_t(uy());ot.casual=new jc.Chrono(ly(!1));ot.strict=new jc.Chrono(Lo(!0,!1));ot.GB=new jc.Chrono(Lo(!1,!0));function MS(r,e,t){return ot.casual.parse(r,e,t)}ot.parse=MS;function RS(r,e,t){return ot.casual.parseDate(r,e,t)}ot.parseDate=RS;function ly(r=!1){let e=Lo(!1,r);return e.parsers.unshift(new vS.default),e.parsers.unshift(new wS.default),e.parsers.unshift(new fS.default),e.parsers.unshift(new DS.default),e.parsers.unshift(new SS.default),e}ot.createCasualConfiguration=ly;function Lo(r=!0,e=!1){return bS.includeCommonConfiguration({parsers:[new ES.default(e),new lS.default,new cS.default,new dS.default,new kS.default,new hS.default,new pS.default,new mS.default(r),new yS.default(r),new gS.default(r)],refiners:[new OS.default,new TS.default,new _S.default]},r)}ot.createConfiguration=Lo});var cy=O(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});var PS=as(),$c=class extends PS.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};Bc.default=$c});var zi=O(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.parseTimeUnits=We.TIME_UNITS_PATTERN=We.parseYear=We.YEAR_PATTERN=We.parseNumberPattern=We.NUMBER_PATTERN=We.TIME_UNIT_DICTIONARY=We.INTEGER_WORD_DICTIONARY=We.MONTH_DICTIONARY=We.WEEKDAY_DICTIONARY=void 0;var Gc=Le(),xS=Rt();We.WEEKDAY_DICTIONARY={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6};We.MONTH_DICTIONARY={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12};We.INTEGER_WORD_DICTIONARY={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12};We.TIME_UNIT_DICTIONARY={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"};We.NUMBER_PATTERN=`(?:${Gc.matchAnyPattern(We.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s*an?)?|an?\\b(?:\\s*few)?|few|several|a?\\s*couple\\s*(?:of)?)`;function fy(r){let e=r.toLowerCase();return We.INTEGER_WORD_DICTIONARY[e]!==void 0?We.INTEGER_WORD_DICTIONARY[e]:e==="a"||e==="an"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}We.parseNumberPattern=fy;We.YEAR_PATTERN="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";function AS(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return xS.findMostLikelyADYear(e)}We.parseYear=AS;var hy=`(${We.NUMBER_PATTERN})\\s{0,5}(${Gc.matchAnyPattern(We.TIME_UNIT_DICTIONARY)})\\s{0,5}`,dy=new RegExp(hy,"i");We.TIME_UNITS_PATTERN=Gc.repeatedTimeunitPattern("",hy);function NS(r){let e={},t=r,n=dy.exec(t);for(;n;)CS(e,n),t=t.substring(n[0].length),n=dy.exec(t);return e}We.parseTimeUnits=NS;function CS(r,e){let t=fy(e[1]),n=We.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var my=O(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});var py=zi(),IS=Le(),FS=Z(),LS=us(),YS=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${IS.matchAnyPattern(py.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),US=1,WS=3,qS=2,Hc=class extends FS.AbstractParserWithWordBoundaryChecking{innerPattern(){return YS}innerExtract(e,t){let n=t[qS].toLowerCase(),s=py.WEEKDAY_DICTIONARY[n],a=t[US],o=t[WS],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l.match(/letzte/)?c="last":l.match(/chste/)?c="next":l.match(/diese/)&&(c="this");let f=LS.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};zc.default=Hc});var Ty=O(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var Cn=ht(),jS=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),$S=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),BS=2,yy=3,gy=4,_y=5,Xs=class{pattern(e){return jS}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=Xs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=$S.exec(s);return a&&(n.end=Xs.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[BS]),t[yy]!=null&&(s=parseInt(t[yy])),s>=60||n>24)return null;if(n>=12&&(a=Cn.Meridiem.PM),t[_y]!=null){if(n>12)return null;let o=t[_y].toLowerCase();o.match(/morgen|vormittag/)&&(a=Cn.Meridiem.AM,n==12&&(n=0)),o.match(/nachmittag|abend/)&&(a=Cn.Meridiem.PM,n!=12&&(n+=12)),o.match(/nacht/)&&(n==12?(a=Cn.Meridiem.AM,n=0):n<6?a=Cn.Meridiem.AM:(a=Cn.Meridiem.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",Cn.Meridiem.AM):e.imply("meridiem",Cn.Meridiem.PM),t[gy]!=null){let o=parseInt(t[gy]);if(o>=60)return null;e.assign("second",o)}return e}};Vc.default=Xs});var by=O(Vi=>{"use strict";var GS=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});var HS=GS(Ur()),Kc=class extends HS.default{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}};Vi.default=Kc});var vy=O(Ki=>{"use strict";var zS=Ki&&Ki.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ki,"__esModule",{value:!0});var VS=zS(rn()),Zc=class extends VS.default{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}};Ki.default=Zc});var Xc=O(Xi=>{"use strict";var KS=Xi&&Xi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xi,"__esModule",{value:!0});var ZS=KS(Pe()),cs=ht(),XS=Z(),QS=pr(),JS=mr(),Zi=class extends XS.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=ZS.default(e.refDate),s=t[2].toLowerCase(),a=e.createParsingComponents();return QS.implySimilarTime(a,n),Zi.extractTimeComponents(a,s)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.PM);break;case"mitternacht":e.get("hour")>1&&(e=JS.addImpliedTimeUnits(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",cs.Meridiem.AM);break}return e}};Xi.default=Zi});var Dy=O(Mr=>{"use strict";var eO=Mr&&Mr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tO=Mr&&Mr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),rO=Mr&&Mr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&eO(e,r,t);return tO(e,r),e},ky=Mr&&Mr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mr,"__esModule",{value:!0});var nO=ky(Pe()),sO=Z(),ds=pr(),iO=ky(Xc()),wy=rO(an()),aO=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),oO=1,uO=2,Qc=class extends sO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return aO}innerExtract(e,t){let n=nO.default(e.refDate),s=(t[oO]||"").toLowerCase(),a=(t[uO]||"").toLowerCase(),o=e.createParsingComponents();switch(s){case"jetzt":o=wy.now(e.reference);break;case"heute":o=wy.today(e.reference);break;case"morgen":ds.assignTheNextDay(o,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),ds.assignTheNextDay(o,n);break;case"gestern":n=n.add(-1,"day"),ds.assignSimilarDate(o,n),ds.implySimilarTime(o,n);break;case"vorgestern":n=n.add(-2,"day"),ds.assignSimilarDate(o,n),ds.implySimilarTime(o,n);break;default:s.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),ds.assignSimilarDate(o,n),o.imply("hour",0));break}return a&&(o=iO.default.extractTimeComponents(o,a)),o}};Mr.default=Qc});var Py=O(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var lO=Rt(),My=zi(),Ry=zi(),cO=Le(),dO=Z(),fO=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${cO.matchAnyPattern(My.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${Ry.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Ey=1,Sy=2,hO=3,Oy=4,Jc=class extends dO.AbstractParserWithWordBoundaryChecking{innerPattern(){return fO}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=My.MONTH_DICTIONARY[t[hO].toLowerCase()],a=parseInt(t[Ey]);if(a>31)return t.index=t.index+t[Ey].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Oy]){let o=Ry.parseYear(t[Oy]);n.start.assign("year",o)}else{let o=lO.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Sy]){let o=parseInt(t[Sy]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};ed.default=Jc});var xy=O(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var Yo=zi(),pO=tt(),mO=Z(),yO=mr(),gO=Le(),td=class extends mO.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${Yo.NUMBER_PATTERN})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${gO.matchAnyPattern(Yo.TIME_UNIT_DICTIONARY)})`,"i")}innerExtract(e,t){let n=t[2]?Yo.parseNumberPattern(t[2]):1,s=Yo.TIME_UNIT_DICTIONARY[t[4].toLowerCase()],a={};a[s]=n;let o=t[1]||t[3]||"";if(o=o.toLowerCase(),!!o)return(/vor/.test(o)||/letzte/.test(o)||/vergangen/.test(o))&&(a=yO.reverseTimeUnits(a)),pO.ParsingComponents.createRelativeFromReference(e.reference,a)}};rd.default=td});var Cy=O(Tt=>{"use strict";var Rr=Tt&&Tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.createConfiguration=Tt.createCasualConfiguration=Tt.parseDate=Tt.parse=Tt.strict=Tt.casual=void 0;var _O=nn(),Ay=Or(),TO=Rr(ls()),bO=Rr(Dc()),vO=Rr(cy()),wO=Rr(my()),kO=Rr(Ty()),DO=Rr(by()),EO=Rr(vy()),SO=Rr(Dy()),OO=Rr(Xc()),MO=Rr(Py()),RO=Rr(xy());Tt.casual=new Ay.Chrono(Ny());Tt.strict=new Ay.Chrono(nd(!0));function PO(r,e,t){return Tt.casual.parse(r,e,t)}Tt.parse=PO;function xO(r,e,t){return Tt.casual.parseDate(r,e,t)}Tt.parseDate=xO;function Ny(r=!0){let e=nd(!1,r);return e.parsers.unshift(new OO.default),e.parsers.unshift(new SO.default),e.parsers.unshift(new RO.default),e}Tt.createCasualConfiguration=Ny;function nd(r=!0,e=!0){return _O.includeCommonConfiguration({parsers:[new bO.default,new TO.default(e),new vO.default,new kO.default,new MO.default,new wO.default],refiners:[new DO.default,new EO.default]},r)}Tt.createConfiguration=nd});var Fy=O(Pr=>{"use strict";var AO=Pr&&Pr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),NO=Pr&&Pr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CO=Pr&&Pr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&AO(e,r,t);return NO(e,r),e},IO=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0});var FO=IO(Pe()),LO=ht(),YO=Z(),Iy=pr(),Uo=CO(an()),sd=class extends YO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=FO.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();switch(s){case"maintenant":return Uo.now(e.reference);case"aujourd'hui":return Uo.today(e.reference);case"hier":return Uo.yesterday(e.reference);case"demain":return Uo.tomorrow(e.reference);default:s.match(/cette\s*nuit/)?(Iy.assignSimilarDate(a,n),a.imply("hour",22),a.imply("meridiem",LO.Meridiem.PM)):s.match(/la\s*veille/)&&(n=n.add(-1,"day"),Iy.assignSimilarDate(a,n),a.imply("hour",0))}return a}};Pr.default=sd});var Ly=O(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Qi=ht(),UO=Z(),id=class extends UO.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),s=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":s.imply("hour",14),s.imply("minute",0),s.imply("meridiem",Qi.Meridiem.PM);break;case"soir":s.imply("hour",18),s.imply("minute",0),s.imply("meridiem",Qi.Meridiem.PM);break;case"matin":s.imply("hour",8),s.imply("minute",0),s.imply("meridiem",Qi.Meridiem.AM);break;case"a midi":s.imply("hour",12),s.imply("minute",0),s.imply("meridiem",Qi.Meridiem.AM);break;case"\xE0 minuit":s.imply("hour",0),s.imply("meridiem",Qi.Meridiem.AM);break}return s}};ad.default=id});var Yy=O(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});var WO=as(),od=class extends WO.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};ud.default=od});var Uy=O(Ji=>{"use strict";var qO=Ji&&Ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ji,"__esModule",{value:!0});var jO=qO(rn()),ld=class extends jO.default{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|vers|de|,|-)?\\s*$")}};Ji.default=ld});var Wy=O(ea=>{"use strict";var $O=ea&&ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ea,"__esModule",{value:!0});var BO=$O(Ur()),cd=class extends BO.default{patternBetween(){return/^\s*(à|a|-)\s*$/i}};ea.default=cd});var In=O(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.parseTimeUnits=xe.TIME_UNITS_PATTERN=xe.parseYear=xe.YEAR_PATTERN=xe.parseOrdinalNumberPattern=xe.ORDINAL_NUMBER_PATTERN=xe.parseNumberPattern=xe.NUMBER_PATTERN=xe.TIME_UNIT_DICTIONARY=xe.INTEGER_WORD_DICTIONARY=xe.MONTH_DICTIONARY=xe.WEEKDAY_DICTIONARY=void 0;var dd=Le();xe.WEEKDAY_DICTIONARY={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6};xe.MONTH_DICTIONARY={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12};xe.INTEGER_WORD_DICTIONARY={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13};xe.TIME_UNIT_DICTIONARY={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"};xe.NUMBER_PATTERN=`(?:${dd.matchAnyPattern(xe.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;function jy(r){let e=r.toLowerCase();return xe.INTEGER_WORD_DICTIONARY[e]!==void 0?xe.INTEGER_WORD_DICTIONARY[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}xe.parseNumberPattern=jy;xe.ORDINAL_NUMBER_PATTERN="(?:[0-9]{1,2}(?:er)?)";function GO(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}xe.parseOrdinalNumberPattern=GO;xe.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";function HO(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}xe.parseYear=HO;var $y=`(${xe.NUMBER_PATTERN})\\s{0,5}(${dd.matchAnyPattern(xe.TIME_UNIT_DICTIONARY)})\\s{0,5}`,qy=new RegExp($y,"i");xe.TIME_UNITS_PATTERN=dd.repeatedTimeunitPattern("",$y);function zO(r){let e={},t=r,n=qy.exec(t);for(;n;)VO(e,n),t=t.substring(n[0].length),n=qy.exec(t);return e}xe.parseTimeUnits=zO;function VO(r,e){let t=jy(e[1]),n=xe.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var Gy=O(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var By=In(),KO=Le(),ZO=Z(),XO=us(),QO=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${KO.matchAnyPattern(By.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),JO=1,eM=2,fd=class extends ZO.AbstractParserWithWordBoundaryChecking{innerPattern(){return QO}innerExtract(e,t){let n=t[JO].toLowerCase(),s=By.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[eM];a=a||"",a=a.toLowerCase();let o=null;a=="dernier"?o="last":a=="prochain"&&(o="next");let l=XO.toDayJSWeekday(e.refDate,s,o);return e.createParsingComponents().assign("weekday",s).imply("day",l.date()).imply("month",l.month()+1).imply("year",l.year())}};hd.default=fd});var Ky=O(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ta=ht(),tM=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),rM=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),nM=2,Hy=3,zy=4,Vy=5,Qs=class{pattern(e){return tM}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=Qs.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let s=e.text.substring(t.index+t[0].length),a=rM.exec(s);return a&&(n.end=Qs.extractTimeComponent(n.start.clone(),a),n.end&&(n.text+=a[0])),n}static extractTimeComponent(e,t){let n=0,s=0,a=null;if(n=parseInt(t[nM]),t[Hy]!=null&&(s=parseInt(t[Hy])),s>=60||n>24)return null;if(n>=12&&(a=ta.Meridiem.PM),t[Vy]!=null){if(n>12)return null;let o=t[Vy][0].toLowerCase();o=="a"&&(a=ta.Meridiem.AM,n==12&&(n=0)),o=="p"&&(a=ta.Meridiem.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",s),a!==null?e.assign("meridiem",a):n<12?e.imply("meridiem",ta.Meridiem.AM):e.imply("meridiem",ta.Meridiem.PM),t[zy]!=null){let o=parseInt(t[zy]);if(o>=60)return null;e.assign("second",o)}return e}};pd.default=Qs});var tg=O(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var sM=Rt(),Jy=In(),eg=In(),Wo=In(),iM=Le(),aM=Z(),oM=new RegExp(`(?:on\\s*?)?(${Wo.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${Wo.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:de)?\\s*)(${iM.matchAnyPattern(Jy.MONTH_DICTIONARY)})(?:(?:-|/|,?\\s*)(${eg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Zy=1,Xy=2,uM=3,Qy=4,md=class extends aM.AbstractParserWithWordBoundaryChecking{innerPattern(){return oM}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Jy.MONTH_DICTIONARY[t[uM].toLowerCase()],a=Wo.parseOrdinalNumberPattern(t[Zy]);if(a>31)return t.index=t.index+t[Zy].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Qy]){let o=eg.parseYear(t[Qy]);n.start.assign("year",o)}else{let o=sM.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Xy]){let o=Wo.parseOrdinalNumberPattern(t[Xy]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};yd.default=md});var ng=O(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var rg=In(),lM=tt(),cM=Z(),dM=mr(),gd=class extends cM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${rg.TIME_UNITS_PATTERN})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=rg.parseTimeUnits(t[1]),s=dM.reverseTimeUnits(n);return lM.ParsingComponents.createRelativeFromReference(e.reference,s)}};_d.default=gd});var ig=O(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var sg=In(),fM=tt(),hM=Z(),Td=class extends hM.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${sg.TIME_UNITS_PATTERN})(?=\\W|$)`,"i")}innerExtract(e,t){let n=sg.parseTimeUnits(t[1]);return fM.ParsingComponents.createRelativeFromReference(e.reference,n)}};bd.default=Td});var ag=O(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var qo=In(),pM=tt(),mM=Z(),yM=mr(),gM=Le(),vd=class extends mM.AbstractParserWithWordBoundaryChecking{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${qo.NUMBER_PATTERN})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${gM.matchAnyPattern(qo.TIME_UNIT_DICTIONARY)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?qo.parseNumberPattern(t[1]):1,s=qo.TIME_UNIT_DICTIONARY[t[3].toLowerCase()],a={};a[s]=n;let o=t[2]||t[4]||"";if(o=o.toLowerCase(),!!o)return(/derni[eè]re?s?/.test(o)||/pass[ée]e?s?/.test(o)||/pr[ée]c[ée]dents?/.test(o))&&(a=yM.reverseTimeUnits(a)),pM.ParsingComponents.createRelativeFromReference(e.reference,a)}};wd.default=vd});var lg=O(bt=>{"use strict";var yr=bt&&bt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bt,"__esModule",{value:!0});bt.createConfiguration=bt.createCasualConfiguration=bt.parseDate=bt.parse=bt.strict=bt.casual=void 0;var _M=nn(),og=Or(),TM=yr(Fy()),bM=yr(Ly()),vM=yr(ls()),wM=yr(Yy()),kM=yr(Uy()),DM=yr(Wy()),EM=yr(Gy()),SM=yr(Ky()),OM=yr(tg()),MM=yr(ng()),RM=yr(ig()),PM=yr(ag());bt.casual=new og.Chrono(ug());bt.strict=new og.Chrono(kd(!0));function xM(r,e,t){return bt.casual.parse(r,e,t)}bt.parse=xM;function AM(r,e,t){return bt.casual.parseDate(r,e,t)}bt.parseDate=AM;function ug(r=!0){let e=kd(!1,r);return e.parsers.unshift(new TM.default),e.parsers.unshift(new bM.default),e.parsers.unshift(new PM.default),e}bt.createCasualConfiguration=ug;function kd(r=!0,e=!0){return _M.includeCommonConfiguration({parsers:[new vM.default(e),new OM.default,new wM.default,new SM.default,new MM.default,new RM.default,new EM.default],refiners:[new kM.default,new DM.default]},r)}bt.createConfiguration=kd});var cg=O(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.toHankaku=void 0;function NM(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,CM)}jo.toHankaku=NM;function CM(r){return String.fromCharCode(r.charCodeAt(0)-65248)}});var fg=O(ra=>{"use strict";var IM=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0});var Dd=cg(),FM=Rt(),LM=IM(Pe()),YM=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,dg=1,UM=2,Ed=3,WM=4,qM=5,jM=6,Sd=class{pattern(){return YM}extract(e,t){let n=parseInt(Dd.toHankaku(t[qM])),s=parseInt(Dd.toHankaku(t[jM])),a=e.createParsingComponents({day:s,month:n});if(t[dg]&&t[dg].match("\u540C|\u4ECA|\u672C")){let o=LM.default(e.refDate);a.assign("year",o.year())}if(t[UM]){let o=t[WM],l=o=="\u5143"?1:parseInt(Dd.toHankaku(o));t[Ed]=="\u4EE4\u548C"?l+=2018:t[Ed]=="\u5E73\u6210"?l+=1988:t[Ed]=="\u662D\u548C"&&(l+=1925),a.assign("year",l)}else{let o=FM.findYearClosestToRef(e.refDate,s,n);a.imply("year",o)}return a}};ra.default=Sd});var hg=O(na=>{"use strict";var $M=na&&na.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(na,"__esModule",{value:!0});var BM=$M(Ur()),Od=class extends BM.default{patternBetween(){return/^\s*(から|ー|-)\s*$/i}};na.default=Od});var mg=O(xr=>{"use strict";var GM=xr&&xr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),HM=xr&&xr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zM=xr&&xr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&GM(e,r,t);return HM(e,r),e},VM=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});var KM=VM(Pe()),pg=ht(),Md=zM(an()),ZM=/今日|当日|昨日|明日|今夜|今夕|今晩|今朝/i,Rd=class{pattern(){return ZM}extract(e,t){let n=t[0],s=KM.default(e.refDate),a=e.createParsingComponents();switch(n){case"\u6628\u65E5":return Md.yesterday(e.reference);case"\u660E\u65E5":return Md.tomorrow(e.reference);case"\u4ECA\u65E5":case"\u5F53\u65E5":return Md.today(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(a.imply("hour",22),a.assign("meridiem",pg.Meridiem.PM)):n.match("\u4ECA\u671D")&&(a.imply("hour",6),a.assign("meridiem",pg.Meridiem.AM)),a.assign("day",s.date()),a.assign("month",s.month()+1),a.assign("year",s.year()),a}};xr.default=Rd});var _g=O(vt=>{"use strict";var Pd=vt&&vt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vt,"__esModule",{value:!0});vt.createConfiguration=vt.createCasualConfiguration=vt.parseDate=vt.parse=vt.strict=vt.casual=void 0;var XM=Pd(fg()),QM=Pd(hg()),JM=Pd(mg()),yg=Or();vt.casual=new yg.Chrono(gg());vt.strict=new yg.Chrono(xd());function eR(r,e,t){return vt.casual.parse(r,e,t)}vt.parse=eR;function tR(r,e,t){return vt.casual.parseDate(r,e,t)}vt.parseDate=tR;function gg(){let r=xd();return r.parsers.unshift(new JM.default),r}vt.createCasualConfiguration=gg;function xd(){return{parsers:[new XM.default],refiners:[new QM.default]}}vt.createConfiguration=xd});var $o=O(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.parseYear=qr.YEAR_PATTERN=qr.MONTH_DICTIONARY=qr.WEEKDAY_DICTIONARY=void 0;qr.WEEKDAY_DICTIONARY={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6};qr.MONTH_DICTIONARY={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12};qr.YEAR_PATTERN="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";function rR(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}qr.parseYear=rR});var bg=O(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var Tg=$o(),nR=Le(),sR=Z(),iR=us(),aR=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${nR.matchAnyPattern(Tg.WEEKDAY_DICTIONARY)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),oR=1,uR=2,lR=3,Ad=class extends sR.AbstractParserWithWordBoundaryChecking{innerPattern(){return aR}innerExtract(e,t){let n=t[uR].toLowerCase(),s=Tg.WEEKDAY_DICTIONARY[n];if(s===void 0)return null;let a=t[oR],o=t[lR],l=a||o||"";l=l.toLowerCase();let c=null;l=="passado"?c="this":l=="pr\xF3ximo"||l=="proximo"?c="next":l=="este"&&(c="this");let f=iR.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};Nd.default=Ad});var vg=O(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var cR=as(),Cd=class extends cR.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}};Id.default=Cd});var wg=O(sa=>{"use strict";var dR=sa&&sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sa,"__esModule",{value:!0});var fR=dR(rn()),Fd=class extends fR.default{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}};sa.default=Fd});var kg=O(ia=>{"use strict";var hR=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0});var pR=hR(Ur()),Ld=class extends pR.default{patternBetween(){return/^\s*(?:-)\s*$/i}};ia.default=Ld});var Rg=O(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var mR=Rt(),Og=$o(),Mg=$o(),yR=Le(),gR=Z(),_R=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${yR.matchAnyPattern(Og.MONTH_DICTIONARY)})(?:\\s*(?:de|,)?\\s*(${Mg.YEAR_PATTERN}))?(?=\\W|$)`,"i"),Dg=1,Eg=2,TR=3,Sg=4,Yd=class extends gR.AbstractParserWithWordBoundaryChecking{innerPattern(){return _R}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Og.MONTH_DICTIONARY[t[TR].toLowerCase()],a=parseInt(t[Dg]);if(a>31)return t.index=t.index+t[Dg].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[Sg]){let o=Mg.parseYear(t[Sg]);n.start.assign("year",o)}else{let o=mR.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[Eg]){let o=parseInt(t[Eg]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Ud.default=Yd});var Pg=O(on=>{"use strict";var bR=on&&on.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),vR=on&&on.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),wR=on&&on.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&bR(e,r,t);return vR(e,r),e};Object.defineProperty(on,"__esModule",{value:!0});var kR=Z(),Bo=wR(an()),Wd=class extends kR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"agora":return Bo.now(e.reference);case"hoje":return Bo.today(e.reference);case"amanha":case"amanh\xE3":return Bo.tomorrow(e.reference);case"ontem":return Bo.yesterday(e.reference)}return s}};on.default=Wd});var xg=O(aa=>{"use strict";var DR=aa&&aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(aa,"__esModule",{value:!0});var Go=ht(),ER=Z(),SR=pr(),OR=DR(Pe()),qd=class extends ER.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=OR.default(e.refDate),s=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":s.imply("meridiem",Go.Meridiem.PM),s.imply("hour",15);break;case"noite":s.imply("meridiem",Go.Meridiem.PM),s.imply("hour",22);break;case"manha":case"manh\xE3":s.imply("meridiem",Go.Meridiem.AM),s.imply("hour",6);break;case"meia-noite":SR.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"meio-dia":s.imply("meridiem",Go.Meridiem.AM),s.imply("hour",12);break}return s}};aa.default=qd});var Cg=O(wt=>{"use strict";var Fn=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0});wt.createConfiguration=wt.createCasualConfiguration=wt.parseDate=wt.parse=wt.strict=wt.casual=void 0;var MR=nn(),Ag=Or(),RR=Fn(ls()),PR=Fn(bg()),xR=Fn(vg()),AR=Fn(wg()),NR=Fn(kg()),CR=Fn(Rg()),IR=Fn(Pg()),FR=Fn(xg());wt.casual=new Ag.Chrono(Ng());wt.strict=new Ag.Chrono(jd(!0));function LR(r,e,t){return wt.casual.parse(r,e,t)}wt.parse=LR;function YR(r,e,t){return wt.casual.parseDate(r,e,t)}wt.parseDate=YR;function Ng(r=!0){let e=jd(!1,r);return e.parsers.push(new IR.default),e.parsers.push(new FR.default),e}wt.createCasualConfiguration=Ng;function jd(r=!0,e=!0){return MR.includeCommonConfiguration({parsers:[new RR.default(e),new PR.default,new xR.default,new CR.default],refiners:[new AR.default,new NR.default]},r)}wt.createConfiguration=jd});var Ig=O(oa=>{"use strict";var UR=oa&&oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oa,"__esModule",{value:!0});var WR=UR(Ur()),$d=class extends WR.default{patternBetween(){return/^\s*(tot|-)\s*$/i}};oa.default=$d});var Fg=O(ua=>{"use strict";var qR=ua&&ua.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ua,"__esModule",{value:!0});var jR=qR(rn()),Bd=class extends jR.default{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}};ua.default=Bd});var Lg=O(un=>{"use strict";var $R=un&&un.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),BR=un&&un.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),GR=un&&un.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$R(e,r,t);return BR(e,r),e};Object.defineProperty(un,"__esModule",{value:!0});var HR=Z(),Ho=GR(an()),Gd=class extends HR.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),s=e.createParsingComponents();switch(n){case"nu":return Ho.now(e.reference);case"vandaag":return Ho.today(e.reference);case"morgen":case"morgend":return Ho.tomorrow(e.reference);case"gisteren":return Ho.yesterday(e.reference)}return s}};un.default=Gd});var Yg=O(la=>{"use strict";var zR=la&&la.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(la,"__esModule",{value:!0});var zo=ht(),VR=Z(),KR=zR(Pe()),ZR=pr(),XR=1,QR=2,Hd=class extends VR.AbstractParserWithWordBoundaryChecking{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=KR.default(e.refDate),s=e.createParsingComponents();switch(t[XR]==="deze"&&(s.assign("day",e.refDate.getDate()),s.assign("month",e.refDate.getMonth()+1),s.assign("year",e.refDate.getFullYear())),t[QR].toLowerCase()){case"namiddag":case"'s namiddags":s.imply("meridiem",zo.Meridiem.PM),s.imply("hour",15);break;case"avond":case"'s avonds'":s.imply("meridiem",zo.Meridiem.PM),s.imply("hour",20);break;case"middernacht":ZR.assignTheNextDay(s,n),s.imply("hour",0),s.imply("minute",0),s.imply("second",0);break;case"ochtend":case"'s ochtends":s.imply("meridiem",zo.Meridiem.AM),s.imply("hour",6);break;case"middag":case"'s middags":s.imply("meridiem",zo.Meridiem.AM),s.imply("hour",12);break}return s}};la.default=Hd});var tr=O(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.parseTimeUnits=we.TIME_UNITS_PATTERN=we.parseYear=we.YEAR_PATTERN=we.parseOrdinalNumberPattern=we.ORDINAL_NUMBER_PATTERN=we.parseNumberPattern=we.NUMBER_PATTERN=we.TIME_UNIT_DICTIONARY=we.ORDINAL_WORD_DICTIONARY=we.INTEGER_WORD_DICTIONARY=we.MONTH_DICTIONARY=we.WEEKDAY_DICTIONARY=void 0;var Vo=Le(),JR=Rt();we.WEEKDAY_DICTIONARY={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6};we.MONTH_DICTIONARY={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12};we.INTEGER_WORD_DICTIONARY={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12};we.ORDINAL_WORD_DICTIONARY={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31};we.TIME_UNIT_DICTIONARY={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"};we.NUMBER_PATTERN=`(?:${Vo.matchAnyPattern(we.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;function Wg(r){let e=r.toLowerCase();return we.INTEGER_WORD_DICTIONARY[e]!==void 0?we.INTEGER_WORD_DICTIONARY[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}we.parseNumberPattern=Wg;we.ORDINAL_NUMBER_PATTERN=`(?:${Vo.matchAnyPattern(we.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:ste|de)?)`;function eP(r){let e=r.toLowerCase();return we.ORDINAL_WORD_DICTIONARY[e]!==void 0?we.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}we.parseOrdinalNumberPattern=eP;we.YEAR_PATTERN="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";function tP(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return JR.findMostLikelyADYear(e)}we.parseYear=tP;var qg=`(${we.NUMBER_PATTERN})\\s{0,5}(${Vo.matchAnyPattern(we.TIME_UNIT_DICTIONARY)})\\s{0,5}`,Ug=new RegExp(qg,"i");we.TIME_UNITS_PATTERN=Vo.repeatedTimeunitPattern("(?:(?:binnen|in)\\s*)?",qg);function rP(r){let e={},t=r,n=Ug.exec(t);for(;n;)nP(e,n),t=t.substring(n[0].length),n=Ug.exec(t);return e}we.parseTimeUnits=rP;function nP(r,e){let t=Wg(e[1]),n=we.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var $g=O(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var jg=tr(),sP=tt(),iP=Z(),zd=class extends iP.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+jg.TIME_UNITS_PATTERN+")(?=\\W|$)","i")}innerExtract(e,t){let n=jg.parseTimeUnits(t[1]);return sP.ParsingComponents.createRelativeFromReference(e.reference,n)}};Vd.default=zd});var Gg=O(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var Bg=tr(),aP=Le(),oP=Z(),uP=us(),lP=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${aP.matchAnyPattern(Bg.WEEKDAY_DICTIONARY)})(?=\\W|$)`,"i"),cP=1,dP=2,fP=3,Kd=class extends oP.AbstractParserWithWordBoundaryChecking{innerPattern(){return lP}innerExtract(e,t){let n=t[dP].toLowerCase(),s=Bg.WEEKDAY_DICTIONARY[n],a=t[cP],o=t[fP],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="vorige"?c="last":l=="volgende"?c="next":l=="deze"&&(c="this");let f=uP.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};Zd.default=Kd});var Xg=O(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});var hP=Rt(),Kg=tr(),Ko=tr(),Zg=tr(),pP=Le(),mP=Z(),yP=new RegExp(`(?:on\\s*?)?(${Ko.ORDINAL_NUMBER_PATTERN})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${Ko.ORDINAL_NUMBER_PATTERN}))?(?:-|/|\\s*(?:of)?\\s*)(`+pP.matchAnyPattern(Kg.MONTH_DICTIONARY)+`)(?:(?:-|/|,?\\s*)(${Zg.YEAR_PATTERN}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),gP=3,Hg=1,zg=2,Vg=4,Xd=class extends mP.AbstractParserWithWordBoundaryChecking{innerPattern(){return yP}innerExtract(e,t){let n=Kg.MONTH_DICTIONARY[t[gP].toLowerCase()],s=Ko.parseOrdinalNumberPattern(t[Hg]);if(s>31)return t.index=t.index+t[Hg].length,null;let a=e.createParsingComponents({day:s,month:n});if(t[Vg]){let c=Zg.parseYear(t[Vg]);a.assign("year",c)}else{let c=hP.findYearClosestToRef(e.refDate,s,n);a.imply("year",c)}if(!t[zg])return a;let o=Ko.parseOrdinalNumberPattern(t[zg]),l=e.createParsingResult(t.index,t[0]);return l.start=a,l.end=a.clone(),l.end.assign("day",o),l}};Qd.default=Xd});var t_=O(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var Jg=tr(),_P=Rt(),TP=Le(),e_=tr(),bP=Z(),vP=new RegExp(`(${TP.matchAnyPattern(Jg.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${e_.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),wP=1,Qg=2,Jd=class extends bP.AbstractParserWithWordBoundaryChecking{innerPattern(){return vP}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let s=t[wP],a=Jg.MONTH_DICTIONARY[s.toLowerCase()];if(n.assign("month",a),t[Qg]){let o=e_.parseYear(t[Qg]);n.assign("year",o)}else{let o=_P.findYearClosestToRef(e.refDate,1,a);n.imply("year",o)}return n}};ef.default=Jd});var r_=O(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var kP=Z(),DP=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),EP=1,SP=2,tf=class extends kP.AbstractParserWithWordBoundaryChecking{innerPattern(){return DP}innerExtract(e,t){let n=parseInt(t[SP]),s=parseInt(t[EP]);return e.createParsingComponents().imply("day",1).assign("month",s).assign("year",n)}};rf.default=tf});var n_=O(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});var OP=as(),nf=class extends OP.AbstractTimeExpressionParser{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}};sf.default=nf});var a_=O(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});var i_=tr(),MP=Le(),RP=Z(),PP=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${MP.matchAnyPattern(i_.MONTH_DICTIONARY)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),xP=1,AP=2,s_=3,NP=4,af=class extends RP.AbstractParserWithWordBoundaryChecking{innerPattern(){return PP}innerExtract(e,t){let n=t[s_]?parseInt(t[s_]):i_.MONTH_DICTIONARY[t[AP].toLowerCase()];if(n<1||n>12)return null;let s=parseInt(t[xP]);return{day:parseInt(t[NP]),month:n,year:s}}};of.default=af});var o_=O(ca=>{"use strict";var CP=ca&&ca.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ca,"__esModule",{value:!0});var IP=Z(),Zo=ht(),uf=pr(),FP=CP(Pe()),LP=1,YP=2,lf=class extends IP.AbstractParserWithWordBoundaryChecking{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[LP].toLowerCase(),s=t[YP].toLowerCase(),a=e.createParsingComponents(),o=FP.default(e.refDate);switch(n){case"gisteren":uf.assignSimilarDate(a,o.add(-1,"day"));break;case"van":uf.assignSimilarDate(a,o);break;case"morgen":uf.assignTheNextDay(a,o);break}switch(s){case"ochtend":a.imply("meridiem",Zo.Meridiem.AM),a.imply("hour",6);break;case"middag":a.imply("meridiem",Zo.Meridiem.AM),a.imply("hour",12);break;case"namiddag":a.imply("meridiem",Zo.Meridiem.PM),a.imply("hour",15);break;case"avond":a.imply("meridiem",Zo.Meridiem.PM),a.imply("hour",20);break}return a}};ca.default=lf});var l_=O(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});var u_=tr(),UP=tt(),WP=Z(),qP=mr(),jP=new RegExp(`(deze|vorige|afgelopen|komende|over|\\+|-)\\s*(${u_.TIME_UNITS_PATTERN})(?=\\W|$)`,"i"),cf=class extends WP.AbstractParserWithWordBoundaryChecking{innerPattern(){return jP}innerExtract(e,t){let n=t[1].toLowerCase(),s=u_.parseTimeUnits(t[2]);switch(n){case"vorige":case"afgelopen":case"-":s=qP.reverseTimeUnits(s);break}return UP.ParsingComponents.createRelativeFromReference(e.reference,s)}};df.default=cf});var f_=O(da=>{"use strict";var $P=da&&da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(da,"__esModule",{value:!0});var d_=tr(),c_=tt(),BP=$P(Pe()),GP=Z(),HP=Le(),zP=new RegExp(`(dit|deze|komende|volgend|volgende|afgelopen|vorige)\\s*(${HP.matchAnyPattern(d_.TIME_UNIT_DICTIONARY)})(?=\\s*)(?=\\W|$)`,"i"),VP=1,KP=2,ff=class extends GP.AbstractParserWithWordBoundaryChecking{innerPattern(){return zP}innerExtract(e,t){let n=t[VP].toLowerCase(),s=t[KP].toLowerCase(),a=d_.TIME_UNIT_DICTIONARY[s];if(n=="volgend"||n=="volgende"||n=="komende"){let c={};return c[a]=1,c_.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="afgelopen"||n=="vorige"){let c={};return c[a]=-1,c_.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=BP.default(e.reference.instant);return s.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):s.match(/maand/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):s.match(/jaar/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};da.default=ff});var h_=O(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});var pf=tr(),ZP=tt(),XP=Z(),QP=mr(),JP=new RegExp("("+pf.TIME_UNITS_PATTERN+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),ex=new RegExp("("+pf.TIME_UNITS_PATTERN+")geleden(?=(?:\\W|$))","i"),hf=class extends XP.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?ex:JP}innerExtract(e,t){let n=pf.parseTimeUnits(t[1]),s=QP.reverseTimeUnits(n);return ZP.ParsingComponents.createRelativeFromReference(e.reference,s)}};mf.default=hf});var p_=O(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var gf=tr(),tx=tt(),rx=Z(),nx=new RegExp("("+gf.TIME_UNITS_PATTERN+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),sx=new RegExp("("+gf.TIME_UNITS_PATTERN+")(later|vanaf nu)(?=(?:\\W|$))","i"),ix=1,yf=class extends rx.AbstractParserWithWordBoundaryChecking{constructor(e){super(),this.strictMode=e}innerPattern(){return this.strictMode?sx:nx}innerExtract(e,t){let n=gf.parseTimeUnits(t[ix]);return tx.ParsingComponents.createRelativeFromReference(e.reference,n)}};_f.default=yf});var __=O(kt=>{"use strict";var xt=kt&&kt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kt,"__esModule",{value:!0});kt.createConfiguration=kt.createCasualConfiguration=kt.parseDate=kt.parse=kt.strict=kt.casual=void 0;var ax=nn(),m_=Or(),ox=xt(Ig()),ux=xt(Fg()),lx=xt(Lg()),cx=xt(Yg()),dx=xt(ls()),fx=xt($g()),hx=xt(Gg()),px=xt(Xg()),y_=xt(t_()),mx=xt(r_()),yx=xt(n_()),gx=xt(a_()),_x=xt(o_()),Tx=xt(l_()),bx=xt(f_()),vx=xt(h_()),wx=xt(p_());kt.casual=new m_.Chrono(g_());kt.strict=new m_.Chrono(Tf(!0));function kx(r,e,t){return kt.casual.parse(r,e,t)}kt.parse=kx;function Dx(r,e,t){return kt.casual.parseDate(r,e,t)}kt.parseDate=Dx;function g_(r=!0){let e=Tf(!1,r);return e.parsers.unshift(new lx.default),e.parsers.unshift(new cx.default),e.parsers.unshift(new _x.default),e.parsers.unshift(new y_.default),e.parsers.unshift(new bx.default),e.parsers.unshift(new Tx.default),e}kt.createCasualConfiguration=g_;function Tf(r=!0,e=!0){return ax.includeCommonConfiguration({parsers:[new dx.default(e),new fx.default,new px.default,new y_.default,new hx.default,new gx.default,new mx.default,new yx.default(r),new vx.default(r),new wx.default(r)],refiners:[new ux.default,new ox.default]},r)}kt.createConfiguration=Tf});var w_=O(fa=>{"use strict";var Ex=fa&&fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fa,"__esModule",{value:!0});var Sx=Ex(Pe()),Ox=Z(),Mx=1,T_=2,Rx=3,b_=4,v_=5,Px=6,bf=class extends Ox.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=Sx.default(e.refDate),o=a;if(t[Mx])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[T_]){let l=t[T_],c=t[Rx];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day")),c=="\u65E9"||c=="\u671D"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[b_]){let c=t[b_][0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[v_]){let l=t[v_];l=="\u660E"||l=="\u807D"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u5F8C"?o=o.add(2,"day"):l=="\u5927\u5F8C"&&(o=o.add(3,"day"));let c=t[Px];if(c){let f=c[0];f=="\u65E9"||f=="\u671D"||f=="\u4E0A"?s.start.imply("hour",6):f=="\u4E0B"||f=="\u664F"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):f=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):f=="\u591C"||f=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):f=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};fa.default=bf});var Js=O(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.zhStringToYear=zt.zhStringToNumber=zt.WEEKDAY_OFFSET=zt.NUMBER=void 0;zt.NUMBER={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30};zt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function xx(r){let e=0;for(let t=0;t{"use strict";var Nx=ha&&ha.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ha,"__esModule",{value:!0});var Cx=Nx(Pe()),Ix=Z(),fs=Js(),vf=1,k_=2,wf=3,kf=class extends Ix.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(fs.NUMBER).join("")+"]{4}|["+Object.keys(fs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(fs.NUMBER).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(fs.NUMBER).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=Cx.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[k_]);if(isNaN(a)&&(a=fs.zhStringToNumber(t[k_])),s.start.assign("month",a),t[wf]){let o=parseInt(t[wf]);isNaN(o)&&(o=fs.zhStringToNumber(t[wf])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[vf]){let o=parseInt(t[vf]);isNaN(o)&&(o=fs.zhStringToYear(t[vf])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};ha.default=kf});var S_=O(pa=>{"use strict";var Fx=pa&&pa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pa,"__esModule",{value:!0});var Lx=Fx(Pe()),Yx=Z(),E_=Js(),Ux=new RegExp("(\\d+|["+Object.keys(E_.NUMBER).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),Df=1,Wx=2,Ef=class extends Yx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Ux}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Df]);if(isNaN(s)&&(s=E_.zhStringToNumber(t[Df])),isNaN(s)){let c=t[Df];if(c==="\u5E7E")s=3;else if(c==="\u534A")s=.5;else return null}let a=Lx.default(e.refDate),l=t[Wx][0];return l.match(/[日天星禮月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u79AE"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u9418")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};pa.default=Ef});var M_=O(ma=>{"use strict";var qx=ma&&ma.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ma,"__esModule",{value:!0});var jx=qx(Pe()),$x=Z(),O_=Js(),Bx=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(O_.WEEKDAY_OFFSET).join("|")+")"),Sf=class extends $x.AbstractParserWithWordBoundaryChecking{innerPattern(){return Bx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=O_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":(l=="\u4ECA"||l=="\u9019"||l=="\u5462")&&(o="this");let c=jx.default(e.refDate),f=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),f=!0):o=="next"?(c=c.day(a+7),f=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var Gx=ya&&ya.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ya,"__esModule",{value:!0});var Hx=Gx(Pe()),zx=Z(),_r=Js(),Vx=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(_r.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(_r.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(_r.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Kx=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(_r.NUMBER).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(_r.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(_r.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Xo=1,Qo=2,Jo=3,eu=4,tu=5,ru=6,gr=7,ei=8,nu=9,Of=class extends zx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Vx}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=Hx.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[Xo]){var o=t[Xo];o=="\u660E"||o=="\u807D"?n.hour()>1&&a.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?a.add(-1,"day"):o=="\u524D"?a.add(-2,"day"):o=="\u5927\u524D"?a.add(-3,"day"):o=="\u5F8C"?a.add(2,"day"):o=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[eu]){var l=t[eu];l=="\u660E"||l=="\u807D"?a.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?a.add(-1,"day"):l=="\u524D"?a.add(-2,"day"):l=="\u5927\u524D"?a.add(-3,"day"):l=="\u5F8C"?a.add(2,"day"):l=="\u5927\u5F8C"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let c=0,f=0,m=-1;if(t[ei]){var g=parseInt(t[ei]);if(isNaN(g)&&(g=_r.zhStringToNumber(t[ei])),g>=60)return null;s.start.assign("second",g)}if(c=parseInt(t[ru]),isNaN(c)&&(c=_r.zhStringToNumber(t[ru])),t[gr]?t[gr]=="\u534A"?f=30:t[gr]=="\u6B63"||t[gr]=="\u6574"?f=0:(f=parseInt(t[gr]),isNaN(f)&&(f=_r.zhStringToNumber(t[gr]))):c>100&&(f=c%100,c=Math.floor(c/100)),f>=60||c>24)return null;if(c>=12&&(m=1),t[nu]){if(c>12)return null;var T=t[nu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12))}else if(t[Qo]){var E=t[Qo],v=E[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[Jo]){var R=t[Jo],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(m=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[tu]){var q=t[tu],$=q[0];$=="\u4E0A"||$=="\u671D"||$=="\u65E9"||$=="\u51CC"?(m=0,c==12&&(c=0)):($=="\u4E0B"||$=="\u664F"||$=="\u665A")&&(m=1,c!=12&&(c+=12))}if(s.start.assign("hour",c),s.start.assign("minute",f),m>=0?s.start.assign("meridiem",m):c<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=Kx.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let B=a.clone();if(s.end=e.createParsingComponents(),t[Xo]){var o=t[Xo];o=="\u660E"||o=="\u807D"?n.hour()>1&&B.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?B.add(-1,"day"):o=="\u524D"?B.add(-2,"day"):o=="\u5927\u524D"?B.add(-3,"day"):o=="\u5F8C"?B.add(2,"day"):o=="\u5927\u5F8C"&&B.add(3,"day"),s.end.assign("day",B.date()),s.end.assign("month",B.month()+1),s.end.assign("year",B.year())}else if(t[eu]){var l=t[eu];l=="\u660E"||l=="\u807D"?B.add(1,"day"):l=="\u6628"||l=="\u5C0B"||l=="\u7434"?B.add(-1,"day"):l=="\u524D"?B.add(-2,"day"):l=="\u5927\u524D"?B.add(-3,"day"):l=="\u5F8C"?B.add(2,"day"):l=="\u5927\u5F8C"&&B.add(3,"day"),s.end.assign("day",B.date()),s.end.assign("month",B.month()+1),s.end.assign("year",B.year())}else s.end.imply("day",B.date()),s.end.imply("month",B.month()+1),s.end.imply("year",B.year());if(c=0,f=0,m=-1,t[ei]){var g=parseInt(t[ei]);if(isNaN(g)&&(g=_r.zhStringToNumber(t[ei])),g>=60)return null;s.end.assign("second",g)}if(c=parseInt(t[ru]),isNaN(c)&&(c=_r.zhStringToNumber(t[ru])),t[gr]?t[gr]=="\u534A"?f=30:t[gr]=="\u6B63"||t[gr]=="\u6574"?f=0:(f=parseInt(t[gr]),isNaN(f)&&(f=_r.zhStringToNumber(t[gr]))):c>100&&(f=c%100,c=Math.floor(c/100)),f>=60||c>24)return null;if(c>=12&&(m=1),t[nu]){if(c>12)return null;var T=t[nu][0].toLowerCase();T=="a"&&(m=0,c==12&&(c=0)),T=="p"&&(m=1,c!=12&&(c+=12)),s.start.isCertain("meridiem")||(m==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[Qo]){var E=t[Qo],v=E[0];v=="\u671D"||v=="\u65E9"?(m=0,c==12&&(c=0)):v=="\u665A"&&(m=1,c!=12&&(c+=12))}else if(t[Jo]){var R=t[Jo],C=R[0];C=="\u4E0A"||C=="\u671D"||C=="\u65E9"||C=="\u51CC"?(m=0,c==12&&(c=0)):(C=="\u4E0B"||C=="\u664F"||C=="\u665A")&&(m=1,c!=12&&(c+=12))}else if(t[tu]){var q=t[tu],$=q[0];$=="\u4E0A"||$=="\u671D"||$=="\u65E9"||$=="\u51CC"?(m=0,c==12&&(c=0)):($=="\u4E0B"||$=="\u664F"||$=="\u665A")&&(m=1,c!=12&&(c+=12))}return s.text=s.text+t[0],s.end.assign("hour",c),s.end.assign("minute",f),m>=0?s.end.assign("meridiem",m):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>c?s.end.imply("meridiem",0):c>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var Zx=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0});var Xx=Zx(Pe()),Qx=Z(),P_=Js(),Jx=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(P_.WEEKDAY_OFFSET).join("|")+")"),Mf=class extends Qx.AbstractParserWithWordBoundaryChecking{innerPattern(){return Jx}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=P_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=Xx.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var eA=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0});var tA=eA(Ur()),Rf=class extends tA.default{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}};_a.default=Rf});var N_=O(Ta=>{"use strict";var rA=Ta&&Ta.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ta,"__esModule",{value:!0});var nA=rA(rn()),Pf=class extends nA.default{patternBetween(){return/^\s*$/i}};Ta.default=Pf});var C_=O(ut=>{"use strict";var ln=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});ut.createConfiguration=ut.createCasualConfiguration=ut.parseDate=ut.parse=ut.strict=ut.casual=ut.hant=void 0;var xf=Or(),sA=ln(No()),iA=nn(),aA=ln(w_()),oA=ln(D_()),uA=ln(S_()),lA=ln(M_()),cA=ln(R_()),dA=ln(x_()),fA=ln(A_()),hA=ln(N_());ut.hant=new xf.Chrono(Af());ut.casual=new xf.Chrono(Af());ut.strict=new xf.Chrono(Nf());function pA(r,e,t){return ut.casual.parse(r,e,t)}ut.parse=pA;function mA(r,e,t){return ut.casual.parseDate(r,e,t)}ut.parseDate=mA;function Af(){let r=Nf();return r.parsers.unshift(new aA.default),r}ut.createCasualConfiguration=Af;function Nf(){let r=iA.includeCommonConfiguration({parsers:[new oA.default,new lA.default,new dA.default,new cA.default,new uA.default],refiners:[new fA.default,new hA.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof sA.default)),r}ut.createConfiguration=Nf});var Y_=O(ba=>{"use strict";var yA=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var gA=yA(Pe()),_A=Z(),TA=1,I_=2,bA=3,F_=4,L_=5,vA=6,Cf=class extends _A.AbstractParserWithWordBoundaryChecking{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,s=e.createParsingResult(n,t[0]),a=gA.default(e.refDate),o=a;if(t[TA])s.start.imply("hour",a.hour()),s.start.imply("minute",a.minute()),s.start.imply("second",a.second()),s.start.imply("millisecond",a.millisecond());else if(t[I_]){let l=t[I_],c=t[bA];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day")),c=="\u65E9"?s.start.imply("hour",6):c=="\u665A"&&(s.start.imply("hour",22),s.start.imply("meridiem",1))}else if(t[F_]){let c=t[F_][0];c=="\u65E9"||c=="\u4E0A"?s.start.imply("hour",6):c=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):c=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):c=="\u51CC"&&s.start.imply("hour",0)}else if(t[L_]){let l=t[L_];l=="\u660E"?a.hour()>1&&(o=o.add(1,"day")):l=="\u6628"?o=o.add(-1,"day"):l=="\u524D"?o=o.add(-2,"day"):l=="\u5927\u524D"?o=o.add(-3,"day"):l=="\u540E"?o=o.add(2,"day"):l=="\u5927\u540E"&&(o=o.add(3,"day"));let c=t[vA];if(c){let f=c[0];f=="\u65E9"||f=="\u4E0A"?s.start.imply("hour",6):f=="\u4E0B"?(s.start.imply("hour",15),s.start.imply("meridiem",1)):f=="\u4E2D"?(s.start.imply("hour",12),s.start.imply("meridiem",1)):f=="\u591C"||f=="\u665A"?(s.start.imply("hour",22),s.start.imply("meridiem",1)):f=="\u51CC"&&s.start.imply("hour",0)}}return s.start.assign("day",o.date()),s.start.assign("month",o.month()+1),s.start.assign("year",o.year()),s}};ba.default=Cf});var ti=O(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.zhStringToYear=Vt.zhStringToNumber=Vt.WEEKDAY_OFFSET=Vt.NUMBER=void 0;Vt.NUMBER={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10};Vt.WEEKDAY_OFFSET={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6};function wA(r){let e=0;for(let t=0;t{"use strict";var DA=va&&va.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(va,"__esModule",{value:!0});var EA=DA(Pe()),SA=Z(),hs=ti(),If=1,U_=2,Ff=3,Lf=class extends SA.AbstractParserWithWordBoundaryChecking{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(hs.NUMBER).join("")+"]{4}|["+Object.keys(hs.NUMBER).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(hs.NUMBER).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(hs.NUMBER).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=EA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=parseInt(t[U_]);if(isNaN(a)&&(a=hs.zhStringToNumber(t[U_])),s.start.assign("month",a),t[Ff]){let o=parseInt(t[Ff]);isNaN(o)&&(o=hs.zhStringToNumber(t[Ff])),s.start.assign("day",o)}else s.start.imply("day",n.date());if(t[If]){let o=parseInt(t[If]);isNaN(o)&&(o=hs.zhStringToYear(t[If])),s.start.assign("year",o)}else s.start.imply("year",n.year());return s}};va.default=Lf});var j_=O(wa=>{"use strict";var OA=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var MA=OA(Pe()),RA=Z(),q_=ti(),PA=new RegExp("(\\d+|["+Object.keys(q_.NUMBER).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),Yf=1,xA=2,Uf=class extends RA.AbstractParserWithWordBoundaryChecking{innerPattern(){return PA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=parseInt(t[Yf]);if(isNaN(s)&&(s=q_.zhStringToNumber(t[Yf])),isNaN(s)){let c=t[Yf];if(c==="\u51E0")s=3;else if(c==="\u534A")s=.5;else return null}let a=MA.default(e.refDate),l=t[xA][0];return l.match(/[日天星礼月年]/)?(l=="\u65E5"||l=="\u5929"?a=a.add(s,"d"):l=="\u661F"||l=="\u793C"?a=a.add(s*7,"d"):l=="\u6708"?a=a.add(s,"month"):l=="\u5E74"&&(a=a.add(s,"year")),n.start.assign("year",a.year()),n.start.assign("month",a.month()+1),n.start.assign("day",a.date()),n):(l=="\u79D2"?a=a.add(s,"second"):l=="\u5206"?a=a.add(s,"minute"):(l=="\u5C0F"||l=="\u949F")&&(a=a.add(s,"hour")),n.start.imply("year",a.year()),n.start.imply("month",a.month()+1),n.start.imply("day",a.date()),n.start.assign("hour",a.hour()),n.start.assign("minute",a.minute()),n.start.assign("second",a.second()),n)}};wa.default=Uf});var B_=O(ka=>{"use strict";var AA=ka&&ka.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ka,"__esModule",{value:!0});var NA=AA(Pe()),CA=Z(),$_=ti(),IA=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys($_.WEEKDAY_OFFSET).join("|")+")"),Wf=class extends CA.AbstractParserWithWordBoundaryChecking{innerPattern(){return IA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=$_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=null,l=t.groups.prefix;l=="\u4E0A"?o="last":l=="\u4E0B"?o="next":l=="\u8FD9"&&(o="this");let c=NA.default(e.refDate),f=!1,m=c.day();return o=="last"||o=="past"?(c=c.day(a-7),f=!0):o=="next"?(c=c.day(a+7),f=!0):o=="this"?c=c.day(a):Math.abs(a-7-m){"use strict";var FA=Da&&Da.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Da,"__esModule",{value:!0});var LA=FA(Pe()),YA=Z(),br=ti(),UA=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),WA=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(br.NUMBER).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),su=1,iu=2,au=3,ou=4,uu=5,lu=6,Tr=7,ri=8,cu=9,qf=class extends YA.AbstractParserWithWordBoundaryChecking{innerPattern(){return UA}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=LA.default(e.refDate),s=e.createParsingResult(t.index,t[0]),a=n.clone();if(t[su]){let m=t[su];m=="\u660E"?n.hour()>1&&a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else if(t[ou]){let m=t[ou];m=="\u660E"?a.add(1,"day"):m=="\u6628"?a.add(-1,"day"):m=="\u524D"?a.add(-2,"day"):m=="\u5927\u524D"?a.add(-3,"day"):m=="\u540E"?a.add(2,"day"):m=="\u5927\u540E"&&a.add(3,"day"),s.start.assign("day",a.date()),s.start.assign("month",a.month()+1),s.start.assign("year",a.year())}else s.start.imply("day",a.date()),s.start.imply("month",a.month()+1),s.start.imply("year",a.year());let o=0,l=0,c=-1;if(t[ri]){let m=parseInt(t[ri]);if(isNaN(m)&&(m=br.zhStringToNumber(t[ri])),m>=60)return null;s.start.assign("second",m)}if(o=parseInt(t[lu]),isNaN(o)&&(o=br.zhStringToNumber(t[lu])),t[Tr]?t[Tr]=="\u534A"?l=30:t[Tr]=="\u6B63"||t[Tr]=="\u6574"?l=0:(l=parseInt(t[Tr]),isNaN(l)&&(l=br.zhStringToNumber(t[Tr]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[cu]){if(o>12)return null;let m=t[cu][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12))}else if(t[iu]){let g=t[iu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[au]){let g=t[au][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[uu]){let g=t[uu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}if(s.start.assign("hour",o),s.start.assign("minute",l),c>=0?s.start.assign("meridiem",c):o<12?s.start.imply("meridiem",0):s.start.imply("meridiem",1),t=WA.exec(e.text.substring(s.index+s.text.length)),!t)return s.text.match(/^\d+$/)?null:s;let f=a.clone();if(s.end=e.createParsingComponents(),t[su]){let m=t[su];m=="\u660E"?n.hour()>1&&f.add(1,"day"):m=="\u6628"?f.add(-1,"day"):m=="\u524D"?f.add(-2,"day"):m=="\u5927\u524D"?f.add(-3,"day"):m=="\u540E"?f.add(2,"day"):m=="\u5927\u540E"&&f.add(3,"day"),s.end.assign("day",f.date()),s.end.assign("month",f.month()+1),s.end.assign("year",f.year())}else if(t[ou]){let m=t[ou];m=="\u660E"?f.add(1,"day"):m=="\u6628"?f.add(-1,"day"):m=="\u524D"?f.add(-2,"day"):m=="\u5927\u524D"?f.add(-3,"day"):m=="\u540E"?f.add(2,"day"):m=="\u5927\u540E"&&f.add(3,"day"),s.end.assign("day",f.date()),s.end.assign("month",f.month()+1),s.end.assign("year",f.year())}else s.end.imply("day",f.date()),s.end.imply("month",f.month()+1),s.end.imply("year",f.year());if(o=0,l=0,c=-1,t[ri]){let m=parseInt(t[ri]);if(isNaN(m)&&(m=br.zhStringToNumber(t[ri])),m>=60)return null;s.end.assign("second",m)}if(o=parseInt(t[lu]),isNaN(o)&&(o=br.zhStringToNumber(t[lu])),t[Tr]?t[Tr]=="\u534A"?l=30:t[Tr]=="\u6B63"||t[Tr]=="\u6574"?l=0:(l=parseInt(t[Tr]),isNaN(l)&&(l=br.zhStringToNumber(t[Tr]))):o>100&&(l=o%100,o=Math.floor(o/100)),l>=60||o>24)return null;if(o>=12&&(c=1),t[cu]){if(o>12)return null;let m=t[cu][0].toLowerCase();m=="a"&&(c=0,o==12&&(o=0)),m=="p"&&(c=1,o!=12&&(o+=12)),s.start.isCertain("meridiem")||(c==0?(s.start.imply("meridiem",0),s.start.get("hour")==12&&s.start.assign("hour",0)):(s.start.imply("meridiem",1),s.start.get("hour")!=12&&s.start.assign("hour",s.start.get("hour")+12)))}else if(t[iu]){let g=t[iu][0];g=="\u65E9"?(c=0,o==12&&(o=0)):g=="\u665A"&&(c=1,o!=12&&(o+=12))}else if(t[au]){let g=t[au][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}else if(t[uu]){let g=t[uu][0];g=="\u4E0A"||g=="\u65E9"||g=="\u51CC"?(c=0,o==12&&(o=0)):(g=="\u4E0B"||g=="\u665A")&&(c=1,o!=12&&(o+=12))}return s.text=s.text+t[0],s.end.assign("hour",o),s.end.assign("minute",l),c>=0?s.end.assign("meridiem",c):s.start.isCertain("meridiem")&&s.start.get("meridiem")==1&&s.start.get("hour")>o?s.end.imply("meridiem",0):o>12&&s.end.imply("meridiem",1),s.end.date().getTime(){"use strict";var qA=Ea&&Ea.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ea,"__esModule",{value:!0});var jA=qA(Pe()),$A=Z(),H_=ti(),BA=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(H_.WEEKDAY_OFFSET).join("|")+")"),jf=class extends $A.AbstractParserWithWordBoundaryChecking{innerPattern(){return BA}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=t.groups.weekday,a=H_.WEEKDAY_OFFSET[s];if(a===void 0)return null;let o=jA.default(e.refDate),l=!1,c=o.day();return Math.abs(a-7-c){"use strict";var GA=Sa&&Sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sa,"__esModule",{value:!0});var HA=GA(Ur()),$f=class extends HA.default{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}};Sa.default=$f});var K_=O(Oa=>{"use strict";var zA=Oa&&Oa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oa,"__esModule",{value:!0});var VA=zA(rn()),Bf=class extends VA.default{patternBetween(){return/^\s*$/i}};Oa.default=Bf});var Z_=O(lt=>{"use strict";var cn=lt&<.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lt,"__esModule",{value:!0});lt.createConfiguration=lt.createCasualConfiguration=lt.parseDate=lt.parse=lt.strict=lt.casual=lt.hans=void 0;var Gf=Or(),KA=cn(No()),ZA=nn(),XA=cn(Y_()),QA=cn(W_()),JA=cn(j_()),eN=cn(B_()),tN=cn(G_()),rN=cn(z_()),nN=cn(V_()),sN=cn(K_());lt.hans=new Gf.Chrono(Hf());lt.casual=new Gf.Chrono(Hf());lt.strict=new Gf.Chrono(zf());function iN(r,e,t){return lt.casual.parse(r,e,t)}lt.parse=iN;function aN(r,e,t){return lt.casual.parseDate(r,e,t)}lt.parseDate=aN;function Hf(){let r=zf();return r.parsers.unshift(new XA.default),r}lt.createCasualConfiguration=Hf;function zf(){let r=ZA.includeCommonConfiguration({parsers:[new QA.default,new eN.default,new rN.default,new tN.default,new JA.default],refiners:[new nN.default,new sN.default]});return r.refiners=r.refiners.filter(e=>!(e instanceof KA.default)),r}lt.createConfiguration=zf});var Q_=O(rr=>{"use strict";var X_=rr&&rr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),oN=rr&&rr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),uN=rr&&rr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&X_(e,r,t)},lN=rr&&rr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&X_(e,r,t);return oN(e,r),e};Object.defineProperty(rr,"__esModule",{value:!0});rr.hans=void 0;uN(C_(),rr);rr.hans=lN(Z_())});var Kt=O(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.parseTimeUnits=he.TIME_UNITS_PATTERN=he.parseYear=he.YEAR_PATTERN=he.parseOrdinalNumberPattern=he.ORDINAL_NUMBER_PATTERN=he.parseNumberPattern=he.NUMBER_PATTERN=he.TIME_UNIT_DICTIONARY=he.ORDINAL_WORD_DICTIONARY=he.INTEGER_WORD_DICTIONARY=he.MONTH_DICTIONARY=he.FULL_MONTH_NAME_DICTIONARY=he.WEEKDAY_DICTIONARY=he.REGEX_PARTS=void 0;var du=Le(),cN=Rt();he.REGEX_PARTS={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"};he.WEEKDAY_DICTIONARY={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6};he.FULL_MONTH_NAME_DICTIONARY={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u044F\u043B\u044C:2,\u0444\u0435\u0432\u0440\u044F\u043B\u044F:2,\u0444\u0435\u0432\u0440\u044F\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12};he.MONTH_DICTIONARY=Object.assign(Object.assign({},he.FULL_MONTH_NAME_DICTIONARY),{\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12});he.INTEGER_WORD_DICTIONARY={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u0435\u043C\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12};he.ORDINAL_WORD_DICTIONARY={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31};he.TIME_UNIT_DICTIONARY={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"};he.NUMBER_PATTERN=`(?:${du.matchAnyPattern(he.INTEGER_WORD_DICTIONARY)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;function eT(r){let e=r.toLowerCase();return he.INTEGER_WORD_DICTIONARY[e]!==void 0?he.INTEGER_WORD_DICTIONARY[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}he.parseNumberPattern=eT;he.ORDINAL_NUMBER_PATTERN=`(?:${du.matchAnyPattern(he.ORDINAL_WORD_DICTIONARY)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;function dN(r){let e=r.toLowerCase();return he.ORDINAL_WORD_DICTIONARY[e]!==void 0?he.ORDINAL_WORD_DICTIONARY[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}he.parseOrdinalNumberPattern=dN;var Vf="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?";he.YEAR_PATTERN=`(?:[1-9][0-9]{0,3}${Vf}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${Vf}|[5-9][0-9]${Vf})`;function fN(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return cN.findMostLikelyADYear(e)}he.parseYear=fN;var tT=`(${he.NUMBER_PATTERN})\\s{0,3}(${du.matchAnyPattern(he.TIME_UNIT_DICTIONARY)})`,J_=new RegExp(tT,"i");he.TIME_UNITS_PATTERN=du.repeatedTimeunitPattern("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",tT);function hN(r){let e={},t=r,n=J_.exec(t);for(;n;)pN(e,n),t=t.substring(n[0].length).trim(),n=J_.exec(t);return e}he.parseTimeUnits=hN;function pN(r,e){let t=eT(e[1]),n=he.TIME_UNIT_DICTIONARY[e[2].toLowerCase()];r[n]=t}});var nT=O(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var Ma=Kt(),mN=tt(),yN=Z(),rT=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${Ma.TIME_UNITS_PATTERN})${Ma.REGEX_PARTS.rightBoundary}`,gN=new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${rT}`,Ma.REGEX_PARTS.flags),_N=new RegExp(rT,"i"),Kf=class extends yN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ma.REGEX_PARTS.leftBoundary}innerPattern(e){return e.option.forwardDate?_N:gN}innerExtract(e,t){let n=Ma.parseTimeUnits(t[1]);return mN.ParsingComponents.createRelativeFromReference(e.reference,n)}};Zf.default=Kf});var uT=O(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var TN=Rt(),Ra=Kt(),oT=Kt(),fu=Kt(),bN=Le(),vN=Z(),wN=new RegExp(`(?:\u0441)?\\s*(${fu.ORDINAL_NUMBER_PATTERN})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${fu.ORDINAL_NUMBER_PATTERN}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${bN.matchAnyPattern(Ra.MONTH_DICTIONARY)})(?:(?:-|\\/|,?\\s{0,3})(${oT.YEAR_PATTERN}(?![^\\s]\\d)))?${Ra.REGEX_PARTS.rightBoundary}`,Ra.REGEX_PARTS.flags),sT=1,iT=2,kN=3,aT=4,Xf=class extends vN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ra.REGEX_PARTS.leftBoundary}innerPattern(){return wN}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),s=Ra.MONTH_DICTIONARY[t[kN].toLowerCase()],a=fu.parseOrdinalNumberPattern(t[sT]);if(a>31)return t.index=t.index+t[sT].length,null;if(n.start.assign("month",s),n.start.assign("day",a),t[aT]){let o=oT.parseYear(t[aT]);n.start.assign("year",o)}else{let o=TN.findYearClosestToRef(e.refDate,a,s);n.start.imply("year",o)}if(t[iT]){let o=fu.parseOrdinalNumberPattern(t[iT]);n.end=n.start.clone(),n.end.assign("day",o)}return n}};Qf.default=Xf});var dT=O(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var Pa=Kt(),DN=Rt(),EN=Le(),cT=Kt(),SN=Z(),ON=new RegExp(`((?:\u0432)\\s*)?(${EN.matchAnyPattern(Pa.MONTH_DICTIONARY)})\\s*(?:[,-]?\\s*(${cT.YEAR_PATTERN})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,Pa.REGEX_PARTS.flags),MN=2,lT=3,Jf=class extends SN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Pa.REGEX_PARTS.leftBoundary}innerPattern(){return ON}innerExtract(e,t){let n=t[MN].toLowerCase();if(t[0].length<=3&&!Pa.FULL_MONTH_NAME_DICTIONARY[n])return null;let s=e.createParsingResult(t.index,t.index+t[0].length);s.start.imply("day",1);let a=Pa.MONTH_DICTIONARY[n];if(s.start.assign("month",a),t[lT]){let o=cT.parseYear(t[lT]);s.start.assign("year",o)}else{let o=DN.findYearClosestToRef(e.refDate,1,a);s.start.imply("year",o)}return s}};eh.default=Jf});var hT=O(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var hu=ht(),RN=as(),fT=Kt(),th=class extends RN.AbstractTimeExpressionParser{constructor(e){super(e)}patternFlags(){return fT.REGEX_PARTS.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${fT.REGEX_PARTS.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let s=n.get("hour");s>=6&&s<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",hu.Meridiem.PM)):s<6&&n.assign("meridiem",hu.Meridiem.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",hu.Meridiem.PM);let s=n.get("hour");s>=0&&s<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",hu.Meridiem.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}};rh.default=th});var pT=O(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var pu=Kt(),PN=tt(),xN=Z(),AN=mr(),NN=new RegExp(`(${pu.TIME_UNITS_PATTERN})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`,pu.REGEX_PARTS.flags),nh=class extends xN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return pu.REGEX_PARTS.leftBoundary}innerPattern(){return NN}innerExtract(e,t){let n=pu.parseTimeUnits(t[1]),s=AN.reverseTimeUnits(n);return PN.ParsingComponents.createRelativeFromReference(e.reference,s)}};sh.default=nh});var mT=O(xa=>{"use strict";var CN=xa&&xa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xa,"__esModule",{value:!0});var IN=CN(Ur()),ih=class extends IN.default{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}};xa.default=ih});var yT=O(Aa=>{"use strict";var FN=Aa&&Aa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Aa,"__esModule",{value:!0});var LN=FN(rn()),ah=class extends LN.default{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}};Aa.default=ah});var gT=O(dn=>{"use strict";var YN=dn&&dn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),UN=dn&&dn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),WN=dn&&dn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&YN(e,r,t);return UN(e,r),e};Object.defineProperty(dn,"__esModule",{value:!0});var qN=Z(),Na=WN(an()),oh=Kt(),jN=new RegExp(`(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)${oh.REGEX_PARTS.rightBoundary}`,oh.REGEX_PARTS.flags),uh=class extends qN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return oh.REGEX_PARTS.leftBoundary}innerPattern(e){return jN}innerExtract(e,t){let n=t[1].toLowerCase(),s=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return Na.today(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return Na.yesterday(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return Na.tomorrow(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Na.theDayAfter(e.reference,2);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Na.theDayBefore(e.reference,2)}return s}};dn.default=uh});var _T=O(Ar=>{"use strict";var $N=Ar&&Ar.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),BN=Ar&&Ar.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),GN=Ar&&Ar.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&$N(e,r,t);return BN(e,r),e},HN=Ar&&Ar.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ar,"__esModule",{value:!0});var zN=Z(),ps=GN(an()),VN=pr(),KN=HN(Pe()),lh=Kt(),ZN=new RegExp(`(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)${lh.REGEX_PARTS.rightBoundary}`,lh.REGEX_PARTS.flags),ch=class extends zN.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return lh.REGEX_PARTS.leftBoundary}innerPattern(){return ZN}innerExtract(e,t){let n=KN.default(e.refDate),s=t[0].toLowerCase(),a=e.createParsingComponents();if(s==="\u0441\u0435\u0439\u0447\u0430\u0441")return ps.now(e.reference);if(s==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||s==="\u0432\u0435\u0447\u0435\u0440\u0430")return ps.evening(e.reference);if(s.endsWith("\u0443\u0442\u0440\u043E\u043C")||s.endsWith("\u0443\u0442\u0440\u0430"))return ps.morning(e.reference);if(s.match(/в\s*полдень/))return ps.noon(e.reference);if(s.match(/прошлой\s*ночью/))return ps.lastNight(e.reference);if(s.match(/прошлым\s*вечером/))return ps.yesterdayEvening(e.reference);if(s.match(/следующей\s*ночью/)){let o=n.hour()<22?1:2;n=n.add(o,"day"),VN.assignSimilarDate(a,n),a.imply("hour",0)}return s.match(/в\s*полночь/)||s.endsWith("\u043D\u043E\u0447\u044C\u044E")?ps.midnight(e.reference):a}};Ar.default=ch});var TT=O(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});var Ca=Kt(),XN=Le(),QN=Z(),JN=us(),eC=new RegExp(`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${XN.matchAnyPattern(Ca.WEEKDAY_DICTIONARY)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?${Ca.REGEX_PARTS.rightBoundary}`,Ca.REGEX_PARTS.flags),tC=1,rC=2,nC=3,dh=class extends QN.AbstractParserWithWordBoundaryChecking{innerPattern(){return eC}patternLeftBoundary(){return Ca.REGEX_PARTS.leftBoundary}innerExtract(e,t){let n=t[rC].toLowerCase(),s=Ca.WEEKDAY_DICTIONARY[n],a=t[tC],o=t[nC],l=a||o;l=l||"",l=l.toLowerCase();let c=null;l=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||l=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||l=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?c="last":l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||l=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?c="next":(l=="\u044D\u0442\u043E\u0442"||l=="\u044D\u0442\u0443"||l=="\u044D\u0442\u043E\u0439")&&(c="this");let f=JN.toDayJSWeekday(e.refDate,s,c);return e.createParsingComponents().assign("weekday",s).imply("day",f.date()).imply("month",f.month()+1).imply("year",f.year())}};fh.default=dh});var vT=O(Fa=>{"use strict";var sC=Fa&&Fa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fa,"__esModule",{value:!0});var Ia=Kt(),bT=tt(),iC=sC(Pe()),aC=Z(),oC=Le(),uC=new RegExp(`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${oC.matchAnyPattern(Ia.TIME_UNIT_DICTIONARY)})(?=\\s*)${Ia.REGEX_PARTS.rightBoundary}`,Ia.REGEX_PARTS.flags),lC=1,cC=2,hh=class extends aC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return Ia.REGEX_PARTS.leftBoundary}innerPattern(){return uC}innerExtract(e,t){let n=t[lC].toLowerCase(),s=t[cC].toLowerCase(),a=Ia.TIME_UNIT_DICTIONARY[s];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let c={};return c[a]=1,bT.ParsingComponents.createRelativeFromReference(e.reference,c)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let c={};return c[a]=-1,bT.ParsingComponents.createRelativeFromReference(e.reference,c)}let o=e.createParsingComponents(),l=iC.default(e.reference.instant);return a.match(/week/i)?(l=l.add(-l.get("d"),"d"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.imply("year",l.year())):a.match(/month/i)?(l=l.add(-l.date()+1,"d"),o.imply("day",l.date()),o.assign("year",l.year()),o.assign("month",l.month()+1)):a.match(/year/i)&&(l=l.add(-l.date()+1,"d"),l=l.add(-l.month(),"month"),o.imply("day",l.date()),o.imply("month",l.month()+1),o.assign("year",l.year())),o}};Fa.default=hh});var wT=O(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var La=Kt(),dC=tt(),fC=Z(),hC=mr(),pC=new RegExp(`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${La.TIME_UNITS_PATTERN})${La.REGEX_PARTS.rightBoundary}`,La.REGEX_PARTS.flags),ph=class extends fC.AbstractParserWithWordBoundaryChecking{patternLeftBoundary(){return La.REGEX_PARTS.leftBoundary}innerPattern(){return pC}innerExtract(e,t){let n=t[1].toLowerCase(),s=La.parseTimeUnits(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":s=hC.reverseTimeUnits(s);break}return dC.ParsingComponents.createRelativeFromReference(e.reference,s)}};mh.default=ph});var ET=O(Dt=>{"use strict";var nr=Dt&&Dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.createConfiguration=Dt.createCasualConfiguration=Dt.parseDate=Dt.parse=Dt.strict=Dt.casual=void 0;var mC=nr(nT()),yC=nr(uT()),gC=nr(dT()),_C=nr(hT()),TC=nr(pT()),bC=nr(mT()),vC=nr(yT()),wC=nn(),kC=nr(gT()),DC=nr(_T()),EC=nr(TT()),SC=nr(vT()),kT=Or(),OC=nr(ls()),MC=nr(wT());Dt.casual=new kT.Chrono(DT());Dt.strict=new kT.Chrono(yh(!0));function RC(r,e,t){return Dt.casual.parse(r,e,t)}Dt.parse=RC;function PC(r,e,t){return Dt.casual.parseDate(r,e,t)}Dt.parseDate=PC;function DT(){let r=yh(!1);return r.parsers.unshift(new kC.default),r.parsers.unshift(new DC.default),r.parsers.unshift(new gC.default),r.parsers.unshift(new SC.default),r.parsers.unshift(new MC.default),r}Dt.createCasualConfiguration=DT;function yh(r=!0){return wC.includeCommonConfiguration({parsers:[new OC.default(!0),new mC.default,new yC.default,new EC.default,new _C.default(r),new TC.default],refiners:[new vC.default,new bC.default]},r)}Dt.createConfiguration=yh});var ht=O(Te=>{"use strict";var xC=Te&&Te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),AC=Te&&Te.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ln=Te&&Te.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&xC(e,r,t);return AC(e,r),e};Object.defineProperty(Te,"__esModule",{value:!0});Te.parseDate=Te.parse=Te.casual=Te.strict=Te.ru=Te.zh=Te.nl=Te.pt=Te.ja=Te.fr=Te.de=Te.Meridiem=Te.Chrono=Te.en=void 0;var gh=Ln(Nc());Te.en=gh;var NC=Or();Object.defineProperty(Te,"Chrono",{enumerable:!0,get:function(){return NC.Chrono}});var CC;(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(CC=Te.Meridiem||(Te.Meridiem={}));var IC=Ln(Cy());Te.de=IC;var FC=Ln(lg());Te.fr=FC;var LC=Ln(_g());Te.ja=LC;var YC=Ln(Cg());Te.pt=YC;var UC=Ln(__());Te.nl=UC;var WC=Ln(Q_());Te.zh=WC;var qC=Ln(ET());Te.ru=qC;Te.strict=gh.strict;Te.casual=gh.casual;function jC(r,e,t){return Te.casual.parse(r,e,t)}Te.parse=jC;function $C(r,e,t){return Te.casual.parseDate(r,e,t)}Te.parseDate=$C});var Th=O((_h,ni)=>{(function(r,e){typeof _h=="object"&&typeof ni!="undefined"?ni.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(_h,function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function s(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,u){return Object.prototype.hasOwnProperty.call(i,u)}function o(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var u;for(u in i)if(a(i,u))return!1;return!0}function l(i){return i===void 0}function c(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function f(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function m(i,u){var d=[],h,p=i.length;for(h=0;h>>0,h;for(h=0;h0)for(d=0;d=0;return(b?d?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+h}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,k=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,S={},M={};function D(i,u,d,h){var p=h;typeof h=="string"&&(p=function(){return this[h]()}),i&&(M[i]=p),u&&(M[u[0]]=function(){return _(p.apply(this,arguments),u[1],u[2])}),d&&(M[d]=function(){return this.localeData().ordinal(p.apply(this,arguments),i)})}function I(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function A(i){var u=i.match(w),d,h;for(d=0,h=u.length;d=0&&k.test(i);)i=i.replace(k,h),k.lastIndex=0,d-=1;return i}var De={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ye(i){var u=this._longDateFormat[i],d=this._longDateFormat[i.toUpperCase()];return u||!d?u:(this._longDateFormat[i]=d.match(w).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[i])}var ce="Invalid date";function Fe(){return this._invalidDate}var K="%d",qe=/\d{1,2}/;function Je(i){return this._ordinal.replace("%d",i)}var Ze={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Dr(i,u,d,h){var p=this._relativeTime[d];return V(p)?p(i,u,d,h):p.replace(/%d/i,i)}function Ot(i,u){var d=this._relativeTime[i>0?"future":"past"];return V(d)?d(u):d.replace(/%s/i,u)}var Ae={};function nt(i,u){var d=i.toLowerCase();Ae[d]=Ae[d+"s"]=Ae[u]=i}function yt(i){return typeof i=="string"?Ae[i]||Ae[i.toLowerCase()]:void 0}function kn(i){var u={},d,h;for(h in i)a(i,h)&&(d=yt(h),d&&(u[d]=i[h]));return u}var Ri={};function je(i,u){Ri[i]=u}function Ns(i){var u=[],d;for(d in i)a(i,d)&&u.push({unit:d,priority:Ri[d]});return u.sort(function(h,p){return h.priority-p.priority}),u}function Kn(i){return i%4===0&&i%100!==0||i%400===0}function dt(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function de(i){var u=+i,d=0;return u!==0&&isFinite(u)&&(d=dt(u)),d}function zr(i,u){return function(d){return d!=null?(Zn(this,i,d),e.updateOffset(this,u),this):Mt(this,i)}}function Mt(i,u){return i.isValid()?i._d["get"+(i._isUTC?"UTC":"")+u]():NaN}function Zn(i,u,d){i.isValid()&&!isNaN(d)&&(u==="FullYear"&&Kn(i.year())&&i.month()===1&&i.date()===29?(d=de(d),i._d["set"+(i._isUTC?"UTC":"")+u](d,i.month(),co(d,i.month()))):i._d["set"+(i._isUTC?"UTC":"")+u](d))}function ao(i){return i=yt(i),V(this[i])?this[i]():this}function Fr(i,u){if(typeof i=="object"){i=kn(i);var d=Ns(i),h,p=d.length;for(h=0;h68?1900:2e3)};var mp=zr("FullYear",!0);function Jv(){return Kn(this.year())}function ew(i,u,d,h,p,b,P){var re;return i<100&&i>=0?(re=new Date(i+400,u,d,h,p,b,P),isFinite(re.getFullYear())&&re.setFullYear(i)):re=new Date(i,u,d,h,p,b,P),re}function Ai(i){var u,d;return i<100&&i>=0?(d=Array.prototype.slice.call(arguments),d[0]=i+400,u=new Date(Date.UTC.apply(null,d)),isFinite(u.getUTCFullYear())&&u.setUTCFullYear(i)):u=new Date(Date.UTC.apply(null,arguments)),u}function fo(i,u,d){var h=7+u-d,p=(7+Ai(i,0,h).getUTCDay()-u)%7;return-p+h-1}function yp(i,u,d,h,p){var b=(7+d-h)%7,P=fo(i,h,p),re=1+7*(u-1)+b+P,ge,Ue;return re<=0?(ge=i-1,Ue=xi(ge)+re):re>xi(i)?(ge=i+1,Ue=re-xi(i)):(ge=i,Ue=re),{year:ge,dayOfYear:Ue}}function Ni(i,u,d){var h=fo(i.year(),u,d),p=Math.floor((i.dayOfYear()-h-1)/7)+1,b,P;return p<1?(P=i.year()-1,b=p+Zr(P,u,d)):p>Zr(i.year(),u,d)?(b=p-Zr(i.year(),u,d),P=i.year()+1):(P=i.year(),b=p),{week:b,year:P}}function Zr(i,u,d){var h=fo(i,u,d),p=fo(i+1,u,d);return(xi(i)-h+p)/7}D("w",["ww",2],"wo","week"),D("W",["WW",2],"Wo","isoWeek"),nt("week","w"),nt("isoWeek","W"),je("week",5),je("isoWeek",5),H("w",Ye),H("ww",Ye,gt),H("W",Ye),H("WW",Ye,gt),hr(["w","ww","W","WW"],function(i,u,d,h){u[h.substr(0,1)]=de(i)});function tw(i){return Ni(i,this._week.dow,this._week.doy).week}var rw={dow:0,doy:6};function nw(){return this._week.dow}function sw(){return this._week.doy}function iw(i){var u=this.localeData().week(this);return i==null?u:this.add((i-u)*7,"d")}function aw(i){var u=Ni(this,1,4).week;return i==null?u:this.add((i-u)*7,"d")}D("d",0,"do","day"),D("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),D("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),D("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),D("e",0,0,"weekday"),D("E",0,0,"isoWeekday"),nt("day","d"),nt("weekday","e"),nt("isoWeekday","E"),je("day",11),je("weekday",11),je("isoWeekday",11),H("d",Ye),H("e",Ye),H("E",Ye),H("dd",function(i,u){return u.weekdaysMinRegex(i)}),H("ddd",function(i,u){return u.weekdaysShortRegex(i)}),H("dddd",function(i,u){return u.weekdaysRegex(i)}),hr(["dd","ddd","dddd"],function(i,u,d,h){var p=d._locale.weekdaysParse(i,h,d._strict);p!=null?u.d=p:v(d).invalidWeekday=i}),hr(["d","e","E"],function(i,u,d,h){u[h]=de(i)});function ow(i,u){return typeof i!="string"?i:isNaN(i)?(i=u.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function uw(i,u){return typeof i=="string"?u.weekdaysParse(i)%7||7:isNaN(i)?null:i}function cl(i,u){return i.slice(u,7).concat(i.slice(0,u))}var lw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),cw="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),dw=dr,fw=dr,hw=dr;function pw(i,u){var d=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(u)?"format":"standalone"];return i===!0?cl(d,this._week.dow):i?d[i.day()]:d}function mw(i){return i===!0?cl(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function yw(i){return i===!0?cl(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function gw(i,u,d){var h,p,b,P=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)b=T([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(b,"").toLocaleLowerCase();return d?u==="dddd"?(p=st.call(this._weekdaysParse,P),p!==-1?p:null):u==="ddd"?(p=st.call(this._shortWeekdaysParse,P),p!==-1?p:null):(p=st.call(this._minWeekdaysParse,P),p!==-1?p:null):u==="dddd"?(p=st.call(this._weekdaysParse,P),p!==-1||(p=st.call(this._shortWeekdaysParse,P),p!==-1)?p:(p=st.call(this._minWeekdaysParse,P),p!==-1?p:null)):u==="ddd"?(p=st.call(this._shortWeekdaysParse,P),p!==-1||(p=st.call(this._weekdaysParse,P),p!==-1)?p:(p=st.call(this._minWeekdaysParse,P),p!==-1?p:null)):(p=st.call(this._minWeekdaysParse,P),p!==-1||(p=st.call(this._weekdaysParse,P),p!==-1)?p:(p=st.call(this._shortWeekdaysParse,P),p!==-1?p:null))}function _w(i,u,d){var h,p,b;if(this._weekdaysParseExact)return gw.call(this,i,u,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(p=T([2e3,1]).day(h),d&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[h]||(b="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[h]=new RegExp(b.replace(".",""),"i")),d&&u==="dddd"&&this._fullWeekdaysParse[h].test(i))return h;if(d&&u==="ddd"&&this._shortWeekdaysParse[h].test(i))return h;if(d&&u==="dd"&&this._minWeekdaysParse[h].test(i))return h;if(!d&&this._weekdaysParse[h].test(i))return h}}function Tw(i){if(!this.isValid())return i!=null?this:NaN;var u=this._isUTC?this._d.getUTCDay():this._d.getDay();return i!=null?(i=ow(i,this.localeData()),this.add(i-u,"d")):u}function bw(i){if(!this.isValid())return i!=null?this:NaN;var u=(this.day()+7-this.localeData()._week.dow)%7;return i==null?u:this.add(i-u,"d")}function vw(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var u=uw(i,this.localeData());return this.day(this.day()%7?u:u-7)}else return this.day()||7}function ww(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||dl.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=dw),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function kw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||dl.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=fw),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Dw(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||dl.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=hw),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function dl(){function i(jt,tn){return tn.length-jt.length}var u=[],d=[],h=[],p=[],b,P,re,ge,Ue;for(b=0;b<7;b++)P=T([2e3,1]).day(b),re=ft(this.weekdaysMin(P,"")),ge=ft(this.weekdaysShort(P,"")),Ue=ft(this.weekdays(P,"")),u.push(re),d.push(ge),h.push(Ue),p.push(re),p.push(ge),p.push(Ue);u.sort(i),d.sort(i),h.sort(i),p.sort(i),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+u.join("|")+")","i")}function fl(){return this.hours()%12||12}function Ew(){return this.hours()||24}D("H",["HH",2],0,"hour"),D("h",["hh",2],0,fl),D("k",["kk",2],0,Ew),D("hmm",0,0,function(){return""+fl.apply(this)+_(this.minutes(),2)}),D("hmmss",0,0,function(){return""+fl.apply(this)+_(this.minutes(),2)+_(this.seconds(),2)}),D("Hmm",0,0,function(){return""+this.hours()+_(this.minutes(),2)}),D("Hmmss",0,0,function(){return""+this.hours()+_(this.minutes(),2)+_(this.seconds(),2)});function _p(i,u){D(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),u)})}_p("a",!0),_p("A",!1),nt("hour","h"),je("hour",13);function Tp(i,u){return u._meridiemParse}H("a",Tp),H("A",Tp),H("H",Ye),H("h",Ye),H("k",Ye),H("HH",Ye,gt),H("hh",Ye,gt),H("kk",Ye,gt),H("hmm",En),H("hmmss",Cs),H("Hmm",En),H("Hmmss",Cs),Ne(["H","HH"],ne),Ne(["k","kk"],function(i,u,d){var h=de(i);u[ne]=h===24?0:h}),Ne(["a","A"],function(i,u,d){d._isPm=d._locale.isPM(i),d._meridiem=i}),Ne(["h","hh"],function(i,u,d){u[ne]=de(i),v(d).bigHour=!0}),Ne("hmm",function(i,u,d){var h=i.length-2;u[ne]=de(i.substr(0,h)),u[le]=de(i.substr(h)),v(d).bigHour=!0}),Ne("hmmss",function(i,u,d){var h=i.length-4,p=i.length-2;u[ne]=de(i.substr(0,h)),u[le]=de(i.substr(h,2)),u[qt]=de(i.substr(p)),v(d).bigHour=!0}),Ne("Hmm",function(i,u,d){var h=i.length-2;u[ne]=de(i.substr(0,h)),u[le]=de(i.substr(h))}),Ne("Hmmss",function(i,u,d){var h=i.length-4,p=i.length-2;u[ne]=de(i.substr(0,h)),u[le]=de(i.substr(h,2)),u[qt]=de(i.substr(p))});function Sw(i){return(i+"").toLowerCase().charAt(0)==="p"}var Ow=/[ap]\.?m?\.?/i,Mw=zr("Hours",!0);function Rw(i,u,d){return i>11?d?"pm":"PM":d?"am":"AM"}var bp={calendar:ue,longDateFormat:De,invalidDate:ce,ordinal:K,dayOfMonthOrdinalParse:qe,relativeTime:Ze,months:$v,monthsShort:cp,week:rw,weekdays:lw,weekdaysMin:cw,weekdaysShort:gp,meridiemParse:Ow},Qe={},Ci={},Ii;function Pw(i,u){var d,h=Math.min(i.length,u.length);for(d=0;d0;){if(p=ho(b.slice(0,d).join("-")),p)return p;if(h&&h.length>=d&&Pw(b,h)>=d-1)break;d--}u++}return Ii}function Aw(i){return i.match("^[^/\\\\]*$")!=null}function ho(i){var u=null,d;if(Qe[i]===void 0&&typeof ni!="undefined"&&ni&&ni.exports&&Aw(i))try{u=Ii._abbr,d=require,d("./locale/"+i),Mn(u)}catch(h){Qe[i]=null}return Qe[i]}function Mn(i,u){var d;return i&&(l(u)?d=Xr(i):d=hl(i,u),d?Ii=d:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),Ii._abbr}function hl(i,u){if(u!==null){var d,h=bp;if(u.abbr=i,Qe[i]!=null)mt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=Qe[i]._config;else if(u.parentLocale!=null)if(Qe[u.parentLocale]!=null)h=Qe[u.parentLocale]._config;else if(d=ho(u.parentLocale),d!=null)h=d._config;else return Ci[u.parentLocale]||(Ci[u.parentLocale]=[]),Ci[u.parentLocale].push({name:i,config:u}),null;return Qe[i]=new Q(x(h,u)),Ci[i]&&Ci[i].forEach(function(p){hl(p.name,p.config)}),Mn(i),Qe[i]}else return delete Qe[i],null}function Nw(i,u){if(u!=null){var d,h,p=bp;Qe[i]!=null&&Qe[i].parentLocale!=null?Qe[i].set(x(Qe[i]._config,u)):(h=ho(i),h!=null&&(p=h._config),u=x(p,u),h==null&&(u.abbr=i),d=new Q(u),d.parentLocale=Qe[i],Qe[i]=d),Mn(i)}else Qe[i]!=null&&(Qe[i].parentLocale!=null?(Qe[i]=Qe[i].parentLocale,i===Mn()&&Mn(i)):Qe[i]!=null&&delete Qe[i]);return Qe[i]}function Xr(i){var u;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return Ii;if(!n(i)){if(u=ho(i),u)return u;i=[i]}return xw(i)}function Cw(){return Y(Qe)}function pl(i){var u,d=i._a;return d&&v(i).overflow===-2&&(u=d[Xe]<0||d[Xe]>11?Xe:d[G]<1||d[G]>co(d[et],d[Xe])?G:d[ne]<0||d[ne]>24||d[ne]===24&&(d[le]!==0||d[qt]!==0||d[es]!==0)?ne:d[le]<0||d[le]>59?le:d[qt]<0||d[qt]>59?qt:d[es]<0||d[es]>999?es:-1,v(i)._overflowDayOfYear&&(uG)&&(u=G),v(i)._overflowWeeks&&u===-1&&(u=Wv),v(i)._overflowWeekday&&u===-1&&(u=qv),v(i).overflow=u),i}var Iw=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Fw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Lw=/Z|[+-]\d\d(?::?\d\d)?/,po=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ml=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Yw=/^\/?Date\((-?\d+)/i,Uw=/^(?:(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{4}))$/,Ww={UT:0,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 wp(i){var u,d,h=i._i,p=Iw.exec(h)||Fw.exec(h),b,P,re,ge,Ue=po.length,jt=ml.length;if(p){for(v(i).iso=!0,u=0,d=Ue;uxi(P)||i._dayOfYear===0)&&(v(i)._overflowDayOfYear=!0),d=Ai(P,0,i._dayOfYear),i._a[Xe]=d.getUTCMonth(),i._a[G]=d.getUTCDate()),u=0;u<3&&i._a[u]==null;++u)i._a[u]=h[u]=p[u];for(;u<7;u++)i._a[u]=h[u]=i._a[u]==null?u===2?1:0:i._a[u];i._a[ne]===24&&i._a[le]===0&&i._a[qt]===0&&i._a[es]===0&&(i._nextDay=!0,i._a[ne]=0),i._d=(i._useUTC?Ai:ew).apply(null,h),b=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ne]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==b&&(v(i).weekdayMismatch=!0)}}function Vw(i){var u,d,h,p,b,P,re,ge,Ue;u=i._w,u.GG!=null||u.W!=null||u.E!=null?(b=1,P=4,d=Fs(u.GG,i._a[et],Ni(ze(),1,4).year),h=Fs(u.W,1),p=Fs(u.E,1),(p<1||p>7)&&(ge=!0)):(b=i._locale._week.dow,P=i._locale._week.doy,Ue=Ni(ze(),b,P),d=Fs(u.gg,i._a[et],Ue.year),h=Fs(u.w,Ue.week),u.d!=null?(p=u.d,(p<0||p>6)&&(ge=!0)):u.e!=null?(p=u.e+b,(u.e<0||u.e>6)&&(ge=!0)):p=b),h<1||h>Zr(d,b,P)?v(i)._overflowWeeks=!0:ge!=null?v(i)._overflowWeekday=!0:(re=yp(d,h,p,b,P),i._a[et]=re.year,i._dayOfYear=re.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function gl(i){if(i._f===e.ISO_8601){wp(i);return}if(i._f===e.RFC_2822){kp(i);return}i._a=[],v(i).empty=!0;var u=""+i._i,d,h,p,b,P,re=u.length,ge=0,Ue,jt;for(p=j(i._f,i._locale).match(w)||[],jt=p.length,d=0;d0&&v(i).unusedInput.push(P),u=u.slice(u.indexOf(h)+h.length),ge+=h.length),M[b]?(h?v(i).empty=!1:v(i).unusedTokens.push(b),It(b,h,i)):i._strict&&!h&&v(i).unusedTokens.push(b);v(i).charsLeftOver=re-ge,u.length>0&&v(i).unusedInput.push(u),i._a[ne]<=12&&v(i).bigHour===!0&&i._a[ne]>0&&(v(i).bigHour=void 0),v(i).parsedDateParts=i._a.slice(0),v(i).meridiem=i._meridiem,i._a[ne]=Kw(i._locale,i._a[ne],i._meridiem),Ue=v(i).era,Ue!==null&&(i._a[et]=i._locale.erasConvertYear(Ue,i._a[et])),yl(i),pl(i)}function Kw(i,u,d){var h;return d==null?u:i.meridiemHour!=null?i.meridiemHour(u,d):(i.isPM!=null&&(h=i.isPM(d),h&&u<12&&(u+=12),!h&&u===12&&(u=0)),u)}function Zw(i){var u,d,h,p,b,P,re=!1,ge=i._f.length;if(ge===0){v(i).invalidFormat=!0,i._d=new Date(NaN);return}for(p=0;pthis?this:i:q()});function Sp(i,u){var d,h;if(u.length===1&&n(u[0])&&(u=u[0]),!u.length)return ze();for(d=u[0],h=1;hthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function g0(){if(!l(this._isDSTShifted))return this._isDSTShifted;var i={},u;return me(i,this),i=Dp(i),i._a?(u=i._isUTC?T(i._a):ze(i._a),this._isDSTShifted=this.isValid()&&u0(i._a,u.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function _0(){return this.isValid()?!this._isUTC:!1}function T0(){return this.isValid()?this._isUTC:!1}function Mp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var b0=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,v0=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Er(i,u){var d=i,h=null,p,b,P;return yo(i)?d={ms:i._milliseconds,d:i._days,M:i._months}:c(i)||!isNaN(+i)?(d={},u?d[u]=+i:d.milliseconds=+i):(h=b0.exec(i))?(p=h[1]==="-"?-1:1,d={y:0,d:de(h[G])*p,h:de(h[ne])*p,m:de(h[le])*p,s:de(h[qt])*p,ms:de(_l(h[es]*1e3))*p}):(h=v0.exec(i))?(p=h[1]==="-"?-1:1,d={y:ts(h[2],p),M:ts(h[3],p),w:ts(h[4],p),d:ts(h[5],p),h:ts(h[6],p),m:ts(h[7],p),s:ts(h[8],p)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(P=w0(ze(d.from),ze(d.to)),d={},d.ms=P.milliseconds,d.M=P.months),b=new mo(d),yo(i)&&a(i,"_locale")&&(b._locale=i._locale),yo(i)&&a(i,"_isValid")&&(b._isValid=i._isValid),b}Er.fn=mo.prototype,Er.invalid=o0;function ts(i,u){var d=i&&parseFloat(i.replace(",","."));return(isNaN(d)?0:d)*u}function Rp(i,u){var d={};return d.months=u.month()-i.month()+(u.year()-i.year())*12,i.clone().add(d.months,"M").isAfter(u)&&--d.months,d.milliseconds=+u-+i.clone().add(d.months,"M"),d}function w0(i,u){var d;return i.isValid()&&u.isValid()?(u=bl(u,i),i.isBefore(u)?d=Rp(i,u):(d=Rp(u,i),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function Pp(i,u){return function(d,h){var p,b;return h!==null&&!isNaN(+h)&&(mt(u,"moment()."+u+"(period, number) is deprecated. Please use moment()."+u+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=d,d=h,h=b),p=Er(d,h),xp(this,p,i),this}}function xp(i,u,d,h){var p=u._milliseconds,b=_l(u._days),P=_l(u._months);!i.isValid()||(h=h==null?!0:h,P&&fp(i,Mt(i,"Month")+P*d),b&&Zn(i,"Date",Mt(i,"Date")+b*d),p&&i._d.setTime(i._d.valueOf()+p*d),h&&e.updateOffset(i,b||P))}var k0=Pp(1,"add"),D0=Pp(-1,"subtract");function Ap(i){return typeof i=="string"||i instanceof String}function E0(i){return ve(i)||f(i)||Ap(i)||c(i)||O0(i)||S0(i)||i===null||i===void 0}function S0(i){var u=s(i)&&!o(i),d=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,b,P=h.length;for(p=0;pd.valueOf():d.valueOf()9999?N(d,u?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?u?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",N(d,"Z")):N(d,u?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function q0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",u="",d,h,p,b;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",u="Z"),d="["+i+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",b=u+'[")]',this.format(d+h+p+b)}function j0(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var u=N(this,i);return this.localeData().postformat(u)}function $0(i,u){return this.isValid()&&(ve(i)&&i.isValid()||ze(i).isValid())?Er({to:this,from:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function B0(i){return this.from(ze(),i)}function G0(i,u){return this.isValid()&&(ve(i)&&i.isValid()||ze(i).isValid())?Er({from:this,to:i}).locale(this.locale()).humanize(!u):this.localeData().invalidDate()}function H0(i){return this.to(ze(),i)}function Np(i){var u;return i===void 0?this._locale._abbr:(u=Xr(i),u!=null&&(this._locale=u),this)}var Cp=te("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Ip(){return this._locale}var _o=1e3,Ls=60*_o,To=60*Ls,Fp=(365*400+97)*24*To;function Ys(i,u){return(i%u+u)%u}function Lp(i,u,d){return i<100&&i>=0?new Date(i+400,u,d)-Fp:new Date(i,u,d).valueOf()}function Yp(i,u,d){return i<100&&i>=0?Date.UTC(i+400,u,d)-Fp:Date.UTC(i,u,d)}function z0(i){var u,d;if(i=yt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Yp:Lp,i){case"year":u=d(this.year(),0,1);break;case"quarter":u=d(this.year(),this.month()-this.month()%3,1);break;case"month":u=d(this.year(),this.month(),1);break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":u=d(this.year(),this.month(),this.date());break;case"hour":u=this._d.valueOf(),u-=Ys(u+(this._isUTC?0:this.utcOffset()*Ls),To);break;case"minute":u=this._d.valueOf(),u-=Ys(u,Ls);break;case"second":u=this._d.valueOf(),u-=Ys(u,_o);break}return this._d.setTime(u),e.updateOffset(this,!0),this}function V0(i){var u,d;if(i=yt(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?Yp:Lp,i){case"year":u=d(this.year()+1,0,1)-1;break;case"quarter":u=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":u=d(this.year(),this.month()+1,1)-1;break;case"week":u=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":u=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":u=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":u=this._d.valueOf(),u+=To-Ys(u+(this._isUTC?0:this.utcOffset()*Ls),To)-1;break;case"minute":u=this._d.valueOf(),u+=Ls-Ys(u,Ls)-1;break;case"second":u=this._d.valueOf(),u+=_o-Ys(u,_o)-1;break}return this._d.setTime(u),e.updateOffset(this,!0),this}function K0(){return this._d.valueOf()-(this._offset||0)*6e4}function Z0(){return Math.floor(this.valueOf()/1e3)}function X0(){return new Date(this.valueOf())}function Q0(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function J0(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function e1(){return this.isValid()?this.toISOString():null}function t1(){return C(this)}function r1(){return g({},v(this))}function n1(){return v(this).overflow}function s1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}D("N",0,0,"eraAbbr"),D("NN",0,0,"eraAbbr"),D("NNN",0,0,"eraAbbr"),D("NNNN",0,0,"eraName"),D("NNNNN",0,0,"eraNarrow"),D("y",["y",1],"yo","eraYear"),D("y",["yy",2],0,"eraYear"),D("y",["yyy",3],0,"eraYear"),D("y",["yyyy",4],0,"eraYear"),H("N",wl),H("NN",wl),H("NNN",wl),H("NNNN",m1),H("NNNNN",y1),Ne(["N","NN","NNN","NNNN","NNNNN"],function(i,u,d,h){var p=d._locale.erasParse(i,h,d._strict);p?v(d).era=p:v(d).invalidEra=i}),H("y",cr),H("yy",cr),H("yyy",cr),H("yyyy",cr),H("yo",g1),Ne(["y","yy","yyy","yyyy"],et),Ne(["yo"],function(i,u,d,h){var p;d._locale._eraYearOrdinalRegex&&(p=i.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?u[et]=d._locale.eraYearOrdinalParse(i,p):u[et]=parseInt(i,10)});function i1(i,u){var d,h,p,b=this._eras||Xr("en")._eras;for(d=0,h=b.length;d=0)return b[h]}function o1(i,u){var d=i.since<=i.until?1:-1;return u===void 0?e(i.since).year():e(i.since).year()+(u-i.offset)*d}function u1(){var i,u,d,h=this.localeData().eras();for(i=0,u=h.length;ib&&(u=b),D1.call(this,i,u,d,h,p))}function D1(i,u,d,h,p){var b=yp(i,u,d,h,p),P=Ai(b.year,0,b.dayOfYear);return this.year(P.getUTCFullYear()),this.month(P.getUTCMonth()),this.date(P.getUTCDate()),this}D("Q",0,"Qo","quarter"),nt("quarter","Q"),je("quarter",7),H("Q",Dn),Ne("Q",function(i,u){u[Xe]=(de(i)-1)*3});function E1(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}D("D",["DD",2],"Do","date"),nt("date","D"),je("date",9),H("D",Ye),H("DD",Ye,gt),H("Do",function(i,u){return i?u._dayOfMonthOrdinalParse||u._ordinalParse:u._dayOfMonthOrdinalParseLenient}),Ne(["D","DD"],G),Ne("Do",function(i,u){u[G]=de(i.match(Ye)[0])});var Wp=zr("Date",!0);D("DDD",["DDDD",3],"DDDo","dayOfYear"),nt("dayOfYear","DDD"),je("dayOfYear",4),H("DDD",Xn),H("DDDD",Pi),Ne(["DDD","DDDD"],function(i,u,d){d._dayOfYear=de(i)});function S1(i){var u=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?u:this.add(i-u,"d")}D("m",["mm",2],0,"minute"),nt("minute","m"),je("minute",14),H("m",Ye),H("mm",Ye,gt),Ne(["m","mm"],le);var O1=zr("Minutes",!1);D("s",["ss",2],0,"second"),nt("second","s"),je("second",15),H("s",Ye),H("ss",Ye,gt),Ne(["s","ss"],qt);var M1=zr("Seconds",!1);D("S",0,0,function(){return~~(this.millisecond()/100)}),D(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),D(0,["SSS",3],0,"millisecond"),D(0,["SSSS",4],0,function(){return this.millisecond()*10}),D(0,["SSSSS",5],0,function(){return this.millisecond()*100}),D(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),D(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),D(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),D(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),nt("millisecond","ms"),je("millisecond",16),H("S",Xn,Dn),H("SS",Xn,gt),H("SSS",Xn,Pi);var Rn,qp;for(Rn="SSSS";Rn.length<=9;Rn+="S")H(Rn,cr);function R1(i,u){u[es]=de(("0."+i)*1e3)}for(Rn="S";Rn.length<=9;Rn+="S")Ne(Rn,R1);qp=zr("Milliseconds",!1),D("z",0,0,"zoneAbbr"),D("zz",0,0,"zoneName");function P1(){return this._isUTC?"UTC":""}function x1(){return this._isUTC?"Coordinated Universal Time":""}var F=fe.prototype;F.add=k0,F.calendar=P0,F.clone=x0,F.diff=Y0,F.endOf=V0,F.format=j0,F.from=$0,F.fromNow=B0,F.to=G0,F.toNow=H0,F.get=ao,F.invalidAt=n1,F.isAfter=A0,F.isBefore=N0,F.isBetween=C0,F.isSame=I0,F.isSameOrAfter=F0,F.isSameOrBefore=L0,F.isValid=t1,F.lang=Cp,F.locale=Np,F.localeData=Ip,F.max=t0,F.min=e0,F.parsingFlags=r1,F.set=Fr,F.startOf=z0,F.subtract=D0,F.toArray=Q0,F.toObject=J0,F.toDate=X0,F.toISOString=W0,F.inspect=q0,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=e1,F.toString=U0,F.unix=Z0,F.valueOf=K0,F.creationData=s1,F.eraName=u1,F.eraNarrow=l1,F.eraAbbr=c1,F.eraYear=d1,F.year=mp,F.isLeapYear=Jv,F.weekYear=_1,F.isoWeekYear=T1,F.quarter=F.quarters=E1,F.month=hp,F.daysInMonth=Zv,F.week=F.weeks=iw,F.isoWeek=F.isoWeeks=aw,F.weeksInYear=w1,F.weeksInWeekYear=k1,F.isoWeeksInYear=b1,F.isoWeeksInISOWeekYear=v1,F.date=Wp,F.day=F.days=Tw,F.weekday=bw,F.isoWeekday=vw,F.dayOfYear=S1,F.hour=F.hours=Mw,F.minute=F.minutes=O1,F.second=F.seconds=M1,F.millisecond=F.milliseconds=qp,F.utcOffset=c0,F.utc=f0,F.local=h0,F.parseZone=p0,F.hasAlignedHourOffset=m0,F.isDST=y0,F.isLocal=_0,F.isUtcOffset=T0,F.isUtc=Mp,F.isUTC=Mp,F.zoneAbbr=P1,F.zoneName=x1,F.dates=te("dates accessor is deprecated. Use date instead.",Wp),F.months=te("months accessor is deprecated. Use month instead",hp),F.years=te("years accessor is deprecated. Use year instead",mp),F.zone=te("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",d0),F.isDSTShifted=te("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",g0);function A1(i){return ze(i*1e3)}function N1(){return ze.apply(null,arguments).parseZone()}function jp(i){return i}var Re=Q.prototype;Re.calendar=y,Re.longDateFormat=ye,Re.invalidDate=Fe,Re.ordinal=Je,Re.preparse=jp,Re.postformat=jp,Re.relativeTime=Dr,Re.pastFuture=Ot,Re.set=W,Re.eras=i1,Re.erasParse=a1,Re.erasConvertYear=o1,Re.erasAbbrRegex=h1,Re.erasNameRegex=f1,Re.erasNarrowRegex=p1,Re.months=Hv,Re.monthsShort=zv,Re.monthsParse=Kv,Re.monthsRegex=Qv,Re.monthsShortRegex=Xv,Re.week=tw,Re.firstDayOfYear=sw,Re.firstDayOfWeek=nw,Re.weekdays=pw,Re.weekdaysMin=yw,Re.weekdaysShort=mw,Re.weekdaysParse=_w,Re.weekdaysRegex=ww,Re.weekdaysShortRegex=kw,Re.weekdaysMinRegex=Dw,Re.isPM=Sw,Re.meridiem=Rw;function vo(i,u,d,h){var p=Xr(),b=T().set(h,u);return p[d](b,i)}function $p(i,u,d){if(c(i)&&(u=i,i=void 0),i=i||"",u!=null)return vo(i,u,d,"month");var h,p=[];for(h=0;h<12;h++)p[h]=vo(i,h,d,"month");return p}function Dl(i,u,d,h){typeof i=="boolean"?(c(u)&&(d=u,u=void 0),u=u||""):(u=i,d=u,i=!1,c(u)&&(d=u,u=void 0),u=u||"");var p=Xr(),b=i?p._week.dow:0,P,re=[];if(d!=null)return vo(u,(d+b)%7,h,"day");for(P=0;P<7;P++)re[P]=vo(u,(P+b)%7,h,"day");return re}function C1(i,u){return $p(i,u,"months")}function I1(i,u){return $p(i,u,"monthsShort")}function F1(i,u,d){return Dl(i,u,d,"weekdays")}function L1(i,u,d){return Dl(i,u,d,"weekdaysShort")}function Y1(i,u,d){return Dl(i,u,d,"weekdaysMin")}Mn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var u=i%10,d=de(i%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th";return i+d}}),e.lang=te("moment.lang is deprecated. Use moment.locale instead.",Mn),e.langData=te("moment.langData is deprecated. Use moment.localeData instead.",Xr);var Qr=Math.abs;function U1(){var i=this._data;return this._milliseconds=Qr(this._milliseconds),this._days=Qr(this._days),this._months=Qr(this._months),i.milliseconds=Qr(i.milliseconds),i.seconds=Qr(i.seconds),i.minutes=Qr(i.minutes),i.hours=Qr(i.hours),i.months=Qr(i.months),i.years=Qr(i.years),this}function Bp(i,u,d,h){var p=Er(u,d);return i._milliseconds+=h*p._milliseconds,i._days+=h*p._days,i._months+=h*p._months,i._bubble()}function W1(i,u){return Bp(this,i,u,1)}function q1(i,u){return Bp(this,i,u,-1)}function Gp(i){return i<0?Math.floor(i):Math.ceil(i)}function j1(){var i=this._milliseconds,u=this._days,d=this._months,h=this._data,p,b,P,re,ge;return i>=0&&u>=0&&d>=0||i<=0&&u<=0&&d<=0||(i+=Gp(El(d)+u)*864e5,u=0,d=0),h.milliseconds=i%1e3,p=dt(i/1e3),h.seconds=p%60,b=dt(p/60),h.minutes=b%60,P=dt(b/60),h.hours=P%24,u+=dt(P/24),ge=dt(Hp(u)),d+=ge,u-=Gp(El(ge)),re=dt(d/12),d%=12,h.days=u,h.months=d,h.years=re,this}function Hp(i){return i*4800/146097}function El(i){return i*146097/4800}function $1(i){if(!this.isValid())return NaN;var u,d,h=this._milliseconds;if(i=yt(i),i==="month"||i==="quarter"||i==="year")switch(u=this._days+h/864e5,d=this._months+Hp(u),i){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(u=this._days+Math.round(El(this._months)),i){case"week":return u/7+h/6048e5;case"day":return u+h/864e5;case"hour":return u*24+h/36e5;case"minute":return u*1440+h/6e4;case"second":return u*86400+h/1e3;case"millisecond":return Math.floor(u*864e5)+h;default:throw new Error("Unknown unit "+i)}}function B1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+de(this._months/12)*31536e6:NaN}function Jr(i){return function(){return this.as(i)}}var G1=Jr("ms"),H1=Jr("s"),z1=Jr("m"),V1=Jr("h"),K1=Jr("d"),Z1=Jr("w"),X1=Jr("M"),Q1=Jr("Q"),J1=Jr("y");function ek(){return Er(this)}function tk(i){return i=yt(i),this.isValid()?this[i+"s"]():NaN}function rs(i){return function(){return this.isValid()?this._data[i]:NaN}}var rk=rs("milliseconds"),nk=rs("seconds"),sk=rs("minutes"),ik=rs("hours"),ak=rs("days"),ok=rs("months"),uk=rs("years");function lk(){return dt(this.days()/7)}var en=Math.round,Us={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ck(i,u,d,h,p){return p.relativeTime(u||1,!!d,i,h)}function dk(i,u,d,h){var p=Er(i).abs(),b=en(p.as("s")),P=en(p.as("m")),re=en(p.as("h")),ge=en(p.as("d")),Ue=en(p.as("M")),jt=en(p.as("w")),tn=en(p.as("y")),Pn=b<=d.ss&&["s",b]||b0,Pn[4]=h,ck.apply(null,Pn)}function fk(i){return i===void 0?en:typeof i=="function"?(en=i,!0):!1}function hk(i,u){return Us[i]===void 0?!1:u===void 0?Us[i]:(Us[i]=u,i==="s"&&(Us.ss=u-1),!0)}function pk(i,u){if(!this.isValid())return this.localeData().invalidDate();var d=!1,h=Us,p,b;return typeof i=="object"&&(u=i,i=!1),typeof i=="boolean"&&(d=i),typeof u=="object"&&(h=Object.assign({},Us,u),u.s!=null&&u.ss==null&&(h.ss=u.s-1)),p=this.localeData(),b=dk(this,!d,h,p),d&&(b=p.pastFuture(+this,b)),p.postformat(b)}var Sl=Math.abs;function Ws(i){return(i>0)-(i<0)||+i}function wo(){if(!this.isValid())return this.localeData().invalidDate();var i=Sl(this._milliseconds)/1e3,u=Sl(this._days),d=Sl(this._months),h,p,b,P,re=this.asSeconds(),ge,Ue,jt,tn;return re?(h=dt(i/60),p=dt(h/60),i%=60,h%=60,b=dt(d/12),d%=12,P=i?i.toFixed(3).replace(/\.?0+$/,""):"",ge=re<0?"-":"",Ue=Ws(this._months)!==Ws(re)?"-":"",jt=Ws(this._days)!==Ws(re)?"-":"",tn=Ws(this._milliseconds)!==Ws(re)?"-":"",ge+"P"+(b?Ue+b+"Y":"")+(d?Ue+d+"M":"")+(u?jt+u+"D":"")+(p||h||i?"T":"")+(p?tn+p+"H":"")+(h?tn+h+"M":"")+(i?tn+P+"S":"")):"P0D"}var Oe=mo.prototype;Oe.isValid=a0,Oe.abs=U1,Oe.add=W1,Oe.subtract=q1,Oe.as=$1,Oe.asMilliseconds=G1,Oe.asSeconds=H1,Oe.asMinutes=z1,Oe.asHours=V1,Oe.asDays=K1,Oe.asWeeks=Z1,Oe.asMonths=X1,Oe.asQuarters=Q1,Oe.asYears=J1,Oe.valueOf=B1,Oe._bubble=j1,Oe.clone=ek,Oe.get=tk,Oe.milliseconds=rk,Oe.seconds=nk,Oe.minutes=sk,Oe.hours=ik,Oe.days=ak,Oe.weeks=lk,Oe.months=ok,Oe.years=uk,Oe.humanize=pk,Oe.toISOString=wo,Oe.toString=wo,Oe.toJSON=wo,Oe.locale=Np,Oe.localeData=Ip,Oe.toIsoString=te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",wo),Oe.lang=Cp,D("X",0,0,"unix"),D("x",0,0,"valueOf"),H("x",On),H("X",uo),Ne("X",function(i,u,d){d._d=new Date(parseFloat(i)*1e3)}),Ne("x",function(i,u,d){d._d=new Date(de(i))});return e.version="2.29.4",t(ze),e.fn=F,e.min=r0,e.max=n0,e.now=s0,e.utc=T,e.unix=A1,e.months=C1,e.isDate=f,e.locale=Mn,e.invalid=q,e.duration=Er,e.isMoment=ve,e.weekdays=F1,e.parseZone=N1,e.localeData=Xr,e.isDuration=yo,e.monthsShort=I1,e.weekdaysMin=Y1,e.defineLocale=hl,e.updateLocale=Nw,e.locales=Cw,e.weekdaysShort=L1,e.normalizeUnits=yt,e.relativeTimeRounding=fk,e.relativeTimeThreshold=hk,e.calendarFormat=R0,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var KT=O((nY,bu)=>{var MT,RT,PT,xT,AT,NT,CT,IT,FT,_u,vh,LT,YT,UT,ai,WT,qT,jT,$T,BT,GT,HT,zT,VT,Tu;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof bu=="object"&&typeof bu.exports=="object"?r(t(e,t(bu.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(a,o){return n[a]=s?s(a,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])};MT=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function a(){this.constructor=n}n.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)},RT=Object.assign||function(n){for(var s,a=1,o=arguments.length;a=0;m--)(f=n[m])&&(c=(l<3?f(c):l>3?f(s,a,c):f(s,a))||c);return l>3&&c&&Object.defineProperty(s,a,c),c},AT=function(n,s){return function(a,o){s(a,o,n)}},NT=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},CT=function(n,s,a,o){function l(c){return c instanceof a?c:new a(function(f){f(c)})}return new(a||(a=Promise))(function(c,f){function m(E){try{T(o.next(E))}catch(v){f(v)}}function g(E){try{T(o.throw(E))}catch(v){f(v)}}function T(E){E.done?c(E.value):l(E.value).then(m,g)}T((o=o.apply(n,s||[])).next())})},IT=function(n,s){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,l,c,f;return f={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function m(T){return function(E){return g([T,E])}}function g(T){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,l&&(c=T[0]&2?l.return:T[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,T[1])).done)return c;switch(l=0,c&&(T=[T[0]&2,c.value]),T[0]){case 0:case 1:c=T;break;case 4:return a.label++,{value:T[1],done:!1};case 5:a.label++,l=T[1],T=[0];continue;case 7:T=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(T[0]===6||T[0]===2)){a=0;continue}if(T[0]===3&&(!c||T[1]>c[0]&&T[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},vh=function(n,s){var a=typeof Symbol=="function"&&n[Symbol.iterator];if(!a)return n;var o=a.call(n),l,c=[],f;try{for(;(s===void 0||s-- >0)&&!(l=o.next()).done;)c.push(l.value)}catch(m){f={error:m}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(f)throw f.error}}return c},LT=function(){for(var n=[],s=0;s1||m(R,C)})})}function m(R,C){try{g(o[R](C))}catch(q){v(c[0][3],q)}}function g(R){R.value instanceof ai?Promise.resolve(R.value.v).then(T,E):v(c[0][2],R)}function T(R){m("next",R)}function E(R){m("throw",R)}function v(R,C){R(C),c.shift(),c.length&&m(c[0][0],c[0][1])}},qT=function(n){var s,a;return s={},o("next"),o("throw",function(l){throw l}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(l,c){s[l]=n[l]?function(f){return(a=!a)?{value:ai(n[l](f)),done:l==="return"}:c?c(f):f}:c}},jT=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],a;return s?s.call(n):(n=typeof _u=="function"?_u(n):n[Symbol.iterator](),a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a);function o(c){a[c]=n[c]&&function(f){return new Promise(function(m,g){f=n[c](f),l(m,g,f.done,f.value)})}}function l(c,f,m,g){Promise.resolve(g).then(function(T){c({value:T,done:m})},f)}},$T=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};BT=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var a in n)a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)&&Tu(s,n,a);return t(s,n),s},GT=function(n){return n&&n.__esModule?n:{default:n}},HT=function(n,s,a,o){if(a==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?o:a==="a"?o.call(n):o?o.value:s.get(n)},zT=function(n,s,a,o,l){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!l:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?l.call(n,a):l?l.value=a:s.set(n,a),a},VT=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",MT),r("__assign",RT),r("__rest",PT),r("__decorate",xT),r("__param",AT),r("__metadata",NT),r("__awaiter",CT),r("__generator",IT),r("__exportStar",FT),r("__createBinding",Tu),r("__values",_u),r("__read",vh),r("__spread",LT),r("__spreadArrays",YT),r("__spreadArray",UT),r("__await",ai),r("__asyncGenerator",WT),r("__asyncDelegator",qT),r("__asyncValues",jT),r("__makeTemplateObject",$T),r("__importStar",BT),r("__importDefault",GT),r("__classPrivateFieldGet",HT),r("__classPrivateFieldSet",zT),r("__classPrivateFieldIn",VT)})});var Cb=O((Ab,Nb)=>{(function(r){var e=Object.hasOwnProperty,t=Array.isArray?Array.isArray:function(_){return Object.prototype.toString.call(_)==="[object Array]"},n=10,s=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",o=typeof Reflect=="object",l=typeof setImmediate=="function",c=l?setImmediate:setTimeout,f=a?o&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(y){var _=Object.getOwnPropertyNames(y);return _.push.apply(_,Object.getOwnPropertySymbols(y)),_}:Object.keys;function m(){this._events={},this._conf&&g.call(this,this._conf)}function g(y){y&&(this._conf=y,y.delimiter&&(this.delimiter=y.delimiter),y.maxListeners!==r&&(this._maxListeners=y.maxListeners),y.wildcard&&(this.wildcard=y.wildcard),y.newListener&&(this._newListener=y.newListener),y.removeListener&&(this._removeListener=y.removeListener),y.verboseMemoryLeak&&(this.verboseMemoryLeak=y.verboseMemoryLeak),y.ignoreErrors&&(this.ignoreErrors=y.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function T(y,_){var w="(node) warning: possible EventEmitter memory leak detected. "+y+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(w+=" Event name: "+_+"."),typeof process!="undefined"&&process.emitWarning){var k=new Error(w);k.name="MaxListenersExceededWarning",k.emitter=this,k.count=y,process.emitWarning(k)}else console.error(w),console.trace&&console.trace()}var E=function(y,_,w){var k=arguments.length;switch(k){case 0:return[];case 1:return[y];case 2:return[y,_];case 3:return[y,_,w];default:for(var S=new Array(k);k--;)S[k]=arguments[k];return S}};function v(y,_){for(var w={},k,S=y.length,M=_?_.length:0,D=0;D0;)y=M[A],D.call(I,y,w[y]);this._listeners={},this._listenersCount=0,N()}}});function C(y,_,w,k){var S=Object.assign({},_);if(!y)return S;if(typeof y!="object")throw TypeError("options must be an object");var M=Object.keys(y),D=M.length,I,A,N;function j(ye){throw Error('Invalid "'+I+'" option value'+(ye?". Reason: "+ye:""))}for(var De=0;De0;)if(I===y[A])return M;D(_)}}var B=$(["function"]),me=$(["object","function"]);function fe(y,_,w){var k,S,M=0,D,I=new y(function(A,N,j){w=C(w,{timeout:0,overload:!1},{timeout:function(Fe,K){return Fe*=1,(typeof Fe!="number"||Fe<0||!Number.isFinite(Fe))&&K("timeout must be a positive number"),Fe}}),k=!w.overload&&typeof y.prototype.cancel=="function"&&typeof j=="function";function De(){S&&(S=null),M&&(clearTimeout(M),M=0)}var ye=function(Fe){De(),A(Fe)},ce=function(Fe){De(),N(Fe)};k?_(ye,ce,j):(S=[function(Fe){ce(Fe||Error("canceled"))}],_(ye,ce,function(Fe){if(D)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Fe!="function")throw TypeError("onCancel callback must be a function");S.push(Fe)}),D=!0),w.timeout>0&&(M=setTimeout(function(){var Fe=Error("timeout");Fe.code="ETIMEDOUT",M=0,I.cancel(Fe),N(Fe)},w.timeout))});return k||(I.cancel=function(A){if(!!S){for(var N=S.length,j=1;j0;)ce=Ot[I],ce!=="_listeners"&&(Ae=ee(y,_,w[ce],k+1,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae));return ye}else if(Ze==="**"){for(Je=k+1===S||k+2===S&&Dr==="*",Je&&w._listeners&&(ye=ee(y,_,w,S,S)),Ot=f(w),I=Ot.length;I-- >0;)ce=Ot[I],ce!=="_listeners"&&(ce==="*"||ce==="**"?(w[ce]._listeners&&!Je&&(Ae=ee(y,_,w[ce],S,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae)),Ae=ee(y,_,w[ce],k,S)):ce===Dr?Ae=ee(y,_,w[ce],k+2,S):Ae=ee(y,_,w[ce],k,S),Ae&&(ye?ye.push.apply(ye,Ae):ye=Ae));return ye}else w[Ze]&&(ye=ee(y,_,w[Ze],k+1,S));if(Fe=w["*"],Fe&&ee(y,_,Fe,k+1,S),K=w["**"],K)if(k0;)ce=Ot[I],ce!=="_listeners"&&(ce===Dr?ee(y,_,K[ce],k+2,S):ce===Ze?ee(y,_,K[ce],k+1,S):(qe={},qe[ce]=K[ce],ee(y,_,{"**":qe},k+1,S)));else K._listeners?ee(y,_,K,S,S):K["*"]&&K["*"]._listeners&&ee(y,_,K["*"],S,S);return ye}function te(y,_,w){var k=0,S=0,M,D=this.delimiter,I=D.length,A;if(typeof y=="string")if((M=y.indexOf(D))!==-1){A=new Array(5);do A[k++]=y.slice(S,M),S=M+I;while((M=y.indexOf(D,S))!==-1);A[k++]=y.slice(S)}else A=[y],k=1;else A=y,k=y.length;if(k>1){for(M=0;M+10&&N._listeners.length>this._maxListeners&&(N._listeners.warned=!0,T.call(this,N._listeners.length,j))):N._listeners=_,!0;return!0}function Ct(y,_,w,k){for(var S=f(y),M=S.length,D,I,A,N=y._listeners,j;M-- >0;)I=S[M],D=y[I],I==="_listeners"?A=w:A=w?w.concat(I):[I],j=k||typeof I=="symbol",N&&_.push(j?A:A.join(this.delimiter)),typeof D=="object"&&Ct.call(this,D,_,A,j);return _}function mt(y){for(var _=f(y),w=_.length,k,S,M;w-- >0;)S=_[w],k=y[S],k&&(M=!0,S!=="_listeners"&&!mt(k)&&delete y[S]);return M}function V(y,_,w){this.emitter=y,this.event=_,this.listener=w}V.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function W(y,_,w){if(w===!0)S=!0;else if(w===!1)k=!0;else{if(!w||typeof w!="object")throw TypeError("options should be an object or true");var k=w.async,S=w.promisify,M=w.nextTick,D=w.objectify}if(k||M||S){var I=_,A=_._origin||_;if(M&&!s)throw Error("process.nextTick is not supported");S===r&&(S=_.constructor.name==="AsyncFunction"),_=function(){var N=arguments,j=this,De=this.event;return S?M?Promise.resolve():new Promise(function(ye){c(ye)}).then(function(){return j.event=De,I.apply(j,N)}):(M?process.nextTick:c)(function(){j.event=De,I.apply(j,N)})},_._async=!0,_._origin=A}return[_,D?new V(this,y,_):this]}function x(y){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,g.call(this,y)}x.EventEmitter2=x,x.prototype.listenTo=function(y,_,w){if(typeof y!="object")throw TypeError("target musts be an object");var k=this;w=C(w,{on:r,off:r,reducers:r},{on:B,off:B,reducers:me});function S(M){if(typeof M!="object")throw TypeError("events must be an object");var D=w.reducers,I=ve.call(k,y),A;I===-1?A=new R(k,y,w):A=k._observers[I];for(var N=f(M),j=N.length,De,ye=typeof D=="function",ce=0;ce0;)S=w[k],(!y||S._target===y)&&(S.unsubscribe(_),M=!0);return M},x.prototype.delimiter=".",x.prototype.setMaxListeners=function(y){y!==r&&(this._maxListeners=y,this._conf||(this._conf={}),this._conf.maxListeners=y)},x.prototype.getMaxListeners=function(){return this._maxListeners},x.prototype.event="",x.prototype.once=function(y,_,w){return this._once(y,_,!1,w)},x.prototype.prependOnceListener=function(y,_,w){return this._once(y,_,!0,w)},x.prototype._once=function(y,_,w,k){return this._many(y,1,_,w,k)},x.prototype.many=function(y,_,w,k){return this._many(y,_,w,!1,k)},x.prototype.prependMany=function(y,_,w,k){return this._many(y,_,w,!0,k)},x.prototype._many=function(y,_,w,k,S){var M=this;if(typeof w!="function")throw new Error("many only accepts instances of Function");function D(){return--_===0&&M.off(y,D),w.apply(this,arguments)}return D._origin=w,this._on(y,D,k,S)},x.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||m.call(this);var y=arguments[0],_,w=this.wildcard,k,S,M,D,I;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(w&&(_=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(S=y.length,a){for(M=0;M3)for(k=new Array(A-1),D=1;D3)for(S=new Array(N-1),I=1;I0&&this._events[y].length>this._maxListeners&&(this._events[y].warned=!0,T.call(this,this._events[y].length,y))):this._events[y]=_,S)},x.prototype.off=function(y,_){if(typeof _!="function")throw new Error("removeListener only takes instances of Function");var w,k=[];if(this.wildcard){var S=typeof y=="string"?y.split(this.delimiter):y.slice();if(k=ee.call(this,null,S,this.listenerTree,0),!k)return this}else{if(!this._events[y])return this;w=this._events[y],k.push({_listeners:w})}for(var M=0;M0){for(k=this._all,_=0,w=k.length;_0;)k=_[w[M]],typeof k=="function"?S.push(k):S.push.apply(S,k);return S}else{if(this.wildcard){if(D=this.listenerTree,!D)return[];var I=[],A=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,I,A,D,0),I}return _?(k=_[y],k?typeof k=="function"?[k]:k:[]):[]}},x.prototype.eventNames=function(y){var _=this._events;return this.wildcard?Ct.call(this,this.listenerTree,[],null,y):_?f(_):[]},x.prototype.listenerCount=function(y){return this.listeners(y).length},x.prototype.hasListeners=function(y){if(this.wildcard){var _=[],w=typeof y=="string"?y.split(this.delimiter):y.slice();return ee.call(this,_,w,this.listenerTree,0),_.length>0}var k=this._events,S=this._all;return!!(S&&S.length||k&&(y===r?f(k).length:k[y]))},x.prototype.listenersAny=function(){return this._all?this._all:[]},x.prototype.waitFor=function(y,_){var w=this,k=typeof _;return k==="number"?_={timeout:_}:k==="function"&&(_={filter:_}),_=C(_,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:B,Promise:q}),fe(_.Promise,function(S,M,D){function I(){var A=_.filter;if(!(A&&!A.apply(w,arguments)))if(w.off(y,I),_.handleError){var N=arguments[0];N?M(N):S(E.apply(null,arguments).slice(1))}else S(E.apply(null,arguments))}D(function(){w.off(y,I)}),w._on(y,I,!1)},{timeout:_.timeout,overload:_.overload})};function Q(y,_,w){w=C(w,{Promise,timeout:0,overload:!1},{Promise:q});var k=w.Promise;return fe(k,function(S,M,D){var I;if(typeof y.addEventListener=="function"){I=function(){S(E.apply(null,arguments))},D(function(){y.removeEventListener(_,I)}),y.addEventListener(_,I,{once:!0});return}var A=function(){N&&y.removeListener("error",N),S(E.apply(null,arguments))},N;_!=="error"&&(N=function(j){y.removeListener(_,A),M(j)},y.once("error",N)),D(function(){N&&y.removeListener("error",N),y.removeListener(_,A)}),y.once(_,A)},{timeout:w.timeout,overload:w.overload})}var Y=x.prototype;if(Object.defineProperties(x,{defaultMaxListeners:{get:function(){return Y._maxListeners},set:function(y){if(typeof y!="number"||y<0||Number.isNaN(y))throw TypeError("n must be a non-negative number");Y._maxListeners=y},enumerable:!0},once:{value:Q,writable:!0,configurable:!0}}),Object.defineProperties(Y,{_maxListeners:{value:n,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof define=="function"&&define.amd)define(function(){return x});else if(typeof Ab=="object")Nb.exports=x;else{var ue=new Function("","return this")();ue.EventEmitter2=x}})()});var Hr=O(zn=>{"use strict";zn.__esModule=!0;var iF;(function(r){r.AND="AND",r.OR="OR",r.XOR="XOR",r.NOT="NOT"})(iF=zn.Operators||(zn.Operators={}));var aF;(function(r){r.OPEN_PARENTHESIS="(",r.CLOSE_PARENTHESIS=")"})(aF=zn.StructuralCharacters||(zn.StructuralCharacters={}));var oF;(function(r){r.IDENTIFIER="IDENTIFIER",r.OPERATOR="OPERATOR",r.STRUCTURAL_CHARACTER="STRUCTURAL_CHARACTER",r.EOF="EOF",r.COMMENT="COMMENT"})(oF=zn.Tokens||(zn.Tokens={}))});var Xh=O(Bu=>{"use strict";Bu.__esModule=!0;var rt=Hr();Bu.OPERATOR_PRECEDENCE={NOT:0,XOR:1,AND:2,OR:3};Bu.VALID_TOKENS={identifierOnly:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS}],identifierOrNot:[{name:rt.Tokens.IDENTIFIER},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.OPEN_PARENTHESIS},{name:rt.Tokens.OPERATOR,value:rt.Operators.NOT}],binaryOperator:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR}],binaryOperatorOrClose:[{name:rt.Tokens.OPERATOR,value:rt.Operators.AND},{name:rt.Tokens.OPERATOR,value:rt.Operators.OR},{name:rt.Tokens.OPERATOR,value:rt.Operators.XOR},{name:rt.Tokens.STRUCTURAL_CHARACTER,value:rt.StructuralCharacters.CLOSE_PARENTHESIS}]}});var Qh=O(_n=>{"use strict";_n.__esModule=!0;var vi=Hr();_n.STRUCTURAL_CHARACTERS={"(":vi.StructuralCharacters.OPEN_PARENTHESIS,")":vi.StructuralCharacters.CLOSE_PARENTHESIS};_n.OPERATORS={AND:vi.Operators.AND,OR:vi.Operators.OR,XOR:vi.Operators.XOR,NOT:vi.Operators.NOT};_n.SEPARATORS=new Set([32,9,10,13].map(function(r){return String.fromCodePoint(r)}));_n.QUOTED_IDENTIFIER_DELIMITER=String.fromCodePoint(34);_n.COMMENT_DELIMITER=String.fromCodePoint(35);_n.EOL=String.fromCodePoint(10);_n.ESCAPE_CHARACTER=String.fromCodePoint(92)});var hv=O(Tn=>{"use strict";var Jh=Tn&&Tn.__assign||function(){return Jh=Object.assign||function(r){for(var e,t=1,n=arguments.length;t{"use strict";ep.__esModule=!0;var wi=Hr(),or=Qh(),ki=hv();ep.lex=function(r){for(var e=null,t=null,n=null,s=0;s{"use strict";var uF=bn&&bn.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";var Ei=ro&&ro.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";vn.__esModule=!0;var _v=Hr();vn.andUtil=function(r,e){return r&&e};vn.orUtil=function(r,e){return r||e};vn.xorUtil=function(r,e){return r!==e};vn.notUtil=function(r){return!r};vn.isIdentifier=function(r){var e=r.name,t=r.value;return e===_v.Tokens.IDENTIFIER&&typeof t=="string"};vn.isOperator=function(r){var e=r.name,t=r.value;return e===_v.Tokens.OPERATOR&&typeof t=="string"};vn.throwInvalidExpression=function(r){throw new TypeError("Invalid postfix expression: "+r)}});var Tv=O(ap=>{"use strict";var no;ap.__esModule=!0;var sp=Hr(),ip=np();ap.OPERATOR_MAP=(no={},no[sp.Operators.AND]=ip.andUtil,no[sp.Operators.OR]=ip.orUtil,no[sp.Operators.XOR]=ip.xorUtil,no)});var vv=O(Ps=>{"use strict";var op=Ps&&Ps.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e{"use strict";so.__esModule=!0;var wv=vv();so.getEvaluator=wv.getEvaluator;so.evaluate=wv.evaluate;var fF=rp();so.parse=fF.parse});var gF={};wk(gF,{default:()=>ll});module.exports=kk(gF);var Uv=require("obsidian");var di=require("obsidian");var TF=new Error("timeout while waiting for mutex to become available"),bF=new Error("mutex already locked"),Dk=new Error("request for lock canceled"),Ek=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{f(n.next(m))}catch(g){o(g)}}function c(m){try{f(n.throw(m))}catch(g){o(g)}}function f(m){m.done?a(m.value):s(m.value).then(l,c)}f((n=n.apply(r,e||[])).next())})},Ol=class{constructor(e,t=Dk){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:n}),this._dispatch()})}runExclusive(e,t=1){return Ek(this,void 0,void 0,function*(){let[n,s]=yield this.acquire(t);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let n=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!n)continue;let s=this._value,a=t;this._value-=t,t=this._value+1,n.resolve([s,this._newReleaser(a)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)!this._weightedWaiters[e-1]||(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},Sk=function(r,e,t,n){function s(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function l(m){try{f(n.next(m))}catch(g){o(g)}}function c(m){try{f(n.throw(m))}catch(g){o(g)}}function f(m){m.done?a(m.value):s(m.value).then(l,c)}f((n=n.apply(r,e||[])).next())})},ko=class{constructor(e){this._semaphore=new Ol(1,e)}acquire(){return Sk(this,void 0,void 0,function*(){let[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};var mu=ns(ht()),si=ns(Th()),ms=class{static parseDate(e,t=!1){return window.moment(mu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e){let t=mu.parse(e,void 0,{forwardDate:!0});if(t.length===0)return[si.default.invalid(),si.default.invalid()];let n=t[0].start,s=t[1]&&t[1].start?t[1].start:n,a=window.moment(n.date()),o=window.moment(s.date()),l=[a,o];o.isBefore(a)&&(l=[o,a]);let c=/(last|this|next) (week|month|quarter|year)/,f=e.match(c);if(f&&f.length===3){let m=f[1],g=si.default.duration(),T=f[2];switch(T){case"month":case"quarter":case"year":case"week":g.add(1,T)}switch(l=[(0,si.default)(),(0,si.default)()],m){case"last":l.forEach(E=>E.subtract(g));break;case"next":l.forEach(E=>E.add(g));break}switch(T){case"month":case"quarter":case"year":l=[l[0].startOf(T),l[1].endOf(T)];break;case"week":l=[l[0].startOf("isoWeek"),l[1].endOf("isoWeek")];break}}return l.forEach(m=>m.startOf("day")),l}};var BC={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function ii(r){for(let[e,t]of Object.entries(BC))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}var yu=["MO","TU","WE","TH","FR","SA","SU"],ct=function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(yu.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=yu[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r}();var He=function(r){return r!=null},sr=function(r){return typeof r=="number"},bh=function(r){return typeof r=="string"&&yu.includes(r)},At=Array.isArray,vr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=ke(t,e/t.length)),t.slice(0,e)+String(n))}var OT=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Ft=function(r,e){var t=r%e;return t*e<0?t+e:t},gu=function(r,e){return{div:Math.floor(r/e),mod:Ft(r,e)}},ir=function(r){return!He(r)||r.length===0},it=function(r){return!ir(r)},Ee=function(r,e){return it(r)&&r.indexOf(e)!==-1};var Yn;(function(r){r.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],r.ONE_DAY=1e3*60*60*24,r.MAXYEAR=9999,r.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),r.PY_WEEKDAYS=[6,0,1,2,3,4,5],r.getYearDay=function(e){var t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((t.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/r.ONE_DAY)+1},r.isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0},r.isDate=function(e){return e instanceof Date},r.isValidDate=function(e){return r.isDate(e)&&!isNaN(e.getTime())},r.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},r.daysBetween=function(e,t){var n=e.getTime()-r.tzOffset(e),s=t.getTime()-r.tzOffset(t),a=n-s;return Math.round(a/r.ONE_DAY)},r.toOrdinal=function(e){return r.daysBetween(e,r.ORDINAL_BASE)},r.fromOrdinal=function(e){return new Date(r.ORDINAL_BASE.getTime()+e*r.ONE_DAY)},r.getMonthDays=function(e){var t=e.getUTCMonth();return t===1&&r.isLeapYear(e.getUTCFullYear())?29:r.MONTH_DAYS[t]},r.getWeekday=function(e){return r.PY_WEEKDAYS[e.getUTCDay()]},r.monthRange=function(e,t){var n=new Date(Date.UTC(e,t,1));return[r.getWeekday(n),r.getMonthDays(n)]},r.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},r.clone=function(e){var t=new Date(e.getTime());return t},r.cloneDates=function(e){for(var t=[],n=0;nthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r}(),fn=GC;var ZT=ns(KT(),1),{__extends:oi,__assign:Bt,__rest:sY,__decorate:iY,__param:aY,__metadata:oY,__awaiter:uY,__generator:lY,__exportStar:cY,__createBinding:dY,__values:fY,__read:hY,__spread:pY,__spreadArrays:mY,__spreadArray:U,__await:yY,__asyncGenerator:gY,__asyncDelegator:_Y,__asyncValues:TY,__makeTemplateObject:bY,__importStar:vY,__importDefault:wY,__classPrivateFieldGet:kY,__classPrivateFieldSet:DY,__classPrivateFieldIn:EY}=ZT.default;var HC=function(r){oi(e,r);function e(t,n,s){var a=r.call(this,t,n)||this;return a.iterator=s,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e}(fn),wh=HC;var zC={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},gs=zC;var XT=function(r,e){return r.indexOf(e)!==-1},VC=function(r){return r.toString()},KC=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},ZC=function(){function r(e,t,n,s){if(t===void 0&&(t=VC),n===void 0&&(n=gs),s===void 0&&(s=KC),this.text=[],this.language=n||gs,this.gettext=t,this.dateFormatter=s,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);a.sort(function(m,g){return m-g}),o.sort(function(m,g){return g-m}),this.bymonthday=a.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(He(this.origOptions.byweekday)){var l=At(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],c=String(l);this.byweekday={allWeeks:l.filter(function(m){return!m.n}),someWeeks:l.filter(function(m){return Boolean(m.n)}),isWeekdays:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")===-1&&c.indexOf("SU")===-1,isEveryDay:c.indexOf("MO")!==-1&&c.indexOf("TU")!==-1&&c.indexOf("WE")!==-1&&c.indexOf("TH")!==-1&&c.indexOf("FR")!==-1&&c.indexOf("SA")!==-1&&c.indexOf("SU")!==-1};var f=function(m,g){return m.weekday-g.weekday};this.byweekday.allWeeks.sort(f),this.byweekday.someWeeks.sort(f),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(XT(["dtstart","wkst","freq"],n))return!0;if(!XT(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[X.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var s=Math.abs(e);switch(s){case 1:case 21:case 31:t=s+n("st");break;case 2:case 22:t=s+n("nd");break;case 3:case 23:t=s+n("rd");break;default:t=s+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=sr(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,s){var a=this;s===void 0&&(s=","),At(e)||(e=[e]);var o=function(c,f,m){for(var g="",T=0;Te[0].length)&&(e=a,t=s)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r}();function Ya(r,e){e===void 0&&(e=gs);var t={},n=new XC(e.tokens);if(!n.start(r))return null;return s(),t;function s(){n.expect("every");var T=n.acceptNumber();if(T&&(t.interval=parseInt(T[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=X.DAILY,n.nextSymbol()&&(o(),g());break;case"weekday(s)":t.freq=X.WEEKLY,t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR],n.nextSymbol(),g();break;case"week(s)":t.freq=X.WEEKLY,n.nextSymbol()&&(a(),g());break;case"hour(s)":t.freq=X.HOURLY,n.nextSymbol()&&(a(),g());break;case"minute(s)":t.freq=X.MINUTELY,n.nextSymbol()&&(a(),g());break;case"month(s)":t.freq=X.MONTHLY,n.nextSymbol()&&(a(),g());break;case"year(s)":t.freq=X.YEARLY,n.nextSymbol()&&(a(),g());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=X.WEEKLY;var E=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[X[E]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=c();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(X[v]),n.nextSymbol()}m(),g();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=X.YEARLY,t.bymonth=[l()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var R=l();if(!R)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(R),n.nextSymbol()}a(),g();break;default:throw new Error("Unknown symbol")}}function a(){var T=n.accept("on"),E=n.accept("the");if(!!(T||E))do{var v=f(),R=c(),C=l();if(v)R?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R].nth(v))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(v),n.accept("day(s)"));else if(R)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(X[R]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[X.MO,X.TU,X.WE,X.TH,X.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var q=n.acceptNumber();if(!q)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(q[0],10)];n.accept("comma");){if(q=n.acceptNumber(),!q)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(q[0],10))}}else if(C)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(C);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var T=n.accept("at");if(!!T)do{var E=n.acceptNumber();if(!E)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(E[0],10)];n.accept("comma");){if(E=n.acceptNumber(),!E)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(E[0],10))}}while(n.accept("comma")||n.accept("at"))}function l(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function c(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function f(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var T=parseInt(n.value[1],10);if(T<-366||T>366)throw new Error("Nth out of range: "+T);return n.nextSymbol(),n.accept("last")?-T:T;default:return!1}}function m(){n.accept("on"),n.accept("the");var T=f();if(!!T)for(t.bymonthday=[T],n.nextSymbol();n.accept("comma");){if(T=f(),!T)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(T),n.nextSymbol()}}function g(){if(n.symbol==="until"){var T=Date.parse(n.text);if(!T)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(T)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var be;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(be||(be={}));function Ua(r){return r12){var n=Math.floor(this.month/12),s=Ft(this.month,12);this.month=s,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,s){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=gu(this.hour,24),o=a.div,l=a.mod;if(o&&(this.hour=l,this.addDaily(o)),ir(s)||Ee(s,this.hour))break}},e.prototype.addMinutes=function(t,n,s,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var o=gu(this.minute,60),l=o.div,c=o.mod;if(l&&(this.minute=c,this.addHours(l,!1,s)),(ir(s)||Ee(s,this.hour))&&(ir(a)||Ee(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,s,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var l=gu(this.second,60),c=l.div,f=l.mod;if(c&&(this.second=f,this.addMinutes(c,!1,s,a)),(ir(s)||Ee(s,this.hour))&&(ir(a)||Ee(a,this.minute))&&(ir(o)||Ee(o,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=Yn.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Yn.MAXYEAR))return;t=Yn.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var s=t.freq,a=t.interval,o=t.wkst,l=t.byhour,c=t.byminute,f=t.bysecond;switch(s){case be.YEARLY:return this.addYears(a);case be.MONTHLY:return this.addMonths(a);case be.WEEKLY:return this.addWeekly(a,o);case be.DAILY:return this.addDaily(a);case be.HOURLY:return this.addHours(a,n,l);case be.MINUTELY:return this.addMinutes(a,n,l,c);case be.SECONDLY:return this.addSeconds(a,n,l,c,f)}},e}(li);function kh(r){for(var e=[],t=Object.keys(r),n=0,s=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||it(e.byweekno)||it(e.byyearday)||Boolean(e.bymonthday)||it(e.bymonthday)||He(e.byweekday)||He(e.byeaster)))switch(e.freq){case X.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case X.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case X.WEEKLY:e.byweekday=[ie.getWeekday(e.dtstart)];break}if(He(e.bymonth)&&!At(e.bymonth)&&(e.bymonth=[e.bymonth]),He(e.byyearday)&&!At(e.byyearday)&&sr(e.byyearday)&&(e.byyearday=[e.byyearday]),!He(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(At(e.bymonthday)){for(var s=[],a=[],t=0;t0?s.push(n):n<0&&a.push(n)}e.bymonthday=s,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(He(e.byweekno)&&!At(e.byweekno)&&(e.byweekno=[e.byweekno]),!He(e.byweekday))e.bynweekday=null;else if(sr(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(bh(e.byweekday))e.byweekday=[ct.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof ct)!e.byweekday.n||e.freq>X.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var o=[],l=[],t=0;tX.MONTHLY?o.push(c.weekday):l.push([c.weekday,c.n])}e.byweekday=it(o)?o:null,e.bynweekday=it(l)?l:null}return He(e.byhour)?sr(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(m=0,f=l.yearlen+Ft(o-e.wkst,7)):f=n-m;for(var g=Math.floor(f/7),T=Ft(f,7),E=Math.floor(g+T/4),v=0;v0&&R<=E){var C=void 0;R>1?(C=m+(R-1)*7,m!==c&&(C-=7-c)):C=m;for(var q=0;q<7&&(l.wnomask[C]=1,C++,l.wdaymask[C]!==e.wkst);q++);}}if(Ee(e.byweekno,1)){var C=m+E*7;if(m!==c&&(C-=7-c),C=4?(me=0,ve=fe+Ft(B-e.wkst,7)):ve=n-m,$=Math.floor(52+Ft(ve,7)/4)}if(Ee(e.byweekno,$))for(var C=0;Ca)return hn(r);if($>=t){var B=vb($,e);if(!r.accept(B)||l&&(--l,!l))return hn(r)}}else for(var q=E;qa)return hn(r);if($>=t){var B=vb($,e);if(!r.accept(B)||l&&(--l,!l))return hn(r)}}}if(e.interval===0||(c.add(e,R),c.year>ie.MAXYEAR))return hn(r);Ua(n)||(m=f.gettimeset(n)(c.hour,c.minute,c.second,0)),f.rebuild(c.year,c.month)}}function lI(r,e,t){var n=t.bymonth,s=t.byweekno,a=t.byweekday,o=t.byeaster,l=t.bymonthday,c=t.bynmonthday,f=t.byyearday;return it(n)&&!Ee(n,r.mmask[e])||it(s)&&!r.wnomask[e]||it(a)&&!Ee(a,r.wdaymask[e])||it(r.nwdaymask)&&!r.nwdaymask[e]||o!==null&&!Ee(r.eastermask,e)||(it(l)||it(c))&&!Ee(l,r.mdaymask[e])&&!Ee(c,r.nmdaymask[e])||it(f)&&(e=r.yearlen&&!Ee(f,e+1-r.yearlen)&&!Ee(f,-r.nextyearlen+e-r.yearlen))}function vb(r,e){return new _s(r,e.tzid).rezonedDate()}function hn(r){return r.getValue()}function cI(r,e,t,n,s){for(var a=!1,o=e;o=X.HOURLY&&it(s)&&!Ee(s,e.hour)||n>=X.MINUTELY&&it(a)&&!Ee(a,e.minute)||n>=X.SECONDLY&&it(o)&&!Ee(o,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var wr={MO:new ct(0),TU:new ct(1),WE:new ct(2),TH:new ct(3),FR:new ct(4),SA:new ct(5),SU:new ct(6)},Wa={freq:be.YEARLY,dtstart:null,interval:1,wkst:wr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},sb=Object.keys(Wa),X=function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new ob,this.origOptions=kh(e);var n=rb(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ya(e,t)},r.fromText=function(e,t){return QT(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return vu(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(!!this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new wh("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new fn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,s){if(n===void 0&&(n=!1),!ie.isValidDate(e)||!ie.isValidDate(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(s)return this._iter(new wh("between",a,s));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new fn("between",a)),this._cacheAdd("between",o,a)),o},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!ie.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},s=this._cacheGet("before",n);return s===!1&&(s=this._iter(new fn("before",n)),this._cacheAdd("before",s,n)),s},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!ie.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},s=this._cacheGet("after",n);return s===!1&&(s=this._iter(new fn("after",n)),this._cacheAdd("after",s,n)),s},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return $a(this.origOptions)},r.prototype.toText=function(e,t,n){return JT(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return eb(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=be.YEARLY,r.MONTHLY=be.MONTHLY,r.WEEKLY=be.WEEKLY,r.DAILY=be.DAILY,r.HOURLY=be.HOURLY,r.MINUTELY=be.MINUTELY,r.SECONDLY=be.SECONDLY,r.MO=wr.MO,r.TU=wr.TU,r.WE=wr.WE,r.TH=wr.TH,r.FR=wr.FR,r.SA=wr.SA,r.SU=wr.SU,r.parseString=ja,r.optionsToString=$a,r}();function wb(r,e,t,n,s,a){var o={},l=r.accept;function c(T,E){t.forEach(function(v){v.between(T,E,!0).forEach(function(R){o[Number(R)]=!0})})}s.forEach(function(T){var E=new _s(T,a).rezonedDate();o[Number(E)]=!0}),r.accept=function(T){var E=Number(T);return isNaN(E)?l.call(this,T):!o[E]&&(c(new Date(E-1),new Date(E+1)),!o[E])?(o[E]=!0,l.call(this,T)):!0},r.method==="between"&&(c(r.args.after,r.args.before),r.accept=function(T){var E=Number(T);return o[E]?!0:(o[E]=!0,l.call(this,T))});for(var f=0;f1||s.length||a.length||o.length){var m=new Sh(f);return m.dtstart(l),m.tzid(c||void 0),n.forEach(function(T){m.rrule(new X(Eh(T,l,c),f))}),s.forEach(function(T){m.rdate(T)}),a.forEach(function(T){m.exrule(new X(Eh(T,l,c),f))}),o.forEach(function(T){m.exdate(T)}),e.compatible&&e.dtstart&&m.rdate(l),m}var g=n[0]||{};return new X(Eh(g,g.dtstart||e.dtstart||l,g.tzid||e.tzid||c),f)}function wu(r,e){return e===void 0&&(e={}),hI(r,pI(e))}function Eh(r,e,t){return Bt(Bt({},r),{dtstart:e,tzid:t})}function pI(r){var e=[],t=Object.keys(r),n=Object.keys(kb);if(t.forEach(function(s){Ee(n,s)||e.push(s)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Bt(Bt({},kb),r)}function mI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=OT(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function yI(r){var e=mI(r),t=e.name,n=e.value,s=t.split(";");if(!s)throw new Error("empty property name");return{name:s[0].toUpperCase(),parms:s.slice(1),value:n}}function gI(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` +`),n=0;n0&&s[0]===" "?(t[n-1]+=s.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function _I(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Db(r,e){return _I(e),r.split(",").map(function(t){return ie.untilStringToDate(t)})}function Eb(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;nn}static nextAfterYears(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));Tt.isSkippingTooManyYears(e,t,a);)t=Tt.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new X(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};var Jm={prioritySymbols:{High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([⏫🔼🔽])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},Gi=class{constructor(e){this.symbols=e}serialize(e){let t=new qs,n="";for(let s of t.layoutComponents)n+=this.componentToString(e,t,s);return n}componentToString(e,t,n){var _;let{prioritySymbols:s,startDateSymbol:a,createdDateSymbol:o,scheduledDateSymbol:l,doneDateSymbol:c,recurrenceSymbol:h,dueDateSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let T="";return e.priority==="1"?T=" "+s.High:e.priority==="2"?T=" "+s.Medium:e.priority==="4"&&(T=" "+s.Low),T}case"startDate":return e.startDate?t.options.shortMode?" "+a:` ${a} ${e.startDate.format(ae.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+o:` ${o} ${e.createdDate.format(ae.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+l:` ${l} ${e.scheduledDate.format(ae.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+c:` ${c} ${e.doneDate.format(ae.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+m:` ${m} ${e.dueDate.format(ae.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+h:` ${h} ${e.recurrence.toText()}`:"";case"blockLink":return(_=e.blockLink)!=null?_:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}deserialize(e){let{prioritySymbols:t,TaskFormatRegularExpressions:n}=this.symbols,s,a="3",o=null,l=null,c=null,h=null,m=null,_="",T=null,D="",v=20,R=0;do{s=!1;let I=e.match(n.priorityRegex);if(I!==null){switch(I[1]){case t.Low:a="4";break;case t.Medium:a="2";break;case t.High:a="1";break}e=e.replace(n.priorityRegex,"").trim(),s=!0}let q=e.match(n.doneDateRegex);q!==null&&(h=window.moment(q[1],ae.dateFormat),e=e.replace(n.doneDateRegex,"").trim(),s=!0);let $=e.match(n.dueDateRegex);$!==null&&(c=window.moment($[1],ae.dateFormat),e=e.replace(n.dueDateRegex,"").trim(),s=!0);let B=e.match(n.scheduledDateRegex);B!==null&&(l=window.moment(B[1],ae.dateFormat),e=e.replace(n.scheduledDateRegex,"").trim(),s=!0);let me=e.match(n.startDateRegex);me!==null&&(o=window.moment(me[1],ae.dateFormat),e=e.replace(n.startDateRegex,"").trim(),s=!0);let fe=e.match(n.createdDateRegex);fe!==null&&(m=window.moment(fe[1],ae.dateFormat),e=e.replace(n.createdDateRegex,"").trim(),s=!0);let ve=e.match(n.recurrenceRegex);ve!==null&&(_=ve[1].trim(),e=e.replace(n.recurrenceRegex,"").trim(),s=!0);let ee=e.match(ae.hashTagsFromEnd);if(ee!=null){e=e.replace(ae.hashTagsFromEnd,"").trim(),s=!0;let te=ee[0].trim();D=D.length>0?[te,D].join(" "):te}R++}while(s&&R<=v);return _.length>0&&(T=Tt.fromText({recurrenceRuleText:_,startDate:o,scheduledDate:l,dueDate:c})),D.length>0&&(e+=" "+D),{description:e,priority:a,startDate:o,createdDate:m,scheduledDate:l,dueDate:c,doneDate:h,recurrence:T,tags:je.extractHashtags(e)}}};var gr=(o=>(o.TODO="TODO",o.DONE="DONE",o.IN_PROGRESS="IN_PROGRESS",o.CANCELLED="CANCELLED",o.NON_TASK="NON_TASK",o.EMPTY="EMPTY",o))(gr||{}),bt=class{constructor(e,t,n,s,a="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=a}};var Vt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}constructor(e){this.configuration=e}static makeDone(){return new Vt(new bt("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Vt(new bt("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Vt(new bt(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Vt(new bt("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Vt(new bt("/","In Progress","x",!0,"IN_PROGRESS"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return gr[e]||"TODO"}static createUnknownStatus(e){return new Vt(new bt(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Vt.getTypeFromStatusTypeString(e[3]);return new Vt(new bt(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}previewText(){let e="";return Vt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},he=Vt;he.DONE=Vt.makeDone(),he.EMPTY=Vt.makeEmpty(),he.TODO=Vt.makeTodo();var xo=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var pt=class{constructor(){this.coreStatuses=[he.makeTodo().configuration,he.makeDone().configuration],this.customStatuses=[he.makeInProgress().configuration,he.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new he(e);return t.findIndex(s=>new he(s).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){pt.deleteAllCustomStatuses(e),new pt().customStatuses.forEach(n=>{pt.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(o=>o.symbol==s[0]&&o.name==s[1]&&o.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):pt.addStatus(e.customStatuses,he.createFromImportedValue(s))}),n}static applyToStatusRegistry(e,t){t.clearStatuses(),e.coreStatuses.forEach(n=>{t.add(n)}),e.customStatuses.forEach(n=>{t.add(n)})}};var ey=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Wr=class{constructor(e,t,n,s,a,o){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=a;this.stable=o}static get values(){let e=[];return ey.forEach(t=>{e=[...e,new Wr(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Wr.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Wr.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var Fn={tasksPluginEmoji:{displayName:"Default",taskSerializer:new Gi(Jm)}},tk={globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],statusSettings:new pt,features:Wr.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new xo},In=Qe({},tk),se=()=>{for(let r in Wr.settingsFlags)In.features[r]===void 0&&(In.features[r]=Wr.settingsFlags[r]);return In.statusSettings.customStatuses.forEach((r,e,t)=>{var s,a;let n=he.getTypeFromStatusTypeString(r.type);t[e]=new bt((s=r.symbol)!=null?s:" ",r.name,(a=r.nextStatusSymbol)!=null?a:"x",r.availableAsCommand,n)}),Qe({},In)},Gt=r=>(In=Qe(Qe({},In),r),se());var os=(r,e)=>(In.generalSettings[r]=e,se()),ty=r=>{var e;return(e=In.features[r])!=null?e:!1};function Cl(){return Fn[se().taskFormat]}var $e=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==he.EMPTY.symbol)}static getInstance(){return $e.instance||($e.instance=new $e),$e.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof he?this._registeredStatuses.push(e):this._registeredStatuses.push(new he(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):he.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):he.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:he.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return he.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:he.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(a=>!this.hasSymbol(a.symbol)),n=new $e,s=[];return t.forEach(a=>{if(n.hasSymbol(a.symbol))return;let o=$e.copyStatusWithNewName(a,`Unknown (${a.symbol})`);s.push(o),n.add(o)}),s}static copyStatusWithNewName(e,t){let n=new bt(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new he(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[he.makeTodo(),he.makeInProgress(),he.makeDone(),he.makeCancelled()].forEach(t=>{this.add(t)})}};var on=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=Math.round(window.moment().diff(e.dueDate)/on.milliSecondsPerDay),s;n>=7?s=1:n>=-14?s=(n+14)*.8/21+.2:s=.2,t+=s*on.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*on.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*on.startedCoefficient),e.priority){case"1":t+=1*on.priorityCoefficient;break;case"2":t+=.65*on.priorityCoefficient;break;case"3":t+=.325*on.priorityCoefficient;break}return t}},an=on;an.dueCoefficient=12,an.scheduledCoefficient=5,an.startedCoefficient=-3,an.priorityCoefficient=6,an.milliSecondsPerDay=1e3*60*60*24;var cy=require("obsidian");var zi=require("obsidian");var iy=ns(Fl()),rk=require("obsidian"),ay=ns(sy());var Ll=class extends ay.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let a in this.options.minLevels)t.startsWith(a)&&a.length>=s.length&&(n=this.options.minLevels[a],s=a);return new Yl(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${(0,iy.default)().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Po=new Ll,Yl=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e){Wl=r,ql=e,jl=t},Ao=t=>J(void 0,[t],function*({originalTask:r,newTasks:e}){if(ql===void 0||Wl===void 0||jl===void 0){$l("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]),Hi.debug(`replaceTaskWithTasks entered. ${r.path}`),uy({originalTask:r,newTasks:e,vault:ql,metadataCache:Wl,workspace:jl,previousTries:0})});function $l(r){console.error(r),new zi.Notice(r,15e3)}function Ul(r){console.warn(r),new zi.Notice(r,1e4)}function sk(r){Hi.debug(r)}var uy=o=>J(void 0,[o],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a}){Hi.debug(`tryRepetitive after ${a} previous tries`);let l=()=>{if(a>10){let I=`Tasks: Could not find the correct task line to update. +`).map(function(s){return s.replace(/^RRULE:/,"EXRULE:")}).filter(function(s){return!/^DTSTART/.test(s)}))}),this._rdate.length&&t.push(Mb("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Mb("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(` +`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e}(X);function Sb(r,e){if(!(r instanceof X))throw new TypeError(String(r)+" is not RRule instance");Ee(e.map(String),String(r))||e.push(r)}function Ob(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");Ee(e.map(Number),Number(r))||(e.push(r),ie.sort(e))}function Mb(r,e,t){var n=!t||t.toUpperCase()==="UTC",s=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(o){return ie.timeToUntilString(o.valueOf(),n)}).join(",");return"".concat(s).concat(a)}function $r(r,e){return r!==null&&e===null?-1:r===null&&e!==null?1:r!==null&&e!==null?r.isValid()&&!e.isValid()?-1:!r.isValid()&&e.isValid()||r.isAfter(e)?1:r.isBefore(e)?-1:0:0}var Et=class{constructor({rrule:e,baseOnToday:t,referenceDate:n,startDate:s,scheduledDate:a,dueDate:o}){this.rrule=e,this.baseOnToday=t,this.referenceDate=n,this.startDate=s,this.scheduledDate=a,this.dueDate=o}static fromText({recurrenceRuleText:e,startDate:t,scheduledDate:n,dueDate:s}){try{let a=e.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(a==null)return null;let o=a[1].trim(),l=a[2]!==void 0,c=X.parseText(o);if(c!==null){let f=null;s?f=window.moment(s):n?f=window.moment(n):t&&(f=window.moment(t)),!l&&f!==null?c.dtstart=window.moment(f).startOf("day").utc(!0).toDate():c.dtstart=window.moment().startOf("day").utc(!0).toDate();let m=new X(c);return new Et({rrule:m,baseOnToday:l,referenceDate:f,startDate:t,scheduledDate:n,dueDate:s})}}catch(a){}return null}toText(){let e=this.rrule.toText();return this.baseOnToday&&(e+=" when done"),e}next(){var t;let e;if(this.baseOnToday){let n=window.moment(),s=new X(er(Ce({},this.rrule.origOptions),{dtstart:n.startOf("day").utc(!0).toDate()}));e=this.nextAfter(n.endOf("day"),s)}else{let n=window.moment((t=this.referenceDate)!=null?t:void 0).endOf("day");e=this.nextAfter(n,this.rrule)}if(e!==null){let n=null,s=null,a=null;if(this.referenceDate){if(this.startDate){let o=window.moment.duration(this.startDate.diff(this.referenceDate));n=window.moment(e),n.add(Math.round(o.asDays()),"days")}if(this.scheduledDate){let o=window.moment.duration(this.scheduledDate.diff(this.referenceDate));s=window.moment(e),s.add(Math.round(o.asDays()),"days")}if(this.dueDate){let o=window.moment.duration(this.dueDate.diff(this.referenceDate));a=window.moment(e),a.add(Math.round(o.asDays()),"days")}}return{startDate:n,scheduledDate:s,dueDate:a}}return null}identicalTo(e){return this.baseOnToday!==e.baseOnToday||$r(this.startDate,e.startDate)!==0||$r(this.scheduledDate,e.scheduledDate)!==0||$r(this.dueDate,e.dueDate)!==0?!1:this.toText()===e.toText()}nextAfter(e,t){e.utc(!0);let n=window.moment(t.after(e.toDate())),s=this.toText(),a=s.match(/every( \d+)? month(s)?(.*)?/);a!==null&&(s.includes(" on ")||(n=Et.nextAfterMonths(e,n,t,a[1])));let o=s.match(/every( \d+)? year(s)?(.*)?/);return o!==null&&(n=Et.nextAfterYears(e,n,t,o[1])),Et.addTimezone(n).toDate()}static nextAfterMonths(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));Et.isSkippingTooManyMonths(e,t,a);)t=Et.fromOneDayEarlier(e,n);return t}static isSkippingTooManyMonths(e,t,n){let s=t.month()-e.month();return s+=(t.year()-e.year())*12,s>n}static nextAfterYears(e,t,n,s){let a=1;for(s!==void 0&&(a=Number.parseInt(s.trim(),10));Et.isSkippingTooManyYears(e,t,a);)t=Et.fromOneDayEarlier(e,n);return t}static isSkippingTooManyYears(e,t,n){return t.year()-e.year()>n}static fromOneDayEarlier(e,t){e.subtract(1,"days").endOf("day");let n=t.origOptions;return n.dtstart=e.startOf("day").toDate(),t=new X(n),window.moment(t.after(e.toDate()))}static addTimezone(e){return window.moment.utc(e).local(!0).startOf("day")}};function Rb(r){let e=`${r.startDateSymbol}${r.scheduledDateSymbol}${r.dueDateSymbol}`;return(t,n,s)=>{let a=[];a=a.concat(bI(t,n,s,e)),a=a.concat(vI(t,n,s,r.recurrenceSymbol));let o=TI(t,s,r),l=Oh(t,/([a-zA-Z'_-]*)/g,n),c=!1;if(l&&l.length>0){let f=l[0];if(f.length>=Math.max(1,s.autoSuggestMinMatch)){let m=o.filter(g=>g.displayText.toLowerCase().includes(f.toLowerCase()));for(let g of m)a.push({suggestionType:"match",displayText:g.displayText,appendText:g.appendText,insertAt:l.index,insertSkip:f.length}),c=!0}}return!c&&s.autoSuggestMinMatch===0&&(a=a.concat(o)),a.length>0&&!a.some(f=>f.suggestionType==="match")&&a.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` +`}),a=a.slice(0,s.autoSuggestMaxItems),a}}function TI(r,e,t){let n=a=>Object.values(t.prioritySymbols).some(o=>o.length>0&&a.includes(o)),s=[];return r.includes(t.dueDateSymbol)||s.push({displayText:`${t.dueDateSymbol} due date`,appendText:`${t.dueDateSymbol} `}),r.includes(t.startDateSymbol)||s.push({displayText:`${t.startDateSymbol} start date`,appendText:`${t.startDateSymbol} `}),r.includes(t.scheduledDateSymbol)||s.push({displayText:`${t.scheduledDateSymbol} scheduled date`,appendText:`${t.scheduledDateSymbol} `}),n(r)||(s.push({displayText:`${t.prioritySymbols.High} high priority`,appendText:`${t.prioritySymbols.High} `}),s.push({displayText:`${t.prioritySymbols.Medium} medium priority`,appendText:`${t.prioritySymbols.Medium} `}),s.push({displayText:`${t.prioritySymbols.Low} low priority`,appendText:`${t.prioritySymbols.Low} `})),r.includes(t.recurrenceSymbol)||s.push({displayText:`${t.recurrenceSymbol} recurring (repeat)`,appendText:`${t.recurrenceSymbol} `}),s}function bI(r,e,t,n){let s=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],a=[],o=new RegExp(`([${n}])\\s*([0-9a-zA-Z ]*)`,"ug"),l=Oh(r,o,e);if(l&&l.length>=2){let c=l[1],f=l[2];if(f.length1?ms.parseDate(ii(f),!0):null;m&&m.isValid()&&a.push({displayText:`${m.format(ae.dateFormat)}`,appendText:`${c} ${m.format(ae.dateFormat)} `,insertAt:l.index,insertSkip:l[0].length});let g=1,T=5,E=s.filter(v=>f&&f.length>=g&&v.toLowerCase().includes(f.toLowerCase())).slice(0,T);E.length===0&&(E=s.slice(0,T));for(let v of E){let C=`${ms.parseDate(v,!0).format(ae.dateFormat)}`;a.push({suggestionType:"match",displayText:`${v} (${C})`,appendText:`${c} ${C} `,insertAt:l.index,insertSkip:l[0].length})}}return a}function vI(r,e,t,n){var c;let s=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],a=[],o=new RegExp(`(${n})\\s*([0-9a-zA-Z ]*)`,"ug"),l=Oh(r,o,e);if(l&&l.length>=2){let f=l[1],m=l[2];if(m.length0){let v=(c=Et.fromText({recurrenceRuleText:m,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:c.toText();if(v){let R=`${f} ${v} `;if(a.push({suggestionType:"match",displayText:`\u2705 ${v}`,appendText:R,insertAt:l.index,insertSkip:l[0].length}),l[0]==R)return[]}}let g=1,T=t.autoSuggestMaxItems/2,E=s.filter(v=>m&&m.length>=g&&v.toLowerCase().includes(m.toLowerCase())).slice(0,T);E.length===0&&m.trim().length===0&&(E=s.slice(0,T));for(let v of E)a.push({suggestionType:"match",displayText:`${v}`,appendText:`${f} ${v} `,insertAt:l.index,insertSkip:l[0].length})}return a}function Oh(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s;return[]}var Ba=class{constructor(){this.hideTaskCount=!1;this.hideBacklinks=!1;this.hidePriority=!1;this.hideCreatedDate=!1;this.hideStartDate=!1;this.hideScheduledDate=!1;this.hideDoneDate=!1;this.hideDueDate=!1;this.hideRecurrenceRule=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.shortMode=!1;this.explainQuery=!1}},qn=class{constructor(e,t){this.defaultLayout=["description","priority","recurrenceRule","createdDate","startDate","scheduledDate","dueDate","doneDate","blockLink"];this.hiddenComponents=[];this.specificClasses=[];e?this.options=e:this.options=new Ba,t?this.layoutComponents=t:this.layoutComponents=this.defaultLayout,this.layoutComponents=this.applyOptions(this.options)}applyOptions(e){let t=(s,a,o)=>a?(this.specificClasses.push(`tasks-layout-hide-${o}`),this.hiddenComponents.push(o),s.filter(l=>l!=o)):s,n=this.layoutComponents;return n=t(n,e.hidePriority,"priority"),n=t(n,e.hideRecurrenceRule,"recurrenceRule"),n=t(n,e.hideCreatedDate,"createdDate"),n=t(n,e.hideStartDate,"startDate"),n=t(n,e.hideScheduledDate,"scheduledDate"),n=t(n,e.hideDueDate,"dueDate"),n=t(n,e.hideDoneDate,"doneDate"),e.shortMode&&this.specificClasses.push("tasks-layout-short-mode"),n}};var Mh={prioritySymbols:{High:"\u23EB",Medium:"\u{1F53C}",Low:"\u{1F53D}",None:""},startDateSymbol:"\u{1F6EB}",createdDateSymbol:"\u2795",scheduledDateSymbol:"\u23F3",dueDateSymbol:"\u{1F4C5}",doneDateSymbol:"\u2705",recurrenceSymbol:"\u{1F501}",TaskFormatRegularExpressions:{priorityRegex:/([⏫🔼🔽])$/u,startDateRegex:/🛫 *(\d{4}-\d{2}-\d{2})$/u,createdDateRegex:/➕ *(\d{4}-\d{2}-\d{2})$/u,scheduledDateRegex:/[⏳⌛] *(\d{4}-\d{2}-\d{2})$/u,dueDateRegex:/[📅📆🗓] *(\d{4}-\d{2}-\d{2})$/u,doneDateRegex:/✅ *(\d{4}-\d{2}-\d{2})$/u,recurrenceRegex:/🔁 ?([a-zA-Z0-9, !]+)$/iu}},Ga=class{constructor(e){this.symbols=e}serialize(e){let t=new qn,n="";for(let s of t.layoutComponents)n+=this.componentToString(e,t,s);return n}componentToString(e,t,n){var g;let{prioritySymbols:s,startDateSymbol:a,createdDateSymbol:o,scheduledDateSymbol:l,doneDateSymbol:c,recurrenceSymbol:f,dueDateSymbol:m}=this.symbols;switch(n){case"description":return e.description;case"priority":{let T="";return e.priority==="1"?T=" "+s.High:e.priority==="2"?T=" "+s.Medium:e.priority==="4"&&(T=" "+s.Low),T}case"startDate":return e.startDate?t.options.shortMode?" "+a:` ${a} ${e.startDate.format(ae.dateFormat)}`:"";case"createdDate":return e.createdDate?t.options.shortMode?" "+o:` ${o} ${e.createdDate.format(ae.dateFormat)}`:"";case"scheduledDate":return!e.scheduledDate||e.scheduledDateIsInferred?"":t.options.shortMode?" "+l:` ${l} ${e.scheduledDate.format(ae.dateFormat)}`;case"doneDate":return e.doneDate?t.options.shortMode?" "+c:` ${c} ${e.doneDate.format(ae.dateFormat)}`:"";case"dueDate":return e.dueDate?t.options.shortMode?" "+m:` ${m} ${e.dueDate.format(ae.dateFormat)}`:"";case"recurrenceRule":return e.recurrence?t.options.shortMode?" "+f:` ${f} ${e.recurrence.toText()}`:"";case"blockLink":return(g=e.blockLink)!=null?g:"";default:throw new Error(`Don't know how to render task component of type '${n}'`)}}deserialize(e){let{prioritySymbols:t,TaskFormatRegularExpressions:n}=this.symbols,s,a="3",o=null,l=null,c=null,f=null,m=null,g="",T=null,E="",v=20,R=0;do{s=!1;let C=e.match(n.priorityRegex);if(C!==null){switch(C[1]){case t.Low:a="4";break;case t.Medium:a="2";break;case t.High:a="1";break}e=e.replace(n.priorityRegex,"").trim(),s=!0}let q=e.match(n.doneDateRegex);q!==null&&(f=window.moment(q[1],ae.dateFormat),e=e.replace(n.doneDateRegex,"").trim(),s=!0);let $=e.match(n.dueDateRegex);$!==null&&(c=window.moment($[1],ae.dateFormat),e=e.replace(n.dueDateRegex,"").trim(),s=!0);let B=e.match(n.scheduledDateRegex);B!==null&&(l=window.moment(B[1],ae.dateFormat),e=e.replace(n.scheduledDateRegex,"").trim(),s=!0);let me=e.match(n.startDateRegex);me!==null&&(o=window.moment(me[1],ae.dateFormat),e=e.replace(n.startDateRegex,"").trim(),s=!0);let fe=e.match(n.createdDateRegex);fe!==null&&(m=window.moment(fe[1],ae.dateFormat),e=e.replace(n.createdDateRegex,"").trim(),s=!0);let ve=e.match(n.recurrenceRegex);ve!==null&&(g=ve[1].trim(),e=e.replace(n.recurrenceRegex,"").trim(),s=!0);let ee=e.match(ae.hashTagsFromEnd);if(ee!=null){e=e.replace(ae.hashTagsFromEnd,"").trim(),s=!0;let te=ee[0].trim();E=E.length>0?[te,E].join(" "):te}R++}while(s&&R<=v);return g.length>0&&(T=Et.fromText({recurrenceRuleText:g,startDate:o,scheduledDate:l,dueDate:c})),E.length>0&&(e+=" "+E),{description:e,priority:a,startDate:o,createdDate:m,scheduledDate:l,dueDate:c,doneDate:f,recurrence:T,tags:$e.extractHashtags(e)}}};var kr=(o=>(o.TODO="TODO",o.DONE="DONE",o.IN_PROGRESS="IN_PROGRESS",o.CANCELLED="CANCELLED",o.NON_TASK="NON_TASK",o.EMPTY="EMPTY",o))(kr||{}),St=class{constructor(e,t,n,s,a="TODO"){this.symbol=e,this.name=t,this.nextStatusSymbol=n,this.availableAsCommand=s,this.type=a}};var Zt=class{get symbol(){return this.configuration.symbol}get name(){return this.configuration.name}get nextStatusSymbol(){return this.configuration.nextStatusSymbol}get availableAsCommand(){return this.configuration.availableAsCommand}get type(){return this.configuration.type}constructor(e){this.configuration=e}static makeDone(){return new Zt(new St("x","Done"," ",!0,"DONE"))}static makeEmpty(){return new Zt(new St("","EMPTY","",!0,"EMPTY"))}static makeTodo(){return new Zt(new St(" ","Todo","x",!0,"TODO"))}static makeCancelled(){return new Zt(new St("-","Cancelled"," ",!0,"CANCELLED"))}static makeInProgress(){return new Zt(new St("/","In Progress","x",!0,"IN_PROGRESS"))}static getTypeForUnknownSymbol(e){switch(e){case"x":case"X":return"DONE";case"/":return"IN_PROGRESS";case"-":return"CANCELLED";case"":return"EMPTY";case" ":default:return"TODO"}}static getTypeFromStatusTypeString(e){return kr[e]||"TODO"}static createUnknownStatus(e){return new Zt(new St(e,"Unknown","x",!1,"TODO"))}static createFromImportedValue(e){let t=e[0],n=Zt.getTypeFromStatusTypeString(e[3]);return new Zt(new St(t,e[1],e[2],!1,n))}isCompleted(){return this.type==="DONE"}previewText(){let e="";return Zt.tasksPluginCanCreateCommandsForStatuses()&&this.availableAsCommand&&(e=" Available as a command."),`- [${this.symbol}] => [${this.nextStatusSymbol}], name: '${this.name}', type: '${this.configuration.type}'.${e}`}static tasksPluginCanCreateCommandsForStatuses(){return!1}},pe=Zt;pe.DONE=Zt.makeDone(),pe.EMPTY=Zt.makeEmpty(),pe.TODO=Zt.makeTodo();var ku=class{constructor(e=!1,t=!1){this.ignoreSortInstructions=e,this.showTaskHiddenData=t}};var pt=class{constructor(){this.coreStatuses=[pe.makeTodo().configuration,pe.makeDone().configuration],this.customStatuses=[pe.makeInProgress().configuration,pe.makeCancelled().configuration]}static addStatus(e,t){e.push(t)}static replaceStatus(e,t,n){let s=this.findStatusIndex(t,e);return s<=-1?!1:(e.splice(s,1,n),!0)}static findStatusIndex(e,t){let n=new pe(e);return t.findIndex(s=>new pe(s).previewText()==n.previewText())}static deleteStatus(e,t){let n=this.findStatusIndex(t,e);return n<=-1?!1:(e.splice(n,1),!0)}static deleteAllCustomStatuses(e){e.customStatuses.splice(0)}static resetAllCustomStatuses(e){pt.deleteAllCustomStatuses(e),new pt().customStatuses.forEach(n=>{pt.addStatus(e.customStatuses,n)})}static bulkAddStatusCollection(e,t){let n=[];return t.forEach(s=>{e.customStatuses.find(o=>o.symbol==s[0]&&o.name==s[1]&&o.nextStatusSymbol==s[2])?n.push(`The status ${s[1]} (${s[0]}) is already added.`):pt.addStatus(e.customStatuses,pe.createFromImportedValue(s))}),n}static applyToStatusRegistry(e,t){t.clearStatuses(),e.coreStatuses.forEach(n=>{t.add(n)}),e.customStatuses.forEach(n=>{t.add(n)})}};var Pb=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}];var Br=class{constructor(e,t,n,s,a,o){this.internalName=e;this.index=t;this.description=n;this.displayName=s;this.enabledByDefault=a;this.stable=o}static get values(){let e=[];return Pb.forEach(t=>{e=[...e,new Br(t.internalName,t.index,t.description,t.displayName,t.enabledByDefault,t.stable)]}),e}static get settingsFlags(){let e={};return Br.values.forEach(t=>{e[t.internalName]=t.enabledByDefault}),e}static fromString(e){for(let t of Br.values)if(e===t.internalName)return t;throw new RangeError(`Illegal argument passed to fromString(): ${e} does not correspond to any available Feature ${this.prototype.constructor.name}`)}};var ci={tasksPluginEmoji:{displayName:"Default",taskSerializer:new Ga(Mh),buildSuggestions:Rb(Mh)}},kI={globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:6,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsDateFolders:[],statusSettings:new pt,features:Br.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new ku},jn=Ce({},kI),se=()=>{for(let r in Br.settingsFlags)jn.features[r]===void 0&&(jn.features[r]=Br.settingsFlags[r]);return jn.statusSettings.customStatuses.forEach((r,e,t)=>{var s,a;let n=pe.getTypeFromStatusTypeString(r.type);t[e]=new St((s=r.symbol)!=null?s:" ",r.name,(a=r.nextStatusSymbol)!=null?a:"x",r.availableAsCommand,n)}),Ce({},jn)},Gt=r=>(jn=Ce(Ce({},jn),r),se());var Ts=(r,e)=>(jn.generalSettings[r]=e,se()),xb=r=>{var e;return(e=jn.features[r])!=null?e:!1};function za(){return ci[se().taskFormat]}var Be=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:e})=>e!==pe.EMPTY.symbol)}static getInstance(){return Be.instance||(Be.instance=new Be),Be.instance}add(e){this.hasSymbol(e.symbol)||(e instanceof pe?this._registeredStatuses.push(e):this._registeredStatuses.push(new pe(e)))}bySymbol(e){return this.hasSymbol(e)?this.getSymbol(e):pe.EMPTY}bySymbolOrCreate(e){return this.hasSymbol(e)?this.getSymbol(e):pe.createUnknownStatus(e)}byName(e){return this._registeredStatuses.filter(({name:t})=>t===e).length>0?this._registeredStatuses.filter(({name:t})=>t===e)[0]:pe.EMPTY}resetToDefaultStatuses(){this.clearStatuses(),this.addDefaultStatusTypes()}clearStatuses(){this._registeredStatuses=[]}getNextStatus(e){if(e.nextStatusSymbol!==""){let t=this.bySymbol(e.nextStatusSymbol);if(t!==null)return t}return pe.EMPTY}getNextStatusOrCreate(e){let t=this.getNextStatus(e);return t.type!=="EMPTY"?t:pe.createUnknownStatus(e.nextStatusSymbol)}findUnknownStatuses(e){let t=e.filter(a=>!this.hasSymbol(a.symbol)),n=new Be,s=[];return t.forEach(a=>{if(n.hasSymbol(a.symbol))return;let o=Be.copyStatusWithNewName(a,`Unknown (${a.symbol})`);s.push(o),n.add(o)}),s}static copyStatusWithNewName(e,t){let n=new St(e.symbol,t,e.nextStatusSymbol,e.availableAsCommand,e.type);return new pe(n)}getSymbol(e){return this._registeredStatuses.filter(({symbol:t})=>t===e)[0]}hasSymbol(e){return this._registeredStatuses.find(t=>t.symbol===e)!==void 0}addDefaultStatusTypes(){[pe.makeTodo(),pe.makeInProgress(),pe.makeDone(),pe.makeCancelled()].forEach(t=>{this.add(t)})}};var mn=class{static calculate(e){let t=0;if(e.dueDate!==null){let n=Math.round(window.moment().diff(e.dueDate)/mn.milliSecondsPerDay),s;n>=7?s=1:n>=-14?s=(n+14)*.8/21+.2:s=.2,t+=s*mn.dueCoefficient}switch(e.scheduledDate!==null&&window.moment().isSameOrAfter(e.scheduledDate)&&(t+=1*mn.scheduledCoefficient),e.startDate!==null&&window.moment().isBefore(e.startDate)&&(t+=1*mn.startedCoefficient),e.priority){case"1":t+=1*mn.priorityCoefficient;break;case"2":t+=.65*mn.priorityCoefficient;break;case"3":t+=.325*mn.priorityCoefficient;break}return t}},pn=mn;pn.dueCoefficient=12,pn.scheduledCoefficient=5,pn.startedCoefficient=-3,pn.priorityCoefficient=6,pn.milliSecondsPerDay=1e3*60*60*24;var Wb=require("obsidian");var Ka=require("obsidian");var Ib=ns(Th()),DI=require("obsidian"),Fb=ns(Cb());var Rh=class extends Fb.EventEmitter2{constructor(){super(...arguments);this.options={minLevels:{"":"info",tasks:"info"}};this.consoleLoggerRegistered=!1;this.arrAvg=t=>t.reduce((n,s)=>n+s,0)/t.length}configure(t){return this.options=Object.assign({},this.options,t),this}getLogger(t){let n="none",s="";for(let a in this.options.minLevels)t.startsWith(a)&&a.length>=s.length&&(n=this.options.minLevels[a],s=a);return new Ph(this,t,n)}onLogEntry(t){return this.on("log",t),this}registerConsoleLogger(){return this.consoleLoggerRegistered?this:(this.onLogEntry(t=>{let n=`[${(0,Ib.default)().format("YYYY-MM-DD-HH:mm:ss.SSS")}][${t.level}][${t.module}]`;switch(t.traceId&&(n+=`[${t.traceId}]`),n+=` ${t.message}`,t.objects===void 0&&(t.objects=""),t.level){case"trace":console.trace(n,t.objects);break;case"debug":console.debug(n,t.objects);break;case"info":console.info(n,t.objects);break;case"warn":console.warn(n,t.objects);break;case"error":console.error(n,t.objects);break;default:console.log(`{${t.level}} ${n}`,t.objects)}}),this.consoleLoggerRegistered=!0,this)}},Du=new Rh,Ph=class{constructor(e,t,n){this.levels={trace:1,debug:2,info:3,warn:4,error:5};this.logManager=e,this.module=t,this.minLevel=this.levelToInt(n)}levelToInt(e){return e.toLowerCase()in this.levels?this.levels[e.toLowerCase()]:99}log(e,t,n){if(this.levelToInt(e){Ah=r,Nh=e,Ch=t},Eu=t=>J(void 0,[t],function*({originalTask:r,newTasks:e}){if(Nh===void 0||Ah===void 0||Ch===void 0){Ih("Tasks: cannot use File before initializing it.");return}Array.isArray(e)||(e=[e]),Va.debug(`replaceTaskWithTasks entered. ${r.path}`),Yb({originalTask:r,newTasks:e,vault:Nh,metadataCache:Ah,workspace:Ch,previousTries:0})});function Ih(r){console.error(r),new Ka.Notice(r,15e3)}function xh(r){console.warn(r),new Ka.Notice(r,1e4)}function SI(r){Va.debug(r)}var Yb=o=>J(void 0,[o],function*({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a}){Va.debug(`tryRepetitive after ${a} previous tries`);let l=()=>{if(a>10){let C=`Tasks: Could not find the correct task line to update. The task line not updated is: ${r.originalMarkdown} @@ -146,14 +147,14 @@ Recommendations: 1. Close all panes that have the above file open, and then re-open the file. 2. Check for exactly identical copies of the task line, in this file, and see if you can make them different. -`;$l(I);return}let R=Math.min(Math.pow(10,a),100);Hi.debug(`timeout = ${R}`),setTimeout(()=>{uy({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a+1})},R)},c=t.getAbstractFileByPath(r.path);if(!(c instanceof zi.TFile))return Ul(`Tasks: No file found for task ${r.description}. Retrying ...`),l();if(!nk.includes(c.extension)){$l(`Tasks: Does not support files with the ${c.extension} file extension.`);return}let h=n.getFileCache(c);if(h==null||h===null)return Ul(`Tasks: No file cache found for file ${c.path}. Retrying ...`),l();let m=h.listItems;if(m===void 0||m.length===0)return Ul(`Tasks: No list items found in file cache of ${c.path}. Retrying ...`),l();let T=(yield t.read(c)).split(` -`),D=ik(r,T,m,sk);if(D===void 0)return l();let v=[...T.slice(0,D),...e.map(R=>R.toFileLineString()),...T.slice(D+1)];yield t.modify(c,v.join(` -`))});function ly(r,e){return r{Yb({originalTask:r,newTasks:e,vault:t,metadataCache:n,workspace:s,previousTries:a+1})},R)},c=t.getAbstractFileByPath(r.path);if(!(c instanceof Ka.TFile))return xh(`Tasks: No file found for task ${r.description}. Retrying ...`),l();if(!EI.includes(c.extension)){Ih(`Tasks: Does not support files with the ${c.extension} file extension.`);return}let f=n.getFileCache(c);if(f==null||f===null)return xh(`Tasks: No file cache found for file ${c.path}. Retrying ...`),l();let m=f.listItems;if(m===void 0||m.length===0)return xh(`Tasks: No list items found in file cache of ${c.path}. Retrying ...`),l();let T=(yield t.read(c)).split(` +`),E=OI(r,T,m,SI);if(E===void 0)return l();let v=[...T.slice(0,E),...e.map(R=>R.toFileLineString()),...T.slice(E+1)];yield t.modify(c,v.join(` +`))});function Ub(r,e){return r{l.preventDefault(),l.stopPropagation(),a.disabled=!0;let c=r.toggle();Ao({originalTask:r,newTasks:c})}),n.prepend(a),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),a.setAttribute("data-line",e.listIndex.toString()),(o=e.layoutOptions)!=null&&o.shortMode&&fk({task:r,element:s,isFilenameUnique:e.isFilenameUnique}),n})}function ck(r,e,t,n){return J(this,null,function*(){let s="",a=new qs(e.layoutOptions),o=Fn.tasksPluginEmoji.taskSerializer;for(let c of a.layoutComponents){let h=o.componentToString(r,a,c);h&&(c==="description"&&(h=hk(h)),s+=h)}let{debugSettings:l}=se();l.showTaskHiddenData&&(s+=`
\u{1F41B} ${r.lineNumber} . ${r.sectionStart} . ${r.sectionIndex} . '${r.originalMarkdown}'
'${r.path}' > '${r.precedingHeader}'
`),yield dk(t,s,"description",r,n)})}function dk(r,e,t,n,s){return J(this,null,function*(){if(t==="description"){yield s(e,r,n.path);let a=r.querySelector("blockquote"),o=a!=null?a:r,l=o.querySelector("p");if(l!==null){for(;l.firstChild;)o.insertBefore(l.firstChild,l);l.remove()}r.querySelectorAll("p").forEach(c=>{c.hasChildNodes()||c.remove()}),r.querySelectorAll(".footnotes").forEach(c=>{c.remove()})}else r.innerHTML=e})}function fk({task:r,element:e,isFilenameUnique:t}){let{recurrenceSymbol:n,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:l,doneDateSymbol:c}=Fn.tasksPluginEmoji.taskSerializer.symbols;e.addEventListener("mouseenter",()=>{let h=e.createDiv();h.addClasses(["tooltip","pop-up"]),r.recurrence&&h.createDiv().setText(`${n} ${r.recurrence.toText()}`),r.createdDate&&h.createDiv().setText(Vi({signifier:a,date:r.createdDate})),r.startDate&&h.createDiv().setText(Vi({signifier:s,date:r.startDate})),r.scheduledDate&&h.createDiv().setText(Vi({signifier:o,date:r.scheduledDate})),r.dueDate&&h.createDiv().setText(Vi({signifier:l,date:r.dueDate})),r.doneDate&&h.createDiv().setText(Vi({signifier:c,date:r.doneDate}));let m=r.getLinkText({isFilenameUnique:t});m&&h.createDiv().setText(`\u{1F517} ${m}`),e.addEventListener("mouseleave",()=>{h.remove()})})}function Vi({signifier:r,date:e}){return`${r} ${e.format(ae.dateFormat)} (${e.from(window.moment().startOf("day"))})`}function hk(r){let{globalFilter:e,removeGlobalFilter:t}=se();return t?r.replace(e,"").trim():r}var Kt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=se();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),s=e.substring(t,n),a=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(s)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let s=e.scheduledDate,a=e.scheduledDateIsInferred;return n===null?a&&(a=!1,s=null):a?s=n:this.canApplyFallback(e)&&(s=n,a=!0),new je(tr(Qe({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:a}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new je(tr(Qe({},s),{scheduledDateIsInferred:!1}))),s))}};function No(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var sr=class{},ae=sr;ae.dateFormat="YYYY-MM-DD",ae.indentationRegex=/^([\s\t>]*)/,ae.listMarkerRegex=/([-*]|[0-9]+\.)/,ae.checkboxRegex=/\[(.)\]/u,ae.afterCheckboxRegex=/ *(.*)/u,ae.taskRegex=new RegExp(sr.indentationRegex.source+sr.listMarkerRegex.source+" +"+sr.checkboxRegex.source+sr.afterCheckboxRegex.source,"u"),ae.nonTaskRegex=new RegExp(sr.indentationRegex.source+sr.listMarkerRegex.source+"? *("+sr.checkboxRegex.source+")?"+sr.afterCheckboxRegex.source,"u"),ae.listItemRegex=new RegExp(sr.indentationRegex.source+sr.listMarkerRegex.source),ae.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,ae.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]*/g,ae.hashTagsFromEnd=new RegExp(sr.hashTags.source+"$");var je=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:a,priority:o,createdDate:l,startDate:c,scheduledDate:h,dueDate:m,doneDate:_,recurrence:T,blockLink:D,tags:v,originalMarkdown:R,scheduledDateIsInferred:I}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=a,this.taskLocation=n,this.tags=v,this.priority=o,this.createdDate=l,this.startDate=c,this.scheduledDate=h,this.dueDate=m,this.doneDate=_,this.recurrence=T,this.blockLink=D,this.originalMarkdown=R,this.scheduledDateIsInferred=I}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=e.match(ae.taskRegex);if(s===null)return null;let a=s[4].trim(),{globalFilter:o}=se();if(!a.includes(o))return null;let l=a,c=s[1],h=s[2],m=s[3],_=$e.getInstance().bySymbolOrCreate(m),T=l.match(ae.blockLinkRegex),D=T!==null?T[0]:"";D!==""&&(l=l.replace(ae.blockLinkRegex,"").trim());let{taskSerializer:v}=Cl(),R=v.deserialize(l),I=!1;return Kt.canApplyFallback(R)&&n!==null&&(R.scheduledDate=n,I=!0),R.tags=R.tags.map(q=>q.trim()),o&&(R.tags=R.tags.filter(q=>q!==o)),new je(tr(Qe({},R),{status:_,indentation:c,listMarker:h,taskLocation:t,blockLink:D,originalMarkdown:e,scheduledDateIsInferred:I}))}toLi(e){return J(this,null,function*(){return dy(this,e)})}toString(){return Cl().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=$e.getInstance().getNextStatusOrCreate(this.status),t=null,n=null;if(e.isCompleted()){let{setDoneDate:o}=se();o&&(t=window.moment()),this.recurrence!==null&&(n=this.recurrence.next())}let s=new je(tr(Qe({},this),{status:e,doneDate:t})),a=[];if(n!==null){let{setCreatedDate:o}=se(),l=null;o&&(l=window.moment());let c=$e.getInstance().getNextStatusOrCreate(e),h=new je(tr(Qe(Qe({},this),n),{status:c,blockLink:"",createdDate:l}));a.push(h)}return a.push(s),a}get urgency(){return this._urgency===null&&(this._urgency=an.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){let t=["status","description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let a of t)if(this[a]!==e[a])return!1;if(this.tags.length!==e.tags.length||!this.tags.every(function(a,o){return a===e.tags[o]}))return!1;t=["createdDate","startDate","scheduledDate","dueDate","doneDate"];for(let a of t){let o=this[a],l=e[a];if(Ur(o,l)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static extractHashtags(e){var t,n;return(n=(t=e.match(ae.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}getDescriptionWithoutGlobalFilter(){let{globalFilter:e}=se(),t=this.description;if(e.length===0)return t;let n=RegExp("(^|\\s)"+No(e)+"($|\\s)","ug");return this.description.search(n)>-1&&(t=t.replace(n,"$1$2").replace(" "," ").trim()),t}};var Ki=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var Pt=class{constructor(e,t,n,s,a){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=a}static fromUnknownPosition(e){return new Pt(e,0,0,0,null)}fromRenamedFile(e){return new Pt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var us=class{constructor({metadataCache:e,vault:t,events:n}){this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new vo,this.state="Cold",this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){let e=this.metadataCache.on("resolved",()=>J(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){let{useFilenameAsScheduledDate:e}=se(),t=this.vault.on("create",a=>{a instanceof zs.TFile&&this.tasksMutex.runExclusive(()=>{this.indexFile(a)})});this.vaultEventReferences.push(t);let n=this.vault.on("delete",a=>{a instanceof zs.TFile&&this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(o=>o.path!==a.path),this.notifySubscribers()})});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(a,o)=>{a instanceof zs.TFile&&this.tasksMutex.runExclusive(()=>{let l=new Ki(()=>Kt.fromPath(a.path));this.tasks=this.tasks.map(c=>c.path===o?e?Kt.updateTaskPath(c,a.path,l.value):new je(tr(Qe({},c),{taskLocation:c.taskLocation.fromRenamedFile(a.path)})):c),this.notifySubscribers()})});this.vaultEventReferences.push(s)}subscribeToEvents(){let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.tasksMutex.runExclusive(()=>J(this,null,function*(){this.state="Initializing",yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.notifySubscribers()}))}indexFile(e){return J(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;let n=this.tasks.filter(o=>o.path===e.path),s=t.listItems,a=[];if(s!==void 0){let o=yield this.vault.cachedRead(e);a=this.getTasksFromFileContent(o,s,t,e)}je.tasksListsIdentical(n,a)||(this.getState()=="Warm"&&console.debug(`At least one task, its line number or its heading has changed in ${e.path}: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.`),this.tasks=this.tasks.filter(o=>o.path!==e.path),this.tasks.push(...a),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let a=[],o=e.split(` -`),l=o.length,c=new Ki(()=>Kt.fromPath(s.path)),h=null,m=0;for(let _ of t)if(_.task!==void 0){let T=_.position.start.line;if(T>=l)return console.log(`${s.path} Obsidian gave us a line number ${T} past the end of the file. ${l}.`),a;if((h===null||h.position.end.line{c.preventDefault(),c.stopPropagation(),o.disabled=!0;let f=r.toggle();Eu({originalTask:r,newTasks:f})}),n.prepend(o),n.setAttribute("data-task",r.status.symbol.trim()),n.setAttribute("data-line",e.listIndex.toString()),n.setAttribute("data-task-status-name",r.status.name),n.setAttribute("data-task-status-type",r.status.type),o.setAttribute("data-line",e.listIndex.toString()),(l=e.layoutOptions)!=null&&l.shortMode&&UI({task:r,element:s,isFilenameUnique:e.isFilenameUnique}),n})}function CI(r,e,t,n){return J(this,null,function*(){let s={},a=new qn(e.layoutOptions),o=ci.tasksPluginEmoji.taskSerializer;for(let l of a.layoutComponents){let c=o.componentToString(r,a,l);if(c){l==="description"&&(c=WI(c));let f=document.createElement("span");if(t.appendChild(f),f){let m=document.createElement("span");f.appendChild(m),yield II(m,c,l,r,n);let[g,T]=Fh(l,r);FI(l,m),f.classList.add(...g);for(let E in T)f.dataset[E]=T[E];s=Ce(Ce({},s),T)}}}for(let l of a.hiddenComponents){let[c,f]=Fh(l,r);s=Ce(Ce({},s),f)}if(s.taskPriority===void 0){let[l,c]=Fh("priority",r);s=Ce(Ce({},s),c)}return s})}function II(r,e,t,n,s){return J(this,null,function*(){if(t==="description"){let{debugSettings:a}=se();a.showTaskHiddenData&&(e+=`
\u{1F41B} ${n.lineNumber} . ${n.sectionStart} . ${n.sectionIndex} . '${n.originalMarkdown}'
'${n.path}' > '${n.precedingHeader}'
`),yield s(e,r,n.path);let o=r.querySelector("blockquote"),l=o!=null?o:r,c=l.querySelector("p");if(c!==null){for(;c.firstChild;)l.insertBefore(c.firstChild,c);c.remove()}r.querySelectorAll("p").forEach(f=>{f.hasChildNodes()||f.remove()}),r.querySelectorAll(".footnotes").forEach(f=>{f.remove()})}else r.innerHTML=e})}function Fh(r,e){let t=[],n={},s=(a,o)=>{let l=LI(a);l&&(n[o]=l)};switch(r){case"description":t.push($n.description);break;case"priority":{let a=null;e.priority==="1"?a="high":e.priority==="2"?a="medium":e.priority==="4"?a="low":a="normal",n.taskPriority=a,t.push($n.priority);break}case"createdDate":{let a=e.createdDate;a&&(t.push($n.createdDate),s(a,"taskCreated"));break}case"dueDate":{let a=e.dueDate;a&&(t.push($n.dueDate),s(a,"taskDue"));break}case"startDate":{let a=e.startDate;a&&(t.push($n.startDate),s(a,"taskStart"));break}case"scheduledDate":{let a=e.scheduledDate;a&&(t.push($n.scheduledDate),s(a,"taskScheduled"));break}case"doneDate":{let a=e.doneDate;a&&(t.push($n.doneDate),s(a,"taskDone"));break}case"recurrenceRule":{t.push($n.recurrenceRule);break}}return[t,n]}function FI(r,e){if(r==="description"){let t=e.getElementsByClassName("tag");for(let n=0;n0?t+="past-":n<0&&(t+="future-"),Math.abs(n)<=xI?t+=Math.abs(n).toString()+"d":t+=AI,t)}function YI(r){let e=/["&\x00\r\n]/g,t=r.replace(e,"-");return t=t.replace(/^[-_]+/,""),t.length>0?t:null}function UI({task:r,element:e,isFilenameUnique:t}){let{recurrenceSymbol:n,startDateSymbol:s,createdDateSymbol:a,scheduledDateSymbol:o,dueDateSymbol:l,doneDateSymbol:c}=ci.tasksPluginEmoji.taskSerializer.symbols;e.addEventListener("mouseenter",()=>{let f=e.createDiv();f.addClasses(["tooltip","pop-up"]),r.recurrence&&f.createDiv().setText(`${n} ${r.recurrence.toText()}`),r.createdDate&&f.createDiv().setText(Za({signifier:a,date:r.createdDate})),r.startDate&&f.createDiv().setText(Za({signifier:s,date:r.startDate})),r.scheduledDate&&f.createDiv().setText(Za({signifier:o,date:r.scheduledDate})),r.dueDate&&f.createDiv().setText(Za({signifier:l,date:r.dueDate})),r.doneDate&&f.createDiv().setText(Za({signifier:c,date:r.doneDate}));let m=r.getLinkText({isFilenameUnique:t});m&&f.createDiv().setText(`\u{1F517} ${m}`),e.addEventListener("mouseleave",()=>{f.remove()})})}function Za({signifier:r,date:e}){return`${r} ${e.format(ae.dateFormat)} (${e.from(window.moment().startOf("day"))})`}function WI(r){let{globalFilter:e,removeGlobalFilter:t}=se();return t?r.replace(e,"").trim():r}var Xt=class{static fromPath(e){let{useFilenameAsScheduledDate:t,filenameAsDateFolders:n}=se();return!t||!this.matchesAnyFolder(n,e)?null:this.extractDateFromPath(e)}static matchesAnyFolder(e,t){return e.length===0?!0:e.some(n=>t.startsWith(n+"/"))}static extractDateFromPath(e){let t=Math.max(0,e.lastIndexOf("/")+1),n=e.lastIndexOf("."),s=e.substring(t,n),a=/(\d{4})-(\d{2})-(\d{2})/.exec(s);if(a||(a=/(\d{4})(\d{2})(\d{2})/.exec(s)),a){let o=window.moment([parseInt(a[1]),parseInt(a[2])-1,parseInt(a[3])]);if(o.isValid())return o}return null}static canApplyFallback({startDate:e,scheduledDate:t,dueDate:n}){return e===null&&n===null&&t===null}static updateTaskPath(e,t,n){let s=e.scheduledDate,a=e.scheduledDateIsInferred;return n===null?a&&(a=!1,s=null):a?s=n:this.canApplyFallback(e)&&(s=n,a=!0),new $e(er(Ce({},e),{taskLocation:e.taskLocation.fromRenamedFile(t),scheduledDate:s,scheduledDateIsInferred:a}))}static removeInferredStatusIfNeeded(e,t){let n=e.scheduledDateIsInferred?e.scheduledDate:null;return t.map(s=>(n!==null&&!n.isSame(s.scheduledDate,"day")&&(s=new $e(er(Ce({},s),{scheduledDateIsInferred:!1}))),s))}};function Su(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")}var ar=class{},ae=ar;ae.dateFormat="YYYY-MM-DD",ae.indentationRegex=/^([\s\t>]*)/,ae.listMarkerRegex=/([-*]|[0-9]+\.)/,ae.checkboxRegex=/\[(.)\]/u,ae.afterCheckboxRegex=/ *(.*)/u,ae.taskRegex=new RegExp(ar.indentationRegex.source+ar.listMarkerRegex.source+" +"+ar.checkboxRegex.source+ar.afterCheckboxRegex.source,"u"),ae.nonTaskRegex=new RegExp(ar.indentationRegex.source+ar.listMarkerRegex.source+"? *("+ar.checkboxRegex.source+")?"+ar.afterCheckboxRegex.source,"u"),ae.listItemRegex=new RegExp(ar.indentationRegex.source+ar.listMarkerRegex.source),ae.blockLinkRegex=/ \^[a-zA-Z0-9-]+$/u,ae.hashTags=/(^|\s)#[^ !@#$%^&*(),.?":{}|<>]*/g,ae.hashTagsFromEnd=new RegExp(ar.hashTags.source+"$");var $e=class{constructor({status:e,description:t,taskLocation:n,indentation:s,listMarker:a,priority:o,createdDate:l,startDate:c,scheduledDate:f,dueDate:m,doneDate:g,recurrence:T,blockLink:E,tags:v,originalMarkdown:R,scheduledDateIsInferred:C}){this._urgency=null;this.status=e,this.description=t,this.indentation=s,this.listMarker=a,this.taskLocation=n,this.tags=v,this.priority=o,this.createdDate=l,this.startDate=c,this.scheduledDate=f,this.dueDate=m,this.doneDate=g,this.recurrence=T,this.blockLink=E,this.originalMarkdown=R,this.scheduledDateIsInferred=C}static fromLine({line:e,taskLocation:t,fallbackDate:n}){let s=e.match(ae.taskRegex);if(s===null)return null;let a=s[4].trim(),{globalFilter:o}=se();if(!a.includes(o))return null;let l=a,c=s[1],f=s[2],m=s[3],g=Be.getInstance().bySymbolOrCreate(m),T=l.match(ae.blockLinkRegex),E=T!==null?T[0]:"";E!==""&&(l=l.replace(ae.blockLinkRegex,"").trim());let{taskSerializer:v}=za(),R=v.deserialize(l),C=!1;return Xt.canApplyFallback(R)&&n!==null&&(R.scheduledDate=n,C=!0),R.tags=R.tags.map(q=>q.trim()),o&&(R.tags=R.tags.filter(q=>q!==o)),new $e(er(Ce({},R),{status:g,indentation:c,listMarker:f,taskLocation:t,blockLink:E,originalMarkdown:e,scheduledDateIsInferred:C}))}toLi(e){return J(this,null,function*(){return qb(this,e)})}toString(){return za().taskSerializer.serialize(this)}toFileLineString(){return`${this.indentation}${this.listMarker} [${this.status.symbol}] ${this.toString()}`}toggle(){let e=Be.getInstance().getNextStatusOrCreate(this.status),t=null,n=null;if(e.isCompleted()){let{setDoneDate:o}=se();o&&(t=window.moment()),this.recurrence!==null&&(n=this.recurrence.next())}let s=new $e(er(Ce({},this),{status:e,doneDate:t})),a=[];if(n!==null){let{setCreatedDate:o}=se(),l=null;o&&(l=window.moment());let c=Be.getInstance().getNextStatusOrCreate(e),f=new $e(er(Ce(Ce({},this),n),{status:c,blockLink:"",createdDate:l}));a.push(f)}return a.push(s),a}get urgency(){return this._urgency===null&&(this._urgency=pn.calculate(this)),this._urgency}get path(){return this.taskLocation.path}get filename(){let e=this.path.match(/([^/]+)\.md$/);return e!==null?e[1]:null}get lineNumber(){return this.taskLocation.lineNumber}get sectionStart(){return this.taskLocation.sectionStart}get sectionIndex(){return this.taskLocation.sectionIndex}get precedingHeader(){return this.taskLocation.precedingHeader}getLinkText({isFilenameUnique:e}){let t;return e?t=this.filename:t="/"+this.path,t===null?null:(this.precedingHeader!==null&&this.precedingHeader!==t&&(t=t+" > "+this.precedingHeader),t)}static tasksListsIdentical(e,t){return e.length!==t.length?!1:e.every((n,s)=>n.identicalTo(t[s]))}identicalTo(e){let t=["status","description","path","indentation","listMarker","lineNumber","sectionStart","sectionIndex","precedingHeader","priority","blockLink","scheduledDateIsInferred"];for(let a of t)if(this[a]!==e[a])return!1;if(this.tags.length!==e.tags.length||!this.tags.every(function(a,o){return a===e.tags[o]}))return!1;t=["createdDate","startDate","scheduledDate","dueDate","doneDate"];for(let a of t){let o=this[a],l=e[a];if($r(o,l)!==0)return!1}let n=this.recurrence,s=e.recurrence;return n===null&&s!==null||n!==null&&s===null?!1:!(n&&s&&!n.identicalTo(s))}static extractHashtags(e){var t,n;return(n=(t=e.match(ae.hashTags))==null?void 0:t.map(s=>s.trim()))!=null?n:[]}getDescriptionWithoutGlobalFilter(){let{globalFilter:e}=se(),t=this.description;if(e.length===0)return t;let n=RegExp("(^|\\s)"+Su(e)+"($|\\s)","ug");return this.description.search(n)>-1&&(t=t.replace(n,"$1$2").replace(" "," ").trim()),t}};var Xa=class{constructor(e){this.fetch=e;this._value=void 0}get value(){return this._value===void 0&&(this._value=this.fetch()),this._value}};var Nt=class{constructor(e,t,n,s,a){this._path=e,this._lineNumber=t,this._sectionStart=n,this._sectionIndex=s,this._precedingHeader=a}static fromUnknownPosition(e){return new Nt(e,0,0,0,null)}fromRenamedFile(e){return new Nt(e,this.lineNumber,this.sectionStart,this.sectionIndex,this.precedingHeader)}get path(){return this._path}get lineNumber(){return this._lineNumber}get sectionStart(){return this._sectionStart}get sectionIndex(){return this._sectionIndex}get precedingHeader(){return this._precedingHeader}};var bs=class{constructor({metadataCache:e,vault:t,events:n}){this.metadataCache=e,this.metadataCacheEventReferences=[],this.vault=t,this.vaultEventReferences=[],this.events=n,this.eventsEventReferences=[],this.tasksMutex=new ko,this.state="Cold",this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.subscribeToVault(),this.subscribeToEvents(),this.loadVault()}unload(){for(let e of this.metadataCacheEventReferences)this.metadataCache.offref(e);for(let e of this.vaultEventReferences)this.vault.offref(e);for(let e of this.eventsEventReferences)this.events.off(e)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){let e=this.metadataCache.on("resolved",()=>J(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(e);let t=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(t)}subscribeToVault(){let{useFilenameAsScheduledDate:e}=se(),t=this.vault.on("create",a=>{a instanceof di.TFile&&this.tasksMutex.runExclusive(()=>{this.indexFile(a)})});this.vaultEventReferences.push(t);let n=this.vault.on("delete",a=>{a instanceof di.TFile&&this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(o=>o.path!==a.path),this.notifySubscribers()})});this.vaultEventReferences.push(n);let s=this.vault.on("rename",(a,o)=>{a instanceof di.TFile&&this.tasksMutex.runExclusive(()=>{let l=new Xa(()=>Xt.fromPath(a.path));this.tasks=this.tasks.map(c=>c.path===o?e?Xt.updateTaskPath(c,a.path,l.value):new $e(er(Ce({},c),{taskLocation:c.taskLocation.fromRenamedFile(a.path)})):c),this.notifySubscribers()})});this.vaultEventReferences.push(s)}subscribeToEvents(){let e=this.events.onRequestCacheUpdate(t=>{t({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(e)}loadVault(){return this.tasksMutex.runExclusive(()=>J(this,null,function*(){this.state="Initializing",yield Promise.all(this.vault.getMarkdownFiles().map(e=>this.indexFile(e))),this.state="Warm",this.notifySubscribers()}))}indexFile(e){return J(this,null,function*(){let t=this.metadataCache.getFileCache(e);if(t==null)return;let n=this.tasks.filter(o=>o.path===e.path),s=t.listItems,a=[];if(s!==void 0){let o=yield this.vault.cachedRead(e);a=this.getTasksFromFileContent(o,s,t,e)}$e.tasksListsIdentical(n,a)||(this.getState()=="Warm"&&console.debug(`At least one task, its line number or its heading has changed in ${e.path}: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.`),this.tasks=this.tasks.filter(o=>o.path!==e.path),this.tasks.push(...a),this.notifySubscribers())})}getTasksFromFileContent(e,t,n,s){let a=[],o=e.split(` +`),l=o.length,c=new Xa(()=>Xt.fromPath(s.path)),f=null,m=0;for(let g of t)if(g.task!==void 0){let T=g.position.start.line;if(T>=l)return console.log(`${s.path} Obsidian gave us a line number ${T} past the end of the file. ${l}.`),a;if((f===null||f.position.end.line=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var Bh=require("obsidian");var iv=require("obsidian");function cs(){}function Hl(r){return r()}function py(){return Object.create(null)}function ds(r){r.forEach(Hl)}function yy(r){return typeof r=="function"}function gy(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function _y(r){return Object.keys(r).length===0}var Ty=!1;function pk(){Ty=!0}function mk(){Ty=!1}function L(r,e){r.appendChild(e)}function Vs(r,e,t){r.insertBefore(e,t||null)}function fs(r){r.parentNode.removeChild(r)}function zl(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function by(r){return function(e){return e.preventDefault(),r.call(this,e)}}function z(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function gk(r){return Array.from(r.childNodes)}function Vl(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Or(r,e){r.value=e==null?"":e}function Kl(r,e){for(let t=0;t{let c=a.map(Hl).filter(yy);o?o.push(...c):ds(c),r.$$.on_mount=[]}),l.forEach(Ji)}function Ey(r,e){let t=r.$$;t.fragment!==null&&(ds(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Dk(r,e){r.$$.dirty[0]===-1&&(Zi.push(r),bk(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let v=D.length?D[0]:T;return h.ctx&&s(h.ctx[_],h.ctx[_]=v)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](v),m&&Dk(r,_)),T}):[],h.update(),m=!0,ds(h.before_update),h.fragment=n?n(h.ctx):!1,e.target){if(e.hydrate){pk();let _=gk(e.target);h.fragment&&h.fragment.l(_),_.forEach(fs)}else h.fragment&&h.fragment.c();e.intro&&Ek(r.$$.fragment),kk(r,e.target,e.anchor,e.customElement),mk(),wy()}Xi(c)}var Sk;typeof HTMLElement=="function"&&(Sk=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Hl).filter(yy);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){ds(this.$$.on_disconnect)}$destroy(){Ey(this,1),this.$destroy=cs}$on(r,e){let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!_y(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Lo=class{$destroy(){Ey(this,1),this.$destroy=cs}$on(e,t){let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!_y(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var jh=ns(mt());var BI={td:"today",tm:"tomorrow",yd:"yesterday",tw:"this week",nw:"next week",weekend:"sat",we:"sat"};function di(r){for(let[e,t]of Object.entries(BI))r=r.replace(RegExp(`\\b${e}\\s`,"i"),t);return r}function ev(r,e,t){let n=r.slice();return n[45]=e[t],n}function tv(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n}function GI(r){let e,t=r[50]+"",n;return{c(){e=oe("span"),n=Zt(t)},m(s,a){Vs(s,e,a),L(e,n)},p:cs,d(s){s&&fs(e)}}}function rv(r){let e,t,n,s,a,o,l,c,h=r[49]+"",m,_,T=r[50]&&r[50].charCodeAt(0)>=256,D,v,R,I,q=T&&GI(r);return{c(){e=oe("span"),t=oe("input"),o=Se(),l=oe("label"),c=oe("span"),m=Zt(h),_=Se(),q&&q.c(),v=Se(),z(t,"type","radio"),z(t,"id",n="priority-"+r[48]),t.__value=s=r[48],t.value=t.__value,z(t,"accesskey",a=r[15](r[49].charAt(0).toLowerCase())),r[33][0].push(t),z(c,"class","accesskey-first"),z(l,"for",D="priority-"+r[48])},m($,B){Vs($,e,B),L(e,t),t.checked=t.__value===r[1].priority,L(e,o),L(e,l),L(l,c),L(c,m),L(l,_),q&&q.m(l,null),L(e,v),R||(I=Ht(t,"change",r[32]),R=!0)},p($,B){B[0]&32768&&a!==(a=$[15]($[49].charAt(0).toLowerCase()))&&z(t,"accesskey",a),B[0]&3&&(t.checked=t.__value===$[1].priority),T&&q.p($,B)},d($){$&&fs(e),r[33][0].splice(r[33][0].indexOf(t),1),q&&q.d(),R=!1,I()}}}function nv(r){let e,t=r[45].name+"",n,s,a=r[45].symbol+"",o,l,c;return{c(){e=oe("option"),n=Zt(t),s=Zt(" ["),o=Zt(a),l=Zt("]"),e.__value=c=r[45],e.value=e.__value},m(h,m){Vs(h,e,m),L(e,n),L(e,s),L(e,o),L(e,l)},p(h,m){m[0]&1&&t!==(t=h[45].name+"")&&Vl(n,t),m[0]&1&&a!==(a=h[45].symbol+"")&&Vl(o,a),m[0]&1&&c!==(c=h[45])&&(e.__value=c,e.value=e.__value)},d(h){h&&fs(e)}}}function HI(r){let e,t,n,s,a,o,l,c,h,m,_,T,D,v,R,I,q,$,B,me,fe,ve,ee,te,It,yt,V,W,P,Q,Y,ue,y,g,w,E,S,M,k,C,A,N,j,ke,ye,ce,Ie,K,We,Je,Ke,Dr,Mt,Ae,st,gt,kn,Ri,qe,Ns,Kn,ft,de,Vr,Rt,Zn,so,Lr,Dn,_t,xi,cr,Kr,Le,Sn,Cs,Xn,On,Qn,dr,Mn,io,Zr,ao,fr,hr,H,Is,oo,ht,Jn,Ne,pr=r[20],Ft=[];for(let G=0;Gtion',a=Se(),o=oe("textarea"),c=Se(),h=oe("div"),m=oe("label"),_=Zt("Priority"),D=Se();for(let G=0;Gart',Ie=Se(),K=oe("input"),Je=Se(),Ke=oe("code"),Dr=Zt(r[17]),Mt=Se(),Ae=new ls(!1),st=Se(),gt=oe("div"),kn=oe("label"),kn.innerHTML=`Only - future dates:`,Ri=Se(),qe=oe("input"),Kn=Se(),ft=oe("div"),de=oe("label"),de.innerHTML='Status',Vr=Se(),Rt=oe("select");for(let G=0;Gr[39].call(Rt)),z(ft,"class","tasks-modal-section"),z(_t,"for","status"),z(cr,"id","status"),z(cr,"type","checkbox"),z(cr,"class","task-list-item-checkbox tasks-modal-checkbox"),cr.checked=Kr=r[1].status.isCompleted(),cr.disabled=!0,z(Lr,"class","tasks-modal-section tasks-modal-status"),hr.disabled=Is=!r[14],z(hr,"type","submit"),z(hr,"class","mod-cta"),z(ht,"type","button"),z(fr,"class","tasks-modal-section tasks-modal-buttons"),Mr(t,"with-accesskeys",r[9]),z(e,"class","tasks-modal")},m(G,ne){Vs(G,e,ne),L(e,t),L(t,n),L(n,s),L(n,a),L(n,o),Or(o,r[1].description),r[31](o),L(t,c),L(t,h),L(h,m),L(m,_),L(h,D);for(let le=0;leno ${K} date`;let Ke=jh.parseDate(We,Je,{forwardDate:Je!=null});return Ke!==null?window.moment(Ke).format("YYYY-MM-DD"):`invalid ${K} date`}function Y(K,We){return Q(K,We,v.forwardOnly?new Date:void 0)}function ue(K){let We=null,Je=jh.parseDate(K,new Date,{forwardDate:v.forwardOnly});return Je!==null&&(We=window.moment(Je)),We}Zl(()=>{let{globalFilter:K,provideAccessKeys:We}=se();t(9,V=We);let Je=a.getDescriptionWithoutGlobalFilter();(Je!=a.description||Je.indexOf(K)==-1)&&(yt=!0);let Ke="none";a.priority==="4"?Ke="low":a.priority==="2"?Ke="medium":a.priority==="1"&&(Ke="high"),t(1,v={description:Je,status:a.status,priority:Ke,recurrenceRule:a.recurrence?a.recurrence.toText():"",createdDate:a.createdDate?a.createdDate.format("YYYY-MM-DD"):"",startDate:a.startDate?a.startDate.format("YYYY-MM-DD"):"",scheduledDate:a.scheduledDate?a.scheduledDate.format("YYYY-MM-DD"):"",dueDate:a.dueDate?a.dueDate.format("YYYY-MM-DD"):"",doneDate:a.doneDate?a.doneDate.format("YYYY-MM-DD"):"",forwardOnly:!0}),setTimeout(()=>{D.focus()},10)});let y=K=>{if(K.key&&!K.altKey&&!K.ctrlKey){let We=P.find(Je=>Je.label.charAt(0).toLowerCase()==K.key);We&&t(1,v.priority=We.value,v)}},g=()=>{o([])},w=K=>{K.key==="Enter"&&(K.preventDefault(),W&&S())},E=()=>{setTimeout(()=>{t(1,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},S=()=>{let{globalFilter:K}=se(),We=v.description.trim();yt&&(We=K+" "+We);let Je=ue(v.startDate),Ke=ue(v.scheduledDate),Dr=ue(v.dueDate),Mt=null;v.recurrenceRule&&(Mt=Tt.fromText({recurrenceRuleText:v.recurrenceRule,startDate:Je,scheduledDate:Ke,dueDate:Dr}));let Ae;switch(v.priority){case"low":Ae="4";break;case"medium":Ae="2";break;case"high":Ae="1";break;default:Ae="3"}let st=new je(Object.assign(Object.assign({},a),{description:We,status:v.status,priority:Ae,recurrence:Mt,startDate:Je,scheduledDate:Ke,dueDate:Dr,doneDate:window.moment(v.doneDate,"YYYY-MM-DD").isValid()?window.moment(v.doneDate,"YYYY-MM-DD"):null}));o([st])},M=[[]];function k(){v.description=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function C(K){Fo[K?"unshift":"push"](()=>{D=K,t(10,D)})}function A(){v.priority=this.__value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function N(){v.recurrenceRule=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function j(){v.dueDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function ke(){v.scheduledDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function ye(){v.startDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function ce(){v.forwardOnly=this.checked,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function Ie(){v.status=vy(this),t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}return r.$$set=K=>{"task"in K&&t(26,a=K.task),"onSubmit"in K&&t(27,o=K.onSubmit),"statusOptions"in K&&t(0,l=K.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=K=>V?K:null)}if(r.$$.dirty[0]&66){e:t(1,v.dueDate=di(v.dueDate),v),t(6,fe=Y("due",v.dueDate)),t(7,ve=!fe.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,v.startDate=di(v.startDate),v),t(2,q=Y("start",v.startDate)),t(3,$=!q.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,v.scheduledDate=di(v.scheduledDate),v),t(4,B=Y("scheduled",v.scheduledDate)),t(5,me=!B.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,te=!0),!v.recurrenceRule)t(12,ee="not recurring");else{let K=t(28,s=Tt.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();K?t(12,ee=K):(t(12,ee="invalid recurrence rule"),t(8,te=!1))}}if(r.$$.dirty[0]&2){e:t(29,R=v.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,W=ve&&te&&me&&$&&R)}if(r.$$.dirty[0]&2){e:t(11,I=Q("created",v.createdDate)),t(13,It=Q("done",v.doneDate))}},[l,v,q,$,B,me,fe,ve,te,V,D,I,ee,It,W,n,h,m,_,T,P,y,g,w,E,S,a,o,s,R,k,C,A,M,N,j,ke,ye,ce,Ie]}var $h=class extends Lo{constructor(e){super(),ky(this,e,zI,HI,gy,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},sv=$h;var Bn=class extends iv.Modal{constructor({app:t,task:n,onSubmit:s}){super(t);this.task=n,this.onSubmit=a=>{a.length&&s(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new sv({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=$e.getInstance().registeredStatuses;return $e.getInstance().bySymbol(this.task.status.symbol)===he.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};var Ru=({line:r,path:e})=>{var v,R;let t=Kt.fromPath(e),n=je.fromLine({line:r,taskLocation:Pt.fromUnknownPosition(e),fallbackDate:t});if(n!==null)return n;let{setCreatedDate:s}=se(),a=null;s&&(a=window.moment());let o=r.match(ae.nonTaskRegex);if(o===null)return console.error("Tasks: Cannot create task on line:",r),new je({status:he.TODO,description:"",taskLocation:Pt.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let l=o[1],c=(v=o[2])!=null?v:"-",h=(R=o[4])!=null?R:" ",m=$e.getInstance().bySymbolOrCreate(h),_=o[5],T=r.match(ae.blockLinkRegex),D=T!==null?T[0]:"";return D!==""&&(_=_.replace(ae.blockLinkRegex,"")),new je({status:m,description:_,taskLocation:Pt.fromUnknownPosition(e),indentation:l,listMarker:c,blockLink:D,priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var av=(r,e,t,n)=>{var _;if(r)return t instanceof Bh.MarkdownView;if(!(t instanceof Bh.MarkdownView))return;let s=(_=t.file)==null?void 0:_.path;if(s===void 0)return;let o=e.getCursor().line,l=e.getLine(o),c=Ru({line:l,path:s}),h=T=>{let D=Kt.removeInferredStatusIfNeeded(c,T).map(v=>v.toFileLineString()).join(` -`);e.setLine(o,D)};new Bn({app:n,task:c,onSubmit:h}).open()};var Gh=require("obsidian");var ov=(r,e,t)=>{var c;if(r)return t instanceof Gh.MarkdownView;if(!(t instanceof Gh.MarkdownView))return;let n=(c=t.file)==null?void 0:c.path;if(n===void 0)return;let s=e.getCursor(),a=s.line,o=e.getLine(a),l=VI(o,n);e.setLine(a,l.text),e.setCursor(KI(s,l))},VI=(r,e)=>{let t=je.fromLine({line:r,taskLocation:Pt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggle().map(s=>s.toFileLineString());return{text:n.join(` -`),moveTo:{line:n.length-1}}}else{let n=r.match(ae.taskRegex);if(n!==null){let s=n[3],o=$e.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(ae.taskRegex,`$1- [${o}] $4`)}}else if(ae.listItemRegex.test(r)){let s=r.replace(ae.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(ae.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},KI=(r,e)=>{var a;let t={line:0,ch:r.ch},n=Qe(Qe({},t),(a=e.moveTo)!=null?a:{}),s=e.text.split(` -`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var xu=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>av(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:ov})}};var Pu=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var Au=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return J(this,null,function*(){var m;let{globalFilter:n}=se(),s=e.findAll(".task-list-item").filter(_=>{var v;let T=(v=_.textContent)==null?void 0:v.split(` -`);if(T===void 0)return!1;let D=null;for(let R=0;Ruv.ViewPlugin.fromClass(Hh),Hh=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let T=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. -If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(T),new lv.Notice(T,45e3)}return!1}let{state:s}=this.view,a=this.view.posAtDOM(t),o=s.doc.lineAt(a),l=je.fromLine({line:o.text,taskLocation:Pt.fromUnknownPosition(""),fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${a} Line: ${o.text}`),l===null)return!1;e.preventDefault();let h=l.toggle().map(T=>T.toFileLineString()).join(s.lineBreak),m=s.update({changes:{from:o.from,to:o.to,insert:h}});this.view.dispatch(m);let _=t.checked;return setTimeout(()=>{t.checked=_},1),!0}};var al=require("obsidian");var gn=class{constructor(e,t,n){this.property=e,this.comparator=gn.maybeReverse(n,t)}static maybeReverse(e,t){return e?gn.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var fi=class{constructor(e,t){this.property=e,this.grouper=t}};var ze=class{canCreateFilterForLine(e){return ze.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return No(this.fieldNameSingular())}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?ze.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=ze.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new gn(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(){return new fi(this.fieldNameSingular(),this.grouper())}};var ot=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new ot("None of",e,"NOT")}static booleanXor(e){return new ot("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e+`${this.symbol}`;this.children.length>1&&(t+=` (${this.description})`),t+=":";let n=e+" ";for(let s=0;s=e)return n;return null}static getPrecedingHeader(e,t){if(t===void 0)return null;let n=null;for(let s of t){if(s.position.start.line>e)return n;n=s.heading}return n}};var zh=require("obsidian");var av=require("obsidian");function ws(){}function Uh(r){return r()}function Bb(){return Object.create(null)}function ks(r){r.forEach(Uh)}function Hb(r){return typeof r=="function"}function zb(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function Vb(r){return Object.keys(r).length===0}var Kb=!1;function qI(){Kb=!0}function jI(){Kb=!1}function L(r,e){r.appendChild(e)}function fi(r,e,t){r.insertBefore(e,t||null)}function Ds(r){r.parentNode.removeChild(r)}function Wh(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function Zb(r){return function(e){return e.preventDefault(),r.call(this,e)}}function z(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function BI(r){return Array.from(r.childNodes)}function qh(r,e){e=""+e,r.wholeText!==e&&(r.data=e)}function Nr(r,e){r.value=e==null?"":e}function jh(r,e){for(let t=0;t{let c=a.map(Uh).filter(Hb);o?o.push(...c):ks(c),r.$$.on_mount=[]}),l.forEach(to)}function Jb(r,e){let t=r.$$;t.fragment!==null&&(ks(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function QI(r,e){r.$$.dirty[0]===-1&&(Qa.push(r),zI(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let v=E.length?E[0]:T;return f.ctx&&s(f.ctx[g],f.ctx[g]=v)&&(!f.skip_bound&&f.bound[g]&&f.bound[g](v),m&&QI(r,g)),T}):[],f.update(),m=!0,ks(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){qI();let g=BI(e.target);f.fragment&&f.fragment.l(g),g.forEach(Ds)}else f.fragment&&f.fragment.c();e.intro&&ZI(r.$$.fragment),XI(r,e.target,e.anchor,e.customElement),jI(),Qb()}Ja(c)}var JI;typeof HTMLElement=="function"&&(JI=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:r}=this.$$;this.$$.on_disconnect=r.map(Uh).filter(Hb);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(r,e,t){this[r]=t}disconnectedCallback(){ks(this.$$.on_disconnect)}$destroy(){Jb(this,1),this.$destroy=ws}$on(r,e){let t=this.$$.callbacks[r]||(this.$$.callbacks[r]=[]);return t.push(e),()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)}}$set(r){this.$$set&&!Vb(r)&&(this.$$.skip_bound=!0,this.$$set(r),this.$$.skip_bound=!1)}});var Pu=class{$destroy(){Jb(this,1),this.$destroy=ws}$on(e,t){let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!Vb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Gh=ns(ht());function tv(r,e,t){let n=r.slice();return n[45]=e[t],n}function rv(r,e,t){let n=r.slice();return n[48]=e[t].value,n[49]=e[t].label,n[50]=e[t].symbol,n}function eF(r){let e,t=r[50]+"",n;return{c(){e=oe("span"),n=Qt(t)},m(s,a){fi(s,e,a),L(e,n)},p:ws,d(s){s&&Ds(e)}}}function nv(r){let e,t,n,s,a,o,l,c,f=r[49]+"",m,g,T=r[50]&&r[50].charCodeAt(0)>=256,E,v,R,C,q=T&&eF(r);return{c(){e=oe("span"),t=oe("input"),o=Se(),l=oe("label"),c=oe("span"),m=Qt(f),g=Se(),q&&q.c(),v=Se(),z(t,"type","radio"),z(t,"id",n="priority-"+r[48]),t.__value=s=r[48],t.value=t.__value,z(t,"accesskey",a=r[15](r[49].charAt(0).toLowerCase())),r[33][0].push(t),z(c,"class","accesskey-first"),z(l,"for",E="priority-"+r[48])},m($,B){fi($,e,B),L(e,t),t.checked=t.__value===r[1].priority,L(e,o),L(e,l),L(l,c),L(c,m),L(l,g),q&&q.m(l,null),L(e,v),R||(C=Ht(t,"change",r[32]),R=!0)},p($,B){B[0]&32768&&a!==(a=$[15]($[49].charAt(0).toLowerCase()))&&z(t,"accesskey",a),B[0]&3&&(t.checked=t.__value===$[1].priority),T&&q.p($,B)},d($){$&&Ds(e),r[33][0].splice(r[33][0].indexOf(t),1),q&&q.d(),R=!1,C()}}}function sv(r){let e,t=r[45].name+"",n,s,a=r[45].symbol+"",o,l,c;return{c(){e=oe("option"),n=Qt(t),s=Qt(" ["),o=Qt(a),l=Qt("]"),e.__value=c=r[45],e.value=e.__value},m(f,m){fi(f,e,m),L(e,n),L(e,s),L(e,o),L(e,l)},p(f,m){m[0]&1&&t!==(t=f[45].name+"")&&qh(n,t),m[0]&1&&a!==(a=f[45].symbol+"")&&qh(o,a),m[0]&1&&c!==(c=f[45])&&(e.__value=c,e.value=e.__value)},d(f){f&&Ds(e)}}}function tF(r){let e,t,n,s,a,o,l,c,f,m,g,T,E,v,R,C,q,$,B,me,fe,ve,ee,te,Ct,mt,V,W,x,Q,Y,ue,y,_,w,k,S,M,D,I,A,N,j,De,ye,ce,Fe,K,qe,Je,Ze,Dr,Ot,Ae,nt,yt,kn,Ri,je,Ns,Kn,dt,de,zr,Mt,Zn,ao,Fr,Dn,gt,Pi,lr,Vr,Ye,En,Cs,Xn,Sn,Qn,cr,On,oo,Kr,uo,dr,fr,H,Is,lo,ft,Jn,Ne,hr=r[20],It=[];for(let G=0;Gtion',a=Se(),o=oe("textarea"),c=Se(),f=oe("div"),m=oe("label"),g=Qt("Priority"),E=Se();for(let G=0;Gart',Fe=Se(),K=oe("input"),Je=Se(),Ze=oe("code"),Dr=Qt(r[17]),Ot=Se(),Ae=new vs(!1),nt=Se(),yt=oe("div"),kn=oe("label"),kn.innerHTML=`Only + future dates:`,Ri=Se(),je=oe("input"),Kn=Se(),dt=oe("div"),de=oe("label"),de.innerHTML='Status',zr=Se(),Mt=oe("select");for(let G=0;Gr[39].call(Mt)),z(dt,"class","tasks-modal-section"),z(gt,"for","status"),z(lr,"id","status"),z(lr,"type","checkbox"),z(lr,"class","task-list-item-checkbox tasks-modal-checkbox"),lr.checked=Vr=r[1].status.isCompleted(),lr.disabled=!0,z(Fr,"class","tasks-modal-section tasks-modal-status"),fr.disabled=Is=!r[14],z(fr,"type","submit"),z(fr,"class","mod-cta"),z(ft,"type","button"),z(dr,"class","tasks-modal-section tasks-modal-buttons"),Cr(t,"with-accesskeys",r[9]),z(e,"class","tasks-modal")},m(G,ne){fi(G,e,ne),L(e,t),L(t,n),L(n,s),L(n,a),L(n,o),Nr(o,r[1].description),r[31](o),L(t,c),L(t,f),L(f,m),L(m,g),L(f,E);for(let le=0;leno ${K} date`;let Ze=Gh.parseDate(qe,Je,{forwardDate:Je!=null});return Ze!==null?window.moment(Ze).format("YYYY-MM-DD"):`invalid ${K} date`}function Y(K,qe){return Q(K,qe,v.forwardOnly?new Date:void 0)}function ue(K){let qe=null,Je=Gh.parseDate(K,new Date,{forwardDate:v.forwardOnly});return Je!==null&&(qe=window.moment(Je)),qe}$h(()=>{let{globalFilter:K,provideAccessKeys:qe}=se();t(9,V=qe);let Je=a.getDescriptionWithoutGlobalFilter();(Je!=a.description||Je.indexOf(K)==-1)&&(mt=!0);let Ze="none";a.priority==="4"?Ze="low":a.priority==="2"?Ze="medium":a.priority==="1"&&(Ze="high"),t(1,v={description:Je,status:a.status,priority:Ze,recurrenceRule:a.recurrence?a.recurrence.toText():"",createdDate:a.createdDate?a.createdDate.format("YYYY-MM-DD"):"",startDate:a.startDate?a.startDate.format("YYYY-MM-DD"):"",scheduledDate:a.scheduledDate?a.scheduledDate.format("YYYY-MM-DD"):"",dueDate:a.dueDate?a.dueDate.format("YYYY-MM-DD"):"",doneDate:a.doneDate?a.doneDate.format("YYYY-MM-DD"):"",forwardOnly:!0}),setTimeout(()=>{E.focus()},10)});let y=K=>{if(K.key&&!K.altKey&&!K.ctrlKey){let qe=x.find(Je=>Je.label.charAt(0).toLowerCase()==K.key);qe&&t(1,v.priority=qe.value,v)}},_=()=>{o([])},w=K=>{K.key==="Enter"&&(K.preventDefault(),W&&S())},k=()=>{setTimeout(()=>{t(1,v.description=v.description.replace(/[\r\n]+/g," "),v)},0)},S=()=>{let{globalFilter:K}=se(),qe=v.description.trim();mt&&(qe=K+" "+qe);let Je=ue(v.startDate),Ze=ue(v.scheduledDate),Dr=ue(v.dueDate),Ot=null;v.recurrenceRule&&(Ot=Et.fromText({recurrenceRuleText:v.recurrenceRule,startDate:Je,scheduledDate:Ze,dueDate:Dr}));let Ae;switch(v.priority){case"low":Ae="4";break;case"medium":Ae="2";break;case"high":Ae="1";break;default:Ae="3"}let nt=new $e(Object.assign(Object.assign({},a),{description:qe,status:v.status,priority:Ae,recurrence:Ot,startDate:Je,scheduledDate:Ze,dueDate:Dr,doneDate:window.moment(v.doneDate,"YYYY-MM-DD").isValid()?window.moment(v.doneDate,"YYYY-MM-DD"):null}));o([nt])},M=[[]];function D(){v.description=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function I(K){Ru[K?"unshift":"push"](()=>{E=K,t(10,E)})}function A(){v.priority=this.__value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function N(){v.recurrenceRule=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function j(){v.dueDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function De(){v.scheduledDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function ye(){v.startDate=this.value,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function ce(){v.forwardOnly=this.checked,t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}function Fe(){v.status=Xb(this),t(1,v),t(6,fe),t(2,q),t(4,B),t(0,l)}return r.$$set=K=>{"task"in K&&t(26,a=K.task),"onSubmit"in K&&t(27,o=K.onSubmit),"statusOptions"in K&&t(0,l=K.statusOptions)},r.$$.update=()=>{if(r.$$.dirty[0]&512){e:t(15,n=K=>V?K:null)}if(r.$$.dirty[0]&66){e:t(1,v.dueDate=ii(v.dueDate),v),t(6,fe=Y("due",v.dueDate)),t(7,ve=!fe.includes("invalid"))}if(r.$$.dirty[0]&6){e:t(1,v.startDate=ii(v.startDate),v),t(2,q=Y("start",v.startDate)),t(3,$=!q.includes("invalid"))}if(r.$$.dirty[0]&18){e:t(1,v.scheduledDate=ii(v.scheduledDate),v),t(4,B=Y("scheduled",v.scheduledDate)),t(5,me=!B.includes("invalid"))}if(r.$$.dirty[0]&268435458){e:if(t(8,te=!0),!v.recurrenceRule)t(12,ee="not recurring");else{let K=t(28,s=Et.fromText({recurrenceRuleText:v.recurrenceRule,startDate:null,scheduledDate:null,dueDate:null}))===null||s===void 0?void 0:s.toText();K?t(12,ee=K):(t(12,ee="invalid recurrence rule"),t(8,te=!1))}}if(r.$$.dirty[0]&2){e:t(29,R=v.description.trim()!=="")}if(r.$$.dirty[0]&536871336){e:t(14,W=ve&&te&&me&&$&&R)}if(r.$$.dirty[0]&2){e:t(11,C=Q("created",v.createdDate)),t(13,Ct=Q("done",v.doneDate))}},[l,v,q,$,B,me,fe,ve,te,V,E,C,ee,Ct,W,n,f,m,g,T,x,y,_,w,k,S,a,o,s,R,D,I,A,M,N,j,De,ye,ce,Fe]}var Hh=class extends Pu{constructor(e){super(),ev(this,e,rF,tF,zb,{task:26,onSubmit:27,statusOptions:0},null,[-1,-1])}},iv=Hh;var Bn=class extends av.Modal{constructor({app:t,task:n,onSubmit:s}){super(t);this.task=n,this.onSubmit=a=>{a.length&&s(a),this.close()}}onOpen(){this.titleEl.setText("Create or edit Task");let{contentEl:t}=this,n=this.getKnownStatusesAndCurrentTaskStatusIfNotKnown();new iv({target:t,props:{task:this.task,statusOptions:n,onSubmit:this.onSubmit}})}getKnownStatusesAndCurrentTaskStatusIfNotKnown(){let t=Be.getInstance().registeredStatuses;return Be.getInstance().bySymbol(this.task.status.symbol)===pe.EMPTY&&t.push(this.task.status),t}onClose(){let{contentEl:t}=this;t.empty()}};var xu=({line:r,path:e})=>{var v,R;let t=Xt.fromPath(e),n=$e.fromLine({line:r,taskLocation:Nt.fromUnknownPosition(e),fallbackDate:t});if(n!==null)return n;let{setCreatedDate:s}=se(),a=null;s&&(a=window.moment());let o=r.match(ae.nonTaskRegex);if(o===null)return console.error("Tasks: Cannot create task on line:",r),new $e({status:pe.TODO,description:"",taskLocation:Nt.fromUnknownPosition(e),indentation:"",listMarker:"-",priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,blockLink:"",tags:[],originalMarkdown:"",scheduledDateIsInferred:!1});let l=o[1],c=(v=o[2])!=null?v:"-",f=(R=o[4])!=null?R:" ",m=Be.getInstance().bySymbolOrCreate(f),g=o[5],T=r.match(ae.blockLinkRegex),E=T!==null?T[0]:"";return E!==""&&(g=g.replace(ae.blockLinkRegex,"")),new $e({status:m,description:g,taskLocation:Nt.fromUnknownPosition(e),indentation:l,listMarker:c,blockLink:E,priority:"3",createdDate:a,startDate:null,scheduledDate:null,dueDate:null,doneDate:null,recurrence:null,tags:[],originalMarkdown:"",scheduledDateIsInferred:!1})};var ov=(r,e,t,n)=>{var g;if(r)return t instanceof zh.MarkdownView;if(!(t instanceof zh.MarkdownView))return;let s=(g=t.file)==null?void 0:g.path;if(s===void 0)return;let o=e.getCursor().line,l=e.getLine(o),c=xu({line:l,path:s}),f=T=>{let E=Xt.removeInferredStatusIfNeeded(c,T).map(v=>v.toFileLineString()).join(` +`);e.setLine(o,E)};new Bn({app:n,task:c,onSubmit:f}).open()};var Vh=require("obsidian");var uv=(r,e,t)=>{var c;if(r)return t instanceof Vh.MarkdownView;if(!(t instanceof Vh.MarkdownView))return;let n=(c=t.file)==null?void 0:c.path;if(n===void 0)return;let s=e.getCursor(),a=s.line,o=e.getLine(a),l=nF(o,n);e.setLine(a,l.text),e.setCursor(sF(s,l))},nF=(r,e)=>{let t=$e.fromLine({line:r,taskLocation:Nt.fromUnknownPosition(e),fallbackDate:null});if(t!==null){let n=t.toggle().map(s=>s.toFileLineString());return{text:n.join(` +`),moveTo:{line:n.length-1}}}else{let n=r.match(ae.taskRegex);if(n!==null){let s=n[3],o=Be.getInstance().bySymbol(s).nextStatusSymbol;return{text:r.replace(ae.taskRegex,`$1- [${o}] $4`)}}else if(ae.listItemRegex.test(r)){let s=r.replace(ae.listItemRegex,"$1$2 [ ]");return{text:s,moveTo:{ch:s.length}}}else{let s=r.replace(ae.indentationRegex,"$1- ");return{text:s,moveTo:{ch:s.length}}}}},sF=(r,e)=>{var a;let t={line:0,ch:r.ch},n=Ce(Ce({},t),(a=e.moveTo)!=null?a:{}),s=e.text.split(` +`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,s)}};var Au=class{get app(){return this.plugin.app}constructor({plugin:e}){this.plugin=e,e.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(t,n,s)=>ov(t,n,s,this.app)}),e.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:uv})}};var Nu=class{constructor({obsidianEvents:e}){this.obsidianEvents=e}onCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:cache-update",e)}triggerCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",e)}onRequestCacheUpdate(e){return this.obsidianEvents.on("obsidian-tasks-plugin:request-cache-update",e)}triggerRequestCacheUpdate(e){this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",e)}off(e){this.obsidianEvents.offref(e)}};var Cu=class{constructor({plugin:e}){this.markdownPostProcessor=this._markdownPostProcessor.bind(this);e.registerMarkdownPostProcessor(this._markdownPostProcessor.bind(this))}_markdownPostProcessor(e,t){return J(this,null,function*(){var m;let{globalFilter:n}=se(),s=e.findAll(".task-list-item").filter(g=>{var v;let T=(v=g.textContent)==null?void 0:v.split(` +`);if(T===void 0)return!1;let E=null;for(let R=0;Rlv.ViewPlugin.fromClass(Kh),Kh=class{constructor(e){this.view=e,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(e){let{target:t}=e;if(!t||!(t instanceof HTMLInputElement)||t.type!=="checkbox")return!1;let n=t.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let T=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview. +If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(T),new cv.Notice(T,45e3)}return!1}let{state:s}=this.view,a=this.view.posAtDOM(t),o=s.doc.lineAt(a),l=$e.fromLine({line:o.text,taskLocation:Nt.fromUnknownPosition(""),fallbackDate:null});if(console.debug(`Live Preview Extension: toggle called. Position: ${a} Line: ${o.text}`),l===null)return!1;e.preventDefault();let f=l.toggle().map(T=>T.toFileLineString()).join(s.lineBreak),m=s.update({changes:{from:o.from,to:o.to,insert:f}});this.view.dispatch(m);let g=t.checked;return setTimeout(()=>{t.checked=g},1),!0}};var ol=require("obsidian");var yn=class{constructor(e,t,n){this.property=e,this.comparator=yn.maybeReverse(n,t)}static maybeReverse(e,t){return e?yn.makeReversedComparator(t):t}static makeReversedComparator(e){return(t,n)=>e(t,n)*-1}};var hi=class{constructor(e,t){this.property=e,this.grouper=t}};var Ve=class{canCreateFilterForLine(e){return Ve.lineMatchesFilter(this.filterRegExp(),e)}static lineMatchesFilter(e,t){return e?e.test(t):!1}static getMatch(e,t){return e?t.match(e):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Su(this.fieldNameSingular())}supportsSorting(){return!1}parseSortLine(e){return!this.supportsSorting()||!this.canCreateSorterForLine(e)?null:this.createSorterFromLine(e)}canCreateSorterForLine(e){return this.supportsSorting()?Ve.lineMatchesFilter(this.sorterRegExp(),e):!1}createSorterFromLine(e){if(!this.supportsSorting())return null;let t=Ve.getMatch(this.sorterRegExp(),e);if(t===null)return null;let n=!!t[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`)}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(e){return new yn(this.fieldNameSingular(),this.comparator(),e)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(){return new hi(this.fieldNameSingular(),this.grouper())}};var at=class{constructor(e,t=[],n=""){this.description=e,this.symbol=n,this.children=t}static booleanAnd(e){return this.combineOrCreateExplanation("All of",e,"AND")}static booleanOr(e){return this.combineOrCreateExplanation("At least one of",e,"OR")}static booleanNot(e){return new at("None of",e,"NOT")}static booleanXor(e){return new at("Exactly one of",e,"XOR")}asString(e=""){if(this.children.length==0)return e+this.description;let t=e+`${this.symbol}`;this.children.length>1&&(t+=` (${this.description})`),t+=":";let n=e+" ";for(let s=0;s ${t.asString(" ")} -`}},Ve=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new Ve(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new Ve(e);return n.error=t,n}};var Nu=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new Ve(e);return e===this._instruction?(t.filter=new er(e,this._filter,new ot(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var Hr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Nu(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let s=n.createFilterOrErrorMessage(e);if(s.error===void 0)return s}let t=new Ve(e);return t.error=`do not understand filter: ${e}`,t}};var Gn=class extends ze{constructor(){super(...arguments);this._filters=new Hr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var _n=class extends Gn{constructor(){super(),this._filters.add("done",e=>e.status.type==="DONE"||e.status.type==="CANCELLED"||e.status.type==="NON_TASK"),this._filters.add("not done",e=>e.status.type==="TODO"||e.status.type==="IN_PROGRESS")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=_n.oldStatusName(e),s=_n.oldStatusName(t);return ns?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}};var Cu=ns(mt()),hi=ns(Fl()),ks=class{static parseDate(e,t=!1){return window.moment(Cu.parseDate(e,void 0,{forwardDate:t})).startOf("day")}static parseDateRange(e){let t=Cu.parse(e,void 0,{forwardDate:!0});if(t.length===0)return[hi.default.invalid(),hi.default.invalid()];let n=t[0].start,s=t[1]&&t[1].start?t[1].start:n,a=window.moment(n.date()),o=window.moment(s.date()),l=[a,o];o.isBefore(a)&&(l=[o,a]);let c=/(last|this|next) (week|month|quarter|year)/,h=e.match(c);if(h&&h.length===3){let m=h[1],_=hi.default.duration(),T=h[2];switch(T){case"month":case"quarter":case"year":case"week":_.add(1,T)}switch(l=[(0,hi.default)(),(0,hi.default)()],m){case"last":l.forEach(D=>D.subtract(_));break;case"next":l.forEach(D=>D.add(_));break}switch(T){case"month":case"quarter":case"year":l=[l[0].startOf(T),l[1].endOf(T)];break;case"week":l=[l[0].startOf("isoWeek"),l[1].endOf("isoWeek")];break}}return l.forEach(m=>m.startOf("day")),l}};var Wt=class extends ze{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Hr,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let s=new Ve(t),a=ze.getMatch(this.filterRegExp(),t);if(a!==null){let o=a[1],l=a[2],c=ks.parseDateRange(l);if(!c[0].isValid()||!c[1].isValid())s.error="do not understand "+this.fieldName()+" date";else{let h=this.buildFilterFunction(o,c),m=Wt.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),c);s.filter=new er(t,h,new ot(m))}}else s.error="do not understand query filter ("+this.fieldName()+" date)";return s}buildFilterFunction(t,n){let s;return t==="before"?s=a=>a?a.isBefore(n[0]):this.filterResultIfFieldMissing():t==="after"?s=a=>a?a.isAfter(n[1]):this.filterResultIfFieldMissing():s=a=>a?a.isSameOrAfter(n[0])&&a.isSameOrBefore(n[1]):this.filterResultIfFieldMissing(),this.getFilter(s)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (before|after|on|in)? ?(.*)`)}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,s,a){let o,l="YYYY-MM-DD (dddd Do MMMM YYYY)",c;switch(n){case"before":o=n,c=a[0].format(l);break;case"after":o=n,c=a[1].format(l);break;default:a[0].isSame(a[1])?(o="on",c=a[0].format(l)):(o="between",c=`${a[0].format(l)} and ${a[1].format(l)} inclusive`);break}let h=`${t} date is ${o} ${c}`;return s&&(h+=` OR no ${t} date`),h}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>Ur(this.date(t),this.date(n))}};var pi=class extends Wt{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var zh=class extends ze{createFilterOrErrorMessage(e){let t=new Ve(e),n=ze.getMatch(this.filterRegExp(),e);if(n!==null){let s=n[5],a=null;switch(s){case"low":a="4";break;case"none":a="3";break;case"medium":a="2";break;case"high":a="1";break}if(a===null)return t.error="do not understand priority",t;let o=e,l;switch(n[3]){case"above":l=c=>c.priority.localeCompare(a)<0;break;case"below":l=c=>c.priority.localeCompare(a)>0;break;case"not":l=c=>c.priority!==a;break;default:l=c=>c.priority===a,o=`${this.fieldName()} is ${s}`}t.filter=new er(e,l,new ot(o))}else t.error="do not understand query filter (priority)";return t}fieldName(){return"priority"}filterRegExp(){return zh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}},Ds=zh;Ds.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(low|none|medium|high))$/;var mi=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var yi=class extends mi{constructor(t){super();this.stringToFind=t}matches(t){return yi.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}};var gi=class extends mi{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/,s=t.match(n);if(s!==null){let a=new RegExp(s[1],s[2]);return new gi(a)}else return null}matches(t){return t.match(this.regex)!==null}};var qt=class extends ze{createFilterOrErrorMessage(e){let t=ze.getMatch(this.filterRegExp(),e);if(t===null)return Ve.fromError(e,`do not understand query filter (${this.fieldName()})`);let[n,s,a]=t,o=null;if(s.includes("include"))o=new yi(a);else if(s.includes("regex")&&(o=gi.validateAndConstruct(a),o===null))return Ve.fromError(e,`cannot parse regex (${this.fieldName()}); check your leading and trailing slashes for your query`);if(o===null)return Ve.fromError(e,`do not understand query filter (${this.fieldName()})`);let l=s.match(/not/)!==null,c=new er(e,this.getFilter(o,l),new ot(e));return Ve.fromFilter(c)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`)}getFilter(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}};var _i=class extends qt{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}};var Ti=class extends ze{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return Ve.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}};var bi=class{static by(e,t){let n=[new Ti().comparator(),new _n().comparator(),new pi().comparator(),new Ds().comparator(),new _i().comparator()],s=[];for(let a of e)s.push(a.comparator);return t.sort(bi.makeCompositeComparator([...s,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let s of e){let a=s(t,n);if(a!==0)return a}return 0}}};var Ss=class extends qt{fieldName(){return"description"}value(e){let t=se().globalFilter;return e.description.replace(t,"").trim()}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Ss.cleanDescription(e.description),s=Ss.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){let t=se().globalFilter;e=e.replace(t,"").trim();let n=/^\[\[?([^\]]*)]]?/,s=e.match(n);if(s!==null){let a=s[1];e=a.substring(a.indexOf("|")+1)+e.replace(n,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Iu=class extends Wt{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Fu=class extends Wt{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Lu=class extends Gn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var Yu=class extends qt{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}};var Uu=class extends Wt{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var Wu=class extends Wt{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Hn=class extends Wt{constructor(){let e=new Hr;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return Array.of(e.startDate,e.scheduledDate,e.dueDate)}earliestDate(e){return new Hn().dates(e).sort(Ur)[0]}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var qu=class extends Gn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}};var ju=class extends qt{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let s=e.matchesAnyOf(this.values(n));return t?!s:s}}};var Os=class extends ju{constructor(){super();this.filterInstructions=new Hr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],a=isNaN(+n[2])?1:+n[2],o=Os.makeCompareByTagComparator(a);return new gn(this.fieldNameSingular(),o,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/}comparator(){return Os.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let a=t-1;if(n.tags.length=t)return 1;if(s.tags.length=t)return-1;if(n.tags.lengththis.filterTaskWithParsedQuery(c,a),l=this.constructExplanation(a);return n.filter=new er(t,o,l),n}catch(a){let o=a instanceof Error?a.message:"unknown error type";return n.error=`malformed boolean query -- ${o} (check the documentation for guidelines)`,n}return n}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n){let s=l=>l==="true",a=l=>l?"true":"false",o=[];for(let l of n)if(l.name==="IDENTIFIER"){if(l.value==null)throw Error("null token value");let h=this.subFields[l.value.trim()].filterFunction(t);o.push(a(h))}else if(l.name==="OPERATOR")if(l.value==="NOT"){let c=s(o.pop());o.push(a(!c))}else if(l.value==="OR"){let c=s(o.pop()),h=s(o.pop());o.push(a(c||h))}else if(l.value==="AND"){let c=s(o.pop()),h=s(o.pop());o.push(a(c&&h))}else if(l.value==="XOR"){let c=s(o.pop()),h=s(o.pop());o.push(a(c&&!h||!c&&h))}else throw Error("Unsupported operator: "+l.value);else throw Error("Unsupported token type: "+l);return s(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let a=this.subFields[s.value.trim()];n.push(a.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let a=n.pop();n.push(ot.booleanNot([a]))}else if(s.value==="OR"){let a=n.pop(),o=n.pop();n.push(ot.booleanOr([o,a]))}else if(s.value==="AND"){let a=n.pop(),o=n.pop();n.push(ot.booleanAnd([o,a]))}else if(s.value==="XOR"){let a=n.pop(),o=n.pop();n.push(ot.booleanXor([o,a]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s);return n[0]}};var Vu=class extends qt{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}};var Ku=class extends qt{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var Vn=class extends ze{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`);return ze.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=ze.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let[n,s,a]=t,o=gr[a.toUpperCase()];if(!o)return this.helpMessage(e);let l;switch(s){case"is":l=c=>c.status.type===o;break;case"is not":l=c=>c.status.type!==o;break;default:return this.helpMessage(e)}return Ve.fromFilter(new er(e,l,new ot(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`)}helpMessage(e){let t=Object.values(gr).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. +`}},Ke=class{constructor(e){this.instruction=e}get filter(){return this._filter}set filter(e){this._filter=e}get filterFunction(){if(this._filter)return this._filter.filterFunction}static fromFilter(e){let t=new Ke(e.instruction);return t.filter=e,t}static fromError(e,t){let n=new Ke(e);return n.error=t,n}};var Iu=class{constructor(e,t){this._instruction=e,this._filter=t}canCreateFilterForLine(e){return e==this._instruction}createFilterOrErrorMessage(e){let t=new Ke(e);return e===this._instruction?(t.filter=new Jt(e,this._filter,new at(e)),t):(t.error=`do not understand filter: ${e}`,t)}};var Gr=class{constructor(){this._filters=[]}add(e,t){this._filters.push(new Iu(e,t))}canCreateFilterForLine(e){for(let t of this._filters)if(t.canCreateFilterForLine(e))return!0;return!1}createFilterOrErrorMessage(e){for(let n of this._filters){let s=n.createFilterOrErrorMessage(e);if(s.error===void 0)return s}let t=new Ke(e);return t.error=`do not understand filter: ${e}`,t}};var Gn=class extends Ve{constructor(){super(...arguments);this._filters=new Gr}canCreateFilterForLine(t){return this._filters.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){return this._filters.createFilterOrErrorMessage(t)}filterRegExp(){return null}};var gn=class extends Gn{constructor(){super(),this._filters.add("done",e=>e.status.type==="DONE"||e.status.type==="CANCELLED"||e.status.type==="NON_TASK"),this._filters.add("not done",e=>e.status.type==="TODO"||e.status.type==="IN_PROGRESS")}fieldName(){return"status"}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=gn.oldStatusName(e),s=gn.oldStatusName(t);return ns?-1:0}}static oldStatusName(e){return e.status.symbol===" "?"Todo":"Done"}};var Ut=class extends Ve{constructor(t=null){super();t!==null?this.filterInstructions=t:(this.filterInstructions=new Gr,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let s=this.date(n);return s!==null&&!s.isValid()}))}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);if(n.filter!==void 0)return n;let s=new Ke(t),a=Ve.getMatch(this.filterRegExp(),t);if(a!==null){let o=a[1],l=a[2],c=ms.parseDateRange(l);if(!c[0].isValid()||!c[1].isValid())s.error="do not understand "+this.fieldName()+" date";else{let f=this.buildFilterFunction(o,c),m=Ut.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),c);s.filter=new Jt(t,f,new at(m))}}else s.error="do not understand query filter ("+this.fieldName()+" date)";return s}buildFilterFunction(t,n){let s;return t==="before"?s=a=>a?a.isBefore(n[0]):this.filterResultIfFieldMissing():t==="after"?s=a=>a?a.isAfter(n[1]):this.filterResultIfFieldMissing():s=a=>a?a.isSameOrAfter(n[0])&&a.isSameOrBefore(n[1]):this.filterResultIfFieldMissing(),this.getFilter(s)}getFilter(t){return n=>t(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (before|after|on|in)? ?(.*)`)}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(t,n,s,a){let o,l="YYYY-MM-DD (dddd Do MMMM YYYY)",c;switch(n){case"before":o=n,c=a[0].format(l);break;case"after":o=n,c=a[1].format(l);break;default:a[0].isSame(a[1])?(o="on",c=a[0].format(l)):(o="between",c=`${a[0].format(l)} and ${a[1].format(l)} inclusive`);break}let f=`${t} date is ${o} ${c}`;return s&&(f+=` OR no ${t} date`),f}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(t,n)=>$r(this.date(t),this.date(n))}};var pi=class extends Ut{fieldName(){return"due"}date(e){return e.dueDate}filterResultIfFieldMissing(){return!1}};var Zh=class extends Ve{createFilterOrErrorMessage(e){let t=new Ke(e),n=Ve.getMatch(this.filterRegExp(),e);if(n!==null){let s=n[5],a=null;switch(s){case"low":a="4";break;case"none":a="3";break;case"medium":a="2";break;case"high":a="1";break}if(a===null)return t.error="do not understand priority",t;let o=e,l;switch(n[3]){case"above":l=c=>c.priority.localeCompare(a)<0;break;case"below":l=c=>c.priority.localeCompare(a)>0;break;case"not":l=c=>c.priority!==a;break;default:l=c=>c.priority===a,o=`${this.fieldName()} is ${s}`}t.filter=new Jt(e,l,new at(o))}else t.error="do not understand query filter (priority)";return t}fieldName(){return"priority"}filterRegExp(){return Zh.priorityRegexp}supportsSorting(){return!0}comparator(){return(e,t)=>e.priority.localeCompare(t.priority)}},Es=Zh;Es.priorityRegexp=/^priority(\s+is)?(\s+(above|below|not))?(\s+(low|none|medium|high))$/;var mi=class{matchesAnyOf(e){return e.some(t=>this.matches(t))}};var yi=class extends mi{constructor(t){super();this.stringToFind=t}matches(t){return yi.stringIncludesCaseInsensitive(t,this.stringToFind)}static stringIncludesCaseInsensitive(t,n){return t.toLocaleLowerCase().includes(n.toLocaleLowerCase())}};var gi=class extends mi{constructor(t){super();this.regex=t}static validateAndConstruct(t){let n=/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/,s=t.match(n);if(s!==null){let a=new RegExp(s[1],s[2]);return new gi(a)}else return null}matches(t){return t.match(this.regex)!==null}};var Wt=class extends Ve{createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return Ke.fromError(e,`do not understand query filter (${this.fieldName()})`);let[n,s,a]=t,o=null;if(s.includes("include"))o=new yi(a);else if(s.includes("regex")&&(o=gi.validateAndConstruct(a),o===null))return Ke.fromError(e,`cannot parse regex (${this.fieldName()}); check your leading and trailing slashes for your query`);if(o===null)return Ke.fromError(e,`do not understand query filter (${this.fieldName()})`);let l=s.match(/not/)!==null,c=new Jt(e,this.getFilter(o,l),new at(e));return Ke.fromFilter(c)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`)}getFilter(e,t){return n=>{let s=e.matches(this.value(n));return t?!s:s}}comparator(){return(e,t)=>this.value(e).localeCompare(this.value(t),void 0,{numeric:!0})}grouper(){return e=>[this.value(e)]}};var _i=class extends Wt{fieldName(){return"path"}value(e){return e.path}supportsSorting(){return!0}};var Ti=class extends Ve{canCreateFilterForLine(e){return!1}createFilterOrErrorMessage(e){return Ke.fromError(e,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(e,t)=>t.urgency-e.urgency}};var bi=class{static by(e,t){let n=[new Ti().comparator(),new gn().comparator(),new pi().comparator(),new Es().comparator(),new _i().comparator()],s=[];for(let a of e)s.push(a.comparator);return t.sort(bi.makeCompositeComparator([...s,...n]))}static makeCompositeComparator(e){return(t,n)=>{for(let s of e){let a=s(t,n);if(a!==0)return a}return 0}}};var Ss=class extends Wt{fieldName(){return"description"}value(e){let t=se().globalFilter;return e.description.replace(t,"").trim()}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Ss.cleanDescription(e.description),s=Ss.cleanDescription(t.description);return n.localeCompare(s,void 0,{numeric:!0})}}static cleanDescription(e){let t=se().globalFilter;e=e.replace(t,"").trim();let n=/^\[\[?([^\]]*)]]?/,s=e.match(n);if(s!==null){let a=s[1];e=a.substring(a.indexOf("|")+1)+e.replace(n,"")}return e=this.replaceFormatting(e,/^\*\*([^*]+)\*\*/),e=this.replaceFormatting(e,/^\*([^*]+)\*/),e=this.replaceFormatting(e,/^==([^=]+)==/),e=this.replaceFormatting(e,/^__([^_]+)__/),e=this.replaceFormatting(e,/^_([^_]+)_/),e}static replaceFormatting(e,t){let n=e.match(t);return n!==null&&(e=n[1]+e.replace(t,"")),e}};var Fu=class extends Ut{fieldName(){return"created"}date(e){return e.createdDate}filterResultIfFieldMissing(){return!1}};var Lu=class extends Ut{fieldName(){return"done"}date(e){return e.doneDate}filterResultIfFieldMissing(){return!1}};var Yu=class extends Gn{constructor(){super(),this._filters.add("exclude sub-items",e=>{if(e.indentation==="")return!0;let t=e.indentation.lastIndexOf(">");return t===-1?!1:/^ ?$/.test(e.indentation.slice(t+1))})}fieldName(){return"exclude"}};var Uu=class extends Wt{fieldName(){return"heading"}value(e){return e.precedingHeader?e.precedingHeader:""}supportsSorting(){return!0}};var Wu=class extends Ut{fieldName(){return"scheduled"}date(e){return e.scheduledDate}filterResultIfFieldMissing(){return!1}};var qu=class extends Ut{fieldName(){return"start"}fieldNameForFilterInstruction(){return"starts"}date(e){return e.startDate}filterResultIfFieldMissing(){return!0}};var Hn=class extends Ut{constructor(){let e=new Gr;e.add("has happens date",t=>this.dates(t).some(n=>n!==null)),e.add("no happens date",t=>!this.dates(t).some(n=>n!==null)),super(e)}fieldName(){return"happens"}fieldNameForExplanation(){return"due, start or scheduled"}date(e){return this.earliestDate(e)}dates(e){return Array.of(e.startDate,e.scheduledDate,e.dueDate)}earliestDate(e){return new Hn().dates(e).sort($r)[0]}filterResultIfFieldMissing(){return!1}getFilter(e){return t=>this.dates(t).some(n=>e(n))}};var ju=class extends Gn{constructor(){super(),this._filters.add("is recurring",e=>e.recurrence!==null),this._filters.add("is not recurring",e=>e.recurrence===null)}fieldName(){return"recurring"}};var $u=class extends Wt{fieldNamePlural(){return this.fieldNameSingular()+"s"}fieldName(){return`${this.fieldNameSingular()}/${this.fieldNamePlural()}`}fieldPattern(){return`${this.fieldNameSingular()}|${this.fieldNamePlural()}`}filterOperatorPattern(){return`${super.filterOperatorPattern()}|include|do not include`}value(e){return this.values(e).join(", ")}getFilter(e,t){return n=>{let s=e.matchesAnyOf(this.values(n));return t?!s:s}}};var Os=class extends $u{constructor(){super();this.filterInstructions=new Gr,this.filterInstructions.add(`has ${this.fieldNameSingular()}`,t=>this.values(t).length>0),this.filterInstructions.add(`has ${this.fieldNamePlural()}`,t=>this.values(t).length>0),this.filterInstructions.add(`no ${this.fieldNameSingular()}`,t=>this.values(t).length===0),this.filterInstructions.add(`no ${this.fieldNamePlural()}`,t=>this.values(t).length===0)}createFilterOrErrorMessage(t){let n=this.filterInstructions.createFilterOrErrorMessage(t);return n.filter!==void 0?n:super.createFilterOrErrorMessage(t)}canCreateFilterForLine(t){return this.filterInstructions.canCreateFilterForLine(t)?!0:super.canCreateFilterForLine(t)}fieldNameSingular(){return"tag"}values(t){return t.tags}supportsSorting(){return!0}createSorterFromLine(t){let n=t.match(this.sorterRegExp());if(n===null)return null;let s=!!n[1],a=isNaN(+n[2])?1:+n[2],o=Os.makeCompareByTagComparator(a);return new yn(this.fieldNameSingular(),o,s)}sorterRegExp(){return/^sort by tag( reverse)?[\s]*(\d+)?/}comparator(){return Os.makeCompareByTagComparator(1)}static makeCompareByTagComparator(t){return(n,s)=>{if(n.tags.length===0&&s.tags.length===0)return 0;if(n.tags.length===0)return 1;if(s.tags.length===0)return-1;let a=t-1;if(n.tags.length=t)return 1;if(s.tags.length=t)return-1;if(n.tags.lengththis.filterTaskWithParsedQuery(c,a),l=this.constructExplanation(a);return n.filter=new Jt(t,o,l),n}catch(a){let o=a instanceof Error?a.message:"unknown error type";return n.error=`malformed boolean query -- ${o} (check the documentation for guidelines)`,n}return n}preprocessExpression(t){return t.replace(/\(([^()]+)\)/g,'("$1")')}filterTaskWithParsedQuery(t,n){let s=l=>l==="true",a=l=>l?"true":"false",o=[];for(let l of n)if(l.name==="IDENTIFIER"){if(l.value==null)throw Error("null token value");let f=this.subFields[l.value.trim()].filterFunction(t);o.push(a(f))}else if(l.name==="OPERATOR")if(l.value==="NOT"){let c=s(o.pop());o.push(a(!c))}else if(l.value==="OR"){let c=s(o.pop()),f=s(o.pop());o.push(a(c||f))}else if(l.value==="AND"){let c=s(o.pop()),f=s(o.pop());o.push(a(c&&f))}else if(l.value==="XOR"){let c=s(o.pop()),f=s(o.pop());o.push(a(c&&!f||!c&&f))}else throw Error("Unsupported operator: "+l.value);else throw Error("Unsupported token type: "+l);return s(o[0])}constructExplanation(t){let n=[];for(let s of t)if(s.name==="IDENTIFIER"){if(s.value==null)throw Error("null token value");let a=this.subFields[s.value.trim()];n.push(a.explanation)}else if(s.name==="OPERATOR")if(s.value==="NOT"){let a=n.pop();n.push(at.booleanNot([a]))}else if(s.value==="OR"){let a=n.pop(),o=n.pop();n.push(at.booleanOr([o,a]))}else if(s.value==="AND"){let a=n.pop(),o=n.pop();n.push(at.booleanAnd([o,a]))}else if(s.value==="XOR"){let a=n.pop(),o=n.pop();n.push(at.booleanXor([o,a]))}else throw Error("Unsupported operator: "+s.value);else throw Error("Unsupported token type: "+s);return n[0]}};var Ku=class extends Wt{fieldName(){return"filename"}value(e){let t=e.filename;return t===null?"":t+".md"}supportsSorting(){return!0}};var Zu=class extends Wt{constructor(){super()}fieldName(){return"status.name"}value(e){return e.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};var Vn=class extends Ve{canCreateFilterForLine(e){let t=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`);return Ve.lineMatchesFilter(t,e)}createFilterOrErrorMessage(e){let t=Ve.getMatch(this.filterRegExp(),e);if(t===null)return this.helpMessage(e);let[n,s,a]=t,o=kr[a.toUpperCase()];if(!o)return this.helpMessage(e);let l;switch(s){case"is":l=c=>c.status.type===o;break;case"is not":l=c=>c.status.type!==o;break;default:return this.helpMessage(e)}return Ke.fromFilter(new Jt(e,l,new at(e)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`)}helpMessage(e){let t=Object.values(kr).filter(s=>s!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${e}'. Allowed options: 'is' and 'is not' (without quotes). Allowed values: ${t} Note: values are case-insensitive, so 'in_progress' works too, for example. - Example: ${this.fieldNameSingular()} is not NON_TASK`;return Ve.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Vn.groupName(e),s=Vn.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[Vn.groupName(e)]}static groupName(e){let t;switch(e.status.type){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return t+" "+e.status.type}};var Zu=class extends qt{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}};var ip=[()=>new Ku,()=>new Vn,()=>new _n,()=>new qu,()=>new Ds,()=>new Hn,()=>new Iu,()=>new Wu,()=>new Uu,()=>new pi,()=>new Fu,()=>new _i,()=>new Ss,()=>new Os,()=>new Yu,()=>new Lu,()=>new Hu,()=>new Vu,()=>new Ti,()=>new Zu];function zu(r){for(let e of ip){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function kv(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of ip){let s=t().parseSortLine(r);if(s)return s}return null}function Dv(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of ip){let n=t(),s=n.fieldNameSingular();if(r===`group by ${s}`&&n.supportsGrouping())return n.createGrouper()}return null}var Xu=class{constructor(e,t){this.nestingLevel=e,this.name=t}};var Qu=class{constructor(e){this.lastHeadingAtLevel=new Array;let n=e.keys().next().value.length;for(let s=0;st.set(l,o)),e.pop();return t}};var el=class extends Map{},tl=class extends Ju{},rl=class{constructor(e,t){this.groups=new el;let n=this.buildGroupingTree(e,t);this.groups=n.generateAllPaths(),this.groups=this.getSortedGroups()}buildGroupingTree(e,t){let n=new tl(t),s=[n];for(let a of e){let o=[];for(let l of s)for(let c of l.values){let h=En.getGroupNamesForTask(a,c);for(let m of h){let _=l.children.get(m);_===void 0&&(_=new tl([]),l.children.set(m,_),o.push(_)),_.values.push(c)}}s=o}return n}getSortedGroups(){return new el([...this.groups.entries()].sort())}};var nl=class{constructor(e,t,n){this.groups=e,this.groupHeadings=t,this.tasks=n}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` + Example: ${this.fieldNameSingular()} is not NON_TASK`;return Ke.fromError(e,n)}fieldName(){return"status.type"}value(e){return e.status.type}supportsSorting(){return!0}comparator(){return(e,t)=>{let n=Vn.groupName(e),s=Vn.groupName(t);return n.localeCompare(s,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return e=>[Vn.groupName(e)]}static groupName(e){let t;switch(e.status.type){case"IN_PROGRESS":t="1";break;case"TODO":t="2";break;case"DONE":t="3";break;case"CANCELLED":t="4";break;case"NON_TASK":t="5";break;case"EMPTY":t="6";break}return t+" "+e.status.type}};var Xu=class extends Wt{fieldName(){return"recurrence"}value(e){return e.recurrence!==null?e.recurrence.toText():""}};var up=[()=>new Zu,()=>new Vn,()=>new gn,()=>new ju,()=>new Es,()=>new Hn,()=>new Fu,()=>new qu,()=>new Wu,()=>new pi,()=>new Lu,()=>new _i,()=>new Ss,()=>new Os,()=>new Uu,()=>new Yu,()=>new zu,()=>new Ku,()=>new Ti,()=>new Xu];function Vu(r){for(let e of up){let t=e();if(t.canCreateFilterForLine(r))return t.createFilterOrErrorMessage(r)}return null}function Ev(r){let e=/^sort by /;if(r.match(e)===null)return null;for(let t of up){let s=t().parseSortLine(r);if(s)return s}return null}function Sv(r){let e=/^group by /;if(r.match(e)===null)return null;for(let t of up){let n=t(),s=n.fieldNameSingular();if(r===`group by ${s}`&&n.supportsGrouping())return n.createGrouper()}return null}var Qu=class{constructor(e,t){this.nestingLevel=e,this.name=t}};var Ju=class{constructor(e){this.lastHeadingAtLevel=new Array;let n=e.keys().next().value.length;for(let s=0;st.set(l,o)),e.pop();return t}};var tl=class extends Map{},rl=class extends el{},nl=class{constructor(e,t){this.groups=new tl;let n=this.buildGroupingTree(e,t);this.groups=n.generateAllPaths(),this.groups=this.getSortedGroups()}buildGroupingTree(e,t){let n=new rl(t),s=[n];for(let a of e){let o=[];for(let l of s)for(let c of l.values){let f=wn.getGroupNamesForTask(a,c);for(let m of f){let g=l.children.get(m);g===void 0&&(g=new rl([]),l.children.set(m,g),o.push(g)),g.values.push(c)}}s=o}return n}getSortedGroups(){return new tl([...this.groups.entries()].sort())}};var sl=class{constructor(e,t,n){this.groups=e,this.groupHeadings=t,this.tasks=n}tasksAsStringOfLines(){let e="";for(let t of this.tasks)e+=t.toFileLineString()+` `;return e}toString(){let e=` `;e+=`Group names: [${this.groups}] `;for(let t of this.groupHeadings)e+=`${"#".repeat(4+t.nestingLevel)} ${t.name} -`;return e+=this.tasksAsStringOfLines(),e}};var sl=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new rl(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+=` +`;return e+=this.tasksAsStringOfLines(),e}};var il=class{constructor(e,t){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=t.length;let n=new nl(e,t);this.addTasks(n)}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let e="";for(let n of this.groups)e+=n.toString(),e+=` --- `;return e+=` ${this.totalTasksCount()} tasks -`,e}addTasks(e){let t=new Qu(e.groups);for(let[n,s]of e.groups){let a=t.getHeadingsForTaskGroup(n),o=new nl(n,a,s);this.add(o)}}add(e){this._groups.push(e)}};var Me=class{static fromGroupingProperty(e){return new fi(e,Me.grouperForProperty(e))}static by(e,t){return new sl(e,t)}static getGroupNamesForTask(e,t){return e.grouper(t)}static grouperForProperty(e){return Me.groupers[e]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}static groupByPriority(e){let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[`Priority ${e.priority}: ${t}`]}static groupByRecurrence(e){return e.recurrence!==null?[e.recurrence.toText()]:["None"]}static groupByRecurring(e){return e.recurrence!==null?["Recurring"]:["Not Recurring"]}static groupByCreatedDate(e){return[Me.stringFromDate(e.createdDate,"created")]}static groupByStartDate(e){return[Me.stringFromDate(e.startDate,"start")]}static groupByScheduledDate(e){return[Me.stringFromDate(e.scheduledDate,"scheduled")]}static groupByDueDate(e){return[Me.stringFromDate(e.dueDate,"due")]}static groupByDoneDate(e){return[Me.stringFromDate(e.doneDate,"done")]}static groupByHappensDate(e){let t=new Hn().earliestDate(e);return[Me.stringFromDate(t,"happens")]}static stringFromDate(e,t){return e===null?"No "+t+" date":e.format(Me.groupDateFormat)}static groupByPath(e){return[Me.escapeMarkdownCharacters(e.path.replace(".md",""))]}static groupByFolder(e){let t=e.path,n=e.filename+".md",s=t.substring(0,t.lastIndexOf(n));return s===""?["/"]:[Me.escapeMarkdownCharacters(s)]}static groupByFileName(e){let t=e.filename;return t===null?["Unknown Location"]:["[["+Me.escapeMarkdownCharacters(t)+"]]"]}static groupByRoot(e){let t=e.path.replace(/\\/g,"/"),n=t.indexOf("/");return n==-1?["/"]:[Me.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=Me.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let s=Me.groupByHeading(e)[0];return n===s?[n]:[`${n} > ${s}`]}static groupByStatus(e){return e.status.symbol===" "?["Todo"]:["Done"]}static groupByHeading(e){return e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}static groupByTags(e){return e.tags.length==0?["(No tags)"]:e.tags}},En=Me;En.groupDateFormat="YYYY-MM-DD dddd",En.groupers={backlink:Me.groupByBacklink,created:Me.groupByCreatedDate,done:Me.groupByDoneDate,due:Me.groupByDueDate,filename:Me.groupByFileName,folder:Me.groupByFolder,happens:Me.groupByHappensDate,heading:Me.groupByHeading,path:Me.groupByPath,priority:Me.groupByPriority,recurrence:Me.groupByRecurrence,recurring:Me.groupByRecurring,root:Me.groupByRoot,scheduled:Me.groupByScheduledDate,start:Me.groupByStartDate,status:Me.groupByStatus,tags:Me.groupByTags};var Si=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Yi;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|created|done|due|filename|folder|happens|heading|path|priority|recurrence|recurring|root|scheduled|start|status|tags)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (to )?(\d+)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split(` +`,e}addTasks(e){let t=new Ju(e.groups);for(let[n,s]of e.groups){let a=t.getHeadingsForTaskGroup(n),o=new sl(n,a,s);this.add(o)}}add(e){this._groups.push(e)}};var Me=class{static fromGroupingProperty(e){return new hi(e,Me.grouperForProperty(e))}static by(e,t){return new il(e,t)}static getGroupNamesForTask(e,t){return e.grouper(t)}static grouperForProperty(e){return Me.groupers[e]}static escapeMarkdownCharacters(e){return e.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}static groupByPriority(e){let t="ERROR";switch(e.priority){case"1":t="High";break;case"2":t="Medium";break;case"3":t="None";break;case"4":t="Low";break}return[`Priority ${e.priority}: ${t}`]}static groupByRecurrence(e){return e.recurrence!==null?[e.recurrence.toText()]:["None"]}static groupByRecurring(e){return e.recurrence!==null?["Recurring"]:["Not Recurring"]}static groupByCreatedDate(e){return[Me.stringFromDate(e.createdDate,"created")]}static groupByStartDate(e){return[Me.stringFromDate(e.startDate,"start")]}static groupByScheduledDate(e){return[Me.stringFromDate(e.scheduledDate,"scheduled")]}static groupByDueDate(e){return[Me.stringFromDate(e.dueDate,"due")]}static groupByDoneDate(e){return[Me.stringFromDate(e.doneDate,"done")]}static groupByHappensDate(e){let t=new Hn().earliestDate(e);return[Me.stringFromDate(t,"happens")]}static stringFromDate(e,t){return e===null?"No "+t+" date":e.format(Me.groupDateFormat)}static groupByPath(e){return[Me.escapeMarkdownCharacters(e.path.replace(".md",""))]}static groupByFolder(e){let t=e.path,n=e.filename+".md",s=t.substring(0,t.lastIndexOf(n));return s===""?["/"]:[Me.escapeMarkdownCharacters(s)]}static groupByFileName(e){let t=e.filename;return t===null?["Unknown Location"]:["[["+t+"]]"]}static groupByRoot(e){let t=e.path.replace(/\\/g,"/"),n=t.indexOf("/");return n==-1?["/"]:[Me.escapeMarkdownCharacters(t.substring(0,n+1))]}static groupByBacklink(e){if(e.getLinkText({isFilenameUnique:!0})===null)return["Unknown Location"];let n="Unknown Location";if(e.filename!==null&&(n=Me.escapeMarkdownCharacters(e.filename)),e.precedingHeader===null||e.precedingHeader.length===0)return[n];let s=Me.groupByHeading(e)[0];return n===s?[n]:[`${n} > ${s}`]}static groupByStatus(e){return e.status.symbol===" "?["Todo"]:["Done"]}static groupByHeading(e){return e.precedingHeader===null||e.precedingHeader.length===0?["(No heading)"]:[e.precedingHeader]}static groupByTags(e){return e.tags.length==0?["(No tags)"]:e.tags}},wn=Me;wn.groupDateFormat="YYYY-MM-DD dddd",wn.groupers={backlink:Me.groupByBacklink,created:Me.groupByCreatedDate,done:Me.groupByDoneDate,due:Me.groupByDueDate,filename:Me.groupByFileName,folder:Me.groupByFolder,happens:Me.groupByHappensDate,heading:Me.groupByHeading,path:Me.groupByPath,priority:Me.groupByPriority,recurrence:Me.groupByRecurrence,recurring:Me.groupByRecurring,root:Me.groupByRoot,scheduled:Me.groupByScheduledDate,start:Me.groupByStartDate,status:Me.groupByStatus,tags:Me.groupByTags};var Si=class{constructor({source:e}){this._limit=void 0;this._layoutOptions=new Ba;this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this.groupByRegexp=/^group by (backlink|created|done|due|filename|folder|happens|heading|path|priority|recurrence|recurring|root|scheduled|start|status|tags)/;this.hideOptionsRegexp=/^(hide|show) (task count|backlink|priority|created date|start date|scheduled date|done date|due date|recurrence rule|edit button|urgency)/;this.shortModeRegexp=/^short/;this.explainQueryRegexp=/^explain/;this.limitRegexp=/^limit (to )?(\d+)( tasks?)?/;this.commentRegexp=/^#.*/;this.source=e,e.split(` `).map(t=>t.trim()).forEach(t=>{switch(!0){case t==="":break;case this.shortModeRegexp.test(t):this._layoutOptions.shortMode=!0;break;case this.explainQueryRegexp.test(t):this._layoutOptions.explainQuery=!0;break;case this.limitRegexp.test(t):this.parseLimit({line:t});break;case this.parseSortBy({line:t}):break;case this.parseGroupBy2({line:t}):break;case this.groupByRegexp.test(t):this.parseGroupBy({line:t});break;case this.hideOptionsRegexp.test(t):this.parseHideOptions({line:t});break;case this.commentRegexp.test(t):break;case this.parseFilter(t):break;default:this._error=`do not understand query: ${t}`}})}explainQuery(){return`Explanation of this Tasks code block query: `+this.explainQueryWithoutIntroduction()}explainQueryWithoutIntroduction(){let e="",{globalFilter:t}=se();t.length!==0&&(e+=`Only tasks containing the global filter '${t}'. @@ -206,12 +207,11 @@ ${this.totalTasksCount()} tasks At most ${this._limit} task`,this._limit!==1&&(e+="s"),e+=`. `);let{debugSettings:s}=se();return s.ignoreSortInstructions&&(e+=` -NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.`),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=se(),s=(t.ignoreSortInstructions?e:bi.by(this.sorting,e)).slice(0,this.limit);return En.by(this.grouping,s)}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=zu(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=kv(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push(En.fromGroupingProperty(t[1])):this._error="do not understand query grouping"}parseGroupBy2({line:e}){let t=Dv(e);return t?(this._grouping.push(t),!0):!1}};var il=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return J(this,null,function*(){n.addChild(new ap({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},ap=class extends al.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.events=n,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=new Si({source:a}),this.queryType="tasks";break;default:this.query=new Si({source:a}),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=new Si({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return J(this,arguments,function*({tasks:t,state:n}){var o;let a=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug(`Render ${this.queryType} called for a block in active file "${this.filePath}", to select from ${t.length} tasks: plugin state: ${n}`),this.query.layoutOptions.explainQuery&&this.createExplanation(a);let l=this.query.applyQueryToTasks(t);for(let h of l.groups){this.addGroupHeadings(a,h.groupHeadings);let{taskList:m}=yield this.createTasksList({tasks:h.tasks,content:a});a.appendChild(m)}let c=l.totalTasksCount();console.debug(`${c} of ${t.length} tasks displayed in a block in "${this.filePath}"`),this.addTaskCount(a,c)}else this.query.error!==void 0?a.createDiv().innerHTML=`
Tasks query: ${this.query.error.replace(/\n/g,"
")}
`:a.setText("Loading Tasks ...");(o=this.containerEl.firstChild)==null||o.replaceWith(a)})}createExplanation(t){let n=this.query.explainQuery(),s=t.createEl("pre");s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTasksList(s){return J(this,arguments,function*({tasks:t,content:n}){let a=t.length,o=n.createEl("ul");o.addClasses(["contains-task-list","plugin-tasks-query-result"]);for(let l=0;lD.remove());let T=this.query.layoutOptions.shortMode;this.query.layoutOptions.hideUrgency||this.addUrgency(m,c),this.query.layoutOptions.hideBacklinks||this.addBacklinks(m,c,T,h),this.query.layoutOptions.hideEditButton||this.addEditButton(m,c),o.appendChild(m)}return{taskList:o,tasksCount:a}})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(a=>{a.preventDefault();let o=c=>{Ao({originalTask:n,newTasks:Kt.removeInferredStatusIfNeeded(n,c)})};new Bn({app:this.app,task:n,onSubmit:o}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addGroupHeadings(t,n){for(let s of n)this.addGroupHeading(t,s)}addGroupHeading(t,n){return J(this,null,function*(){let s;n.nestingLevel===0?s=t.createEl("h4",{cls:"tasks-group-heading"}):n.nestingLevel===1?s=t.createEl("h5",{cls:"tasks-group-heading"}):s=t.createEl("h6",{cls:"tasks-group-heading"}),yield al.MarkdownRenderer.renderMarkdown(n.name,s,this.filePath,this)})}addBacklinks(t,n,s,a){var h;let o=t.createSpan({cls:"tasks-backlink"});s||o.append(" (");let l=o.createEl("a");if(l.href=n.path,l.setAttribute("data-href",n.path),l.rel="noopener",l.target="_blank",l.addClass("internal-link"),s&&l.addClass("internal-link-short-mode"),n.precedingHeader!==null){let m=n.precedingHeader.replace(/#/g,"");l.href=l.href+"#"+m,l.setAttribute("data-href",l.getAttribute("data-href")+"#"+m)}let c;s?c=" \u{1F517}":c=(h=n.getLinkText({isFilenameUnique:a}))!=null?h:"",l.setText(c),s||o.append(")")}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:`${n} task${n!==1?"s":""}`,cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let s=n[1];return this.app.vault.getMarkdownFiles().filter(o=>{if(o.basename===s)return!0}).length<2}};var Be=require("obsidian");function Sv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Ov(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Mv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function Rv(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function xv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Pv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Av=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Fr=require("obsidian");var Ps=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,s,a]=e,o=[];if(o.push(...this.validateType(a)),t===s&&a!=="NON_TASK"&&o.push(`Status symbol '${t}' toggles to itself`),o.length>0)return o;let l=he.createFromImportedValue(e).configuration;return o.push(...this.validateSymbolTypeConventions(l)),o.push(...this.validate(l)),o}validateSymbol(e){return Ps.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return Ps.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=gr[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,s=new $e,a=n==="X"?"x":n,o=s.bySymbol(a);return o.type!=="EMPTY"&&(e.nextStatusSymbol!==o.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${o.nextStatusSymbol}'`),e.type!==o.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${o.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var As=new Ps,lr=class extends Fr.Modal{constructor(t,n,s){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=s}statusConfiguration(){return new bt(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return J(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new Fr.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(h=>{s=h,h.setValue(this.statusSymbol).onChange(m=>{this.statusSymbol=m,lr.setValid(h,As.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(h=>{lr.setValid(s,As.validateSymbol(this.statusConfiguration()))});let a;new Fr.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(h=>{a=h,h.setValue(this.statusName).onChange(m=>{this.statusName=m,lr.setValid(h,As.validateName(this.statusConfiguration()))})}).then(h=>{lr.setValid(a,As.validateName(this.statusConfiguration()))});let o;new Fr.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(h=>{o=h,h.setValue(this.statusNextSymbol).onChange(m=>{this.statusNextSymbol=m,lr.setValid(h,As.validateNextSymbol(this.statusConfiguration()))})}).then(h=>{lr.setValid(o,As.validateNextSymbol(this.statusConfiguration()))}),new Fr.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(h=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(_=>{h.addOption(_,_)}),h.setValue(this.type).onChange(_=>{this.type=he.getTypeFromStatusTypeString(_)})}),he.tasksPluginCanCreateCommandsForStatuses()&&new Fr.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(h=>{h.setValue(this.statusAvailableAsCommand).onChange(m=>J(this,null,function*(){this.statusAvailableAsCommand=m}))});let l=t.createDiv(),c=new Fr.Setting(l);c.addButton(h=>(h.setTooltip("Save").setIcon("checkmark").onClick(()=>J(this,null,function*(){let m=As.validate(this.statusConfiguration());if(m.length>0){let _=m.join(` +NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.`),e}get limit(){return this._limit}get layoutOptions(){return this._layoutOptions}get filters(){return this._filters}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}applyQueryToTasks(e){this.filters.forEach(a=>{e=e.filter(a.filterFunction)});let{debugSettings:t}=se(),s=(t.ignoreSortInstructions?e:bi.by(this.sorting,e)).slice(0,this.limit);return wn.by(this.grouping,s)}parseHideOptions({line:e}){let t=e.match(this.hideOptionsRegexp);if(t!==null){let n=t[1]==="hide";switch(t[2]){case"task count":this._layoutOptions.hideTaskCount=n;break;case"backlink":this._layoutOptions.hideBacklinks=n;break;case"priority":this._layoutOptions.hidePriority=n;break;case"created date":this._layoutOptions.hideCreatedDate=n;break;case"start date":this._layoutOptions.hideStartDate=n;break;case"scheduled date":this._layoutOptions.hideScheduledDate=n;break;case"due date":this._layoutOptions.hideDueDate=n;break;case"done date":this._layoutOptions.hideDoneDate=n;break;case"recurrence rule":this._layoutOptions.hideRecurrenceRule=n;break;case"edit button":this._layoutOptions.hideEditButton=n;break;case"urgency":this._layoutOptions.hideUrgency=n;break;default:this._error="do not understand hide/show option"}}}parseFilter(e){let t=Vu(e);return t!=null?(t.filter?this._filters.push(t.filter):this._error=t.error,!0):!1}parseLimit({line:e}){let t=e.match(this.limitRegexp);t!==null?this._limit=Number.parseInt(t[2],10):this._error="do not understand query limit"}parseSortBy({line:e}){let t=Ev(e);return t?(this._sorting.push(t),!0):!1}parseGroupBy({line:e}){let t=e.match(this.groupByRegexp);t!==null?this._grouping.push(wn.fromGroupingProperty(t[1])):this._error="do not understand query grouping"}parseGroupBy2({line:e}){let t=Sv(e);return t?(this._grouping.push(t),!0):!1}};var al=class{constructor({plugin:e,events:t}){this.addQueryRenderChild=this._addQueryRenderChild.bind(this);this.app=e.app,this.events=t,e.registerMarkdownCodeBlockProcessor("tasks",this._addQueryRenderChild.bind(this))}_addQueryRenderChild(e,t,n){return J(this,null,function*(){n.addChild(new lp({app:this.app,events:this.events,container:t,source:e,filePath:n.sourcePath}))})}},lp=class extends ol.MarkdownRenderChild{constructor({app:t,events:n,container:s,source:a,filePath:o}){super(s);switch(this.app=t,this.events=n,this.source=a,this.filePath=o,this.containerEl.className){case"block-language-tasks":this.query=new Si({source:a}),this.queryType="tasks";break;default:this.query=new Si({source:a}),this.queryType="tasks";break}}onload(){this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.renderEventRef=this.events.onCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()}onunload(){this.renderEventRef!==void 0&&this.events.off(this.renderEventRef),this.queryReloadTimeout!==void 0&&clearTimeout(this.queryReloadTimeout)}reloadQueryAtMidnight(){let t=new Date;t.setHours(24,0,0,0);let n=new Date,s=t.getTime()-n.getTime();this.queryReloadTimeout=setTimeout(()=>{this.query=new Si({source:this.source}),this.events.triggerRequestCacheUpdate(this.render.bind(this)),this.reloadQueryAtMidnight()},s+1e3)}render(s){return J(this,arguments,function*({tasks:t,state:n}){var o;let a=this.containerEl.createEl("div");if(n==="Warm"&&this.query.error===void 0){console.debug(`Render ${this.queryType} called for a block in active file "${this.filePath}", to select from ${t.length} tasks: plugin state: ${n}`),this.query.layoutOptions.explainQuery&&this.createExplanation(a);let l=this.query.applyQueryToTasks(t);for(let f of l.groups){this.addGroupHeadings(a,f.groupHeadings);let{taskList:m}=yield this.createTasksList({tasks:f.tasks,content:a});a.appendChild(m)}let c=l.totalTasksCount();console.debug(`${c} of ${t.length} tasks displayed in a block in "${this.filePath}"`),this.addTaskCount(a,c)}else this.query.error!==void 0?a.createDiv().innerHTML=`
Tasks query: ${this.query.error.replace(/\n/g,"
")}
`:a.setText("Loading Tasks ...");(o=this.containerEl.firstChild)==null||o.replaceWith(a)})}createExplanation(t){let n=this.query.explainQuery(),s=t.createEl("pre");s.addClasses(["plugin-tasks-query-explanation"]),s.setText(n),t.appendChild(s)}createTasksList(s){return J(this,arguments,function*({tasks:t,content:n}){let a=t.length,o=new qn(this.query.layoutOptions),l=n.createEl("ul");l.addClasses(["contains-task-list","plugin-tasks-query-result"]),l.addClasses(o.specificClasses);let c=this.getGroupingAttribute();c&&c.length>0&&(l.dataset.taskGroupBy=c);for(let f=0;fC.remove());let v=this.query.layoutOptions.shortMode,R=T.createSpan("task-extras");this.query.layoutOptions.hideUrgency||this.addUrgency(R,m),this.query.layoutOptions.hideBacklinks||this.addBacklinks(R,m,v,g),this.query.layoutOptions.hideEditButton||this.addEditButton(R,m),l.appendChild(T)}return{taskList:l,tasksCount:a}})}addEditButton(t,n){t.createEl("a",{cls:"tasks-edit"}).onClickEvent(a=>{a.preventDefault();let o=c=>{Eu({originalTask:n,newTasks:Xt.removeInferredStatusIfNeeded(n,c)})};new Bn({app:this.app,task:n,onSubmit:o}).open()})}addUrgency(t,n){let s=new Intl.NumberFormat().format(n.urgency);t.createSpan({text:s,cls:"tasks-urgency"})}addGroupHeadings(t,n){for(let s of n)this.addGroupHeading(t,s)}addGroupHeading(t,n){return J(this,null,function*(){let s;n.nestingLevel===0?s=t.createEl("h4",{cls:"tasks-group-heading"}):n.nestingLevel===1?s=t.createEl("h5",{cls:"tasks-group-heading"}):s=t.createEl("h6",{cls:"tasks-group-heading"}),yield ol.MarkdownRenderer.renderMarkdown(n.name,s,this.filePath,this)})}addBacklinks(t,n,s,a){var f;let o=t.createSpan({cls:"tasks-backlink"});s||o.append(" (");let l=o.createEl("a");if(l.href=n.path,l.setAttribute("data-href",n.path),l.rel="noopener",l.target="_blank",l.addClass("internal-link"),s&&l.addClass("internal-link-short-mode"),n.precedingHeader!==null){let m=n.precedingHeader.replace(/#/g,"");l.href=l.href+"#"+m,l.setAttribute("data-href",l.getAttribute("data-href")+"#"+m)}let c;s?c=" \u{1F517}":c=(f=n.getLinkText({isFilenameUnique:a}))!=null?f:"",l.setText(c),s||o.append(")")}addTaskCount(t,n){this.query.layoutOptions.hideTaskCount||t.createDiv({text:`${n} task${n!==1?"s":""}`,cls:"tasks-count"})}isFilenameUnique({task:t}){let n=t.path.match(/([^/]*)\..+$/i);if(n===null)return;let s=n[1];return this.app.vault.getMarkdownFiles().filter(o=>{if(o.basename===s)return!0}).length<2}getGroupingAttribute(){let t=[];for(let n of this.query.grouping)t.push(n.property);return t.join(",")}};var Ge=require("obsidian");function Ov(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Mv(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Rv(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function Pv(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function xv(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Av(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}var Nv=[{text:"Core Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:"

These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.

You can add edit and add your own custom statuses in the section below.

"},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertTaskCoreStatusSettings",featureFlag:"",notice:null}]},{text:"Custom Statuses",level:"h3",class:"",open:!0,notice:{class:"setting-item-description",text:null,html:`

You should first select and install a CSS Snippet or Theme to style custom checkboxes.

Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.

Note Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.

See the documentation to get started!

`},settings:[{name:"",description:"",type:"function",initialValue:"",placeholder:"",settingName:"insertCustomTaskStatusSettings",featureFlag:"",notice:null}]}];var Ir=require("obsidian");var xs=class{validate(e){let t=[];return t.push(...this.validateSymbol(e)),t.push(...this.validateName(e)),t.push(...this.validateNextSymbol(e)),t}validateStatusCollectionEntry(e){let[t,n,s,a]=e,o=[];if(o.push(...this.validateType(a)),t===s&&a!=="NON_TASK"&&o.push(`Status symbol '${t}' toggles to itself`),o.length>0)return o;let l=pe.createFromImportedValue(e).configuration;return o.push(...this.validateSymbolTypeConventions(l)),o.push(...this.validate(l)),o}validateSymbol(e){return xs.validateOneSymbol(e.symbol,"Task Status Symbol")}validateNextSymbol(e){return xs.validateOneSymbol(e.nextStatusSymbol,"Task Next Status Symbol")}validateName(e){let t=[];return e.name.length===0&&t.push("Task Status Name cannot be empty."),t}validateType(e){let t=kr[e],n=[];return t||n.push(`Status Type "${e}" is not a valid type`),t=="EMPTY"&&n.push('Status Type "EMPTY" is not permitted in user data'),n}validateSymbolTypeConventions(e){let t=[],n=e.symbol,s=new Be,a=n==="X"?"x":n,o=s.bySymbol(a);return o.type!=="EMPTY"&&(e.nextStatusSymbol!==o.nextStatusSymbol&&t.push(`Next Status Symbol for symbol '${n}': '${e.nextStatusSymbol}' is inconsistent with convention '${o.nextStatusSymbol}'`),e.type!==o.type&&t.push(`Status Type for symbol '${n}': '${e.type}' is inconsistent with convention '${o.type}'`)),t}static validateOneSymbol(e,t){let n=[];return e.length===0&&n.push(`${t} cannot be empty.`),e.length>1&&n.push(`${t} ("${e}") must be a single character.`),n}};var As=new xs,ur=class extends Ir.Modal{constructor(t,n,s){super(t.app);this.plugin=t;this.saved=!1;this.error=!1;this.statusSymbol=n.symbol,this.statusName=n.name,this.statusNextSymbol=n.nextStatusSymbol,this.statusAvailableAsCommand=n.availableAsCommand,this.type=n.type,this.isCoreStatus=s}statusConfiguration(){return new St(this.statusSymbol,this.statusName,this.statusNextSymbol,this.statusAvailableAsCommand,this.type)}display(){return J(this,null,function*(){let{contentEl:t}=this;t.empty();let n=t.createDiv(),s;new Ir.Setting(n).setName("Task Status Symbol").setDesc("This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)").addText(f=>{s=f,f.setValue(this.statusSymbol).onChange(m=>{this.statusSymbol=m,ur.setValid(f,As.validateSymbol(this.statusConfiguration()))})}).setDisabled(this.isCoreStatus).then(f=>{ur.setValid(s,As.validateSymbol(this.statusConfiguration()))});let a;new Ir.Setting(n).setName("Task Status Name").setDesc("This is the friendly name of the task status.").addText(f=>{a=f,f.setValue(this.statusName).onChange(m=>{this.statusName=m,ur.setValid(f,As.validateName(this.statusConfiguration()))})}).then(f=>{ur.setValid(a,As.validateName(this.statusConfiguration()))});let o;new Ir.Setting(n).setName("Task Next Status Symbol").setDesc("When clicked on this is the symbol that should be used next.").addText(f=>{o=f,f.setValue(this.statusNextSymbol).onChange(m=>{this.statusNextSymbol=m,ur.setValid(f,As.validateNextSymbol(this.statusConfiguration()))})}).then(f=>{ur.setValid(o,As.validateNextSymbol(this.statusConfiguration()))}),new Ir.Setting(n).setName("Task Status Type").setDesc("Control how the status behaves for searching and toggling.").addDropdown(f=>{["TODO","IN_PROGRESS","DONE","CANCELLED","NON_TASK"].forEach(g=>{f.addOption(g,g)}),f.setValue(this.type).onChange(g=>{this.type=pe.getTypeFromStatusTypeString(g)})}),pe.tasksPluginCanCreateCommandsForStatuses()&&new Ir.Setting(n).setName("Available as command").setDesc("If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.").addToggle(f=>{f.setValue(this.statusAvailableAsCommand).onChange(m=>J(this,null,function*(){this.statusAvailableAsCommand=m}))});let l=t.createDiv(),c=new Ir.Setting(l);c.addButton(f=>(f.setTooltip("Save").setIcon("checkmark").onClick(()=>J(this,null,function*(){let m=As.validate(this.statusConfiguration());if(m.length>0){let g=m.join(` `)+` -Fix errors before saving.`;new Fr.Notice(_);return}this.saved=!0,this.close()})),h)),c.addExtraButton(h=>(h.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),h))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?lr.removeValidationError(t):lr.setValidationError(t)}};var Oi=class extends Be.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return J(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Global filter Settings"}),new Be.Setting(t).setName("Global task filter").setDesc(Oi.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(s=>{let a=se();s.setPlaceholder("e.g. #task or TODO").setValue(a.globalFilter).onChange(o=>J(this,null,function*(){Gt({globalFilter:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let a=se();s.setValue(a.removeGlobalFilter).onChange(o=>J(this,null,function*(){Gt({removeGlobalFilter:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=se();Av.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new Be.Setting(t).setName("Set created date on every added task").setDesc("Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.").addToggle(s=>{let a=se();s.setValue(a.setCreatedDate).onChange(o=>J(this,null,function*(){Gt({setCreatedDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.").addToggle(s=>{let a=se();s.setValue(a.setDoneDate).onChange(o=>J(this,null,function*(){Gt({setDoneDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Oi.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(s=>{let a=se();s.setValue(a.useFilenameAsScheduledDate).onChange(o=>J(this,null,function*(){Gt({useFilenameAsScheduledDate:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(s=>J(this,null,function*(){let a=se();yield this.plugin.saveSettings(),s.setValue(Oi.renderFolderArray(a.filenameAsDateFolders)).onChange(o=>J(this,null,function*(){let l=Oi.parseCommaSeparatedFolders(o);Gt({filenameAsDateFolders:l}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Auto-suggest Settings"}),new Be.Setting(t).setName("Auto-suggest task content").setDesc("Enabling this will open an intelligent suggest menu while typing inside a recognized task line.").addToggle(s=>{let a=se();s.setValue(a.autoSuggestInEditor).onChange(o=>J(this,null,function*(){Gt({autoSuggestInEditor:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(s=>{let a=se();s.setLimits(0,3,1).setValue(a.autoSuggestMinMatch).setDynamicTooltip().onChange(o=>J(this,null,function*(){Gt({autoSuggestMinMatch:o}),yield this.plugin.saveSettings()}))}),new Be.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(s=>{let a=se();s.setLimits(3,12,1).setValue(a.autoSuggestMaxItems).setDynamicTooltip().onChange(o=>J(this,null,function*(){Gt({autoSuggestMaxItems:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Be.Setting(t).setName("Provide access keys in dialogs").setDesc("If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.").addToggle(s=>{let a=se();s.setValue(a.provideAccessKeys).onChange(o=>J(this,null,function*(){Gt({provideAccessKeys:o}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let a=t.createEl("details",{cls:"tasks-nested-settings",attr:Qe({},n.open||s[n.text]?{open:!0}:{})});a.empty(),a.ontoggle=()=>{s[n.text]=a.open,Gt({headingOpened:s}),this.plugin.saveSettings()};let o=a.createEl("summary");if(new Be.Setting(o).setHeading().setName(n.text),o.createDiv("collapser").createDiv("handle"),n.notice!==null){let l=a.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&l.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(l=>{if(!(l.featureFlag!==""&&!ty(l.featureFlag))&&(l.type==="checkbox"?new Be.Setting(a).setName(l.name).setDesc(l.description).addToggle(c=>{let h=se();h.generalSettings[l.settingName]||os(l.settingName,l.initialValue),c.setValue(h.generalSettings[l.settingName]).onChange(m=>J(this,null,function*(){os(l.settingName,m),yield this.plugin.saveSettings()}))}):l.type==="text"?new Be.Setting(a).setName(l.name).setDesc(l.description).addText(c=>{let h=se();h.generalSettings[l.settingName]||os(l.settingName,l.initialValue);let m=_=>J(this,null,function*(){os(l.settingName,_),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(h.generalSettings[l.settingName].toString()).onChange((0,Be.debounce)(m,500,!0))}):l.type==="textarea"?new Be.Setting(a).setName(l.name).setDesc(l.description).addTextArea(c=>{let h=se();h.generalSettings[l.settingName]||os(l.settingName,l.initialValue);let m=_=>J(this,null,function*(){os(l.settingName,_),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(h.generalSettings[l.settingName].toString()).onChange((0,Be.debounce)(m,500,!0)),c.inputEl.rows=8,c.inputEl.cols=40}):l.type==="function"&&this.customFunctions[l.settingName](a,this),l.notice!==null)){let c=a.createEl("p",{cls:l.notice.class,text:l.notice.text});l.notice.html!==null&&c.insertAdjacentHTML("beforeend",l.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:s}=se();s.coreStatuses.forEach(a=>{Nv(t,a,s.coreStatuses,s,n,n.plugin,!0)})}insertCustomTaskStatusSettings(t,n){let{statusSettings:s}=se();s.customStatuses.forEach(h=>{Nv(t,h,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new Be.Setting(t).addButton(h=>{h.setButtonText("Add New Task Status").setCta().onClick(()=>J(this,null,function*(){pt.addStatus(s.customStatuses,new bt("","","",!1,"TODO")),yield Mi(s,n)}))}).infoEl.remove();let o=[["AnuPpuccin Theme",Sv()],["Ebullientworks Theme",Mv()],["ITS Theme & SlRvb Checkboxes",Rv()],["Minimal Theme",xv()],["Things Theme",Pv()],["Aura Theme (Dark mode only)",Ov()]];for(let[h,m]of o)new Be.Setting(t).addButton(T=>{let D=`${h}: Add ${m.length} supported Statuses`;T.setButtonText(D).onClick(()=>J(this,null,function*(){yield oF(m,s,n)}))}).infoEl.remove();new Be.Setting(t).addButton(h=>{h.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>J(this,null,function*(){let _=this.plugin.getTasks().map(D=>D.status),T=$e.getInstance().findUnknownStatuses(_);T.length!==0&&(T.forEach(D=>{pt.addStatus(s.customStatuses,D)}),yield Mi(s,n))}))}).infoEl.remove(),new Be.Setting(t).addButton(h=>{h.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>J(this,null,function*(){pt.resetAllCustomStatuses(s),yield Mi(s,n)}))}).infoEl.remove()}},no=Oi;no.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Nv(r,e,t,n,s,a,o){let l=r.createEl("pre");l.addClass("row-for-status"),l.textContent=new he(e).previewText();let c=new Be.Setting(r);c.infoEl.replaceWith(l),o||c.addExtraButton(h=>{h.setIcon("cross").setTooltip("Delete").onClick(()=>J(this,null,function*(){pt.deleteStatus(t,e)&&(yield Mi(n,s))}))}),c.addExtraButton(h=>{h.setIcon("pencil").setTooltip("Edit").onClick(()=>J(this,null,function*(){let m=new lr(a,e,o);m.onClose=()=>J(this,null,function*(){m.saved&&pt.replaceStatus(t,e,m.statusConfiguration())&&(yield Mi(n,s))}),m.open()}))}),c.infoEl.remove()}function oF(r,e,t){return J(this,null,function*(){pt.bulkAddStatusCollection(e,r).forEach(s=>{new Be.Notice(s)}),yield Mi(e,t)})}function Mi(r,e){return J(this,null,function*(){Gt({statusSettings:r}),pt.applyToStatusRegistry(r,$e.getInstance()),yield e.saveSettings(!0)})}var Iv=require("obsidian");var{symbols:tt}=Fn.tasksPluginEmoji.taskSerializer,uF=`${tt.startDateSymbol}${tt.scheduledDateSymbol}${tt.dueDateSymbol}`;function Cv(r,e,t){let n=[];n=n.concat(dF(r,e,t)),n=n.concat(fF(r,e,t));let s=cF(r,t),a=op(r,/([a-zA-Z'_-]*)/g,e),o=!1;if(a&&a.length>0){let l=a[0];if(l.length>=Math.max(1,t.autoSuggestMinMatch)){let c=s.filter(h=>h.displayText.toLowerCase().includes(l.toLowerCase()));for(let h of c)n.push({suggestionType:"match",displayText:h.displayText,appendText:h.appendText,insertAt:a.index,insertSkip:l.length}),o=!0}}return!o&&t.autoSuggestMinMatch===0&&(n=n.concat(s)),n.length>0&&!n.some(l=>l.suggestionType==="match")&&n.unshift({suggestionType:"empty",displayText:"\u23CE",appendText:` -`}),n=n.slice(0,t.autoSuggestMaxItems),n}function lF(r){if(Object.values(tt.prioritySymbols).some(e=>e.length>0&&r.includes(e)))return!0}function cF(r,e){let t=[];return r.includes(tt.dueDateSymbol)||t.push({displayText:`${tt.dueDateSymbol} due date`,appendText:`${tt.dueDateSymbol} `}),r.includes(tt.startDateSymbol)||t.push({displayText:`${tt.startDateSymbol} start date`,appendText:`${tt.startDateSymbol} `}),r.includes(tt.scheduledDateSymbol)||t.push({displayText:`${tt.scheduledDateSymbol} scheduled date`,appendText:`${tt.scheduledDateSymbol} `}),lF(r)||(t.push({displayText:`${tt.prioritySymbols.High} high priority`,appendText:`${tt.prioritySymbols.High} `}),t.push({displayText:`${tt.prioritySymbols.Medium} medium priority`,appendText:`${tt.prioritySymbols.Medium} `}),t.push({displayText:`${tt.prioritySymbols.Low} low priority`,appendText:`${tt.prioritySymbols.Low} `})),r.includes(tt.recurrenceSymbol)||t.push({displayText:`${tt.recurrenceSymbol} recurring (repeat)`,appendText:`${tt.recurrenceSymbol} `}),t}function dF(r,e,t){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],s=[],a=new RegExp(`([${uF}])\\s*([0-9a-zA-Z ]*)`,"ug"),o=op(r,a,e);if(o&&o.length>=2){let l=o[1],c=o[2];if(c.length1?ks.parseDate(di(c),!0):null;h&&h.isValid()&&s.push({displayText:`${h.format(ae.dateFormat)}`,appendText:`${l} ${h.format(ae.dateFormat)} `,insertAt:o.index,insertSkip:o[0].length});let m=1,_=5,T=n.filter(D=>c&&c.length>=m&&D.toLowerCase().includes(c.toLowerCase())).slice(0,_);T.length===0&&(T=n.slice(0,_));for(let D of T){let R=`${ks.parseDate(D,!0).format(ae.dateFormat)}`;s.push({suggestionType:"match",displayText:`${D} (${R})`,appendText:`${l} ${R} `,insertAt:o.index,insertSkip:o[0].length})}}return s}function fF(r,e,t){var l;let n=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],s=[],a=new RegExp(`(${tt.recurrenceSymbol})\\s*([0-9a-zA-Z ]*)`,"ug"),o=op(r,a,e);if(o&&o.length>=2){let c=o[1],h=o[2];if(h.length0){let D=(l=Tt.fromText({recurrenceRuleText:h,startDate:null,scheduledDate:null,dueDate:null}))==null?void 0:l.toText();if(D){let v=`${c} ${D} `;if(s.push({suggestionType:"match",displayText:`\u2705 ${D}`,appendText:v,insertAt:o.index,insertSkip:o[0].length}),o[0]==v)return[]}}let m=1,_=t.autoSuggestMaxItems/2,T=n.filter(D=>h&&h.length>=m&&D.toLowerCase().includes(h.toLowerCase())).slice(0,_);T.length===0&&h.trim().length===0&&(T=n.slice(0,_));for(let D of T)s.push({suggestionType:"match",displayText:`${D}`,appendText:`${c} ${D} `,insertAt:o.index,insertSkip:o[0].length})}return s}function op(r,e,t){let n=r.matchAll(e);for(let s of n)if((s==null?void 0:s.index)&&s.index<=t&&t<=s.index+s[0].length)return s;return[]}var ol=class extends Iv.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let a=n.getLine(t.line);return a.contains(this.settings.globalFilter)&&a.match(ae.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:a.length},query:a}:null}getSuggestions(t){let n=t.query,s=t.editor.getCursor(),a=Cv(n,s.ch,this.settings),o=[];for(let l of a)o.push(tr(Qe({},l),{context:t}));return o}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var c,h,m;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let _=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(h=(c=s==null?void 0:s.cm)==null?void 0:c.contentDOM)==null||h.dispatchEvent(_);return}let a=t.context.editor.getCursor(),o={line:a.line,ch:(m=t.insertAt)!=null?m:a.ch},l=t.insertSkip?{line:a.line,ch:o.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,o,l),t.context.editor.setCursor({line:a.line,ch:o.ch+t.appendText.length})}};var Fv=(r,e)=>{let t,n=new Promise((o,l)=>{t=o});return e(r,o=>{let l=o.map(c=>c.toFileLineString()).join(` -`);t(l)}).open(),n};var Lv=(r,e)=>{let t=Ru({line:"",path:""});return new Bn({app:r,task:t,onSubmit:e})};var Yv=r=>({createTaskLineModal:()=>Fv(r,Lv)});var ul=class extends Uv.Plugin{get apiV1(){return Yv(app)}onload(){return J(this,null,function*(){Po.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new no({plugin:this})),oy({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new Pu({obsidianEvents:this.app.workspace});this.cache=new us({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new Au({plugin:this}),this.queryRenderer=new il({plugin:this,events:t}),this.registerEditorExtension(cv()),this.registerEditorSuggest(new ol(this.app,se())),new xu({plugin:this})})}loadTaskStatuses(){return J(this,null,function*(){let{statusSettings:t}=se();pt.applyToStatusRegistry(t,$e.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return J(this,null,function*(){let t=yield this.loadData();Gt(t),yield this.loadTaskStatuses()})}saveSettings(){return J(this,null,function*(){yield this.saveData(se())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; +Fix errors before saving.`;new Ir.Notice(g);return}this.saved=!0,this.close()})),f)),c.addExtraButton(f=>(f.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),f))})}onOpen(){this.display()}static setValidationError(t){t.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(t){t.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(t,n){n.length===0?ur.removeValidationError(t):ur.setValidationError(t)}};var Oi=class extends Ge.PluginSettingTab{constructor({plugin:t}){super(t.app,t);this.customFunctions={insertTaskCoreStatusSettings:this.insertTaskCoreStatusSettings.bind(this),insertCustomTaskStatusSettings:this.insertCustomTaskStatusSettings.bind(this)};this.plugin=t}saveSettings(t){return J(this,null,function*(){yield this.plugin.saveSettings(),t&&this.display()})}display(){let{containerEl:t}=this;t.empty(),this.containerEl.addClass("tasks-settings"),t.createEl("h3",{text:"Tasks Settings"}),t.createEl("p",{cls:"tasks-setting-important",text:"Changing any settings requires a restart of obsidian."}),t.createEl("h4",{text:"Global filter Settings"}),new Ge.Setting(t).setName("Global task filter").setDesc(Oi.createFragmentWithHTML('

Recommended: Leave empty if you want all checklist items in your vault to be tasks managed by this plugin.

Use a global filter if you want Tasks to only act on a subset of your "- [ ]" checklist items, so that a checklist item must include the specified string in its description in order to be considered a task.

For example, if you set the global filter to #task, the Tasks plugin will only handle checklist items tagged with #task.
Other checklist items will remain normal checklist items and not appear in queries or get a done date set.

See the documentation.

')).addText(s=>{let a=se();s.setPlaceholder("e.g. #task or TODO").setValue(a.globalFilter).onChange(o=>J(this,null,function*(){Gt({globalFilter:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Remove global filter from description").setDesc("Enabling this removes the string that you set as global filter from the task description when displaying a task.").addToggle(s=>{let a=se();s.setValue(a.removeGlobalFilter).onChange(o=>J(this,null,function*(){Gt({removeGlobalFilter:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Task Statuses"});let{headingOpened:n}=se();Nv.forEach(s=>{this.addOneSettingsBlock(t,s,n)}),t.createEl("h4",{text:"Date Settings"}),new Ge.Setting(t).setName("Set created date on every added task").setDesc("Enabling this will add a timestamp \u2795 YYYY-MM-DD before other date values, when a task is created with 'Create or edit task', or by completing a recurring task.").addToggle(s=>{let a=se();s.setValue(a.setCreatedDate).onChange(o=>J(this,null,function*(){Gt({setCreatedDate:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Set done date on every completed task").setDesc("Enabling this will add a timestamp \u2705 YYYY-MM-DD at the end when a task is toggled to done.").addToggle(s=>{let a=se();s.setValue(a.setDoneDate).onChange(o=>J(this,null,function*(){Gt({setDoneDate:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Use filename as Scheduled date for undated tasks").setDesc(Oi.createFragmentWithHTML('Save time entering Scheduled (\u23F3) dates.
If this option is enabled, any undated tasks will be given a default Scheduled date extracted from their file name.
The date in the file name must be in one of YYYY-MM-DD or YYYYMMDD formats.
Undated tasks have none of Due (\u{1F4C5} ), Scheduled (\u23F3) and Start (\u{1F6EB}) dates.

See the documentation.

')).addToggle(s=>{let a=se();s.setValue(a.useFilenameAsScheduledDate).onChange(o=>J(this,null,function*(){Gt({useFilenameAsScheduledDate:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Folders with default Scheduled dates").setDesc("Leave empty if you want to use default Scheduled dates everywhere, or enter a comma-separated list of folders.").addText(s=>J(this,null,function*(){let a=se();yield this.plugin.saveSettings(),s.setValue(Oi.renderFolderArray(a.filenameAsDateFolders)).onChange(o=>J(this,null,function*(){let l=Oi.parseCommaSeparatedFolders(o);Gt({filenameAsDateFolders:l}),yield this.plugin.saveSettings()}))})),t.createEl("h4",{text:"Auto-suggest Settings"}),new Ge.Setting(t).setName("Auto-suggest task content").setDesc("Enabling this will open an intelligent suggest menu while typing inside a recognized task line.").addToggle(s=>{let a=se();s.setValue(a.autoSuggestInEditor).onChange(o=>J(this,null,function*(){Gt({autoSuggestInEditor:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Minimum match length for auto-suggest").setDesc("If higher than 0, auto-suggest will be triggered only when the beginning of any supported keywords is recognized.").addSlider(s=>{let a=se();s.setLimits(0,3,1).setValue(a.autoSuggestMinMatch).setDynamicTooltip().onChange(o=>J(this,null,function*(){Gt({autoSuggestMinMatch:o}),yield this.plugin.saveSettings()}))}),new Ge.Setting(t).setName("Maximum number of auto-suggestions to show").setDesc('How many suggestions should be shown when an auto-suggest menu pops up (including the "\u23CE" option).').addSlider(s=>{let a=se();s.setLimits(3,12,1).setValue(a.autoSuggestMaxItems).setDynamicTooltip().onChange(o=>J(this,null,function*(){Gt({autoSuggestMaxItems:o}),yield this.plugin.saveSettings()}))}),t.createEl("h4",{text:"Dialog Settings"}),new Ge.Setting(t).setName("Provide access keys in dialogs").setDesc("If the access keys (keyboard shortcuts) for various controls in dialog boxes conflict with system keyboard shortcuts or assistive technology functionality that is important for you, you may want to deactivate them here.").addToggle(s=>{let a=se();s.setValue(a.provideAccessKeys).onChange(o=>J(this,null,function*(){Gt({provideAccessKeys:o}),yield this.plugin.saveSettings()}))})}addOneSettingsBlock(t,n,s){let a=t.createEl("details",{cls:"tasks-nested-settings",attr:Ce({},n.open||s[n.text]?{open:!0}:{})});a.empty(),a.ontoggle=()=>{s[n.text]=a.open,Gt({headingOpened:s}),this.plugin.saveSettings()};let o=a.createEl("summary");if(new Ge.Setting(o).setHeading().setName(n.text),o.createDiv("collapser").createDiv("handle"),n.notice!==null){let l=a.createEl("div",{cls:n.notice.class,text:n.notice.text});n.notice.html!==null&&l.insertAdjacentHTML("beforeend",n.notice.html)}n.settings.forEach(l=>{if(!(l.featureFlag!==""&&!xb(l.featureFlag))&&(l.type==="checkbox"?new Ge.Setting(a).setName(l.name).setDesc(l.description).addToggle(c=>{let f=se();f.generalSettings[l.settingName]||Ts(l.settingName,l.initialValue),c.setValue(f.generalSettings[l.settingName]).onChange(m=>J(this,null,function*(){Ts(l.settingName,m),yield this.plugin.saveSettings()}))}):l.type==="text"?new Ge.Setting(a).setName(l.name).setDesc(l.description).addText(c=>{let f=se();f.generalSettings[l.settingName]||Ts(l.settingName,l.initialValue);let m=g=>J(this,null,function*(){Ts(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(f.generalSettings[l.settingName].toString()).onChange((0,Ge.debounce)(m,500,!0))}):l.type==="textarea"?new Ge.Setting(a).setName(l.name).setDesc(l.description).addTextArea(c=>{let f=se();f.generalSettings[l.settingName]||Ts(l.settingName,l.initialValue);let m=g=>J(this,null,function*(){Ts(l.settingName,g),yield this.plugin.saveSettings()});c.setPlaceholder(l.placeholder.toString()).setValue(f.generalSettings[l.settingName].toString()).onChange((0,Ge.debounce)(m,500,!0)),c.inputEl.rows=8,c.inputEl.cols=40}):l.type==="function"&&this.customFunctions[l.settingName](a,this),l.notice!==null)){let c=a.createEl("p",{cls:l.notice.class,text:l.notice.text});l.notice.html!==null&&c.insertAdjacentHTML("beforeend",l.notice.html)}})}static parseCommaSeparatedFolders(t){return t.split(",").map(n=>n.trim()).map(n=>n.replace(/^\/|\/$/g,"")).filter(n=>n!=="")}static renderFolderArray(t){return t.join(",")}insertTaskCoreStatusSettings(t,n){let{statusSettings:s}=se();s.coreStatuses.forEach(a=>{Cv(t,a,s.coreStatuses,s,n,n.plugin,!0)})}insertCustomTaskStatusSettings(t,n){let{statusSettings:s}=se();s.customStatuses.forEach(f=>{Cv(t,f,s.customStatuses,s,n,n.plugin,!1)}),t.createEl("div"),new Ge.Setting(t).addButton(f=>{f.setButtonText("Add New Task Status").setCta().onClick(()=>J(this,null,function*(){pt.addStatus(s.customStatuses,new St("","","",!1,"TODO")),yield Mi(s,n)}))}).infoEl.remove();let o=[["AnuPpuccin Theme",Ov()],["Ebullientworks Theme",Rv()],["ITS Theme & SlRvb Checkboxes",Pv()],["Minimal Theme",xv()],["Things Theme",Av()],["Aura Theme (Dark mode only)",Mv()]];for(let[f,m]of o)new Ge.Setting(t).addButton(T=>{let E=`${f}: Add ${m.length} supported Statuses`;T.setButtonText(E).onClick(()=>J(this,null,function*(){yield yF(m,s,n)}))}).infoEl.remove();new Ge.Setting(t).addButton(f=>{f.setButtonText("Add All Unknown Status Types").setCta().onClick(()=>J(this,null,function*(){let g=this.plugin.getTasks().map(E=>E.status),T=Be.getInstance().findUnknownStatuses(g);T.length!==0&&(T.forEach(E=>{pt.addStatus(s.customStatuses,E)}),yield Mi(s,n))}))}).infoEl.remove(),new Ge.Setting(t).addButton(f=>{f.setButtonText("Reset Custom Status Types to Defaults").setWarning().onClick(()=>J(this,null,function*(){pt.resetAllCustomStatuses(s),yield Mi(s,n)}))}).infoEl.remove()}},io=Oi;io.createFragmentWithHTML=t=>createFragment(n=>n.createDiv().innerHTML=t);function Cv(r,e,t,n,s,a,o){let l=r.createEl("pre");l.addClass("row-for-status"),l.textContent=new pe(e).previewText();let c=new Ge.Setting(r);c.infoEl.replaceWith(l),o||c.addExtraButton(f=>{f.setIcon("cross").setTooltip("Delete").onClick(()=>J(this,null,function*(){pt.deleteStatus(t,e)&&(yield Mi(n,s))}))}),c.addExtraButton(f=>{f.setIcon("pencil").setTooltip("Edit").onClick(()=>J(this,null,function*(){let m=new ur(a,e,o);m.onClose=()=>J(this,null,function*(){m.saved&&pt.replaceStatus(t,e,m.statusConfiguration())&&(yield Mi(n,s))}),m.open()}))}),c.infoEl.remove()}function yF(r,e,t){return J(this,null,function*(){pt.bulkAddStatusCollection(e,r).forEach(s=>{new Ge.Notice(s)}),yield Mi(e,t)})}function Mi(r,e){return J(this,null,function*(){Gt({statusSettings:r}),pt.applyToStatusRegistry(r,Be.getInstance()),yield e.saveSettings(!0)})}var Iv=require("obsidian");var ul=class extends Iv.EditorSuggest{constructor(t,n){super(t);this.settings=n}onTrigger(t,n,s){if(!this.settings.autoSuggestInEditor)return null;let a=n.getLine(t.line);return a.contains(this.settings.globalFilter)&&a.match(ae.taskRegex)?{start:{line:t.line,ch:0},end:{line:t.line,ch:a.length},query:a}:null}getSuggestions(t){var o,l,c;let n=t.query,s=t.editor.getCursor();return((c=(l=(o=za()).buildSuggestions)==null?void 0:l.call(o,n,s.ch,this.settings))!=null?c:[]).map(f=>er(Ce({},f),{context:t}))}renderSuggestion(t,n){n.setText(t.displayText)}selectSuggestion(t,n){var c,f,m;let s=t.context.editor;if(t.suggestionType==="empty"){this.close();let g=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(f=(c=s==null?void 0:s.cm)==null?void 0:c.contentDOM)==null||f.dispatchEvent(g);return}let a=t.context.editor.getCursor(),o={line:a.line,ch:(m=t.insertAt)!=null?m:a.ch},l=t.insertSkip?{line:a.line,ch:o.ch+t.insertSkip}:void 0;t.context.editor.replaceRange(t.appendText,o,l),t.context.editor.setCursor({line:a.line,ch:o.ch+t.appendText.length})}};var Fv=(r,e)=>{let t,n=new Promise((o,l)=>{t=o});return e(r,o=>{let l=o.map(c=>c.toFileLineString()).join(` +`);t(l)}).open(),n};var Lv=(r,e)=>{let t=xu({line:"",path:""});return new Bn({app:r,task:t,onSubmit:e})};var Yv=r=>({createTaskLineModal:()=>Fv(r,Lv)});var ll=class extends Uv.Plugin{get apiV1(){return Yv(app)}onload(){return J(this,null,function*(){Du.registerConsoleLogger(),console.log('loading plugin "tasks"'),yield this.loadSettings(),this.addSettingTab(new io({plugin:this})),Lb({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses();let t=new Nu({obsidianEvents:this.app.workspace});this.cache=new bs({metadataCache:this.app.metadataCache,vault:this.app.vault,events:t}),this.inlineRenderer=new Cu({plugin:this}),this.queryRenderer=new al({plugin:this,events:t}),this.registerEditorExtension(dv()),this.registerEditorSuggest(new ul(this.app,se())),new Au({plugin:this})})}loadTaskStatuses(){return J(this,null,function*(){let{statusSettings:t}=se();pt.applyToStatusRegistry(t,Be.getInstance())})}onunload(){var t;console.log('unloading plugin "tasks"'),(t=this.cache)==null||t.unload()}loadSettings(){return J(this,null,function*(){let t=yield this.loadData();Gt(t),yield this.loadTaskStatuses()})}saveSettings(){return J(this,null,function*(){yield this.saveData(se())})}getTasks(){var t;return(t=this.cache)==null?void 0:t.getTasks()}}; /*! * EventEmitter2 * https://github.com/hij1nx/EventEmitter2 diff --git a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json index a1b56abf..ad2a3d36 100644 --- a/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +++ b/.obsidian/plugins/obsidian-tasks-plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-tasks-plugin", "name": "Tasks", - "version": "2.0.1", + "version": "3.0.0", "minAppVersion": "0.14.6", "description": "Task management for Obsidian", "author": "Martin Schenck and Clare Macrae", diff --git a/.obsidian/plugins/obsidian42-brat/data.json b/.obsidian/plugins/obsidian42-brat/data.json index 5514be1c..49e6662c 100644 --- a/.obsidian/plugins/obsidian42-brat/data.json +++ b/.obsidian/plugins/obsidian42-brat/data.json @@ -1,5 +1,6 @@ { "pluginList": [ + "cdloh/obsidian-cron", "willasm/obsidian-open-weather", "joleaf/obsidian-email-block-plugin", "akaalias/obsidian-extract-pdf", diff --git a/.obsidian/plugins/obsidian42-brat/main.js b/.obsidian/plugins/obsidian42-brat/main.js index db86a97f..5b513b0d 100644 --- a/.obsidian/plugins/obsidian42-brat/main.js +++ b/.obsidian/plugins/obsidian42-brat/main.js @@ -1,23 +1,24 @@ -var He=Object.create;var V=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var Qe=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),Ge=(s,t)=>{for(var e in t)V(s,e,{get:t[e],enumerable:!0})},ce=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qe(t))!We.call(s,i)&&i!==e&&V(s,i,{get:()=>t[i],enumerable:!(n=je(t,i))||n.enumerable});return s};var Ke=(s,t,e)=>(e=s!=null?He(Je(s)):{},ce(t||!s||!s.__esModule?V(e,"default",{value:s,enumerable:!0}):e,s)),Ze=s=>ce(V({},"__esModule",{value:!0}),s);var a=(s,t,e)=>new Promise((n,i)=>{var o=g=>{try{l(e.next(g))}catch(c){i(c)}},r=g=>{try{l(e.throw(g))}catch(c){i(c)}},l=g=>g.done?n(g.value):Promise.resolve(g.value).then(o,r);l((e=e.apply(s,t)).next())});var ze=Qe(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});var p=require("obsidian"),se="YYYY-MM-DD",oe="gggg-[W]ww",Ce="YYYY-MM",Ee="YYYY-[Q]Q",Ie="YYYY";function R(s){var e,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e[s])==null?void 0:n.enabled)}function k(){var s,t,e,n;try{let{internalPlugins:i,plugins:o}=window.app;if(R("daily")){let{format:c,folder:h,template:d}=((t=(s=o.getPlugin("periodic-notes"))==null?void 0:s.settings)==null?void 0:t.daily)||{};return{format:c||se,folder:(h==null?void 0:h.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:r,format:l,template:g}=((n=(e=i.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:n.options)||{};return{format:l||se,folder:(r==null?void 0:r.trim())||"",template:(g==null?void 0:g.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function M(){var s,t,e,n,i,o,r;try{let l=window.app.plugins,g=(s=l.getPlugin("calendar"))==null?void 0:s.options,c=(e=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.weekly;if(R("weekly"))return{format:c.format||oe,folder:((n=c.folder)==null?void 0:n.trim())||"",template:((i=c.template)==null?void 0:i.trim())||""};let h=g||{};return{format:h.weeklyNoteFormat||oe,folder:((o=h.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((r=h.weeklyNoteTemplate)==null?void 0:r.trim())||""}}catch(l){console.info("No custom weekly note settings found!",l)}}function O(){var t,e,n,i;let s=window.app.plugins;try{let o=R("monthly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.monthly)||{};return{format:o.format||Ce,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function $(){var t,e,n,i;let s=window.app.plugins;try{let o=R("quarterly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.quarterly)||{};return{format:o.format||Ee,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function x(){var t,e,n,i;let s=window.app.plugins;try{let o=R("yearly")&&((e=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.yearly)||{};return{format:o.format||Ie,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function Le(...s){let t=[];for(let n=0,i=s.length;n{let ee=n(),te=s.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return w&&te.add(parseInt(f,10),P),y?te.format(y.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,s.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,s.clone().add(1,"d").format(o)));return t.foldManager.save(d,g),d}catch(d){console.error(`Failed to create file: '${h}'`,d),new p.Notice("Unable to create new file.")}})}function at(s,t){var e;return(e=t[N(s,"day")])!=null?e:null}function rt(){let{vault:s}=window.app,{folder:t}=k(),e=s.getAbstractFileByPath(p.normalizePath(t));if(!e)throw new ae("Failed to find daily notes folder");let n={};return p.Vault.recurseChildren(e,i=>{if(i instanceof p.TFile){let o=I(i,"day");if(o){let r=N(o,"day");n[r]=i}}}),n}var re=class extends Error{};function lt(){let{moment:s}=window,t=s.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ut(s){return lt().indexOf(s.toLowerCase())}function ke(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=M(),[o,r]=yield E(e),l=s.format(n),g=yield U(i,l);try{let c=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,T,w,f)=>{let P=window.moment(),y=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&y.add(parseInt(T,10),w),f?y.format(f.substring(1).trim()):y.format(n)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(h,d,b)=>{let T=ut(d);return s.weekday(T).format(b.trim())}));return window.app.foldManager.save(c,r),c}catch(c){console.error(`Failed to create file: '${g}'`,c),new p.Notice("Unable to create new file.")}})}function gt(s,t){var e;return(e=t[N(s,"week")])!=null?e:null}function ct(){let s={};if(!Oe())return s;let{vault:t}=window.app,{folder:e}=M(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new re("Failed to find weekly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=I(i,"week");if(o){let r=N(o,"week");s[r]=i}}}),s}var le=class extends Error{};function Me(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=O(),[o,r]=yield E(e),l=s.format(n),g=yield U(i,l);try{let c=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,T,w,f)=>{let P=window.moment(),y=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&y.add(parseInt(T,10),w),f?y.format(f.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(c,r),c}catch(c){console.error(`Failed to create file: '${g}'`,c),new p.Notice("Unable to create new file.")}})}function dt(s,t){var e;return(e=t[N(s,"month")])!=null?e:null}function mt(){let s={};if(!$e())return s;let{vault:t}=window.app,{folder:e}=O(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new le("Failed to find monthly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=I(i,"month");if(o){let r=N(o,"month");s[r]=i}}}),s}var ue=class extends Error{};function pt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=$(),[o,r]=yield E(e),l=s.format(n),g=yield U(i,l);try{let c=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,T,w,f)=>{let P=window.moment(),y=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&y.add(parseInt(T,10),w),f?y.format(f.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(c,r),c}catch(c){console.error(`Failed to create file: '${g}'`,c),new p.Notice("Unable to create new file.")}})}function ft(s,t){var e;return(e=t[N(s,"quarter")])!=null?e:null}function ht(){let s={};if(!xe())return s;let{vault:t}=window.app,{folder:e}=$(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ue("Failed to find quarterly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=I(i,"quarter");if(o){let r=N(o,"quarter");s[r]=i}}}),s}var ge=class extends Error{};function bt(s){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:i}=x(),[o,r]=yield E(e),l=s.format(n),g=yield U(i,l);try{let c=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,d,b,T,w,f)=>{let P=window.moment(),y=s.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return b&&y.add(parseInt(T,10),w),f?y.format(f.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(c,r),c}catch(c){console.error(`Failed to create file: '${g}'`,c),new p.Notice("Unable to create new file.")}})}function wt(s,t){var e;return(e=t[N(s,"year")])!=null?e:null}function yt(){let s={};if(!Ue())return s;let{vault:t}=window.app,{folder:e}=x(),n=t.getAbstractFileByPath(p.normalizePath(e));if(!n)throw new ge("Failed to find yearly notes folder");return p.Vault.recurseChildren(n,i=>{if(i instanceof p.TFile){let o=I(i,"year");if(o){let r=N(o,"year");s[r]=i}}}),s}function Tt(){var n,i;let{app:s}=window,t=s.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=s.plugins.getPlugin("periodic-notes");return e&&((i=(n=e.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function Oe(){var e,n;let{app:s}=window;if(s.plugins.getPlugin("calendar"))return!0;let t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.weekly)==null?void 0:n.enabled)}function $e(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.monthly)==null?void 0:n.enabled)}function xe(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.quarterly)==null?void 0:n.enabled)}function Ue(){var e,n;let{app:s}=window,t=s.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.yearly)==null?void 0:n.enabled)}function Pt(s){let t={day:k,week:M,month:O,quarter:$,year:x}[s];return t()}function vt(s,t){return{day:Re,month:Me,week:ke}[s](t)}u.DEFAULT_DAILY_NOTE_FORMAT=se;u.DEFAULT_MONTHLY_NOTE_FORMAT=Ce;u.DEFAULT_QUARTERLY_NOTE_FORMAT=Ee;u.DEFAULT_WEEKLY_NOTE_FORMAT=oe;u.DEFAULT_YEARLY_NOTE_FORMAT=Ie;u.appHasDailyNotesPluginLoaded=Tt;u.appHasMonthlyNotesPluginLoaded=$e;u.appHasQuarterlyNotesPluginLoaded=xe;u.appHasWeeklyNotesPluginLoaded=Oe;u.appHasYearlyNotesPluginLoaded=Ue;u.createDailyNote=Re;u.createMonthlyNote=Me;u.createPeriodicNote=vt;u.createQuarterlyNote=pt;u.createWeeklyNote=ke;u.createYearlyNote=bt;u.getAllDailyNotes=rt;u.getAllMonthlyNotes=mt;u.getAllQuarterlyNotes=ht;u.getAllWeeklyNotes=ct;u.getAllYearlyNotes=yt;u.getDailyNote=at;u.getDailyNoteSettings=k;u.getDateFromFile=I;u.getDateFromPath=ot;u.getDateUID=N;u.getMonthlyNote=dt;u.getMonthlyNoteSettings=O;u.getPeriodicNoteSettings=Pt;u.getQuarterlyNote=ft;u.getQuarterlyNoteSettings=$;u.getTemplateInfo=E;u.getWeeklyNote=gt;u.getWeeklyNoteSettings=M;u.getYearlyNote=wt;u.getYearlyNoteSettings=x});var St={};Ge(St,{default:()=>X});module.exports=Ze(St);var Ye=require("obsidian");var v=require("obsidian");var W=require("obsidian");var de=require("obsidian");var S=class extends de.FuzzySuggestModal{constructor(e){super(e.app);this.scope.register(["Shift"],"Enter",n=>this.enterTrigger(n)),this.scope.register(["Ctrl"],"Enter",n=>this.enterTrigger(n))}setSuggesterData(e){this.data=e}display(e){return a(this,null,function*(){this.callbackFunction=e,this.open()})}getItems(){return this.data}getItemText(e){return e.display}onChooseItem(){}renderSuggestion(e,n){n.createEl("div",{text:e.item.display})}enterTrigger(e){let n=document.querySelector(".suggestion-item.is-selected div").textContent,i=this.data.find(o=>o.display===n);i&&(this.invokeCallback(i,e),this.close())}onChooseSuggestion(e,n){this.invokeCallback(e.item,n)}invokeCallback(e,n){this.callbackFunction(e,n)}};var F=require("obsidian");var Xe="https://raw.githubusercontent.com/",Y=(s,t,e,n=!0)=>a(void 0,null,function*(){let i=`https://github.com/${s}/releases/download/${t}/${e}`;try{let o=yield(0,F.request)({url:i});return o==="Not Found"||o==='{"error":"Not Found"}'?null:o}catch(o){return n&&console.log("error in grabReleaseFileFromRepository",i,o),null}}),me=(s,t=!0,e=!0)=>a(void 0,null,function*(){let n=Xe+s+(t===!0?"/HEAD/manifest.json":"/HEAD/manifest-beta.json");try{let i=yield(0,F.request)({url:n});return i==="404: Not Found"?null:yield JSON.parse(i)}catch(i){return i!="Error: Request failed, status 404"&&e&&console.log(`error in grabManifestJsonFromRepository for ${n}`,i),null}}),pe=(s=!0)=>a(void 0,null,function*(){let t="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:yield JSON.parse(e)}catch(e){return s&&console.log("error in grabCommmunityPluginList",e),null}}),H=(s=!0)=>a(void 0,null,function*(){let t="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-css-themes.json";try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:yield JSON.parse(e)}catch(e){return s&&console.log("error in grabCommmunityThemesList",e),null}}),ne=(s,t=!0)=>a(void 0,null,function*(){let e=`https://raw.githubusercontent.com/${s}/HEAD/obsidian.css`;try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:n}catch(n){return t&&console.log("error in grabCommmunityThemesList",n),null}}),et=(s,t,e=!0)=>a(void 0,null,function*(){let n=`https://api.github.com/repos/${s}/commits?path=${t}&page=1&per_page=1`;try{let i=yield(0,F.request)({url:n});return i==="404: Not Found"?null:JSON.parse(i)}catch(i){return e&&console.log("error in grabCommmunityThemesList",i),null}}),j=(s,t)=>a(void 0,null,function*(){let e=yield et(s,t);return e[0].commit.committer.date?e[0].commit.committer.date:""});var fe={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!1,updateThemesAtStartup:!1,ribbonIconEnabled:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!0,notificationsEnabled:!0};function he(s,t,e=""){return a(this,null,function*(){let n=!1;s.settings.pluginList.contains(t)||(s.settings.pluginList.unshift(t),n=!0),e!==""&&s.settings.pluginSubListFrozenVersion.filter(i=>i.repo===t).length===0&&(s.settings.pluginSubListFrozenVersion.unshift({repo:t,version:e}),n=!0),n&&s.saveSettings()})}function be(s,t){return a(this,null,function*(){return s.settings.pluginList.contains(t)})}function we(s,t){return a(this,null,function*(){let e={repo:t,lastUpdate:yield j(t,"obsidian.css")};s.settings.themesList.unshift(e),s.saveSettings()})}function ye(s,t){return a(this,null,function*(){return!!s.settings.themesList.find(n=>n.repo===t)})}function Te(s,t,e){s.settings.themesList.forEach(n=>{n.repo===t&&(n.lastUpdate=e,s.saveSettings())})}var q=require("obsidian");function m(s,t,e=10,n=null){if(s.settings.notificationsEnabled===!1)return;let i=n?q.Platform.isDesktop?"(click=dismiss, right-click=Info)":"(click=dismiss)":"",o=new q.Notice(`BRAT +var je=Object.create;var K=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Ke=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Ge=(i,t)=>{for(var e in t)K(i,e,{get:t[e],enumerable:!0})},pe=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Je(t))!Qe.call(i,s)&&s!==e&&K(i,s,{get:()=>t[s],enumerable:!(n=qe(t,s))||n.enumerable});return i};var Ze=(i,t,e)=>(e=i!=null?je(We(i)):{},pe(t||!i||!i.__esModule?K(e,"default",{value:i,enumerable:!0}):e,i)),Xe=i=>pe(K({},"__esModule",{value:!0}),i);var a=(i,t,e)=>new Promise((n,s)=>{var o=g=>{try{l(e.next(g))}catch(u){s(u)}},r=g=>{try{l(e.throw(g))}catch(u){s(u)}},l=g=>g.done?n(g.value):Promise.resolve(g.value).then(o,r);l((e=e.apply(i,t)).next())});var ze=Ke(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var f=require("obsidian"),ae="YYYY-MM-DD",re="gggg-[W]ww",Ne="YYYY-MM",Ee="YYYY-[Q]Q",Le="YYYY";function z(i){var e,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e[i])==null?void 0:n.enabled)}function _(){var i,t,e,n;try{let{internalPlugins:s,plugins:o}=window.app;if(z("daily")){let{format:u,folder:m,template:d}=((t=(i=o.getPlugin("periodic-notes"))==null?void 0:i.settings)==null?void 0:t.daily)||{};return{format:u||ae,folder:(m==null?void 0:m.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:r,format:l,template:g}=((n=(e=s.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:n.options)||{};return{format:l||ae,folder:(r==null?void 0:r.trim())||"",template:(g==null?void 0:g.trim())||""}}catch(s){console.info("No custom daily note settings found!",s)}}function H(){var i,t,e,n,s,o,r;try{let l=window.app.plugins,g=(i=l.getPlugin("calendar"))==null?void 0:i.options,u=(e=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.weekly;if(z("weekly"))return{format:u.format||re,folder:((n=u.folder)==null?void 0:n.trim())||"",template:((s=u.template)==null?void 0:s.trim())||""};let m=g||{};return{format:m.weeklyNoteFormat||re,folder:((o=m.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((r=m.weeklyNoteTemplate)==null?void 0:r.trim())||""}}catch(l){console.info("No custom weekly note settings found!",l)}}function V(){var t,e,n,s;let i=window.app.plugins;try{let o=z("monthly")&&((e=(t=i.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.monthly)||{};return{format:o.format||Ne,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function Y(){var t,e,n,s;let i=window.app.plugins;try{let o=z("quarterly")&&((e=(t=i.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.quarterly)||{};return{format:o.format||Ee,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function j(){var t,e,n,s;let i=window.app.plugins;try{let o=z("yearly")&&((e=(t=i.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.yearly)||{};return{format:o.format||Le,folder:((n=o.folder)==null?void 0:n.trim())||"",template:((s=o.template)==null?void 0:s.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function Ie(...i){let t=[];for(let n=0,s=i.length;n{let se=n(),oe=i.clone().set({hour:se.get("hour"),minute:se.get("minute"),second:se.get("second")});return w&&oe.add(parseInt(b,10),P),y?oe.format(y.substring(1).trim()):oe.format(o)}).replace(/{{\s*yesterday\s*}}/gi,i.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,i.clone().add(1,"d").format(o)));return t.foldManager.save(d,g),d}catch(d){console.error(`Failed to create file: '${m}'`,d),new f.Notice("Unable to create new file.")}})}function lt(i,t){var e;return(e=t[C(i,"day")])!=null?e:null}function gt(){let{vault:i}=window.app,{folder:t}=_(),e=i.getAbstractFileByPath(f.normalizePath(t));if(!e)throw new le("Failed to find daily notes folder");let n={};return f.Vault.recurseChildren(e,s=>{if(s instanceof f.TFile){let o=B(s,"day");if(o){let r=C(o,"day");n[r]=s}}}),n}var ge=class extends Error{};function ut(){let{moment:i}=window,t=i.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function ct(i){return ut().indexOf(i.toLowerCase())}function Me(i){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:s}=H(),[o,r]=yield D(e),l=i.format(n),g=yield q(s,l);try{let u=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,d,h,T,w,b)=>{let P=window.moment(),y=i.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return h&&y.add(parseInt(T,10),w),b?y.format(b.substring(1).trim()):y.format(n)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(m,d,h)=>{let T=ct(d);return i.weekday(T).format(h.trim())}));return window.app.foldManager.save(u,r),u}catch(u){console.error(`Failed to create file: '${g}'`,u),new f.Notice("Unable to create new file.")}})}function dt(i,t){var e;return(e=t[C(i,"week")])!=null?e:null}function pt(){let i={};if(!xe())return i;let{vault:t}=window.app,{folder:e}=H(),n=t.getAbstractFileByPath(f.normalizePath(e));if(!n)throw new ge("Failed to find weekly notes folder");return f.Vault.recurseChildren(n,s=>{if(s instanceof f.TFile){let o=B(s,"week");if(o){let r=C(o,"week");i[r]=s}}}),i}var ue=class extends Error{};function Re(i){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:s}=V(),[o,r]=yield D(e),l=i.format(n),g=yield q(s,l);try{let u=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,d,h,T,w,b)=>{let P=window.moment(),y=i.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return h&&y.add(parseInt(T,10),w),b?y.format(b.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(u,r),u}catch(u){console.error(`Failed to create file: '${g}'`,u),new f.Notice("Unable to create new file.")}})}function mt(i,t){var e;return(e=t[C(i,"month")])!=null?e:null}function ft(){let i={};if(!Oe())return i;let{vault:t}=window.app,{folder:e}=V(),n=t.getAbstractFileByPath(f.normalizePath(e));if(!n)throw new ue("Failed to find monthly notes folder");return f.Vault.recurseChildren(n,s=>{if(s instanceof f.TFile){let o=B(s,"month");if(o){let r=C(o,"month");i[r]=s}}}),i}var ce=class extends Error{};function ht(i){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:s}=Y(),[o,r]=yield D(e),l=i.format(n),g=yield q(s,l);try{let u=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,d,h,T,w,b)=>{let P=window.moment(),y=i.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return h&&y.add(parseInt(T,10),w),b?y.format(b.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(u,r),u}catch(u){console.error(`Failed to create file: '${g}'`,u),new f.Notice("Unable to create new file.")}})}function bt(i,t){var e;return(e=t[C(i,"quarter")])!=null?e:null}function wt(){let i={};if(!$e())return i;let{vault:t}=window.app,{folder:e}=Y(),n=t.getAbstractFileByPath(f.normalizePath(e));if(!n)throw new ce("Failed to find quarterly notes folder");return f.Vault.recurseChildren(n,s=>{if(s instanceof f.TFile){let o=B(s,"quarter");if(o){let r=C(o,"quarter");i[r]=s}}}),i}var de=class extends Error{};function yt(i){return a(this,null,function*(){let{vault:t}=window.app,{template:e,format:n,folder:s}=j(),[o,r]=yield D(e),l=i.format(n),g=yield q(s,l);try{let u=yield t.create(g,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,d,h,T,w,b)=>{let P=window.moment(),y=i.clone().set({hour:P.get("hour"),minute:P.get("minute"),second:P.get("second")});return h&&y.add(parseInt(T,10),w),b?y.format(b.substring(1).trim()):y.format(n)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(u,r),u}catch(u){console.error(`Failed to create file: '${g}'`,u),new f.Notice("Unable to create new file.")}})}function Tt(i,t){var e;return(e=t[C(i,"year")])!=null?e:null}function Pt(){let i={};if(!Ue())return i;let{vault:t}=window.app,{folder:e}=j(),n=t.getAbstractFileByPath(f.normalizePath(e));if(!n)throw new de("Failed to find yearly notes folder");return f.Vault.recurseChildren(n,s=>{if(s instanceof f.TFile){let o=B(s,"year");if(o){let r=C(o,"year");i[r]=s}}}),i}function vt(){var n,s;let{app:i}=window,t=i.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=i.plugins.getPlugin("periodic-notes");return e&&((s=(n=e.settings)==null?void 0:n.daily)==null?void 0:s.enabled)}function xe(){var e,n;let{app:i}=window;if(i.plugins.getPlugin("calendar"))return!0;let t=i.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.weekly)==null?void 0:n.enabled)}function Oe(){var e,n;let{app:i}=window,t=i.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.monthly)==null?void 0:n.enabled)}function $e(){var e,n;let{app:i}=window,t=i.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.quarterly)==null?void 0:n.enabled)}function Ue(){var e,n;let{app:i}=window,t=i.plugins.getPlugin("periodic-notes");return t&&((n=(e=t.settings)==null?void 0:e.yearly)==null?void 0:n.enabled)}function Ct(i){let t={day:_,week:H,month:V,quarter:Y,year:j}[i];return t()}function St(i,t){return{day:Be,month:Re,week:Me}[i](t)}c.DEFAULT_DAILY_NOTE_FORMAT=ae;c.DEFAULT_MONTHLY_NOTE_FORMAT=Ne;c.DEFAULT_QUARTERLY_NOTE_FORMAT=Ee;c.DEFAULT_WEEKLY_NOTE_FORMAT=re;c.DEFAULT_YEARLY_NOTE_FORMAT=Le;c.appHasDailyNotesPluginLoaded=vt;c.appHasMonthlyNotesPluginLoaded=Oe;c.appHasQuarterlyNotesPluginLoaded=$e;c.appHasWeeklyNotesPluginLoaded=xe;c.appHasYearlyNotesPluginLoaded=Ue;c.createDailyNote=Be;c.createMonthlyNote=Re;c.createPeriodicNote=St;c.createQuarterlyNote=ht;c.createWeeklyNote=Me;c.createYearlyNote=yt;c.getAllDailyNotes=gt;c.getAllMonthlyNotes=ft;c.getAllQuarterlyNotes=wt;c.getAllWeeklyNotes=pt;c.getAllYearlyNotes=Pt;c.getDailyNote=lt;c.getDailyNoteSettings=_;c.getDateFromFile=B;c.getDateFromPath=rt;c.getDateUID=C;c.getMonthlyNote=mt;c.getMonthlyNoteSettings=V;c.getPeriodicNoteSettings=Ct;c.getQuarterlyNote=bt;c.getQuarterlyNoteSettings=Y;c.getTemplateInfo=D;c.getWeeklyNote=dt;c.getWeeklyNoteSettings=H;c.getYearlyNote=Tt;c.getYearlyNoteSettings=j});var Ft={};Ge(Ft,{default:()=>ie});module.exports=Xe(Ft);var Ye=require("obsidian");var v=require("obsidian");var N=require("obsidian");var F=require("obsidian");var et="https://raw.githubusercontent.com/",G=(i,t,e,n=!0)=>a(void 0,null,function*(){let s=`https://github.com/${i}/releases/download/${t}/${e}`;try{let o=yield(0,F.request)({url:s});return o==="Not Found"||o==='{"error":"Not Found"}'?null:o}catch(o){return n&&console.log("error in grabReleaseFileFromRepository",s,o),null}}),me=(i,t=!0,e=!0)=>a(void 0,null,function*(){let n=et+i+(t===!0?"/HEAD/manifest.json":"/HEAD/manifest-beta.json");try{let s=yield(0,F.request)({url:n});return s==="404: Not Found"?null:yield JSON.parse(s)}catch(s){return s!="Error: Request failed, status 404"&&e&&console.log(`error in grabManifestJsonFromRepository for ${n}`,s),null}}),fe=(i=!0)=>a(void 0,null,function*(){let t="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-plugins.json";try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:yield JSON.parse(e)}catch(e){return i&&console.log("error in grabCommmunityPluginList",e),null}}),he=(i=!0)=>a(void 0,null,function*(){let t="https://raw.githubusercontent.com/obsidianmd/obsidian-releases/HEAD/community-css-themes.json";try{let e=yield(0,F.request)({url:t});return e==="404: Not Found"?null:yield JSON.parse(e)}catch(e){return i&&console.log("error in grabCommmunityThemesList",e),null}}),L=(i,t=!1,e)=>a(void 0,null,function*(){let n=`https://raw.githubusercontent.com/${i}/HEAD/theme${t?"-beta":""}.css`;try{let s=yield(0,F.request)({url:n});return s==="404: Not Found"?null:s}catch(s){return e&&console.log("error in grabCommmunityThemeCssFile",s),null}}),be=(i,t=!0)=>a(void 0,null,function*(){let e=`https://raw.githubusercontent.com/${i}/HEAD/manifest.json`;try{let n=yield(0,F.request)({url:e});return n==="404: Not Found"?null:n}catch(n){return t&&console.log("error in grabCommmunityThemeManifestFile",n),null}}),tt=i=>{let t=0;for(let e=0;ett(i).toString(),R=(i,t,e)=>a(void 0,null,function*(){let n=yield L(i,t,e);return n?M(n):"0"}),nt=(i,t,e=!0)=>a(void 0,null,function*(){let n=`https://api.github.com/repos/${i}/commits?path=${t}&page=1&per_page=1`;try{let s=yield(0,F.request)({url:n});return s==="404: Not Found"?null:JSON.parse(s)}catch(s){return e&&console.log("error in grabLastCommitInfoForAFile",s),null}}),we=(i,t)=>a(void 0,null,function*(){let e=yield nt(i,t);return e[0].commit.committer.date?e[0].commit.committer.date:""});var ye={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!1,updateThemesAtStartup:!1,ribbonIconEnabled:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!0,notificationsEnabled:!0};function Te(i,t,e=""){return a(this,null,function*(){let n=!1;i.settings.pluginList.contains(t)||(i.settings.pluginList.unshift(t),n=!0),e!==""&&i.settings.pluginSubListFrozenVersion.filter(s=>s.repo===t).length===0&&(i.settings.pluginSubListFrozenVersion.unshift({repo:t,version:e}),n=!0),n&&i.saveSettings()})}function Pe(i,t){return a(this,null,function*(){return i.settings.pluginList.contains(t)})}function ve(i,t,e){return a(this,null,function*(){let n={repo:t,lastUpdate:M(e)};i.settings.themesList.unshift(n),i.saveSettings()})}function Ce(i,t){return a(this,null,function*(){return!!i.settings.themesList.find(n=>n.repo===t)})}function Se(i,t,e){i.settings.themesList.forEach(n=>{n.repo===t&&(n.lastUpdate=e,i.saveSettings())})}var Z=require("obsidian");function p(i,t,e=10,n){if(i.settings.notificationsEnabled===!1)return;let s=n?Z.Platform.isDesktop?"(click=dismiss, right-click=Info)":"(click=dismiss)":"",o=new Z.Notice(`BRAT ${t} -${i}`,e*1e3);n&&(o.noticeEl.oncontextmenu=()=>a(this,null,function*(){n()}))}function J(){return a(this,null,function*(){try{let s=yield fetch("https://obsidian.md/?"+Math.random());return s.status>=200&&s.status<300}catch(s){return!1}})}var Pe=s=>(0,W.normalizePath)(s.app.vault.configDir+"/themes")+"/",ie=(s,t,e="")=>a(void 0,null,function*(){let n=yield ne(t,s.settings.debuggingMode);if(!n)return m(s,"There is no obsidian.css file in the root path of this repository, so there is no theme to install."),!1;yield ve(s,e,n);let i=`${e} theme installed from ${t}. `;return s.log(i+`[Theme Info](https://github.com/${t})`,!1),m(s,`${i}`,10,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),setTimeout(()=>{s.app.customCss.setTheme(e)},500),!0}),ve=(s,t,e)=>a(void 0,null,function*(){let n=Pe(s),i=s.app.vault.adapter;(yield i.exists(n))===!1&&(yield i.mkdir(n)),yield i.write(n+t+".css",e)}),Se=s=>a(void 0,null,function*(){let t=yield H(s.settings.debuggingMode),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i})),n=new S(s);n.setSuggesterData(e),yield n.display(i=>a(void 0,null,function*(){yield ie(s,i.info.repo,i.info.name)}))}),Q=s=>("BRAT-"+s.replace("/","----")).substr(0,100),Ne=(s,t)=>a(void 0,null,function*(){s.settings.themesList=s.settings.themesList.filter(n=>n.repo!=t),s.saveSettings(),yield s.app.vault.adapter.remove(Pe(s)+Q(t)+".css");let e=`Removed ${t} from BRAT themes list and deleted from vault`;s.log(e,!0),m(s,`${e}`)}),G=(s,t)=>a(void 0,null,function*(){if((yield J())===!1){console.log("BRAT: No internet detected.");return}let e,n="Checking for beta theme updates STARTED";s.log(n,!0),t&&s.settings.notificationsEnabled&&(e=new W.Notice(`BRAT -${n}`,3e4));for(let o of s.settings.themesList){let r=yield j(o.repo,"obsidian.css");r!==o.lastUpdate&&(yield tt(s,o.repo,o.lastUpdate,r))}let i="Checking for beta theme updates COMPLETED";s.log(i,!0),t&&(s.settings.notificationsEnabled&&e.hide(),m(s,i))}),tt=(s,t,e="",n="")=>a(void 0,null,function*(){let i=yield ne(t,s.settings.debuggingMode);if(!i)return m(s,"There is no obsidian.css file in the root path of the ${cssGithubRepository} repository, so this theme cannot be updated."),!1;let o=Q(t);yield ve(s,o,i),Te(s,t,n);let r=`${o} theme updated from ${t}. From date: ${e} to ${n} `;return s.log(r+`[Theme Info](https://github.com/${t})`,!1),m(s,`${r}`,20,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),!0});var K=require("obsidian");var C=class extends K.Modal{constructor(e,n=!1){super(e.app);this.plugin=e,this.address="",this.openSettingsTabAfterwards=n}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield ye(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield ie(this.plugin,e,Q(e)))&&(yield we(this.plugin,e),this.close())})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{new K.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: https://github.com/GitubUserName/repository-name"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Theme"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var Z=class extends v.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.appName}),new v.Setting(e).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(i=>{i.setValue(this.plugin.settings.updateAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(i=>{i.setValue(this.plugin.settings.updateThemesAtStartup),i.onChange(o=>a(this,null,function*(){this.plugin.settings.updateThemesAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Ribbon Button").setDesc("Toggle ribbon button off and on.").addToggle(i=>{i.setValue(this.plugin.settings.ribbonIconEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.ribbonIconEnabled=o,this.plugin.settings.ribbonIconEnabled===!1?this.plugin.ribbonIcon.remove():this.plugin.showRibbonButton(),yield this.plugin.saveSettings()}))}),e.createEl("hr"),e.createEl("h2",{text:"Beta Plugin List"}),e.createEl("div",{text:'The following is a list of beta plugins added via the command palette "Add a beta plugin for testing" or "Add a beta plugin with frozen version for testing". A frozen version is a specific release of a plugin based on its releease tag. '}),e.createEl("p"),e.createEl("div",{text:"Click the x button next to a plugin to remove it from the list."}),e.createEl("p"),e.createEl("span").createEl("b",{text:"Note: "}),e.createSpan({text:"This does not delete the plugin, this should be done from the Community Plugins tab in Settings."}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!1)}))});let n=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo));for(let i of this.plugin.settings.pluginList)n.has(i)||new v.Setting(e).setName(i).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i))}))});new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta plugin with frozen version"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!0)}))});for(let i of this.plugin.settings.pluginSubListFrozenVersion)new v.Setting(e).setName(`${i.repo} (version ${i.version})`).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Beta Themes List"}),new v.Setting(e).addButton(i=>{i.setButtonText("Add Beta Theme"),i.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),new C(this.plugin).open()}))});for(let i of this.plugin.settings.themesList)new v.Setting(e).setName(i.repo).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta theme"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield Ne(this.plugin,i.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Monitoring"}),new v.Setting(e).setName("Enable Notifications").setDesc("BRAT will provide popup notifications for its various activities. Turn this off means no notifications from BRAT.").addToggle(i=>{i.setValue(this.plugin.settings.notificationsEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.notificationsEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Logging").setDesc("Plugin updates will be logged to a file in the log file.").addToggle(i=>{i.setValue(this.plugin.settings.loggingEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(this.containerEl).setName("BRAT Log File Location").setDesc("Logs will be saved to this file. Don't add .md to the file name.").addSearch(i=>{i.setPlaceholder("Example: BRAT-log").setValue(this.plugin.settings.loggingPath).onChange(o=>a(this,null,function*(){this.plugin.settings.loggingPath=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Verbose Logging").setDesc("Get a lot more information in the log.").addToggle(i=>{i.setValue(this.plugin.settings.loggingVerboseEnabled),i.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingVerboseEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Debugging Mode").setDesc("Atomic Bomb level console logging. Can be used for troubleshoting and development.").addToggle(i=>{i.setValue(this.plugin.settings.debuggingMode),i.onChange(o=>a(this,null,function*(){this.plugin.settings.debuggingMode=o,yield this.plugin.saveSettings()}))})}};var L=require("obsidian");var B=class extends L.Modal{constructor(e,n,i=!1,o=!1){super(e.app);this.plugin=e,this.betaPlugins=n,this.address="",this.openSettingsTabAfterwards=i,this.useFrozenVersion=o,this.version=""}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield be(this.plugin,e)){m(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield this.betaPlugins.addPlugin(e,!1,!1,!1,this.version))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta plugin:"}),this.contentEl.createEl("form",{},e=>{new L.Setting(e).addText(n=>{n.setPlaceholder("Repository (example: https://github.com/GitubUserName/repository-name)"),n.onChange(i=>{this.address=i.trim()}),n.inputEl.addEventListener("keydown",i=>a(this,null,function*(){i.key==="Enter"&&this.address!==" "&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(i.preventDefault(),yield this.submitForm())})),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove(),n.inputEl.focus()},10)}),this.useFrozenVersion&&new L.Setting(e).addText(n=>{n.setPlaceholder("Specify the release version tag (example: 1.0.0)"),n.onChange(i=>{this.version=i.trim()}),n.inputEl.style.width="100%",window.setTimeout(()=>{let i=document.querySelector(".setting-item-info");i&&i.remove()},10)}),e.createDiv("modal-button-container",n=>{n.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),n.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Plugin"})}),e.addEventListener("submit",n=>a(this,null,function*(){n.preventDefault(),this.address!==""&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var A=require("obsidian");var D=class{constructor(t){this.plugin=t}displayAddNewPluginModal(t=!1,e=!1){return a(this,null,function*(){new B(this.plugin,this,t,e).open()})}validateRepository(t,e=!1,n=!1){return a(this,null,function*(){let o=yield me(t,!e,this.plugin.settings.debuggingMode);return o?"id"in o?"version"in o?o:(n&&m(this.plugin,`${t} -The version attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t} -The plugin id attribute for the release is missing from the manifest file`,15),null):(n&&m(this.plugin,`${t} -This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),null)})}getAllReleaseFiles(t,e,n,i=""){return a(this,null,function*(){let o=i===""?e.version:i,r=n||i!=="";return{mainJs:yield Y(t,o,"main.js",this.plugin.settings.debuggingMode),manifest:r?yield Y(t,o,"manifest.json",this.plugin.settings.debuggingMode):"",styles:yield Y(t,o,"styles.css",this.plugin.settings.debuggingMode)}})}writeReleaseFilesToPluginFolder(t,e){return a(this,null,function*(){let n=(0,A.normalizePath)(this.plugin.app.vault.configDir+"/plugins/"+t)+"/",i=this.plugin.app.vault.adapter;((yield i.exists(n))===!1||!(yield i.exists(n+"manifest.json")))&&(yield i.mkdir(n)),yield i.write(n+"main.js",e.mainJs),yield i.write(n+"manifest.json",e.manifest),e.styles&&(yield i.write(n+"styles.css",e.styles))})}addPlugin(t,e=!1,n=!1,i=!1,o=""){return a(this,null,function*(){var h;let l=yield this.validateRepository(t,!0,!1),g=!!l;if(g===!1&&(l=yield this.validateRepository(t,!1,!0)),l===null){let d=`${t} -A manifest.json or manifest-beta.json file does not exist in the root directory of the repository. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}if(!l.hasOwnProperty("version")){let d=`${t} -The manifest${g?"-beta":""}.json file in the root directory of the repository does not have a version number in the file. This plugin cannot be installed.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,10),!1}if(l.hasOwnProperty("minAppVersion")&&!(0,A.requireApiVersion)(l.minAppVersion)){let d=`Plugin: ${t} +${s}`,e*1e3);n&&(o.noticeEl.oncontextmenu=()=>a(this,null,function*(){n()}))}function X(){return a(this,null,function*(){try{let i=yield fetch("https://obsidian.md/?"+Math.random());return i.status>=200&&i.status<300}catch(i){return!1}})}var x=(i,t,e)=>a(void 0,null,function*(){let n=yield L(t,!0,i.settings.debuggingMode);if(n||(n=yield L(t,!1,i.settings.debuggingMode)),!n)return p(i,"There is no theme.css or theme-beta.css file in the root path of this repository, so there is no theme to install."),!1;let s=yield be(t,i.settings.debuggingMode);if(!s)return p(i,"There is no manifest.json file in the root path of this repository, so theme cannot be installed."),!1;let o=yield JSON.parse(s),r=(0,N.normalizePath)(it(i)+o.name),l=i.app.vault.adapter;(yield l.exists(r))===!1&&(yield l.mkdir(r)),yield l.write((0,N.normalizePath)(r+"/theme.css"),n),yield l.write((0,N.normalizePath)(r+"/manifest.json"),s),Se(i,t,M(n));let g="";return e?(yield ve(i,t,n),g=`${o.name} theme installed from ${t}. `,setTimeout(()=>{i.app.customCss.setTheme(o.name)},500)):g=`${o.name} theme updated from ${t}.`,i.log(g+`[Theme Info](https://github.com/${t})`,!1),p(i,`${g}`,20,()=>a(void 0,null,function*(){window.open(`https://github.com/${t}`)})),!0}),I=(i,t)=>a(void 0,null,function*(){if((yield X())===!1){console.log("BRAT: No internet detected.");return}let e,n="Checking for beta theme updates STARTED";i.log(n,!0),t&&i.settings.notificationsEnabled&&(e=new N.Notice(`BRAT +${n}`,3e4));for(let o of i.settings.themesList){let r=yield R(o.repo,!0,i.settings.debuggingMode);r==="0"&&(r=yield R(o.repo,!1,i.settings.debuggingMode)),r!==o.lastUpdate&&(yield x(i,o.repo,!1))}let s="Checking for beta theme updates COMPLETED";i.log(s,!0),t&&(i.settings.notificationsEnabled&&e.hide(),p(i,s))}),ee=(i,t)=>a(void 0,null,function*(){i.settings.themesList=i.settings.themesList.filter(n=>n.repo!=t),i.saveSettings();let e=`Removed ${t} from BRAT themes list and will no longer be updated. However, the theme files still exist in the vault. To remove them, go into Settings > Appearance and remove the theme.`;i.log(e,!0),p(i,`${e}`)}),it=i=>(0,N.normalizePath)(i.app.vault.configDir+"/themes")+"/";var te=require("obsidian");var k=(i,t=!0)=>{let e=t?40:30,n=i.createEl("div");n.style.float="right",t===!1?(n.style.padding="10px",n.style.paddingLeft="15px",n.style.paddingRight="15px"):(n.style.padding="15px",n.style.paddingLeft="15px",n.style.paddingRight="15px",n.style.marginLeft="15px");let s=n.createSpan("coffee");s.addClass("ex-coffee-span");let r=s.createEl("a",{href:"https://bit.ly/o42-kofi"}).createEl("img",{attr:{src:"https://cdn.ko-fi.com/cdn/kofi3.png?v=3"}});r.height=e;let l=n.createSpan("coffee");l.addClass("ex-twitter-span"),l.style.paddingLeft="10px";let u=l.createEl("a",{href:"https://bit.ly/o42-twitter"}).createEl("img",{attr:{src:"https://cdn.cdnlogo.com/logos/t/96/twitter-icon.svg"}});u.height=e;let m=n.createSpan("coffee");m.addClass("ex-twitter-span"),m.style.paddingLeft="10px",m.style.right="0";let h=m.createEl("a",{href:"https://bit.ly/o42-medium"}).createEl("img",{attr:{src:"https://miro.medium.com/v2/resize:fill:176:176/1*sHhtYhaCe2Uc3IU0IgKwIQ.png"}});return h.height=e,n};var E=class extends te.Modal{constructor(e,n=!1){super(e.app);this.plugin=e,this.address="",this.openSettingsTabAfterwards=n}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield Ce(this.plugin,e)){p(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield x(this.plugin,e,!0))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{e.addClass("brat-modal"),new te.Setting(e).addText(o=>{o.setPlaceholder("Repository (example: https://github.com/GitubUserName/repository-name"),o.onChange(r=>{this.address=r.trim()}),o.inputEl.addEventListener("keydown",r=>a(this,null,function*(){r.key==="Enter"&&this.address!==" "&&(r.preventDefault(),yield this.submitForm())})),o.inputEl.style.width="100%",window.setTimeout(()=>{let r=document.querySelector(".setting-item-info");r&&r.remove(),o.inputEl.focus()},10)}),e.createDiv("modal-button-container",o=>{o.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),o.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Theme"})});let n=e.createDiv();n.style.borderTop="1px solid #ccc",n.style.marginTop="30px";let s=n.createSpan();s.innerHTML="BRAT by TFTHacker",s.style.fontStyle="italic",n.appendChild(s),k(n,!1),window.setTimeout(()=>{e.querySelectorAll(".brat-modal .setting-item-info").forEach(r=>{r.remove()})},50),e.addEventListener("submit",o=>a(this,null,function*(){o.preventDefault(),this.address!==""&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var ne=class extends v.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this;e.empty(),k(e,!0),e.createEl("h1",{text:this.plugin.appName}),e.createEl("h2",{text:"by TfTHacker"}),new v.Setting(e).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(s=>{s.setValue(this.plugin.settings.updateAtStartup),s.onChange(o=>a(this,null,function*(){this.plugin.settings.updateAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(s=>{s.setValue(this.plugin.settings.updateThemesAtStartup),s.onChange(o=>a(this,null,function*(){this.plugin.settings.updateThemesAtStartup=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Ribbon Button").setDesc("Toggle ribbon button off and on.").addToggle(s=>{s.setValue(this.plugin.settings.ribbonIconEnabled),s.onChange(o=>a(this,null,function*(){this.plugin.settings.ribbonIconEnabled=o,this.plugin.settings.ribbonIconEnabled===!1?this.plugin.ribbonIcon.remove():this.plugin.showRibbonButton(),yield this.plugin.saveSettings()}))}),e.createEl("hr"),e.createEl("h2",{text:"Beta Plugin List"}),e.createEl("div",{text:'The following is a list of beta plugins added via the command palette "Add a beta plugin for testing" or "Add a beta plugin with frozen version for testing". A frozen version is a specific release of a plugin based on its releease tag. '}),e.createEl("p"),e.createEl("div",{text:"Click the x button next to a plugin to remove it from the list."}),e.createEl("p"),e.createEl("span").createEl("b",{text:"Note: "}),e.createSpan({text:"This does not delete the plugin, this should be done from the Community Plugins tab in Settings."}),new v.Setting(e).addButton(s=>{s.setButtonText("Add Beta plugin"),s.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!1)}))});let n=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(s=>s.repo));for(let s of this.plugin.settings.pluginList)n.has(s)||new v.Setting(e).setName(s).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(s))}))});new v.Setting(e).addButton(s=>{s.setButtonText("Add Beta plugin with frozen version"),s.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),yield this.plugin.betaPlugins.displayAddNewPluginModal(!0,!0)}))});for(let s of this.plugin.settings.pluginSubListFrozenVersion)new v.Setting(e).setName(`${s.repo} (version ${s.version})`).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta plugin"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield this.plugin.betaPlugins.deletePlugin(s.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Beta Themes List"}),new v.Setting(e).addButton(s=>{s.setButtonText("Add Beta Theme"),s.onClick(()=>a(this,null,function*(){this.plugin.app.setting.close(),new E(this.plugin).open()}))});for(let s of this.plugin.settings.themesList)new v.Setting(e).setName(s.repo).addButton(o=>{o.setIcon("cross"),o.setTooltip("Delete this beta theme"),o.onClick(()=>a(this,null,function*(){o.buttonEl.textContent===""?o.setButtonText("Click once more to confirm removal"):(o.buttonEl.parentElement.parentElement.remove(),yield ee(this.plugin,s.repo))}))});e.createEl("hr"),e.createEl("h2",{text:"Monitoring"}),new v.Setting(e).setName("Enable Notifications").setDesc("BRAT will provide popup notifications for its various activities. Turn this off means no notifications from BRAT.").addToggle(s=>{s.setValue(this.plugin.settings.notificationsEnabled),s.onChange(o=>a(this,null,function*(){this.plugin.settings.notificationsEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Logging").setDesc("Plugin updates will be logged to a file in the log file.").addToggle(s=>{s.setValue(this.plugin.settings.loggingEnabled),s.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(this.containerEl).setName("BRAT Log File Location").setDesc("Logs will be saved to this file. Don't add .md to the file name.").addSearch(s=>{s.setPlaceholder("Example: BRAT-log").setValue(this.plugin.settings.loggingPath).onChange(o=>a(this,null,function*(){this.plugin.settings.loggingPath=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Enable Verbose Logging").setDesc("Get a lot more information in the log.").addToggle(s=>{s.setValue(this.plugin.settings.loggingVerboseEnabled),s.onChange(o=>a(this,null,function*(){this.plugin.settings.loggingVerboseEnabled=o,yield this.plugin.saveSettings()}))}),new v.Setting(e).setName("Debugging Mode").setDesc("Atomic Bomb level console logging. Can be used for troubleshoting and development.").addToggle(s=>{s.setValue(this.plugin.settings.debuggingMode),s.onChange(o=>a(this,null,function*(){this.plugin.settings.debuggingMode=o,yield this.plugin.saveSettings()}))})}};var O=require("obsidian");var $=class extends O.Modal{constructor(e,n,s=!1,o=!1){super(e.app);this.plugin=e,this.betaPlugins=n,this.address="",this.openSettingsTabAfterwards=s,this.useFrozenVersion=o,this.version=""}submitForm(){return a(this,null,function*(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(yield Pe(this.plugin,e)){p(this.plugin,"This plugin is already in the list for beta testing",10);return}(yield this.betaPlugins.addPlugin(e,!1,!1,!1,this.version))&&this.close()})}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta plugin:"}),this.contentEl.createEl("form",{},e=>{e.addClass("brat-modal"),new O.Setting(e).addText(o=>{o.setPlaceholder("Repository (example: https://github.com/GitubUserName/repository-name)"),o.onChange(r=>{this.address=r.trim()}),o.inputEl.addEventListener("keydown",r=>a(this,null,function*(){r.key==="Enter"&&this.address!==" "&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(r.preventDefault(),yield this.submitForm())})),o.inputEl.style.width="100%"}),this.useFrozenVersion&&new O.Setting(e).addText(o=>{o.setPlaceholder("Specify the release version tag (example: 1.0.0)"),o.onChange(r=>{this.version=r.trim()}),o.inputEl.style.width="100%"}),e.createDiv("modal-button-container",o=>{o.createEl("button",{attr:{type:"button"},text:"Never mind"}).addEventListener("click",()=>this.close()),o.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:"Add Plugin"})});let n=e.createDiv();n.style.borderTop="1px solid #ccc",n.style.marginTop="30px";let s=n.createSpan();s.innerHTML="BRAT by TFTHacker",s.style.fontStyle="italic",n.appendChild(s),k(n,!1),window.setTimeout(()=>{e.querySelectorAll(".brat-modal .setting-item-info").forEach(r=>{r.remove()})},50),e.addEventListener("submit",o=>a(this,null,function*(){o.preventDefault(),this.address!==""&&(this.useFrozenVersion&&this.version!==""||!this.useFrozenVersion)&&(yield this.submitForm())}))})}onClose(){return a(this,null,function*(){this.openSettingsTabAfterwards&&(yield this.plugin.app.setting.open(),yield this.plugin.app.setting.openTabById("obsidian42-brat"))})}};var A=require("obsidian");var U=class{constructor(t){this.plugin=t}displayAddNewPluginModal(t=!1,e=!1){return a(this,null,function*(){new $(this.plugin,this,t,e).open()})}validateRepository(t,e=!1,n=!1){return a(this,null,function*(){let o=yield me(t,!e,this.plugin.settings.debuggingMode);return o?"id"in o?"version"in o?o:(n&&p(this.plugin,`${t} +The version attribute for the release is missing from the manifest file`,15),null):(n&&p(this.plugin,`${t} +The plugin id attribute for the release is missing from the manifest file`,15),null):(n&&p(this.plugin,`${t} +This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),null)})}getAllReleaseFiles(t,e,n,s=""){return a(this,null,function*(){let o=s===""?e.version:s,r=n||s!=="";return{mainJs:yield G(t,o,"main.js",this.plugin.settings.debuggingMode),manifest:r?yield G(t,o,"manifest.json",this.plugin.settings.debuggingMode):"",styles:yield G(t,o,"styles.css",this.plugin.settings.debuggingMode)}})}writeReleaseFilesToPluginFolder(t,e){return a(this,null,function*(){let n=(0,A.normalizePath)(this.plugin.app.vault.configDir+"/plugins/"+t)+"/",s=this.plugin.app.vault.adapter;((yield s.exists(n))===!1||!(yield s.exists(n+"manifest.json")))&&(yield s.mkdir(n)),yield s.write(n+"main.js",e.mainJs),yield s.write(n+"manifest.json",e.manifest),e.styles&&(yield s.write(n+"styles.css",e.styles))})}addPlugin(t,e=!1,n=!1,s=!1,o=""){return a(this,null,function*(){var m;let l=yield this.validateRepository(t,!0,!1),g=!!l;if(g===!1&&(l=yield this.validateRepository(t,!1,!0)),l===null){let d=`${t} +A manifest.json or manifest-beta.json file does not exist in the root directory of the repository. This plugin cannot be installed.`;return this.plugin.log(d,!0),p(this.plugin,`${d}`,10),!1}if(!l.hasOwnProperty("version")){let d=`${t} +The manifest${g?"-beta":""}.json file in the root directory of the repository does not have a version number in the file. This plugin cannot be installed.`;return this.plugin.log(d,!0),p(this.plugin,`${d}`,10),!1}if(l.hasOwnProperty("minAppVersion")&&!(0,A.requireApiVersion)(l.minAppVersion)){let d=`Plugin: ${t} The manifest${g?"-beta":""}.json for this plugin indicates that the Obsidian version of the app needs to be ${l.minAppVersion}, but this installation of Obsidian is ${A.apiVersion}. -You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return this.plugin.log(d,!0),m(this.plugin,`${d}`,30),!1}let c=()=>a(this,null,function*(){let d=yield this.getAllReleaseFiles(t,l,g,o);if((g||d.manifest==="")&&(d.manifest=JSON.stringify(l)),d.mainJs===null){let b=`${t} -The release is not complete and cannot be download. main.js is missing from the Release`;return this.plugin.log(b,!0),m(this.plugin,`${b}`,10),null}return d});if(e===!1){let d=yield c();if(d===null)return!1;yield this.writeReleaseFilesToPluginFolder(l.id,d),yield he(this.plugin,t,o),yield this.plugin.app.plugins.loadManifests();let b=o===""?"":` (version: ${o})`,T=`${t}${b} -The plugin has been registered with BRAT. You may still need to enable it the Community Plugin List.`;this.plugin.log(T,!0),m(this.plugin,T,10)}else{let d=this.plugin.app.vault.configDir+"/plugins/"+l.id+"/",b="";try{b=yield this.plugin.app.vault.adapter.read(d+"manifest.json")}catch(w){if(w.errno===-4058||w.errno===-2)return yield this.addPlugin(t,!1,g,!1,o),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(w,null,2))}if(o!==""||this.plugin.settings.pluginSubListFrozenVersion.map(w=>w.repo).includes(t))return m(this.plugin,`The version of ${t} is frozen, not updating.`,3),!1;let T=yield JSON.parse(b);if(T.version!==l.version){let w=yield c();if(w===null)return!1;if(n){let f=`There is an update available for ${l.id} from version ${T.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}else{yield this.writeReleaseFilesToPluginFolder(l.id,w),yield this.plugin.app.plugins.loadManifests(),(h=this.plugin.app.plugins.plugins[l.id])!=null&&h.manifest&&(yield this.reloadPlugin(l.id));let f=`${l.id} -Plugin has been updated from version ${T.version} to ${l.version}. `;this.plugin.log(f+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),m(this.plugin,f,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}}else i&&m(this.plugin,`No update available for ${t}`,3)}return!0})}reloadPlugin(t){return a(this,null,function*(){let e=this.plugin.app.plugins;try{yield e.disablePlugin(t),yield e.enablePlugin(t)}catch(n){this.plugin.settings.debuggingMode&&console.log("reload plugin",n)}})}updatePlugin(t,e=!1,n=!1){return a(this,null,function*(){let i=yield this.addPlugin(t,!0,e,n);return i===!1&&e===!1&&m(this.plugin,`${t} -Update of plugin failed.`),i})}checkForUpdatesAndInstallUpdates(t=!1,e=!1){return a(this,null,function*(){if((yield J())===!1){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";this.plugin.log(i,!0),t&&this.plugin.settings.notificationsEnabled&&(n=new A.Notice(`BRAT -${i}`,3e4));let o=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(l=>l.repo));for(let l of this.plugin.settings.pluginList)o.has(l)||(yield this.updatePlugin(l,e));let r="Checking for plugin updates COMPLETED";this.plugin.log(r,!0),t&&(n.hide(),m(this.plugin,r,10))})}deletePlugin(t){return a(this,null,function*(){let e=`Removed ${t} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!=t),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!=t),this.plugin.saveSettings()})}getEnabledDisabledPlugins(t){let e=this.plugin.app.plugins,n=Object.values(e.manifests),i=Object.values(e.plugins).map(o=>o.manifest);return t?n.filter(o=>i.find(r=>o.id===r.id)):n.filter(o=>!i.find(r=>o.id===r.id))}};var Ae=require("obsidian");function Fe(){(0,Ae.addIcon)("BratIcon",'')}var z=require("obsidian"),_e=Ke(ze());function Ve(s,t,e=!1){if(s.settings.debuggingMode&&console.log("BRAT: "+t),s.settings.loggingEnabled){if(s.settings.loggingVerboseEnabled===!1&&e===!0)return;{let n=s.settings.loggingPath+".md",i="[["+(0,z.moment)().format((0,_e.getDailyNoteSettings)().format).toString()+"]] "+(0,z.moment)().format("HH:mm"),o=z.Platform.isDesktop?window.require("os").hostname():"MOBILE",r=i+" "+o+" "+t.replace(` +You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return this.plugin.log(d,!0),p(this.plugin,`${d}`,30),!1}let u=()=>a(this,null,function*(){let d=yield this.getAllReleaseFiles(t,l,g,o);if((g||d.manifest==="")&&(d.manifest=JSON.stringify(l)),d.mainJs===null){let h=`${t} +The release is not complete and cannot be download. main.js is missing from the Release`;return this.plugin.log(h,!0),p(this.plugin,`${h}`,10),null}return d});if(e===!1){let d=yield u();if(d===null)return!1;yield this.writeReleaseFilesToPluginFolder(l.id,d),yield Te(this.plugin,t,o),yield this.plugin.app.plugins.loadManifests();let h=o===""?"":` (version: ${o})`,T=`${t}${h} +The plugin has been registered with BRAT. You may still need to enable it the Community Plugin List.`;this.plugin.log(T,!0),p(this.plugin,T,10)}else{let d=this.plugin.app.vault.configDir+"/plugins/"+l.id+"/",h="";try{h=yield this.plugin.app.vault.adapter.read(d+"manifest.json")}catch(w){if(w.errno===-4058||w.errno===-2)return yield this.addPlugin(t,!1,g,!1,o),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(w,null,2))}if(o!==""||this.plugin.settings.pluginSubListFrozenVersion.map(w=>w.repo).includes(t))return p(this.plugin,`The version of ${t} is frozen, not updating.`,3),!1;let T=yield JSON.parse(h);if(T.version!==l.version){let w=yield u();if(w===null)return!1;if(n){let b=`There is an update available for ${l.id} from version ${T.version} to ${l.version}. `;this.plugin.log(b+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),p(this.plugin,b,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}else{yield this.writeReleaseFilesToPluginFolder(l.id,w),yield this.plugin.app.plugins.loadManifests(),(m=this.plugin.app.plugins.plugins[l.id])!=null&&m.manifest&&(yield this.reloadPlugin(l.id));let b=`${l.id} +Plugin has been updated from version ${T.version} to ${l.version}. `;this.plugin.log(b+`[Release Info](https://github.com/${t}/releases/tag/${l.version})`,!1),p(this.plugin,b,30,()=>a(this,null,function*(){window.open(`https://github.com/${t}/releases/tag/${l.version}`)}))}}else s&&p(this.plugin,`No update available for ${t}`,3)}return!0})}reloadPlugin(t){return a(this,null,function*(){let e=this.plugin.app.plugins;try{yield e.disablePlugin(t),yield e.enablePlugin(t)}catch(n){this.plugin.settings.debuggingMode&&console.log("reload plugin",n)}})}updatePlugin(t,e=!1,n=!1){return a(this,null,function*(){let s=yield this.addPlugin(t,!0,e,n);return s===!1&&e===!1&&p(this.plugin,`${t} +Update of plugin failed.`),s})}checkForUpdatesAndInstallUpdates(t=!1,e=!1){return a(this,null,function*(){if((yield X())===!1){console.log("BRAT: No internet detected.");return}let n,s="Checking for plugin updates STARTED";this.plugin.log(s,!0),t&&this.plugin.settings.notificationsEnabled&&(n=new A.Notice(`BRAT +${s}`,3e4));let o=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(l=>l.repo));for(let l of this.plugin.settings.pluginList)o.has(l)||(yield this.updatePlugin(l,e));let r="Checking for plugin updates COMPLETED";this.plugin.log(r,!0),t&&(n.hide(),p(this.plugin,r,10))})}deletePlugin(t){return a(this,null,function*(){let e=`Removed ${t} from BRAT plugin list`;this.plugin.log(e,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!=t),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!=t),this.plugin.saveSettings()})}getEnabledDisabledPlugins(t){let e=this.plugin.app.plugins,n=Object.values(e.manifests),s=Object.values(e.plugins).map(o=>o.manifest);return t?n.filter(o=>s.find(r=>o.id===r.id)):n.filter(o=>!s.find(r=>o.id===r.id))}};var Fe=require("obsidian");function Ae(){(0,Fe.addIcon)("BratIcon",'')}var J=require("obsidian"),_e=Ze(ze());function He(i,t,e=!1){if(i.settings.debuggingMode&&console.log("BRAT: "+t),i.settings.loggingEnabled){if(i.settings.loggingVerboseEnabled===!1&&e===!0)return;{let n=i.settings.loggingPath+".md",s="[["+(0,J.moment)().format((0,_e.getDailyNoteSettings)().format).toString()+"]] "+(0,J.moment)().format("HH:mm"),o=J.Platform.isDesktop?window.require("os").hostname():"MOBILE",r=s+" "+o+" "+t.replace(` `," ")+` -`;setTimeout(()=>a(this,null,function*(){if((yield s.app.vault.adapter.exists(n))===!0){let l=yield s.app.vault.adapter.read(n);r=r+l;let g=s.app.vault.getAbstractFileByPath(n);yield s.app.vault.modify(g,r)}else yield s.app.vault.create(n,r)}),10)}}}var _=class{constructor(t){this.bratCommands=[{id:"BRAT-AddBetaPlugin",icon:"BratIcon",name:"Plugins: Add a beta plugin for testing",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!1)})},{id:"BRAT-AddBetaPluginWithFrozenVersion",icon:"BratIcon",name:"Plugins: Add a beta plugin with frozen version based on a release tag",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!0)})},{id:"BRAT-checkForUpdatesAndUpdate",icon:"BratIcon",name:"Plugins: Check for updates to all beta plugins and UPDATE",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!1)})},{id:"BRAT-checkForUpdatesAndDontUpdate",icon:"BratIcon",name:"Plugins: Only check for updates to beta plugins, but don't Update",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!0)})},{id:"BRAT-updateOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin version to update",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),e=Object.values(this.plugin.settings.pluginList).filter(i=>!t.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){let o=`Checking for updates for ${i.info}`;this.plugin.log(o,!0),m(this.plugin,` -${o}`,3),yield this.plugin.betaPlugins.updatePlugin(i.info,!1,!0)}))})},{id:"BRAT-restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){m(this.plugin,`${n.info} -Plugin reloading .....`,5),yield this.plugin.betaPlugins.reloadPlugin(n.info)}))})},{id:"BRAT-disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.log(n.info),yield this.plugin.app.plugins.disablePluginAndSave(n.info)}))})},{id:"BRAT-enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin enabled`,!1),yield this.plugin.app.plugins.enablePluginAndSave(n.info)}))})},{id:"BRAT-openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield pe(this.plugin.settings.debuggingMode),e=Object.values(t).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:"BRAT: "+o,info:o}));e.forEach(o=>n.push(o));let i=new S(this.plugin);i.setSuggesterData(n),yield i.display(o=>a(this,null,function*(){o.info&&window.open(`https://github.com/${o.info}`)}))})},{id:"BRAT-openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield H(this.plugin.settings.debuggingMode),e=Object.values(t).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(i=>a(this,null,function*(){i.info&&window.open(`https://github.com/${i.info}`)}))})},{id:"BRAT-opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.app.setting,e=Object.values(t.pluginTabs).map(o=>({display:"Plugin: "+o.name,info:o.id})),n=new S(this.plugin),i=Object.values(t.settingTabs).map(o=>({display:"Core: "+o.name,info:o.id}));e.forEach(o=>i.push(o)),n.setSuggesterData(i),yield n.display(o=>a(this,null,function*(){t.open(),t.openTabById(o.info)}))})},{id:"BRAT-GrabCommunityTheme",icon:"BratIcon",name:"Themes: Grab a community theme",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield Se(this.plugin)})},{id:"BRAT-GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>a(this,null,function*(){new C(this.plugin).open()})},{id:"BRAT-updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield G(this.plugin,!0)})},{id:"BRAT-switchTheme",icon:"BratIcon",name:"Themes: Switch Active Theme ",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.customCss.themes).map(n=>({display:n,info:n}));t.unshift({display:"Obsidian Default Theme",info:""});let e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`Switched to theme ${n.display}`,!1),this.plugin.app.customCss.setTheme(n.info)}))})},{id:"BRAT-allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>a(this,null,function*(){return this.ribbonDisplayCommands()})}];this.plugin=t,this.bratCommands.forEach(e=>a(this,null,function*(){this.plugin.addCommand({id:e.id,name:e.name,icon:e.icon,callback:()=>a(this,null,function*(){yield e.callback()})})}))}ribbonDisplayCommands(){return a(this,null,function*(){let t=[];this.bratCommands.forEach(r=>{r.showInRibbon&&t.push({display:r.name,info:r.callback})});let e=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(r=>({display:"Core: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})})),o=Object.values(n.pluginTabs).map(r=>({display:"Plugin: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})}));t.push({display:"---- Core Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),i.forEach(r=>t.push(r)),t.push({display:"---- Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),o.forEach(r=>t.push(r)),e.setSuggesterData(t),yield e.display(r=>a(this,null,function*(){return yield r.info()}))})}};var X=class extends Ye.Plugin{constructor(){super(...arguments);this.appName="Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)";this.appID="obsidian42-brat"}onload(){return a(this,null,function*(){console.log("loading Obsidian42 - BRAT"),yield this.loadSettings(),this.addSettingTab(new Z(this.app,this)),this.betaPlugins=new D(this),this.commands=new _(this),Fe(),this.settings.ribbonIconEnabled&&this.showRibbonButton(),this.app.workspace.onLayoutReady(()=>{this.settings.updateAtStartup&&setTimeout(()=>a(this,null,function*(){yield this.betaPlugins.checkForUpdatesAndInstallUpdates(!1)}),6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>a(this,null,function*(){yield G(this,!1)}),12e4)})})}showRibbonButton(){this.ribbonIcon=this.addRibbonIcon("BratIcon","BRAT",()=>a(this,null,function*(){return this.commands.ribbonDisplayCommands()}))}log(e,n=!1){Ve(this,e,n)}onunload(){console.log("unloading "+this.appName)}loadSettings(){return a(this,null,function*(){this.settings=Object.assign({},fe,yield this.loadData())})}saveSettings(){return a(this,null,function*(){yield this.saveData(this.settings)})}}; +`;setTimeout(()=>a(this,null,function*(){if((yield i.app.vault.adapter.exists(n))===!0){let l=yield i.app.vault.adapter.read(n);r=r+l;let g=i.app.vault.getAbstractFileByPath(n);yield i.app.vault.modify(g,r)}else yield i.app.vault.create(n,r)}),10)}}}var Ve=require("obsidian");var S=class extends Ve.FuzzySuggestModal{constructor(e){super(e.app);this.scope.register(["Shift"],"Enter",n=>this.enterTrigger(n)),this.scope.register(["Ctrl"],"Enter",n=>this.enterTrigger(n))}setSuggesterData(e){this.data=e}display(e){return a(this,null,function*(){this.callbackFunction=e,this.open()})}getItems(){return this.data}getItemText(e){return e.display}onChooseItem(){}renderSuggestion(e,n){n.createEl("div",{text:e.item.display})}enterTrigger(e){let n=document.querySelector(".suggestion-item.is-selected div").textContent,s=this.data.find(o=>o.display===n);s&&(this.invokeCallback(s,e),this.close())}onChooseSuggestion(e,n){this.invokeCallback(e.item,n)}invokeCallback(e,n){this.callbackFunction(e,n)}};var W=class{constructor(t){this.bratCommands=[{id:"BRAT-AddBetaPlugin",icon:"BratIcon",name:"Plugins: Add a beta plugin for testing",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!1)})},{id:"BRAT-AddBetaPluginWithFrozenVersion",icon:"BratIcon",name:"Plugins: Add a beta plugin with frozen version based on a release tag",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.displayAddNewPluginModal(!1,!0)})},{id:"BRAT-checkForUpdatesAndUpdate",icon:"BratIcon",name:"Plugins: Check for updates to all beta plugins and UPDATE",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!1)})},{id:"BRAT-checkForUpdatesAndDontUpdate",icon:"BratIcon",name:"Plugins: Only check for updates to beta plugins, but don't Update",showInRibbon:!0,callback:()=>a(this,null,function*(){yield this.plugin.betaPlugins.checkForUpdatesAndInstallUpdates(!0,!0)})},{id:"BRAT-updateOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin version to update",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(s=>s.repo)),e=Object.values(this.plugin.settings.pluginList).filter(s=>!t.has(s)).map(s=>({display:s,info:s})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(s=>a(this,null,function*(){let o=`Checking for updates for ${s.info}`;this.plugin.log(o,!0),p(this.plugin,` +${o}`,3),yield this.plugin.betaPlugins.updatePlugin(s.info,!1,!0)}))})},{id:"BRAT-restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){p(this.plugin,`${n.info} +Plugin reloading .....`,5),yield this.plugin.betaPlugins.reloadPlugin(n.info)}))})},{id:"BRAT-disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.log(n.info),yield this.plugin.app.plugins.disablePluginAndSave(n.info)}))})},{id:"BRAT-enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),e=new S(this.plugin);e.setSuggesterData(t),yield e.display(n=>a(this,null,function*(){this.plugin.log(`${n.display} plugin enabled`,!1),yield this.plugin.app.plugins.enablePluginAndSave(n.info)}))})},{id:"BRAT-openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield fe(this.plugin.settings.debuggingMode),e=Object.values(t).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:"BRAT: "+o,info:o}));e.forEach(o=>n.push(o));let s=new S(this.plugin);s.setSuggesterData(n),yield s.display(o=>a(this,null,function*(){o.info&&window.open(`https://github.com/${o.info}`)}))})},{id:"BRAT-openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=yield he(this.plugin.settings.debuggingMode),e=Object.values(t).map(s=>({display:`Theme: ${s.name} (${s.repo})`,info:s.repo})),n=new S(this.plugin);n.setSuggesterData(e),yield n.display(s=>a(this,null,function*(){s.info&&window.open(`https://github.com/${s.info}`)}))})},{id:"BRAT-opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>a(this,null,function*(){let t=this.plugin.app.setting,e=Object.values(t.pluginTabs).map(o=>({display:"Plugin: "+o.name,info:o.id})),n=new S(this.plugin),s=Object.values(t.settingTabs).map(o=>({display:"Core: "+o.name,info:o.id}));e.forEach(o=>s.push(o)),n.setSuggesterData(s),yield n.display(o=>a(this,null,function*(){t.open(),t.openTabById(o.info)}))})},{id:"BRAT-GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>a(this,null,function*(){new E(this.plugin).open()})},{id:"BRAT-updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:()=>a(this,null,function*(){return yield I(this.plugin,!0)})},{id:"BRAT-allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>a(this,null,function*(){return this.ribbonDisplayCommands()})}];this.plugin=t,this.bratCommands.forEach(e=>a(this,null,function*(){this.plugin.addCommand({id:e.id,name:e.name,icon:e.icon,callback:()=>a(this,null,function*(){yield e.callback()})})}))}ribbonDisplayCommands(){return a(this,null,function*(){let t=[];this.bratCommands.forEach(r=>{r.showInRibbon&&t.push({display:r.name,info:r.callback})});let e=new S(this.plugin),n=this.plugin.app.setting,s=Object.values(n.settingTabs).map(r=>({display:"Core: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})})),o=Object.values(n.pluginTabs).map(r=>({display:"Plugin: "+r.name,info:()=>a(this,null,function*(){n.open(),n.openTabById(r.id)})}));t.push({display:"---- Core Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),s.forEach(r=>t.push(r)),t.push({display:"---- Plugin Settings ----",info:()=>a(this,null,function*(){yield this.ribbonDisplayCommands()})}),o.forEach(r=>t.push(r)),e.setSuggesterData(t),yield e.display(r=>a(this,null,function*(){return yield r.info()}))})}};var Q=class{constructor(t){this.console=(t,...e)=>{console.log("BRAT: "+t,e)};this.themes={themeseCheckAndUpates:t=>a(this,null,function*(){yield I(this.plugin,t)}),themeInstallTheme:t=>a(this,null,function*(){let e=t.replace("https://github.com/","");yield x(this.plugin,e,!0)}),themesDelete:t=>a(this,null,function*(){let e=t.replace("https://github.com/","");yield ee(this.plugin,e)}),grabCommmunityThemeCssFile:(t,e=!1)=>a(this,null,function*(){return yield L(t,e,this.plugin.settings.debuggingMode)}),grabChecksumOfThemeCssFile:(t,e=!1)=>a(this,null,function*(){return yield R(t,e,this.plugin.settings.debuggingMode)}),grabLastCommitDateForAFile:(t,e)=>a(this,null,function*(){return yield we(t,e)})};this.plugin=t}};var ie=class extends Ye.Plugin{constructor(){super(...arguments);this.appName="Obsidian42 - Beta Reviewer's Auto-update Tool (BRAT)";this.appID="obsidian42-brat"}onload(){return a(this,null,function*(){console.log("loading Obsidian42 - BRAT"),yield this.loadSettings(),this.addSettingTab(new ne(this.app,this)),this.betaPlugins=new U(this),this.commands=new W(this),Ae(),this.settings.ribbonIconEnabled&&this.showRibbonButton(),this.app.workspace.onLayoutReady(()=>{this.settings.updateAtStartup&&setTimeout(()=>a(this,null,function*(){yield this.betaPlugins.checkForUpdatesAndInstallUpdates(!1)}),6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>a(this,null,function*(){yield I(this,!1)}),12e4),setTimeout(()=>a(this,null,function*(){this.bratAPI=new Q(this),globalThis.bratAPI=this.bratAPI}),500)})})}showRibbonButton(){this.ribbonIcon=this.addRibbonIcon("BratIcon","BRAT",()=>a(this,null,function*(){return this.commands.ribbonDisplayCommands()}))}log(e,n=!1){He(this,e,n)}onunload(){console.log("unloading "+this.appName)}loadSettings(){return a(this,null,function*(){this.settings=Object.assign({},ye,yield this.loadData())})}saveSettings(){return a(this,null,function*(){yield this.saveData(this.settings)})}}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vbm9kZV9tb2R1bGVzL29ic2lkaWFuLWRhaWx5LW5vdGVzLWludGVyZmFjZS9kaXN0L21haW4uanMiLCAiLi4vc3JjL21haW4udHMiLCAiLi4vc3JjL3VpL1NldHRpbmdzVGFiLnRzIiwgIi4uL3NyYy9mZWF0dXJlcy90aGVtZXMudHMiLCAiLi4vc3JjL2ZlYXR1cmVzL2dpdGh1YlV0aWxzLnRzIiwgIi4uL3NyYy91aS9zZXR0aW5ncy50cyIsICIuLi9zcmMvdXRpbHMvbm90aWZpY2F0aW9ucy50cyIsICIuLi9zcmMvdXRpbHMvaW50ZXJuZXRjb25uZWN0aW9uLnRzIiwgIi4uL3NyYy91aS9BZGROZXdUaGVtZS50cyIsICIuLi9zcmMvdWkvUHJvbW90aW9uYWwudHMiLCAiLi4vc3JjL3VpL0FkZE5ld1BsdWdpbk1vZGFsLnRzIiwgIi4uL3NyYy9mZWF0dXJlcy9CZXRhUGx1Z2lucy50cyIsICIuLi9zcmMvdWkvaWNvbnMudHMiLCAiLi4vc3JjL3V0aWxzL2xvZ2dpbmcudHMiLCAiLi4vc3JjL3VpL0dlbmVyaWNGdXp6eVN1Z2dlc3Rlci50cyIsICIuLi9zcmMvdWkvUG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VtcGxhdGUpO1xuICAgIGNvbnN0IGZpbGVuYW1lID0gZGF0ZS5mb3JtYXQoZm9ybWF0KTtcbiAgICBjb25zdCBub3JtYWxpemVkUGF0aCA9IGF3YWl0IGdldE5vdGVQYXRoKGZvbGRlciwgZmlsZW5hbWUpO1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IGNyZWF0ZWRGaWxlID0gYXdhaXQgdmF1bHQuY3JlYXRlKG5vcm1hbGl6ZWRQYXRoLCB0ZW1wbGF0ZUNvbnRlbnRzXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqKGRhdGV8dGltZSlcXHMqKChbKy1dXFxkKykoW3lxbXdkaHNdKSk/XFxzKig6Lis/KT99fS9naSwgKF8sIF90aW1lT3JEYXRlLCBjYWxjLCB0aW1lRGVsdGEsIHVuaXQsIG1vbWVudEZvcm1hdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgbm93ID0gd2luZG93Lm1vbWVudCgpO1xuICAgICAgICAgICAgY29uc3QgY3VycmVudERhdGUgPSBkYXRlLmNsb25lKCkuc2V0KHtcbiAgICAgICAgICAgICAgICBob3VyOiBub3cuZ2V0KFwiaG91clwiKSxcbiAgICAgICAgICAgICAgICBtaW51dGU6IG5vdy5nZXQoXCJtaW51dGVcIiksXG4gICAgICAgICAgICAgICAgc2Vjb25kOiBub3cuZ2V0KFwic2Vjb25kXCIpLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoY2FsYykge1xuICAgICAgICAgICAgICAgIGN1cnJlbnREYXRlLmFkZChwYXJzZUludCh0aW1lRGVsdGEsIDEwKSwgdW5pdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobW9tZW50Rm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChtb21lbnRGb3JtYXQuc3Vic3RyaW5nKDEpLnRyaW0oKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZX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uICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKihkYXRlfHRpbWUpXFxzKigoWystXVxcZCspKFt5cW13ZGhzXSkpP1xccyooOi4rPyk/fX0vZ2ksIChfLCBfdGltZU9yRGF0ZSwgY2FsYywgdGltZURlbHRhLCB1bml0LCBtb21lbnRGb3JtYXQpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG5vdyA9IHdpbmRvdy5tb21lbnQoKTtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnREYXRlID0gZGF0ZS5jbG9uZSgpLnNldCh7XG4gICAgICAgICAgICAgICAgaG91cjogbm93LmdldChcImhvdXJcIiksXG4gICAgICAgICAgICAgICAgbWludXRlOiBub3cuZ2V0KFwibWludXRlXCIpLFxuICAgICAgICAgICAgICAgIHNlY29uZDogbm93LmdldChcInNlY29uZFwiKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKGNhbGMpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZS5hZGQocGFyc2VJbnQodGltZURlbHRhLCAxMCksIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1vbWVudEZvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQobW9tZW50Rm9ybWF0LnN1YnN0cmluZygxKS50cmltKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnREYXRlLmZvcm1hdChmb3JtYXQpO1xuICAgICAgICB9KVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKmRhdGVcXHMqfX0vZ2ksIGZpbGVuYW1lKVxuICAgICAgICAgICAgLnJlcGxhY2UoL3t7XFxzKnRpbWVcXHMqfX0vZ2ksIHdpbmRvdy5tb21lbnQoKS5mb3JtYXQoXCJISDptbVwiKSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccyp0aXRsZVxccyp9fS9naSwgZmlsZW5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z8pP319L2dpLCAoXywgX3RpbWVPckRhdGUsIGNhbGMsIHRpbWVEZWx0YSwgdW5pdCwgbW9tZW50Rm9ybWF0KSA9PiB7XG4gICAgICAgICAgICBjb25zdCBub3cgPSB3aW5kb3cubW9tZW50KCk7XG4gICAgICAgICAgICBjb25zdCBjdXJyZW50RGF0ZSA9IGRhdGUuY2xvbmUoKS5zZXQoe1xuICAgICAgICAgICAgICAgIGhvdXI6IG5vdy5nZXQoXCJob3VyXCIpLFxuICAgICAgICAgICAgICAgIG1pbnV0ZTogbm93LmdldChcIm1pbnV0ZVwiKSxcbiAgICAgICAgICAgICAgICBzZWNvbmQ6IG5vdy5nZXQoXCJzZWNvbmRcIiksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChjYWxjKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudERhdGUuYWRkKHBhcnNlSW50KHRpbWVEZWx0YSwgMTApLCB1bml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtb21lbnRGb3JtYXQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY3VycmVudERhdGUuZm9ybWF0KG1vbWVudEZvcm1hdC5zdWJzdHJpbmcoMSkudHJpbSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjdXJyZW50RGF0ZS5mb3JtYXQoZm9ybWF0KTtcbiAgICAgICAgfSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccypkYXRlXFxzKn19L2dpLCBmaWxlbmFtZSlcbiAgICAgICAgICAgIC5yZXBsYWNlKC97e1xccyp0aW1lXFxzKn19L2dpLCB3aW5kb3cubW9tZW50KCkuZm9ybWF0KFwiSEg6bW1cIikpXG4gICAgICAgICAgICAucmVwbGFjZSgve3tcXHMqdGl0bGVcXHMqfX0vZ2ksIGZpbGVuYW1lKSk7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQ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9yIGJldGEgdGVzdGluZ2AsIDEwKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYoYXdhaXQgdGhlbWVTYXZlKHRoaXMucGx1Z2luLCBzY3J1YmJlZEFkZHJlc3MsIHRydWUpKSB7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKCk7ICAgIFxuICAgICAgICB9XG4gICAgfVxuXG4gICAgb25PcGVuKCk6IHZvaWQge1xuICAgICAgICB0aGlzLmNvbnRlbnRFbC5jcmVhdGVFbCgnaDQnLCB7IHRleHQ6IFwiR2l0aHViIHJlcG9zaXRvcnkgZm9yIGJldGEgdGhlbWU6XCIgfSk7XG4gICAgICAgIHRoaXMuY29udGVudEVsLmNyZWF0ZUVsKCdmb3JtJywge30sIChmb3JtRWwpID0+IHtcbiAgICAgICAgICAgIGZvcm1FbC5hZGRDbGFzcyhcImJyYXQtbW9kYWxcIik7XG4gICAgICAgICAgICBuZXcgU2V0dGluZyhmb3JtRWwpXG4gICAgICAgICAgICAgICAgLmFkZFRleHQoKHRleHRFbCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1JlcG9zaXRvcnkgKGV4YW1wbGU6IGh0dHBzOi8vZ2l0aHViLmNvbS9HaXR1YlVzZXJOYW1lL3JlcG9zaXRvcnktbmFtZScpO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwub25DaGFuZ2UoKHZhbHVlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFkZHJlc3MgPSB2YWx1ZS50cmltKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJywgYXN5bmMgKGU6IEtleWJvYXJkRXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJyAmJiB0aGlzLmFkZHJlc3MgIT09ICcgJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5pbnB1dEVsLnN0eWxlLndpZHRoID0gXCIxMDAlXCI7XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRpdGxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcIi5zZXR0aW5nLWl0ZW0taW5mb1wiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aXRsZSkgdGl0bGUucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5mb2N1cygpXG4gICAgICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgZm9ybUVsLmNyZWF0ZURpdignbW9kYWwtYnV0dG9uLWNvbnRhaW5lcicsIChidXR0b25Db250YWluZXJFbCkgPT4ge1xuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsXG4gICAgICAgICAgICAgICAgICAgIC5jcmVhdGVFbCgnYnV0dG9uJywgeyBhdHRyOiB7IHR5cGU6ICdidXR0b24nIH0sIHRleHQ6ICdOZXZlciBtaW5kJyB9KVxuICAgICAgICAgICAgICAgICAgICAuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCAoKSA9PiB0aGlzLmNsb3NlKCkpO1xuICAgICAgICAgICAgICAgIGJ1dHRvbkNvbnRhaW5lckVsLmNyZWF0ZUVsKCdidXR0b24nLCB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1cbiAgICAgICAgY29uc3QgcmVzdWx0ID0gYXdhaXQgdGhpcy5iZXRhUGx1Z2lucy5hZGRQbHVnaW4oc2NydWJiZWRBZGRyZXNzLCBmYWxzZSwgZmFsc2UsIGZhbHNlLCB0aGlzLnZlcnNpb24pO1xuICAgICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBvbk9wZW4oKTogdm9pZCB7XG4gICAgICAgIHRoaXMuY29udGVudEVsLmNyZWF0ZUVsKCdoNCcsIHsgdGV4dDogXCJHaXRodWIgcmVwb3NpdG9yeSBmb3IgYmV0YSBwbHVnaW46XCIgfSk7XG4gICAgICAgIHRoaXMuY29udGVudEVsLmNyZWF0ZUVsKCdmb3JtJywge30sIChmb3JtRWwpID0+IHtcbiAgICAgICAgICAgIGZvcm1FbC5hZGRDbGFzcyhcImJyYXQtbW9kYWxcIilcbiAgICAgICAgICAgIG5ldyBTZXR0aW5nKGZvcm1FbClcbiAgICAgICAgICAgICAgICAuYWRkVGV4dCgodGV4dEVsKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRleHRFbC5zZXRQbGFjZWhvbGRlcignUmVwb3NpdG9yeSAoZXhhbXBsZTogaHR0cHM6Ly9naXRodWIuY29tL0dpdHViVXNlck5hbWUvcmVwb3NpdG9yeS1uYW1lKScpO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwub25DaGFuZ2UoKHZhbHVlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFkZHJlc3MgPSB2YWx1ZS50cmltKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJywgYXN5bmMgKGU6IEtleWJvYXJkRXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmtleSA9PT0gJ0VudGVyJyAmJiB0aGlzLmFkZHJlc3MgIT09ICcgJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMudXNlRnJvemVuVmVyc2lvbiAmJiB0aGlzLnZlcnNpb24gIT09IFwiXCIpIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIXRoaXMudXNlRnJvemVuVmVyc2lvbilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLnN1Ym1pdEZvcm0oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuaW5wdXRFbC5zdHlsZS53aWR0aCA9IFwiMTAwJVwiO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAodGhpcy51c2VGcm96ZW5WZXJzaW9uKSB7XG4gICAgICAgICAgICAgICAgbmV3IFNldHRpbmcoZm9ybUVsKVxuICAgICAgICAgICAgICAgICAgICAuYWRkVGV4dCgodGV4dEVsKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RWwuc2V0UGxhY2Vob2xkZXIoJ1NwZWNpZnkgdGhlIHJlbGVhc2UgdmVyc2lvbiB0YWcgKGV4YW1wbGU6IDEuMC4wKScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVsLm9uQ2hhbmdlKCh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudmVyc2lvbiA9IHZhbHVlLnRyaW0oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVsLmlucHV0RWwuc3R5bGUud2lkdGggPSBcIjEwMCVcIjtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvcm1FbC5jcmVhdGVEaXYoJ21vZGFsLWJ1dHRvbi1jb250YWluZXInLCAoYnV0dG9uQ29udGFpbmVyRWwpID0+IHtcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbFxuICAgICAgICAgICAgICAgICAgICAuY3JlYXRlRWwoJ2J1dHRvbicsIHsgYXR0cjogeyB0eXBlOiAnYnV0dG9uJyB9LCB0ZXh0OiAnTmV2ZXIgbWluZCcgfSlcbiAgICAgICAgICAgICAgICAgICAgLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgKCkgPT4gdGhpcy5jbG9zZSgpKTtcbiAgICAgICAgICAgICAgICBidXR0b25Db250YWluZXJFbC5jcmVhdGVFbCgnYnV0dG9uJywge1xuICAgICAgICAgICAgICAgICAgICBhdHRyOiB7IHR5cGU6ICdzdWJtaXQnIH0sXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ21vZC1jdGEnLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0OiAnQWRkIFBsdWdpbicsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY29uc3QgbmV3RGl2ID0gZm9ybUVsLmNyZWF0ZURpdigpO1xuICAgICAgICAgICAgbmV3RGl2LnN0eWxlLmJvcmRlclRvcCA9IFwiMXB4IHNvbGlkICNjY2NcIjtcbiAgICAgICAgICAgIG5ld0Rpdi5zdHlsZS5tYXJnaW5Ub3AgPSBcIjMwcHhcIjtcbiAgICAgICAgICAgIGNvbnN0IGJ5VGZUaGFja2VyID0gbmV3RGl2LmNyZWF0ZVNwYW4oKTtcbiAgICAgICAgICAgIGJ5VGZUaGFja2VyLmlubmVySFRNTCA9IFwiQlJBVCBieSA8YSBocmVmPSdodHRwczovL2JpdC5seS9vNDItdHdpdHRlcic+VEZUSGFja2VyPC9hPlwiO1xuICAgICAgICAgICAgYnlUZlRoYWNrZXIuc3R5bGUuZm9udFN0eWxlID0gXCJpdGFsaWNcIjtcbiAgICAgICAgICAgIG5ld0Rpdi5hcHBlbmRDaGlsZChieVRmVGhhY2tlcik7XG4gICAgICAgICAgICBwcm9tb3Rpb25hbExpbmtzKG5ld0RpdiwgZmFsc2UpO1xuXG4gICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgdGl0bGUgPSBmb3JtRWwucXVlcnlTZWxlY3RvckFsbChcIi5icmF0LW1vZGFsIC5zZXR0aW5nLWl0ZW0taW5mb1wiKTtcbiAgICAgICAgICAgICAgICB0aXRsZS5mb3JFYWNoKCh0aXRsZUVsKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlRWwucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH0sIDUwKVxuXG5cbiAgICAgICAgICAgIC8vIGludm9rZWQgd2hlbiBidXR0b24gaXMgY2xpY2tlZC4gXG4gICAgICAgICAgICBmb3JtRWwuYWRkRXZlbnRMaXN0ZW5lcignc3VibWl0JywgYXN5bmMgKGU6IEV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmFkZHJlc3MgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgICAgICh0aGlzLnVzZUZyb3plblZlcnNpb24gJiYgdGhpcy52ZXJzaW9uICE9PSBcIlwiKSBcbiAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghdGhpcy51c2VGcm96ZW5WZXJzaW9uKVxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAg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kYXRlcyh0cnVlLCB0cnVlKSB9XG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtdXBkYXRlT25lUGx1Z2luXCIsXG4gICAgICAgICAgICBpY29uOiBcIkJyYXRJY29uXCIsXG4gICAgICAgICAgICBuYW1lOiBcIlBsdWdpbnM6IENob29zZSBhIHNpbmdsZSBwbHVnaW4gdmVyc2lvbiB0byB1cGRhdGVcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcGx1Z2luU3ViTGlzdEZyb3plblZlcnNpb25OYW1lcyA9IFxuICAgICAgICAgICAgICAgICAgICBuZXcgU2V0KHRoaXMucGx1Z2luLnNldHRpbmdzLnBsdWdpblN1Ykxpc3RGcm96ZW5WZXJzaW9uLm1hcChmID0+IGYucmVwbykpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHBsdWdpbkxpc3Q6IFN1Z2dlc3Rlckl0ZW1bXSA9IFxuICAgICAgICAgICAgICAgICAgICBPYmplY3RcbiAgICAgICAgICAgICAgICAgICAgICAgIC52YWx1ZXModGhpcy5wbHVnaW4uc2V0dGluZ3MucGx1Z2luTGlzdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKGYpID0+ICFwbHVnaW5TdWJMaXN0RnJvemVuVmVyc2lvbk5hbWVzLmhhcyhmKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKG0pID0+IHsgcmV0dXJuIHsgZGlzcGxheTogbSwgaW5mbzogbSB9IH0pO1xuICAgICAgICAgICAgICAgIGNvbnN0IGdmcyA9IG5ldyBHZW5lcmljRnV6enlTdWdnZXN0ZXIodGhpcy5wbHVnaW4pO1xuICAgICAgICAgICAgICAgIGdmcy5zZXRTdWdnZXN0ZXJEYXRhKHBsdWdpbkxpc3QpO1xuICAgICAgICA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lcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5VGhlbWUgPSBhd2FpdCBncmFiQ29tbW11bml0eVRoZW1lc0xpc3QodGhpcy5wbHVnaW4uc2V0dGluZ3MuZGVidWdnaW5nTW9kZSk7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbXVuaXR5VGhlbWVMaXN0OiBTdWdnZXN0ZXJJdGVtW10gPSBPYmplY3QudmFsdWVzKGNvbW11bml0eVRoZW1lKS5tYXAoKHApID0+IHsgcmV0dXJuIHsgZGlzcGxheTogYFRoZW1lOiAke3AubmFtZX0gICgke3AucmVwb30pYCwgaW5mbzogcC5yZXBvIH0gfSk7XG4gICAgICAgICAgICAgICAgY29uc3QgZ2ZzID0gbmV3IEdlbmVyaWNGdXp6eVN1Z2dlc3Rlcih0aGlzLnBsdWdpbik7XG4gICAgICAgICAgICAgICAgZ2ZzLnNldFN1Z2dlc3RlckRhdGEoY29tbXVuaXR5VGhlbWVMaXN0KTtcbiAgICAgICAgICAgICAgICBhd2FpdCBnZnMuZGlzcGxheShhc3luYyAocmVzdWx0cykgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0cy5pbmZvKSB3aW5kb3cub3BlbihgaHR0cHM6Ly9naXRodWIuY29tLyR7cmVzdWx0cy5pbmZvfWApXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtb3BlbnRQbHVnaW5TZXR0aW5nc1wiLFxuICAgICAgICAgICAgaWNvbjogXCJCcmF0SWNvblwiLFxuICAgICAgICAgICAgbmFtZTogXCJQbHVnaW5zOiBPcGVuIFBsdWdpbiBTZXR0aW5ncyBUYWJcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJ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gICAgICAgICAgICAgICAgc2V0dGluZ3Mub3BlbigpO1xuICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5vcGVuVGFiQnlJZChyZXN1bHRzLmluZm8pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgICBpZDogXCJCUkFULUdyYWJCZXRhVGhlbWVcIixcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcbiAgICAgICAgICAgIG5hbWU6IFwiVGhlbWVzOiBHcmFiIGEgYmV0YSB0aGVtZSBmb3IgdGVzdGluZyBmcm9tIGEgR2l0aHViIHJlcG9zaXRvcnlcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiB7IChuZXcgQWRkTmV3VGhlbWUodGhpcy5wbHVnaW4pKS5vcGVuKCkgfVxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgICBpZDogXCJCUkFULXVwZGF0ZUJldGFUaGVtZXNcIixcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcbiAgICAgICAgICAgIG5hbWU6IFwiVGhlbWVzOiBVcGRhdGUgYmV0YSB0aGVtZXNcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogdHJ1ZSxcbiAgICAgICAgICAgIGNhbGxiYWNrOiBhc3luYyAoKSA9PiBhd2FpdCB0aGVtZXNDaGVja0FuZFVwZGF0ZXModGhpcy5wbHVnaW4sIHRydWUpIFxuICAgICAgICB9LCAgICAgICAgXG4gICAgICAgIHtcbiAgICAgICAgICAgIGlkOiBcIkJSQVQtYWxsQ29tbWFuZHNcIixcbiAgICAgICAgICAgIGljb246IFwiQnJhdEljb25cIixcbiAgICAgICAgICAgIG5hbWU6IFwiQWxsIENvbW1hbmRzIGxpc3RcIixcbiAgICAgICAgICAgIHNob3dJblJpYmJvbjogZmFsc2UsX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ian/plugins/obsidian42-brat/manifest.json index cb329e74..129261c9 100644 --- a/.obsidian/plugins/obsidian42-brat/manifest.json +++ b/.obsidian/plugins/obsidian42-brat/manifest.json @@ -1,10 +1,14 @@ { "id": "obsidian42-brat", "name": "Obsidian42 - BRAT", - "version": "0.6.36", - "minAppVersion": "1.0.0", + "version": "0.7.0", + "minAppVersion": "1.1.16", "description": "Easily install a beta version of a plugin for testing.", "author": "TfTHacker", "authorUrl": "https://github.com/TfTHacker/obsidian42-brat", - "isDesktopOnly": false + "isDesktopOnly": false, + "fundingUrl": { + "Buy Me a Coffee": "https://bit.ly/o42-kofi", + "Medium membership": "https://bit.ly/o42-medium" + } } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian42-brat/styles.css b/.obsidian/plugins/obsidian42-brat/styles.css index 0519ecba..92e64664 100644 --- a/.obsidian/plugins/obsidian42-brat/styles.css +++ b/.obsidian/plugins/obsidian42-brat/styles.css @@ -1 +1,3 @@ - \ No newline at end of file +.brat-modal .modal-button-container { + margin-top: 5px !important; +} \ No newline at end of file diff --git a/.obsidian/plugins/quickadd/data.json b/.obsidian/plugins/quickadd/data.json index 28692e43..5755a1d7 100644 --- a/.obsidian/plugins/quickadd/data.json +++ b/.obsidian/plugins/quickadd/data.json @@ -48,7 +48,7 @@ "devMode": false, "templateFolderPath": "00.01 Admin/Templates", "announceUpdates": true, - "version": "0.17.1", + "version": "0.19.4", "migrations": { "migrateToMacroIDFromEmbeddedMacro": true, "useQuickAddTemplateFolder": true, diff --git a/.obsidian/plugins/quickadd/main.js b/.obsidian/plugins/quickadd/main.js index 4420c093..fa3b7741 100644 --- a/.obsidian/plugins/quickadd/main.js +++ b/.obsidian/plugins/quickadd/main.js @@ -4446,7 +4446,7 @@ function create_each_block2(key_1, ctx) { const if_block_creators = [create_if_block4, create_else_block]; const if_blocks = []; function select_block_type(ctx2, dirty) { - if (ctx2[23].type !== "Multi" /* Multi */) + if (ctx2[23].type !== "Multi") return 0; return 1; } @@ -4713,20 +4713,12 @@ function create_fragment10(ctx) { let t0; let select; let option0; - let t1_value = "Template" /* Template */ + ""; - let t1; let option0_value_value; let option1; - let t2_value = "Capture" /* Capture */ + ""; - let t2; let option1_value_value; let option2; - let t3_value = "Macro" /* Macro */ + ""; - let t3; let option2_value_value; let option3; - let t4_value = "Multi" /* Multi */ + ""; - let t4; let option3_value_value; let t5; let button; @@ -4739,25 +4731,25 @@ function create_fragment10(ctx) { t0 = space(); select = element("select"); option0 = element("option"); - t1 = text(t1_value); + option0.textContent = `${"Template"}`; option1 = element("option"); - t2 = text(t2_value); + option1.textContent = `${"Capture"}`; option2 = element("option"); - t3 = text(t3_value); + option2.textContent = `${"Macro"}`; option3 = element("option"); - t4 = text(t4_value); + option3.textContent = `${"Multi"}`; t5 = space(); button = element("button"); button.textContent = "Add Choice"; attr(input, "type", "text"); attr(input, "placeholder", "Name"); - option0.__value = option0_value_value = "Template" /* Template */; + option0.__value = option0_value_value = "Template"; option0.value = option0.__value; - option1.__value = option1_value_value = "Capture" /* Capture */; + option1.__value = option1_value_value = "Capture"; option1.value = option1.__value; - option2.__value = option2_value_value = "Macro" /* Macro */; + option2.__value = option2_value_value = "Macro"; option2.value = option2.__value; - option3.__value = option3_value_value = "Multi" /* Multi */; + option3.__value = option3_value_value = "Multi"; option3.value = option3.__value; attr(select, "id", "addChoiceTypeSelector"); attr(select, "class", "svelte-1newuee"); @@ -4773,13 +4765,9 @@ function create_fragment10(ctx) { append(div, t0); append(div, select); append(select, option0); - append(option0, t1); append(select, option1); - append(option1, t2); append(select, option2); - append(option2, t3); append(select, option3); - append(option3, t4); select_option(select, ctx[1]); append(div, t5); append(div, button); @@ -4901,7 +4889,7 @@ var Choice = class { // src/types/choices/TemplateChoice.ts var TemplateChoice = class extends Choice { constructor(name) { - super(name, "Template" /* Template */); + super(name, "Template"); this.templatePath = ""; this.fileNameFormat = { enabled: false, format: "" }; this.folder = { @@ -4930,7 +4918,7 @@ var TemplateChoice = class extends Choice { // src/types/choices/MacroChoice.ts var MacroChoice = class extends Choice { constructor(name) { - super(name, "Macro" /* Macro */); + super(name, "Macro"); this.macroId = ""; } }; @@ -4938,7 +4926,7 @@ var MacroChoice = class extends Choice { // src/types/choices/CaptureChoice.ts var CaptureChoice = class extends Choice { constructor(name) { - super(name, "Capture" /* Capture */); + super(name, "Capture"); this.appendLink = false; this.captureTo = ""; this.captureToActiveFile = false; @@ -4974,7 +4962,7 @@ var CaptureChoice = class extends Choice { // src/types/choices/MultiChoice.ts var MultiChoice = class extends Choice { constructor(name) { - super(name, "Multi" /* Multi */); + super(name, "Multi"); this.choices = []; } addChoice(choice) { @@ -8833,10 +8821,7 @@ async function templaterParseTemplate(app2, templateContent, targetFile) { const templater = getTemplater(app2); if (!templater) return templateContent; - return await templater.templater.parse_template( - { target_file: targetFile, run_mode: 4 }, - templateContent - ); + return await templater.templater.parse_template({ target_file: targetFile, run_mode: 4 }, templateContent); } function getNaturalLanguageDates(app2) { return app2.plugins.plugins["nldates-obsidian"]; @@ -8939,12 +8924,54 @@ function excludeKeys(sourceObj, except) { return obj; } function getChoiceType(choice) { - const isTemplate = (choice2) => choice2.type === "Template" /* Template */; - const isMacro = (choice2) => choice2.type === "Macro" /* Macro */; - const isCapture = (choice2) => choice2.type === "Capture" /* Capture */; - const isMulti = (choice2) => choice2.type === "Multi" /* Multi */; + const isTemplate = (choice2) => choice2.type === "Template"; + const isMacro = (choice2) => choice2.type === "Macro"; + const isCapture = (choice2) => choice2.type === "Capture"; + const isMulti = (choice2) => choice2.type === "Multi"; return isTemplate(choice) || isMacro(choice) || isCapture(choice) || isMulti(choice); } +function isFolder(path) { + const abstractItem = app.vault.getAbstractFileByPath(path); + return !!abstractItem && abstractItem instanceof import_obsidian8.TFolder; +} +function getMarkdownFilesInFolder(folderPath) { + return app.vault.getMarkdownFiles().filter((f) => f.path.startsWith(folderPath)); +} +function getMarkdownFilesWithTag(tag) { + const hasTags = (fileCache) => fileCache.tags !== void 0 && Array.isArray(fileCache.tags); + const hasFrontmatterTags = (fileCache) => { + return fileCache.frontmatter !== void 0 && fileCache.frontmatter.tags !== void 0 && typeof fileCache.frontmatter.tags === "string" && fileCache.frontmatter.tags.length > 0; + }; + const hasFrontmatterTag = (fileCache) => { + return fileCache.frontmatter !== void 0 && fileCache.frontmatter.tag !== void 0 && typeof fileCache.frontmatter.tag === "string" && fileCache.frontmatter.tag.length > 0; + }; + return app.vault.getMarkdownFiles().filter((f) => { + const fileCache = app.metadataCache.getFileCache(f); + if (!fileCache) + return false; + if (hasTags(fileCache)) { + const tagInTags = fileCache.tags.find((item) => item.tag === tag); + if (tagInTags) { + return true; + } + } + if (hasFrontmatterTags(fileCache)) { + const tagWithoutHash = tag.replace(/^\#/, ""); + const tagInFrontmatterTags = fileCache.frontmatter.tags.split(" ").find((item) => item === tagWithoutHash); + if (tagInFrontmatterTags) { + return true; + } + } + if (hasFrontmatterTag(fileCache)) { + const tagWithoutHash = tag.replace(/^\#/, ""); + const tagInFrontmatterTag = fileCache.frontmatter.tag.split(" ").find((item) => item === tagWithoutHash); + if (tagInFrontmatterTag) { + return true; + } + } + return false; + }); +} // src/formatters/formatter.ts var Formatter = class { @@ -11874,12 +11901,13 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { } this.addTaskSetting(); this.addPrependSetting(); + this.addAppendLinkSetting(); + this.addInsertAfterSetting(); if (!this.choice.captureToActiveFile) { - this.addAppendLinkSetting(); - this.addInsertAfterSetting(); this.addOpenFileSetting(); - if (this.choice.openFile) + if (this.choice.openFile) { this.addOpenFileInNewTabSetting(); + } } this.addFormatSetting(); } @@ -12007,22 +12035,22 @@ var CaptureChoiceBuilder = class extends ChoiceBuilder { considerSubsectionsSetting.setName("Consider subsections").setDesc( "Enabling this will insert the text at the end of the section & its subsections, rather than just at the end of the target section.A section is defined by a heading, and its subsections are all the headings inside that section." ).addToggle( - (toggle) => toggle.setValue(this.choice.insertAfter?.considerSubsections).onChange( - (value) => { - if (!value) { - this.choice.insertAfter.considerSubsections = false; - return; - } - const targetIsHeading = this.choice.insertAfter.after.startsWith("#"); - if (targetIsHeading) { - this.choice.insertAfter.considerSubsections = value; - } else { - this.choice.insertAfter.considerSubsections = false; - log.logError("'Consider subsections' can only be enabled if the insert after line starts with a # (heading)."); - this.display(); - } + (toggle) => toggle.setValue(this.choice.insertAfter?.considerSubsections).onChange((value) => { + if (!value) { + this.choice.insertAfter.considerSubsections = false; + return; } - ) + const targetIsHeading = this.choice.insertAfter.after.startsWith("#"); + if (targetIsHeading) { + this.choice.insertAfter.considerSubsections = value; + } else { + this.choice.insertAfter.considerSubsections = false; + log.logError( + "'Consider subsections' can only be enabled if the insert after line starts with a # (heading)." + ); + this.display(); + } + }) ); const createLineIfNotFound = new import_obsidian22.Setting(this.contentEl); createLineIfNotFound.setName("Create line if not found").setDesc("Creates the 'insert after' line if it is not found.").addToggle((toggle) => { @@ -13433,12 +13461,12 @@ function instance16($$self, $$props, $$invalidate) { } function getChoiceBuilder(choice) { switch (choice.type) { - case "Template" /* Template */: + case "Template": return new TemplateChoiceBuilder(app2, choice, plugin); - case "Capture" /* Capture */: + case "Capture": return new CaptureChoiceBuilder(app2, choice, plugin); - case "Macro" /* Macro */: - case "Multi" /* Multi */: + case "Macro": + case "Multi": default: break; } @@ -13603,6 +13631,20 @@ var NestedChoiceCommand2 = class extends Command { }; // src/gui/MacroGUIs/MacroBuilder.ts +function getChoicesAsList(nestedChoices) { + const arr = []; + const recursive = (choices) => { + choices.forEach((choice) => { + if (choice.type === "Multi") { + recursive(choice.choices); + } else { + arr.push(choice); + } + }); + }; + recursive(nestedChoices); + return arr; +} var MacroBuilder = class extends import_obsidian25.Modal { constructor(app2, plugin, macro, choices) { super(app2); @@ -13611,7 +13653,7 @@ var MacroBuilder = class extends import_obsidian25.Modal { this.choices = []; this.macro = macro; this.svelteElements = []; - this.choices = choices; + this.choices = getChoicesAsList(choices); this.plugin = plugin; this.waitForClose = new Promise( (resolve) => this.resolvePromise = resolve @@ -14150,28 +14192,11 @@ var MacrosManager = class extends import_obsidian28.Modal { configureButton.setClass("mod-cta"); configureButton.buttonEl.style.marginRight = "0"; configureButton.setButtonText("Configure").onClick(async (evt) => { - const getReachableChoices = (choices) => { - const reachableChoices2 = []; - choices.forEach((choice) => { - if (choice.type === "Multi" /* Multi */) - reachableChoices2.push( - ...getReachableChoices( - choice.choices - ) - ); - if (choice.type !== "Multi" /* Multi */) - reachableChoices2.push(choice); - }); - return reachableChoices2; - }; - const reachableChoices = getReachableChoices( - this.choices - ); const newMacro = await new MacroBuilder( this.app, this.plugin, macro, - reachableChoices + this.choices ).waitForClose; if (newMacro) { this.updateMacro(newMacro); @@ -14322,6 +14347,27 @@ function create_fragment17(ctx) { } }; } +function deleteChoiceHelper(id, value) { + if (value.type === "Multi") { + value.choices = value.choices.filter((v) => deleteChoiceHelper(id, v)); + } + return value.id !== id; +} +function updateChoiceHelper(oldChoice, newChoice) { + if (oldChoice.id === newChoice.id) { + oldChoice = { ...oldChoice, ...newChoice }; + return oldChoice; + } + if (oldChoice.type === "Multi") { + const multiChoice = oldChoice; + const multiChoiceChoices = multiChoice.choices.map((c) => updateChoiceHelper(c, newChoice)); + return { + ...multiChoice, + choices: multiChoiceChoices + }; + } + return oldChoice; +} function instance17($$self, $$props, $$invalidate) { let { choices = [] } = $$props; let { macros = [] } = $$props; @@ -14341,19 +14387,19 @@ function instance17($$self, $$props, $$invalidate) { function addChoiceToList(event) { const { name, type } = event.detail; switch (type) { - case "Template" /* Template */: + case "Template": const templateChoice = new TemplateChoice(name); $$invalidate(0, choices = [...choices, templateChoice]); break; - case "Capture" /* Capture */: + case "Capture": const captureChoice = new CaptureChoice(name); $$invalidate(0, choices = [...choices, captureChoice]); break; - case "Macro" /* Macro */: + case "Macro": const macroChoice = new MacroChoice(name); $$invalidate(0, choices = [...choices, macroChoice]); break; - case "Multi" /* Multi */: + case "Multi": const multiChoice = new MultiChoice(name); $$invalidate(0, choices = [...choices, multiChoice]); break; @@ -14362,8 +14408,8 @@ function instance17($$self, $$props, $$invalidate) { } async function deleteChoice(e) { const choice = e.detail.choice; - const hasOwnMacro = choice.type === "Macro" /* Macro */ && macros.some((macro) => macro.name === choice.name); - const isMulti = choice.type === "Multi" /* Multi */; + const hasOwnMacro = choice.type === "Macro" && macros.some((macro) => macro.name === choice.name); + const isMulti = choice.type === "Multi"; const userConfirmed = await GenericYesNoPrompt.Prompt(app2, `Confirm deletion of choice`, `Please confirm that you wish to delete '${choice.name}'. ${isMulti ? "Deleting this choice will delete all (" + choice.choices.length + ") choices inside it!" : ""} ${hasOwnMacro ? "Deleting this choice will delete the macro associated with it!" : ""} @@ -14378,16 +14424,10 @@ function instance17($$self, $$props, $$invalidate) { plugin.removeCommandForChoice(choice); saveChoices(choices); } - function deleteChoiceHelper(id, value) { - if (value.type === "Multi" /* Multi */) { - value.choices = value.choices.filter((v) => deleteChoiceHelper(id, v)); - } - return value.id !== id; - } async function configureChoice(e) { const { choice: oldChoice } = e.detail; let updatedChoice; - if (oldChoice.type === "Multi" /* Multi */) { + if (oldChoice.type === "Multi") { updatedChoice = oldChoice; const name = await GenericInputPrompt.Prompt(app2, `Rename ${oldChoice.name}`, "", oldChoice.name); if (!name) @@ -14428,50 +14468,35 @@ function instance17($$self, $$props, $$invalidate) { throw new Error("Invalid choice type"); let newChoice; switch (choice.type) { - case "Template" /* Template */: + case "Template": newChoice = new TemplateChoice(`${choice.name} (copy)`); break; - case "Capture" /* Capture */: + case "Capture": newChoice = new CaptureChoice(`${choice.name} (copy)`); break; - case "Macro" /* Macro */: + case "Macro": newChoice = new MacroChoice(`${choice.name} (copy)`); break; - case "Multi" /* Multi */: + case "Multi": newChoice = new MultiChoice(`${choice.name} (copy)`); break; } - if (choice.type !== "Multi" /* Multi */) { + if (choice.type !== "Multi") { Object.assign(newChoice, excludeKeys(choice, ["id", "name"])); } else { newChoice.choices = choice.choices.map((c) => duplicateChoice(c)); } return newChoice; } - function updateChoiceHelper(oldChoice, newChoice) { - if (oldChoice.id === newChoice.id) { - oldChoice = { ...oldChoice, ...newChoice }; - return oldChoice; - } - if (oldChoice.type === "Multi" /* Multi */) { - const multiChoice = oldChoice; - const multiChoiceChoices = multiChoice.choices.map((c) => updateChoiceHelper(c, newChoice)); - return { - ...multiChoice, - choices: multiChoiceChoices - }; - } - return oldChoice; - } function getChoiceBuilder(choice) { switch (choice.type) { - case "Template" /* Template */: + case "Template": return new TemplateChoiceBuilder(app2, choice, plugin); - case "Capture" /* Capture */: + case "Capture": return new CaptureChoiceBuilder(app2, choice, plugin); - case "Macro" /* Macro */: + case "Macro": return new MacroChoiceBuilder(app2, choice, macros, settingsStore.getState().choices); - case "Multi" /* Multi */: + case "Multi": default: break; } @@ -14934,7 +14959,11 @@ function getEndOfSection(lines, targetLine, shouldConsiderSubsections = false) { (str) => str.trim() !== "" ); if (lastNonEmptyLineInSectionIdx !== null) { - if (lastNonEmptyLineInSectionIdx + 1 === lastLineInBodyIdx) { + if (lastNonEmptyLineInSectionIdx < targetLine) { + return targetLine; + } + const lineIsEmpty = lines[lastNonEmptyLineInSectionIdx + 1].trim() === ""; + if (lastNonEmptyLineInSectionIdx + 1 === lastLineInBodyIdx && !lineIsEmpty) { return endOfSectionLineIdx; } if (lastNonEmptyLineInSectionIdx === 0) { @@ -15798,15 +15827,9 @@ var CaptureChoiceEngine = class extends QuickAddChoiceEngine { } async run() { try { - if (this.choice?.captureToActiveFile) { - await this.captureToActiveFile(); - return; - } - const captureTo = this.choice.captureTo; - invariant(captureTo, () => { - return `Invalid capture to for ${this.choice.name}. ${captureTo.length === 0 ? "Capture path is empty." : `Capture path is not valid: ${captureTo}`}`; - }); - const filePath = await this.formatFilePath(captureTo); + const filePath = await this.getFormattedPathToCaptureTo( + this.choice.captureToActiveFile + ); const content = this.getCaptureContent(); let getFileAndAddContentFn; if (await this.fileExists(filePath)) { @@ -15823,8 +15846,17 @@ var CaptureChoiceEngine = class extends QuickAddChoiceEngine { ); return; } - const { file, content: newFileContent } = await getFileAndAddContentFn(filePath, content); - await this.app.vault.modify(file, newFileContent); + const { file, newFileContent, captureContent } = await getFileAndAddContentFn(filePath, content); + if (this.choice.captureToActiveFile && !this.choice.prepend && !this.choice.insertAfter.enabled) { + const content2 = await templaterParseTemplate( + app, + captureContent, + file + ); + appendToCurrentLine(content2, this.app); + } else { + await this.app.vault.modify(file, newFileContent); + } if (this.choice.appendLink) { const markdownLink = this.app.fileManager.generateMarkdownLink( file, @@ -15855,6 +15887,69 @@ var CaptureChoiceEngine = class extends QuickAddChoiceEngine { `; return content; } + async getFormattedPathToCaptureTo(shouldCaptureToActiveFile) { + if (shouldCaptureToActiveFile) { + const activeFile = this.app.workspace.getActiveFile(); + invariant( + activeFile, + `Cannot capture to active file - no active file.` + ); + return activeFile.path; + } + const captureTo = this.choice.captureTo; + const formattedCaptureTo = await this.formatFilePath(captureTo); + const folderPath = formattedCaptureTo.replace( + /^\/$|\/\.md$|^\.md$/, + "" + ); + const captureAnywhereInVault = folderPath === ""; + const shouldCaptureToFolder = captureAnywhereInVault || isFolder(folderPath); + const shouldCaptureWithTag = formattedCaptureTo.startsWith("#"); + if (shouldCaptureToFolder) { + return this.selectFileInFolder(folderPath, captureAnywhereInVault); + } + if (shouldCaptureWithTag) { + const tag = formattedCaptureTo.replace(/\.md$/, ""); + return this.selectFileWithTag(tag); + } + return formattedCaptureTo; + } + async selectFileInFolder(folderPath, captureAnywhereInVault) { + const folderPathSlash = folderPath.endsWith("/") || captureAnywhereInVault ? folderPath : `${folderPath}/`; + const filesInFolder = getMarkdownFilesInFolder(folderPathSlash); + invariant( + filesInFolder.length > 0, + `Folder ${folderPathSlash} is empty.` + ); + const filePaths = filesInFolder.map((f) => f.path); + const targetFilePath = await InputSuggester.Suggest( + app, + filePaths.map((item) => item.replace(folderPathSlash, "")), + filePaths + ); + invariant( + !!targetFilePath && targetFilePath.length > 0, + `No file selected for capture.` + ); + const filePath = targetFilePath.startsWith(`${folderPathSlash}/`) ? targetFilePath : `${folderPathSlash}/${targetFilePath}`; + return await this.formatFilePath(filePath); + } + async selectFileWithTag(tag) { + const tagWithHash = tag.startsWith("#") ? tag : `#${tag}`; + const filesWithTag = getMarkdownFilesWithTag(tagWithHash); + invariant(filesWithTag.length > 0, `No files with tag ${tag}.`); + const filePaths = filesWithTag.map((f) => f.path); + const targetFilePath = await GenericSuggester.Suggest( + app, + filePaths, + filePaths + ); + invariant( + !!targetFilePath && targetFilePath.length > 0, + `No file selected for capture.` + ); + return await this.formatFilePath(targetFilePath); + } async onFileExists(filePath, content) { const file = this.getFileByPath(filePath); if (!file) @@ -15883,9 +15978,9 @@ This is in order to prevent data loss.` ); newFileContent = res.joinedResults(); } - return { file, content: newFileContent }; + return { file, newFileContent, captureContent: formatted }; } - async onCreateFileIfItDoesntExist(filePath, content) { + async onCreateFileIfItDoesntExist(filePath, captureContent) { let fileContent = ""; if (this.choice.createFileIfItDoesntExist.createWithTemplate) { const singleTemplateEngine = new SingleTemplateEngine( @@ -15905,12 +16000,12 @@ This is in order to prevent data loss.` file ); const newFileContent = await this.formatter.formatContentWithFile( - content, + captureContent, this.choice, updatedFileContent, file ); - return { file, content: newFileContent }; + return { file, newFileContent, captureContent }; } async formatFilePath(captureTo) { const formattedCaptureTo = await this.formatter.formatFileName( @@ -15919,33 +16014,6 @@ This is in order to prevent data loss.` ); return this.normalizeMarkdownFilePath("", formattedCaptureTo); } - async captureToActiveFile() { - const activeFile = this.app.workspace.getActiveFile(); - if (!activeFile) { - log.logError("Cannot capture to active file - no active file."); - return; - } - let content = this.getCaptureContent(); - content = await this.formatter.formatContent(content, this.choice); - if (this.choice.format.enabled) { - content = await templaterParseTemplate( - this.app, - content, - activeFile - ); - } - if (!content) - return; - if (this.choice.prepend) { - const fileContent = await this.app.vault.cachedRead( - activeFile - ); - const newFileContent = `${fileContent}${content}`; - await this.app.vault.modify(activeFile, newFileContent); - } else { - appendToCurrentLine(content, this.app); - } - } }; // src/gui/suggesters/choiceSuggester.ts @@ -15977,7 +16045,7 @@ var ChoiceSuggester = class extends import_obsidian33.FuzzySuggestModal { return this.choices; } async onChooseItem(item, evt) { - if (item.type === "Multi" /* Multi */) + if (item.type === "Multi") this.onChooseMultiType(item); else await this.choiceExecutor.execute(item); @@ -15999,22 +16067,22 @@ var ChoiceExecutor = class { } async execute(choice) { switch (choice.type) { - case "Template" /* Template */: { + case "Template": { const templateChoice = choice; await this.onChooseTemplateType(templateChoice); break; } - case "Capture" /* Capture */: { + case "Capture": { const captureChoice = choice; await this.onChooseCaptureType(captureChoice); break; } - case "Macro" /* Macro */: { + case "Macro": { const macroChoice = choice; await this.onChooseMacroType(macroChoice); break; } - case "Multi" /* Multi */: { + case "Multi": { const multiChoice = choice; this.onChooseMultiType(multiChoice); break; @@ -16063,7 +16131,7 @@ var migrateToMacroIDFromEmbeddedMacro_default = { description: "Migrate to macro ID from embedded macro in macro choices.", migrate: async (plugin) => { function convertMacroChoiceMacroToIdHelper(choice) { - if (choice.type === "Multi" /* Multi */) { + if (choice.type === "Multi") { let multiChoice = choice; const multiChoices = multiChoice.choices.map( convertMacroChoiceMacroToIdHelper @@ -16071,7 +16139,7 @@ var migrateToMacroIDFromEmbeddedMacro_default = { multiChoice = { ...multiChoice, choices: multiChoices }; return multiChoice; } - if (choice.type !== "Macro" /* Macro */) + if (choice.type !== "Macro") return choice; const macroChoice = choice; if (macroChoice.macro) { @@ -16128,7 +16196,7 @@ function isMultiChoice(choice) { if (choice === null || typeof choice !== "object" || !("type" in choice) || !("choices" in choice)) { return false; } - return choice.type === "Multi" /* Multi */ && choice.choices !== void 0; + return choice.type === "Multi" && choice.choices !== void 0; } // src/migrations/isNestedChoiceCommand.ts @@ -16189,7 +16257,7 @@ var incrementFileNameSettingMoveToDefaultBehavior_default = incrementFileNameSet // src/migrations/isCaptureChoice.ts function isCaptureChoice(choice) { - return choice.type === "Capture" /* Capture */; + return choice.type === "Capture"; } // src/migrations/mutualExclusionInsertAfterAndWriteToBottomOfFile.ts @@ -16453,7 +16521,7 @@ var QuickAdd = class extends import_obsidian35.Plugin { choices.forEach((choice) => this.addCommandForChoice(choice)); } addCommandForChoice(choice) { - if (choice.type === "Multi" /* Multi */) { + if (choice.type === "Multi") { this.addCommandsForChoices(choice.choices); } if (choice.command) { @@ -16485,7 +16553,7 @@ var QuickAdd = class extends import_obsidian35.Plugin { if (choice[by] === targetPropertyValue) { return choice; } - if (choice.type === "Multi" /* Multi */) { + if (choice.type === "Multi") { const subChoice = this.getChoice( by, targetPropertyValue, diff --git a/.obsidian/plugins/quickadd/manifest.json b/.obsidian/plugins/quickadd/manifest.json index 42d39a8d..2b1da9a4 100644 --- a/.obsidian/plugins/quickadd/manifest.json +++ b/.obsidian/plugins/quickadd/manifest.json @@ -1,7 +1,7 @@ { "id": "quickadd", "name": "QuickAdd", - "version": "0.17.1", + "version": "0.19.4", "minAppVersion": "0.13.19", "description": "Quickly add new pages or content to your vault.", "author": "Christian B. B. Houmann", diff --git a/.obsidian/workspace-mobile.json b/.obsidian/workspace-mobile.json index 94a1c745..e5b170fd 100644 --- a/.obsidian/workspace-mobile.json +++ b/.obsidian/workspace-mobile.json @@ -212,7 +212,6 @@ "ledger-obsidian:Add to Ledger": false, "obsidian-map-view:Open map view": false, "obsidian-metatable:Metatable": false, - "obsidian42-brat:BRAT": false, "table-editor-obsidian:Advanced Tables Toolbar": false, "templater-obsidian:Templater": false, "obsidian-book-search-plugin:Create new book note": false, @@ -232,37 +231,38 @@ "msg-handler:MSG Handler": false, "obsidian-read-it-later:ReadItLater: Save clipboard": false, "meld-encrypt:Create new encrypted note": false, + "obsidian42-brat:BRAT": false, "obsidian-memos:Memos": false } }, "active": "a51da5ef0d807c2e", "lastOpenFiles": [ - "00.01 Admin/Calendars/2023-04-02.md", - "00.01 Admin/Calendars/2023-04-03.md", - "01.02 Home/@Main Dashboard.md", "01.02 Home/@Shopping list.md", - "00.01 Admin/Calendars/2023-04-01.md", - "00.01 Admin/Calendars/2023-03-31.md", - "01.01 Life Orga/@Personal projects.md", - "00.01 Admin/Calendars/2023-03-30.md", - "05.02 Networks/Server Alias.md", - "03.02 Travels/Mallorca.md", - "00.01 Admin/Calendars/2023-03-29.md", - "03.01 Reading list/The Fran Lebowitz Reader.md", - "00.02 Inbox/Le Temps gagné.md", - "03.01 Reading list/@Reading master.md", - "03.01 Reading list/Au Revoir Là-Haut.md", - "00.01 Admin/Calendars/2023-03-26.md", - "00.01 Admin/Calendars/2023-03-27.md", - "00.01 Admin/Calendars/2023-03-28.md", - "00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md", - "00.03 News/Adam Sandler doesn’t need your respect. But he’s getting it anyway..md", - "00.03 News/Gisele Bündchen on Tom Brady, FTX Blind Side, and Being a “Witch of Love”.md", - "00.03 News/I Went on a Package Trip for Millennials Who Travel Alone. Help Me..md", - "00.03 News/Jaylen Brown Is Trying to Find a Balance.md", + "01.02 Home/@Main Dashboard.md", + "00.01 Admin/Calendars/2023-04-04.md", + "00.01 Admin/Calendars/2023-04-05.md", + "00.01 Admin/Calendars/2023-04-06.md", + "00.01 Admin/Calendars/2023-04-07.md", + "02.03 Zürich/Polo Park Zürich.md", "03.04 Cinematheque/@Cinematheque.md", - "00.01 Admin/Calendars/Events/2023-03-26 Mallorca.md", - "00.03 News/The Limits and Wonders of John Wick’s Last Fight.md", + "03.04 Cinematheque/The Guard (2011).md", + "03.04 Cinematheque/Thank You for Smoking (2005).md", + "05.01 Computer setup/Storage and Syncing.md", + "00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md", + "02.02 Paris/Alluma.md", + "02.02 Paris/Narro.md", + "00.01 Admin/Calendars/2023-04-03.md", + "00.03 News/The Big Coin Heist.md", + "00.03 News/The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow.md", + "00.03 News/We want objective judges and doctors. Why not journalists too.md", + "00.02 Inbox/Why are Americans dying so young.md", + "00.01 Admin/Calendars/2023-04-02.md", + "05.02 Networks/Server VPN.md", + "05.02 Networks/Configuring Caddy.md", + "05.02 Networks/Server Alias.md", + "05.02 Networks/Server Tools.md", + "00.01 Admin/Calendars/Events/2023-02-09 Médecin.md", + "00.01 Admin/Calendars/2023-04-01.md", "Pasted image 20230317114612.png", "Pasted image 20230317114609.png", "Pasted image 20230309141356.png", diff --git a/00.01 Admin/Calendars/2023-04-02.md b/00.01 Admin/Calendars/2023-04-02.md index 84443dc3..83f09872 100644 --- a/00.01 Admin/Calendars/2023-04-02.md +++ b/00.01 Admin/Calendars/2023-04-02.md @@ -114,7 +114,7 @@ This section does serve for quick memos.   -Loret ipsum +🛬: [[Mallorca]] to [[@@Zürich|Zürich]]   diff --git a/00.01 Admin/Calendars/2023-04-03.md b/00.01 Admin/Calendars/2023-04-03.md index df24bd78..a237a7fa 100644 --- a/00.01 Admin/Calendars/2023-04-03.md +++ b/00.01 Admin/Calendars/2023-04-03.md @@ -16,9 +16,9 @@ Stress: 27.5 FrontHeadBar: 5 EarHeadBar: 35 BackHeadBar: 20 -Water: 0.5 +Water: 3.75 Coffee: 0 -Steps: +Steps: 11290 Weight: Ski: IceSkating: @@ -114,7 +114,7 @@ This section does serve for quick memos.   -Loret ipsum +📺: [[Thank You for Smoking (2005)]]   diff --git a/00.01 Admin/Calendars/2023-04-04.md b/00.01 Admin/Calendars/2023-04-04.md new file mode 100644 index 00000000..0d95d61d --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-04.md @@ -0,0 +1,136 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-04 +Date: 2023-04-04 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 6.5 +Happiness: 80 +Gratefulness: 80 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.83 +Coffee: 3 +Steps: 11566 +Weight: 96.3 +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-03|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-05|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-04Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-04NSave + +  + +# 2023-04-04 + +  + +> [!summary]+ +> Daily note for 2023-04-04 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-04 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +🚆: [[@@Zürich|Zürich]] to [[@@Paris|Paris]] + +🍽: dinner with [[Amaury de Villeneuve]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-04]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-05.md b/00.01 Admin/Calendars/2023-04-05.md new file mode 100644 index 00000000..f96ace45 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-05.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-05 +Date: 2023-04-05 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 7.5 +Happiness: 80 +Gratefulness: 80 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 2.58 +Coffee: 5 +Steps: 5789 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-04|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-06|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-05Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-05NSave + +  + +# 2023-04-05 + +  + +> [!summary]+ +> Daily note for 2023-04-05 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-05 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-05]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-06.md b/00.01 Admin/Calendars/2023-04-06.md new file mode 100644 index 00000000..7af15542 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-06.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-06 +Date: 2023-04-06 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 6 +Happiness: 80 +Gratefulness: 80 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: 3.5 +Coffee: 0 +Steps: 3317 +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-05|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-07|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-06Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-06NSave + +  + +# 2023-04-06 + +  + +> [!summary]+ +> Daily note for 2023-04-06 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-06 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +📺: [[The Guard (2011)]] + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-06]] +``` + +  +  \ No newline at end of file diff --git a/00.01 Admin/Calendars/2023-04-07.md b/00.01 Admin/Calendars/2023-04-07.md new file mode 100644 index 00000000..d9eb04a5 --- /dev/null +++ b/00.01 Admin/Calendars/2023-04-07.md @@ -0,0 +1,134 @@ +--- + +title: "🗒 Daily Note" +allDay: true +date: 2023-04-07 +Date: 2023-04-07 +DocType: Note +Hierarchy: +TimeStamp: +location: +CollapseMetaTable: true +Sleep: 8 +Happiness: 80 +Gratefulness: 80 +Stress: 27.5 +FrontHeadBar: 5 +EarHeadBar: 35 +BackHeadBar: 20 +Water: +Coffee: +Steps: +Weight: +Ski: +IceSkating: +Riding: +Racket: +Football: +Swim: + +--- + +%% Parent:: [[@Life Admin]] %% + +--- + +[[2023-04-06|<< 🗓 Previous ]]       [[@Main Dashboard|Back]]       [[2023-04-08|🗓 Next >>]] + +--- + +  + +```button +name Record today's health +type command +action MetaEdit: Run MetaEdit +id EditMetaData +``` +^button-2023-04-07Edit + +```button +name Save +type command +action Save current file +id Save +``` +^button-2023-04-07NSave + +  + +# 2023-04-07 + +  + +> [!summary]+ +> Daily note for 2023-04-07 + +  + +```toc +style: number +``` + +  + +--- + +  + +### ✅ Tasks of the day + +  + +```tasks +not done +due on 2023-04-07 +path does not include Templates +hide backlinks +hide task count +``` + +  + +--- + +  + +### 📝 Memos + +  + +This section does serve for quick memos. + +  + + +%% --- %% +  + +--- + +  + +### 🗒 Notes + +  + +Loret ipsum + +  + +--- + +  + +### :link: Linked activity + +  + +```dataview +Table from [[2023-04-07]] +``` + +  +  \ No newline at end of file diff --git a/00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md b/00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md index d632b61b..e3320b0f 100644 --- a/00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md +++ b/00.03 News/How Michael Cohen’s Big Mouth Could Be Derailing the Trump Prosecution.md @@ -12,7 +12,7 @@ CollapseMetaTable: true --- Parent:: [[@News|News]] -Read:: 🟥 +Read:: [[2023-04-06]] --- diff --git a/00.03 News/The Big Coin Heist.md b/00.03 News/The Big Coin Heist.md new file mode 100644 index 00000000..dc3e76e3 --- /dev/null +++ b/00.03 News/The Big Coin Heist.md @@ -0,0 +1,205 @@ +--- + +Tag: ["🚔", "💸", "🇨🇦"] +Date: 2023-04-03 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-03 +Link: https://hazlitt.net/longreads/big-coin-heist +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-TheBigCoinHeistNSave + +  + +# The Big Coin Heist + +**The figure turns to address two others.** Like him, they are dressed in head-to-toe black, their faces obscured. Unlike him, they are lagging on the stairs of Berlin’s Hackescher Markt S-Bahn platform. Because there is no audio and his face is turned away from the CCTV cameras, there’s no way to know what he’s saying, but there’s something in his body language. A restlessness, like an eager kid telling his friends to catch up because they’re at risk of missing out.  + +It’s 3 a.m., on March 27, 2017. The figures are going to steal a 100 kg coin the size of a car tire made of the purest gold in the world. + +Whatever the leader says works. The two other figures catch up, fall in line, and when they reach the top of the stairs, speed walk towards the end of the S-Bahn platform. The three figures step off the platform, onto the track bed, and over to the service pathway running parallel to the tracks. They didn’t have to worry about any trains passing by and spotting them, because they knew that the S-Bahn wouldn’t start up again until 4:13 a.m. + +The path they walk gives them an enviable view of the unattended city, theirs in the way all cities belong to those awake at such an early hour. The Berlin Cathedral looms above them and Monbijoupark, with its winter-battered trees, peers over the S-Bahn tracks. Beneath them is the Spree River, and ahead is the Bode Museum, part of what is known as Museum Island. + +It was there, on the second floor of the Bode Museum, that the Big Maple Leaf coin awaited them. + +Since its creation, the coin had possessed a curious quality, a weight greater than its mass, and a worth beyond its face value. It had a way of changing lives. The three figures were moments away from learning that themselves. If they succeeded, the coin would certainly make them rich. But it also had the potential to do more: make them infamous, noteworthy, respected, admired for the brazenness of their act. Which was the idea. This was meant to be a provocation, and what was at stake in those early hours of the day wasn’t just repercussions, but reputation. + +\* + +Ten years earlier, 6000 kilometers away, in Ottawa, designer and engraver Stan Witten was at his desk with a set of graphite pencils drawing three silver maple leaves on an 8.5x11 piece of paper. The veteran Royal Canadian Mint employee was focused on getting the leaves just right. He wanted to ensure the leaves felt alive, as if they would curl up and float off the page. They were for a special project unlike any he had ever worked on for the RCM. + +The project, to create a 100 kg coin, twenty inches thick, with a face value of one million dollars, was so unprecedented that when RCM chief technology officer Xianyao Li was told about it, his first thought was, “It’s impossible.” + +The idea for the Big Maple Leaf coin formed as the RCM was launching a new series of pocket-sized coins made of 99.999 percent pure gold, often referred to as “five nines pure.” Raw gold is typically muddied with other elements like silver, aluminum, or zirconium, and needs to be processed so that there are less than ten parts per million of other elements*.* The typical standard is four nines. That extra decimal represents hundreds of thousands of dollars of additional value, and a source of technical pride for an organization like the RCM. + +But the RCM wanted to signal a little more to the world, to draw attention to the new line of coins. In 2004, the Austrian Mint had created what was at that time the world’s biggest coin: a 31 kg coin made of 99.99 percent pure gold. In doing so, Austria hadn’t issued a direct challenge, but because there is an unofficial rivalry between international mints, they might just as well have. What if the RCM combined one accomplishment with another? What if they created a big, 99.999 percent pure coin? Really big. Big enough to draw attention. + +Most coins can be struck with a hydraulic press, but there was no machine large enough, or powerful enough, to strike a coin this size. Li and his colleagues would have to turn to casting, a process not unlike pouring batter into a cake mold. The problem with that was the need to create a custom mold that could produce the needed thickness. It would also have to be a mold strong enough to withstand so much hot molten gold, while flexible enough to let the coin pop out after. Precision also had to be considered. Because the coin was to be sold at 100 kilograms, if it ended up weighing 101 kilograms, that additional gold would be an expensive loss for the RCM. If the coin came out of the cast under 100 kilograms, the team would have to scrap the entire coin and start again. The process could also risk contamination, turning five nine gold into four nines.  + +Over the next three months, the team worked through the process. They knew they were working on something unique. Defining. Whenever a coin was cast, the whole plant would gather and provide support. “Everyone wanted to know how successful it would be,” recalls Xianyao Li. “When we succeeded everyone was so happy. When we scrapped one coin because of the weight, everybody found a way to support the team so they don’t feel bad.” + +Eventually the casting process succeeded. Witten used hand engraving tools to remove slight defects that emerged during the casting process, enhanced the details of the maple leaves and the image of Queen Elizabeth (designed by Susanna Blunt) on the opposite side. The coin surfaces were primed by hand, pre-polished, and then given a frosted finish. + +In May 2007, the Big Maple Leaf coin was revealed to the public and the press at the RCM’s Ottawa offices. Internally, the team celebrated. Special posters were made and signed by all involved (Li has one framed in his office). Team photos were shot. There was also a celebration in the employees’ cafeteria, with coffee and cake, and a chance to stand next to the coin and have a photo taken. + +In the days, weeks, and months after, the Big Maple Leaf coin’s creators saw their hard work receive international attention. The Guinness World Records organization officially recognized the coin as the world’s largest. There was high demand for the coin to tour the world. + +The creators received personal attention too. Witten saw his name appear widely in external publications and brochures. All of it has been tucked away in a filing cabinet he keeps at home, to look back on when he retires.   + +As for Li, he was invited in 2008 to give a presentation at his industry’s most prestigious event, the Mint Directors Conference. He broke through in the mint industry in ways he hadn’t before, becoming a member of the technical committee that oversees the industry. + +And the RCM itself? “This built some confidence in the mint that we can overcome a lot of technical challenges,” Li says. + +The RCM’s work with the coins wasn’t entirely done, however. The coin had attracted other attention as well. Wealthy companies and individuals reached out to the Mint, inquiring if the coin could be custom made for them. The RCM accepted. In the end, six coins were created. One stayed with the RCM in a vault. One went to Barrick Gold Corporation, a Canadian gold mining outfit. One went to an Austrian investment firm. One went to Queen Elizabeth. The last two went to two individuals in Dubai, one of whom, it is rumoured, uses the coin as a coffee table. + +When all the work was done, the team was proud of it as an artistic accomplishment, an engineering accomplishment, and a national accomplishment. “I think coins tell a lot about a country, and showcase the country. What’s important, what they’re proud of, what’s meaningful,” Witten says. Li adds, “That’s our history. The coins do give us things we can pass down for years.”  + +They felt they had created something lasting. “Coins are permanent, right? Even one this heavy. They don’t burn or don’t blow away, or get lost,” Witten told me. + +“Unless someone steals it,” Li added. + +\* + +The three thieves arrived at a wall that once belonged to a support structure that connected the Bode Museum to the Pergamon Museum. The bridge itself was long gone, and the structure had lost its purpose, but that morning it would find one again. Scaled, the wall leads to the only second-floor window accessible from the outside of the museum. It was the thieves’ best way in, and they had planned accordingly. Nearby was a ladder they had left behind from a previous visit, six days earlier, when everything had gone wrong. + +On March 21, the would-be thieves had climbed that ladder up to the window, to remove bolts from security glass that covered the window and gain access to a locker room for museum employees. Mid-bolt removal, however, the glass had cracked. Worried, they fled. If anyone noticed the damage the next day, security would likely be increased and their only entry point would be closed to them. + +The damage was noticed. A repair order was issued, but it wasn’t prioritized, likely because the damage was written off as wear and tear. The thieves had been given another chance. But if they didn’t succeed today, on March 27, the coin was going to be gone. It was scheduled to be moved to the Berlin Kulturforum, across the city. If that happened, their weeks’ worth of planning, stress, and anticipation would be for nothing. + +They climbed the ladder and stood in front of the security glass for the second time in a week. No longer worried about causing further damage (what did they have to lose now?), they successfully removed the remaining bolts on the security glass and got the casement window behind it open. They knew they didn’t have to listen for the shriek of an alarm, because they knew the alarm sensor in the window had been faulty since 2013 and was turned off. They knew this the same way they knew the window damage hadn’t drawn concerns, the same way they knew how to do everything they were about to do. Their crew had a fourth member. They had an inside man. + +They were in. There was the risk of being caught by one of the guards who patrolled the rooms and halls of the museum, but that morning there was only one guard on duty, and he was patrolling another floor. In order not to set off the motion sensors throughout the museum during their rounds, guards turned them off.  + +At that early hour, the thieves’ hurried steps would have pierced the silence and the assumed decorum of museums, echoing off the hardwood floors and into the high ceilings. + +They walked out of the “Employees Only” door and left the first of several doorstoppers meant to ease their escape. The path took them past frescos of the god Pan and Renaissance images of Christ, past statues of Prussian military leaders watching their advance and a collection of 18th century French artwork. They passed an assembly of baroque southern German art before finally moving past an image of a man victoriously holding a decapitated head, and arriving in the first of the series of rooms, painted envy green and filled with narrow door frames only one person can fit through at a time, that made up the museum’s numismatic section. + +Around them were coins from the Holy Roman Empire all the way to the present. There was ancient and modern currency from Germany, France, Italy, Spain, Portugal. There were quotes about currency from a Nürnberger leaflet from 1652, inscribed on a plaque: “Money rules the world. You noble Miss Money/Everyone courts you/What does it matter: because your love on earth/can do anything.” + +Then there was the Big Maple Leaf coin, in all its purity, size, detail, and value. It was right there and now all they had to do was take it. + +One of the thieves removed an axe from the backpack they had brought with them. He wrapped his hands around its black rubber handle, and the yellow grip at its base. Then he swung the axe towards the case protecting the coin. + +\* + +When the Big Maple Leaf coin arrived in the Bode Museum in 2010 it had been on something of a Bad Luck European Tour. This coin was the one purchased by the Austrian investment firm, AvW Invest. The company dissolved around 2010—the head of the company was arrested for fraud—and the coin was sold at an auction for 3.27 million euros to a Spanish precious metals company named Oro Direct Sales. That company, too, got into trouble. Police descended on their offices in 2014 with suspicions of money laundering and illegal trading. The coin, however, narrowly avoided that fate thanks to Boris Fuchsmann, a Ukrainian real estate mogul living in Düsseldorf. A collector of art and luxuries, Fuchsmann had registered for the auction Oro Direct Sales had won while in South Africa for the 2010 World Cup. During the auction, however, he was visiting Kruger National Park and had no cell reception. Afterwards, he reached out to the Spanish company and offered 100,000 euros more for the coin than they had paid. Oro agreed. Not long after, Fuchsmann got a call from the Bode Museum who asked if he could lend the coin for a special exhibit called “Gold Giants.” He agreed.  + +The Big Maple Leaf coin proved to be a draw to the museum. The press covered it. A TV film crew filmed the exhibit. Its success was considerable enough that, while the other coins that were lent to the museum for the exhibit were returned, the museum asked Fuchsmann if they could give the Big Maple Leaf coin a more long-term home. The coin became a permanent addition and the museum became its guardian.  + +\* + +The glass encasement that guarded the coin smashed into pieces so thick, so heavy, that when they fell onto the hardwood floor, they left deep gouges that remain there, like scars, to this day. + +With the coin now exposed, the thieves put their hands on it for the first time. Muscles tightening beneath the 100 kg weight, they lifted the giant Maple Leaf coin and lowered it down onto a handle-less wooden trolley. + +They had to move. The guard could return to the security room at any moment and reactivate the motion sensors, and then the propped open doors would trigger an alarm. + +They hastily pushed the trolley back along the route they had come, its small wheels click-clacking along the floors, leaving the occasional skid mark. Plaster was ripped off the walls as the trolley bumped into them. When the thieves arrived back in the locker room, they lifted the giant coin up towards the window. They left the trolley behind, shoved the coin, and gravity did the rest. + +Waiting below was a wheelbarrow. (Unbeknownst to them, the wheelbarrow had been noticed ten days ago by an electrician working on the S-Bahn’s signals, but he assumed his colleagues had left it there). The thieves loaded the coin into the wheelbarrow and pushed it to a spot above Monbijoupark, where a driver was waiting. Their bounty was put into the trunk, then the thieves got into the car and drove off. + +In sixteen minutes, they had become millionaires. + +After 4 a.m., the guard on duty in the Bode returned to the security room from his rounds. The guard was an eight-year veteran of Museum Island security but had only recently been transferred to the Bode. Tonight was his first time on solo duty since starting there and his first two rounds (one starting, according to logs, at 18:55 and another at 23:00) had been uneventful. He had no reason to think the third would be any different. + +Then, on a monitor, he saw something confusing. Several doors on the second floor were open, even though he was certain that he’d closed them earlier. Fear gripped him. Someone was in the museum. How had this happened? He hadn’t heard or seen anything. + +The guard radioed Museum Island’s central security for backup. One of his colleagues noticed the scuff marks the thieves’ trolley had left on the hardwood floor. Tracking them eventually led to the scene of the crime where someone, according to reports, exclaimed, “Oh shit, the coin.” + +A call went out to Bernhard Weisser, the director of the museum’s numismatic collection, who initially thought he was being pranked. The coin was so big, so awkward to transport, the museum had considered it an unlikely target for a theft. “That was a big mistake,” Weisser would later tell the press. + +Another call went out to the Berlin Police, who misunderstood the scope of what had happened. One coin was missing? Considering the museum had thousands of coins and other priceless artworks, that hardly seemed like a major crime. It wasn’t until they arrived at the scene and an officer saw the broken glass case, along with a plaque describing a 100 kg coin, that the police realized it hadn’t been just a piece of ancient pocket change. + +The ensuing investigation was made considerably easier by the thieves, whose heist may have been daring and well-planned, but hardly careful. Caution didn’t seem to have been a priority. Along each step of the heist, the thieves had left easy evidence to collect. At the S-Bahn Hackescher station, CCTV cameras had captured that morning’s journey. Where the ladder, axe, trolley, and wheelbarrow had been left served as useful landmarks to identify the thieves’ in-and-out route. Gold fragments had also been left where the coin had been dropped, which outlined their final escape path, as did another security camera which caught the getaway Mercedes driving away from the scene. The thieves had left DNA on several of their tools. + +The police, nonetheless, didn’t have any immediate theories as to who the suspects could be. But they would soon find out there was a place in Berlin where it wasn’t much of a secret at all. + +\* + +Wander streets like Karl-Marx-Strasse and Sonnenallee in the borough of Neukölln, located in southeast Berlin, and you’ll notice signs of what many call a parallel society within Germany. Hookah bars, as well as stores selling Middle Eastern nuts and sweets, all demonstrate the local population: the Arabische Grossfamilien (Arabian extended families) that have made the borough their home. + +These families are made up of Kurds from Southeast Turkey who, during the 1980s, fled Turkey for Lebanon, then fled Lebanon for Germany due to the Lebanese Civil War. When the families arrived as refugees, they were subject to what is now considered a failure of politics and a policy of neglect. They were excluded from society. Ignored into its margins. They received welfare, but little opportunity. They weren’t allowed to work or leave Berlin. + +Germany’s disinterest encouraged isolation, but the country’s neglect had another effect. While the vast majority of Grossfamilien were law abiding (and this remains true today), a contingent began to seek financial opportunities beyond German law. If Germany wouldn’t shape their futures, these men would shape their own. They turned to drugs, prostitution, extortion and theft to make money and, over time, robust criminal organizations, referred to as clans, were formed. + +As a clan member named Yehya E. relays [in the book](https://www.christian-stahl.com/books_in-den-gangs-von-neukoelln.html) *In the Gangs of Neukölln* by journalist Christian Stahl, “It’s about being a man, and being a man is very important … It’s the face you wear. One with which you can walk around on the street. You can’t let yourself be seen anywhere when you’re not a man … So, you carry the dream of being a big mafia boss in your heart … to be a hero for a moment.” + +Becoming that hero is made possible because of accessible hierarchies, where there are no fixed positions. What elevates you is what you do. Youth make themselves upwardly mobile in the clans by building a resumé of assaults, petty theft, and drugs. + +And some graduate to more audacious crimes; like the Big Maple Leaf theft. Seeking respect and recognition, the thieves made no secret of their plans, which is why, eventually, the police were contacted by clan informants, and told three names. + +Ahmed, Wayci and Wissam Remmo. + +The police knew the Remmo clan, and the three men, well. The Remmos are one adversary among the small battles in an ongoing war between the clans and police. When luxury cars double park in Neukölln and an officer tries to give a ticket, they are quickly surrounded by clan members yelling “Get out of here, this is our territory, fucking cop.” When officers are leaving work, they are followed home, or asked on their way out the door how their children are doing in school by clan members—who name the children, and the school. + +Patriarch Issa Remmo arrived in Germany in 1995 and has thirteen children and fifteen siblings. He has always vehemently denied any criminal activity, insisting he is nothing more than a real estate investor and restaurateur. He has posed for photo shoots in crisp dress shirts, pouring coffee in a standard suburban backyard, promoting the image of himself as unassuming entrepreneur. Nonetheless, his family—especially his children—continually find themselves in court. + +\* + +With the information they obtained from undercover sources, the Berlin Police got to work. They began monitoring the communications of numerous members of the Remmo clan. Police suspected talk of the museum robbery was being restricted to encrypted message services. But the police did get an investigative foothold when they became aware of a twenty-year-old man named Denis W. + +Denis W. had started working at the Bode Museum only twenty-six days before the theft. More significantly, he was known to be a school friend of one of the suspects, Ahmed Remmo. A week after the theft, he had also drawn attention to himself through a sudden financial windfall. He had invested thousands of dollars in a local bakery, he had been luxury car shopping, and he was seen wearing a new 11,000-euro necklace. The police had found the inside man. + +A police officer remembered Denis W. from three weeks before the theft. He had pulled him over for filling up at a gas station, then driving off without paying, all while using a fake license plate in case cameras caught the act. The officer at the time had noticed Bode Museum floor plans in the back seat, as well as screwdrivers and nylon gloves in the trunk. Later, it would also be discovered that Denis W. had photos of the museum that corresponded with the thieves’ escape route. + +A bigger breakthrough on the case came when a raid was executed on July 12, 2017. Among the targets were the Big Maple Leaf coin suspects, and more evidence was found. Police found an app on Wissam Remmo’s cell phone for calculating gold prices. His search history unearthed queries for equipment that could melt gold, along with news updates on the heist. His camera roll included screenshots of Google Map directions that appeared to indicate the thieves’ getaway route. In his apartment, they found gloves with glass fragments that matched the museum window the thieves had entered through. + +Police found a piece of paper listing current gold values with Ahmed Remmo’s fingerprints on it in a kitchen spice rack. Between all the suspects, the police found clothes—a rare Armani jacket seen in the CCTV footage, gloves, shoes—that had small gold particles on them, which police hoped would match the coin.  + +All of it was damning evidence, though at risk of being deemed circumstantial. But it was enough for the police to arrest the suspects the day of the raid, pursue an indictment, and set the trial process into motion. + +\* + +The police were eager to involve the state as soon as possible.  + +The state attorney’s office was now part of a three-prong attack underway against the clans, and here was a significant chance to gain ground in the battle. But convictions against clan members are rare: the criminal organizations’ wealth allows them to intimidate witnesses to recant their testimony, as well as afford the city’s best defense lawyers, eager to chip away at any perceived vulnerabilities in the prosecution’s case. + +Even a pinch of doubt could mean the panel of judges (there are no juries in German courts) refusing to convict. If there was a successful conviction, the impact on the clans could be minor. Time in prison can be as comfortable for clan members as life on the outside. And jail time was often perceived to be a means of proving oneself. (“Prison makes men,” is a common expression among the clans). Clans often use members who are under twenty-one to commit more overt crimes so that they will be tried in more lenient youth courts. + +But a successful outcome for the clans wouldn’t necessarily spare the parties involved from anger. On July 17, 2019, patriarch Issa Remmo’s son was cleared of murder. Remmo began yelling in the court room at the prosecutor. “I know you, and everyone who works with you … I am a clean person. I have respect for the court, for the police. I have respect for this country, but absolutely none for you.” Outside the courthouse, he continued in front of the cameras of Spiegel TV. Addressing informants, he said, “I know you … As god is my witness, I will fuck your sisters.” + +The trial for the coin heist began in January 2019. The suspects covered their faces with magazines to protect themselves from the press, and none of their family or friends were in attendance. They sat still and silent in the courtroom as the charges were read, only speaking to confirm their names and professions. (They told the judges they were students and couriers). + +Over the course of several court dates scattered over months, the details of what happened the night of the Big Maple Leaf coin theft were laid out. Museum employees explained the security gaps that had led to the window alarm being inoperable. The guard on duty that night was questioned about his movements. He shared how haunted he was by those who refused to believe he hadn’t heard or seen anything that night, and shared the anxiety he has suffered since. Police investigators testified about searching the crime scene and their investigation of the Remmos that led to the arrests. Experts were brought in to connect suspects to the thefts and the evidence. An ex-girlfriend of Ahmed Remmo, who had told investigators about him hiding tools and bragging about being a millionaire, was called to the stand. (She retracted her comments once there). Ernst Pernicka, an archaeometrist, provided critical evidence linking the gold particles found on the thieves’ clothes to the giant coin.   + +On February 20, 2020, all parties gathered to hear what verdict had been reached.  + +After acknowledging the theft at the heart of the case was “the coup of a lifetime,” judge Dorothee Prüfer passed down the court’s decision. + +Denis W. received three years and four months of prison time. He was fined 100,000 euros, his presumed cut for being the inside man. + +Wissam and Ahmed Remmo were sentenced to four years and five months (priors for assault and breaking and entering led to longer sentences). They were fined 3.3 million euros, the estimated value of the coin at the time. + +Wayci Remmo was released due to a lack of evidence tying him to the crime. + +The three men’s defense lawyers attempted to appeal the verdict, which was denied in July 2021. It likely didn’t help that Wissam Remmo became a suspect— and was eventually arrested—for another spectacular crime in 2019: the robbery of the Green Vault, a museum in Dresden. The haul? Royal jewelry some estimate to be worth 113 million euros or more. + +\* + +One question remains: What happened to the Big Maple Leaf coin? + +It was never recovered and nobody believes it still exists intact. It was impossible to sell as is, so it was likely broken apart or melted. Its presumed fate evokes another quote that had been on display in the Bode Museum that night it was stolen, not far from where the Big Maple Leaf Coin stood. The author bemoans what he considers the worst fates that can befall a society. There’s war, plague, and famine. He then adds debasement—the destruction of a currency’s value. It’s likely no single piece of currency has been so stripped of so much value. And yet, another value remains. One that now lingers, like fine gold dust, on all those who came in touch with it. + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow.md b/00.03 News/The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow.md new file mode 100644 index 00000000..f0397041 --- /dev/null +++ b/00.03 News/The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow.md @@ -0,0 +1,61 @@ +--- + +Tag: ["🤵🏻", "📰", "🇷🇺", "🇺🇸"] +Date: 2023-04-03 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-03 +Link: https://www.newyorker.com/news/daily-comment/the-unimaginable-horror-of-a-friends-arrest-in-moscow +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-TheHorrorofEvanGershkovichArrestinMoscowNSave + +  + +# The Unimaginable Horror of Evan Gershkovich’s Arrest in Moscow + +Evan Gershkovich.Photograph from AFP / Getty + +On Wednesday, the Russian state security service, the F.S.B., arrested my friend Evan. Evan Gershkovich, a thirty-one-year-old reporter for the *Wall Street Journal* and the son of Soviet-born émigrés who came to the U.S. in the late seventies, was detained while on a reporting trip to Yekaterinburg, a city more than a thousand miles east of Moscow. I learned of the news the following day, when he was brought to Moscow, formally charged with espionage in a closed hearing, and ordered to be held in Lefortovo Prison awaiting trial, which could send him to prison for as long as twenty years. + +I met Evan five years ago, not long after he arrived in Moscow as a twentysomething reporter full of ideas, hustle, and smarts. He was funny, acerbic, and kindhearted, not to mention a skilled chef—he had spent several months in the kitchen of a serious New York City restaurant before he turned to journalism. We cooked together, went to the *banya* together, partied together. + +Above all, Evan is a hell of a reporter, industrious and energetic. He filed stories for the Moscow *Times*, his first journalistic home, that often scooped the rest of the Western press corps. During the pandemic, he spoke to Russian medical students forced to treat *COVID* patients and to statisticians who feared that the state was manipulating data on *COVID* deaths. In January, 2022, after a stint at Agence France-Presse, he started at the *Journal*. He was happy; his friends were proud of him. He had pulled off what he had worked so hard for: a staff job with a major American newspaper, covering a place that meant so much to him. Russia could be maddening and fascinating in equal measure, but never boring or unimportant. + +In the years before Russia’s invasion of Ukraine, people in the U.S. often asked how foreign correspondents managed to do their jobs in a place like [Vladimir Putin](https://www.newyorker.com/tag/vladimir-putin)’s Russia. During my and Evan’s time there, the country shifted in an unmistakably repressive direction, transitioning from an autocracy that pretended, however flimsily, to be a democracy to a state that didn’t bother hiding its claws. The Russia story became more monotone, less a madcap collision of wealth and opportunity and ambition—as it had been in the early Putin years—than one increasingly defined by menace and violence. The space for independent journalism, however marginal and niche it had been already, shrunk even further. + +Our Russian journalist friends faced countless pressure and constraints, mainly of the financial and professional kind—one independent outlet after another closed down or was forced to—but more immediate dangers were also ever present. In the summer of 2019, Ivan Golunov, an investigative reporter for [Meduza](https://www.newyorker.com/magazine/2023/03/13/how-russian-journalists-in-exile-are-covering-the-war-in-ukraine), a news site based in Riga, was arrested on a fabricated drug charge, apparently in retaliation for his coverage of corruption in the Moscow burial industry. He was freed after four days, the result of mass protests organized by his journalistic colleagues. + +But Golunov’s enemies were local, relatively small-time criminals, not the truly powerful ones who occupy top positions in the Kremlin and F.S.B. If you were up against forces like that, your fate could be very different. In 2020, Ivan Safronov, a former journalist for *Kommersant*, a once serious, hard-hitting daily in Moscow that had morphed into something more safe and milquetoast, was arrested on charges of espionage. Supposedly, his coverage of the sale of Russian fighter jets was secret cover for his dealings with Czech intelligence services. This story was as unconvincing as it sounds, but, in 2022, Safronov was sentenced to twenty-two years in prison. He remains there today. + +Yet, for a long time, arrests were rare. So were physical attacks. The macabre insight of the Russian state and its security services was that you didn’t have to jail or kill that many reporters for the rest to get the hint. The Kremlin preferred more banal, quasi-legalistic methods of constraining the work of individual journalists, such as designating them “foreign agents,” a label that comes with all manner of burdensome administration, and which scares off sources and contacts. Whole outlets—such as Proekt, an investigative Web site founded by reporters who banded together after their previous outlets were shuttered—were deemed “undesirable,” and this, in effect, criminalized just about everything connected to them. Proekt was forced to shut down; five of its journalists were named “foreign agents.” + +What was hard to explain—to our friends and family back home, to our editors, even to ourselves—was the degree to which we, as foreign correspondents, continued to occupy a position of relative privilege and safety. The bosses and owners of our media organizations were in New York; they couldn’t readily be pressured or blackmailed. Putin can’t close down the *Wall Street Journal* or *The New Yorker*. But, on a more basic level, we weren’t worth the trouble: our audiences were far away, and nothing published in English was going to threaten Putin’s hold on power or the stability of the political system. And the Kremlin long ago gave up caring about its image in the West. So we were largely left alone to report and write as we pleased. + +Then came the war. Last February, Russia invaded [Ukraine](https://www.newyorker.com/tag/ukraine), and what had been a gradual process of shrinking freedoms took on new speed. [TV Rain](https://www.newyorker.com/news/dispatch/russia-blocks-its-last-independent-television-channel), an independent television channel with a large online following, was taken off the air and banned entirely. So was [Echo Moskvy](https://www.newyorker.com/magazine/2008/09/22/echo-in-the-dark), a liberal-leaning radio station. A package of wartime censorship laws, passed on March 4, 2022, criminalized virtually any honest, factual reporting on Russia’s invasion. Just about every Russian journalist who Evan and I knew [fled the country](https://www.newyorker.com/magazine/2022/03/28/the-russians-fleeing-putins-wartime-crackdown) within a matter of days; those who stayed had no choice but to leave the profession. I was in Ukraine at the time; Evan was in Moscow. He quickly left Russia, too, unsure of how to continue to do his job under such conditions. + +But then, over the summer, he went back. His Russian visa and journalistic accreditation were still valid, and it seemed like the old logic might still apply: foreigners could get away with reporting that would be far more problematic, if not off limits entirely, for Russians. The *Times* and the *Guardian*, among others, had correspondents who cycled through Russia. Evan and I spoke a lot about his choice. He felt that he had the rare journalistic privilege of reporting from the country that had launched the largest land war in Europe since the Second World War, and that understanding what both the élite and the wider population felt about that was an urgent journalistic assignment. The magnetic tug of duty and curiosity made sense to me. In fact, on some level, I was jealous. + +Evan came and went from Moscow. He told me of the strange paradox of life in the capital: the context for everything—politics, the economy, how people related to one another—had changed, perhaps irreparably, but on the surface it often felt like things remained the same as ever. In July, he [wrote](https://www.wsj.com/articles/in-russias-biggest-cities-ukraine-war-fades-to-background-noise-11656670347) about the maniacal drive among many in Moscow to act as if everything were normal; he reported from verandas and courtyard parties, an experience that was dizzying and a bit soul-crushing. “While the police patrolling Moscow’s streets are now armed with assault rifles, they are busier handing out fines for public drinking than putting down dissent,” he wrote. + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/00.03 News/We want objective judges and doctors. Why not journalists too.md b/00.03 News/We want objective judges and doctors. Why not journalists too.md new file mode 100644 index 00000000..3f1a73a5 --- /dev/null +++ b/00.03 News/We want objective judges and doctors. Why not journalists too.md @@ -0,0 +1,191 @@ +--- + +Tag: ["🤵🏻", "📰"] +Date: 2023-04-03 +DocType: "WebClipping" +Hierarchy: +TimeStamp: 2023-04-03 +Link: https://www.washingtonpost.com/opinions/2023/03/24/journalism-objectivity-trump-misinformation-marty-baron/ +location: +CollapseMetaTable: true + +--- + +Parent:: [[@News|News]] +Read:: 🟥 + +--- + +  + +```button +name Save +type command +action Save current file +id Save +``` +^button-WewantobjectivejudgesWhynotjournaliststooNSave + +  + +# We want objective judges and doctors. Why not journalists too? + +(Video: Michelle Kondrich/The Washington Post) + +*Martin Baron was executive editor of The Post from January 2013 through February 2021 and, before that, editor of the Boston Globe for more than 11 years. His book, “Collision of Power: Trump, Bezos, and The Washington Post,” is to be published in October. This essay is adapted from a speech he gave March 16 as part of the Richman Fellowship at Brandeis University.* + +Objectivity in journalism has attracted a lot of attention lately. It also is a subject that has suffered from confusion and an abundance of distortion. + +I’m about to do something terribly unpopular in my profession these days: Defend the idea. + +Let’s step back a bit. First, a dictionary definition of objectivity. This is from Merriam-Webster: “expressing or dealing with facts or conditions as perceived without distortion by personal feelings, prejudices, or interpretations.” + +That’s of some, but limited, help in understanding the idea. Let me suggest thinking about objectivity in the context of other professions. Because as journalists, and as citizens, we routinely expect objectivity from professionals of every sort. + +We want objective judges. We want objective juries. We want front-line police officers to be objective when they make arrests and detectives to be objective in conducting investigations. We want prosecutors to evaluate cases objectively, with no preexisting bias or agendas. In short, we want justice to be equitably administered. Objectivity — which is to say a fair, honest, honorable, accurate, rigorous, impartial, open-minded evaluation of the evidence — is at the very heart of equity in law enforcement. + +We want doctors to be objective in their diagnoses of the medical conditions of their patients. We don’t want them recommending treatments based on hunches or superficial, subjective judgments about their patients. We want doctors to make a fair, honest, honorable, accurate, rigorous, impartial, open-minded evaluation of the clinical evidence. + +We want medical researchers and government regulators to be objective in determining whether new drugs might work and whether they can be taken safely. We want scientists to be objective in evaluating the impact of chemicals in the soil, air and water. In short, we want to know with confidence that we can live in healthful conditions, without injury to our children, our parents, our friends or ourselves. + +Objectivity among science and medical professionals is at the very heart of our faith in the food we eat, the water we drink, the air we breathe and the medicines we take. + +In business, too, we want objectivity. We want applicants for bank loans to be considered objectively, based on valid criteria about collateral and borrowers’ capacity to repay debt — not on biases about race and ethnicity. The same goes for credit cards, where access to the consumer marketplace should rest on objective standards and not on prejudices or flawed assumptions about who qualifies as a good risk and who does not. + +The concept of objectivity in all these fields gets no argument from journalists. We accept it, embrace it, insist on it. Journalists investigate when we find it missing, particularly when it leads to acts of injustice. + +And today — in an era of misinformation, disinformation and crackpot conspiracy theories that poison our politics and threaten the public health — we rightly ask leaders of all sorts to face up to “objective reality,” or what we commonly call truth. + +Of course, objectivity is not always achieved. Judges, police and prosecutors don’t always act without bias. Scientists sometimes succumb to wishful thinking or manipulate data in a dishonest pursuit of professional glory. In business, bias has inflicted profound, enduring damage on marginalized communities by barring full participation in the economy. + +But failure to achieve standards does not obviate the need for them. It does not render them outmoded. It makes them more necessary. And it requires that we apply them more consistently and enforce them more firmly. + +Most in the public, in my experience, expect my profession to be objective, too. Dismissing their expectations — outright defying them — is an act of arrogance. It excuses our biases. It enshrines them. And, most importantly, it fails the cause of truth. + +Increasingly now, journalists — particularly a rising generation — are repudiating the standard to which we routinely, and resolutely, hold others. + +These critics of objectivity among journalism professionals, encouraged and enabled by many in the academic world, are convinced that journalism has failed on multiple fronts and that objectivity is at the root of the problem. + +Various arguments are made: + +First, that no one can be truly objective — that we all have opinions. Why not admit them? Why hide them? We’re not being honest if we do. + +Second, that true objectivity is unattainable. Our views shape every choice we make in practicing journalism — from the stories we select to pursue, to the people we interview, to the questions we ask, to the ways we write stories. So, if genuine objectivity is beyond reach, the argument goes, let’s not pretend we’re practicing it and let’s not even try. + +Third, that objectivity is just another word for false balance, false equivalence, neutrality, both-sidesism and “on the one hand, on the other hand” journalism. According to this argument, objectivity is nothing more than an effort to insulate ourselves from partisan criticism: When the evidence points overwhelmingly in one direction, we deceitfully suggest otherwise. + +Ultimately, critics consider the idea of objectivity antithetical to our mission overall: The standard is a straitjacket, the argument goes. We can’t tell it like it is. The practical effect is to misinform. Moral values are stripped from our work. The truth gets buried. + +Many journalists have concluded that our profession has failed miserably to fulfill its responsibilities at a perilous moment in history. Their evidence is that Donald Trump got elected in the first place, despite his lies, nativism, brutishness and racist and misogynistic language; that Donald Trump still maintains a strong grip on Republican politicians and so much of the American public; and that so many American voters refuse to accept basic facts, that they reject reason and logic and evidence, and get swept up in outlandish conspiratorial thinking. + +Had we not been constrained by standards like objectivity, critics believe, we would have been more faithful to our profession’s truth-telling mission. American politics might be different. People could better sift truth from lie. + +There is also the view that we have never actually been reliable truth-tellers. That what we call “objective” is, in fact, *subjective*. + +Objectivity’s detractors note, with merit, that American media have been dominated by White males. Historically, the experiences of women, people of color and other marginalized populations have not been adequately told — or told at all. What White males consider objective reality isn’t that at all, they say. It’s really nothing more, in their view, than the world seen from the White male perspective. + +That’s the criticism. So, where did this idea of objectivity come from? And how did it become a journalistic standard in the first place? The origins are a bit murky, but they are typically traced to about a century ago. + +In 1920, Walter Lippmann, a renowned American journalist, published “Liberty and the News.” He was one of the most influential advocates for the idea of “objectivity” in journalism. In that brief collection of essays, he sought to advance the concept. + +For context, here is what he had to say about his own era. It should have a familiar ring. + +“There is everywhere an increasingly angry disillusionment about the press, a growing sense of being baffled and misled.” He saw an onslaught of news that comes “helter-skelter, in inconceivable confusion” and a public “protected by no rules of evidence.” + +He feared an environment where people, as he [put it](https://cdn.theatlantic.com/media/archives/1919/11/124-5/132353920.pdf), “cease to respond to truths, and respond simply to opinions … what somebody asserts, not what actually is.” + +“The cardinal fact,” he said, “is the loss of contact with objective information.” And he worried that people “believe whatever fits most comfortably with their prepossessions.” + +His diagnosis was much like what causes us so much worry today: Democratic institutions were threatened. He saw journalism as essential to democracy. But to properly serve its purpose, journalism — in his view — needed standards. + +“Without protection against propaganda,” he wrote, “without standards of evidence, without criteria of emphasis, the living substance of all popular decision is exposed to every prejudice and to infinite exploitation. … There can be no liberty for a community which lacks the information by which to detect lies.” + +Lippmann was seeking a means for countering the propaganda of his time. He well understood the tools for manipulating public opinion. He himself participated in the propaganda machine of the Woodrow Wilson administration. He saw how propaganda of the early 20th century carried the world into the slaughter of World War I, and how public sentiment could be influenced and exploited through calculated effort. And he called this propaganda emanating from government the “manufacture of consent.” + +[ + +Leonard Downie Jr. + +--- + +counterpointNewsrooms that move beyond ‘objectivity’ can build trust + + + +](https://www.washingtonpost.com/opinions/2023/01/30/newsrooms-news-reporting-objectivity-diversity/?itid=cn) + +Lippmann recognized that we all have our preconceptions. But he wrote that “we shall accomplish more by fighting for truth than by fighting for our theories.” And so he called for as “impartial an investigation of the facts as is humanly possible.” Which is where the idea of objectivity came in: as impartial an investigation of the facts as is humanly possible. + +Our job as journalists, as he saw it, was to determine the facts and place them in context. The goal should be to have our work be as scientific as we could make it. Our research would be conscientious and careful. We would be guided by what the evidence showed. That meant we had to be generous listeners and eager learners, especially conscious of our own suppositions, prejudices, preexisting opinions and limited knowledge. + +So, when I defend objectivity, I am defending it as it was originally defined and defending what it really means. The true meaning of objectivity is not the straw man that is routinely erected by critics so that they can then tear it down. + +Objectivity is not neutrality. It is not on-the-one-hand, on-the-other-hand journalism. It is not false balance or both-sidesism. It is not giving equal weight to opposing arguments when the evidence points overwhelmingly in one direction. It does not suggest that we as journalists should engage in meticulous, thorough research only to surrender to cowardice by failing to report the facts we’ve worked so hard to discover. + +The goal is not to avoid criticism, pander to partisans or appease the public. The aim is not to win affection from readers and viewers. It does not require us to fall back on euphemisms when we should be speaking plainly. It does not mean we as a profession labor without moral conviction about right and wrong. + +Nor was the principle of objectivity “meant to imply that journalists were free of bias,” as Tom Rosenstiel, a professor of journalism at the University of Maryland and former executive director of the American Press Institute, and Bill Kovach, a former top editor, wrote in their book, “The Elements of Journalism.” “Quite the contrary,” [they noted](https://www.americanpressinstitute.org/journalism-essentials/bias-objectivity/lost-meaning-objectivity/). The term arose “out of a growing recognition that journalists were *full* of bias, often unconsciously. Objectivity called for journalists to develop a consistent method of testing information — a transparent approach to evidence — precisely so that personal and cultural biases would not undermine the accuracy of their work.” + +As Rosenstiel and Kovach pointed out, “*the method* is objective, not the journalist,” and “the key was in the *discipline* of the craft.” + +The idea is to be open-minded when we begin our research and to do that work as conscientiously as possible. It demands a willingness to listen, an eagerness to learn — and an awareness that there is much for us to know. + +We don’t start with the answers. We go seeking them, first with the already formidable challenge of asking the right questions and finally with the arduous task of verification. + +It’s not that we know nothing when we embark on our reporting. It is that we don’t know everything. And typically we don’t know much, or perhaps even most, of what we should. And what we think we know may not be right or may be missing important pieces. And so we set out to learn what we do not know or do not fully understand. + +I call that reporting. If that’s not what we mean by genuine reporting, what exactly do we mean? + +I believe our profession would benefit from listening more *to* the public and from talking less *at* the public, as if we knew it all. I believe we should be more impressed with what we don’t know than with what we know — or think we know. In journalism, we could use more humility — and less hubris. + +We of course want journalists to bring their life experiences to their jobs. The collective life experiences of all of us in a newsroom are an invaluable resource of ideas and perspectives. But every individual’s life experience is, inescapably, narrow. Life experience can inform us. But, let’s be honest, it can also limit us. There is an immense universe beyond the lives we ourselves have lived. And if there are constraints on our ability to understand a world beyond our own, we as journalists should strive to overcome them. + +I made a statement in my retirement note to staff in early 2021 that reflects my belief: “We start with more questions than answers, inclined more to curiosity and inquiry than to certitude. We always have more to learn.” + +This gets at a point that my longtime friend and competitor, Dean Baquet, then executive editor of the New York Times, eloquently articulated in a speech in 2021. I wholeheartedly embrace his perspective. + +Dean said: “My theory, secretly shared by many editors I know and respect, is that one of the major crises in our profession is the erosion of the primacy of reporting.” + +“There is not enough talk about the beauty of open-minded and empathetic reporting and the fear that its value will fade in an era where hot takes, quick analysis and riffs are held in such high esteem. …” + +“Certainty,” Dean said, “is one of the enemies of great reporting.” And he called upon reporting to be “restored to the center.” + +Dean quoted Jason DeParle, the New York Times’s superb reporter on poverty in America: “The great lesson of reporting,” Jason said, “is that the world is almost always more complicated and unlikely than it seems while sitting at your desk.” + +None of these statements argues for false balance. They argue for genuine understanding of all people and perspectives and a receptivity to learning unfamiliar facts. + +None argue for ignoring or soft-pedaling the revelations of our reporting. They are arguments for exhaustively thorough and open-minded research. + +None of them are arguments against moral values in our work. Of course, we as a profession must have a moral core, and it begins with valuing truth, equal and fair treatment of all people, giving voice to the voiceless and the vulnerable, countering hate and violence, safeguarding freedom of expression and democratic values, and rejecting abuses of power. + +All of them, however, suggest we avoid self-appointment as moral authorities. All are arguments against stories that are precooked before a lick of research is conducted, where source selection is an exercise in confirmation bias and where comment is sought (often at the last minute) only because it’s required and not as an essential ingredient of honest inquiry. + +All argue against a madcap rush to social media soapboxes with spur-of-the-moment feelings or irrepressible snark and virtue signaling. + +All of them are arguments for acknowledging our limitations — for simultaneously opening the aperture of journalism and going deeper. That is the simple demand of objectivity and what, to me, is its unarguable point. + +To those today who say that the media needs to be explicitly pro-democracy, I would say this: Every newspaper I’ve ever worked for always has been. They have been vigorously protecting democracy for decades. How is it possible that you failed to notice? + +One of the ways those news organizations protected democracy was by holding government and other powerful interests accountable. + +When The Washington Post broke open the Watergate scandal in the early 1970s, President Richard Nixon, along with his aides and allies, portrayed The Post’s journalists as liars and political opponents. In the end, their reporting was vindicated, and ultimately the Nixon administration was held to account for abuse of power, criminal behavior and obstruction of justice. + +When the New York Times first published the Pentagon Papers, the secret official history of the Vietnam War, it was accused of treason and threatened with criminal prosecution on the grounds that it had revealed classified information. So was The Washington Post, which began publishing the Pentagon Papers shortly afterward. But what was the government really trying to conceal from the public? How it had deceived American citizens about the war and its progress. The Times and The Post stood their ground on behalf of informing the American public. + +When the Boston Globe in 2002 exposed a decades-long coverup of sexual abuse by clergy in the Catholic Church, we were taking on what was then the most powerful institution in New England. There was every chance that the large Catholic population of the region would react by canceling subscriptions. But we did our work anyway, exposing how the Church had betrayed parishioners and its own principles. The repercussions continue today — within dioceses throughout the world and within the Vatican itself. + +Today, the question is commonly asked: Was the media, in adhering to traditional standards, up to the task of covering a government led by Donald Trump, with his pattern of mendacity and anti-democratic impulses? + +And yet virtually everything the public knows about his lies and his abuse of power is because of the work of mainstream news organizations. + +There is no profession without flaws. There is not one that always fulfills its highest ideals. Journalism is by no means an exception. We have often failed, embarrassingly and egregiously. We often did harm: Through errors of commission and errors of omission. Because of haste and neglect. Because of prejudice and arrogance. + +But our failures were not ones of principle. They were failures to live up to principle. + +We can — and should — have a vigorous debate about how a democracy and the press can serve the public better. But the answer to our failures as a society and as a profession is not to renounce principles and standards. There is far too much of that taking place in today’s America. The answer is to restate our principles, reinforce them, recommit to them and do a better job of fulfilling them. + +  +  + +--- +`$= dv.el('center', 'Source: ' + dv.current().Link + ', ' + dv.current().Date.toLocaleString("fr-FR"))` \ No newline at end of file diff --git a/01.02 Home/@Shopping list.md b/01.02 Home/@Shopping list.md index bca6542c..3436f3ce 100644 --- a/01.02 Home/@Shopping list.md +++ b/01.02 Home/@Shopping list.md @@ -72,7 +72,7 @@ style: number - [x] ☕ Coffee ✅ 2022-03-01 - [x] 🍶 Coke 0 ✅ 2022-03-14 - [x] 🧃 Apfelschorle ✅ 2022-12-21 -- [x] 🍊 Morning juice ✅ 2023-03-18 +- [ ] 🍊 Morning juice - [x] 🍺 Beer ✅ 2022-02-06   @@ -86,7 +86,7 @@ style: number #### Dairy -- [x] 🧈 Beurre ✅ 2023-03-18 +- [ ] 🧈 Beurre - [x] 🧀 Fromage à servir ✅ 2023-03-06 - [x] 🧀 Fromage rapé ✅ 2023-03-06 - [x] 🧀 Parmeggiano ✅ 2023-03-06 @@ -102,7 +102,7 @@ style: number #### Breakfast - [x] 🥯 Bread ✅ 2023-03-11 -- [x] 🍯 Honey/Jam ✅ 2023-03-18 +- [ ] 🍯 Honey/Jam - [x] 🍫 Nutella ✅ 2022-02-15 - [x] 🥚 Eggs ✅ 2023-03-11 diff --git a/01.02 Home/Household.md b/01.02 Home/Household.md index 49ad3a36..a895459d 100644 --- a/01.02 Home/Household.md +++ b/01.02 Home/Household.md @@ -79,7 +79,8 @@ style: number - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-02-28 ✅ 2023-02-27 - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-02-14 ✅ 2023-02-13 - [x] ♻ [[Household]]: *Paper* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-01-31 ✅ 2023-01-30 -- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-04 +- [ ] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-18 +- [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-04-04 ✅ 2023-04-03 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-03-21 ✅ 2023-03-21 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-03-07 ✅ 2023-03-06 - [x] ♻ [[Household]]: *Cardboard* recycling collection %%done_del%% 🔁 every 2 weeks on Tuesday 📅 2023-02-21 ✅ 2023-02-20 @@ -95,7 +96,8 @@ style: number - [ ] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2023-04-03 📅 2023-04-29 - [x] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2023-02-27 📅 2023-03-25 ✅ 2023-03-21 - [x] 🛎 🛍 REMINDER [[Household]]: Monthly shop in France %%done_del%% 🔁 every month on the last Saturday 🛫 2023-01-30 📅 2023-02-25 ✅ 2023-02-20 -- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-04-03 +- [ ] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-04-10 +- [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-04-03 ✅ 2023-04-03 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-03-27 ✅ 2023-03-25 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-03-20 ✅ 2023-03-20 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-03-13 ✅ 2023-03-10 @@ -104,7 +106,8 @@ style: number - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-02-20 ✅ 2023-02-20 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-02-13 ✅ 2023-02-12 - [x] 🛎 🧻 REMINDER [[Household]]: check need for toilet paper %%done_del%% 🔁 every week 📅 2023-02-06 ✅ 2023-02-04 -- [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-04-01 +- [ ] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-04-15 +- [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-04-01 ✅ 2023-04-03 - [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-03-18 ✅ 2023-03-18 - [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-03-04 ✅ 2023-03-01 - [x] :bed: [[Household]] Change bedsheets %%done_del%% 🔁 every 2 weeks on Saturday 📅 2023-02-18 ✅ 2023-02-17 diff --git a/03.04 Cinematheque/Thank You for Smoking (2005).md b/03.04 Cinematheque/Thank You for Smoking (2005).md new file mode 100644 index 00000000..945b370c --- /dev/null +++ b/03.04 Cinematheque/Thank You for Smoking (2005).md @@ -0,0 +1,97 @@ +--- +type: "movie" +subType: null +title: "Thank You for Smoking" +englishTitle: "Thank You for Smoking" +year: "2005" +dataSource: "OMDbAPI" +url: "https://www.imdb.com/title/tt0427944/" +id: "tt0427944" +genres: + - "Comedy" + - "Drama" +producer: "Jason Reitman" +duration: "92 min" +onlineRating: 7.5 +actors: + - "Aaron Eckhart" + - "Cameron Bright" + - "Maria Bello" +image: "https://m.media-amazon.com/images/M/MV5BMTI2MDk5MjE4NV5BMl5BanBnXkFtZTYwMjkwNTU3._V1_SX300.jpg" +released: true +streamingServices: +premiere: "14/04/2006" +watched: true +lastWatched: "[[2023-04-03]]" +personalRating: 7 +CollapseMetaTable: true + +--- + +Parent:: [[@Cinematheque]] + +--- + +```dataviewjs +dv.paragraph(`> [!${dv.current().watched ? 'SUCCESS' : 'WARNING'}] ${dv.current().watched ? 'last watched on ' + dv.current().lastWatched : 'not yet watched'}`) +``` + +  + +# `$= dv.current().title` + +  + +`$= dv.current().watched ? '**Rating**: ' + dv.current().personalRating + ' out of 10' : ''` + +```toc +``` + +  + +### Details + +  + +**Genres**: +`$= dv.current().genres.length === 0 ? ' - none' : dv.list(dv.current().genres)` + +`$= !dv.current().released ? '**Not released** The movie is not yet released.' : ''` + +  + +```dataview +list without id + "" + + + "" ++ + "" + + + "" + + + "" + + + "" + + + "" + + + "" + + + "" + + + "
Type" + this.type + "
Online Rating" + this.onlineRating + "
Duration" + this.duration + "
Premiered" + this.premiere + "
Producer" + this.producer + "
" +FROM "03.04 Cinematheque/Thank You for Smoking (2005)" +``` + +  + +--- + +  + +### Poster + +  + +`$= '![Image|360](' + dv.current().image + ')'` \ No newline at end of file diff --git a/03.04 Cinematheque/The Guard (2011).md b/03.04 Cinematheque/The Guard (2011).md new file mode 100644 index 00000000..e1291441 --- /dev/null +++ b/03.04 Cinematheque/The Guard (2011).md @@ -0,0 +1,98 @@ +--- +type: "movie" +subType: null +title: "The Guard" +englishTitle: "The Guard" +year: "2011" +dataSource: "OMDbAPI" +url: "https://www.imdb.com/title/tt1540133/" +id: "tt1540133" +genres: + - "Comedy" + - "Crime" + - "Thriller" +producer: "John Michael McDonagh" +duration: "96 min" +onlineRating: 7.3 +actors: + - "Brendan Gleeson" + - "Don Cheadle" + - "Mark Strong" +image: "https://m.media-amazon.com/images/M/MV5BMTY2ODkzMDgwM15BMl5BanBnXkFtZTcwMDA1Mjg1OA@@._V1_SX300.jpg" +released: true +streamingServices: +premiere: "07/07/2011" +watched: true +lastWatched: "[[2023-04-06]]" +personalRating: 7 +CollapseMetaTable: true + +--- + +Parent:: [[@Cinematheque]] + +--- + +```dataviewjs +dv.paragraph(`> [!${dv.current().watched ? 'SUCCESS' : 'WARNING'}] ${dv.current().watched ? 'last watched on ' + dv.current().lastWatched : 'not yet watched'}`) +``` + +  + +# `$= dv.current().title` + +  + +`$= dv.current().watched ? '**Rating**: ' + dv.current().personalRating + ' out of 10' : ''` + +```toc +``` + +  + +### Details + +  + +**Genres**: +`$= dv.current().genres.length === 0 ? ' - none' : dv.list(dv.current().genres)` + +`$= !dv.current().released ? '**Not released** The movie is not yet released.' : ''` + +  + +```dataview +list without id + "" + + + "" ++ + "" + + + "" + + + "" + + + "" + + + "" + + + "" + + + "" + + + "
Type" + this.type + "
Online Rating" + this.onlineRating + "
Duration" + this.duration + "
Premiered" + this.premiere + "
Producer" + this.producer + "
" +FROM "03.04 Cinematheque/The Guard (2011)" +``` + +  + +--- + +  + +### Poster + +  + +`$= '![Image|360](' + dv.current().image + ')'` \ No newline at end of file diff --git a/04.01 lebv.org/Hosting Tasks.md b/04.01 lebv.org/Hosting Tasks.md index 86c738e8..23274615 100644 --- a/04.01 lebv.org/Hosting Tasks.md +++ b/04.01 lebv.org/Hosting Tasks.md @@ -69,8 +69,10 @@ Tasks and potential enhancements for the webhosting of lebv.org - [x] [[Hosting Tasks|Hosting]]: Explore the possibility to [[Hosting Tasks#Self-hosting|self-host]] ✅ 2021-09-16 - [ ] :fleur_de_lis: [[Hosting Tasks|Hosting]]: Explore the possibility of webhosting through [[Hosting Tasks#Decentralised hosting|decentralised services]] (Blockchain) 📅 2023-12-31 -- [ ] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#Backup procedure|backup]] the DB & Files %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-04-05 -- [ ] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#PHP versioning|Check the php version]] of the website %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-04-05 +- [ ] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#Backup procedure|backup]] the DB & Files %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-07-05 +- [x] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#Backup procedure|backup]] the DB & Files %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-04-05 ✅ 2023-04-06 +- [ ] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#PHP versioning|Check the php version]] of the website %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-07-05 +- [x] :fleur_de_lis: [[Hosting Tasks|Hosting]]: [[Hosting Tasks#PHP versioning|Check the php version]] of the website %%done_del%% 🔁 every 3 months on the 1st Wednesday 📅 2023-04-05 ✅ 2023-04-06   diff --git a/05.01 Computer setup/Storage and Syncing.md b/05.01 Computer setup/Storage and Syncing.md index a6f57b0f..53d26bdb 100644 --- a/05.01 Computer setup/Storage and Syncing.md +++ b/05.01 Computer setup/Storage and Syncing.md @@ -172,26 +172,12 @@ For Obsidian in particular [GitHub](https://github.com) is used in coordination The following Apps require a manual backup: -- [ ] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Standard Notes (PC) %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-04-07 -- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Standard Notes (PC) %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-01-06 ✅ 2023-01-03 -- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Standard Notes (PC) %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2022-10-07 ✅ 2022-10-06 -- [ ] Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%% 🔁 every 3 months on the 1st Thursday 📅 2023-04-06 -- [x] Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%% 🔁 every 3 months on the 1st Thursday 📅 2023-01-05 ✅ 2023-01-03 -- [x] Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%% 🔁 every 3 months on the 1st Thursday 📅 2022-10-06 ✅ 2022-10-03 +- [ ] Backup [[Storage and Syncing#Instructions for Anchor|Anchor Wallet]] %%done_del%% 🔁 every 3 months on the 1st Thursday 📅 2023-07-06 - [ ] :iphone: Backup [[Storage and Syncing#Instructions for iPhone|iPhone]] %%done_del%% 🔁 every 3 months on the 2nd Tuesday 📅 2023-04-11 -- [x] :iphone: Backup [[Storage and Syncing#Instructions for iPhone|iPhone]] %%done_del%% 🔁 every 3 months on the 2nd Tuesday 📅 2023-01-10 ✅ 2023-01-06 -- [x] :iphone: Backup [[Storage and Syncing#Instructions for iPhone|iPhone]] %%done_del%% 🔁 every 3 months on the 2nd Tuesday 📅 2022-10-11 ✅ 2022-10-11 -- [ ] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-04-07 -- [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-01-06 ✅ 2023-01-04 -- [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2022-10-07 ✅ 2022-10-06 +- [ ] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-07-07 +- [x] :floppy_disk: Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] %%done_del%% 🔁 every 3 months on the 1st Friday 📅 2023-04-07 ✅ 2023-04-06 - [ ] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-06-12 -- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2023-03-13 ✅ 2023-03-14 -- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2022-12-12 ✅ 2022-12-13 -- [x] :cloud: [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] %%done_del%% 🔁 every 3 months on the 2nd Monday 📅 2022-09-12 ✅ 2022-09-13 - [ ] :camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%% 🔁 every 3 months on the 2nd Thursday 📅 2023-04-13 -- [x] :camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%% 🔁 every 3 months on the 2nd Thursday 📅 2023-01-12 ✅ 2023-01-06 -- [x] :camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%% 🔁 every 3 months on the 2nd Thursday 📅 2022-10-14 ✅ 2022-10-14 -- [x] :camera: [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED %%done_del%% 🔁 every 3 months on the 2nd Thursday 📅 2022-10-13 ✅ 2022-10-13   diff --git a/05.02 Networks/Configuring UFW.md b/05.02 Networks/Configuring UFW.md index dd2228a6..5b4afeb6 100644 --- a/05.02 Networks/Configuring UFW.md +++ b/05.02 Networks/Configuring UFW.md @@ -237,7 +237,8 @@ sudo bash /etc/addip4ban/addip4ban.sh #### Ban List Tasks -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-01 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-08 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-04-01 ✅ 2023-04-03 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-03-25 ✅ 2023-03-25 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-03-18 ✅ 2023-03-18 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-03-11 ✅ 2023-03-10 @@ -246,7 +247,8 @@ sudo bash /etc/addip4ban/addip4ban.sh - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-18 ✅ 2023-02-17 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-11 ✅ 2023-02-11 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix %%done_del%% 🔁 every week on Saturday 📅 2023-02-04 ✅ 2023-02-04 -- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-01 +- [ ] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-08 +- [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-04-01 ✅ 2023-04-03 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-03-25 ✅ 2023-03-25 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-03-18 ✅ 2023-03-18 - [x] 🖥 [[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list %%done_del%% 🔁 every month on Saturday 📅 2023-03-11 ✅ 2023-03-10 diff --git a/05.02 Networks/Server Alias.md b/05.02 Networks/Server Alias.md index 3971fb8b..aa2b8201 100644 --- a/05.02 Networks/Server Alias.md +++ b/05.02 Networks/Server Alias.md @@ -15,7 +15,7 @@ Characteristics: OS: Ubuntu 20.04 Domiciliation: NL Host: Hostigger - IPv4: 5.181.166.123 + IPv4: 141.98.119.142 Hostname: 1630136610 SubDomain: emailalias Disk: diff --git a/05.02 Networks/Server Tools.md b/05.02 Networks/Server Tools.md index 3bb26685..52703ad8 100644 --- a/05.02 Networks/Server Tools.md +++ b/05.02 Networks/Server Tools.md @@ -574,7 +574,8 @@ List of monitored services:   -- [ ] :hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-04-04 📅 2023-04-04 +- [ ] :hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-10-03 📅 2023-10-03 +- [x] :hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-04-04 📅 2023-04-04 ✅ 2023-04-03 - [x] :hammer_and_wrench: [[Server Tools]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2022-10-04 📅 2022-10-04 ✅ 2022-10-03 - [x] [[Server Tools]]: Backup server 🔁 every 6 months on the 1st Tuesday ⏳ 2022-04-12 📅 2022-04-12 ✅ 2022-04-11 - [x] [[Server Tools]]: Backup server 🔁 every 6 months on the 1st Tuesday 📅 2021-10-14 ✅ 2022-01-08 diff --git a/05.02 Networks/Server VPN.md b/05.02 Networks/Server VPN.md index 31a67a02..9931ffa3 100644 --- a/05.02 Networks/Server VPN.md +++ b/05.02 Networks/Server VPN.md @@ -283,7 +283,8 @@ Everything is rather self-explanatory.   -- [ ] :shield: [[Server VPN]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-04-04 📅 2023-04-04 +- [ ] :shield: [[Server VPN]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-10-03 📅 2023-10-03 +- [x] :shield: [[Server VPN]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2023-04-04 📅 2023-04-04 ✅ 2023-04-03 - [x] :shield: [[Server VPN]]: Backup server %%done_del%% 🔁 every 6 months on the 1st Tuesday ⏳ 2022-10-04 📅 2022-10-04 ✅ 2022-10-03 - [x] [[Server VPN]]: Backup server 🔁 every 6 months on the 1st Tuesday ⏳ 2022-04-12 📅 2022-04-12 ✅ 2022-04-11 - [x] [[Server VPN]]: Backup server 🔁 every 6 months on the 1st Tuesday 📅 2021-10-14 ✅ 2022-01-08 diff --git a/06.01 Finances/2023.ledger b/06.01 Finances/2023.ledger index 1d511781..b3232904 100644 --- a/06.01 Finances/2023.ledger +++ b/06.01 Finances/2023.ledger @@ -744,4 +744,36 @@ alias f=expenses:Food 2023/04/02 Petrol expenses:Travels:EUR €52.45 - liability:CreditCard:CHF \ No newline at end of file + liability:CreditCard:CHF + +2023/04/03 Migros + expenses:Food:CHF CHF7.10 + assets:Cash:CHF + +2023/04/02 Uber eats + expenses:Food:CHF CHF50.20 + liability:CreditCard:CHF + +2023/04/02 SBB + expenses:Travels:CHF CHF6.80 + assets:Cash:CHF + +2023/04/03 Migros + expenses:Food:CHF CHF22.20 + assets:Cash:CHF + +2023/04/03 Fine - speeding + expenses:Car:CHF CHF60.00 + assets:Cash:CHF + +2023/04/03 Dr Cleo Morales + expenses:Health:CHF CHF155.00 + assets:Cash:CHF + +2023/04/04 Migros + expenses:Food:CHF CHF2.25 + assets:Cash:CHF + +2023/04/04 Diner Papa + expenses:Food:EUR €98.50 + assets:Cash:CHF \ No newline at end of file diff --git a/06.02 Investments/Crypto Tasks.md b/06.02 Investments/Crypto Tasks.md index 19c2919e..28b707d0 100644 --- a/06.02 Investments/Crypto Tasks.md +++ b/06.02 Investments/Crypto Tasks.md @@ -70,7 +70,8 @@ All tasks and to-dos Crypto-related.   %%- [ ] 💰[[Crypto Tasks#internet alerts|monitor Crypto news and publications]] %%done_del%% 🔁 every week on Friday 📅 2022-12-16%% -- [ ] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-04-04 +- [ ] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-05-02 +- [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-04-04 ✅ 2023-04-03 - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-03-07 ✅ 2023-03-07 - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-02-07 ✅ 2023-02-06 - [x] :ballot_box: [[Crypto Tasks]]: Vote for [[EOS]] block producers %%done_del%% 🔁 every month on the 1st Tuesday 📅 2023-01-03 ✅ 2023-01-03