UNPKG

tiddlywiki-plugin-dev

Version:

[![](https://img.shields.io/badge/Join-TiddlyWiki_CN-blue)](https://github.com/tiddly-gittly)

1,484 lines (1,472 loc) 14.9 MB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __knownSymbol = (name, symbol) => { if (symbol = Symbol[name]) return symbol; throw Error("Symbol." + name + " is not defined"); }; var __pow = Math.pow; var __defNormalProp = (obj, key2, value2) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key2] = value2; var __spreadValues = (a6, b2) => { for (var prop in b2 || (b2 = {})) if (__hasOwnProp.call(b2, prop)) __defNormalProp(a6, prop, b2[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b2)) { if (__propIsEnum.call(b2, prop)) __defNormalProp(a6, prop, b2[prop]); } return a6; }; var __spreadProps = (a6, b2) => __defProps(a6, __getOwnPropDescs(b2)); var __objRest = (source2, exclude) => { var target = {}; for (var prop in source2) if (__hasOwnProp.call(source2, prop) && exclude.indexOf(prop) < 0) target[prop] = source2[prop]; if (source2 != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source2)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source2, prop)) target[prop] = source2[prop]; } return target; }; var __esm = (fn3, res) => function __init() { return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res; }; 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 key2 of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key2) && key2 !== except) __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || 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, key2, value2) => { __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value2); return value2; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve3, reject) => { var fulfilled = (value2) => { try { step(generator.next(value2)); } catch (e4) { reject(e4); } }; var rejected = (value2) => { try { step(generator.throw(value2)); } catch (e4) { reject(e4); } }; var step = (x2) => x2.done ? resolve3(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; var __await = function(promise, isYieldStar) { this[0] = promise; this[1] = isYieldStar; }; var __yieldStar = (value2) => { var obj = value2[__knownSymbol("asyncIterator")]; var isAwait = false; var method; var it3 = {}; if (obj == null) { obj = value2[__knownSymbol("iterator")](); method = (k2) => it3[k2] = (x2) => obj[k2](x2); } else { obj = obj.call(value2); method = (k2) => it3[k2] = (v) => { if (isAwait) { isAwait = false; if (k2 === "throw") throw v; return v; } isAwait = true; return { done: false, value: new __await(new Promise((resolve3) => { var x2 = obj[k2](v); if (!(x2 instanceof Object)) throw TypeError("Object expected"); resolve3(x2); }), 1) }; }; } return it3[__knownSymbol("iterator")] = () => it3, method("next"), "throw" in obj ? method("throw") : it3.throw = (x2) => { throw x2; }, "return" in obj && method("return"), it3; }; // node_modules/.pnpm/svelte-preprocess@6.0.3_@babel+core@7.29.0_coffeescript@2.7.0_less@4.6.4_postcss-load-c_30239b2c86ef1a941f4b83837dbdcac5/node_modules/svelte-preprocess/dist/modules/utils.js var require_utils = __commonJS({ "node_modules/.pnpm/svelte-preprocess@6.0.3_@babel+core@7.29.0_coffeescript@2.7.0_less@4.6.4_postcss-load-c_30239b2c86ef1a941f4b83837dbdcac5/node_modules/svelte-preprocess/dist/modules/utils.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? function(o5, m4, k2, k22) { if (k22 === void 0) k22 = k2; var desc = Object.getOwnPropertyDescriptor(m4, k2); if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m4[k2]; } }; } Object.defineProperty(o5, k22, desc); } : function(o5, m4, k2, k22) { if (k22 === void 0) k22 = k2; o5[k22] = m4[k2]; }); var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o5, v) { Object.defineProperty(o5, "default", { enumerable: true, value: v }); } : function(o5, v) { o5["default"] = v; }); var __importStar = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k2 in mod) if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2)) __createBinding(result, mod, k2); } __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.setProp = exports.findUp = exports.isValidLocalPath = exports.hasDepInstalled = exports.getIncludePaths = exports.concat = void 0; var fs_1 = require("fs"); var path_1 = require("path"); function concat(...arrs) { return arrs.reduce((acc, a6) => { if (a6) return acc.concat(a6); return acc; }, []); } exports.concat = concat; function getIncludePaths(fromFilename, base = []) { if (fromFilename == null) return []; return [ .../* @__PURE__ */ new Set([...base, "node_modules", process.cwd(), (0, path_1.dirname)(fromFilename)]) ]; } exports.getIncludePaths = getIncludePaths; var depCheckCache = {}; function hasDepInstalled(dep) { return __async(this, null, function* () { if (depCheckCache[dep] != null) { return depCheckCache[dep]; } let result = false; try { yield Promise.resolve(`${dep}`).then((s4) => __importStar(require(s4))); result = true; } catch (e4) { result = false; } return depCheckCache[dep] = result; }); } exports.hasDepInstalled = hasDepInstalled; function isValidLocalPath(path3) { return path3.startsWith("."); } exports.isValidLocalPath = isValidLocalPath; function findUp({ what, from }) { const { root: root2, dir } = (0, path_1.parse)(from); let cur = dir; try { while (cur !== root2) { const possiblePath = (0, path_1.join)(cur, what); if ((0, fs_1.existsSync)(possiblePath)) { return possiblePath; } cur = (0, path_1.dirname)(cur); } } catch (e4) { console.error(e4); } return null; } exports.findUp = findUp; function setProp(obj, keyList, value2) { let i5 = 0; for (; i5 < keyList.length - 1; i5++) { const key2 = keyList[i5]; if (typeof obj[key2] !== "object") { obj[key2] = {}; } obj = obj[key2]; } obj[keyList[i5]] = value2; } exports.setProp = setProp; } }); // node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module2) { "use strict"; var p3 = process || {}; var argv = p3.argv || []; var env = p3.env || {}; var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p3.platform === "win32" || (p3.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI); var formatter = (open, close, replace = open) => (input) => { let string = "" + input, index = string.indexOf(close, open.length); return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close; }; var replaceClose = (string, close, replace, index) => { let result = "", cursor = 0; do { result += string.substring(cursor, index) + replace; cursor = index + close.length; index = string.indexOf(close, cursor); } while (~index); return result + string.substring(cursor); }; var createColors = (enabled = isColorSupported) => { let f2 = enabled ? formatter : () => String; return { isColorSupported: enabled, reset: f2("\x1B[0m", "\x1B[0m"), bold: f2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), dim: f2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), italic: f2("\x1B[3m", "\x1B[23m"), underline: f2("\x1B[4m", "\x1B[24m"), inverse: f2("\x1B[7m", "\x1B[27m"), hidden: f2("\x1B[8m", "\x1B[28m"), strikethrough: f2("\x1B[9m", "\x1B[29m"), black: f2("\x1B[30m", "\x1B[39m"), red: f2("\x1B[31m", "\x1B[39m"), green: f2("\x1B[32m", "\x1B[39m"), yellow: f2("\x1B[33m", "\x1B[39m"), blue: f2("\x1B[34m", "\x1B[39m"), magenta: f2("\x1B[35m", "\x1B[39m"), cyan: f2("\x1B[36m", "\x1B[39m"), white: f2("\x1B[37m", "\x1B[39m"), gray: f2("\x1B[90m", "\x1B[39m"), bgBlack: f2("\x1B[40m", "\x1B[49m"), bgRed: f2("\x1B[41m", "\x1B[49m"), bgGreen: f2("\x1B[42m", "\x1B[49m"), bgYellow: f2("\x1B[43m", "\x1B[49m"), bgBlue: f2("\x1B[44m", "\x1B[49m"), bgMagenta: f2("\x1B[45m", "\x1B[49m"), bgCyan: f2("\x1B[46m", "\x1B[49m"), bgWhite: f2("\x1B[47m", "\x1B[49m"), blackBright: f2("\x1B[90m", "\x1B[39m"), redBright: f2("\x1B[91m", "\x1B[39m"), greenBright: f2("\x1B[92m", "\x1B[39m"), yellowBright: f2("\x1B[93m", "\x1B[39m"), blueBright: f2("\x1B[94m", "\x1B[39m"), magentaBright: f2("\x1B[95m", "\x1B[39m"), cyanBright: f2("\x1B[96m", "\x1B[39m"), whiteBright: f2("\x1B[97m", "\x1B[39m"), bgBlackBright: f2("\x1B[100m", "\x1B[49m"), bgRedBright: f2("\x1B[101m", "\x1B[49m"), bgGreenBright: f2("\x1B[102m", "\x1B[49m"), bgYellowBright: f2("\x1B[103m", "\x1B[49m"), bgBlueBright: f2("\x1B[104m", "\x1B[49m"), bgMagentaBright: f2("\x1B[105m", "\x1B[49m"), bgCyanBright: f2("\x1B[106m", "\x1B[49m"), bgWhiteBright: f2("\x1B[107m", "\x1B[49m") }; }; module2.exports = createColors(); module2.exports.createColors = createColors; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/tokenize.js var require_tokenize = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/tokenize.js"(exports, module2) { "use strict"; var SINGLE_QUOTE = "'".charCodeAt(0); var DOUBLE_QUOTE = '"'.charCodeAt(0); var BACKSLASH = "\\".charCodeAt(0); var SLASH = "/".charCodeAt(0); var NEWLINE = "\n".charCodeAt(0); var SPACE = " ".charCodeAt(0); var FEED = "\f".charCodeAt(0); var TAB = " ".charCodeAt(0); var CR = "\r".charCodeAt(0); var OPEN_SQUARE = "[".charCodeAt(0); var CLOSE_SQUARE = "]".charCodeAt(0); var OPEN_PARENTHESES = "(".charCodeAt(0); var CLOSE_PARENTHESES = ")".charCodeAt(0); var OPEN_CURLY = "{".charCodeAt(0); var CLOSE_CURLY = "}".charCodeAt(0); var SEMICOLON = ";".charCodeAt(0); var ASTERISK = "*".charCodeAt(0); var COLON = ":".charCodeAt(0); var AT = "@".charCodeAt(0); var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; var RE_BAD_BRACKET = /.[\r\n"'(/\\]/; var RE_HEX_ESCAPE = /[\da-f]/i; module2.exports = function tokenizer3(input, options = {}) { let css = input.css.valueOf(); let ignore = options.ignoreErrors; let code, content, escape3, next, quote; let currentToken, escaped, escapePos, n3, prev; let length = css.length; let pos2 = 0; let buffer2 = []; let returned = []; function position() { return pos2; } function unclosed(what) { throw input.error("Unclosed " + what, pos2); } function endOfFile() { return returned.length === 0 && pos2 >= length; } function nextToken(opts) { if (returned.length) return returned.pop(); if (pos2 >= length) return; let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; code = css.charCodeAt(pos2); switch (code) { case NEWLINE: case SPACE: case TAB: case CR: case FEED: { next = pos2; do { next += 1; code = css.charCodeAt(next); } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED); currentToken = ["space", css.slice(pos2, next)]; pos2 = next - 1; break; } case OPEN_SQUARE: case CLOSE_SQUARE: case OPEN_CURLY: case CLOSE_CURLY: case COLON: case SEMICOLON: case CLOSE_PARENTHESES: { let controlChar = String.fromCharCode(code); currentToken = [controlChar, controlChar, pos2]; break; } case OPEN_PARENTHESES: { prev = buffer2.length ? buffer2.pop()[1] : ""; n3 = css.charCodeAt(pos2 + 1); if (prev === "url" && n3 !== SINGLE_QUOTE && n3 !== DOUBLE_QUOTE && n3 !== SPACE && n3 !== NEWLINE && n3 !== TAB && n3 !== FEED && n3 !== CR) { next = pos2; do { escaped = false; next = css.indexOf(")", next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos2; break; } else { unclosed("bracket"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["brackets", css.slice(pos2, next + 1), pos2, next]; pos2 = next; } else { next = css.indexOf(")", pos2 + 1); content = css.slice(pos2, next + 1); if (next === -1 || RE_BAD_BRACKET.test(content)) { currentToken = ["(", "(", pos2]; } else { currentToken = ["brackets", content, pos2, next]; pos2 = next; } } break; } case SINGLE_QUOTE: case DOUBLE_QUOTE: { quote = code === SINGLE_QUOTE ? "'" : '"'; next = pos2; do { escaped = false; next = css.indexOf(quote, next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos2 + 1; break; } else { unclosed("string"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["string", css.slice(pos2, next + 1), pos2, next]; pos2 = next; break; } case AT: { RE_AT_END.lastIndex = pos2 + 1; RE_AT_END.test(css); if (RE_AT_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_AT_END.lastIndex - 2; } currentToken = ["at-word", css.slice(pos2, next + 1), pos2, next]; pos2 = next; break; } case BACKSLASH: { next = pos2; escape3 = true; while (css.charCodeAt(next + 1) === BACKSLASH) { next += 1; escape3 = !escape3; } code = css.charCodeAt(next + 1); if (escape3 && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) { next += 1; if (RE_HEX_ESCAPE.test(css.charAt(next))) { while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { next += 1; } if (css.charCodeAt(next + 1) === SPACE) { next += 1; } } } currentToken = ["word", css.slice(pos2, next + 1), pos2, next]; pos2 = next; break; } default: { if (code === SLASH && css.charCodeAt(pos2 + 1) === ASTERISK) { next = css.indexOf("*/", pos2 + 2) + 1; if (next === 0) { if (ignore || ignoreUnclosed) { next = css.length; } else { unclosed("comment"); } } currentToken = ["comment", css.slice(pos2, next + 1), pos2, next]; pos2 = next; } else { RE_WORD_END.lastIndex = pos2 + 1; RE_WORD_END.test(css); if (RE_WORD_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_WORD_END.lastIndex - 2; } currentToken = ["word", css.slice(pos2, next + 1), pos2, next]; buffer2.push(currentToken); pos2 = next; } break; } } pos2++; return currentToken; } function back(token2) { returned.push(token2); } return { back, endOfFile, nextToken, position }; }; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/terminal-highlight.js var require_terminal_highlight = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/terminal-highlight.js"(exports, module2) { "use strict"; var pico = require_picocolors(); var tokenizer3 = require_tokenize(); var Input; function registerInput(dependant) { Input = dependant; } var HIGHLIGHT_THEME = { ";": pico.yellow, ":": pico.yellow, "(": pico.cyan, ")": pico.cyan, "[": pico.yellow, "]": pico.yellow, "{": pico.yellow, "}": pico.yellow, "at-word": pico.cyan, "brackets": pico.cyan, "call": pico.cyan, "class": pico.yellow, "comment": pico.gray, "hash": pico.magenta, "string": pico.green }; function getTokenType([type, value2], processor) { if (type === "word") { if (value2[0] === ".") { return "class"; } if (value2[0] === "#") { return "hash"; } } if (!processor.endOfFile()) { let next = processor.nextToken(); processor.back(next); if (next[0] === "brackets" || next[0] === "(") return "call"; } return type; } function terminalHighlight(css) { let processor = tokenizer3(new Input(css), { ignoreErrors: true }); let result = ""; while (!processor.endOfFile()) { let token2 = processor.nextToken(); let color = HIGHLIGHT_THEME[getTokenType(token2, processor)]; if (color) { result += token2[1].split(/\r?\n/).map((i5) => color(i5)).join("\n"); } else { result += token2[1]; } } return result; } terminalHighlight.registerInput = registerInput; module2.exports = terminalHighlight; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/css-syntax-error.js var require_css_syntax_error = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/css-syntax-error.js"(exports, module2) { "use strict"; var pico = require_picocolors(); var terminalHighlight = require_terminal_highlight(); var CssSyntaxError = class _CssSyntaxError extends Error { constructor(message, line2, column2, source2, file, plugin) { super(message); this.name = "CssSyntaxError"; this.reason = message; if (file) { this.file = file; } if (source2) { this.source = source2; } if (plugin) { this.plugin = plugin; } if (typeof line2 !== "undefined" && typeof column2 !== "undefined") { if (typeof line2 === "number") { this.line = line2; this.column = column2; } else { this.line = line2.line; this.column = line2.column; this.endLine = column2.line; this.endColumn = column2.column; } } this.setMessage(); if (Error.captureStackTrace) { Error.captureStackTrace(this, _CssSyntaxError); } } setMessage() { this.message = this.plugin ? this.plugin + ": " : ""; this.message += this.file ? this.file : "<css input>"; if (typeof this.line !== "undefined") { this.message += ":" + this.line + ":" + this.column; } this.message += ": " + this.reason; } showSourceCode(color) { if (!this.source) return ""; let css = this.source; if (color == null) color = pico.isColorSupported; let aside = (text) => text; let mark = (text) => text; let highlight = (text) => text; if (color) { let { bold, gray, red } = pico.createColors(true); mark = (text) => bold(red(text)); aside = (text) => gray(text); if (terminalHighlight) { highlight = (text) => terminalHighlight(text); } } let lines = css.split(/\r?\n/); let start = Math.max(this.line - 3, 0); let end = Math.min(this.line + 2, lines.length); let maxWidth = String(end).length; return lines.slice(start, end).map((line2, index) => { let number = start + 1 + index; let gutter = " " + (" " + number).slice(-maxWidth) + " | "; if (number === this.line) { if (line2.length > 160) { let padding = 20; let subLineStart = Math.max(0, this.column - padding); let subLineEnd = Math.max( this.column + padding, this.endColumn + padding ); let subLine = line2.slice(subLineStart, subLineEnd); let spacing2 = aside(gutter.replace(/\d/g, " ")) + line2.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, " "); return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing2 + mark("^"); } let spacing = aside(gutter.replace(/\d/g, " ")) + line2.slice(0, this.column - 1).replace(/[^\t]/g, " "); return mark(">") + aside(gutter) + highlight(line2) + "\n " + spacing + mark("^"); } return " " + aside(gutter) + highlight(line2); }).join("\n"); } toString() { let code = this.showSourceCode(); if (code) { code = "\n\n" + code + "\n"; } return this.name + ": " + this.message + code; } }; module2.exports = CssSyntaxError; CssSyntaxError.default = CssSyntaxError; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringifier.js var require_stringifier = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringifier.js"(exports, module2) { "use strict"; var DEFAULT_RAW = { after: "\n", beforeClose: "\n", beforeComment: "\n", beforeDecl: "\n", beforeOpen: " ", beforeRule: "\n", colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: false }; function capitalize(str) { return str[0].toUpperCase() + str.slice(1); } var Stringifier = class { constructor(builder) { this.builder = builder; } atrule(node, semicolon) { let name = "@" + node.name; let params = node.params ? this.rawValue(node, "params") : ""; if (typeof node.raws.afterName !== "undefined") { name += node.raws.afterName; } else if (params) { name += " "; } if (node.nodes) { this.block(node, name + params); } else { let end = (node.raws.between || "") + (semicolon ? ";" : ""); this.builder(name + params + end, node); } } beforeAfter(node, detect) { let value2; if (node.type === "decl") { value2 = this.raw(node, null, "beforeDecl"); } else if (node.type === "comment") { value2 = this.raw(node, null, "beforeComment"); } else if (detect === "before") { value2 = this.raw(node, null, "beforeRule"); } else { value2 = this.raw(node, null, "beforeClose"); } let buf = node.parent; let depth = 0; while (buf && buf.type !== "root") { depth += 1; buf = buf.parent; } if (value2.includes("\n")) { let indent = this.raw(node, null, "indent"); if (indent.length) { for (let step = 0; step < depth; step++) value2 += indent; } } return value2; } block(node, start) { let between = this.raw(node, "between", "beforeOpen"); this.builder(start + between + "{", node, "start"); let after; if (node.nodes && node.nodes.length) { this.body(node); after = this.raw(node, "after"); } else { after = this.raw(node, "after", "emptyBody"); } if (after) this.builder(after); this.builder("}", node, "end"); } body(node) { let last = node.nodes.length - 1; while (last > 0) { if (node.nodes[last].type !== "comment") break; last -= 1; } let semicolon = this.raw(node, "semicolon"); for (let i5 = 0; i5 < node.nodes.length; i5++) { let child = node.nodes[i5]; let before = this.raw(child, "before"); if (before) this.builder(before); this.stringify(child, last !== i5 || semicolon); } } comment(node) { let left = this.raw(node, "left", "commentLeft"); let right = this.raw(node, "right", "commentRight"); this.builder("/*" + left + node.text + right + "*/", node); } decl(node, semicolon) { let between = this.raw(node, "between", "colon"); let string = node.prop + between + this.rawValue(node, "value"); if (node.important) { string += node.raws.important || " !important"; } if (semicolon) string += ";"; this.builder(string, node); } document(node) { this.body(node); } raw(node, own, detect) { let value2; if (!detect) detect = own; if (own) { value2 = node.raws[own]; if (typeof value2 !== "undefined") return value2; } let parent = node.parent; if (detect === "before") { if (!parent || parent.type === "root" && parent.first === node) { return ""; } if (parent && parent.type === "document") { return ""; } } if (!parent) return DEFAULT_RAW[detect]; let root2 = node.root(); if (!root2.rawCache) root2.rawCache = {}; if (typeof root2.rawCache[detect] !== "undefined") { return root2.rawCache[detect]; } if (detect === "before" || detect === "after") { return this.beforeAfter(node, detect); } else { let method = "raw" + capitalize(detect); if (this[method]) { value2 = this[method](root2, node); } else { root2.walk((i5) => { value2 = i5.raws[own]; if (typeof value2 !== "undefined") return false; }); } } if (typeof value2 === "undefined") value2 = DEFAULT_RAW[detect]; root2.rawCache[detect] = value2; return value2; } rawBeforeClose(root2) { let value2; root2.walk((i5) => { if (i5.nodes && i5.nodes.length > 0) { if (typeof i5.raws.after !== "undefined") { value2 = i5.raws.after; if (value2.includes("\n")) { value2 = value2.replace(/[^\n]+$/, ""); } return false; } } }); if (value2) value2 = value2.replace(/\S/g, ""); return value2; } rawBeforeComment(root2, node) { let value2; root2.walkComments((i5) => { if (typeof i5.raws.before !== "undefined") { value2 = i5.raws.before; if (value2.includes("\n")) { value2 = value2.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value2 === "undefined") { value2 = this.raw(node, null, "beforeDecl"); } else if (value2) { value2 = value2.replace(/\S/g, ""); } return value2; } rawBeforeDecl(root2, node) { let value2; root2.walkDecls((i5) => { if (typeof i5.raws.before !== "undefined") { value2 = i5.raws.before; if (value2.includes("\n")) { value2 = value2.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value2 === "undefined") { value2 = this.raw(node, null, "beforeRule"); } else if (value2) { value2 = value2.replace(/\S/g, ""); } return value2; } rawBeforeOpen(root2) { let value2; root2.walk((i5) => { if (i5.type !== "decl") { value2 = i5.raws.between; if (typeof value2 !== "undefined") return false; } }); return value2; } rawBeforeRule(root2) { let value2; root2.walk((i5) => { if (i5.nodes && (i5.parent !== root2 || root2.first !== i5)) { if (typeof i5.raws.before !== "undefined") { value2 = i5.raws.before; if (value2.includes("\n")) { value2 = value2.replace(/[^\n]+$/, ""); } return false; } } }); if (value2) value2 = value2.replace(/\S/g, ""); return value2; } rawColon(root2) { let value2; root2.walkDecls((i5) => { if (typeof i5.raws.between !== "undefined") { value2 = i5.raws.between.replace(/[^\s:]/g, ""); return false; } }); return value2; } rawEmptyBody(root2) { let value2; root2.walk((i5) => { if (i5.nodes && i5.nodes.length === 0) { value2 = i5.raws.after; if (typeof value2 !== "undefined") return false; } }); return value2; } rawIndent(root2) { if (root2.raws.indent) return root2.raws.indent; let value2; root2.walk((i5) => { let p3 = i5.parent; if (p3 && p3 !== root2 && p3.parent && p3.parent === root2) { if (typeof i5.raws.before !== "undefined") { let parts = i5.raws.before.split("\n"); value2 = parts[parts.length - 1]; value2 = value2.replace(/\S/g, ""); return false; } } }); return value2; } rawSemicolon(root2) { let value2; root2.walk((i5) => { if (i5.nodes && i5.nodes.length && i5.last.type === "decl") { value2 = i5.raws.semicolon; if (typeof value2 !== "undefined") return false; } }); return value2; } rawValue(node, prop) { let value2 = node[prop]; let raw = node.raws[prop]; if (raw && raw.value === value2) { return raw.raw; } return value2; } root(node) { this.body(node); if (node.raws.after) this.builder(node.raws.after); } rule(node) { this.block(node, this.rawValue(node, "selector")); if (node.raws.ownSemicolon) { this.builder(node.raws.ownSemicolon, node, "end"); } } stringify(node, semicolon) { if (!this[node.type]) { throw new Error( "Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier." ); } this[node.type](node, semicolon); } }; module2.exports = Stringifier; Stringifier.default = Stringifier; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringify.js var require_stringify = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/stringify.js"(exports, module2) { "use strict"; var Stringifier = require_stringifier(); function stringify3(node, builder) { let str = new Stringifier(builder); str.stringify(node); } module2.exports = stringify3; stringify3.default = stringify3; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/symbols.js var require_symbols = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/symbols.js"(exports, module2) { "use strict"; module2.exports.isClean = Symbol("isClean"); module2.exports.my = Symbol("my"); } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/node.js var require_node = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/node.js"(exports, module2) { "use strict"; var CssSyntaxError = require_css_syntax_error(); var Stringifier = require_stringifier(); var stringify3 = require_stringify(); var { isClean, my } = require_symbols(); function cloneNode(obj, parent) { let cloned = new obj.constructor(); for (let i5 in obj) { if (!Object.prototype.hasOwnProperty.call(obj, i5)) { continue; } if (i5 === "proxyCache") continue; let value2 = obj[i5]; let type = typeof value2; if (i5 === "parent" && type === "object") { if (parent) cloned[i5] = parent; } else if (i5 === "source") { cloned[i5] = value2; } else if (Array.isArray(value2)) { cloned[i5] = value2.map((j2) => cloneNode(j2, cloned)); } else { if (type === "object" && value2 !== null) value2 = cloneNode(value2); cloned[i5] = value2; } } return cloned; } function sourceOffset(inputCSS, position) { if (position && typeof position.offset !== "undefined") { return position.offset; } let column2 = 1; let line2 = 1; let offset2 = 0; for (let i5 = 0; i5 < inputCSS.length; i5++) { if (line2 === position.line && column2 === position.column) { offset2 = i5; break; } if (inputCSS[i5] === "\n") { column2 = 1; line2 += 1; } else { column2 += 1; } } return offset2; } var Node3 = class { get proxyOf() { return this; } constructor(defaults = {}) { this.raws = {}; this[isClean] = false; this[my] = true; for (let name in defaults) { if (name === "nodes") { this.nodes = []; for (let node of defaults[name]) { if (typeof node.clone === "function") { this.append(node.clone()); } else { this.append(node); } } } else { this[name] = defaults[name]; } } } addToError(error) { error.postcssNode = this; if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { let s4 = this.source; error.stack = error.stack.replace( /\n\s{4}at /, `$&${s4.input.from}:${s4.start.line}:${s4.start.column}$&` ); } return error; } after(add) { this.parent.insertAfter(this, add); return this; } assign(overrides = {}) { for (let name in overrides) { this[name] = overrides[name]; } return this; } before(add) { this.parent.insertBefore(this, add); return this; } cleanRaws(keepBetween) { delete this.raws.before; delete this.raws.after; if (!keepBetween) delete this.raws.between; } clone(overrides = {}) { let cloned = cloneNode(this); for (let name in overrides) { cloned[name] = overrides[name]; } return cloned; } cloneAfter(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertAfter(this, cloned); return cloned; } cloneBefore(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertBefore(this, cloned); return cloned; } error(message, opts = {}) { if (this.source) { let { end, start } = this.rangeBy(opts); return this.source.input.error( message, { column: start.column, line: start.line }, { column: end.column, line: end.line }, opts ); } return new CssSyntaxError(message); } getProxyProcessor() { return { get(node, prop) { if (prop === "proxyOf") { return node; } else if (prop === "root") { return () => node.root().toProxy(); } else { return node[prop]; } }, set(node, prop, value2) { if (node[prop] === value2) return true; node[prop] = value2; if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */ prop === "text") { node.markDirty(); } return true; } }; } /* c8 ignore next 3 */ markClean() { this[isClean] = true; } markDirty() { if (this[isClean]) { this[isClean] = false; let next = this; while (next = next.parent) { next[isClean] = false; } } } next() { if (!this.parent) return void 0; let index = this.parent.index(this); return this.parent.nodes[index + 1]; } positionBy(opts = {}) { let pos2 = this.source.start; if (opts.index) { pos2 = this.positionInside(opts.index); } else if (opts.word) { let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ); let index = stringRepresentation.indexOf(opts.word); if (index !== -1) pos2 = this.positionInside(index); } return pos2; } positionInside(index) { let column2 = this.source.start.column; let line2 = this.source.start.line; let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let offset2 = sourceOffset(inputString, this.source.start); let end = offset2 + index; for (let i5 = offset2; i5 < end; i5++) { if (inputString[i5] === "\n") { column2 = 1; line2 += 1; } else { column2 += 1; } } return { column: column2, line: line2, offset: end }; } prev() { if (!this.parent) return void 0; let index = this.parent.index(this); return this.parent.nodes[index - 1]; } rangeBy(opts = {}) { let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let start = { column: this.source.start.column, line: this.source.start.line, offset: sourceOffset(inputString, this.source.start) }; let end = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line, offset: typeof this.source.end.offset === "number" ? ( // `source.end.offset` is exclusive, so we don't need to add 1 this.source.end.offset ) : ( // Since line/column in this.source.end is inclusive, // the `sourceOffset(... , this.source.end)` returns an inclusive offset. // So, we add 1 to convert it to exclusive. sourceOffset(inputString, this.source.end) + 1 ) } : { column: start.column + 1, line: start.line, offset: start.offset + 1 }; if (opts.word) { let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ); let index = stringRepresentation.indexOf(opts.word); if (index !== -1) { start = this.positionInside(index); end = this.positionInside(index + opts.word.length); } } else { if (opts.start) { start = { column: opts.start.column, line: opts.start.line, offset: sourceOffset(inputString, opts.start) }; } else if (opts.index) { start = this.positionInside(opts.index); } if (opts.end) { end = { column: opts.end.column, line: opts.end.line, offset: sourceOffset(inputString, opts.end) }; } else if (typeof opts.endIndex === "number") { end = this.positionInside(opts.endIndex); } else if (opts.index) { end = this.positionInside(opts.index + 1); } } if (end.line < start.line || end.line === start.line && end.column <= start.column) { end = { column: start.column + 1, line: start.line, offset: start.offset + 1 }; } return { end, start }; } raw(prop, defaultType) { let str = new Stringifier(); return str.raw(this, prop, defaultType); } remove() { if (this.parent) { this.parent.removeChild(this); } this.parent = void 0; return this; } replaceWith(...nodes) { if (this.parent) { let bookmark = this; let foundSelf = false; for (let node of nodes) { if (node === this) { foundSelf = true; } else if (foundSelf) { this.parent.insertAfter(bookmark, node); bookmark = node; } else { this.parent.insertBefore(bookmark, node); } } if (!foundSelf) { this.remove(); } } return this; } root() { let result = this; while (result.parent && result.parent.type !== "document") { result = result.parent; } return result; } toJSON(_, inputs) { let fixed = {}; let emitInputs = inputs == null; inputs = inputs || /* @__PURE__ */ new Map(); let inputsNextIndex = 0; for (let name in this) { if (!Object.prototype.hasOwnProperty.call(this, name)) { continue; } if (name === "parent" || name === "proxyCache") continue; let value2 = this[name]; if (Array.isArray(value2)) { fixed[name] = value2.map((i5) => { if (typeof i5 === "object" && i5.toJSON) { return i5.toJSON(null, inputs); } else { return i5; } }); } else if (typeof value2 === "object" && value2.toJSON) { fixed[name] = value2.toJSON(null, inputs); } else if (name === "source") { if (value2 == null) continue; let inputId = inputs.get(value2.input); if (inputId == null) { inputId = inputsNextIndex; inputs.set(value2.input, inputsNextIndex); inputsNextIndex++; } fixed[name] = { end: value2.end, inputId, start: value2.start }; } else { fixed[name] = value2; } } if (emitInputs) { fixed.inputs = [...inputs.keys()].map((input) => input.toJSON()); } return fixed; } toProxy() { if (!this.proxyCache) { this.proxyCache = new Proxy(this, this.getProxyProcessor()); } return this.proxyCache; } toString(stringifier = stringify3) { if (stringifier.stringify) stringifier = stringifier.stringify; let result = ""; stringifier(this, (i5) => { result += i5; }); return result; } warn(result, text, opts = {}) { let data2 = { node: this }; for (let i5 in opts) data2[i5] = opts[i5]; return result.warn(text, data2); } }; module2.exports = Node3; Node3.default = Node3; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/comment.js var require_comment = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/comment.js"(exports, module2) { "use strict"; var Node3 = require_node(); var Comment = class extends Node3 { constructor(defaults) { super(defaults); this.type = "comment"; } }; module2.exports = Comment; Comment.default = Comment; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/declaration.js var require_declaration = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/declaration.js"(exports, module2) { "use strict"; var Node3 = require_node(); var Declaration = class extends Node3 { get variable() { return this.prop.startsWith("--") || this.prop[0] === "$"; } constructor(defaults) { if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") { defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) }); } super(defaults); this.type = "decl"; } }; module2.exports = Declaration; Declaration.default = Declaration; } }); // node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/container.js var require_container = __commonJS({ "node_modules/.pnpm/postcss@8.5.9/node_modules/postcss/lib/container.js"(exports, module2) { "use strict"; var Comment = require_comment(); var Declaration = require_declaration(); var Node3 = require_node(); var { isClean, my } = require_symbols(); var AtRule; var parse6; var Root; var Rule; function cleanSource(nodes) { return nodes.map((i5) => { if (i5.nodes) i5.nodes = cleanSource(i5.nodes); delete i5