false }; const result = one(state, tree, void 0); if (result && typeof result !== "string") { return result; } return state.create( tree, state.Fragment, { children: result || void 0 }, void 0 ); } function one(state, node2, key) { if (node2.type === "element") { return element(state, node2, key); } if (node2.type === "mdxFlowExpression" || node2.type === "mdxTextExpression") { return mdxExpression(state, node2); } if (node2.type === "mdxJsxFlowElement" || node2.type === "mdxJsxTextElement") { return mdxJsxElement(state, node2, key); } if (node2.type === "mdxjsEsm") { return mdxEsm(state, node2); } if (node2.type === "root") { return root(state, node2, key); } if (node2.type === "text") { return text(state, node2); } } function element(state, node2, key) { const parentSchema = state.schema; let schema = parentSchema; if (node2.tagName.toLowerCase() === "svg" && parentSchema.space === "html") { schema = svg2; state.schema = schema; } state.ancestors.push(node2); const type = findComponentFromName(state, node2.tagName, false); const props = createElementProps(state, node2); let children = createChildren(state, node2); if (tableElements.has(node2.tagName)) { children = children.filter(function(child) { return typeof child === "string" ? !whitespace(child) : true; }); } addNode(state, props, type, node2); addChildren(props, children); state.ancestors.pop(); state.schema = parentSchema; return state.create(node2, type, props, key); } function mdxExpression(state, node2) { if (node2.data && node2.data.estree && state.evaluater) { const program = node2.data.estree; const expression = program.body[0]; ok(expression.type === "ExpressionStatement"); return ( /** @type {Child | undefined} */ state.evaluater.evaluateExpression(expression.expression) ); } crashEstree(state, node2.position); } function mdxEsm(state, node2) { if (node2.data && node2.data.estree && state.evaluater) { return ( /** @type {Child | undefined} */ state.evaluater.evaluateProgram(node2.data.estree) ); } crashEstree(state, node2.position); } function mdxJsxElement(state, node2, key) { const parentSchema = state.schema; let schema = parentSchema; if (node2.name === "svg" && parentSchema.space === "html") { schema = svg2; state.schema = schema; } state.ancestors.push(node2); const type = node2.name === null ? state.Fragment : findComponentFromName(state, node2.name, true); const props = createJsxElementProps(state, node2); const children = createChildren(state, node2); addNode(state, props, type, node2); addChildren(props, children); state.ancestors.pop(); state.schema = parentSchema; return state.create(node2, type, props, key); } function root(state, node2, key) { const props = {}; addChildren(props, createChildren(state, node2)); return state.create(node2, state.Fragment, props, key); } function text(_, node2) { return node2.value; } function addNode(state, props, type, node2) { if (typeof type !== "string" && type !== state.Fragment && state.passNode) { props.node = node2; } } function addChildren(props, children) { if (children.length > 0) { const value = children.length > 1 ? children : children[0]; if (value) { props.children = value; } } } function productionCreate(_, jsx2, jsxs2) { return create2; function create2(_2, type, props, key) { const isStaticChildren = Array.isArray(props.children); const fn = isStaticChildren ? jsxs2 : jsx2; return key ? fn(type, props, key) : fn(type, props); } } function developmentCreate(filePath, jsxDEV) { return create2; function create2(node2, type, props, key) { const isStaticChildren = Array.isArray(props.children); const point4 = pointStart(node2); return jsxDEV( type, props, key, isStaticChildren, { columnNumber: point4 ? point4.column - 1 : void 0, fileName: filePath, lineNumber: point4 ? point4.line : void 0 }, void 0 ); } } function createElementProps(state, node2) { const props = {}; let alignValue; let prop; for (prop in node2.properties) { if (prop !== "children" && own.call(node2.properties, prop)) { const result = createProperty(state, prop, node2.properties[prop]); if (result) { const [key, value] = result; if (state.tableCellAlignToStyle && key === "align" && typeof value === "string" && tableCellElement.has(node2.tagName)) { alignValue = value; } else { props[key] = value; } } } } if (alignValue) { const style = ( /** @type {Style} */ props.style || (props.style = {}) ); style[state.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = alignValue; } return props; } function createJsxElementProps(state, node2) { const props = {}; for (const attribute of node2.attributes) { if (attribute.type === "mdxJsxExpressionAttribute") { if (attribute.data && attribute.data.estree && state.evaluater) { const program = attribute.data.estree; const expression = program.body[0]; ok(expression.type === "ExpressionStatement"); const objectExpression = expression.expression; ok(objectExpression.type === "ObjectExpression"); const property = objectExpression.properties[0]; ok(property.type === "SpreadElement"); Object.assign( props, state.evaluater.evaluateExpression(property.argument) ); } else { crashEstree(state, node2.position); } } else { const name2 = attribute.name; let value; if (attribute.value && typeof attribute.value === "object") { if (attribute.value.data && attribute.value.data.estree && state.evaluater) { const program = attribute.value.data.estree; const expression = program.body[0]; ok(expression.type === "ExpressionStatement"); value = state.evaluater.evaluateExpression(expression.expression); } else { crashEstree(state, node2.position); } } else { value = attribute.value === null ? true : attribute.value; } props[name2] = /** @type {Props[keyof Props]} */ value; } } return props; } function createChildren(state, node2) { const children = []; let index2 = -1; const countsByName = state.passKeys ? /* @__PURE__ */ new Map() : emptyMap; while (++index2 < node2.children.length) { const child = node2.children[index2]; let key; if (state.passKeys) { const name2 = child.type === "element" ? child.tagName : child.type === "mdxJsxFlowElement" || child.type === "mdxJsxTextElement" ? child.name : void 0; if (name2) { const count = countsByName.get(name2) || 0; key = name2 + "-" + count; countsByName.set(name2, count + 1); } } const result = one(state, child, key); if (result !== void 0) children.push(result); } return children; } function createProperty(state, prop, value) { const info = find(state.schema, prop); if (value === null || value === void 0 || typeof value === "number" && Number.isNaN(value)) { return; } if (Array.isArray(value)) { value = info.commaSeparated ? stringify(value) : stringify2(value); } if (info.property === "style") { let styleObject = typeof value === "object" ? value : parseStyle(state, String(value)); if (state.stylePropertyNameCase === "css") { styleObject = transformStylesToCssCasing(styleObject); } return ["style", styleObject]; } return [ state.elementAttributeNameCase === "react" && info.space ? hastToReact[info.property] || info.property : info.attribute, value ]; } function parseStyle(state, value) { try { return (0, import_style_to_js.default)(value, { reactCompat: true }); } catch (error) { if (state.ignoreInvalidStyle) { return {}; } const cause = ( /** @type {Error} */ error ); const message = new VFileMessage("Cannot parse `style` attribute", { ancestors: state.ancestors, cause, ruleId: "style", source: "hast-util-to-jsx-runtime" }); message.file = state.filePath || void 0; message.url = docs + "#cannot-parse-style-attribute"; throw message; } } function findComponentFromName(state, name2, allowExpression) { let result; if (!allowExpression) { result = { type: "Literal", value: name2 }; } else if (name2.includes(".")) { const identifiers = name2.split("."); let index2 = -1; let node2; while (++index2 < identifiers.length) { const prop = name(identifiers[index2]) ? { type: "Identifier", name: identifiers[index2] } : { type: "Literal", value: identifiers[index2] }; node2 = node2 ? { type: "MemberExpression", object: node2, property: prop, computed: Boolean(index2 && prop.type === "Literal"), optional: false } : prop; } ok(node2, "always a result"); result = node2; } else { result = name(name2) && !/^[a-z]/.test(name2) ? { type: "Identifier", name: name2 } : { type: "Literal", value: name2 }; } if (result.type === "Literal") { const name3 = ( /** @type {string | number} */ result.value ); return own.call(state.components, name3) ? state.components[name3] : name3; } if (state.evaluater) { return state.evaluater.evaluateExpression(result); } crashEstree(state); } function crashEstree(state, place) { const message = new VFileMessage( "Cannot handle MDX estrees without `createEvaluater`", { ancestors: state.ancestors, place, ruleId: "mdx-estree", source: "hast-util-to-jsx-runtime" } ); message.file = state.filePath || void 0; message.url = docs + "#cannot-handle-mdx-estrees-without-createevaluater"; throw message; } function transformStylesToCssCasing(domCasing) { const cssCasing = {}; let from; for (from in domCasing) { if (own.call(domCasing, from)) { cssCasing[transformStyleToCssCasing(from)] = domCasing[from]; } } return cssCasing; } function transformStyleToCssCasing(from) { let to = from.replace(cap2, toDash); if (to.slice(0, 3) === "ms-") to = "-" + to; return to; } function toDash($0) { return "-" + $0.toLowerCase(); } // node_modules/html-url-attributes/lib/index.js var urlAttributes = { action: ["form"], cite: ["blockquote", "del", "ins", "q"], data: ["object"], formAction: ["button", "input"], href: ["a", "area", "base", "link"], icon: ["menuitem"], itemId: null, manifest: ["html"], ping: ["a", "area"], poster: ["video"], src: [ "audio", "embed", "iframe", "img", "input", "script", "source", "track", "video" ] }; // node_modules/react-markdown/lib/index.js var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var import_react = __toESM(require_react(), 1); // node_modules/mdast-util-to-string/lib/index.js var emptyOptions2 = {}; function toString(value, options) { const settings = options || emptyOptions2; const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true; const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true; return one2(value, includeImageAlt, includeHtml); } function one2(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(values2, includeImageAlt, includeHtml) { const result = []; let index2 = -1; while (++index2 < values2.length) { result[index2] = one2(values2[index2], includeImageAlt, includeHtml); } return result.join(""); } function node(value) { return Boolean(value && typeof value === "object"); } // node_modules/decode-named-character-reference/index.dom.js var element2 = document.createElement("i"); function decodeNamedCharacterReference(value) { const characterReference2 = "&" + value + ";"; element2.innerHTML = characterReference2; const character = element2.textContent; if ( // @ts-expect-error: TypeScript is wrong that `textContent` on elements can // yield `null`. character.charCodeAt(character.length - 1) === 59 && value !== "semi" ) { return false; } return character === characterReference2 ? false : character; } // node_modules/micromark-util-symbol/lib/codes.js var codes = ( /** @type {const} */ { carriageReturn: -5, lineFeed: -4, carriageReturnLineFeed: -3, horizontalTab: -2, virtualSpace: -1, eof: null, nul: 0, soh: 1, stx: 2, etx: 3, eot: 4, enq: 5, ack: 6, bel: 7, bs: 8, ht: 9, // `\t` lf: 10, // `\n` vt: 11, // `\v` ff: 12, // `\f` cr: 13, // `\r` so: 14, si: 15, dle: 16, dc1: 17, dc2: 18, dc3: 19, dc4: 20, nak: 21, syn: 22, etb: 23, can: 24, em: 25, sub: 26, esc: 27, fs: 28, gs: 29, rs: 30, us: 31, space: 32, exclamationMark: 33, // `!` quotationMark: 34, // `"` numberSign: 35, // `#` dollarSign: 36, // `$` percentSign: 37, // `%` ampersand: 38, // `&` apostrophe: 39, // `'` leftParenthesis: 40, // `(` rightParenthesis: 41, // `)` asterisk: 42, // `*` plusSign: 43, // `+` comma: 44, // `,` dash: 45, // `-` dot: 46, // `.` slash: 47, // `/` digit0: 48, // `0` digit1: 49, // `1` digit2: 50, // `2` digit3: 51, // `3` digit4: 52, // `4` digit5: 53, // `5` digit6: 54, // `6` digit7: 55, // `7` digit8: 56, // `8` digit9: 57, // `9` colon: 58, // `:` semicolon: 59, // `;` lessThan: 60, // `<` equalsTo: 61, // `=` greaterThan: 62, // `>` questionMark: 63, // `?` atSign: 64, // `@` uppercaseA: 65, // `A` uppercaseB: 66, // `B` uppercaseC: 67, // `C` uppercaseD: 68, // `D` uppercaseE: 69, // `E` uppercaseF: 70, // `F` uppercaseG: 71, // `G` uppercaseH: 72, // `H` uppercaseI: 73, // `I` uppercaseJ: 74, // `J` uppercaseK: 75, // `K` uppercaseL: 76, // `L` uppercaseM: 77, // `M` uppercaseN: 78, // `N` uppercaseO: 79, // `O` uppercaseP: 80, // `P` uppercaseQ: 81, // `Q` uppercaseR: 82, // `R` uppercaseS: 83, // `S` uppercaseT: 84, // `T` uppercaseU: 85, // `U` uppercaseV: 86, // `V` uppercaseW: 87, // `W` uppercaseX: 88, // `X` uppercaseY: 89, // `Y` uppercaseZ: 90, // `Z` leftSquareBracket: 91, // `[` backslash: 92, // `\` rightSquareBracket: 93, // `]` caret: 94, // `^` underscore: 95, // `_` graveAccent: 96, // `` ` `` lowercaseA: 97, // `a` lowercaseB: 98, // `b` lowercaseC: 99, // `c` lowercaseD: 100, // `d` lowercaseE: 101, // `e` lowercaseF: 102, // `f` lowercaseG: 103, // `g` lowercaseH: 104, // `h` lowercaseI: 105, // `i` lowercaseJ: 106, // `j` lowercaseK: 107, // `k` lowercaseL: 108, // `l` lowercaseM: 109, // `m` lowercaseN: 110, // `n` lowercaseO: 111, // `o` lowercaseP: 112, // `p` lowercaseQ: 113, // `q` lowercaseR: 114, // `r` lowercaseS: 115, // `s` lowercaseT: 116, // `t` lowercaseU: 117, // `u` lowercaseV: 118, // `v` lowercaseW: 119, // `w` lowercaseX: 120, // `x` lowercaseY: 121, // `y` lowercaseZ: 122, // `z` leftCurlyBrace: 123, // `{` verticalBar: 124, // `|` rightCurlyBrace: 125, // `}` tilde: 126, // `~` del: 127, // Unicode Specials block. byteOrderMarker: 65279, // Unicode Specials block. replacementCharacter: 65533 // `�` } ); // node_modules/micromark-util-symbol/lib/constants.js var constants = ( /** @type {const} */ { attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*` attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a` atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t. autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many. autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many. cdataOpeningString: "CDATA[", // And preceded by `` htmlComment: 2, // Symbol for `` htmlComplete: 7, // Symbol for `` htmlDeclaration: 4, // Symbol for `` htmlInstruction: 3, // Symbol for `` htmlRawSizeMax: 8, // Length of `textarea`. htmlRaw: 1, // Symbol for `