Skip to content

Instantly share code, notes, and snippets.

@dctanner
Last active September 1, 2023 14:08
Show Gist options
  • Save dctanner/78b45c45b906f8e91780095436b9a14a to your computer and use it in GitHub Desktop.
Save dctanner/78b45c45b906f8e91780095436b9a14a to your computer and use it in GitHub Desktop.
(function (g, f) {typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = f() : typeof define === 'function' && define.amd ? define([], f) : (g = typeof globalThis !== 'undefined' ? globalThis : g || self, g.ReactMarkdown = f()); }(this, (function () { 'use strict';
"use strict";
var ReactMarkdown = (() => {
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 __pow = Math.pow;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all3) => {
for (var name in all3)
__defProp(target, name, { get: all3[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// node_modules/.pnpm/[email protected]/node_modules/is-buffer/index.js
var require_is_buffer = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/is-buffer/index.js"(exports, module) {
module.exports = function isBuffer2(obj) {
return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
};
}
});
// node_modules/.pnpm/[email protected]/node_modules/extend/index.js
var require_extend = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/extend/index.js"(exports, module) {
"use strict";
var hasOwn = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var defineProperty = Object.defineProperty;
var gOPD = Object.getOwnPropertyDescriptor;
var isArray = function isArray2(arr) {
if (typeof Array.isArray === "function") {
return Array.isArray(arr);
}
return toStr.call(arr) === "[object Array]";
};
var isPlainObject2 = function isPlainObject3(obj) {
if (!obj || toStr.call(obj) !== "[object Object]") {
return false;
}
var hasOwnConstructor = hasOwn.call(obj, "constructor");
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
return false;
}
var key;
for (key in obj) {
}
return typeof key === "undefined" || hasOwn.call(obj, key);
};
var setProperty = function setProperty2(target, options) {
if (defineProperty && options.name === "__proto__") {
defineProperty(target, options.name, {
enumerable: true,
configurable: true,
value: options.newValue,
writable: true
});
} else {
target[options.name] = options.newValue;
}
};
var getProperty = function getProperty2(obj, name) {
if (name === "__proto__") {
if (!hasOwn.call(obj, name)) {
return void 0;
} else if (gOPD) {
return gOPD(obj, name).value;
}
}
return obj[name];
};
module.exports = function extend2() {
var options, name, src, copy, copyIsArray, clone;
var target = arguments[0];
var i = 1;
var length = arguments.length;
var deep = false;
if (typeof target === "boolean") {
deep = target;
target = arguments[1] || {};
i = 2;
}
if (target == null || typeof target !== "object" && typeof target !== "function") {
target = {};
}
for (; i < length; ++i) {
options = arguments[i];
if (options != null) {
for (name in options) {
src = getProperty(target, name);
copy = getProperty(options, name);
if (target !== copy) {
if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && isArray(src) ? src : [];
} else {
clone = src && isPlainObject2(src) ? src : {};
}
setProperty(target, { name, newValue: extend2(deep, clone, copy) });
} else if (typeof copy !== "undefined") {
setProperty(target, { name, newValue: copy });
}
}
}
}
}
return target;
};
}
});
// node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/emptyFunction.js
var require_emptyFunction = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/emptyFunction.js"(exports, module) {
"use strict";
function makeEmptyFunction(arg) {
return function() {
return arg;
};
}
var emptyFunction = function emptyFunction2() {
};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function() {
return this;
};
emptyFunction.thatReturnsArgument = function(arg) {
return arg;
};
module.exports = emptyFunction;
}
});
// node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/invariant.js
var require_invariant = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/invariant.js"(exports, module) {
"use strict";
var validateFormat = function validateFormat2(format) {
};
if (true) {
validateFormat = function validateFormat2(format) {
if (format === void 0) {
throw new Error("invariant requires an error message argument");
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === void 0) {
error = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function() {
return args[argIndex++];
}));
error.name = "Invariant Violation";
}
error.framesToPop = 1;
throw error;
}
}
module.exports = invariant;
}
});
// node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/warning.js
var require_warning = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/fbjs/lib/warning.js"(exports, module) {
"use strict";
var emptyFunction = require_emptyFunction();
var warning = emptyFunction;
if (true) {
printWarning = function printWarning2(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = "Warning: " + format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== "undefined") {
console.error(message);
}
try {
throw new Error(message);
} catch (x) {
}
};
warning = function warning2(condition, format) {
if (format === void 0) {
throw new Error("`warning(condition, format, ...args)` requires a warning message argument");
}
if (format.indexOf("Failed Composite propType: ") === 0) {
return;
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(void 0, [format].concat(args));
}
};
}
var printWarning;
module.exports = warning;
}
});
// node_modules/.pnpm/[email protected]/node_modules/prop-types/lib/ReactPropTypesSecret.js
var require_ReactPropTypesSecret = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
"use strict";
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
module.exports = ReactPropTypesSecret;
}
});
// node_modules/.pnpm/[email protected]/node_modules/prop-types/checkPropTypes.js
var require_checkPropTypes = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/prop-types/checkPropTypes.js"(exports, module) {
"use strict";
var invariant = require_invariant();
var warning = require_warning();
var ReactPropTypesSecret = require_ReactPropTypesSecret();
var loggedTypeFailures = {};
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (true) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
try {
invariant(typeof typeSpecs[typeSpecName] === "function", "%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.", componentName || "React class", location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
true ? warning(!error || error instanceof Error, "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : "";
true ? warning(false, "Failed %s type: %s%s", location, error.message, stack != null ? stack : "") : void 0;
}
}
}
}
}
module.exports = checkPropTypes;
}
});
// node_modules/.pnpm/[email protected]/node_modules/prop-types/factory.js
var require_factory = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/prop-types/factory.js"(exports, module) {
"use strict";
var emptyFunction = require_emptyFunction();
var invariant = require_invariant();
var warning = require_warning();
var ReactPropTypesSecret = require_ReactPropTypesSecret();
var checkPropTypes = require_checkPropTypes();
module.exports = function(isValidElement) {
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = "@@iterator";
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === "function") {
return iteratorFn;
}
}
var ANONYMOUS = "<<anonymous>>";
var ReactPropTypes;
if (true) {
ReactPropTypes = {
array: createPrimitiveTypeChecker("array"),
bool: createPrimitiveTypeChecker("boolean"),
func: createPrimitiveTypeChecker("function"),
number: createPrimitiveTypeChecker("number"),
object: createPrimitiveTypeChecker("object"),
string: createPrimitiveTypeChecker("string"),
symbol: createPrimitiveTypeChecker("symbol"),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
} else {
var productionTypeChecker = function() {
invariant(false, "React.PropTypes type checking code is stripped in production.");
};
productionTypeChecker.isRequired = productionTypeChecker;
var getProductionTypeChecker = function() {
return productionTypeChecker;
};
ReactPropTypes = {
array: productionTypeChecker,
bool: productionTypeChecker,
func: productionTypeChecker,
number: productionTypeChecker,
object: productionTypeChecker,
string: productionTypeChecker,
symbol: productionTypeChecker,
any: productionTypeChecker,
arrayOf: getProductionTypeChecker,
element: productionTypeChecker,
instanceOf: getProductionTypeChecker,
node: productionTypeChecker,
objectOf: getProductionTypeChecker,
oneOf: getProductionTypeChecker,
oneOfType: getProductionTypeChecker,
shape: getProductionTypeChecker
};
}
function is2(x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
function PropTypeError(message) {
this.message = message;
this.stack = "";
}
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (true) {
var manualPropTypeCallCache = {};
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (true) {
if (secret !== ReactPropTypesSecret && typeof console !== "undefined") {
var cacheKey = componentName + ":" + propName;
if (!manualPropTypeCallCache[cacheKey]) {
true ? warning(false, "You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will not work in production with the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.", propFullName, componentName) : void 0;
manualPropTypeCallCache[cacheKey] = true;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
}
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
var preciseType = getPreciseType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== "function") {
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
true ? warning(false, "Invalid argument supplied to oneOf, expected an instance of array.") : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is2(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + propValue + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== "function") {
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== "object") {
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
true ? warning(false, "Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`."));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== "object") {
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case "number":
case "string":
case "undefined":
return true;
case "boolean":
return !propValue;
case "object":
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
if (propType === "symbol") {
return true;
}
if (propValue["@@toStringTag"] === "Symbol") {
return true;
}
if (typeof Symbol === "function" && propValue instanceof Symbol) {
return true;
}
return false;
}
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return "array";
}
if (propValue instanceof RegExp) {
return "object";
}
if (isSymbol(propType, propValue)) {
return "symbol";
}
return propType;
}
function getPreciseType(propValue) {
var propType = getPropType(propValue);
if (propType === "object") {
if (propValue instanceof Date) {
return "date";
} else if (propValue instanceof RegExp) {
return "regexp";
}
}
return propType;
}
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
}
});
// node_modules/.pnpm/[email protected]/node_modules/prop-types/index.js
var require_prop_types = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/prop-types/index.js"(exports, module) {
var React3 = __require("react");
var factory = require_factory();
module.exports = factory(React3.isValidElement);
}
});
// node_modules/.pnpm/[email protected]/node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/react-is/cjs/react-is.development.js"(exports) {
"use strict";
if (true) {
(function() {
"use strict";
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
var REACT_MEMO_TYPE = Symbol.for("react.memo");
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
var enableScopeAPI = false;
var enableCacheElement = false;
var enableTransitionTracing = false;
var enableLegacyHidden = false;
var enableDebugTracing = false;
var REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
function isValidElementType(type) {
if (typeof type === "string" || typeof type === "function") {
return true;
}
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
return true;
}
if (typeof type === "object" && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
return true;
}
}
return false;
}
function typeOf(object) {
if (typeof object === "object" && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
case REACT_SUSPENSE_LIST_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_SERVER_CONTEXT_TYPE:
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
return void 0;
}
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
var hasWarnedAboutDeprecatedIsAsyncMode = false;
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
function isAsyncMode(object) {
{
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
hasWarnedAboutDeprecatedIsAsyncMode = true;
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
}
}
return false;
}
function isConcurrentMode(object) {
{
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
hasWarnedAboutDeprecatedIsConcurrentMode = true;
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
}
}
return false;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
function isSuspenseList(object) {
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
}
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.SuspenseList = SuspenseList;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isSuspenseList = isSuspenseList;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
})();
}
}
});
// node_modules/.pnpm/[email protected]/node_modules/react-is/index.js
var require_react_is = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/react-is/index.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_react_is_development();
}
}
});
// node_modules/.pnpm/[email protected]/node_modules/inline-style-parser/index.js
var require_inline_style_parser = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/inline-style-parser/index.js"(exports, module) {
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
var NEWLINE_REGEX = /\n/g;
var WHITESPACE_REGEX = /^\s*/;
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
var COLON_REGEX = /^:\s*/;
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
var SEMICOLON_REGEX = /^[;\s]*/;
var TRIM_REGEX = /^\s+|\s+$/g;
var NEWLINE = "\n";
var FORWARD_SLASH = "/";
var ASTERISK = "*";
var EMPTY_STRING = "";
var TYPE_COMMENT = "comment";
var TYPE_DECLARATION = "declaration";
module.exports = function(style, options) {
if (typeof style !== "string") {
throw new TypeError("First argument must be a string");
}
if (!style)
return [];
options = options || {};
var lineno = 1;
var column = 1;
function updatePosition(str) {
var lines = str.match(NEWLINE_REGEX);
if (lines)
lineno += lines.length;
var i = str.lastIndexOf(NEWLINE);
column = ~i ? str.length - i : column + str.length;
}
function position3() {
var start = { line: lineno, column };
return function(node2) {
node2.position = new Position(start);
whitespace2();
return node2;
};
}
function Position(start) {
this.start = start;
this.end = { line: lineno, column };
this.source = options.source;
}
Position.prototype.content = style;
var errorsList = [];
function error(msg) {
var err = new Error(
options.source + ":" + lineno + ":" + column + ": " + msg
);
err.reason = msg;
err.filename = options.source;
err.line = lineno;
err.column = column;
err.source = style;
if (options.silent) {
errorsList.push(err);
} else {
throw err;
}
}
function match(re) {
var m = re.exec(style);
if (!m)
return;
var str = m[0];
updatePosition(str);
style = style.slice(str.length);
return m;
}
function whitespace2() {
match(WHITESPACE_REGEX);
}
function comments(rules) {
var c;
rules = rules || [];
while (c = comment()) {
if (c !== false) {
rules.push(c);
}
}
return rules;
}
function comment() {
var pos = position3();
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1))
return;
var i = 2;
while (EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))) {
++i;
}
i += 2;
if (EMPTY_STRING === style.charAt(i - 1)) {
return error("End of comment missing");
}
var str = style.slice(2, i - 2);
column += 2;
updatePosition(str);
style = style.slice(i);
column += 2;
return pos({
type: TYPE_COMMENT,
comment: str
});
}
function declaration() {
var pos = position3();
var prop = match(PROPERTY_REGEX);
if (!prop)
return;
comment();
if (!match(COLON_REGEX))
return error("property missing ':'");
var val = match(VALUE_REGEX);
var ret = pos({
type: TYPE_DECLARATION,
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
});
match(SEMICOLON_REGEX);
return ret;
}
function declarations() {
var decls = [];
comments(decls);
var decl;
while (decl = declaration()) {
if (decl !== false) {
decls.push(decl);
comments(decls);
}
}
return decls;
}
whitespace2();
return declarations();
};
function trim(str) {
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
}
}
});
// node_modules/.pnpm/[email protected]/node_modules/style-to-object/index.js
var require_style_to_object = __commonJS({
"node_modules/.pnpm/[email protected]/node_modules/style-to-object/index.js"(exports, module) {
var parse2 = require_inline_style_parser();
function StyleToObject2(style, iterator) {
var output = null;
if (!style || typeof style !== "string") {
return output;
}
var declaration;
var declarations = parse2(style);
var hasIterator = typeof iterator === "function";
var property;
var value;
for (var i = 0, len = declarations.length; i < len; i++) {
declaration = declarations[i];
property = declaration.property;
value = declaration.value;
if (hasIterator) {
iterator(property, value, declaration);
} else if (value) {
output || (output = {});
output[property] = value;
}
}
return output;
}
module.exports = StyleToObject2;
module.exports.default = StyleToObject2;
}
});
// index.js
var react_markdown_8_0_exports = {};
__export(react_markdown_8_0_exports, {
default: () => ReactMarkdown,
uriTransformer: () => uriTransformer
});
// lib/uri-transformer.js
var protocols = ["http", "https", "mailto", "tel"];
function uriTransformer(uri) {
const url = (uri || "").trim();
const first = url.charAt(0);
if (first === "#" || first === "/") {
return url;
}
const colon = url.indexOf(":");
if (colon === -1) {
return url;
}
let index2 = -1;
while (++index2 < protocols.length) {
const protocol = protocols[index2];
if (colon === protocol.length && url.slice(0, protocol.length).toLowerCase() === protocol) {
return url;
}
}
index2 = url.indexOf("?");
if (index2 !== -1 && colon > index2) {
return url;
}
index2 = url.indexOf("#");
if (index2 !== -1 && colon > index2) {
return url;
}
return "javascript:void(0)";
}
// node_modules/.pnpm/[email protected]/node_modules/vfile/lib/index.js
var import_is_buffer = __toESM(require_is_buffer(), 1);
// node_modules/.pnpm/[email protected]/node_modules/vfile/lib/minpath.browser.js
var path = { basename, dirname, extname, join, sep: "/" };
function basename(path2, ext) {
var start = 0;
var end = -1;
var index2;
var firstNonSlashEnd;
var seenNonSlash;
var extIndex;
if (ext !== void 0 && typeof ext !== "string") {
throw new TypeError('"ext" argument must be a string');
}
assertPath(path2);
index2 = path2.length;
if (ext === void 0 || ext.length === 0 || ext.length > path2.length) {
while (index2--) {
if (path2.charCodeAt(index2) === 47) {
if (seenNonSlash) {
start = index2 + 1;
break;
}
} else if (end < 0) {
seenNonSlash = true;
end = index2 + 1;
}
}
return end < 0 ? "" : path2.slice(start, end);
}
if (ext === path2) {
return "";
}
firstNonSlashEnd = -1;
extIndex = ext.length - 1;
while (index2--) {
if (path2.charCodeAt(index2) === 47) {
if (seenNonSlash) {
start = index2 + 1;
break;
}
} else {
if (firstNonSlashEnd < 0) {
seenNonSlash = true;
firstNonSlashEnd = index2 + 1;
}
if (extIndex > -1) {
if (path2.charCodeAt(index2) === ext.charCodeAt(extIndex--)) {
if (extIndex < 0) {
end = index2;
}
} else {
extIndex = -1;
end = firstNonSlashEnd;
}
}
}
}
if (start === end) {
end = firstNonSlashEnd;
} else if (end < 0) {
end = path2.length;
}
return path2.slice(start, end);
}
function dirname(path2) {
var end;
var unmatchedSlash;
var index2;
assertPath(path2);
if (path2.length === 0) {
return ".";
}
end = -1;
index2 = path2.length;
while (--index2) {
if (path2.charCodeAt(index2) === 47) {
if (unmatchedSlash) {
end = index2;
break;
}
} else if (!unmatchedSlash) {
unmatchedSlash = true;
}
}
return end < 0 ? path2.charCodeAt(0) === 47 ? "/" : "." : end === 1 && path2.charCodeAt(0) === 47 ? "//" : path2.slice(0, end);
}
function extname(path2) {
var startDot = -1;
var startPart = 0;
var end = -1;
var preDotState = 0;
var unmatchedSlash;
var code2;
var index2;
assertPath(path2);
index2 = path2.length;
while (index2--) {
code2 = path2.charCodeAt(index2);
if (code2 === 47) {
if (unmatchedSlash) {
startPart = index2 + 1;
break;
}
continue;
}
if (end < 0) {
unmatchedSlash = true;
end = index2 + 1;
}
if (code2 === 46) {
if (startDot < 0) {
startDot = index2;
} else if (preDotState !== 1) {
preDotState = 1;
}
} else if (startDot > -1) {
preDotState = -1;
}
}
if (startDot < 0 || end < 0 || // We saw a non-dot character immediately before the dot.
preDotState === 0 || // The (right-most) trimmed path component is exactly `..`.
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return "";
}
return path2.slice(startDot, end);
}
function join(...segments) {
var index2 = -1;
var joined;
while (++index2 < segments.length) {
assertPath(segments[index2]);
if (segments[index2]) {
joined = joined === void 0 ? segments[index2] : joined + "/" + segments[index2];
}
}
return joined === void 0 ? "." : normalize(joined);
}
function normalize(path2) {
var absolute;
var value;
assertPath(path2);
absolute = path2.charCodeAt(0) === 47;
value = normalizeString(path2, !absolute);
if (value.length === 0 && !absolute) {
value = ".";
}
if (value.length > 0 && path2.charCodeAt(path2.length - 1) === 47) {
value += "/";
}
return absolute ? "/" + value : value;
}
function normalizeString(path2, allowAboveRoot) {
var result = "";
var lastSegmentLength = 0;
var lastSlash = -1;
var dots = 0;
var index2 = -1;
var code2;
var lastSlashIndex;
while (++index2 <= path2.length) {
if (index2 < path2.length) {
code2 = path2.charCodeAt(index2);
} else if (code2 === 47) {
break;
} else {
code2 = 47;
}
if (code2 === 47) {
if (lastSlash === index2 - 1 || dots === 1) {
} else if (lastSlash !== index2 - 1 && dots === 2) {
if (result.length < 2 || lastSegmentLength !== 2 || result.charCodeAt(result.length - 1) !== 46 || result.charCodeAt(result.length - 2) !== 46) {
if (result.length > 2) {
lastSlashIndex = result.lastIndexOf("/");
if (lastSlashIndex !== result.length - 1) {
if (lastSlashIndex < 0) {
result = "";
lastSegmentLength = 0;
} else {
result = result.slice(0, lastSlashIndex);
lastSegmentLength = result.length - 1 - result.lastIndexOf("/");
}
lastSlash = index2;
dots = 0;
continue;
}
} else if (result.length > 0) {
result = "";
lastSegmentLength = 0;
lastSlash = index2;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
result = result.length > 0 ? result + "/.." : "..";
lastSegmentLength = 2;
}
} else {
if (result.length > 0) {
result += "/" + path2.slice(lastSlash + 1, index2);
} else {
result = path2.slice(lastSlash + 1, index2);
}
lastSegmentLength = index2 - lastSlash - 1;
}
lastSlash = index2;
dots = 0;
} else if (code2 === 46 && dots > -1) {
dots++;
} else {
dots = -1;
}
}
return result;
}
function assertPath(path2) {
if (typeof path2 !== "string") {
throw new TypeError(
"Path must be a string. Received " + JSON.stringify(path2)
);
}
}
// node_modules/.pnpm/[email protected]/node_modules/vfile/lib/minproc.browser.js
var proc = { cwd };
function cwd() {
return "/";
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-stringify-position/lib/index.js
function stringifyPosition(value) {
if (!value || typeof value !== "object") {
return "";
}
if ("position" in value || "type" in value) {
return position(value.position);
}
if ("start" in value || "end" in value) {
return position(value);
}
if ("line" in value || "column" in value) {
return point(value);
}
return "";
}
function point(point4) {
return index(point4 && point4.line) + ":" + index(point4 && point4.column);
}
function position(pos) {
return point(pos && pos.start) + "-" + point(pos && pos.end);
}
function index(value) {
return value && typeof value === "number" ? value : 1;
}
// node_modules/.pnpm/[email protected]/node_modules/vfile-message/lib/index.js
var VFileMessage = class extends Error {
/**
* Create a message for `reason` at `place` from `origin`.
*
* When an error is passed in as `reason`, the `stack` is copied.
*
* @param {string | Error | VFileMessage} reason
* Reason for message, uses the stack and message of the error if given.
*
* > 👉 **Note**: you should use markdown.
* @param {Node | NodeLike | Position | Point | null | undefined} [place]
* Place in file where the message occurred.
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns
* Instance of `VFileMessage`.
*/
// To do: next major: expose `undefined` everywhere instead of `null`.
constructor(reason, place, origin) {
const parts = [null, null];
let position3 = {
// @ts-expect-error: we always follows the structure of `position`.
start: { line: null, column: null },
// @ts-expect-error: "
end: { line: null, column: null }
};
super();
if (typeof place === "string") {
origin = place;
place = void 0;
}
if (typeof origin === "string") {
const index2 = origin.indexOf(":");
if (index2 === -1) {
parts[1] = origin;
} else {
parts[0] = origin.slice(0, index2);
parts[1] = origin.slice(index2 + 1);
}
}
if (place) {
if ("type" in place || "position" in place) {
if (place.position) {
position3 = place.position;
}
} else if ("start" in place || "end" in place) {
position3 = place;
} else if ("line" in place || "column" in place) {
position3.start = place;
}
}
this.name = stringifyPosition(place) || "1:1";
this.message = typeof reason === "object" ? reason.message : reason;
this.stack = "";
if (typeof reason === "object" && reason.stack) {
this.stack = reason.stack;
}
this.reason = this.message;
this.fatal;
this.line = position3.start.line;
this.column = position3.start.column;
this.position = position3;
this.source = parts[0];
this.ruleId = parts[1];
this.file;
this.actual;
this.expected;
this.url;
this.note;
}
};
VFileMessage.prototype.file = "";
VFileMessage.prototype.name = "";
VFileMessage.prototype.reason = "";
VFileMessage.prototype.message = "";
VFileMessage.prototype.stack = "";
VFileMessage.prototype.fatal = null;
VFileMessage.prototype.column = null;
VFileMessage.prototype.line = null;
VFileMessage.prototype.source = null;
VFileMessage.prototype.ruleId = null;
VFileMessage.prototype.position = null;
// node_modules/.pnpm/[email protected]/node_modules/vfile/lib/index.js
var order = ["history", "path", "basename", "stem", "extname", "dirname"];
var VFile = class {
/**
* Create a new virtual file.
*
* If `options` is `string` or `Buffer`, treats it as `{value: options}`.
* If `options` is a `VFile`, shallow copies its data over to the new file.
* All other given fields are set on the newly created `VFile`.
*
* Path related properties are set in the following order (least specific to
* most specific): `history`, `path`, `basename`, `stem`, `extname`,
* `dirname`.
*
* It’s not possible to set either `dirname` or `extname` without setting
* either `history`, `path`, `basename`, or `stem` as well.
*
* @param {VFileCompatible} [value]
*/
constructor(value) {
var index2 = -1;
var options;
var prop;
if (!value) {
options = {};
} else if (typeof value === "string" || (0, import_is_buffer.default)(value)) {
options = { value };
} else {
options = value;
}
this.data = {};
this.messages = [];
this.history = [];
this.cwd = proc.cwd();
this.value;
while (++index2 < order.length) {
prop = order[index2];
if (prop in options && options[prop] !== void 0) {
this[prop] = prop === "history" ? options[prop].concat() : options[prop];
}
}
for (prop in options) {
if (!order.includes(prop)) {
this[prop] = options[prop];
}
}
}
/**
* Access full path (`~/index.min.js`).
*/
get path() {
return this.history[this.history.length - 1];
}
/**
* Set full path (`~/index.min.js`).
* Cannot be nullified.
*/
set path(path2) {
assertNonEmpty(path2, "path");
if (this.path !== path2) {
this.history.push(path2);
}
}
/**
* Access parent path (`~`).
*/
get dirname() {
return typeof this.path === "string" ? path.dirname(this.path) : void 0;
}
/**
* Set parent path (`~`).
* Cannot be set if there's no `path` yet.
*/
set dirname(dirname2) {
assertPath2(this.path, "dirname");
this.path = path.join(dirname2 || "", this.basename);
}
/**
* Access basename (including extname) (`index.min.js`).
*/
get basename() {
return typeof this.path === "string" ? path.basename(this.path) : void 0;
}
/**
* Set basename (`index.min.js`).
* Cannot contain path separators.
* Cannot be nullified either (use `file.path = file.dirname` instead).
*/
set basename(basename2) {
assertNonEmpty(basename2, "basename");
assertPart(basename2, "basename");
this.path = path.join(this.dirname || "", basename2);
}
/**
* Access extname (including dot) (`.js`).
*/
get extname() {
return typeof this.path === "string" ? path.extname(this.path) : void 0;
}
/**
* Set extname (including dot) (`.js`).
* Cannot be set if there's no `path` yet and cannot contain path separators.
*/
set extname(extname2) {
assertPart(extname2, "extname");
assertPath2(this.path, "extname");
if (extname2) {
if (extname2.charCodeAt(0) !== 46) {
throw new Error("`extname` must start with `.`");
}
if (extname2.includes(".", 1)) {
throw new Error("`extname` cannot contain multiple dots");
}
}
this.path = path.join(this.dirname, this.stem + (extname2 || ""));
}
/**
* Access stem (w/o extname) (`index.min`).
*/
get stem() {
return typeof this.path === "string" ? path.basename(this.path, this.extname) : void 0;
}
/**
* Set stem (w/o extname) (`index.min`).
* Cannot be nullified, and cannot contain path separators.
*/
set stem(stem) {
assertNonEmpty(stem, "stem");
assertPart(stem, "stem");
this.path = path.join(this.dirname || "", stem + (this.extname || ""));
}
/**
* Serialize the file.
*
* @param {BufferEncoding} [encoding='utf8'] If `file.value` is a buffer, `encoding` is used to serialize buffers.
* @returns {string}
*/
toString(encoding) {
return (this.value || "").toString(encoding);
}
/**
* Create a message and associates it w/ the file.
*
* @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
* @param {Node|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
* @param {string} [origin] Place in code the message originates from (`string`, optional).
* @returns {VFileMessage}
*/
message(reason, place, origin) {
var message = new VFileMessage(reason, place, origin);
if (this.path) {
message.name = this.path + ":" + message.name;
message.file = this.path;
}
message.fatal = false;
this.messages.push(message);
return message;
}
/**
* Info: create a message, associate it with the file, and mark the fatality
* as `null`.
* Calls `message()` internally.
*
* @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
* @param {Node|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
* @param {string} [origin] Place in code the message originates from (`string`, optional).
* @returns {VFileMessage}
*/
info(reason, place, origin) {
var message = this.message(reason, place, origin);
message.fatal = null;
return message;
}
/**
* Fail: create a message, associate it with the file, mark the fatality as
* `true`.
* Note: fatal errors mean a file is no longer processable.
* Calls `message()` internally.
*
* @param {string|Error} reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given.
* @param {Node|Position|Point} [place] Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional).
* @param {string} [origin] Place in code the message originates from (`string`, optional).
* @returns {never}
*/
fail(reason, place, origin) {
var message = this.message(reason, place, origin);
message.fatal = true;
throw message;
}
};
function assertPart(part, name) {
if (part && part.includes(path.sep)) {
throw new Error(
"`" + name + "` cannot be a path: did not expect `" + path.sep + "`"
);
}
}
function assertNonEmpty(part, name) {
if (!part) {
throw new Error("`" + name + "` cannot be empty");
}
}
function assertPath2(path2, name) {
if (!path2) {
throw new Error("Setting `" + name + "` requires `path` to be set too");
}
}
// node_modules/.pnpm/[email protected]/node_modules/bail/index.js
function bail(error) {
if (error) {
throw error;
}
}
// node_modules/.pnpm/[email protected]/node_modules/unified/lib/index.js
var import_is_buffer2 = __toESM(require_is_buffer(), 1);
var import_extend = __toESM(require_extend(), 1);
// node_modules/.pnpm/[email protected]/node_modules/is-plain-obj/index.js
function isPlainObject(value) {
if (typeof value !== "object" || value === null) {
return false;
}
const prototype = Object.getPrototypeOf(value);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
}
// node_modules/.pnpm/[email protected]/node_modules/trough/index.js
function trough() {
const fns = [];
const pipeline = { run, use };
return pipeline;
function run(...values) {
let middlewareIndex = -1;
const callback = values.pop();
if (typeof callback !== "function") {
throw new TypeError("Expected function as last argument, not " + callback);
}
next(null, ...values);
function next(error, ...output) {
const fn = fns[++middlewareIndex];
let index2 = -1;
if (error) {
callback(error);
return;
}
while (++index2 < values.length) {
if (output[index2] === null || output[index2] === void 0) {
output[index2] = values[index2];
}
}
values = output;
if (fn) {
wrap(fn, next)(...output);
} else {
callback(null, ...output);
}
}
}
function use(middelware) {
if (typeof middelware !== "function") {
throw new TypeError(
"Expected `middelware` to be a function, not " + middelware
);
}
fns.push(middelware);
return pipeline;
}
}
function wrap(middleware, callback) {
let called;
return wrapped;
function wrapped(...parameters) {
const fnExpectsCallback = middleware.length > parameters.length;
let result;
if (fnExpectsCallback) {
parameters.push(done);
}
try {
result = middleware.apply(this, parameters);
} catch (error) {
const exception = (
/** @type {Error} */
error
);
if (fnExpectsCallback && called) {
throw exception;
}
return done(exception);
}
if (!fnExpectsCallback) {
if (result instanceof Promise) {
result.then(then, done);
} else if (result instanceof Error) {
done(result);
} else {
then(result);
}
}
}
function done(error, ...output) {
if (!called) {
called = true;
callback(error, ...output);
}
}
function then(value) {
done(null, value);
}
}
// node_modules/.pnpm/[email protected]/node_modules/unified/lib/index.js
var unified = base().freeze();
var own = {}.hasOwnProperty;
function base() {
const transformers = trough();
const attachers = [];
let namespace = {};
let frozen;
let freezeIndex = -1;
processor.data = data;
processor.Parser = void 0;
processor.Compiler = void 0;
processor.freeze = freeze;
processor.attachers = attachers;
processor.use = use;
processor.parse = parse2;
processor.stringify = stringify3;
processor.run = run;
processor.runSync = runSync;
processor.process = process2;
processor.processSync = processSync;
return processor;
function processor() {
const destination = base();
let index2 = -1;
while (++index2 < attachers.length) {
destination.use(...attachers[index2]);
}
destination.data((0, import_extend.default)(true, {}, namespace));
return destination;
}
function data(key, value) {
if (typeof key === "string") {
if (arguments.length === 2) {
assertUnfrozen("data", frozen);
namespace[key] = value;
return processor;
}
return own.call(namespace, key) && namespace[key] || null;
}
if (key) {
assertUnfrozen("data", frozen);
namespace = key;
return processor;
}
return namespace;
}
function freeze() {
if (frozen) {
return processor;
}
while (++freezeIndex < attachers.length) {
const [attacher, ...options] = attachers[freezeIndex];
if (options[0] === false) {
continue;
}
if (options[0] === true) {
options[1] = void 0;
}
const transformer = attacher.call(processor, ...options);
if (typeof transformer === "function") {
transformers.use(transformer);
}
}
frozen = true;
freezeIndex = Number.POSITIVE_INFINITY;
return processor;
}
function use(value, ...options) {
let settings;
assertUnfrozen("use", frozen);
if (value === null || value === void 0) {
} else if (typeof value === "function") {
addPlugin(value, ...options);
} else if (typeof value === "object") {
if (Array.isArray(value)) {
addList(value);
} else {
addPreset(value);
}
} else {
throw new TypeError("Expected usable value, not `" + value + "`");
}
if (settings) {
namespace.settings = Object.assign(namespace.settings || {}, settings);
}
return processor;
function add(value2) {
if (typeof value2 === "function") {
addPlugin(value2);
} else if (typeof value2 === "object") {
if (Array.isArray(value2)) {
const [plugin, ...options2] = value2;
addPlugin(plugin, ...options2);
} else {
addPreset(value2);
}
} else {
throw new TypeError("Expected usable value, not `" + value2 + "`");
}
}
function addPreset(result) {
addList(result.plugins);
if (result.settings) {
settings = Object.assign(settings || {}, result.settings);
}
}
function addList(plugins) {
let index2 = -1;
if (plugins === null || plugins === void 0) {
} else if (Array.isArray(plugins)) {
while (++index2 < plugins.length) {
const thing = plugins[index2];
add(thing);
}
} else {
throw new TypeError("Expected a list of plugins, not `" + plugins + "`");
}
}
function addPlugin(plugin, value2) {
let index2 = -1;
let entry;
while (++index2 < attachers.length) {
if (attachers[index2][0] === plugin) {
entry = attachers[index2];
break;
}
}
if (entry) {
if (isPlainObject(entry[1]) && isPlainObject(value2)) {
value2 = (0, import_extend.default)(true, entry[1], value2);
}
entry[1] = value2;
} else {
attachers.push([...arguments]);
}
}
}
function parse2(doc) {
processor.freeze();
const file = vfile(doc);
const Parser = processor.Parser;
assertParser("parse", Parser);
if (newable(Parser, "parse")) {
return new Parser(String(file), file).parse();
}
return Parser(String(file), file);
}
function stringify3(node2, doc) {
processor.freeze();
const file = vfile(doc);
const Compiler = processor.Compiler;
assertCompiler("stringify", Compiler);
assertNode(node2);
if (newable(Compiler, "compile")) {
return new Compiler(node2, file).compile();
}
return Compiler(node2, file);
}
function run(node2, doc, callback) {
assertNode(node2);
processor.freeze();
if (!callback && typeof doc === "function") {
callback = doc;
doc = void 0;
}
if (!callback) {
return new Promise(executor);
}
executor(null, callback);
function executor(resolve, reject) {
transformers.run(node2, vfile(doc), done);
function done(error, tree, file) {
tree = tree || node2;
if (error) {
reject(error);
} else if (resolve) {
resolve(tree);
} else {
callback(null, tree, file);
}
}
}
}
function runSync(node2, file) {
let result;
let complete;
processor.run(node2, file, done);
assertDone("runSync", "run", complete);
return result;
function done(error, tree) {
bail(error);
result = tree;
complete = true;
}
}
function process2(doc, callback) {
processor.freeze();
assertParser("process", processor.Parser);
assertCompiler("process", processor.Compiler);
if (!callback) {
return new Promise(executor);
}
executor(null, callback);
function executor(resolve, reject) {
const file = vfile(doc);
processor.run(processor.parse(file), file, (error, tree, file2) => {
if (error || !tree || !file2) {
done(error);
} else {
const result = processor.stringify(tree, file2);
if (result === void 0 || result === null) {
} else if (looksLikeAVFileValue(result)) {
file2.value = result;
} else {
file2.result = result;
}
done(error, file2);
}
});
function done(error, file2) {
if (error || !file2) {
reject(error);
} else if (resolve) {
resolve(file2);
} else {
callback(null, file2);
}
}
}
}
function processSync(doc) {
let complete;
processor.freeze();
assertParser("processSync", processor.Parser);
assertCompiler("processSync", processor.Compiler);
const file = vfile(doc);
processor.process(file, done);
assertDone("processSync", "process", complete);
return file;
function done(error) {
complete = true;
bail(error);
}
}
}
function newable(value, name) {
return typeof value === "function" && // Prototypes do exist.
// type-coverage:ignore-next-line
value.prototype && // A function with keys in its prototype is probably a constructor.
// Classes’ prototype methods are not enumerable, so we check if some value
// exists in the prototype.
// type-coverage:ignore-next-line
(keys(value.prototype) || name in value.prototype);
}
function keys(value) {
let key;
for (key in value) {
if (own.call(value, key)) {
return true;
}
}
return false;
}
function assertParser(name, value) {
if (typeof value !== "function") {
throw new TypeError("Cannot `" + name + "` without `Parser`");
}
}
function assertCompiler(name, value) {
if (typeof value !== "function") {
throw new TypeError("Cannot `" + name + "` without `Compiler`");
}
}
function assertUnfrozen(name, frozen) {
if (frozen) {
throw new Error(
"Cannot call `" + name + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`."
);
}
}
function assertNode(node2) {
if (!isPlainObject(node2) || typeof node2.type !== "string") {
throw new TypeError("Expected node, got `" + node2 + "`");
}
}
function assertDone(name, asyncName, complete) {
if (!complete) {
throw new Error(
"`" + name + "` finished async. Use `" + asyncName + "` instead"
);
}
}
function vfile(value) {
return looksLikeAVFile(value) ? value : new VFile(value);
}
function looksLikeAVFile(value) {
return Boolean(
value && typeof value === "object" && "message" in value && "messages" in value
);
}
function looksLikeAVFileValue(value) {
return typeof value === "string" || (0, import_is_buffer2.default)(value);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-string/lib/index.js
var emptyOptions = {};
function toString(value, options) {
const settings = options || emptyOptions;
const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true;
const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
return one(value, includeImageAlt, includeHtml);
}
function one(value, includeImageAlt, includeHtml) {
if (node(value)) {
if ("value" in value) {
return value.type === "html" && !includeHtml ? "" : value.value;
}
if (includeImageAlt && "alt" in value && value.alt) {
return value.alt;
}
if ("children" in value) {
return all(value.children, includeImageAlt, includeHtml);
}
}
if (Array.isArray(value)) {
return all(value, includeImageAlt, includeHtml);
}
return "";
}
function all(values, includeImageAlt, includeHtml) {
const result = [];
let index2 = -1;
while (++index2 < values.length) {
result[index2] = one(values[index2], includeImageAlt, includeHtml);
}
return result.join("");
}
function node(value) {
return Boolean(value && typeof value === "object");
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-chunked/index.js
function splice(list3, start, remove, items) {
const end = list3.length;
let chunkStart = 0;
let parameters;
if (start < 0) {
start = -start > end ? 0 : end + start;
} else {
start = start > end ? end : start;
}
remove = remove > 0 ? remove : 0;
if (items.length < 1e4) {
parameters = Array.from(items);
parameters.unshift(start, remove);
list3.splice(...parameters);
} else {
if (remove)
list3.splice(start, remove);
while (chunkStart < items.length) {
parameters = items.slice(chunkStart, chunkStart + 1e4);
parameters.unshift(start, 0);
list3.splice(...parameters);
chunkStart += 1e4;
start += 1e4;
}
}
}
function push(list3, items) {
if (list3.length > 0) {
splice(list3, list3.length, 0, items);
return list3;
}
return items;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-combine-extensions/index.js
var hasOwnProperty = {}.hasOwnProperty;
function combineExtensions(extensions) {
const all3 = {};
let index2 = -1;
while (++index2 < extensions.length) {
syntaxExtension(all3, extensions[index2]);
}
return all3;
}
function syntaxExtension(all3, extension2) {
let hook;
for (hook in extension2) {
const maybe = hasOwnProperty.call(all3, hook) ? all3[hook] : void 0;
const left = maybe || (all3[hook] = {});
const right = extension2[hook];
let code2;
if (right) {
for (code2 in right) {
if (!hasOwnProperty.call(left, code2))
left[code2] = [];
const value = right[code2];
constructs(
// @ts-expect-error Looks like a list.
left[code2],
Array.isArray(value) ? value : value ? [value] : []
);
}
}
}
}
function constructs(existing, list3) {
let index2 = -1;
const before = [];
while (++index2 < list3.length) {
;
(list3[index2].add === "after" ? existing : before).push(list3[index2]);
}
splice(existing, 0, 0, before);
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js
var unicodePunctuationRegex = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/;
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-character/index.js
var asciiAlpha = regexCheck(/[A-Za-z]/);
var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
function asciiControl(code2) {
return (
// Special whitespace codes (which have negative values), C0 and Control
// character DEL
code2 !== null && (code2 < 32 || code2 === 127)
);
}
var asciiDigit = regexCheck(/\d/);
var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
function markdownLineEnding(code2) {
return code2 !== null && code2 < -2;
}
function markdownLineEndingOrSpace(code2) {
return code2 !== null && (code2 < 0 || code2 === 32);
}
function markdownSpace(code2) {
return code2 === -2 || code2 === -1 || code2 === 32;
}
var unicodePunctuation = regexCheck(unicodePunctuationRegex);
var unicodeWhitespace = regexCheck(/\s/);
function regexCheck(regex) {
return check;
function check(code2) {
return code2 !== null && regex.test(String.fromCharCode(code2));
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-factory-space/index.js
function factorySpace(effects, ok2, type, max) {
const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
let size = 0;
return start;
function start(code2) {
if (markdownSpace(code2)) {
effects.enter(type);
return prefix(code2);
}
return ok2(code2);
}
function prefix(code2) {
if (markdownSpace(code2) && size++ < limit) {
effects.consume(code2);
return prefix;
}
effects.exit(type);
return ok2(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/initialize/content.js
var content = {
tokenize: initializeContent
};
function initializeContent(effects) {
const contentStart = effects.attempt(
this.parser.constructs.contentInitial,
afterContentStartConstruct,
paragraphInitial
);
let previous2;
return contentStart;
function afterContentStartConstruct(code2) {
if (code2 === null) {
effects.consume(code2);
return;
}
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return factorySpace(effects, contentStart, "linePrefix");
}
function paragraphInitial(code2) {
effects.enter("paragraph");
return lineStart(code2);
}
function lineStart(code2) {
const token = effects.enter("chunkText", {
contentType: "text",
previous: previous2
});
if (previous2) {
previous2.next = token;
}
previous2 = token;
return data(code2);
}
function data(code2) {
if (code2 === null) {
effects.exit("chunkText");
effects.exit("paragraph");
effects.consume(code2);
return;
}
if (markdownLineEnding(code2)) {
effects.consume(code2);
effects.exit("chunkText");
return lineStart;
}
effects.consume(code2);
return data;
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/initialize/document.js
var document2 = {
tokenize: initializeDocument
};
var containerConstruct = {
tokenize: tokenizeContainer
};
function initializeDocument(effects) {
const self = this;
const stack = [];
let continued = 0;
let childFlow;
let childToken;
let lineStartOffset;
return start;
function start(code2) {
if (continued < stack.length) {
const item = stack[continued];
self.containerState = item[1];
return effects.attempt(
item[0].continuation,
documentContinue,
checkNewContainers
)(code2);
}
return checkNewContainers(code2);
}
function documentContinue(code2) {
continued++;
if (self.containerState._closeFlow) {
self.containerState._closeFlow = void 0;
if (childFlow) {
closeFlow();
}
const indexBeforeExits = self.events.length;
let indexBeforeFlow = indexBeforeExits;
let point4;
while (indexBeforeFlow--) {
if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
point4 = self.events[indexBeforeFlow][1].end;
break;
}
}
exitContainers(continued);
let index2 = indexBeforeExits;
while (index2 < self.events.length) {
self.events[index2][1].end = Object.assign({}, point4);
index2++;
}
splice(
self.events,
indexBeforeFlow + 1,
0,
self.events.slice(indexBeforeExits)
);
self.events.length = index2;
return checkNewContainers(code2);
}
return start(code2);
}
function checkNewContainers(code2) {
if (continued === stack.length) {
if (!childFlow) {
return documentContinued(code2);
}
if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
return flowStart(code2);
}
self.interrupt = Boolean(
childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
);
}
self.containerState = {};
return effects.check(
containerConstruct,
thereIsANewContainer,
thereIsNoNewContainer
)(code2);
}
function thereIsANewContainer(code2) {
if (childFlow)
closeFlow();
exitContainers(continued);
return documentContinued(code2);
}
function thereIsNoNewContainer(code2) {
self.parser.lazy[self.now().line] = continued !== stack.length;
lineStartOffset = self.now().offset;
return flowStart(code2);
}
function documentContinued(code2) {
self.containerState = {};
return effects.attempt(
containerConstruct,
containerContinue,
flowStart
)(code2);
}
function containerContinue(code2) {
continued++;
stack.push([self.currentConstruct, self.containerState]);
return documentContinued(code2);
}
function flowStart(code2) {
if (code2 === null) {
if (childFlow)
closeFlow();
exitContainers(0);
effects.consume(code2);
return;
}
childFlow = childFlow || self.parser.flow(self.now());
effects.enter("chunkFlow", {
contentType: "flow",
previous: childToken,
_tokenizer: childFlow
});
return flowContinue(code2);
}
function flowContinue(code2) {
if (code2 === null) {
writeToChild(effects.exit("chunkFlow"), true);
exitContainers(0);
effects.consume(code2);
return;
}
if (markdownLineEnding(code2)) {
effects.consume(code2);
writeToChild(effects.exit("chunkFlow"));
continued = 0;
self.interrupt = void 0;
return start;
}
effects.consume(code2);
return flowContinue;
}
function writeToChild(token, eof) {
const stream = self.sliceStream(token);
if (eof)
stream.push(null);
token.previous = childToken;
if (childToken)
childToken.next = token;
childToken = token;
childFlow.defineSkip(token.start);
childFlow.write(stream);
if (self.parser.lazy[token.start.line]) {
let index2 = childFlow.events.length;
while (index2--) {
if (
// The token starts before the line ending…
childFlow.events[index2][1].start.offset < lineStartOffset && // …and either is not ended yet…
(!childFlow.events[index2][1].end || // …or ends after it.
childFlow.events[index2][1].end.offset > lineStartOffset)
) {
return;
}
}
const indexBeforeExits = self.events.length;
let indexBeforeFlow = indexBeforeExits;
let seen;
let point4;
while (indexBeforeFlow--) {
if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") {
if (seen) {
point4 = self.events[indexBeforeFlow][1].end;
break;
}
seen = true;
}
}
exitContainers(continued);
index2 = indexBeforeExits;
while (index2 < self.events.length) {
self.events[index2][1].end = Object.assign({}, point4);
index2++;
}
splice(
self.events,
indexBeforeFlow + 1,
0,
self.events.slice(indexBeforeExits)
);
self.events.length = index2;
}
}
function exitContainers(size) {
let index2 = stack.length;
while (index2-- > size) {
const entry = stack[index2];
self.containerState = entry[1];
entry[0].exit.call(self, effects);
}
stack.length = size;
}
function closeFlow() {
childFlow.write([null]);
childToken = void 0;
childFlow = void 0;
self.containerState._closeFlow = void 0;
}
}
function tokenizeContainer(effects, ok2, nok) {
return factorySpace(
effects,
effects.attempt(this.parser.constructs.document, ok2, nok),
"linePrefix",
this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
);
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-classify-character/index.js
function classifyCharacter(code2) {
if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
return 1;
}
if (unicodePunctuation(code2)) {
return 2;
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-resolve-all/index.js
function resolveAll(constructs2, events, context) {
const called = [];
let index2 = -1;
while (++index2 < constructs2.length) {
const resolve = constructs2[index2].resolveAll;
if (resolve && !called.includes(resolve)) {
events = resolve(events, context);
called.push(resolve);
}
}
return events;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/attention.js
var attention = {
name: "attention",
tokenize: tokenizeAttention,
resolveAll: resolveAllAttention
};
function resolveAllAttention(events, context) {
let index2 = -1;
let open;
let group;
let text4;
let openingSequence;
let closingSequence;
let use;
let nextEvents;
let offset;
while (++index2 < events.length) {
if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) {
open = index2;
while (open--) {
if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && // If the markers are the same:
context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) {
if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) {
continue;
}
use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1;
const start = Object.assign({}, events[open][1].end);
const end = Object.assign({}, events[index2][1].start);
movePoint(start, -use);
movePoint(end, use);
openingSequence = {
type: use > 1 ? "strongSequence" : "emphasisSequence",
start,
end: Object.assign({}, events[open][1].end)
};
closingSequence = {
type: use > 1 ? "strongSequence" : "emphasisSequence",
start: Object.assign({}, events[index2][1].start),
end
};
text4 = {
type: use > 1 ? "strongText" : "emphasisText",
start: Object.assign({}, events[open][1].end),
end: Object.assign({}, events[index2][1].start)
};
group = {
type: use > 1 ? "strong" : "emphasis",
start: Object.assign({}, openingSequence.start),
end: Object.assign({}, closingSequence.end)
};
events[open][1].end = Object.assign({}, openingSequence.start);
events[index2][1].start = Object.assign({}, closingSequence.end);
nextEvents = [];
if (events[open][1].end.offset - events[open][1].start.offset) {
nextEvents = push(nextEvents, [
["enter", events[open][1], context],
["exit", events[open][1], context]
]);
}
nextEvents = push(nextEvents, [
["enter", group, context],
["enter", openingSequence, context],
["exit", openingSequence, context],
["enter", text4, context]
]);
nextEvents = push(
nextEvents,
resolveAll(
context.parser.constructs.insideSpan.null,
events.slice(open + 1, index2),
context
)
);
nextEvents = push(nextEvents, [
["exit", text4, context],
["enter", closingSequence, context],
["exit", closingSequence, context],
["exit", group, context]
]);
if (events[index2][1].end.offset - events[index2][1].start.offset) {
offset = 2;
nextEvents = push(nextEvents, [
["enter", events[index2][1], context],
["exit", events[index2][1], context]
]);
} else {
offset = 0;
}
splice(events, open - 1, index2 - open + 3, nextEvents);
index2 = open + nextEvents.length - offset - 2;
break;
}
}
}
}
index2 = -1;
while (++index2 < events.length) {
if (events[index2][1].type === "attentionSequence") {
events[index2][1].type = "data";
}
}
return events;
}
function tokenizeAttention(effects, ok2) {
const attentionMarkers2 = this.parser.constructs.attentionMarkers.null;
const previous2 = this.previous;
const before = classifyCharacter(previous2);
let marker;
return start;
function start(code2) {
marker = code2;
effects.enter("attentionSequence");
return inside(code2);
}
function inside(code2) {
if (code2 === marker) {
effects.consume(code2);
return inside;
}
const token = effects.exit("attentionSequence");
const after = classifyCharacter(code2);
const open = !after || after === 2 && before || attentionMarkers2.includes(code2);
const close = !before || before === 2 && after || attentionMarkers2.includes(previous2);
token._open = Boolean(marker === 42 ? open : open && (before || !close));
token._close = Boolean(marker === 42 ? close : close && (after || !open));
return ok2(code2);
}
}
function movePoint(point4, offset) {
point4.column += offset;
point4.offset += offset;
point4._bufferIndex += offset;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/autolink.js
var autolink = {
name: "autolink",
tokenize: tokenizeAutolink
};
function tokenizeAutolink(effects, ok2, nok) {
let size = 0;
return start;
function start(code2) {
effects.enter("autolink");
effects.enter("autolinkMarker");
effects.consume(code2);
effects.exit("autolinkMarker");
effects.enter("autolinkProtocol");
return open;
}
function open(code2) {
if (asciiAlpha(code2)) {
effects.consume(code2);
return schemeOrEmailAtext;
}
return emailAtext(code2);
}
function schemeOrEmailAtext(code2) {
if (code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) {
size = 1;
return schemeInsideOrEmailAtext(code2);
}
return emailAtext(code2);
}
function schemeInsideOrEmailAtext(code2) {
if (code2 === 58) {
effects.consume(code2);
size = 0;
return urlInside;
}
if ((code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) && size++ < 32) {
effects.consume(code2);
return schemeInsideOrEmailAtext;
}
size = 0;
return emailAtext(code2);
}
function urlInside(code2) {
if (code2 === 62) {
effects.exit("autolinkProtocol");
effects.enter("autolinkMarker");
effects.consume(code2);
effects.exit("autolinkMarker");
effects.exit("autolink");
return ok2;
}
if (code2 === null || code2 === 32 || code2 === 60 || asciiControl(code2)) {
return nok(code2);
}
effects.consume(code2);
return urlInside;
}
function emailAtext(code2) {
if (code2 === 64) {
effects.consume(code2);
return emailAtSignOrDot;
}
if (asciiAtext(code2)) {
effects.consume(code2);
return emailAtext;
}
return nok(code2);
}
function emailAtSignOrDot(code2) {
return asciiAlphanumeric(code2) ? emailLabel(code2) : nok(code2);
}
function emailLabel(code2) {
if (code2 === 46) {
effects.consume(code2);
size = 0;
return emailAtSignOrDot;
}
if (code2 === 62) {
effects.exit("autolinkProtocol").type = "autolinkEmail";
effects.enter("autolinkMarker");
effects.consume(code2);
effects.exit("autolinkMarker");
effects.exit("autolink");
return ok2;
}
return emailValue(code2);
}
function emailValue(code2) {
if ((code2 === 45 || asciiAlphanumeric(code2)) && size++ < 63) {
const next = code2 === 45 ? emailValue : emailLabel;
effects.consume(code2);
return next;
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/blank-line.js
var blankLine = {
tokenize: tokenizeBlankLine,
partial: true
};
function tokenizeBlankLine(effects, ok2, nok) {
return start;
function start(code2) {
return markdownSpace(code2) ? factorySpace(effects, after, "linePrefix")(code2) : after(code2);
}
function after(code2) {
return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/block-quote.js
var blockQuote = {
name: "blockQuote",
tokenize: tokenizeBlockQuoteStart,
continuation: {
tokenize: tokenizeBlockQuoteContinuation
},
exit
};
function tokenizeBlockQuoteStart(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
if (code2 === 62) {
const state = self.containerState;
if (!state.open) {
effects.enter("blockQuote", {
_container: true
});
state.open = true;
}
effects.enter("blockQuotePrefix");
effects.enter("blockQuoteMarker");
effects.consume(code2);
effects.exit("blockQuoteMarker");
return after;
}
return nok(code2);
}
function after(code2) {
if (markdownSpace(code2)) {
effects.enter("blockQuotePrefixWhitespace");
effects.consume(code2);
effects.exit("blockQuotePrefixWhitespace");
effects.exit("blockQuotePrefix");
return ok2;
}
effects.exit("blockQuotePrefix");
return ok2(code2);
}
}
function tokenizeBlockQuoteContinuation(effects, ok2, nok) {
const self = this;
return contStart;
function contStart(code2) {
if (markdownSpace(code2)) {
return factorySpace(
effects,
contBefore,
"linePrefix",
self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
)(code2);
}
return contBefore(code2);
}
function contBefore(code2) {
return effects.attempt(blockQuote, ok2, nok)(code2);
}
}
function exit(effects) {
effects.exit("blockQuote");
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/character-escape.js
var characterEscape = {
name: "characterEscape",
tokenize: tokenizeCharacterEscape
};
function tokenizeCharacterEscape(effects, ok2, nok) {
return start;
function start(code2) {
effects.enter("characterEscape");
effects.enter("escapeMarker");
effects.consume(code2);
effects.exit("escapeMarker");
return inside;
}
function inside(code2) {
if (asciiPunctuation(code2)) {
effects.enter("characterEscapeValue");
effects.consume(code2);
effects.exit("characterEscapeValue");
effects.exit("characterEscape");
return ok2;
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/decode-named-character-reference/index.dom.js
var element = document.createElement("i");
function decodeNamedCharacterReference(value) {
const characterReference2 = "&" + value + ";";
element.innerHTML = characterReference2;
const char = element.textContent;
if (char.charCodeAt(char.length - 1) === 59 && value !== "semi") {
return false;
}
return char === characterReference2 ? false : char;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/character-reference.js
var characterReference = {
name: "characterReference",
tokenize: tokenizeCharacterReference
};
function tokenizeCharacterReference(effects, ok2, nok) {
const self = this;
let size = 0;
let max;
let test;
return start;
function start(code2) {
effects.enter("characterReference");
effects.enter("characterReferenceMarker");
effects.consume(code2);
effects.exit("characterReferenceMarker");
return open;
}
function open(code2) {
if (code2 === 35) {
effects.enter("characterReferenceMarkerNumeric");
effects.consume(code2);
effects.exit("characterReferenceMarkerNumeric");
return numeric;
}
effects.enter("characterReferenceValue");
max = 31;
test = asciiAlphanumeric;
return value(code2);
}
function numeric(code2) {
if (code2 === 88 || code2 === 120) {
effects.enter("characterReferenceMarkerHexadecimal");
effects.consume(code2);
effects.exit("characterReferenceMarkerHexadecimal");
effects.enter("characterReferenceValue");
max = 6;
test = asciiHexDigit;
return value;
}
effects.enter("characterReferenceValue");
max = 7;
test = asciiDigit;
return value(code2);
}
function value(code2) {
if (code2 === 59 && size) {
const token = effects.exit("characterReferenceValue");
if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {
return nok(code2);
}
effects.enter("characterReferenceMarker");
effects.consume(code2);
effects.exit("characterReferenceMarker");
effects.exit("characterReference");
return ok2;
}
if (test(code2) && size++ < max) {
effects.consume(code2);
return value;
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/code-fenced.js
var nonLazyContinuation = {
tokenize: tokenizeNonLazyContinuation,
partial: true
};
var codeFenced = {
name: "codeFenced",
tokenize: tokenizeCodeFenced,
concrete: true
};
function tokenizeCodeFenced(effects, ok2, nok) {
const self = this;
const closeStart = {
tokenize: tokenizeCloseStart,
partial: true
};
let initialPrefix = 0;
let sizeOpen = 0;
let marker;
return start;
function start(code2) {
return beforeSequenceOpen(code2);
}
function beforeSequenceOpen(code2) {
const tail = self.events[self.events.length - 1];
initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
marker = code2;
effects.enter("codeFenced");
effects.enter("codeFencedFence");
effects.enter("codeFencedFenceSequence");
return sequenceOpen(code2);
}
function sequenceOpen(code2) {
if (code2 === marker) {
sizeOpen++;
effects.consume(code2);
return sequenceOpen;
}
if (sizeOpen < 3) {
return nok(code2);
}
effects.exit("codeFencedFenceSequence");
return markdownSpace(code2) ? factorySpace(effects, infoBefore, "whitespace")(code2) : infoBefore(code2);
}
function infoBefore(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("codeFencedFence");
return self.interrupt ? ok2(code2) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code2);
}
effects.enter("codeFencedFenceInfo");
effects.enter("chunkString", {
contentType: "string"
});
return info(code2);
}
function info(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("chunkString");
effects.exit("codeFencedFenceInfo");
return infoBefore(code2);
}
if (markdownSpace(code2)) {
effects.exit("chunkString");
effects.exit("codeFencedFenceInfo");
return factorySpace(effects, metaBefore, "whitespace")(code2);
}
if (code2 === 96 && code2 === marker) {
return nok(code2);
}
effects.consume(code2);
return info;
}
function metaBefore(code2) {
if (code2 === null || markdownLineEnding(code2)) {
return infoBefore(code2);
}
effects.enter("codeFencedFenceMeta");
effects.enter("chunkString", {
contentType: "string"
});
return meta(code2);
}
function meta(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("chunkString");
effects.exit("codeFencedFenceMeta");
return infoBefore(code2);
}
if (code2 === 96 && code2 === marker) {
return nok(code2);
}
effects.consume(code2);
return meta;
}
function atNonLazyBreak(code2) {
return effects.attempt(closeStart, after, contentBefore)(code2);
}
function contentBefore(code2) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return contentStart;
}
function contentStart(code2) {
return initialPrefix > 0 && markdownSpace(code2) ? factorySpace(
effects,
beforeContentChunk,
"linePrefix",
initialPrefix + 1
)(code2) : beforeContentChunk(code2);
}
function beforeContentChunk(code2) {
if (code2 === null || markdownLineEnding(code2)) {
return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code2);
}
effects.enter("codeFlowValue");
return contentChunk(code2);
}
function contentChunk(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("codeFlowValue");
return beforeContentChunk(code2);
}
effects.consume(code2);
return contentChunk;
}
function after(code2) {
effects.exit("codeFenced");
return ok2(code2);
}
function tokenizeCloseStart(effects2, ok3, nok2) {
let size = 0;
return startBefore;
function startBefore(code2) {
effects2.enter("lineEnding");
effects2.consume(code2);
effects2.exit("lineEnding");
return start2;
}
function start2(code2) {
effects2.enter("codeFencedFence");
return markdownSpace(code2) ? factorySpace(
effects2,
beforeSequenceClose,
"linePrefix",
self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
)(code2) : beforeSequenceClose(code2);
}
function beforeSequenceClose(code2) {
if (code2 === marker) {
effects2.enter("codeFencedFenceSequence");
return sequenceClose(code2);
}
return nok2(code2);
}
function sequenceClose(code2) {
if (code2 === marker) {
size++;
effects2.consume(code2);
return sequenceClose;
}
if (size >= sizeOpen) {
effects2.exit("codeFencedFenceSequence");
return markdownSpace(code2) ? factorySpace(effects2, sequenceCloseAfter, "whitespace")(code2) : sequenceCloseAfter(code2);
}
return nok2(code2);
}
function sequenceCloseAfter(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects2.exit("codeFencedFence");
return ok3(code2);
}
return nok2(code2);
}
}
}
function tokenizeNonLazyContinuation(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
if (code2 === null) {
return nok(code2);
}
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return lineStart;
}
function lineStart(code2) {
return self.parser.lazy[self.now().line] ? nok(code2) : ok2(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/code-indented.js
var codeIndented = {
name: "codeIndented",
tokenize: tokenizeCodeIndented
};
var furtherStart = {
tokenize: tokenizeFurtherStart,
partial: true
};
function tokenizeCodeIndented(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
effects.enter("codeIndented");
return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
}
function afterPrefix(code2) {
const tail = self.events[self.events.length - 1];
return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code2) : nok(code2);
}
function atBreak(code2) {
if (code2 === null) {
return after(code2);
}
if (markdownLineEnding(code2)) {
return effects.attempt(furtherStart, atBreak, after)(code2);
}
effects.enter("codeFlowValue");
return inside(code2);
}
function inside(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("codeFlowValue");
return atBreak(code2);
}
effects.consume(code2);
return inside;
}
function after(code2) {
effects.exit("codeIndented");
return ok2(code2);
}
}
function tokenizeFurtherStart(effects, ok2, nok) {
const self = this;
return furtherStart2;
function furtherStart2(code2) {
if (self.parser.lazy[self.now().line]) {
return nok(code2);
}
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return furtherStart2;
}
return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2);
}
function afterPrefix(code2) {
const tail = self.events[self.events.length - 1];
return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok2(code2) : markdownLineEnding(code2) ? furtherStart2(code2) : nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/code-text.js
var codeText = {
name: "codeText",
tokenize: tokenizeCodeText,
resolve: resolveCodeText,
previous
};
function resolveCodeText(events) {
let tailExitIndex = events.length - 4;
let headEnterIndex = 3;
let index2;
let enter;
if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) {
index2 = headEnterIndex;
while (++index2 < tailExitIndex) {
if (events[index2][1].type === "codeTextData") {
events[headEnterIndex][1].type = "codeTextPadding";
events[tailExitIndex][1].type = "codeTextPadding";
headEnterIndex += 2;
tailExitIndex -= 2;
break;
}
}
}
index2 = headEnterIndex - 1;
tailExitIndex++;
while (++index2 <= tailExitIndex) {
if (enter === void 0) {
if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") {
enter = index2;
}
} else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") {
events[enter][1].type = "codeTextData";
if (index2 !== enter + 2) {
events[enter][1].end = events[index2 - 1][1].end;
events.splice(enter + 2, index2 - enter - 2);
tailExitIndex -= index2 - enter - 2;
index2 = enter + 2;
}
enter = void 0;
}
}
return events;
}
function previous(code2) {
return code2 !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
}
function tokenizeCodeText(effects, ok2, nok) {
const self = this;
let sizeOpen = 0;
let size;
let token;
return start;
function start(code2) {
effects.enter("codeText");
effects.enter("codeTextSequence");
return sequenceOpen(code2);
}
function sequenceOpen(code2) {
if (code2 === 96) {
effects.consume(code2);
sizeOpen++;
return sequenceOpen;
}
effects.exit("codeTextSequence");
return between(code2);
}
function between(code2) {
if (code2 === null) {
return nok(code2);
}
if (code2 === 32) {
effects.enter("space");
effects.consume(code2);
effects.exit("space");
return between;
}
if (code2 === 96) {
token = effects.enter("codeTextSequence");
size = 0;
return sequenceClose(code2);
}
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return between;
}
effects.enter("codeTextData");
return data(code2);
}
function data(code2) {
if (code2 === null || code2 === 32 || code2 === 96 || markdownLineEnding(code2)) {
effects.exit("codeTextData");
return between(code2);
}
effects.consume(code2);
return data;
}
function sequenceClose(code2) {
if (code2 === 96) {
effects.consume(code2);
size++;
return sequenceClose;
}
if (size === sizeOpen) {
effects.exit("codeTextSequence");
effects.exit("codeText");
return ok2(code2);
}
token.type = "codeTextData";
return data(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-subtokenize/index.js
function subtokenize(events) {
const jumps = {};
let index2 = -1;
let event;
let lineIndex;
let otherIndex;
let otherEvent;
let parameters;
let subevents;
let more;
while (++index2 < events.length) {
while (index2 in jumps) {
index2 = jumps[index2];
}
event = events[index2];
if (index2 && event[1].type === "chunkFlow" && events[index2 - 1][1].type === "listItemPrefix") {
subevents = event[1]._tokenizer.events;
otherIndex = 0;
if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") {
otherIndex += 2;
}
if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") {
while (++otherIndex < subevents.length) {
if (subevents[otherIndex][1].type === "content") {
break;
}
if (subevents[otherIndex][1].type === "chunkText") {
subevents[otherIndex][1]._isInFirstContentOfListItem = true;
otherIndex++;
}
}
}
}
if (event[0] === "enter") {
if (event[1].contentType) {
Object.assign(jumps, subcontent(events, index2));
index2 = jumps[index2];
more = true;
}
} else if (event[1]._container) {
otherIndex = index2;
lineIndex = void 0;
while (otherIndex--) {
otherEvent = events[otherIndex];
if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") {
if (otherEvent[0] === "enter") {
if (lineIndex) {
events[lineIndex][1].type = "lineEndingBlank";
}
otherEvent[1].type = "lineEnding";
lineIndex = otherIndex;
}
} else {
break;
}
}
if (lineIndex) {
event[1].end = Object.assign({}, events[lineIndex][1].start);
parameters = events.slice(lineIndex, index2);
parameters.unshift(event);
splice(events, lineIndex, index2 - lineIndex + 1, parameters);
}
}
}
return !more;
}
function subcontent(events, eventIndex) {
const token = events[eventIndex][1];
const context = events[eventIndex][2];
let startPosition = eventIndex - 1;
const startPositions = [];
const tokenizer = token._tokenizer || context.parser[token.contentType](token.start);
const childEvents = tokenizer.events;
const jumps = [];
const gaps = {};
let stream;
let previous2;
let index2 = -1;
let current = token;
let adjust = 0;
let start = 0;
const breaks = [start];
while (current) {
while (events[++startPosition][1] !== current) {
}
startPositions.push(startPosition);
if (!current._tokenizer) {
stream = context.sliceStream(current);
if (!current.next) {
stream.push(null);
}
if (previous2) {
tokenizer.defineSkip(current.start);
}
if (current._isInFirstContentOfListItem) {
tokenizer._gfmTasklistFirstContentOfListItem = true;
}
tokenizer.write(stream);
if (current._isInFirstContentOfListItem) {
tokenizer._gfmTasklistFirstContentOfListItem = void 0;
}
}
previous2 = current;
current = current.next;
}
current = token;
while (++index2 < childEvents.length) {
if (
// Find a void token that includes a break.
childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line
) {
start = index2 + 1;
breaks.push(start);
current._tokenizer = void 0;
current.previous = void 0;
current = current.next;
}
}
tokenizer.events = [];
if (current) {
current._tokenizer = void 0;
current.previous = void 0;
} else {
breaks.pop();
}
index2 = breaks.length;
while (index2--) {
const slice = childEvents.slice(breaks[index2], breaks[index2 + 1]);
const start2 = startPositions.pop();
jumps.unshift([start2, start2 + slice.length - 1]);
splice(events, start2, 2, slice);
}
index2 = -1;
while (++index2 < jumps.length) {
gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1];
adjust += jumps[index2][1] - jumps[index2][0] - 1;
}
return gaps;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/content.js
var content2 = {
tokenize: tokenizeContent,
resolve: resolveContent
};
var continuationConstruct = {
tokenize: tokenizeContinuation,
partial: true
};
function resolveContent(events) {
subtokenize(events);
return events;
}
function tokenizeContent(effects, ok2) {
let previous2;
return chunkStart;
function chunkStart(code2) {
effects.enter("content");
previous2 = effects.enter("chunkContent", {
contentType: "content"
});
return chunkInside(code2);
}
function chunkInside(code2) {
if (code2 === null) {
return contentEnd(code2);
}
if (markdownLineEnding(code2)) {
return effects.check(
continuationConstruct,
contentContinue,
contentEnd
)(code2);
}
effects.consume(code2);
return chunkInside;
}
function contentEnd(code2) {
effects.exit("chunkContent");
effects.exit("content");
return ok2(code2);
}
function contentContinue(code2) {
effects.consume(code2);
effects.exit("chunkContent");
previous2.next = effects.enter("chunkContent", {
contentType: "content",
previous: previous2
});
previous2 = previous2.next;
return chunkInside;
}
}
function tokenizeContinuation(effects, ok2, nok) {
const self = this;
return startLookahead;
function startLookahead(code2) {
effects.exit("chunkContent");
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return factorySpace(effects, prefixed, "linePrefix");
}
function prefixed(code2) {
if (code2 === null || markdownLineEnding(code2)) {
return nok(code2);
}
const tail = self.events[self.events.length - 1];
if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) {
return ok2(code2);
}
return effects.interrupt(self.parser.constructs.flow, nok, ok2)(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-factory-destination/index.js
function factoryDestination(effects, ok2, nok, type, literalType, literalMarkerType, rawType, stringType, max) {
const limit = max || Number.POSITIVE_INFINITY;
let balance = 0;
return start;
function start(code2) {
if (code2 === 60) {
effects.enter(type);
effects.enter(literalType);
effects.enter(literalMarkerType);
effects.consume(code2);
effects.exit(literalMarkerType);
return enclosedBefore;
}
if (code2 === null || code2 === 32 || code2 === 41 || asciiControl(code2)) {
return nok(code2);
}
effects.enter(type);
effects.enter(rawType);
effects.enter(stringType);
effects.enter("chunkString", {
contentType: "string"
});
return raw(code2);
}
function enclosedBefore(code2) {
if (code2 === 62) {
effects.enter(literalMarkerType);
effects.consume(code2);
effects.exit(literalMarkerType);
effects.exit(literalType);
effects.exit(type);
return ok2;
}
effects.enter(stringType);
effects.enter("chunkString", {
contentType: "string"
});
return enclosed(code2);
}
function enclosed(code2) {
if (code2 === 62) {
effects.exit("chunkString");
effects.exit(stringType);
return enclosedBefore(code2);
}
if (code2 === null || code2 === 60 || markdownLineEnding(code2)) {
return nok(code2);
}
effects.consume(code2);
return code2 === 92 ? enclosedEscape : enclosed;
}
function enclosedEscape(code2) {
if (code2 === 60 || code2 === 62 || code2 === 92) {
effects.consume(code2);
return enclosed;
}
return enclosed(code2);
}
function raw(code2) {
if (!balance && (code2 === null || code2 === 41 || markdownLineEndingOrSpace(code2))) {
effects.exit("chunkString");
effects.exit(stringType);
effects.exit(rawType);
effects.exit(type);
return ok2(code2);
}
if (balance < limit && code2 === 40) {
effects.consume(code2);
balance++;
return raw;
}
if (code2 === 41) {
effects.consume(code2);
balance--;
return raw;
}
if (code2 === null || code2 === 32 || code2 === 40 || asciiControl(code2)) {
return nok(code2);
}
effects.consume(code2);
return code2 === 92 ? rawEscape : raw;
}
function rawEscape(code2) {
if (code2 === 40 || code2 === 41 || code2 === 92) {
effects.consume(code2);
return raw;
}
return raw(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-factory-label/index.js
function factoryLabel(effects, ok2, nok, type, markerType, stringType) {
const self = this;
let size = 0;
let seen;
return start;
function start(code2) {
effects.enter(type);
effects.enter(markerType);
effects.consume(code2);
effects.exit(markerType);
effects.enter(stringType);
return atBreak;
}
function atBreak(code2) {
if (size > 999 || code2 === null || code2 === 91 || code2 === 93 && !seen || // To do: remove in the future once we’ve switched from
// `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
// which doesn’t need this.
// Hidden footnotes hook.
/* c8 ignore next 3 */
code2 === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) {
return nok(code2);
}
if (code2 === 93) {
effects.exit(stringType);
effects.enter(markerType);
effects.consume(code2);
effects.exit(markerType);
effects.exit(type);
return ok2;
}
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return atBreak;
}
effects.enter("chunkString", {
contentType: "string"
});
return labelInside(code2);
}
function labelInside(code2) {
if (code2 === null || code2 === 91 || code2 === 93 || markdownLineEnding(code2) || size++ > 999) {
effects.exit("chunkString");
return atBreak(code2);
}
effects.consume(code2);
if (!seen)
seen = !markdownSpace(code2);
return code2 === 92 ? labelEscape : labelInside;
}
function labelEscape(code2) {
if (code2 === 91 || code2 === 92 || code2 === 93) {
effects.consume(code2);
size++;
return labelInside;
}
return labelInside(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-factory-title/index.js
function factoryTitle(effects, ok2, nok, type, markerType, stringType) {
let marker;
return start;
function start(code2) {
if (code2 === 34 || code2 === 39 || code2 === 40) {
effects.enter(type);
effects.enter(markerType);
effects.consume(code2);
effects.exit(markerType);
marker = code2 === 40 ? 41 : code2;
return begin;
}
return nok(code2);
}
function begin(code2) {
if (code2 === marker) {
effects.enter(markerType);
effects.consume(code2);
effects.exit(markerType);
effects.exit(type);
return ok2;
}
effects.enter(stringType);
return atBreak(code2);
}
function atBreak(code2) {
if (code2 === marker) {
effects.exit(stringType);
return begin(marker);
}
if (code2 === null) {
return nok(code2);
}
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return factorySpace(effects, atBreak, "linePrefix");
}
effects.enter("chunkString", {
contentType: "string"
});
return inside(code2);
}
function inside(code2) {
if (code2 === marker || code2 === null || markdownLineEnding(code2)) {
effects.exit("chunkString");
return atBreak(code2);
}
effects.consume(code2);
return code2 === 92 ? escape : inside;
}
function escape(code2) {
if (code2 === marker || code2 === 92) {
effects.consume(code2);
return inside;
}
return inside(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-factory-whitespace/index.js
function factoryWhitespace(effects, ok2) {
let seen;
return start;
function start(code2) {
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
seen = true;
return start;
}
if (markdownSpace(code2)) {
return factorySpace(
effects,
start,
seen ? "linePrefix" : "lineSuffix"
)(code2);
}
return ok2(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-normalize-identifier/index.js
function normalizeIdentifier(value) {
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/definition.js
var definition = {
name: "definition",
tokenize: tokenizeDefinition
};
var titleBefore = {
tokenize: tokenizeTitleBefore,
partial: true
};
function tokenizeDefinition(effects, ok2, nok) {
const self = this;
let identifier;
return start;
function start(code2) {
effects.enter("definition");
return before(code2);
}
function before(code2) {
return factoryLabel.call(
self,
effects,
labelAfter,
// Note: we don’t need to reset the way `markdown-rs` does.
nok,
"definitionLabel",
"definitionLabelMarker",
"definitionLabelString"
)(code2);
}
function labelAfter(code2) {
identifier = normalizeIdentifier(
self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
);
if (code2 === 58) {
effects.enter("definitionMarker");
effects.consume(code2);
effects.exit("definitionMarker");
return markerAfter;
}
return nok(code2);
}
function markerAfter(code2) {
return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, destinationBefore)(code2) : destinationBefore(code2);
}
function destinationBefore(code2) {
return factoryDestination(
effects,
destinationAfter,
// Note: we don’t need to reset the way `markdown-rs` does.
nok,
"definitionDestination",
"definitionDestinationLiteral",
"definitionDestinationLiteralMarker",
"definitionDestinationRaw",
"definitionDestinationString"
)(code2);
}
function destinationAfter(code2) {
return effects.attempt(titleBefore, after, after)(code2);
}
function after(code2) {
return markdownSpace(code2) ? factorySpace(effects, afterWhitespace, "whitespace")(code2) : afterWhitespace(code2);
}
function afterWhitespace(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("definition");
self.parser.defined.push(identifier);
return ok2(code2);
}
return nok(code2);
}
}
function tokenizeTitleBefore(effects, ok2, nok) {
return titleBefore2;
function titleBefore2(code2) {
return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, beforeMarker)(code2) : nok(code2);
}
function beforeMarker(code2) {
return factoryTitle(
effects,
titleAfter,
nok,
"definitionTitle",
"definitionTitleMarker",
"definitionTitleString"
)(code2);
}
function titleAfter(code2) {
return markdownSpace(code2) ? factorySpace(effects, titleAfterOptionalWhitespace, "whitespace")(code2) : titleAfterOptionalWhitespace(code2);
}
function titleAfterOptionalWhitespace(code2) {
return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
var hardBreakEscape = {
name: "hardBreakEscape",
tokenize: tokenizeHardBreakEscape
};
function tokenizeHardBreakEscape(effects, ok2, nok) {
return start;
function start(code2) {
effects.enter("hardBreakEscape");
effects.consume(code2);
return after;
}
function after(code2) {
if (markdownLineEnding(code2)) {
effects.exit("hardBreakEscape");
return ok2(code2);
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/heading-atx.js
var headingAtx = {
name: "headingAtx",
tokenize: tokenizeHeadingAtx,
resolve: resolveHeadingAtx
};
function resolveHeadingAtx(events, context) {
let contentEnd = events.length - 2;
let contentStart = 3;
let content3;
let text4;
if (events[contentStart][1].type === "whitespace") {
contentStart += 2;
}
if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") {
contentEnd -= 2;
}
if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) {
contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;
}
if (contentEnd > contentStart) {
content3 = {
type: "atxHeadingText",
start: events[contentStart][1].start,
end: events[contentEnd][1].end
};
text4 = {
type: "chunkText",
start: events[contentStart][1].start,
end: events[contentEnd][1].end,
contentType: "text"
};
splice(events, contentStart, contentEnd - contentStart + 1, [
["enter", content3, context],
["enter", text4, context],
["exit", text4, context],
["exit", content3, context]
]);
}
return events;
}
function tokenizeHeadingAtx(effects, ok2, nok) {
let size = 0;
return start;
function start(code2) {
effects.enter("atxHeading");
return before(code2);
}
function before(code2) {
effects.enter("atxHeadingSequence");
return sequenceOpen(code2);
}
function sequenceOpen(code2) {
if (code2 === 35 && size++ < 6) {
effects.consume(code2);
return sequenceOpen;
}
if (code2 === null || markdownLineEndingOrSpace(code2)) {
effects.exit("atxHeadingSequence");
return atBreak(code2);
}
return nok(code2);
}
function atBreak(code2) {
if (code2 === 35) {
effects.enter("atxHeadingSequence");
return sequenceFurther(code2);
}
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("atxHeading");
return ok2(code2);
}
if (markdownSpace(code2)) {
return factorySpace(effects, atBreak, "whitespace")(code2);
}
effects.enter("atxHeadingText");
return data(code2);
}
function sequenceFurther(code2) {
if (code2 === 35) {
effects.consume(code2);
return sequenceFurther;
}
effects.exit("atxHeadingSequence");
return atBreak(code2);
}
function data(code2) {
if (code2 === null || code2 === 35 || markdownLineEndingOrSpace(code2)) {
effects.exit("atxHeadingText");
return atBreak(code2);
}
effects.consume(code2);
return data;
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-html-tag-name/index.js
var htmlBlockNames = [
"address",
"article",
"aside",
"base",
"basefont",
"blockquote",
"body",
"caption",
"center",
"col",
"colgroup",
"dd",
"details",
"dialog",
"dir",
"div",
"dl",
"dt",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"frame",
"frameset",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hr",
"html",
"iframe",
"legend",
"li",
"link",
"main",
"menu",
"menuitem",
"nav",
"noframes",
"ol",
"optgroup",
"option",
"p",
"param",
"search",
"section",
"summary",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"title",
"tr",
"track",
"ul"
];
var htmlRawNames = ["pre", "script", "style", "textarea"];
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/html-flow.js
var htmlFlow = {
name: "htmlFlow",
tokenize: tokenizeHtmlFlow,
resolveTo: resolveToHtmlFlow,
concrete: true
};
var blankLineBefore = {
tokenize: tokenizeBlankLineBefore,
partial: true
};
var nonLazyContinuationStart = {
tokenize: tokenizeNonLazyContinuationStart,
partial: true
};
function resolveToHtmlFlow(events) {
let index2 = events.length;
while (index2--) {
if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") {
break;
}
}
if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") {
events[index2][1].start = events[index2 - 2][1].start;
events[index2 + 1][1].start = events[index2 - 2][1].start;
events.splice(index2 - 2, 2);
}
return events;
}
function tokenizeHtmlFlow(effects, ok2, nok) {
const self = this;
let marker;
let closingTag;
let buffer2;
let index2;
let markerB;
return start;
function start(code2) {
return before(code2);
}
function before(code2) {
effects.enter("htmlFlow");
effects.enter("htmlFlowData");
effects.consume(code2);
return open;
}
function open(code2) {
if (code2 === 33) {
effects.consume(code2);
return declarationOpen;
}
if (code2 === 47) {
effects.consume(code2);
closingTag = true;
return tagCloseStart;
}
if (code2 === 63) {
effects.consume(code2);
marker = 3;
return self.interrupt ? ok2 : continuationDeclarationInside;
}
if (asciiAlpha(code2)) {
effects.consume(code2);
buffer2 = String.fromCharCode(code2);
return tagName;
}
return nok(code2);
}
function declarationOpen(code2) {
if (code2 === 45) {
effects.consume(code2);
marker = 2;
return commentOpenInside;
}
if (code2 === 91) {
effects.consume(code2);
marker = 5;
index2 = 0;
return cdataOpenInside;
}
if (asciiAlpha(code2)) {
effects.consume(code2);
marker = 4;
return self.interrupt ? ok2 : continuationDeclarationInside;
}
return nok(code2);
}
function commentOpenInside(code2) {
if (code2 === 45) {
effects.consume(code2);
return self.interrupt ? ok2 : continuationDeclarationInside;
}
return nok(code2);
}
function cdataOpenInside(code2) {
const value = "CDATA[";
if (code2 === value.charCodeAt(index2++)) {
effects.consume(code2);
if (index2 === value.length) {
return self.interrupt ? ok2 : continuation;
}
return cdataOpenInside;
}
return nok(code2);
}
function tagCloseStart(code2) {
if (asciiAlpha(code2)) {
effects.consume(code2);
buffer2 = String.fromCharCode(code2);
return tagName;
}
return nok(code2);
}
function tagName(code2) {
if (code2 === null || code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
const slash = code2 === 47;
const name = buffer2.toLowerCase();
if (!slash && !closingTag && htmlRawNames.includes(name)) {
marker = 1;
return self.interrupt ? ok2(code2) : continuation(code2);
}
if (htmlBlockNames.includes(buffer2.toLowerCase())) {
marker = 6;
if (slash) {
effects.consume(code2);
return basicSelfClosing;
}
return self.interrupt ? ok2(code2) : continuation(code2);
}
marker = 7;
return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code2) : closingTag ? completeClosingTagAfter(code2) : completeAttributeNameBefore(code2);
}
if (code2 === 45 || asciiAlphanumeric(code2)) {
effects.consume(code2);
buffer2 += String.fromCharCode(code2);
return tagName;
}
return nok(code2);
}
function basicSelfClosing(code2) {
if (code2 === 62) {
effects.consume(code2);
return self.interrupt ? ok2 : continuation;
}
return nok(code2);
}
function completeClosingTagAfter(code2) {
if (markdownSpace(code2)) {
effects.consume(code2);
return completeClosingTagAfter;
}
return completeEnd(code2);
}
function completeAttributeNameBefore(code2) {
if (code2 === 47) {
effects.consume(code2);
return completeEnd;
}
if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) {
effects.consume(code2);
return completeAttributeName;
}
if (markdownSpace(code2)) {
effects.consume(code2);
return completeAttributeNameBefore;
}
return completeEnd(code2);
}
function completeAttributeName(code2) {
if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) {
effects.consume(code2);
return completeAttributeName;
}
return completeAttributeNameAfter(code2);
}
function completeAttributeNameAfter(code2) {
if (code2 === 61) {
effects.consume(code2);
return completeAttributeValueBefore;
}
if (markdownSpace(code2)) {
effects.consume(code2);
return completeAttributeNameAfter;
}
return completeAttributeNameBefore(code2);
}
function completeAttributeValueBefore(code2) {
if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) {
return nok(code2);
}
if (code2 === 34 || code2 === 39) {
effects.consume(code2);
markerB = code2;
return completeAttributeValueQuoted;
}
if (markdownSpace(code2)) {
effects.consume(code2);
return completeAttributeValueBefore;
}
return completeAttributeValueUnquoted(code2);
}
function completeAttributeValueQuoted(code2) {
if (code2 === markerB) {
effects.consume(code2);
markerB = null;
return completeAttributeValueQuotedAfter;
}
if (code2 === null || markdownLineEnding(code2)) {
return nok(code2);
}
effects.consume(code2);
return completeAttributeValueQuoted;
}
function completeAttributeValueUnquoted(code2) {
if (code2 === null || code2 === 34 || code2 === 39 || code2 === 47 || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96 || markdownLineEndingOrSpace(code2)) {
return completeAttributeNameAfter(code2);
}
effects.consume(code2);
return completeAttributeValueUnquoted;
}
function completeAttributeValueQuotedAfter(code2) {
if (code2 === 47 || code2 === 62 || markdownSpace(code2)) {
return completeAttributeNameBefore(code2);
}
return nok(code2);
}
function completeEnd(code2) {
if (code2 === 62) {
effects.consume(code2);
return completeAfter;
}
return nok(code2);
}
function completeAfter(code2) {
if (code2 === null || markdownLineEnding(code2)) {
return continuation(code2);
}
if (markdownSpace(code2)) {
effects.consume(code2);
return completeAfter;
}
return nok(code2);
}
function continuation(code2) {
if (code2 === 45 && marker === 2) {
effects.consume(code2);
return continuationCommentInside;
}
if (code2 === 60 && marker === 1) {
effects.consume(code2);
return continuationRawTagOpen;
}
if (code2 === 62 && marker === 4) {
effects.consume(code2);
return continuationClose;
}
if (code2 === 63 && marker === 3) {
effects.consume(code2);
return continuationDeclarationInside;
}
if (code2 === 93 && marker === 5) {
effects.consume(code2);
return continuationCdataInside;
}
if (markdownLineEnding(code2) && (marker === 6 || marker === 7)) {
effects.exit("htmlFlowData");
return effects.check(
blankLineBefore,
continuationAfter,
continuationStart
)(code2);
}
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("htmlFlowData");
return continuationStart(code2);
}
effects.consume(code2);
return continuation;
}
function continuationStart(code2) {
return effects.check(
nonLazyContinuationStart,
continuationStartNonLazy,
continuationAfter
)(code2);
}
function continuationStartNonLazy(code2) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return continuationBefore;
}
function continuationBefore(code2) {
if (code2 === null || markdownLineEnding(code2)) {
return continuationStart(code2);
}
effects.enter("htmlFlowData");
return continuation(code2);
}
function continuationCommentInside(code2) {
if (code2 === 45) {
effects.consume(code2);
return continuationDeclarationInside;
}
return continuation(code2);
}
function continuationRawTagOpen(code2) {
if (code2 === 47) {
effects.consume(code2);
buffer2 = "";
return continuationRawEndTag;
}
return continuation(code2);
}
function continuationRawEndTag(code2) {
if (code2 === 62) {
const name = buffer2.toLowerCase();
if (htmlRawNames.includes(name)) {
effects.consume(code2);
return continuationClose;
}
return continuation(code2);
}
if (asciiAlpha(code2) && buffer2.length < 8) {
effects.consume(code2);
buffer2 += String.fromCharCode(code2);
return continuationRawEndTag;
}
return continuation(code2);
}
function continuationCdataInside(code2) {
if (code2 === 93) {
effects.consume(code2);
return continuationDeclarationInside;
}
return continuation(code2);
}
function continuationDeclarationInside(code2) {
if (code2 === 62) {
effects.consume(code2);
return continuationClose;
}
if (code2 === 45 && marker === 2) {
effects.consume(code2);
return continuationDeclarationInside;
}
return continuation(code2);
}
function continuationClose(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("htmlFlowData");
return continuationAfter(code2);
}
effects.consume(code2);
return continuationClose;
}
function continuationAfter(code2) {
effects.exit("htmlFlow");
return ok2(code2);
}
}
function tokenizeNonLazyContinuationStart(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
if (markdownLineEnding(code2)) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return after;
}
return nok(code2);
}
function after(code2) {
return self.parser.lazy[self.now().line] ? nok(code2) : ok2(code2);
}
}
function tokenizeBlankLineBefore(effects, ok2, nok) {
return start;
function start(code2) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return effects.attempt(blankLine, ok2, nok);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/html-text.js
var htmlText = {
name: "htmlText",
tokenize: tokenizeHtmlText
};
function tokenizeHtmlText(effects, ok2, nok) {
const self = this;
let marker;
let index2;
let returnState;
return start;
function start(code2) {
effects.enter("htmlText");
effects.enter("htmlTextData");
effects.consume(code2);
return open;
}
function open(code2) {
if (code2 === 33) {
effects.consume(code2);
return declarationOpen;
}
if (code2 === 47) {
effects.consume(code2);
return tagCloseStart;
}
if (code2 === 63) {
effects.consume(code2);
return instruction;
}
if (asciiAlpha(code2)) {
effects.consume(code2);
return tagOpen;
}
return nok(code2);
}
function declarationOpen(code2) {
if (code2 === 45) {
effects.consume(code2);
return commentOpenInside;
}
if (code2 === 91) {
effects.consume(code2);
index2 = 0;
return cdataOpenInside;
}
if (asciiAlpha(code2)) {
effects.consume(code2);
return declaration;
}
return nok(code2);
}
function commentOpenInside(code2) {
if (code2 === 45) {
effects.consume(code2);
return commentEnd;
}
return nok(code2);
}
function comment(code2) {
if (code2 === null) {
return nok(code2);
}
if (code2 === 45) {
effects.consume(code2);
return commentClose;
}
if (markdownLineEnding(code2)) {
returnState = comment;
return lineEndingBefore(code2);
}
effects.consume(code2);
return comment;
}
function commentClose(code2) {
if (code2 === 45) {
effects.consume(code2);
return commentEnd;
}
return comment(code2);
}
function commentEnd(code2) {
return code2 === 62 ? end(code2) : code2 === 45 ? commentClose(code2) : comment(code2);
}
function cdataOpenInside(code2) {
const value = "CDATA[";
if (code2 === value.charCodeAt(index2++)) {
effects.consume(code2);
return index2 === value.length ? cdata : cdataOpenInside;
}
return nok(code2);
}
function cdata(code2) {
if (code2 === null) {
return nok(code2);
}
if (code2 === 93) {
effects.consume(code2);
return cdataClose;
}
if (markdownLineEnding(code2)) {
returnState = cdata;
return lineEndingBefore(code2);
}
effects.consume(code2);
return cdata;
}
function cdataClose(code2) {
if (code2 === 93) {
effects.consume(code2);
return cdataEnd;
}
return cdata(code2);
}
function cdataEnd(code2) {
if (code2 === 62) {
return end(code2);
}
if (code2 === 93) {
effects.consume(code2);
return cdataEnd;
}
return cdata(code2);
}
function declaration(code2) {
if (code2 === null || code2 === 62) {
return end(code2);
}
if (markdownLineEnding(code2)) {
returnState = declaration;
return lineEndingBefore(code2);
}
effects.consume(code2);
return declaration;
}
function instruction(code2) {
if (code2 === null) {
return nok(code2);
}
if (code2 === 63) {
effects.consume(code2);
return instructionClose;
}
if (markdownLineEnding(code2)) {
returnState = instruction;
return lineEndingBefore(code2);
}
effects.consume(code2);
return instruction;
}
function instructionClose(code2) {
return code2 === 62 ? end(code2) : instruction(code2);
}
function tagCloseStart(code2) {
if (asciiAlpha(code2)) {
effects.consume(code2);
return tagClose;
}
return nok(code2);
}
function tagClose(code2) {
if (code2 === 45 || asciiAlphanumeric(code2)) {
effects.consume(code2);
return tagClose;
}
return tagCloseBetween(code2);
}
function tagCloseBetween(code2) {
if (markdownLineEnding(code2)) {
returnState = tagCloseBetween;
return lineEndingBefore(code2);
}
if (markdownSpace(code2)) {
effects.consume(code2);
return tagCloseBetween;
}
return end(code2);
}
function tagOpen(code2) {
if (code2 === 45 || asciiAlphanumeric(code2)) {
effects.consume(code2);
return tagOpen;
}
if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
return tagOpenBetween(code2);
}
return nok(code2);
}
function tagOpenBetween(code2) {
if (code2 === 47) {
effects.consume(code2);
return end;
}
if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) {
effects.consume(code2);
return tagOpenAttributeName;
}
if (markdownLineEnding(code2)) {
returnState = tagOpenBetween;
return lineEndingBefore(code2);
}
if (markdownSpace(code2)) {
effects.consume(code2);
return tagOpenBetween;
}
return end(code2);
}
function tagOpenAttributeName(code2) {
if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) {
effects.consume(code2);
return tagOpenAttributeName;
}
return tagOpenAttributeNameAfter(code2);
}
function tagOpenAttributeNameAfter(code2) {
if (code2 === 61) {
effects.consume(code2);
return tagOpenAttributeValueBefore;
}
if (markdownLineEnding(code2)) {
returnState = tagOpenAttributeNameAfter;
return lineEndingBefore(code2);
}
if (markdownSpace(code2)) {
effects.consume(code2);
return tagOpenAttributeNameAfter;
}
return tagOpenBetween(code2);
}
function tagOpenAttributeValueBefore(code2) {
if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) {
return nok(code2);
}
if (code2 === 34 || code2 === 39) {
effects.consume(code2);
marker = code2;
return tagOpenAttributeValueQuoted;
}
if (markdownLineEnding(code2)) {
returnState = tagOpenAttributeValueBefore;
return lineEndingBefore(code2);
}
if (markdownSpace(code2)) {
effects.consume(code2);
return tagOpenAttributeValueBefore;
}
effects.consume(code2);
return tagOpenAttributeValueUnquoted;
}
function tagOpenAttributeValueQuoted(code2) {
if (code2 === marker) {
effects.consume(code2);
marker = void 0;
return tagOpenAttributeValueQuotedAfter;
}
if (code2 === null) {
return nok(code2);
}
if (markdownLineEnding(code2)) {
returnState = tagOpenAttributeValueQuoted;
return lineEndingBefore(code2);
}
effects.consume(code2);
return tagOpenAttributeValueQuoted;
}
function tagOpenAttributeValueUnquoted(code2) {
if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 96) {
return nok(code2);
}
if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
return tagOpenBetween(code2);
}
effects.consume(code2);
return tagOpenAttributeValueUnquoted;
}
function tagOpenAttributeValueQuotedAfter(code2) {
if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) {
return tagOpenBetween(code2);
}
return nok(code2);
}
function end(code2) {
if (code2 === 62) {
effects.consume(code2);
effects.exit("htmlTextData");
effects.exit("htmlText");
return ok2;
}
return nok(code2);
}
function lineEndingBefore(code2) {
effects.exit("htmlTextData");
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return lineEndingAfter;
}
function lineEndingAfter(code2) {
return markdownSpace(code2) ? factorySpace(
effects,
lineEndingAfterPrefix,
"linePrefix",
self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
)(code2) : lineEndingAfterPrefix(code2);
}
function lineEndingAfterPrefix(code2) {
effects.enter("htmlTextData");
return returnState(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/label-end.js
var labelEnd = {
name: "labelEnd",
tokenize: tokenizeLabelEnd,
resolveTo: resolveToLabelEnd,
resolveAll: resolveAllLabelEnd
};
var resourceConstruct = {
tokenize: tokenizeResource
};
var referenceFullConstruct = {
tokenize: tokenizeReferenceFull
};
var referenceCollapsedConstruct = {
tokenize: tokenizeReferenceCollapsed
};
function resolveAllLabelEnd(events) {
let index2 = -1;
while (++index2 < events.length) {
const token = events[index2][1];
if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") {
events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2);
token.type = "data";
index2++;
}
}
return events;
}
function resolveToLabelEnd(events, context) {
let index2 = events.length;
let offset = 0;
let token;
let open;
let close;
let media;
while (index2--) {
token = events[index2][1];
if (open) {
if (token.type === "link" || token.type === "labelLink" && token._inactive) {
break;
}
if (events[index2][0] === "enter" && token.type === "labelLink") {
token._inactive = true;
}
} else if (close) {
if (events[index2][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) {
open = index2;
if (token.type !== "labelLink") {
offset = 2;
break;
}
}
} else if (token.type === "labelEnd") {
close = index2;
}
}
const group = {
type: events[open][1].type === "labelLink" ? "link" : "image",
start: Object.assign({}, events[open][1].start),
end: Object.assign({}, events[events.length - 1][1].end)
};
const label = {
type: "label",
start: Object.assign({}, events[open][1].start),
end: Object.assign({}, events[close][1].end)
};
const text4 = {
type: "labelText",
start: Object.assign({}, events[open + offset + 2][1].end),
end: Object.assign({}, events[close - 2][1].start)
};
media = [
["enter", group, context],
["enter", label, context]
];
media = push(media, events.slice(open + 1, open + offset + 3));
media = push(media, [["enter", text4, context]]);
media = push(
media,
resolveAll(
context.parser.constructs.insideSpan.null,
events.slice(open + offset + 4, close - 3),
context
)
);
media = push(media, [
["exit", text4, context],
events[close - 2],
events[close - 1],
["exit", label, context]
]);
media = push(media, events.slice(close + 1));
media = push(media, [["exit", group, context]]);
splice(events, open, events.length, media);
return events;
}
function tokenizeLabelEnd(effects, ok2, nok) {
const self = this;
let index2 = self.events.length;
let labelStart;
let defined;
while (index2--) {
if ((self.events[index2][1].type === "labelImage" || self.events[index2][1].type === "labelLink") && !self.events[index2][1]._balanced) {
labelStart = self.events[index2][1];
break;
}
}
return start;
function start(code2) {
if (!labelStart) {
return nok(code2);
}
if (labelStart._inactive) {
return labelEndNok(code2);
}
defined = self.parser.defined.includes(
normalizeIdentifier(
self.sliceSerialize({
start: labelStart.end,
end: self.now()
})
)
);
effects.enter("labelEnd");
effects.enter("labelMarker");
effects.consume(code2);
effects.exit("labelMarker");
effects.exit("labelEnd");
return after;
}
function after(code2) {
if (code2 === 40) {
return effects.attempt(
resourceConstruct,
labelEndOk,
defined ? labelEndOk : labelEndNok
)(code2);
}
if (code2 === 91) {
return effects.attempt(
referenceFullConstruct,
labelEndOk,
defined ? referenceNotFull : labelEndNok
)(code2);
}
return defined ? labelEndOk(code2) : labelEndNok(code2);
}
function referenceNotFull(code2) {
return effects.attempt(
referenceCollapsedConstruct,
labelEndOk,
labelEndNok
)(code2);
}
function labelEndOk(code2) {
return ok2(code2);
}
function labelEndNok(code2) {
labelStart._balanced = true;
return nok(code2);
}
}
function tokenizeResource(effects, ok2, nok) {
return resourceStart;
function resourceStart(code2) {
effects.enter("resource");
effects.enter("resourceMarker");
effects.consume(code2);
effects.exit("resourceMarker");
return resourceBefore;
}
function resourceBefore(code2) {
return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceOpen)(code2) : resourceOpen(code2);
}
function resourceOpen(code2) {
if (code2 === 41) {
return resourceEnd(code2);
}
return factoryDestination(
effects,
resourceDestinationAfter,
resourceDestinationMissing,
"resourceDestination",
"resourceDestinationLiteral",
"resourceDestinationLiteralMarker",
"resourceDestinationRaw",
"resourceDestinationString",
32
)(code2);
}
function resourceDestinationAfter(code2) {
return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceBetween)(code2) : resourceEnd(code2);
}
function resourceDestinationMissing(code2) {
return nok(code2);
}
function resourceBetween(code2) {
if (code2 === 34 || code2 === 39 || code2 === 40) {
return factoryTitle(
effects,
resourceTitleAfter,
nok,
"resourceTitle",
"resourceTitleMarker",
"resourceTitleString"
)(code2);
}
return resourceEnd(code2);
}
function resourceTitleAfter(code2) {
return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, resourceEnd)(code2) : resourceEnd(code2);
}
function resourceEnd(code2) {
if (code2 === 41) {
effects.enter("resourceMarker");
effects.consume(code2);
effects.exit("resourceMarker");
effects.exit("resource");
return ok2;
}
return nok(code2);
}
}
function tokenizeReferenceFull(effects, ok2, nok) {
const self = this;
return referenceFull;
function referenceFull(code2) {
return factoryLabel.call(
self,
effects,
referenceFullAfter,
referenceFullMissing,
"reference",
"referenceMarker",
"referenceString"
)(code2);
}
function referenceFullAfter(code2) {
return self.parser.defined.includes(
normalizeIdentifier(
self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
)
) ? ok2(code2) : nok(code2);
}
function referenceFullMissing(code2) {
return nok(code2);
}
}
function tokenizeReferenceCollapsed(effects, ok2, nok) {
return referenceCollapsedStart;
function referenceCollapsedStart(code2) {
effects.enter("reference");
effects.enter("referenceMarker");
effects.consume(code2);
effects.exit("referenceMarker");
return referenceCollapsedOpen;
}
function referenceCollapsedOpen(code2) {
if (code2 === 93) {
effects.enter("referenceMarker");
effects.consume(code2);
effects.exit("referenceMarker");
effects.exit("reference");
return ok2;
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/label-start-image.js
var labelStartImage = {
name: "labelStartImage",
tokenize: tokenizeLabelStartImage,
resolveAll: labelEnd.resolveAll
};
function tokenizeLabelStartImage(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
effects.enter("labelImage");
effects.enter("labelImageMarker");
effects.consume(code2);
effects.exit("labelImageMarker");
return open;
}
function open(code2) {
if (code2 === 91) {
effects.enter("labelMarker");
effects.consume(code2);
effects.exit("labelMarker");
effects.exit("labelImage");
return after;
}
return nok(code2);
}
function after(code2) {
return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok2(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/label-start-link.js
var labelStartLink = {
name: "labelStartLink",
tokenize: tokenizeLabelStartLink,
resolveAll: labelEnd.resolveAll
};
function tokenizeLabelStartLink(effects, ok2, nok) {
const self = this;
return start;
function start(code2) {
effects.enter("labelLink");
effects.enter("labelMarker");
effects.consume(code2);
effects.exit("labelMarker");
effects.exit("labelLink");
return after;
}
function after(code2) {
return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok2(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/line-ending.js
var lineEnding = {
name: "lineEnding",
tokenize: tokenizeLineEnding
};
function tokenizeLineEnding(effects, ok2) {
return start;
function start(code2) {
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
return factorySpace(effects, ok2, "linePrefix");
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/thematic-break.js
var thematicBreak = {
name: "thematicBreak",
tokenize: tokenizeThematicBreak
};
function tokenizeThematicBreak(effects, ok2, nok) {
let size = 0;
let marker;
return start;
function start(code2) {
effects.enter("thematicBreak");
return before(code2);
}
function before(code2) {
marker = code2;
return atBreak(code2);
}
function atBreak(code2) {
if (code2 === marker) {
effects.enter("thematicBreakSequence");
return sequence(code2);
}
if (size >= 3 && (code2 === null || markdownLineEnding(code2))) {
effects.exit("thematicBreak");
return ok2(code2);
}
return nok(code2);
}
function sequence(code2) {
if (code2 === marker) {
effects.consume(code2);
size++;
return sequence;
}
effects.exit("thematicBreakSequence");
return markdownSpace(code2) ? factorySpace(effects, atBreak, "whitespace")(code2) : atBreak(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/list.js
var list = {
name: "list",
tokenize: tokenizeListStart,
continuation: {
tokenize: tokenizeListContinuation
},
exit: tokenizeListEnd
};
var listItemPrefixWhitespaceConstruct = {
tokenize: tokenizeListItemPrefixWhitespace,
partial: true
};
var indentConstruct = {
tokenize: tokenizeIndent,
partial: true
};
function tokenizeListStart(effects, ok2, nok) {
const self = this;
const tail = self.events[self.events.length - 1];
let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0;
let size = 0;
return start;
function start(code2) {
const kind = self.containerState.type || (code2 === 42 || code2 === 43 || code2 === 45 ? "listUnordered" : "listOrdered");
if (kind === "listUnordered" ? !self.containerState.marker || code2 === self.containerState.marker : asciiDigit(code2)) {
if (!self.containerState.type) {
self.containerState.type = kind;
effects.enter(kind, {
_container: true
});
}
if (kind === "listUnordered") {
effects.enter("listItemPrefix");
return code2 === 42 || code2 === 45 ? effects.check(thematicBreak, nok, atMarker)(code2) : atMarker(code2);
}
if (!self.interrupt || code2 === 49) {
effects.enter("listItemPrefix");
effects.enter("listItemValue");
return inside(code2);
}
}
return nok(code2);
}
function inside(code2) {
if (asciiDigit(code2) && ++size < 10) {
effects.consume(code2);
return inside;
}
if ((!self.interrupt || size < 2) && (self.containerState.marker ? code2 === self.containerState.marker : code2 === 41 || code2 === 46)) {
effects.exit("listItemValue");
return atMarker(code2);
}
return nok(code2);
}
function atMarker(code2) {
effects.enter("listItemMarker");
effects.consume(code2);
effects.exit("listItemMarker");
self.containerState.marker = self.containerState.marker || code2;
return effects.check(
blankLine,
// Can’t be empty when interrupting.
self.interrupt ? nok : onBlank,
effects.attempt(
listItemPrefixWhitespaceConstruct,
endOfPrefix,
otherPrefix
)
);
}
function onBlank(code2) {
self.containerState.initialBlankLine = true;
initialSize++;
return endOfPrefix(code2);
}
function otherPrefix(code2) {
if (markdownSpace(code2)) {
effects.enter("listItemPrefixWhitespace");
effects.consume(code2);
effects.exit("listItemPrefixWhitespace");
return endOfPrefix;
}
return nok(code2);
}
function endOfPrefix(code2) {
self.containerState.size = initialSize + self.sliceSerialize(effects.exit("listItemPrefix"), true).length;
return ok2(code2);
}
}
function tokenizeListContinuation(effects, ok2, nok) {
const self = this;
self.containerState._closeFlow = void 0;
return effects.check(blankLine, onBlank, notBlank);
function onBlank(code2) {
self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;
return factorySpace(
effects,
ok2,
"listItemIndent",
self.containerState.size + 1
)(code2);
}
function notBlank(code2) {
if (self.containerState.furtherBlankLines || !markdownSpace(code2)) {
self.containerState.furtherBlankLines = void 0;
self.containerState.initialBlankLine = void 0;
return notInCurrentItem(code2);
}
self.containerState.furtherBlankLines = void 0;
self.containerState.initialBlankLine = void 0;
return effects.attempt(indentConstruct, ok2, notInCurrentItem)(code2);
}
function notInCurrentItem(code2) {
self.containerState._closeFlow = true;
self.interrupt = void 0;
return factorySpace(
effects,
effects.attempt(list, ok2, nok),
"linePrefix",
self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
)(code2);
}
}
function tokenizeIndent(effects, ok2, nok) {
const self = this;
return factorySpace(
effects,
afterPrefix,
"listItemIndent",
self.containerState.size + 1
);
function afterPrefix(code2) {
const tail = self.events[self.events.length - 1];
return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok2(code2) : nok(code2);
}
}
function tokenizeListEnd(effects) {
effects.exit(this.containerState.type);
}
function tokenizeListItemPrefixWhitespace(effects, ok2, nok) {
const self = this;
return factorySpace(
effects,
afterPrefix,
"listItemPrefixWhitespace",
self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1
);
function afterPrefix(code2) {
const tail = self.events[self.events.length - 1];
return !markdownSpace(code2) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok2(code2) : nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/setext-underline.js
var setextUnderline = {
name: "setextUnderline",
tokenize: tokenizeSetextUnderline,
resolveTo: resolveToSetextUnderline
};
function resolveToSetextUnderline(events, context) {
let index2 = events.length;
let content3;
let text4;
let definition2;
while (index2--) {
if (events[index2][0] === "enter") {
if (events[index2][1].type === "content") {
content3 = index2;
break;
}
if (events[index2][1].type === "paragraph") {
text4 = index2;
}
} else {
if (events[index2][1].type === "content") {
events.splice(index2, 1);
}
if (!definition2 && events[index2][1].type === "definition") {
definition2 = index2;
}
}
}
const heading2 = {
type: "setextHeading",
start: Object.assign({}, events[text4][1].start),
end: Object.assign({}, events[events.length - 1][1].end)
};
events[text4][1].type = "setextHeadingText";
if (definition2) {
events.splice(text4, 0, ["enter", heading2, context]);
events.splice(definition2 + 1, 0, ["exit", events[content3][1], context]);
events[content3][1].end = Object.assign({}, events[definition2][1].end);
} else {
events[content3][1] = heading2;
}
events.push(["exit", heading2, context]);
return events;
}
function tokenizeSetextUnderline(effects, ok2, nok) {
const self = this;
let marker;
return start;
function start(code2) {
let index2 = self.events.length;
let paragraph2;
while (index2--) {
if (self.events[index2][1].type !== "lineEnding" && self.events[index2][1].type !== "linePrefix" && self.events[index2][1].type !== "content") {
paragraph2 = self.events[index2][1].type === "paragraph";
break;
}
}
if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph2)) {
effects.enter("setextHeadingLine");
marker = code2;
return before(code2);
}
return nok(code2);
}
function before(code2) {
effects.enter("setextHeadingLineSequence");
return inside(code2);
}
function inside(code2) {
if (code2 === marker) {
effects.consume(code2);
return inside;
}
effects.exit("setextHeadingLineSequence");
return markdownSpace(code2) ? factorySpace(effects, after, "lineSuffix")(code2) : after(code2);
}
function after(code2) {
if (code2 === null || markdownLineEnding(code2)) {
effects.exit("setextHeadingLine");
return ok2(code2);
}
return nok(code2);
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/initialize/flow.js
var flow = {
tokenize: initializeFlow
};
function initializeFlow(effects) {
const self = this;
const initial = effects.attempt(
// Try to parse a blank line.
blankLine,
atBlankEnding,
// Try to parse initial flow (essentially, only code).
effects.attempt(
this.parser.constructs.flowInitial,
afterConstruct,
factorySpace(
effects,
effects.attempt(
this.parser.constructs.flow,
afterConstruct,
effects.attempt(content2, afterConstruct)
),
"linePrefix"
)
)
);
return initial;
function atBlankEnding(code2) {
if (code2 === null) {
effects.consume(code2);
return;
}
effects.enter("lineEndingBlank");
effects.consume(code2);
effects.exit("lineEndingBlank");
self.currentConstruct = void 0;
return initial;
}
function afterConstruct(code2) {
if (code2 === null) {
effects.consume(code2);
return;
}
effects.enter("lineEnding");
effects.consume(code2);
effects.exit("lineEnding");
self.currentConstruct = void 0;
return initial;
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/initialize/text.js
var resolver = {
resolveAll: createResolver()
};
var string = initializeFactory("string");
var text = initializeFactory("text");
function initializeFactory(field) {
return {
tokenize: initializeText,
resolveAll: createResolver(
field === "text" ? resolveAllLineSuffixes : void 0
)
};
function initializeText(effects) {
const self = this;
const constructs2 = this.parser.constructs[field];
const text4 = effects.attempt(constructs2, start, notText);
return start;
function start(code2) {
return atBreak(code2) ? text4(code2) : notText(code2);
}
function notText(code2) {
if (code2 === null) {
effects.consume(code2);
return;
}
effects.enter("data");
effects.consume(code2);
return data;
}
function data(code2) {
if (atBreak(code2)) {
effects.exit("data");
return text4(code2);
}
effects.consume(code2);
return data;
}
function atBreak(code2) {
if (code2 === null) {
return true;
}
const list3 = constructs2[code2];
let index2 = -1;
if (list3) {
while (++index2 < list3.length) {
const item = list3[index2];
if (!item.previous || item.previous.call(self, self.previous)) {
return true;
}
}
}
return false;
}
}
}
function createResolver(extraResolver) {
return resolveAllText;
function resolveAllText(events, context) {
let index2 = -1;
let enter;
while (++index2 <= events.length) {
if (enter === void 0) {
if (events[index2] && events[index2][1].type === "data") {
enter = index2;
index2++;
}
} else if (!events[index2] || events[index2][1].type !== "data") {
if (index2 !== enter + 2) {
events[enter][1].end = events[index2 - 1][1].end;
events.splice(enter + 2, index2 - enter - 2);
index2 = enter + 2;
}
enter = void 0;
}
}
return extraResolver ? extraResolver(events, context) : events;
}
}
function resolveAllLineSuffixes(events, context) {
let eventIndex = 0;
while (++eventIndex <= events.length) {
if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") {
const data = events[eventIndex - 1][1];
const chunks = context.sliceStream(data);
let index2 = chunks.length;
let bufferIndex = -1;
let size = 0;
let tabs;
while (index2--) {
const chunk = chunks[index2];
if (typeof chunk === "string") {
bufferIndex = chunk.length;
while (chunk.charCodeAt(bufferIndex - 1) === 32) {
size++;
bufferIndex--;
}
if (bufferIndex)
break;
bufferIndex = -1;
} else if (chunk === -2) {
tabs = true;
size++;
} else if (chunk === -1) {
} else {
index2++;
break;
}
}
if (size) {
const token = {
type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing",
start: {
line: data.end.line,
column: data.end.column - size,
offset: data.end.offset - size,
_index: data.start._index + index2,
_bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex
},
end: Object.assign({}, data.end)
};
data.end = Object.assign({}, token.start);
if (data.start.offset === data.end.offset) {
Object.assign(data, token);
} else {
events.splice(
eventIndex,
0,
["enter", token, context],
["exit", token, context]
);
eventIndex += 2;
}
}
eventIndex++;
}
}
return events;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/create-tokenizer.js
function createTokenizer(parser, initialize, from) {
let point4 = Object.assign(
from ? Object.assign({}, from) : {
line: 1,
column: 1,
offset: 0
},
{
_index: 0,
_bufferIndex: -1
}
);
const columnStart = {};
const resolveAllConstructs = [];
let chunks = [];
let stack = [];
let consumed = true;
const effects = {
consume,
enter,
exit: exit2,
attempt: constructFactory(onsuccessfulconstruct),
check: constructFactory(onsuccessfulcheck),
interrupt: constructFactory(onsuccessfulcheck, {
interrupt: true
})
};
const context = {
previous: null,
code: null,
containerState: {},
events: [],
parser,
sliceStream,
sliceSerialize,
now,
defineSkip,
write
};
let state = initialize.tokenize.call(context, effects);
let expectedCode;
if (initialize.resolveAll) {
resolveAllConstructs.push(initialize);
}
return context;
function write(slice) {
chunks = push(chunks, slice);
main();
if (chunks[chunks.length - 1] !== null) {
return [];
}
addResult(initialize, 0);
context.events = resolveAll(resolveAllConstructs, context.events, context);
return context.events;
}
function sliceSerialize(token, expandTabs) {
return serializeChunks(sliceStream(token), expandTabs);
}
function sliceStream(token) {
return sliceChunks(chunks, token);
}
function now() {
const { line, column, offset, _index, _bufferIndex } = point4;
return {
line,
column,
offset,
_index,
_bufferIndex
};
}
function defineSkip(value) {
columnStart[value.line] = value.column;
accountForPotentialSkip();
}
function main() {
let chunkIndex;
while (point4._index < chunks.length) {
const chunk = chunks[point4._index];
if (typeof chunk === "string") {
chunkIndex = point4._index;
if (point4._bufferIndex < 0) {
point4._bufferIndex = 0;
}
while (point4._index === chunkIndex && point4._bufferIndex < chunk.length) {
go(chunk.charCodeAt(point4._bufferIndex));
}
} else {
go(chunk);
}
}
}
function go(code2) {
consumed = void 0;
expectedCode = code2;
state = state(code2);
}
function consume(code2) {
if (markdownLineEnding(code2)) {
point4.line++;
point4.column = 1;
point4.offset += code2 === -3 ? 2 : 1;
accountForPotentialSkip();
} else if (code2 !== -1) {
point4.column++;
point4.offset++;
}
if (point4._bufferIndex < 0) {
point4._index++;
} else {
point4._bufferIndex++;
if (point4._bufferIndex === chunks[point4._index].length) {
point4._bufferIndex = -1;
point4._index++;
}
}
context.previous = code2;
consumed = true;
}
function enter(type, fields) {
const token = fields || {};
token.type = type;
token.start = now();
context.events.push(["enter", token, context]);
stack.push(token);
return token;
}
function exit2(type) {
const token = stack.pop();
token.end = now();
context.events.push(["exit", token, context]);
return token;
}
function onsuccessfulconstruct(construct, info) {
addResult(construct, info.from);
}
function onsuccessfulcheck(_, info) {
info.restore();
}
function constructFactory(onreturn, fields) {
return hook;
function hook(constructs2, returnState, bogusState) {
let listOfConstructs;
let constructIndex;
let currentConstruct;
let info;
return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? (
// @ts-expect-error Looks like a construct.
handleListOfConstructs([constructs2])
) : handleMapOfConstructs(constructs2);
function handleMapOfConstructs(map) {
return start;
function start(code2) {
const def = code2 !== null && map[code2];
const all3 = code2 !== null && map.null;
const list3 = [
// To do: add more extension tests.
/* c8 ignore next 2 */
...Array.isArray(def) ? def : def ? [def] : [],
...Array.isArray(all3) ? all3 : all3 ? [all3] : []
];
return handleListOfConstructs(list3)(code2);
}
}
function handleListOfConstructs(list3) {
listOfConstructs = list3;
constructIndex = 0;
if (list3.length === 0) {
return bogusState;
}
return handleConstruct(list3[constructIndex]);
}
function handleConstruct(construct) {
return start;
function start(code2) {
info = store();
currentConstruct = construct;
if (!construct.partial) {
context.currentConstruct = construct;
}
if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {
return nok(code2);
}
return construct.tokenize.call(
// If we do have fields, create an object w/ `context` as its
// prototype.
// This allows a “live binding”, which is needed for `interrupt`.
fields ? Object.assign(Object.create(context), fields) : context,
effects,
ok2,
nok
)(code2);
}
}
function ok2(code2) {
consumed = true;
onreturn(currentConstruct, info);
return returnState;
}
function nok(code2) {
consumed = true;
info.restore();
if (++constructIndex < listOfConstructs.length) {
return handleConstruct(listOfConstructs[constructIndex]);
}
return bogusState;
}
}
}
function addResult(construct, from2) {
if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
resolveAllConstructs.push(construct);
}
if (construct.resolve) {
splice(
context.events,
from2,
context.events.length - from2,
construct.resolve(context.events.slice(from2), context)
);
}
if (construct.resolveTo) {
context.events = construct.resolveTo(context.events, context);
}
}
function store() {
const startPoint = now();
const startPrevious = context.previous;
const startCurrentConstruct = context.currentConstruct;
const startEventsIndex = context.events.length;
const startStack = Array.from(stack);
return {
restore,
from: startEventsIndex
};
function restore() {
point4 = startPoint;
context.previous = startPrevious;
context.currentConstruct = startCurrentConstruct;
context.events.length = startEventsIndex;
stack = startStack;
accountForPotentialSkip();
}
}
function accountForPotentialSkip() {
if (point4.line in columnStart && point4.column < 2) {
point4.column = columnStart[point4.line];
point4.offset += columnStart[point4.line] - 1;
}
}
}
function sliceChunks(chunks, token) {
const startIndex = token.start._index;
const startBufferIndex = token.start._bufferIndex;
const endIndex = token.end._index;
const endBufferIndex = token.end._bufferIndex;
let view;
if (startIndex === endIndex) {
view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];
} else {
view = chunks.slice(startIndex, endIndex);
if (startBufferIndex > -1) {
const head = view[0];
if (typeof head === "string") {
view[0] = head.slice(startBufferIndex);
} else {
view.shift();
}
}
if (endBufferIndex > 0) {
view.push(chunks[endIndex].slice(0, endBufferIndex));
}
}
return view;
}
function serializeChunks(chunks, expandTabs) {
let index2 = -1;
const result = [];
let atTab;
while (++index2 < chunks.length) {
const chunk = chunks[index2];
let value;
if (typeof chunk === "string") {
value = chunk;
} else
switch (chunk) {
case -5: {
value = "\r";
break;
}
case -4: {
value = "\n";
break;
}
case -3: {
value = "\r\n";
break;
}
case -2: {
value = expandTabs ? " " : " ";
break;
}
case -1: {
if (!expandTabs && atTab)
continue;
value = " ";
break;
}
default: {
value = String.fromCharCode(chunk);
}
}
atTab = chunk === -2;
result.push(value);
}
return result.join("");
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/constructs.js
var constructs_exports = {};
__export(constructs_exports, {
attentionMarkers: () => attentionMarkers,
contentInitial: () => contentInitial,
disable: () => disable,
document: () => document3,
flow: () => flow2,
flowInitial: () => flowInitial,
insideSpan: () => insideSpan,
string: () => string2,
text: () => text2
});
var document3 = {
[42]: list,
[43]: list,
[45]: list,
[48]: list,
[49]: list,
[50]: list,
[51]: list,
[52]: list,
[53]: list,
[54]: list,
[55]: list,
[56]: list,
[57]: list,
[62]: blockQuote
};
var contentInitial = {
[91]: definition
};
var flowInitial = {
[-2]: codeIndented,
[-1]: codeIndented,
[32]: codeIndented
};
var flow2 = {
[35]: headingAtx,
[42]: thematicBreak,
[45]: [setextUnderline, thematicBreak],
[60]: htmlFlow,
[61]: setextUnderline,
[95]: thematicBreak,
[96]: codeFenced,
[126]: codeFenced
};
var string2 = {
[38]: characterReference,
[92]: characterEscape
};
var text2 = {
[-5]: lineEnding,
[-4]: lineEnding,
[-3]: lineEnding,
[33]: labelStartImage,
[38]: characterReference,
[42]: attention,
[60]: [autolink, htmlText],
[91]: labelStartLink,
[92]: [hardBreakEscape, characterEscape],
[93]: labelEnd,
[95]: attention,
[96]: codeText
};
var insideSpan = {
null: [attention, resolver]
};
var attentionMarkers = {
null: [42, 95]
};
var disable = {
null: []
};
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/parse.js
function parse(options) {
const settings = options || {};
const constructs2 = (
/** @type {FullNormalizedExtension} */
combineExtensions([constructs_exports, ...settings.extensions || []])
);
const parser = {
defined: [],
lazy: {},
constructs: constructs2,
content: create2(content),
document: create2(document2),
flow: create2(flow),
string: create2(string),
text: create2(text)
};
return parser;
function create2(initial) {
return creator;
function creator(from) {
return createTokenizer(parser, initial, from);
}
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/preprocess.js
var search = /[\0\t\n\r]/g;
function preprocess() {
let column = 1;
let buffer2 = "";
let start = true;
let atCarriageReturn;
return preprocessor;
function preprocessor(value, encoding, end) {
const chunks = [];
let match;
let next;
let startPosition;
let endPosition;
let code2;
value = buffer2 + value.toString(encoding);
startPosition = 0;
buffer2 = "";
if (start) {
if (value.charCodeAt(0) === 65279) {
startPosition++;
}
start = void 0;
}
while (startPosition < value.length) {
search.lastIndex = startPosition;
match = search.exec(value);
endPosition = match && match.index !== void 0 ? match.index : value.length;
code2 = value.charCodeAt(endPosition);
if (!match) {
buffer2 = value.slice(startPosition);
break;
}
if (code2 === 10 && startPosition === endPosition && atCarriageReturn) {
chunks.push(-3);
atCarriageReturn = void 0;
} else {
if (atCarriageReturn) {
chunks.push(-5);
atCarriageReturn = void 0;
}
if (startPosition < endPosition) {
chunks.push(value.slice(startPosition, endPosition));
column += endPosition - startPosition;
}
switch (code2) {
case 0: {
chunks.push(65533);
column++;
break;
}
case 9: {
next = Math.ceil(column / 4) * 4;
chunks.push(-2);
while (column++ < next)
chunks.push(-1);
break;
}
case 10: {
chunks.push(-4);
column = 1;
break;
}
default: {
atCarriageReturn = true;
column = 1;
}
}
}
startPosition = endPosition + 1;
}
if (end) {
if (atCarriageReturn)
chunks.push(-5);
if (buffer2)
chunks.push(buffer2);
chunks.push(null);
}
return chunks;
}
}
// node_modules/.pnpm/[email protected]/node_modules/micromark/lib/postprocess.js
function postprocess(events) {
while (!subtokenize(events)) {
}
return events;
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-decode-numeric-character-reference/index.js
function decodeNumericCharacterReference(value, base2) {
const code2 = Number.parseInt(value, base2);
if (
// C0 except for HT, LF, FF, CR, space.
code2 < 9 || code2 === 11 || code2 > 13 && code2 < 32 || // Control character (DEL) of C0, and C1 controls.
code2 > 126 && code2 < 160 || // Lone high surrogates and low surrogates.
code2 > 55295 && code2 < 57344 || // Noncharacters.
code2 > 64975 && code2 < 65008 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534 || // Out of range
code2 > 1114111
) {
return "\uFFFD";
}
return String.fromCharCode(code2);
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-decode-string/index.js
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
function decodeString(value) {
return value.replace(characterEscapeOrReference, decode);
}
function decode($0, $1, $2) {
if ($1) {
return $1;
}
const head = $2.charCodeAt(0);
if (head === 35) {
const head2 = $2.charCodeAt(1);
const hex = head2 === 120 || head2 === 88;
return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
}
return decodeNamedCharacterReference($2) || $0;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-from-markdown/lib/index.js
var own2 = {}.hasOwnProperty;
var fromMarkdown = (
/**
* @type {(
* ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) &
* ((value: Value, options?: Options | null | undefined) => Root)
* )}
*/
/**
* @param {Value} value
* @param {Encoding | Options | null | undefined} [encoding]
* @param {Options | null | undefined} [options]
* @returns {Root}
*/
function(value, encoding, options) {
if (typeof encoding !== "string") {
options = encoding;
encoding = void 0;
}
return compiler(options)(
postprocess(
parse(options).document().write(preprocess()(value, encoding, true))
)
);
}
);
function compiler(options) {
const config = {
transforms: [],
canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
enter: {
autolink: opener(link2),
autolinkProtocol: onenterdata,
autolinkEmail: onenterdata,
atxHeading: opener(heading2),
blockQuote: opener(blockQuote2),
characterEscape: onenterdata,
characterReference: onenterdata,
codeFenced: opener(codeFlow),
codeFencedFenceInfo: buffer2,
codeFencedFenceMeta: buffer2,
codeIndented: opener(codeFlow, buffer2),
codeText: opener(codeText2, buffer2),
codeTextData: onenterdata,
data: onenterdata,
codeFlowValue: onenterdata,
definition: opener(definition2),
definitionDestinationString: buffer2,
definitionLabelString: buffer2,
definitionTitleString: buffer2,
emphasis: opener(emphasis2),
hardBreakEscape: opener(hardBreak2),
hardBreakTrailing: opener(hardBreak2),
htmlFlow: opener(html4, buffer2),
htmlFlowData: onenterdata,
htmlText: opener(html4, buffer2),
htmlTextData: onenterdata,
image: opener(image2),
label: buffer2,
link: opener(link2),
listItem: opener(listItem2),
listItemValue: onenterlistitemvalue,
listOrdered: opener(list3, onenterlistordered),
listUnordered: opener(list3),
paragraph: opener(paragraph2),
reference: onenterreference,
referenceString: buffer2,
resourceDestinationString: buffer2,
resourceTitleString: buffer2,
setextHeading: opener(heading2),
strong: opener(strong2),
thematicBreak: opener(thematicBreak3)
},
exit: {
atxHeading: closer(),
atxHeadingSequence: onexitatxheadingsequence,
autolink: closer(),
autolinkEmail: onexitautolinkemail,
autolinkProtocol: onexitautolinkprotocol,
blockQuote: closer(),
characterEscapeValue: onexitdata,
characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
characterReferenceValue: onexitcharacterreferencevalue,
codeFenced: closer(onexitcodefenced),
codeFencedFence: onexitcodefencedfence,
codeFencedFenceInfo: onexitcodefencedfenceinfo,
codeFencedFenceMeta: onexitcodefencedfencemeta,
codeFlowValue: onexitdata,
codeIndented: closer(onexitcodeindented),
codeText: closer(onexitcodetext),
codeTextData: onexitdata,
data: onexitdata,
definition: closer(),
definitionDestinationString: onexitdefinitiondestinationstring,
definitionLabelString: onexitdefinitionlabelstring,
definitionTitleString: onexitdefinitiontitlestring,
emphasis: closer(),
hardBreakEscape: closer(onexithardbreak),
hardBreakTrailing: closer(onexithardbreak),
htmlFlow: closer(onexithtmlflow),
htmlFlowData: onexitdata,
htmlText: closer(onexithtmltext),
htmlTextData: onexitdata,
image: closer(onexitimage),
label: onexitlabel,
labelText: onexitlabeltext,
lineEnding: onexitlineending,
link: closer(onexitlink),
listItem: closer(),
listOrdered: closer(),
listUnordered: closer(),
paragraph: closer(),
referenceString: onexitreferencestring,
resourceDestinationString: onexitresourcedestinationstring,
resourceTitleString: onexitresourcetitlestring,
resource: onexitresource,
setextHeading: closer(onexitsetextheading),
setextHeadingLineSequence: onexitsetextheadinglinesequence,
setextHeadingText: onexitsetextheadingtext,
strong: closer(),
thematicBreak: closer()
}
};
configure(config, (options || {}).mdastExtensions || []);
const data = {};
return compile;
function compile(events) {
let tree = {
type: "root",
children: []
};
const context = {
stack: [tree],
tokenStack: [],
config,
enter,
exit: exit2,
buffer: buffer2,
resume,
setData,
getData
};
const listStack = [];
let index2 = -1;
while (++index2 < events.length) {
if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") {
if (events[index2][0] === "enter") {
listStack.push(index2);
} else {
const tail = listStack.pop();
index2 = prepareList(events, tail, index2);
}
}
}
index2 = -1;
while (++index2 < events.length) {
const handler = config[events[index2][0]];
if (own2.call(handler, events[index2][1].type)) {
handler[events[index2][1].type].call(
Object.assign(
{
sliceSerialize: events[index2][2].sliceSerialize
},
context
),
events[index2][1]
);
}
}
if (context.tokenStack.length > 0) {
const tail = context.tokenStack[context.tokenStack.length - 1];
const handler = tail[1] || defaultOnError;
handler.call(context, void 0, tail[0]);
}
tree.position = {
start: point2(
events.length > 0 ? events[0][1].start : {
line: 1,
column: 1,
offset: 0
}
),
end: point2(
events.length > 0 ? events[events.length - 2][1].end : {
line: 1,
column: 1,
offset: 0
}
)
};
index2 = -1;
while (++index2 < config.transforms.length) {
tree = config.transforms[index2](tree) || tree;
}
return tree;
}
function prepareList(events, start, length) {
let index2 = start - 1;
let containerBalance = -1;
let listSpread = false;
let listItem3;
let lineIndex;
let firstBlankLineIndex;
let atMarker;
while (++index2 <= length) {
const event = events[index2];
if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") {
if (event[0] === "enter") {
containerBalance++;
} else {
containerBalance--;
}
atMarker = void 0;
} else if (event[1].type === "lineEndingBlank") {
if (event[0] === "enter") {
if (listItem3 && !atMarker && !containerBalance && !firstBlankLineIndex) {
firstBlankLineIndex = index2;
}
atMarker = void 0;
}
} else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") {
} else {
atMarker = void 0;
}
if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) {
if (listItem3) {
let tailIndex = index2;
lineIndex = void 0;
while (tailIndex--) {
const tailEvent = events[tailIndex];
if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") {
if (tailEvent[0] === "exit")
continue;
if (lineIndex) {
events[lineIndex][1].type = "lineEndingBlank";
listSpread = true;
}
tailEvent[1].type = "lineEnding";
lineIndex = tailIndex;
} else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") {
} else {
break;
}
}
if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
listItem3._spread = true;
}
listItem3.end = Object.assign(
{},
lineIndex ? events[lineIndex][1].start : event[1].end
);
events.splice(lineIndex || index2, 0, ["exit", listItem3, event[2]]);
index2++;
length++;
}
if (event[1].type === "listItemPrefix") {
listItem3 = {
type: "listItem",
_spread: false,
start: Object.assign({}, event[1].start),
// @ts-expect-error: we’ll add `end` in a second.
end: void 0
};
events.splice(index2, 0, ["enter", listItem3, event[2]]);
index2++;
length++;
firstBlankLineIndex = void 0;
atMarker = true;
}
}
}
events[start][1]._spread = listSpread;
return length;
}
function setData(key, value) {
data[key] = value;
}
function getData(key) {
return data[key];
}
function opener(create2, and) {
return open;
function open(token) {
enter.call(this, create2(token), token);
if (and)
and.call(this, token);
}
}
function buffer2() {
this.stack.push({
type: "fragment",
children: []
});
}
function enter(node2, token, errorHandler) {
const parent = this.stack[this.stack.length - 1];
parent.children.push(node2);
this.stack.push(node2);
this.tokenStack.push([token, errorHandler]);
node2.position = {
start: point2(token.start)
};
return node2;
}
function closer(and) {
return close;
function close(token) {
if (and)
and.call(this, token);
exit2.call(this, token);
}
}
function exit2(token, onExitError) {
const node2 = this.stack.pop();
const open = this.tokenStack.pop();
if (!open) {
throw new Error(
"Cannot close `" + token.type + "` (" + stringifyPosition({
start: token.start,
end: token.end
}) + "): it\u2019s not open"
);
} else if (open[0].type !== token.type) {
if (onExitError) {
onExitError.call(this, token, open[0]);
} else {
const handler = open[1] || defaultOnError;
handler.call(this, token, open[0]);
}
}
node2.position.end = point2(token.end);
return node2;
}
function resume() {
return toString(this.stack.pop());
}
function onenterlistordered() {
setData("expectingFirstListItemValue", true);
}
function onenterlistitemvalue(token) {
if (getData("expectingFirstListItemValue")) {
const ancestor = this.stack[this.stack.length - 2];
ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);
setData("expectingFirstListItemValue");
}
}
function onexitcodefencedfenceinfo() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.lang = data2;
}
function onexitcodefencedfencemeta() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.meta = data2;
}
function onexitcodefencedfence() {
if (getData("flowCodeInside"))
return;
this.buffer();
setData("flowCodeInside", true);
}
function onexitcodefenced() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.value = data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, "");
setData("flowCodeInside");
}
function onexitcodeindented() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.value = data2.replace(/(\r?\n|\r)$/g, "");
}
function onexitdefinitionlabelstring(token) {
const label = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.label = label;
node2.identifier = normalizeIdentifier(
this.sliceSerialize(token)
).toLowerCase();
}
function onexitdefinitiontitlestring() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.title = data2;
}
function onexitdefinitiondestinationstring() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.url = data2;
}
function onexitatxheadingsequence(token) {
const node2 = this.stack[this.stack.length - 1];
if (!node2.depth) {
const depth = this.sliceSerialize(token).length;
node2.depth = depth;
}
}
function onexitsetextheadingtext() {
setData("setextHeadingSlurpLineEnding", true);
}
function onexitsetextheadinglinesequence(token) {
const node2 = this.stack[this.stack.length - 1];
node2.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2;
}
function onexitsetextheading() {
setData("setextHeadingSlurpLineEnding");
}
function onenterdata(token) {
const node2 = this.stack[this.stack.length - 1];
let tail = node2.children[node2.children.length - 1];
if (!tail || tail.type !== "text") {
tail = text4();
tail.position = {
start: point2(token.start)
};
node2.children.push(tail);
}
this.stack.push(tail);
}
function onexitdata(token) {
const tail = this.stack.pop();
tail.value += this.sliceSerialize(token);
tail.position.end = point2(token.end);
}
function onexitlineending(token) {
const context = this.stack[this.stack.length - 1];
if (getData("atHardBreak")) {
const tail = context.children[context.children.length - 1];
tail.position.end = point2(token.end);
setData("atHardBreak");
return;
}
if (!getData("setextHeadingSlurpLineEnding") && config.canContainEols.includes(context.type)) {
onenterdata.call(this, token);
onexitdata.call(this, token);
}
}
function onexithardbreak() {
setData("atHardBreak", true);
}
function onexithtmlflow() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.value = data2;
}
function onexithtmltext() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.value = data2;
}
function onexitcodetext() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.value = data2;
}
function onexitlink() {
const node2 = this.stack[this.stack.length - 1];
if (getData("inReference")) {
const referenceType = getData("referenceType") || "shortcut";
node2.type += "Reference";
node2.referenceType = referenceType;
delete node2.url;
delete node2.title;
} else {
delete node2.identifier;
delete node2.label;
}
setData("referenceType");
}
function onexitimage() {
const node2 = this.stack[this.stack.length - 1];
if (getData("inReference")) {
const referenceType = getData("referenceType") || "shortcut";
node2.type += "Reference";
node2.referenceType = referenceType;
delete node2.url;
delete node2.title;
} else {
delete node2.identifier;
delete node2.label;
}
setData("referenceType");
}
function onexitlabeltext(token) {
const string3 = this.sliceSerialize(token);
const ancestor = this.stack[this.stack.length - 2];
ancestor.label = decodeString(string3);
ancestor.identifier = normalizeIdentifier(string3).toLowerCase();
}
function onexitlabel() {
const fragment = this.stack[this.stack.length - 1];
const value = this.resume();
const node2 = this.stack[this.stack.length - 1];
setData("inReference", true);
if (node2.type === "link") {
const children = fragment.children;
node2.children = children;
} else {
node2.alt = value;
}
}
function onexitresourcedestinationstring() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.url = data2;
}
function onexitresourcetitlestring() {
const data2 = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.title = data2;
}
function onexitresource() {
setData("inReference");
}
function onenterreference() {
setData("referenceType", "collapsed");
}
function onexitreferencestring(token) {
const label = this.resume();
const node2 = this.stack[this.stack.length - 1];
node2.label = label;
node2.identifier = normalizeIdentifier(
this.sliceSerialize(token)
).toLowerCase();
setData("referenceType", "full");
}
function onexitcharacterreferencemarker(token) {
setData("characterReferenceType", token.type);
}
function onexitcharacterreferencevalue(token) {
const data2 = this.sliceSerialize(token);
const type = getData("characterReferenceType");
let value;
if (type) {
value = decodeNumericCharacterReference(
data2,
type === "characterReferenceMarkerNumeric" ? 10 : 16
);
setData("characterReferenceType");
} else {
const result = decodeNamedCharacterReference(data2);
value = result;
}
const tail = this.stack.pop();
tail.value += value;
tail.position.end = point2(token.end);
}
function onexitautolinkprotocol(token) {
onexitdata.call(this, token);
const node2 = this.stack[this.stack.length - 1];
node2.url = this.sliceSerialize(token);
}
function onexitautolinkemail(token) {
onexitdata.call(this, token);
const node2 = this.stack[this.stack.length - 1];
node2.url = "mailto:" + this.sliceSerialize(token);
}
function blockQuote2() {
return {
type: "blockquote",
children: []
};
}
function codeFlow() {
return {
type: "code",
lang: null,
meta: null,
value: ""
};
}
function codeText2() {
return {
type: "inlineCode",
value: ""
};
}
function definition2() {
return {
type: "definition",
identifier: "",
label: null,
title: null,
url: ""
};
}
function emphasis2() {
return {
type: "emphasis",
children: []
};
}
function heading2() {
return {
type: "heading",
depth: void 0,
children: []
};
}
function hardBreak2() {
return {
type: "break"
};
}
function html4() {
return {
type: "html",
value: ""
};
}
function image2() {
return {
type: "image",
title: null,
url: "",
alt: null
};
}
function link2() {
return {
type: "link",
title: null,
url: "",
children: []
};
}
function list3(token) {
return {
type: "list",
ordered: token.type === "listOrdered",
start: null,
spread: token._spread,
children: []
};
}
function listItem2(token) {
return {
type: "listItem",
spread: token._spread,
checked: null,
children: []
};
}
function paragraph2() {
return {
type: "paragraph",
children: []
};
}
function strong2() {
return {
type: "strong",
children: []
};
}
function text4() {
return {
type: "text",
value: ""
};
}
function thematicBreak3() {
return {
type: "thematicBreak"
};
}
}
function point2(d) {
return {
line: d.line,
column: d.column,
offset: d.offset
};
}
function configure(combined, extensions) {
let index2 = -1;
while (++index2 < extensions.length) {
const value = extensions[index2];
if (Array.isArray(value)) {
configure(combined, value);
} else {
extension(combined, value);
}
}
}
function extension(combined, extension2) {
let key;
for (key in extension2) {
if (own2.call(extension2, key)) {
if (key === "canContainEols") {
const right = extension2[key];
if (right) {
combined[key].push(...right);
}
} else if (key === "transforms") {
const right = extension2[key];
if (right) {
combined[key].push(...right);
}
} else if (key === "enter" || key === "exit") {
const right = extension2[key];
if (right) {
Object.assign(combined[key], right);
}
}
}
}
}
function defaultOnError(left, right) {
if (left) {
throw new Error(
"Cannot close `" + left.type + "` (" + stringifyPosition({
start: left.start,
end: left.end
}) + "): a different token (`" + right.type + "`, " + stringifyPosition({
start: right.start,
end: right.end
}) + ") is open"
);
} else {
throw new Error(
"Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
start: right.start,
end: right.end
}) + ") is still open"
);
}
}
// node_modules/.pnpm/[email protected]/node_modules/remark-parse/lib/index.js
function remarkParse(options) {
const parser = (doc) => {
const settings = (
/** @type {Options} */
this.data("settings")
);
return fromMarkdown(
doc,
Object.assign({}, settings, options, {
// Note: these options are not in the readme.
// The goal is for them to be set by plugins on `data` instead of being
// passed by users.
extensions: this.data("micromarkExtensions") || [],
mdastExtensions: this.data("fromMarkdownExtensions") || []
})
);
};
Object.assign(this, { Parser: parser });
}
// node_modules/.pnpm/[email protected]/node_modules/remark-parse/index.js
var remark_parse_default = remarkParse;
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
function blockquote(state, node2) {
const result = {
type: "element",
tagName: "blockquote",
properties: {},
children: state.wrap(state.all(node2), true)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/break.js
function hardBreak(state, node2) {
const result = { type: "element", tagName: "br", properties: {}, children: [] };
state.patch(node2, result);
return [state.applyData(node2, result), { type: "text", value: "\n" }];
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/code.js
function code(state, node2) {
const value = node2.value ? node2.value + "\n" : "";
const lang = node2.lang ? node2.lang.match(/^[^ \t]+(?=[ \t]|$)/) : null;
const properties = {};
if (lang) {
properties.className = ["language-" + lang];
}
let result = {
type: "element",
tagName: "code",
properties,
children: [{ type: "text", value }]
};
if (node2.meta) {
result.data = { meta: node2.meta };
}
state.patch(node2, result);
result = state.applyData(node2, result);
result = { type: "element", tagName: "pre", properties: {}, children: [result] };
state.patch(node2, result);
return result;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/delete.js
function strikethrough(state, node2) {
const result = {
type: "element",
tagName: "del",
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
function emphasis(state, node2) {
const result = {
type: "element",
tagName: "em",
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/micromark-util-sanitize-uri/index.js
function normalizeUri(value) {
const result = [];
let index2 = -1;
let start = 0;
let skip = 0;
while (++index2 < value.length) {
const code2 = value.charCodeAt(index2);
let replace = "";
if (code2 === 37 && asciiAlphanumeric(value.charCodeAt(index2 + 1)) && asciiAlphanumeric(value.charCodeAt(index2 + 2))) {
skip = 2;
} else if (code2 < 128) {
if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) {
replace = String.fromCharCode(code2);
}
} else if (code2 > 55295 && code2 < 57344) {
const next = value.charCodeAt(index2 + 1);
if (code2 < 56320 && next > 56319 && next < 57344) {
replace = String.fromCharCode(code2, next);
skip = 1;
} else {
replace = "\uFFFD";
}
} else {
replace = String.fromCharCode(code2);
}
if (replace) {
result.push(value.slice(start, index2), encodeURIComponent(replace));
start = index2 + skip + 1;
replace = "";
}
if (skip) {
index2 += skip;
skip = 0;
}
}
return result.join("") + value.slice(start);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
function footnoteReference(state, node2) {
const id = String(node2.identifier).toUpperCase();
const safeId = normalizeUri(id.toLowerCase());
const index2 = state.footnoteOrder.indexOf(id);
let counter;
if (index2 === -1) {
state.footnoteOrder.push(id);
state.footnoteCounts[id] = 1;
counter = state.footnoteOrder.length;
} else {
state.footnoteCounts[id]++;
counter = index2 + 1;
}
const reuseCounter = state.footnoteCounts[id];
const link2 = {
type: "element",
tagName: "a",
properties: {
href: "#" + state.clobberPrefix + "fn-" + safeId,
id: state.clobberPrefix + "fnref-" + safeId + (reuseCounter > 1 ? "-" + reuseCounter : ""),
dataFootnoteRef: true,
ariaDescribedBy: ["footnote-label"]
},
children: [{ type: "text", value: String(counter) }]
};
state.patch(node2, link2);
const sup = {
type: "element",
tagName: "sup",
properties: {},
children: [link2]
};
state.patch(node2, sup);
return state.applyData(node2, sup);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/footnote.js
function footnote(state, node2) {
const footnoteById = state.footnoteById;
let no = 1;
while (no in footnoteById)
no++;
const identifier = String(no);
footnoteById[identifier] = {
type: "footnoteDefinition",
identifier,
children: [{ type: "paragraph", children: node2.children }],
position: node2.position
};
return footnoteReference(state, {
type: "footnoteReference",
identifier,
position: node2.position
});
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/heading.js
function heading(state, node2) {
const result = {
type: "element",
tagName: "h" + node2.depth,
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/html.js
function html(state, node2) {
if (state.dangerous) {
const result = { type: "raw", value: node2.value };
state.patch(node2, result);
return state.applyData(node2, result);
}
return null;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/revert.js
function revert(state, node2) {
const subtype = node2.referenceType;
let suffix = "]";
if (subtype === "collapsed") {
suffix += "[]";
} else if (subtype === "full") {
suffix += "[" + (node2.label || node2.identifier) + "]";
}
if (node2.type === "imageReference") {
return { type: "text", value: "![" + node2.alt + suffix };
}
const contents = state.all(node2);
const head = contents[0];
if (head && head.type === "text") {
head.value = "[" + head.value;
} else {
contents.unshift({ type: "text", value: "[" });
}
const tail = contents[contents.length - 1];
if (tail && tail.type === "text") {
tail.value += suffix;
} else {
contents.push({ type: "text", value: suffix });
}
return contents;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
function imageReference(state, node2) {
const def = state.definition(node2.identifier);
if (!def) {
return revert(state, node2);
}
const properties = { src: normalizeUri(def.url || ""), alt: node2.alt };
if (def.title !== null && def.title !== void 0) {
properties.title = def.title;
}
const result = { type: "element", tagName: "img", properties, children: [] };
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/image.js
function image(state, node2) {
const properties = { src: normalizeUri(node2.url) };
if (node2.alt !== null && node2.alt !== void 0) {
properties.alt = node2.alt;
}
if (node2.title !== null && node2.title !== void 0) {
properties.title = node2.title;
}
const result = { type: "element", tagName: "img", properties, children: [] };
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
function inlineCode(state, node2) {
const text4 = { type: "text", value: node2.value.replace(/\r?\n|\r/g, " ") };
state.patch(node2, text4);
const result = {
type: "element",
tagName: "code",
properties: {},
children: [text4]
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
function linkReference(state, node2) {
const def = state.definition(node2.identifier);
if (!def) {
return revert(state, node2);
}
const properties = { href: normalizeUri(def.url || "") };
if (def.title !== null && def.title !== void 0) {
properties.title = def.title;
}
const result = {
type: "element",
tagName: "a",
properties,
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/link.js
function link(state, node2) {
const properties = { href: normalizeUri(node2.url) };
if (node2.title !== null && node2.title !== void 0) {
properties.title = node2.title;
}
const result = {
type: "element",
tagName: "a",
properties,
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/list-item.js
function listItem(state, node2, parent) {
const results = state.all(node2);
const loose = parent ? listLoose(parent) : listItemLoose(node2);
const properties = {};
const children = [];
if (typeof node2.checked === "boolean") {
const head = results[0];
let paragraph2;
if (head && head.type === "element" && head.tagName === "p") {
paragraph2 = head;
} else {
paragraph2 = { type: "element", tagName: "p", properties: {}, children: [] };
results.unshift(paragraph2);
}
if (paragraph2.children.length > 0) {
paragraph2.children.unshift({ type: "text", value: " " });
}
paragraph2.children.unshift({
type: "element",
tagName: "input",
properties: { type: "checkbox", checked: node2.checked, disabled: true },
children: []
});
properties.className = ["task-list-item"];
}
let index2 = -1;
while (++index2 < results.length) {
const child = results[index2];
if (loose || index2 !== 0 || child.type !== "element" || child.tagName !== "p") {
children.push({ type: "text", value: "\n" });
}
if (child.type === "element" && child.tagName === "p" && !loose) {
children.push(...child.children);
} else {
children.push(child);
}
}
const tail = results[results.length - 1];
if (tail && (loose || tail.type !== "element" || tail.tagName !== "p")) {
children.push({ type: "text", value: "\n" });
}
const result = { type: "element", tagName: "li", properties, children };
state.patch(node2, result);
return state.applyData(node2, result);
}
function listLoose(node2) {
let loose = false;
if (node2.type === "list") {
loose = node2.spread || false;
const children = node2.children;
let index2 = -1;
while (!loose && ++index2 < children.length) {
loose = listItemLoose(children[index2]);
}
}
return loose;
}
function listItemLoose(node2) {
const spread = node2.spread;
return spread === void 0 || spread === null ? node2.children.length > 1 : spread;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/list.js
function list2(state, node2) {
const properties = {};
const results = state.all(node2);
let index2 = -1;
if (typeof node2.start === "number" && node2.start !== 1) {
properties.start = node2.start;
}
while (++index2 < results.length) {
const child = results[index2];
if (child.type === "element" && child.tagName === "li" && child.properties && Array.isArray(child.properties.className) && child.properties.className.includes("task-list-item")) {
properties.className = ["contains-task-list"];
break;
}
}
const result = {
type: "element",
tagName: node2.ordered ? "ol" : "ul",
properties,
children: state.wrap(results, true)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
function paragraph(state, node2) {
const result = {
type: "element",
tagName: "p",
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/root.js
function root(state, node2) {
const result = { type: "root", children: state.wrap(state.all(node2)) };
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/strong.js
function strong(state, node2) {
const result = {
type: "element",
tagName: "strong",
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-position/lib/index.js
var pointStart = point3("start");
var pointEnd = point3("end");
function position2(node2) {
return { start: pointStart(node2), end: pointEnd(node2) };
}
function point3(type) {
return point4;
function point4(node2) {
const point5 = node2 && node2.position && node2.position[type] || {};
return {
// @ts-expect-error: in practice, null is allowed.
line: point5.line || null,
// @ts-expect-error: in practice, null is allowed.
column: point5.column || null,
// @ts-expect-error: in practice, null is allowed.
offset: point5.offset > -1 ? point5.offset : null
};
}
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/table.js
function table(state, node2) {
const rows = state.all(node2);
const firstRow = rows.shift();
const tableContent = [];
if (firstRow) {
const head = {
type: "element",
tagName: "thead",
properties: {},
children: state.wrap([firstRow], true)
};
state.patch(node2.children[0], head);
tableContent.push(head);
}
if (rows.length > 0) {
const body = {
type: "element",
tagName: "tbody",
properties: {},
children: state.wrap(rows, true)
};
const start = pointStart(node2.children[1]);
const end = pointEnd(node2.children[node2.children.length - 1]);
if (start.line && end.line)
body.position = { start, end };
tableContent.push(body);
}
const result = {
type: "element",
tagName: "table",
properties: {},
children: state.wrap(tableContent, true)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/table-row.js
function tableRow(state, node2, parent) {
const siblings = parent ? parent.children : void 0;
const rowIndex = siblings ? siblings.indexOf(node2) : 1;
const tagName = rowIndex === 0 ? "th" : "td";
const align = parent && parent.type === "table" ? parent.align : void 0;
const length = align ? align.length : node2.children.length;
let cellIndex = -1;
const cells = [];
while (++cellIndex < length) {
const cell = node2.children[cellIndex];
const properties = {};
const alignValue = align ? align[cellIndex] : void 0;
if (alignValue) {
properties.align = alignValue;
}
let result2 = { type: "element", tagName, properties, children: [] };
if (cell) {
result2.children = state.all(cell);
state.patch(cell, result2);
result2 = state.applyData(node2, result2);
}
cells.push(result2);
}
const result = {
type: "element",
tagName: "tr",
properties: {},
children: state.wrap(cells, true)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
function tableCell(state, node2) {
const result = {
type: "element",
tagName: "td",
// Assume body cell.
properties: {},
children: state.all(node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/trim-lines/index.js
var tab = 9;
var space = 32;
function trimLines(value) {
const source = String(value);
const search2 = /\r?\n|\r/g;
let match = search2.exec(source);
let last = 0;
const lines = [];
while (match) {
lines.push(
trimLine(source.slice(last, match.index), last > 0, true),
match[0]
);
last = match.index + match[0].length;
match = search2.exec(source);
}
lines.push(trimLine(source.slice(last), last > 0, false));
return lines.join("");
}
function trimLine(value, start, end) {
let startIndex = 0;
let endIndex = value.length;
if (start) {
let code2 = value.codePointAt(startIndex);
while (code2 === tab || code2 === space) {
startIndex++;
code2 = value.codePointAt(startIndex);
}
}
if (end) {
let code2 = value.codePointAt(endIndex - 1);
while (code2 === tab || code2 === space) {
endIndex--;
code2 = value.codePointAt(endIndex - 1);
}
}
return endIndex > startIndex ? value.slice(startIndex, endIndex) : "";
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/text.js
function text3(state, node2) {
const result = { type: "text", value: trimLines(String(node2.value)) };
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
function thematicBreak2(state, node2) {
const result = {
type: "element",
tagName: "hr",
properties: {},
children: []
};
state.patch(node2, result);
return state.applyData(node2, result);
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/handlers/index.js
var handlers = {
blockquote,
break: hardBreak,
code,
delete: strikethrough,
emphasis,
footnoteReference,
footnote,
heading,
html,
imageReference,
image,
inlineCode,
linkReference,
link,
listItem,
list: list2,
paragraph,
root,
strong,
table,
tableCell,
tableRow,
text: text3,
thematicBreak: thematicBreak2,
toml: ignore,
yaml: ignore,
definition: ignore,
footnoteDefinition: ignore
};
function ignore() {
return null;
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-is/lib/index.js
var convert = (
/**
* @type {(
* (<Kind extends Node>(test: PredicateTest<Kind>) => AssertPredicate<Kind>) &
* ((test?: Test) => AssertAnything)
* )}
*/
/**
* @param {Test} [test]
* @returns {AssertAnything}
*/
function(test) {
if (test === void 0 || test === null) {
return ok;
}
if (typeof test === "string") {
return typeFactory(test);
}
if (typeof test === "object") {
return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
}
if (typeof test === "function") {
return castFactory(test);
}
throw new Error("Expected function, string, or object as test");
}
);
function anyFactory(tests) {
const checks2 = [];
let index2 = -1;
while (++index2 < tests.length) {
checks2[index2] = convert(tests[index2]);
}
return castFactory(any);
function any(...parameters) {
let index3 = -1;
while (++index3 < checks2.length) {
if (checks2[index3].call(this, ...parameters))
return true;
}
return false;
}
}
function propsFactory(check) {
return castFactory(all3);
function all3(node2) {
let key;
for (key in check) {
if (node2[key] !== check[key])
return false;
}
return true;
}
}
function typeFactory(check) {
return castFactory(type);
function type(node2) {
return node2 && node2.type === check;
}
}
function castFactory(check) {
return assertion;
function assertion(node2, ...parameters) {
return Boolean(
node2 && typeof node2 === "object" && "type" in node2 && // @ts-expect-error: fine.
Boolean(check.call(this, node2, ...parameters))
);
}
}
function ok() {
return true;
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/color.browser.js
function color(d) {
return d;
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js
var CONTINUE = true;
var EXIT = false;
var SKIP = "skip";
var visitParents = (
/**
* @type {(
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) &
* (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void)
* )}
*/
/**
* @param {Node} tree
* @param {Test} test
* @param {Visitor<Node>} visitor
* @param {boolean | null | undefined} [reverse]
* @returns {void}
*/
function(tree, test, visitor, reverse) {
if (typeof test === "function" && typeof visitor !== "function") {
reverse = visitor;
visitor = test;
test = null;
}
const is2 = convert(test);
const step = reverse ? -1 : 1;
factory(tree, void 0, [])();
function factory(node2, index2, parents) {
const value = node2 && typeof node2 === "object" ? node2 : {};
if (typeof value.type === "string") {
const name = (
// `hast`
typeof value.tagName === "string" ? value.tagName : (
// `xast`
typeof value.name === "string" ? value.name : void 0
)
);
Object.defineProperty(visit2, "name", {
value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
});
}
return visit2;
function visit2() {
let result = [];
let subresult;
let offset;
let grandparents;
if (!test || is2(node2, index2, parents[parents.length - 1] || null)) {
result = toResult(visitor(node2, parents));
if (result[0] === EXIT) {
return result;
}
}
if (node2.children && result[0] !== SKIP) {
offset = (reverse ? node2.children.length : -1) + step;
grandparents = parents.concat(node2);
while (offset > -1 && offset < node2.children.length) {
subresult = factory(node2.children[offset], offset, grandparents)();
if (subresult[0] === EXIT) {
return subresult;
}
offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
}
}
return result;
}
}
}
);
function toResult(value) {
if (Array.isArray(value)) {
return value;
}
if (typeof value === "number") {
return [CONTINUE, value];
}
return [value];
}
// node_modules/.pnpm/[email protected]/node_modules/unist-util-visit/index.js
var visit = (
/**
* @type {(
* (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: Visitor<import('unist-util-visit-parents/complex-types').Matches<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>, Check>>, reverse?: boolean) => void) &
* (<Tree extends Node>(tree: Tree, visitor: Visitor<import('unist-util-visit-parents/complex-types').InclusiveDescendant<Tree>>, reverse?: boolean) => void)
* )}
*/
/**
* @param {Node} tree
* @param {Test} test
* @param {Visitor<Node>} visitor
* @param {boolean} [reverse]
*/
function(tree, test, visitor, reverse) {
if (typeof test === "function" && typeof visitor !== "function") {
reverse = visitor;
visitor = test;
test = null;
}
visitParents(tree, test, overload, reverse);
function overload(node2, parents) {
const parent = parents[parents.length - 1];
return visitor(
node2,
parent ? parent.children.indexOf(node2) : null,
parent
);
}
}
);
// node_modules/.pnpm/[email protected]/node_modules/unist-util-generated/lib/index.js
function generated(node2) {
return !node2 || !node2.position || !node2.position.start || !node2.position.start.line || !node2.position.start.column || !node2.position.end || !node2.position.end.line || !node2.position.end.column;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-definitions/lib/index.js
var own3 = {}.hasOwnProperty;
function definitions(tree) {
const cache = /* @__PURE__ */ Object.create(null);
if (!tree || !tree.type) {
throw new Error("mdast-util-definitions expected node");
}
visit(tree, "definition", (definition3) => {
const id = clean(definition3.identifier);
if (id && !own3.call(cache, id)) {
cache[id] = definition3;
}
});
return definition2;
function definition2(identifier) {
const id = clean(identifier);
return id && own3.call(cache, id) ? cache[id] : null;
}
}
function clean(value) {
return String(value || "").toUpperCase();
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/state.js
var own4 = {}.hasOwnProperty;
function createState(tree, options) {
const settings = options || {};
const dangerous = settings.allowDangerousHtml || false;
const footnoteById = {};
state.dangerous = dangerous;
state.clobberPrefix = settings.clobberPrefix === void 0 || settings.clobberPrefix === null ? "user-content-" : settings.clobberPrefix;
state.footnoteLabel = settings.footnoteLabel || "Footnotes";
state.footnoteLabelTagName = settings.footnoteLabelTagName || "h2";
state.footnoteLabelProperties = settings.footnoteLabelProperties || {
className: ["sr-only"]
};
state.footnoteBackLabel = settings.footnoteBackLabel || "Back to content";
state.unknownHandler = settings.unknownHandler;
state.passThrough = settings.passThrough;
state.handlers = __spreadValues(__spreadValues({}, handlers), settings.handlers);
state.definition = definitions(tree);
state.footnoteById = footnoteById;
state.footnoteOrder = [];
state.footnoteCounts = {};
state.patch = patch;
state.applyData = applyData;
state.one = oneBound;
state.all = allBound;
state.wrap = wrap2;
state.augment = augment;
visit(tree, "footnoteDefinition", (definition2) => {
const id = String(definition2.identifier).toUpperCase();
if (!own4.call(footnoteById, id)) {
footnoteById[id] = definition2;
}
});
return state;
function augment(left, right) {
if (left && "data" in left && left.data) {
const data = left.data;
if (data.hName) {
if (right.type !== "element") {
right = {
type: "element",
tagName: "",
properties: {},
children: []
};
}
right.tagName = data.hName;
}
if (right.type === "element" && data.hProperties) {
right.properties = __spreadValues(__spreadValues({}, right.properties), data.hProperties);
}
if ("children" in right && right.children && data.hChildren) {
right.children = data.hChildren;
}
}
if (left) {
const ctx = "type" in left ? left : { position: left };
if (!generated(ctx)) {
right.position = { start: pointStart(ctx), end: pointEnd(ctx) };
}
}
return right;
}
function state(node2, tagName, props, children) {
if (Array.isArray(props)) {
children = props;
props = {};
}
return augment(node2, {
type: "element",
tagName,
properties: props || {},
children: children || []
});
}
function oneBound(node2, parent) {
return one2(state, node2, parent);
}
function allBound(parent) {
return all2(state, parent);
}
}
function patch(from, to) {
if (from.position)
to.position = position2(from);
}
function applyData(from, to) {
let result = to;
if (from && from.data) {
const hName = from.data.hName;
const hChildren = from.data.hChildren;
const hProperties = from.data.hProperties;
if (typeof hName === "string") {
if (result.type === "element") {
result.tagName = hName;
} else {
result = {
type: "element",
tagName: hName,
properties: {},
children: []
};
}
}
if (result.type === "element" && hProperties) {
result.properties = __spreadValues(__spreadValues({}, result.properties), hProperties);
}
if ("children" in result && result.children && hChildren !== null && hChildren !== void 0) {
result.children = hChildren;
}
}
return result;
}
function one2(state, node2, parent) {
const type = node2 && node2.type;
if (!type) {
throw new Error("Expected node, got `" + node2 + "`");
}
if (own4.call(state.handlers, type)) {
return state.handlers[type](state, node2, parent);
}
if (state.passThrough && state.passThrough.includes(type)) {
return "children" in node2 ? __spreadProps(__spreadValues({}, node2), { children: all2(state, node2) }) : node2;
}
if (state.unknownHandler) {
return state.unknownHandler(state, node2, parent);
}
return defaultUnknownHandler(state, node2);
}
function all2(state, parent) {
const values = [];
if ("children" in parent) {
const nodes = parent.children;
let index2 = -1;
while (++index2 < nodes.length) {
const result = one2(state, nodes[index2], parent);
if (result) {
if (index2 && nodes[index2 - 1].type === "break") {
if (!Array.isArray(result) && result.type === "text") {
result.value = result.value.replace(/^\s+/, "");
}
if (!Array.isArray(result) && result.type === "element") {
const head = result.children[0];
if (head && head.type === "text") {
head.value = head.value.replace(/^\s+/, "");
}
}
}
if (Array.isArray(result)) {
values.push(...result);
} else {
values.push(result);
}
}
}
}
return values;
}
function defaultUnknownHandler(state, node2) {
const data = node2.data || {};
const result = "value" in node2 && !(own4.call(data, "hProperties") || own4.call(data, "hChildren")) ? { type: "text", value: node2.value } : {
type: "element",
tagName: "div",
properties: {},
children: all2(state, node2)
};
state.patch(node2, result);
return state.applyData(node2, result);
}
function wrap2(nodes, loose) {
const result = [];
let index2 = -1;
if (loose) {
result.push({ type: "text", value: "\n" });
}
while (++index2 < nodes.length) {
if (index2)
result.push({ type: "text", value: "\n" });
result.push(nodes[index2]);
}
if (loose && nodes.length > 0) {
result.push({ type: "text", value: "\n" });
}
return result;
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/footer.js
function footer(state) {
const listItems = [];
let index2 = -1;
while (++index2 < state.footnoteOrder.length) {
const def = state.footnoteById[state.footnoteOrder[index2]];
if (!def) {
continue;
}
const content3 = state.all(def);
const id = String(def.identifier).toUpperCase();
const safeId = normalizeUri(id.toLowerCase());
let referenceIndex = 0;
const backReferences = [];
while (++referenceIndex <= state.footnoteCounts[id]) {
const backReference = {
type: "element",
tagName: "a",
properties: {
href: "#" + state.clobberPrefix + "fnref-" + safeId + (referenceIndex > 1 ? "-" + referenceIndex : ""),
dataFootnoteBackref: true,
className: ["data-footnote-backref"],
ariaLabel: state.footnoteBackLabel
},
children: [{ type: "text", value: "\u21A9" }]
};
if (referenceIndex > 1) {
backReference.children.push({
type: "element",
tagName: "sup",
children: [{ type: "text", value: String(referenceIndex) }]
});
}
if (backReferences.length > 0) {
backReferences.push({ type: "text", value: " " });
}
backReferences.push(backReference);
}
const tail = content3[content3.length - 1];
if (tail && tail.type === "element" && tail.tagName === "p") {
const tailTail = tail.children[tail.children.length - 1];
if (tailTail && tailTail.type === "text") {
tailTail.value += " ";
} else {
tail.children.push({ type: "text", value: " " });
}
tail.children.push(...backReferences);
} else {
content3.push(...backReferences);
}
const listItem2 = {
type: "element",
tagName: "li",
properties: { id: state.clobberPrefix + "fn-" + safeId },
children: state.wrap(content3, true)
};
state.patch(def, listItem2);
listItems.push(listItem2);
}
if (listItems.length === 0) {
return;
}
return {
type: "element",
tagName: "section",
properties: { dataFootnotes: true, className: ["footnotes"] },
children: [
{
type: "element",
tagName: state.footnoteLabelTagName,
properties: __spreadProps(__spreadValues({}, JSON.parse(JSON.stringify(state.footnoteLabelProperties))), {
id: "footnote-label"
}),
children: [{ type: "text", value: state.footnoteLabel }]
},
{ type: "text", value: "\n" },
{
type: "element",
tagName: "ol",
properties: {},
children: state.wrap(listItems, true)
},
{ type: "text", value: "\n" }
]
};
}
// node_modules/.pnpm/[email protected]/node_modules/mdast-util-to-hast/lib/index.js
function toHast(tree, options) {
const state = createState(tree, options);
const node2 = state.one(tree, null);
const foot = footer(state);
if (foot) {
node2.children.push({ type: "text", value: "\n" }, foot);
}
return Array.isArray(node2) ? { type: "root", children: node2 } : node2;
}
// node_modules/.pnpm/[email protected]/node_modules/remark-rehype/index.js
var remarkRehype = (
/** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */
function(destination, options) {
return destination && "run" in destination ? bridge(destination, options) : mutate(destination || options);
}
);
var remark_rehype_default = remarkRehype;
function bridge(destination, options) {
return (node2, file, next) => {
destination.run(toHast(node2, options), file, (error) => {
next(error);
});
};
}
function mutate(options) {
return (node2) => toHast(node2, options);
}
// lib/react-markdown.js
var import_prop_types = __toESM(require_prop_types(), 1);
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/schema.js
var Schema = class {
/**
* @constructor
* @param {Properties} property
* @param {Normal} normal
* @param {string} [space]
*/
constructor(property, normal, space2) {
this.property = property;
this.normal = normal;
if (space2) {
this.space = space2;
}
}
};
Schema.prototype.property = {};
Schema.prototype.normal = {};
Schema.prototype.space = null;
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/merge.js
function merge(definitions2, space2) {
var property = {};
var normal = {};
var index2 = -1;
while (++index2 < definitions2.length) {
Object.assign(property, definitions2[index2].property);
Object.assign(normal, definitions2[index2].normal);
}
return new Schema(property, normal, space2);
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/normalize.js
function normalize2(value) {
return value.toLowerCase();
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/info.js
var Info = class {
/**
* @constructor
* @param {string} property
* @param {string} attribute
*/
constructor(property, attribute) {
this.property = property;
this.attribute = attribute;
}
};
Info.prototype.space = null;
Info.prototype.attribute = null;
Info.prototype.property = null;
Info.prototype.boolean = false;
Info.prototype.booleanish = false;
Info.prototype.overloadedBoolean = false;
Info.prototype.number = false;
Info.prototype.commaSeparated = false;
Info.prototype.spaceSeparated = false;
Info.prototype.commaOrSpaceSeparated = false;
Info.prototype.mustUseProperty = false;
Info.prototype.defined = false;
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/types.js
var types_exports = {};
__export(types_exports, {
boolean: () => boolean,
booleanish: () => booleanish,
commaOrSpaceSeparated: () => commaOrSpaceSeparated,
commaSeparated: () => commaSeparated,
number: () => number,
overloadedBoolean: () => overloadedBoolean,
spaceSeparated: () => spaceSeparated
});
var powers = 0;
var boolean = increment();
var booleanish = increment();
var overloadedBoolean = increment();
var number = increment();
var spaceSeparated = increment();
var commaSeparated = increment();
var commaOrSpaceSeparated = increment();
function increment() {
return __pow(2, ++powers);
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/defined-info.js
var checks = Object.keys(types_exports);
var DefinedInfo = class extends Info {
/**
* @constructor
* @param {string} property
* @param {string} attribute
* @param {number} [mask]
* @param {string} [space]
*/
constructor(property, attribute, mask, space2) {
var index2 = -1;
super(property, attribute);
mark(this, "space", space2);
while (++index2 < checks.length) {
mark(
this,
checks[index2],
(mask & types_exports[checks[index2]]) === types_exports[checks[index2]]
);
}
}
};
DefinedInfo.prototype.defined = true;
function mark(values, key, value) {
if (value) {
values[key] = value;
}
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/create.js
var own5 = {}.hasOwnProperty;
function create(definition2) {
var property = {};
var normal = {};
var prop;
var info;
for (prop in definition2.properties) {
if (own5.call(definition2.properties, prop)) {
info = new DefinedInfo(
prop,
definition2.transform(definition2.attributes, prop),
definition2.properties[prop],
definition2.space
);
if (definition2.mustUseProperty && definition2.mustUseProperty.includes(prop)) {
info.mustUseProperty = true;
}
property[prop] = info;
normal[normalize2(prop)] = prop;
normal[normalize2(info.attribute)] = prop;
}
}
return new Schema(property, normal, definition2.space);
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/xlink.js
var xlink = create({
space: "xlink",
transform: xlinkTransform,
properties: {
xLinkActuate: null,
xLinkArcRole: null,
xLinkHref: null,
xLinkRole: null,
xLinkShow: null,
xLinkTitle: null,
xLinkType: null
}
});
function xlinkTransform(_, prop) {
return "xlink:" + prop.slice(5).toLowerCase();
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/xml.js
var xml = create({
space: "xml",
transform: xmlTransform,
properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
});
function xmlTransform(_, prop) {
return "xml:" + prop.slice(3).toLowerCase();
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/case-sensitive-transform.js
function caseSensitiveTransform(attributes, attribute) {
return attribute in attributes ? attributes[attribute] : attribute;
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/util/case-insensitive-transform.js
function caseInsensitiveTransform(attributes, property) {
return caseSensitiveTransform(attributes, property.toLowerCase());
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/xmlns.js
var xmlns = create({
space: "xmlns",
attributes: { xmlnsxlink: "xmlns:xlink" },
transform: caseInsensitiveTransform,
properties: { xmlns: null, xmlnsXLink: null }
});
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/aria.js
var aria = create({
transform: ariaTransform,
properties: {
ariaActiveDescendant: null,
ariaAtomic: booleanish,
ariaAutoComplete: null,
ariaBusy: booleanish,
ariaChecked: booleanish,
ariaColCount: number,
ariaColIndex: number,
ariaColSpan: number,
ariaControls: spaceSeparated,
ariaCurrent: null,
ariaDescribedBy: spaceSeparated,
ariaDetails: null,
ariaDisabled: booleanish,
ariaDropEffect: spaceSeparated,
ariaErrorMessage: null,
ariaExpanded: booleanish,
ariaFlowTo: spaceSeparated,
ariaGrabbed: booleanish,
ariaHasPopup: null,
ariaHidden: booleanish,
ariaInvalid: null,
ariaKeyShortcuts: null,
ariaLabel: null,
ariaLabelledBy: spaceSeparated,
ariaLevel: number,
ariaLive: null,
ariaModal: booleanish,
ariaMultiLine: booleanish,
ariaMultiSelectable: booleanish,
ariaOrientation: null,
ariaOwns: spaceSeparated,
ariaPlaceholder: null,
ariaPosInSet: number,
ariaPressed: booleanish,
ariaReadOnly: booleanish,
ariaRelevant: null,
ariaRequired: booleanish,
ariaRoleDescription: spaceSeparated,
ariaRowCount: number,
ariaRowIndex: number,
ariaRowSpan: number,
ariaSelected: booleanish,
ariaSetSize: number,
ariaSort: null,
ariaValueMax: number,
ariaValueMin: number,
ariaValueNow: number,
ariaValueText: null,
role: null
}
});
function ariaTransform(_, prop) {
return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/html.js
var html2 = create({
space: "html",
attributes: {
acceptcharset: "accept-charset",
classname: "class",
htmlfor: "for",
httpequiv: "http-equiv"
},
transform: caseInsensitiveTransform,
mustUseProperty: ["checked", "multiple", "muted", "selected"],
properties: {
// Standard Properties.
abbr: null,
accept: commaSeparated,
acceptCharset: spaceSeparated,
accessKey: spaceSeparated,
action: null,
allow: null,
allowFullScreen: boolean,
allowPaymentRequest: boolean,
allowUserMedia: boolean,
alt: null,
as: null,
async: boolean,
autoCapitalize: null,
autoComplete: spaceSeparated,
autoFocus: boolean,
autoPlay: boolean,
capture: boolean,
charSet: null,
checked: boolean,
cite: null,
className: spaceSeparated,
cols: number,
colSpan: null,
content: null,
contentEditable: booleanish,
controls: boolean,
controlsList: spaceSeparated,
coords: number | commaSeparated,
crossOrigin: null,
data: null,
dateTime: null,
decoding: null,
default: boolean,
defer: boolean,
dir: null,
dirName: null,
disabled: boolean,
download: overloadedBoolean,
draggable: booleanish,
encType: null,
enterKeyHint: null,
form: null,
formAction: null,
formEncType: null,
formMethod: null,
formNoValidate: boolean,
formTarget: null,
headers: spaceSeparated,
height: number,
hidden: boolean,
high: number,
href: null,
hrefLang: null,
htmlFor: spaceSeparated,
httpEquiv: spaceSeparated,
id: null,
imageSizes: null,
imageSrcSet: commaSeparated,
inputMode: null,
integrity: null,
is: null,
isMap: boolean,
itemId: null,
itemProp: spaceSeparated,
itemRef: spaceSeparated,
itemScope: boolean,
itemType: spaceSeparated,
kind: null,
label: null,
lang: null,
language: null,
list: null,
loading: null,
loop: boolean,
low: number,
manifest: null,
max: null,
maxLength: number,
media: null,
method: null,
min: null,
minLength: number,
multiple: boolean,
muted: boolean,
name: null,
nonce: null,
noModule: boolean,
noValidate: boolean,
onAbort: null,
onAfterPrint: null,
onAuxClick: null,
onBeforePrint: null,
onBeforeUnload: null,
onBlur: null,
onCancel: null,
onCanPlay: null,
onCanPlayThrough: null,
onChange: null,
onClick: null,
onClose: null,
onContextMenu: null,
onCopy: null,
onCueChange: null,
onCut: null,
onDblClick: null,
onDrag: null,
onDragEnd: null,
onDragEnter: null,
onDragExit: null,
onDragLeave: null,
onDragOver: null,
onDragStart: null,
onDrop: null,
onDurationChange: null,
onEmptied: null,
onEnded: null,
onError: null,
onFocus: null,
onFormData: null,
onHashChange: null,
onInput: null,
onInvalid: null,
onKeyDown: null,
onKeyPress: null,
onKeyUp: null,
onLanguageChange: null,
onLoad: null,
onLoadedData: null,
onLoadedMetadata: null,
onLoadEnd: null,
onLoadStart: null,
onMessage: null,
onMessageError: null,
onMouseDown: null,
onMouseEnter: null,
onMouseLeave: null,
onMouseMove: null,
onMouseOut: null,
onMouseOver: null,
onMouseUp: null,
onOffline: null,
onOnline: null,
onPageHide: null,
onPageShow: null,
onPaste: null,
onPause: null,
onPlay: null,
onPlaying: null,
onPopState: null,
onProgress: null,
onRateChange: null,
onRejectionHandled: null,
onReset: null,
onResize: null,
onScroll: null,
onSecurityPolicyViolation: null,
onSeeked: null,
onSeeking: null,
onSelect: null,
onSlotChange: null,
onStalled: null,
onStorage: null,
onSubmit: null,
onSuspend: null,
onTimeUpdate: null,
onToggle: null,
onUnhandledRejection: null,
onUnload: null,
onVolumeChange: null,
onWaiting: null,
onWheel: null,
open: boolean,
optimum: number,
pattern: null,
ping: spaceSeparated,
placeholder: null,
playsInline: boolean,
poster: null,
preload: null,
readOnly: boolean,
referrerPolicy: null,
rel: spaceSeparated,
required: boolean,
reversed: boolean,
rows: number,
rowSpan: number,
sandbox: spaceSeparated,
scope: null,
scoped: boolean,
seamless: boolean,
selected: boolean,
shape: null,
size: number,
sizes: null,
slot: null,
span: number,
spellCheck: booleanish,
src: null,
srcDoc: null,
srcLang: null,
srcSet: commaSeparated,
start: number,
step: null,
style: null,
tabIndex: number,
target: null,
title: null,
translate: null,
type: null,
typeMustMatch: boolean,
useMap: null,
value: booleanish,
width: number,
wrap: null,
// Legacy.
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
align: null,
// Several. Use CSS `text-align` instead,
aLink: null,
// `<body>`. Use CSS `a:active {color}` instead
archive: spaceSeparated,
// `<object>`. List of URIs to archives
axis: null,
// `<td>` and `<th>`. Use `scope` on `<th>`
background: null,
// `<body>`. Use CSS `background-image` instead
bgColor: null,
// `<body>` and table elements. Use CSS `background-color` instead
border: number,
// `<table>`. Use CSS `border-width` instead,
borderColor: null,
// `<table>`. Use CSS `border-color` instead,
bottomMargin: number,
// `<body>`
cellPadding: null,
// `<table>`
cellSpacing: null,
// `<table>`
char: null,
// Several table elements. When `align=char`, sets the character to align on
charOff: null,
// Several table elements. When `char`, offsets the alignment
classId: null,
// `<object>`
clear: null,
// `<br>`. Use CSS `clear` instead
code: null,
// `<object>`
codeBase: null,
// `<object>`
codeType: null,
// `<object>`
color: null,
// `<font>` and `<hr>`. Use CSS instead
compact: boolean,
// Lists. Use CSS to reduce space between items instead
declare: boolean,
// `<object>`
event: null,
// `<script>`
face: null,
// `<font>`. Use CSS instead
frame: null,
// `<table>`
frameBorder: null,
// `<iframe>`. Use CSS `border` instead
hSpace: number,
// `<img>` and `<object>`
leftMargin: number,
// `<body>`
link: null,
// `<body>`. Use CSS `a:link {color: *}` instead
longDesc: null,
// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
lowSrc: null,
// `<img>`. Use a `<picture>`
marginHeight: number,
// `<body>`
marginWidth: number,
// `<body>`
noResize: boolean,
// `<frame>`
noHref: boolean,
// `<area>`. Use no href instead of an explicit `nohref`
noShade: boolean,
// `<hr>`. Use background-color and height instead of borders
noWrap: boolean,
// `<td>` and `<th>`
object: null,
// `<applet>`
profile: null,
// `<head>`
prompt: null,
// `<isindex>`
rev: null,
// `<link>`
rightMargin: number,
// `<body>`
rules: null,
// `<table>`
scheme: null,
// `<meta>`
scrolling: booleanish,
// `<frame>`. Use overflow in the child context
standby: null,
// `<object>`
summary: null,
// `<table>`
text: null,
// `<body>`. Use CSS `color` instead
topMargin: number,
// `<body>`
valueType: null,
// `<param>`
version: null,
// `<html>`. Use a doctype.
vAlign: null,
// Several. Use CSS `vertical-align` instead
vLink: null,
// `<body>`. Use CSS `a:visited {color}` instead
vSpace: number,
// `<img>` and `<object>`
// Non-standard Properties.
allowTransparency: null,
autoCorrect: null,
autoSave: null,
disablePictureInPicture: boolean,
disableRemotePlayback: boolean,
prefix: null,
property: null,
results: number,
security: null,
unselectable: null
}
});
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/svg.js
var svg = create({
space: "svg",
attributes: {
accentHeight: "accent-height",
alignmentBaseline: "alignment-baseline",
arabicForm: "arabic-form",
baselineShift: "baseline-shift",
capHeight: "cap-height",
className: "class",
clipPath: "clip-path",
clipRule: "clip-rule",
colorInterpolation: "color-interpolation",
colorInterpolationFilters: "color-interpolation-filters",
colorProfile: "color-profile",
colorRendering: "color-rendering",
crossOrigin: "crossorigin",
dataType: "datatype",
dominantBaseline: "dominant-baseline",
enableBackground: "enable-background",
fillOpacity: "fill-opacity",
fillRule: "fill-rule",
floodColor: "flood-color",
floodOpacity: "flood-opacity",
fontFamily: "font-family",
fontSize: "font-size",
fontSizeAdjust: "font-size-adjust",
fontStretch: "font-stretch",
fontStyle: "font-style",
fontVariant: "font-variant",
fontWeight: "font-weight",
glyphName: "glyph-name",
glyphOrientationHorizontal: "glyph-orientation-horizontal",
glyphOrientationVertical: "glyph-orientation-vertical",
hrefLang: "hreflang",
horizAdvX: "horiz-adv-x",
horizOriginX: "horiz-origin-x",
horizOriginY: "horiz-origin-y",
imageRendering: "image-rendering",
letterSpacing: "letter-spacing",
lightingColor: "lighting-color",
markerEnd: "marker-end",
markerMid: "marker-mid",
markerStart: "marker-start",
navDown: "nav-down",
navDownLeft: "nav-down-left",
navDownRight: "nav-down-right",
navLeft: "nav-left",
navNext: "nav-next",
navPrev: "nav-prev",
navRight: "nav-right",
navUp: "nav-up",
navUpLeft: "nav-up-left",
navUpRight: "nav-up-right",
onAbort: "onabort",
onActivate: "onactivate",
onAfterPrint: "onafterprint",
onBeforePrint: "onbeforeprint",
onBegin: "onbegin",
onCancel: "oncancel",
onCanPlay: "oncanplay",
onCanPlayThrough: "oncanplaythrough",
onChange: "onchange",
onClick: "onclick",
onClose: "onclose",
onCopy: "oncopy",
onCueChange: "oncuechange",
onCut: "oncut",
onDblClick: "ondblclick",
onDrag: "ondrag",
onDragEnd: "ondragend",
onDragEnter: "ondragenter",
onDragExit: "ondragexit",
onDragLeave: "ondragleave",
onDragOver: "ondragover",
onDragStart: "ondragstart",
onDrop: "ondrop",
onDurationChange: "ondurationchange",
onEmptied: "onemptied",
onEnd: "onend",
onEnded: "onended",
onError: "onerror",
onFocus: "onfocus",
onFocusIn: "onfocusin",
onFocusOut: "onfocusout",
onHashChange: "onhashchange",
onInput: "oninput",
onInvalid: "oninvalid",
onKeyDown: "onkeydown",
onKeyPress: "onkeypress",
onKeyUp: "onkeyup",
onLoad: "onload",
onLoadedData: "onloadeddata",
onLoadedMetadata: "onloadedmetadata",
onLoadStart: "onloadstart",
onMessage: "onmessage",
onMouseDown: "onmousedown",
onMouseEnter: "onmouseenter",
onMouseLeave: "onmouseleave",
onMouseMove: "onmousemove",
onMouseOut: "onmouseout",
onMouseOver: "onmouseover",
onMouseUp: "onmouseup",
onMouseWheel: "onmousewheel",
onOffline: "onoffline",
onOnline: "ononline",
onPageHide: "onpagehide",
onPageShow: "onpageshow",
onPaste: "onpaste",
onPause: "onpause",
onPlay: "onplay",
onPlaying: "onplaying",
onPopState: "onpopstate",
onProgress: "onprogress",
onRateChange: "onratechange",
onRepeat: "onrepeat",
onReset: "onreset",
onResize: "onresize",
onScroll: "onscroll",
onSeeked: "onseeked",
onSeeking: "onseeking",
onSelect: "onselect",
onShow: "onshow",
onStalled: "onstalled",
onStorage: "onstorage",
onSubmit: "onsubmit",
onSuspend: "onsuspend",
onTimeUpdate: "ontimeupdate",
onToggle: "ontoggle",
onUnload: "onunload",
onVolumeChange: "onvolumechange",
onWaiting: "onwaiting",
onZoom: "onzoom",
overlinePosition: "overline-position",
overlineThickness: "overline-thickness",
paintOrder: "paint-order",
panose1: "panose-1",
pointerEvents: "pointer-events",
referrerPolicy: "referrerpolicy",
renderingIntent: "rendering-intent",
shapeRendering: "shape-rendering",
stopColor: "stop-color",
stopOpacity: "stop-opacity",
strikethroughPosition: "strikethrough-position",
strikethroughThickness: "strikethrough-thickness",
strokeDashArray: "stroke-dasharray",
strokeDashOffset: "stroke-dashoffset",
strokeLineCap: "stroke-linecap",
strokeLineJoin: "stroke-linejoin",
strokeMiterLimit: "stroke-miterlimit",
strokeOpacity: "stroke-opacity",
strokeWidth: "stroke-width",
tabIndex: "tabindex",
textAnchor: "text-anchor",
textDecoration: "text-decoration",
textRendering: "text-rendering",
typeOf: "typeof",
underlinePosition: "underline-position",
underlineThickness: "underline-thickness",
unicodeBidi: "unicode-bidi",
unicodeRange: "unicode-range",
unitsPerEm: "units-per-em",
vAlphabetic: "v-alphabetic",
vHanging: "v-hanging",
vIdeographic: "v-ideographic",
vMathematical: "v-mathematical",
vectorEffect: "vector-effect",
vertAdvY: "vert-adv-y",
vertOriginX: "vert-origin-x",
vertOriginY: "vert-origin-y",
wordSpacing: "word-spacing",
writingMode: "writing-mode",
xHeight: "x-height",
// These were camelcased in Tiny. Now lowercased in SVG 2
playbackOrder: "playbackorder",
timelineBegin: "timelinebegin"
},
transform: caseSensitiveTransform,
properties: {
about: commaOrSpaceSeparated,
accentHeight: number,
accumulate: null,
additive: null,
alignmentBaseline: null,
alphabetic: number,
amplitude: number,
arabicForm: null,
ascent: number,
attributeName: null,
attributeType: null,
azimuth: number,
bandwidth: null,
baselineShift: null,
baseFrequency: null,
baseProfile: null,
bbox: null,
begin: null,
bias: number,
by: null,
calcMode: null,
capHeight: number,
className: spaceSeparated,
clip: null,
clipPath: null,
clipPathUnits: null,
clipRule: null,
color: null,
colorInterpolation: null,
colorInterpolationFilters: null,
colorProfile: null,
colorRendering: null,
content: null,
contentScriptType: null,
contentStyleType: null,
crossOrigin: null,
cursor: null,
cx: null,
cy: null,
d: null,
dataType: null,
defaultAction: null,
descent: number,
diffuseConstant: number,
direction: null,
display: null,
dur: null,
divisor: number,
dominantBaseline: null,
download: boolean,
dx: null,
dy: null,
edgeMode: null,
editable: null,
elevation: number,
enableBackground: null,
end: null,
event: null,
exponent: number,
externalResourcesRequired: null,
fill: null,
fillOpacity: number,
fillRule: null,
filter: null,
filterRes: null,
filterUnits: null,
floodColor: null,
floodOpacity: null,
focusable: null,
focusHighlight: null,
fontFamily: null,
fontSize: null,
fontSizeAdjust: null,
fontStretch: null,
fontStyle: null,
fontVariant: null,
fontWeight: null,
format: null,
fr: null,
from: null,
fx: null,
fy: null,
g1: commaSeparated,
g2: commaSeparated,
glyphName: commaSeparated,
glyphOrientationHorizontal: null,
glyphOrientationVertical: null,
glyphRef: null,
gradientTransform: null,
gradientUnits: null,
handler: null,
hanging: number,
hatchContentUnits: null,
hatchUnits: null,
height: null,
href: null,
hrefLang: null,
horizAdvX: number,
horizOriginX: number,
horizOriginY: number,
id: null,
ideographic: number,
imageRendering: null,
initialVisibility: null,
in: null,
in2: null,
intercept: number,
k: number,
k1: number,
k2: number,
k3: number,
k4: number,
kernelMatrix: commaOrSpaceSeparated,
kernelUnitLength: null,
keyPoints: null,
// SEMI_COLON_SEPARATED
keySplines: null,
// SEMI_COLON_SEPARATED
keyTimes: null,
// SEMI_COLON_SEPARATED
kerning: null,
lang: null,
lengthAdjust: null,
letterSpacing: null,
lightingColor: null,
limitingConeAngle: number,
local: null,
markerEnd: null,
markerMid: null,
markerStart: null,
markerHeight: null,
markerUnits: null,
markerWidth: null,
mask: null,
maskContentUnits: null,
maskUnits: null,
mathematical: null,
max: null,
media: null,
mediaCharacterEncoding: null,
mediaContentEncodings: null,
mediaSize: number,
mediaTime: null,
method: null,
min: null,
mode: null,
name: null,
navDown: null,
navDownLeft: null,
navDownRight: null,
navLeft: null,
navNext: null,
navPrev: null,
navRight: null,
navUp: null,
navUpLeft: null,
navUpRight: null,
numOctaves: null,
observer: null,
offset: null,
onAbort: null,
onActivate: null,
onAfterPrint: null,
onBeforePrint: null,
onBegin: null,
onCancel: null,
onCanPlay: null,
onCanPlayThrough: null,
onChange: null,
onClick: null,
onClose: null,
onCopy: null,
onCueChange: null,
onCut: null,
onDblClick: null,
onDrag: null,
onDragEnd: null,
onDragEnter: null,
onDragExit: null,
onDragLeave: null,
onDragOver: null,
onDragStart: null,
onDrop: null,
onDurationChange: null,
onEmptied: null,
onEnd: null,
onEnded: null,
onError: null,
onFocus: null,
onFocusIn: null,
onFocusOut: null,
onHashChange: null,
onInput: null,
onInvalid: null,
onKeyDown: null,
onKeyPress: null,
onKeyUp: null,
onLoad: null,
onLoadedData: null,
onLoadedMetadata: null,
onLoadStart: null,
onMessage: null,
onMouseDown: null,
onMouseEnter: null,
onMouseLeave: null,
onMouseMove: null,
onMouseOut: null,
onMouseOver: null,
onMouseUp: null,
onMouseWheel: null,
onOffline: null,
onOnline: null,
onPageHide: null,
onPageShow: null,
onPaste: null,
onPause: null,
onPlay: null,
onPlaying: null,
onPopState: null,
onProgress: null,
onRateChange: null,
onRepeat: null,
onReset: null,
onResize: null,
onScroll: null,
onSeeked: null,
onSeeking: null,
onSelect: null,
onShow: null,
onStalled: null,
onStorage: null,
onSubmit: null,
onSuspend: null,
onTimeUpdate: null,
onToggle: null,
onUnload: null,
onVolumeChange: null,
onWaiting: null,
onZoom: null,
opacity: null,
operator: null,
order: null,
orient: null,
orientation: null,
origin: null,
overflow: null,
overlay: null,
overlinePosition: number,
overlineThickness: number,
paintOrder: null,
panose1: null,
path: null,
pathLength: number,
patternContentUnits: null,
patternTransform: null,
patternUnits: null,
phase: null,
ping: spaceSeparated,
pitch: null,
playbackOrder: null,
pointerEvents: null,
points: null,
pointsAtX: number,
pointsAtY: number,
pointsAtZ: number,
preserveAlpha: null,
preserveAspectRatio: null,
primitiveUnits: null,
propagate: null,
property: commaOrSpaceSeparated,
r: null,
radius: null,
referrerPolicy: null,
refX: null,
refY: null,
rel: commaOrSpaceSeparated,
rev: commaOrSpaceSeparated,
renderingIntent: null,
repeatCount: null,
repeatDur: null,
requiredExtensions: commaOrSpaceSeparated,
requiredFeatures: commaOrSpaceSeparated,
requiredFonts: commaOrSpaceSeparated,
requiredFormats: commaOrSpaceSeparated,
resource: null,
restart: null,
result: null,
rotate: null,
rx: null,
ry: null,
scale: null,
seed: null,
shapeRendering: null,
side: null,
slope: null,
snapshotTime: null,
specularConstant: number,
specularExponent: number,
spreadMethod: null,
spacing: null,
startOffset: null,
stdDeviation: null,
stemh: null,
stemv: null,
stitchTiles: null,
stopColor: null,
stopOpacity: null,
strikethroughPosition: number,
strikethroughThickness: number,
string: null,
stroke: null,
strokeDashArray: commaOrSpaceSeparated,
strokeDashOffset: null,
strokeLineCap: null,
strokeLineJoin: null,
strokeMiterLimit: number,
strokeOpacity: number,
strokeWidth: null,
style: null,
surfaceScale: number,
syncBehavior: null,
syncBehaviorDefault: null,
syncMaster: null,
syncTolerance: null,
syncToleranceDefault: null,
systemLanguage: commaOrSpaceSeparated,
tabIndex: number,
tableValues: null,
target: null,
targetX: number,
targetY: number,
textAnchor: null,
textDecoration: null,
textRendering: null,
textLength: null,
timelineBegin: null,
title: null,
transformBehavior: null,
type: null,
typeOf: commaOrSpaceSeparated,
to: null,
transform: null,
u1: null,
u2: null,
underlinePosition: number,
underlineThickness: number,
unicode: null,
unicodeBidi: null,
unicodeRange: null,
unitsPerEm: number,
values: null,
vAlphabetic: number,
vMathematical: number,
vectorEffect: null,
vHanging: number,
vIdeographic: number,
version: null,
vertAdvY: number,
vertOriginX: number,
vertOriginY: number,
viewBox: null,
viewTarget: null,
visibility: null,
width: null,
widths: null,
wordSpacing: null,
writingMode: null,
x: null,
x1: null,
x2: null,
xChannelSelector: null,
xHeight: number,
y: null,
y1: null,
y2: null,
yChannelSelector: null,
z: null,
zoomAndPan: null
}
});
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/find.js
var valid = /^data[-\w.:]+$/i;
var dash = /-[a-z]/g;
var cap = /[A-Z]/g;
function find(schema, value) {
var normal = normalize2(value);
var prop = value;
var Type = Info;
if (normal in schema.normal) {
return schema.property[schema.normal[normal]];
}
if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
if (value.charAt(4) === "-") {
prop = datasetToProperty(value);
} else {
value = datasetToAttribute(value);
}
Type = DefinedInfo;
}
return new Type(prop, value);
}
function datasetToProperty(attribute) {
var value = attribute.slice(5).replace(dash, camelcase);
return "data" + value.charAt(0).toUpperCase() + value.slice(1);
}
function datasetToAttribute(property) {
var value = property.slice(4);
if (dash.test(value)) {
return property;
}
value = value.replace(cap, kebab);
if (value.charAt(0) !== "-") {
value = "-" + value;
}
return "data" + value;
}
function kebab($0) {
return "-" + $0.toLowerCase();
}
function camelcase($0) {
return $0.charAt(1).toUpperCase();
}
// node_modules/.pnpm/[email protected]/node_modules/property-information/lib/hast-to-react.js
var hastToReact = {
classId: "classID",
dataType: "datatype",
itemId: "itemID",
strokeDashArray: "strokeDasharray",
strokeDashOffset: "strokeDashoffset",
strokeLineCap: "strokeLinecap",
strokeLineJoin: "strokeLinejoin",
strokeMiterLimit: "strokeMiterlimit",
typeOf: "typeof",
xLinkActuate: "xlinkActuate",
xLinkArcRole: "xlinkArcrole",
xLinkHref: "xlinkHref",
xLinkRole: "xlinkRole",
xLinkShow: "xlinkShow",
xLinkTitle: "xlinkTitle",
xLinkType: "xlinkType",
xmlnsXLink: "xmlnsXlink"
};
// node_modules/.pnpm/[email protected]/node_modules/property-information/index.js
var html3 = merge([xml, xlink, xmlns, aria, html2], "html");
var svg2 = merge([xml, xlink, xmlns, aria, svg], "svg");
// lib/rehype-filter.js
function rehypeFilter(options) {
if (options.allowedElements && options.disallowedElements) {
throw new TypeError(
"Only one of `allowedElements` and `disallowedElements` should be defined"
);
}
if (options.allowedElements || options.disallowedElements || options.allowElement) {
return (tree) => {
visit(tree, "element", (node2, index2, parent_) => {
const parent = (
/** @type {Element|Root} */
parent_
);
let remove;
if (options.allowedElements) {
remove = !options.allowedElements.includes(node2.tagName);
} else if (options.disallowedElements) {
remove = options.disallowedElements.includes(node2.tagName);
}
if (!remove && options.allowElement && typeof index2 === "number") {
remove = !options.allowElement(node2, index2, parent);
}
if (remove && typeof index2 === "number") {
if (options.unwrapDisallowed && node2.children) {
parent.children.splice(index2, 1, ...node2.children);
} else {
parent.children.splice(index2, 1);
}
return index2;
}
return void 0;
});
};
}
}
// lib/ast-to-react.js
var import_react = __toESM(__require("react"), 1);
var import_react_is = __toESM(require_react_is(), 1);
// node_modules/.pnpm/[email protected]/node_modules/hast-util-whitespace/index.js
function whitespace(thing) {
var value = (
// @ts-ignore looks like a node.
thing && typeof thing === "object" && thing.type === "text" ? (
// @ts-ignore looks like a text.
thing.value || ""
) : thing
);
return typeof value === "string" && value.replace(/[ \t\n\f\r]/g, "") === "";
}
// node_modules/.pnpm/[email protected]/node_modules/space-separated-tokens/index.js
function stringify(values) {
return values.join(" ").trim();
}
// node_modules/.pnpm/[email protected]/node_modules/comma-separated-tokens/index.js
function stringify2(values, options) {
var settings = options || {};
if (values[values.length - 1] === "") {
values = values.concat("");
}
return values.join(
(settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")
).trim();
}
// node_modules/.pnpm/[email protected]/node_modules/style-to-object/index.mjs
var import_index = __toESM(require_style_to_object(), 1);
var style_to_object_default = import_index.default;
// lib/ast-to-react.js
var own6 = {}.hasOwnProperty;
var tableElements = /* @__PURE__ */ new Set(["table", "thead", "tbody", "tfoot", "tr"]);
function childrenToReact(context, node2) {
const children = [];
let childIndex = -1;
let child;
while (++childIndex < node2.children.length) {
child = node2.children[childIndex];
if (child.type === "element") {
children.push(toReact(context, child, childIndex, node2));
} else if (child.type === "text") {
if (node2.type !== "element" || !tableElements.has(node2.tagName) || !whitespace(child)) {
children.push(child.value);
}
} else if (child.type === "raw" && !context.options.skipHtml) {
children.push(child.value);
}
}
return children;
}
function toReact(context, node2, index2, parent) {
const options = context.options;
const transform = options.transformLinkUri === void 0 ? uriTransformer : options.transformLinkUri;
const parentSchema = context.schema;
const name = node2.tagName;
const properties = {};
let schema = parentSchema;
let property;
if (parentSchema.space === "html" && name === "svg") {
schema = svg2;
context.schema = schema;
}
if (node2.properties) {
for (property in node2.properties) {
if (own6.call(node2.properties, property)) {
addProperty(properties, property, node2.properties[property], context);
}
}
}
if (name === "ol" || name === "ul") {
context.listDepth++;
}
const children = childrenToReact(context, node2);
if (name === "ol" || name === "ul") {
context.listDepth--;
}
context.schema = parentSchema;
const position3 = node2.position || {
start: { line: null, column: null, offset: null },
end: { line: null, column: null, offset: null }
};
const component = options.components && own6.call(options.components, name) ? options.components[name] : name;
const basic = typeof component === "string" || component === import_react.default.Fragment;
if (!import_react_is.default.isValidElementType(component)) {
throw new TypeError(
`Component for name \`${name}\` not defined or is not renderable`
);
}
properties.key = index2;
if (name === "a" && options.linkTarget) {
properties.target = typeof options.linkTarget === "function" ? options.linkTarget(
String(properties.href || ""),
node2.children,
typeof properties.title === "string" ? properties.title : null
) : options.linkTarget;
}
if (name === "a" && transform) {
properties.href = transform(
String(properties.href || ""),
node2.children,
typeof properties.title === "string" ? properties.title : null
);
}
if (!basic && name === "code" && parent.type === "element" && parent.tagName !== "pre") {
properties.inline = true;
}
if (!basic && (name === "h1" || name === "h2" || name === "h3" || name === "h4" || name === "h5" || name === "h6")) {
properties.level = Number.parseInt(name.charAt(1), 10);
}
if (name === "img" && options.transformImageUri) {
properties.src = options.transformImageUri(
String(properties.src || ""),
String(properties.alt || ""),
typeof properties.title === "string" ? properties.title : null
);
}
if (!basic && name === "li" && parent.type === "element") {
const input = getInputElement(node2);
properties.checked = input && input.properties ? Boolean(input.properties.checked) : null;
properties.index = getElementsBeforeCount(parent, node2);
properties.ordered = parent.tagName === "ol";
}
if (!basic && (name === "ol" || name === "ul")) {
properties.ordered = name === "ol";
properties.depth = context.listDepth;
}
if (name === "td" || name === "th") {
if (properties.align) {
if (!properties.style)
properties.style = {};
properties.style.textAlign = properties.align;
delete properties.align;
}
if (!basic) {
properties.isHeader = name === "th";
}
}
if (!basic && name === "tr" && parent.type === "element") {
properties.isHeader = Boolean(parent.tagName === "thead");
}
if (options.sourcePos) {
properties["data-sourcepos"] = flattenPosition(position3);
}
if (!basic && options.rawSourcePos) {
properties.sourcePosition = node2.position;
}
if (!basic && options.includeElementIndex) {
properties.index = getElementsBeforeCount(parent, node2);
properties.siblingCount = getElementsBeforeCount(parent);
}
if (!basic) {
properties.node = node2;
}
return children.length > 0 ? import_react.default.createElement(component, properties, children) : import_react.default.createElement(component, properties);
}
function getInputElement(node2) {
let index2 = -1;
while (++index2 < node2.children.length) {
const child = node2.children[index2];
if (child.type === "element" && child.tagName === "input") {
return child;
}
}
return null;
}
function getElementsBeforeCount(parent, node2) {
let index2 = -1;
let count = 0;
while (++index2 < parent.children.length) {
if (parent.children[index2] === node2)
break;
if (parent.children[index2].type === "element")
count++;
}
return count;
}
function addProperty(props, prop, value, ctx) {
const info = find(ctx.schema, prop);
let result = value;
if (result === null || result === void 0 || result !== result) {
return;
}
if (Array.isArray(result)) {
result = info.commaSeparated ? stringify2(result) : stringify(result);
}
if (info.property === "style" && typeof result === "string") {
result = parseStyle(result);
}
if (info.space && info.property) {
props[own6.call(hastToReact, info.property) ? hastToReact[info.property] : info.property] = result;
} else if (info.attribute) {
props[info.attribute] = result;
}
}
function parseStyle(value) {
const result = {};
try {
style_to_object_default(value, iterator);
} catch (e) {
}
return result;
function iterator(name, v) {
const k = name.slice(0, 4) === "-ms-" ? `ms-${name.slice(4)}` : name;
result[k.replace(/-([a-z])/g, styleReplacer)] = v;
}
}
function styleReplacer(_, $1) {
return $1.toUpperCase();
}
function flattenPosition(pos) {
return [
pos.start.line,
":",
pos.start.column,
"-",
pos.end.line,
":",
pos.end.column
].map(String).join("");
}
// lib/react-markdown.js
var own7 = {}.hasOwnProperty;
var changelog = "https://github.com/remarkjs/react-markdown/blob/main/changelog.md";
var deprecated = {
plugins: { to: "remarkPlugins", id: "change-plugins-to-remarkplugins" },
renderers: { to: "components", id: "change-renderers-to-components" },
astPlugins: { id: "remove-buggy-html-in-markdown-parser" },
allowDangerousHtml: { id: "remove-buggy-html-in-markdown-parser" },
escapeHtml: { id: "remove-buggy-html-in-markdown-parser" },
source: { to: "children", id: "change-source-to-children" },
allowNode: {
to: "allowElement",
id: "replace-allownode-allowedtypes-and-disallowedtypes"
},
allowedTypes: {
to: "allowedElements",
id: "replace-allownode-allowedtypes-and-disallowedtypes"
},
disallowedTypes: {
to: "disallowedElements",
id: "replace-allownode-allowedtypes-and-disallowedtypes"
},
includeNodeIndex: {
to: "includeElementIndex",
id: "change-includenodeindex-to-includeelementindex"
}
};
function ReactMarkdown(options) {
for (const key in deprecated) {
if (own7.call(deprecated, key) && own7.call(options, key)) {
const deprecation = deprecated[key];
console.warn(
`[react-markdown] Warning: please ${deprecation.to ? `use \`${deprecation.to}\` instead of` : "remove"} \`${key}\` (see <${changelog}#${deprecation.id}> for more info)`
);
delete deprecated[key];
}
}
const processor = unified().use(remark_parse_default).use(options.remarkPlugins || []).use(remark_rehype_default, __spreadProps(__spreadValues({}, options.remarkRehypeOptions), {
allowDangerousHtml: true
})).use(options.rehypePlugins || []).use(rehypeFilter, options);
const file = new VFile();
if (typeof options.children === "string") {
file.value = options.children;
} else if (options.children !== void 0 && options.children !== null) {
console.warn(
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
);
}
const hastNode = processor.runSync(processor.parse(file), file);
if (hastNode.type !== "root") {
throw new TypeError("Expected a `root` node");
}
let result = React.createElement(
React.Fragment,
{},
childrenToReact({ options, schema: html3, listDepth: 0 }, hastNode)
);
if (options.className) {
result = React.createElement("div", { className: options.className }, result);
}
return result;
}
ReactMarkdown.propTypes = {
// Core options:
children: import_prop_types.default.string,
// Layout options:
className: import_prop_types.default.string,
// Filter options:
allowElement: import_prop_types.default.func,
allowedElements: import_prop_types.default.arrayOf(import_prop_types.default.string),
disallowedElements: import_prop_types.default.arrayOf(import_prop_types.default.string),
unwrapDisallowed: import_prop_types.default.bool,
// Plugin options:
remarkPlugins: import_prop_types.default.arrayOf(
import_prop_types.default.oneOfType([
import_prop_types.default.object,
import_prop_types.default.func,
import_prop_types.default.arrayOf(
import_prop_types.default.oneOfType([
import_prop_types.default.bool,
import_prop_types.default.string,
import_prop_types.default.object,
import_prop_types.default.func,
import_prop_types.default.arrayOf(
// prettier-ignore
// type-coverage:ignore-next-line
import_prop_types.default.any
)
])
)
])
),
rehypePlugins: import_prop_types.default.arrayOf(
import_prop_types.default.oneOfType([
import_prop_types.default.object,
import_prop_types.default.func,
import_prop_types.default.arrayOf(
import_prop_types.default.oneOfType([
import_prop_types.default.bool,
import_prop_types.default.string,
import_prop_types.default.object,
import_prop_types.default.func,
import_prop_types.default.arrayOf(
// prettier-ignore
// type-coverage:ignore-next-line
import_prop_types.default.any
)
])
)
])
),
// Transform options:
sourcePos: import_prop_types.default.bool,
rawSourcePos: import_prop_types.default.bool,
skipHtml: import_prop_types.default.bool,
includeElementIndex: import_prop_types.default.bool,
transformLinkUri: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.bool]),
linkTarget: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.string]),
transformImageUri: import_prop_types.default.func,
components: import_prop_types.default.object
};
return __toCommonJS(react_markdown_8_0_exports);
})();
/*! Bundled license information:
is-buffer/index.js:
(*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
react-is/cjs/react-is.development.js:
(**
* @license React
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/
return ReactMarkdown;})));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment