/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ "use strict"; 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 __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 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); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/common.js var require_common = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/common.js"(exports, module2) { "use strict"; function isNothing(subject) { return typeof subject === "undefined" || subject === null; } function isObject(subject) { return typeof subject === "object" && subject !== null; } function toArray(sequence) { if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return []; return [sequence]; } function extend(target, source) { var index, length, key, sourceKeys; if (source) { sourceKeys = Object.keys(source); for (index = 0, length = sourceKeys.length; index < length; index += 1) { key = sourceKeys[index]; target[key] = source[key]; } } return target; } function repeat(string, count) { var result = "", cycle; for (cycle = 0; cycle < count; cycle += 1) { result += string; } return result; } function isNegativeZero(number) { return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; } module2.exports.isNothing = isNothing; module2.exports.isObject = isObject; module2.exports.toArray = toArray; module2.exports.repeat = repeat; module2.exports.isNegativeZero = isNegativeZero; module2.exports.extend = extend; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/exception.js var require_exception = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/exception.js"(exports, module2) { "use strict"; function YAMLException(reason, mark) { Error.call(this); this.name = "YAMLException"; this.reason = reason; this.mark = mark; this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : ""); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { this.stack = new Error().stack || ""; } } YAMLException.prototype = Object.create(Error.prototype); YAMLException.prototype.constructor = YAMLException; YAMLException.prototype.toString = function toString(compact) { var result = this.name + ": "; result += this.reason || "(unknown reason)"; if (!compact && this.mark) { result += " " + this.mark.toString(); } return result; }; module2.exports = YAMLException; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/mark.js var require_mark = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/mark.js"(exports, module2) { "use strict"; var common = require_common(); function Mark(name, buffer, position, line, column) { this.name = name; this.buffer = buffer; this.position = position; this.line = line; this.column = column; } Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; head = ""; start = this.position; while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > maxLength / 2 - 1) { head = " ... "; start += 5; break; } } tail = ""; end = this.position; while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > maxLength / 2 - 1) { tail = " ... "; end -= 5; break; } } snippet = this.buffer.slice(start, end); return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^"; }; Mark.prototype.toString = function toString(compact) { var snippet, where = ""; if (this.name) { where += 'in "' + this.name + '" '; } where += "at line " + (this.line + 1) + ", column " + (this.column + 1); if (!compact) { snippet = this.getSnippet(); if (snippet) { where += ":\n" + snippet; } } return where; }; module2.exports = Mark; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type.js var require_type = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type.js"(exports, module2) { "use strict"; var YAMLException = require_exception(); var TYPE_CONSTRUCTOR_OPTIONS = [ "kind", "resolve", "construct", "instanceOf", "predicate", "represent", "defaultStyle", "styleAliases" ]; var YAML_NODE_KINDS = [ "scalar", "sequence", "mapping" ]; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function(style) { map[style].forEach(function(alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function(name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); this.tag = tag; this.kind = options["kind"] || null; this.resolve = options["resolve"] || function() { return true; }; this.construct = options["construct"] || function(data) { return data; }; this.instanceOf = options["instanceOf"] || null; this.predicate = options["predicate"] || null; this.represent = options["represent"] || null; this.defaultStyle = options["defaultStyle"] || null; this.styleAliases = compileStyleAliases(options["styleAliases"] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module2.exports = Type; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema.js var require_schema = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema.js"(exports, module2) { "use strict"; var common = require_common(); var YAMLException = require_exception(); var Type = require_type(); function compileList(schema, name, result) { var exclude = []; schema.include.forEach(function(includedSchema) { result = compileList(includedSchema, name, result); }); schema[name].forEach(function(currentType) { result.forEach(function(previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { exclude.push(previousIndex); } }); result.push(currentType); }); return result.filter(function(type, index) { return exclude.indexOf(index) === -1; }); } function compileMap() { var result = { scalar: {}, sequence: {}, mapping: {}, fallback: {} }, index, length; function collectType(type) { result[type.kind][type.tag] = result["fallback"][type.tag] = type; } for (index = 0, length = arguments.length; index < length; index += 1) { arguments[index].forEach(collectType); } return result; } function Schema(definition) { this.include = definition.include || []; this.implicit = definition.implicit || []; this.explicit = definition.explicit || []; this.implicit.forEach(function(type) { if (type.loadKind && type.loadKind !== "scalar") { throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); } }); this.compiledImplicit = compileList(this, "implicit", []); this.compiledExplicit = compileList(this, "explicit", []); this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); } Schema.DEFAULT = null; Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { case 1: schemas = Schema.DEFAULT; types = arguments[0]; break; case 2: schemas = arguments[0]; types = arguments[1]; break; default: throw new YAMLException("Wrong number of arguments for Schema.create function"); } schemas = common.toArray(schemas); types = common.toArray(types); if (!schemas.every(function(schema) { return schema instanceof Schema; })) { throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object."); } if (!types.every(function(type) { return type instanceof Type; })) { throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object."); } return new Schema({ include: schemas, explicit: types }); }; module2.exports = Schema; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/str.js var require_str = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports, module2) { "use strict"; var Type = require_type(); module2.exports = new Type("tag:yaml.org,2002:str", { kind: "scalar", construct: function(data) { return data !== null ? data : ""; } }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js var require_seq = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports, module2) { "use strict"; var Type = require_type(); module2.exports = new Type("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(data) { return data !== null ? data : []; } }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/map.js var require_map = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports, module2) { "use strict"; var Type = require_type(); module2.exports = new Type("tag:yaml.org,2002:map", { kind: "mapping", construct: function(data) { return data !== null ? data : {}; } }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js var require_failsafe = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports, module2) { "use strict"; var Schema = require_schema(); module2.exports = new Schema({ explicit: [ require_str(), require_seq(), require_map() ] }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/null.js var require_null = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports, module2) { "use strict"; var Type = require_type(); function resolveYamlNull(data) { if (data === null) return true; var max2 = data.length; return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); } function constructYamlNull() { return null; } function isNull(object) { return object === null; } module2.exports = new Type("tag:yaml.org,2002:null", { kind: "scalar", resolve: resolveYamlNull, construct: constructYamlNull, predicate: isNull, represent: { canonical: function() { return "~"; }, lowercase: function() { return "null"; }, uppercase: function() { return "NULL"; }, camelcase: function() { return "Null"; } }, defaultStyle: "lowercase" }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js var require_bool = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports, module2) { "use strict"; var Type = require_type(); function resolveYamlBoolean(data) { if (data === null) return false; var max2 = data.length; return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); } function constructYamlBoolean(data) { return data === "true" || data === "True" || data === "TRUE"; } function isBoolean(object) { return Object.prototype.toString.call(object) === "[object Boolean]"; } module2.exports = new Type("tag:yaml.org,2002:bool", { kind: "scalar", resolve: resolveYamlBoolean, construct: constructYamlBoolean, predicate: isBoolean, represent: { lowercase: function(object) { return object ? "true" : "false"; }, uppercase: function(object) { return object ? "TRUE" : "FALSE"; }, camelcase: function(object) { return object ? "True" : "False"; } }, defaultStyle: "lowercase" }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/int.js var require_int = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports, module2) { "use strict"; var common = require_common(); var Type = require_type(); function isHexCode(c) { return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102; } function isOctCode(c) { return 48 <= c && c <= 55; } function isDecCode(c) { return 48 <= c && c <= 57; } function resolveYamlInteger(data) { if (data === null) return false; var max2 = data.length, index = 0, hasDigits = false, ch; if (!max2) return false; ch = data[index]; if (ch === "-" || ch === "+") { ch = data[++index]; } if (ch === "0") { if (index + 1 === max2) return true; ch = data[++index]; if (ch === "b") { index++; for (; index < max2; index++) { ch = data[index]; if (ch === "_") continue; if (ch !== "0" && ch !== "1") return false; hasDigits = true; } return hasDigits && ch !== "_"; } if (ch === "x") { index++; for (; index < max2; index++) { ch = data[index]; if (ch === "_") continue; if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== "_"; } for (; index < max2; index++) { ch = data[index]; if (ch === "_") continue; if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== "_"; } if (ch === "_") return false; for (; index < max2; index++) { ch = data[index]; if (ch === "_") continue; if (ch === ":") break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } if (!hasDigits || ch === "_") return false; if (ch !== ":") return true; return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); } function constructYamlInteger(data) { var value = data, sign = 1, ch, base, digits = []; if (value.indexOf("_") !== -1) { value = value.replace(/_/g, ""); } ch = value[0]; if (ch === "-" || ch === "+") { if (ch === "-") sign = -1; value = value.slice(1); ch = value[0]; } if (value === "0") return 0; if (ch === "0") { if (value[1] === "b") return sign * parseInt(value.slice(2), 2); if (value[1] === "x") return sign * parseInt(value, 16); return sign * parseInt(value, 8); } if (value.indexOf(":") !== -1) { value.split(":").forEach(function(v) { digits.unshift(parseInt(v, 10)); }); value = 0; base = 1; digits.forEach(function(d) { value += d * base; base *= 60; }); return sign * value; } return sign * parseInt(value, 10); } function isInteger(object) { return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object)); } module2.exports = new Type("tag:yaml.org,2002:int", { kind: "scalar", resolve: resolveYamlInteger, construct: constructYamlInteger, predicate: isInteger, represent: { binary: function(obj) { return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); }, octal: function(obj) { return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1); }, decimal: function(obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function(obj) { return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); } }, defaultStyle: "decimal", styleAliases: { binary: [2, "bin"], octal: [8, "oct"], decimal: [10, "dec"], hexadecimal: [16, "hex"] } }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/float.js var require_float = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports, module2) { "use strict"; var common = require_common(); var Type = require_type(); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers "^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" ); function resolveYamlFloat(data) { if (data === null) return false; if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length - 1] === "_") { return false; } return true; } function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, "").toLowerCase(); sign = value[0] === "-" ? -1 : 1; digits = []; if ("+-".indexOf(value[0]) >= 0) { value = value.slice(1); } if (value === ".inf") { return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; } else if (value === ".nan") { return NaN; } else if (value.indexOf(":") >= 0) { value.split(":").forEach(function(v) { digits.unshift(parseFloat(v, 10)); }); value = 0; base = 1; digits.forEach(function(d) { value += d * base; base *= 60; }); return sign * value; } return sign * parseFloat(value, 10); } var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; function representYamlFloat(object, style) { var res; if (isNaN(object)) { switch (style) { case "lowercase": return ".nan"; case "uppercase": return ".NAN"; case "camelcase": return ".NaN"; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { case "lowercase": return ".inf"; case "uppercase": return ".INF"; case "camelcase": return ".Inf"; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { case "lowercase": return "-.inf"; case "uppercase": return "-.INF"; case "camelcase": return "-.Inf"; } } else if (common.isNegativeZero(object)) { return "-0.0"; } res = object.toString(10); return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; } function isFloat(object) { return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); } module2.exports = new Type("tag:yaml.org,2002:float", { kind: "scalar", resolve: resolveYamlFloat, construct: constructYamlFloat, predicate: isFloat, represent: representYamlFloat, defaultStyle: "lowercase" }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js var require_json = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports, module2) { "use strict"; var Schema = require_schema(); module2.exports = new Schema({ include: [ require_failsafe() ], implicit: [ require_null(), require_bool(), require_int(), require_float() ] }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js var require_core = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports, module2) { "use strict"; var Schema = require_schema(); module2.exports = new Schema({ include: [ require_json() ] }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js var require_timestamp = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports, module2) { "use strict"; var Type = require_type(); var YAML_DATE_REGEXP = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" ); var YAML_TIMESTAMP_REGEXP = new RegExp( "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" ); function resolveYamlTimestamp(data) { if (data === null) return false; if (YAML_DATE_REGEXP.exec(data) !== null) return true; if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; match = YAML_DATE_REGEXP.exec(data); if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error("Date resolve error"); year = +match[1]; month = +match[2] - 1; day = +match[3]; if (!match[4]) { return new Date(Date.UTC(year, month, day)); } hour = +match[4]; minute = +match[5]; second = +match[6]; if (match[7]) { fraction = match[7].slice(0, 3); while (fraction.length < 3) { fraction += "0"; } fraction = +fraction; } if (match[9]) { tz_hour = +match[10]; tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 6e4; if (match[9] === "-") delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); if (delta) date.setTime(date.getTime() - delta); return date; } function representYamlTimestamp(object) { return object.toISOString(); } module2.exports = new Type("tag:yaml.org,2002:timestamp", { kind: "scalar", resolve: resolveYamlTimestamp, construct: constructYamlTimestamp, instanceOf: Date, represent: representYamlTimestamp }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js var require_merge = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports, module2) { "use strict"; var Type = require_type(); function resolveYamlMerge(data) { return data === "<<" || data === null; } module2.exports = new Type("tag:yaml.org,2002:merge", { kind: "scalar", resolve: resolveYamlMerge }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js var require_binary = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports, module2) { "use strict"; var NodeBuffer; try { _require = require; NodeBuffer = _require("buffer").Buffer; } catch (__) { } var _require; var Type = require_type(); var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; function resolveYamlBinary(data) { if (data === null) return false; var code, idx, bitlen = 0, max2 = data.length, map = BASE64_MAP; for (idx = 0; idx < max2; idx++) { code = map.indexOf(data.charAt(idx)); if (code > 64) continue; if (code < 0) return false; bitlen += 6; } return bitlen % 8 === 0; } function constructYamlBinary(data) { var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map = BASE64_MAP, bits = 0, result = []; for (idx = 0; idx < max2; idx++) { if (idx % 4 === 0 && idx) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); result.push(bits & 255); } bits = bits << 6 | map.indexOf(input.charAt(idx)); } tailbits = max2 % 4 * 6; if (tailbits === 0) { result.push(bits >> 16 & 255); result.push(bits >> 8 & 255); result.push(bits & 255); } else if (tailbits === 18) { result.push(bits >> 10 & 255); result.push(bits >> 2 & 255); } else if (tailbits === 12) { result.push(bits >> 4 & 255); } if (NodeBuffer) { return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); } return result; } function representYamlBinary(object) { var result = "", bits = 0, idx, tail, max2 = object.length, map = BASE64_MAP; for (idx = 0; idx < max2; idx++) { if (idx % 3 === 0 && idx) { result += map[bits >> 18 & 63]; result += map[bits >> 12 & 63]; result += map[bits >> 6 & 63]; result += map[bits & 63]; } bits = (bits << 8) + object[idx]; } tail = max2 % 3; if (tail === 0) { result += map[bits >> 18 & 63]; result += map[bits >> 12 & 63]; result += map[bits >> 6 & 63]; result += map[bits & 63]; } else if (tail === 2) { result += map[bits >> 10 & 63]; result += map[bits >> 4 & 63]; result += map[bits << 2 & 63]; result += map[64]; } else if (tail === 1) { result += map[bits >> 2 & 63]; result += map[bits << 4 & 63]; result += map[64]; result += map[64]; } return result; } function isBinary(object) { return NodeBuffer && NodeBuffer.isBuffer(object); } module2.exports = new Type("tag:yaml.org,2002:binary", { kind: "scalar", resolve: resolveYamlBinary, construct: constructYamlBinary, predicate: isBinary, represent: representYamlBinary }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js var require_omap = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports, module2) { "use strict"; var Type = require_type(); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; pairHasKey = false; if (_toString.call(pair) !== "[object Object]") return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { if (!pairHasKey) pairHasKey = true; else return false; } } if (!pairHasKey) return false; if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); else return false; } return true; } function constructYamlOmap(data) { return data !== null ? data : []; } module2.exports = new Type("tag:yaml.org,2002:omap", { kind: "sequence", resolve: resolveYamlOmap, construct: constructYamlOmap }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js var require_pairs = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports, module2) { "use strict"; var Type = require_type(); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { if (data === null) return true; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== "[object Object]") return false; keys = Object.keys(pair); if (keys.length !== 1) return false; result[index] = [keys[0], pair[keys[0]]]; } return true; } function constructYamlPairs(data) { if (data === null) return []; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; keys = Object.keys(pair); result[index] = [keys[0], pair[keys[0]]]; } return result; } module2.exports = new Type("tag:yaml.org,2002:pairs", { kind: "sequence", resolve: resolveYamlPairs, construct: constructYamlPairs }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/set.js var require_set = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports, module2) { "use strict"; var Type = require_type(); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { if (object[key] !== null) return false; } } return true; } function constructYamlSet(data) { return data !== null ? data : {}; } module2.exports = new Type("tag:yaml.org,2002:set", { kind: "mapping", resolve: resolveYamlSet, construct: constructYamlSet }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js var require_default_safe = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports, module2) { "use strict"; var Schema = require_schema(); module2.exports = new Schema({ include: [ require_core() ], implicit: [ require_timestamp(), require_merge() ], explicit: [ require_binary(), require_omap(), require_pairs(), require_set() ] }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js var require_undefined = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports, module2) { "use strict"; var Type = require_type(); function resolveJavascriptUndefined() { return true; } function constructJavascriptUndefined() { return void 0; } function representJavascriptUndefined() { return ""; } function isUndefined(object) { return typeof object === "undefined"; } module2.exports = new Type("tag:yaml.org,2002:js/undefined", { kind: "scalar", resolve: resolveJavascriptUndefined, construct: constructJavascriptUndefined, predicate: isUndefined, represent: representJavascriptUndefined }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js var require_regexp = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports, module2) { "use strict"; var Type = require_type(); function resolveJavascriptRegExp(data) { if (data === null) return false; if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ""; if (regexp[0] === "/") { if (tail) modifiers = tail[1]; if (modifiers.length > 3) return false; if (regexp[regexp.length - modifiers.length - 1] !== "/") return false; } return true; } function constructJavascriptRegExp(data) { var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ""; if (regexp[0] === "/") { if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } return new RegExp(regexp, modifiers); } function representJavascriptRegExp(object) { var result = "/" + object.source + "/"; if (object.global) result += "g"; if (object.multiline) result += "m"; if (object.ignoreCase) result += "i"; return result; } function isRegExp(object) { return Object.prototype.toString.call(object) === "[object RegExp]"; } module2.exports = new Type("tag:yaml.org,2002:js/regexp", { kind: "scalar", resolve: resolveJavascriptRegExp, construct: constructJavascriptRegExp, predicate: isRegExp, represent: representJavascriptRegExp }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js var require_function = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports, module2) { "use strict"; var esprima; try { _require = require; esprima = _require("esprima"); } catch (_) { if (typeof window !== "undefined") esprima = window.esprima; } var _require; var Type = require_type(); function resolveJavascriptFunction(data) { if (data === null) return false; try { var source = "(" + data + ")", ast = esprima.parse(source, { range: true }); if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") { return false; } return true; } catch (err) { return false; } } function constructJavascriptFunction(data) { var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body; if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") { throw new Error("Failed to resolve function"); } ast.body[0].expression.params.forEach(function(param) { params.push(param.name); }); body = ast.body[0].expression.body.range; if (ast.body[0].expression.body.type === "BlockStatement") { return new Function(params, source.slice(body[0] + 1, body[1] - 1)); } return new Function(params, "return " + source.slice(body[0], body[1])); } function representJavascriptFunction(object) { return object.toString(); } function isFunction(object) { return Object.prototype.toString.call(object) === "[object Function]"; } module2.exports = new Type("tag:yaml.org,2002:js/function", { kind: "scalar", resolve: resolveJavascriptFunction, construct: constructJavascriptFunction, predicate: isFunction, represent: representJavascriptFunction }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js var require_default_full = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports, module2) { "use strict"; var Schema = require_schema(); module2.exports = Schema.DEFAULT = new Schema({ include: [ require_default_safe() ], explicit: [ require_undefined(), require_regexp(), require_function() ] }); } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/loader.js var require_loader = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/loader.js"(exports, module2) { "use strict"; var common = require_common(); var YAMLException = require_exception(); var Mark = require_mark(); var DEFAULT_SAFE_SCHEMA = require_default_safe(); var DEFAULT_FULL_SCHEMA = require_default_full(); var _hasOwnProperty = Object.prototype.hasOwnProperty; var CONTEXT_FLOW_IN = 1; var CONTEXT_FLOW_OUT = 2; var CONTEXT_BLOCK_IN = 3; var CONTEXT_BLOCK_OUT = 4; var CHOMPING_CLIP = 1; var CHOMPING_STRIP = 2; var CHOMPING_KEEP = 3; var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; function _class(obj) { return Object.prototype.toString.call(obj); } function is_EOL(c) { return c === 10 || c === 13; } function is_WHITE_SPACE(c) { return c === 9 || c === 32; } function is_WS_OR_EOL(c) { return c === 9 || c === 32 || c === 10 || c === 13; } function is_FLOW_INDICATOR(c) { return c === 44 || c === 91 || c === 93 || c === 123 || c === 125; } function fromHexCode(c) { var lc; if (48 <= c && c <= 57) { return c - 48; } lc = c | 32; if (97 <= lc && lc <= 102) { return lc - 97 + 10; } return -1; } function escapedHexLen(c) { if (c === 120) { return 2; } if (c === 117) { return 4; } if (c === 85) { return 8; } return 0; } function fromDecimalCode(c) { if (48 <= c && c <= 57) { return c - 48; } return -1; } function simpleEscapeSequence(c) { return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : ""; } function charFromCodepoint(c) { if (c <= 65535) { return String.fromCharCode(c); } return String.fromCharCode( (c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320 ); } function setProperty(object, key, value) { if (key === "__proto__") { Object.defineProperty(object, key, { configurable: true, enumerable: true, writable: true, value }); } else { object[key] = value; } } var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; simpleEscapeMap[i] = simpleEscapeSequence(i); } var i; function State(input, options) { this.input = input; this.filename = options["filename"] || null; this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; this.onWarning = options["onWarning"] || null; this.legacy = options["legacy"] || false; this.json = options["json"] || false; this.listener = options["listener"] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; this.length = input.length; this.position = 0; this.line = 0; this.lineStart = 0; this.lineIndent = 0; this.documents = []; } function generateError(state, message) { return new YAMLException( message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart) ); } function throwError(state, message) { throw generateError(state, message); } function throwWarning(state, message) { if (state.onWarning) { state.onWarning.call(null, generateError(state, message)); } } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { var match, major, minor; if (state.version !== null) { throwError(state, "duplication of %YAML directive"); } if (args.length !== 1) { throwError(state, "YAML directive accepts exactly one argument"); } match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); if (match === null) { throwError(state, "ill-formed argument of the YAML directive"); } major = parseInt(match[1], 10); minor = parseInt(match[2], 10); if (major !== 1) { throwError(state, "unacceptable YAML version of the document"); } state.version = args[0]; state.checkLineBreaks = minor < 2; if (minor !== 1 && minor !== 2) { throwWarning(state, "unsupported YAML version of the document"); } }, TAG: function handleTagDirective(state, name, args) { var handle, prefix; if (args.length !== 2) { throwError(state, "TAG directive accepts exactly two arguments"); } handle = args[0]; prefix = args[1]; if (!PATTERN_TAG_HANDLE.test(handle)) { throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); } if (_hasOwnProperty.call(state.tagMap, handle)) { throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); } if (!PATTERN_TAG_URI.test(prefix)) { throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); } state.tagMap[handle] = prefix; } }; function captureSegment(state, start, end, checkJson) { var _position, _length, _character, _result; if (start < end) { _result = state.input.slice(start, end); if (checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { throwError(state, "expected valid JSON character"); } } } else if (PATTERN_NON_PRINTABLE.test(_result)) { throwError(state, "the stream contains non-printable characters"); } state.result += _result; } } function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { throwError(state, "cannot merge mappings; the provided source object is unacceptable"); } sourceKeys = Object.keys(source); for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty.call(destination, key)) { setProperty(destination, key, source[key]); overridableKeys[key] = true; } } } function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { var index, quantity; if (Array.isArray(keyNode)) { keyNode = Array.prototype.slice.call(keyNode); for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { if (Array.isArray(keyNode[index])) { throwError(state, "nested arrays are not supported inside keys"); } if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { keyNode[index] = "[object Object]"; } } } if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { keyNode = "[object Object]"; } keyNode = String(keyNode); if (_result === null) { _result = {}; } if (keyTag === "tag:yaml.org,2002:merge") { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } } else { if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { state.line = startLine || state.line; state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; } function readLineBreak(state) { var ch; ch = state.input.charCodeAt(state.position); if (ch === 10) { state.position++; } else if (ch === 13) { state.position++; if (state.input.charCodeAt(state.position) === 10) { state.position++; } } else { throwError(state, "a line break is expected"); } state.line += 1; state.lineStart = state.position; } function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (allowComments && ch === 35) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 10 && ch !== 13 && ch !== 0); } if (is_EOL(ch)) { readLineBreak(state); ch = state.input.charCodeAt(state.position); lineBreaks++; state.lineIndent = 0; while (ch === 32) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } } else { break; } } if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, "deficient indentation"); } return lineBreaks; } function testDocumentSeparator(state) { var _position = state.position, ch; ch = state.input.charCodeAt(_position); if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { _position += 3; ch = state.input.charCodeAt(_position); if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } } return false; } function writeFoldedLines(state, count) { if (count === 1) { state.result += " "; } else if (count > 1) { state.result += common.repeat("\n", count - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; ch = state.input.charCodeAt(state.position); if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { return false; } if (ch === 63 || ch === 45) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { return false; } } state.kind = "scalar"; state.result = ""; captureStart = captureEnd = state.position; hasPendingContent = false; while (ch !== 0) { if (ch === 58) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { break; } } else if (ch === 35) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { break; } } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { break; } else if (is_EOL(ch)) { _line = state.line; _lineStart = state.lineStart; _lineIndent = state.lineIndent; skipSeparationSpace(state, false, -1); if (state.lineIndent >= nodeIndent) { hasPendingContent = true; ch = state.input.charCodeAt(state.position); continue; } else { state.position = captureEnd; state.line = _line; state.lineStart = _lineStart; state.lineIndent = _lineIndent; break; } } if (hasPendingContent) { captureSegment(state, captureStart, captureEnd, false); writeFoldedLines(state, state.line - _line); captureStart = captureEnd = state.position; hasPendingContent = false; } if (!is_WHITE_SPACE(ch)) { captureEnd = state.position + 1; } ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, captureEnd, false); if (state.result) { return true; } state.kind = _kind; state.result = _result; return false; } function readSingleQuotedScalar(state, nodeIndent) { var ch, captureStart, captureEnd; ch = state.input.charCodeAt(state.position); if (ch !== 39) { return false; } state.kind = "scalar"; state.result = ""; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 39) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (ch === 39) { captureStart = state.position; state.position++; captureEnd = state.position; } else { return true; } } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, "unexpected end of the document within a single quoted scalar"); } else { state.position++; captureEnd = state.position; } } throwError(state, "unexpected end of the stream within a single quoted scalar"); } function readDoubleQuotedScalar(state, nodeIndent) { var captureStart, captureEnd, hexLength, hexResult, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch !== 34) { return false; } state.kind = "scalar"; state.result = ""; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 34) { captureSegment(state, captureStart, state.position, true); state.position++; return true; } else if (ch === 92) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (is_EOL(ch)) { skipSeparationSpace(state, false, nodeIndent); } else if (ch < 256 && simpleEscapeCheck[ch]) { state.result += simpleEscapeMap[ch]; state.position++; } else if ((tmp = escapedHexLen(ch)) > 0) { hexLength = tmp; hexResult = 0; for (; hexLength > 0; hexLength--) { ch = state.input.charCodeAt(++state.position); if ((tmp = fromHexCode(ch)) >= 0) { hexResult = (hexResult << 4) + tmp; } else { throwError(state, "expected hexadecimal character"); } } state.result += charFromCodepoint(hexResult); state.position++; } else { throwError(state, "unknown escape sequence"); } captureStart = captureEnd = state.position; } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, "unexpected end of the document within a double quoted scalar"); } else { state.position++; captureEnd = state.position; } } throwError(state, "unexpected end of the stream within a double quoted scalar"); } function readFlowCollection(state, nodeIndent) { var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch; ch = state.input.charCodeAt(state.position); if (ch === 91) { terminator = 93; isMapping = false; _result = []; } else if (ch === 123) { terminator = 125; isMapping = true; _result = {}; } else { return false; } if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === terminator) { state.position++; state.tag = _tag; state.anchor = _anchor; state.kind = isMapping ? "mapping" : "sequence"; state.result = _result; return true; } else if (!readNext) { throwError(state, "missed comma between flow collection entries"); } keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; if (ch === 63) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { isPair = isExplicitPair = true; state.position++; skipSeparationSpace(state, true, nodeIndent); } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); keyTag = state.tag; keyNode = state.result; skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if ((isExplicitPair || state.line === _line) && ch === 58) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); valueNode = state.result; } if (isMapping) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === 44) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { readNext = false; } } throwError(state, "unexpected end of the stream within a flow collection"); } function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch === 124) { folding = false; } else if (ch === 62) { folding = true; } else { return false; } state.kind = "scalar"; state.result = ""; while (ch !== 0) { ch = state.input.charCodeAt(++state.position); if (ch === 43 || ch === 45) { if (CHOMPING_CLIP === chomping) { chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, "repeat of a chomping mode identifier"); } } else if ((tmp = fromDecimalCode(ch)) >= 0) { if (tmp === 0) { throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); } else if (!detectedIndent) { textIndent = nodeIndent + tmp - 1; detectedIndent = true; } else { throwError(state, "repeat of an indentation width identifier"); } } else { break; } } if (is_WHITE_SPACE(ch)) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); if (ch === 35) { do { ch = state.input.charCodeAt(++state.position); } while (!is_EOL(ch) && ch !== 0); } } while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } if (!detectedIndent && state.lineIndent > textIndent) { textIndent = state.lineIndent; } if (is_EOL(ch)) { emptyLines++; continue; } if (state.lineIndent < textIndent) { if (chomping === CHOMPING_KEEP) { state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { if (didReadContent) { state.result += "\n"; } } break; } if (folding) { if (is_WHITE_SPACE(ch)) { atMoreIndented = true; state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } else if (atMoreIndented) { atMoreIndented = false; state.result += common.repeat("\n", emptyLines + 1); } else if (emptyLines === 0) { if (didReadContent) { state.result += " "; } } else { state.result += common.repeat("\n", emptyLines); } } else { state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; while (!is_EOL(ch) && ch !== 0) { ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, state.position, false); } return true; } function readBlockSequence(state, nodeIndent) { var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { if (ch !== 45) { break; } following = state.input.charCodeAt(state.position + 1); if (!is_WS_OR_EOL(following)) { break; } detected = true; state.position++; if (skipSeparationSpace(state, true, -1)) { if (state.lineIndent <= nodeIndent) { _result.push(null); ch = state.input.charCodeAt(state.position); continue; } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); _result.push(state.result); skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { throwError(state, "bad indentation of a sequence entry"); } else if (state.lineIndent < nodeIndent) { break; } } if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = "sequence"; state.result = _result; return true; } return false; } function readBlockMapping(state, nodeIndent, flowIndent) { var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; _pos = state.position; if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { if (ch === 63) { if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = true; allowCompact = true; } else if (atExplicitKey) { atExplicitKey = false; allowCompact = true; } else { throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); } state.position += 1; ch = following; } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { if (state.line === _line) { ch = state.input.charCodeAt(state.position); while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 58) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); } if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = false; allowCompact = false; keyTag = state.tag; keyNode = state.result; } else if (detected) { throwError(state, "can not read an implicit mapping pair; a colon is missed"); } else { state.tag = _tag; state.anchor = _anchor; return true; } } else if (detected) { throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); } else { state.tag = _tag; state.anchor = _anchor; return true; } } else { break; } if (state.line === _line || state.lineIndent > nodeIndent) { if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { keyNode = state.result; } else { valueNode = state.result; } } if (!atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); keyTag = keyNode = valueNode = null; } skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); } if (state.lineIndent > nodeIndent && ch !== 0) { throwError(state, "bad indentation of a mapping entry"); } else if (state.lineIndent < nodeIndent) { break; } } if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = "mapping"; state.result = _result; } return detected; } function readTagProperty(state) { var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; ch = state.input.charCodeAt(state.position); if (ch !== 33) return false; if (state.tag !== null) { throwError(state, "duplication of a tag property"); } ch = state.input.charCodeAt(++state.position); if (ch === 60) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); } else if (ch === 33) { isNamed = true; tagHandle = "!!"; ch = state.input.charCodeAt(++state.position); } else { tagHandle = "!"; } _position = state.position; if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && ch !== 62); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); ch = state.input.charCodeAt(++state.position); } else { throwError(state, "unexpected end of the stream within a verbatim tag"); } } else { while (ch !== 0 && !is_WS_OR_EOL(ch)) { if (ch === 33) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); if (!PATTERN_TAG_HANDLE.test(tagHandle)) { throwError(state, "named tag handle cannot contain such characters"); } isNamed = true; _position = state.position + 1; } else { throwError(state, "tag suffix cannot contain exclamation marks"); } } ch = state.input.charCodeAt(++state.position); } tagName = state.input.slice(_position, state.position); if (PATTERN_FLOW_INDICATORS.test(tagName)) { throwError(state, "tag suffix cannot contain flow indicator characters"); } } if (tagName && !PATTERN_TAG_URI.test(tagName)) { throwError(state, "tag name cannot contain such characters: " + tagName); } if (isVerbatim) { state.tag = tagName; } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; } else if (tagHandle === "!") { state.tag = "!" + tagName; } else if (tagHandle === "!!") { state.tag = "tag:yaml.org,2002:" + tagName; } else { throwError(state, 'undeclared tag handle "' + tagHandle + '"'); } return true; } function readAnchorProperty(state) { var _position, ch; ch = state.input.charCodeAt(state.position); if (ch !== 38) return false; if (state.anchor !== null) { throwError(state, "duplication of an anchor property"); } ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, "name of an anchor node must contain at least one character"); } state.anchor = state.input.slice(_position, state.position); return true; } function readAlias(state) { var _position, alias, ch; ch = state.input.charCodeAt(state.position); if (ch !== 42) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, "name of an alias node must contain at least one character"); } alias = state.input.slice(_position, state.position); if (!_hasOwnProperty.call(state.anchorMap, alias)) { throwError(state, 'unidentified alias "' + alias + '"'); } state.result = state.anchorMap[alias]; skipSeparationSpace(state, true, -1); return true; } function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent; if (state.listener !== null) { state.listener("open", state); } state.tag = null; state.anchor = null; state.kind = null; state.result = null; allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; if (allowToSeek) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; if (state.lineIndent > parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } } if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } else { allowBlockCollections = false; } } } if (allowBlockCollections) { allowBlockCollections = atNewLine || allowCompact; } if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { flowIndent = parentIndent + 1; } blockIndent = state.position - state.lineStart; if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { hasContent = true; } else { if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { hasContent = true; } else if (readAlias(state)) { hasContent = true; if (state.tag !== null || state.anchor !== null) { throwError(state, "alias node should not have any properties"); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; if (state.tag === null) { state.tag = "?"; } } if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else if (indentStatus === 0) { hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } if (state.tag !== null && state.tag !== "!") { if (state.tag === "?") { if (state.result !== null && state.kind !== "scalar") { throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); } for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { type = state.implicitTypes[typeIndex]; if (type.resolve(state.result)) { state.result = type.construct(state.result); state.tag = type.tag; if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; } } } else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) { type = state.typeMap[state.kind || "fallback"][state.tag]; if (state.result !== null && type.kind !== state.kind) { throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } if (!type.resolve(state.result)) { throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); } else { state.result = type.construct(state.result); if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { throwError(state, "unknown tag !<" + state.tag + ">"); } } if (state.listener !== null) { state.listener("close", state); } return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; state.tagMap = {}; state.anchorMap = {}; while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if (state.lineIndent > 0 || ch !== 37) { break; } hasDirectives = true; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveName = state.input.slice(_position, state.position); directiveArgs = []; if (directiveName.length < 1) { throwError(state, "directive name must not be less than one character in length"); } while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 35) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && !is_EOL(ch)); break; } if (is_EOL(ch)) break; _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); } else { throwWarning(state, 'unknown document directive "' + directiveName + '"'); } } skipSeparationSpace(state, true, -1); if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { state.position += 3; skipSeparationSpace(state, true, -1); } else if (hasDirectives) { throwError(state, "directives end mark is expected"); } composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); skipSeparationSpace(state, true, -1); if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { throwWarning(state, "non-ASCII line breaks are interpreted as content"); } state.documents.push(state.result); if (state.position === state.lineStart && testDocumentSeparator(state)) { if (state.input.charCodeAt(state.position) === 46) { state.position += 3; skipSeparationSpace(state, true, -1); } return; } if (state.position < state.length - 1) { throwError(state, "end of the stream or a document separator is expected"); } else { return; } } function loadDocuments(input, options) { input = String(input); options = options || {}; if (input.length !== 0) { if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { input += "\n"; } if (input.charCodeAt(0) === 65279) { input = input.slice(1); } } var state = new State(input, options); var nullpos = input.indexOf("\0"); if (nullpos !== -1) { state.position = nullpos; throwError(state, "null byte is not allowed in input"); } state.input += "\0"; while (state.input.charCodeAt(state.position) === 32) { state.lineIndent += 1; state.position += 1; } while (state.position < state.length - 1) { readDocument(state); } return state.documents; } function loadAll(input, iterator, options) { if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { options = iterator; iterator = null; } var documents = loadDocuments(input, options); if (typeof iterator !== "function") { return documents; } for (var index = 0, length = documents.length; index < length; index += 1) { iterator(documents[index]); } } function load(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { return void 0; } else if (documents.length === 1) { return documents[0]; } throw new YAMLException("expected a single document in the stream, but found more"); } function safeLoadAll(input, iterator, options) { if (typeof iterator === "object" && iterator !== null && typeof options === "undefined") { options = iterator; iterator = null; } return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } function safeLoad(input, options) { return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module2.exports.loadAll = loadAll; module2.exports.load = load; module2.exports.safeLoadAll = safeLoadAll; module2.exports.safeLoad = safeLoad; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/dumper.js var require_dumper = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports, module2) { "use strict"; var common = require_common(); var YAMLException = require_exception(); var DEFAULT_FULL_SCHEMA = require_default_full(); var DEFAULT_SAFE_SCHEMA = require_default_safe(); var _toString = Object.prototype.toString; var _hasOwnProperty = Object.prototype.hasOwnProperty; var CHAR_TAB = 9; var CHAR_LINE_FEED = 10; var CHAR_CARRIAGE_RETURN = 13; var CHAR_SPACE = 32; var CHAR_EXCLAMATION = 33; var CHAR_DOUBLE_QUOTE = 34; var CHAR_SHARP = 35; var CHAR_PERCENT = 37; var CHAR_AMPERSAND = 38; var CHAR_SINGLE_QUOTE = 39; var CHAR_ASTERISK = 42; var CHAR_COMMA = 44; var CHAR_MINUS = 45; var CHAR_COLON = 58; var CHAR_EQUALS = 61; var CHAR_GREATER_THAN = 62; var CHAR_QUESTION = 63; var CHAR_COMMERCIAL_AT = 64; var CHAR_LEFT_SQUARE_BRACKET = 91; var CHAR_RIGHT_SQUARE_BRACKET = 93; var CHAR_GRAVE_ACCENT = 96; var CHAR_LEFT_CURLY_BRACKET = 123; var CHAR_VERTICAL_LINE = 124; var CHAR_RIGHT_CURLY_BRACKET = 125; var ESCAPE_SEQUENCES = {}; ESCAPE_SEQUENCES[0] = "\\0"; ESCAPE_SEQUENCES[7] = "\\a"; ESCAPE_SEQUENCES[8] = "\\b"; ESCAPE_SEQUENCES[9] = "\\t"; ESCAPE_SEQUENCES[10] = "\\n"; ESCAPE_SEQUENCES[11] = "\\v"; ESCAPE_SEQUENCES[12] = "\\f"; ESCAPE_SEQUENCES[13] = "\\r"; ESCAPE_SEQUENCES[27] = "\\e"; ESCAPE_SEQUENCES[34] = '\\"'; ESCAPE_SEQUENCES[92] = "\\\\"; ESCAPE_SEQUENCES[133] = "\\N"; ESCAPE_SEQUENCES[160] = "\\_"; ESCAPE_SEQUENCES[8232] = "\\L"; ESCAPE_SEQUENCES[8233] = "\\P"; var DEPRECATED_BOOLEANS_SYNTAX = [ "y", "Y", "yes", "Yes", "YES", "on", "On", "ON", "n", "N", "no", "No", "NO", "off", "Off", "OFF" ]; function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; if (map === null) return {}; result = {}; keys = Object.keys(map); for (index = 0, length = keys.length; index < length; index += 1) { tag = keys[index]; style = String(map[tag]); if (tag.slice(0, 2) === "!!") { tag = "tag:yaml.org,2002:" + tag.slice(2); } type = schema.compiledTypeMap["fallback"][tag]; if (type && _hasOwnProperty.call(type.styleAliases, style)) { style = type.styleAliases[style]; } result[tag] = style; } return result; } function encodeHex(character) { var string, handle, length; string = character.toString(16).toUpperCase(); if (character <= 255) { handle = "x"; length = 2; } else if (character <= 65535) { handle = "u"; length = 4; } else if (character <= 4294967295) { handle = "U"; length = 8; } else { throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF"); } return "\\" + handle + common.repeat("0", length - string.length) + string; } function State(options) { this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; this.indent = Math.max(1, options["indent"] || 2); this.noArrayIndent = options["noArrayIndent"] || false; this.skipInvalid = options["skipInvalid"] || false; this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; this.styleMap = compileStyleMap(this.schema, options["styles"] || null); this.sortKeys = options["sortKeys"] || false; this.lineWidth = options["lineWidth"] || 80; this.noRefs = options["noRefs"] || false; this.noCompatMode = options["noCompatMode"] || false; this.condenseFlow = options["condenseFlow"] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; this.tag = null; this.result = ""; this.duplicates = []; this.usedDuplicates = null; } function indentString(string, spaces) { var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length; while (position < length) { next = string.indexOf("\n", position); if (next === -1) { line = string.slice(position); position = length; } else { line = string.slice(position, next + 1); position = next + 1; } if (line.length && line !== "\n") result += ind; result += line; } return result; } function generateNextLine(state, level) { return "\n" + common.repeat(" ", state.indent * level); } function testImplicitResolving(state, str) { var index, length, type; for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { type = state.implicitTypes[index]; if (type.resolve(str)) { return true; } } return false; } function isWhitespace(c) { return c === CHAR_SPACE || c === CHAR_TAB; } function isPrintable(c) { return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111; } function isNsChar(c) { return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; } function isPlainSafe(c, prev) { return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev)); } function isPlainSafeFirst(c) { return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; } function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; return leadingSpaceRe.test(string); } var STYLE_PLAIN = 1; var STYLE_SINGLE = 2; var STYLE_LITERAL = 3; var STYLE_FOLDED = 4; var STYLE_DOUBLE = 5; function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { var i; var char, prev_char; var hasLineBreak = false; var hasFoldableLine = false; var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1)); if (singleLineOnly) { for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } } else { for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (char === CHAR_LINE_FEED) { hasLineBreak = true; if (shouldTrackWidth) { hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "; previousLineBreak = i; } } else if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " "); } if (!hasLineBreak && !hasFoldableLine) { return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE; } if (indentPerLevel > 9 && needIndentIndicator(string)) { return STYLE_DOUBLE; } return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } function writeScalar(state, string, level, iskey) { state.dump = function() { if (string.length === 0) { return "''"; } if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { return "'" + string + "'"; } var indent = state.indent * Math.max(1, level); var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; function testAmbiguity(string2) { return testImplicitResolving(state, string2); } switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { case STYLE_PLAIN: return string; case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; case STYLE_LITERAL: return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); case STYLE_FOLDED: return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); case STYLE_DOUBLE: return '"' + escapeString(string, lineWidth) + '"'; default: throw new YAMLException("impossible error: invalid scalar style"); } }(); } function blockHeader(string, indentPerLevel) { var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ""; var clip = string[string.length - 1] === "\n"; var keep = clip && (string[string.length - 2] === "\n" || string === "\n"); var chomp = keep ? "+" : clip ? "" : "-"; return indentIndicator + chomp + "\n"; } function dropEndingNewline(string) { return string[string.length - 1] === "\n" ? string.slice(0, -1) : string; } function foldString(string, width) { var lineRe = /(\n+)([^\n]*)/g; var result = function() { var nextLF = string.indexOf("\n"); nextLF = nextLF !== -1 ? nextLF : string.length; lineRe.lastIndex = nextLF; return foldLine(string.slice(0, nextLF), width); }(); var prevMoreIndented = string[0] === "\n" || string[0] === " "; var moreIndented; var match; while (match = lineRe.exec(string)) { var prefix = match[1], line = match[2]; moreIndented = line[0] === " "; result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); prevMoreIndented = moreIndented; } return result; } function foldLine(line, width) { if (line === "" || line[0] === " ") return line; var breakRe = / [^ ]/g; var match; var start = 0, end, curr = 0, next = 0; var result = ""; while (match = breakRe.exec(line)) { next = match.index; if (next - start > width) { end = curr > start ? curr : next; result += "\n" + line.slice(start, end); start = end + 1; } curr = next; } result += "\n"; if (line.length - start > width && curr > start) { result += line.slice(start, curr) + "\n" + line.slice(curr + 1); } else { result += line.slice(start); } return result.slice(1); } function escapeString(string) { var result = ""; var char, nextChar; var escapeSeq; for (var i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (char >= 55296 && char <= 56319) { nextChar = string.charCodeAt(i + 1); if (nextChar >= 56320 && nextChar <= 57343) { result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536); i++; continue; } } escapeSeq = ESCAPE_SEQUENCES[char]; result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char); } return result; } function writeFlowSequence(state, level, object) { var _result = "", _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { if (writeNode(state, level, object[index], false, false)) { if (index !== 0) _result += "," + (!state.condenseFlow ? " " : ""); _result += state.dump; } } state.tag = _tag; state.dump = "[" + _result + "]"; } function writeBlockSequence(state, level, object, compact) { var _result = "", _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { if (writeNode(state, level + 1, object[index], true, true)) { if (!compact || index !== 0) { _result += generateNextLine(state, level); } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { _result += "-"; } else { _result += "- "; } _result += state.dump; } } state.tag = _tag; state.dump = _result || "[]"; } function writeFlowMapping(state, level, object) { var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ""; if (index !== 0) pairBuffer += ", "; if (state.condenseFlow) pairBuffer += '"'; objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level, objectKey, false, false)) { continue; } if (state.dump.length > 1024) pairBuffer += "? "; pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " "); if (!writeNode(state, level, objectValue, false, false)) { continue; } pairBuffer += state.dump; _result += pairBuffer; } state.tag = _tag; state.dump = "{" + _result + "}"; } function writeBlockMapping(state, level, object, compact) { var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; if (state.sortKeys === true) { objectKeyList.sort(); } else if (typeof state.sortKeys === "function") { objectKeyList.sort(state.sortKeys); } else if (state.sortKeys) { throw new YAMLException("sortKeys must be a boolean or a function"); } for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ""; if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; } explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; if (explicitPair) { if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += "?"; } else { pairBuffer += "? "; } } pairBuffer += state.dump; if (explicitPair) { pairBuffer += generateNextLine(state, level); } if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { continue; } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += ":"; } else { pairBuffer += ": "; } pairBuffer += state.dump; _result += pairBuffer; } state.tag = _tag; state.dump = _result || "{}"; } function detectType(state, object, explicit) { var _result, typeList, index, length, type, style; typeList = explicit ? state.explicitTypes : state.implicitTypes; for (index = 0, length = typeList.length; index < length; index += 1) { type = typeList[index]; if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : "?"; if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; if (_toString.call(type.represent) === "[object Function]") { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); } else { throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style'); } state.dump = _result; } return true; } } return false; } function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; if (!detectType(state, object, false)) { detectType(state, object, true); } var type = _toString.call(state.dump); if (block) { block = state.flowLevel < 0 || state.flowLevel > level; } var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate; if (objectOrArray) { duplicateIndex = state.duplicates.indexOf(object); duplicate = duplicateIndex !== -1; } if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) { compact = false; } if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = "*ref_" + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } if (type === "[object Object]") { if (block && Object.keys(state.dump).length !== 0) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { state.dump = "&ref_" + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); if (duplicate) { state.dump = "&ref_" + duplicateIndex + " " + state.dump; } } } else if (type === "[object Array]") { var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level; if (block && state.dump.length !== 0) { writeBlockSequence(state, arrayLevel, state.dump, compact); if (duplicate) { state.dump = "&ref_" + duplicateIndex + state.dump; } } else { writeFlowSequence(state, arrayLevel, state.dump); if (duplicate) { state.dump = "&ref_" + duplicateIndex + " " + state.dump; } } } else if (type === "[object String]") { if (state.tag !== "?") { writeScalar(state, state.dump, level, iskey); } } else { if (state.skipInvalid) return false; throw new YAMLException("unacceptable kind of an object to dump " + type); } if (state.tag !== null && state.tag !== "?") { state.dump = "!<" + state.tag + "> " + state.dump; } } return true; } function getDuplicateReferences(object, state) { var objects = [], duplicatesIndexes = [], index, length; inspectNode(object, objects, duplicatesIndexes); for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { state.duplicates.push(objects[duplicatesIndexes[index]]); } state.usedDuplicates = new Array(length); } function inspectNode(object, objects, duplicatesIndexes) { var objectKeyList, index, length; if (object !== null && typeof object === "object") { index = objects.indexOf(object); if (index !== -1) { if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { objects.push(object); if (Array.isArray(object)) { for (index = 0, length = object.length; index < length; index += 1) { inspectNode(object[index], objects, duplicatesIndexes); } } else { objectKeyList = Object.keys(object); for (index = 0, length = objectKeyList.length; index < length; index += 1) { inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); } } } } } function dump(input, options) { options = options || {}; var state = new State(options); if (!state.noRefs) getDuplicateReferences(input, state); if (writeNode(state, 0, input, true, true)) return state.dump + "\n"; return ""; } function safeDump(input, options) { return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module2.exports.dump = dump; module2.exports.safeDump = safeDump; } }); // node_modules/front-matter/node_modules/js-yaml/lib/js-yaml.js var require_js_yaml = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/lib/js-yaml.js"(exports, module2) { "use strict"; var loader = require_loader(); var dumper = require_dumper(); function deprecated(name) { return function() { throw new Error("Function " + name + " is deprecated and cannot be used."); }; } module2.exports.Type = require_type(); module2.exports.Schema = require_schema(); module2.exports.FAILSAFE_SCHEMA = require_failsafe(); module2.exports.JSON_SCHEMA = require_json(); module2.exports.CORE_SCHEMA = require_core(); module2.exports.DEFAULT_SAFE_SCHEMA = require_default_safe(); module2.exports.DEFAULT_FULL_SCHEMA = require_default_full(); module2.exports.load = loader.load; module2.exports.loadAll = loader.loadAll; module2.exports.safeLoad = loader.safeLoad; module2.exports.safeLoadAll = loader.safeLoadAll; module2.exports.dump = dumper.dump; module2.exports.safeDump = dumper.safeDump; module2.exports.YAMLException = require_exception(); module2.exports.MINIMAL_SCHEMA = require_failsafe(); module2.exports.SAFE_SCHEMA = require_default_safe(); module2.exports.DEFAULT_SCHEMA = require_default_full(); module2.exports.scan = deprecated("scan"); module2.exports.parse = deprecated("parse"); module2.exports.compose = deprecated("compose"); module2.exports.addConstructor = deprecated("addConstructor"); } }); // node_modules/front-matter/node_modules/js-yaml/index.js var require_js_yaml2 = __commonJS({ "node_modules/front-matter/node_modules/js-yaml/index.js"(exports, module2) { "use strict"; var yaml = require_js_yaml(); module2.exports = yaml; } }); // node_modules/front-matter/index.js var require_front_matter = __commonJS({ "node_modules/front-matter/index.js"(exports, module2) { var parser = require_js_yaml2(); var optionalByteOrderMark = "\\ufeff?"; var platform2 = typeof process !== "undefined" ? process.platform : ""; var pattern = "^(" + optionalByteOrderMark + "(= yaml =|---)$([\\s\\S]*?)^(?:\\2|\\.\\.\\.)\\s*$" + (platform2 === "win32" ? "\\r?" : "") + "(?:\\n)?)"; var regex = new RegExp(pattern, "m"); module2.exports = extractor; module2.exports.test = test; function extractor(string, options) { string = string || ""; var defaultOptions = { allowUnsafe: false }; options = options instanceof Object ? { ...defaultOptions, ...options } : defaultOptions; options.allowUnsafe = Boolean(options.allowUnsafe); var lines = string.split(/(\r?\n)/); if (lines[0] && /= yaml =|---/.test(lines[0])) { return parse(string, options.allowUnsafe); } else { return { attributes: {}, body: string, bodyBegin: 1 }; } } function computeLocation(match, body) { var line = 1; var pos = body.indexOf("\n"); var offset3 = match.index + match[0].length; while (pos !== -1) { if (pos >= offset3) { return line; } line++; pos = body.indexOf("\n", pos + 1); } return line; } function parse(string, allowUnsafe) { var match = regex.exec(string); if (!match) { return { attributes: {}, body: string, bodyBegin: 1 }; } var loader = allowUnsafe ? parser.load : parser.safeLoad; var yaml = match[match.length - 1].replace(/^\s+|\s+$/g, ""); var attributes = loader(yaml) || {}; var body = string.replace(match[0], ""); var line = computeLocation(match, string); return { attributes, body, bodyBegin: line, frontmatter: yaml }; } function test(string) { string = string || ""; return regex.test(string); } } }); // node_modules/crypto-js/core.js var require_core2 = __commonJS({ "node_modules/crypto-js/core.js"(exports, module2) { (function(root, factory) { if (typeof exports === "object") { module2.exports = exports = factory(); } else if (typeof define === "function" && define.amd) { define([], factory); } else { root.CryptoJS = factory(); } })(exports, function() { var CryptoJS = CryptoJS || function(Math2, undefined2) { var crypto2; if (typeof window !== "undefined" && window.crypto) { crypto2 = window.crypto; } if (typeof self !== "undefined" && self.crypto) { crypto2 = self.crypto; } if (typeof globalThis !== "undefined" && globalThis.crypto) { crypto2 = globalThis.crypto; } if (!crypto2 && typeof window !== "undefined" && window.msCrypto) { crypto2 = window.msCrypto; } if (!crypto2 && typeof global !== "undefined" && global.crypto) { crypto2 = global.crypto; } if (!crypto2 && typeof require === "function") { try { crypto2 = require("crypto"); } catch (err) { } } var cryptoSecureRandomInt = function() { if (crypto2) { if (typeof crypto2.getRandomValues === "function") { try { return crypto2.getRandomValues(new Uint32Array(1))[0]; } catch (err) { } } if (typeof crypto2.randomBytes === "function") { try { return crypto2.randomBytes(4).readInt32LE(); } catch (err) { } } } throw new Error("Native crypto module could not be used to get secure random number."); }; var create = Object.create || /* @__PURE__ */ function() { function F() { } return function(obj) { var subtype; F.prototype = obj; subtype = new F(); F.prototype = null; return subtype; }; }(); var C = {}; var C_lib = C.lib = {}; var Base2 = C_lib.Base = /* @__PURE__ */ function() { return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function(overrides) { var subtype = create(this); if (overrides) { subtype.mixIn(overrides); } if (!subtype.hasOwnProperty("init") || this.init === subtype.init) { subtype.init = function() { subtype.$super.init.apply(this, arguments); }; } subtype.init.prototype = subtype; subtype.$super = this; return subtype; }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function() { var instance11 = this.extend(); instance11.init.apply(instance11, arguments); return instance11; }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function() { }, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function(properties) { for (var propertyName in properties) { if (properties.hasOwnProperty(propertyName)) { this[propertyName] = properties[propertyName]; } } if (properties.hasOwnProperty("toString")) { this.toString = properties.toString; } }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function() { return this.init.prototype.extend(this); } }; }(); var WordArray = C_lib.WordArray = Base2.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function(words, sigBytes) { words = this.words = words || []; if (sigBytes != undefined2) { this.sigBytes = sigBytes; } else { this.sigBytes = words.length * 4; } }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function(encoder) { return (encoder || Hex).stringify(this); }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function(wordArray) { var thisWords = this.words; var thatWords = wordArray.words; var thisSigBytes = this.sigBytes; var thatSigBytes = wordArray.sigBytes; this.clamp(); if (thisSigBytes % 4) { for (var i = 0; i < thatSigBytes; i++) { var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255; thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8; } } else { for (var j = 0; j < thatSigBytes; j += 4) { thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2]; } } this.sigBytes += thatSigBytes; return this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function() { var words = this.words; var sigBytes = this.sigBytes; words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8; words.length = Math2.ceil(sigBytes / 4); }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function() { var clone = Base2.clone.call(this); clone.words = this.words.slice(0); return clone; }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function(nBytes) { var words = []; for (var i = 0; i < nBytes; i += 4) { words.push(cryptoSecureRandomInt()); } return new WordArray.init(words, nBytes); } }); var C_enc = C.enc = {}; var Hex = C_enc.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function(wordArray) { var words = wordArray.words; var sigBytes = wordArray.sigBytes; var hexChars = []; for (var i = 0; i < sigBytes; i++) { var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; hexChars.push((bite >>> 4).toString(16)); hexChars.push((bite & 15).toString(16)); } return hexChars.join(""); }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function(hexStr) { var hexStrLength = hexStr.length; var words = []; for (var i = 0; i < hexStrLength; i += 2) { words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4; } return new WordArray.init(words, hexStrLength / 2); } }; var Latin1 = C_enc.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function(wordArray) { var words = wordArray.words; var sigBytes = wordArray.sigBytes; var latin1Chars = []; for (var i = 0; i < sigBytes; i++) { var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; latin1Chars.push(String.fromCharCode(bite)); } return latin1Chars.join(""); }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function(latin1Str) { var latin1StrLength = latin1Str.length; var words = []; for (var i = 0; i < latin1StrLength; i++) { words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8; } return new WordArray.init(words, latin1StrLength); } }; var Utf8 = C_enc.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function(wordArray) { try { return decodeURIComponent(escape(Latin1.stringify(wordArray))); } catch (e) { throw new Error("Malformed UTF-8 data"); } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function(utf8Str) { return Latin1.parse(unescape(encodeURIComponent(utf8Str))); } }; var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base2.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function() { this._data = new WordArray.init(); this._nDataBytes = 0; }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function(data) { if (typeof data == "string") { data = Utf8.parse(data); } this._data.concat(data); this._nDataBytes += data.sigBytes; }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function(doFlush) { var processedWords; var data = this._data; var dataWords = data.words; var dataSigBytes = data.sigBytes; var blockSize = this.blockSize; var blockSizeBytes = blockSize * 4; var nBlocksReady = dataSigBytes / blockSizeBytes; if (doFlush) { nBlocksReady = Math2.ceil(nBlocksReady); } else { nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0); } var nWordsReady = nBlocksReady * blockSize; var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes); if (nWordsReady) { for (var offset3 = 0; offset3 < nWordsReady; offset3 += blockSize) { this._doProcessBlock(dataWords, offset3); } processedWords = dataWords.splice(0, nWordsReady); data.sigBytes -= nBytesReady; } return new WordArray.init(processedWords, nBytesReady); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function() { var clone = Base2.clone.call(this); clone._data = this._data.clone(); return clone; }, _minBufferSize: 0 }); var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ /** * Configuration options. */ cfg: Base2.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function(cfg) { this.cfg = this.cfg.extend(cfg); this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function() { BufferedBlockAlgorithm.reset.call(this); this._doReset(); }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. * * @example * * hasher.update('message'); * hasher.update(wordArray); */ update: function(messageUpdate) { this._append(messageUpdate); this._process(); return this; }, /** * Finalizes the hash computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The hash. * * @example * * var hash = hasher.finalize(); * var hash = hasher.finalize('message'); * var hash = hasher.finalize(wordArray); */ finalize: function(messageUpdate) { if (messageUpdate) { this._append(messageUpdate); } var hash = this._doFinalize(); return hash; }, blockSize: 512 / 32, /** * Creates a shortcut function to a hasher's object interface. * * @param {Hasher} hasher The hasher to create a helper for. * * @return {Function} The shortcut function. * * @static * * @example * * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); */ _createHelper: function(hasher) { return function(message, cfg) { return new hasher.init(cfg).finalize(message); }; }, /** * Creates a shortcut function to the HMAC's object interface. * * @param {Hasher} hasher The hasher to use in this HMAC helper. * * @return {Function} The shortcut function. * * @static * * @example * * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); */ _createHmacHelper: function(hasher) { return function(message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message); }; } }); var C_algo = C.algo = {}; return C; }(Math); return CryptoJS; }); } }); // node_modules/crypto-js/sha256.js var require_sha256 = __commonJS({ "node_modules/crypto-js/sha256.js"(exports, module2) { (function(root, factory) { if (typeof exports === "object") { module2.exports = exports = factory(require_core2()); } else if (typeof define === "function" && define.amd) { define(["./core"], factory); } else { factory(root.CryptoJS); } })(exports, function(CryptoJS) { (function(Math2) { var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; var H = []; var K = []; (function() { function isPrime(n2) { var sqrtN = Math2.sqrt(n2); for (var factor = 2; factor <= sqrtN; factor++) { if (!(n2 % factor)) { return false; } } return true; } function getFractionalBits(n2) { return (n2 - (n2 | 0)) * 4294967296 | 0; } var n = 2; var nPrime = 0; while (nPrime < 64) { if (isPrime(n)) { if (nPrime < 8) { H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2)); } K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3)); nPrime++; } n++; } })(); var W = []; var SHA256 = C_algo.SHA256 = Hasher.extend({ _doReset: function() { this._hash = new WordArray.init(H.slice(0)); }, _doProcessBlock: function(M, offset3) { var H2 = this._hash.words; var a = H2[0]; var b = H2[1]; var c = H2[2]; var d = H2[3]; var e = H2[4]; var f = H2[5]; var g = H2[6]; var h = H2[7]; for (var i = 0; i < 64; i++) { if (i < 16) { W[i] = M[offset3 + i] | 0; } else { var gamma0x = W[i - 15]; var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3; var gamma1x = W[i - 2]; var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10; W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; } var ch = e & f ^ ~e & g; var maj = a & b ^ a & c ^ b & c; var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22); var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25); var t1 = h + sigma1 + ch + K[i] + W[i]; var t2 = sigma0 + maj; h = g; g = f; f = e; e = d + t1 | 0; d = c; c = b; b = a; a = t1 + t2 | 0; } H2[0] = H2[0] + a | 0; H2[1] = H2[1] + b | 0; H2[2] = H2[2] + c | 0; H2[3] = H2[3] + d | 0; H2[4] = H2[4] + e | 0; H2[5] = H2[5] + f | 0; H2[6] = H2[6] + g | 0; H2[7] = H2[7] + h | 0; }, _doFinalize: function() { var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296); dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; this._process(); return this._hash; }, clone: function() { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); C.SHA256 = Hasher._createHelper(SHA256); C.HmacSHA256 = Hasher._createHmacHelper(SHA256); })(Math); return CryptoJS.SHA256; }); } }); // src/entry.ts var entry_exports = {}; __export(entry_exports, { default: () => Base }); module.exports = __toCommonJS(entry_exports); var import_obsidian10 = require("obsidian"); // src/ui/text_view.ts var import_obsidian9 = require("obsidian"); var import_front_matter = __toESM(require_front_matter()); // node_modules/svelte/src/runtime/internal/utils.js function noop() { } function assign(tar, src) { for (const k in src) tar[k] = src[k]; return ( /** @type {T & S} */ tar ); } function run(fn) { return fn(); } function blank_object() { return /* @__PURE__ */ Object.create(null); } function run_all(fns) { fns.forEach(run); } function is_function(thing) { return typeof thing === "function"; } function safe_not_equal(a, b) { return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; } function is_empty(obj) { return Object.keys(obj).length === 0; } function subscribe(store, ...callbacks) { if (store == null) { for (const callback of callbacks) { callback(void 0); } return noop; } const unsub = store.subscribe(...callbacks); return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; } function get_store_value(store) { let value; subscribe(store, (_) => value = _)(); return value; } function component_subscribe(component, store, callback) { component.$$.on_destroy.push(subscribe(store, callback)); } function create_slot(definition, ctx, $$scope, fn) { if (definition) { const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); return definition[0](slot_ctx); } } function get_slot_context(definition, ctx, $$scope, fn) { return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; } function get_slot_changes(definition, $$scope, dirty, fn) { if (definition[2] && fn) { const lets = definition[2](fn(dirty)); if ($$scope.dirty === void 0) { return lets; } if (typeof lets === "object") { const merged = []; const len = Math.max($$scope.dirty.length, lets.length); for (let i = 0; i < len; i += 1) { merged[i] = $$scope.dirty[i] | lets[i]; } return merged; } return $$scope.dirty | lets; } return $$scope.dirty; } function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) { if (slot_changes) { const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); slot.p(slot_context, slot_changes); } } function get_all_dirty_from_scope($$scope) { if ($$scope.ctx.length > 32) { const dirty = []; const length = $$scope.ctx.length / 32; for (let i = 0; i < length; i++) { dirty[i] = -1; } return dirty; } return -1; } function exclude_internal_props(props) { const result = {}; for (const k in props) if (k[0] !== "$") result[k] = props[k]; return result; } function compute_rest_props(props, keys) { const rest = {}; keys = new Set(keys); for (const k in props) if (!keys.has(k) && k[0] !== "$") rest[k] = props[k]; return rest; } function compute_slots(slots) { const result = {}; for (const key in slots) { result[key] = true; } return result; } function set_store_value(store, ret, value) { store.set(value); return ret; } function action_destroyer(action_result) { return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; } // node_modules/svelte/src/runtime/internal/globals.js var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : ( // @ts-ignore Node typings have this global ); // node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js var ResizeObserverSingleton = class _ResizeObserverSingleton { /** @param {ResizeObserverOptions} options */ constructor(options) { /** * @private * @readonly * @type {WeakMap} */ __publicField(this, "_listeners", "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0); /** * @private * @type {ResizeObserver} */ __publicField(this, "_observer"); /** @type {ResizeObserverOptions} */ __publicField(this, "options"); this.options = options; } /** * @param {Element} element * @param {import('./private.js').Listener} listener * @returns {() => void} */ observe(element2, listener) { this._listeners.set(element2, listener); this._getObserver().observe(element2, this.options); return () => { this._listeners.delete(element2); this._observer.unobserve(element2); }; } /** * @private */ _getObserver() { var _a; return (_a = this._observer) != null ? _a : this._observer = new ResizeObserver((entries) => { var _a2; for (const entry of entries) { _ResizeObserverSingleton.entries.set(entry.target, entry); (_a2 = this._listeners.get(entry.target)) == null ? void 0 : _a2(entry); } }); } }; ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0; // node_modules/svelte/src/runtime/internal/dom.js var is_hydrating = false; function start_hydrating() { is_hydrating = true; } function end_hydrating() { is_hydrating = false; } function append(target, node) { target.appendChild(node); } function append_styles(target, style_sheet_id, styles) { const append_styles_to = get_root_for_style(target); if (!append_styles_to.getElementById(style_sheet_id)) { const style = element("style"); style.id = style_sheet_id; style.textContent = styles; append_stylesheet(append_styles_to, style); } } function get_root_for_style(node) { if (!node) return document; const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; if (root && /** @type {ShadowRoot} */ root.host) { return ( /** @type {ShadowRoot} */ root ); } return node.ownerDocument; } function append_stylesheet(node, style) { append( /** @type {Document} */ node.head || node, style ); return style.sheet; } function insert(target, node, anchor) { target.insertBefore(node, anchor || null); } function detach(node) { if (node.parentNode) { node.parentNode.removeChild(node); } } function destroy_each(iterations, detaching) { for (let i = 0; i < iterations.length; i += 1) { if (iterations[i]) iterations[i].d(detaching); } } function element(name) { return document.createElement(name); } function svg_element(name) { return document.createElementNS("http://www.w3.org/2000/svg", name); } function text(data) { return document.createTextNode(data); } function space() { return text(" "); } function empty() { return text(""); } function listen(node, event, handler, options) { node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } function prevent_default(fn) { return function(event) { event.preventDefault(); return fn.call(this, event); }; } function stop_propagation(fn) { return function(event) { event.stopPropagation(); return fn.call(this, event); }; } function attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); } var always_set_through_set_attribute = ["width", "height"]; function set_attributes(node, attributes) { const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); for (const key in attributes) { if (attributes[key] == null) { node.removeAttribute(key); } else if (key === "style") { node.style.cssText = attributes[key]; } else if (key === "__value") { node.value = node[key] = attributes[key]; } else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) { node[key] = attributes[key]; } else { attr(node, key, attributes[key]); } } } function children(element2) { return Array.from(element2.childNodes); } function set_data(text2, data) { data = "" + data; if (text2.data === data) return; text2.data = /** @type {string} */ data; } function set_input_value(input, value) { input.value = value == null ? "" : value; } function set_style(node, key, value, important) { if (value == null) { node.style.removeProperty(key); } else { node.style.setProperty(key, value, important ? "important" : ""); } } function toggle_class(element2, name, toggle) { element2.classList.toggle(name, !!toggle); } function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { return new CustomEvent(type, { detail, bubbles, cancelable }); } function get_custom_elements_slots(element2) { const result = {}; element2.childNodes.forEach( /** @param {Element} node */ (node) => { result[node.slot || "default"] = true; } ); return result; } // node_modules/svelte/src/runtime/internal/lifecycle.js var current_component; function set_current_component(component) { current_component = component; } function get_current_component() { if (!current_component) throw new Error("Function called outside component initialization"); return current_component; } function beforeUpdate(fn) { get_current_component().$$.before_update.push(fn); } function onMount(fn) { get_current_component().$$.on_mount.push(fn); } function afterUpdate(fn) { get_current_component().$$.after_update.push(fn); } function onDestroy(fn) { get_current_component().$$.on_destroy.push(fn); } function createEventDispatcher() { const component = get_current_component(); return (type, detail, { cancelable = false } = {}) => { const callbacks = component.$$.callbacks[type]; if (callbacks) { const event = custom_event( /** @type {string} */ type, detail, { cancelable } ); callbacks.slice().forEach((fn) => { fn.call(component, event); }); return !event.defaultPrevented; } return true; }; } function bubble(component, event) { const callbacks = component.$$.callbacks[event.type]; if (callbacks) { callbacks.slice().forEach((fn) => fn.call(this, event)); } } // node_modules/svelte/src/runtime/internal/scheduler.js var dirty_components = []; var binding_callbacks = []; var render_callbacks = []; var flush_callbacks = []; var resolved_promise = /* @__PURE__ */ Promise.resolve(); var update_scheduled = false; function schedule_update() { if (!update_scheduled) { update_scheduled = true; resolved_promise.then(flush); } } function tick() { schedule_update(); return resolved_promise; } function add_render_callback(fn) { render_callbacks.push(fn); } function add_flush_callback(fn) { flush_callbacks.push(fn); } var seen_callbacks = /* @__PURE__ */ new Set(); var flushidx = 0; function flush() { if (flushidx !== 0) { return; } const saved_component = current_component; do { try { while (flushidx < dirty_components.length) { const component = dirty_components[flushidx]; flushidx++; set_current_component(component); update(component.$$); } } catch (e) { dirty_components.length = 0; flushidx = 0; throw e; } set_current_component(null); dirty_components.length = 0; flushidx = 0; while (binding_callbacks.length) binding_callbacks.pop()(); for (let i = 0; i < render_callbacks.length; i += 1) { const callback = render_callbacks[i]; if (!seen_callbacks.has(callback)) { seen_callbacks.add(callback); callback(); } } render_callbacks.length = 0; } while (dirty_components.length); while (flush_callbacks.length) { flush_callbacks.pop()(); } update_scheduled = false; seen_callbacks.clear(); set_current_component(saved_component); } function update($$) { if ($$.fragment !== null) { $$.update(); run_all($$.before_update); const dirty = $$.dirty; $$.dirty = [-1]; $$.fragment && $$.fragment.p($$.ctx, dirty); $$.after_update.forEach(add_render_callback); } } function flush_render_callbacks(fns) { const filtered = []; const targets = []; render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); targets.forEach((c) => c()); render_callbacks = filtered; } // node_modules/svelte/src/runtime/internal/transitions.js var outroing = /* @__PURE__ */ new Set(); var outros; function group_outros() { outros = { r: 0, c: [], p: outros // parent group }; } function check_outros() { if (!outros.r) { run_all(outros.c); } outros = outros.p; } function transition_in(block, local) { if (block && block.i) { outroing.delete(block); block.i(local); } } function transition_out(block, local, detach2, callback) { if (block && block.o) { if (outroing.has(block)) return; outroing.add(block); outros.c.push(() => { outroing.delete(block); if (callback) { if (detach2) block.d(1); callback(); } }); block.o(local); } else if (callback) { callback(); } } // node_modules/svelte/src/runtime/internal/each.js function ensure_array_like(array_like_or_iterator) { return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); } // node_modules/svelte/src/runtime/internal/spread.js function get_spread_update(levels, updates) { const update2 = {}; const to_null_out = {}; const accounted_for = { $$scope: 1 }; let i = levels.length; while (i--) { const o = levels[i]; const n = updates[i]; if (n) { for (const key in o) { if (!(key in n)) to_null_out[key] = 1; } for (const key in n) { if (!accounted_for[key]) { update2[key] = n[key]; accounted_for[key] = 1; } } levels[i] = n; } else { for (const key in o) { accounted_for[key] = 1; } } } for (const key in to_null_out) { if (!(key in update2)) update2[key] = void 0; } return update2; } // node_modules/svelte/src/shared/boolean_attributes.js var _boolean_attributes = ( /** @type {const} */ [ "allowfullscreen", "allowpaymentrequest", "async", "autofocus", "autoplay", "checked", "controls", "default", "defer", "disabled", "formnovalidate", "hidden", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "selected" ] ); var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]); // node_modules/svelte/src/runtime/internal/Component.js function bind(component, name, callback) { const index = component.$$.props[name]; if (index !== void 0) { component.$$.bound[index] = callback; callback(component.$$.ctx[index]); } } function create_component(block) { block && block.c(); } function mount_component(component, target, anchor) { const { fragment, after_update } = component.$$; fragment && fragment.m(target, anchor); add_render_callback(() => { const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); if (component.$$.on_destroy) { component.$$.on_destroy.push(...new_on_destroy); } else { run_all(new_on_destroy); } component.$$.on_mount = []; }); after_update.forEach(add_render_callback); } function destroy_component(component, detaching) { const $$ = component.$$; if ($$.fragment !== null) { flush_render_callbacks($$.after_update); run_all($$.on_destroy); $$.fragment && $$.fragment.d(detaching); $$.on_destroy = $$.fragment = null; $$.ctx = []; } } function make_dirty(component, i) { if (component.$$.dirty[0] === -1) { dirty_components.push(component); schedule_update(); component.$$.dirty.fill(0); } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } function init(component, options, instance11, create_fragment14, not_equal, props, append_styles2 = null, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { fragment: null, ctx: [], // state props, update: noop, not_equal, bound: blank_object(), // lifecycle on_mount: [], on_destroy: [], on_disconnect: [], before_update: [], after_update: [], context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), // everything else callbacks: blank_object(), dirty, skip_bound: false, root: options.target || parent_component.$$.root }; append_styles2 && append_styles2($$.root); let ready = false; $$.ctx = instance11 ? instance11(component, options.props || {}, (i, ret, ...rest) => { const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value); if (ready) make_dirty(component, i); } return ret; }) : []; $$.update(); ready = true; run_all($$.before_update); $$.fragment = create_fragment14 ? create_fragment14($$.ctx) : false; if (options.target) { if (options.hydrate) { start_hydrating(); const nodes = children(options.target); $$.fragment && $$.fragment.l(nodes); nodes.forEach(detach); } else { $$.fragment && $$.fragment.c(); } if (options.intro) transition_in(component.$$.fragment); mount_component(component, options.target, options.anchor); end_hydrating(); flush(); } set_current_component(parent_component); } var SvelteElement; if (typeof HTMLElement === "function") { SvelteElement = class extends HTMLElement { constructor($$componentCtor, $$slots, use_shadow_dom) { super(); /** The Svelte component constructor */ __publicField(this, "$$ctor"); /** Slots */ __publicField(this, "$$s"); /** The Svelte component instance */ __publicField(this, "$$c"); /** Whether or not the custom element is connected */ __publicField(this, "$$cn", false); /** Component props data */ __publicField(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ __publicField(this, "$$r", false); /** @type {Record} Props definition (name, reflected, type etc) */ __publicField(this, "$$p_d", {}); /** @type {Record} Event listeners */ __publicField(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ __publicField(this, "$$l_u", /* @__PURE__ */ new Map()); this.$$ctor = $$componentCtor; this.$$s = $$slots; if (use_shadow_dom) { this.attachShadow({ mode: "open" }); } } addEventListener(type, listener, options) { this.$$l[type] = this.$$l[type] || []; this.$$l[type].push(listener); if (this.$$c) { const unsub = this.$$c.$on(type, listener); this.$$l_u.set(listener, unsub); } super.addEventListener(type, listener, options); } removeEventListener(type, listener, options) { super.removeEventListener(type, listener, options); if (this.$$c) { const unsub = this.$$l_u.get(listener); if (unsub) { unsub(); this.$$l_u.delete(listener); } } if (this.$$l[type]) { const idx = this.$$l[type].indexOf(listener); if (idx >= 0) { this.$$l[type].splice(idx, 1); } } } async connectedCallback() { this.$$cn = true; if (!this.$$c) { let create_slot2 = function(name) { return () => { let node; const obj = { c: function create() { node = element("slot"); if (name !== "default") { attr(node, "name", name); } }, /** * @param {HTMLElement} target * @param {HTMLElement} [anchor] */ m: function mount(target, anchor) { insert(target, node, anchor); }, d: function destroy(detaching) { if (detaching) { detach(node); } } }; return obj; }; }; await Promise.resolve(); if (!this.$$cn || this.$$c) { return; } const $$slots = {}; const existing_slots = get_custom_elements_slots(this); for (const name of this.$$s) { if (name in existing_slots) { $$slots[name] = [create_slot2(name)]; } } for (const attribute of this.attributes) { const name = this.$$g_p(attribute.name); if (!(name in this.$$d)) { this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); } } for (const key in this.$$p_d) { if (!(key in this.$$d) && this[key] !== void 0) { this.$$d[key] = this[key]; delete this[key]; } } this.$$c = new this.$$ctor({ target: this.shadowRoot || this, props: { ...this.$$d, $$slots, $$scope: { ctx: [] } } }); const reflect_attributes = () => { this.$$r = true; for (const key in this.$$p_d) { this.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]]; if (this.$$p_d[key].reflect) { const attribute_value = get_custom_element_value( key, this.$$d[key], this.$$p_d, "toAttribute" ); if (attribute_value == null) { this.removeAttribute(this.$$p_d[key].attribute || key); } else { this.setAttribute(this.$$p_d[key].attribute || key, attribute_value); } } } this.$$r = false; }; this.$$c.$$.after_update.push(reflect_attributes); reflect_attributes(); for (const type in this.$$l) { for (const listener of this.$$l[type]) { const unsub = this.$$c.$on(type, listener); this.$$l_u.set(listener, unsub); } } this.$$l = {}; } } // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte // and setting attributes through setAttribute etc, this is helpful attributeChangedCallback(attr2, _oldValue, newValue) { var _a; if (this.$$r) return; attr2 = this.$$g_p(attr2); this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp"); (_a = this.$$c) == null ? void 0 : _a.$set({ [attr2]: this.$$d[attr2] }); } disconnectedCallback() { this.$$cn = false; Promise.resolve().then(() => { if (!this.$$cn && this.$$c) { this.$$c.$destroy(); this.$$c = void 0; } }); } $$g_p(attribute_name) { return Object.keys(this.$$p_d).find( (key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name ) || attribute_name; } }; } function get_custom_element_value(prop, value, props_definition, transform) { var _a; const type = (_a = props_definition[prop]) == null ? void 0 : _a.type; value = type === "Boolean" && typeof value !== "boolean" ? value != null : value; if (!transform || !props_definition[prop]) { return value; } else if (transform === "toAttribute") { switch (type) { case "Object": case "Array": return value == null ? null : JSON.stringify(value); case "Boolean": return value ? "" : null; case "Number": return value == null ? null : value; default: return value; } } else { switch (type) { case "Object": case "Array": return value && JSON.parse(value); case "Boolean": return value; // conversion already handled above case "Number": return value != null ? +value : value; default: return value; } } } var SvelteComponent = class { constructor() { /** * ### PRIVATE API * * Do not use, may change at any time * * @type {any} */ __publicField(this, "$$"); /** * ### PRIVATE API * * Do not use, may change at any time * * @type {any} */ __publicField(this, "$$set"); } /** @returns {void} */ $destroy() { destroy_component(this, 1); this.$destroy = noop; } /** * @template {Extract} K * @param {K} type * @param {((e: Events[K]) => void) | null | undefined} callback * @returns {() => void} */ $on(type, callback) { if (!is_function(callback)) { return noop; } const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); if (index !== -1) callbacks.splice(index, 1); }; } /** * @param {Partial} props * @returns {void} */ $set(props) { if (this.$$set && !is_empty(props)) { this.$$.skip_bound = true; this.$$set(props); this.$$.skip_bound = false; } } }; // node_modules/svelte/src/shared/version.js var PUBLIC_VERSION = "4"; // node_modules/svelte/src/runtime/internal/disclose-version/index.js if (typeof window !== "undefined") (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION); // src/parsing/kebab/kebab.ts function kebab(input) { return input.replaceAll(/\p{Lu}/gu, (match) => `-${match.toLowerCase()}`).replaceAll(/\p{Z}/gu, "-").replaceAll(/[^\p{L}\p{N}\/-]/gu, "-").replaceAll(/-+/g, "-").replace(/^-/, "").replace(/-$/, ""); } // node_modules/svelte/src/runtime/store/index.js var subscriber_queue = []; function readable(value, start) { return { subscribe: writable(value, start).subscribe }; } function writable(value, start = noop) { let stop; const subscribers = /* @__PURE__ */ new Set(); function set(new_value) { if (safe_not_equal(value, new_value)) { value = new_value; if (stop) { const run_queue = !subscriber_queue.length; for (const subscriber of subscribers) { subscriber[1](); subscriber_queue.push(subscriber, value); } if (run_queue) { for (let i = 0; i < subscriber_queue.length; i += 2) { subscriber_queue[i][0](subscriber_queue[i + 1]); } subscriber_queue.length = 0; } } } } function update2(fn) { set(fn(value)); } function subscribe2(run2, invalidate = noop) { const subscriber = [run2, invalidate]; subscribers.add(subscriber); if (subscribers.size === 1) { stop = start(set, update2) || noop; } run2(value); return () => { subscribers.delete(subscriber); if (subscribers.size === 0 && stop) { stop(); stop = null; } }; } return { set, update: update2, subscribe: subscribe2 }; } function derived(stores, fn, initial_value) { const single = !Array.isArray(stores); const stores_array = single ? [stores] : stores; if (!stores_array.every(Boolean)) { throw new Error("derived() expects stores as input, got a falsy value"); } const auto = fn.length < 2; return readable(initial_value, (set, update2) => { let started = false; const values = []; let pending = 0; let cleanup = noop; const sync = () => { if (pending) { return; } cleanup(); const result = fn(single ? values[0] : values, set, update2); if (auto) { set(result); } else { cleanup = is_function(result) ? result : noop; } }; const unsubscribers = stores_array.map( (store, i) => subscribe( store, (value) => { values[i] = value; pending &= ~(1 << i); if (started) { sync(); } }, () => { pending |= 1 << i; } ) ); started = true; sync(); return function stop() { run_all(unsubscribers); cleanup(); started = false; }; }); } // src/ui/columns/columns.ts var parseColumnSpec = (columnSpec) => { const hashMatch = columnSpec.match(/^(.+?)\(#([0-9a-fA-F]{6})\)$/); const oxMatch = columnSpec.match(/^(.+?)\(0x([0-9a-fA-F]{6})\)$/); const match = hashMatch || oxMatch; if (match && match[1] && match[2]) { return { raw: columnSpec, label: match[1], color: `#${match[2]}` }; } return { raw: columnSpec, label: columnSpec }; }; var createColumnStores = (settingsStore) => { const columnTagTable = derived([settingsStore], ([settings]) => { var _a; const output = {}; for (const column of (_a = settings.columns) != null ? _a : []) { const parsed = parseColumnSpec(column); output[kebab(parsed.label)] = parsed.label; } return output; }); const columnColourTable = derived([settingsStore], ([settings]) => { var _a; const output = {}; for (const column of (_a = settings.columns) != null ? _a : []) { const parsed = parseColumnSpec(column); if (parsed.color) { output[kebab(parsed.label)] = parsed.color; } } return output; }); return { columnTagTable, columnColourTable }; }; function isColumnTag(input, columnTagTableStore) { return input in get_store_value(columnTagTableStore); } // src/ui/components/column.svelte var import_obsidian5 = require("obsidian"); // src/ui/dnd/store.ts var isDraggingStore = writable(null); // src/ui/components/task_menu.svelte var import_obsidian2 = require("obsidian"); // src/ui/components/icon_button.svelte var import_obsidian = require("obsidian"); function add_css(target) { append_styles(target, "svelte-11ck62i", "button.svelte-11ck62i{width:24px;height:24px;display:flex;justify-content:center;align-items:center;border-radius:var(--radius-s);transition:background linear 100ms;cursor:pointer;background:unset;padding:0}button.svelte-11ck62i:focus-visible{outline:2px solid var(--background-modifier-border-focus);outline-offset:2px}"); } function create_fragment(ctx) { let button; let mounted; let dispose; let button_levels = [ { tabindex: "0" }, /*$$restProps*/ ctx[2] ]; let button_data = {}; for (let i = 0; i < button_levels.length; i += 1) { button_data = assign(button_data, button_levels[i]); } return { c() { button = element("button"); set_attributes(button, button_data); toggle_class(button, "svelte-11ck62i", true); }, m(target, anchor) { insert(target, button, anchor); if (button.autofocus) button.focus(); ctx[5](button); if (!mounted) { dispose = [ listen( button, "click", /*click_handler*/ ctx[4] ), listen( button, "keydown", /*handleKeydown*/ ctx[1] ) ]; mounted = true; } }, p(ctx2, [dirty]) { set_attributes(button, button_data = get_spread_update(button_levels, [{ tabindex: "0" }, dirty & /*$$restProps*/ 4 && /*$$restProps*/ ctx2[2]])); toggle_class(button, "svelte-11ck62i", true); }, i: noop, o: noop, d(detaching) { if (detaching) { detach(button); } ctx[5](null); mounted = false; run_all(dispose); } }; } function instance($$self, $$props, $$invalidate) { const omit_props_names = ["icon"]; let $$restProps = compute_rest_props($$props, omit_props_names); let { icon } = $$props; let element2; function handleKeydown(e) { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); element2 == null ? void 0 : element2.click(); } } function click_handler(event) { bubble.call(this, $$self, event); } function button_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { element2 = $$value; $$invalidate(0, element2); }); } $$self.$$set = ($$new_props) => { $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)); $$invalidate(2, $$restProps = compute_rest_props($$props, omit_props_names)); if ("icon" in $$new_props) $$invalidate(3, icon = $$new_props.icon); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*element, icon*/ 9) { $: { if (element2) { (0, import_obsidian.setIcon)(element2, icon); } } } }; return [element2, handleKeydown, $$restProps, icon, click_handler, button_binding]; } var Icon_button = class extends SvelteComponent { constructor(options) { super(); init(this, options, instance, create_fragment, safe_not_equal, { icon: 3 }, add_css); } }; var icon_button_default = Icon_button; // src/ui/components/task_menu.svelte function create_fragment2(ctx) { let iconbutton; let current; iconbutton = new icon_button_default({ props: { icon: "lucide-more-vertical" } }); iconbutton.$on( "click", /*showMenu*/ ctx[1] ); return { c() { create_component(iconbutton.$$.fragment); }, m(target, anchor) { mount_component(iconbutton, target, anchor); current = true; }, p: noop, i(local) { if (current) return; transition_in(iconbutton.$$.fragment, local); current = true; }, o(local) { transition_out(iconbutton.$$.fragment, local); current = false; }, d(detaching) { destroy_component(iconbutton, detaching); } }; } function instance2($$self, $$props, $$invalidate) { let $columnTagTableStore, $$unsubscribe_columnTagTableStore = noop, $$subscribe_columnTagTableStore = () => ($$unsubscribe_columnTagTableStore(), $$unsubscribe_columnTagTableStore = subscribe(columnTagTableStore, ($$value) => $$invalidate(4, $columnTagTableStore = $$value)), columnTagTableStore); $$self.$$.on_destroy.push(() => $$unsubscribe_columnTagTableStore()); let { task } = $$props; let { taskActions } = $$props; let { columnTagTableStore } = $$props; $$subscribe_columnTagTableStore(); function showMenu(e) { const menu = new import_obsidian2.Menu(); const target = e.target; if (!target) { return; } const boundingRect = target.getBoundingClientRect(); const y = boundingRect.top + boundingRect.height / 2; const x = boundingRect.left + boundingRect.width / 2; menu.addItem((i) => { i.setTitle(`Go to file`).onClick(() => taskActions.viewFile(task.id)); }); menu.addSeparator(); for (const [tag, label] of Object.entries($columnTagTableStore)) { menu.addItem((i) => { i.setTitle(`Move to ${label}`).onClick(() => taskActions.changeColumn(task.id, tag)); if (task.column === tag) { i.setDisabled(true); } }); } menu.addItem((i) => { i.setTitle(`Move to Done`).onClick(() => taskActions.markDone(task.id)); if (task.done) { i.setDisabled(true); } }); menu.addSeparator(); menu.addItem((i) => { i.setTitle(`Archive task`).onClick(() => taskActions.archiveTasks([task.id])); }); menu.addItem((i) => { i.setTitle(`Delete task`).onClick(() => taskActions.deleteTask(task.id)); }); menu.showAtPosition({ x, y }); } $$self.$$set = ($$props2) => { if ("task" in $$props2) $$invalidate(2, task = $$props2.task); if ("taskActions" in $$props2) $$invalidate(3, taskActions = $$props2.taskActions); if ("columnTagTableStore" in $$props2) $$subscribe_columnTagTableStore($$invalidate(0, columnTagTableStore = $$props2.columnTagTableStore)); }; return [columnTagTableStore, showMenu, task, taskActions]; } var Task_menu = class extends SvelteComponent { constructor(options) { super(); init(this, options, instance2, create_fragment2, safe_not_equal, { task: 2, taskActions: 3, columnTagTableStore: 0 }); } }; var task_menu_default = Task_menu; // src/ui/components/icon.svelte var import_obsidian3 = require("obsidian"); function add_css2(target) { append_styles(target, "svelte-b7hxum", ".icon.svelte-b7hxum{display:inline-flex;justify-content:center;align-items:center;flex-shrink:0}.icon.svelte-b7hxum svg{width:100%;height:100%}"); } function create_fragment3(ctx) { let span; let span_role_value; let style_width = `${/*size*/ ctx[0]}px`; let style_height = `${/*size*/ ctx[0]}px`; return { c() { span = element("span"); attr(span, "class", "icon svelte-b7hxum"); attr( span, "aria-label", /*ariaLabel*/ ctx[2] ); attr(span, "role", span_role_value = /*ariaLabel*/ ctx[2] ? "img" : void 0); set_style(span, "width", style_width); set_style(span, "height", style_height); set_style( span, "opacity", /*opacity*/ ctx[1] ); }, m(target, anchor) { insert(target, span, anchor); ctx[5](span); }, p(ctx2, [dirty]) { if (dirty & /*ariaLabel*/ 4) { attr( span, "aria-label", /*ariaLabel*/ ctx2[2] ); } if (dirty & /*ariaLabel*/ 4 && span_role_value !== (span_role_value = /*ariaLabel*/ ctx2[2] ? "img" : void 0)) { attr(span, "role", span_role_value); } if (dirty & /*size*/ 1 && style_width !== (style_width = `${/*size*/ ctx2[0]}px`)) { set_style(span, "width", style_width); } if (dirty & /*size*/ 1 && style_height !== (style_height = `${/*size*/ ctx2[0]}px`)) { set_style(span, "height", style_height); } if (dirty & /*opacity*/ 2) { set_style( span, "opacity", /*opacity*/ ctx2[1] ); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(span); } ctx[5](null); } }; } function instance3($$self, $$props, $$invalidate) { let { name } = $$props; let { size: size2 = 16 } = $$props; let { opacity = 1 } = $$props; let { ariaLabel = void 0 } = $$props; let element2; onMount(() => { if (element2) { (0, import_obsidian3.setIcon)(element2, name); } }); function span_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { element2 = $$value; $$invalidate(3, element2); }); } $$self.$$set = ($$props2) => { if ("name" in $$props2) $$invalidate(4, name = $$props2.name); if ("size" in $$props2) $$invalidate(0, size2 = $$props2.size); if ("opacity" in $$props2) $$invalidate(1, opacity = $$props2.opacity); if ("ariaLabel" in $$props2) $$invalidate(2, ariaLabel = $$props2.ariaLabel); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*element, name*/ 24) { $: { if (element2 && name) { (0, import_obsidian3.setIcon)(element2, name); } } } }; return [size2, opacity, ariaLabel, element2, name, span_binding]; } var Icon = class extends SvelteComponent { constructor(options) { super(); init( this, options, instance3, create_fragment3, safe_not_equal, { name: 4, size: 0, opacity: 1, ariaLabel: 2 }, add_css2 ); } }; var icon_default = Icon; // src/ui/components/task.svelte var import_obsidian4 = require("obsidian"); // src/ui/selection/task_selection_store.ts var taskSelectionStore = writable(/* @__PURE__ */ new Map()); function toggleTaskSelection(taskId) { taskSelectionStore.update((map) => { const current = map.get(taskId) || false; map.set(taskId, !current); return new Map(map); }); } function isTaskSelected(taskId, selectionMap) { return selectionMap.get(taskId) || false; } function clearTaskSelections() { taskSelectionStore.set(/* @__PURE__ */ new Map()); } function getSelectedTaskCount(taskIds, selectionMap) { return taskIds.filter((id) => selectionMap.get(id) || false).length; } // src/ui/components/task.svelte function add_css3(target) { append_styles(target, "svelte-1d22sh4", '.task.svelte-1d22sh4.svelte-1d22sh4{background-color:var(--background-secondary-alt);border-radius:var(--radius-m);border:var(--border-width) solid var(--background-modifier-border);cursor:grab}.task.is-dragging.svelte-1d22sh4.svelte-1d22sh4{opacity:0.15}.task.svelte-1d22sh4 .task-row.svelte-1d22sh4{padding:var(--size-4-2);display:flex;gap:var(--size-4-1);align-items:center}.task.svelte-1d22sh4 .task-row .task-row-left.svelte-1d22sh4{display:flex;align-items:center;flex-shrink:0}.task.svelte-1d22sh4 .task-row .task-row-content.svelte-1d22sh4{flex:1;min-width:0}.task.svelte-1d22sh4 .task-row .task-row-content textarea.svelte-1d22sh4{cursor:text;background-color:var(--color-base-25);width:100%}.task.svelte-1d22sh4 .task-row .task-row-content .content-preview.svelte-1d22sh4{min-height:1.5rem;display:flex;flex-direction:column;justify-content:center}.task.svelte-1d22sh4 .task-row .task-row-content .content-preview.svelte-1d22sh4:focus-within{box-shadow:0 0 0 3px var(--background-modifier-border-focus)}.task.svelte-1d22sh4 .task-row .task-row-right.svelte-1d22sh4{display:flex;align-items:center;flex-shrink:0}.task.svelte-1d22sh4 .icon-button.svelte-1d22sh4{display:flex;justify-content:center;align-items:center;width:24px;height:24px;padding:0;border:none;background:transparent;cursor:pointer;border-radius:var(--radius-s);transition:opacity 0.2s ease;position:relative;box-shadow:none}.task.svelte-1d22sh4 .icon-button.svelte-1d22sh4:hover,.task.svelte-1d22sh4 .icon-button.svelte-1d22sh4:active{background:transparent;box-shadow:none}.task.svelte-1d22sh4 .icon-button.svelte-1d22sh4:focus-visible{outline:2px solid var(--background-modifier-border-focus);outline-offset:2px}.task.svelte-1d22sh4 .icon-button .default-icon.svelte-1d22sh4,.task.svelte-1d22sh4 .icon-button .hover-icon.svelte-1d22sh4{position:absolute;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease}.task.svelte-1d22sh4 .icon-button .hover-icon.svelte-1d22sh4{opacity:0}.task.svelte-1d22sh4 .icon-button.mark-done:hover .hover-icon.svelte-1d22sh4{opacity:1}.task.svelte-1d22sh4 .icon-button.mark-done:hover .hover-icon.svelte-1d22sh4 svg{color:var(--interactive-accent)}.task.svelte-1d22sh4 .icon-button.mark-done:hover .default-icon.svelte-1d22sh4{opacity:0}.task.svelte-1d22sh4 .icon-button.mark-done.is-done .default-icon.svelte-1d22sh4 svg{opacity:1;color:var(--icon-color)}.task.svelte-1d22sh4 .icon-button.bulk-select .default-icon.svelte-1d22sh4,.task.svelte-1d22sh4 .icon-button.bulk-select .hover-icon.svelte-1d22sh4{position:absolute;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease}.task.svelte-1d22sh4 .icon-button.bulk-select .hover-icon.svelte-1d22sh4{opacity:0}.task.svelte-1d22sh4 .icon-button.bulk-select:hover .hover-icon.svelte-1d22sh4{opacity:1}.task.svelte-1d22sh4 .icon-button.bulk-select:hover .hover-icon.svelte-1d22sh4 svg{color:var(--interactive-accent)}.task.svelte-1d22sh4 .icon-button.bulk-select:hover .default-icon.svelte-1d22sh4{opacity:0}.task.svelte-1d22sh4 .icon-button.bulk-select.is-selected .default-icon.svelte-1d22sh4 svg{opacity:1;color:var(--icon-color)}.task.svelte-1d22sh4 .task-footer.svelte-1d22sh4{border-top:var(--border-width) solid var(--background-modifier-border);padding:var(--size-4-2);padding-top:var(--size-4-1)}.task.svelte-1d22sh4 .task-footer .go-to-file-button.svelte-1d22sh4{display:flex;align-items:center;justify-content:flex-start;gap:var(--size-2-1);width:100%;padding:0;border:none;background:transparent;cursor:pointer;text-align:left;box-shadow:none;transition:opacity 0.2s ease;border-radius:var(--radius-s)}.task.svelte-1d22sh4 .task-footer .go-to-file-button.svelte-1d22sh4:hover{background:transparent;box-shadow:none}.task.svelte-1d22sh4 .task-footer .go-to-file-button.svelte-1d22sh4:hover svg{opacity:1 !important;color:var(--interactive-accent)}.task.svelte-1d22sh4 .task-footer .go-to-file-button:hover .file-path.svelte-1d22sh4{color:var(--interactive-accent)}.task.svelte-1d22sh4 .task-footer .go-to-file-button.svelte-1d22sh4:focus-visible{outline:2px solid var(--background-modifier-border-focus);outline-offset:2px}.task.svelte-1d22sh4 .task-footer .go-to-file-button .file-path.svelte-1d22sh4{margin:0;font-size:var(--font-ui-smaller);color:var(--text-muted);transition:color 0.2s ease;overflow-wrap:anywhere;white-space:normal;flex:1;min-width:0;line-height:1.3}.task.svelte-1d22sh4 .task-tags.svelte-1d22sh4{display:flex;flex-wrap:wrap;gap:var(--size-4-1) var(--size-2-1);padding:var(--size-4-2) var(--size-2-2);padding-top:0}.task-row-content *{word-break:break-word;margin:0}.task-row-content img{max-width:100%;max-height:160px;object-fit:contain}.task-row-content code{white-space:pre-wrap}.task-row-content input[type="checkbox"]{pointer-events:none}'); } function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[33] = list[i]; return child_ctx; } function create_else_block_1(ctx) { let button; let span0; let icon0; let t; let span1; let icon1; let button_aria_label_value; let button_aria_pressed_value; let button_title_value; let current; let mounted; let dispose; icon0 = new icon_default({ props: { name: ( /*task*/ ctx[0].done ? "lucide-circle-check" : "lucide-circle" ), size: 18, opacity: 0.5 } }); icon1 = new icon_default({ props: { name: "lucide-circle-check", size: 18, opacity: 1 } }); return { c() { button = element("button"); span0 = element("span"); create_component(icon0.$$.fragment); t = space(); span1 = element("span"); create_component(icon1.$$.fragment); attr(span0, "class", "default-icon svelte-1d22sh4"); attr(span1, "class", "hover-icon svelte-1d22sh4"); attr(button, "class", "icon-button mark-done svelte-1d22sh4"); attr(button, "aria-label", button_aria_label_value = /*task*/ ctx[0].done ? "Mark as incomplete" : "Move to Done"); attr(button, "aria-pressed", button_aria_pressed_value = /*task*/ ctx[0].done); attr(button, "title", button_title_value = /*task*/ ctx[0].done ? "Mark as incomplete" : "Move to Done"); attr(button, "tabindex", "0"); toggle_class( button, "is-done", /*task*/ ctx[0].done ); }, m(target, anchor) { insert(target, button, anchor); append(button, span0); mount_component(icon0, span0, null); append(button, t); append(button, span1); mount_component(icon1, span1, null); current = true; if (!mounted) { dispose = [ listen( button, "click", /*click_handler_1*/ ctx[23] ), listen( button, "keydown", /*keydown_handler_1*/ ctx[24] ) ]; mounted = true; } }, p(ctx2, dirty) { const icon0_changes = {}; if (dirty[0] & /*task*/ 1) icon0_changes.name = /*task*/ ctx2[0].done ? "lucide-circle-check" : "lucide-circle"; icon0.$set(icon0_changes); if (!current || dirty[0] & /*task*/ 1 && button_aria_label_value !== (button_aria_label_value = /*task*/ ctx2[0].done ? "Mark as incomplete" : "Move to Done")) { attr(button, "aria-label", button_aria_label_value); } if (!current || dirty[0] & /*task*/ 1 && button_aria_pressed_value !== (button_aria_pressed_value = /*task*/ ctx2[0].done)) { attr(button, "aria-pressed", button_aria_pressed_value); } if (!current || dirty[0] & /*task*/ 1 && button_title_value !== (button_title_value = /*task*/ ctx2[0].done ? "Mark as incomplete" : "Move to Done")) { attr(button, "title", button_title_value); } if (!current || dirty[0] & /*task*/ 1) { toggle_class( button, "is-done", /*task*/ ctx2[0].done ); } }, i(local) { if (current) return; transition_in(icon0.$$.fragment, local); transition_in(icon1.$$.fragment, local); current = true; }, o(local) { transition_out(icon0.$$.fragment, local); transition_out(icon1.$$.fragment, local); current = false; }, d(detaching) { if (detaching) { detach(button); } destroy_component(icon0); destroy_component(icon1); mounted = false; run_all(dispose); } }; } function create_if_block_3(ctx) { let button; let span0; let icon0; let t; let span1; let icon1; let current; let mounted; let dispose; icon0 = new icon_default({ props: { name: ( /*isSelected*/ ctx[9] ? "lucide-check-square" : "lucide-square" ), size: 18, opacity: ( /*isSelected*/ ctx[9] ? 1 : 0.5 ) } }); icon1 = new icon_default({ props: { name: "lucide-check-square", size: 18, opacity: 1 } }); return { c() { button = element("button"); span0 = element("span"); create_component(icon0.$$.fragment); t = space(); span1 = element("span"); create_component(icon1.$$.fragment); attr(span0, "class", "default-icon svelte-1d22sh4"); attr(span1, "class", "hover-icon svelte-1d22sh4"); attr(button, "class", "icon-button bulk-select svelte-1d22sh4"); attr(button, "aria-label", "Select for bulk actions"); attr( button, "aria-pressed", /*isSelected*/ ctx[9] ); attr(button, "title", "Select for bulk actions"); attr(button, "tabindex", "0"); toggle_class( button, "is-selected", /*isSelected*/ ctx[9] ); }, m(target, anchor) { insert(target, button, anchor); append(button, span0); mount_component(icon0, span0, null); append(button, t); append(button, span1); mount_component(icon1, span1, null); current = true; if (!mounted) { dispose = [ listen( button, "click", /*click_handler*/ ctx[21] ), listen( button, "keydown", /*keydown_handler*/ ctx[22] ) ]; mounted = true; } }, p(ctx2, dirty) { const icon0_changes = {}; if (dirty[0] & /*isSelected*/ 512) icon0_changes.name = /*isSelected*/ ctx2[9] ? "lucide-check-square" : "lucide-square"; if (dirty[0] & /*isSelected*/ 512) icon0_changes.opacity = /*isSelected*/ ctx2[9] ? 1 : 0.5; icon0.$set(icon0_changes); if (!current || dirty[0] & /*isSelected*/ 512) { attr( button, "aria-pressed", /*isSelected*/ ctx2[9] ); } if (!current || dirty[0] & /*isSelected*/ 512) { toggle_class( button, "is-selected", /*isSelected*/ ctx2[9] ); } }, i(local) { if (current) return; transition_in(icon0.$$.fragment, local); transition_in(icon1.$$.fragment, local); current = true; }, o(local) { transition_out(icon0.$$.fragment, local); transition_out(icon1.$$.fragment, local); current = false; }, d(detaching) { if (detaching) { detach(button); } destroy_component(icon0); destroy_component(icon1); mounted = false; run_all(dispose); } }; } function create_else_block(ctx) { let div; let mounted; let dispose; return { c() { div = element("div"); attr(div, "role", "button"); attr(div, "class", "content-preview markdown-rendered svelte-1d22sh4"); attr(div, "tabindex", "0"); }, m(target, anchor) { insert(target, div, anchor); ctx[26](div); if (!mounted) { dispose = [ listen( div, "mouseup", /*handleFocus*/ ctx[16] ), listen( div, "keypress", /*handleOpenKeypress*/ ctx[13] ) ]; mounted = true; } }, p: noop, d(detaching) { if (detaching) { detach(div); } ctx[26](null); mounted = false; run_all(dispose); } }; } function create_if_block_2(ctx) { let textarea; let textarea_value_value; let mounted; let dispose; return { c() { textarea = element("textarea"); textarea.value = textarea_value_value = /*task*/ ctx[0].content.replaceAll("
", "\n"); attr(textarea, "class", "svelte-1d22sh4"); toggle_class( textarea, "editing", /*isEditing*/ ctx[5] ); }, m(target, anchor) { insert(target, textarea, anchor); ctx[25](textarea); if (!mounted) { dispose = [ listen( textarea, "keypress", /*handleKeypress*/ ctx[12] ), listen( textarea, "blur", /*handleContentBlur*/ ctx[11] ), listen(textarea, "input", onInput) ]; mounted = true; } }, p(ctx2, dirty) { if (dirty[0] & /*task*/ 1 && textarea_value_value !== (textarea_value_value = /*task*/ ctx2[0].content.replaceAll("
", "\n"))) { textarea.value = textarea_value_value; } if (dirty[0] & /*isEditing*/ 32) { toggle_class( textarea, "editing", /*isEditing*/ ctx2[5] ); } }, d(detaching) { if (detaching) { detach(textarea); } ctx[25](null); mounted = false; run_all(dispose); } }; } function create_if_block_1(ctx) { let div; let button; let icon; let t0; let span; let t1_value = ( /*task*/ ctx[0].path + "" ); let t1; let current; let mounted; let dispose; icon = new icon_default({ props: { name: "lucide-arrow-up-right", size: 18, opacity: 0.5 } }); return { c() { div = element("div"); button = element("button"); create_component(icon.$$.fragment); t0 = space(); span = element("span"); t1 = text(t1_value); attr(span, "class", "file-path svelte-1d22sh4"); attr(button, "class", "go-to-file-button svelte-1d22sh4"); attr(button, "aria-label", "Go to file"); attr(button, "title", "Go to file"); attr(button, "tabindex", "0"); attr(div, "class", "task-footer svelte-1d22sh4"); }, m(target, anchor) { insert(target, div, anchor); append(div, button); mount_component(icon, button, null); append(button, t0); append(button, span); append(span, t1); current = true; if (!mounted) { dispose = [ listen( button, "click", /*click_handler_2*/ ctx[27] ), listen( button, "keydown", /*keydown_handler_2*/ ctx[28] ) ]; mounted = true; } }, p(ctx2, dirty) { if ((!current || dirty[0] & /*task*/ 1) && t1_value !== (t1_value = /*task*/ ctx2[0].path + "")) set_data(t1, t1_value); }, i(local) { if (current) return; transition_in(icon.$$.fragment, local); current = true; }, o(local) { transition_out(icon.$$.fragment, local); current = false; }, d(detaching) { if (detaching) { detach(div); } destroy_component(icon); mounted = false; run_all(dispose); } }; } function create_if_block(ctx) { let div; let each_value = ensure_array_like( /*task*/ ctx[0].tags ); let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } return { c() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } attr(div, "class", "task-tags svelte-1d22sh4"); }, m(target, anchor) { insert(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { each_blocks[i].m(div, null); } } }, p(ctx2, dirty) { if (dirty[0] & /*task*/ 1) { each_value = ensure_array_like( /*task*/ ctx2[0].tags ); let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context(ctx2, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { each_blocks[i] = create_each_block(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } }, d(detaching) { if (detaching) { detach(div); } destroy_each(each_blocks, detaching); } }; } function create_each_block(ctx) { let span2; let span0; let span1; let t1_value = ( /*tag*/ ctx[33] + "" ); let t1; let t2; return { c() { span2 = element("span"); span0 = element("span"); span0.textContent = "#"; span1 = element("span"); t1 = text(t1_value); t2 = space(); attr(span0, "class", "cm-formatting cm-formatting-hashtag cm-hashtag cm-hashtag-begin cm-list-1"); attr(span1, "class", "cm-hashtag cm-hashtag-end cm-list-1"); }, m(target, anchor) { insert(target, span2, anchor); append(span2, span0); append(span2, span1); append(span1, t1); append(span2, t2); }, p(ctx2, dirty) { if (dirty[0] & /*task*/ 1 && t1_value !== (t1_value = /*tag*/ ctx2[33] + "")) set_data(t1, t1_value); }, d(detaching) { if (detaching) { detach(span2); } } }; } function create_fragment4(ctx) { let div4; let div3; let div0; let current_block_type_index; let if_block0; let t0; let div1; let t1; let div2; let taskmenu; let t2; let t3; let div4_draggable_value; let current; let mounted; let dispose; const if_block_creators = [create_if_block_3, create_else_block_1]; const if_blocks = []; function select_block_type(ctx2, dirty) { if ( /*isInSelectionMode*/ ctx2[4] ) return 0; return 1; } current_block_type_index = select_block_type(ctx, [-1, -1]); if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); function select_block_type_1(ctx2, dirty) { if ( /*isEditing*/ ctx2[5] ) return create_if_block_2; return create_else_block; } let current_block_type = select_block_type_1(ctx, [-1, -1]); let if_block1 = current_block_type(ctx); taskmenu = new task_menu_default({ props: { task: ( /*task*/ ctx[0] ), taskActions: ( /*taskActions*/ ctx[1] ), columnTagTableStore: ( /*columnTagTableStore*/ ctx[2] ) } }); let if_block2 = ( /*showFilepath*/ ctx[3] && create_if_block_1(ctx) ); let if_block3 = ( /*shouldconsolidateTags*/ ctx[10] && create_if_block(ctx) ); return { c() { div4 = element("div"); div3 = element("div"); div0 = element("div"); if_block0.c(); t0 = space(); div1 = element("div"); if_block1.c(); t1 = space(); div2 = element("div"); create_component(taskmenu.$$.fragment); t2 = space(); if (if_block2) if_block2.c(); t3 = space(); if (if_block3) if_block3.c(); attr(div0, "class", "task-row-left svelte-1d22sh4"); attr(div1, "class", "task-row-content svelte-1d22sh4"); attr(div2, "class", "task-row-right svelte-1d22sh4"); attr(div3, "class", "task-row svelte-1d22sh4"); attr(div4, "class", "task svelte-1d22sh4"); attr(div4, "role", "group"); attr(div4, "draggable", div4_draggable_value = !/*isEditing*/ ctx[5]); toggle_class( div4, "is-dragging", /*isDragging*/ ctx[8] ); }, m(target, anchor) { insert(target, div4, anchor); append(div4, div3); append(div3, div0); if_blocks[current_block_type_index].m(div0, null); append(div3, t0); append(div3, div1); if_block1.m(div1, null); append(div3, t1); append(div3, div2); mount_component(taskmenu, div2, null); append(div4, t2); if (if_block2) if_block2.m(div4, null); append(div4, t3); if (if_block3) if_block3.m(div4, null); current = true; if (!mounted) { dispose = [ listen( div4, "dragstart", /*handleDragStart*/ ctx[14] ), listen( div4, "dragend", /*handleDragEnd*/ ctx[15] ) ]; mounted = true; } }, p(ctx2, dirty) { let previous_block_index = current_block_type_index; current_block_type_index = select_block_type(ctx2, dirty); if (current_block_type_index === previous_block_index) { if_blocks[current_block_type_index].p(ctx2, dirty); } else { group_outros(); transition_out(if_blocks[previous_block_index], 1, 1, () => { if_blocks[previous_block_index] = null; }); check_outros(); if_block0 = if_blocks[current_block_type_index]; if (!if_block0) { if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); if_block0.c(); } else { if_block0.p(ctx2, dirty); } transition_in(if_block0, 1); if_block0.m(div0, null); } if (current_block_type === (current_block_type = select_block_type_1(ctx2, dirty)) && if_block1) { if_block1.p(ctx2, dirty); } else { if_block1.d(1); if_block1 = current_block_type(ctx2); if (if_block1) { if_block1.c(); if_block1.m(div1, null); } } const taskmenu_changes = {}; if (dirty[0] & /*task*/ 1) taskmenu_changes.task = /*task*/ ctx2[0]; if (dirty[0] & /*taskActions*/ 2) taskmenu_changes.taskActions = /*taskActions*/ ctx2[1]; if (dirty[0] & /*columnTagTableStore*/ 4) taskmenu_changes.columnTagTableStore = /*columnTagTableStore*/ ctx2[2]; taskmenu.$set(taskmenu_changes); if ( /*showFilepath*/ ctx2[3] ) { if (if_block2) { if_block2.p(ctx2, dirty); if (dirty[0] & /*showFilepath*/ 8) { transition_in(if_block2, 1); } } else { if_block2 = create_if_block_1(ctx2); if_block2.c(); transition_in(if_block2, 1); if_block2.m(div4, t3); } } else if (if_block2) { group_outros(); transition_out(if_block2, 1, 1, () => { if_block2 = null; }); check_outros(); } if ( /*shouldconsolidateTags*/ ctx2[10] ) { if (if_block3) { if_block3.p(ctx2, dirty); } else { if_block3 = create_if_block(ctx2); if_block3.c(); if_block3.m(div4, null); } } else if (if_block3) { if_block3.d(1); if_block3 = null; } if (!current || dirty[0] & /*isEditing*/ 32 && div4_draggable_value !== (div4_draggable_value = !/*isEditing*/ ctx2[5])) { attr(div4, "draggable", div4_draggable_value); } if (!current || dirty[0] & /*isDragging*/ 256) { toggle_class( div4, "is-dragging", /*isDragging*/ ctx2[8] ); } }, i(local) { if (current) return; transition_in(if_block0); transition_in(taskmenu.$$.fragment, local); transition_in(if_block2); current = true; }, o(local) { transition_out(if_block0); transition_out(taskmenu.$$.fragment, local); transition_out(if_block2); current = false; }, d(detaching) { if (detaching) { detach(div4); } if_blocks[current_block_type_index].d(); if_block1.d(); destroy_component(taskmenu); if (if_block2) if_block2.d(); if (if_block3) if_block3.d(); mounted = false; run_all(dispose); } }; } function onInput(e) { e.currentTarget.style.height = `0px`; e.currentTarget.style.height = `${e.currentTarget.scrollHeight}px`; } function instance4($$self, $$props, $$invalidate) { let shouldconsolidateTags; let isSelected; let $taskSelectionStore; component_subscribe($$self, taskSelectionStore, ($$value) => $$invalidate(20, $taskSelectionStore = $$value)); let { app } = $$props; let { task } = $$props; let { taskActions } = $$props; let { columnTagTableStore } = $$props; let { showFilepath } = $$props; let { consolidateTags } = $$props; let { displayColumn } = $$props; let { isInSelectionMode = false } = $$props; function handleContentBlur() { $$invalidate(5, isEditing = false); const content = textAreaEl == null ? void 0 : textAreaEl.value; if (!content) return; const updatedContent = content.replaceAll("\n", "
"); taskActions.updateContent(task.id, updatedContent); } function handleKeypress(e) { if (e.key === "Enter" && !e.shiftKey || e.key === "Escape") { textAreaEl == null ? void 0 : textAreaEl.blur(); } } function handleOpenKeypress(e) { if (e.key === "Enter" || e.key === " ") { handleFocus(); } } let isDragging = false; let isEditing = false; function handleDragStart(e) { handleContentBlur(); $$invalidate(8, isDragging = true); isDraggingStore.set({ fromColumn: displayColumn }); if (e.dataTransfer) { e.dataTransfer.setData("text/plain", task.id); e.dataTransfer.dropEffect = "move"; } } function handleDragEnd() { $$invalidate(8, isDragging = false); isDraggingStore.set(null); } let textAreaEl; let previewContainerEl; let markdownComponent; function handleFocus(e) { const path = (e == null ? void 0 : e.composedPath()) || []; for (const element2 of path) { if (element2 instanceof HTMLElement && element2.tagName.toLowerCase() === "a") { return; } } $$invalidate(5, isEditing = true); setTimeout( () => { textAreaEl == null ? void 0 : textAreaEl.focus(); }, 100 ); } async function renderMarkdown() { if (!previewContainerEl) return; if (markdownComponent) { markdownComponent.unload(); } previewContainerEl.empty(); markdownComponent = new import_obsidian4.Component(); const contentToRender = (task.content + (task.blockLink ? ` ^${task.blockLink}` : "")).replaceAll("
", "\n"); await import_obsidian4.MarkdownRenderer.render(app, contentToRender, previewContainerEl, task.path, markdownComponent); setupLinkHandlers(); postProcessRenderedContent(); } function setupLinkHandlers() { if (!previewContainerEl) return; const internalLinks = previewContainerEl.querySelectorAll("a.internal-link"); internalLinks.forEach((link) => { const anchorEl = link; anchorEl.addEventListener("click", (e) => { e.preventDefault(); e.stopPropagation(); const linkTarget = anchorEl.getAttribute("data-href"); if (linkTarget && app) { app.workspace.openLinkText(linkTarget, task.path, true); } }); anchorEl.addEventListener("mouseover", (e) => { const linkTarget = anchorEl.getAttribute("data-href"); if (linkTarget && app && previewContainerEl) { app.workspace.trigger("hover-link", { event: e, source: "kanban-view", hoverParent: previewContainerEl, targetEl: anchorEl, linktext: linkTarget, sourcePath: task.path }); } }); }); } function postProcessRenderedContent() { if (!previewContainerEl) return; previewContainerEl.querySelectorAll("a:not(.internal-link)").forEach((a) => { const anchor = a; anchor.target = "_blank"; anchor.rel = "noopener noreferrer"; anchor.addEventListener("click", (e) => e.stopPropagation()); anchor.addEventListener("keypress", (e) => e.stopPropagation()); }); previewContainerEl.querySelectorAll('input[type="checkbox"]').forEach((cb) => { const el = cb; el.disabled = true; }); previewContainerEl.querySelectorAll("iframe, audio, video").forEach((el) => { el.remove(); }); } onDestroy(() => { if (markdownComponent) { markdownComponent.unload(); } }); const click_handler = () => toggleTaskSelection(task.id); const keydown_handler = (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); toggleTaskSelection(task.id); } }; const click_handler_1 = () => taskActions.toggleDone(task.id); const keydown_handler_1 = (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); taskActions.toggleDone(task.id); } }; function textarea_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { textAreaEl = $$value; $$invalidate(6, textAreaEl); }); } function div_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { previewContainerEl = $$value; $$invalidate(7, previewContainerEl); }); } const click_handler_2 = () => taskActions.viewFile(task.id); const keydown_handler_2 = (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); taskActions.viewFile(task.id); } }; $$self.$$set = ($$props2) => { if ("app" in $$props2) $$invalidate(17, app = $$props2.app); if ("task" in $$props2) $$invalidate(0, task = $$props2.task); if ("taskActions" in $$props2) $$invalidate(1, taskActions = $$props2.taskActions); if ("columnTagTableStore" in $$props2) $$invalidate(2, columnTagTableStore = $$props2.columnTagTableStore); if ("showFilepath" in $$props2) $$invalidate(3, showFilepath = $$props2.showFilepath); if ("consolidateTags" in $$props2) $$invalidate(18, consolidateTags = $$props2.consolidateTags); if ("displayColumn" in $$props2) $$invalidate(19, displayColumn = $$props2.displayColumn); if ("isInSelectionMode" in $$props2) $$invalidate(4, isInSelectionMode = $$props2.isInSelectionMode); }; $$self.$$.update = () => { if ($$self.$$.dirty[0] & /*task, isEditing, previewContainerEl*/ 161) { $: if (task && !isEditing && previewContainerEl) { renderMarkdown(); } } if ($$self.$$.dirty[0] & /*textAreaEl*/ 64) { $: { if (textAreaEl) { $$invalidate(6, textAreaEl.style.height = `0px`, textAreaEl); $$invalidate(6, textAreaEl.style.height = `${textAreaEl.scrollHeight}px`, textAreaEl); } } } if ($$self.$$.dirty[0] & /*consolidateTags, task*/ 262145) { $: $$invalidate(10, shouldconsolidateTags = consolidateTags && task.tags.size > 0); } if ($$self.$$.dirty[0] & /*task, $taskSelectionStore*/ 1048577) { $: $$invalidate(9, isSelected = isTaskSelected(task.id, $taskSelectionStore)); } }; return [ task, taskActions, columnTagTableStore, showFilepath, isInSelectionMode, isEditing, textAreaEl, previewContainerEl, isDragging, isSelected, shouldconsolidateTags, handleContentBlur, handleKeypress, handleOpenKeypress, handleDragStart, handleDragEnd, handleFocus, app, consolidateTags, displayColumn, $taskSelectionStore, click_handler, keydown_handler, click_handler_1, keydown_handler_1, textarea_binding, div_binding, click_handler_2, keydown_handler_2 ]; } var Task = class extends SvelteComponent { constructor(options) { super(); init( this, options, instance4, create_fragment4, safe_not_equal, { app: 17, task: 0, taskActions: 1, columnTagTableStore: 2, showFilepath: 3, consolidateTags: 18, displayColumn: 19, isInSelectionMode: 4 }, add_css3, [-1, -1] ); } }; var task_default = Task; // src/ui/selection/selection_mode_store.ts var selectionModeStore = writable(/* @__PURE__ */ new Map()); function toggleSelectionMode(column) { selectionModeStore.update((map) => { const current = map.get(column) || false; const newMode = !current; map.set(column, newMode); if (current && !newMode) { taskSelectionStore.set(/* @__PURE__ */ new Map()); } return new Map(map); }); } // src/ui/components/column.svelte function add_css4(target) { append_styles(target, "svelte-5t18g7", ".column.svelte-5t18g7.svelte-5t18g7{display:flex;flex-direction:column;align-self:flex-start;width:var(--column-width, 300px);flex-shrink:0;padding:var(--size-4-3);border-radius:var(--radius-m);border:var(--border-width) solid var(--background-modifier-border);background-color:var(--background-secondary)}.column.vertical-flow.svelte-5t18g7.svelte-5t18g7{width:100%}.column.vertical-flow.svelte-5t18g7 .tasks-wrapper.svelte-5t18g7{width:100%;display:flex;flex-direction:column;gap:var(--size-4-2)}.column.vertical-flow.svelte-5t18g7 .tasks-wrapper .tasks.svelte-5t18g7{flex-direction:row;flex-wrap:wrap;align-items:flex-start}.column.vertical-flow.svelte-5t18g7 .tasks-wrapper .tasks.svelte-5t18g7 .task{width:min(var(--column-width, 300px), 100%);flex-shrink:0}.column.svelte-5t18g7 .column-header.row-header.svelte-5t18g7{display:flex;align-items:center;gap:var(--size-4-2);margin-bottom:var(--size-4-2)}.column.svelte-5t18g7 .column-header.row-header .header.svelte-5t18g7{margin-right:0}.column.svelte-5t18g7 .column-header.row-header .mode-toggle-container.svelte-5t18g7{margin-top:0;margin-bottom:0;gap:var(--size-4-1)}.column.svelte-5t18g7 .column-header.row-header .mode-toggle-container .selection-count.svelte-5t18g7:empty{display:none}.column.svelte-5t18g7 .column-header.row-header .mode-toggle-container .selection-count.svelte-5t18g7{min-width:0;flex:0}.column.drop-active.svelte-5t18g7 .tasks-wrapper .tasks.svelte-5t18g7{opacity:0.4}.column.drop-active.drop-hover.svelte-5t18g7 .tasks-wrapper.svelte-5t18g7{border-color:var(--color-base-70)}.column.svelte-5t18g7 .header.svelte-5t18g7{display:flex;justify-content:space-between;align-items:center;height:24px;flex-shrink:0}.column.svelte-5t18g7 .header h2.svelte-5t18g7{font-size:var(--font-ui-larger);font-weight:var(--font-bold);margin:0}.column.svelte-5t18g7 .mode-toggle-container.svelte-5t18g7{display:flex;align-items:center;margin-top:var(--size-4-3);margin-bottom:var(--size-4-2);gap:var(--size-4-2)}.column.svelte-5t18g7 .mode-toggle-container .segmented-control.svelte-5t18g7{display:inline-flex;background:var(--background-primary);border:none;border-radius:var(--radius-s);padding:2px;gap:0}.column.svelte-5t18g7 .mode-toggle-container .segmented-control.has-color.svelte-5t18g7{background:var(--toggle-bg-color)}.column.svelte-5t18g7 .mode-toggle-container .segmented-control .segment.svelte-5t18g7{padding:2px var(--size-4-2);border:none;background:transparent;border-radius:calc(var(--radius-s) - 2px);cursor:pointer;font-size:var(--font-ui-smaller);color:var(--text-muted);transition:all 0.2s ease;box-shadow:none;position:relative;z-index:1;white-space:nowrap}.column.svelte-5t18g7 .mode-toggle-container .segmented-control .segment.active.svelte-5t18g7{background:var(--background-secondary);border:none;color:var(--text-normal)}.column.svelte-5t18g7 .mode-toggle-container .segmented-control .segment.svelte-5t18g7:focus-visible{outline:2px solid var(--background-modifier-border-focus);outline-offset:2px}.column.svelte-5t18g7 .mode-toggle-container .segmented-control.has-color .segment.active.svelte-5t18g7{background:var(--toggle-active-color);border:none;color:var(--text-normal)}.column.svelte-5t18g7 .mode-toggle-container .selection-count.svelte-5t18g7{font-size:var(--font-ui-smaller);color:var(--text-muted);flex:1}.column.svelte-5t18g7 .mode-toggle-container .bulk-actions-button.svelte-5t18g7{opacity:0;pointer-events:none;transition:opacity 0.2s ease}.column.svelte-5t18g7 .mode-toggle-container .bulk-actions-button.visible.svelte-5t18g7{opacity:1;pointer-events:auto}.column.svelte-5t18g7 .divide.svelte-5t18g7{width:calc(100% + 2 * var(--size-4-3));border-bottom:var(--border-width) solid var(--column-color, var(--background-modifier-border));margin:var(--size-4-3) calc(-1 * var(--size-4-3))}.column.svelte-5t18g7 .tasks-wrapper.svelte-5t18g7{min-height:50px;border:var(--border-width) dashed transparent;border-radius:var(--radius-m)}.column.svelte-5t18g7 .tasks-wrapper .tasks.svelte-5t18g7{display:flex;flex-direction:column;gap:var(--size-4-2)}.column.svelte-5t18g7 .tasks-wrapper .add-new-btn.svelte-5t18g7{display:flex;align-items:center;align-self:flex-start;cursor:pointer;margin-top:var(--size-4-2)}.column.svelte-5t18g7 .tasks-wrapper .add-new-btn span.svelte-5t18g7{height:18px}"); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[35] = list[i]; return child_ctx; } function create_if_block2(ctx) { let div8; let div5; let div0; let h2; let t0; let h2_id_value; let t1; let t2; let div4; let div1; let button0; let t3; let button0_aria_pressed_value; let t4; let button1; let t5; let t6; let div2; let t7; let div3; let iconbutton; let t8; let t9; let div7; let div6; let t10; let show_if = isColumnTag( /*column*/ ctx[1], /*columnTagTableStore*/ ctx[5] ); let div8_aria_labelledby_value; let div8_style_value; let current; let mounted; let dispose; let if_block0 = ( /*column*/ ctx[1] === "done" && create_if_block_4(ctx) ); let if_block1 = ( /*isInSelectionMode*/ ctx[15] && /*selectedCount*/ ctx[14] > 0 && create_if_block_32(ctx) ); iconbutton = new icon_button_default({ props: { icon: "lucide-more-vertical", "aria-label": "Bulk actions" } }); iconbutton.$on( "click", /*showBulkActionsMenu*/ ctx[19] ); let if_block2 = !/*isVerticalFlow*/ ctx[9] && create_if_block_22(ctx); let each_value = ensure_array_like( /*sortedTasks*/ ctx[13] ); let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); } const out = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; }); let if_block3 = show_if && create_if_block_12(ctx); return { c() { div8 = element("div"); div5 = element("div"); div0 = element("div"); h2 = element("h2"); t0 = text( /*columnTitle*/ ctx[17] ); t1 = space(); if (if_block0) if_block0.c(); t2 = space(); div4 = element("div"); div1 = element("div"); button0 = element("button"); t3 = text("Done"); t4 = space(); button1 = element("button"); t5 = text("Select"); t6 = space(); div2 = element("div"); if (if_block1) if_block1.c(); t7 = space(); div3 = element("div"); create_component(iconbutton.$$.fragment); t8 = space(); if (if_block2) if_block2.c(); t9 = space(); div7 = element("div"); div6 = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } t10 = space(); if (if_block3) if_block3.c(); attr(h2, "id", h2_id_value = "column-title-" + /*column*/ ctx[1]); attr(h2, "class", "svelte-5t18g7"); attr(div0, "class", "header svelte-5t18g7"); attr(button0, "class", "segment svelte-5t18g7"); attr(button0, "aria-label", "Mark as done mode"); attr(button0, "aria-pressed", button0_aria_pressed_value = !/*isInSelectionMode*/ ctx[15]); attr(button0, "tabindex", "0"); toggle_class(button0, "active", !/*isInSelectionMode*/ ctx[15]); attr(button1, "class", "segment svelte-5t18g7"); attr(button1, "aria-label", "Selection mode"); attr( button1, "aria-pressed", /*isInSelectionMode*/ ctx[15] ); attr(button1, "tabindex", "0"); toggle_class( button1, "active", /*isInSelectionMode*/ ctx[15] ); attr(div1, "class", "segmented-control svelte-5t18g7"); attr(div1, "role", "toolbar"); attr(div1, "aria-label", "Task interaction mode"); toggle_class(div1, "has-color", !!/*columnColor*/ ctx[16]); set_style( div1, "--toggle-bg-color", /*columnColor*/ ctx[16] ? `color-mix(in srgb, ${/*columnColor*/ ctx[16]} 25%, white)` : void 0 ); set_style( div1, "--toggle-active-color", /*columnColor*/ ctx[16] || void 0 ); attr(div2, "class", "selection-count svelte-5t18g7"); attr(div2, "aria-live", "polite"); attr(div3, "class", "bulk-actions-button svelte-5t18g7"); toggle_class( div3, "visible", /*isInSelectionMode*/ ctx[15] && /*selectedCount*/ ctx[14] > 0 ); attr(div4, "class", "mode-toggle-container svelte-5t18g7"); attr(div5, "class", "column-header svelte-5t18g7"); toggle_class( div5, "row-header", /*isVerticalFlow*/ ctx[9] ); attr(div6, "class", "tasks svelte-5t18g7"); attr(div7, "class", "tasks-wrapper svelte-5t18g7"); attr(div8, "role", "group"); attr(div8, "aria-labelledby", div8_aria_labelledby_value = "column-title-" + /*column*/ ctx[1]); attr(div8, "class", "column svelte-5t18g7"); attr(div8, "style", div8_style_value = /*columnColor*/ ctx[16] ? `background-color: ${/*columnColor*/ ctx[16]};` : ""); toggle_class(div8, "drop-active", !!/*draggingData*/ ctx[11]); toggle_class( div8, "drop-hover", /*isDraggedOver*/ ctx[12] ); toggle_class( div8, "vertical-flow", /*isVerticalFlow*/ ctx[9] ); set_style( div8, "--column-color", /*columnColor*/ ctx[16] ); }, m(target, anchor) { insert(target, div8, anchor); append(div8, div5); append(div5, div0); append(div0, h2); append(h2, t0); append(div0, t1); if (if_block0) if_block0.m(div0, null); append(div5, t2); append(div5, div4); append(div4, div1); append(div1, button0); append(button0, t3); append(div1, t4); append(div1, button1); append(button1, t5); append(div4, t6); append(div4, div2); if (if_block1) if_block1.m(div2, null); append(div4, t7); append(div4, div3); mount_component(iconbutton, div3, null); append(div8, t8); if (if_block2) if_block2.m(div8, null); append(div8, t9); append(div8, div7); append(div7, div6); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { each_blocks[i].m(div6, null); } } append(div7, t10); if (if_block3) if_block3.m(div7, null); current = true; if (!mounted) { dispose = [ listen( button0, "click", /*click_handler*/ ctx[28] ), listen( button0, "keydown", /*keydown_handler*/ ctx[29] ), listen( button1, "click", /*click_handler_1*/ ctx[30] ), listen( button1, "keydown", /*keydown_handler_1*/ ctx[31] ), listen( div8, "dragover", /*handleDragOver*/ ctx[20] ), listen( div8, "dragleave", /*handleDragLeave*/ ctx[21] ), listen( div8, "drop", /*handleDrop*/ ctx[22] ) ]; mounted = true; } }, p(ctx2, dirty) { if (!current || dirty[0] & /*columnTitle*/ 131072) set_data( t0, /*columnTitle*/ ctx2[17] ); if (!current || dirty[0] & /*column*/ 2 && h2_id_value !== (h2_id_value = "column-title-" + /*column*/ ctx2[1])) { attr(h2, "id", h2_id_value); } if ( /*column*/ ctx2[1] === "done" ) { if (if_block0) { if_block0.p(ctx2, dirty); if (dirty[0] & /*column*/ 2) { transition_in(if_block0, 1); } } else { if_block0 = create_if_block_4(ctx2); if_block0.c(); transition_in(if_block0, 1); if_block0.m(div0, null); } } else if (if_block0) { group_outros(); transition_out(if_block0, 1, 1, () => { if_block0 = null; }); check_outros(); } if (!current || dirty[0] & /*isInSelectionMode*/ 32768 && button0_aria_pressed_value !== (button0_aria_pressed_value = !/*isInSelectionMode*/ ctx2[15])) { attr(button0, "aria-pressed", button0_aria_pressed_value); } if (!current || dirty[0] & /*isInSelectionMode*/ 32768) { toggle_class(button0, "active", !/*isInSelectionMode*/ ctx2[15]); } if (!current || dirty[0] & /*isInSelectionMode*/ 32768) { attr( button1, "aria-pressed", /*isInSelectionMode*/ ctx2[15] ); } if (!current || dirty[0] & /*isInSelectionMode*/ 32768) { toggle_class( button1, "active", /*isInSelectionMode*/ ctx2[15] ); } if (!current || dirty[0] & /*columnColor*/ 65536) { toggle_class(div1, "has-color", !!/*columnColor*/ ctx2[16]); } if (dirty[0] & /*columnColor*/ 65536) { set_style( div1, "--toggle-bg-color", /*columnColor*/ ctx2[16] ? `color-mix(in srgb, ${/*columnColor*/ ctx2[16]} 25%, white)` : void 0 ); } if (dirty[0] & /*columnColor*/ 65536) { set_style( div1, "--toggle-active-color", /*columnColor*/ ctx2[16] || void 0 ); } if ( /*isInSelectionMode*/ ctx2[15] && /*selectedCount*/ ctx2[14] > 0 ) { if (if_block1) { if_block1.p(ctx2, dirty); } else { if_block1 = create_if_block_32(ctx2); if_block1.c(); if_block1.m(div2, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } if (!current || dirty[0] & /*isInSelectionMode, selectedCount*/ 49152) { toggle_class( div3, "visible", /*isInSelectionMode*/ ctx2[15] && /*selectedCount*/ ctx2[14] > 0 ); } if (!current || dirty[0] & /*isVerticalFlow*/ 512) { toggle_class( div5, "row-header", /*isVerticalFlow*/ ctx2[9] ); } if (!/*isVerticalFlow*/ ctx2[9]) { if (if_block2) { } else { if_block2 = create_if_block_22(ctx2); if_block2.c(); if_block2.m(div8, t9); } } else if (if_block2) { if_block2.d(1); if_block2 = null; } if (dirty[0] & /*app, sortedTasks, taskActions, columnTagTableStore, showFilepath, consolidateTags, column, isInSelectionMode*/ 41395) { each_value = ensure_array_like( /*sortedTasks*/ ctx2[13] ); let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context2(ctx2, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { each_blocks[i] = create_each_block2(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(div6, null); } } group_outros(); for (i = each_value.length; i < each_blocks.length; i += 1) { out(i); } check_outros(); } if (dirty[0] & /*column, columnTagTableStore*/ 34) show_if = isColumnTag( /*column*/ ctx2[1], /*columnTagTableStore*/ ctx2[5] ); if (show_if) { if (if_block3) { if_block3.p(ctx2, dirty); } else { if_block3 = create_if_block_12(ctx2); if_block3.c(); if_block3.m(div7, null); } } else if (if_block3) { if_block3.d(1); if_block3 = null; } if (!current || dirty[0] & /*column*/ 2 && div8_aria_labelledby_value !== (div8_aria_labelledby_value = "column-title-" + /*column*/ ctx2[1])) { attr(div8, "aria-labelledby", div8_aria_labelledby_value); } if (!current || dirty[0] & /*columnColor*/ 65536 && div8_style_value !== (div8_style_value = /*columnColor*/ ctx2[16] ? `background-color: ${/*columnColor*/ ctx2[16]};` : "")) { attr(div8, "style", div8_style_value); } if (!current || dirty[0] & /*draggingData*/ 2048) { toggle_class(div8, "drop-active", !!/*draggingData*/ ctx2[11]); } if (!current || dirty[0] & /*isDraggedOver*/ 4096) { toggle_class( div8, "drop-hover", /*isDraggedOver*/ ctx2[12] ); } if (!current || dirty[0] & /*isVerticalFlow*/ 512) { toggle_class( div8, "vertical-flow", /*isVerticalFlow*/ ctx2[9] ); } const style_changed = dirty[0] & /*columnColor*/ 65536; if (dirty[0] & /*columnColor*/ 65536 || style_changed) { set_style( div8, "--column-color", /*columnColor*/ ctx2[16] ); } }, i(local) { if (current) return; transition_in(if_block0); transition_in(iconbutton.$$.fragment, local); for (let i = 0; i < each_value.length; i += 1) { transition_in(each_blocks[i]); } current = true; }, o(local) { transition_out(if_block0); transition_out(iconbutton.$$.fragment, local); each_blocks = each_blocks.filter(Boolean); for (let i = 0; i < each_blocks.length; i += 1) { transition_out(each_blocks[i]); } current = false; }, d(detaching) { if (detaching) { detach(div8); } if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); destroy_component(iconbutton); if (if_block2) if_block2.d(); destroy_each(each_blocks, detaching); if (if_block3) if_block3.d(); mounted = false; run_all(dispose); } }; } function create_if_block_4(ctx) { let iconbutton; let current; iconbutton = new icon_button_default({ props: { icon: "lucide-more-vertical" } }); iconbutton.$on( "click", /*showMenu*/ ctx[18] ); return { c() { create_component(iconbutton.$$.fragment); }, m(target, anchor) { mount_component(iconbutton, target, anchor); current = true; }, p: noop, i(local) { if (current) return; transition_in(iconbutton.$$.fragment, local); current = true; }, o(local) { transition_out(iconbutton.$$.fragment, local); current = false; }, d(detaching) { destroy_component(iconbutton, detaching); } }; } function create_if_block_32(ctx) { let span; let t0; let t1; return { c() { span = element("span"); t0 = text( /*selectedCount*/ ctx[14] ); t1 = text(" selected"); attr(span, "class", "svelte-5t18g7"); }, m(target, anchor) { insert(target, span, anchor); append(span, t0); append(span, t1); }, p(ctx2, dirty) { if (dirty[0] & /*selectedCount*/ 16384) set_data( t0, /*selectedCount*/ ctx2[14] ); }, d(detaching) { if (detaching) { detach(span); } } }; } function create_if_block_22(ctx) { let div; return { c() { div = element("div"); attr(div, "class", "divide svelte-5t18g7"); }, m(target, anchor) { insert(target, div, anchor); }, d(detaching) { if (detaching) { detach(div); } } }; } function create_each_block2(ctx) { let taskcomponent; let current; taskcomponent = new task_default({ props: { app: ( /*app*/ ctx[0] ), task: ( /*task*/ ctx[35] ), taskActions: ( /*taskActions*/ ctx[4] ), columnTagTableStore: ( /*columnTagTableStore*/ ctx[5] ), showFilepath: ( /*showFilepath*/ ctx[7] ), consolidateTags: ( /*consolidateTags*/ ctx[8] ), displayColumn: ( /*column*/ ctx[1] ), isInSelectionMode: ( /*isInSelectionMode*/ ctx[15] ) } }); return { c() { create_component(taskcomponent.$$.fragment); }, m(target, anchor) { mount_component(taskcomponent, target, anchor); current = true; }, p(ctx2, dirty) { const taskcomponent_changes = {}; if (dirty[0] & /*app*/ 1) taskcomponent_changes.app = /*app*/ ctx2[0]; if (dirty[0] & /*sortedTasks*/ 8192) taskcomponent_changes.task = /*task*/ ctx2[35]; if (dirty[0] & /*taskActions*/ 16) taskcomponent_changes.taskActions = /*taskActions*/ ctx2[4]; if (dirty[0] & /*columnTagTableStore*/ 32) taskcomponent_changes.columnTagTableStore = /*columnTagTableStore*/ ctx2[5]; if (dirty[0] & /*showFilepath*/ 128) taskcomponent_changes.showFilepath = /*showFilepath*/ ctx2[7]; if (dirty[0] & /*consolidateTags*/ 256) taskcomponent_changes.consolidateTags = /*consolidateTags*/ ctx2[8]; if (dirty[0] & /*column*/ 2) taskcomponent_changes.displayColumn = /*column*/ ctx2[1]; if (dirty[0] & /*isInSelectionMode*/ 32768) taskcomponent_changes.isInSelectionMode = /*isInSelectionMode*/ ctx2[15]; taskcomponent.$set(taskcomponent_changes); }, i(local) { if (current) return; transition_in(taskcomponent.$$.fragment, local); current = true; }, o(local) { transition_out(taskcomponent.$$.fragment, local); current = false; }, d(detaching) { destroy_component(taskcomponent, detaching); } }; } function create_if_block_12(ctx) { let button; let span; let t; let mounted; let dispose; return { c() { button = element("button"); span = element("span"); t = text("\n Add new"); attr(span, "class", "svelte-5t18g7"); attr(button, "class", "add-new-btn svelte-5t18g7"); }, m(target, anchor) { insert(target, button, anchor); append(button, span); ctx[32](span); append(button, t); if (!mounted) { dispose = listen( button, "click", /*click_handler_2*/ ctx[33] ); mounted = true; } }, p: noop, d(detaching) { if (detaching) { detach(button); } ctx[32](null); mounted = false; dispose(); } }; } function create_fragment5(ctx) { let if_block_anchor; let current; let if_block = (!/*hideOnEmpty*/ ctx[2] || /*tasks*/ ctx[3].length) && create_if_block2(ctx); return { c() { if (if_block) if_block.c(); if_block_anchor = empty(); }, m(target, anchor) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); current = true; }, p(ctx2, dirty) { if (!/*hideOnEmpty*/ ctx2[2] || /*tasks*/ ctx2[3].length) { if (if_block) { if_block.p(ctx2, dirty); if (dirty[0] & /*hideOnEmpty, tasks*/ 12) { transition_in(if_block, 1); } } else { if_block = create_if_block2(ctx2); if_block.c(); transition_in(if_block, 1); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { group_outros(); transition_out(if_block, 1, 1, () => { if_block = null; }); check_outros(); } }, i(local) { if (current) return; transition_in(if_block); current = true; }, o(local) { transition_out(if_block); current = false; }, d(detaching) { if (detaching) { detach(if_block_anchor); } if (if_block) if_block.d(detaching); } }; } function getColumnTitle(column, columnTagTable) { switch (column) { case "done": return "Done"; case "uncategorised": return "Uncategorised"; default: return columnTagTable[column]; } } function instance5($$self, $$props, $$invalidate) { let columnTitle; let columnColor; let isInSelectionMode; let selectedCount; let sortedTasks; let draggingData; let canDrop; let $isDraggingStore; let $columnTagTableStore, $$unsubscribe_columnTagTableStore = noop, $$subscribe_columnTagTableStore = () => ($$unsubscribe_columnTagTableStore(), $$unsubscribe_columnTagTableStore = subscribe(columnTagTableStore, ($$value) => $$invalidate(24, $columnTagTableStore = $$value)), columnTagTableStore); let $taskSelectionStore; let $selectionModeStore; let $columnColourTableStore, $$unsubscribe_columnColourTableStore = noop, $$subscribe_columnColourTableStore = () => ($$unsubscribe_columnColourTableStore(), $$unsubscribe_columnColourTableStore = subscribe(columnColourTableStore, ($$value) => $$invalidate(27, $columnColourTableStore = $$value)), columnColourTableStore); component_subscribe($$self, isDraggingStore, ($$value) => $$invalidate(23, $isDraggingStore = $$value)); component_subscribe($$self, taskSelectionStore, ($$value) => $$invalidate(25, $taskSelectionStore = $$value)); component_subscribe($$self, selectionModeStore, ($$value) => $$invalidate(26, $selectionModeStore = $$value)); $$self.$$.on_destroy.push(() => $$unsubscribe_columnTagTableStore()); $$self.$$.on_destroy.push(() => $$unsubscribe_columnColourTableStore()); let { app } = $$props; let { column } = $$props; let { hideOnEmpty = false } = $$props; let { tasks } = $$props; let { taskActions } = $$props; let { columnTagTableStore } = $$props; $$subscribe_columnTagTableStore(); let { columnColourTableStore } = $$props; $$subscribe_columnColourTableStore(); let { showFilepath } = $$props; let { consolidateTags } = $$props; let { isVerticalFlow = false } = $$props; function showMenu(e) { const menu = new import_obsidian5.Menu(); menu.addItem((i) => { i.setTitle(`Archive all`).onClick(() => taskActions.archiveTasks(tasks.map(({ id }) => id))); }); menu.showAtMouseEvent(e); } function showBulkActionsMenu(e) { const menu = new import_obsidian5.Menu(); const selectedTaskIds = tasks.filter((task) => $taskSelectionStore.get(task.id)).map((task) => task.id); if (selectedTaskIds.length === 0) { return; } const target = e.currentTarget; if (!target) { return; } const boundingRect = target.getBoundingClientRect(); const y = boundingRect.top + boundingRect.height / 2; const x = boundingRect.left + boundingRect.width / 2; for (const [tag, label] of Object.entries($columnTagTableStore)) { menu.addItem((i) => { i.setTitle(`Move to ${label}`).onClick(() => { selectedTaskIds.forEach((taskId) => { taskActions.changeColumn(taskId, tag); }); clearTaskSelections(); }); if (isColumnTag(column, columnTagTableStore) && column === tag) { i.setDisabled(true); } }); } menu.addItem((i) => { i.setTitle(`Move to Done`).onClick(() => { selectedTaskIds.forEach((taskId) => { taskActions.markDone(taskId); }); clearTaskSelections(); }); if (column === "done") { i.setDisabled(true); } }); menu.addSeparator(); menu.addItem((i) => { i.setTitle(`Archive task`).onClick(() => { taskActions.archiveTasks(selectedTaskIds); clearTaskSelections(); }); }); menu.addItem((i) => { i.setTitle(`Delete task`).onClick(() => { selectedTaskIds.forEach((taskId) => { taskActions.deleteTask(taskId); }); clearTaskSelections(); }); }); menu.showAtPosition({ x, y }); } let isDraggedOver = false; function handleDragOver(e) { e.preventDefault(); if (!canDrop) { if (e.dataTransfer) { e.dataTransfer.dropEffect = "none"; } return; } $$invalidate(12, isDraggedOver = true); if (e.dataTransfer) { e.dataTransfer.dropEffect = "move"; } } function handleDragLeave(e) { $$invalidate(12, isDraggedOver = false); } function handleDrop(e) { var _a; e.preventDefault(); if (!canDrop) { return; } const droppedId = (_a = e.dataTransfer) == null ? void 0 : _a.getData("text/plain"); if (droppedId) { switch (column) { case "uncategorised": break; case "done": taskActions.markDone(droppedId); break; default: taskActions.changeColumn(droppedId, column); break; } } } let buttonEl; const click_handler = () => { if (isInSelectionMode) toggleSelectionMode(column); }; const keydown_handler = (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); if (isInSelectionMode) { toggleSelectionMode(column); } } }; const click_handler_1 = () => { if (!isInSelectionMode) toggleSelectionMode(column); }; const keydown_handler_1 = (e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); if (!isInSelectionMode) { toggleSelectionMode(column); } } }; function span_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttonEl = $$value; $$invalidate(10, buttonEl); }); } const click_handler_2 = async (e) => { if (isColumnTag(column, columnTagTableStore)) { await taskActions.addNew(column, e); } }; $$self.$$set = ($$props2) => { if ("app" in $$props2) $$invalidate(0, app = $$props2.app); if ("column" in $$props2) $$invalidate(1, column = $$props2.column); if ("hideOnEmpty" in $$props2) $$invalidate(2, hideOnEmpty = $$props2.hideOnEmpty); if ("tasks" in $$props2) $$invalidate(3, tasks = $$props2.tasks); if ("taskActions" in $$props2) $$invalidate(4, taskActions = $$props2.taskActions); if ("columnTagTableStore" in $$props2) $$subscribe_columnTagTableStore($$invalidate(5, columnTagTableStore = $$props2.columnTagTableStore)); if ("columnColourTableStore" in $$props2) $$subscribe_columnColourTableStore($$invalidate(6, columnColourTableStore = $$props2.columnColourTableStore)); if ("showFilepath" in $$props2) $$invalidate(7, showFilepath = $$props2.showFilepath); if ("consolidateTags" in $$props2) $$invalidate(8, consolidateTags = $$props2.consolidateTags); if ("isVerticalFlow" in $$props2) $$invalidate(9, isVerticalFlow = $$props2.isVerticalFlow); }; $$self.$$.update = () => { if ($$self.$$.dirty[0] & /*column, $columnTagTableStore*/ 16777218) { $: $$invalidate(17, columnTitle = getColumnTitle(column, $columnTagTableStore)); } if ($$self.$$.dirty[0] & /*column, columnTagTableStore, $columnColourTableStore*/ 134217762) { $: $$invalidate(16, columnColor = isColumnTag(column, columnTagTableStore) ? $columnColourTableStore[column] : void 0); } if ($$self.$$.dirty[0] & /*$selectionModeStore, column*/ 67108866) { $: $$invalidate(15, isInSelectionMode = $selectionModeStore.get(column) || false); } if ($$self.$$.dirty[0] & /*tasks, $taskSelectionStore*/ 33554440) { $: $$invalidate(14, selectedCount = getSelectedTaskCount(tasks.map((t) => t.id), $taskSelectionStore)); } if ($$self.$$.dirty[0] & /*tasks*/ 8) { $: $$invalidate(13, sortedTasks = [...tasks].sort((a, b) => { if (a.path === b.path) { return a.rowIndex - b.rowIndex; } else { return a.path.localeCompare(b.path); } })); } if ($$self.$$.dirty[0] & /*$isDraggingStore*/ 8388608) { $: $$invalidate(11, draggingData = $isDraggingStore); } if ($$self.$$.dirty[0] & /*draggingData, column*/ 2050) { $: canDrop = !!draggingData && draggingData.fromColumn !== column; } if ($$self.$$.dirty[0] & /*buttonEl*/ 1024) { $: { if (buttonEl) { (0, import_obsidian5.setIcon)(buttonEl, "lucide-plus"); } } } }; return [ app, column, hideOnEmpty, tasks, taskActions, columnTagTableStore, columnColourTableStore, showFilepath, consolidateTags, isVerticalFlow, buttonEl, draggingData, isDraggedOver, sortedTasks, selectedCount, isInSelectionMode, columnColor, columnTitle, showMenu, showBulkActionsMenu, handleDragOver, handleDragLeave, handleDrop, $isDraggingStore, $columnTagTableStore, $taskSelectionStore, $selectionModeStore, $columnColourTableStore, click_handler, keydown_handler, click_handler_1, keydown_handler_1, span_binding, click_handler_2 ]; } var Column = class extends SvelteComponent { constructor(options) { super(); init( this, options, instance5, create_fragment5, safe_not_equal, { app: 0, column: 1, hideOnEmpty: 2, tasks: 3, taskActions: 4, columnTagTableStore: 5, columnColourTableStore: 6, showFilepath: 7, consolidateTags: 8, isVerticalFlow: 9 }, add_css4, [-1, -1] ); } }; var column_default = Column; // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs var min = Math.min; var max = Math.max; var round = Math.round; var floor = Math.floor; var createCoords = (v) => ({ x: v, y: v }); var oppositeSideMap = { left: "right", right: "left", bottom: "top", top: "bottom" }; var oppositeAlignmentMap = { start: "end", end: "start" }; function clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === "function" ? value(param) : value; } function getSide(placement) { return placement.split("-")[0]; } function getAlignment(placement) { return placement.split("-")[1]; } function getOppositeAxis(axis) { return axis === "x" ? "y" : "x"; } function getAxisLength(axis) { return axis === "y" ? "height" : "width"; } function getSideAxis(placement) { return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x"; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ["left", "right"]; const rl = ["right", "left"]; const tb = ["top", "bottom"]; const bt = ["bottom", "top"]; switch (side) { case "top": case "bottom": if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case "left": case "right": return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === "start", rtl); if (alignment) { list = list.map((side) => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== "number" ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } // node_modules/@floating-ui/core/dist/floating-ui.core.mjs function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = getSide(placement); const isVertical = sideAxis === "y"; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case "top": coords = { x: commonX, y: reference.y - floating.height }; break; case "bottom": coords = { x: commonX, y: reference.y + reference.height }; break; case "right": coords = { x: reference.x + reference.width, y: commonY }; break; case "left": coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (getAlignment(placement)) { case "start": coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case "end": coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } var computePosition = async (reference, floating, config) => { const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform2 } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating)); let rects = await platform2.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform: platform2, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name]: { ...middlewareData[name], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === "object") { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform2.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform: platform2, rects, elements, strategy } = state; const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state); const paddingObject = getPaddingObject(padding); const altContext = elementContext === "floating" ? "reference" : "floating"; const element2 = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform2.getClippingRect({ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element2))) != null ? _await$platform$isEle : true) ? element2 : element2.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), boundary, rootBoundary, strategy })); const rect = elementContext === "floating" ? { ...rects.floating, x, y } : rects.reference; const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)); const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ elements, rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } var flip = function(options) { if (options === void 0) { options = {}; } return { name: "flip", options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform: platform2, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state); if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = getSide(placement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements2 = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides2 = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides2[0]], overflow[sides2[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; if (!overflows.every((side2) => side2 <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements2[nextIndex]; if (nextPlacement) { return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; if (!resetPlacement) { switch (fallbackStrategy) { case "bestFit": { var _overflowsData$map$so; const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; if (placement2) { resetPlacement = placement2; } break; } case "initialPlacement": resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; async function convertValueToCoords(state, options) { const { placement, platform: platform2, elements } = state; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getSideAxis(placement) === "y"; const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state); let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...rawValue }; if (alignment && typeof alignmentAxis === "number") { crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } var offset = function(options) { if (options === void 0) { options = 0; } return { name: "offset", options, async fn(state) { var _middlewareData$offse, _middlewareData$arrow; const { x, y, placement, middlewareData } = state; const diffCoords = await convertValueToCoords(state, options); if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } return { x: x + diffCoords.x, y: y + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; var shift = function(options) { if (options === void 0) { options = {}; } return { name: "shift", options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => { let { x: x2, y: y2 } = _ref; return { x: x2, y: y2 }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const crossAxis = getSideAxis(getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === "y" ? "top" : "left"; const maxSide = mainAxis === "y" ? "bottom" : "right"; const min2 = mainAxisCoord + overflow[minSide]; const max2 = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min2, mainAxisCoord, max2); } if (checkCrossAxis) { const minSide = crossAxis === "y" ? "top" : "left"; const maxSide = crossAxis === "y" ? "bottom" : "right"; const min2 = crossAxisCoord + overflow[minSide]; const max2 = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min2, crossAxisCoord, max2); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y } }; } }; }; // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || "").toLowerCase(); } return "#document"; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (typeof ShadowRoot === "undefined") { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element2) { const { overflow, overflowX, overflowY, display } = getComputedStyle2(element2); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display); } function isTableElement(element2) { return ["table", "td", "th"].includes(getNodeName(element2)); } function isContainingBlock(element2) { const webkit = isWebKit(); const css = getComputedStyle2(element2); return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value)); } function getContainingBlock(element2) { let currentNode = getParentNode(element2); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === "undefined" || !CSS.supports) return false; return CSS.supports("-webkit-backdrop-filter", "none"); } function isLastTraversableNode(node) { return ["html", "body", "#document"].includes(getNodeName(node)); } function getComputedStyle2(element2) { return getWindow(element2).getComputedStyle(element2); } function getNodeScroll(element2) { if (isElement(element2)) { return { scrollLeft: element2.scrollLeft, scrollTop: element2.scrollTop }; } return { scrollLeft: element2.pageXOffset, scrollTop: element2.pageYOffset }; } function getParentNode(node) { if (getNodeName(node) === "html") { return node; } const result = ( // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node) ); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element2) { const css = getComputedStyle2(element2); let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element2); const offsetWidth = hasOffset ? element2.offsetWidth : width; const offsetHeight = hasOffset ? element2.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element2) { return !isElement(element2) ? element2.contextElement : element2; } function getScale(element2) { const domElement = unwrapElement(element2); if (!isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } var noOffsets = /* @__PURE__ */ createCoords(0); function getVisualOffsets(element2) { const win = getWindow(element2); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element2, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element2)) { return false; } return isFixed; } function getBoundingClientRect(element2, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element2.getBoundingClientRect(); const domElement = unwrapElement(element2); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element2); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = currentWin.frameElement; while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = getComputedStyle2(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = getWindow(currentIFrame); currentIFrame = currentWin.frameElement; } } return rectToClientRect({ width, height, x, y }); } var topLayerSelectors = [":popover-open", ":modal"]; function isTopLayer(element2) { return topLayerSelectors.some((selector) => { try { return element2.matches(selector); } catch (e) { return false; } }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === "fixed"; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element2) { return Array.from(element2.getClientRects()); } function getWindowScrollBarX(element2) { return getBoundingClientRect(getDocumentElement(element2)).left + getNodeScroll(element2).scrollLeft; } function getDocumentRect(element2) { const html = getDocumentElement(element2); const scroll = getNodeScroll(element2); const body = element2.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element2); const y = -scroll.scrollTop; if (getComputedStyle2(body).direction === "rtl") { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getViewportRect(element2, strategy) { const win = getWindow(element2); const html = getDocumentElement(element2); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === "fixed") { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } function getInnerBoundingClientRect(element2, strategy) { const clientRect = getBoundingClientRect(element2, true, strategy === "fixed"); const top = clientRect.top + element2.clientTop; const left = clientRect.left + element2.clientLeft; const scale = isHTMLElement(element2) ? getScale(element2) : createCoords(1); const width = element2.clientWidth * scale.x; const height = element2.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element2, clippingAncestor, strategy) { let rect; if (clippingAncestor === "viewport") { rect = getViewportRect(element2, strategy); } else if (clippingAncestor === "document") { rect = getDocumentRect(getDocumentElement(element2)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element2); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return rectToClientRect(rect); } function hasFixedPositionAncestor(element2, stopNode) { const parentNode = getParentNode(element2); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); } function getClippingElementAncestors(element2, cache) { const cachedResult = cache.get(element2); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element2, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); let currentContainingBlockComputedStyle = null; const elementIsFixed = getComputedStyle2(element2).position === "fixed"; let currentNode = elementIsFixed ? getParentNode(element2) : element2; while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle2(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === "fixed") { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element2, currentNode); if (shouldDropCurrentNode) { result = result.filter((ancestor) => ancestor !== currentNode); } else { currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element2, result); return result; } function getClippingRect(_ref) { let { element: element2, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element2) ? [] : getClippingElementAncestors(element2, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element2, clippingAncestor, 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; }, getClientRectFromClippingAncestor(element2, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element2) { const { width, height } = getCssDimensions(element2); return { width, height }; } function getRectRelativeToOffsetParent(element2, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === "fixed"; const rect = getBoundingClientRect(element2, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } const x = rect.left + scroll.scrollLeft - offsets.x; const y = rect.top + scroll.scrollTop - offsets.y; return { x, y, width: rect.width, height: rect.height }; } function isStaticPositioned(element2) { return getComputedStyle2(element2).position === "static"; } function getTrueOffsetParent(element2, polyfill) { if (!isHTMLElement(element2) || getComputedStyle2(element2).position === "fixed") { return null; } if (polyfill) { return polyfill(element2); } return element2.offsetParent; } function getOffsetParent(element2, polyfill) { const win = getWindow(element2); if (isTopLayer(element2)) { return win; } if (!isHTMLElement(element2)) { let svgOffsetParent = getParentNode(element2); while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { return svgOffsetParent; } svgOffsetParent = getParentNode(svgOffsetParent); } return win; } let offsetParent = getTrueOffsetParent(element2, polyfill); while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { return win; } return offsetParent || getContainingBlock(element2) || win; } var getElementRects = async function(data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; const floatingDimensions = await getDimensionsFn(data.floating); return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, width: floatingDimensions.width, height: floatingDimensions.height } }; }; function isRTL(element2) { return getComputedStyle2(element2).direction === "rtl"; } var platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement, isRTL }; function observeMove(element2, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element2); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element2.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 1e3); } else { refresh(false, ratio); } } isFirstUpdate = false; } try { io = new IntersectionObserver(handleObserve, { ...options, // Handle