@bratislava/wysimark-editor
Version:
The customized fork of wysimark editor - A modern and clean rich text editor for React that supports 100% of CommonMark and GitHub Flavored Markdown.
1,195 lines (1,192 loc) • 2.9 MB
JavaScript
"use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
}) : x2)(function(x2) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x2 + '" is not supported');
});
var __esm = (fn2, res) => function __init() {
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all2) => {
for (var name in all2)
__defProp(target, name, { get: all2[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key2 of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key2) && key2 !== except)
__defProp(to, key2, { get: () => from2[key2], enumerable: !(desc = __getOwnPropDesc(from2, key2)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// ../../node_modules/react/cjs/react.production.min.js
var require_react_production_min = __commonJS({
"../../node_modules/react/cjs/react.production.min.js"(exports) {
"use strict";
init_react_shim();
var l2 = Symbol.for("react.element");
var n4 = Symbol.for("react.portal");
var p2 = Symbol.for("react.fragment");
var q2 = Symbol.for("react.strict_mode");
var r4 = Symbol.for("react.profiler");
var t3 = Symbol.for("react.provider");
var u2 = Symbol.for("react.context");
var v2 = Symbol.for("react.forward_ref");
var w2 = Symbol.for("react.suspense");
var x2 = Symbol.for("react.memo");
var y2 = Symbol.for("react.lazy");
var z2 = Symbol.iterator;
function A2(a2) {
if (null === a2 || "object" !== typeof a2)
return null;
a2 = z2 && a2[z2] || a2["@@iterator"];
return "function" === typeof a2 ? a2 : null;
}
var B2 = { isMounted: function() {
return false;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} };
var C = Object.assign;
var D2 = {};
function E2(a2, b2, e2) {
this.props = a2;
this.context = b2;
this.refs = D2;
this.updater = e2 || B2;
}
E2.prototype.isReactComponent = {};
E2.prototype.setState = function(a2, b2) {
if ("object" !== typeof a2 && "function" !== typeof a2 && null != a2)
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
this.updater.enqueueSetState(this, a2, b2, "setState");
};
E2.prototype.forceUpdate = function(a2) {
this.updater.enqueueForceUpdate(this, a2, "forceUpdate");
};
function F() {
}
F.prototype = E2.prototype;
function G2(a2, b2, e2) {
this.props = a2;
this.context = b2;
this.refs = D2;
this.updater = e2 || B2;
}
var H7 = G2.prototype = new F();
H7.constructor = G2;
C(H7, E2.prototype);
H7.isPureReactComponent = true;
var I2 = Array.isArray;
var J = Object.prototype.hasOwnProperty;
var K = { current: null };
var L2 = { key: true, ref: true, __self: true, __source: true };
function M2(a2, b2, e2) {
var d2, c2 = {}, k2 = null, h2 = null;
if (null != b2)
for (d2 in void 0 !== b2.ref && (h2 = b2.ref), void 0 !== b2.key && (k2 = "" + b2.key), b2)
J.call(b2, d2) && !L2.hasOwnProperty(d2) && (c2[d2] = b2[d2]);
var g2 = arguments.length - 2;
if (1 === g2)
c2.children = e2;
else if (1 < g2) {
for (var f2 = Array(g2), m = 0; m < g2; m++)
f2[m] = arguments[m + 2];
c2.children = f2;
}
if (a2 && a2.defaultProps)
for (d2 in g2 = a2.defaultProps, g2)
void 0 === c2[d2] && (c2[d2] = g2[d2]);
return { $$typeof: l2, type: a2, key: k2, ref: h2, props: c2, _owner: K.current };
}
function N2(a2, b2) {
return { $$typeof: l2, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner };
}
function O2(a2) {
return "object" === typeof a2 && null !== a2 && a2.$$typeof === l2;
}
function escape(a2) {
var b2 = { "=": "=0", ":": "=2" };
return "$" + a2.replace(/[=:]/g, function(a3) {
return b2[a3];
});
}
var P2 = /\/+/g;
function Q2(a2, b2) {
return "object" === typeof a2 && null !== a2 && null != a2.key ? escape("" + a2.key) : b2.toString(36);
}
function R2(a2, b2, e2, d2, c2) {
var k2 = typeof a2;
if ("undefined" === k2 || "boolean" === k2)
a2 = null;
var h2 = false;
if (null === a2)
h2 = true;
else
switch (k2) {
case "string":
case "number":
h2 = true;
break;
case "object":
switch (a2.$$typeof) {
case l2:
case n4:
h2 = true;
}
}
if (h2)
return h2 = a2, c2 = c2(h2), a2 = "" === d2 ? "." + Q2(h2, 0) : d2, I2(c2) ? (e2 = "", null != a2 && (e2 = a2.replace(P2, "$&/") + "/"), R2(c2, b2, e2, "", function(a3) {
return a3;
})) : null != c2 && (O2(c2) && (c2 = N2(c2, e2 + (!c2.key || h2 && h2.key === c2.key ? "" : ("" + c2.key).replace(P2, "$&/") + "/") + a2)), b2.push(c2)), 1;
h2 = 0;
d2 = "" === d2 ? "." : d2 + ":";
if (I2(a2))
for (var g2 = 0; g2 < a2.length; g2++) {
k2 = a2[g2];
var f2 = d2 + Q2(k2, g2);
h2 += R2(k2, b2, e2, f2, c2);
}
else if (f2 = A2(a2), "function" === typeof f2)
for (a2 = f2.call(a2), g2 = 0; !(k2 = a2.next()).done; )
k2 = k2.value, f2 = d2 + Q2(k2, g2++), h2 += R2(k2, b2, e2, f2, c2);
else if ("object" === k2)
throw b2 = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b2 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead.");
return h2;
}
function S2(a2, b2, e2) {
if (null == a2)
return a2;
var d2 = [], c2 = 0;
R2(a2, d2, "", "", function(a3) {
return b2.call(e2, a3, c2++);
});
return d2;
}
function T(a2) {
if (-1 === a2._status) {
var b2 = a2._result;
b2 = b2();
b2.then(function(b3) {
if (0 === a2._status || -1 === a2._status)
a2._status = 1, a2._result = b3;
}, function(b3) {
if (0 === a2._status || -1 === a2._status)
a2._status = 2, a2._result = b3;
});
-1 === a2._status && (a2._status = 0, a2._result = b2);
}
if (1 === a2._status)
return a2._result.default;
throw a2._result;
}
var U2 = { current: null };
var V = { transition: null };
var W2 = { ReactCurrentDispatcher: U2, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
function X2() {
throw Error("act(...) is not supported in production builds of React.");
}
exports.Children = { map: S2, forEach: function(a2, b2, e2) {
S2(a2, function() {
b2.apply(this, arguments);
}, e2);
}, count: function(a2) {
var b2 = 0;
S2(a2, function() {
b2++;
});
return b2;
}, toArray: function(a2) {
return S2(a2, function(a3) {
return a3;
}) || [];
}, only: function(a2) {
if (!O2(a2))
throw Error("React.Children.only expected to receive a single React element child.");
return a2;
} };
exports.Component = E2;
exports.Fragment = p2;
exports.Profiler = r4;
exports.PureComponent = G2;
exports.StrictMode = q2;
exports.Suspense = w2;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W2;
exports.act = X2;
exports.cloneElement = function(a2, b2, e2) {
if (null === a2 || void 0 === a2)
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a2 + ".");
var d2 = C({}, a2.props), c2 = a2.key, k2 = a2.ref, h2 = a2._owner;
if (null != b2) {
void 0 !== b2.ref && (k2 = b2.ref, h2 = K.current);
void 0 !== b2.key && (c2 = "" + b2.key);
if (a2.type && a2.type.defaultProps)
var g2 = a2.type.defaultProps;
for (f2 in b2)
J.call(b2, f2) && !L2.hasOwnProperty(f2) && (d2[f2] = void 0 === b2[f2] && void 0 !== g2 ? g2[f2] : b2[f2]);
}
var f2 = arguments.length - 2;
if (1 === f2)
d2.children = e2;
else if (1 < f2) {
g2 = Array(f2);
for (var m = 0; m < f2; m++)
g2[m] = arguments[m + 2];
d2.children = g2;
}
return { $$typeof: l2, type: a2.type, key: c2, ref: k2, props: d2, _owner: h2 };
};
exports.createContext = function(a2) {
a2 = { $$typeof: u2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
a2.Provider = { $$typeof: t3, _context: a2 };
return a2.Consumer = a2;
};
exports.createElement = M2;
exports.createFactory = function(a2) {
var b2 = M2.bind(null, a2);
b2.type = a2;
return b2;
};
exports.createRef = function() {
return { current: null };
};
exports.forwardRef = function(a2) {
return { $$typeof: v2, render: a2 };
};
exports.isValidElement = O2;
exports.lazy = function(a2) {
return { $$typeof: y2, _payload: { _status: -1, _result: a2 }, _init: T };
};
exports.memo = function(a2, b2) {
return { $$typeof: x2, type: a2, compare: void 0 === b2 ? null : b2 };
};
exports.startTransition = function(a2) {
var b2 = V.transition;
V.transition = {};
try {
a2();
} finally {
V.transition = b2;
}
};
exports.unstable_act = X2;
exports.useCallback = function(a2, b2) {
return U2.current.useCallback(a2, b2);
};
exports.useContext = function(a2) {
return U2.current.useContext(a2);
};
exports.useDebugValue = function() {
};
exports.useDeferredValue = function(a2) {
return U2.current.useDeferredValue(a2);
};
exports.useEffect = function(a2, b2) {
return U2.current.useEffect(a2, b2);
};
exports.useId = function() {
return U2.current.useId();
};
exports.useImperativeHandle = function(a2, b2, e2) {
return U2.current.useImperativeHandle(a2, b2, e2);
};
exports.useInsertionEffect = function(a2, b2) {
return U2.current.useInsertionEffect(a2, b2);
};
exports.useLayoutEffect = function(a2, b2) {
return U2.current.useLayoutEffect(a2, b2);
};
exports.useMemo = function(a2, b2) {
return U2.current.useMemo(a2, b2);
};
exports.useReducer = function(a2, b2, e2) {
return U2.current.useReducer(a2, b2, e2);
};
exports.useRef = function(a2) {
return U2.current.useRef(a2);
};
exports.useState = function(a2) {
return U2.current.useState(a2);
};
exports.useSyncExternalStore = function(a2, b2, e2) {
return U2.current.useSyncExternalStore(a2, b2, e2);
};
exports.useTransition = function() {
return U2.current.useTransition();
};
exports.version = "18.3.1";
}
});
// ../../node_modules/react/cjs/react.development.js
var require_react_development = __commonJS({
"../../node_modules/react/cjs/react.development.js"(exports, module) {
"use strict";
init_react_shim();
if (process.env.NODE_ENV !== "production") {
(function() {
"use strict";
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.1";
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
var REACT_MEMO_TYPE = Symbol.for("react.memo");
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = "@@iterator";
function getIteratorFn(maybeIterable) {
if (maybeIterable === null || typeof maybeIterable !== "object") {
return null;
}
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
if (typeof maybeIterator === "function") {
return maybeIterator;
}
return null;
}
var ReactCurrentDispatcher = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
var ReactCurrentBatchConfig = {
transition: null
};
var ReactCurrentActQueue = {
current: null,
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
isBatchingLegacy: false,
didScheduleLegacyUpdate: false
};
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
var ReactDebugCurrentFrame = {};
var currentExtraStackFrame = null;
function setExtraStackFrame(stack) {
{
currentExtraStackFrame = stack;
}
}
{
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
{
currentExtraStackFrame = stack;
}
};
ReactDebugCurrentFrame.getCurrentStack = null;
ReactDebugCurrentFrame.getStackAddendum = function() {
var stack = "";
if (currentExtraStackFrame) {
stack += currentExtraStackFrame;
}
var impl = ReactDebugCurrentFrame.getCurrentStack;
if (impl) {
stack += impl() || "";
}
return stack;
};
}
var enableScopeAPI = false;
var enableCacheElement = false;
var enableTransitionTracing = false;
var enableLegacyHidden = false;
var enableDebugTracing = false;
var ReactSharedInternals = {
ReactCurrentDispatcher,
ReactCurrentBatchConfig,
ReactCurrentOwner
};
{
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
}
function warn(format) {
{
{
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
printWarning("warn", format, args);
}
}
}
function error(format) {
{
{
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
printWarning("error", format, args);
}
}
}
function printWarning(level, format, args) {
{
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame2.getStackAddendum();
if (stack !== "") {
format += "%s";
args = args.concat([stack]);
}
var argsWithFormat = args.map(function(item) {
return String(item);
});
argsWithFormat.unshift("Warning: " + format);
Function.prototype.apply.call(console[level], console, argsWithFormat);
}
}
var didWarnStateUpdateForUnmountedComponent = {};
function warnNoop(publicInstance, callerName) {
{
var _constructor = publicInstance.constructor;
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
var warningKey = componentName + "." + callerName;
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
return;
}
error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
}
}
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function(publicInstance) {
return false;
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueForceUpdate: function(publicInstance, callback, callerName) {
warnNoop(publicInstance, "forceUpdate");
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @param {?function} callback Called after component is updated.
* @param {?string} callerName name of the calling function in the public API.
* @internal
*/
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
warnNoop(publicInstance, "replaceState");
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @param {?function} callback Called after component is updated.
* @param {?string} Name of the calling function in the public API.
* @internal
*/
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
warnNoop(publicInstance, "setState");
}
};
var assign2 = Object.assign;
var emptyObject = {};
{
Object.freeze(emptyObject);
}
function Component2(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
Component2.prototype.isReactComponent = {};
Component2.prototype.setState = function(partialState, callback) {
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
}
this.updater.enqueueSetState(this, partialState, callback, "setState");
};
Component2.prototype.forceUpdate = function(callback) {
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
};
{
var deprecatedAPIs = {
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
};
var defineDeprecationWarning = function(methodName, info) {
Object.defineProperty(Component2.prototype, methodName, {
get: function() {
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
return void 0;
}
});
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
function ComponentDummy() {
}
ComponentDummy.prototype = Component2.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
assign2(pureComponentPrototype, Component2.prototype);
pureComponentPrototype.isPureReactComponent = true;
function createRef() {
var refObject = {
current: null
};
{
Object.seal(refObject);
}
return refObject;
}
var isArrayImpl = Array.isArray;
function isArray(a2) {
return isArrayImpl(a2);
}
function typeName(value) {
{
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
return type;
}
}
function willCoercionThrow(value) {
{
try {
testStringCoercion(value);
return false;
} catch (e2) {
return true;
}
}
}
function testStringCoercion(value) {
return "" + value;
}
function checkKeyStringCoercion(value) {
{
if (willCoercionThrow(value)) {
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
return testStringCoercion(value);
}
}
}
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || "";
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
}
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromType(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
}
}
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if (typeof type === "object") {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + ".Consumer";
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + ".Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
if (outerName !== null) {
return outerName;
}
return getComponentNameFromType(type.type) || "Memo";
case REACT_LAZY_TYPE: {
var lazyComponent = type;
var payload = lazyComponent._payload;
var init = lazyComponent._init;
try {
return getComponentNameFromType(init(payload));
} catch (x2) {
return null;
}
}
}
}
return null;
}
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
{
didWarnAboutStringRefs = {};
}
function hasValidRef(config) {
{
if (hasOwnProperty2.call(config, "ref")) {
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== void 0;
}
function hasValidKey(config) {
{
if (hasOwnProperty2.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== void 0;
}
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function() {
{
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
error("%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)", displayName);
}
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function() {
{
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
error("%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)", displayName);
}
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, "ref", {
get: warnAboutAccessingRef,
configurable: true
});
}
function warnIfStringRefCannotBeAutoConverted(config) {
{
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
if (!didWarnAboutStringRefs[componentName]) {
error('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', componentName, config.ref);
didWarnAboutStringRefs[componentName] = true;
}
}
}
}
var ReactElement = function(type, key2, ref, self2, source, owner, props) {
var element = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type,
key: key2,
ref,
props,
// Record the component responsible for creating this element.
_owner: owner
};
{
element._store = {};
Object.defineProperty(element._store, "validated", {
configurable: false,
enumerable: false,
writable: true,
value: false
});
Object.defineProperty(element, "_self", {
configurable: false,
enumerable: false,
writable: false,
value: self2
});
Object.defineProperty(element, "_source", {
configurable: false,
enumerable: false,
writable: false,
value: source
});
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
function createElement4(type, config, children) {
var propName;
var props = {};
var key2 = null;
var ref = null;
var self2 = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
{
warnIfStringRefCannotBeAutoConverted(config);
}
}
if (hasValidKey(config)) {
{
checkKeyStringCoercion(config.key);
}
key2 = "" + config.key;
}
self2 = config.__self === void 0 ? null : config.__self;
source = config.__source === void 0 ? null : config.__source;
for (propName in config) {
if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i3 = 0; i3 < childrenLength; i3++) {
childArray[i3] = arguments[i3 + 2];
}
{
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;
}
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
}
{
if (key2 || ref) {
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
if (key2) {
defineKeyPropWarningGetter(props, displayName);
}
if (ref) {
defineRefPropWarningGetter(props, displayName);
}
}
}
return ReactElement(type, key2, ref, self2, source, ReactCurrentOwner.current, props);
}
function cloneAndReplaceKey(oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
}
function cloneElement2(element, config, children) {
if (element === null || element === void 0) {
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
}
var propName;
var props = assign2({}, element.props);
var key2 = element.key;
var ref = element.ref;
var self2 = element._self;
var source = element._source;
var owner = element._owner;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config)) {
{
checkKeyStringCoercion(config.key);
}
key2 = "" + config.key;
}
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config) {
if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
if (config[propName] === void 0 && defaultProps !== void 0) {
props[propName] = defaultProps[propName];
} else {
props[propName] = config[propName];
}
}
}
}
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i3 = 0; i3 < childrenLength; i3++) {
childArray[i3] = arguments[i3 + 2];
}
props.children = childArray;
}
return ReactElement(element.type, key2, ref, self2, source, owner, props);
}
function isValidElement(object) {
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
var SEPARATOR = ".";
var SUBSEPARATOR = ":";
function escape(key2) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
"=": "=0",
":": "=2"
};
var escapedString = key2.replace(escapeRegex, function(match2) {
return escaperLookup[match2];
});
return "$" + escapedString;
}
var didWarnAboutMaps = false;
var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text4) {
return text4.replace(userProvidedKeyEscapeRegex, "$&/");
}
function getElementKey(element, index2) {
if (typeof element === "object" && element !== null && element.key != null) {
{
checkKeyStringCoercion(element.key);
}
return escape("" + element.key);
}
return index2.toString(36);
}
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
var type = typeof children;
if (type === "undefined" || type === "boolean") {
children = null;
}
var invokeCallback = false;
if (children === null) {
invokeCallback = true;
} else {
switch (type) {
case "string":
case "number":
invokeCallback = true;
break;
case "object":
switch (children.$$typeof) {
case REACT_ELEMENT_TYPE:
case REACT_PORTAL_TYPE:
invokeCallback = true;
}
}
}
if (invokeCallback) {
var _child = children;
var mappedChild = callback(_child);
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
if (isArray(mappedChild)) {
var escapedChildKey = "";
if (childKey != null) {
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
}
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c2) {
return c2;
});
} else if (mappedChild != null) {
if (isValidElement(mappedChild)) {
{
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
checkKeyStringCoercion(mappedChild.key);
}
}
mappedChild = cloneAndReplaceKey(
mappedChild,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
(mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
// eslint-disable-next-line react-internal/safe-string-coercion
escapeUserProvidedKey("" + mappedChild.key) + "/"
) : "") + childKey
);
}
array.push(mappedChild);
}
return 1;
}
var child;
var nextName;
var subtreeCount = 0;
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (isArray(children)) {
for (var i3 = 0; i3 < children.length; i3++) {
child = children[i3];
nextName = nextNamePrefix + getElementKey(child, i3);
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
}
} else {
var iteratorFn = getIteratorFn(children);
if (typeof iteratorFn === "function") {
var iterableChildren = children;
{
if (iteratorFn === iterableChildren.entries) {
if (!didWarnAboutMaps) {
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
}
didWarnAboutMaps = true;
}
}
var iterator = iteratorFn.call(iterableChildren);
var step;
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getElementKey(child, ii++);
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
}
} else if (type === "object") {
var childrenString = String(children);
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
}
}
return subtreeCount;
}
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
var count = 0;
mapIntoArray(children, result, "", "", function(child) {
return func.call(context, child, count++);
});
return result;
}
function countChildren(children) {
var n4 = 0;
mapChildren(children, function() {
n4++;
});
return n4;
}
function forEachChildren(children, forEachFunc, forEachContext) {
mapChildren(children, function() {
forEachFunc.apply(this, arguments);
}, forEachContext);
}
function toArray(children) {
return mapChildren(children, function(child) {
return child;
}) || [];
}
function onlyChild(children) {
if (!isValidElement(children)) {
throw new Error("React.Children.only expected to receive a single React element child.");
}
return children;
}
function createContext5(defaultValue) {
var context = {
$$typeof: REACT_CONTEXT_TYPE,
// As a workaround to support multiple concurrent renderers, we categorize
// some renderers as primary and others as secondary. We only expect
// there to be two concurrent renderers at most: React Native (primary) and
// Fabric (secondary); React DOM (primary) and React ART (secondary).
// Secondary renderers store their context values on separate fields.
_currentValue: defaultValue,
_currentValue2: defaultValue,
// Used to track how many concurrent renderers this context currently
// supports within in a single renderer. Such as parallel server rendering.
_threadCount: 0,
// These are circular
Provider: null,
Consumer: null,
// Add these to use same hidden class in VM as ServerContext
_defaultValue: null,
_globalName: null
};
context.Provider = {
$$typeof: REACT_PROVIDER_TYPE,
_context: context
};
var hasWarnedAboutUsingNestedContextConsumers = false;
var hasWarnedAboutUsingConsumerProvider = false;
var hasWarnedAboutDisplayNameOnConsumer = false;
{
var Consumer = {
$$typeof: REACT_CONTEXT_TYPE,
_context: context
};
Object.defineProperties(Consumer, {
Provider: {
get: function() {
if (!hasWarnedAboutUsingConsumerProvider) {
hasWarnedAboutUsingConsumerProvider = true;
error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
}
return context.Provider;
},
set: function(_Provider) {
context.Provider = _Provider;
}
},
_currentValue: {
get: function() {
return context._currentValue;
},
set: function(_currentValue) {
context._currentValue = _currentValue;
}
},
_currentValue2: {
get: function() {
return context._currentValue2;
},
set: function(_currentValue2) {
context._currentValue2 = _currentValue2;
}
},
_threadCount: {
get: function() {
return context._threadCount;
},
set: function(_threadCount) {
context._threadCount = _threadCount;
}
},
Consumer: {
get: function() {
if (!hasWarnedAboutUsingNestedContextConsumers) {
hasWarnedAboutUsingNestedContextConsumers = true;
error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
}
return context.Consumer;
}
},
displayName: {
get: function() {
return context.displayName;
},
set: function(displayName) {
if (!hasWarnedAboutDisplayNameOnConsumer) {
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
hasWarnedAboutDisplayNameOnConsumer = true;
}
}
}
});
context.Consumer = Consumer;
}