@rcb-plugins/markdown-renderer
Version:
A simple plugin for rendering markdown messages in React ChatBotify.
1,935 lines • 198 kB
JavaScript
import { useEffect as gr } from "react";
import { useFlow as yr, useMessages as xr, useSettings as kr, useChatHistory as br, useOnRcbEvent as Ue, RcbEvent as Ve } from "react-chatbotify";
import { jsxs as wr, jsx as ae, Fragment as Sr } from "react/jsx-runtime";
function Cr(e, n) {
const t = {};
return (e[e.length - 1] === "" ? [...e, ""] : e).join(
(t.padRight ? " " : "") + "," + (t.padLeft === !1 ? "" : " ")
).trim();
}
const Er = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, Ir = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, Ar = {};
function Hn(e, n) {
return (Ar.jsx ? Ir : Er).test(e);
}
const Tr = /[ \t\n\f\r]/g;
function Pr(e) {
return typeof e == "object" ? e.type === "text" ? Un(e.value) : !1 : Un(e);
}
function Un(e) {
return e.replace(Tr, "") === "";
}
class Be {
/**
* @constructor
* @param {Properties} property
* @param {Normal} normal
* @param {string} [space]
*/
constructor(n, t, r) {
this.property = n, this.normal = t, r && (this.space = r);
}
}
Be.prototype.property = {};
Be.prototype.normal = {};
Be.prototype.space = null;
function Et(e, n) {
const t = {}, r = {};
let i = -1;
for (; ++i < e.length; )
Object.assign(t, e[i].property), Object.assign(r, e[i].normal);
return new Be(t, r, n);
}
function hn(e) {
return e.toLowerCase();
}
class te {
/**
* @constructor
* @param {string} property
* @param {string} attribute
*/
constructor(n, t) {
this.property = n, this.attribute = t;
}
}
te.prototype.space = null;
te.prototype.boolean = !1;
te.prototype.booleanish = !1;
te.prototype.overloadedBoolean = !1;
te.prototype.number = !1;
te.prototype.commaSeparated = !1;
te.prototype.spaceSeparated = !1;
te.prototype.commaOrSpaceSeparated = !1;
te.prototype.mustUseProperty = !1;
te.prototype.defined = !1;
let zr = 0;
const O = be(), $ = be(), It = be(), k = be(), U = be(), Ae = be(), Z = be();
function be() {
return 2 ** ++zr;
}
const mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
boolean: O,
booleanish: $,
commaOrSpaceSeparated: Z,
commaSeparated: Ae,
number: k,
overloadedBoolean: It,
spaceSeparated: U
}, Symbol.toStringTag, { value: "Module" })), Ze = Object.keys(mn);
class Sn extends te {
/**
* @constructor
* @param {string} property
* @param {string} attribute
* @param {number|null} [mask]
* @param {string} [space]
*/
constructor(n, t, r, i) {
let l = -1;
if (super(n, t), Vn(this, "space", i), typeof r == "number")
for (; ++l < Ze.length; ) {
const o = Ze[l];
Vn(this, Ze[l], (r & mn[o]) === mn[o]);
}
}
}
Sn.prototype.defined = !0;
function Vn(e, n, t) {
t && (e[n] = t);
}
const Lr = {}.hasOwnProperty;
function Pe(e) {
const n = {}, t = {};
let r;
for (r in e.properties)
if (Lr.call(e.properties, r)) {
const i = e.properties[r], l = new Sn(
r,
e.transform(e.attributes || {}, r),
i,
e.space
);
e.mustUseProperty && e.mustUseProperty.includes(r) && (l.mustUseProperty = !0), n[r] = l, t[hn(r)] = r, t[hn(l.attribute)] = r;
}
return new Be(n, t, e.space);
}
const At = Pe({
space: "xlink",
transform(e, n) {
return "xlink:" + n.slice(5).toLowerCase();
},
properties: {
xLinkActuate: null,
xLinkArcRole: null,
xLinkHref: null,
xLinkRole: null,
xLinkShow: null,
xLinkTitle: null,
xLinkType: null
}
}), Tt = Pe({
space: "xml",
transform(e, n) {
return "xml:" + n.slice(3).toLowerCase();
},
properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
});
function Pt(e, n) {
return n in e ? e[n] : n;
}
function zt(e, n) {
return Pt(e, n.toLowerCase());
}
const Lt = Pe({
space: "xmlns",
attributes: { xmlnsxlink: "xmlns:xlink" },
transform: zt,
properties: { xmlns: null, xmlnsXLink: null }
}), vt = Pe({
transform(e, n) {
return n === "role" ? n : "aria-" + n.slice(4).toLowerCase();
},
properties: {
ariaActiveDescendant: null,
ariaAtomic: $,
ariaAutoComplete: null,
ariaBusy: $,
ariaChecked: $,
ariaColCount: k,
ariaColIndex: k,
ariaColSpan: k,
ariaControls: U,
ariaCurrent: null,
ariaDescribedBy: U,
ariaDetails: null,
ariaDisabled: $,
ariaDropEffect: U,
ariaErrorMessage: null,
ariaExpanded: $,
ariaFlowTo: U,
ariaGrabbed: $,
ariaHasPopup: null,
ariaHidden: $,
ariaInvalid: null,
ariaKeyShortcuts: null,
ariaLabel: null,
ariaLabelledBy: U,
ariaLevel: k,
ariaLive: null,
ariaModal: $,
ariaMultiLine: $,
ariaMultiSelectable: $,
ariaOrientation: null,
ariaOwns: U,
ariaPlaceholder: null,
ariaPosInSet: k,
ariaPressed: $,
ariaReadOnly: $,
ariaRelevant: null,
ariaRequired: $,
ariaRoleDescription: U,
ariaRowCount: k,
ariaRowIndex: k,
ariaRowSpan: k,
ariaSelected: $,
ariaSetSize: k,
ariaSort: null,
ariaValueMax: k,
ariaValueMin: k,
ariaValueNow: k,
ariaValueText: null,
role: null
}
}), vr = Pe({
space: "html",
attributes: {
acceptcharset: "accept-charset",
classname: "class",
htmlfor: "for",
httpequiv: "http-equiv"
},
transform: zt,
mustUseProperty: ["checked", "multiple", "muted", "selected"],
properties: {
// Standard Properties.
abbr: null,
accept: Ae,
acceptCharset: U,
accessKey: U,
action: null,
allow: null,
allowFullScreen: O,
allowPaymentRequest: O,
allowUserMedia: O,
alt: null,
as: null,
async: O,
autoCapitalize: null,
autoComplete: U,
autoFocus: O,
autoPlay: O,
blocking: U,
capture: null,
charSet: null,
checked: O,
cite: null,
className: U,
cols: k,
colSpan: null,
content: null,
contentEditable: $,
controls: O,
controlsList: U,
coords: k | Ae,
crossOrigin: null,
data: null,
dateTime: null,
decoding: null,
default: O,
defer: O,
dir: null,
dirName: null,
disabled: O,
download: It,
draggable: $,
encType: null,
enterKeyHint: null,
fetchPriority: null,
form: null,
formAction: null,
formEncType: null,
formMethod: null,
formNoValidate: O,
formTarget: null,
headers: U,
height: k,
hidden: O,
high: k,
href: null,
hrefLang: null,
htmlFor: U,
httpEquiv: U,
id: null,
imageSizes: null,
imageSrcSet: null,
inert: O,
inputMode: null,
integrity: null,
is: null,
isMap: O,
itemId: null,
itemProp: U,
itemRef: U,
itemScope: O,
itemType: U,
kind: null,
label: null,
lang: null,
language: null,
list: null,
loading: null,
loop: O,
low: k,
manifest: null,
max: null,
maxLength: k,
media: null,
method: null,
min: null,
minLength: k,
multiple: O,
muted: O,
name: null,
nonce: null,
noModule: O,
noValidate: O,
onAbort: null,
onAfterPrint: null,
onAuxClick: null,
onBeforeMatch: null,
onBeforePrint: null,
onBeforeToggle: null,
onBeforeUnload: null,
onBlur: null,
onCancel: null,
onCanPlay: null,
onCanPlayThrough: null,
onChange: null,
onClick: null,
onClose: null,
onContextLost: null,
onContextMenu: null,
onContextRestored: 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,
onScrollEnd: 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: O,
optimum: k,
pattern: null,
ping: U,
placeholder: null,
playsInline: O,
popover: null,
popoverTarget: null,
popoverTargetAction: null,
poster: null,
preload: null,
readOnly: O,
referrerPolicy: null,
rel: U,
required: O,
reversed: O,
rows: k,
rowSpan: k,
sandbox: U,
scope: null,
scoped: O,
seamless: O,
selected: O,
shadowRootClonable: O,
shadowRootDelegatesFocus: O,
shadowRootMode: null,
shape: null,
size: k,
sizes: null,
slot: null,
span: k,
spellCheck: $,
src: null,
srcDoc: null,
srcLang: null,
srcSet: null,
start: k,
step: null,
style: null,
tabIndex: k,
target: null,
title: null,
translate: null,
type: null,
typeMustMatch: O,
useMap: null,
value: $,
width: k,
wrap: null,
writingSuggestions: 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: U,
// `<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: k,
// `<table>`. Use CSS `border-width` instead,
borderColor: null,
// `<table>`. Use CSS `border-color` instead,
bottomMargin: k,
// `<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: O,
// Lists. Use CSS to reduce space between items instead
declare: O,
// `<object>`
event: null,
// `<script>`
face: null,
// `<font>`. Use CSS instead
frame: null,
// `<table>`
frameBorder: null,
// `<iframe>`. Use CSS `border` instead
hSpace: k,
// `<img>` and `<object>`
leftMargin: k,
// `<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: k,
// `<body>`
marginWidth: k,
// `<body>`
noResize: O,
// `<frame>`
noHref: O,
// `<area>`. Use no href instead of an explicit `nohref`
noShade: O,
// `<hr>`. Use background-color and height instead of borders
noWrap: O,
// `<td>` and `<th>`
object: null,
// `<applet>`
profile: null,
// `<head>`
prompt: null,
// `<isindex>`
rev: null,
// `<link>`
rightMargin: k,
// `<body>`
rules: null,
// `<table>`
scheme: null,
// `<meta>`
scrolling: $,
// `<frame>`. Use overflow in the child context
standby: null,
// `<object>`
summary: null,
// `<table>`
text: null,
// `<body>`. Use CSS `color` instead
topMargin: k,
// `<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: k,
// `<img>` and `<object>`
// Non-standard Properties.
allowTransparency: null,
autoCorrect: null,
autoSave: null,
disablePictureInPicture: O,
disableRemotePlayback: O,
prefix: null,
property: null,
results: k,
security: null,
unselectable: null
}
}), Dr = Pe({
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",
transformOrigin: "transform-origin",
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: Pt,
properties: {
about: Z,
accentHeight: k,
accumulate: null,
additive: null,
alignmentBaseline: null,
alphabetic: k,
amplitude: k,
arabicForm: null,
ascent: k,
attributeName: null,
attributeType: null,
azimuth: k,
bandwidth: null,
baselineShift: null,
baseFrequency: null,
baseProfile: null,
bbox: null,
begin: null,
bias: k,
by: null,
calcMode: null,
capHeight: k,
className: U,
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: k,
diffuseConstant: k,
direction: null,
display: null,
dur: null,
divisor: k,
dominantBaseline: null,
download: O,
dx: null,
dy: null,
edgeMode: null,
editable: null,
elevation: k,
enableBackground: null,
end: null,
event: null,
exponent: k,
externalResourcesRequired: null,
fill: null,
fillOpacity: k,
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: Ae,
g2: Ae,
glyphName: Ae,
glyphOrientationHorizontal: null,
glyphOrientationVertical: null,
glyphRef: null,
gradientTransform: null,
gradientUnits: null,
handler: null,
hanging: k,
hatchContentUnits: null,
hatchUnits: null,
height: null,
href: null,
hrefLang: null,
horizAdvX: k,
horizOriginX: k,
horizOriginY: k,
id: null,
ideographic: k,
imageRendering: null,
initialVisibility: null,
in: null,
in2: null,
intercept: k,
k,
k1: k,
k2: k,
k3: k,
k4: k,
kernelMatrix: Z,
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: k,
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: k,
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: k,
overlineThickness: k,
paintOrder: null,
panose1: null,
path: null,
pathLength: k,
patternContentUnits: null,
patternTransform: null,
patternUnits: null,
phase: null,
ping: U,
pitch: null,
playbackOrder: null,
pointerEvents: null,
points: null,
pointsAtX: k,
pointsAtY: k,
pointsAtZ: k,
preserveAlpha: null,
preserveAspectRatio: null,
primitiveUnits: null,
propagate: null,
property: Z,
r: null,
radius: null,
referrerPolicy: null,
refX: null,
refY: null,
rel: Z,
rev: Z,
renderingIntent: null,
repeatCount: null,
repeatDur: null,
requiredExtensions: Z,
requiredFeatures: Z,
requiredFonts: Z,
requiredFormats: Z,
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: k,
specularExponent: k,
spreadMethod: null,
spacing: null,
startOffset: null,
stdDeviation: null,
stemh: null,
stemv: null,
stitchTiles: null,
stopColor: null,
stopOpacity: null,
strikethroughPosition: k,
strikethroughThickness: k,
string: null,
stroke: null,
strokeDashArray: Z,
strokeDashOffset: null,
strokeLineCap: null,
strokeLineJoin: null,
strokeMiterLimit: k,
strokeOpacity: k,
strokeWidth: null,
style: null,
surfaceScale: k,
syncBehavior: null,
syncBehaviorDefault: null,
syncMaster: null,
syncTolerance: null,
syncToleranceDefault: null,
systemLanguage: Z,
tabIndex: k,
tableValues: null,
target: null,
targetX: k,
targetY: k,
textAnchor: null,
textDecoration: null,
textRendering: null,
textLength: null,
timelineBegin: null,
title: null,
transformBehavior: null,
type: null,
typeOf: Z,
to: null,
transform: null,
transformOrigin: null,
u1: null,
u2: null,
underlinePosition: k,
underlineThickness: k,
unicode: null,
unicodeBidi: null,
unicodeRange: null,
unitsPerEm: k,
values: null,
vAlphabetic: k,
vMathematical: k,
vectorEffect: null,
vHanging: k,
vIdeographic: k,
version: null,
vertAdvY: k,
vertOriginX: k,
vertOriginY: k,
viewBox: null,
viewTarget: null,
visibility: null,
width: null,
widths: null,
wordSpacing: null,
writingMode: null,
x: null,
x1: null,
x2: null,
xChannelSelector: null,
xHeight: k,
y: null,
y1: null,
y2: null,
yChannelSelector: null,
z: null,
zoomAndPan: null
}
}), Or = /^data[-\w.:]+$/i, qn = /-[a-z]/g, Rr = /[A-Z]/g;
function Fr(e, n) {
const t = hn(n);
let r = n, i = te;
if (t in e.normal)
return e.property[e.normal[t]];
if (t.length > 4 && t.slice(0, 4) === "data" && Or.test(n)) {
if (n.charAt(4) === "-") {
const l = n.slice(5).replace(qn, Mr);
r = "data" + l.charAt(0).toUpperCase() + l.slice(1);
} else {
const l = n.slice(4);
if (!qn.test(l)) {
let o = l.replace(Rr, Nr);
o.charAt(0) !== "-" && (o = "-" + o), n = "data" + o;
}
}
i = Sn;
}
return new i(r, n);
}
function Nr(e) {
return "-" + e.toLowerCase();
}
function Mr(e) {
return e.charAt(1).toUpperCase();
}
const _r = {
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"
}, Br = Et([Tt, At, Lt, vt, vr], "html"), Cn = Et([Tt, At, Lt, vt, Dr], "svg");
function jr(e) {
return e.join(" ").trim();
}
function Dt(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Ee = {}, en, $n;
function Hr() {
if ($n) return en;
$n = 1;
var e = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, n = /\n/g, t = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, i = /^:\s*/, l = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, o = /^[;\s]*/, a = /^\s+|\s+$/g, s = `
`, u = "/", c = "*", f = "", d = "comment", p = "declaration";
en = function(w, A) {
if (typeof w != "string")
throw new TypeError("First argument must be a string");
if (!w) return [];
A = A || {};
var x = 1, C = 1;
function E(P) {
var I = P.match(n);
I && (x += I.length);
var v = P.lastIndexOf(s);
C = ~v ? P.length - v : C + P.length;
}
function N() {
var P = { line: x, column: C };
return function(I) {
return I.position = new R(P), q(), I;
};
}
function R(P) {
this.start = P, this.end = { line: x, column: C }, this.source = A.source;
}
R.prototype.content = w;
function y(P) {
var I = new Error(
A.source + ":" + x + ":" + C + ": " + P
);
if (I.reason = P, I.filename = A.source, I.line = x, I.column = C, I.source = w, !A.silent) throw I;
}
function F(P) {
var I = P.exec(w);
if (I) {
var v = I[0];
return E(v), w = w.slice(v.length), I;
}
}
function q() {
F(t);
}
function B(P) {
var I;
for (P = P || []; I = j(); )
I !== !1 && P.push(I);
return P;
}
function j() {
var P = N();
if (!(u != w.charAt(0) || c != w.charAt(1))) {
for (var I = 2; f != w.charAt(I) && (c != w.charAt(I) || u != w.charAt(I + 1)); )
++I;
if (I += 2, f === w.charAt(I - 1))
return y("End of comment missing");
var v = w.slice(2, I - 2);
return C += 2, E(v), w = w.slice(I), C += 2, P({
type: d,
comment: v
});
}
}
function z() {
var P = N(), I = F(r);
if (I) {
if (j(), !F(i)) return y("property missing ':'");
var v = F(l), W = P({
type: p,
property: b(I[0].replace(e, f)),
value: v ? b(v[0].replace(e, f)) : f
});
return F(o), W;
}
}
function T() {
var P = [];
B(P);
for (var I; I = z(); )
I !== !1 && (P.push(I), B(P));
return P;
}
return q(), T();
};
function b(w) {
return w ? w.replace(a, f) : f;
}
return en;
}
var Wn;
function Ur() {
if (Wn) return Ee;
Wn = 1;
var e = Ee && Ee.__importDefault || function(r) {
return r && r.__esModule ? r : { default: r };
};
Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.default = t;
var n = e(Hr());
function t(r, i) {
var l = null;
if (!r || typeof r != "string")
return l;
var o = (0, n.default)(r), a = typeof i == "function";
return o.forEach(function(s) {
if (s.type === "declaration") {
var u = s.property, c = s.value;
a ? i(u, c, s) : c && (l = l || {}, l[u] = c);
}
}), l;
}
return Ee;
}
var Vr = Ur();
const Yn = /* @__PURE__ */ Dt(Vr), qr = Yn.default || Yn, Ot = Rt("end"), En = Rt("start");
function Rt(e) {
return n;
function n(t) {
const r = t && t.position && t.position[e] || {};
if (typeof r.line == "number" && r.line > 0 && typeof r.column == "number" && r.column > 0)
return {
line: r.line,
column: r.column,
offset: typeof r.offset == "number" && r.offset > -1 ? r.offset : void 0
};
}
}
function $r(e) {
const n = En(e), t = Ot(e);
if (n && t)
return { start: n, end: t };
}
function Fe(e) {
return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? Qn(e.position) : "start" in e || "end" in e ? Qn(e) : "line" in e || "column" in e ? dn(e) : "";
}
function dn(e) {
return Xn(e && e.line) + ":" + Xn(e && e.column);
}
function Qn(e) {
return dn(e && e.start) + "-" + dn(e && e.end);
}
function Xn(e) {
return e && typeof e == "number" ? e : 1;
}
class X extends Error {
/**
* Create a message for `reason`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {Options | null | undefined} [options]
* @returns
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns
* Instance of `VFileMessage`.
*/
// eslint-disable-next-line complexity
constructor(n, t, r) {
super(), typeof t == "string" && (r = t, t = void 0);
let i = "", l = {}, o = !1;
if (t && ("line" in t && "column" in t ? l = { place: t } : "start" in t && "end" in t ? l = { place: t } : "type" in t ? l = {
ancestors: [t],
place: t.position
} : l = { ...t }), typeof n == "string" ? i = n : !l.cause && n && (o = !0, i = n.message, l.cause = n), !l.ruleId && !l.source && typeof r == "string") {
const s = r.indexOf(":");
s === -1 ? l.ruleId = r : (l.source = r.slice(0, s), l.ruleId = r.slice(s + 1));
}
if (!l.place && l.ancestors && l.ancestors) {
const s = l.ancestors[l.ancestors.length - 1];
s && (l.place = s.position);
}
const a = l.place && "start" in l.place ? l.place.start : l.place;
this.ancestors = l.ancestors || void 0, this.cause = l.cause || void 0, this.column = a ? a.column : void 0, this.fatal = void 0, this.file, this.message = i, this.line = a ? a.line : void 0, this.name = Fe(l.place) || "1:1", this.place = l.place || void 0, this.reason = this.message, this.ruleId = l.ruleId || void 0, this.source = l.source || void 0, this.stack = o && l.cause && typeof l.cause.stack == "string" ? l.cause.stack : "", this.actual, this.expected, this.note, this.url;
}
}
X.prototype.file = "";
X.prototype.name = "";
X.prototype.reason = "";
X.prototype.message = "";
X.prototype.stack = "";
X.prototype.column = void 0;
X.prototype.line = void 0;
X.prototype.ancestors = void 0;
X.prototype.cause = void 0;
X.prototype.fatal = void 0;
X.prototype.place = void 0;
X.prototype.ruleId = void 0;
X.prototype.source = void 0;
const In = {}.hasOwnProperty, Wr = /* @__PURE__ */ new Map(), Yr = /[A-Z]/g, Qr = /-([a-z])/g, Xr = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), Kr = /* @__PURE__ */ new Set(["td", "th"]), Ft = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
function Gr(e, n) {
if (!n || n.Fragment === void 0)
throw new TypeError("Expected `Fragment` in options");
const t = n.filePath || void 0;
let r;
if (n.development) {
if (typeof n.jsxDEV != "function")
throw new TypeError(
"Expected `jsxDEV` in options when `development: true`"
);
r = li(t, n.jsxDEV);
} else {
if (typeof n.jsx != "function")
throw new TypeError("Expected `jsx` in production options");
if (typeof n.jsxs != "function")
throw new TypeError("Expected `jsxs` in production options");
r = ii(t, n.jsx, n.jsxs);
}
const i = {
Fragment: n.Fragment,
ancestors: [],
components: n.components || {},
create: r,
elementAttributeNameCase: n.elementAttributeNameCase || "react",
evaluater: n.createEvaluater ? n.createEvaluater() : void 0,
filePath: t,
ignoreInvalidStyle: n.ignoreInvalidStyle || !1,
passKeys: n.passKeys !== !1,
passNode: n.passNode || !1,
schema: n.space === "svg" ? Cn : Br,
stylePropertyNameCase: n.stylePropertyNameCase || "dom",
tableCellAlignToStyle: n.tableCellAlignToStyle !== !1
}, l = Nt(i, e, void 0);
return l && typeof l != "string" ? l : i.create(
e,
i.Fragment,
{ children: l || void 0 },
void 0
);
}
function Nt(e, n, t) {
if (n.type === "element")
return Jr(e, n, t);
if (n.type === "mdxFlowExpression" || n.type === "mdxTextExpression")
return Zr(e, n);
if (n.type === "mdxJsxFlowElement" || n.type === "mdxJsxTextElement")
return ni(e, n, t);
if (n.type === "mdxjsEsm")
return ei(e, n);
if (n.type === "root")
return ti(e, n, t);
if (n.type === "text")
return ri(e, n);
}
function Jr(e, n, t) {
const r = e.schema;
let i = r;
n.tagName.toLowerCase() === "svg" && r.space === "html" && (i = Cn, e.schema = i), e.ancestors.push(n);
const l = _t(e, n.tagName, !1), o = oi(e, n);
let a = Tn(e, n);
return Xr.has(n.tagName) && (a = a.filter(function(s) {
return typeof s == "string" ? !Pr(s) : !0;
})), Mt(e, o, l, n), An(o, a), e.ancestors.pop(), e.schema = r, e.create(n, l, o, t);
}
function Zr(e, n) {
if (n.data && n.data.estree && e.evaluater) {
const r = n.data.estree.body[0];
return r.type, /** @type {Child | undefined} */
e.evaluater.evaluateExpression(r.expression);
}
_e(e, n.position);
}
function ei(e, n) {
if (n.data && n.data.estree && e.evaluater)
return (
/** @type {Child | undefined} */
e.evaluater.evaluateProgram(n.data.estree)
);
_e(e, n.position);
}
function ni(e, n, t) {
const r = e.schema;
let i = r;
n.name === "svg" && r.space === "html" && (i = Cn, e.schema = i), e.ancestors.push(n);
const l = n.name === null ? e.Fragment : _t(e, n.name, !0), o = ai(e, n), a = Tn(e, n);
return Mt(e, o, l, n), An(o, a), e.ancestors.pop(), e.schema = r, e.create(n, l, o, t);
}
function ti(e, n, t) {
const r = {};
return An(r, Tn(e, n)), e.create(n, e.Fragment, r, t);
}
function ri(e, n) {
return n.value;
}
function Mt(e, n, t, r) {
typeof t != "string" && t !== e.Fragment && e.passNode && (n.node = r);
}
function An(e, n) {
if (n.length > 0) {
const t = n.length > 1 ? n : n[0];
t && (e.children = t);
}
}
function ii(e, n, t) {
return r;
function r(i, l, o, a) {
const u = Array.isArray(o.children) ? t : n;
return a ? u(l, o, a) : u(l, o);
}
}
function li(e, n) {
return t;
function t(r, i, l, o) {
const a = Array.isArray(l.children), s = En(r);
return n(
i,
l,
o,
a,
{
columnNumber: s ? s.column - 1 : void 0,
fileName: e,
lineNumber: s ? s.line : void 0
},
void 0
);
}
}
function oi(e, n) {
const t = {};
let r, i;
for (i in n.properties)
if (i !== "children" && In.call(n.properties, i)) {
const l = ui(e, i, n.properties[i]);
if (l) {
const [o, a] = l;
e.tableCellAlignToStyle && o === "align" && typeof a == "string" && Kr.has(n.tagName) ? r = a : t[o] = a;
}
}
if (r) {
const l = (
/** @type {Style} */
t.style || (t.style = {})
);
l[e.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = r;
}
return t;
}
function ai(e, n) {
const t = {};
for (const r of n.attributes)
if (r.type === "mdxJsxExpressionAttribute")
if (r.data && r.data.estree && e.evaluater) {
const l = r.data.estree.body[0];
l.type;
const o = l.expression;
o.type;
const a = o.properties[0];
a.type, Object.assign(
t,
e.evaluater.evaluateExpression(a.argument)
);
} else
_e(e, n.position);
else {
const i = r.name;
let l;
if (r.value && typeof r.value == "object")
if (r.value.data && r.value.data.estree && e.evaluater) {
const a = r.value.data.estree.body[0];
a.type, l = e.evaluater.evaluateExpression(a.expression);
} else
_e(e, n.position);
else
l = r.value === null ? !0 : r.value;
t[i] = /** @type {Props[keyof Props]} */
l;
}
return t;
}
function Tn(e, n) {
const t = [];
let r = -1;
const i = e.passKeys ? /* @__PURE__ */ new Map() : Wr;
for (; ++r < n.children.length; ) {
const l = n.children[r];
let o;
if (e.passKeys) {
const s = l.type === "element" ? l.tagName : l.type === "mdxJsxFlowElement" || l.type === "mdxJsxTextElement" ? l.name : void 0;
if (s) {
const u = i.get(s) || 0;
o = s + "-" + u, i.set(s, u + 1);
}
}
const a = Nt(e, l, o);
a !== void 0 && t.push(a);
}
return t;
}
function ui(e, n, t) {
const r = Fr(e.schema, n);
if (!(t == null || typeof t == "number" && Number.isNaN(t))) {
if (Array.isArray(t) && (t = r.commaSeparated ? Cr(t) : jr(t)), r.property === "style") {
let i = typeof t == "object" ? t : si(e, String(t));
return e.stylePropertyNameCase === "css" && (i = ci(i)), ["style", i];
}
return [
e.elementAttributeNameCase === "react" && r.space ? _r[r.property] || r.property : r.attribute,
t
];
}
}
function si(e, n) {
const t = {};
try {
qr(n, r);
} catch (i) {
if (!e.ignoreInvalidStyle) {
const l = (
/** @type {Error} */
i
), o = new X("Cannot parse `style` attribute", {
ancestors: e.ancestors,
cause: l,
ruleId: "style",
source: "hast-util-to-jsx-runtime"
});
throw o.file = e.filePath || void 0, o.url = Ft + "#cannot-parse-style-attribute", o;
}
}
return t;
function r(i, l) {
let o = i;
o.slice(0, 2) !== "--" && (o.slice(0, 4) === "-ms-" && (o = "ms-" + o.slice(4)), o = o.replace(Qr, fi)), t[o] = l;
}
}
function _t(e, n, t) {
let r;
if (!t)
r = { type: "Literal", value: n };
else if (n.includes(".")) {
const i = n.split(".");
let l = -1, o;
for (; ++l < i.length; ) {
const a = Hn(i[l]) ? { type: "Identifier", name: i[l] } : { type: "Literal", value: i[l] };
o = o ? {
type: "MemberExpression",
object: o,
property: a,
computed: !!(l && a.type === "Literal"),
optional: !1
} : a;
}
r = o;
} else
r = Hn(n) && !/^[a-z]/.test(n) ? { type: "Identifier", name: n } : { type: "Literal", value: n };
if (r.type === "Literal") {
const i = (
/** @type {keyof JSX.IntrinsicElements} */
r.value
);
return In.call(e.components, i) ? e.components[i] : i;
}
if (e.evaluater)
return e.evaluater.evaluateExpression(r);
_e(e);
}
function _e(e, n) {
const t = new X(
"Cannot handle MDX estrees without `createEvaluater`",
{
ancestors: e.ancestors,
place: n,
ruleId: "mdx-estree",
source: "hast-util-to-jsx-runtime"
}
);
throw t.file = e.filePath || void 0, t.url = Ft + "#cannot-handle-mdx-estrees-without-createevaluater", t;
}
function ci(e) {
const n = {};
let t;
for (t in e)
In.call(e, t) && (n[pi(t)] = e[t]);
return n;
}
function pi(e) {
let n = e.replace(Yr, hi);
return n.slice(0, 3) === "ms-" && (n = "-" + n), n;
}
function fi(e, n) {
return n.toUpperCase();
}
function hi(e) {
return "-" + e.toLowerCase();
}
const nn = {
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"
]
}, mi = {};
function di(e, n) {
const t = mi, r = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
return Bt(e, r, i);
}
function Bt(e, n, t) {
if (gi(e)) {
if ("value" in e)
return e.type === "html" && !t ? "" : e.value;
if (n && "alt" in e && e.alt)
return e.alt;
if ("children" in e)
return Kn(e.children, n, t);
}
return Array.isArray(e) ? Kn(e, n, t) : "";
}
function Kn(e, n, t) {
const r = [];
let i = -1;
for (; ++i < e.length; )
r[i] = Bt(e[i], n, t);
return r.join("");
}
function gi(e) {
return !!(e && typeof e == "object");
}
const Gn = document.createElement("i");
function Pn(e) {
const n = "&" + e + ";";
Gn.innerHTML = n;
const t = Gn.textContent;
return t.charCodeAt(t.length - 1) === 59 && e !== "semi" || t === n ? !1 : t;
}
function ce(e, n, t, r) {
const i = e.length;
let l = 0, o;
if (n < 0 ? n = -n > i ? 0 : i + n : n = n > i ? i : n, t = t > 0 ? t : 0, r.length < 1e4)
o = Array.from(r), o.unshift(n, t), e.splice(...o);
else
for (t && e.splice(n, t); l < r.length; )
o = r.slice(l, l + 1e4), o.unshift(n, 0), e.splice(...o), l += 1e4, n += 1e4;
}
function ne(e, n) {
return e.length > 0 ? (ce(e, e.length, 0, n), e) : n;
}
const Jn = {}.hasOwnProperty;
function yi(e) {
const n = {};
let t = -1;
for (; ++t < e.length; )
xi(n, e[t]);
return n;
}
function xi(e, n) {
let t;
for (t in n) {
const i = (Jn.call(e, t) ? e[t] : void 0) || (e[t] = {}), l = n[t];
let o;
if (l)
for (o in l) {
Jn.call(i, o) || (i[o] = []);
const a = l[o];
ki(
// @ts-expect-error Looks like a list.
i[o],
Array.isArray(a) ? a : a ? [a] : []
);
}
}
}
function ki(e, n) {
let t = -1;
const r = [];
for (; ++t < n.length; )
(n[t].add === "after" ? e : r).push(n[t]);
ce(e, 0, 0, r);
}
function jt(e, n) {
const t = Number.parseInt(e, n);
return (
// C0 except for HT, LF, FF, CR, space.
t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
t > 126 && t < 160 || // Lone high surrogates and low surrogates.
t > 55295 && t < 57344 || // Noncharacters.
t > 64975 && t < 65008 || /* eslint-disable no-bitwise */
(t & 65535) === 65535 || (t & 65535) === 65534 || /* eslint-enable no-bitwise */
// Out of range
t > 1114111 ? "�" : String.fromCodePoint(t)
);
}
function Te(e) {
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
}
const se = ye(/[A-Za-z]/), ee = ye(/[\dA-Za-z]/), bi = ye(/[#-'*+\--9=?A-Z^-~]/);
function gn(e) {
return (
// Special whitespace codes (which have negative values), C0 and Control
// character DEL
e !== null && (e < 32 || e === 127)
);
}
const yn = ye(/\d/), wi = ye(/[\dA-Fa-f]/), Si = ye(/[!-/:-@[-`{-~]/);
function L(e) {
return e !== null && e < -2;
}
function G(e) {
return e !== null && (e < 0 || e === 32);
}
function _(e) {
return e === -2 || e === -1 || e === 32;
}
const Ci = ye(new RegExp("\\p{P}|\\p{S}", "u")), Ei = ye(/\s/);
function ye(e) {
return n;
function n(t) {
return t !== null && t > -1 && e.test(String.fromCharCode(t));
}
}
function ze(e) {
const n = [];
let t = -1, r = 0, i = 0;
for (; ++t < e.length; ) {
const l = e.charCodeAt(t);
let o = "";
if (l === 37 && ee(e.charCodeAt(t + 1)) && ee(e.charCodeAt(t + 2)))
i = 2;
else if (l < 128)
/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l)) || (o = String.fromCharCode(l));
else if (l > 55295 && l < 57344) {
const a = e.charCodeAt(t + 1);
l < 56320 && a > 56319 && a < 57344 ? (o = String.fromCharCode(l, a), i = 1) : o = "�";
} else
o = String.fromCharCode(l);
o && (n.push(e.slice(r, t), encodeURIComponent(o)), r = t + i + 1, o = ""), i && (t += i, i = 0);
}
return n.join("") + e.slice(r);
}
function V(e, n, t, r) {
const i = r ? r - 1 : Number.POSITIVE_INFINITY;
let l = 0;
return o;
function o(s) {
return _(s) ? (e.enter(t), a(s)) : n(s);
}
function a(s) {
return _(s) && l++ < i ? (e.consume(s), a) : (e.exit(t), n(s));
}
}
const Ii = {
tokenize: Ai
};
function Ai(e) {
const n = e.attempt(this.parser.constructs.contentInitial, r, i);
let t;
return n;
function r(a) {
if (a === null) {
e.consume(a);
return;
}
return e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), V(e, n, "linePrefix");
}
function i(a) {
return e.enter("paragraph"), l(a);
}
function l(a) {
const s = e.enter("chunkText", {
contentType: "text",
previous: t
});
return t && (t.next = s), t = s, o(a);
}
function o(a) {
if (a === null) {
e.exit("chunkText"), e.exit("paragraph"), e.consume(a);
return;
}
return L(a) ? (e.consume(a), e.exit("chunkText"), l) : (e.consume(a), o);
}
}
const Ti = {
tokenize: Pi
}, Zn = {
tokenize: zi
};
function Pi(e) {
const n = this, t = [];
let r = 0, i, l, o;
return a;
function a(E) {
if (r < t.length) {
const N = t[r];
return n.containerState = N[1], e.attempt(N[0].continuation, s, u)(E);
}
return u(E);
}
function s(E) {
if (r++, n.containerState._closeFlow) {
n.containerState._closeFlow = void 0, i && C();
const N = n.events.length;
let R = N, y;
for (; R--; )
if (n.events[R][0] === "exit" && n.events[R][1].type === "chunkFlow") {
y = n.events[R][1].end;
break;
}
x(r);
let F = N;
for (; F < n.events.length; )
n.events[F][1].end