@dslate/antd
Version:
一个Antd Design风格的富文本编辑器 - A Antd Design style rich editor based on Slate
1,491 lines (1,485 loc) • 2.93 MB
JavaScript
import * as ei from "react";
import k, { forwardRef as Kg, useMemo as Kr, useState as W0, useCallback as k0, useImperativeHandle as fY, useContext as dt, useEffect as br, createElement as Cn, isValidElement as zY, PureComponent as BB, Component as oi, useRef as $i, useLayoutEffect as xY } from "react";
import { createEditor as jY, Text as Jr, Editor as we, Element as B0, Transforms as ne, Node as ss, Range as X0, Point as p1, Operation as Zo, Path as U0 } from "slate";
import { withReact as RY, Slate as HY, useSlate as At, DefaultElement as bY, Editable as JY, ReactEditor as sB, useSelected as ns, useFocused as SY } from "slate-react";
import d1 from "react-dom";
import { Button as kY, theme as D1, Divider as LY, Input as U1, Popover as vY, Tooltip as G1, Select as TY, Progress as WY, InputNumber as KY } from "antd";
function f1(A) {
return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
var qo = { exports: {} }, UB = {};
/**
* @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 Tw;
function VY() {
if (Tw)
return UB;
Tw = 1;
var A = k, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, B = { key: !0, ref: !0, __self: !0, __source: !0 };
function n(g, Q, I) {
var E, M = {}, u = null, G = null;
I !== void 0 && (u = "" + I), Q.key !== void 0 && (u = "" + Q.key), Q.ref !== void 0 && (G = Q.ref);
for (E in Q)
r.call(Q, E) && !B.hasOwnProperty(E) && (M[E] = Q[E]);
if (g && g.defaultProps)
for (E in Q = g.defaultProps, Q)
M[E] === void 0 && (M[E] = Q[E]);
return { $$typeof: e, type: g, key: u, ref: G, props: M, _owner: i.current };
}
return UB.Fragment = t, UB.jsx = n, UB.jsxs = n, UB;
}
var GB = {};
/**
* @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.
*/
var Ww;
function OY() {
return Ww || (Ww = 1, process.env.NODE_ENV !== "production" && function() {
var A = k, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), n = Symbol.for("react.provider"), g = Symbol.for("react.context"), Q = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), u = Symbol.for("react.lazy"), G = Symbol.for("react.offscreen"), p = Symbol.iterator, z = "@@iterator";
function m(w) {
if (w === null || typeof w != "object")
return null;
var f = p && w[p] || w[z];
return typeof f == "function" ? f : null;
}
var v = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function H(w) {
{
for (var f = arguments.length, S = new Array(f > 1 ? f - 1 : 0), sA = 1; sA < f; sA++)
S[sA - 1] = arguments[sA];
V("error", w, S);
}
}
function V(w, f, S) {
{
var sA = v.ReactDebugCurrentFrame, pA = sA.getStackAddendum();
pA !== "" && (f += "%s", S = S.concat([pA]));
var GA = S.map(function(yA) {
return String(yA);
});
GA.unshift("Warning: " + f), Function.prototype.apply.call(console[w], console, GA);
}
}
var Z = !1, b = !1, IA = !1, FA = !1, fA = !1, WA;
WA = Symbol.for("react.module.reference");
function mA(w) {
return !!(typeof w == "string" || typeof w == "function" || w === r || w === B || fA || w === i || w === I || w === E || FA || w === G || Z || b || IA || typeof w == "object" && w !== null && (w.$$typeof === u || w.$$typeof === M || w.$$typeof === n || w.$$typeof === g || w.$$typeof === Q || // 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.
w.$$typeof === WA || w.getModuleId !== void 0));
}
function NA(w, f, S) {
var sA = w.displayName;
if (sA)
return sA;
var pA = f.displayName || f.name || "";
return pA !== "" ? S + "(" + pA + ")" : S;
}
function UA(w) {
return w.displayName || "Context";
}
function dA(w) {
if (w == null)
return null;
if (typeof w.tag == "number" && H("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof w == "function")
return w.displayName || w.name || null;
if (typeof w == "string")
return w;
switch (w) {
case r:
return "Fragment";
case t:
return "Portal";
case B:
return "Profiler";
case i:
return "StrictMode";
case I:
return "Suspense";
case E:
return "SuspenseList";
}
if (typeof w == "object")
switch (w.$$typeof) {
case g:
var f = w;
return UA(f) + ".Consumer";
case n:
var S = w;
return UA(S._context) + ".Provider";
case Q:
return NA(w, w.render, "ForwardRef");
case M:
var sA = w.displayName || null;
return sA !== null ? sA : dA(w.type) || "Memo";
case u: {
var pA = w, GA = pA._payload, yA = pA._init;
try {
return dA(yA(GA));
} catch {
return null;
}
}
}
return null;
}
var lA = Object.assign, zA = 0, cA, nA, MA, HA, rA, EA, L;
function T() {
}
T.__reactDisabledLog = !0;
function W() {
{
if (zA === 0) {
cA = console.log, nA = console.info, MA = console.warn, HA = console.error, rA = console.group, EA = console.groupCollapsed, L = console.groupEnd;
var w = {
configurable: !0,
enumerable: !0,
value: T,
writable: !0
};
Object.defineProperties(console, {
info: w,
log: w,
warn: w,
error: w,
group: w,
groupCollapsed: w,
groupEnd: w
});
}
zA++;
}
}
function tA() {
{
if (zA--, zA === 0) {
var w = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: lA({}, w, {
value: cA
}),
info: lA({}, w, {
value: nA
}),
warn: lA({}, w, {
value: MA
}),
error: lA({}, w, {
value: HA
}),
group: lA({}, w, {
value: rA
}),
groupCollapsed: lA({}, w, {
value: EA
}),
groupEnd: lA({}, w, {
value: L
})
});
}
zA < 0 && H("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var d = v.ReactCurrentDispatcher, oA;
function O(w, f, S) {
{
if (oA === void 0)
try {
throw Error();
} catch (pA) {
var sA = pA.stack.trim().match(/\n( *(at )?)/);
oA = sA && sA[1] || "";
}
return `
` + oA + w;
}
}
var YA = !1, $;
{
var RA = typeof WeakMap == "function" ? WeakMap : Map;
$ = new RA();
}
function _(w, f) {
if (!w || YA)
return "";
{
var S = $.get(w);
if (S !== void 0)
return S;
}
var sA;
YA = !0;
var pA = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var GA;
GA = d.current, d.current = null, W();
try {
if (f) {
var yA = function() {
throw Error();
};
if (Object.defineProperty(yA.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(yA, []);
} catch (Fe) {
sA = Fe;
}
Reflect.construct(w, [], yA);
} else {
try {
yA.call();
} catch (Fe) {
sA = Fe;
}
w.call(yA.prototype);
}
} else {
try {
throw Error();
} catch (Fe) {
sA = Fe;
}
w();
}
} catch (Fe) {
if (Fe && sA && typeof Fe.stack == "string") {
for (var CA = Fe.stack.split(`
`), eA = sA.stack.split(`
`), jA = CA.length - 1, LA = eA.length - 1; jA >= 1 && LA >= 0 && CA[jA] !== eA[LA]; )
LA--;
for (; jA >= 1 && LA >= 0; jA--, LA--)
if (CA[jA] !== eA[LA]) {
if (jA !== 1 || LA !== 1)
do
if (jA--, LA--, LA < 0 || CA[jA] !== eA[LA]) {
var te = `
` + CA[jA].replace(" at new ", " at ");
return w.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", w.displayName)), typeof w == "function" && $.set(w, te), te;
}
while (jA >= 1 && LA >= 0);
break;
}
}
} finally {
YA = !1, d.current = GA, tA(), Error.prepareStackTrace = pA;
}
var Ve = w ? w.displayName || w.name : "", qt = Ve ? O(Ve) : "";
return typeof w == "function" && $.set(w, qt), qt;
}
function qA(w, f, S) {
return _(w, !1);
}
function aA(w) {
var f = w.prototype;
return !!(f && f.isReactComponent);
}
function xA(w, f, S) {
if (w == null)
return "";
if (typeof w == "function")
return _(w, aA(w));
if (typeof w == "string")
return O(w);
switch (w) {
case I:
return O("Suspense");
case E:
return O("SuspenseList");
}
if (typeof w == "object")
switch (w.$$typeof) {
case Q:
return qA(w.render);
case M:
return xA(w.type, f, S);
case u: {
var sA = w, pA = sA._payload, GA = sA._init;
try {
return xA(GA(pA), f, S);
} catch {
}
}
}
return "";
}
var ZA = Object.prototype.hasOwnProperty, vA = {}, Be = v.ReactDebugCurrentFrame;
function le(w) {
if (w) {
var f = w._owner, S = xA(w.type, w._source, f ? f.type : null);
Be.setExtraStackFrame(S);
} else
Be.setExtraStackFrame(null);
}
function ce(w, f, S, sA, pA) {
{
var GA = Function.call.bind(ZA);
for (var yA in w)
if (GA(w, yA)) {
var CA = void 0;
try {
if (typeof w[yA] != "function") {
var eA = Error((sA || "React class") + ": " + S + " type `" + yA + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof w[yA] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw eA.name = "Invariant Violation", eA;
}
CA = w[yA](f, yA, sA, S, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (jA) {
CA = jA;
}
CA && !(CA instanceof Error) && (le(pA), H("%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).", sA || "React class", S, yA, typeof CA), le(null)), CA instanceof Error && !(CA.message in vA) && (vA[CA.message] = !0, le(pA), H("Failed %s type: %s", S, CA.message), le(null));
}
}
}
var Ze = Array.isArray;
function Je(w) {
return Ze(w);
}
function ze(w) {
{
var f = typeof Symbol == "function" && Symbol.toStringTag, S = f && w[Symbol.toStringTag] || w.constructor.name || "Object";
return S;
}
}
function JA(w) {
try {
return se(w), !1;
} catch {
return !0;
}
}
function se(w) {
return "" + w;
}
function nt(w) {
if (JA(w))
return H("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(w)), se(w);
}
var oe = v.ReactCurrentOwner, l = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Y, D, K;
K = {};
function He(w) {
if (ZA.call(w, "ref")) {
var f = Object.getOwnPropertyDescriptor(w, "ref").get;
if (f && f.isReactWarning)
return !1;
}
return w.ref !== void 0;
}
function XA(w) {
if (ZA.call(w, "key")) {
var f = Object.getOwnPropertyDescriptor(w, "key").get;
if (f && f.isReactWarning)
return !1;
}
return w.key !== void 0;
}
function ie(w, f) {
if (typeof w.ref == "string" && oe.current && f && oe.current.stateNode !== f) {
var S = dA(oe.current.type);
K[S] || (H('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', dA(oe.current.type), w.ref), K[S] = !0);
}
}
function Xe(w, f) {
{
var S = function() {
Y || (Y = !0, H("%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)", f));
};
S.isReactWarning = !0, Object.defineProperty(w, "key", {
get: S,
configurable: !0
});
}
}
function X(w, f) {
{
var S = function() {
D || (D = !0, H("%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)", f));
};
S.isReactWarning = !0, Object.defineProperty(w, "ref", {
get: S,
configurable: !0
});
}
}
var iA = function(w, f, S, sA, pA, GA, yA) {
var CA = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: e,
// Built-in properties that belong on the element
type: w,
key: f,
ref: S,
props: yA,
// Record the component responsible for creating this element.
_owner: GA
};
return CA._store = {}, Object.defineProperty(CA._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(CA, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: sA
}), Object.defineProperty(CA, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: pA
}), Object.freeze && (Object.freeze(CA.props), Object.freeze(CA)), CA;
};
function z0(w, f, S, sA, pA) {
{
var GA, yA = {}, CA = null, eA = null;
S !== void 0 && (nt(S), CA = "" + S), XA(f) && (nt(f.key), CA = "" + f.key), He(f) && (eA = f.ref, ie(f, pA));
for (GA in f)
ZA.call(f, GA) && !l.hasOwnProperty(GA) && (yA[GA] = f[GA]);
if (w && w.defaultProps) {
var jA = w.defaultProps;
for (GA in jA)
yA[GA] === void 0 && (yA[GA] = jA[GA]);
}
if (CA || eA) {
var LA = typeof w == "function" ? w.displayName || w.name || "Unknown" : w;
CA && Xe(yA, LA), eA && X(yA, LA);
}
return iA(w, CA, eA, pA, sA, oe.current, yA);
}
}
var yt = v.ReactCurrentOwner, Wt = v.ReactDebugCurrentFrame;
function Se(w) {
if (w) {
var f = w._owner, S = xA(w.type, w._source, f ? f.type : null);
Wt.setExtraStackFrame(S);
} else
Wt.setExtraStackFrame(null);
}
var Dt;
Dt = !1;
function Ct(w) {
return typeof w == "object" && w !== null && w.$$typeof === e;
}
function St() {
{
if (yt.current) {
var w = dA(yt.current.type);
if (w)
return `
Check the render method of \`` + w + "`.";
}
return "";
}
}
function o0(w) {
{
if (w !== void 0) {
var f = w.fileName.replace(/^.*[\\\/]/, ""), S = w.lineNumber;
return `
Check your code at ` + f + ":" + S + ".";
}
return "";
}
}
var Ye = {};
function It(w) {
{
var f = St();
if (!f) {
var S = typeof w == "string" ? w : w.displayName || w.name;
S && (f = `
Check the top-level render call using <` + S + ">.");
}
return f;
}
}
function be(w, f) {
{
if (!w._store || w._store.validated || w.key != null)
return;
w._store.validated = !0;
var S = It(f);
if (Ye[S])
return;
Ye[S] = !0;
var sA = "";
w && w._owner && w._owner !== yt.current && (sA = " It was passed a child from " + dA(w._owner.type) + "."), Se(w), H('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S, sA), Se(null);
}
}
function ut(w, f) {
{
if (typeof w != "object")
return;
if (Je(w))
for (var S = 0; S < w.length; S++) {
var sA = w[S];
Ct(sA) && be(sA, f);
}
else if (Ct(w))
w._store && (w._store.validated = !0);
else if (w) {
var pA = m(w);
if (typeof pA == "function" && pA !== w.entries)
for (var GA = pA.call(w), yA; !(yA = GA.next()).done; )
Ct(yA.value) && be(yA.value, f);
}
}
}
function jt(w) {
{
var f = w.type;
if (f == null || typeof f == "string")
return;
var S;
if (typeof f == "function")
S = f.propTypes;
else if (typeof f == "object" && (f.$$typeof === Q || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
f.$$typeof === M))
S = f.propTypes;
else
return;
if (S) {
var sA = dA(f);
ce(S, w.props, "prop", sA, w);
} else if (f.PropTypes !== void 0 && !Dt) {
Dt = !0;
var pA = dA(f);
H("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", pA || "Unknown");
}
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && H("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function F0(w) {
{
for (var f = Object.keys(w.props), S = 0; S < f.length; S++) {
var sA = f[S];
if (sA !== "children" && sA !== "key") {
Se(w), H("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", sA), Se(null);
break;
}
}
w.ref !== null && (Se(w), H("Invalid attribute `ref` supplied to `React.Fragment`."), Se(null));
}
}
function Rt(w, f, S, sA, pA, GA) {
{
var yA = mA(w);
if (!yA) {
var CA = "";
(w === void 0 || typeof w == "object" && w !== null && Object.keys(w).length === 0) && (CA += " 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 eA = o0(pA);
eA ? CA += eA : CA += St();
var jA;
w === null ? jA = "null" : Je(w) ? jA = "array" : w !== void 0 && w.$$typeof === e ? (jA = "<" + (dA(w.type) || "Unknown") + " />", CA = " Did you accidentally export a JSX literal instead of a component?") : jA = typeof w, H("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", jA, CA);
}
var LA = z0(w, f, S, pA, GA);
if (LA == null)
return LA;
if (yA) {
var te = f.children;
if (te !== void 0)
if (sA)
if (Je(te)) {
for (var Ve = 0; Ve < te.length; Ve++)
ut(te[Ve], w);
Object.freeze && Object.freeze(te);
} else
H("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
ut(te, w);
}
return w === r ? F0(LA) : jt(LA), LA;
}
}
function g0(w, f, S) {
return Rt(w, f, S, !0);
}
function x0(w, f, S) {
return Rt(w, f, S, !1);
}
var a0 = x0, Nt = g0;
GB.Fragment = r, GB.jsx = a0, GB.jsxs = Nt;
}()), GB;
}
process.env.NODE_ENV === "production" ? qo.exports = VY() : qo.exports = OY();
var z1 = qo.exports;
const zt = z1.jsx, Kw = z1.jsxs;
function PY(A) {
return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
}
var _o = { exports: {} }, fB = {};
/**
* @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 Vw;
function XY() {
if (Vw)
return fB;
Vw = 1;
var A = k, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, B = { key: !0, ref: !0, __self: !0, __source: !0 };
function n(g, Q, I) {
var E, M = {}, u = null, G = null;
I !== void 0 && (u = "" + I), Q.key !== void 0 && (u = "" + Q.key), Q.ref !== void 0 && (G = Q.ref);
for (E in Q)
r.call(Q, E) && !B.hasOwnProperty(E) && (M[E] = Q[E]);
if (g && g.defaultProps)
for (E in Q = g.defaultProps, Q)
M[E] === void 0 && (M[E] = Q[E]);
return { $$typeof: e, type: g, key: u, ref: G, props: M, _owner: i.current };
}
return fB.Fragment = t, fB.jsx = n, fB.jsxs = n, fB;
}
var bs = {};
/**
* @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.
*/
var Ow;
function ZY() {
return Ow || (Ow = 1, process.env.NODE_ENV !== "production" && function() {
var A = k, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), n = Symbol.for("react.provider"), g = Symbol.for("react.context"), Q = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), u = Symbol.for("react.lazy"), G = Symbol.for("react.offscreen"), p = Symbol.iterator, z = "@@iterator";
function m(w) {
if (w === null || typeof w != "object")
return null;
var f = p && w[p] || w[z];
return typeof f == "function" ? f : null;
}
var v = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function H(w) {
{
for (var f = arguments.length, S = new Array(f > 1 ? f - 1 : 0), sA = 1; sA < f; sA++)
S[sA - 1] = arguments[sA];
V("error", w, S);
}
}
function V(w, f, S) {
{
var sA = v.ReactDebugCurrentFrame, pA = sA.getStackAddendum();
pA !== "" && (f += "%s", S = S.concat([pA]));
var GA = S.map(function(yA) {
return String(yA);
});
GA.unshift("Warning: " + f), Function.prototype.apply.call(console[w], console, GA);
}
}
var Z = !1, b = !1, IA = !1, FA = !1, fA = !1, WA;
WA = Symbol.for("react.module.reference");
function mA(w) {
return !!(typeof w == "string" || typeof w == "function" || w === r || w === B || fA || w === i || w === I || w === E || FA || w === G || Z || b || IA || typeof w == "object" && w !== null && (w.$$typeof === u || w.$$typeof === M || w.$$typeof === n || w.$$typeof === g || w.$$typeof === Q || // 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.
w.$$typeof === WA || w.getModuleId !== void 0));
}
function NA(w, f, S) {
var sA = w.displayName;
if (sA)
return sA;
var pA = f.displayName || f.name || "";
return pA !== "" ? S + "(" + pA + ")" : S;
}
function UA(w) {
return w.displayName || "Context";
}
function dA(w) {
if (w == null)
return null;
if (typeof w.tag == "number" && H("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof w == "function")
return w.displayName || w.name || null;
if (typeof w == "string")
return w;
switch (w) {
case r:
return "Fragment";
case t:
return "Portal";
case B:
return "Profiler";
case i:
return "StrictMode";
case I:
return "Suspense";
case E:
return "SuspenseList";
}
if (typeof w == "object")
switch (w.$$typeof) {
case g:
var f = w;
return UA(f) + ".Consumer";
case n:
var S = w;
return UA(S._context) + ".Provider";
case Q:
return NA(w, w.render, "ForwardRef");
case M:
var sA = w.displayName || null;
return sA !== null ? sA : dA(w.type) || "Memo";
case u: {
var pA = w, GA = pA._payload, yA = pA._init;
try {
return dA(yA(GA));
} catch {
return null;
}
}
}
return null;
}
var lA = Object.assign, zA = 0, cA, nA, MA, HA, rA, EA, L;
function T() {
}
T.__reactDisabledLog = !0;
function W() {
{
if (zA === 0) {
cA = console.log, nA = console.info, MA = console.warn, HA = console.error, rA = console.group, EA = console.groupCollapsed, L = console.groupEnd;
var w = {
configurable: !0,
enumerable: !0,
value: T,
writable: !0
};
Object.defineProperties(console, {
info: w,
log: w,
warn: w,
error: w,
group: w,
groupCollapsed: w,
groupEnd: w
});
}
zA++;
}
}
function tA() {
{
if (zA--, zA === 0) {
var w = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: lA({}, w, {
value: cA
}),
info: lA({}, w, {
value: nA
}),
warn: lA({}, w, {
value: MA
}),
error: lA({}, w, {
value: HA
}),
group: lA({}, w, {
value: rA
}),
groupCollapsed: lA({}, w, {
value: EA
}),
groupEnd: lA({}, w, {
value: L
})
});
}
zA < 0 && H("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var d = v.ReactCurrentDispatcher, oA;
function O(w, f, S) {
{
if (oA === void 0)
try {
throw Error();
} catch (pA) {
var sA = pA.stack.trim().match(/\n( *(at )?)/);
oA = sA && sA[1] || "";
}
return `
` + oA + w;
}
}
var YA = !1, $;
{
var RA = typeof WeakMap == "function" ? WeakMap : Map;
$ = new RA();
}
function _(w, f) {
if (!w || YA)
return "";
{
var S = $.get(w);
if (S !== void 0)
return S;
}
var sA;
YA = !0;
var pA = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var GA;
GA = d.current, d.current = null, W();
try {
if (f) {
var yA = function() {
throw Error();
};
if (Object.defineProperty(yA.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(yA, []);
} catch (Fe) {
sA = Fe;
}
Reflect.construct(w, [], yA);
} else {
try {
yA.call();
} catch (Fe) {
sA = Fe;
}
w.call(yA.prototype);
}
} else {
try {
throw Error();
} catch (Fe) {
sA = Fe;
}
w();
}
} catch (Fe) {
if (Fe && sA && typeof Fe.stack == "string") {
for (var CA = Fe.stack.split(`
`), eA = sA.stack.split(`
`), jA = CA.length - 1, LA = eA.length - 1; jA >= 1 && LA >= 0 && CA[jA] !== eA[LA]; )
LA--;
for (; jA >= 1 && LA >= 0; jA--, LA--)
if (CA[jA] !== eA[LA]) {
if (jA !== 1 || LA !== 1)
do
if (jA--, LA--, LA < 0 || CA[jA] !== eA[LA]) {
var te = `
` + CA[jA].replace(" at new ", " at ");
return w.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", w.displayName)), typeof w == "function" && $.set(w, te), te;
}
while (jA >= 1 && LA >= 0);
break;
}
}
} finally {
YA = !1, d.current = GA, tA(), Error.prepareStackTrace = pA;
}
var Ve = w ? w.displayName || w.name : "", qt = Ve ? O(Ve) : "";
return typeof w == "function" && $.set(w, qt), qt;
}
function qA(w, f, S) {
return _(w, !1);
}
function aA(w) {
var f = w.prototype;
return !!(f && f.isReactComponent);
}
function xA(w, f, S) {
if (w == null)
return "";
if (typeof w == "function")
return _(w, aA(w));
if (typeof w == "string")
return O(w);
switch (w) {
case I:
return O("Suspense");
case E:
return O("SuspenseList");
}
if (typeof w == "object")
switch (w.$$typeof) {
case Q:
return qA(w.render);
case M:
return xA(w.type, f, S);
case u: {
var sA = w, pA = sA._payload, GA = sA._init;
try {
return xA(GA(pA), f, S);
} catch {
}
}
}
return "";
}
var ZA = Object.prototype.hasOwnProperty, vA = {}, Be = v.ReactDebugCurrentFrame;
function le(w) {
if (w) {
var f = w._owner, S = xA(w.type, w._source, f ? f.type : null);
Be.setExtraStackFrame(S);
} else
Be.setExtraStackFrame(null);
}
function ce(w, f, S, sA, pA) {
{
var GA = Function.call.bind(ZA);
for (var yA in w)
if (GA(w, yA)) {
var CA = void 0;
try {
if (typeof w[yA] != "function") {
var eA = Error((sA || "React class") + ": " + S + " type `" + yA + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof w[yA] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw eA.name = "Invariant Violation", eA;
}
CA = w[yA](f, yA, sA, S, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (jA) {
CA = jA;
}
CA && !(CA instanceof Error) && (le(pA), H("%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).", sA || "React class", S, yA, typeof CA), le(null)), CA instanceof Error && !(CA.message in vA) && (vA[CA.message] = !0, le(pA), H("Failed %s type: %s", S, CA.message), le(null));
}
}
}
var Ze = Array.isArray;
function Je(w) {
return Ze(w);
}
function ze(w) {
{
var f = typeof Symbol == "function" && Symbol.toStringTag, S = f && w[Symbol.toStringTag] || w.constructor.name || "Object";
return S;
}
}
function JA(w) {
try {
return se(w), !1;
} catch {
return !0;
}
}
function se(w) {
return "" + w;
}
function nt(w) {
if (JA(w))
return H("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(w)), se(w);
}
var oe = v.ReactCurrentOwner, l = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Y, D, K;
K = {};
function He(w) {
if (ZA.call(w, "ref")) {
var f = Object.getOwnPropertyDescriptor(w, "ref").get;
if (f && f.isReactWarning)
return !1;
}
return w.ref !== void 0;
}
function XA(w) {
if (ZA.call(w, "key")) {
var f = Object.getOwnPropertyDescriptor(w, "key").get;
if (f && f.isReactWarning)
return !1;
}
return w.key !== void 0;
}
function ie(w, f) {
if (typeof w.ref == "string" && oe.current && f && oe.current.stateNode !== f) {
var S = dA(oe.current.type);
K[S] || (H('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', dA(oe.current.type), w.ref), K[S] = !0);
}
}
function Xe(w, f) {
{
var S = function() {
Y || (Y = !0, H("%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)", f));
};
S.isReactWarning = !0, Object.defineProperty(w, "key", {
get: S,
configurable: !0
});
}
}
function X(w, f) {
{
var S = function() {
D || (D = !0, H("%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)", f));
};
S.isReactWarning = !0, Object.defineProperty(w, "ref", {
get: S,
configurable: !0
});
}
}
var iA = function(w, f, S, sA, pA, GA, yA) {
var CA = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: e,
// Built-in properties that belong on the element
type: w,
key: f,
ref: S,
props: yA,
// Record the component responsible for creating this element.
_owner: GA
};
return CA._store = {}, Object.defineProperty(CA._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(CA, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: sA
}), Object.defineProperty(CA, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: pA
}), Object.freeze && (Object.freeze(CA.props), Object.freeze(CA)), CA;
};
function z0(w, f, S, sA, pA) {
{
var GA, yA = {}, CA = null, eA = null;
S !== void 0 && (nt(S), CA = "" + S), XA(f) && (nt(f.key), CA = "" + f.key), He(f) && (eA = f.ref, ie(f, pA));
for (GA in f)
ZA.call(f, GA) && !l.hasOwnProperty(GA) && (yA[GA] = f[GA]);
if (w && w.defaultProps) {
var jA = w.defaultProps;
for (GA in jA)
yA[GA] === void 0 && (yA[GA] = jA[GA]);
}
if (CA || eA) {
var LA = typeof w == "function" ? w.displayName || w.name || "Unknown" : w;
CA && Xe(yA, LA), eA && X(yA, LA);
}
return iA(w, CA, eA, pA, sA, oe.current, yA);
}
}
var yt = v.ReactCurrentOwner, Wt = v.ReactDebugCurrentFrame;
function Se(w) {
if (w) {
var f = w._owner, S = xA(w.type, w._source, f ? f.type : null);
Wt.setExtraStackFrame(S);
} else
Wt.setExtraStackFrame(null);
}
var Dt;
Dt = !1;
function Ct(w) {
return typeof w == "object" && w !== null && w.$$typeof === e;
}
function St() {
{
if (yt.current) {
var w = dA(yt.current.type);
if (w)
return `
Check the render method of \`` + w + "`.";
}
return "";
}
}
function o0(w) {
{
if (w !== void 0) {
var f = w.fileName.replace(/^.*[\\\/]/, ""), S = w.lineNumber;
return `
Check your code at ` + f + ":" + S + ".";
}
return "";
}
}
var Ye = {};
function It(w) {
{
var f = St();
if (!f) {
var S = typeof w == "string" ? w : w.displayName || w.name;
S && (f = `
Check the top-level render call using <` + S + ">.");
}
return f;
}
}
function be(w, f) {
{
if (!w._store || w._store.validated || w.key != null)
return;
w._store.validated = !0;
var S = It(f);
if (Ye[S])
return;
Ye[S] = !0;
var sA = "";
w && w._owner && w._owner !== yt.current && (sA = " It was passed a child from " + dA(w._owner.type) + "."), Se(w), H('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S, sA), Se(null);
}
}
function ut(w, f) {
{
if (typeof w != "object")
return;
if (Je(w))
for (var S = 0; S < w.length; S++) {
var sA = w[S];
Ct(sA) && be(sA, f);
}
else if (Ct(w))
w._store && (w._store.validated = !0);
else if (w) {
var pA = m(w);
if (typeof pA == "function" && pA !== w.entries)
for (var GA = pA.call(w), yA; !(yA = GA.next()).done; )
Ct(yA.value) && be(yA.value, f);
}
}
}
function jt(w) {
{
var f = w.type;
if (f == null || typeof f == "string")
return;
var S;
if (typeof f == "function")
S = f.propTypes;
else if (typeof f == "object" && (f.$$typeof === Q || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
f.$$typeof === M))
S = f.propTypes;
else
return;
if (S) {
var sA = dA(f);
ce(S, w.props, "prop", sA, w);
} else if (f.PropTypes !== void 0 && !Dt) {
Dt = !0;
var pA = dA(f);
H("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", pA || "Unknown");
}
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && H("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function F0(w) {
{
for (var f = Object.keys(w.props), S = 0; S < f.length; S++) {
var sA = f[S];
if (sA !== "children" && sA !== "key") {
Se(w), H("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", sA), Se(null);
break;
}
}
w.ref !== null && (Se(w), H("Invalid attribute `ref` supplied to `React.Fragment`."), Se(null));
}
}
function Rt(w, f, S, sA, pA, GA) {
{
var yA = mA(w);
if (!yA) {
var CA = "";
(w === void 0 || typeof w == "object" && w !== null && Object.keys(w).length === 0) && (CA += " 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 eA = o0(pA);
eA ? CA += eA : CA += St();
var jA;
w === null ? jA = "null" : Je(w) ? jA = "array" : w !== void 0 && w.$$typeof === e ? (jA = "<" + (dA(w.type) || "Unknown") + " />", CA = " Did you accidentally export a JSX literal instead of a component?") : jA = typeof w, H("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", jA, CA);
}
var LA = z0(w, f, S, pA, GA);
if (LA == null)
return LA;
if (yA) {
var te = f.children;
if (te !== void 0)
if (sA)
if (Je(te)) {
for (var Ve = 0; Ve < te.length; Ve++)
ut(te[Ve], w);
Object.freeze && Object.freeze(te);
} else
H("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
ut(te, w);
}
return w === r ? F0(LA) : jt(LA), LA;
}
}
function g0(w, f, S) {
return Rt(w, f, S, !0);
}
function x0(w, f, S) {
return Rt(w, f, S, !1);
}
var a0 = x0, Nt = g0;
bs.Fragment = r, bs.jsx = a0, bs.jsxs = Nt;
}()), bs;
}
process.env.NODE_ENV === "production" ? _o.exports = XY() : _o.exports = ZY();
var qY = _o.exports;
const Pw = qY.jsx;
/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/
var _Y = /["'&<>]/, $Y = A4;
function A4(A) {
var e = "" + A, t = _Y.exec(e);
if (!t)
return e;
var r, i = "", B = 0, n = 0;
for (B = t.index; B < e.length; B++) {
switch (e.charCodeAt(B)) {
case 34:
r = """;
break;
case 38:
r = "&";
break;
case 39:
r = "'";
break;
case 60:
r = "<";
break;
case 62:
r = ">";
break;
default:
continue;
}
n !== B && (i += e.substring(n, B)), n = B + 1, i += r;
}
return n !== B ? i + e.substring(n, B) : i;
}
const Xw = /* @__PURE__ */ PY($Y), e4 = {
plugins: [],
locales: [
{
locale: "default"
}
],
locale: "default"
}, Jt = (A, e) => {
const { selection: t } = A;
if (!t)
return !1;
const [r] = Array.from(
we.nodes(A, {
match: (i) => !we.isEditor(i) && B0.isElement(i) && we.isBlock(A, i) && i.type === e
})
);
return !!r;
}, HL = (A, e) => {
const t = Jt(A, e);
ne.setNodes(
A,
{ type: t ? A.defaultElement : e },
{
hanging: !0,
match: (r) => !we.isEditor(r) && B0.isElement(r) && we.isBlock(A, r) && r.type === (t ? e : A.defaultElement)
}
);
}, xr = (A, e, t) => {
const { selection: r } = A;
if (!r)
return t;
const [i] = we.nodes(A, {
at: we.unhangRange(A, r),
match: (n) => !we.isEditor(n) && B0.isElement(n) && we.isBlock(A, n) && e in n
});
if (!i)
return t;
const [B] = i;
return B[e] ?? t;
}, AB = (A, e, t) => {
const { selection: r } = A;
r && ne.setNodes(
A,
{ [e]: t },
{
match: (i) => !we.isEditor(i) && B0.isElement(i) && we.isBlock(A, i)
}
);
}, t4 = (A, e) => {
const { selection: t } = A;
t && ne.unsetNodes(A, e, {
match: (r) => !we.isEditor(r) && B0.isElement(r) && we.isBlock(A, r)
});
}, r4 = (A) => {
const e = new FileReader();
e.addEventListener(
"load",
() => {
var t;
(t = A.onSuccess) == null || t.call(A, { url: e.result });
},
!1
), e.readAsDataURL(A.file);
}, i4 = (A) => {
const e = new FileReader();
e.addEventListener(
"load",
(t) => {
var r, i;
let B = new Blob([(r = t == null ? void 0 : t.target) == null ? void 0 : r.result], {
type: A.file.type
});
window.URL = window.URL || window.webkitURL, (i = A.onSuccess) == null || i.call(A, { url: window.URL.createObjectURL(B) });
},
!1
), e.readAsDataURL(A.file);
}, B4 = (A, e, t) => {
const r = e.replace(/\[(\d+)\]/g, ".$1").split(".");
let i = A, B = t;
for (const n of r)
if (B = Object(i)[n], i = Object(i)[n], B === void 0)
return t;
return B;
}, x1 = (A) => {
var e;
if (!A.selection)
return !1;
const t = (e = we.above(A)) == null ? void 0 : e[0];
return t ? ss.string(t) === "" && !t.children.some(
(r) => B0.isElement(r) && we.isInline(A, r)
) : !1;
}, Vn = (A, e) => {
const t = A.selection;
if (t && X0.isCollapsed(t)) {
const [r] = we.nodes(A, {
match: (i) => !we.isEditor(i) && B0.isElement(i) && i.type === e
});
if (r) {
const [, i] = r, B = we.start(A, i);
if (p1.equals(t.anchor, B))
return !0;
}
}
return !1;
}, s4 = (A, e) => {
const t = [...A];
for (const r of e)
if (r.locale)
for (const { locale: i, ...B } of r.locale) {
const n = t.find((g) => g.locale === i);
if (n) {
const g = { ...n[r.type] || {} };
n[r.type] = {
...B,
...g
};
} else
t.push({
locale: i,
[r.type]: {
...B
}
});
}
return t;
}, Oi = (A, e, t, r) => e.filter(
(i) => i.nodeType === t
).reduce((i, B) => {
const n = { ...i };
if (!B.renderStyle)
return { ...n };
let g = {};
return typeof B.renderStyle == "function" ? g = B.renderStyle(A, r, B.props) : A[B.type] && (g = B.renderStyle), { ...n, ...g };
}, {});
function n4(A) {
return A.replace(/([A-Z])/g, function(e) {
return "-" + e.toLowerCase();
}).trim();
}
const Js = (A) => typeof A != "object" ? "" : Object.keys(A).map((e) => {
let t = A[e];
return typeof t == "number" && (t = t + "px"), `${n4(e)}:${t};`;
}).join(""), Vg = (A, e, t, r = "dataurl") => {
const { onProgress: i, onError: B, onSuccess: n } = A;
return new Promise((g, Q) => {
t == null || t(1);
const I = {
...A,
onProgress: (E) => {
i == null || i(E), t == null || t((E == null ? void 0 : E.percent) ?? 0);
},
onError: (E, M) => {
Q(E), B == null || B(E, M), t == null || t(-1);
},
onSuccess: (E) => {
n == null || n(E), t == null || t(0), g(E);
}
};
if (e)
e(I);
else {
if (console.log("defaultType", r), r === "dataurl") {
r4(I);
return;
}
if (r === "bloburl") {
i4(I);
return;
}
alert("not support upload function"), Q("not support upload function"), B == null || B(new Error("not support upload function")), t == null || t(-1);
}
});
}, P0 = (A, e, t = !1) => {
const r = we.marks(A);
return (r == null ? void 0 : r[e]) ?? t;
}, Og = (A, e, t) => {
we.addMark(A, e, t);
}, Mn = (A, e) => {
P0(A, e) ? we.removeMark(A, e) : we.addMark(A, e, !0);
};
let c4 = (A = 21) => crypto.getRandomValues(new Uint8Array(A)).reduce((e, t) => (t &= 63, t < 36 ? e += t.toString(36) : t < 62 ? e += (t - 26).toString(36).toUpperCase() : t > 62 ? e += "-" : e += "_", e), "");
const o4 = (A, e) => e.reduce((t, r) => {
r.uuid || (r.uuid = `${r.type}_${c4()}`);
const { isVoid: i, isInline: B, normalizeNode: n } = t;
return r.isDefaultElement && (t.defaultElement = r.type), "isVoid" in r && (t.isVoid = (g) => g.type === r.type ? r.isVoid ? typeof r.isVoid == "function" ? r.isVoid(g) : r.isVoid : !1 : i(g)), "isInline" in r && (t.isInline = (g) => g.type === r.type ? r.isInline ? typeof r.isInline == "function" ? r.isInline(g) : r.isInline : !1 : B