UNPKG

@kaiachain/kaia-chat-ui

Version:

A customizable chat UI component for by Kaia

1,827 lines (1,825 loc) 239 kB
import ct, { useState as Pe, useRef as Lt, useEffect as Cn } from "react"; function Sr(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var Sn = { exports: {} }, sn = {}; /** * @license React * react-jsx-runtime.production.min.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. */ var Ot; function gi() { if (Ot) return sn; Ot = 1; var e = ct, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 }; function o(a, c, u) { var s, f = {}, g = null, p = null; u !== void 0 && (g = "" + u), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (p = c.ref); for (s in c) r.call(c, s) && !l.hasOwnProperty(s) && (f[s] = c[s]); if (a && a.defaultProps) for (s in c = a.defaultProps, c) f[s] === void 0 && (f[s] = c[s]); return { $$typeof: n, type: a, key: g, ref: p, props: f, _owner: i.current }; } return sn.Fragment = t, sn.jsx = o, sn.jsxs = o, sn; } var cn = {}, Dt; function yi() { if (Dt) return cn; Dt = 1; var e = {}; /** * @license React * react-jsx-runtime.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 e.NODE_ENV !== "production" && function() { var n = ct, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), w = Symbol.iterator, O = "@@iterator"; function k(h) { if (h === null || typeof h != "object") return null; var b = w && h[w] || h[O]; return typeof b == "function" ? b : null; } var P = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function E(h) { { for (var b = arguments.length, T = new Array(b > 1 ? b - 1 : 0), F = 1; F < b; F++) T[F - 1] = arguments[F]; $("error", h, T); } } function $(h, b, T) { { var F = P.ReactDebugCurrentFrame, K = F.getStackAddendum(); K !== "" && (b += "%s", T = T.concat([K])); var Q = T.map(function(W) { return String(W); }); Q.unshift("Warning: " + b), Function.prototype.apply.call(console[h], console, Q); } } var Z = !1, x = !1, V = !1, Y = !1, B = !1, H; H = Symbol.for("react.module.reference"); function R(h) { return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || B || h === l || h === s || h === f || Y || h === S || Z || x || V || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === g || h.$$typeof === a || h.$$typeof === c || h.$$typeof === u || // 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. h.$$typeof === H || h.getModuleId !== void 0)); } function A(h, b, T) { var F = h.displayName; if (F) return F; var K = b.displayName || b.name || ""; return K !== "" ? T + "(" + K + ")" : T; } function _(h) { return h.displayName || "Context"; } function I(h) { if (h == null) return null; if (typeof h.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function") return h.displayName || h.name || null; if (typeof h == "string") return h; switch (h) { case i: return "Fragment"; case r: return "Portal"; case o: return "Profiler"; case l: return "StrictMode"; case s: return "Suspense"; case f: return "SuspenseList"; } if (typeof h == "object") switch (h.$$typeof) { case c: var b = h; return _(b) + ".Consumer"; case a: var T = h; return _(T._context) + ".Provider"; case u: return A(h, h.render, "ForwardRef"); case g: var F = h.displayName || null; return F !== null ? F : I(h.type) || "Memo"; case p: { var K = h, Q = K._payload, W = K._init; try { return I(W(Q)); } catch { return null; } } } return null; } var L = Object.assign, G = 0, te, ue, ye, d, ce, xe, m; function fe() { } fe.__reactDisabledLog = !0; function Re() { { if (G === 0) { te = console.log, ue = console.info, ye = console.warn, d = console.error, ce = console.group, xe = console.groupCollapsed, m = console.groupEnd; var h = { configurable: !0, enumerable: !0, value: fe, writable: !0 }; Object.defineProperties(console, { info: h, log: h, warn: h, error: h, group: h, groupCollapsed: h, groupEnd: h }); } G++; } } function ie() { { if (G--, G === 0) { var h = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: L({}, h, { value: te }), info: L({}, h, { value: ue }), warn: L({}, h, { value: ye }), error: L({}, h, { value: d }), group: L({}, h, { value: ce }), groupCollapsed: L({}, h, { value: xe }), groupEnd: L({}, h, { value: m }) }); } G < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var ve = P.ReactCurrentDispatcher, he; function M(h, b, T) { { if (he === void 0) try { throw Error(); } catch (K) { var F = K.stack.trim().match(/\n( *(at )?)/); he = F && F[1] || ""; } return ` ` + he + h; } } var re = !1, de; { var Oe = typeof WeakMap == "function" ? WeakMap : Map; de = new Oe(); } function De(h, b) { if (!h || re) return ""; { var T = de.get(h); if (T !== void 0) return T; } var F; re = !0; var K = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var Q; Q = ve.current, ve.current = null, Re(); try { if (b) { var W = function() { throw Error(); }; if (Object.defineProperty(W.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(W, []); } catch (be) { F = be; } Reflect.construct(h, [], W); } else { try { W.call(); } catch (be) { F = be; } h.call(W.prototype); } } else { try { throw Error(); } catch (be) { F = be; } h(); } } catch (be) { if (be && F && typeof be.stack == "string") { for (var q = be.stack.split(` `), ge = F.stack.split(` `), le = q.length - 1, oe = ge.length - 1; le >= 1 && oe >= 0 && q[le] !== ge[oe]; ) oe--; for (; le >= 1 && oe >= 0; le--, oe--) if (q[le] !== ge[oe]) { if (le !== 1 || oe !== 1) do if (le--, oe--, oe < 0 || q[le] !== ge[oe]) { var Te = ` ` + q[le].replace(" at new ", " at "); return h.displayName && Te.includes("<anonymous>") && (Te = Te.replace("<anonymous>", h.displayName)), typeof h == "function" && de.set(h, Te), Te; } while (le >= 1 && oe >= 0); break; } } } finally { re = !1, ve.current = Q, ie(), Error.prepareStackTrace = K; } var Qe = h ? h.displayName || h.name : "", Xe = Qe ? M(Qe) : ""; return typeof h == "function" && de.set(h, Xe), Xe; } function Je(h, b, T) { return De(h, !1); } function Ke(h) { var b = h.prototype; return !!(b && b.isReactComponent); } function qe(h, b, T) { if (h == null) return ""; if (typeof h == "function") return De(h, Ke(h)); if (typeof h == "string") return M(h); switch (h) { case s: return M("Suspense"); case f: return M("SuspenseList"); } if (typeof h == "object") switch (h.$$typeof) { case u: return Je(h.render); case g: return qe(h.type, b, T); case p: { var F = h, K = F._payload, Q = F._init; try { return qe(Q(K), b, T); } catch { } } } return ""; } var je = Object.prototype.hasOwnProperty, wn = {}, an = P.ReactDebugCurrentFrame; function $e(h) { if (h) { var b = h._owner, T = qe(h.type, h._source, b ? b.type : null); an.setExtraStackFrame(T); } else an.setExtraStackFrame(null); } function On(h, b, T, F, K) { { var Q = Function.call.bind(je); for (var W in h) if (Q(h, W)) { var q = void 0; try { if (typeof h[W] != "function") { var ge = Error((F || "React class") + ": " + T + " type `" + W + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[W] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw ge.name = "Invariant Violation", ge; } q = h[W](b, W, F, T, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (le) { q = le; } q && !(q instanceof Error) && ($e(K), E("%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).", F || "React class", T, W, typeof q), $e(null)), q instanceof Error && !(q.message in wn) && (wn[q.message] = !0, $e(K), E("Failed %s type: %s", T, q.message), $e(null)); } } } var Dn = Array.isArray; function un(h) { return Dn(h); } function zn(h) { { var b = typeof Symbol == "function" && Symbol.toStringTag, T = b && h[Symbol.toStringTag] || h.constructor.name || "Object"; return T; } } function Fn(h) { try { return y(h), !1; } catch { return !0; } } function y(h) { return "" + h; } function v(h) { if (Fn(h)) return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", zn(h)), y(h); } var z = P.ReactCurrentOwner, U = { key: !0, ref: !0, __self: !0, __source: !0 }, J, ke; function Ne(h) { if (je.call(h, "ref")) { var b = Object.getOwnPropertyDescriptor(h, "ref").get; if (b && b.isReactWarning) return !1; } return h.ref !== void 0; } function Ae(h) { if (je.call(h, "key")) { var b = Object.getOwnPropertyDescriptor(h, "key").get; if (b && b.isReactWarning) return !1; } return h.key !== void 0; } function We(h, b) { typeof h.ref == "string" && z.current; } function Ye(h, b) { { var T = function() { J || (J = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b)); }; T.isReactWarning = !0, Object.defineProperty(h, "key", { get: T, configurable: !0 }); } } function me(h, b) { { var T = function() { ke || (ke = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b)); }; T.isReactWarning = !0, Object.defineProperty(h, "ref", { get: T, configurable: !0 }); } } var Be = function(h, b, T, F, K, Q, W) { var q = { // This tag allows us to uniquely identify this as a React Element $$typeof: t, // Built-in properties that belong on the element type: h, key: b, ref: T, props: W, // Record the component responsible for creating this element. _owner: Q }; return q._store = {}, Object.defineProperty(q._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(q, "_self", { configurable: !1, enumerable: !1, writable: !1, value: F }), Object.defineProperty(q, "_source", { configurable: !1, enumerable: !1, writable: !1, value: K }), Object.freeze && (Object.freeze(q.props), Object.freeze(q)), q; }; function Le(h, b, T, F, K) { { var Q, W = {}, q = null, ge = null; T !== void 0 && (v(T), q = "" + T), Ae(b) && (v(b.key), q = "" + b.key), Ne(b) && (ge = b.ref, We(b, K)); for (Q in b) je.call(b, Q) && !U.hasOwnProperty(Q) && (W[Q] = b[Q]); if (h && h.defaultProps) { var le = h.defaultProps; for (Q in le) W[Q] === void 0 && (W[Q] = le[Q]); } if (q || ge) { var oe = typeof h == "function" ? h.displayName || h.name || "Unknown" : h; q && Ye(W, oe), ge && me(W, oe); } return Be(h, q, ge, K, F, z.current, W); } } var Mn = P.ReactCurrentOwner, Et = P.ReactDebugCurrentFrame; function Ge(h) { if (h) { var b = h._owner, T = qe(h.type, h._source, b ? b.type : null); Et.setExtraStackFrame(T); } else Et.setExtraStackFrame(null); } var Nn; Nn = !1; function jn(h) { return typeof h == "object" && h !== null && h.$$typeof === t; } function It() { { if (Mn.current) { var h = I(Mn.current.type); if (h) return ` Check the render method of \`` + h + "`."; } return ""; } } function oi(h) { return ""; } var Tt = {}; function ai(h) { { var b = It(); if (!b) { var T = typeof h == "string" ? h : h.displayName || h.name; T && (b = ` Check the top-level render call using <` + T + ">."); } return b; } } function Pt(h, b) { { if (!h._store || h._store.validated || h.key != null) return; h._store.validated = !0; var T = ai(b); if (Tt[T]) return; Tt[T] = !0; var F = ""; h && h._owner && h._owner !== Mn.current && (F = " It was passed a child from " + I(h._owner.type) + "."), Ge(h), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, F), Ge(null); } } function _t(h, b) { { if (typeof h != "object") return; if (un(h)) for (var T = 0; T < h.length; T++) { var F = h[T]; jn(F) && Pt(F, b); } else if (jn(h)) h._store && (h._store.validated = !0); else if (h) { var K = k(h); if (typeof K == "function" && K !== h.entries) for (var Q = K.call(h), W; !(W = Q.next()).done; ) jn(W.value) && Pt(W.value, b); } } } function ui(h) { { var b = h.type; if (b == null || typeof b == "string") return; var T; if (typeof b == "function") T = b.propTypes; else if (typeof b == "object" && (b.$$typeof === u || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. b.$$typeof === g)) T = b.propTypes; else return; if (T) { var F = I(b); On(T, h.props, "prop", F, h); } else if (b.PropTypes !== void 0 && !Nn) { Nn = !0; var K = I(b); E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", K || "Unknown"); } typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function si(h) { { for (var b = Object.keys(h.props), T = 0; T < b.length; T++) { var F = b[T]; if (F !== "children" && F !== "key") { Ge(h), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", F), Ge(null); break; } } h.ref !== null && (Ge(h), E("Invalid attribute `ref` supplied to `React.Fragment`."), Ge(null)); } } var Rt = {}; function At(h, b, T, F, K, Q) { { var W = R(h); if (!W) { var q = ""; (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (q += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var ge = oi(); ge ? q += ge : q += It(); var le; h === null ? le = "null" : un(h) ? le = "array" : h !== void 0 && h.$$typeof === t ? (le = "<" + (I(h.type) || "Unknown") + " />", q = " Did you accidentally export a JSX literal instead of a component?") : le = typeof h, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", le, q); } var oe = Le(h, b, T, K, Q); if (oe == null) return oe; if (W) { var Te = b.children; if (Te !== void 0) if (F) if (un(Te)) { for (var Qe = 0; Qe < Te.length; Qe++) _t(Te[Qe], h); Object.freeze && Object.freeze(Te); } else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else _t(Te, h); } if (je.call(b, "key")) { var Xe = I(h), be = Object.keys(b).filter(function(mi) { return mi !== "key"; }), Bn = be.length > 0 ? "{key: someKey, " + be.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!Rt[Xe + Bn]) { var di = be.length > 0 ? "{" + be.join(": ..., ") + ": ...}" : "{}"; E(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, Bn, Xe, di, Xe), Rt[Xe + Bn] = !0; } } return h === i ? si(oe) : ui(oe), oe; } } function ci(h, b, T) { return At(h, b, T, !0); } function fi(h, b, T) { return At(h, b, T, !1); } var pi = fi, hi = ci; cn.Fragment = i, cn.jsx = pi, cn.jsxs = hi; }(), cn; } var zt; function xi() { if (zt) return Sn.exports; zt = 1; var e = {}; return e.NODE_ENV === "production" ? Sn.exports = gi() : Sn.exports = yi(), Sn.exports; } var j = xi(); const se = []; for (let e = 0; e < 256; ++e) se.push((e + 256).toString(16).slice(1)); function ki(e, n = 0) { return (se[e[n + 0]] + se[e[n + 1]] + se[e[n + 2]] + se[e[n + 3]] + "-" + se[e[n + 4]] + se[e[n + 5]] + "-" + se[e[n + 6]] + se[e[n + 7]] + "-" + se[e[n + 8]] + se[e[n + 9]] + "-" + se[e[n + 10]] + se[e[n + 11]] + se[e[n + 12]] + se[e[n + 13]] + se[e[n + 14]] + se[e[n + 15]]).toLowerCase(); } let Vn; const bi = new Uint8Array(16); function wi() { if (!Vn) { if (typeof crypto > "u" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); Vn = crypto.getRandomValues.bind(crypto); } return Vn(bi); } const Ci = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ft = { randomUUID: Ci }; function Si(e, n, t) { var i; if (Ft.randomUUID && !e) return Ft.randomUUID(); e = e || {}; const r = e.random ?? ((i = e.rng) == null ? void 0 : i.call(e)) ?? wi(); if (r.length < 16) throw new Error("Random bytes length must be >= 16"); return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, ki(r); } function vi(e, n) { const t = {}; return (e[e.length - 1] === "" ? [...e, ""] : e).join( (t.padRight ? " " : "") + "," + (t.padLeft === !1 ? "" : " ") ).trim(); } const Ei = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, Ii = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, Ti = {}; function Mt(e, n) { return (Ti.jsx ? Ii : Ei).test(e); } const Pi = /[ \t\n\f\r]/g; function _i(e) { return typeof e == "object" ? e.type === "text" ? Nt(e.value) : !1 : Nt(e); } function Nt(e) { return e.replace(Pi, "") === ""; } class kn { /** * @param {SchemaType['property']} property * Property. * @param {SchemaType['normal']} normal * Normal. * @param {Space | undefined} [space] * Space. * @returns * Schema. */ constructor(n, t, r) { this.normal = t, this.property = n, r && (this.space = r); } } kn.prototype.normal = {}; kn.prototype.property = {}; kn.prototype.space = void 0; function vr(e, n) { const t = {}, r = {}; for (const i of e) Object.assign(t, i.property), Object.assign(r, i.normal); return new kn(t, r, n); } function nt(e) { return e.toLowerCase(); } class Se { /** * @param {string} property * Property. * @param {string} attribute * Attribute. * @returns * Info. */ constructor(n, t) { this.attribute = t, this.property = n; } } Se.prototype.attribute = ""; Se.prototype.booleanish = !1; Se.prototype.boolean = !1; Se.prototype.commaOrSpaceSeparated = !1; Se.prototype.commaSeparated = !1; Se.prototype.defined = !1; Se.prototype.mustUseProperty = !1; Se.prototype.number = !1; Se.prototype.overloadedBoolean = !1; Se.prototype.property = ""; Se.prototype.spaceSeparated = !1; Se.prototype.space = void 0; let Ri = 0; const N = Ze(), ae = Ze(), Er = Ze(), C = Ze(), ee = Ze(), tn = Ze(), Ee = Ze(); function Ze() { return 2 ** ++Ri; } const tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, boolean: N, booleanish: ae, commaOrSpaceSeparated: Ee, commaSeparated: tn, number: C, overloadedBoolean: Er, spaceSeparated: ee }, Symbol.toStringTag, { value: "Module" })), Un = ( /** @type {ReadonlyArray<keyof typeof types>} */ Object.keys(tt) ); class ft extends Se { /** * @constructor * @param {string} property * Property. * @param {string} attribute * Attribute. * @param {number | null | undefined} [mask] * Mask. * @param {Space | undefined} [space] * Space. * @returns * Info. */ constructor(n, t, r, i) { let l = -1; if (super(n, t), jt(this, "space", i), typeof r == "number") for (; ++l < Un.length; ) { const o = Un[l]; jt(this, Un[l], (r & tt[o]) === tt[o]); } } } ft.prototype.defined = !0; function jt(e, n, t) { t && (e[n] = t); } function ln(e) { const n = {}, t = {}; for (const [r, i] of Object.entries(e.properties)) { const l = new ft( r, e.transform(e.attributes || {}, r), i, e.space ); e.mustUseProperty && e.mustUseProperty.includes(r) && (l.mustUseProperty = !0), n[r] = l, t[nt(r)] = r, t[nt(l.attribute)] = r; } return new kn(n, t, e.space); } const Ir = ln({ properties: { ariaActiveDescendant: null, ariaAtomic: ae, ariaAutoComplete: null, ariaBusy: ae, ariaChecked: ae, ariaColCount: C, ariaColIndex: C, ariaColSpan: C, ariaControls: ee, ariaCurrent: null, ariaDescribedBy: ee, ariaDetails: null, ariaDisabled: ae, ariaDropEffect: ee, ariaErrorMessage: null, ariaExpanded: ae, ariaFlowTo: ee, ariaGrabbed: ae, ariaHasPopup: null, ariaHidden: ae, ariaInvalid: null, ariaKeyShortcuts: null, ariaLabel: null, ariaLabelledBy: ee, ariaLevel: C, ariaLive: null, ariaModal: ae, ariaMultiLine: ae, ariaMultiSelectable: ae, ariaOrientation: null, ariaOwns: ee, ariaPlaceholder: null, ariaPosInSet: C, ariaPressed: ae, ariaReadOnly: ae, ariaRelevant: null, ariaRequired: ae, ariaRoleDescription: ee, ariaRowCount: C, ariaRowIndex: C, ariaRowSpan: C, ariaSelected: ae, ariaSetSize: C, ariaSort: null, ariaValueMax: C, ariaValueMin: C, ariaValueNow: C, ariaValueText: null, role: null }, transform(e, n) { return n === "role" ? n : "aria-" + n.slice(4).toLowerCase(); } }); function Tr(e, n) { return n in e ? e[n] : n; } function Pr(e, n) { return Tr(e, n.toLowerCase()); } const Ai = ln({ attributes: { acceptcharset: "accept-charset", classname: "class", htmlfor: "for", httpequiv: "http-equiv" }, mustUseProperty: ["checked", "multiple", "muted", "selected"], properties: { // Standard Properties. abbr: null, accept: tn, acceptCharset: ee, accessKey: ee, action: null, allow: null, allowFullScreen: N, allowPaymentRequest: N, allowUserMedia: N, alt: null, as: null, async: N, autoCapitalize: null, autoComplete: ee, autoFocus: N, autoPlay: N, blocking: ee, capture: null, charSet: null, checked: N, cite: null, className: ee, cols: C, colSpan: null, content: null, contentEditable: ae, controls: N, controlsList: ee, coords: C | tn, crossOrigin: null, data: null, dateTime: null, decoding: null, default: N, defer: N, dir: null, dirName: null, disabled: N, download: Er, draggable: ae, encType: null, enterKeyHint: null, fetchPriority: null, form: null, formAction: null, formEncType: null, formMethod: null, formNoValidate: N, formTarget: null, headers: ee, height: C, hidden: N, high: C, href: null, hrefLang: null, htmlFor: ee, httpEquiv: ee, id: null, imageSizes: null, imageSrcSet: null, inert: N, inputMode: null, integrity: null, is: null, isMap: N, itemId: null, itemProp: ee, itemRef: ee, itemScope: N, itemType: ee, kind: null, label: null, lang: null, language: null, list: null, loading: null, loop: N, low: C, manifest: null, max: null, maxLength: C, media: null, method: null, min: null, minLength: C, multiple: N, muted: N, name: null, nonce: null, noModule: N, noValidate: N, 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: N, optimum: C, pattern: null, ping: ee, placeholder: null, playsInline: N, popover: null, popoverTarget: null, popoverTargetAction: null, poster: null, preload: null, readOnly: N, referrerPolicy: null, rel: ee, required: N, reversed: N, rows: C, rowSpan: C, sandbox: ee, scope: null, scoped: N, seamless: N, selected: N, shadowRootClonable: N, shadowRootDelegatesFocus: N, shadowRootMode: null, shape: null, size: C, sizes: null, slot: null, span: C, spellCheck: ae, src: null, srcDoc: null, srcLang: null, srcSet: null, start: C, step: null, style: null, tabIndex: C, target: null, title: null, translate: null, type: null, typeMustMatch: N, useMap: null, value: ae, width: C, 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: ee, // `<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: C, // `<table>`. Use CSS `border-width` instead, borderColor: null, // `<table>`. Use CSS `border-color` instead, bottomMargin: C, // `<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: N, // Lists. Use CSS to reduce space between items instead declare: N, // `<object>` event: null, // `<script>` face: null, // `<font>`. Use CSS instead frame: null, // `<table>` frameBorder: null, // `<iframe>`. Use CSS `border` instead hSpace: C, // `<img>` and `<object>` leftMargin: C, // `<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: C, // `<body>` marginWidth: C, // `<body>` noResize: N, // `<frame>` noHref: N, // `<area>`. Use no href instead of an explicit `nohref` noShade: N, // `<hr>`. Use background-color and height instead of borders noWrap: N, // `<td>` and `<th>` object: null, // `<applet>` profile: null, // `<head>` prompt: null, // `<isindex>` rev: null, // `<link>` rightMargin: C, // `<body>` rules: null, // `<table>` scheme: null, // `<meta>` scrolling: ae, // `<frame>`. Use overflow in the child context standby: null, // `<object>` summary: null, // `<table>` text: null, // `<body>`. Use CSS `color` instead topMargin: C, // `<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: C, // `<img>` and `<object>` // Non-standard Properties. allowTransparency: null, autoCorrect: null, autoSave: null, disablePictureInPicture: N, disableRemotePlayback: N, prefix: null, property: null, results: C, security: null, unselectable: null }, space: "html", transform: Pr }), Li = ln({ 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" }, properties: { about: Ee, accentHeight: C, accumulate: null, additive: null, alignmentBaseline: null, alphabetic: C, amplitude: C, arabicForm: null, ascent: C, attributeName: null, attributeType: null, azimuth: C, bandwidth: null, baselineShift: null, baseFrequency: null, baseProfile: null, bbox: null, begin: null, bias: C, by: null, calcMode: null, capHeight: C, className: ee, 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: C, diffuseConstant: C, direction: null, display: null, dur: null, divisor: C, dominantBaseline: null, download: N, dx: null, dy: null, edgeMode: null, editable: null, elevation: C, enableBackground: null, end: null, event: null, exponent: C, externalResourcesRequired: null, fill: null, fillOpacity: C, 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: tn, g2: tn, glyphName: tn, glyphOrientationHorizontal: null, glyphOrientationVertical: null, glyphRef: null, gradientTransform: null, gradientUnits: null, handler: null, hanging: C, hatchContentUnits: null, hatchUnits: null, height: null, href: null, hrefLang: null, horizAdvX: C, horizOriginX: C, horizOriginY: C, id: null, ideographic: C, imageRendering: null, initialVisibility: null, in: null, in2: null, intercept: C, k: C, k1: C, k2: C, k3: C, k4: C, kernelMatrix: Ee, 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: C, 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: C, 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: C, overlineThickness: C, paintOrder: null, panose1: null, path: null, pathLength: C, patternContentUnits: null, patternTransform: null, patternUnits: null, phase: null, ping: ee, pitch: null, playbackOrder: null, pointerEvents: null, points: null, pointsAtX: C, pointsAtY: C, pointsAtZ: C, preserveAlpha: null, preserveAspectRatio: null, primitiveUnits: null, propagate: null, property: Ee, r: null, radius: null, referrerPolicy: null, refX: null, refY: null, rel: Ee, rev: Ee, renderingIntent: null, repeatCount: null, repeatDur: null, requiredExtensions: Ee, requiredFeatures: Ee, requiredFonts: Ee, requiredFormats: Ee, 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: C, specularExponent: C, spreadMethod: null, spacing: null, startOffset: null, stdDeviation: null, stemh: null, stemv: null, stitchTiles: null, stopColor: null, stopOpacity: null, strikethroughPosition: C, strikethroughThickness: C, string: null, stroke: null, strokeDashArray: Ee, strokeDashOffset: null, strokeLineCap: null, strokeLineJoin: null, strokeMiterLimit: C, strokeOpacity: C, strokeWidth: null, style: null, surfaceScale: C, syncBehavior: null, syncBehaviorDefault: null, syncMaster: null, syncTolerance: null, syncToleranceDefault: null, systemLanguage: Ee, tabIndex: C, tableValues: null, target: null, targetX: C, targetY: C, textAnchor: null, textDecoration: null, textRendering: null, textLength: null, timelineBegin: null, title: null, transformBehavior: null, type: null, typeOf: Ee, to: null, transform: null, transformOrigin: null, u1: null, u2: null, underlinePosition: C, underlineThickness: C, unicode: null, unicodeBidi: null, unicodeRange: null, unitsPerEm: C, values: null, vAlphabetic: C, vMathematical: C, vectorEffect: null, vHanging: C, vIdeographic: C, version: null, vertAdvY: C, vertOriginX: C, vertOriginY: C, viewBox: null, viewTarget: null, visibility: null, width: null, widths: null, wordSpacing: null, writingMode: null, x: null, x1: null, x2: null, xChannelSelector: null, xHeight: C, y: null, y1: null, y2: null, yChannelSelector: null, z: null, zoomAndPan: null }, space: "svg", transform: Tr }), _r = ln({ properties: { xLinkActuate: null, xLinkArcRole: null, xLinkHref: null, xLinkRole: null, xLinkShow: null, xLinkTitle: null, xLinkType: null }, space: "xlink", transform(e, n) { return "xlink:" + n.slice(5).toLowerCase(); } }), Rr = ln({ attributes: { xmlnsxlink: "xmlns:xlink" }, properties: { xmlnsXLink: null, xmlns: null }, space: "xmlns", transform: Pr }), Ar = ln({ properties: { xmlBase: null, xmlLang: null, xmlSpace: null }, space: "xml", transform(e, n) { return "xml:" + n.slice(3).toLowerCase(); } }), Oi = { 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" }, Di = /[A-Z]/g, Bt = /-[a-z]/g, zi = /^data[-\w.:]+$/i; function Fi(e, n) { const t = nt(n); let r = n, i = Se; if (t in e.normal) return e.property[e.normal[t]]; if (t.length > 4 && t.slice(0, 4) === "data" && zi.test(n)) { if (n.charAt(4) === "-") { const l = n.slice(5).replace(Bt, Ni); r = "data" + l.charAt(0).toUpperCase