63660 lines
2.6 MiB
63660 lines
2.6 MiB
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a2, b2) => {
|
|
for (var prop in b2 || (b2 = {}))
|
|
if (__hasOwnProp.call(b2, prop))
|
|
__defNormalProp(a2, prop, b2[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b2)) {
|
|
if (__propIsEnum.call(b2, prop))
|
|
__defNormalProp(a2, prop, b2[prop]);
|
|
}
|
|
return a2;
|
|
};
|
|
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x2) => x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
// node_modules/react/cjs/react.development.js
|
|
var require_react_development = __commonJS({
|
|
"node_modules/react/cjs/react.development.js"(exports, module2) {
|
|
"use strict";
|
|
if (true) {
|
|
(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.2.0";
|
|
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 = {
|
|
current: null
|
|
};
|
|
var ReactCurrentBatchConfig = {
|
|
transition: null
|
|
};
|
|
var ReactCurrentActQueue = {
|
|
current: null,
|
|
isBatchingLegacy: false,
|
|
didScheduleLegacyUpdate: false
|
|
};
|
|
var ReactCurrentOwner = {
|
|
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 = {
|
|
isMounted: function(publicInstance) {
|
|
return false;
|
|
},
|
|
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
warnNoop(publicInstance, "forceUpdate");
|
|
},
|
|
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
warnNoop(publicInstance, "replaceState");
|
|
},
|
|
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
warnNoop(publicInstance, "setState");
|
|
}
|
|
};
|
|
var assign = Object.assign;
|
|
var emptyObject = {};
|
|
{
|
|
Object.freeze(emptyObject);
|
|
}
|
|
function Component(props, context, updater) {
|
|
this.props = props;
|
|
this.context = context;
|
|
this.refs = emptyObject;
|
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
}
|
|
Component.prototype.isReactComponent = {};
|
|
Component.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");
|
|
};
|
|
Component.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(Component.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 = Component.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;
|
|
assign(pureComponentPrototype, Component.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 (e) {
|
|
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 getWrappedName2(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 getWrappedName2(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 hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
{
|
|
didWarnAboutStringRefs = {};
|
|
}
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.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 (hasOwnProperty.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, key, ref, self2, source, owner, props) {
|
|
var element = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
ref,
|
|
props,
|
|
_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 createElement(type, config, children) {
|
|
var propName;
|
|
var props = {};
|
|
var key = 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);
|
|
}
|
|
key = "" + config.key;
|
|
}
|
|
self2 = config.__self === void 0 ? null : config.__self;
|
|
source = config.__source === void 0 ? null : config.__source;
|
|
for (propName in config) {
|
|
if (hasOwnProperty.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 i2 = 0; i2 < childrenLength; i2++) {
|
|
childArray[i2] = arguments[i2 + 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 (key || ref) {
|
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
}
|
|
return ReactElement(type, key, 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 cloneElement(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 = assign({}, element.props);
|
|
var key = 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);
|
|
}
|
|
key = "" + config.key;
|
|
}
|
|
var defaultProps;
|
|
if (element.type && element.type.defaultProps) {
|
|
defaultProps = element.type.defaultProps;
|
|
}
|
|
for (propName in config) {
|
|
if (hasOwnProperty.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 i2 = 0; i2 < childrenLength; i2++) {
|
|
childArray[i2] = arguments[i2 + 2];
|
|
}
|
|
props.children = childArray;
|
|
}
|
|
return ReactElement(element.type, key, 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(key) {
|
|
var escapeRegex = /[=:]/g;
|
|
var escaperLookup = {
|
|
"=": "=0",
|
|
":": "=2"
|
|
};
|
|
var escapedString = key.replace(escapeRegex, function(match) {
|
|
return escaperLookup[match];
|
|
});
|
|
return "$" + escapedString;
|
|
}
|
|
var didWarnAboutMaps = false;
|
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
function escapeUserProvidedKey(text) {
|
|
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
|
}
|
|
function getElementKey(element, index) {
|
|
if (typeof element === "object" && element !== null && element.key != null) {
|
|
{
|
|
checkKeyStringCoercion(element.key);
|
|
}
|
|
return escape("" + element.key);
|
|
}
|
|
return index.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,
|
|
escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? 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 i2 = 0; i2 < children.length; i2++) {
|
|
child = children[i2];
|
|
nextName = nextNamePrefix + getElementKey(child, i2);
|
|
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 n2 = 0;
|
|
mapChildren(children, function() {
|
|
n2++;
|
|
});
|
|
return n2;
|
|
}
|
|
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 createContext3(defaultValue) {
|
|
var context = {
|
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
_currentValue: defaultValue,
|
|
_currentValue2: defaultValue,
|
|
_threadCount: 0,
|
|
Provider: null,
|
|
Consumer: null,
|
|
_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;
|
|
}
|
|
{
|
|
context._currentRenderer = null;
|
|
context._currentRenderer2 = null;
|
|
}
|
|
return context;
|
|
}
|
|
var Uninitialized = -1;
|
|
var Pending = 0;
|
|
var Resolved = 1;
|
|
var Rejected = 2;
|
|
function lazyInitializer(payload) {
|
|
if (payload._status === Uninitialized) {
|
|
var ctor = payload._result;
|
|
var thenable = ctor();
|
|
thenable.then(function(moduleObject2) {
|
|
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
var resolved = payload;
|
|
resolved._status = Resolved;
|
|
resolved._result = moduleObject2;
|
|
}
|
|
}, function(error2) {
|
|
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
var rejected = payload;
|
|
rejected._status = Rejected;
|
|
rejected._result = error2;
|
|
}
|
|
});
|
|
if (payload._status === Uninitialized) {
|
|
var pending = payload;
|
|
pending._status = Pending;
|
|
pending._result = thenable;
|
|
}
|
|
}
|
|
if (payload._status === Resolved) {
|
|
var moduleObject = payload._result;
|
|
{
|
|
if (moduleObject === void 0) {
|
|
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
}
|
|
}
|
|
{
|
|
if (!("default" in moduleObject)) {
|
|
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
|
}
|
|
}
|
|
return moduleObject.default;
|
|
} else {
|
|
throw payload._result;
|
|
}
|
|
}
|
|
function lazy(ctor) {
|
|
var payload = {
|
|
_status: Uninitialized,
|
|
_result: ctor
|
|
};
|
|
var lazyType = {
|
|
$$typeof: REACT_LAZY_TYPE,
|
|
_payload: payload,
|
|
_init: lazyInitializer
|
|
};
|
|
{
|
|
var defaultProps;
|
|
var propTypes;
|
|
Object.defineProperties(lazyType, {
|
|
defaultProps: {
|
|
configurable: true,
|
|
get: function() {
|
|
return defaultProps;
|
|
},
|
|
set: function(newDefaultProps) {
|
|
error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
defaultProps = newDefaultProps;
|
|
Object.defineProperty(lazyType, "defaultProps", {
|
|
enumerable: true
|
|
});
|
|
}
|
|
},
|
|
propTypes: {
|
|
configurable: true,
|
|
get: function() {
|
|
return propTypes;
|
|
},
|
|
set: function(newPropTypes) {
|
|
error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
propTypes = newPropTypes;
|
|
Object.defineProperty(lazyType, "propTypes", {
|
|
enumerable: true
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return lazyType;
|
|
}
|
|
function forwardRef3(render) {
|
|
{
|
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
} else if (typeof render !== "function") {
|
|
error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
|
} else {
|
|
if (render.length !== 0 && render.length !== 2) {
|
|
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
|
}
|
|
}
|
|
if (render != null) {
|
|
if (render.defaultProps != null || render.propTypes != null) {
|
|
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
}
|
|
}
|
|
}
|
|
var elementType = {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render
|
|
};
|
|
{
|
|
var ownName;
|
|
Object.defineProperty(elementType, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
if (!render.name && !render.displayName) {
|
|
render.displayName = name;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return elementType;
|
|
}
|
|
var REACT_MODULE_REFERENCE;
|
|
{
|
|
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
}
|
|
function isValidElementType2(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function memo2(type, compare) {
|
|
{
|
|
if (!isValidElementType2(type)) {
|
|
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
}
|
|
}
|
|
var elementType = {
|
|
$$typeof: REACT_MEMO_TYPE,
|
|
type,
|
|
compare: compare === void 0 ? null : compare
|
|
};
|
|
{
|
|
var ownName;
|
|
Object.defineProperty(elementType, "displayName", {
|
|
enumerable: false,
|
|
configurable: true,
|
|
get: function() {
|
|
return ownName;
|
|
},
|
|
set: function(name) {
|
|
ownName = name;
|
|
if (!type.name && !type.displayName) {
|
|
type.displayName = name;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return elementType;
|
|
}
|
|
function resolveDispatcher() {
|
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
{
|
|
if (dispatcher === null) {
|
|
error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
}
|
|
}
|
|
return dispatcher;
|
|
}
|
|
function useContext6(Context) {
|
|
var dispatcher = resolveDispatcher();
|
|
{
|
|
if (Context._context !== void 0) {
|
|
var realContext = Context._context;
|
|
if (realContext.Consumer === Context) {
|
|
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
} else if (realContext.Provider === Context) {
|
|
error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
}
|
|
}
|
|
}
|
|
return dispatcher.useContext(Context);
|
|
}
|
|
function useState7(initialState3) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useState(initialState3);
|
|
}
|
|
function useReducer(reducer, initialArg, init) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useReducer(reducer, initialArg, init);
|
|
}
|
|
function useRef7(initialValue) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useRef(initialValue);
|
|
}
|
|
function useEffect7(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useEffect(create, deps);
|
|
}
|
|
function useInsertionEffect(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useInsertionEffect(create, deps);
|
|
}
|
|
function useLayoutEffect2(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useLayoutEffect(create, deps);
|
|
}
|
|
function useCallback(callback, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useCallback(callback, deps);
|
|
}
|
|
function useMemo4(create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useMemo(create, deps);
|
|
}
|
|
function useImperativeHandle(ref, create, deps) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
}
|
|
function useDebugValue3(value, formatterFn) {
|
|
{
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
}
|
|
}
|
|
function useTransition() {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useTransition();
|
|
}
|
|
function useDeferredValue(value) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useDeferredValue(value);
|
|
}
|
|
function useId() {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useId();
|
|
}
|
|
function useSyncExternalStore3(subscribe, getSnapshot, getServerSnapshot) {
|
|
var dispatcher = resolveDispatcher();
|
|
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
}
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix2;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix2 === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
var match = x2.stack.trim().match(/\n( *(at )?)/);
|
|
prefix2 = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix2 + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn2, construct) {
|
|
if (!fn2 || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn2);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
Reflect.construct(fn2, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s2 = sampleLines.length - 1;
|
|
var c2 = controlLines.length - 1;
|
|
while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
|
|
c2--;
|
|
}
|
|
for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
|
|
if (sampleLines[s2] !== controlLines[c2]) {
|
|
if (s2 !== 1 || c2 !== 1) {
|
|
do {
|
|
s2--;
|
|
c2--;
|
|
if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
|
|
var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
|
|
if (fn2.displayName && _frame.includes("<anonymous>")) {
|
|
_frame = _frame.replace("<anonymous>", fn2.displayName);
|
|
}
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s2 >= 1 && c2 >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn2 ? fn2.displayName || fn2.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeFunctionComponentFrame(fn2, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn2, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component2) {
|
|
var prototype = Component2.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case REACT_SUSPENSE_TYPE:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x2) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
{
|
|
var has = Function.call.bind(hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function setCurrentlyValidatingElement$1(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
setExtraStackFrame(stack);
|
|
} else {
|
|
setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
var propTypesMisspellWarningShown;
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
if (ReactCurrentOwner.current) {
|
|
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
if (name) {
|
|
return "\n\nCheck the render method of `" + name + "`.";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function getSourceInfoErrorAddendum(source) {
|
|
if (source !== void 0) {
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
var lineNumber = source.lineNumber;
|
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
}
|
|
return "";
|
|
}
|
|
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
if (elementProps !== null && elementProps !== void 0) {
|
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
}
|
|
return "";
|
|
}
|
|
var ownerHasKeyUseWarning = {};
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
var info = getDeclarationErrorAddendum();
|
|
if (!info) {
|
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
function validateExplicitKey(element, parentType) {
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
var childOwner = "";
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
}
|
|
{
|
|
setCurrentlyValidatingElement$1(element);
|
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
function validateChildKeys(node, parentType) {
|
|
if (typeof node !== "object") {
|
|
return;
|
|
}
|
|
if (isArray(node)) {
|
|
for (var i2 = 0; i2 < node.length; i2++) {
|
|
var child = node[i2];
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
if (typeof iteratorFn === "function") {
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validatePropTypes(element) {
|
|
{
|
|
var type = element.type;
|
|
if (type === null || type === void 0 || typeof type === "string") {
|
|
return;
|
|
}
|
|
var propTypes;
|
|
if (typeof type === "function") {
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
if (propTypes) {
|
|
var name = getComponentNameFromType(type);
|
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
var _name = getComponentNameFromType(type);
|
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
}
|
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
}
|
|
}
|
|
}
|
|
function validateFragmentProps(fragment) {
|
|
{
|
|
var keys = Object.keys(fragment.props);
|
|
for (var i2 = 0; i2 < keys.length; i2++) {
|
|
var key = keys[i2];
|
|
if (key !== "children" && key !== "key") {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
setCurrentlyValidatingElement$1(null);
|
|
break;
|
|
}
|
|
}
|
|
if (fragment.ref !== null) {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
}
|
|
function createElementWithValidation(type, props, children) {
|
|
var validType = isValidElementType2(type);
|
|
if (!validType) {
|
|
var info = "";
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " 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 sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
var typeString;
|
|
if (type === null) {
|
|
typeString = "null";
|
|
} else if (isArray(type)) {
|
|
typeString = "array";
|
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
{
|
|
error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
}
|
|
}
|
|
var element = createElement.apply(this, arguments);
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
if (validType) {
|
|
for (var i2 = 2; i2 < arguments.length; i2++) {
|
|
validateChildKeys(arguments[i2], type);
|
|
}
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
return element;
|
|
}
|
|
var didWarnAboutDeprecatedCreateFactory = false;
|
|
function createFactoryWithValidation(type) {
|
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
validatedFactory.type = type;
|
|
{
|
|
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
didWarnAboutDeprecatedCreateFactory = true;
|
|
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
|
}
|
|
Object.defineProperty(validatedFactory, "type", {
|
|
enumerable: false,
|
|
get: function() {
|
|
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
|
Object.defineProperty(this, "type", {
|
|
value: type
|
|
});
|
|
return type;
|
|
}
|
|
});
|
|
}
|
|
return validatedFactory;
|
|
}
|
|
function cloneElementWithValidation(element, props, children) {
|
|
var newElement = cloneElement.apply(this, arguments);
|
|
for (var i2 = 2; i2 < arguments.length; i2++) {
|
|
validateChildKeys(arguments[i2], newElement.type);
|
|
}
|
|
validatePropTypes(newElement);
|
|
return newElement;
|
|
}
|
|
function startTransition(scope, options) {
|
|
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
ReactCurrentBatchConfig.transition = {};
|
|
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
{
|
|
ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
}
|
|
try {
|
|
scope();
|
|
} finally {
|
|
ReactCurrentBatchConfig.transition = prevTransition;
|
|
{
|
|
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
if (updatedFibersCount > 10) {
|
|
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
|
}
|
|
currentTransition._updatedFibers.clear();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var didWarnAboutMessageChannel = false;
|
|
var enqueueTaskImpl = null;
|
|
function enqueueTask(task2) {
|
|
if (enqueueTaskImpl === null) {
|
|
try {
|
|
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
var nodeRequire = module2 && module2[requireString];
|
|
enqueueTaskImpl = nodeRequire.call(module2, "timers").setImmediate;
|
|
} catch (_err) {
|
|
enqueueTaskImpl = function(callback) {
|
|
{
|
|
if (didWarnAboutMessageChannel === false) {
|
|
didWarnAboutMessageChannel = true;
|
|
if (typeof MessageChannel === "undefined") {
|
|
error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
|
|
}
|
|
}
|
|
}
|
|
var channel = new MessageChannel();
|
|
channel.port1.onmessage = callback;
|
|
channel.port2.postMessage(void 0);
|
|
};
|
|
}
|
|
}
|
|
return enqueueTaskImpl(task2);
|
|
}
|
|
var actScopeDepth = 0;
|
|
var didWarnNoAwaitAct = false;
|
|
function act(callback) {
|
|
{
|
|
var prevActScopeDepth = actScopeDepth;
|
|
actScopeDepth++;
|
|
if (ReactCurrentActQueue.current === null) {
|
|
ReactCurrentActQueue.current = [];
|
|
}
|
|
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
var result;
|
|
try {
|
|
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
result = callback();
|
|
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
var queue = ReactCurrentActQueue.current;
|
|
if (queue !== null) {
|
|
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
flushActQueue(queue);
|
|
}
|
|
}
|
|
} catch (error2) {
|
|
popActScope(prevActScopeDepth);
|
|
throw error2;
|
|
} finally {
|
|
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
}
|
|
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
var thenableResult = result;
|
|
var wasAwaited = false;
|
|
var thenable = {
|
|
then: function(resolve, reject) {
|
|
wasAwaited = true;
|
|
thenableResult.then(function(returnValue2) {
|
|
popActScope(prevActScopeDepth);
|
|
if (actScopeDepth === 0) {
|
|
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
|
} else {
|
|
resolve(returnValue2);
|
|
}
|
|
}, function(error2) {
|
|
popActScope(prevActScopeDepth);
|
|
reject(error2);
|
|
});
|
|
}
|
|
};
|
|
{
|
|
if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
|
|
Promise.resolve().then(function() {
|
|
}).then(function() {
|
|
if (!wasAwaited) {
|
|
didWarnNoAwaitAct = true;
|
|
error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
return thenable;
|
|
} else {
|
|
var returnValue = result;
|
|
popActScope(prevActScopeDepth);
|
|
if (actScopeDepth === 0) {
|
|
var _queue = ReactCurrentActQueue.current;
|
|
if (_queue !== null) {
|
|
flushActQueue(_queue);
|
|
ReactCurrentActQueue.current = null;
|
|
}
|
|
var _thenable = {
|
|
then: function(resolve, reject) {
|
|
if (ReactCurrentActQueue.current === null) {
|
|
ReactCurrentActQueue.current = [];
|
|
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
} else {
|
|
resolve(returnValue);
|
|
}
|
|
}
|
|
};
|
|
return _thenable;
|
|
} else {
|
|
var _thenable2 = {
|
|
then: function(resolve, reject) {
|
|
resolve(returnValue);
|
|
}
|
|
};
|
|
return _thenable2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function popActScope(prevActScopeDepth) {
|
|
{
|
|
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
|
}
|
|
actScopeDepth = prevActScopeDepth;
|
|
}
|
|
}
|
|
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
{
|
|
var queue = ReactCurrentActQueue.current;
|
|
if (queue !== null) {
|
|
try {
|
|
flushActQueue(queue);
|
|
enqueueTask(function() {
|
|
if (queue.length === 0) {
|
|
ReactCurrentActQueue.current = null;
|
|
resolve(returnValue);
|
|
} else {
|
|
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
}
|
|
});
|
|
} catch (error2) {
|
|
reject(error2);
|
|
}
|
|
} else {
|
|
resolve(returnValue);
|
|
}
|
|
}
|
|
}
|
|
var isFlushing = false;
|
|
function flushActQueue(queue) {
|
|
{
|
|
if (!isFlushing) {
|
|
isFlushing = true;
|
|
var i2 = 0;
|
|
try {
|
|
for (; i2 < queue.length; i2++) {
|
|
var callback = queue[i2];
|
|
do {
|
|
callback = callback(true);
|
|
} while (callback !== null);
|
|
}
|
|
queue.length = 0;
|
|
} catch (error2) {
|
|
queue = queue.slice(i2 + 1);
|
|
throw error2;
|
|
} finally {
|
|
isFlushing = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var createElement$1 = createElementWithValidation;
|
|
var cloneElement$1 = cloneElementWithValidation;
|
|
var createFactory = createFactoryWithValidation;
|
|
var Children = {
|
|
map: mapChildren,
|
|
forEach: forEachChildren,
|
|
count: countChildren,
|
|
toArray,
|
|
only: onlyChild
|
|
};
|
|
exports.Children = Children;
|
|
exports.Component = Component;
|
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
exports.Profiler = REACT_PROFILER_TYPE;
|
|
exports.PureComponent = PureComponent;
|
|
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
exports.cloneElement = cloneElement$1;
|
|
exports.createContext = createContext3;
|
|
exports.createElement = createElement$1;
|
|
exports.createFactory = createFactory;
|
|
exports.createRef = createRef;
|
|
exports.forwardRef = forwardRef3;
|
|
exports.isValidElement = isValidElement;
|
|
exports.lazy = lazy;
|
|
exports.memo = memo2;
|
|
exports.startTransition = startTransition;
|
|
exports.unstable_act = act;
|
|
exports.useCallback = useCallback;
|
|
exports.useContext = useContext6;
|
|
exports.useDebugValue = useDebugValue3;
|
|
exports.useDeferredValue = useDeferredValue;
|
|
exports.useEffect = useEffect7;
|
|
exports.useId = useId;
|
|
exports.useImperativeHandle = useImperativeHandle;
|
|
exports.useInsertionEffect = useInsertionEffect;
|
|
exports.useLayoutEffect = useLayoutEffect2;
|
|
exports.useMemo = useMemo4;
|
|
exports.useReducer = useReducer;
|
|
exports.useRef = useRef7;
|
|
exports.useState = useState7;
|
|
exports.useSyncExternalStore = useSyncExternalStore3;
|
|
exports.useTransition = useTransition;
|
|
exports.version = ReactVersion;
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
}
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react/index.js
|
|
var require_react = __commonJS({
|
|
"node_modules/react/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/cjs/scheduler.development.js
|
|
var require_scheduler_development = __commonJS({
|
|
"node_modules/scheduler/cjs/scheduler.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(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 enableSchedulerDebugging = false;
|
|
var enableProfiling = false;
|
|
var frameYieldMs = 5;
|
|
function push(heap, node) {
|
|
var index = heap.length;
|
|
heap.push(node);
|
|
siftUp(heap, node, index);
|
|
}
|
|
function peek(heap) {
|
|
return heap.length === 0 ? null : heap[0];
|
|
}
|
|
function pop(heap) {
|
|
if (heap.length === 0) {
|
|
return null;
|
|
}
|
|
var first = heap[0];
|
|
var last = heap.pop();
|
|
if (last !== first) {
|
|
heap[0] = last;
|
|
siftDown(heap, last, 0);
|
|
}
|
|
return first;
|
|
}
|
|
function siftUp(heap, node, i2) {
|
|
var index = i2;
|
|
while (index > 0) {
|
|
var parentIndex = index - 1 >>> 1;
|
|
var parent = heap[parentIndex];
|
|
if (compare(parent, node) > 0) {
|
|
heap[parentIndex] = node;
|
|
heap[index] = parent;
|
|
index = parentIndex;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function siftDown(heap, node, i2) {
|
|
var index = i2;
|
|
var length = heap.length;
|
|
var halfLength = length >>> 1;
|
|
while (index < halfLength) {
|
|
var leftIndex = (index + 1) * 2 - 1;
|
|
var left2 = heap[leftIndex];
|
|
var rightIndex = leftIndex + 1;
|
|
var right2 = heap[rightIndex];
|
|
if (compare(left2, node) < 0) {
|
|
if (rightIndex < length && compare(right2, left2) < 0) {
|
|
heap[index] = right2;
|
|
heap[rightIndex] = node;
|
|
index = rightIndex;
|
|
} else {
|
|
heap[index] = left2;
|
|
heap[leftIndex] = node;
|
|
index = leftIndex;
|
|
}
|
|
} else if (rightIndex < length && compare(right2, node) < 0) {
|
|
heap[index] = right2;
|
|
heap[rightIndex] = node;
|
|
index = rightIndex;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function compare(a2, b2) {
|
|
var diff = a2.sortIndex - b2.sortIndex;
|
|
return diff !== 0 ? diff : a2.id - b2.id;
|
|
}
|
|
var ImmediatePriority = 1;
|
|
var UserBlockingPriority = 2;
|
|
var NormalPriority = 3;
|
|
var LowPriority = 4;
|
|
var IdlePriority = 5;
|
|
function markTaskErrored(task2, ms) {
|
|
}
|
|
var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
|
|
if (hasPerformanceNow) {
|
|
var localPerformance = performance;
|
|
exports.unstable_now = function() {
|
|
return localPerformance.now();
|
|
};
|
|
} else {
|
|
var localDate = Date;
|
|
var initialTime = localDate.now();
|
|
exports.unstable_now = function() {
|
|
return localDate.now() - initialTime;
|
|
};
|
|
}
|
|
var maxSigned31BitInt = 1073741823;
|
|
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
|
|
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
|
var NORMAL_PRIORITY_TIMEOUT = 5e3;
|
|
var LOW_PRIORITY_TIMEOUT = 1e4;
|
|
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
|
|
var taskQueue = [];
|
|
var timerQueue = [];
|
|
var taskIdCounter = 1;
|
|
var currentTask = null;
|
|
var currentPriorityLevel = NormalPriority;
|
|
var isPerformingWork = false;
|
|
var isHostCallbackScheduled = false;
|
|
var isHostTimeoutScheduled = false;
|
|
var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
|
|
var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
|
|
var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
|
|
var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
|
|
function advanceTimers(currentTime) {
|
|
var timer = peek(timerQueue);
|
|
while (timer !== null) {
|
|
if (timer.callback === null) {
|
|
pop(timerQueue);
|
|
} else if (timer.startTime <= currentTime) {
|
|
pop(timerQueue);
|
|
timer.sortIndex = timer.expirationTime;
|
|
push(taskQueue, timer);
|
|
} else {
|
|
return;
|
|
}
|
|
timer = peek(timerQueue);
|
|
}
|
|
}
|
|
function handleTimeout(currentTime) {
|
|
isHostTimeoutScheduled = false;
|
|
advanceTimers(currentTime);
|
|
if (!isHostCallbackScheduled) {
|
|
if (peek(taskQueue) !== null) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
} else {
|
|
var firstTimer = peek(timerQueue);
|
|
if (firstTimer !== null) {
|
|
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function flushWork(hasTimeRemaining, initialTime2) {
|
|
isHostCallbackScheduled = false;
|
|
if (isHostTimeoutScheduled) {
|
|
isHostTimeoutScheduled = false;
|
|
cancelHostTimeout();
|
|
}
|
|
isPerformingWork = true;
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
try {
|
|
if (enableProfiling) {
|
|
try {
|
|
return workLoop(hasTimeRemaining, initialTime2);
|
|
} catch (error) {
|
|
if (currentTask !== null) {
|
|
var currentTime = exports.unstable_now();
|
|
markTaskErrored(currentTask, currentTime);
|
|
currentTask.isQueued = false;
|
|
}
|
|
throw error;
|
|
}
|
|
} else {
|
|
return workLoop(hasTimeRemaining, initialTime2);
|
|
}
|
|
} finally {
|
|
currentTask = null;
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
isPerformingWork = false;
|
|
}
|
|
}
|
|
function workLoop(hasTimeRemaining, initialTime2) {
|
|
var currentTime = initialTime2;
|
|
advanceTimers(currentTime);
|
|
currentTask = peek(taskQueue);
|
|
while (currentTask !== null && !enableSchedulerDebugging) {
|
|
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
|
|
break;
|
|
}
|
|
var callback = currentTask.callback;
|
|
if (typeof callback === "function") {
|
|
currentTask.callback = null;
|
|
currentPriorityLevel = currentTask.priorityLevel;
|
|
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
|
var continuationCallback = callback(didUserCallbackTimeout);
|
|
currentTime = exports.unstable_now();
|
|
if (typeof continuationCallback === "function") {
|
|
currentTask.callback = continuationCallback;
|
|
} else {
|
|
if (currentTask === peek(taskQueue)) {
|
|
pop(taskQueue);
|
|
}
|
|
}
|
|
advanceTimers(currentTime);
|
|
} else {
|
|
pop(taskQueue);
|
|
}
|
|
currentTask = peek(taskQueue);
|
|
}
|
|
if (currentTask !== null) {
|
|
return true;
|
|
} else {
|
|
var firstTimer = peek(timerQueue);
|
|
if (firstTimer !== null) {
|
|
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
function unstable_runWithPriority(priorityLevel, eventHandler) {
|
|
switch (priorityLevel) {
|
|
case ImmediatePriority:
|
|
case UserBlockingPriority:
|
|
case NormalPriority:
|
|
case LowPriority:
|
|
case IdlePriority:
|
|
break;
|
|
default:
|
|
priorityLevel = NormalPriority;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
}
|
|
function unstable_next(eventHandler) {
|
|
var priorityLevel;
|
|
switch (currentPriorityLevel) {
|
|
case ImmediatePriority:
|
|
case UserBlockingPriority:
|
|
case NormalPriority:
|
|
priorityLevel = NormalPriority;
|
|
break;
|
|
default:
|
|
priorityLevel = currentPriorityLevel;
|
|
break;
|
|
}
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = priorityLevel;
|
|
try {
|
|
return eventHandler();
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
}
|
|
function unstable_wrapCallback(callback) {
|
|
var parentPriorityLevel = currentPriorityLevel;
|
|
return function() {
|
|
var previousPriorityLevel = currentPriorityLevel;
|
|
currentPriorityLevel = parentPriorityLevel;
|
|
try {
|
|
return callback.apply(this, arguments);
|
|
} finally {
|
|
currentPriorityLevel = previousPriorityLevel;
|
|
}
|
|
};
|
|
}
|
|
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
var currentTime = exports.unstable_now();
|
|
var startTime2;
|
|
if (typeof options === "object" && options !== null) {
|
|
var delay = options.delay;
|
|
if (typeof delay === "number" && delay > 0) {
|
|
startTime2 = currentTime + delay;
|
|
} else {
|
|
startTime2 = currentTime;
|
|
}
|
|
} else {
|
|
startTime2 = currentTime;
|
|
}
|
|
var timeout;
|
|
switch (priorityLevel) {
|
|
case ImmediatePriority:
|
|
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
|
|
break;
|
|
case UserBlockingPriority:
|
|
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
|
|
break;
|
|
case IdlePriority:
|
|
timeout = IDLE_PRIORITY_TIMEOUT;
|
|
break;
|
|
case LowPriority:
|
|
timeout = LOW_PRIORITY_TIMEOUT;
|
|
break;
|
|
case NormalPriority:
|
|
default:
|
|
timeout = NORMAL_PRIORITY_TIMEOUT;
|
|
break;
|
|
}
|
|
var expirationTime = startTime2 + timeout;
|
|
var newTask = {
|
|
id: taskIdCounter++,
|
|
callback,
|
|
priorityLevel,
|
|
startTime: startTime2,
|
|
expirationTime,
|
|
sortIndex: -1
|
|
};
|
|
if (startTime2 > currentTime) {
|
|
newTask.sortIndex = startTime2;
|
|
push(timerQueue, newTask);
|
|
if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
|
|
if (isHostTimeoutScheduled) {
|
|
cancelHostTimeout();
|
|
} else {
|
|
isHostTimeoutScheduled = true;
|
|
}
|
|
requestHostTimeout(handleTimeout, startTime2 - currentTime);
|
|
}
|
|
} else {
|
|
newTask.sortIndex = expirationTime;
|
|
push(taskQueue, newTask);
|
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
}
|
|
}
|
|
return newTask;
|
|
}
|
|
function unstable_pauseExecution() {
|
|
}
|
|
function unstable_continueExecution() {
|
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
isHostCallbackScheduled = true;
|
|
requestHostCallback(flushWork);
|
|
}
|
|
}
|
|
function unstable_getFirstCallbackNode() {
|
|
return peek(taskQueue);
|
|
}
|
|
function unstable_cancelCallback(task2) {
|
|
task2.callback = null;
|
|
}
|
|
function unstable_getCurrentPriorityLevel() {
|
|
return currentPriorityLevel;
|
|
}
|
|
var isMessageLoopRunning = false;
|
|
var scheduledHostCallback = null;
|
|
var taskTimeoutID = -1;
|
|
var frameInterval = frameYieldMs;
|
|
var startTime = -1;
|
|
function shouldYieldToHost() {
|
|
var timeElapsed = exports.unstable_now() - startTime;
|
|
if (timeElapsed < frameInterval) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function requestPaint() {
|
|
}
|
|
function forceFrameRate(fps) {
|
|
if (fps < 0 || fps > 125) {
|
|
console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
|
|
return;
|
|
}
|
|
if (fps > 0) {
|
|
frameInterval = Math.floor(1e3 / fps);
|
|
} else {
|
|
frameInterval = frameYieldMs;
|
|
}
|
|
}
|
|
var performWorkUntilDeadline = function() {
|
|
if (scheduledHostCallback !== null) {
|
|
var currentTime = exports.unstable_now();
|
|
startTime = currentTime;
|
|
var hasTimeRemaining = true;
|
|
var hasMoreWork = true;
|
|
try {
|
|
hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
|
} finally {
|
|
if (hasMoreWork) {
|
|
schedulePerformWorkUntilDeadline();
|
|
} else {
|
|
isMessageLoopRunning = false;
|
|
scheduledHostCallback = null;
|
|
}
|
|
}
|
|
} else {
|
|
isMessageLoopRunning = false;
|
|
}
|
|
};
|
|
var schedulePerformWorkUntilDeadline;
|
|
if (typeof localSetImmediate === "function") {
|
|
schedulePerformWorkUntilDeadline = function() {
|
|
localSetImmediate(performWorkUntilDeadline);
|
|
};
|
|
} else if (typeof MessageChannel !== "undefined") {
|
|
var channel = new MessageChannel();
|
|
var port = channel.port2;
|
|
channel.port1.onmessage = performWorkUntilDeadline;
|
|
schedulePerformWorkUntilDeadline = function() {
|
|
port.postMessage(null);
|
|
};
|
|
} else {
|
|
schedulePerformWorkUntilDeadline = function() {
|
|
localSetTimeout(performWorkUntilDeadline, 0);
|
|
};
|
|
}
|
|
function requestHostCallback(callback) {
|
|
scheduledHostCallback = callback;
|
|
if (!isMessageLoopRunning) {
|
|
isMessageLoopRunning = true;
|
|
schedulePerformWorkUntilDeadline();
|
|
}
|
|
}
|
|
function requestHostTimeout(callback, ms) {
|
|
taskTimeoutID = localSetTimeout(function() {
|
|
callback(exports.unstable_now());
|
|
}, ms);
|
|
}
|
|
function cancelHostTimeout() {
|
|
localClearTimeout(taskTimeoutID);
|
|
taskTimeoutID = -1;
|
|
}
|
|
var unstable_requestPaint = requestPaint;
|
|
var unstable_Profiling = null;
|
|
exports.unstable_IdlePriority = IdlePriority;
|
|
exports.unstable_ImmediatePriority = ImmediatePriority;
|
|
exports.unstable_LowPriority = LowPriority;
|
|
exports.unstable_NormalPriority = NormalPriority;
|
|
exports.unstable_Profiling = unstable_Profiling;
|
|
exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
|
exports.unstable_cancelCallback = unstable_cancelCallback;
|
|
exports.unstable_continueExecution = unstable_continueExecution;
|
|
exports.unstable_forceFrameRate = forceFrameRate;
|
|
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
|
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
|
exports.unstable_next = unstable_next;
|
|
exports.unstable_pauseExecution = unstable_pauseExecution;
|
|
exports.unstable_requestPaint = unstable_requestPaint;
|
|
exports.unstable_runWithPriority = unstable_runWithPriority;
|
|
exports.unstable_scheduleCallback = unstable_scheduleCallback;
|
|
exports.unstable_shouldYield = shouldYieldToHost;
|
|
exports.unstable_wrapCallback = unstable_wrapCallback;
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
}
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/scheduler/index.js
|
|
var require_scheduler = __commonJS({
|
|
"node_modules/scheduler/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_scheduler_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/cjs/react-dom.development.js
|
|
var require_react_dom_development = __commonJS({
|
|
"node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(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 React11 = require_react();
|
|
var Scheduler = require_scheduler();
|
|
var ReactSharedInternals = React11.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
var suppressWarning = false;
|
|
function setSuppressWarning(newSuppressWarning) {
|
|
{
|
|
suppressWarning = newSuppressWarning;
|
|
}
|
|
}
|
|
function warn(format) {
|
|
{
|
|
if (!suppressWarning) {
|
|
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) {
|
|
{
|
|
if (!suppressWarning) {
|
|
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 FunctionComponent = 0;
|
|
var ClassComponent = 1;
|
|
var IndeterminateComponent = 2;
|
|
var HostRoot = 3;
|
|
var HostPortal = 4;
|
|
var HostComponent = 5;
|
|
var HostText = 6;
|
|
var Fragment6 = 7;
|
|
var Mode = 8;
|
|
var ContextConsumer = 9;
|
|
var ContextProvider = 10;
|
|
var ForwardRef2 = 11;
|
|
var Profiler = 12;
|
|
var SuspenseComponent = 13;
|
|
var MemoComponent = 14;
|
|
var SimpleMemoComponent = 15;
|
|
var LazyComponent = 16;
|
|
var IncompleteClassComponent = 17;
|
|
var DehydratedFragment = 18;
|
|
var SuspenseListComponent = 19;
|
|
var ScopeComponent = 21;
|
|
var OffscreenComponent = 22;
|
|
var LegacyHiddenComponent = 23;
|
|
var CacheComponent = 24;
|
|
var TracingMarkerComponent = 25;
|
|
var enableClientRenderFallbackOnTextMismatch = true;
|
|
var enableNewReconciler = false;
|
|
var enableLazyContextPropagation = false;
|
|
var enableLegacyHidden = false;
|
|
var enableSuspenseAvoidThisFallback = false;
|
|
var disableCommentsAsDOMContainers = true;
|
|
var enableCustomElementPropertySupport = false;
|
|
var warnAboutStringRefs = false;
|
|
var enableSchedulingProfiler = true;
|
|
var enableProfilerTimer = true;
|
|
var enableProfilerCommitHooks = true;
|
|
var allNativeEvents = /* @__PURE__ */ new Set();
|
|
var registrationNameDependencies = {};
|
|
var possibleRegistrationNames = {};
|
|
function registerTwoPhaseEvent(registrationName, dependencies) {
|
|
registerDirectEvent(registrationName, dependencies);
|
|
registerDirectEvent(registrationName + "Capture", dependencies);
|
|
}
|
|
function registerDirectEvent(registrationName, dependencies) {
|
|
{
|
|
if (registrationNameDependencies[registrationName]) {
|
|
error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
|
|
}
|
|
}
|
|
registrationNameDependencies[registrationName] = dependencies;
|
|
{
|
|
var lowerCasedName = registrationName.toLowerCase();
|
|
possibleRegistrationNames[lowerCasedName] = registrationName;
|
|
if (registrationName === "onDoubleClick") {
|
|
possibleRegistrationNames.ondblclick = registrationName;
|
|
}
|
|
}
|
|
for (var i2 = 0; i2 < dependencies.length; i2++) {
|
|
allNativeEvents.add(dependencies[i2]);
|
|
}
|
|
}
|
|
var canUseDOM2 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
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 (e) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
function testStringCoercion(value) {
|
|
return "" + value;
|
|
}
|
|
function checkAttributeStringCoercion(value, attributeName) {
|
|
{
|
|
if (willCoercionThrow(value)) {
|
|
error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value));
|
|
return testStringCoercion(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 checkPropStringCoercion(value, propName) {
|
|
{
|
|
if (willCoercionThrow(value)) {
|
|
error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
}
|
|
function checkCSSPropertyStringCoercion(value, propName) {
|
|
{
|
|
if (willCoercionThrow(value)) {
|
|
error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
}
|
|
function checkHtmlStringCoercion(value) {
|
|
{
|
|
if (willCoercionThrow(value)) {
|
|
error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
}
|
|
function checkFormFieldValueStringCoercion(value) {
|
|
{
|
|
if (willCoercionThrow(value)) {
|
|
error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
return testStringCoercion(value);
|
|
}
|
|
}
|
|
}
|
|
var RESERVED = 0;
|
|
var STRING = 1;
|
|
var BOOLEANISH_STRING = 2;
|
|
var BOOLEAN = 3;
|
|
var OVERLOADED_BOOLEAN = 4;
|
|
var NUMERIC = 5;
|
|
var POSITIVE_NUMERIC = 6;
|
|
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var illegalAttributeNameCache = {};
|
|
var validatedAttributeNameCache = {};
|
|
function isAttributeNameSafe(attributeName) {
|
|
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
|
return true;
|
|
}
|
|
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
|
return false;
|
|
}
|
|
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
|
validatedAttributeNameCache[attributeName] = true;
|
|
return true;
|
|
}
|
|
illegalAttributeNameCache[attributeName] = true;
|
|
{
|
|
error("Invalid attribute name: `%s`", attributeName);
|
|
}
|
|
return false;
|
|
}
|
|
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
|
if (propertyInfo !== null) {
|
|
return propertyInfo.type === RESERVED;
|
|
}
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
|
if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
|
return false;
|
|
}
|
|
switch (typeof value) {
|
|
case "function":
|
|
case "symbol":
|
|
return true;
|
|
case "boolean": {
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (propertyInfo !== null) {
|
|
return !propertyInfo.acceptsBooleans;
|
|
} else {
|
|
var prefix3 = name.toLowerCase().slice(0, 5);
|
|
return prefix3 !== "data-" && prefix3 !== "aria-";
|
|
}
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
|
if (value === null || typeof value === "undefined") {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
|
return true;
|
|
}
|
|
if (isCustomComponentTag) {
|
|
return false;
|
|
}
|
|
if (propertyInfo !== null) {
|
|
switch (propertyInfo.type) {
|
|
case BOOLEAN:
|
|
return !value;
|
|
case OVERLOADED_BOOLEAN:
|
|
return value === false;
|
|
case NUMERIC:
|
|
return isNaN(value);
|
|
case POSITIVE_NUMERIC:
|
|
return isNaN(value) || value < 1;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function getPropertyInfo(name) {
|
|
return properties2.hasOwnProperty(name) ? properties2[name] : null;
|
|
}
|
|
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
|
|
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
this.attributeName = attributeName;
|
|
this.attributeNamespace = attributeNamespace;
|
|
this.mustUseProperty = mustUseProperty;
|
|
this.propertyName = name;
|
|
this.type = type;
|
|
this.sanitizeURL = sanitizeURL2;
|
|
this.removeEmptyString = removeEmptyString;
|
|
}
|
|
var properties2 = {};
|
|
var reservedProps = [
|
|
"children",
|
|
"dangerouslySetInnerHTML",
|
|
"defaultValue",
|
|
"defaultChecked",
|
|
"innerHTML",
|
|
"suppressContentEditableWarning",
|
|
"suppressHydrationWarning",
|
|
"style"
|
|
];
|
|
reservedProps.forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
RESERVED,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
|
|
var name = _ref[0], attributeName = _ref[1];
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEANISH_STRING,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEANISH_STRING,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"allowFullScreen",
|
|
"async",
|
|
"autoFocus",
|
|
"autoPlay",
|
|
"controls",
|
|
"default",
|
|
"defer",
|
|
"disabled",
|
|
"disablePictureInPicture",
|
|
"disableRemotePlayback",
|
|
"formNoValidate",
|
|
"hidden",
|
|
"loop",
|
|
"noModule",
|
|
"noValidate",
|
|
"open",
|
|
"playsInline",
|
|
"readOnly",
|
|
"required",
|
|
"reversed",
|
|
"scoped",
|
|
"seamless",
|
|
"itemScope"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEAN,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"checked",
|
|
"multiple",
|
|
"muted",
|
|
"selected"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEAN,
|
|
true,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"capture",
|
|
"download"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
OVERLOADED_BOOLEAN,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"cols",
|
|
"rows",
|
|
"size",
|
|
"span"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
POSITIVE_NUMERIC,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["rowSpan", "start"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
NUMERIC,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
var capitalize2 = function(token) {
|
|
return token[1].toUpperCase();
|
|
};
|
|
[
|
|
"accent-height",
|
|
"alignment-baseline",
|
|
"arabic-form",
|
|
"baseline-shift",
|
|
"cap-height",
|
|
"clip-path",
|
|
"clip-rule",
|
|
"color-interpolation",
|
|
"color-interpolation-filters",
|
|
"color-profile",
|
|
"color-rendering",
|
|
"dominant-baseline",
|
|
"enable-background",
|
|
"fill-opacity",
|
|
"fill-rule",
|
|
"flood-color",
|
|
"flood-opacity",
|
|
"font-family",
|
|
"font-size",
|
|
"font-size-adjust",
|
|
"font-stretch",
|
|
"font-style",
|
|
"font-variant",
|
|
"font-weight",
|
|
"glyph-name",
|
|
"glyph-orientation-horizontal",
|
|
"glyph-orientation-vertical",
|
|
"horiz-adv-x",
|
|
"horiz-origin-x",
|
|
"image-rendering",
|
|
"letter-spacing",
|
|
"lighting-color",
|
|
"marker-end",
|
|
"marker-mid",
|
|
"marker-start",
|
|
"overline-position",
|
|
"overline-thickness",
|
|
"paint-order",
|
|
"panose-1",
|
|
"pointer-events",
|
|
"rendering-intent",
|
|
"shape-rendering",
|
|
"stop-color",
|
|
"stop-opacity",
|
|
"strikethrough-position",
|
|
"strikethrough-thickness",
|
|
"stroke-dasharray",
|
|
"stroke-dashoffset",
|
|
"stroke-linecap",
|
|
"stroke-linejoin",
|
|
"stroke-miterlimit",
|
|
"stroke-opacity",
|
|
"stroke-width",
|
|
"text-anchor",
|
|
"text-decoration",
|
|
"text-rendering",
|
|
"underline-position",
|
|
"underline-thickness",
|
|
"unicode-bidi",
|
|
"unicode-range",
|
|
"units-per-em",
|
|
"v-alphabetic",
|
|
"v-hanging",
|
|
"v-ideographic",
|
|
"v-mathematical",
|
|
"vector-effect",
|
|
"vert-adv-y",
|
|
"vert-origin-x",
|
|
"vert-origin-y",
|
|
"word-spacing",
|
|
"writing-mode",
|
|
"xmlns:xlink",
|
|
"x-height"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"xlink:actuate",
|
|
"xlink:arcrole",
|
|
"xlink:role",
|
|
"xlink:show",
|
|
"xlink:title",
|
|
"xlink:type"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
"http://www.w3.org/1999/xlink",
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"xml:base",
|
|
"xml:lang",
|
|
"xml:space"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
"http://www.w3.org/XML/1998/namespace",
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
|
|
properties2[attributeName] = new PropertyInfoRecord(
|
|
attributeName,
|
|
STRING,
|
|
false,
|
|
attributeName.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
var xlinkHref = "xlinkHref";
|
|
properties2[xlinkHref] = new PropertyInfoRecord(
|
|
"xlinkHref",
|
|
STRING,
|
|
false,
|
|
"xlink:href",
|
|
"http://www.w3.org/1999/xlink",
|
|
true,
|
|
false
|
|
);
|
|
["src", "href", "action", "formAction"].forEach(function(attributeName) {
|
|
properties2[attributeName] = new PropertyInfoRecord(
|
|
attributeName,
|
|
STRING,
|
|
false,
|
|
attributeName.toLowerCase(),
|
|
null,
|
|
true,
|
|
true
|
|
);
|
|
});
|
|
var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
|
|
var didWarn = false;
|
|
function sanitizeURL(url) {
|
|
{
|
|
if (!didWarn && isJavaScriptProtocol.test(url)) {
|
|
didWarn = true;
|
|
error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
|
|
}
|
|
}
|
|
}
|
|
function getValueForProperty(node, name, expected, propertyInfo) {
|
|
{
|
|
if (propertyInfo.mustUseProperty) {
|
|
var propertyName = propertyInfo.propertyName;
|
|
return node[propertyName];
|
|
} else {
|
|
{
|
|
checkAttributeStringCoercion(expected, name);
|
|
}
|
|
if (propertyInfo.sanitizeURL) {
|
|
sanitizeURL("" + expected);
|
|
}
|
|
var attributeName = propertyInfo.attributeName;
|
|
var stringValue = null;
|
|
if (propertyInfo.type === OVERLOADED_BOOLEAN) {
|
|
if (node.hasAttribute(attributeName)) {
|
|
var value = node.getAttribute(attributeName);
|
|
if (value === "") {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return value;
|
|
}
|
|
if (value === "" + expected) {
|
|
return expected;
|
|
}
|
|
return value;
|
|
}
|
|
} else if (node.hasAttribute(attributeName)) {
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return node.getAttribute(attributeName);
|
|
}
|
|
if (propertyInfo.type === BOOLEAN) {
|
|
return expected;
|
|
}
|
|
stringValue = node.getAttribute(attributeName);
|
|
}
|
|
if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
|
return stringValue === null ? expected : stringValue;
|
|
} else if (stringValue === "" + expected) {
|
|
return expected;
|
|
} else {
|
|
return stringValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getValueForAttribute(node, name, expected, isCustomComponentTag) {
|
|
{
|
|
if (!isAttributeNameSafe(name)) {
|
|
return;
|
|
}
|
|
if (!node.hasAttribute(name)) {
|
|
return expected === void 0 ? void 0 : null;
|
|
}
|
|
var value = node.getAttribute(name);
|
|
{
|
|
checkAttributeStringCoercion(expected, name);
|
|
}
|
|
if (value === "" + expected) {
|
|
return expected;
|
|
}
|
|
return value;
|
|
}
|
|
}
|
|
function setValueForProperty(node, name, value, isCustomComponentTag) {
|
|
var propertyInfo = getPropertyInfo(name);
|
|
if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
|
|
return;
|
|
}
|
|
if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
|
|
value = null;
|
|
}
|
|
if (isCustomComponentTag || propertyInfo === null) {
|
|
if (isAttributeNameSafe(name)) {
|
|
var _attributeName = name;
|
|
if (value === null) {
|
|
node.removeAttribute(_attributeName);
|
|
} else {
|
|
{
|
|
checkAttributeStringCoercion(value, name);
|
|
}
|
|
node.setAttribute(_attributeName, "" + value);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
var mustUseProperty = propertyInfo.mustUseProperty;
|
|
if (mustUseProperty) {
|
|
var propertyName = propertyInfo.propertyName;
|
|
if (value === null) {
|
|
var type = propertyInfo.type;
|
|
node[propertyName] = type === BOOLEAN ? false : "";
|
|
} else {
|
|
node[propertyName] = value;
|
|
}
|
|
return;
|
|
}
|
|
var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
|
|
if (value === null) {
|
|
node.removeAttribute(attributeName);
|
|
} else {
|
|
var _type = propertyInfo.type;
|
|
var attributeValue;
|
|
if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
|
|
attributeValue = "";
|
|
} else {
|
|
{
|
|
{
|
|
checkAttributeStringCoercion(value, attributeName);
|
|
}
|
|
attributeValue = "" + value;
|
|
}
|
|
if (propertyInfo.sanitizeURL) {
|
|
sanitizeURL(attributeValue.toString());
|
|
}
|
|
}
|
|
if (attributeNamespace) {
|
|
node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
|
|
} else {
|
|
node.setAttribute(attributeName, attributeValue);
|
|
}
|
|
}
|
|
}
|
|
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_SCOPE_TYPE = Symbol.for("react.scope");
|
|
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
|
|
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
|
|
var REACT_CACHE_TYPE = Symbol.for("react.cache");
|
|
var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
|
|
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 assign = Object.assign;
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix2;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix2 === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
var match = x2.stack.trim().match(/\n( *(at )?)/);
|
|
prefix2 = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix2 + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn2, construct) {
|
|
if (!fn2 || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn2);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher.current;
|
|
ReactCurrentDispatcher.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
Reflect.construct(fn2, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s2 = sampleLines.length - 1;
|
|
var c2 = controlLines.length - 1;
|
|
while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
|
|
c2--;
|
|
}
|
|
for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
|
|
if (sampleLines[s2] !== controlLines[c2]) {
|
|
if (s2 !== 1 || c2 !== 1) {
|
|
do {
|
|
s2--;
|
|
c2--;
|
|
if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
|
|
var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
|
|
if (fn2.displayName && _frame.includes("<anonymous>")) {
|
|
_frame = _frame.replace("<anonymous>", fn2.displayName);
|
|
}
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s2 >= 1 && c2 >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn2 ? fn2.displayName || fn2.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeClassComponentFrame(ctor, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(ctor, true);
|
|
}
|
|
}
|
|
function describeFunctionComponentFrame(fn2, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn2, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case REACT_SUSPENSE_TYPE:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x2) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function describeFiber(fiber) {
|
|
var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
|
|
var source = fiber._debugSource;
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
return describeBuiltInComponentFrame(fiber.type);
|
|
case LazyComponent:
|
|
return describeBuiltInComponentFrame("Lazy");
|
|
case SuspenseComponent:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case SuspenseListComponent:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
case FunctionComponent:
|
|
case IndeterminateComponent:
|
|
case SimpleMemoComponent:
|
|
return describeFunctionComponentFrame(fiber.type);
|
|
case ForwardRef2:
|
|
return describeFunctionComponentFrame(fiber.type.render);
|
|
case ClassComponent:
|
|
return describeClassComponentFrame(fiber.type);
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
function getStackByFiberInDevAndProd(workInProgress2) {
|
|
try {
|
|
var info = "";
|
|
var node = workInProgress2;
|
|
do {
|
|
info += describeFiber(node);
|
|
node = node.return;
|
|
} while (node);
|
|
return info;
|
|
} catch (x2) {
|
|
return "\nError generating stack: " + x2.message + "\n" + x2.stack;
|
|
}
|
|
}
|
|
function getWrappedName2(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 getWrappedName2(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;
|
|
}
|
|
function getWrappedName$1(outerType, innerType, wrapperName) {
|
|
var functionName = innerType.displayName || innerType.name || "";
|
|
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
}
|
|
function getContextName$1(type) {
|
|
return type.displayName || "Context";
|
|
}
|
|
function getComponentNameFromFiber(fiber) {
|
|
var tag = fiber.tag, type = fiber.type;
|
|
switch (tag) {
|
|
case CacheComponent:
|
|
return "Cache";
|
|
case ContextConsumer:
|
|
var context = type;
|
|
return getContextName$1(context) + ".Consumer";
|
|
case ContextProvider:
|
|
var provider = type;
|
|
return getContextName$1(provider._context) + ".Provider";
|
|
case DehydratedFragment:
|
|
return "DehydratedFragment";
|
|
case ForwardRef2:
|
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
|
case Fragment6:
|
|
return "Fragment";
|
|
case HostComponent:
|
|
return type;
|
|
case HostPortal:
|
|
return "Portal";
|
|
case HostRoot:
|
|
return "Root";
|
|
case HostText:
|
|
return "Text";
|
|
case LazyComponent:
|
|
return getComponentNameFromType(type);
|
|
case Mode:
|
|
if (type === REACT_STRICT_MODE_TYPE) {
|
|
return "StrictMode";
|
|
}
|
|
return "Mode";
|
|
case OffscreenComponent:
|
|
return "Offscreen";
|
|
case Profiler:
|
|
return "Profiler";
|
|
case ScopeComponent:
|
|
return "Scope";
|
|
case SuspenseComponent:
|
|
return "Suspense";
|
|
case SuspenseListComponent:
|
|
return "SuspenseList";
|
|
case TracingMarkerComponent:
|
|
return "TracingMarker";
|
|
case ClassComponent:
|
|
case FunctionComponent:
|
|
case IncompleteClassComponent:
|
|
case IndeterminateComponent:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent:
|
|
if (typeof type === "function") {
|
|
return type.displayName || type.name || null;
|
|
}
|
|
if (typeof type === "string") {
|
|
return type;
|
|
}
|
|
break;
|
|
}
|
|
return null;
|
|
}
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var current = null;
|
|
var isRendering = false;
|
|
function getCurrentFiberOwnerNameInDevOrNull() {
|
|
{
|
|
if (current === null) {
|
|
return null;
|
|
}
|
|
var owner = current._debugOwner;
|
|
if (owner !== null && typeof owner !== "undefined") {
|
|
return getComponentNameFromFiber(owner);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getCurrentFiberStackInDev() {
|
|
{
|
|
if (current === null) {
|
|
return "";
|
|
}
|
|
return getStackByFiberInDevAndProd(current);
|
|
}
|
|
}
|
|
function resetCurrentFiber() {
|
|
{
|
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
current = null;
|
|
isRendering = false;
|
|
}
|
|
}
|
|
function setCurrentFiber(fiber) {
|
|
{
|
|
ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;
|
|
current = fiber;
|
|
isRendering = false;
|
|
}
|
|
}
|
|
function getCurrentFiber() {
|
|
{
|
|
return current;
|
|
}
|
|
}
|
|
function setIsRendering(rendering) {
|
|
{
|
|
isRendering = rendering;
|
|
}
|
|
}
|
|
function toString(value) {
|
|
return "" + value;
|
|
}
|
|
function getToStringValue(value) {
|
|
switch (typeof value) {
|
|
case "boolean":
|
|
case "number":
|
|
case "string":
|
|
case "undefined":
|
|
return value;
|
|
case "object":
|
|
{
|
|
checkFormFieldValueStringCoercion(value);
|
|
}
|
|
return value;
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
var hasReadOnlyValue = {
|
|
button: true,
|
|
checkbox: true,
|
|
image: true,
|
|
hidden: true,
|
|
radio: true,
|
|
reset: true,
|
|
submit: true
|
|
};
|
|
function checkControlledValueProps(tagName, props) {
|
|
{
|
|
if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
|
|
error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
|
|
}
|
|
if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
|
|
error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
|
|
}
|
|
}
|
|
}
|
|
function isCheckable(elem) {
|
|
var type = elem.type;
|
|
var nodeName = elem.nodeName;
|
|
return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
|
|
}
|
|
function getTracker(node) {
|
|
return node._valueTracker;
|
|
}
|
|
function detachTracker(node) {
|
|
node._valueTracker = null;
|
|
}
|
|
function getValueFromNode(node) {
|
|
var value = "";
|
|
if (!node) {
|
|
return value;
|
|
}
|
|
if (isCheckable(node)) {
|
|
value = node.checked ? "true" : "false";
|
|
} else {
|
|
value = node.value;
|
|
}
|
|
return value;
|
|
}
|
|
function trackValueOnNode(node) {
|
|
var valueField = isCheckable(node) ? "checked" : "value";
|
|
var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
|
|
{
|
|
checkFormFieldValueStringCoercion(node[valueField]);
|
|
}
|
|
var currentValue = "" + node[valueField];
|
|
if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
|
|
return;
|
|
}
|
|
var get2 = descriptor.get, set2 = descriptor.set;
|
|
Object.defineProperty(node, valueField, {
|
|
configurable: true,
|
|
get: function() {
|
|
return get2.call(this);
|
|
},
|
|
set: function(value) {
|
|
{
|
|
checkFormFieldValueStringCoercion(value);
|
|
}
|
|
currentValue = "" + value;
|
|
set2.call(this, value);
|
|
}
|
|
});
|
|
Object.defineProperty(node, valueField, {
|
|
enumerable: descriptor.enumerable
|
|
});
|
|
var tracker = {
|
|
getValue: function() {
|
|
return currentValue;
|
|
},
|
|
setValue: function(value) {
|
|
{
|
|
checkFormFieldValueStringCoercion(value);
|
|
}
|
|
currentValue = "" + value;
|
|
},
|
|
stopTracking: function() {
|
|
detachTracker(node);
|
|
delete node[valueField];
|
|
}
|
|
};
|
|
return tracker;
|
|
}
|
|
function track(node) {
|
|
if (getTracker(node)) {
|
|
return;
|
|
}
|
|
node._valueTracker = trackValueOnNode(node);
|
|
}
|
|
function updateValueIfChanged(node) {
|
|
if (!node) {
|
|
return false;
|
|
}
|
|
var tracker = getTracker(node);
|
|
if (!tracker) {
|
|
return true;
|
|
}
|
|
var lastValue = tracker.getValue();
|
|
var nextValue = getValueFromNode(node);
|
|
if (nextValue !== lastValue) {
|
|
tracker.setValue(nextValue);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function getActiveElement(doc) {
|
|
doc = doc || (typeof document !== "undefined" ? document : void 0);
|
|
if (typeof doc === "undefined") {
|
|
return null;
|
|
}
|
|
try {
|
|
return doc.activeElement || doc.body;
|
|
} catch (e) {
|
|
return doc.body;
|
|
}
|
|
}
|
|
var didWarnValueDefaultValue = false;
|
|
var didWarnCheckedDefaultChecked = false;
|
|
var didWarnControlledToUncontrolled = false;
|
|
var didWarnUncontrolledToControlled = false;
|
|
function isControlled(props) {
|
|
var usesChecked = props.type === "checkbox" || props.type === "radio";
|
|
return usesChecked ? props.checked != null : props.value != null;
|
|
}
|
|
function getHostProps(element, props) {
|
|
var node = element;
|
|
var checked = props.checked;
|
|
var hostProps = assign({}, props, {
|
|
defaultChecked: void 0,
|
|
defaultValue: void 0,
|
|
value: void 0,
|
|
checked: checked != null ? checked : node._wrapperState.initialChecked
|
|
});
|
|
return hostProps;
|
|
}
|
|
function initWrapperState(element, props) {
|
|
{
|
|
checkControlledValueProps("input", props);
|
|
if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
|
|
error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
|
|
didWarnCheckedDefaultChecked = true;
|
|
}
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
|
|
error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
|
|
didWarnValueDefaultValue = true;
|
|
}
|
|
}
|
|
var node = element;
|
|
var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
|
|
node._wrapperState = {
|
|
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
|
|
initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
|
|
controlled: isControlled(props)
|
|
};
|
|
}
|
|
function updateChecked(element, props) {
|
|
var node = element;
|
|
var checked = props.checked;
|
|
if (checked != null) {
|
|
setValueForProperty(node, "checked", checked, false);
|
|
}
|
|
}
|
|
function updateWrapper(element, props) {
|
|
var node = element;
|
|
{
|
|
var controlled = isControlled(props);
|
|
if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
|
|
error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnUncontrolledToControlled = true;
|
|
}
|
|
if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
|
|
error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnControlledToUncontrolled = true;
|
|
}
|
|
}
|
|
updateChecked(element, props);
|
|
var value = getToStringValue(props.value);
|
|
var type = props.type;
|
|
if (value != null) {
|
|
if (type === "number") {
|
|
if (value === 0 && node.value === "" || node.value != value) {
|
|
node.value = toString(value);
|
|
}
|
|
} else if (node.value !== toString(value)) {
|
|
node.value = toString(value);
|
|
}
|
|
} else if (type === "submit" || type === "reset") {
|
|
node.removeAttribute("value");
|
|
return;
|
|
}
|
|
{
|
|
if (props.hasOwnProperty("value")) {
|
|
setDefaultValue(node, props.type, value);
|
|
} else if (props.hasOwnProperty("defaultValue")) {
|
|
setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
|
|
}
|
|
}
|
|
{
|
|
if (props.checked == null && props.defaultChecked != null) {
|
|
node.defaultChecked = !!props.defaultChecked;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper(element, props, isHydrating2) {
|
|
var node = element;
|
|
if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
|
|
var type = props.type;
|
|
var isButton = type === "submit" || type === "reset";
|
|
if (isButton && (props.value === void 0 || props.value === null)) {
|
|
return;
|
|
}
|
|
var initialValue = toString(node._wrapperState.initialValue);
|
|
if (!isHydrating2) {
|
|
{
|
|
if (initialValue !== node.value) {
|
|
node.value = initialValue;
|
|
}
|
|
}
|
|
}
|
|
{
|
|
node.defaultValue = initialValue;
|
|
}
|
|
}
|
|
var name = node.name;
|
|
if (name !== "") {
|
|
node.name = "";
|
|
}
|
|
{
|
|
node.defaultChecked = !node.defaultChecked;
|
|
node.defaultChecked = !!node._wrapperState.initialChecked;
|
|
}
|
|
if (name !== "") {
|
|
node.name = name;
|
|
}
|
|
}
|
|
function restoreControlledState(element, props) {
|
|
var node = element;
|
|
updateWrapper(node, props);
|
|
updateNamedCousins(node, props);
|
|
}
|
|
function updateNamedCousins(rootNode, props) {
|
|
var name = props.name;
|
|
if (props.type === "radio" && name != null) {
|
|
var queryRoot = rootNode;
|
|
while (queryRoot.parentNode) {
|
|
queryRoot = queryRoot.parentNode;
|
|
}
|
|
{
|
|
checkAttributeStringCoercion(name, "name");
|
|
}
|
|
var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
|
|
for (var i2 = 0; i2 < group.length; i2++) {
|
|
var otherNode = group[i2];
|
|
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
|
continue;
|
|
}
|
|
var otherProps = getFiberCurrentPropsFromNode(otherNode);
|
|
if (!otherProps) {
|
|
throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
|
|
}
|
|
updateValueIfChanged(otherNode);
|
|
updateWrapper(otherNode, otherProps);
|
|
}
|
|
}
|
|
}
|
|
function setDefaultValue(node, type, value) {
|
|
if (type !== "number" || getActiveElement(node.ownerDocument) !== node) {
|
|
if (value == null) {
|
|
node.defaultValue = toString(node._wrapperState.initialValue);
|
|
} else if (node.defaultValue !== toString(value)) {
|
|
node.defaultValue = toString(value);
|
|
}
|
|
}
|
|
}
|
|
var didWarnSelectedSetOnOption = false;
|
|
var didWarnInvalidChild = false;
|
|
var didWarnInvalidInnerHTML = false;
|
|
function validateProps(element, props) {
|
|
{
|
|
if (props.value == null) {
|
|
if (typeof props.children === "object" && props.children !== null) {
|
|
React11.Children.forEach(props.children, function(child) {
|
|
if (child == null) {
|
|
return;
|
|
}
|
|
if (typeof child === "string" || typeof child === "number") {
|
|
return;
|
|
}
|
|
if (!didWarnInvalidChild) {
|
|
didWarnInvalidChild = true;
|
|
error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
|
|
}
|
|
});
|
|
} else if (props.dangerouslySetInnerHTML != null) {
|
|
if (!didWarnInvalidInnerHTML) {
|
|
didWarnInvalidInnerHTML = true;
|
|
error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
|
|
}
|
|
}
|
|
}
|
|
if (props.selected != null && !didWarnSelectedSetOnOption) {
|
|
error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
|
|
didWarnSelectedSetOnOption = true;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper$1(element, props) {
|
|
if (props.value != null) {
|
|
element.setAttribute("value", toString(getToStringValue(props.value)));
|
|
}
|
|
}
|
|
var isArrayImpl = Array.isArray;
|
|
function isArray(a2) {
|
|
return isArrayImpl(a2);
|
|
}
|
|
var didWarnValueDefaultValue$1;
|
|
{
|
|
didWarnValueDefaultValue$1 = false;
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
|
if (ownerName) {
|
|
return "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
return "";
|
|
}
|
|
var valuePropNames = ["value", "defaultValue"];
|
|
function checkSelectPropTypes(props) {
|
|
{
|
|
checkControlledValueProps("select", props);
|
|
for (var i2 = 0; i2 < valuePropNames.length; i2++) {
|
|
var propName = valuePropNames[i2];
|
|
if (props[propName] == null) {
|
|
continue;
|
|
}
|
|
var propNameIsArray = isArray(props[propName]);
|
|
if (props.multiple && !propNameIsArray) {
|
|
error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
|
|
} else if (!props.multiple && propNameIsArray) {
|
|
error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function updateOptions(node, multiple, propValue, setDefaultSelected) {
|
|
var options2 = node.options;
|
|
if (multiple) {
|
|
var selectedValues = propValue;
|
|
var selectedValue = {};
|
|
for (var i2 = 0; i2 < selectedValues.length; i2++) {
|
|
selectedValue["$" + selectedValues[i2]] = true;
|
|
}
|
|
for (var _i = 0; _i < options2.length; _i++) {
|
|
var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
|
|
if (options2[_i].selected !== selected) {
|
|
options2[_i].selected = selected;
|
|
}
|
|
if (selected && setDefaultSelected) {
|
|
options2[_i].defaultSelected = true;
|
|
}
|
|
}
|
|
} else {
|
|
var _selectedValue = toString(getToStringValue(propValue));
|
|
var defaultSelected = null;
|
|
for (var _i2 = 0; _i2 < options2.length; _i2++) {
|
|
if (options2[_i2].value === _selectedValue) {
|
|
options2[_i2].selected = true;
|
|
if (setDefaultSelected) {
|
|
options2[_i2].defaultSelected = true;
|
|
}
|
|
return;
|
|
}
|
|
if (defaultSelected === null && !options2[_i2].disabled) {
|
|
defaultSelected = options2[_i2];
|
|
}
|
|
}
|
|
if (defaultSelected !== null) {
|
|
defaultSelected.selected = true;
|
|
}
|
|
}
|
|
}
|
|
function getHostProps$1(element, props) {
|
|
return assign({}, props, {
|
|
value: void 0
|
|
});
|
|
}
|
|
function initWrapperState$1(element, props) {
|
|
var node = element;
|
|
{
|
|
checkSelectPropTypes(props);
|
|
}
|
|
node._wrapperState = {
|
|
wasMultiple: !!props.multiple
|
|
};
|
|
{
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
|
|
error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
|
|
didWarnValueDefaultValue$1 = true;
|
|
}
|
|
}
|
|
}
|
|
function postMountWrapper$2(element, props) {
|
|
var node = element;
|
|
node.multiple = !!props.multiple;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
} else if (props.defaultValue != null) {
|
|
updateOptions(node, !!props.multiple, props.defaultValue, true);
|
|
}
|
|
}
|
|
function postUpdateWrapper(element, props) {
|
|
var node = element;
|
|
var wasMultiple = node._wrapperState.wasMultiple;
|
|
node._wrapperState.wasMultiple = !!props.multiple;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
} else if (wasMultiple !== !!props.multiple) {
|
|
if (props.defaultValue != null) {
|
|
updateOptions(node, !!props.multiple, props.defaultValue, true);
|
|
} else {
|
|
updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
|
|
}
|
|
}
|
|
}
|
|
function restoreControlledState$1(element, props) {
|
|
var node = element;
|
|
var value = props.value;
|
|
if (value != null) {
|
|
updateOptions(node, !!props.multiple, value, false);
|
|
}
|
|
}
|
|
var didWarnValDefaultVal = false;
|
|
function getHostProps$2(element, props) {
|
|
var node = element;
|
|
if (props.dangerouslySetInnerHTML != null) {
|
|
throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
|
|
}
|
|
var hostProps = assign({}, props, {
|
|
value: void 0,
|
|
defaultValue: void 0,
|
|
children: toString(node._wrapperState.initialValue)
|
|
});
|
|
return hostProps;
|
|
}
|
|
function initWrapperState$2(element, props) {
|
|
var node = element;
|
|
{
|
|
checkControlledValueProps("textarea", props);
|
|
if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
|
|
error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
|
|
didWarnValDefaultVal = true;
|
|
}
|
|
}
|
|
var initialValue = props.value;
|
|
if (initialValue == null) {
|
|
var children = props.children, defaultValue = props.defaultValue;
|
|
if (children != null) {
|
|
{
|
|
error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
|
|
}
|
|
{
|
|
if (defaultValue != null) {
|
|
throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
|
|
}
|
|
if (isArray(children)) {
|
|
if (children.length > 1) {
|
|
throw new Error("<textarea> can only have at most one child.");
|
|
}
|
|
children = children[0];
|
|
}
|
|
defaultValue = children;
|
|
}
|
|
}
|
|
if (defaultValue == null) {
|
|
defaultValue = "";
|
|
}
|
|
initialValue = defaultValue;
|
|
}
|
|
node._wrapperState = {
|
|
initialValue: getToStringValue(initialValue)
|
|
};
|
|
}
|
|
function updateWrapper$1(element, props) {
|
|
var node = element;
|
|
var value = getToStringValue(props.value);
|
|
var defaultValue = getToStringValue(props.defaultValue);
|
|
if (value != null) {
|
|
var newValue = toString(value);
|
|
if (newValue !== node.value) {
|
|
node.value = newValue;
|
|
}
|
|
if (props.defaultValue == null && node.defaultValue !== newValue) {
|
|
node.defaultValue = newValue;
|
|
}
|
|
}
|
|
if (defaultValue != null) {
|
|
node.defaultValue = toString(defaultValue);
|
|
}
|
|
}
|
|
function postMountWrapper$3(element, props) {
|
|
var node = element;
|
|
var textContent = node.textContent;
|
|
if (textContent === node._wrapperState.initialValue) {
|
|
if (textContent !== "" && textContent !== null) {
|
|
node.value = textContent;
|
|
}
|
|
}
|
|
}
|
|
function restoreControlledState$2(element, props) {
|
|
updateWrapper$1(element, props);
|
|
}
|
|
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
|
|
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
function getIntrinsicNamespace(type) {
|
|
switch (type) {
|
|
case "svg":
|
|
return SVG_NAMESPACE;
|
|
case "math":
|
|
return MATH_NAMESPACE;
|
|
default:
|
|
return HTML_NAMESPACE;
|
|
}
|
|
}
|
|
function getChildNamespace(parentNamespace, type) {
|
|
if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
|
|
return getIntrinsicNamespace(type);
|
|
}
|
|
if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
|
|
return HTML_NAMESPACE;
|
|
}
|
|
return parentNamespace;
|
|
}
|
|
var createMicrosoftUnsafeLocalFunction = function(func) {
|
|
if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
|
|
return function(arg0, arg1, arg2, arg3) {
|
|
MSApp.execUnsafeLocalFunction(function() {
|
|
return func(arg0, arg1, arg2, arg3);
|
|
});
|
|
};
|
|
} else {
|
|
return func;
|
|
}
|
|
};
|
|
var reusableSVGContainer;
|
|
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
|
|
if (node.namespaceURI === SVG_NAMESPACE) {
|
|
if (!("innerHTML" in node)) {
|
|
reusableSVGContainer = reusableSVGContainer || document.createElement("div");
|
|
reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
|
|
var svgNode = reusableSVGContainer.firstChild;
|
|
while (node.firstChild) {
|
|
node.removeChild(node.firstChild);
|
|
}
|
|
while (svgNode.firstChild) {
|
|
node.appendChild(svgNode.firstChild);
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
node.innerHTML = html;
|
|
});
|
|
var ELEMENT_NODE = 1;
|
|
var TEXT_NODE = 3;
|
|
var COMMENT_NODE = 8;
|
|
var DOCUMENT_NODE = 9;
|
|
var DOCUMENT_FRAGMENT_NODE = 11;
|
|
var setTextContent = function(node, text) {
|
|
if (text) {
|
|
var firstChild = node.firstChild;
|
|
if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
|
|
firstChild.nodeValue = text;
|
|
return;
|
|
}
|
|
}
|
|
node.textContent = text;
|
|
};
|
|
var shorthandToLonghand = {
|
|
animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
|
|
background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
|
|
backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
|
|
border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
|
|
borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
|
|
borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
|
|
borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
|
|
borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
|
|
borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
|
|
borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
|
|
borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
|
|
borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
|
|
borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
|
|
borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
|
|
borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
|
|
borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
|
|
borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
|
|
columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
|
|
columns: ["columnCount", "columnWidth"],
|
|
flex: ["flexBasis", "flexGrow", "flexShrink"],
|
|
flexFlow: ["flexDirection", "flexWrap"],
|
|
font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
|
|
fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
|
|
gap: ["columnGap", "rowGap"],
|
|
grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
|
|
gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
|
|
gridColumn: ["gridColumnEnd", "gridColumnStart"],
|
|
gridColumnGap: ["columnGap"],
|
|
gridGap: ["columnGap", "rowGap"],
|
|
gridRow: ["gridRowEnd", "gridRowStart"],
|
|
gridRowGap: ["rowGap"],
|
|
gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
|
|
listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
|
|
margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
|
|
marker: ["markerEnd", "markerMid", "markerStart"],
|
|
mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
|
|
maskPosition: ["maskPositionX", "maskPositionY"],
|
|
outline: ["outlineColor", "outlineStyle", "outlineWidth"],
|
|
overflow: ["overflowX", "overflowY"],
|
|
padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
|
|
placeContent: ["alignContent", "justifyContent"],
|
|
placeItems: ["alignItems", "justifyItems"],
|
|
placeSelf: ["alignSelf", "justifySelf"],
|
|
textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
|
|
textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
|
|
transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
|
|
wordWrap: ["overflowWrap"]
|
|
};
|
|
var isUnitlessNumber = {
|
|
animationIterationCount: true,
|
|
aspectRatio: true,
|
|
borderImageOutset: true,
|
|
borderImageSlice: true,
|
|
borderImageWidth: true,
|
|
boxFlex: true,
|
|
boxFlexGroup: true,
|
|
boxOrdinalGroup: true,
|
|
columnCount: true,
|
|
columns: true,
|
|
flex: true,
|
|
flexGrow: true,
|
|
flexPositive: true,
|
|
flexShrink: true,
|
|
flexNegative: true,
|
|
flexOrder: true,
|
|
gridArea: true,
|
|
gridRow: true,
|
|
gridRowEnd: true,
|
|
gridRowSpan: true,
|
|
gridRowStart: true,
|
|
gridColumn: true,
|
|
gridColumnEnd: true,
|
|
gridColumnSpan: true,
|
|
gridColumnStart: true,
|
|
fontWeight: true,
|
|
lineClamp: true,
|
|
lineHeight: true,
|
|
opacity: true,
|
|
order: true,
|
|
orphans: true,
|
|
tabSize: true,
|
|
widows: true,
|
|
zIndex: true,
|
|
zoom: true,
|
|
fillOpacity: true,
|
|
floodOpacity: true,
|
|
stopOpacity: true,
|
|
strokeDasharray: true,
|
|
strokeDashoffset: true,
|
|
strokeMiterlimit: true,
|
|
strokeOpacity: true,
|
|
strokeWidth: true
|
|
};
|
|
function prefixKey(prefix3, key) {
|
|
return prefix3 + key.charAt(0).toUpperCase() + key.substring(1);
|
|
}
|
|
var prefixes = ["Webkit", "ms", "Moz", "O"];
|
|
Object.keys(isUnitlessNumber).forEach(function(prop) {
|
|
prefixes.forEach(function(prefix3) {
|
|
isUnitlessNumber[prefixKey(prefix3, prop)] = isUnitlessNumber[prop];
|
|
});
|
|
});
|
|
function dangerousStyleValue(name, value, isCustomProperty) {
|
|
var isEmpty3 = value == null || typeof value === "boolean" || value === "";
|
|
if (isEmpty3) {
|
|
return "";
|
|
}
|
|
if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
|
|
return value + "px";
|
|
}
|
|
{
|
|
checkCSSPropertyStringCoercion(value, name);
|
|
}
|
|
return ("" + value).trim();
|
|
}
|
|
var uppercasePattern = /([A-Z])/g;
|
|
var msPattern = /^ms-/;
|
|
function hyphenateStyleName(name) {
|
|
return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
|
|
}
|
|
var warnValidStyle = function() {
|
|
};
|
|
{
|
|
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
var msPattern$1 = /^-ms-/;
|
|
var hyphenPattern = /-(.)/g;
|
|
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
var warnedStyleNames = {};
|
|
var warnedStyleValues = {};
|
|
var warnedForNaNValue = false;
|
|
var warnedForInfinityValue = false;
|
|
var camelize = function(string) {
|
|
return string.replace(hyphenPattern, function(_3, character) {
|
|
return character.toUpperCase();
|
|
});
|
|
};
|
|
var warnHyphenatedStyleName = function(name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
warnedStyleNames[name] = true;
|
|
error(
|
|
"Unsupported style property %s. Did you mean %s?",
|
|
name,
|
|
camelize(name.replace(msPattern$1, "ms-"))
|
|
);
|
|
};
|
|
var warnBadVendoredStyleName = function(name) {
|
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
return;
|
|
}
|
|
warnedStyleNames[name] = true;
|
|
error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
};
|
|
var warnStyleValueWithSemicolon = function(name, value) {
|
|
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
return;
|
|
}
|
|
warnedStyleValues[value] = true;
|
|
error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
|
|
};
|
|
var warnStyleValueIsNaN = function(name, value) {
|
|
if (warnedForNaNValue) {
|
|
return;
|
|
}
|
|
warnedForNaNValue = true;
|
|
error("`NaN` is an invalid value for the `%s` css style property.", name);
|
|
};
|
|
var warnStyleValueIsInfinity = function(name, value) {
|
|
if (warnedForInfinityValue) {
|
|
return;
|
|
}
|
|
warnedForInfinityValue = true;
|
|
error("`Infinity` is an invalid value for the `%s` css style property.", name);
|
|
};
|
|
warnValidStyle = function(name, value) {
|
|
if (name.indexOf("-") > -1) {
|
|
warnHyphenatedStyleName(name);
|
|
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
warnBadVendoredStyleName(name);
|
|
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
warnStyleValueWithSemicolon(name, value);
|
|
}
|
|
if (typeof value === "number") {
|
|
if (isNaN(value)) {
|
|
warnStyleValueIsNaN(name, value);
|
|
} else if (!isFinite(value)) {
|
|
warnStyleValueIsInfinity(name, value);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var warnValidStyle$1 = warnValidStyle;
|
|
function createDangerousStringForStyles(styles) {
|
|
{
|
|
var serialized = "";
|
|
var delimiter = "";
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var styleValue = styles[styleName];
|
|
if (styleValue != null) {
|
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
|
|
serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
|
|
delimiter = ";";
|
|
}
|
|
}
|
|
return serialized || null;
|
|
}
|
|
}
|
|
function setValueForStyles(node, styles) {
|
|
var style4 = node.style;
|
|
for (var styleName in styles) {
|
|
if (!styles.hasOwnProperty(styleName)) {
|
|
continue;
|
|
}
|
|
var isCustomProperty = styleName.indexOf("--") === 0;
|
|
{
|
|
if (!isCustomProperty) {
|
|
warnValidStyle$1(styleName, styles[styleName]);
|
|
}
|
|
}
|
|
var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
|
|
if (styleName === "float") {
|
|
styleName = "cssFloat";
|
|
}
|
|
if (isCustomProperty) {
|
|
style4.setProperty(styleName, styleValue);
|
|
} else {
|
|
style4[styleName] = styleValue;
|
|
}
|
|
}
|
|
}
|
|
function isValueEmpty(value) {
|
|
return value == null || typeof value === "boolean" || value === "";
|
|
}
|
|
function expandShorthandMap(styles) {
|
|
var expanded = {};
|
|
for (var key in styles) {
|
|
var longhands = shorthandToLonghand[key] || [key];
|
|
for (var i2 = 0; i2 < longhands.length; i2++) {
|
|
expanded[longhands[i2]] = key;
|
|
}
|
|
}
|
|
return expanded;
|
|
}
|
|
function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
|
|
{
|
|
if (!nextStyles) {
|
|
return;
|
|
}
|
|
var expandedUpdates = expandShorthandMap(styleUpdates);
|
|
var expandedStyles = expandShorthandMap(nextStyles);
|
|
var warnedAbout = {};
|
|
for (var key in expandedUpdates) {
|
|
var originalKey = expandedUpdates[key];
|
|
var correctOriginalKey = expandedStyles[key];
|
|
if (correctOriginalKey && originalKey !== correctOriginalKey) {
|
|
var warningKey = originalKey + "," + correctOriginalKey;
|
|
if (warnedAbout[warningKey]) {
|
|
continue;
|
|
}
|
|
warnedAbout[warningKey] = true;
|
|
error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var omittedCloseTags = {
|
|
area: true,
|
|
base: true,
|
|
br: true,
|
|
col: true,
|
|
embed: true,
|
|
hr: true,
|
|
img: true,
|
|
input: true,
|
|
keygen: true,
|
|
link: true,
|
|
meta: true,
|
|
param: true,
|
|
source: true,
|
|
track: true,
|
|
wbr: true
|
|
};
|
|
var voidElementTags = assign({
|
|
menuitem: true
|
|
}, omittedCloseTags);
|
|
var HTML = "__html";
|
|
function assertValidProps(tag, props) {
|
|
if (!props) {
|
|
return;
|
|
}
|
|
if (voidElementTags[tag]) {
|
|
if (props.children != null || props.dangerouslySetInnerHTML != null) {
|
|
throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
|
|
}
|
|
}
|
|
if (props.dangerouslySetInnerHTML != null) {
|
|
if (props.children != null) {
|
|
throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
|
|
}
|
|
if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
|
|
throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
|
|
}
|
|
}
|
|
{
|
|
if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
|
|
error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
|
|
}
|
|
}
|
|
if (props.style != null && typeof props.style !== "object") {
|
|
throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
|
|
}
|
|
}
|
|
function isCustomComponent(tagName, props) {
|
|
if (tagName.indexOf("-") === -1) {
|
|
return typeof props.is === "string";
|
|
}
|
|
switch (tagName) {
|
|
case "annotation-xml":
|
|
case "color-profile":
|
|
case "font-face":
|
|
case "font-face-src":
|
|
case "font-face-uri":
|
|
case "font-face-format":
|
|
case "font-face-name":
|
|
case "missing-glyph":
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
var possibleStandardNames = {
|
|
accept: "accept",
|
|
acceptcharset: "acceptCharset",
|
|
"accept-charset": "acceptCharset",
|
|
accesskey: "accessKey",
|
|
action: "action",
|
|
allowfullscreen: "allowFullScreen",
|
|
alt: "alt",
|
|
as: "as",
|
|
async: "async",
|
|
autocapitalize: "autoCapitalize",
|
|
autocomplete: "autoComplete",
|
|
autocorrect: "autoCorrect",
|
|
autofocus: "autoFocus",
|
|
autoplay: "autoPlay",
|
|
autosave: "autoSave",
|
|
capture: "capture",
|
|
cellpadding: "cellPadding",
|
|
cellspacing: "cellSpacing",
|
|
challenge: "challenge",
|
|
charset: "charSet",
|
|
checked: "checked",
|
|
children: "children",
|
|
cite: "cite",
|
|
class: "className",
|
|
classid: "classID",
|
|
classname: "className",
|
|
cols: "cols",
|
|
colspan: "colSpan",
|
|
content: "content",
|
|
contenteditable: "contentEditable",
|
|
contextmenu: "contextMenu",
|
|
controls: "controls",
|
|
controlslist: "controlsList",
|
|
coords: "coords",
|
|
crossorigin: "crossOrigin",
|
|
dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
|
|
data: "data",
|
|
datetime: "dateTime",
|
|
default: "default",
|
|
defaultchecked: "defaultChecked",
|
|
defaultvalue: "defaultValue",
|
|
defer: "defer",
|
|
dir: "dir",
|
|
disabled: "disabled",
|
|
disablepictureinpicture: "disablePictureInPicture",
|
|
disableremoteplayback: "disableRemotePlayback",
|
|
download: "download",
|
|
draggable: "draggable",
|
|
enctype: "encType",
|
|
enterkeyhint: "enterKeyHint",
|
|
for: "htmlFor",
|
|
form: "form",
|
|
formmethod: "formMethod",
|
|
formaction: "formAction",
|
|
formenctype: "formEncType",
|
|
formnovalidate: "formNoValidate",
|
|
formtarget: "formTarget",
|
|
frameborder: "frameBorder",
|
|
headers: "headers",
|
|
height: "height",
|
|
hidden: "hidden",
|
|
high: "high",
|
|
href: "href",
|
|
hreflang: "hrefLang",
|
|
htmlfor: "htmlFor",
|
|
httpequiv: "httpEquiv",
|
|
"http-equiv": "httpEquiv",
|
|
icon: "icon",
|
|
id: "id",
|
|
imagesizes: "imageSizes",
|
|
imagesrcset: "imageSrcSet",
|
|
innerhtml: "innerHTML",
|
|
inputmode: "inputMode",
|
|
integrity: "integrity",
|
|
is: "is",
|
|
itemid: "itemID",
|
|
itemprop: "itemProp",
|
|
itemref: "itemRef",
|
|
itemscope: "itemScope",
|
|
itemtype: "itemType",
|
|
keyparams: "keyParams",
|
|
keytype: "keyType",
|
|
kind: "kind",
|
|
label: "label",
|
|
lang: "lang",
|
|
list: "list",
|
|
loop: "loop",
|
|
low: "low",
|
|
manifest: "manifest",
|
|
marginwidth: "marginWidth",
|
|
marginheight: "marginHeight",
|
|
max: "max",
|
|
maxlength: "maxLength",
|
|
media: "media",
|
|
mediagroup: "mediaGroup",
|
|
method: "method",
|
|
min: "min",
|
|
minlength: "minLength",
|
|
multiple: "multiple",
|
|
muted: "muted",
|
|
name: "name",
|
|
nomodule: "noModule",
|
|
nonce: "nonce",
|
|
novalidate: "noValidate",
|
|
open: "open",
|
|
optimum: "optimum",
|
|
pattern: "pattern",
|
|
placeholder: "placeholder",
|
|
playsinline: "playsInline",
|
|
poster: "poster",
|
|
preload: "preload",
|
|
profile: "profile",
|
|
radiogroup: "radioGroup",
|
|
readonly: "readOnly",
|
|
referrerpolicy: "referrerPolicy",
|
|
rel: "rel",
|
|
required: "required",
|
|
reversed: "reversed",
|
|
role: "role",
|
|
rows: "rows",
|
|
rowspan: "rowSpan",
|
|
sandbox: "sandbox",
|
|
scope: "scope",
|
|
scoped: "scoped",
|
|
scrolling: "scrolling",
|
|
seamless: "seamless",
|
|
selected: "selected",
|
|
shape: "shape",
|
|
size: "size",
|
|
sizes: "sizes",
|
|
span: "span",
|
|
spellcheck: "spellCheck",
|
|
src: "src",
|
|
srcdoc: "srcDoc",
|
|
srclang: "srcLang",
|
|
srcset: "srcSet",
|
|
start: "start",
|
|
step: "step",
|
|
style: "style",
|
|
summary: "summary",
|
|
tabindex: "tabIndex",
|
|
target: "target",
|
|
title: "title",
|
|
type: "type",
|
|
usemap: "useMap",
|
|
value: "value",
|
|
width: "width",
|
|
wmode: "wmode",
|
|
wrap: "wrap",
|
|
about: "about",
|
|
accentheight: "accentHeight",
|
|
"accent-height": "accentHeight",
|
|
accumulate: "accumulate",
|
|
additive: "additive",
|
|
alignmentbaseline: "alignmentBaseline",
|
|
"alignment-baseline": "alignmentBaseline",
|
|
allowreorder: "allowReorder",
|
|
alphabetic: "alphabetic",
|
|
amplitude: "amplitude",
|
|
arabicform: "arabicForm",
|
|
"arabic-form": "arabicForm",
|
|
ascent: "ascent",
|
|
attributename: "attributeName",
|
|
attributetype: "attributeType",
|
|
autoreverse: "autoReverse",
|
|
azimuth: "azimuth",
|
|
basefrequency: "baseFrequency",
|
|
baselineshift: "baselineShift",
|
|
"baseline-shift": "baselineShift",
|
|
baseprofile: "baseProfile",
|
|
bbox: "bbox",
|
|
begin: "begin",
|
|
bias: "bias",
|
|
by: "by",
|
|
calcmode: "calcMode",
|
|
capheight: "capHeight",
|
|
"cap-height": "capHeight",
|
|
clip: "clip",
|
|
clippath: "clipPath",
|
|
"clip-path": "clipPath",
|
|
clippathunits: "clipPathUnits",
|
|
cliprule: "clipRule",
|
|
"clip-rule": "clipRule",
|
|
color: "color",
|
|
colorinterpolation: "colorInterpolation",
|
|
"color-interpolation": "colorInterpolation",
|
|
colorinterpolationfilters: "colorInterpolationFilters",
|
|
"color-interpolation-filters": "colorInterpolationFilters",
|
|
colorprofile: "colorProfile",
|
|
"color-profile": "colorProfile",
|
|
colorrendering: "colorRendering",
|
|
"color-rendering": "colorRendering",
|
|
contentscripttype: "contentScriptType",
|
|
contentstyletype: "contentStyleType",
|
|
cursor: "cursor",
|
|
cx: "cx",
|
|
cy: "cy",
|
|
d: "d",
|
|
datatype: "datatype",
|
|
decelerate: "decelerate",
|
|
descent: "descent",
|
|
diffuseconstant: "diffuseConstant",
|
|
direction: "direction",
|
|
display: "display",
|
|
divisor: "divisor",
|
|
dominantbaseline: "dominantBaseline",
|
|
"dominant-baseline": "dominantBaseline",
|
|
dur: "dur",
|
|
dx: "dx",
|
|
dy: "dy",
|
|
edgemode: "edgeMode",
|
|
elevation: "elevation",
|
|
enablebackground: "enableBackground",
|
|
"enable-background": "enableBackground",
|
|
end: "end",
|
|
exponent: "exponent",
|
|
externalresourcesrequired: "externalResourcesRequired",
|
|
fill: "fill",
|
|
fillopacity: "fillOpacity",
|
|
"fill-opacity": "fillOpacity",
|
|
fillrule: "fillRule",
|
|
"fill-rule": "fillRule",
|
|
filter: "filter",
|
|
filterres: "filterRes",
|
|
filterunits: "filterUnits",
|
|
floodopacity: "floodOpacity",
|
|
"flood-opacity": "floodOpacity",
|
|
floodcolor: "floodColor",
|
|
"flood-color": "floodColor",
|
|
focusable: "focusable",
|
|
fontfamily: "fontFamily",
|
|
"font-family": "fontFamily",
|
|
fontsize: "fontSize",
|
|
"font-size": "fontSize",
|
|
fontsizeadjust: "fontSizeAdjust",
|
|
"font-size-adjust": "fontSizeAdjust",
|
|
fontstretch: "fontStretch",
|
|
"font-stretch": "fontStretch",
|
|
fontstyle: "fontStyle",
|
|
"font-style": "fontStyle",
|
|
fontvariant: "fontVariant",
|
|
"font-variant": "fontVariant",
|
|
fontweight: "fontWeight",
|
|
"font-weight": "fontWeight",
|
|
format: "format",
|
|
from: "from",
|
|
fx: "fx",
|
|
fy: "fy",
|
|
g1: "g1",
|
|
g2: "g2",
|
|
glyphname: "glyphName",
|
|
"glyph-name": "glyphName",
|
|
glyphorientationhorizontal: "glyphOrientationHorizontal",
|
|
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
glyphorientationvertical: "glyphOrientationVertical",
|
|
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
glyphref: "glyphRef",
|
|
gradienttransform: "gradientTransform",
|
|
gradientunits: "gradientUnits",
|
|
hanging: "hanging",
|
|
horizadvx: "horizAdvX",
|
|
"horiz-adv-x": "horizAdvX",
|
|
horizoriginx: "horizOriginX",
|
|
"horiz-origin-x": "horizOriginX",
|
|
ideographic: "ideographic",
|
|
imagerendering: "imageRendering",
|
|
"image-rendering": "imageRendering",
|
|
in2: "in2",
|
|
in: "in",
|
|
inlist: "inlist",
|
|
intercept: "intercept",
|
|
k1: "k1",
|
|
k2: "k2",
|
|
k3: "k3",
|
|
k4: "k4",
|
|
k: "k",
|
|
kernelmatrix: "kernelMatrix",
|
|
kernelunitlength: "kernelUnitLength",
|
|
kerning: "kerning",
|
|
keypoints: "keyPoints",
|
|
keysplines: "keySplines",
|
|
keytimes: "keyTimes",
|
|
lengthadjust: "lengthAdjust",
|
|
letterspacing: "letterSpacing",
|
|
"letter-spacing": "letterSpacing",
|
|
lightingcolor: "lightingColor",
|
|
"lighting-color": "lightingColor",
|
|
limitingconeangle: "limitingConeAngle",
|
|
local: "local",
|
|
markerend: "markerEnd",
|
|
"marker-end": "markerEnd",
|
|
markerheight: "markerHeight",
|
|
markermid: "markerMid",
|
|
"marker-mid": "markerMid",
|
|
markerstart: "markerStart",
|
|
"marker-start": "markerStart",
|
|
markerunits: "markerUnits",
|
|
markerwidth: "markerWidth",
|
|
mask: "mask",
|
|
maskcontentunits: "maskContentUnits",
|
|
maskunits: "maskUnits",
|
|
mathematical: "mathematical",
|
|
mode: "mode",
|
|
numoctaves: "numOctaves",
|
|
offset: "offset",
|
|
opacity: "opacity",
|
|
operator: "operator",
|
|
order: "order",
|
|
orient: "orient",
|
|
orientation: "orientation",
|
|
origin: "origin",
|
|
overflow: "overflow",
|
|
overlineposition: "overlinePosition",
|
|
"overline-position": "overlinePosition",
|
|
overlinethickness: "overlineThickness",
|
|
"overline-thickness": "overlineThickness",
|
|
paintorder: "paintOrder",
|
|
"paint-order": "paintOrder",
|
|
panose1: "panose1",
|
|
"panose-1": "panose1",
|
|
pathlength: "pathLength",
|
|
patterncontentunits: "patternContentUnits",
|
|
patterntransform: "patternTransform",
|
|
patternunits: "patternUnits",
|
|
pointerevents: "pointerEvents",
|
|
"pointer-events": "pointerEvents",
|
|
points: "points",
|
|
pointsatx: "pointsAtX",
|
|
pointsaty: "pointsAtY",
|
|
pointsatz: "pointsAtZ",
|
|
prefix: "prefix",
|
|
preservealpha: "preserveAlpha",
|
|
preserveaspectratio: "preserveAspectRatio",
|
|
primitiveunits: "primitiveUnits",
|
|
property: "property",
|
|
r: "r",
|
|
radius: "radius",
|
|
refx: "refX",
|
|
refy: "refY",
|
|
renderingintent: "renderingIntent",
|
|
"rendering-intent": "renderingIntent",
|
|
repeatcount: "repeatCount",
|
|
repeatdur: "repeatDur",
|
|
requiredextensions: "requiredExtensions",
|
|
requiredfeatures: "requiredFeatures",
|
|
resource: "resource",
|
|
restart: "restart",
|
|
result: "result",
|
|
results: "results",
|
|
rotate: "rotate",
|
|
rx: "rx",
|
|
ry: "ry",
|
|
scale: "scale",
|
|
security: "security",
|
|
seed: "seed",
|
|
shaperendering: "shapeRendering",
|
|
"shape-rendering": "shapeRendering",
|
|
slope: "slope",
|
|
spacing: "spacing",
|
|
specularconstant: "specularConstant",
|
|
specularexponent: "specularExponent",
|
|
speed: "speed",
|
|
spreadmethod: "spreadMethod",
|
|
startoffset: "startOffset",
|
|
stddeviation: "stdDeviation",
|
|
stemh: "stemh",
|
|
stemv: "stemv",
|
|
stitchtiles: "stitchTiles",
|
|
stopcolor: "stopColor",
|
|
"stop-color": "stopColor",
|
|
stopopacity: "stopOpacity",
|
|
"stop-opacity": "stopOpacity",
|
|
strikethroughposition: "strikethroughPosition",
|
|
"strikethrough-position": "strikethroughPosition",
|
|
strikethroughthickness: "strikethroughThickness",
|
|
"strikethrough-thickness": "strikethroughThickness",
|
|
string: "string",
|
|
stroke: "stroke",
|
|
strokedasharray: "strokeDasharray",
|
|
"stroke-dasharray": "strokeDasharray",
|
|
strokedashoffset: "strokeDashoffset",
|
|
"stroke-dashoffset": "strokeDashoffset",
|
|
strokelinecap: "strokeLinecap",
|
|
"stroke-linecap": "strokeLinecap",
|
|
strokelinejoin: "strokeLinejoin",
|
|
"stroke-linejoin": "strokeLinejoin",
|
|
strokemiterlimit: "strokeMiterlimit",
|
|
"stroke-miterlimit": "strokeMiterlimit",
|
|
strokewidth: "strokeWidth",
|
|
"stroke-width": "strokeWidth",
|
|
strokeopacity: "strokeOpacity",
|
|
"stroke-opacity": "strokeOpacity",
|
|
suppresscontenteditablewarning: "suppressContentEditableWarning",
|
|
suppresshydrationwarning: "suppressHydrationWarning",
|
|
surfacescale: "surfaceScale",
|
|
systemlanguage: "systemLanguage",
|
|
tablevalues: "tableValues",
|
|
targetx: "targetX",
|
|
targety: "targetY",
|
|
textanchor: "textAnchor",
|
|
"text-anchor": "textAnchor",
|
|
textdecoration: "textDecoration",
|
|
"text-decoration": "textDecoration",
|
|
textlength: "textLength",
|
|
textrendering: "textRendering",
|
|
"text-rendering": "textRendering",
|
|
to: "to",
|
|
transform: "transform",
|
|
typeof: "typeof",
|
|
u1: "u1",
|
|
u2: "u2",
|
|
underlineposition: "underlinePosition",
|
|
"underline-position": "underlinePosition",
|
|
underlinethickness: "underlineThickness",
|
|
"underline-thickness": "underlineThickness",
|
|
unicode: "unicode",
|
|
unicodebidi: "unicodeBidi",
|
|
"unicode-bidi": "unicodeBidi",
|
|
unicoderange: "unicodeRange",
|
|
"unicode-range": "unicodeRange",
|
|
unitsperem: "unitsPerEm",
|
|
"units-per-em": "unitsPerEm",
|
|
unselectable: "unselectable",
|
|
valphabetic: "vAlphabetic",
|
|
"v-alphabetic": "vAlphabetic",
|
|
values: "values",
|
|
vectoreffect: "vectorEffect",
|
|
"vector-effect": "vectorEffect",
|
|
version: "version",
|
|
vertadvy: "vertAdvY",
|
|
"vert-adv-y": "vertAdvY",
|
|
vertoriginx: "vertOriginX",
|
|
"vert-origin-x": "vertOriginX",
|
|
vertoriginy: "vertOriginY",
|
|
"vert-origin-y": "vertOriginY",
|
|
vhanging: "vHanging",
|
|
"v-hanging": "vHanging",
|
|
videographic: "vIdeographic",
|
|
"v-ideographic": "vIdeographic",
|
|
viewbox: "viewBox",
|
|
viewtarget: "viewTarget",
|
|
visibility: "visibility",
|
|
vmathematical: "vMathematical",
|
|
"v-mathematical": "vMathematical",
|
|
vocab: "vocab",
|
|
widths: "widths",
|
|
wordspacing: "wordSpacing",
|
|
"word-spacing": "wordSpacing",
|
|
writingmode: "writingMode",
|
|
"writing-mode": "writingMode",
|
|
x1: "x1",
|
|
x2: "x2",
|
|
x: "x",
|
|
xchannelselector: "xChannelSelector",
|
|
xheight: "xHeight",
|
|
"x-height": "xHeight",
|
|
xlinkactuate: "xlinkActuate",
|
|
"xlink:actuate": "xlinkActuate",
|
|
xlinkarcrole: "xlinkArcrole",
|
|
"xlink:arcrole": "xlinkArcrole",
|
|
xlinkhref: "xlinkHref",
|
|
"xlink:href": "xlinkHref",
|
|
xlinkrole: "xlinkRole",
|
|
"xlink:role": "xlinkRole",
|
|
xlinkshow: "xlinkShow",
|
|
"xlink:show": "xlinkShow",
|
|
xlinktitle: "xlinkTitle",
|
|
"xlink:title": "xlinkTitle",
|
|
xlinktype: "xlinkType",
|
|
"xlink:type": "xlinkType",
|
|
xmlbase: "xmlBase",
|
|
"xml:base": "xmlBase",
|
|
xmllang: "xmlLang",
|
|
"xml:lang": "xmlLang",
|
|
xmlns: "xmlns",
|
|
"xml:space": "xmlSpace",
|
|
xmlnsxlink: "xmlnsXlink",
|
|
"xmlns:xlink": "xmlnsXlink",
|
|
xmlspace: "xmlSpace",
|
|
y1: "y1",
|
|
y2: "y2",
|
|
y: "y",
|
|
ychannelselector: "yChannelSelector",
|
|
z: "z",
|
|
zoomandpan: "zoomAndPan"
|
|
};
|
|
var ariaProperties = {
|
|
"aria-current": 0,
|
|
"aria-description": 0,
|
|
"aria-details": 0,
|
|
"aria-disabled": 0,
|
|
"aria-hidden": 0,
|
|
"aria-invalid": 0,
|
|
"aria-keyshortcuts": 0,
|
|
"aria-label": 0,
|
|
"aria-roledescription": 0,
|
|
"aria-autocomplete": 0,
|
|
"aria-checked": 0,
|
|
"aria-expanded": 0,
|
|
"aria-haspopup": 0,
|
|
"aria-level": 0,
|
|
"aria-modal": 0,
|
|
"aria-multiline": 0,
|
|
"aria-multiselectable": 0,
|
|
"aria-orientation": 0,
|
|
"aria-placeholder": 0,
|
|
"aria-pressed": 0,
|
|
"aria-readonly": 0,
|
|
"aria-required": 0,
|
|
"aria-selected": 0,
|
|
"aria-sort": 0,
|
|
"aria-valuemax": 0,
|
|
"aria-valuemin": 0,
|
|
"aria-valuenow": 0,
|
|
"aria-valuetext": 0,
|
|
"aria-atomic": 0,
|
|
"aria-busy": 0,
|
|
"aria-live": 0,
|
|
"aria-relevant": 0,
|
|
"aria-dropeffect": 0,
|
|
"aria-grabbed": 0,
|
|
"aria-activedescendant": 0,
|
|
"aria-colcount": 0,
|
|
"aria-colindex": 0,
|
|
"aria-colspan": 0,
|
|
"aria-controls": 0,
|
|
"aria-describedby": 0,
|
|
"aria-errormessage": 0,
|
|
"aria-flowto": 0,
|
|
"aria-labelledby": 0,
|
|
"aria-owns": 0,
|
|
"aria-posinset": 0,
|
|
"aria-rowcount": 0,
|
|
"aria-rowindex": 0,
|
|
"aria-rowspan": 0,
|
|
"aria-setsize": 0
|
|
};
|
|
var warnedProperties = {};
|
|
var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
function validateProperty(tagName, name) {
|
|
{
|
|
if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
|
|
return true;
|
|
}
|
|
if (rARIACamel.test(name)) {
|
|
var ariaName = "aria-" + name.slice(4).toLowerCase();
|
|
var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
|
|
if (correctName == null) {
|
|
error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
if (name !== correctName) {
|
|
error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
}
|
|
if (rARIA.test(name)) {
|
|
var lowerCasedName = name.toLowerCase();
|
|
var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
|
|
if (standardName == null) {
|
|
warnedProperties[name] = true;
|
|
return false;
|
|
}
|
|
if (name !== standardName) {
|
|
error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
|
|
warnedProperties[name] = true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function warnInvalidARIAProps(type, props) {
|
|
{
|
|
var invalidProps = [];
|
|
for (var key in props) {
|
|
var isValid = validateProperty(type, key);
|
|
if (!isValid) {
|
|
invalidProps.push(key);
|
|
}
|
|
}
|
|
var unknownPropString = invalidProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
if (invalidProps.length === 1) {
|
|
error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
|
|
} else if (invalidProps.length > 1) {
|
|
error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
|
|
}
|
|
}
|
|
}
|
|
function validateProperties(type, props) {
|
|
if (isCustomComponent(type, props)) {
|
|
return;
|
|
}
|
|
warnInvalidARIAProps(type, props);
|
|
}
|
|
var didWarnValueNull = false;
|
|
function validateProperties$1(type, props) {
|
|
{
|
|
if (type !== "input" && type !== "textarea" && type !== "select") {
|
|
return;
|
|
}
|
|
if (props != null && props.value === null && !didWarnValueNull) {
|
|
didWarnValueNull = true;
|
|
if (type === "select" && props.multiple) {
|
|
error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
|
|
} else {
|
|
error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var validateProperty$1 = function() {
|
|
};
|
|
{
|
|
var warnedProperties$1 = {};
|
|
var EVENT_NAME_REGEX = /^on./;
|
|
var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
|
var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
|
|
validateProperty$1 = function(tagName, name, value, eventRegistry) {
|
|
if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
|
return true;
|
|
}
|
|
var lowerCasedName = name.toLowerCase();
|
|
if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
|
|
error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (eventRegistry != null) {
|
|
var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
|
|
if (registrationNameDependencies2.hasOwnProperty(name)) {
|
|
return true;
|
|
}
|
|
var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
|
|
if (registrationName != null) {
|
|
error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
error("Unknown event handler property `%s`. It will be ignored.", name);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
} else if (EVENT_NAME_REGEX.test(name)) {
|
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
|
|
}
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "innerhtml") {
|
|
error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "aria") {
|
|
error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
|
|
error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (typeof value === "number" && isNaN(value)) {
|
|
error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
var propertyInfo = getPropertyInfo(name);
|
|
var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
if (standardName !== name) {
|
|
error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
if (value) {
|
|
error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name, name, value, name);
|
|
} else {
|
|
error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
|
|
}
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
if (isReserved) {
|
|
return true;
|
|
}
|
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
warnedProperties$1[name] = true;
|
|
return false;
|
|
}
|
|
if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
|
|
warnedProperties$1[name] = true;
|
|
return true;
|
|
}
|
|
return true;
|
|
};
|
|
}
|
|
var warnUnknownProperties = function(type, props, eventRegistry) {
|
|
{
|
|
var unknownProps = [];
|
|
for (var key in props) {
|
|
var isValid = validateProperty$1(type, key, props[key], eventRegistry);
|
|
if (!isValid) {
|
|
unknownProps.push(key);
|
|
}
|
|
}
|
|
var unknownPropString = unknownProps.map(function(prop) {
|
|
return "`" + prop + "`";
|
|
}).join(", ");
|
|
if (unknownProps.length === 1) {
|
|
error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
|
|
} else if (unknownProps.length > 1) {
|
|
error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
|
|
}
|
|
}
|
|
};
|
|
function validateProperties$2(type, props, eventRegistry) {
|
|
if (isCustomComponent(type, props)) {
|
|
return;
|
|
}
|
|
warnUnknownProperties(type, props, eventRegistry);
|
|
}
|
|
var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
|
|
var IS_NON_DELEGATED = 1 << 1;
|
|
var IS_CAPTURE_PHASE = 1 << 2;
|
|
var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
|
|
var currentReplayingEvent = null;
|
|
function setReplayingEvent(event) {
|
|
{
|
|
if (currentReplayingEvent !== null) {
|
|
error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
currentReplayingEvent = event;
|
|
}
|
|
function resetReplayingEvent() {
|
|
{
|
|
if (currentReplayingEvent === null) {
|
|
error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
currentReplayingEvent = null;
|
|
}
|
|
function isReplayingEvent(event) {
|
|
return event === currentReplayingEvent;
|
|
}
|
|
function getEventTarget(nativeEvent) {
|
|
var target = nativeEvent.target || nativeEvent.srcElement || window;
|
|
if (target.correspondingUseElement) {
|
|
target = target.correspondingUseElement;
|
|
}
|
|
return target.nodeType === TEXT_NODE ? target.parentNode : target;
|
|
}
|
|
var restoreImpl = null;
|
|
var restoreTarget = null;
|
|
var restoreQueue = null;
|
|
function restoreStateOfTarget(target) {
|
|
var internalInstance = getInstanceFromNode(target);
|
|
if (!internalInstance) {
|
|
return;
|
|
}
|
|
if (typeof restoreImpl !== "function") {
|
|
throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
var stateNode = internalInstance.stateNode;
|
|
if (stateNode) {
|
|
var _props = getFiberCurrentPropsFromNode(stateNode);
|
|
restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
|
|
}
|
|
}
|
|
function setRestoreImplementation(impl) {
|
|
restoreImpl = impl;
|
|
}
|
|
function enqueueStateRestore(target) {
|
|
if (restoreTarget) {
|
|
if (restoreQueue) {
|
|
restoreQueue.push(target);
|
|
} else {
|
|
restoreQueue = [target];
|
|
}
|
|
} else {
|
|
restoreTarget = target;
|
|
}
|
|
}
|
|
function needsStateRestore() {
|
|
return restoreTarget !== null || restoreQueue !== null;
|
|
}
|
|
function restoreStateIfNeeded() {
|
|
if (!restoreTarget) {
|
|
return;
|
|
}
|
|
var target = restoreTarget;
|
|
var queuedTargets = restoreQueue;
|
|
restoreTarget = null;
|
|
restoreQueue = null;
|
|
restoreStateOfTarget(target);
|
|
if (queuedTargets) {
|
|
for (var i2 = 0; i2 < queuedTargets.length; i2++) {
|
|
restoreStateOfTarget(queuedTargets[i2]);
|
|
}
|
|
}
|
|
}
|
|
var batchedUpdatesImpl = function(fn2, bookkeeping) {
|
|
return fn2(bookkeeping);
|
|
};
|
|
var flushSyncImpl = function() {
|
|
};
|
|
var isInsideEventHandler = false;
|
|
function finishEventHandler() {
|
|
var controlledComponentsHavePendingUpdates = needsStateRestore();
|
|
if (controlledComponentsHavePendingUpdates) {
|
|
flushSyncImpl();
|
|
restoreStateIfNeeded();
|
|
}
|
|
}
|
|
function batchedUpdates(fn2, a2, b2) {
|
|
if (isInsideEventHandler) {
|
|
return fn2(a2, b2);
|
|
}
|
|
isInsideEventHandler = true;
|
|
try {
|
|
return batchedUpdatesImpl(fn2, a2, b2);
|
|
} finally {
|
|
isInsideEventHandler = false;
|
|
finishEventHandler();
|
|
}
|
|
}
|
|
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
|
|
batchedUpdatesImpl = _batchedUpdatesImpl;
|
|
flushSyncImpl = _flushSyncImpl;
|
|
}
|
|
function isInteractive(tag) {
|
|
return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
|
|
}
|
|
function shouldPreventMouseEvent(name, type, props) {
|
|
switch (name) {
|
|
case "onClick":
|
|
case "onClickCapture":
|
|
case "onDoubleClick":
|
|
case "onDoubleClickCapture":
|
|
case "onMouseDown":
|
|
case "onMouseDownCapture":
|
|
case "onMouseMove":
|
|
case "onMouseMoveCapture":
|
|
case "onMouseUp":
|
|
case "onMouseUpCapture":
|
|
case "onMouseEnter":
|
|
return !!(props.disabled && isInteractive(type));
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function getListener(inst, registrationName) {
|
|
var stateNode = inst.stateNode;
|
|
if (stateNode === null) {
|
|
return null;
|
|
}
|
|
var props = getFiberCurrentPropsFromNode(stateNode);
|
|
if (props === null) {
|
|
return null;
|
|
}
|
|
var listener2 = props[registrationName];
|
|
if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
|
|
return null;
|
|
}
|
|
if (listener2 && typeof listener2 !== "function") {
|
|
throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener2 + "` type.");
|
|
}
|
|
return listener2;
|
|
}
|
|
var passiveBrowserEventsSupported = false;
|
|
if (canUseDOM2) {
|
|
try {
|
|
var options = {};
|
|
Object.defineProperty(options, "passive", {
|
|
get: function() {
|
|
passiveBrowserEventsSupported = true;
|
|
}
|
|
});
|
|
window.addEventListener("test", options, options);
|
|
window.removeEventListener("test", options, options);
|
|
} catch (e) {
|
|
passiveBrowserEventsSupported = false;
|
|
}
|
|
}
|
|
function invokeGuardedCallbackProd(name, func, context, a2, b2, c2, d2, e, f2) {
|
|
var funcArgs = Array.prototype.slice.call(arguments, 3);
|
|
try {
|
|
func.apply(context, funcArgs);
|
|
} catch (error2) {
|
|
this.onError(error2);
|
|
}
|
|
}
|
|
var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
{
|
|
if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
|
|
var fakeNode = document.createElement("react");
|
|
invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a2, b2, c2, d2, e, f2) {
|
|
if (typeof document === "undefined" || document === null) {
|
|
throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
|
|
}
|
|
var evt = document.createEvent("Event");
|
|
var didCall = false;
|
|
var didError = true;
|
|
var windowEvent = window.event;
|
|
var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
|
|
function restoreAfterDispatch() {
|
|
fakeNode.removeEventListener(evtType, callCallback2, false);
|
|
if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
|
|
window.event = windowEvent;
|
|
}
|
|
}
|
|
var funcArgs = Array.prototype.slice.call(arguments, 3);
|
|
function callCallback2() {
|
|
didCall = true;
|
|
restoreAfterDispatch();
|
|
func.apply(context, funcArgs);
|
|
didError = false;
|
|
}
|
|
var error2;
|
|
var didSetError = false;
|
|
var isCrossOriginError = false;
|
|
function handleWindowError(event) {
|
|
error2 = event.error;
|
|
didSetError = true;
|
|
if (error2 === null && event.colno === 0 && event.lineno === 0) {
|
|
isCrossOriginError = true;
|
|
}
|
|
if (event.defaultPrevented) {
|
|
if (error2 != null && typeof error2 === "object") {
|
|
try {
|
|
error2._suppressLogging = true;
|
|
} catch (inner) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var evtType = "react-" + (name ? name : "invokeguardedcallback");
|
|
window.addEventListener("error", handleWindowError);
|
|
fakeNode.addEventListener(evtType, callCallback2, false);
|
|
evt.initEvent(evtType, false, false);
|
|
fakeNode.dispatchEvent(evt);
|
|
if (windowEventDescriptor) {
|
|
Object.defineProperty(window, "event", windowEventDescriptor);
|
|
}
|
|
if (didCall && didError) {
|
|
if (!didSetError) {
|
|
error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
|
|
} else if (isCrossOriginError) {
|
|
error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
|
|
}
|
|
this.onError(error2);
|
|
}
|
|
window.removeEventListener("error", handleWindowError);
|
|
if (!didCall) {
|
|
restoreAfterDispatch();
|
|
return invokeGuardedCallbackProd.apply(this, arguments);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
|
|
var hasError = false;
|
|
var caughtError = null;
|
|
var hasRethrowError = false;
|
|
var rethrowError = null;
|
|
var reporter = {
|
|
onError: function(error2) {
|
|
hasError = true;
|
|
caughtError = error2;
|
|
}
|
|
};
|
|
function invokeGuardedCallback(name, func, context, a2, b2, c2, d2, e, f2) {
|
|
hasError = false;
|
|
caughtError = null;
|
|
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
|
|
}
|
|
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a2, b2, c2, d2, e, f2) {
|
|
invokeGuardedCallback.apply(this, arguments);
|
|
if (hasError) {
|
|
var error2 = clearCaughtError();
|
|
if (!hasRethrowError) {
|
|
hasRethrowError = true;
|
|
rethrowError = error2;
|
|
}
|
|
}
|
|
}
|
|
function rethrowCaughtError() {
|
|
if (hasRethrowError) {
|
|
var error2 = rethrowError;
|
|
hasRethrowError = false;
|
|
rethrowError = null;
|
|
throw error2;
|
|
}
|
|
}
|
|
function hasCaughtError() {
|
|
return hasError;
|
|
}
|
|
function clearCaughtError() {
|
|
if (hasError) {
|
|
var error2 = caughtError;
|
|
hasError = false;
|
|
caughtError = null;
|
|
return error2;
|
|
} else {
|
|
throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
function get(key) {
|
|
return key._reactInternals;
|
|
}
|
|
function has(key) {
|
|
return key._reactInternals !== void 0;
|
|
}
|
|
function set(key, value) {
|
|
key._reactInternals = value;
|
|
}
|
|
var NoFlags = 0;
|
|
var PerformedWork = 1;
|
|
var Placement = 2;
|
|
var Update = 4;
|
|
var ChildDeletion = 16;
|
|
var ContentReset = 32;
|
|
var Callback = 64;
|
|
var DidCapture = 128;
|
|
var ForceClientRender = 256;
|
|
var Ref = 512;
|
|
var Snapshot = 1024;
|
|
var Passive = 2048;
|
|
var Hydrating = 4096;
|
|
var Visibility = 8192;
|
|
var StoreConsistency = 16384;
|
|
var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
|
|
var HostEffectMask = 32767;
|
|
var Incomplete = 32768;
|
|
var ShouldCapture = 65536;
|
|
var ForceUpdateForLegacySuspense = 131072;
|
|
var Forked = 1048576;
|
|
var RefStatic = 2097152;
|
|
var LayoutStatic = 4194304;
|
|
var PassiveStatic = 8388608;
|
|
var MountLayoutDev = 16777216;
|
|
var MountPassiveDev = 33554432;
|
|
var BeforeMutationMask = Update | Snapshot | 0;
|
|
var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility;
|
|
var LayoutMask = Update | Callback | Ref | Visibility;
|
|
var PassiveMask = Passive | ChildDeletion;
|
|
var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
|
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
function getNearestMountedFiber(fiber) {
|
|
var node = fiber;
|
|
var nearestMounted = fiber;
|
|
if (!fiber.alternate) {
|
|
var nextNode = node;
|
|
do {
|
|
node = nextNode;
|
|
if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
nearestMounted = node.return;
|
|
}
|
|
nextNode = node.return;
|
|
} while (nextNode);
|
|
} else {
|
|
while (node.return) {
|
|
node = node.return;
|
|
}
|
|
}
|
|
if (node.tag === HostRoot) {
|
|
return nearestMounted;
|
|
}
|
|
return null;
|
|
}
|
|
function getSuspenseInstanceFromFiber(fiber) {
|
|
if (fiber.tag === SuspenseComponent) {
|
|
var suspenseState = fiber.memoizedState;
|
|
if (suspenseState === null) {
|
|
var current2 = fiber.alternate;
|
|
if (current2 !== null) {
|
|
suspenseState = current2.memoizedState;
|
|
}
|
|
}
|
|
if (suspenseState !== null) {
|
|
return suspenseState.dehydrated;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getContainerFromFiber(fiber) {
|
|
return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
|
|
}
|
|
function isFiberMounted(fiber) {
|
|
return getNearestMountedFiber(fiber) === fiber;
|
|
}
|
|
function isMounted(component) {
|
|
{
|
|
var owner = ReactCurrentOwner.current;
|
|
if (owner !== null && owner.tag === ClassComponent) {
|
|
var ownerFiber = owner;
|
|
var instance = ownerFiber.stateNode;
|
|
if (!instance._warnedAboutRefsInRender) {
|
|
error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component");
|
|
}
|
|
instance._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
var fiber = get(component);
|
|
if (!fiber) {
|
|
return false;
|
|
}
|
|
return getNearestMountedFiber(fiber) === fiber;
|
|
}
|
|
function assertIsMounted(fiber) {
|
|
if (getNearestMountedFiber(fiber) !== fiber) {
|
|
throw new Error("Unable to find node on an unmounted component.");
|
|
}
|
|
}
|
|
function findCurrentFiberUsingSlowPath(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (!alternate) {
|
|
var nearestMounted = getNearestMountedFiber(fiber);
|
|
if (nearestMounted === null) {
|
|
throw new Error("Unable to find node on an unmounted component.");
|
|
}
|
|
if (nearestMounted !== fiber) {
|
|
return null;
|
|
}
|
|
return fiber;
|
|
}
|
|
var a2 = fiber;
|
|
var b2 = alternate;
|
|
while (true) {
|
|
var parentA = a2.return;
|
|
if (parentA === null) {
|
|
break;
|
|
}
|
|
var parentB = parentA.alternate;
|
|
if (parentB === null) {
|
|
var nextParent = parentA.return;
|
|
if (nextParent !== null) {
|
|
a2 = b2 = nextParent;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
if (parentA.child === parentB.child) {
|
|
var child = parentA.child;
|
|
while (child) {
|
|
if (child === a2) {
|
|
assertIsMounted(parentA);
|
|
return fiber;
|
|
}
|
|
if (child === b2) {
|
|
assertIsMounted(parentA);
|
|
return alternate;
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
throw new Error("Unable to find node on an unmounted component.");
|
|
}
|
|
if (a2.return !== b2.return) {
|
|
a2 = parentA;
|
|
b2 = parentB;
|
|
} else {
|
|
var didFindChild = false;
|
|
var _child = parentA.child;
|
|
while (_child) {
|
|
if (_child === a2) {
|
|
didFindChild = true;
|
|
a2 = parentA;
|
|
b2 = parentB;
|
|
break;
|
|
}
|
|
if (_child === b2) {
|
|
didFindChild = true;
|
|
b2 = parentA;
|
|
a2 = parentB;
|
|
break;
|
|
}
|
|
_child = _child.sibling;
|
|
}
|
|
if (!didFindChild) {
|
|
_child = parentB.child;
|
|
while (_child) {
|
|
if (_child === a2) {
|
|
didFindChild = true;
|
|
a2 = parentB;
|
|
b2 = parentA;
|
|
break;
|
|
}
|
|
if (_child === b2) {
|
|
didFindChild = true;
|
|
b2 = parentB;
|
|
a2 = parentA;
|
|
break;
|
|
}
|
|
_child = _child.sibling;
|
|
}
|
|
if (!didFindChild) {
|
|
throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
if (a2.alternate !== b2) {
|
|
throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (a2.tag !== HostRoot) {
|
|
throw new Error("Unable to find node on an unmounted component.");
|
|
}
|
|
if (a2.stateNode.current === a2) {
|
|
return fiber;
|
|
}
|
|
return alternate;
|
|
}
|
|
function findCurrentHostFiber(parent) {
|
|
var currentParent = findCurrentFiberUsingSlowPath(parent);
|
|
return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
|
|
}
|
|
function findCurrentHostFiberImpl(node) {
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
return node;
|
|
}
|
|
var child = node.child;
|
|
while (child !== null) {
|
|
var match = findCurrentHostFiberImpl(child);
|
|
if (match !== null) {
|
|
return match;
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function findCurrentHostFiberWithNoPortals(parent) {
|
|
var currentParent = findCurrentFiberUsingSlowPath(parent);
|
|
return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
|
|
}
|
|
function findCurrentHostFiberWithNoPortalsImpl(node) {
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
return node;
|
|
}
|
|
var child = node.child;
|
|
while (child !== null) {
|
|
if (child.tag !== HostPortal) {
|
|
var match = findCurrentHostFiberWithNoPortalsImpl(child);
|
|
if (match !== null) {
|
|
return match;
|
|
}
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
var scheduleCallback = Scheduler.unstable_scheduleCallback;
|
|
var cancelCallback = Scheduler.unstable_cancelCallback;
|
|
var shouldYield = Scheduler.unstable_shouldYield;
|
|
var requestPaint = Scheduler.unstable_requestPaint;
|
|
var now = Scheduler.unstable_now;
|
|
var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
|
|
var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
|
|
var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
|
|
var NormalPriority = Scheduler.unstable_NormalPriority;
|
|
var LowPriority = Scheduler.unstable_LowPriority;
|
|
var IdlePriority = Scheduler.unstable_IdlePriority;
|
|
var unstable_yieldValue = Scheduler.unstable_yieldValue;
|
|
var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
|
|
var rendererID = null;
|
|
var injectedHook = null;
|
|
var injectedProfilingHooks = null;
|
|
var hasLoggedError = false;
|
|
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
|
|
function injectInternals(internals) {
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
|
|
return false;
|
|
}
|
|
var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
if (hook.isDisabled) {
|
|
return true;
|
|
}
|
|
if (!hook.supportsFiber) {
|
|
{
|
|
error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
|
|
}
|
|
return true;
|
|
}
|
|
try {
|
|
if (enableSchedulingProfiler) {
|
|
internals = assign({}, internals, {
|
|
getLaneLabelMap,
|
|
injectProfilingHooks
|
|
});
|
|
}
|
|
rendererID = hook.inject(internals);
|
|
injectedHook = hook;
|
|
} catch (err) {
|
|
{
|
|
error("React instrumentation encountered an error: %s.", err);
|
|
}
|
|
}
|
|
if (hook.checkDCE) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function onScheduleRoot(root2, children) {
|
|
{
|
|
if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
|
|
try {
|
|
injectedHook.onScheduleFiberRoot(rendererID, root2, children);
|
|
} catch (err) {
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onCommitRoot(root2, eventPriority) {
|
|
if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
|
|
try {
|
|
var didError = (root2.current.flags & DidCapture) === DidCapture;
|
|
if (enableProfilerTimer) {
|
|
var schedulerPriority;
|
|
switch (eventPriority) {
|
|
case DiscreteEventPriority:
|
|
schedulerPriority = ImmediatePriority;
|
|
break;
|
|
case ContinuousEventPriority:
|
|
schedulerPriority = UserBlockingPriority;
|
|
break;
|
|
case DefaultEventPriority:
|
|
schedulerPriority = NormalPriority;
|
|
break;
|
|
case IdleEventPriority:
|
|
schedulerPriority = IdlePriority;
|
|
break;
|
|
default:
|
|
schedulerPriority = NormalPriority;
|
|
break;
|
|
}
|
|
injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
|
|
} else {
|
|
injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
|
|
}
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onPostCommitRoot(root2) {
|
|
if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
|
|
try {
|
|
injectedHook.onPostCommitFiberRoot(rendererID, root2);
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onCommitUnmount(fiber) {
|
|
if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
|
|
try {
|
|
injectedHook.onCommitFiberUnmount(rendererID, fiber);
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function setIsStrictModeForDevtools(newIsStrictMode) {
|
|
{
|
|
if (typeof unstable_yieldValue === "function") {
|
|
unstable_setDisableYieldValue(newIsStrictMode);
|
|
setSuppressWarning(newIsStrictMode);
|
|
}
|
|
if (injectedHook && typeof injectedHook.setStrictMode === "function") {
|
|
try {
|
|
injectedHook.setStrictMode(rendererID, newIsStrictMode);
|
|
} catch (err) {
|
|
{
|
|
if (!hasLoggedError) {
|
|
hasLoggedError = true;
|
|
error("React instrumentation encountered an error: %s", err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function injectProfilingHooks(profilingHooks) {
|
|
injectedProfilingHooks = profilingHooks;
|
|
}
|
|
function getLaneLabelMap() {
|
|
{
|
|
var map = /* @__PURE__ */ new Map();
|
|
var lane = 1;
|
|
for (var index2 = 0; index2 < TotalLanes; index2++) {
|
|
var label = getLabelForLane(lane);
|
|
map.set(lane, label);
|
|
lane *= 2;
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
function markCommitStarted(lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
|
|
injectedProfilingHooks.markCommitStarted(lanes);
|
|
}
|
|
}
|
|
}
|
|
function markCommitStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
|
|
injectedProfilingHooks.markCommitStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentRenderStarted(fiber) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
|
|
injectedProfilingHooks.markComponentRenderStarted(fiber);
|
|
}
|
|
}
|
|
}
|
|
function markComponentRenderStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
|
|
injectedProfilingHooks.markComponentRenderStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentPassiveEffectMountStarted(fiber) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
|
|
injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
|
|
}
|
|
}
|
|
}
|
|
function markComponentPassiveEffectMountStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
|
|
injectedProfilingHooks.markComponentPassiveEffectMountStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentPassiveEffectUnmountStarted(fiber) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
|
|
injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
|
|
}
|
|
}
|
|
}
|
|
function markComponentPassiveEffectUnmountStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
|
|
injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentLayoutEffectMountStarted(fiber) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
|
|
injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
|
|
}
|
|
}
|
|
}
|
|
function markComponentLayoutEffectMountStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
|
|
injectedProfilingHooks.markComponentLayoutEffectMountStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentLayoutEffectUnmountStarted(fiber) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
|
|
injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
|
|
}
|
|
}
|
|
}
|
|
function markComponentLayoutEffectUnmountStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
|
|
injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
|
|
}
|
|
}
|
|
}
|
|
function markComponentErrored(fiber, thrownValue, lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
|
|
injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
|
|
}
|
|
}
|
|
}
|
|
function markComponentSuspended(fiber, wakeable, lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
|
|
injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
|
|
}
|
|
}
|
|
}
|
|
function markLayoutEffectsStarted(lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
|
|
injectedProfilingHooks.markLayoutEffectsStarted(lanes);
|
|
}
|
|
}
|
|
}
|
|
function markLayoutEffectsStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
|
|
injectedProfilingHooks.markLayoutEffectsStopped();
|
|
}
|
|
}
|
|
}
|
|
function markPassiveEffectsStarted(lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
|
|
injectedProfilingHooks.markPassiveEffectsStarted(lanes);
|
|
}
|
|
}
|
|
}
|
|
function markPassiveEffectsStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
|
|
injectedProfilingHooks.markPassiveEffectsStopped();
|
|
}
|
|
}
|
|
}
|
|
function markRenderStarted(lanes) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
|
|
injectedProfilingHooks.markRenderStarted(lanes);
|
|
}
|
|
}
|
|
}
|
|
function markRenderYielded() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
|
|
injectedProfilingHooks.markRenderYielded();
|
|
}
|
|
}
|
|
}
|
|
function markRenderStopped() {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
|
|
injectedProfilingHooks.markRenderStopped();
|
|
}
|
|
}
|
|
}
|
|
function markRenderScheduled(lane) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
|
|
injectedProfilingHooks.markRenderScheduled(lane);
|
|
}
|
|
}
|
|
}
|
|
function markForceUpdateScheduled(fiber, lane) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
|
|
injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
|
|
}
|
|
}
|
|
}
|
|
function markStateUpdateScheduled(fiber, lane) {
|
|
{
|
|
if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
|
|
injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
|
|
}
|
|
}
|
|
}
|
|
var NoMode = 0;
|
|
var ConcurrentMode = 1;
|
|
var ProfileMode = 2;
|
|
var StrictLegacyMode = 8;
|
|
var StrictEffectsMode = 16;
|
|
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
|
|
var log = Math.log;
|
|
var LN2 = Math.LN2;
|
|
function clz32Fallback(x2) {
|
|
var asUint = x2 >>> 0;
|
|
if (asUint === 0) {
|
|
return 32;
|
|
}
|
|
return 31 - (log(asUint) / LN2 | 0) | 0;
|
|
}
|
|
var TotalLanes = 31;
|
|
var NoLanes = 0;
|
|
var NoLane = 0;
|
|
var SyncLane = 1;
|
|
var InputContinuousHydrationLane = 2;
|
|
var InputContinuousLane = 4;
|
|
var DefaultHydrationLane = 8;
|
|
var DefaultLane = 16;
|
|
var TransitionHydrationLane = 32;
|
|
var TransitionLanes = 4194240;
|
|
var TransitionLane1 = 64;
|
|
var TransitionLane2 = 128;
|
|
var TransitionLane3 = 256;
|
|
var TransitionLane4 = 512;
|
|
var TransitionLane5 = 1024;
|
|
var TransitionLane6 = 2048;
|
|
var TransitionLane7 = 4096;
|
|
var TransitionLane8 = 8192;
|
|
var TransitionLane9 = 16384;
|
|
var TransitionLane10 = 32768;
|
|
var TransitionLane11 = 65536;
|
|
var TransitionLane12 = 131072;
|
|
var TransitionLane13 = 262144;
|
|
var TransitionLane14 = 524288;
|
|
var TransitionLane15 = 1048576;
|
|
var TransitionLane16 = 2097152;
|
|
var RetryLanes = 130023424;
|
|
var RetryLane1 = 4194304;
|
|
var RetryLane2 = 8388608;
|
|
var RetryLane3 = 16777216;
|
|
var RetryLane4 = 33554432;
|
|
var RetryLane5 = 67108864;
|
|
var SomeRetryLane = RetryLane1;
|
|
var SelectiveHydrationLane = 134217728;
|
|
var NonIdleLanes = 268435455;
|
|
var IdleHydrationLane = 268435456;
|
|
var IdleLane = 536870912;
|
|
var OffscreenLane = 1073741824;
|
|
function getLabelForLane(lane) {
|
|
{
|
|
if (lane & SyncLane) {
|
|
return "Sync";
|
|
}
|
|
if (lane & InputContinuousHydrationLane) {
|
|
return "InputContinuousHydration";
|
|
}
|
|
if (lane & InputContinuousLane) {
|
|
return "InputContinuous";
|
|
}
|
|
if (lane & DefaultHydrationLane) {
|
|
return "DefaultHydration";
|
|
}
|
|
if (lane & DefaultLane) {
|
|
return "Default";
|
|
}
|
|
if (lane & TransitionHydrationLane) {
|
|
return "TransitionHydration";
|
|
}
|
|
if (lane & TransitionLanes) {
|
|
return "Transition";
|
|
}
|
|
if (lane & RetryLanes) {
|
|
return "Retry";
|
|
}
|
|
if (lane & SelectiveHydrationLane) {
|
|
return "SelectiveHydration";
|
|
}
|
|
if (lane & IdleHydrationLane) {
|
|
return "IdleHydration";
|
|
}
|
|
if (lane & IdleLane) {
|
|
return "Idle";
|
|
}
|
|
if (lane & OffscreenLane) {
|
|
return "Offscreen";
|
|
}
|
|
}
|
|
}
|
|
var NoTimestamp = -1;
|
|
var nextTransitionLane = TransitionLane1;
|
|
var nextRetryLane = RetryLane1;
|
|
function getHighestPriorityLanes(lanes) {
|
|
switch (getHighestPriorityLane(lanes)) {
|
|
case SyncLane:
|
|
return SyncLane;
|
|
case InputContinuousHydrationLane:
|
|
return InputContinuousHydrationLane;
|
|
case InputContinuousLane:
|
|
return InputContinuousLane;
|
|
case DefaultHydrationLane:
|
|
return DefaultHydrationLane;
|
|
case DefaultLane:
|
|
return DefaultLane;
|
|
case TransitionHydrationLane:
|
|
return TransitionHydrationLane;
|
|
case TransitionLane1:
|
|
case TransitionLane2:
|
|
case TransitionLane3:
|
|
case TransitionLane4:
|
|
case TransitionLane5:
|
|
case TransitionLane6:
|
|
case TransitionLane7:
|
|
case TransitionLane8:
|
|
case TransitionLane9:
|
|
case TransitionLane10:
|
|
case TransitionLane11:
|
|
case TransitionLane12:
|
|
case TransitionLane13:
|
|
case TransitionLane14:
|
|
case TransitionLane15:
|
|
case TransitionLane16:
|
|
return lanes & TransitionLanes;
|
|
case RetryLane1:
|
|
case RetryLane2:
|
|
case RetryLane3:
|
|
case RetryLane4:
|
|
case RetryLane5:
|
|
return lanes & RetryLanes;
|
|
case SelectiveHydrationLane:
|
|
return SelectiveHydrationLane;
|
|
case IdleHydrationLane:
|
|
return IdleHydrationLane;
|
|
case IdleLane:
|
|
return IdleLane;
|
|
case OffscreenLane:
|
|
return OffscreenLane;
|
|
default:
|
|
{
|
|
error("Should have found matching lanes. This is a bug in React.");
|
|
}
|
|
return lanes;
|
|
}
|
|
}
|
|
function getNextLanes(root2, wipLanes) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
if (pendingLanes === NoLanes) {
|
|
return NoLanes;
|
|
}
|
|
var nextLanes = NoLanes;
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
var pingedLanes = root2.pingedLanes;
|
|
var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
|
|
if (nonIdlePendingLanes !== NoLanes) {
|
|
var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
|
|
if (nonIdleUnblockedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
|
|
} else {
|
|
var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
|
|
if (nonIdlePingedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
|
|
}
|
|
}
|
|
} else {
|
|
var unblockedLanes = pendingLanes & ~suspendedLanes;
|
|
if (unblockedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(unblockedLanes);
|
|
} else {
|
|
if (pingedLanes !== NoLanes) {
|
|
nextLanes = getHighestPriorityLanes(pingedLanes);
|
|
}
|
|
}
|
|
}
|
|
if (nextLanes === NoLanes) {
|
|
return NoLanes;
|
|
}
|
|
if (wipLanes !== NoLanes && wipLanes !== nextLanes && (wipLanes & suspendedLanes) === NoLanes) {
|
|
var nextLane = getHighestPriorityLane(nextLanes);
|
|
var wipLane = getHighestPriorityLane(wipLanes);
|
|
if (nextLane >= wipLane || nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) {
|
|
return wipLanes;
|
|
}
|
|
}
|
|
if ((nextLanes & InputContinuousLane) !== NoLanes) {
|
|
nextLanes |= pendingLanes & DefaultLane;
|
|
}
|
|
var entangledLanes = root2.entangledLanes;
|
|
if (entangledLanes !== NoLanes) {
|
|
var entanglements = root2.entanglements;
|
|
var lanes = nextLanes & entangledLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
nextLanes |= entanglements[index2];
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
return nextLanes;
|
|
}
|
|
function getMostRecentEventTime(root2, lanes) {
|
|
var eventTimes = root2.eventTimes;
|
|
var mostRecentEventTime = NoTimestamp;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var eventTime = eventTimes[index2];
|
|
if (eventTime > mostRecentEventTime) {
|
|
mostRecentEventTime = eventTime;
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
return mostRecentEventTime;
|
|
}
|
|
function computeExpirationTime(lane, currentTime) {
|
|
switch (lane) {
|
|
case SyncLane:
|
|
case InputContinuousHydrationLane:
|
|
case InputContinuousLane:
|
|
return currentTime + 250;
|
|
case DefaultHydrationLane:
|
|
case DefaultLane:
|
|
case TransitionHydrationLane:
|
|
case TransitionLane1:
|
|
case TransitionLane2:
|
|
case TransitionLane3:
|
|
case TransitionLane4:
|
|
case TransitionLane5:
|
|
case TransitionLane6:
|
|
case TransitionLane7:
|
|
case TransitionLane8:
|
|
case TransitionLane9:
|
|
case TransitionLane10:
|
|
case TransitionLane11:
|
|
case TransitionLane12:
|
|
case TransitionLane13:
|
|
case TransitionLane14:
|
|
case TransitionLane15:
|
|
case TransitionLane16:
|
|
return currentTime + 5e3;
|
|
case RetryLane1:
|
|
case RetryLane2:
|
|
case RetryLane3:
|
|
case RetryLane4:
|
|
case RetryLane5:
|
|
return NoTimestamp;
|
|
case SelectiveHydrationLane:
|
|
case IdleHydrationLane:
|
|
case IdleLane:
|
|
case OffscreenLane:
|
|
return NoTimestamp;
|
|
default:
|
|
{
|
|
error("Should have found matching lanes. This is a bug in React.");
|
|
}
|
|
return NoTimestamp;
|
|
}
|
|
}
|
|
function markStarvedLanesAsExpired(root2, currentTime) {
|
|
var pendingLanes = root2.pendingLanes;
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
var pingedLanes = root2.pingedLanes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = pendingLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var expirationTime = expirationTimes[index2];
|
|
if (expirationTime === NoTimestamp) {
|
|
if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
|
|
expirationTimes[index2] = computeExpirationTime(lane, currentTime);
|
|
}
|
|
} else if (expirationTime <= currentTime) {
|
|
root2.expiredLanes |= lane;
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function getHighestPriorityPendingLanes(root2) {
|
|
return getHighestPriorityLanes(root2.pendingLanes);
|
|
}
|
|
function getLanesToRetrySynchronouslyOnError(root2) {
|
|
var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
|
|
if (everythingButOffscreen !== NoLanes) {
|
|
return everythingButOffscreen;
|
|
}
|
|
if (everythingButOffscreen & OffscreenLane) {
|
|
return OffscreenLane;
|
|
}
|
|
return NoLanes;
|
|
}
|
|
function includesSyncLane(lanes) {
|
|
return (lanes & SyncLane) !== NoLanes;
|
|
}
|
|
function includesNonIdleWork(lanes) {
|
|
return (lanes & NonIdleLanes) !== NoLanes;
|
|
}
|
|
function includesOnlyRetries(lanes) {
|
|
return (lanes & RetryLanes) === lanes;
|
|
}
|
|
function includesOnlyNonUrgentLanes(lanes) {
|
|
var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
|
|
return (lanes & UrgentLanes) === NoLanes;
|
|
}
|
|
function includesOnlyTransitions(lanes) {
|
|
return (lanes & TransitionLanes) === lanes;
|
|
}
|
|
function includesBlockingLane(root2, lanes) {
|
|
var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
|
|
return (lanes & SyncDefaultLanes) !== NoLanes;
|
|
}
|
|
function includesExpiredLane(root2, lanes) {
|
|
return (lanes & root2.expiredLanes) !== NoLanes;
|
|
}
|
|
function isTransitionLane(lane) {
|
|
return (lane & TransitionLanes) !== NoLanes;
|
|
}
|
|
function claimNextTransitionLane() {
|
|
var lane = nextTransitionLane;
|
|
nextTransitionLane <<= 1;
|
|
if ((nextTransitionLane & TransitionLanes) === NoLanes) {
|
|
nextTransitionLane = TransitionLane1;
|
|
}
|
|
return lane;
|
|
}
|
|
function claimNextRetryLane() {
|
|
var lane = nextRetryLane;
|
|
nextRetryLane <<= 1;
|
|
if ((nextRetryLane & RetryLanes) === NoLanes) {
|
|
nextRetryLane = RetryLane1;
|
|
}
|
|
return lane;
|
|
}
|
|
function getHighestPriorityLane(lanes) {
|
|
return lanes & -lanes;
|
|
}
|
|
function pickArbitraryLane(lanes) {
|
|
return getHighestPriorityLane(lanes);
|
|
}
|
|
function pickArbitraryLaneIndex(lanes) {
|
|
return 31 - clz32(lanes);
|
|
}
|
|
function laneToIndex(lane) {
|
|
return pickArbitraryLaneIndex(lane);
|
|
}
|
|
function includesSomeLane(a2, b2) {
|
|
return (a2 & b2) !== NoLanes;
|
|
}
|
|
function isSubsetOfLanes(set2, subset) {
|
|
return (set2 & subset) === subset;
|
|
}
|
|
function mergeLanes(a2, b2) {
|
|
return a2 | b2;
|
|
}
|
|
function removeLanes(set2, subset) {
|
|
return set2 & ~subset;
|
|
}
|
|
function intersectLanes(a2, b2) {
|
|
return a2 & b2;
|
|
}
|
|
function laneToLanes(lane) {
|
|
return lane;
|
|
}
|
|
function higherPriorityLane(a2, b2) {
|
|
return a2 !== NoLane && a2 < b2 ? a2 : b2;
|
|
}
|
|
function createLaneMap(initial) {
|
|
var laneMap = [];
|
|
for (var i2 = 0; i2 < TotalLanes; i2++) {
|
|
laneMap.push(initial);
|
|
}
|
|
return laneMap;
|
|
}
|
|
function markRootUpdated(root2, updateLane, eventTime) {
|
|
root2.pendingLanes |= updateLane;
|
|
if (updateLane !== IdleLane) {
|
|
root2.suspendedLanes = NoLanes;
|
|
root2.pingedLanes = NoLanes;
|
|
}
|
|
var eventTimes = root2.eventTimes;
|
|
var index2 = laneToIndex(updateLane);
|
|
eventTimes[index2] = eventTime;
|
|
}
|
|
function markRootSuspended(root2, suspendedLanes) {
|
|
root2.suspendedLanes |= suspendedLanes;
|
|
root2.pingedLanes &= ~suspendedLanes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = suspendedLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
expirationTimes[index2] = NoTimestamp;
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function markRootPinged(root2, pingedLanes, eventTime) {
|
|
root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
|
|
}
|
|
function markRootFinished(root2, remainingLanes) {
|
|
var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
|
|
root2.pendingLanes = remainingLanes;
|
|
root2.suspendedLanes = NoLanes;
|
|
root2.pingedLanes = NoLanes;
|
|
root2.expiredLanes &= remainingLanes;
|
|
root2.mutableReadLanes &= remainingLanes;
|
|
root2.entangledLanes &= remainingLanes;
|
|
var entanglements = root2.entanglements;
|
|
var eventTimes = root2.eventTimes;
|
|
var expirationTimes = root2.expirationTimes;
|
|
var lanes = noLongerPendingLanes;
|
|
while (lanes > 0) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
entanglements[index2] = NoLanes;
|
|
eventTimes[index2] = NoTimestamp;
|
|
expirationTimes[index2] = NoTimestamp;
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function markRootEntangled(root2, entangledLanes) {
|
|
var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
|
|
var entanglements = root2.entanglements;
|
|
var lanes = rootEntangledLanes;
|
|
while (lanes) {
|
|
var index2 = pickArbitraryLaneIndex(lanes);
|
|
var lane = 1 << index2;
|
|
if (lane & entangledLanes | entanglements[index2] & entangledLanes) {
|
|
entanglements[index2] |= entangledLanes;
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function getBumpedLaneForHydration(root2, renderLanes2) {
|
|
var renderLane = getHighestPriorityLane(renderLanes2);
|
|
var lane;
|
|
switch (renderLane) {
|
|
case InputContinuousLane:
|
|
lane = InputContinuousHydrationLane;
|
|
break;
|
|
case DefaultLane:
|
|
lane = DefaultHydrationLane;
|
|
break;
|
|
case TransitionLane1:
|
|
case TransitionLane2:
|
|
case TransitionLane3:
|
|
case TransitionLane4:
|
|
case TransitionLane5:
|
|
case TransitionLane6:
|
|
case TransitionLane7:
|
|
case TransitionLane8:
|
|
case TransitionLane9:
|
|
case TransitionLane10:
|
|
case TransitionLane11:
|
|
case TransitionLane12:
|
|
case TransitionLane13:
|
|
case TransitionLane14:
|
|
case TransitionLane15:
|
|
case TransitionLane16:
|
|
case RetryLane1:
|
|
case RetryLane2:
|
|
case RetryLane3:
|
|
case RetryLane4:
|
|
case RetryLane5:
|
|
lane = TransitionHydrationLane;
|
|
break;
|
|
case IdleLane:
|
|
lane = IdleHydrationLane;
|
|
break;
|
|
default:
|
|
lane = NoLane;
|
|
break;
|
|
}
|
|
if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
|
|
return NoLane;
|
|
}
|
|
return lane;
|
|
}
|
|
function addFiberToLanesMap(root2, fiber, lanes) {
|
|
if (!isDevToolsPresent) {
|
|
return;
|
|
}
|
|
var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
|
|
while (lanes > 0) {
|
|
var index2 = laneToIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var updaters = pendingUpdatersLaneMap[index2];
|
|
updaters.add(fiber);
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function movePendingFibersToMemoized(root2, lanes) {
|
|
if (!isDevToolsPresent) {
|
|
return;
|
|
}
|
|
var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
while (lanes > 0) {
|
|
var index2 = laneToIndex(lanes);
|
|
var lane = 1 << index2;
|
|
var updaters = pendingUpdatersLaneMap[index2];
|
|
if (updaters.size > 0) {
|
|
updaters.forEach(function(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (alternate === null || !memoizedUpdaters.has(alternate)) {
|
|
memoizedUpdaters.add(fiber);
|
|
}
|
|
});
|
|
updaters.clear();
|
|
}
|
|
lanes &= ~lane;
|
|
}
|
|
}
|
|
function getTransitionsForLanes(root2, lanes) {
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
var DiscreteEventPriority = SyncLane;
|
|
var ContinuousEventPriority = InputContinuousLane;
|
|
var DefaultEventPriority = DefaultLane;
|
|
var IdleEventPriority = IdleLane;
|
|
var currentUpdatePriority = NoLane;
|
|
function getCurrentUpdatePriority() {
|
|
return currentUpdatePriority;
|
|
}
|
|
function setCurrentUpdatePriority(newPriority) {
|
|
currentUpdatePriority = newPriority;
|
|
}
|
|
function runWithPriority(priority, fn2) {
|
|
var previousPriority = currentUpdatePriority;
|
|
try {
|
|
currentUpdatePriority = priority;
|
|
return fn2();
|
|
} finally {
|
|
currentUpdatePriority = previousPriority;
|
|
}
|
|
}
|
|
function higherEventPriority(a2, b2) {
|
|
return a2 !== 0 && a2 < b2 ? a2 : b2;
|
|
}
|
|
function lowerEventPriority(a2, b2) {
|
|
return a2 === 0 || a2 > b2 ? a2 : b2;
|
|
}
|
|
function isHigherEventPriority(a2, b2) {
|
|
return a2 !== 0 && a2 < b2;
|
|
}
|
|
function lanesToEventPriority(lanes) {
|
|
var lane = getHighestPriorityLane(lanes);
|
|
if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
|
|
return DiscreteEventPriority;
|
|
}
|
|
if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
|
|
return ContinuousEventPriority;
|
|
}
|
|
if (includesNonIdleWork(lane)) {
|
|
return DefaultEventPriority;
|
|
}
|
|
return IdleEventPriority;
|
|
}
|
|
function isRootDehydrated(root2) {
|
|
var currentState = root2.current.memoizedState;
|
|
return currentState.isDehydrated;
|
|
}
|
|
var _attemptSynchronousHydration;
|
|
function setAttemptSynchronousHydration(fn2) {
|
|
_attemptSynchronousHydration = fn2;
|
|
}
|
|
function attemptSynchronousHydration(fiber) {
|
|
_attemptSynchronousHydration(fiber);
|
|
}
|
|
var attemptContinuousHydration;
|
|
function setAttemptContinuousHydration(fn2) {
|
|
attemptContinuousHydration = fn2;
|
|
}
|
|
var attemptHydrationAtCurrentPriority;
|
|
function setAttemptHydrationAtCurrentPriority(fn2) {
|
|
attemptHydrationAtCurrentPriority = fn2;
|
|
}
|
|
var getCurrentUpdatePriority$1;
|
|
function setGetCurrentUpdatePriority(fn2) {
|
|
getCurrentUpdatePriority$1 = fn2;
|
|
}
|
|
var attemptHydrationAtPriority;
|
|
function setAttemptHydrationAtPriority(fn2) {
|
|
attemptHydrationAtPriority = fn2;
|
|
}
|
|
var hasScheduledReplayAttempt = false;
|
|
var queuedDiscreteEvents = [];
|
|
var queuedFocus = null;
|
|
var queuedDrag = null;
|
|
var queuedMouse = null;
|
|
var queuedPointers = /* @__PURE__ */ new Map();
|
|
var queuedPointerCaptures = /* @__PURE__ */ new Map();
|
|
var queuedExplicitHydrationTargets = [];
|
|
var discreteReplayableEvents = [
|
|
"mousedown",
|
|
"mouseup",
|
|
"touchcancel",
|
|
"touchend",
|
|
"touchstart",
|
|
"auxclick",
|
|
"dblclick",
|
|
"pointercancel",
|
|
"pointerdown",
|
|
"pointerup",
|
|
"dragend",
|
|
"dragstart",
|
|
"drop",
|
|
"compositionend",
|
|
"compositionstart",
|
|
"keydown",
|
|
"keypress",
|
|
"keyup",
|
|
"input",
|
|
"textInput",
|
|
"copy",
|
|
"cut",
|
|
"paste",
|
|
"click",
|
|
"change",
|
|
"contextmenu",
|
|
"reset",
|
|
"submit"
|
|
];
|
|
function isDiscreteEventThatRequiresHydration(eventType) {
|
|
return discreteReplayableEvents.indexOf(eventType) > -1;
|
|
}
|
|
function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
return {
|
|
blockedOn,
|
|
domEventName,
|
|
eventSystemFlags,
|
|
nativeEvent,
|
|
targetContainers: [targetContainer]
|
|
};
|
|
}
|
|
function clearIfContinuousEvent(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
case "focusout":
|
|
queuedFocus = null;
|
|
break;
|
|
case "dragenter":
|
|
case "dragleave":
|
|
queuedDrag = null;
|
|
break;
|
|
case "mouseover":
|
|
case "mouseout":
|
|
queuedMouse = null;
|
|
break;
|
|
case "pointerover":
|
|
case "pointerout": {
|
|
var pointerId = nativeEvent.pointerId;
|
|
queuedPointers.delete(pointerId);
|
|
break;
|
|
}
|
|
case "gotpointercapture":
|
|
case "lostpointercapture": {
|
|
var _pointerId = nativeEvent.pointerId;
|
|
queuedPointerCaptures.delete(_pointerId);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
|
|
var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
if (blockedOn !== null) {
|
|
var _fiber2 = getInstanceFromNode(blockedOn);
|
|
if (_fiber2 !== null) {
|
|
attemptContinuousHydration(_fiber2);
|
|
}
|
|
}
|
|
return queuedEvent;
|
|
}
|
|
existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
|
|
var targetContainers = existingQueuedEvent.targetContainers;
|
|
if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
|
|
targetContainers.push(targetContainer);
|
|
}
|
|
return existingQueuedEvent;
|
|
}
|
|
function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "focusin": {
|
|
var focusEvent = nativeEvent;
|
|
queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
|
|
return true;
|
|
}
|
|
case "dragenter": {
|
|
var dragEvent = nativeEvent;
|
|
queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
|
|
return true;
|
|
}
|
|
case "mouseover": {
|
|
var mouseEvent = nativeEvent;
|
|
queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
|
|
return true;
|
|
}
|
|
case "pointerover": {
|
|
var pointerEvent = nativeEvent;
|
|
var pointerId = pointerEvent.pointerId;
|
|
queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
|
|
return true;
|
|
}
|
|
case "gotpointercapture": {
|
|
var _pointerEvent = nativeEvent;
|
|
var _pointerId2 = _pointerEvent.pointerId;
|
|
queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function attemptExplicitHydrationTarget(queuedTarget) {
|
|
var targetInst = getClosestInstanceFromNode(queuedTarget.target);
|
|
if (targetInst !== null) {
|
|
var nearestMounted = getNearestMountedFiber(targetInst);
|
|
if (nearestMounted !== null) {
|
|
var tag = nearestMounted.tag;
|
|
if (tag === SuspenseComponent) {
|
|
var instance = getSuspenseInstanceFromFiber(nearestMounted);
|
|
if (instance !== null) {
|
|
queuedTarget.blockedOn = instance;
|
|
attemptHydrationAtPriority(queuedTarget.priority, function() {
|
|
attemptHydrationAtCurrentPriority(nearestMounted);
|
|
});
|
|
return;
|
|
}
|
|
} else if (tag === HostRoot) {
|
|
var root2 = nearestMounted.stateNode;
|
|
if (isRootDehydrated(root2)) {
|
|
queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
queuedTarget.blockedOn = null;
|
|
}
|
|
function queueExplicitHydrationTarget(target) {
|
|
var updatePriority = getCurrentUpdatePriority$1();
|
|
var queuedTarget = {
|
|
blockedOn: null,
|
|
target,
|
|
priority: updatePriority
|
|
};
|
|
var i2 = 0;
|
|
for (; i2 < queuedExplicitHydrationTargets.length; i2++) {
|
|
if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i2].priority)) {
|
|
break;
|
|
}
|
|
}
|
|
queuedExplicitHydrationTargets.splice(i2, 0, queuedTarget);
|
|
if (i2 === 0) {
|
|
attemptExplicitHydrationTarget(queuedTarget);
|
|
}
|
|
}
|
|
function attemptReplayContinuousQueuedEvent(queuedEvent) {
|
|
if (queuedEvent.blockedOn !== null) {
|
|
return false;
|
|
}
|
|
var targetContainers = queuedEvent.targetContainers;
|
|
while (targetContainers.length > 0) {
|
|
var targetContainer = targetContainers[0];
|
|
var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
|
|
if (nextBlockedOn === null) {
|
|
{
|
|
var nativeEvent = queuedEvent.nativeEvent;
|
|
var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
setReplayingEvent(nativeEventClone);
|
|
nativeEvent.target.dispatchEvent(nativeEventClone);
|
|
resetReplayingEvent();
|
|
}
|
|
} else {
|
|
var _fiber3 = getInstanceFromNode(nextBlockedOn);
|
|
if (_fiber3 !== null) {
|
|
attemptContinuousHydration(_fiber3);
|
|
}
|
|
queuedEvent.blockedOn = nextBlockedOn;
|
|
return false;
|
|
}
|
|
targetContainers.shift();
|
|
}
|
|
return true;
|
|
}
|
|
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
|
|
if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
|
|
map.delete(key);
|
|
}
|
|
}
|
|
function replayUnblockedEvents() {
|
|
hasScheduledReplayAttempt = false;
|
|
if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
|
|
queuedFocus = null;
|
|
}
|
|
if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
|
|
queuedDrag = null;
|
|
}
|
|
if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
|
|
queuedMouse = null;
|
|
}
|
|
queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
|
|
}
|
|
function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
|
|
if (queuedEvent.blockedOn === unblocked) {
|
|
queuedEvent.blockedOn = null;
|
|
if (!hasScheduledReplayAttempt) {
|
|
hasScheduledReplayAttempt = true;
|
|
Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
|
|
}
|
|
}
|
|
}
|
|
function retryIfBlockedOn(unblocked) {
|
|
if (queuedDiscreteEvents.length > 0) {
|
|
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
|
|
for (var i2 = 1; i2 < queuedDiscreteEvents.length; i2++) {
|
|
var queuedEvent = queuedDiscreteEvents[i2];
|
|
if (queuedEvent.blockedOn === unblocked) {
|
|
queuedEvent.blockedOn = null;
|
|
}
|
|
}
|
|
}
|
|
if (queuedFocus !== null) {
|
|
scheduleCallbackIfUnblocked(queuedFocus, unblocked);
|
|
}
|
|
if (queuedDrag !== null) {
|
|
scheduleCallbackIfUnblocked(queuedDrag, unblocked);
|
|
}
|
|
if (queuedMouse !== null) {
|
|
scheduleCallbackIfUnblocked(queuedMouse, unblocked);
|
|
}
|
|
var unblock = function(queuedEvent2) {
|
|
return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
|
|
};
|
|
queuedPointers.forEach(unblock);
|
|
queuedPointerCaptures.forEach(unblock);
|
|
for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
|
|
var queuedTarget = queuedExplicitHydrationTargets[_i];
|
|
if (queuedTarget.blockedOn === unblocked) {
|
|
queuedTarget.blockedOn = null;
|
|
}
|
|
}
|
|
while (queuedExplicitHydrationTargets.length > 0) {
|
|
var nextExplicitTarget = queuedExplicitHydrationTargets[0];
|
|
if (nextExplicitTarget.blockedOn !== null) {
|
|
break;
|
|
} else {
|
|
attemptExplicitHydrationTarget(nextExplicitTarget);
|
|
if (nextExplicitTarget.blockedOn === null) {
|
|
queuedExplicitHydrationTargets.shift();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
var _enabled = true;
|
|
function setEnabled(enabled) {
|
|
_enabled = !!enabled;
|
|
}
|
|
function isEnabled() {
|
|
return _enabled;
|
|
}
|
|
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
|
|
var eventPriority = getEventPriority(domEventName);
|
|
var listenerWrapper;
|
|
switch (eventPriority) {
|
|
case DiscreteEventPriority:
|
|
listenerWrapper = dispatchDiscreteEvent;
|
|
break;
|
|
case ContinuousEventPriority:
|
|
listenerWrapper = dispatchContinuousEvent;
|
|
break;
|
|
case DefaultEventPriority:
|
|
default:
|
|
listenerWrapper = dispatchEvent;
|
|
break;
|
|
}
|
|
return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
|
|
}
|
|
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
ReactCurrentBatchConfig.transition = null;
|
|
try {
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig.transition = prevTransition;
|
|
}
|
|
}
|
|
function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
ReactCurrentBatchConfig.transition = null;
|
|
try {
|
|
setCurrentUpdatePriority(ContinuousEventPriority);
|
|
dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig.transition = prevTransition;
|
|
}
|
|
}
|
|
function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
if (!_enabled) {
|
|
return;
|
|
}
|
|
{
|
|
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
}
|
|
}
|
|
function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
if (blockedOn === null) {
|
|
dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
|
|
clearIfContinuousEvent(domEventName, nativeEvent);
|
|
return;
|
|
}
|
|
if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
|
|
nativeEvent.stopPropagation();
|
|
return;
|
|
}
|
|
clearIfContinuousEvent(domEventName, nativeEvent);
|
|
if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
|
|
while (blockedOn !== null) {
|
|
var fiber = getInstanceFromNode(blockedOn);
|
|
if (fiber !== null) {
|
|
attemptSynchronousHydration(fiber);
|
|
}
|
|
var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
|
|
if (nextBlockedOn === null) {
|
|
dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
|
|
}
|
|
if (nextBlockedOn === blockedOn) {
|
|
break;
|
|
}
|
|
blockedOn = nextBlockedOn;
|
|
}
|
|
if (blockedOn !== null) {
|
|
nativeEvent.stopPropagation();
|
|
}
|
|
return;
|
|
}
|
|
dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
|
|
}
|
|
var return_targetInst = null;
|
|
function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
|
|
return_targetInst = null;
|
|
var nativeEventTarget = getEventTarget(nativeEvent);
|
|
var targetInst = getClosestInstanceFromNode(nativeEventTarget);
|
|
if (targetInst !== null) {
|
|
var nearestMounted = getNearestMountedFiber(targetInst);
|
|
if (nearestMounted === null) {
|
|
targetInst = null;
|
|
} else {
|
|
var tag = nearestMounted.tag;
|
|
if (tag === SuspenseComponent) {
|
|
var instance = getSuspenseInstanceFromFiber(nearestMounted);
|
|
if (instance !== null) {
|
|
return instance;
|
|
}
|
|
targetInst = null;
|
|
} else if (tag === HostRoot) {
|
|
var root2 = nearestMounted.stateNode;
|
|
if (isRootDehydrated(root2)) {
|
|
return getContainerFromFiber(nearestMounted);
|
|
}
|
|
targetInst = null;
|
|
} else if (nearestMounted !== targetInst) {
|
|
targetInst = null;
|
|
}
|
|
}
|
|
}
|
|
return_targetInst = targetInst;
|
|
return null;
|
|
}
|
|
function getEventPriority(domEventName) {
|
|
switch (domEventName) {
|
|
case "cancel":
|
|
case "click":
|
|
case "close":
|
|
case "contextmenu":
|
|
case "copy":
|
|
case "cut":
|
|
case "auxclick":
|
|
case "dblclick":
|
|
case "dragend":
|
|
case "dragstart":
|
|
case "drop":
|
|
case "focusin":
|
|
case "focusout":
|
|
case "input":
|
|
case "invalid":
|
|
case "keydown":
|
|
case "keypress":
|
|
case "keyup":
|
|
case "mousedown":
|
|
case "mouseup":
|
|
case "paste":
|
|
case "pause":
|
|
case "play":
|
|
case "pointercancel":
|
|
case "pointerdown":
|
|
case "pointerup":
|
|
case "ratechange":
|
|
case "reset":
|
|
case "resize":
|
|
case "seeked":
|
|
case "submit":
|
|
case "touchcancel":
|
|
case "touchend":
|
|
case "touchstart":
|
|
case "volumechange":
|
|
case "change":
|
|
case "selectionchange":
|
|
case "textInput":
|
|
case "compositionstart":
|
|
case "compositionend":
|
|
case "compositionupdate":
|
|
case "beforeblur":
|
|
case "afterblur":
|
|
case "beforeinput":
|
|
case "blur":
|
|
case "fullscreenchange":
|
|
case "focus":
|
|
case "hashchange":
|
|
case "popstate":
|
|
case "select":
|
|
case "selectstart":
|
|
return DiscreteEventPriority;
|
|
case "drag":
|
|
case "dragenter":
|
|
case "dragexit":
|
|
case "dragleave":
|
|
case "dragover":
|
|
case "mousemove":
|
|
case "mouseout":
|
|
case "mouseover":
|
|
case "pointermove":
|
|
case "pointerout":
|
|
case "pointerover":
|
|
case "scroll":
|
|
case "toggle":
|
|
case "touchmove":
|
|
case "wheel":
|
|
case "mouseenter":
|
|
case "mouseleave":
|
|
case "pointerenter":
|
|
case "pointerleave":
|
|
return ContinuousEventPriority;
|
|
case "message": {
|
|
var schedulerPriority = getCurrentPriorityLevel();
|
|
switch (schedulerPriority) {
|
|
case ImmediatePriority:
|
|
return DiscreteEventPriority;
|
|
case UserBlockingPriority:
|
|
return ContinuousEventPriority;
|
|
case NormalPriority:
|
|
case LowPriority:
|
|
return DefaultEventPriority;
|
|
case IdlePriority:
|
|
return IdleEventPriority;
|
|
default:
|
|
return DefaultEventPriority;
|
|
}
|
|
}
|
|
default:
|
|
return DefaultEventPriority;
|
|
}
|
|
}
|
|
function addEventBubbleListener(target, eventType, listener2) {
|
|
target.addEventListener(eventType, listener2, false);
|
|
return listener2;
|
|
}
|
|
function addEventCaptureListener(target, eventType, listener2) {
|
|
target.addEventListener(eventType, listener2, true);
|
|
return listener2;
|
|
}
|
|
function addEventCaptureListenerWithPassiveFlag(target, eventType, listener2, passive) {
|
|
target.addEventListener(eventType, listener2, {
|
|
capture: true,
|
|
passive
|
|
});
|
|
return listener2;
|
|
}
|
|
function addEventBubbleListenerWithPassiveFlag(target, eventType, listener2, passive) {
|
|
target.addEventListener(eventType, listener2, {
|
|
passive
|
|
});
|
|
return listener2;
|
|
}
|
|
var root = null;
|
|
var startText = null;
|
|
var fallbackText = null;
|
|
function initialize(nativeEventTarget) {
|
|
root = nativeEventTarget;
|
|
startText = getText();
|
|
return true;
|
|
}
|
|
function reset() {
|
|
root = null;
|
|
startText = null;
|
|
fallbackText = null;
|
|
}
|
|
function getData() {
|
|
if (fallbackText) {
|
|
return fallbackText;
|
|
}
|
|
var start;
|
|
var startValue = startText;
|
|
var startLength = startValue.length;
|
|
var end;
|
|
var endValue = getText();
|
|
var endLength = endValue.length;
|
|
for (start = 0; start < startLength; start++) {
|
|
if (startValue[start] !== endValue[start]) {
|
|
break;
|
|
}
|
|
}
|
|
var minEnd = startLength - start;
|
|
for (end = 1; end <= minEnd; end++) {
|
|
if (startValue[startLength - end] !== endValue[endLength - end]) {
|
|
break;
|
|
}
|
|
}
|
|
var sliceTail = end > 1 ? 1 - end : void 0;
|
|
fallbackText = endValue.slice(start, sliceTail);
|
|
return fallbackText;
|
|
}
|
|
function getText() {
|
|
if ("value" in root) {
|
|
return root.value;
|
|
}
|
|
return root.textContent;
|
|
}
|
|
function getEventCharCode(nativeEvent) {
|
|
var charCode;
|
|
var keyCode = nativeEvent.keyCode;
|
|
if ("charCode" in nativeEvent) {
|
|
charCode = nativeEvent.charCode;
|
|
if (charCode === 0 && keyCode === 13) {
|
|
charCode = 13;
|
|
}
|
|
} else {
|
|
charCode = keyCode;
|
|
}
|
|
if (charCode === 10) {
|
|
charCode = 13;
|
|
}
|
|
if (charCode >= 32 || charCode === 13) {
|
|
return charCode;
|
|
}
|
|
return 0;
|
|
}
|
|
function functionThatReturnsTrue() {
|
|
return true;
|
|
}
|
|
function functionThatReturnsFalse() {
|
|
return false;
|
|
}
|
|
function createSyntheticEvent(Interface) {
|
|
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
|
|
this._reactName = reactName;
|
|
this._targetInst = targetInst;
|
|
this.type = reactEventType;
|
|
this.nativeEvent = nativeEvent;
|
|
this.target = nativeEventTarget;
|
|
this.currentTarget = null;
|
|
for (var _propName in Interface) {
|
|
if (!Interface.hasOwnProperty(_propName)) {
|
|
continue;
|
|
}
|
|
var normalize = Interface[_propName];
|
|
if (normalize) {
|
|
this[_propName] = normalize(nativeEvent);
|
|
} else {
|
|
this[_propName] = nativeEvent[_propName];
|
|
}
|
|
}
|
|
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
if (defaultPrevented) {
|
|
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
} else {
|
|
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
}
|
|
this.isPropagationStopped = functionThatReturnsFalse;
|
|
return this;
|
|
}
|
|
assign(SyntheticBaseEvent.prototype, {
|
|
preventDefault: function() {
|
|
this.defaultPrevented = true;
|
|
var event = this.nativeEvent;
|
|
if (!event) {
|
|
return;
|
|
}
|
|
if (event.preventDefault) {
|
|
event.preventDefault();
|
|
} else if (typeof event.returnValue !== "unknown") {
|
|
event.returnValue = false;
|
|
}
|
|
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
},
|
|
stopPropagation: function() {
|
|
var event = this.nativeEvent;
|
|
if (!event) {
|
|
return;
|
|
}
|
|
if (event.stopPropagation) {
|
|
event.stopPropagation();
|
|
} else if (typeof event.cancelBubble !== "unknown") {
|
|
event.cancelBubble = true;
|
|
}
|
|
this.isPropagationStopped = functionThatReturnsTrue;
|
|
},
|
|
persist: function() {
|
|
},
|
|
isPersistent: functionThatReturnsTrue
|
|
});
|
|
return SyntheticBaseEvent;
|
|
}
|
|
var EventInterface = {
|
|
eventPhase: 0,
|
|
bubbles: 0,
|
|
cancelable: 0,
|
|
timeStamp: function(event) {
|
|
return event.timeStamp || Date.now();
|
|
},
|
|
defaultPrevented: 0,
|
|
isTrusted: 0
|
|
};
|
|
var SyntheticEvent = createSyntheticEvent(EventInterface);
|
|
var UIEventInterface = assign({}, EventInterface, {
|
|
view: 0,
|
|
detail: 0
|
|
});
|
|
var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
|
|
var lastMovementX;
|
|
var lastMovementY;
|
|
var lastMouseEvent;
|
|
function updateMouseMovementPolyfillState(event) {
|
|
if (event !== lastMouseEvent) {
|
|
if (lastMouseEvent && event.type === "mousemove") {
|
|
lastMovementX = event.screenX - lastMouseEvent.screenX;
|
|
lastMovementY = event.screenY - lastMouseEvent.screenY;
|
|
} else {
|
|
lastMovementX = 0;
|
|
lastMovementY = 0;
|
|
}
|
|
lastMouseEvent = event;
|
|
}
|
|
}
|
|
var MouseEventInterface = assign({}, UIEventInterface, {
|
|
screenX: 0,
|
|
screenY: 0,
|
|
clientX: 0,
|
|
clientY: 0,
|
|
pageX: 0,
|
|
pageY: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
getModifierState: getEventModifierState,
|
|
button: 0,
|
|
buttons: 0,
|
|
relatedTarget: function(event) {
|
|
if (event.relatedTarget === void 0)
|
|
return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
|
|
return event.relatedTarget;
|
|
},
|
|
movementX: function(event) {
|
|
if ("movementX" in event) {
|
|
return event.movementX;
|
|
}
|
|
updateMouseMovementPolyfillState(event);
|
|
return lastMovementX;
|
|
},
|
|
movementY: function(event) {
|
|
if ("movementY" in event) {
|
|
return event.movementY;
|
|
}
|
|
return lastMovementY;
|
|
}
|
|
});
|
|
var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
|
|
var DragEventInterface = assign({}, MouseEventInterface, {
|
|
dataTransfer: 0
|
|
});
|
|
var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
|
|
var FocusEventInterface = assign({}, UIEventInterface, {
|
|
relatedTarget: 0
|
|
});
|
|
var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
|
|
var AnimationEventInterface = assign({}, EventInterface, {
|
|
animationName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
});
|
|
var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
|
|
var ClipboardEventInterface = assign({}, EventInterface, {
|
|
clipboardData: function(event) {
|
|
return "clipboardData" in event ? event.clipboardData : window.clipboardData;
|
|
}
|
|
});
|
|
var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
|
|
var CompositionEventInterface = assign({}, EventInterface, {
|
|
data: 0
|
|
});
|
|
var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
|
|
var SyntheticInputEvent = SyntheticCompositionEvent;
|
|
var normalizeKey = {
|
|
Esc: "Escape",
|
|
Spacebar: " ",
|
|
Left: "ArrowLeft",
|
|
Up: "ArrowUp",
|
|
Right: "ArrowRight",
|
|
Down: "ArrowDown",
|
|
Del: "Delete",
|
|
Win: "OS",
|
|
Menu: "ContextMenu",
|
|
Apps: "ContextMenu",
|
|
Scroll: "ScrollLock",
|
|
MozPrintableKey: "Unidentified"
|
|
};
|
|
var translateToKey = {
|
|
"8": "Backspace",
|
|
"9": "Tab",
|
|
"12": "Clear",
|
|
"13": "Enter",
|
|
"16": "Shift",
|
|
"17": "Control",
|
|
"18": "Alt",
|
|
"19": "Pause",
|
|
"20": "CapsLock",
|
|
"27": "Escape",
|
|
"32": " ",
|
|
"33": "PageUp",
|
|
"34": "PageDown",
|
|
"35": "End",
|
|
"36": "Home",
|
|
"37": "ArrowLeft",
|
|
"38": "ArrowUp",
|
|
"39": "ArrowRight",
|
|
"40": "ArrowDown",
|
|
"45": "Insert",
|
|
"46": "Delete",
|
|
"112": "F1",
|
|
"113": "F2",
|
|
"114": "F3",
|
|
"115": "F4",
|
|
"116": "F5",
|
|
"117": "F6",
|
|
"118": "F7",
|
|
"119": "F8",
|
|
"120": "F9",
|
|
"121": "F10",
|
|
"122": "F11",
|
|
"123": "F12",
|
|
"144": "NumLock",
|
|
"145": "ScrollLock",
|
|
"224": "Meta"
|
|
};
|
|
function getEventKey(nativeEvent) {
|
|
if (nativeEvent.key) {
|
|
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
|
if (key !== "Unidentified") {
|
|
return key;
|
|
}
|
|
}
|
|
if (nativeEvent.type === "keypress") {
|
|
var charCode = getEventCharCode(nativeEvent);
|
|
return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
|
|
}
|
|
if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
|
|
return translateToKey[nativeEvent.keyCode] || "Unidentified";
|
|
}
|
|
return "";
|
|
}
|
|
var modifierKeyToProp = {
|
|
Alt: "altKey",
|
|
Control: "ctrlKey",
|
|
Meta: "metaKey",
|
|
Shift: "shiftKey"
|
|
};
|
|
function modifierStateGetter(keyArg) {
|
|
var syntheticEvent = this;
|
|
var nativeEvent = syntheticEvent.nativeEvent;
|
|
if (nativeEvent.getModifierState) {
|
|
return nativeEvent.getModifierState(keyArg);
|
|
}
|
|
var keyProp = modifierKeyToProp[keyArg];
|
|
return keyProp ? !!nativeEvent[keyProp] : false;
|
|
}
|
|
function getEventModifierState(nativeEvent) {
|
|
return modifierStateGetter;
|
|
}
|
|
var KeyboardEventInterface = assign({}, UIEventInterface, {
|
|
key: getEventKey,
|
|
code: 0,
|
|
location: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
repeat: 0,
|
|
locale: 0,
|
|
getModifierState: getEventModifierState,
|
|
charCode: function(event) {
|
|
if (event.type === "keypress") {
|
|
return getEventCharCode(event);
|
|
}
|
|
return 0;
|
|
},
|
|
keyCode: function(event) {
|
|
if (event.type === "keydown" || event.type === "keyup") {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
},
|
|
which: function(event) {
|
|
if (event.type === "keypress") {
|
|
return getEventCharCode(event);
|
|
}
|
|
if (event.type === "keydown" || event.type === "keyup") {
|
|
return event.keyCode;
|
|
}
|
|
return 0;
|
|
}
|
|
});
|
|
var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
|
|
var PointerEventInterface = assign({}, MouseEventInterface, {
|
|
pointerId: 0,
|
|
width: 0,
|
|
height: 0,
|
|
pressure: 0,
|
|
tangentialPressure: 0,
|
|
tiltX: 0,
|
|
tiltY: 0,
|
|
twist: 0,
|
|
pointerType: 0,
|
|
isPrimary: 0
|
|
});
|
|
var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
|
|
var TouchEventInterface = assign({}, UIEventInterface, {
|
|
touches: 0,
|
|
targetTouches: 0,
|
|
changedTouches: 0,
|
|
altKey: 0,
|
|
metaKey: 0,
|
|
ctrlKey: 0,
|
|
shiftKey: 0,
|
|
getModifierState: getEventModifierState
|
|
});
|
|
var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
|
|
var TransitionEventInterface = assign({}, EventInterface, {
|
|
propertyName: 0,
|
|
elapsedTime: 0,
|
|
pseudoElement: 0
|
|
});
|
|
var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
|
|
var WheelEventInterface = assign({}, MouseEventInterface, {
|
|
deltaX: function(event) {
|
|
return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
|
|
},
|
|
deltaY: function(event) {
|
|
return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
|
|
},
|
|
deltaZ: 0,
|
|
deltaMode: 0
|
|
});
|
|
var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
|
|
var END_KEYCODES = [9, 13, 27, 32];
|
|
var START_KEYCODE = 229;
|
|
var canUseCompositionEvent = canUseDOM2 && "CompositionEvent" in window;
|
|
var documentMode = null;
|
|
if (canUseDOM2 && "documentMode" in document) {
|
|
documentMode = document.documentMode;
|
|
}
|
|
var canUseTextInputEvent = canUseDOM2 && "TextEvent" in window && !documentMode;
|
|
var useFallbackCompositionData = canUseDOM2 && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
|
var SPACEBAR_CODE = 32;
|
|
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
|
function registerEvents() {
|
|
registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
|
|
registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
|
|
}
|
|
var hasSpaceKeypress = false;
|
|
function isKeypressCommand(nativeEvent) {
|
|
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
|
}
|
|
function getCompositionEventType(domEventName) {
|
|
switch (domEventName) {
|
|
case "compositionstart":
|
|
return "onCompositionStart";
|
|
case "compositionend":
|
|
return "onCompositionEnd";
|
|
case "compositionupdate":
|
|
return "onCompositionUpdate";
|
|
}
|
|
}
|
|
function isFallbackCompositionStart(domEventName, nativeEvent) {
|
|
return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
|
|
}
|
|
function isFallbackCompositionEnd(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "keyup":
|
|
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
|
case "keydown":
|
|
return nativeEvent.keyCode !== START_KEYCODE;
|
|
case "keypress":
|
|
case "mousedown":
|
|
case "focusout":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function getDataFromCustomEvent(nativeEvent) {
|
|
var detail = nativeEvent.detail;
|
|
if (typeof detail === "object" && "data" in detail) {
|
|
return detail.data;
|
|
}
|
|
return null;
|
|
}
|
|
function isUsingKoreanIME(nativeEvent) {
|
|
return nativeEvent.locale === "ko";
|
|
}
|
|
var isComposing = false;
|
|
function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
|
|
var eventType;
|
|
var fallbackData;
|
|
if (canUseCompositionEvent) {
|
|
eventType = getCompositionEventType(domEventName);
|
|
} else if (!isComposing) {
|
|
if (isFallbackCompositionStart(domEventName, nativeEvent)) {
|
|
eventType = "onCompositionStart";
|
|
}
|
|
} else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
|
|
eventType = "onCompositionEnd";
|
|
}
|
|
if (!eventType) {
|
|
return null;
|
|
}
|
|
if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
|
|
if (!isComposing && eventType === "onCompositionStart") {
|
|
isComposing = initialize(nativeEventTarget);
|
|
} else if (eventType === "onCompositionEnd") {
|
|
if (isComposing) {
|
|
fallbackData = getData();
|
|
}
|
|
}
|
|
}
|
|
var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
if (fallbackData) {
|
|
event.data = fallbackData;
|
|
} else {
|
|
var customData = getDataFromCustomEvent(nativeEvent);
|
|
if (customData !== null) {
|
|
event.data = customData;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getNativeBeforeInputChars(domEventName, nativeEvent) {
|
|
switch (domEventName) {
|
|
case "compositionend":
|
|
return getDataFromCustomEvent(nativeEvent);
|
|
case "keypress":
|
|
var which = nativeEvent.which;
|
|
if (which !== SPACEBAR_CODE) {
|
|
return null;
|
|
}
|
|
hasSpaceKeypress = true;
|
|
return SPACEBAR_CHAR;
|
|
case "textInput":
|
|
var chars = nativeEvent.data;
|
|
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
|
return null;
|
|
}
|
|
return chars;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function getFallbackBeforeInputChars(domEventName, nativeEvent) {
|
|
if (isComposing) {
|
|
if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
|
|
var chars = getData();
|
|
reset();
|
|
isComposing = false;
|
|
return chars;
|
|
}
|
|
return null;
|
|
}
|
|
switch (domEventName) {
|
|
case "paste":
|
|
return null;
|
|
case "keypress":
|
|
if (!isKeypressCommand(nativeEvent)) {
|
|
if (nativeEvent.char && nativeEvent.char.length > 1) {
|
|
return nativeEvent.char;
|
|
} else if (nativeEvent.which) {
|
|
return String.fromCharCode(nativeEvent.which);
|
|
}
|
|
}
|
|
return null;
|
|
case "compositionend":
|
|
return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
|
|
var chars;
|
|
if (canUseTextInputEvent) {
|
|
chars = getNativeBeforeInputChars(domEventName, nativeEvent);
|
|
} else {
|
|
chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
|
|
}
|
|
if (!chars) {
|
|
return null;
|
|
}
|
|
var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
event.data = chars;
|
|
}
|
|
}
|
|
function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
}
|
|
var supportedInputTypes = {
|
|
color: true,
|
|
date: true,
|
|
datetime: true,
|
|
"datetime-local": true,
|
|
email: true,
|
|
month: true,
|
|
number: true,
|
|
password: true,
|
|
range: true,
|
|
search: true,
|
|
tel: true,
|
|
text: true,
|
|
time: true,
|
|
url: true,
|
|
week: true
|
|
};
|
|
function isTextInputElement(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
if (nodeName === "input") {
|
|
return !!supportedInputTypes[elem.type];
|
|
}
|
|
if (nodeName === "textarea") {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function isEventSupported(eventNameSuffix) {
|
|
if (!canUseDOM2) {
|
|
return false;
|
|
}
|
|
var eventName = "on" + eventNameSuffix;
|
|
var isSupported = eventName in document;
|
|
if (!isSupported) {
|
|
var element = document.createElement("div");
|
|
element.setAttribute(eventName, "return;");
|
|
isSupported = typeof element[eventName] === "function";
|
|
}
|
|
return isSupported;
|
|
}
|
|
function registerEvents$1() {
|
|
registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
|
|
}
|
|
function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
|
|
enqueueStateRestore(target);
|
|
var listeners = accumulateTwoPhaseListeners(inst, "onChange");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
}
|
|
}
|
|
var activeElement = null;
|
|
var activeElementInst = null;
|
|
function shouldUseChangeEvent(elem) {
|
|
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName === "select" || nodeName === "input" && elem.type === "file";
|
|
}
|
|
function manualDispatchChangeEvent(nativeEvent) {
|
|
var dispatchQueue = [];
|
|
createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
|
|
batchedUpdates(runEventInBatch, dispatchQueue);
|
|
}
|
|
function runEventInBatch(dispatchQueue) {
|
|
processDispatchQueue(dispatchQueue, 0);
|
|
}
|
|
function getInstIfValueChanged(targetInst) {
|
|
var targetNode = getNodeFromInstance(targetInst);
|
|
if (updateValueIfChanged(targetNode)) {
|
|
return targetInst;
|
|
}
|
|
}
|
|
function getTargetInstForChangeEvent(domEventName, targetInst) {
|
|
if (domEventName === "change") {
|
|
return targetInst;
|
|
}
|
|
}
|
|
var isInputEventSupported = false;
|
|
if (canUseDOM2) {
|
|
isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
|
|
}
|
|
function startWatchingForValueChange(target, targetInst) {
|
|
activeElement = target;
|
|
activeElementInst = targetInst;
|
|
activeElement.attachEvent("onpropertychange", handlePropertyChange);
|
|
}
|
|
function stopWatchingForValueChange() {
|
|
if (!activeElement) {
|
|
return;
|
|
}
|
|
activeElement.detachEvent("onpropertychange", handlePropertyChange);
|
|
activeElement = null;
|
|
activeElementInst = null;
|
|
}
|
|
function handlePropertyChange(nativeEvent) {
|
|
if (nativeEvent.propertyName !== "value") {
|
|
return;
|
|
}
|
|
if (getInstIfValueChanged(activeElementInst)) {
|
|
manualDispatchChangeEvent(nativeEvent);
|
|
}
|
|
}
|
|
function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
|
|
if (domEventName === "focusin") {
|
|
stopWatchingForValueChange();
|
|
startWatchingForValueChange(target, targetInst);
|
|
} else if (domEventName === "focusout") {
|
|
stopWatchingForValueChange();
|
|
}
|
|
}
|
|
function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
|
|
if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
|
|
return getInstIfValueChanged(activeElementInst);
|
|
}
|
|
}
|
|
function shouldUseClickEvent(elem) {
|
|
var nodeName = elem.nodeName;
|
|
return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
|
|
}
|
|
function getTargetInstForClickEvent(domEventName, targetInst) {
|
|
if (domEventName === "click") {
|
|
return getInstIfValueChanged(targetInst);
|
|
}
|
|
}
|
|
function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
|
|
if (domEventName === "input" || domEventName === "change") {
|
|
return getInstIfValueChanged(targetInst);
|
|
}
|
|
}
|
|
function handleControlledInputBlur(node) {
|
|
var state = node._wrapperState;
|
|
if (!state || !state.controlled || node.type !== "number") {
|
|
return;
|
|
}
|
|
{
|
|
setDefaultValue(node, "number", node.value);
|
|
}
|
|
}
|
|
function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
var getTargetInstFunc, handleEventFunc;
|
|
if (shouldUseChangeEvent(targetNode)) {
|
|
getTargetInstFunc = getTargetInstForChangeEvent;
|
|
} else if (isTextInputElement(targetNode)) {
|
|
if (isInputEventSupported) {
|
|
getTargetInstFunc = getTargetInstForInputOrChangeEvent;
|
|
} else {
|
|
getTargetInstFunc = getTargetInstForInputEventPolyfill;
|
|
handleEventFunc = handleEventsForInputEventPolyfill;
|
|
}
|
|
} else if (shouldUseClickEvent(targetNode)) {
|
|
getTargetInstFunc = getTargetInstForClickEvent;
|
|
}
|
|
if (getTargetInstFunc) {
|
|
var inst = getTargetInstFunc(domEventName, targetInst);
|
|
if (inst) {
|
|
createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
|
|
return;
|
|
}
|
|
}
|
|
if (handleEventFunc) {
|
|
handleEventFunc(domEventName, targetNode, targetInst);
|
|
}
|
|
if (domEventName === "focusout") {
|
|
handleControlledInputBlur(targetNode);
|
|
}
|
|
}
|
|
function registerEvents$2() {
|
|
registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
|
|
registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
|
|
registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
|
|
}
|
|
function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
|
|
var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
|
|
if (isOverEvent && !isReplayingEvent(nativeEvent)) {
|
|
var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
|
|
if (related) {
|
|
if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
if (!isOutEvent && !isOverEvent) {
|
|
return;
|
|
}
|
|
var win;
|
|
if (nativeEventTarget.window === nativeEventTarget) {
|
|
win = nativeEventTarget;
|
|
} else {
|
|
var doc = nativeEventTarget.ownerDocument;
|
|
if (doc) {
|
|
win = doc.defaultView || doc.parentWindow;
|
|
} else {
|
|
win = window;
|
|
}
|
|
}
|
|
var from;
|
|
var to;
|
|
if (isOutEvent) {
|
|
var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
|
|
from = targetInst;
|
|
to = _related ? getClosestInstanceFromNode(_related) : null;
|
|
if (to !== null) {
|
|
var nearestMounted = getNearestMountedFiber(to);
|
|
if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
|
|
to = null;
|
|
}
|
|
}
|
|
} else {
|
|
from = null;
|
|
to = targetInst;
|
|
}
|
|
if (from === to) {
|
|
return;
|
|
}
|
|
var SyntheticEventCtor = SyntheticMouseEvent;
|
|
var leaveEventType = "onMouseLeave";
|
|
var enterEventType = "onMouseEnter";
|
|
var eventTypePrefix = "mouse";
|
|
if (domEventName === "pointerout" || domEventName === "pointerover") {
|
|
SyntheticEventCtor = SyntheticPointerEvent;
|
|
leaveEventType = "onPointerLeave";
|
|
enterEventType = "onPointerEnter";
|
|
eventTypePrefix = "pointer";
|
|
}
|
|
var fromNode = from == null ? win : getNodeFromInstance(from);
|
|
var toNode = to == null ? win : getNodeFromInstance(to);
|
|
var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
|
|
leave.target = fromNode;
|
|
leave.relatedTarget = toNode;
|
|
var enter = null;
|
|
var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
|
|
if (nativeTargetInst === targetInst) {
|
|
var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
|
|
enterEvent.target = toNode;
|
|
enterEvent.relatedTarget = fromNode;
|
|
enter = enterEvent;
|
|
}
|
|
accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
|
|
}
|
|
function is(x2, y2) {
|
|
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
}
|
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
function shallowEqual2(objA, objB) {
|
|
if (objectIs(objA, objB)) {
|
|
return true;
|
|
}
|
|
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
|
|
return false;
|
|
}
|
|
var keysA = Object.keys(objA);
|
|
var keysB = Object.keys(objB);
|
|
if (keysA.length !== keysB.length) {
|
|
return false;
|
|
}
|
|
for (var i2 = 0; i2 < keysA.length; i2++) {
|
|
var currentKey = keysA[i2];
|
|
if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function getLeafNode(node) {
|
|
while (node && node.firstChild) {
|
|
node = node.firstChild;
|
|
}
|
|
return node;
|
|
}
|
|
function getSiblingNode(node) {
|
|
while (node) {
|
|
if (node.nextSibling) {
|
|
return node.nextSibling;
|
|
}
|
|
node = node.parentNode;
|
|
}
|
|
}
|
|
function getNodeForCharacterOffset(root2, offset) {
|
|
var node = getLeafNode(root2);
|
|
var nodeStart = 0;
|
|
var nodeEnd = 0;
|
|
while (node) {
|
|
if (node.nodeType === TEXT_NODE) {
|
|
nodeEnd = nodeStart + node.textContent.length;
|
|
if (nodeStart <= offset && nodeEnd >= offset) {
|
|
return {
|
|
node,
|
|
offset: offset - nodeStart
|
|
};
|
|
}
|
|
nodeStart = nodeEnd;
|
|
}
|
|
node = getLeafNode(getSiblingNode(node));
|
|
}
|
|
}
|
|
function getOffsets(outerNode) {
|
|
var ownerDocument = outerNode.ownerDocument;
|
|
var win = ownerDocument && ownerDocument.defaultView || window;
|
|
var selection = win.getSelection && win.getSelection();
|
|
if (!selection || selection.rangeCount === 0) {
|
|
return null;
|
|
}
|
|
var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
|
|
try {
|
|
anchorNode.nodeType;
|
|
focusNode.nodeType;
|
|
} catch (e) {
|
|
return null;
|
|
}
|
|
return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
|
|
}
|
|
function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
|
|
var length = 0;
|
|
var start = -1;
|
|
var end = -1;
|
|
var indexWithinAnchor = 0;
|
|
var indexWithinFocus = 0;
|
|
var node = outerNode;
|
|
var parentNode = null;
|
|
outer:
|
|
while (true) {
|
|
var next = null;
|
|
while (true) {
|
|
if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
|
|
start = length + anchorOffset;
|
|
}
|
|
if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
|
|
end = length + focusOffset;
|
|
}
|
|
if (node.nodeType === TEXT_NODE) {
|
|
length += node.nodeValue.length;
|
|
}
|
|
if ((next = node.firstChild) === null) {
|
|
break;
|
|
}
|
|
parentNode = node;
|
|
node = next;
|
|
}
|
|
while (true) {
|
|
if (node === outerNode) {
|
|
break outer;
|
|
}
|
|
if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
|
|
start = length;
|
|
}
|
|
if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
|
|
end = length;
|
|
}
|
|
if ((next = node.nextSibling) !== null) {
|
|
break;
|
|
}
|
|
node = parentNode;
|
|
parentNode = node.parentNode;
|
|
}
|
|
node = next;
|
|
}
|
|
if (start === -1 || end === -1) {
|
|
return null;
|
|
}
|
|
return {
|
|
start,
|
|
end
|
|
};
|
|
}
|
|
function setOffsets(node, offsets) {
|
|
var doc = node.ownerDocument || document;
|
|
var win = doc && doc.defaultView || window;
|
|
if (!win.getSelection) {
|
|
return;
|
|
}
|
|
var selection = win.getSelection();
|
|
var length = node.textContent.length;
|
|
var start = Math.min(offsets.start, length);
|
|
var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
|
|
if (!selection.extend && start > end) {
|
|
var temp = end;
|
|
end = start;
|
|
start = temp;
|
|
}
|
|
var startMarker = getNodeForCharacterOffset(node, start);
|
|
var endMarker = getNodeForCharacterOffset(node, end);
|
|
if (startMarker && endMarker) {
|
|
if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
|
|
return;
|
|
}
|
|
var range = doc.createRange();
|
|
range.setStart(startMarker.node, startMarker.offset);
|
|
selection.removeAllRanges();
|
|
if (start > end) {
|
|
selection.addRange(range);
|
|
selection.extend(endMarker.node, endMarker.offset);
|
|
} else {
|
|
range.setEnd(endMarker.node, endMarker.offset);
|
|
selection.addRange(range);
|
|
}
|
|
}
|
|
}
|
|
function isTextNode(node) {
|
|
return node && node.nodeType === TEXT_NODE;
|
|
}
|
|
function containsNode(outerNode, innerNode) {
|
|
if (!outerNode || !innerNode) {
|
|
return false;
|
|
} else if (outerNode === innerNode) {
|
|
return true;
|
|
} else if (isTextNode(outerNode)) {
|
|
return false;
|
|
} else if (isTextNode(innerNode)) {
|
|
return containsNode(outerNode, innerNode.parentNode);
|
|
} else if ("contains" in outerNode) {
|
|
return outerNode.contains(innerNode);
|
|
} else if (outerNode.compareDocumentPosition) {
|
|
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
function isInDocument(node) {
|
|
return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
|
|
}
|
|
function isSameOriginFrame(iframe) {
|
|
try {
|
|
return typeof iframe.contentWindow.location.href === "string";
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|
|
function getActiveElementDeep() {
|
|
var win = window;
|
|
var element = getActiveElement();
|
|
while (element instanceof win.HTMLIFrameElement) {
|
|
if (isSameOriginFrame(element)) {
|
|
win = element.contentWindow;
|
|
} else {
|
|
return element;
|
|
}
|
|
element = getActiveElement(win.document);
|
|
}
|
|
return element;
|
|
}
|
|
function hasSelectionCapabilities(elem) {
|
|
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
|
|
}
|
|
function getSelectionInformation() {
|
|
var focusedElem = getActiveElementDeep();
|
|
return {
|
|
focusedElem,
|
|
selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
|
|
};
|
|
}
|
|
function restoreSelection(priorSelectionInformation) {
|
|
var curFocusedElem = getActiveElementDeep();
|
|
var priorFocusedElem = priorSelectionInformation.focusedElem;
|
|
var priorSelectionRange = priorSelectionInformation.selectionRange;
|
|
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
|
if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
|
|
setSelection(priorFocusedElem, priorSelectionRange);
|
|
}
|
|
var ancestors = [];
|
|
var ancestor = priorFocusedElem;
|
|
while (ancestor = ancestor.parentNode) {
|
|
if (ancestor.nodeType === ELEMENT_NODE) {
|
|
ancestors.push({
|
|
element: ancestor,
|
|
left: ancestor.scrollLeft,
|
|
top: ancestor.scrollTop
|
|
});
|
|
}
|
|
}
|
|
if (typeof priorFocusedElem.focus === "function") {
|
|
priorFocusedElem.focus();
|
|
}
|
|
for (var i2 = 0; i2 < ancestors.length; i2++) {
|
|
var info = ancestors[i2];
|
|
info.element.scrollLeft = info.left;
|
|
info.element.scrollTop = info.top;
|
|
}
|
|
}
|
|
}
|
|
function getSelection(input) {
|
|
var selection;
|
|
if ("selectionStart" in input) {
|
|
selection = {
|
|
start: input.selectionStart,
|
|
end: input.selectionEnd
|
|
};
|
|
} else {
|
|
selection = getOffsets(input);
|
|
}
|
|
return selection || {
|
|
start: 0,
|
|
end: 0
|
|
};
|
|
}
|
|
function setSelection(input, offsets) {
|
|
var start = offsets.start;
|
|
var end = offsets.end;
|
|
if (end === void 0) {
|
|
end = start;
|
|
}
|
|
if ("selectionStart" in input) {
|
|
input.selectionStart = start;
|
|
input.selectionEnd = Math.min(end, input.value.length);
|
|
} else {
|
|
setOffsets(input, offsets);
|
|
}
|
|
}
|
|
var skipSelectionChangeEvent = canUseDOM2 && "documentMode" in document && document.documentMode <= 11;
|
|
function registerEvents$3() {
|
|
registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
|
|
}
|
|
var activeElement$1 = null;
|
|
var activeElementInst$1 = null;
|
|
var lastSelection = null;
|
|
var mouseDown = false;
|
|
function getSelection$1(node) {
|
|
if ("selectionStart" in node && hasSelectionCapabilities(node)) {
|
|
return {
|
|
start: node.selectionStart,
|
|
end: node.selectionEnd
|
|
};
|
|
} else {
|
|
var win = node.ownerDocument && node.ownerDocument.defaultView || window;
|
|
var selection = win.getSelection();
|
|
return {
|
|
anchorNode: selection.anchorNode,
|
|
anchorOffset: selection.anchorOffset,
|
|
focusNode: selection.focusNode,
|
|
focusOffset: selection.focusOffset
|
|
};
|
|
}
|
|
}
|
|
function getEventTargetDocument(eventTarget) {
|
|
return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
|
|
}
|
|
function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
|
|
var doc = getEventTargetDocument(nativeEventTarget);
|
|
if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
|
|
return;
|
|
}
|
|
var currentSelection = getSelection$1(activeElement$1);
|
|
if (!lastSelection || !shallowEqual2(lastSelection, currentSelection)) {
|
|
lastSelection = currentSelection;
|
|
var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
|
|
if (listeners.length > 0) {
|
|
var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
event.target = activeElement$1;
|
|
}
|
|
}
|
|
}
|
|
function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
|
|
switch (domEventName) {
|
|
case "focusin":
|
|
if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
|
|
activeElement$1 = targetNode;
|
|
activeElementInst$1 = targetInst;
|
|
lastSelection = null;
|
|
}
|
|
break;
|
|
case "focusout":
|
|
activeElement$1 = null;
|
|
activeElementInst$1 = null;
|
|
lastSelection = null;
|
|
break;
|
|
case "mousedown":
|
|
mouseDown = true;
|
|
break;
|
|
case "contextmenu":
|
|
case "mouseup":
|
|
case "dragend":
|
|
mouseDown = false;
|
|
constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
|
|
break;
|
|
case "selectionchange":
|
|
if (skipSelectionChangeEvent) {
|
|
break;
|
|
}
|
|
case "keydown":
|
|
case "keyup":
|
|
constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
|
|
}
|
|
}
|
|
function makePrefixMap(styleProp, eventName) {
|
|
var prefixes2 = {};
|
|
prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
|
|
prefixes2["Webkit" + styleProp] = "webkit" + eventName;
|
|
prefixes2["Moz" + styleProp] = "moz" + eventName;
|
|
return prefixes2;
|
|
}
|
|
var vendorPrefixes = {
|
|
animationend: makePrefixMap("Animation", "AnimationEnd"),
|
|
animationiteration: makePrefixMap("Animation", "AnimationIteration"),
|
|
animationstart: makePrefixMap("Animation", "AnimationStart"),
|
|
transitionend: makePrefixMap("Transition", "TransitionEnd")
|
|
};
|
|
var prefixedEventNames = {};
|
|
var style3 = {};
|
|
if (canUseDOM2) {
|
|
style3 = document.createElement("div").style;
|
|
if (!("AnimationEvent" in window)) {
|
|
delete vendorPrefixes.animationend.animation;
|
|
delete vendorPrefixes.animationiteration.animation;
|
|
delete vendorPrefixes.animationstart.animation;
|
|
}
|
|
if (!("TransitionEvent" in window)) {
|
|
delete vendorPrefixes.transitionend.transition;
|
|
}
|
|
}
|
|
function getVendorPrefixedEventName(eventName) {
|
|
if (prefixedEventNames[eventName]) {
|
|
return prefixedEventNames[eventName];
|
|
} else if (!vendorPrefixes[eventName]) {
|
|
return eventName;
|
|
}
|
|
var prefixMap = vendorPrefixes[eventName];
|
|
for (var styleProp in prefixMap) {
|
|
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style3) {
|
|
return prefixedEventNames[eventName] = prefixMap[styleProp];
|
|
}
|
|
}
|
|
return eventName;
|
|
}
|
|
var ANIMATION_END = getVendorPrefixedEventName("animationend");
|
|
var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
|
|
var ANIMATION_START = getVendorPrefixedEventName("animationstart");
|
|
var TRANSITION_END = getVendorPrefixedEventName("transitionend");
|
|
var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
|
|
var simpleEventPluginEvents = ["abort", "auxClick", "cancel", "canPlay", "canPlayThrough", "click", "close", "contextMenu", "copy", "cut", "drag", "dragEnd", "dragEnter", "dragExit", "dragLeave", "dragOver", "dragStart", "drop", "durationChange", "emptied", "encrypted", "ended", "error", "gotPointerCapture", "input", "invalid", "keyDown", "keyPress", "keyUp", "load", "loadedData", "loadedMetadata", "loadStart", "lostPointerCapture", "mouseDown", "mouseMove", "mouseOut", "mouseOver", "mouseUp", "paste", "pause", "play", "playing", "pointerCancel", "pointerDown", "pointerMove", "pointerOut", "pointerOver", "pointerUp", "progress", "rateChange", "reset", "resize", "seeked", "seeking", "stalled", "submit", "suspend", "timeUpdate", "touchCancel", "touchEnd", "touchStart", "volumeChange", "scroll", "toggle", "touchMove", "waiting", "wheel"];
|
|
function registerSimpleEvent(domEventName, reactName) {
|
|
topLevelEventsToReactNames.set(domEventName, reactName);
|
|
registerTwoPhaseEvent(reactName, [domEventName]);
|
|
}
|
|
function registerSimpleEvents() {
|
|
for (var i2 = 0; i2 < simpleEventPluginEvents.length; i2++) {
|
|
var eventName = simpleEventPluginEvents[i2];
|
|
var domEventName = eventName.toLowerCase();
|
|
var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
|
|
registerSimpleEvent(domEventName, "on" + capitalizedEvent);
|
|
}
|
|
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
|
registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
|
|
registerSimpleEvent(ANIMATION_START, "onAnimationStart");
|
|
registerSimpleEvent("dblclick", "onDoubleClick");
|
|
registerSimpleEvent("focusin", "onFocus");
|
|
registerSimpleEvent("focusout", "onBlur");
|
|
registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
|
|
}
|
|
function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
var reactName = topLevelEventsToReactNames.get(domEventName);
|
|
if (reactName === void 0) {
|
|
return;
|
|
}
|
|
var SyntheticEventCtor = SyntheticEvent;
|
|
var reactEventType = domEventName;
|
|
switch (domEventName) {
|
|
case "keypress":
|
|
if (getEventCharCode(nativeEvent) === 0) {
|
|
return;
|
|
}
|
|
case "keydown":
|
|
case "keyup":
|
|
SyntheticEventCtor = SyntheticKeyboardEvent;
|
|
break;
|
|
case "focusin":
|
|
reactEventType = "focus";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "focusout":
|
|
reactEventType = "blur";
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "beforeblur":
|
|
case "afterblur":
|
|
SyntheticEventCtor = SyntheticFocusEvent;
|
|
break;
|
|
case "click":
|
|
if (nativeEvent.button === 2) {
|
|
return;
|
|
}
|
|
case "auxclick":
|
|
case "dblclick":
|
|
case "mousedown":
|
|
case "mousemove":
|
|
case "mouseup":
|
|
case "mouseout":
|
|
case "mouseover":
|
|
case "contextmenu":
|
|
SyntheticEventCtor = SyntheticMouseEvent;
|
|
break;
|
|
case "drag":
|
|
case "dragend":
|
|
case "dragenter":
|
|
case "dragexit":
|
|
case "dragleave":
|
|
case "dragover":
|
|
case "dragstart":
|
|
case "drop":
|
|
SyntheticEventCtor = SyntheticDragEvent;
|
|
break;
|
|
case "touchcancel":
|
|
case "touchend":
|
|
case "touchmove":
|
|
case "touchstart":
|
|
SyntheticEventCtor = SyntheticTouchEvent;
|
|
break;
|
|
case ANIMATION_END:
|
|
case ANIMATION_ITERATION:
|
|
case ANIMATION_START:
|
|
SyntheticEventCtor = SyntheticAnimationEvent;
|
|
break;
|
|
case TRANSITION_END:
|
|
SyntheticEventCtor = SyntheticTransitionEvent;
|
|
break;
|
|
case "scroll":
|
|
SyntheticEventCtor = SyntheticUIEvent;
|
|
break;
|
|
case "wheel":
|
|
SyntheticEventCtor = SyntheticWheelEvent;
|
|
break;
|
|
case "copy":
|
|
case "cut":
|
|
case "paste":
|
|
SyntheticEventCtor = SyntheticClipboardEvent;
|
|
break;
|
|
case "gotpointercapture":
|
|
case "lostpointercapture":
|
|
case "pointercancel":
|
|
case "pointerdown":
|
|
case "pointermove":
|
|
case "pointerout":
|
|
case "pointerover":
|
|
case "pointerup":
|
|
SyntheticEventCtor = SyntheticPointerEvent;
|
|
break;
|
|
}
|
|
var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
|
|
{
|
|
var accumulateTargetOnly = !inCapturePhase && domEventName === "scroll";
|
|
var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
|
|
if (_listeners.length > 0) {
|
|
var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
|
|
dispatchQueue.push({
|
|
event: _event,
|
|
listeners: _listeners
|
|
});
|
|
}
|
|
}
|
|
}
|
|
registerSimpleEvents();
|
|
registerEvents$2();
|
|
registerEvents$1();
|
|
registerEvents$3();
|
|
registerEvents();
|
|
function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
|
|
extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
|
|
var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
|
|
if (shouldProcessPolyfillPlugins) {
|
|
extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
|
|
}
|
|
}
|
|
var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "resize", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
|
|
var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
|
|
function executeDispatch(event, listener2, currentTarget) {
|
|
var type = event.type || "unknown-event";
|
|
event.currentTarget = currentTarget;
|
|
invokeGuardedCallbackAndCatchFirstError(type, listener2, void 0, event);
|
|
event.currentTarget = null;
|
|
}
|
|
function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
|
|
var previousInstance;
|
|
if (inCapturePhase) {
|
|
for (var i2 = dispatchListeners.length - 1; i2 >= 0; i2--) {
|
|
var _dispatchListeners$i = dispatchListeners[i2], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener2 = _dispatchListeners$i.listener;
|
|
if (instance !== previousInstance && event.isPropagationStopped()) {
|
|
return;
|
|
}
|
|
executeDispatch(event, listener2, currentTarget);
|
|
previousInstance = instance;
|
|
}
|
|
} else {
|
|
for (var _i = 0; _i < dispatchListeners.length; _i++) {
|
|
var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
|
|
if (_instance !== previousInstance && event.isPropagationStopped()) {
|
|
return;
|
|
}
|
|
executeDispatch(event, _listener, _currentTarget);
|
|
previousInstance = _instance;
|
|
}
|
|
}
|
|
}
|
|
function processDispatchQueue(dispatchQueue, eventSystemFlags) {
|
|
var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
|
|
for (var i2 = 0; i2 < dispatchQueue.length; i2++) {
|
|
var _dispatchQueue$i = dispatchQueue[i2], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
|
|
processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
|
|
}
|
|
rethrowCaughtError();
|
|
}
|
|
function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
|
|
var nativeEventTarget = getEventTarget(nativeEvent);
|
|
var dispatchQueue = [];
|
|
extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
|
|
processDispatchQueue(dispatchQueue, eventSystemFlags);
|
|
}
|
|
function listenToNonDelegatedEvent(domEventName, targetElement) {
|
|
{
|
|
if (!nonDelegatedEvents.has(domEventName)) {
|
|
error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
|
|
}
|
|
}
|
|
var isCapturePhaseListener = false;
|
|
var listenerSet = getEventListenerSet(targetElement);
|
|
var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
|
|
if (!listenerSet.has(listenerSetKey)) {
|
|
addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
|
|
listenerSet.add(listenerSetKey);
|
|
}
|
|
}
|
|
function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
|
|
{
|
|
if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
|
|
error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
|
|
}
|
|
}
|
|
var eventSystemFlags = 0;
|
|
if (isCapturePhaseListener) {
|
|
eventSystemFlags |= IS_CAPTURE_PHASE;
|
|
}
|
|
addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
|
|
}
|
|
var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
|
|
function listenToAllSupportedEvents(rootContainerElement) {
|
|
if (!rootContainerElement[listeningMarker]) {
|
|
rootContainerElement[listeningMarker] = true;
|
|
allNativeEvents.forEach(function(domEventName) {
|
|
if (domEventName !== "selectionchange") {
|
|
if (!nonDelegatedEvents.has(domEventName)) {
|
|
listenToNativeEvent(domEventName, false, rootContainerElement);
|
|
}
|
|
listenToNativeEvent(domEventName, true, rootContainerElement);
|
|
}
|
|
});
|
|
var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
if (ownerDocument !== null) {
|
|
if (!ownerDocument[listeningMarker]) {
|
|
ownerDocument[listeningMarker] = true;
|
|
listenToNativeEvent("selectionchange", false, ownerDocument);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
|
|
var listener2 = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
|
|
var isPassiveListener = void 0;
|
|
if (passiveBrowserEventsSupported) {
|
|
if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
|
|
isPassiveListener = true;
|
|
}
|
|
}
|
|
targetContainer = targetContainer;
|
|
var unsubscribeListener;
|
|
if (isCapturePhaseListener) {
|
|
if (isPassiveListener !== void 0) {
|
|
unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener2, isPassiveListener);
|
|
} else {
|
|
unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener2);
|
|
}
|
|
} else {
|
|
if (isPassiveListener !== void 0) {
|
|
unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener2, isPassiveListener);
|
|
} else {
|
|
unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener2);
|
|
}
|
|
}
|
|
}
|
|
function isMatchingRootContainer(grandContainer, targetContainer) {
|
|
return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
|
|
}
|
|
function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
|
|
var ancestorInst = targetInst;
|
|
if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
|
|
var targetContainerNode = targetContainer;
|
|
if (targetInst !== null) {
|
|
var node = targetInst;
|
|
mainLoop:
|
|
while (true) {
|
|
if (node === null) {
|
|
return;
|
|
}
|
|
var nodeTag = node.tag;
|
|
if (nodeTag === HostRoot || nodeTag === HostPortal) {
|
|
var container = node.stateNode.containerInfo;
|
|
if (isMatchingRootContainer(container, targetContainerNode)) {
|
|
break;
|
|
}
|
|
if (nodeTag === HostPortal) {
|
|
var grandNode = node.return;
|
|
while (grandNode !== null) {
|
|
var grandTag = grandNode.tag;
|
|
if (grandTag === HostRoot || grandTag === HostPortal) {
|
|
var grandContainer = grandNode.stateNode.containerInfo;
|
|
if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
|
|
return;
|
|
}
|
|
}
|
|
grandNode = grandNode.return;
|
|
}
|
|
}
|
|
while (container !== null) {
|
|
var parentNode = getClosestInstanceFromNode(container);
|
|
if (parentNode === null) {
|
|
return;
|
|
}
|
|
var parentTag = parentNode.tag;
|
|
if (parentTag === HostComponent || parentTag === HostText) {
|
|
node = ancestorInst = parentNode;
|
|
continue mainLoop;
|
|
}
|
|
container = container.parentNode;
|
|
}
|
|
}
|
|
node = node.return;
|
|
}
|
|
}
|
|
}
|
|
batchedUpdates(function() {
|
|
return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
|
|
});
|
|
}
|
|
function createDispatchListener(instance, listener2, currentTarget) {
|
|
return {
|
|
instance,
|
|
listener: listener2,
|
|
currentTarget
|
|
};
|
|
}
|
|
function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
|
|
var captureName = reactName !== null ? reactName + "Capture" : null;
|
|
var reactEventName = inCapturePhase ? captureName : reactName;
|
|
var listeners = [];
|
|
var instance = targetFiber;
|
|
var lastHostComponent = null;
|
|
while (instance !== null) {
|
|
var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
lastHostComponent = stateNode;
|
|
if (reactEventName !== null) {
|
|
var listener2 = getListener(instance, reactEventName);
|
|
if (listener2 != null) {
|
|
listeners.push(createDispatchListener(instance, listener2, lastHostComponent));
|
|
}
|
|
}
|
|
}
|
|
if (accumulateTargetOnly) {
|
|
break;
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
return listeners;
|
|
}
|
|
function accumulateTwoPhaseListeners(targetFiber, reactName) {
|
|
var captureName = reactName + "Capture";
|
|
var listeners = [];
|
|
var instance = targetFiber;
|
|
while (instance !== null) {
|
|
var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
var currentTarget = stateNode;
|
|
var captureListener = getListener(instance, captureName);
|
|
if (captureListener != null) {
|
|
listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
|
|
}
|
|
var bubbleListener = getListener(instance, reactName);
|
|
if (bubbleListener != null) {
|
|
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
}
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
return listeners;
|
|
}
|
|
function getParent(inst) {
|
|
if (inst === null) {
|
|
return null;
|
|
}
|
|
do {
|
|
inst = inst.return;
|
|
} while (inst && inst.tag !== HostComponent);
|
|
if (inst) {
|
|
return inst;
|
|
}
|
|
return null;
|
|
}
|
|
function getLowestCommonAncestor(instA, instB) {
|
|
var nodeA = instA;
|
|
var nodeB = instB;
|
|
var depthA = 0;
|
|
for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
|
|
depthA++;
|
|
}
|
|
var depthB = 0;
|
|
for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
|
|
depthB++;
|
|
}
|
|
while (depthA - depthB > 0) {
|
|
nodeA = getParent(nodeA);
|
|
depthA--;
|
|
}
|
|
while (depthB - depthA > 0) {
|
|
nodeB = getParent(nodeB);
|
|
depthB--;
|
|
}
|
|
var depth = depthA;
|
|
while (depth--) {
|
|
if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
|
|
return nodeA;
|
|
}
|
|
nodeA = getParent(nodeA);
|
|
nodeB = getParent(nodeB);
|
|
}
|
|
return null;
|
|
}
|
|
function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common2, inCapturePhase) {
|
|
var registrationName = event._reactName;
|
|
var listeners = [];
|
|
var instance = target;
|
|
while (instance !== null) {
|
|
if (instance === common2) {
|
|
break;
|
|
}
|
|
var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
|
|
if (alternate !== null && alternate === common2) {
|
|
break;
|
|
}
|
|
if (tag === HostComponent && stateNode !== null) {
|
|
var currentTarget = stateNode;
|
|
if (inCapturePhase) {
|
|
var captureListener = getListener(instance, registrationName);
|
|
if (captureListener != null) {
|
|
listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
|
|
}
|
|
} else if (!inCapturePhase) {
|
|
var bubbleListener = getListener(instance, registrationName);
|
|
if (bubbleListener != null) {
|
|
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
}
|
|
}
|
|
}
|
|
instance = instance.return;
|
|
}
|
|
if (listeners.length !== 0) {
|
|
dispatchQueue.push({
|
|
event,
|
|
listeners
|
|
});
|
|
}
|
|
}
|
|
function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
|
|
var common2 = from && to ? getLowestCommonAncestor(from, to) : null;
|
|
if (from !== null) {
|
|
accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common2, false);
|
|
}
|
|
if (to !== null && enterEvent !== null) {
|
|
accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common2, true);
|
|
}
|
|
}
|
|
function getListenerSetKey(domEventName, capture) {
|
|
return domEventName + "__" + (capture ? "capture" : "bubble");
|
|
}
|
|
var didWarnInvalidHydration = false;
|
|
var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
|
|
var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
|
|
var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
|
|
var AUTOFOCUS = "autoFocus";
|
|
var CHILDREN = "children";
|
|
var STYLE = "style";
|
|
var HTML$1 = "__html";
|
|
var warnedUnknownTags;
|
|
var validatePropertiesInDevelopment;
|
|
var warnForPropDifference;
|
|
var warnForExtraAttributes;
|
|
var warnForInvalidEventListener;
|
|
var canDiffStyleForHydrationWarning;
|
|
var normalizeHTML;
|
|
{
|
|
warnedUnknownTags = {
|
|
dialog: true,
|
|
webview: true
|
|
};
|
|
validatePropertiesInDevelopment = function(type, props) {
|
|
validateProperties(type, props);
|
|
validateProperties$1(type, props);
|
|
validateProperties$2(type, props, {
|
|
registrationNameDependencies,
|
|
possibleRegistrationNames
|
|
});
|
|
};
|
|
canDiffStyleForHydrationWarning = canUseDOM2 && !document.documentMode;
|
|
warnForPropDifference = function(propName, serverValue, clientValue) {
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
|
|
var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
|
|
if (normalizedServerValue === normalizedClientValue) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
|
|
};
|
|
warnForExtraAttributes = function(attributeNames) {
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
var names = [];
|
|
attributeNames.forEach(function(name) {
|
|
names.push(name);
|
|
});
|
|
error("Extra attributes from the server: %s", names);
|
|
};
|
|
warnForInvalidEventListener = function(registrationName, listener2) {
|
|
if (listener2 === false) {
|
|
error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
|
|
} else {
|
|
error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener2);
|
|
}
|
|
};
|
|
normalizeHTML = function(parent, html) {
|
|
var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
|
|
testElement.innerHTML = html;
|
|
return testElement.innerHTML;
|
|
};
|
|
}
|
|
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
|
|
var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
|
|
function normalizeMarkupForTextOrAttribute(markup) {
|
|
{
|
|
checkHtmlStringCoercion(markup);
|
|
}
|
|
var markupString = typeof markup === "string" ? markup : "" + markup;
|
|
return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
|
|
}
|
|
function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
|
|
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
|
|
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
|
|
if (normalizedServerText === normalizedClientText) {
|
|
return;
|
|
}
|
|
if (shouldWarnDev) {
|
|
{
|
|
if (!didWarnInvalidHydration) {
|
|
didWarnInvalidHydration = true;
|
|
error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
|
|
}
|
|
}
|
|
}
|
|
if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
|
|
throw new Error("Text content does not match server-rendered HTML.");
|
|
}
|
|
}
|
|
function getOwnerDocumentFromRootContainer(rootContainerElement) {
|
|
return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
|
|
}
|
|
function noop() {
|
|
}
|
|
function trapClickOnNonInteractiveElement(node) {
|
|
node.onclick = noop;
|
|
}
|
|
function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
|
|
for (var propKey in nextProps) {
|
|
if (!nextProps.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
var nextProp = nextProps[propKey];
|
|
if (propKey === STYLE) {
|
|
{
|
|
if (nextProp) {
|
|
Object.freeze(nextProp);
|
|
}
|
|
}
|
|
setValueForStyles(domElement, nextProp);
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
setInnerHTML(domElement, nextHtml);
|
|
}
|
|
} else if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string") {
|
|
var canSetTextContent = tag !== "textarea" || nextProp !== "";
|
|
if (canSetTextContent) {
|
|
setTextContent(domElement, nextProp);
|
|
}
|
|
} else if (typeof nextProp === "number") {
|
|
setTextContent(domElement, "" + nextProp);
|
|
}
|
|
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (propKey === AUTOFOCUS)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
} else if (nextProp != null) {
|
|
setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
|
|
}
|
|
}
|
|
}
|
|
function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
|
|
for (var i2 = 0; i2 < updatePayload.length; i2 += 2) {
|
|
var propKey = updatePayload[i2];
|
|
var propValue = updatePayload[i2 + 1];
|
|
if (propKey === STYLE) {
|
|
setValueForStyles(domElement, propValue);
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
setInnerHTML(domElement, propValue);
|
|
} else if (propKey === CHILDREN) {
|
|
setTextContent(domElement, propValue);
|
|
} else {
|
|
setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
|
|
}
|
|
}
|
|
}
|
|
function createElement(type, props, rootContainerElement, parentNamespace) {
|
|
var isCustomComponentTag;
|
|
var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
|
|
var domElement;
|
|
var namespaceURI = parentNamespace;
|
|
if (namespaceURI === HTML_NAMESPACE) {
|
|
namespaceURI = getIntrinsicNamespace(type);
|
|
}
|
|
if (namespaceURI === HTML_NAMESPACE) {
|
|
{
|
|
isCustomComponentTag = isCustomComponent(type, props);
|
|
if (!isCustomComponentTag && type !== type.toLowerCase()) {
|
|
error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
|
|
}
|
|
}
|
|
if (type === "script") {
|
|
var div = ownerDocument.createElement("div");
|
|
div.innerHTML = "<script><\/script>";
|
|
var firstChild = div.firstChild;
|
|
domElement = div.removeChild(firstChild);
|
|
} else if (typeof props.is === "string") {
|
|
domElement = ownerDocument.createElement(type, {
|
|
is: props.is
|
|
});
|
|
} else {
|
|
domElement = ownerDocument.createElement(type);
|
|
if (type === "select") {
|
|
var node = domElement;
|
|
if (props.multiple) {
|
|
node.multiple = true;
|
|
} else if (props.size) {
|
|
node.size = props.size;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
domElement = ownerDocument.createElementNS(namespaceURI, type);
|
|
}
|
|
{
|
|
if (namespaceURI === HTML_NAMESPACE) {
|
|
if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) {
|
|
warnedUnknownTags[type] = true;
|
|
error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
|
|
}
|
|
}
|
|
}
|
|
return domElement;
|
|
}
|
|
function createTextNode(text, rootContainerElement) {
|
|
return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
|
|
}
|
|
function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
|
|
var isCustomComponentTag = isCustomComponent(tag, rawProps);
|
|
{
|
|
validatePropertiesInDevelopment(tag, rawProps);
|
|
}
|
|
var props;
|
|
switch (tag) {
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("cancel", domElement);
|
|
listenToNonDelegatedEvent("close", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
case "embed":
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (var i2 = 0; i2 < mediaEventTypes.length; i2++) {
|
|
listenToNonDelegatedEvent(mediaEventTypes[i2], domElement);
|
|
}
|
|
props = rawProps;
|
|
break;
|
|
case "source":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "img":
|
|
case "image":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
props = rawProps;
|
|
break;
|
|
case "input":
|
|
initWrapperState(domElement, rawProps);
|
|
props = getHostProps(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "option":
|
|
validateProps(domElement, rawProps);
|
|
props = rawProps;
|
|
break;
|
|
case "select":
|
|
initWrapperState$1(domElement, rawProps);
|
|
props = getHostProps$1(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "textarea":
|
|
initWrapperState$2(domElement, rawProps);
|
|
props = getHostProps$2(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
default:
|
|
props = rawProps;
|
|
}
|
|
assertValidProps(tag, props);
|
|
setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
|
|
switch (tag) {
|
|
case "input":
|
|
track(domElement);
|
|
postMountWrapper(domElement, rawProps, false);
|
|
break;
|
|
case "textarea":
|
|
track(domElement);
|
|
postMountWrapper$3(domElement);
|
|
break;
|
|
case "option":
|
|
postMountWrapper$1(domElement, rawProps);
|
|
break;
|
|
case "select":
|
|
postMountWrapper$2(domElement, rawProps);
|
|
break;
|
|
default:
|
|
if (typeof props.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
|
|
{
|
|
validatePropertiesInDevelopment(tag, nextRawProps);
|
|
}
|
|
var updatePayload = null;
|
|
var lastProps;
|
|
var nextProps;
|
|
switch (tag) {
|
|
case "input":
|
|
lastProps = getHostProps(domElement, lastRawProps);
|
|
nextProps = getHostProps(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
case "select":
|
|
lastProps = getHostProps$1(domElement, lastRawProps);
|
|
nextProps = getHostProps$1(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
case "textarea":
|
|
lastProps = getHostProps$2(domElement, lastRawProps);
|
|
nextProps = getHostProps$2(domElement, nextRawProps);
|
|
updatePayload = [];
|
|
break;
|
|
default:
|
|
lastProps = lastRawProps;
|
|
nextProps = nextRawProps;
|
|
if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
assertValidProps(tag, nextProps);
|
|
var propKey;
|
|
var styleName;
|
|
var styleUpdates = null;
|
|
for (propKey in lastProps) {
|
|
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
var lastStyle = lastProps[propKey];
|
|
for (styleName in lastStyle) {
|
|
if (lastStyle.hasOwnProperty(styleName)) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = "";
|
|
}
|
|
}
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN)
|
|
;
|
|
else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (propKey === AUTOFOCUS)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (!updatePayload) {
|
|
updatePayload = [];
|
|
}
|
|
} else {
|
|
(updatePayload = updatePayload || []).push(propKey, null);
|
|
}
|
|
}
|
|
for (propKey in nextProps) {
|
|
var nextProp = nextProps[propKey];
|
|
var lastProp = lastProps != null ? lastProps[propKey] : void 0;
|
|
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
|
|
continue;
|
|
}
|
|
if (propKey === STYLE) {
|
|
{
|
|
if (nextProp) {
|
|
Object.freeze(nextProp);
|
|
}
|
|
}
|
|
if (lastProp) {
|
|
for (styleName in lastProp) {
|
|
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = "";
|
|
}
|
|
}
|
|
for (styleName in nextProp) {
|
|
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
|
if (!styleUpdates) {
|
|
styleUpdates = {};
|
|
}
|
|
styleUpdates[styleName] = nextProp[styleName];
|
|
}
|
|
}
|
|
} else {
|
|
if (!styleUpdates) {
|
|
if (!updatePayload) {
|
|
updatePayload = [];
|
|
}
|
|
updatePayload.push(propKey, styleUpdates);
|
|
}
|
|
styleUpdates = nextProp;
|
|
}
|
|
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
if (lastHtml !== nextHtml) {
|
|
(updatePayload = updatePayload || []).push(propKey, nextHtml);
|
|
}
|
|
}
|
|
} else if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string" || typeof nextProp === "number") {
|
|
(updatePayload = updatePayload || []).push(propKey, "" + nextProp);
|
|
}
|
|
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
|
|
;
|
|
else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
if (!updatePayload && lastProp !== nextProp) {
|
|
updatePayload = [];
|
|
}
|
|
} else {
|
|
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
|
}
|
|
}
|
|
if (styleUpdates) {
|
|
{
|
|
validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
|
|
}
|
|
(updatePayload = updatePayload || []).push(STYLE, styleUpdates);
|
|
}
|
|
return updatePayload;
|
|
}
|
|
function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
|
|
if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
|
|
updateChecked(domElement, nextRawProps);
|
|
}
|
|
var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
|
|
var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
|
|
updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
|
|
switch (tag) {
|
|
case "input":
|
|
updateWrapper(domElement, nextRawProps);
|
|
break;
|
|
case "textarea":
|
|
updateWrapper$1(domElement, nextRawProps);
|
|
break;
|
|
case "select":
|
|
postUpdateWrapper(domElement, nextRawProps);
|
|
break;
|
|
}
|
|
}
|
|
function getPossibleStandardName(propName) {
|
|
{
|
|
var lowerCasedName = propName.toLowerCase();
|
|
if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
return null;
|
|
}
|
|
return possibleStandardNames[lowerCasedName] || null;
|
|
}
|
|
}
|
|
function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {
|
|
var isCustomComponentTag;
|
|
var extraAttributeNames;
|
|
{
|
|
isCustomComponentTag = isCustomComponent(tag, rawProps);
|
|
validatePropertiesInDevelopment(tag, rawProps);
|
|
}
|
|
switch (tag) {
|
|
case "dialog":
|
|
listenToNonDelegatedEvent("cancel", domElement);
|
|
listenToNonDelegatedEvent("close", domElement);
|
|
break;
|
|
case "iframe":
|
|
case "object":
|
|
case "embed":
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "video":
|
|
case "audio":
|
|
for (var i2 = 0; i2 < mediaEventTypes.length; i2++) {
|
|
listenToNonDelegatedEvent(mediaEventTypes[i2], domElement);
|
|
}
|
|
break;
|
|
case "source":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
break;
|
|
case "img":
|
|
case "image":
|
|
case "link":
|
|
listenToNonDelegatedEvent("error", domElement);
|
|
listenToNonDelegatedEvent("load", domElement);
|
|
break;
|
|
case "details":
|
|
listenToNonDelegatedEvent("toggle", domElement);
|
|
break;
|
|
case "input":
|
|
initWrapperState(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "option":
|
|
validateProps(domElement, rawProps);
|
|
break;
|
|
case "select":
|
|
initWrapperState$1(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
case "textarea":
|
|
initWrapperState$2(domElement, rawProps);
|
|
listenToNonDelegatedEvent("invalid", domElement);
|
|
break;
|
|
}
|
|
assertValidProps(tag, rawProps);
|
|
{
|
|
extraAttributeNames = /* @__PURE__ */ new Set();
|
|
var attributes = domElement.attributes;
|
|
for (var _i = 0; _i < attributes.length; _i++) {
|
|
var name = attributes[_i].name.toLowerCase();
|
|
switch (name) {
|
|
case "value":
|
|
break;
|
|
case "checked":
|
|
break;
|
|
case "selected":
|
|
break;
|
|
default:
|
|
extraAttributeNames.add(attributes[_i].name);
|
|
}
|
|
}
|
|
}
|
|
var updatePayload = null;
|
|
for (var propKey in rawProps) {
|
|
if (!rawProps.hasOwnProperty(propKey)) {
|
|
continue;
|
|
}
|
|
var nextProp = rawProps[propKey];
|
|
if (propKey === CHILDREN) {
|
|
if (typeof nextProp === "string") {
|
|
if (domElement.textContent !== nextProp) {
|
|
if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
|
checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
|
|
}
|
|
updatePayload = [CHILDREN, nextProp];
|
|
}
|
|
} else if (typeof nextProp === "number") {
|
|
if (domElement.textContent !== "" + nextProp) {
|
|
if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
|
checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
|
|
}
|
|
updatePayload = [CHILDREN, "" + nextProp];
|
|
}
|
|
}
|
|
} else if (registrationNameDependencies.hasOwnProperty(propKey)) {
|
|
if (nextProp != null) {
|
|
if (typeof nextProp !== "function") {
|
|
warnForInvalidEventListener(propKey, nextProp);
|
|
}
|
|
if (propKey === "onScroll") {
|
|
listenToNonDelegatedEvent("scroll", domElement);
|
|
}
|
|
}
|
|
} else if (shouldWarnDev && true && typeof isCustomComponentTag === "boolean") {
|
|
var serverValue = void 0;
|
|
var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
|
|
if (rawProps[SUPPRESS_HYDRATION_WARNING] === true)
|
|
;
|
|
else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || propKey === "value" || propKey === "checked" || propKey === "selected")
|
|
;
|
|
else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
|
var serverHTML = domElement.innerHTML;
|
|
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
|
|
if (nextHtml != null) {
|
|
var expectedHTML = normalizeHTML(domElement, nextHtml);
|
|
if (expectedHTML !== serverHTML) {
|
|
warnForPropDifference(propKey, serverHTML, expectedHTML);
|
|
}
|
|
}
|
|
} else if (propKey === STYLE) {
|
|
extraAttributeNames.delete(propKey);
|
|
if (canDiffStyleForHydrationWarning) {
|
|
var expectedStyle = createDangerousStringForStyles(nextProp);
|
|
serverValue = domElement.getAttribute("style");
|
|
if (expectedStyle !== serverValue) {
|
|
warnForPropDifference(propKey, serverValue, expectedStyle);
|
|
}
|
|
}
|
|
} else if (isCustomComponentTag && !enableCustomElementPropertySupport) {
|
|
extraAttributeNames.delete(propKey.toLowerCase());
|
|
serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
|
if (nextProp !== serverValue) {
|
|
warnForPropDifference(propKey, serverValue, nextProp);
|
|
}
|
|
} else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
|
|
var isMismatchDueToBadCasing = false;
|
|
if (propertyInfo !== null) {
|
|
extraAttributeNames.delete(propertyInfo.attributeName);
|
|
serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
|
|
} else {
|
|
var ownNamespace = parentNamespace;
|
|
if (ownNamespace === HTML_NAMESPACE) {
|
|
ownNamespace = getIntrinsicNamespace(tag);
|
|
}
|
|
if (ownNamespace === HTML_NAMESPACE) {
|
|
extraAttributeNames.delete(propKey.toLowerCase());
|
|
} else {
|
|
var standardName = getPossibleStandardName(propKey);
|
|
if (standardName !== null && standardName !== propKey) {
|
|
isMismatchDueToBadCasing = true;
|
|
extraAttributeNames.delete(standardName);
|
|
}
|
|
extraAttributeNames.delete(propKey);
|
|
}
|
|
serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
|
}
|
|
var dontWarnCustomElement = enableCustomElementPropertySupport;
|
|
if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
|
|
warnForPropDifference(propKey, serverValue, nextProp);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
if (shouldWarnDev) {
|
|
if (extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
|
warnForExtraAttributes(extraAttributeNames);
|
|
}
|
|
}
|
|
}
|
|
switch (tag) {
|
|
case "input":
|
|
track(domElement);
|
|
postMountWrapper(domElement, rawProps, true);
|
|
break;
|
|
case "textarea":
|
|
track(domElement);
|
|
postMountWrapper$3(domElement);
|
|
break;
|
|
case "select":
|
|
case "option":
|
|
break;
|
|
default:
|
|
if (typeof rawProps.onClick === "function") {
|
|
trapClickOnNonInteractiveElement(domElement);
|
|
}
|
|
break;
|
|
}
|
|
return updatePayload;
|
|
}
|
|
function diffHydratedText(textNode, text, isConcurrentMode) {
|
|
var isDifferent = textNode.nodeValue !== text;
|
|
return isDifferent;
|
|
}
|
|
function warnForDeletedHydratableElement(parentNode, child) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForDeletedHydratableText(parentNode, child) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForInsertedHydratedElement(parentNode, tag, props) {
|
|
{
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function warnForInsertedHydratedText(parentNode, text) {
|
|
{
|
|
if (text === "") {
|
|
return;
|
|
}
|
|
if (didWarnInvalidHydration) {
|
|
return;
|
|
}
|
|
didWarnInvalidHydration = true;
|
|
error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function restoreControlledState$3(domElement, tag, props) {
|
|
switch (tag) {
|
|
case "input":
|
|
restoreControlledState(domElement, props);
|
|
return;
|
|
case "textarea":
|
|
restoreControlledState$2(domElement, props);
|
|
return;
|
|
case "select":
|
|
restoreControlledState$1(domElement, props);
|
|
return;
|
|
}
|
|
}
|
|
var validateDOMNesting = function() {
|
|
};
|
|
var updatedAncestorInfo = function() {
|
|
};
|
|
{
|
|
var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
|
|
var inScopeTags = [
|
|
"applet",
|
|
"caption",
|
|
"html",
|
|
"table",
|
|
"td",
|
|
"th",
|
|
"marquee",
|
|
"object",
|
|
"template",
|
|
"foreignObject",
|
|
"desc",
|
|
"title"
|
|
];
|
|
var buttonScopeTags = inScopeTags.concat(["button"]);
|
|
var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
|
|
var emptyAncestorInfo = {
|
|
current: null,
|
|
formTag: null,
|
|
aTagInScope: null,
|
|
buttonTagInScope: null,
|
|
nobrTagInScope: null,
|
|
pTagInButtonScope: null,
|
|
listItemTagAutoclosing: null,
|
|
dlItemTagAutoclosing: null
|
|
};
|
|
updatedAncestorInfo = function(oldInfo, tag) {
|
|
var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
|
|
var info = {
|
|
tag
|
|
};
|
|
if (inScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.aTagInScope = null;
|
|
ancestorInfo.buttonTagInScope = null;
|
|
ancestorInfo.nobrTagInScope = null;
|
|
}
|
|
if (buttonScopeTags.indexOf(tag) !== -1) {
|
|
ancestorInfo.pTagInButtonScope = null;
|
|
}
|
|
if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
|
|
ancestorInfo.listItemTagAutoclosing = null;
|
|
ancestorInfo.dlItemTagAutoclosing = null;
|
|
}
|
|
ancestorInfo.current = info;
|
|
if (tag === "form") {
|
|
ancestorInfo.formTag = info;
|
|
}
|
|
if (tag === "a") {
|
|
ancestorInfo.aTagInScope = info;
|
|
}
|
|
if (tag === "button") {
|
|
ancestorInfo.buttonTagInScope = info;
|
|
}
|
|
if (tag === "nobr") {
|
|
ancestorInfo.nobrTagInScope = info;
|
|
}
|
|
if (tag === "p") {
|
|
ancestorInfo.pTagInButtonScope = info;
|
|
}
|
|
if (tag === "li") {
|
|
ancestorInfo.listItemTagAutoclosing = info;
|
|
}
|
|
if (tag === "dd" || tag === "dt") {
|
|
ancestorInfo.dlItemTagAutoclosing = info;
|
|
}
|
|
return ancestorInfo;
|
|
};
|
|
var isTagValidWithParent = function(tag, parentTag) {
|
|
switch (parentTag) {
|
|
case "select":
|
|
return tag === "option" || tag === "optgroup" || tag === "#text";
|
|
case "optgroup":
|
|
return tag === "option" || tag === "#text";
|
|
case "option":
|
|
return tag === "#text";
|
|
case "tr":
|
|
return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
|
|
case "tbody":
|
|
case "thead":
|
|
case "tfoot":
|
|
return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
|
|
case "colgroup":
|
|
return tag === "col" || tag === "template";
|
|
case "table":
|
|
return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
|
|
case "head":
|
|
return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
|
|
case "html":
|
|
return tag === "head" || tag === "body" || tag === "frameset";
|
|
case "frameset":
|
|
return tag === "frame";
|
|
case "#document":
|
|
return tag === "html";
|
|
}
|
|
switch (tag) {
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
|
|
case "rp":
|
|
case "rt":
|
|
return impliedEndTags.indexOf(parentTag) === -1;
|
|
case "body":
|
|
case "caption":
|
|
case "col":
|
|
case "colgroup":
|
|
case "frameset":
|
|
case "frame":
|
|
case "head":
|
|
case "html":
|
|
case "tbody":
|
|
case "td":
|
|
case "tfoot":
|
|
case "th":
|
|
case "thead":
|
|
case "tr":
|
|
return parentTag == null;
|
|
}
|
|
return true;
|
|
};
|
|
var findInvalidAncestorForTag = function(tag, ancestorInfo) {
|
|
switch (tag) {
|
|
case "address":
|
|
case "article":
|
|
case "aside":
|
|
case "blockquote":
|
|
case "center":
|
|
case "details":
|
|
case "dialog":
|
|
case "dir":
|
|
case "div":
|
|
case "dl":
|
|
case "fieldset":
|
|
case "figcaption":
|
|
case "figure":
|
|
case "footer":
|
|
case "header":
|
|
case "hgroup":
|
|
case "main":
|
|
case "menu":
|
|
case "nav":
|
|
case "ol":
|
|
case "p":
|
|
case "section":
|
|
case "summary":
|
|
case "ul":
|
|
case "pre":
|
|
case "listing":
|
|
case "table":
|
|
case "hr":
|
|
case "xmp":
|
|
case "h1":
|
|
case "h2":
|
|
case "h3":
|
|
case "h4":
|
|
case "h5":
|
|
case "h6":
|
|
return ancestorInfo.pTagInButtonScope;
|
|
case "form":
|
|
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
|
case "li":
|
|
return ancestorInfo.listItemTagAutoclosing;
|
|
case "dd":
|
|
case "dt":
|
|
return ancestorInfo.dlItemTagAutoclosing;
|
|
case "button":
|
|
return ancestorInfo.buttonTagInScope;
|
|
case "a":
|
|
return ancestorInfo.aTagInScope;
|
|
case "nobr":
|
|
return ancestorInfo.nobrTagInScope;
|
|
}
|
|
return null;
|
|
};
|
|
var didWarn$1 = {};
|
|
validateDOMNesting = function(childTag, childText, ancestorInfo) {
|
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
var parentInfo = ancestorInfo.current;
|
|
var parentTag = parentInfo && parentInfo.tag;
|
|
if (childText != null) {
|
|
if (childTag != null) {
|
|
error("validateDOMNesting: when childText is passed, childTag should be null");
|
|
}
|
|
childTag = "#text";
|
|
}
|
|
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
|
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
|
var invalidParentOrAncestor = invalidParent || invalidAncestor;
|
|
if (!invalidParentOrAncestor) {
|
|
return;
|
|
}
|
|
var ancestorTag = invalidParentOrAncestor.tag;
|
|
var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
|
|
if (didWarn$1[warnKey]) {
|
|
return;
|
|
}
|
|
didWarn$1[warnKey] = true;
|
|
var tagDisplayName = childTag;
|
|
var whitespaceInfo = "";
|
|
if (childTag === "#text") {
|
|
if (/\S/.test(childText)) {
|
|
tagDisplayName = "Text nodes";
|
|
} else {
|
|
tagDisplayName = "Whitespace text nodes";
|
|
whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
|
|
}
|
|
} else {
|
|
tagDisplayName = "<" + childTag + ">";
|
|
}
|
|
if (invalidParent) {
|
|
var info = "";
|
|
if (ancestorTag === "table" && childTag === "tr") {
|
|
info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
|
|
}
|
|
error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
|
|
} else {
|
|
error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
|
|
}
|
|
};
|
|
}
|
|
var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
|
|
var SUSPENSE_START_DATA = "$";
|
|
var SUSPENSE_END_DATA = "/$";
|
|
var SUSPENSE_PENDING_START_DATA = "$?";
|
|
var SUSPENSE_FALLBACK_START_DATA = "$!";
|
|
var STYLE$1 = "style";
|
|
var eventsEnabled = null;
|
|
var selectionInformation = null;
|
|
function getRootHostContext(rootContainerInstance) {
|
|
var type;
|
|
var namespace;
|
|
var nodeType = rootContainerInstance.nodeType;
|
|
switch (nodeType) {
|
|
case DOCUMENT_NODE:
|
|
case DOCUMENT_FRAGMENT_NODE: {
|
|
type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
|
|
var root2 = rootContainerInstance.documentElement;
|
|
namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
|
|
break;
|
|
}
|
|
default: {
|
|
var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
|
|
var ownNamespace = container.namespaceURI || null;
|
|
type = container.tagName;
|
|
namespace = getChildNamespace(ownNamespace, type);
|
|
break;
|
|
}
|
|
}
|
|
{
|
|
var validatedTag = type.toLowerCase();
|
|
var ancestorInfo = updatedAncestorInfo(null, validatedTag);
|
|
return {
|
|
namespace,
|
|
ancestorInfo
|
|
};
|
|
}
|
|
}
|
|
function getChildHostContext(parentHostContext, type, rootContainerInstance) {
|
|
{
|
|
var parentHostContextDev = parentHostContext;
|
|
var namespace = getChildNamespace(parentHostContextDev.namespace, type);
|
|
var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
|
|
return {
|
|
namespace,
|
|
ancestorInfo
|
|
};
|
|
}
|
|
}
|
|
function getPublicInstance(instance) {
|
|
return instance;
|
|
}
|
|
function prepareForCommit(containerInfo) {
|
|
eventsEnabled = isEnabled();
|
|
selectionInformation = getSelectionInformation();
|
|
var activeInstance = null;
|
|
setEnabled(false);
|
|
return activeInstance;
|
|
}
|
|
function resetAfterCommit(containerInfo) {
|
|
restoreSelection(selectionInformation);
|
|
setEnabled(eventsEnabled);
|
|
eventsEnabled = null;
|
|
selectionInformation = null;
|
|
}
|
|
function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
var parentNamespace;
|
|
{
|
|
var hostContextDev = hostContext;
|
|
validateDOMNesting(type, null, hostContextDev.ancestorInfo);
|
|
if (typeof props.children === "string" || typeof props.children === "number") {
|
|
var string = "" + props.children;
|
|
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
|
validateDOMNesting(null, string, ownAncestorInfo);
|
|
}
|
|
parentNamespace = hostContextDev.namespace;
|
|
}
|
|
var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
|
|
precacheFiberNode(internalInstanceHandle, domElement);
|
|
updateFiberProps(domElement, props);
|
|
return domElement;
|
|
}
|
|
function appendInitialChild(parentInstance, child) {
|
|
parentInstance.appendChild(child);
|
|
}
|
|
function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
|
|
setInitialProperties(domElement, type, props, rootContainerInstance);
|
|
switch (type) {
|
|
case "button":
|
|
case "input":
|
|
case "select":
|
|
case "textarea":
|
|
return !!props.autoFocus;
|
|
case "img":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
|
|
{
|
|
var hostContextDev = hostContext;
|
|
if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
|
|
var string = "" + newProps.children;
|
|
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
|
validateDOMNesting(null, string, ownAncestorInfo);
|
|
}
|
|
}
|
|
return diffProperties(domElement, type, oldProps, newProps);
|
|
}
|
|
function shouldSetTextContent(type, props) {
|
|
return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
|
|
}
|
|
function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
{
|
|
var hostContextDev = hostContext;
|
|
validateDOMNesting(null, text, hostContextDev.ancestorInfo);
|
|
}
|
|
var textNode = createTextNode(text, rootContainerInstance);
|
|
precacheFiberNode(internalInstanceHandle, textNode);
|
|
return textNode;
|
|
}
|
|
function getCurrentEventPriority() {
|
|
var currentEvent = window.event;
|
|
if (currentEvent === void 0) {
|
|
return DefaultEventPriority;
|
|
}
|
|
return getEventPriority(currentEvent.type);
|
|
}
|
|
var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
|
|
var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
|
|
var noTimeout = -1;
|
|
var localPromise = typeof Promise === "function" ? Promise : void 0;
|
|
var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
|
|
return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
|
|
} : scheduleTimeout;
|
|
function handleErrorInNextTick(error2) {
|
|
setTimeout(function() {
|
|
throw error2;
|
|
});
|
|
}
|
|
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
|
switch (type) {
|
|
case "button":
|
|
case "input":
|
|
case "select":
|
|
case "textarea":
|
|
if (newProps.autoFocus) {
|
|
domElement.focus();
|
|
}
|
|
return;
|
|
case "img": {
|
|
if (newProps.src) {
|
|
domElement.src = newProps.src;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
|
|
updateProperties(domElement, updatePayload, type, oldProps, newProps);
|
|
updateFiberProps(domElement, newProps);
|
|
}
|
|
function resetTextContent(domElement) {
|
|
setTextContent(domElement, "");
|
|
}
|
|
function commitTextUpdate(textInstance, oldText, newText) {
|
|
textInstance.nodeValue = newText;
|
|
}
|
|
function appendChild(parentInstance, child) {
|
|
parentInstance.appendChild(child);
|
|
}
|
|
function appendChildToContainer(container, child) {
|
|
var parentNode;
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
parentNode = container.parentNode;
|
|
parentNode.insertBefore(child, container);
|
|
} else {
|
|
parentNode = container;
|
|
parentNode.appendChild(child);
|
|
}
|
|
var reactRootContainer = container._reactRootContainer;
|
|
if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
|
|
trapClickOnNonInteractiveElement(parentNode);
|
|
}
|
|
}
|
|
function insertBefore(parentInstance, child, beforeChild) {
|
|
parentInstance.insertBefore(child, beforeChild);
|
|
}
|
|
function insertInContainerBefore(container, child, beforeChild) {
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
container.parentNode.insertBefore(child, beforeChild);
|
|
} else {
|
|
container.insertBefore(child, beforeChild);
|
|
}
|
|
}
|
|
function removeChild(parentInstance, child) {
|
|
parentInstance.removeChild(child);
|
|
}
|
|
function removeChildFromContainer(container, child) {
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
container.parentNode.removeChild(child);
|
|
} else {
|
|
container.removeChild(child);
|
|
}
|
|
}
|
|
function clearSuspenseBoundary(parentInstance, suspenseInstance) {
|
|
var node = suspenseInstance;
|
|
var depth = 0;
|
|
do {
|
|
var nextNode = node.nextSibling;
|
|
parentInstance.removeChild(node);
|
|
if (nextNode && nextNode.nodeType === COMMENT_NODE) {
|
|
var data = nextNode.data;
|
|
if (data === SUSPENSE_END_DATA) {
|
|
if (depth === 0) {
|
|
parentInstance.removeChild(nextNode);
|
|
retryIfBlockedOn(suspenseInstance);
|
|
return;
|
|
} else {
|
|
depth--;
|
|
}
|
|
} else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
|
|
depth++;
|
|
}
|
|
}
|
|
node = nextNode;
|
|
} while (node);
|
|
retryIfBlockedOn(suspenseInstance);
|
|
}
|
|
function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
|
|
if (container.nodeType === COMMENT_NODE) {
|
|
clearSuspenseBoundary(container.parentNode, suspenseInstance);
|
|
} else if (container.nodeType === ELEMENT_NODE) {
|
|
clearSuspenseBoundary(container, suspenseInstance);
|
|
}
|
|
retryIfBlockedOn(container);
|
|
}
|
|
function hideInstance(instance) {
|
|
instance = instance;
|
|
var style4 = instance.style;
|
|
if (typeof style4.setProperty === "function") {
|
|
style4.setProperty("display", "none", "important");
|
|
} else {
|
|
style4.display = "none";
|
|
}
|
|
}
|
|
function hideTextInstance(textInstance) {
|
|
textInstance.nodeValue = "";
|
|
}
|
|
function unhideInstance(instance, props) {
|
|
instance = instance;
|
|
var styleProp = props[STYLE$1];
|
|
var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
|
|
instance.style.display = dangerousStyleValue("display", display);
|
|
}
|
|
function unhideTextInstance(textInstance, text) {
|
|
textInstance.nodeValue = text;
|
|
}
|
|
function clearContainer(container) {
|
|
if (container.nodeType === ELEMENT_NODE) {
|
|
container.textContent = "";
|
|
} else if (container.nodeType === DOCUMENT_NODE) {
|
|
if (container.documentElement) {
|
|
container.removeChild(container.documentElement);
|
|
}
|
|
}
|
|
}
|
|
function canHydrateInstance(instance, type, props) {
|
|
if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
|
|
return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function canHydrateTextInstance(instance, text) {
|
|
if (text === "" || instance.nodeType !== TEXT_NODE) {
|
|
return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function canHydrateSuspenseInstance(instance) {
|
|
if (instance.nodeType !== COMMENT_NODE) {
|
|
return null;
|
|
}
|
|
return instance;
|
|
}
|
|
function isSuspenseInstancePending(instance) {
|
|
return instance.data === SUSPENSE_PENDING_START_DATA;
|
|
}
|
|
function isSuspenseInstanceFallback(instance) {
|
|
return instance.data === SUSPENSE_FALLBACK_START_DATA;
|
|
}
|
|
function getSuspenseInstanceFallbackErrorDetails(instance) {
|
|
var dataset = instance.nextSibling && instance.nextSibling.dataset;
|
|
var digest, message, stack;
|
|
if (dataset) {
|
|
digest = dataset.dgst;
|
|
{
|
|
message = dataset.msg;
|
|
stack = dataset.stck;
|
|
}
|
|
}
|
|
{
|
|
return {
|
|
message,
|
|
digest,
|
|
stack
|
|
};
|
|
}
|
|
}
|
|
function registerSuspenseInstanceRetry(instance, callback) {
|
|
instance._reactRetry = callback;
|
|
}
|
|
function getNextHydratable(node) {
|
|
for (; node != null; node = node.nextSibling) {
|
|
var nodeType = node.nodeType;
|
|
if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
|
|
break;
|
|
}
|
|
if (nodeType === COMMENT_NODE) {
|
|
var nodeData = node.data;
|
|
if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
|
|
break;
|
|
}
|
|
if (nodeData === SUSPENSE_END_DATA) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
return node;
|
|
}
|
|
function getNextHydratableSibling(instance) {
|
|
return getNextHydratable(instance.nextSibling);
|
|
}
|
|
function getFirstHydratableChild(parentInstance) {
|
|
return getNextHydratable(parentInstance.firstChild);
|
|
}
|
|
function getFirstHydratableChildWithinContainer(parentContainer) {
|
|
return getNextHydratable(parentContainer.firstChild);
|
|
}
|
|
function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
|
|
return getNextHydratable(parentInstance.nextSibling);
|
|
}
|
|
function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
|
|
precacheFiberNode(internalInstanceHandle, instance);
|
|
updateFiberProps(instance, props);
|
|
var parentNamespace;
|
|
{
|
|
var hostContextDev = hostContext;
|
|
parentNamespace = hostContextDev.namespace;
|
|
}
|
|
var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
|
return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
|
|
}
|
|
function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {
|
|
precacheFiberNode(internalInstanceHandle, textInstance);
|
|
var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
|
return diffHydratedText(textInstance, text);
|
|
}
|
|
function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
|
|
precacheFiberNode(internalInstanceHandle, suspenseInstance);
|
|
}
|
|
function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
|
|
var node = suspenseInstance.nextSibling;
|
|
var depth = 0;
|
|
while (node) {
|
|
if (node.nodeType === COMMENT_NODE) {
|
|
var data = node.data;
|
|
if (data === SUSPENSE_END_DATA) {
|
|
if (depth === 0) {
|
|
return getNextHydratableSibling(node);
|
|
} else {
|
|
depth--;
|
|
}
|
|
} else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
|
|
depth++;
|
|
}
|
|
}
|
|
node = node.nextSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function getParentSuspenseInstance(targetInstance) {
|
|
var node = targetInstance.previousSibling;
|
|
var depth = 0;
|
|
while (node) {
|
|
if (node.nodeType === COMMENT_NODE) {
|
|
var data = node.data;
|
|
if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
|
|
if (depth === 0) {
|
|
return node;
|
|
} else {
|
|
depth--;
|
|
}
|
|
} else if (data === SUSPENSE_END_DATA) {
|
|
depth++;
|
|
}
|
|
}
|
|
node = node.previousSibling;
|
|
}
|
|
return null;
|
|
}
|
|
function commitHydratedContainer(container) {
|
|
retryIfBlockedOn(container);
|
|
}
|
|
function commitHydratedSuspenseInstance(suspenseInstance) {
|
|
retryIfBlockedOn(suspenseInstance);
|
|
}
|
|
function shouldDeleteUnhydratedTailInstances(parentType) {
|
|
return parentType !== "head" && parentType !== "body";
|
|
}
|
|
function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {
|
|
var shouldWarnDev = true;
|
|
checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
|
|
}
|
|
function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {
|
|
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
var shouldWarnDev = true;
|
|
checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
|
|
}
|
|
}
|
|
function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
|
|
{
|
|
if (instance.nodeType === ELEMENT_NODE) {
|
|
warnForDeletedHydratableElement(parentContainer, instance);
|
|
} else if (instance.nodeType === COMMENT_NODE)
|
|
;
|
|
else {
|
|
warnForDeletedHydratableText(parentContainer, instance);
|
|
}
|
|
}
|
|
}
|
|
function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
|
|
{
|
|
var parentNode = parentInstance.parentNode;
|
|
if (parentNode !== null) {
|
|
if (instance.nodeType === ELEMENT_NODE) {
|
|
warnForDeletedHydratableElement(parentNode, instance);
|
|
} else if (instance.nodeType === COMMENT_NODE)
|
|
;
|
|
else {
|
|
warnForDeletedHydratableText(parentNode, instance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
|
|
{
|
|
if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
if (instance.nodeType === ELEMENT_NODE) {
|
|
warnForDeletedHydratableElement(parentInstance, instance);
|
|
} else if (instance.nodeType === COMMENT_NODE)
|
|
;
|
|
else {
|
|
warnForDeletedHydratableText(parentInstance, instance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
|
|
{
|
|
warnForInsertedHydratedElement(parentContainer, type);
|
|
}
|
|
}
|
|
function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {
|
|
{
|
|
warnForInsertedHydratedText(parentContainer, text);
|
|
}
|
|
}
|
|
function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
|
|
{
|
|
var parentNode = parentInstance.parentNode;
|
|
if (parentNode !== null)
|
|
warnForInsertedHydratedElement(parentNode, type);
|
|
}
|
|
}
|
|
function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {
|
|
{
|
|
var parentNode = parentInstance.parentNode;
|
|
if (parentNode !== null)
|
|
warnForInsertedHydratedText(parentNode, text);
|
|
}
|
|
}
|
|
function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
|
|
{
|
|
if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
warnForInsertedHydratedElement(parentInstance, type);
|
|
}
|
|
}
|
|
}
|
|
function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {
|
|
{
|
|
if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
|
|
warnForInsertedHydratedText(parentInstance, text);
|
|
}
|
|
}
|
|
}
|
|
function errorHydratingContainer(parentContainer) {
|
|
{
|
|
error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
|
|
}
|
|
}
|
|
function preparePortalMount(portalInstance) {
|
|
listenToAllSupportedEvents(portalInstance);
|
|
}
|
|
var randomKey = Math.random().toString(36).slice(2);
|
|
var internalInstanceKey = "__reactFiber$" + randomKey;
|
|
var internalPropsKey = "__reactProps$" + randomKey;
|
|
var internalContainerInstanceKey = "__reactContainer$" + randomKey;
|
|
var internalEventHandlersKey = "__reactEvents$" + randomKey;
|
|
var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
|
|
var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
|
|
function detachDeletedInstance(node) {
|
|
delete node[internalInstanceKey];
|
|
delete node[internalPropsKey];
|
|
delete node[internalEventHandlersKey];
|
|
delete node[internalEventHandlerListenersKey];
|
|
delete node[internalEventHandlesSetKey];
|
|
}
|
|
function precacheFiberNode(hostInst, node) {
|
|
node[internalInstanceKey] = hostInst;
|
|
}
|
|
function markContainerAsRoot(hostRoot, node) {
|
|
node[internalContainerInstanceKey] = hostRoot;
|
|
}
|
|
function unmarkContainerAsRoot(node) {
|
|
node[internalContainerInstanceKey] = null;
|
|
}
|
|
function isContainerMarkedAsRoot(node) {
|
|
return !!node[internalContainerInstanceKey];
|
|
}
|
|
function getClosestInstanceFromNode(targetNode) {
|
|
var targetInst = targetNode[internalInstanceKey];
|
|
if (targetInst) {
|
|
return targetInst;
|
|
}
|
|
var parentNode = targetNode.parentNode;
|
|
while (parentNode) {
|
|
targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
|
|
if (targetInst) {
|
|
var alternate = targetInst.alternate;
|
|
if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
|
|
var suspenseInstance = getParentSuspenseInstance(targetNode);
|
|
while (suspenseInstance !== null) {
|
|
var targetSuspenseInst = suspenseInstance[internalInstanceKey];
|
|
if (targetSuspenseInst) {
|
|
return targetSuspenseInst;
|
|
}
|
|
suspenseInstance = getParentSuspenseInstance(suspenseInstance);
|
|
}
|
|
}
|
|
return targetInst;
|
|
}
|
|
targetNode = parentNode;
|
|
parentNode = targetNode.parentNode;
|
|
}
|
|
return null;
|
|
}
|
|
function getInstanceFromNode(node) {
|
|
var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
|
|
if (inst) {
|
|
if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
|
|
return inst;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getNodeFromInstance(inst) {
|
|
if (inst.tag === HostComponent || inst.tag === HostText) {
|
|
return inst.stateNode;
|
|
}
|
|
throw new Error("getNodeFromInstance: Invalid argument.");
|
|
}
|
|
function getFiberCurrentPropsFromNode(node) {
|
|
return node[internalPropsKey] || null;
|
|
}
|
|
function updateFiberProps(node, props) {
|
|
node[internalPropsKey] = props;
|
|
}
|
|
function getEventListenerSet(node) {
|
|
var elementListenerSet = node[internalEventHandlersKey];
|
|
if (elementListenerSet === void 0) {
|
|
elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
|
|
}
|
|
return elementListenerSet;
|
|
}
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
{
|
|
var has2 = Function.call.bind(hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has2(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var valueStack = [];
|
|
var fiberStack;
|
|
{
|
|
fiberStack = [];
|
|
}
|
|
var index = -1;
|
|
function createCursor(defaultValue) {
|
|
return {
|
|
current: defaultValue
|
|
};
|
|
}
|
|
function pop(cursor, fiber) {
|
|
if (index < 0) {
|
|
{
|
|
error("Unexpected pop.");
|
|
}
|
|
return;
|
|
}
|
|
{
|
|
if (fiber !== fiberStack[index]) {
|
|
error("Unexpected Fiber popped.");
|
|
}
|
|
}
|
|
cursor.current = valueStack[index];
|
|
valueStack[index] = null;
|
|
{
|
|
fiberStack[index] = null;
|
|
}
|
|
index--;
|
|
}
|
|
function push(cursor, value, fiber) {
|
|
index++;
|
|
valueStack[index] = cursor.current;
|
|
{
|
|
fiberStack[index] = fiber;
|
|
}
|
|
cursor.current = value;
|
|
}
|
|
var warnedAboutMissingGetChildContext;
|
|
{
|
|
warnedAboutMissingGetChildContext = {};
|
|
}
|
|
var emptyContextObject = {};
|
|
{
|
|
Object.freeze(emptyContextObject);
|
|
}
|
|
var contextStackCursor = createCursor(emptyContextObject);
|
|
var didPerformWorkStackCursor = createCursor(false);
|
|
var previousContext = emptyContextObject;
|
|
function getUnmaskedContext(workInProgress2, Component, didPushOwnContextIfProvider) {
|
|
{
|
|
if (didPushOwnContextIfProvider && isContextProvider(Component)) {
|
|
return previousContext;
|
|
}
|
|
return contextStackCursor.current;
|
|
}
|
|
}
|
|
function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
|
|
instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
|
|
}
|
|
}
|
|
function getMaskedContext(workInProgress2, unmaskedContext) {
|
|
{
|
|
var type = workInProgress2.type;
|
|
var contextTypes = type.contextTypes;
|
|
if (!contextTypes) {
|
|
return emptyContextObject;
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
|
|
return instance.__reactInternalMemoizedMaskedChildContext;
|
|
}
|
|
var context = {};
|
|
for (var key in contextTypes) {
|
|
context[key] = unmaskedContext[key];
|
|
}
|
|
{
|
|
var name = getComponentNameFromFiber(workInProgress2) || "Unknown";
|
|
checkPropTypes(contextTypes, context, "context", name);
|
|
}
|
|
if (instance) {
|
|
cacheContext(workInProgress2, unmaskedContext, context);
|
|
}
|
|
return context;
|
|
}
|
|
}
|
|
function hasContextChanged() {
|
|
{
|
|
return didPerformWorkStackCursor.current;
|
|
}
|
|
}
|
|
function isContextProvider(type) {
|
|
{
|
|
var childContextTypes = type.childContextTypes;
|
|
return childContextTypes !== null && childContextTypes !== void 0;
|
|
}
|
|
}
|
|
function popContext(fiber) {
|
|
{
|
|
pop(didPerformWorkStackCursor, fiber);
|
|
pop(contextStackCursor, fiber);
|
|
}
|
|
}
|
|
function popTopLevelContextObject(fiber) {
|
|
{
|
|
pop(didPerformWorkStackCursor, fiber);
|
|
pop(contextStackCursor, fiber);
|
|
}
|
|
}
|
|
function pushTopLevelContextObject(fiber, context, didChange) {
|
|
{
|
|
if (contextStackCursor.current !== emptyContextObject) {
|
|
throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
push(contextStackCursor, context, fiber);
|
|
push(didPerformWorkStackCursor, didChange, fiber);
|
|
}
|
|
}
|
|
function processChildContext(fiber, type, parentContext) {
|
|
{
|
|
var instance = fiber.stateNode;
|
|
var childContextTypes = type.childContextTypes;
|
|
if (typeof instance.getChildContext !== "function") {
|
|
{
|
|
var componentName = getComponentNameFromFiber(fiber) || "Unknown";
|
|
if (!warnedAboutMissingGetChildContext[componentName]) {
|
|
warnedAboutMissingGetChildContext[componentName] = true;
|
|
error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
|
|
}
|
|
}
|
|
return parentContext;
|
|
}
|
|
var childContext = instance.getChildContext();
|
|
for (var contextKey in childContext) {
|
|
if (!(contextKey in childContextTypes)) {
|
|
throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
|
|
}
|
|
}
|
|
{
|
|
var name = getComponentNameFromFiber(fiber) || "Unknown";
|
|
checkPropTypes(childContextTypes, childContext, "child context", name);
|
|
}
|
|
return assign({}, parentContext, childContext);
|
|
}
|
|
}
|
|
function pushContextProvider(workInProgress2) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
|
|
previousContext = contextStackCursor.current;
|
|
push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
|
|
push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
|
|
return true;
|
|
}
|
|
}
|
|
function invalidateContextProvider(workInProgress2, type, didChange) {
|
|
{
|
|
var instance = workInProgress2.stateNode;
|
|
if (!instance) {
|
|
throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
if (didChange) {
|
|
var mergedContext = processChildContext(workInProgress2, type, previousContext);
|
|
instance.__reactInternalMemoizedMergedChildContext = mergedContext;
|
|
pop(didPerformWorkStackCursor, workInProgress2);
|
|
pop(contextStackCursor, workInProgress2);
|
|
push(contextStackCursor, mergedContext, workInProgress2);
|
|
push(didPerformWorkStackCursor, didChange, workInProgress2);
|
|
} else {
|
|
pop(didPerformWorkStackCursor, workInProgress2);
|
|
push(didPerformWorkStackCursor, didChange, workInProgress2);
|
|
}
|
|
}
|
|
}
|
|
function findCurrentUnmaskedContext(fiber) {
|
|
{
|
|
if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
|
|
throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
var node = fiber;
|
|
do {
|
|
switch (node.tag) {
|
|
case HostRoot:
|
|
return node.stateNode.context;
|
|
case ClassComponent: {
|
|
var Component = node.type;
|
|
if (isContextProvider(Component)) {
|
|
return node.stateNode.__reactInternalMemoizedMergedChildContext;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
node = node.return;
|
|
} while (node !== null);
|
|
throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var LegacyRoot = 0;
|
|
var ConcurrentRoot = 1;
|
|
var syncQueue = null;
|
|
var includesLegacySyncCallbacks = false;
|
|
var isFlushingSyncQueue = false;
|
|
function scheduleSyncCallback(callback) {
|
|
if (syncQueue === null) {
|
|
syncQueue = [callback];
|
|
} else {
|
|
syncQueue.push(callback);
|
|
}
|
|
}
|
|
function scheduleLegacySyncCallback(callback) {
|
|
includesLegacySyncCallbacks = true;
|
|
scheduleSyncCallback(callback);
|
|
}
|
|
function flushSyncCallbacksOnlyInLegacyMode() {
|
|
if (includesLegacySyncCallbacks) {
|
|
flushSyncCallbacks();
|
|
}
|
|
}
|
|
function flushSyncCallbacks() {
|
|
if (!isFlushingSyncQueue && syncQueue !== null) {
|
|
isFlushingSyncQueue = true;
|
|
var i2 = 0;
|
|
var previousUpdatePriority = getCurrentUpdatePriority();
|
|
try {
|
|
var isSync = true;
|
|
var queue = syncQueue;
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
for (; i2 < queue.length; i2++) {
|
|
var callback = queue[i2];
|
|
do {
|
|
callback = callback(isSync);
|
|
} while (callback !== null);
|
|
}
|
|
syncQueue = null;
|
|
includesLegacySyncCallbacks = false;
|
|
} catch (error2) {
|
|
if (syncQueue !== null) {
|
|
syncQueue = syncQueue.slice(i2 + 1);
|
|
}
|
|
scheduleCallback(ImmediatePriority, flushSyncCallbacks);
|
|
throw error2;
|
|
} finally {
|
|
setCurrentUpdatePriority(previousUpdatePriority);
|
|
isFlushingSyncQueue = false;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
var forkStack = [];
|
|
var forkStackIndex = 0;
|
|
var treeForkProvider = null;
|
|
var treeForkCount = 0;
|
|
var idStack = [];
|
|
var idStackIndex = 0;
|
|
var treeContextProvider = null;
|
|
var treeContextId = 1;
|
|
var treeContextOverflow = "";
|
|
function isForkedChild(workInProgress2) {
|
|
warnIfNotHydrating();
|
|
return (workInProgress2.flags & Forked) !== NoFlags;
|
|
}
|
|
function getForksAtLevel(workInProgress2) {
|
|
warnIfNotHydrating();
|
|
return treeForkCount;
|
|
}
|
|
function getTreeId() {
|
|
var overflow2 = treeContextOverflow;
|
|
var idWithLeadingBit = treeContextId;
|
|
var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
|
|
return id.toString(32) + overflow2;
|
|
}
|
|
function pushTreeFork(workInProgress2, totalChildren) {
|
|
warnIfNotHydrating();
|
|
forkStack[forkStackIndex++] = treeForkCount;
|
|
forkStack[forkStackIndex++] = treeForkProvider;
|
|
treeForkProvider = workInProgress2;
|
|
treeForkCount = totalChildren;
|
|
}
|
|
function pushTreeId(workInProgress2, totalChildren, index2) {
|
|
warnIfNotHydrating();
|
|
idStack[idStackIndex++] = treeContextId;
|
|
idStack[idStackIndex++] = treeContextOverflow;
|
|
idStack[idStackIndex++] = treeContextProvider;
|
|
treeContextProvider = workInProgress2;
|
|
var baseIdWithLeadingBit = treeContextId;
|
|
var baseOverflow = treeContextOverflow;
|
|
var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
|
|
var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
|
|
var slot = index2 + 1;
|
|
var length = getBitLength(totalChildren) + baseLength;
|
|
if (length > 30) {
|
|
var numberOfOverflowBits = baseLength - baseLength % 5;
|
|
var newOverflowBits = (1 << numberOfOverflowBits) - 1;
|
|
var newOverflow = (baseId & newOverflowBits).toString(32);
|
|
var restOfBaseId = baseId >> numberOfOverflowBits;
|
|
var restOfBaseLength = baseLength - numberOfOverflowBits;
|
|
var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
|
|
var restOfNewBits = slot << restOfBaseLength;
|
|
var id = restOfNewBits | restOfBaseId;
|
|
var overflow2 = newOverflow + baseOverflow;
|
|
treeContextId = 1 << restOfLength | id;
|
|
treeContextOverflow = overflow2;
|
|
} else {
|
|
var newBits = slot << baseLength;
|
|
var _id = newBits | baseId;
|
|
var _overflow = baseOverflow;
|
|
treeContextId = 1 << length | _id;
|
|
treeContextOverflow = _overflow;
|
|
}
|
|
}
|
|
function pushMaterializedTreeId(workInProgress2) {
|
|
warnIfNotHydrating();
|
|
var returnFiber = workInProgress2.return;
|
|
if (returnFiber !== null) {
|
|
var numberOfForks = 1;
|
|
var slotIndex = 0;
|
|
pushTreeFork(workInProgress2, numberOfForks);
|
|
pushTreeId(workInProgress2, numberOfForks, slotIndex);
|
|
}
|
|
}
|
|
function getBitLength(number) {
|
|
return 32 - clz32(number);
|
|
}
|
|
function getLeadingBit(id) {
|
|
return 1 << getBitLength(id) - 1;
|
|
}
|
|
function popTreeContext(workInProgress2) {
|
|
while (workInProgress2 === treeForkProvider) {
|
|
treeForkProvider = forkStack[--forkStackIndex];
|
|
forkStack[forkStackIndex] = null;
|
|
treeForkCount = forkStack[--forkStackIndex];
|
|
forkStack[forkStackIndex] = null;
|
|
}
|
|
while (workInProgress2 === treeContextProvider) {
|
|
treeContextProvider = idStack[--idStackIndex];
|
|
idStack[idStackIndex] = null;
|
|
treeContextOverflow = idStack[--idStackIndex];
|
|
idStack[idStackIndex] = null;
|
|
treeContextId = idStack[--idStackIndex];
|
|
idStack[idStackIndex] = null;
|
|
}
|
|
}
|
|
function getSuspendedTreeContext() {
|
|
warnIfNotHydrating();
|
|
if (treeContextProvider !== null) {
|
|
return {
|
|
id: treeContextId,
|
|
overflow: treeContextOverflow
|
|
};
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
|
|
warnIfNotHydrating();
|
|
idStack[idStackIndex++] = treeContextId;
|
|
idStack[idStackIndex++] = treeContextOverflow;
|
|
idStack[idStackIndex++] = treeContextProvider;
|
|
treeContextId = suspendedContext.id;
|
|
treeContextOverflow = suspendedContext.overflow;
|
|
treeContextProvider = workInProgress2;
|
|
}
|
|
function warnIfNotHydrating() {
|
|
{
|
|
if (!getIsHydrating()) {
|
|
error("Expected to be hydrating. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var hydrationParentFiber = null;
|
|
var nextHydratableInstance = null;
|
|
var isHydrating = false;
|
|
var didSuspendOrErrorDEV = false;
|
|
var hydrationErrors = null;
|
|
function warnIfHydrating() {
|
|
{
|
|
if (isHydrating) {
|
|
error("We should not be hydrating here. This is a bug in React. Please file a bug.");
|
|
}
|
|
}
|
|
}
|
|
function markDidThrowWhileHydratingDEV() {
|
|
{
|
|
didSuspendOrErrorDEV = true;
|
|
}
|
|
}
|
|
function didSuspendOrErrorWhileHydratingDEV() {
|
|
{
|
|
return didSuspendOrErrorDEV;
|
|
}
|
|
}
|
|
function enterHydrationState(fiber) {
|
|
var parentInstance = fiber.stateNode.containerInfo;
|
|
nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
|
|
hydrationParentFiber = fiber;
|
|
isHydrating = true;
|
|
hydrationErrors = null;
|
|
didSuspendOrErrorDEV = false;
|
|
return true;
|
|
}
|
|
function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
|
|
nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
|
|
hydrationParentFiber = fiber;
|
|
isHydrating = true;
|
|
hydrationErrors = null;
|
|
didSuspendOrErrorDEV = false;
|
|
if (treeContext !== null) {
|
|
restoreSuspendedTreeContext(fiber, treeContext);
|
|
}
|
|
return true;
|
|
}
|
|
function warnUnhydratedInstance(returnFiber, instance) {
|
|
{
|
|
switch (returnFiber.tag) {
|
|
case HostRoot: {
|
|
didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
|
|
didNotHydrateInstance(
|
|
returnFiber.type,
|
|
returnFiber.memoizedProps,
|
|
returnFiber.stateNode,
|
|
instance,
|
|
isConcurrentMode
|
|
);
|
|
break;
|
|
}
|
|
case SuspenseComponent: {
|
|
var suspenseState = returnFiber.memoizedState;
|
|
if (suspenseState.dehydrated !== null)
|
|
didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function deleteHydratableInstance(returnFiber, instance) {
|
|
warnUnhydratedInstance(returnFiber, instance);
|
|
var childToDelete = createFiberFromHostInstanceForDeletion();
|
|
childToDelete.stateNode = instance;
|
|
childToDelete.return = returnFiber;
|
|
var deletions = returnFiber.deletions;
|
|
if (deletions === null) {
|
|
returnFiber.deletions = [childToDelete];
|
|
returnFiber.flags |= ChildDeletion;
|
|
} else {
|
|
deletions.push(childToDelete);
|
|
}
|
|
}
|
|
function warnNonhydratedInstance(returnFiber, fiber) {
|
|
{
|
|
if (didSuspendOrErrorDEV) {
|
|
return;
|
|
}
|
|
switch (returnFiber.tag) {
|
|
case HostRoot: {
|
|
var parentContainer = returnFiber.stateNode.containerInfo;
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
var type = fiber.type;
|
|
var props = fiber.pendingProps;
|
|
didNotFindHydratableInstanceWithinContainer(parentContainer, type);
|
|
break;
|
|
case HostText:
|
|
var text = fiber.pendingProps;
|
|
didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var parentType = returnFiber.type;
|
|
var parentProps = returnFiber.memoizedProps;
|
|
var parentInstance = returnFiber.stateNode;
|
|
switch (fiber.tag) {
|
|
case HostComponent: {
|
|
var _type = fiber.type;
|
|
var _props = fiber.pendingProps;
|
|
var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
|
|
didNotFindHydratableInstance(
|
|
parentType,
|
|
parentProps,
|
|
parentInstance,
|
|
_type,
|
|
_props,
|
|
isConcurrentMode
|
|
);
|
|
break;
|
|
}
|
|
case HostText: {
|
|
var _text = fiber.pendingProps;
|
|
var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
|
|
didNotFindHydratableTextInstance(
|
|
parentType,
|
|
parentProps,
|
|
parentInstance,
|
|
_text,
|
|
_isConcurrentMode
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case SuspenseComponent: {
|
|
var suspenseState = returnFiber.memoizedState;
|
|
var _parentInstance = suspenseState.dehydrated;
|
|
if (_parentInstance !== null)
|
|
switch (fiber.tag) {
|
|
case HostComponent:
|
|
var _type2 = fiber.type;
|
|
var _props2 = fiber.pendingProps;
|
|
didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
|
|
break;
|
|
case HostText:
|
|
var _text2 = fiber.pendingProps;
|
|
didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function insertNonHydratedInstance(returnFiber, fiber) {
|
|
fiber.flags = fiber.flags & ~Hydrating | Placement;
|
|
warnNonhydratedInstance(returnFiber, fiber);
|
|
}
|
|
function tryHydrate(fiber, nextInstance) {
|
|
switch (fiber.tag) {
|
|
case HostComponent: {
|
|
var type = fiber.type;
|
|
var props = fiber.pendingProps;
|
|
var instance = canHydrateInstance(nextInstance, type);
|
|
if (instance !== null) {
|
|
fiber.stateNode = instance;
|
|
hydrationParentFiber = fiber;
|
|
nextHydratableInstance = getFirstHydratableChild(instance);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
case HostText: {
|
|
var text = fiber.pendingProps;
|
|
var textInstance = canHydrateTextInstance(nextInstance, text);
|
|
if (textInstance !== null) {
|
|
fiber.stateNode = textInstance;
|
|
hydrationParentFiber = fiber;
|
|
nextHydratableInstance = null;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
case SuspenseComponent: {
|
|
var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
|
|
if (suspenseInstance !== null) {
|
|
var suspenseState = {
|
|
dehydrated: suspenseInstance,
|
|
treeContext: getSuspendedTreeContext(),
|
|
retryLane: OffscreenLane
|
|
};
|
|
fiber.memoizedState = suspenseState;
|
|
var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
|
|
dehydratedFragment.return = fiber;
|
|
fiber.child = dehydratedFragment;
|
|
hydrationParentFiber = fiber;
|
|
nextHydratableInstance = null;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function shouldClientRenderOnMismatch(fiber) {
|
|
return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
|
|
}
|
|
function throwOnHydrationMismatch(fiber) {
|
|
throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
|
|
}
|
|
function tryToClaimNextHydratableInstance(fiber) {
|
|
if (!isHydrating) {
|
|
return;
|
|
}
|
|
var nextInstance = nextHydratableInstance;
|
|
if (!nextInstance) {
|
|
if (shouldClientRenderOnMismatch(fiber)) {
|
|
warnNonhydratedInstance(hydrationParentFiber, fiber);
|
|
throwOnHydrationMismatch();
|
|
}
|
|
insertNonHydratedInstance(hydrationParentFiber, fiber);
|
|
isHydrating = false;
|
|
hydrationParentFiber = fiber;
|
|
return;
|
|
}
|
|
var firstAttemptedInstance = nextInstance;
|
|
if (!tryHydrate(fiber, nextInstance)) {
|
|
if (shouldClientRenderOnMismatch(fiber)) {
|
|
warnNonhydratedInstance(hydrationParentFiber, fiber);
|
|
throwOnHydrationMismatch();
|
|
}
|
|
nextInstance = getNextHydratableSibling(firstAttemptedInstance);
|
|
var prevHydrationParentFiber = hydrationParentFiber;
|
|
if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
|
|
insertNonHydratedInstance(hydrationParentFiber, fiber);
|
|
isHydrating = false;
|
|
hydrationParentFiber = fiber;
|
|
return;
|
|
}
|
|
deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
|
|
}
|
|
}
|
|
function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
|
|
var instance = fiber.stateNode;
|
|
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
|
|
var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
|
|
fiber.updateQueue = updatePayload;
|
|
if (updatePayload !== null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function prepareToHydrateHostTextInstance(fiber) {
|
|
var textInstance = fiber.stateNode;
|
|
var textContent = fiber.memoizedProps;
|
|
var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
|
|
if (shouldUpdate) {
|
|
var returnFiber = hydrationParentFiber;
|
|
if (returnFiber !== null) {
|
|
switch (returnFiber.tag) {
|
|
case HostRoot: {
|
|
var parentContainer = returnFiber.stateNode.containerInfo;
|
|
var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
|
|
didNotMatchHydratedContainerTextInstance(
|
|
parentContainer,
|
|
textInstance,
|
|
textContent,
|
|
isConcurrentMode
|
|
);
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var parentType = returnFiber.type;
|
|
var parentProps = returnFiber.memoizedProps;
|
|
var parentInstance = returnFiber.stateNode;
|
|
var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
|
|
didNotMatchHydratedTextInstance(
|
|
parentType,
|
|
parentProps,
|
|
parentInstance,
|
|
textInstance,
|
|
textContent,
|
|
_isConcurrentMode2
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return shouldUpdate;
|
|
}
|
|
function prepareToHydrateHostSuspenseInstance(fiber) {
|
|
var suspenseState = fiber.memoizedState;
|
|
var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
|
|
if (!suspenseInstance) {
|
|
throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
hydrateSuspenseInstance(suspenseInstance, fiber);
|
|
}
|
|
function skipPastDehydratedSuspenseInstance(fiber) {
|
|
var suspenseState = fiber.memoizedState;
|
|
var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
|
|
if (!suspenseInstance) {
|
|
throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
|
|
}
|
|
function popToNextHostParent(fiber) {
|
|
var parent = fiber.return;
|
|
while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
|
|
parent = parent.return;
|
|
}
|
|
hydrationParentFiber = parent;
|
|
}
|
|
function popHydrationState(fiber) {
|
|
if (fiber !== hydrationParentFiber) {
|
|
return false;
|
|
}
|
|
if (!isHydrating) {
|
|
popToNextHostParent(fiber);
|
|
isHydrating = true;
|
|
return false;
|
|
}
|
|
if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
|
|
var nextInstance = nextHydratableInstance;
|
|
if (nextInstance) {
|
|
if (shouldClientRenderOnMismatch(fiber)) {
|
|
warnIfUnhydratedTailNodes(fiber);
|
|
throwOnHydrationMismatch();
|
|
} else {
|
|
while (nextInstance) {
|
|
deleteHydratableInstance(fiber, nextInstance);
|
|
nextInstance = getNextHydratableSibling(nextInstance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
popToNextHostParent(fiber);
|
|
if (fiber.tag === SuspenseComponent) {
|
|
nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
|
|
} else {
|
|
nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
|
|
}
|
|
return true;
|
|
}
|
|
function hasUnhydratedTailNodes() {
|
|
return isHydrating && nextHydratableInstance !== null;
|
|
}
|
|
function warnIfUnhydratedTailNodes(fiber) {
|
|
var nextInstance = nextHydratableInstance;
|
|
while (nextInstance) {
|
|
warnUnhydratedInstance(fiber, nextInstance);
|
|
nextInstance = getNextHydratableSibling(nextInstance);
|
|
}
|
|
}
|
|
function resetHydrationState() {
|
|
hydrationParentFiber = null;
|
|
nextHydratableInstance = null;
|
|
isHydrating = false;
|
|
didSuspendOrErrorDEV = false;
|
|
}
|
|
function upgradeHydrationErrorsToRecoverable() {
|
|
if (hydrationErrors !== null) {
|
|
queueRecoverableErrors(hydrationErrors);
|
|
hydrationErrors = null;
|
|
}
|
|
}
|
|
function getIsHydrating() {
|
|
return isHydrating;
|
|
}
|
|
function queueHydrationError(error2) {
|
|
if (hydrationErrors === null) {
|
|
hydrationErrors = [error2];
|
|
} else {
|
|
hydrationErrors.push(error2);
|
|
}
|
|
}
|
|
var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
var NoTransition = null;
|
|
function requestCurrentTransition() {
|
|
return ReactCurrentBatchConfig$1.transition;
|
|
}
|
|
var ReactStrictModeWarnings = {
|
|
recordUnsafeLifecycleWarnings: function(fiber, instance) {
|
|
},
|
|
flushPendingUnsafeLifecycleWarnings: function() {
|
|
},
|
|
recordLegacyContextWarning: function(fiber, instance) {
|
|
},
|
|
flushLegacyContextWarning: function() {
|
|
},
|
|
discardPendingWarnings: function() {
|
|
}
|
|
};
|
|
{
|
|
var findStrictRoot = function(fiber) {
|
|
var maybeStrictRoot = null;
|
|
var node = fiber;
|
|
while (node !== null) {
|
|
if (node.mode & StrictLegacyMode) {
|
|
maybeStrictRoot = node;
|
|
}
|
|
node = node.return;
|
|
}
|
|
return maybeStrictRoot;
|
|
};
|
|
var setToSortedString = function(set2) {
|
|
var array = [];
|
|
set2.forEach(function(value) {
|
|
array.push(value);
|
|
});
|
|
return array.sort().join(", ");
|
|
};
|
|
var pendingComponentWillMountWarnings = [];
|
|
var pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
var pendingComponentWillReceivePropsWarnings = [];
|
|
var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
var pendingComponentWillUpdateWarnings = [];
|
|
var pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
|
|
if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
|
|
return;
|
|
}
|
|
if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillMountWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
|
|
pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
|
|
}
|
|
if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillReceivePropsWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
|
|
}
|
|
if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
|
pendingComponentWillUpdateWarnings.push(fiber);
|
|
}
|
|
if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
|
|
}
|
|
};
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
|
|
var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingComponentWillMountWarnings.length > 0) {
|
|
pendingComponentWillMountWarnings.forEach(function(fiber) {
|
|
componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillMountWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
}
|
|
var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingComponentWillReceivePropsWarnings.length > 0) {
|
|
pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
|
|
componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillReceivePropsWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
}
|
|
var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingComponentWillUpdateWarnings.length > 0) {
|
|
pendingComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingComponentWillUpdateWarnings = [];
|
|
}
|
|
var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
|
|
if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
|
|
pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
|
|
UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutUnsafeLifecycles.add(fiber.type);
|
|
});
|
|
pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
}
|
|
if (UNSAFE_componentWillMountUniqueNames.size > 0) {
|
|
var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
|
|
error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
|
|
}
|
|
if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
|
|
var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
|
|
error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
|
|
}
|
|
if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
|
|
var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
|
|
error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
|
|
}
|
|
if (componentWillMountUniqueNames.size > 0) {
|
|
var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
|
|
warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
|
|
}
|
|
if (componentWillReceivePropsUniqueNames.size > 0) {
|
|
var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
|
|
warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
|
|
}
|
|
if (componentWillUpdateUniqueNames.size > 0) {
|
|
var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
|
|
warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
|
|
}
|
|
};
|
|
var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
|
|
var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
|
|
ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
|
|
var strictRoot = findStrictRoot(fiber);
|
|
if (strictRoot === null) {
|
|
error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
|
|
return;
|
|
}
|
|
if (didWarnAboutLegacyContext.has(fiber.type)) {
|
|
return;
|
|
}
|
|
var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
|
|
if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
|
|
if (warningsForRoot === void 0) {
|
|
warningsForRoot = [];
|
|
pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
|
|
}
|
|
warningsForRoot.push(fiber);
|
|
}
|
|
};
|
|
ReactStrictModeWarnings.flushLegacyContextWarning = function() {
|
|
pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
|
|
if (fiberArray.length === 0) {
|
|
return;
|
|
}
|
|
var firstFiber = fiberArray[0];
|
|
var uniqueNames = /* @__PURE__ */ new Set();
|
|
fiberArray.forEach(function(fiber) {
|
|
uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
|
|
didWarnAboutLegacyContext.add(fiber.type);
|
|
});
|
|
var sortedNames = setToSortedString(uniqueNames);
|
|
try {
|
|
setCurrentFiber(firstFiber);
|
|
error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
|
|
} finally {
|
|
resetCurrentFiber();
|
|
}
|
|
});
|
|
};
|
|
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
|
pendingComponentWillMountWarnings = [];
|
|
pendingUNSAFE_ComponentWillMountWarnings = [];
|
|
pendingComponentWillReceivePropsWarnings = [];
|
|
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
|
|
pendingComponentWillUpdateWarnings = [];
|
|
pendingUNSAFE_ComponentWillUpdateWarnings = [];
|
|
pendingLegacyContextWarning = /* @__PURE__ */ new Map();
|
|
};
|
|
}
|
|
function resolveDefaultProps(Component, baseProps) {
|
|
if (Component && Component.defaultProps) {
|
|
var props = assign({}, baseProps);
|
|
var defaultProps = Component.defaultProps;
|
|
for (var propName in defaultProps) {
|
|
if (props[propName] === void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
return baseProps;
|
|
}
|
|
var valueCursor = createCursor(null);
|
|
var rendererSigil;
|
|
{
|
|
rendererSigil = {};
|
|
}
|
|
var currentlyRenderingFiber = null;
|
|
var lastContextDependency = null;
|
|
var lastFullyObservedContext = null;
|
|
var isDisallowedContextReadInDEV = false;
|
|
function resetContextDependencies() {
|
|
currentlyRenderingFiber = null;
|
|
lastContextDependency = null;
|
|
lastFullyObservedContext = null;
|
|
{
|
|
isDisallowedContextReadInDEV = false;
|
|
}
|
|
}
|
|
function enterDisallowedContextReadInDEV() {
|
|
{
|
|
isDisallowedContextReadInDEV = true;
|
|
}
|
|
}
|
|
function exitDisallowedContextReadInDEV() {
|
|
{
|
|
isDisallowedContextReadInDEV = false;
|
|
}
|
|
}
|
|
function pushProvider(providerFiber, context, nextValue) {
|
|
{
|
|
push(valueCursor, context._currentValue, providerFiber);
|
|
context._currentValue = nextValue;
|
|
{
|
|
if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
|
|
error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
|
|
}
|
|
context._currentRenderer = rendererSigil;
|
|
}
|
|
}
|
|
}
|
|
function popProvider(context, providerFiber) {
|
|
var currentValue = valueCursor.current;
|
|
pop(valueCursor, providerFiber);
|
|
{
|
|
{
|
|
context._currentValue = currentValue;
|
|
}
|
|
}
|
|
}
|
|
function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
|
|
var node = parent;
|
|
while (node !== null) {
|
|
var alternate = node.alternate;
|
|
if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
|
|
node.childLanes = mergeLanes(node.childLanes, renderLanes2);
|
|
if (alternate !== null) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
|
|
}
|
|
} else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
|
|
}
|
|
if (node === propagationRoot) {
|
|
break;
|
|
}
|
|
node = node.return;
|
|
}
|
|
{
|
|
if (node !== propagationRoot) {
|
|
error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
function propagateContextChange(workInProgress2, context, renderLanes2) {
|
|
{
|
|
propagateContextChange_eager(workInProgress2, context, renderLanes2);
|
|
}
|
|
}
|
|
function propagateContextChange_eager(workInProgress2, context, renderLanes2) {
|
|
var fiber = workInProgress2.child;
|
|
if (fiber !== null) {
|
|
fiber.return = workInProgress2;
|
|
}
|
|
while (fiber !== null) {
|
|
var nextFiber = void 0;
|
|
var list = fiber.dependencies;
|
|
if (list !== null) {
|
|
nextFiber = fiber.child;
|
|
var dependency = list.firstContext;
|
|
while (dependency !== null) {
|
|
if (dependency.context === context) {
|
|
if (fiber.tag === ClassComponent) {
|
|
var lane = pickArbitraryLane(renderLanes2);
|
|
var update = createUpdate(NoTimestamp, lane);
|
|
update.tag = ForceUpdate;
|
|
var updateQueue = fiber.updateQueue;
|
|
if (updateQueue === null)
|
|
;
|
|
else {
|
|
var sharedQueue = updateQueue.shared;
|
|
var pending = sharedQueue.pending;
|
|
if (pending === null) {
|
|
update.next = update;
|
|
} else {
|
|
update.next = pending.next;
|
|
pending.next = update;
|
|
}
|
|
sharedQueue.pending = update;
|
|
}
|
|
}
|
|
fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
|
|
}
|
|
scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
|
|
list.lanes = mergeLanes(list.lanes, renderLanes2);
|
|
break;
|
|
}
|
|
dependency = dependency.next;
|
|
}
|
|
} else if (fiber.tag === ContextProvider) {
|
|
nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
|
|
} else if (fiber.tag === DehydratedFragment) {
|
|
var parentSuspense = fiber.return;
|
|
if (parentSuspense === null) {
|
|
throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
|
|
}
|
|
parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
|
|
var _alternate = parentSuspense.alternate;
|
|
if (_alternate !== null) {
|
|
_alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
|
|
}
|
|
scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
|
|
nextFiber = fiber.sibling;
|
|
} else {
|
|
nextFiber = fiber.child;
|
|
}
|
|
if (nextFiber !== null) {
|
|
nextFiber.return = fiber;
|
|
} else {
|
|
nextFiber = fiber;
|
|
while (nextFiber !== null) {
|
|
if (nextFiber === workInProgress2) {
|
|
nextFiber = null;
|
|
break;
|
|
}
|
|
var sibling = nextFiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = nextFiber.return;
|
|
nextFiber = sibling;
|
|
break;
|
|
}
|
|
nextFiber = nextFiber.return;
|
|
}
|
|
}
|
|
fiber = nextFiber;
|
|
}
|
|
}
|
|
function prepareToReadContext(workInProgress2, renderLanes2) {
|
|
currentlyRenderingFiber = workInProgress2;
|
|
lastContextDependency = null;
|
|
lastFullyObservedContext = null;
|
|
var dependencies = workInProgress2.dependencies;
|
|
if (dependencies !== null) {
|
|
{
|
|
var firstContext = dependencies.firstContext;
|
|
if (firstContext !== null) {
|
|
if (includesSomeLane(dependencies.lanes, renderLanes2)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
dependencies.firstContext = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function readContext(context) {
|
|
{
|
|
if (isDisallowedContextReadInDEV) {
|
|
error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
}
|
|
}
|
|
var value = context._currentValue;
|
|
if (lastFullyObservedContext === context)
|
|
;
|
|
else {
|
|
var contextItem = {
|
|
context,
|
|
memoizedValue: value,
|
|
next: null
|
|
};
|
|
if (lastContextDependency === null) {
|
|
if (currentlyRenderingFiber === null) {
|
|
throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
}
|
|
lastContextDependency = contextItem;
|
|
currentlyRenderingFiber.dependencies = {
|
|
lanes: NoLanes,
|
|
firstContext: contextItem
|
|
};
|
|
} else {
|
|
lastContextDependency = lastContextDependency.next = contextItem;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
var concurrentQueues = null;
|
|
function pushConcurrentUpdateQueue(queue) {
|
|
if (concurrentQueues === null) {
|
|
concurrentQueues = [queue];
|
|
} else {
|
|
concurrentQueues.push(queue);
|
|
}
|
|
}
|
|
function finishQueueingConcurrentUpdates() {
|
|
if (concurrentQueues !== null) {
|
|
for (var i2 = 0; i2 < concurrentQueues.length; i2++) {
|
|
var queue = concurrentQueues[i2];
|
|
var lastInterleavedUpdate = queue.interleaved;
|
|
if (lastInterleavedUpdate !== null) {
|
|
queue.interleaved = null;
|
|
var firstInterleavedUpdate = lastInterleavedUpdate.next;
|
|
var lastPendingUpdate = queue.pending;
|
|
if (lastPendingUpdate !== null) {
|
|
var firstPendingUpdate = lastPendingUpdate.next;
|
|
lastPendingUpdate.next = firstInterleavedUpdate;
|
|
lastInterleavedUpdate.next = firstPendingUpdate;
|
|
}
|
|
queue.pending = lastInterleavedUpdate;
|
|
}
|
|
}
|
|
concurrentQueues = null;
|
|
}
|
|
}
|
|
function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
|
|
var interleaved = queue.interleaved;
|
|
if (interleaved === null) {
|
|
update.next = update;
|
|
pushConcurrentUpdateQueue(queue);
|
|
} else {
|
|
update.next = interleaved.next;
|
|
interleaved.next = update;
|
|
}
|
|
queue.interleaved = update;
|
|
return markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
}
|
|
function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
|
|
var interleaved = queue.interleaved;
|
|
if (interleaved === null) {
|
|
update.next = update;
|
|
pushConcurrentUpdateQueue(queue);
|
|
} else {
|
|
update.next = interleaved.next;
|
|
interleaved.next = update;
|
|
}
|
|
queue.interleaved = update;
|
|
}
|
|
function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
|
|
var interleaved = queue.interleaved;
|
|
if (interleaved === null) {
|
|
update.next = update;
|
|
pushConcurrentUpdateQueue(queue);
|
|
} else {
|
|
update.next = interleaved.next;
|
|
interleaved.next = update;
|
|
}
|
|
queue.interleaved = update;
|
|
return markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
}
|
|
function enqueueConcurrentRenderForLane(fiber, lane) {
|
|
return markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
}
|
|
var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
|
|
function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
|
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
|
|
var alternate = sourceFiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, lane);
|
|
}
|
|
{
|
|
if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
}
|
|
}
|
|
var node = sourceFiber;
|
|
var parent = sourceFiber.return;
|
|
while (parent !== null) {
|
|
parent.childLanes = mergeLanes(parent.childLanes, lane);
|
|
alternate = parent.alternate;
|
|
if (alternate !== null) {
|
|
alternate.childLanes = mergeLanes(alternate.childLanes, lane);
|
|
} else {
|
|
{
|
|
if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
}
|
|
}
|
|
}
|
|
node = parent;
|
|
parent = parent.return;
|
|
}
|
|
if (node.tag === HostRoot) {
|
|
var root2 = node.stateNode;
|
|
return root2;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
var UpdateState = 0;
|
|
var ReplaceState = 1;
|
|
var ForceUpdate = 2;
|
|
var CaptureUpdate = 3;
|
|
var hasForceUpdate = false;
|
|
var didWarnUpdateInsideUpdate;
|
|
var currentlyProcessingQueue;
|
|
{
|
|
didWarnUpdateInsideUpdate = false;
|
|
currentlyProcessingQueue = null;
|
|
}
|
|
function initializeUpdateQueue(fiber) {
|
|
var queue = {
|
|
baseState: fiber.memoizedState,
|
|
firstBaseUpdate: null,
|
|
lastBaseUpdate: null,
|
|
shared: {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: NoLanes
|
|
},
|
|
effects: null
|
|
};
|
|
fiber.updateQueue = queue;
|
|
}
|
|
function cloneUpdateQueue(current2, workInProgress2) {
|
|
var queue = workInProgress2.updateQueue;
|
|
var currentQueue = current2.updateQueue;
|
|
if (queue === currentQueue) {
|
|
var clone = {
|
|
baseState: currentQueue.baseState,
|
|
firstBaseUpdate: currentQueue.firstBaseUpdate,
|
|
lastBaseUpdate: currentQueue.lastBaseUpdate,
|
|
shared: currentQueue.shared,
|
|
effects: currentQueue.effects
|
|
};
|
|
workInProgress2.updateQueue = clone;
|
|
}
|
|
}
|
|
function createUpdate(eventTime, lane) {
|
|
var update = {
|
|
eventTime,
|
|
lane,
|
|
tag: UpdateState,
|
|
payload: null,
|
|
callback: null,
|
|
next: null
|
|
};
|
|
return update;
|
|
}
|
|
function enqueueUpdate(fiber, update, lane) {
|
|
var updateQueue = fiber.updateQueue;
|
|
if (updateQueue === null) {
|
|
return null;
|
|
}
|
|
var sharedQueue = updateQueue.shared;
|
|
{
|
|
if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
|
|
error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
|
|
didWarnUpdateInsideUpdate = true;
|
|
}
|
|
}
|
|
if (isUnsafeClassRenderPhaseUpdate()) {
|
|
var pending = sharedQueue.pending;
|
|
if (pending === null) {
|
|
update.next = update;
|
|
} else {
|
|
update.next = pending.next;
|
|
pending.next = update;
|
|
}
|
|
sharedQueue.pending = update;
|
|
return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
} else {
|
|
return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
|
|
}
|
|
}
|
|
function entangleTransitions(root2, fiber, lane) {
|
|
var updateQueue = fiber.updateQueue;
|
|
if (updateQueue === null) {
|
|
return;
|
|
}
|
|
var sharedQueue = updateQueue.shared;
|
|
if (isTransitionLane(lane)) {
|
|
var queueLanes = sharedQueue.lanes;
|
|
queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
|
|
var newQueueLanes = mergeLanes(queueLanes, lane);
|
|
sharedQueue.lanes = newQueueLanes;
|
|
markRootEntangled(root2, newQueueLanes);
|
|
}
|
|
}
|
|
function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
|
|
var queue = workInProgress2.updateQueue;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 !== null) {
|
|
var currentQueue = current2.updateQueue;
|
|
if (queue === currentQueue) {
|
|
var newFirst = null;
|
|
var newLast = null;
|
|
var firstBaseUpdate = queue.firstBaseUpdate;
|
|
if (firstBaseUpdate !== null) {
|
|
var update = firstBaseUpdate;
|
|
do {
|
|
var clone = {
|
|
eventTime: update.eventTime,
|
|
lane: update.lane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
if (newLast === null) {
|
|
newFirst = newLast = clone;
|
|
} else {
|
|
newLast.next = clone;
|
|
newLast = clone;
|
|
}
|
|
update = update.next;
|
|
} while (update !== null);
|
|
if (newLast === null) {
|
|
newFirst = newLast = capturedUpdate;
|
|
} else {
|
|
newLast.next = capturedUpdate;
|
|
newLast = capturedUpdate;
|
|
}
|
|
} else {
|
|
newFirst = newLast = capturedUpdate;
|
|
}
|
|
queue = {
|
|
baseState: currentQueue.baseState,
|
|
firstBaseUpdate: newFirst,
|
|
lastBaseUpdate: newLast,
|
|
shared: currentQueue.shared,
|
|
effects: currentQueue.effects
|
|
};
|
|
workInProgress2.updateQueue = queue;
|
|
return;
|
|
}
|
|
}
|
|
var lastBaseUpdate = queue.lastBaseUpdate;
|
|
if (lastBaseUpdate === null) {
|
|
queue.firstBaseUpdate = capturedUpdate;
|
|
} else {
|
|
lastBaseUpdate.next = capturedUpdate;
|
|
}
|
|
queue.lastBaseUpdate = capturedUpdate;
|
|
}
|
|
function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
|
|
switch (update.tag) {
|
|
case ReplaceState: {
|
|
var payload = update.payload;
|
|
if (typeof payload === "function") {
|
|
{
|
|
enterDisallowedContextReadInDEV();
|
|
}
|
|
var nextState = payload.call(instance, prevState, nextProps);
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
payload.call(instance, prevState, nextProps);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
exitDisallowedContextReadInDEV();
|
|
}
|
|
return nextState;
|
|
}
|
|
return payload;
|
|
}
|
|
case CaptureUpdate: {
|
|
workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
|
|
}
|
|
case UpdateState: {
|
|
var _payload = update.payload;
|
|
var partialState;
|
|
if (typeof _payload === "function") {
|
|
{
|
|
enterDisallowedContextReadInDEV();
|
|
}
|
|
partialState = _payload.call(instance, prevState, nextProps);
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
_payload.call(instance, prevState, nextProps);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
exitDisallowedContextReadInDEV();
|
|
}
|
|
} else {
|
|
partialState = _payload;
|
|
}
|
|
if (partialState === null || partialState === void 0) {
|
|
return prevState;
|
|
}
|
|
return assign({}, prevState, partialState);
|
|
}
|
|
case ForceUpdate: {
|
|
hasForceUpdate = true;
|
|
return prevState;
|
|
}
|
|
}
|
|
return prevState;
|
|
}
|
|
function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
|
|
var queue = workInProgress2.updateQueue;
|
|
hasForceUpdate = false;
|
|
{
|
|
currentlyProcessingQueue = queue.shared;
|
|
}
|
|
var firstBaseUpdate = queue.firstBaseUpdate;
|
|
var lastBaseUpdate = queue.lastBaseUpdate;
|
|
var pendingQueue = queue.shared.pending;
|
|
if (pendingQueue !== null) {
|
|
queue.shared.pending = null;
|
|
var lastPendingUpdate = pendingQueue;
|
|
var firstPendingUpdate = lastPendingUpdate.next;
|
|
lastPendingUpdate.next = null;
|
|
if (lastBaseUpdate === null) {
|
|
firstBaseUpdate = firstPendingUpdate;
|
|
} else {
|
|
lastBaseUpdate.next = firstPendingUpdate;
|
|
}
|
|
lastBaseUpdate = lastPendingUpdate;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 !== null) {
|
|
var currentQueue = current2.updateQueue;
|
|
var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
|
|
if (currentLastBaseUpdate !== lastBaseUpdate) {
|
|
if (currentLastBaseUpdate === null) {
|
|
currentQueue.firstBaseUpdate = firstPendingUpdate;
|
|
} else {
|
|
currentLastBaseUpdate.next = firstPendingUpdate;
|
|
}
|
|
currentQueue.lastBaseUpdate = lastPendingUpdate;
|
|
}
|
|
}
|
|
}
|
|
if (firstBaseUpdate !== null) {
|
|
var newState = queue.baseState;
|
|
var newLanes = NoLanes;
|
|
var newBaseState = null;
|
|
var newFirstBaseUpdate = null;
|
|
var newLastBaseUpdate = null;
|
|
var update = firstBaseUpdate;
|
|
do {
|
|
var updateLane = update.lane;
|
|
var updateEventTime = update.eventTime;
|
|
if (!isSubsetOfLanes(renderLanes2, updateLane)) {
|
|
var clone = {
|
|
eventTime: updateEventTime,
|
|
lane: updateLane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
if (newLastBaseUpdate === null) {
|
|
newFirstBaseUpdate = newLastBaseUpdate = clone;
|
|
newBaseState = newState;
|
|
} else {
|
|
newLastBaseUpdate = newLastBaseUpdate.next = clone;
|
|
}
|
|
newLanes = mergeLanes(newLanes, updateLane);
|
|
} else {
|
|
if (newLastBaseUpdate !== null) {
|
|
var _clone = {
|
|
eventTime: updateEventTime,
|
|
lane: NoLane,
|
|
tag: update.tag,
|
|
payload: update.payload,
|
|
callback: update.callback,
|
|
next: null
|
|
};
|
|
newLastBaseUpdate = newLastBaseUpdate.next = _clone;
|
|
}
|
|
newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
|
|
var callback = update.callback;
|
|
if (callback !== null && update.lane !== NoLane) {
|
|
workInProgress2.flags |= Callback;
|
|
var effects = queue.effects;
|
|
if (effects === null) {
|
|
queue.effects = [update];
|
|
} else {
|
|
effects.push(update);
|
|
}
|
|
}
|
|
}
|
|
update = update.next;
|
|
if (update === null) {
|
|
pendingQueue = queue.shared.pending;
|
|
if (pendingQueue === null) {
|
|
break;
|
|
} else {
|
|
var _lastPendingUpdate = pendingQueue;
|
|
var _firstPendingUpdate = _lastPendingUpdate.next;
|
|
_lastPendingUpdate.next = null;
|
|
update = _firstPendingUpdate;
|
|
queue.lastBaseUpdate = _lastPendingUpdate;
|
|
queue.shared.pending = null;
|
|
}
|
|
}
|
|
} while (true);
|
|
if (newLastBaseUpdate === null) {
|
|
newBaseState = newState;
|
|
}
|
|
queue.baseState = newBaseState;
|
|
queue.firstBaseUpdate = newFirstBaseUpdate;
|
|
queue.lastBaseUpdate = newLastBaseUpdate;
|
|
var lastInterleaved = queue.shared.interleaved;
|
|
if (lastInterleaved !== null) {
|
|
var interleaved = lastInterleaved;
|
|
do {
|
|
newLanes = mergeLanes(newLanes, interleaved.lane);
|
|
interleaved = interleaved.next;
|
|
} while (interleaved !== lastInterleaved);
|
|
} else if (firstBaseUpdate === null) {
|
|
queue.shared.lanes = NoLanes;
|
|
}
|
|
markSkippedUpdateLanes(newLanes);
|
|
workInProgress2.lanes = newLanes;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
{
|
|
currentlyProcessingQueue = null;
|
|
}
|
|
}
|
|
function callCallback(callback, context) {
|
|
if (typeof callback !== "function") {
|
|
throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
|
|
}
|
|
callback.call(context);
|
|
}
|
|
function resetHasForceUpdateBeforeProcessing() {
|
|
hasForceUpdate = false;
|
|
}
|
|
function checkHasForceUpdateAfterProcessing() {
|
|
return hasForceUpdate;
|
|
}
|
|
function commitUpdateQueue(finishedWork, finishedQueue, instance) {
|
|
var effects = finishedQueue.effects;
|
|
finishedQueue.effects = null;
|
|
if (effects !== null) {
|
|
for (var i2 = 0; i2 < effects.length; i2++) {
|
|
var effect = effects[i2];
|
|
var callback = effect.callback;
|
|
if (callback !== null) {
|
|
effect.callback = null;
|
|
callCallback(callback, instance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var fakeInternalInstance = {};
|
|
var emptyRefsObject = new React11.Component().refs;
|
|
var didWarnAboutStateAssignmentForComponent;
|
|
var didWarnAboutUninitializedState;
|
|
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
|
var didWarnAboutLegacyLifecyclesAndDerivedState;
|
|
var didWarnAboutUndefinedDerivedState;
|
|
var warnOnUndefinedDerivedState;
|
|
var warnOnInvalidCallback;
|
|
var didWarnAboutDirectlyAssigningPropsToState;
|
|
var didWarnAboutContextTypeAndContextTypes;
|
|
var didWarnAboutInvalidateContextType;
|
|
{
|
|
didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
|
|
didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
|
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
|
|
didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
|
|
didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
|
|
didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
|
|
didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
|
|
didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
|
|
var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
|
|
warnOnInvalidCallback = function(callback, callerName) {
|
|
if (callback === null || typeof callback === "function") {
|
|
return;
|
|
}
|
|
var key = callerName + "_" + callback;
|
|
if (!didWarnOnInvalidCallback.has(key)) {
|
|
didWarnOnInvalidCallback.add(key);
|
|
error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
|
|
}
|
|
};
|
|
warnOnUndefinedDerivedState = function(type, partialState) {
|
|
if (partialState === void 0) {
|
|
var componentName = getComponentNameFromType(type) || "Component";
|
|
if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
|
|
didWarnAboutUndefinedDerivedState.add(componentName);
|
|
error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
|
|
}
|
|
}
|
|
};
|
|
Object.defineProperty(fakeInternalInstance, "_processChildContext", {
|
|
enumerable: false,
|
|
value: function() {
|
|
throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
|
|
}
|
|
});
|
|
Object.freeze(fakeInternalInstance);
|
|
}
|
|
function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
|
|
var prevState = workInProgress2.memoizedState;
|
|
var partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
partialState = getDerivedStateFromProps(nextProps, prevState);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
warnOnUndefinedDerivedState(ctor, partialState);
|
|
}
|
|
var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState);
|
|
workInProgress2.memoizedState = memoizedState;
|
|
if (workInProgress2.lanes === NoLanes) {
|
|
var updateQueue = workInProgress2.updateQueue;
|
|
updateQueue.baseState = memoizedState;
|
|
}
|
|
}
|
|
var classComponentUpdater = {
|
|
isMounted,
|
|
enqueueSetState: function(inst, payload, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.payload = payload;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "setState");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
var root2 = enqueueUpdate(fiber, update, lane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
entangleTransitions(root2, fiber, lane);
|
|
}
|
|
{
|
|
markStateUpdateScheduled(fiber, lane);
|
|
}
|
|
},
|
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.tag = ReplaceState;
|
|
update.payload = payload;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "replaceState");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
var root2 = enqueueUpdate(fiber, update, lane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
entangleTransitions(root2, fiber, lane);
|
|
}
|
|
{
|
|
markStateUpdateScheduled(fiber, lane);
|
|
}
|
|
},
|
|
enqueueForceUpdate: function(inst, callback) {
|
|
var fiber = get(inst);
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.tag = ForceUpdate;
|
|
if (callback !== void 0 && callback !== null) {
|
|
{
|
|
warnOnInvalidCallback(callback, "forceUpdate");
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
var root2 = enqueueUpdate(fiber, update, lane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
entangleTransitions(root2, fiber, lane);
|
|
}
|
|
{
|
|
markForceUpdateScheduled(fiber, lane);
|
|
}
|
|
}
|
|
};
|
|
function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
|
|
var instance = workInProgress2.stateNode;
|
|
if (typeof instance.shouldComponentUpdate === "function") {
|
|
var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
if (shouldUpdate === void 0) {
|
|
error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
|
|
}
|
|
}
|
|
return shouldUpdate;
|
|
}
|
|
if (ctor.prototype && ctor.prototype.isPureReactComponent) {
|
|
return !shallowEqual2(oldProps, newProps) || !shallowEqual2(oldState, newState);
|
|
}
|
|
return true;
|
|
}
|
|
function checkClassInstance(workInProgress2, ctor, newProps) {
|
|
var instance = workInProgress2.stateNode;
|
|
{
|
|
var name = getComponentNameFromType(ctor) || "Component";
|
|
var renderPresent = instance.render;
|
|
if (!renderPresent) {
|
|
if (ctor.prototype && typeof ctor.prototype.render === "function") {
|
|
error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
|
|
} else {
|
|
error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
|
|
}
|
|
}
|
|
if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
|
|
error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name);
|
|
}
|
|
if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name);
|
|
}
|
|
if (instance.propTypes) {
|
|
error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
|
|
}
|
|
if (instance.contextType) {
|
|
error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
|
|
}
|
|
{
|
|
if (instance.contextTypes) {
|
|
error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
|
|
}
|
|
if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
|
|
didWarnAboutContextTypeAndContextTypes.add(ctor);
|
|
error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
|
|
}
|
|
}
|
|
if (typeof instance.componentShouldUpdate === "function") {
|
|
error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name);
|
|
}
|
|
if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
|
|
error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component");
|
|
}
|
|
if (typeof instance.componentDidUnmount === "function") {
|
|
error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
|
|
}
|
|
if (typeof instance.componentDidReceiveProps === "function") {
|
|
error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name);
|
|
}
|
|
if (typeof instance.componentWillRecieveProps === "function") {
|
|
error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
|
|
error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
|
|
}
|
|
var hasMutatedProps = instance.props !== newProps;
|
|
if (instance.props !== void 0 && hasMutatedProps) {
|
|
error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
|
|
}
|
|
if (instance.defaultProps) {
|
|
error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name);
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
|
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
|
|
error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor));
|
|
}
|
|
if (typeof instance.getDerivedStateFromProps === "function") {
|
|
error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
|
|
}
|
|
if (typeof instance.getDerivedStateFromError === "function") {
|
|
error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
|
|
}
|
|
if (typeof ctor.getSnapshotBeforeUpdate === "function") {
|
|
error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
|
|
}
|
|
var _state = instance.state;
|
|
if (_state && (typeof _state !== "object" || isArray(_state))) {
|
|
error("%s.state: must be set to an object or null", name);
|
|
}
|
|
if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
|
|
error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
|
|
}
|
|
}
|
|
}
|
|
function adoptClassInstance(workInProgress2, instance) {
|
|
instance.updater = classComponentUpdater;
|
|
workInProgress2.stateNode = instance;
|
|
set(instance, workInProgress2);
|
|
{
|
|
instance._reactInternalInstance = fakeInternalInstance;
|
|
}
|
|
}
|
|
function constructClassInstance(workInProgress2, ctor, props) {
|
|
var isLegacyContextConsumer = false;
|
|
var unmaskedContext = emptyContextObject;
|
|
var context = emptyContextObject;
|
|
var contextType = ctor.contextType;
|
|
{
|
|
if ("contextType" in ctor) {
|
|
var isValid = contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0;
|
|
if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
|
|
didWarnAboutInvalidateContextType.add(ctor);
|
|
var addendum = "";
|
|
if (contextType === void 0) {
|
|
addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
|
|
} else if (typeof contextType !== "object") {
|
|
addendum = " However, it is set to a " + typeof contextType + ".";
|
|
} else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
|
|
addendum = " Did you accidentally pass the Context.Provider instead?";
|
|
} else if (contextType._context !== void 0) {
|
|
addendum = " Did you accidentally pass the Context.Consumer instead?";
|
|
} else {
|
|
addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
|
|
}
|
|
error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum);
|
|
}
|
|
}
|
|
}
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
context = readContext(contextType);
|
|
} else {
|
|
unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
var contextTypes = ctor.contextTypes;
|
|
isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
|
|
context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
|
|
}
|
|
var instance = new ctor(props, context);
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
instance = new ctor(props, context);
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
}
|
|
var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
|
|
adoptClassInstance(workInProgress2, instance);
|
|
{
|
|
if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
|
|
var componentName = getComponentNameFromType(ctor) || "Component";
|
|
if (!didWarnAboutUninitializedState.has(componentName)) {
|
|
didWarnAboutUninitializedState.add(componentName);
|
|
error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
|
|
}
|
|
}
|
|
if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
var foundWillMountName = null;
|
|
var foundWillReceivePropsName = null;
|
|
var foundWillUpdateName = null;
|
|
if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
foundWillMountName = "componentWillMount";
|
|
} else if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
foundWillMountName = "UNSAFE_componentWillMount";
|
|
}
|
|
if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
|
foundWillReceivePropsName = "componentWillReceiveProps";
|
|
} else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
|
|
}
|
|
if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
|
foundWillUpdateName = "componentWillUpdate";
|
|
} else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
foundWillUpdateName = "UNSAFE_componentWillUpdate";
|
|
}
|
|
if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
|
var _componentName = getComponentNameFromType(ctor) || "Component";
|
|
var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
|
|
if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
|
|
didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
|
|
error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : "");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isLegacyContextConsumer) {
|
|
cacheContext(workInProgress2, unmaskedContext, context);
|
|
}
|
|
return instance;
|
|
}
|
|
function callComponentWillMount(workInProgress2, instance) {
|
|
var oldState = instance.state;
|
|
if (typeof instance.componentWillMount === "function") {
|
|
instance.componentWillMount();
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
instance.UNSAFE_componentWillMount();
|
|
}
|
|
if (oldState !== instance.state) {
|
|
{
|
|
error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress2) || "Component");
|
|
}
|
|
classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
}
|
|
}
|
|
function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
|
|
var oldState = instance.state;
|
|
if (typeof instance.componentWillReceiveProps === "function") {
|
|
instance.componentWillReceiveProps(newProps, nextContext);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
|
|
instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
|
}
|
|
if (instance.state !== oldState) {
|
|
{
|
|
var componentName = getComponentNameFromFiber(workInProgress2) || "Component";
|
|
if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
|
|
didWarnAboutStateAssignmentForComponent.add(componentName);
|
|
error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
|
|
}
|
|
}
|
|
classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
}
|
|
}
|
|
function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
|
|
{
|
|
checkClassInstance(workInProgress2, ctor, newProps);
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
instance.props = newProps;
|
|
instance.state = workInProgress2.memoizedState;
|
|
instance.refs = emptyRefsObject;
|
|
initializeUpdateQueue(workInProgress2);
|
|
var contextType = ctor.contextType;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
instance.context = readContext(contextType);
|
|
} else {
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
instance.context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
{
|
|
if (instance.state === newProps) {
|
|
var componentName = getComponentNameFromType(ctor) || "Component";
|
|
if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
|
|
didWarnAboutDirectlyAssigningPropsToState.add(componentName);
|
|
error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
|
|
}
|
|
}
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
|
|
}
|
|
{
|
|
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
|
|
}
|
|
}
|
|
instance.state = workInProgress2.memoizedState;
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
instance.state = workInProgress2.memoizedState;
|
|
}
|
|
if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
|
|
callComponentWillMount(workInProgress2, instance);
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
instance.state = workInProgress2.memoizedState;
|
|
}
|
|
if (typeof instance.componentDidMount === "function") {
|
|
var fiberFlags = Update;
|
|
{
|
|
fiberFlags |= LayoutStatic;
|
|
}
|
|
if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
|
|
fiberFlags |= MountLayoutDev;
|
|
}
|
|
workInProgress2.flags |= fiberFlags;
|
|
}
|
|
}
|
|
function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
|
|
var instance = workInProgress2.stateNode;
|
|
var oldProps = workInProgress2.memoizedProps;
|
|
instance.props = oldProps;
|
|
var oldContext = instance.context;
|
|
var contextType = ctor.contextType;
|
|
var nextContext = emptyContextObject;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
nextContext = readContext(contextType);
|
|
} else {
|
|
var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
|
|
}
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
|
|
if (oldProps !== newProps || oldContext !== nextContext) {
|
|
callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
|
|
}
|
|
}
|
|
resetHasForceUpdateBeforeProcessing();
|
|
var oldState = workInProgress2.memoizedState;
|
|
var newState = instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
newState = workInProgress2.memoizedState;
|
|
if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
|
|
if (typeof instance.componentDidMount === "function") {
|
|
var fiberFlags = Update;
|
|
{
|
|
fiberFlags |= LayoutStatic;
|
|
}
|
|
if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
|
|
fiberFlags |= MountLayoutDev;
|
|
}
|
|
workInProgress2.flags |= fiberFlags;
|
|
}
|
|
return false;
|
|
}
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
newState = workInProgress2.memoizedState;
|
|
}
|
|
var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
|
|
if (shouldUpdate) {
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
|
|
if (typeof instance.componentWillMount === "function") {
|
|
instance.componentWillMount();
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillMount === "function") {
|
|
instance.UNSAFE_componentWillMount();
|
|
}
|
|
}
|
|
if (typeof instance.componentDidMount === "function") {
|
|
var _fiberFlags = Update;
|
|
{
|
|
_fiberFlags |= LayoutStatic;
|
|
}
|
|
if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
|
|
_fiberFlags |= MountLayoutDev;
|
|
}
|
|
workInProgress2.flags |= _fiberFlags;
|
|
}
|
|
} else {
|
|
if (typeof instance.componentDidMount === "function") {
|
|
var _fiberFlags2 = Update;
|
|
{
|
|
_fiberFlags2 |= LayoutStatic;
|
|
}
|
|
if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
|
|
_fiberFlags2 |= MountLayoutDev;
|
|
}
|
|
workInProgress2.flags |= _fiberFlags2;
|
|
}
|
|
workInProgress2.memoizedProps = newProps;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
instance.props = newProps;
|
|
instance.state = newState;
|
|
instance.context = nextContext;
|
|
return shouldUpdate;
|
|
}
|
|
function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
|
|
var instance = workInProgress2.stateNode;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
var unresolvedOldProps = workInProgress2.memoizedProps;
|
|
var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
|
|
instance.props = oldProps;
|
|
var unresolvedNewProps = workInProgress2.pendingProps;
|
|
var oldContext = instance.context;
|
|
var contextType = ctor.contextType;
|
|
var nextContext = emptyContextObject;
|
|
if (typeof contextType === "object" && contextType !== null) {
|
|
nextContext = readContext(contextType);
|
|
} else {
|
|
var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
|
|
nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
|
|
}
|
|
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
|
var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
|
|
if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
|
|
callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
|
|
}
|
|
}
|
|
resetHasForceUpdateBeforeProcessing();
|
|
var oldState = workInProgress2.memoizedState;
|
|
var newState = instance.state = oldState;
|
|
processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
|
|
newState = workInProgress2.memoizedState;
|
|
if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) {
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
if (typeof getDerivedStateFromProps === "function") {
|
|
applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
|
|
newState = workInProgress2.memoizedState;
|
|
}
|
|
var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) || enableLazyContextPropagation;
|
|
if (shouldUpdate) {
|
|
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
|
|
if (typeof instance.componentWillUpdate === "function") {
|
|
instance.componentWillUpdate(newProps, newState, nextContext);
|
|
}
|
|
if (typeof instance.UNSAFE_componentWillUpdate === "function") {
|
|
instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
|
|
}
|
|
}
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
} else {
|
|
if (typeof instance.componentDidUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
}
|
|
if (typeof instance.getSnapshotBeforeUpdate === "function") {
|
|
if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
|
|
workInProgress2.flags |= Snapshot;
|
|
}
|
|
}
|
|
workInProgress2.memoizedProps = newProps;
|
|
workInProgress2.memoizedState = newState;
|
|
}
|
|
instance.props = newProps;
|
|
instance.state = newState;
|
|
instance.context = nextContext;
|
|
return shouldUpdate;
|
|
}
|
|
var didWarnAboutMaps;
|
|
var didWarnAboutGenerators;
|
|
var didWarnAboutStringRefs;
|
|
var ownerHasKeyUseWarning;
|
|
var ownerHasFunctionTypeWarning;
|
|
var warnForMissingKey = function(child, returnFiber) {
|
|
};
|
|
{
|
|
didWarnAboutMaps = false;
|
|
didWarnAboutGenerators = false;
|
|
didWarnAboutStringRefs = {};
|
|
ownerHasKeyUseWarning = {};
|
|
ownerHasFunctionTypeWarning = {};
|
|
warnForMissingKey = function(child, returnFiber) {
|
|
if (child === null || typeof child !== "object") {
|
|
return;
|
|
}
|
|
if (!child._store || child._store.validated || child.key != null) {
|
|
return;
|
|
}
|
|
if (typeof child._store !== "object") {
|
|
throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
child._store.validated = true;
|
|
var componentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
if (ownerHasKeyUseWarning[componentName]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[componentName] = true;
|
|
error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
|
|
};
|
|
}
|
|
function coerceRef(returnFiber, current2, element) {
|
|
var mixedRef = element.ref;
|
|
if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
|
|
{
|
|
if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self)) {
|
|
var componentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
{
|
|
error('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', mixedRef);
|
|
}
|
|
didWarnAboutStringRefs[componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
if (element._owner) {
|
|
var owner = element._owner;
|
|
var inst;
|
|
if (owner) {
|
|
var ownerFiber = owner;
|
|
if (ownerFiber.tag !== ClassComponent) {
|
|
throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
|
|
}
|
|
inst = ownerFiber.stateNode;
|
|
}
|
|
if (!inst) {
|
|
throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
var resolvedInst = inst;
|
|
{
|
|
checkPropStringCoercion(mixedRef, "ref");
|
|
}
|
|
var stringRef = "" + mixedRef;
|
|
if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
|
|
return current2.ref;
|
|
}
|
|
var ref = function(value) {
|
|
var refs = resolvedInst.refs;
|
|
if (refs === emptyRefsObject) {
|
|
refs = resolvedInst.refs = {};
|
|
}
|
|
if (value === null) {
|
|
delete refs[stringRef];
|
|
} else {
|
|
refs[stringRef] = value;
|
|
}
|
|
};
|
|
ref._stringRef = stringRef;
|
|
return ref;
|
|
} else {
|
|
if (typeof mixedRef !== "string") {
|
|
throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
|
|
}
|
|
if (!element._owner) {
|
|
throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
|
|
}
|
|
}
|
|
}
|
|
return mixedRef;
|
|
}
|
|
function throwOnInvalidObjectType(returnFiber, newChild) {
|
|
var childString = Object.prototype.toString.call(newChild);
|
|
throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
|
|
}
|
|
function warnOnFunctionType(returnFiber) {
|
|
{
|
|
var componentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
if (ownerHasFunctionTypeWarning[componentName]) {
|
|
return;
|
|
}
|
|
ownerHasFunctionTypeWarning[componentName] = true;
|
|
error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
|
|
}
|
|
}
|
|
function resolveLazy(lazyType) {
|
|
var payload = lazyType._payload;
|
|
var init = lazyType._init;
|
|
return init(payload);
|
|
}
|
|
function ChildReconciler(shouldTrackSideEffects) {
|
|
function deleteChild(returnFiber, childToDelete) {
|
|
if (!shouldTrackSideEffects) {
|
|
return;
|
|
}
|
|
var deletions = returnFiber.deletions;
|
|
if (deletions === null) {
|
|
returnFiber.deletions = [childToDelete];
|
|
returnFiber.flags |= ChildDeletion;
|
|
} else {
|
|
deletions.push(childToDelete);
|
|
}
|
|
}
|
|
function deleteRemainingChildren(returnFiber, currentFirstChild) {
|
|
if (!shouldTrackSideEffects) {
|
|
return null;
|
|
}
|
|
var childToDelete = currentFirstChild;
|
|
while (childToDelete !== null) {
|
|
deleteChild(returnFiber, childToDelete);
|
|
childToDelete = childToDelete.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
function mapRemainingChildren(returnFiber, currentFirstChild) {
|
|
var existingChildren = /* @__PURE__ */ new Map();
|
|
var existingChild = currentFirstChild;
|
|
while (existingChild !== null) {
|
|
if (existingChild.key !== null) {
|
|
existingChildren.set(existingChild.key, existingChild);
|
|
} else {
|
|
existingChildren.set(existingChild.index, existingChild);
|
|
}
|
|
existingChild = existingChild.sibling;
|
|
}
|
|
return existingChildren;
|
|
}
|
|
function useFiber(fiber, pendingProps) {
|
|
var clone = createWorkInProgress(fiber, pendingProps);
|
|
clone.index = 0;
|
|
clone.sibling = null;
|
|
return clone;
|
|
}
|
|
function placeChild(newFiber, lastPlacedIndex, newIndex) {
|
|
newFiber.index = newIndex;
|
|
if (!shouldTrackSideEffects) {
|
|
newFiber.flags |= Forked;
|
|
return lastPlacedIndex;
|
|
}
|
|
var current2 = newFiber.alternate;
|
|
if (current2 !== null) {
|
|
var oldIndex = current2.index;
|
|
if (oldIndex < lastPlacedIndex) {
|
|
newFiber.flags |= Placement;
|
|
return lastPlacedIndex;
|
|
} else {
|
|
return oldIndex;
|
|
}
|
|
} else {
|
|
newFiber.flags |= Placement;
|
|
return lastPlacedIndex;
|
|
}
|
|
}
|
|
function placeSingleChild(newFiber) {
|
|
if (shouldTrackSideEffects && newFiber.alternate === null) {
|
|
newFiber.flags |= Placement;
|
|
}
|
|
return newFiber;
|
|
}
|
|
function updateTextNode(returnFiber, current2, textContent, lanes) {
|
|
if (current2 === null || current2.tag !== HostText) {
|
|
var created = createFiberFromText(textContent, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, textContent);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function updateElement(returnFiber, current2, element, lanes) {
|
|
var elementType = element.type;
|
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
return updateFragment2(returnFiber, current2, element.props.children, lanes, element.key);
|
|
}
|
|
if (current2 !== null) {
|
|
if (current2.elementType === elementType || isCompatibleFamilyForHotReloading(current2, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
|
|
var existing = useFiber(current2, element.props);
|
|
existing.ref = coerceRef(returnFiber, current2, element);
|
|
existing.return = returnFiber;
|
|
{
|
|
existing._debugSource = element._source;
|
|
existing._debugOwner = element._owner;
|
|
}
|
|
return existing;
|
|
}
|
|
}
|
|
var created = createFiberFromElement(element, returnFiber.mode, lanes);
|
|
created.ref = coerceRef(returnFiber, current2, element);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function updatePortal(returnFiber, current2, portal, lanes) {
|
|
if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
|
|
var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, portal.children || []);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
|
if (current2 === null || current2.tag !== Fragment6) {
|
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var existing = useFiber(current2, fragment);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
}
|
|
function createChild(returnFiber, newChild, lanes) {
|
|
if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
|
|
var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
|
|
_created.ref = coerceRef(returnFiber, null, newChild);
|
|
_created.return = returnFiber;
|
|
return _created;
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
|
|
_created2.return = returnFiber;
|
|
return _created2;
|
|
}
|
|
case REACT_LAZY_TYPE: {
|
|
var payload = newChild._payload;
|
|
var init = newChild._init;
|
|
return createChild(returnFiber, init(payload), lanes);
|
|
}
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild)) {
|
|
var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
|
|
_created3.return = returnFiber;
|
|
return _created3;
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function updateSlot(returnFiber, oldFiber, newChild, lanes) {
|
|
var key = oldFiber !== null ? oldFiber.key : null;
|
|
if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
|
|
if (key !== null) {
|
|
return null;
|
|
}
|
|
return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
if (newChild.key === key) {
|
|
return updateElement(returnFiber, oldFiber, newChild, lanes);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
if (newChild.key === key) {
|
|
return updatePortal(returnFiber, oldFiber, newChild, lanes);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
case REACT_LAZY_TYPE: {
|
|
var payload = newChild._payload;
|
|
var init = newChild._init;
|
|
return updateSlot(returnFiber, oldFiber, init(payload), lanes);
|
|
}
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild)) {
|
|
if (key !== null) {
|
|
return null;
|
|
}
|
|
return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
|
|
if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
|
|
var matchedFiber = existingChildren.get(newIdx) || null;
|
|
return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE: {
|
|
var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
|
return updateElement(returnFiber, _matchedFiber, newChild, lanes);
|
|
}
|
|
case REACT_PORTAL_TYPE: {
|
|
var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
|
return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
|
|
}
|
|
case REACT_LAZY_TYPE:
|
|
var payload = newChild._payload;
|
|
var init = newChild._init;
|
|
return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
|
|
}
|
|
if (isArray(newChild) || getIteratorFn(newChild)) {
|
|
var _matchedFiber3 = existingChildren.get(newIdx) || null;
|
|
return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function warnOnInvalidKey(child, knownKeys, returnFiber) {
|
|
{
|
|
if (typeof child !== "object" || child === null) {
|
|
return knownKeys;
|
|
}
|
|
switch (child.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
case REACT_PORTAL_TYPE:
|
|
warnForMissingKey(child, returnFiber);
|
|
var key = child.key;
|
|
if (typeof key !== "string") {
|
|
break;
|
|
}
|
|
if (knownKeys === null) {
|
|
knownKeys = /* @__PURE__ */ new Set();
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
if (!knownKeys.has(key)) {
|
|
knownKeys.add(key);
|
|
break;
|
|
}
|
|
error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key);
|
|
break;
|
|
case REACT_LAZY_TYPE:
|
|
var payload = child._payload;
|
|
var init = child._init;
|
|
warnOnInvalidKey(init(payload), knownKeys, returnFiber);
|
|
break;
|
|
}
|
|
}
|
|
return knownKeys;
|
|
}
|
|
function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
|
|
{
|
|
var knownKeys = null;
|
|
for (var i2 = 0; i2 < newChildren.length; i2++) {
|
|
var child = newChildren[i2];
|
|
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
}
|
|
}
|
|
var resultingFirstChild = null;
|
|
var previousNewFiber = null;
|
|
var oldFiber = currentFirstChild;
|
|
var lastPlacedIndex = 0;
|
|
var newIdx = 0;
|
|
var nextOldFiber = null;
|
|
for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
|
|
if (oldFiber.index > newIdx) {
|
|
nextOldFiber = oldFiber;
|
|
oldFiber = null;
|
|
} else {
|
|
nextOldFiber = oldFiber.sibling;
|
|
}
|
|
var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
|
|
if (newFiber === null) {
|
|
if (oldFiber === null) {
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
break;
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
if (oldFiber && newFiber.alternate === null) {
|
|
deleteChild(returnFiber, oldFiber);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = newFiber;
|
|
}
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (newIdx === newChildren.length) {
|
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
if (getIsHydrating()) {
|
|
var numberOfForks = newIdx;
|
|
pushTreeFork(returnFiber, numberOfForks);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
if (oldFiber === null) {
|
|
for (; newIdx < newChildren.length; newIdx++) {
|
|
var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
|
|
if (_newFiber === null) {
|
|
continue;
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber;
|
|
}
|
|
previousNewFiber = _newFiber;
|
|
}
|
|
if (getIsHydrating()) {
|
|
var _numberOfForks = newIdx;
|
|
pushTreeFork(returnFiber, _numberOfForks);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
|
for (; newIdx < newChildren.length; newIdx++) {
|
|
var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
|
|
if (_newFiber2 !== null) {
|
|
if (shouldTrackSideEffects) {
|
|
if (_newFiber2.alternate !== null) {
|
|
existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber2;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber2;
|
|
}
|
|
previousNewFiber = _newFiber2;
|
|
}
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
existingChildren.forEach(function(child2) {
|
|
return deleteChild(returnFiber, child2);
|
|
});
|
|
}
|
|
if (getIsHydrating()) {
|
|
var _numberOfForks2 = newIdx;
|
|
pushTreeFork(returnFiber, _numberOfForks2);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
|
|
var iteratorFn = getIteratorFn(newChildrenIterable);
|
|
if (typeof iteratorFn !== "function") {
|
|
throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
{
|
|
if (typeof Symbol === "function" && newChildrenIterable[Symbol.toStringTag] === "Generator") {
|
|
if (!didWarnAboutGenerators) {
|
|
error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
|
|
}
|
|
didWarnAboutGenerators = true;
|
|
}
|
|
if (newChildrenIterable.entries === iteratorFn) {
|
|
if (!didWarnAboutMaps) {
|
|
error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
}
|
|
didWarnAboutMaps = true;
|
|
}
|
|
var _newChildren = iteratorFn.call(newChildrenIterable);
|
|
if (_newChildren) {
|
|
var knownKeys = null;
|
|
var _step = _newChildren.next();
|
|
for (; !_step.done; _step = _newChildren.next()) {
|
|
var child = _step.value;
|
|
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
}
|
|
}
|
|
}
|
|
var newChildren = iteratorFn.call(newChildrenIterable);
|
|
if (newChildren == null) {
|
|
throw new Error("An iterable object provided no iterator.");
|
|
}
|
|
var resultingFirstChild = null;
|
|
var previousNewFiber = null;
|
|
var oldFiber = currentFirstChild;
|
|
var lastPlacedIndex = 0;
|
|
var newIdx = 0;
|
|
var nextOldFiber = null;
|
|
var step = newChildren.next();
|
|
for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
|
|
if (oldFiber.index > newIdx) {
|
|
nextOldFiber = oldFiber;
|
|
oldFiber = null;
|
|
} else {
|
|
nextOldFiber = oldFiber.sibling;
|
|
}
|
|
var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
|
|
if (newFiber === null) {
|
|
if (oldFiber === null) {
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
break;
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
if (oldFiber && newFiber.alternate === null) {
|
|
deleteChild(returnFiber, oldFiber);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = newFiber;
|
|
} else {
|
|
previousNewFiber.sibling = newFiber;
|
|
}
|
|
previousNewFiber = newFiber;
|
|
oldFiber = nextOldFiber;
|
|
}
|
|
if (step.done) {
|
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
if (getIsHydrating()) {
|
|
var numberOfForks = newIdx;
|
|
pushTreeFork(returnFiber, numberOfForks);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
if (oldFiber === null) {
|
|
for (; !step.done; newIdx++, step = newChildren.next()) {
|
|
var _newFiber3 = createChild(returnFiber, step.value, lanes);
|
|
if (_newFiber3 === null) {
|
|
continue;
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber3;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber3;
|
|
}
|
|
previousNewFiber = _newFiber3;
|
|
}
|
|
if (getIsHydrating()) {
|
|
var _numberOfForks3 = newIdx;
|
|
pushTreeFork(returnFiber, _numberOfForks3);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
|
for (; !step.done; newIdx++, step = newChildren.next()) {
|
|
var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
|
|
if (_newFiber4 !== null) {
|
|
if (shouldTrackSideEffects) {
|
|
if (_newFiber4.alternate !== null) {
|
|
existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
|
|
}
|
|
}
|
|
lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
|
|
if (previousNewFiber === null) {
|
|
resultingFirstChild = _newFiber4;
|
|
} else {
|
|
previousNewFiber.sibling = _newFiber4;
|
|
}
|
|
previousNewFiber = _newFiber4;
|
|
}
|
|
}
|
|
if (shouldTrackSideEffects) {
|
|
existingChildren.forEach(function(child2) {
|
|
return deleteChild(returnFiber, child2);
|
|
});
|
|
}
|
|
if (getIsHydrating()) {
|
|
var _numberOfForks4 = newIdx;
|
|
pushTreeFork(returnFiber, _numberOfForks4);
|
|
}
|
|
return resultingFirstChild;
|
|
}
|
|
function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
|
|
if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
|
|
deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
|
|
var existing = useFiber(currentFirstChild, textContent);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
}
|
|
deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
var created = createFiberFromText(textContent, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
|
|
var key = element.key;
|
|
var child = currentFirstChild;
|
|
while (child !== null) {
|
|
if (child.key === key) {
|
|
var elementType = element.type;
|
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
if (child.tag === Fragment6) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var existing = useFiber(child, element.props.children);
|
|
existing.return = returnFiber;
|
|
{
|
|
existing._debugSource = element._source;
|
|
existing._debugOwner = element._owner;
|
|
}
|
|
return existing;
|
|
}
|
|
} else {
|
|
if (child.elementType === elementType || isCompatibleFamilyForHotReloading(child, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var _existing = useFiber(child, element.props);
|
|
_existing.ref = coerceRef(returnFiber, child, element);
|
|
_existing.return = returnFiber;
|
|
{
|
|
_existing._debugSource = element._source;
|
|
_existing._debugOwner = element._owner;
|
|
}
|
|
return _existing;
|
|
}
|
|
}
|
|
deleteRemainingChildren(returnFiber, child);
|
|
break;
|
|
} else {
|
|
deleteChild(returnFiber, child);
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
if (element.type === REACT_FRAGMENT_TYPE) {
|
|
var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
|
|
created.return = returnFiber;
|
|
return created;
|
|
} else {
|
|
var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
|
|
_created4.ref = coerceRef(returnFiber, currentFirstChild, element);
|
|
_created4.return = returnFiber;
|
|
return _created4;
|
|
}
|
|
}
|
|
function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
|
|
var key = portal.key;
|
|
var child = currentFirstChild;
|
|
while (child !== null) {
|
|
if (child.key === key) {
|
|
if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
|
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
var existing = useFiber(child, portal.children || []);
|
|
existing.return = returnFiber;
|
|
return existing;
|
|
} else {
|
|
deleteRemainingChildren(returnFiber, child);
|
|
break;
|
|
}
|
|
} else {
|
|
deleteChild(returnFiber, child);
|
|
}
|
|
child = child.sibling;
|
|
}
|
|
var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
|
|
created.return = returnFiber;
|
|
return created;
|
|
}
|
|
function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
|
|
var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
|
|
if (isUnkeyedTopLevelFragment) {
|
|
newChild = newChild.props.children;
|
|
}
|
|
if (typeof newChild === "object" && newChild !== null) {
|
|
switch (newChild.$$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
|
|
case REACT_PORTAL_TYPE:
|
|
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
|
|
case REACT_LAZY_TYPE:
|
|
var payload = newChild._payload;
|
|
var init = newChild._init;
|
|
return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
|
|
}
|
|
if (isArray(newChild)) {
|
|
return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
|
|
}
|
|
if (getIteratorFn(newChild)) {
|
|
return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
|
|
}
|
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
}
|
|
if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
|
|
return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
|
|
}
|
|
{
|
|
if (typeof newChild === "function") {
|
|
warnOnFunctionType(returnFiber);
|
|
}
|
|
}
|
|
return deleteRemainingChildren(returnFiber, currentFirstChild);
|
|
}
|
|
return reconcileChildFibers2;
|
|
}
|
|
var reconcileChildFibers = ChildReconciler(true);
|
|
var mountChildFibers = ChildReconciler(false);
|
|
function cloneChildFibers(current2, workInProgress2) {
|
|
if (current2 !== null && workInProgress2.child !== current2.child) {
|
|
throw new Error("Resuming work not yet implemented.");
|
|
}
|
|
if (workInProgress2.child === null) {
|
|
return;
|
|
}
|
|
var currentChild = workInProgress2.child;
|
|
var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
|
|
workInProgress2.child = newChild;
|
|
newChild.return = workInProgress2;
|
|
while (currentChild.sibling !== null) {
|
|
currentChild = currentChild.sibling;
|
|
newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
|
|
newChild.return = workInProgress2;
|
|
}
|
|
newChild.sibling = null;
|
|
}
|
|
function resetChildFibers(workInProgress2, lanes) {
|
|
var child = workInProgress2.child;
|
|
while (child !== null) {
|
|
resetWorkInProgress(child, lanes);
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
var NO_CONTEXT = {};
|
|
var contextStackCursor$1 = createCursor(NO_CONTEXT);
|
|
var contextFiberStackCursor = createCursor(NO_CONTEXT);
|
|
var rootInstanceStackCursor = createCursor(NO_CONTEXT);
|
|
function requiredContext(c2) {
|
|
if (c2 === NO_CONTEXT) {
|
|
throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
return c2;
|
|
}
|
|
function getRootHostContainer() {
|
|
var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
|
return rootInstance;
|
|
}
|
|
function pushHostContainer(fiber, nextRootInstance) {
|
|
push(rootInstanceStackCursor, nextRootInstance, fiber);
|
|
push(contextFiberStackCursor, fiber, fiber);
|
|
push(contextStackCursor$1, NO_CONTEXT, fiber);
|
|
var nextRootContext = getRootHostContext(nextRootInstance);
|
|
pop(contextStackCursor$1, fiber);
|
|
push(contextStackCursor$1, nextRootContext, fiber);
|
|
}
|
|
function popHostContainer(fiber) {
|
|
pop(contextStackCursor$1, fiber);
|
|
pop(contextFiberStackCursor, fiber);
|
|
pop(rootInstanceStackCursor, fiber);
|
|
}
|
|
function getHostContext() {
|
|
var context = requiredContext(contextStackCursor$1.current);
|
|
return context;
|
|
}
|
|
function pushHostContext(fiber) {
|
|
var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
|
var context = requiredContext(contextStackCursor$1.current);
|
|
var nextContext = getChildHostContext(context, fiber.type);
|
|
if (context === nextContext) {
|
|
return;
|
|
}
|
|
push(contextFiberStackCursor, fiber, fiber);
|
|
push(contextStackCursor$1, nextContext, fiber);
|
|
}
|
|
function popHostContext(fiber) {
|
|
if (contextFiberStackCursor.current !== fiber) {
|
|
return;
|
|
}
|
|
pop(contextStackCursor$1, fiber);
|
|
pop(contextFiberStackCursor, fiber);
|
|
}
|
|
var DefaultSuspenseContext = 0;
|
|
var SubtreeSuspenseContextMask = 1;
|
|
var InvisibleParentSuspenseContext = 1;
|
|
var ForceSuspenseFallback = 2;
|
|
var suspenseStackCursor = createCursor(DefaultSuspenseContext);
|
|
function hasSuspenseContext(parentContext, flag) {
|
|
return (parentContext & flag) !== 0;
|
|
}
|
|
function setDefaultShallowSuspenseContext(parentContext) {
|
|
return parentContext & SubtreeSuspenseContextMask;
|
|
}
|
|
function setShallowSuspenseContext(parentContext, shallowContext) {
|
|
return parentContext & SubtreeSuspenseContextMask | shallowContext;
|
|
}
|
|
function addSubtreeSuspenseContext(parentContext, subtreeContext) {
|
|
return parentContext | subtreeContext;
|
|
}
|
|
function pushSuspenseContext(fiber, newContext) {
|
|
push(suspenseStackCursor, newContext, fiber);
|
|
}
|
|
function popSuspenseContext(fiber) {
|
|
pop(suspenseStackCursor, fiber);
|
|
}
|
|
function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
|
|
var nextState = workInProgress2.memoizedState;
|
|
if (nextState !== null) {
|
|
if (nextState.dehydrated !== null) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
var props = workInProgress2.memoizedProps;
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
function findFirstSuspended(row) {
|
|
var node = row;
|
|
while (node !== null) {
|
|
if (node.tag === SuspenseComponent) {
|
|
var state = node.memoizedState;
|
|
if (state !== null) {
|
|
var dehydrated = state.dehydrated;
|
|
if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
|
|
return node;
|
|
}
|
|
}
|
|
} else if (node.tag === SuspenseListComponent && node.memoizedProps.revealOrder !== void 0) {
|
|
var didSuspend = (node.flags & DidCapture) !== NoFlags;
|
|
if (didSuspend) {
|
|
return node;
|
|
}
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === row) {
|
|
return null;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === row) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return null;
|
|
}
|
|
var NoFlags$1 = 0;
|
|
var HasEffect = 1;
|
|
var Insertion = 2;
|
|
var Layout = 4;
|
|
var Passive$1 = 8;
|
|
var workInProgressSources = [];
|
|
function resetWorkInProgressVersions() {
|
|
for (var i2 = 0; i2 < workInProgressSources.length; i2++) {
|
|
var mutableSource = workInProgressSources[i2];
|
|
{
|
|
mutableSource._workInProgressVersionPrimary = null;
|
|
}
|
|
}
|
|
workInProgressSources.length = 0;
|
|
}
|
|
function registerMutableSourceForHydration(root2, mutableSource) {
|
|
var getVersion = mutableSource._getVersion;
|
|
var version = getVersion(mutableSource._source);
|
|
if (root2.mutableSourceEagerHydrationData == null) {
|
|
root2.mutableSourceEagerHydrationData = [mutableSource, version];
|
|
} else {
|
|
root2.mutableSourceEagerHydrationData.push(mutableSource, version);
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
var didWarnAboutMismatchedHooksForComponent;
|
|
var didWarnUncachedGetSnapshot;
|
|
{
|
|
didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
|
|
}
|
|
var renderLanes = NoLanes;
|
|
var currentlyRenderingFiber$1 = null;
|
|
var currentHook = null;
|
|
var workInProgressHook = null;
|
|
var didScheduleRenderPhaseUpdate = false;
|
|
var didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
var localIdCounter = 0;
|
|
var globalClientIdCounter = 0;
|
|
var RE_RENDER_LIMIT = 25;
|
|
var currentHookNameInDev = null;
|
|
var hookTypesDev = null;
|
|
var hookTypesUpdateIndexDev = -1;
|
|
var ignorePreviousDependencies = false;
|
|
function mountHookTypesDev() {
|
|
{
|
|
var hookName = currentHookNameInDev;
|
|
if (hookTypesDev === null) {
|
|
hookTypesDev = [hookName];
|
|
} else {
|
|
hookTypesDev.push(hookName);
|
|
}
|
|
}
|
|
}
|
|
function updateHookTypesDev() {
|
|
{
|
|
var hookName = currentHookNameInDev;
|
|
if (hookTypesDev !== null) {
|
|
hookTypesUpdateIndexDev++;
|
|
if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
|
|
warnOnHookMismatchInDev(hookName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function checkDepsAreArrayDev(deps) {
|
|
{
|
|
if (deps !== void 0 && deps !== null && !isArray(deps)) {
|
|
error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
|
|
}
|
|
}
|
|
}
|
|
function warnOnHookMismatchInDev(currentHookName) {
|
|
{
|
|
var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
|
|
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
|
|
didWarnAboutMismatchedHooksForComponent.add(componentName);
|
|
if (hookTypesDev !== null) {
|
|
var table = "";
|
|
var secondColumnStart = 30;
|
|
for (var i2 = 0; i2 <= hookTypesUpdateIndexDev; i2++) {
|
|
var oldHookName = hookTypesDev[i2];
|
|
var newHookName = i2 === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
|
|
var row = i2 + 1 + ". " + oldHookName;
|
|
while (row.length < secondColumnStart) {
|
|
row += " ";
|
|
}
|
|
row += newHookName + "\n";
|
|
table += row;
|
|
}
|
|
error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function throwInvalidHookError() {
|
|
throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
}
|
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
{
|
|
if (ignorePreviousDependencies) {
|
|
return false;
|
|
}
|
|
}
|
|
if (prevDeps === null) {
|
|
{
|
|
error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
|
|
}
|
|
return false;
|
|
}
|
|
{
|
|
if (nextDeps.length !== prevDeps.length) {
|
|
error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
|
|
}
|
|
}
|
|
for (var i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++) {
|
|
if (objectIs(nextDeps[i2], prevDeps[i2])) {
|
|
continue;
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) {
|
|
renderLanes = nextRenderLanes;
|
|
currentlyRenderingFiber$1 = workInProgress2;
|
|
{
|
|
hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
|
|
}
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
workInProgress2.lanes = NoLanes;
|
|
{
|
|
if (current2 !== null && current2.memoizedState !== null) {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
} else if (hookTypesDev !== null) {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
|
|
} else {
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
|
|
}
|
|
}
|
|
var children = Component(props, secondArg);
|
|
if (didScheduleRenderPhaseUpdateDuringThisPass) {
|
|
var numberOfReRenders = 0;
|
|
do {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
localIdCounter = 0;
|
|
if (numberOfReRenders >= RE_RENDER_LIMIT) {
|
|
throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
|
|
}
|
|
numberOfReRenders += 1;
|
|
{
|
|
ignorePreviousDependencies = false;
|
|
}
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
workInProgress2.updateQueue = null;
|
|
{
|
|
hookTypesUpdateIndexDev = -1;
|
|
}
|
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
|
|
children = Component(props, secondArg);
|
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
}
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
{
|
|
workInProgress2._debugHookTypes = hookTypesDev;
|
|
}
|
|
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
|
|
renderLanes = NoLanes;
|
|
currentlyRenderingFiber$1 = null;
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
{
|
|
currentHookNameInDev = null;
|
|
hookTypesDev = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && (current2.mode & ConcurrentMode) !== NoMode) {
|
|
error("Internal React error: Expected static flag was missing. Please notify the React team.");
|
|
}
|
|
}
|
|
didScheduleRenderPhaseUpdate = false;
|
|
if (didRenderTooFewHooks) {
|
|
throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
|
|
}
|
|
return children;
|
|
}
|
|
function checkDidRenderIdHook() {
|
|
var didRenderIdHook = localIdCounter !== 0;
|
|
localIdCounter = 0;
|
|
return didRenderIdHook;
|
|
}
|
|
function bailoutHooks(current2, workInProgress2, lanes) {
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
|
|
workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
|
|
} else {
|
|
workInProgress2.flags &= ~(Passive | Update);
|
|
}
|
|
current2.lanes = removeLanes(current2.lanes, lanes);
|
|
}
|
|
function resetHooksAfterThrow() {
|
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
if (didScheduleRenderPhaseUpdate) {
|
|
var hook = currentlyRenderingFiber$1.memoizedState;
|
|
while (hook !== null) {
|
|
var queue = hook.queue;
|
|
if (queue !== null) {
|
|
queue.pending = null;
|
|
}
|
|
hook = hook.next;
|
|
}
|
|
didScheduleRenderPhaseUpdate = false;
|
|
}
|
|
renderLanes = NoLanes;
|
|
currentlyRenderingFiber$1 = null;
|
|
currentHook = null;
|
|
workInProgressHook = null;
|
|
{
|
|
hookTypesDev = null;
|
|
hookTypesUpdateIndexDev = -1;
|
|
currentHookNameInDev = null;
|
|
isUpdatingOpaqueValueInRenderPhase = false;
|
|
}
|
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
localIdCounter = 0;
|
|
}
|
|
function mountWorkInProgressHook() {
|
|
var hook = {
|
|
memoizedState: null,
|
|
baseState: null,
|
|
baseQueue: null,
|
|
queue: null,
|
|
next: null
|
|
};
|
|
if (workInProgressHook === null) {
|
|
currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
|
|
} else {
|
|
workInProgressHook = workInProgressHook.next = hook;
|
|
}
|
|
return workInProgressHook;
|
|
}
|
|
function updateWorkInProgressHook() {
|
|
var nextCurrentHook;
|
|
if (currentHook === null) {
|
|
var current2 = currentlyRenderingFiber$1.alternate;
|
|
if (current2 !== null) {
|
|
nextCurrentHook = current2.memoizedState;
|
|
} else {
|
|
nextCurrentHook = null;
|
|
}
|
|
} else {
|
|
nextCurrentHook = currentHook.next;
|
|
}
|
|
var nextWorkInProgressHook;
|
|
if (workInProgressHook === null) {
|
|
nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
|
|
} else {
|
|
nextWorkInProgressHook = workInProgressHook.next;
|
|
}
|
|
if (nextWorkInProgressHook !== null) {
|
|
workInProgressHook = nextWorkInProgressHook;
|
|
nextWorkInProgressHook = workInProgressHook.next;
|
|
currentHook = nextCurrentHook;
|
|
} else {
|
|
if (nextCurrentHook === null) {
|
|
throw new Error("Rendered more hooks than during the previous render.");
|
|
}
|
|
currentHook = nextCurrentHook;
|
|
var newHook = {
|
|
memoizedState: currentHook.memoizedState,
|
|
baseState: currentHook.baseState,
|
|
baseQueue: currentHook.baseQueue,
|
|
queue: currentHook.queue,
|
|
next: null
|
|
};
|
|
if (workInProgressHook === null) {
|
|
currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
|
|
} else {
|
|
workInProgressHook = workInProgressHook.next = newHook;
|
|
}
|
|
}
|
|
return workInProgressHook;
|
|
}
|
|
function createFunctionComponentUpdateQueue() {
|
|
return {
|
|
lastEffect: null,
|
|
stores: null
|
|
};
|
|
}
|
|
function basicStateReducer(state, action) {
|
|
return typeof action === "function" ? action(state) : action;
|
|
}
|
|
function mountReducer(reducer, initialArg, init) {
|
|
var hook = mountWorkInProgressHook();
|
|
var initialState3;
|
|
if (init !== void 0) {
|
|
initialState3 = init(initialArg);
|
|
} else {
|
|
initialState3 = initialArg;
|
|
}
|
|
hook.memoizedState = hook.baseState = initialState3;
|
|
var queue = {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: NoLanes,
|
|
dispatch: null,
|
|
lastRenderedReducer: reducer,
|
|
lastRenderedState: initialState3
|
|
};
|
|
hook.queue = queue;
|
|
var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function updateReducer(reducer, initialArg, init) {
|
|
var hook = updateWorkInProgressHook();
|
|
var queue = hook.queue;
|
|
if (queue === null) {
|
|
throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
queue.lastRenderedReducer = reducer;
|
|
var current2 = currentHook;
|
|
var baseQueue = current2.baseQueue;
|
|
var pendingQueue = queue.pending;
|
|
if (pendingQueue !== null) {
|
|
if (baseQueue !== null) {
|
|
var baseFirst = baseQueue.next;
|
|
var pendingFirst = pendingQueue.next;
|
|
baseQueue.next = pendingFirst;
|
|
pendingQueue.next = baseFirst;
|
|
}
|
|
{
|
|
if (current2.baseQueue !== baseQueue) {
|
|
error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
|
|
}
|
|
}
|
|
current2.baseQueue = baseQueue = pendingQueue;
|
|
queue.pending = null;
|
|
}
|
|
if (baseQueue !== null) {
|
|
var first = baseQueue.next;
|
|
var newState = current2.baseState;
|
|
var newBaseState = null;
|
|
var newBaseQueueFirst = null;
|
|
var newBaseQueueLast = null;
|
|
var update = first;
|
|
do {
|
|
var updateLane = update.lane;
|
|
if (!isSubsetOfLanes(renderLanes, updateLane)) {
|
|
var clone = {
|
|
lane: updateLane,
|
|
action: update.action,
|
|
hasEagerState: update.hasEagerState,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
};
|
|
if (newBaseQueueLast === null) {
|
|
newBaseQueueFirst = newBaseQueueLast = clone;
|
|
newBaseState = newState;
|
|
} else {
|
|
newBaseQueueLast = newBaseQueueLast.next = clone;
|
|
}
|
|
currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
|
|
markSkippedUpdateLanes(updateLane);
|
|
} else {
|
|
if (newBaseQueueLast !== null) {
|
|
var _clone = {
|
|
lane: NoLane,
|
|
action: update.action,
|
|
hasEagerState: update.hasEagerState,
|
|
eagerState: update.eagerState,
|
|
next: null
|
|
};
|
|
newBaseQueueLast = newBaseQueueLast.next = _clone;
|
|
}
|
|
if (update.hasEagerState) {
|
|
newState = update.eagerState;
|
|
} else {
|
|
var action = update.action;
|
|
newState = reducer(newState, action);
|
|
}
|
|
}
|
|
update = update.next;
|
|
} while (update !== null && update !== first);
|
|
if (newBaseQueueLast === null) {
|
|
newBaseState = newState;
|
|
} else {
|
|
newBaseQueueLast.next = newBaseQueueFirst;
|
|
}
|
|
if (!objectIs(newState, hook.memoizedState)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newBaseState;
|
|
hook.baseQueue = newBaseQueueLast;
|
|
queue.lastRenderedState = newState;
|
|
}
|
|
var lastInterleaved = queue.interleaved;
|
|
if (lastInterleaved !== null) {
|
|
var interleaved = lastInterleaved;
|
|
do {
|
|
var interleavedLane = interleaved.lane;
|
|
currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
|
|
markSkippedUpdateLanes(interleavedLane);
|
|
interleaved = interleaved.next;
|
|
} while (interleaved !== lastInterleaved);
|
|
} else if (baseQueue === null) {
|
|
queue.lanes = NoLanes;
|
|
}
|
|
var dispatch = queue.dispatch;
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function rerenderReducer(reducer, initialArg, init) {
|
|
var hook = updateWorkInProgressHook();
|
|
var queue = hook.queue;
|
|
if (queue === null) {
|
|
throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
queue.lastRenderedReducer = reducer;
|
|
var dispatch = queue.dispatch;
|
|
var lastRenderPhaseUpdate = queue.pending;
|
|
var newState = hook.memoizedState;
|
|
if (lastRenderPhaseUpdate !== null) {
|
|
queue.pending = null;
|
|
var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
|
var update = firstRenderPhaseUpdate;
|
|
do {
|
|
var action = update.action;
|
|
newState = reducer(newState, action);
|
|
update = update.next;
|
|
} while (update !== firstRenderPhaseUpdate);
|
|
if (!objectIs(newState, hook.memoizedState)) {
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
hook.memoizedState = newState;
|
|
if (hook.baseQueue === null) {
|
|
hook.baseState = newState;
|
|
}
|
|
queue.lastRenderedState = newState;
|
|
}
|
|
return [newState, dispatch];
|
|
}
|
|
function mountMutableSource(source, getSnapshot, subscribe) {
|
|
{
|
|
return void 0;
|
|
}
|
|
}
|
|
function updateMutableSource(source, getSnapshot, subscribe) {
|
|
{
|
|
return void 0;
|
|
}
|
|
}
|
|
function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
var fiber = currentlyRenderingFiber$1;
|
|
var hook = mountWorkInProgressHook();
|
|
var nextSnapshot;
|
|
var isHydrating2 = getIsHydrating();
|
|
if (isHydrating2) {
|
|
if (getServerSnapshot === void 0) {
|
|
throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
|
|
}
|
|
nextSnapshot = getServerSnapshot();
|
|
{
|
|
if (!didWarnUncachedGetSnapshot) {
|
|
if (nextSnapshot !== getServerSnapshot()) {
|
|
error("The result of getServerSnapshot should be cached to avoid an infinite loop");
|
|
didWarnUncachedGetSnapshot = true;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
nextSnapshot = getSnapshot();
|
|
{
|
|
if (!didWarnUncachedGetSnapshot) {
|
|
var cachedSnapshot = getSnapshot();
|
|
if (!objectIs(nextSnapshot, cachedSnapshot)) {
|
|
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
didWarnUncachedGetSnapshot = true;
|
|
}
|
|
}
|
|
}
|
|
var root2 = getWorkInProgressRoot();
|
|
if (root2 === null) {
|
|
throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
|
|
}
|
|
if (!includesBlockingLane(root2, renderLanes)) {
|
|
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
|
|
}
|
|
}
|
|
hook.memoizedState = nextSnapshot;
|
|
var inst = {
|
|
value: nextSnapshot,
|
|
getSnapshot
|
|
};
|
|
hook.queue = inst;
|
|
mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
|
|
fiber.flags |= Passive;
|
|
pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
|
|
return nextSnapshot;
|
|
}
|
|
function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
var fiber = currentlyRenderingFiber$1;
|
|
var hook = updateWorkInProgressHook();
|
|
var nextSnapshot = getSnapshot();
|
|
{
|
|
if (!didWarnUncachedGetSnapshot) {
|
|
var cachedSnapshot = getSnapshot();
|
|
if (!objectIs(nextSnapshot, cachedSnapshot)) {
|
|
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
didWarnUncachedGetSnapshot = true;
|
|
}
|
|
}
|
|
}
|
|
var prevSnapshot = hook.memoizedState;
|
|
var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
|
|
if (snapshotChanged) {
|
|
hook.memoizedState = nextSnapshot;
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
var inst = hook.queue;
|
|
updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
|
|
if (inst.getSnapshot !== getSnapshot || snapshotChanged || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
|
|
fiber.flags |= Passive;
|
|
pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
|
|
var root2 = getWorkInProgressRoot();
|
|
if (root2 === null) {
|
|
throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
|
|
}
|
|
if (!includesBlockingLane(root2, renderLanes)) {
|
|
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
|
|
}
|
|
}
|
|
return nextSnapshot;
|
|
}
|
|
function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
|
|
fiber.flags |= StoreConsistency;
|
|
var check = {
|
|
getSnapshot,
|
|
value: renderedSnapshot
|
|
};
|
|
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
|
|
if (componentUpdateQueue === null) {
|
|
componentUpdateQueue = createFunctionComponentUpdateQueue();
|
|
currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
|
|
componentUpdateQueue.stores = [check];
|
|
} else {
|
|
var stores = componentUpdateQueue.stores;
|
|
if (stores === null) {
|
|
componentUpdateQueue.stores = [check];
|
|
} else {
|
|
stores.push(check);
|
|
}
|
|
}
|
|
}
|
|
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
|
|
inst.value = nextSnapshot;
|
|
inst.getSnapshot = getSnapshot;
|
|
if (checkIfSnapshotChanged(inst)) {
|
|
forceStoreRerender(fiber);
|
|
}
|
|
}
|
|
function subscribeToStore(fiber, inst, subscribe) {
|
|
var handleStoreChange = function() {
|
|
if (checkIfSnapshotChanged(inst)) {
|
|
forceStoreRerender(fiber);
|
|
}
|
|
};
|
|
return subscribe(handleStoreChange);
|
|
}
|
|
function checkIfSnapshotChanged(inst) {
|
|
var latestGetSnapshot = inst.getSnapshot;
|
|
var prevValue = inst.value;
|
|
try {
|
|
var nextValue = latestGetSnapshot();
|
|
return !objectIs(prevValue, nextValue);
|
|
} catch (error2) {
|
|
return true;
|
|
}
|
|
}
|
|
function forceStoreRerender(fiber) {
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
}
|
|
function mountState(initialState3) {
|
|
var hook = mountWorkInProgressHook();
|
|
if (typeof initialState3 === "function") {
|
|
initialState3 = initialState3();
|
|
}
|
|
hook.memoizedState = hook.baseState = initialState3;
|
|
var queue = {
|
|
pending: null,
|
|
interleaved: null,
|
|
lanes: NoLanes,
|
|
dispatch: null,
|
|
lastRenderedReducer: basicStateReducer,
|
|
lastRenderedState: initialState3
|
|
};
|
|
hook.queue = queue;
|
|
var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
|
|
return [hook.memoizedState, dispatch];
|
|
}
|
|
function updateState(initialState3) {
|
|
return updateReducer(basicStateReducer);
|
|
}
|
|
function rerenderState(initialState3) {
|
|
return rerenderReducer(basicStateReducer);
|
|
}
|
|
function pushEffect(tag, create, destroy, deps) {
|
|
var effect = {
|
|
tag,
|
|
create,
|
|
destroy,
|
|
deps,
|
|
next: null
|
|
};
|
|
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
|
|
if (componentUpdateQueue === null) {
|
|
componentUpdateQueue = createFunctionComponentUpdateQueue();
|
|
currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
|
|
componentUpdateQueue.lastEffect = effect.next = effect;
|
|
} else {
|
|
var lastEffect = componentUpdateQueue.lastEffect;
|
|
if (lastEffect === null) {
|
|
componentUpdateQueue.lastEffect = effect.next = effect;
|
|
} else {
|
|
var firstEffect = lastEffect.next;
|
|
lastEffect.next = effect;
|
|
effect.next = firstEffect;
|
|
componentUpdateQueue.lastEffect = effect;
|
|
}
|
|
}
|
|
return effect;
|
|
}
|
|
function mountRef(initialValue) {
|
|
var hook = mountWorkInProgressHook();
|
|
{
|
|
var _ref2 = {
|
|
current: initialValue
|
|
};
|
|
hook.memoizedState = _ref2;
|
|
return _ref2;
|
|
}
|
|
}
|
|
function updateRef(initialValue) {
|
|
var hook = updateWorkInProgressHook();
|
|
return hook.memoizedState;
|
|
}
|
|
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
|
|
}
|
|
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var destroy = void 0;
|
|
if (currentHook !== null) {
|
|
var prevEffect = currentHook.memoizedState;
|
|
destroy = prevEffect.destroy;
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevEffect.deps;
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
|
|
}
|
|
function mountEffect(create, deps) {
|
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
|
|
} else {
|
|
return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
|
|
}
|
|
}
|
|
function updateEffect(create, deps) {
|
|
return updateEffectImpl(Passive, Passive$1, create, deps);
|
|
}
|
|
function mountInsertionEffect(create, deps) {
|
|
return mountEffectImpl(Update, Insertion, create, deps);
|
|
}
|
|
function updateInsertionEffect(create, deps) {
|
|
return updateEffectImpl(Update, Insertion, create, deps);
|
|
}
|
|
function mountLayoutEffect(create, deps) {
|
|
var fiberFlags = Update;
|
|
{
|
|
fiberFlags |= LayoutStatic;
|
|
}
|
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
fiberFlags |= MountLayoutDev;
|
|
}
|
|
return mountEffectImpl(fiberFlags, Layout, create, deps);
|
|
}
|
|
function updateLayoutEffect(create, deps) {
|
|
return updateEffectImpl(Update, Layout, create, deps);
|
|
}
|
|
function imperativeHandleEffect(create, ref) {
|
|
if (typeof ref === "function") {
|
|
var refCallback = ref;
|
|
var _inst = create();
|
|
refCallback(_inst);
|
|
return function() {
|
|
refCallback(null);
|
|
};
|
|
} else if (ref !== null && ref !== void 0) {
|
|
var refObject = ref;
|
|
{
|
|
if (!refObject.hasOwnProperty("current")) {
|
|
error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
|
|
}
|
|
}
|
|
var _inst2 = create();
|
|
refObject.current = _inst2;
|
|
return function() {
|
|
refObject.current = null;
|
|
};
|
|
}
|
|
}
|
|
function mountImperativeHandle(ref, create, deps) {
|
|
{
|
|
if (typeof create !== "function") {
|
|
error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
|
|
}
|
|
}
|
|
var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
|
|
var fiberFlags = Update;
|
|
{
|
|
fiberFlags |= LayoutStatic;
|
|
}
|
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
fiberFlags |= MountLayoutDev;
|
|
}
|
|
return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
|
|
}
|
|
function updateImperativeHandle(ref, create, deps) {
|
|
{
|
|
if (typeof create !== "function") {
|
|
error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
|
|
}
|
|
}
|
|
var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
|
|
return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
|
|
}
|
|
function mountDebugValue(value, formatterFn) {
|
|
}
|
|
var updateDebugValue = mountDebugValue;
|
|
function mountCallback(callback, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
hook.memoizedState = [callback, nextDeps];
|
|
return callback;
|
|
}
|
|
function updateCallback(callback, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (prevState !== null) {
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevState[1];
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
return prevState[0];
|
|
}
|
|
}
|
|
}
|
|
hook.memoizedState = [callback, nextDeps];
|
|
return callback;
|
|
}
|
|
function mountMemo(nextCreate, deps) {
|
|
var hook = mountWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var nextValue = nextCreate();
|
|
hook.memoizedState = [nextValue, nextDeps];
|
|
return nextValue;
|
|
}
|
|
function updateMemo(nextCreate, deps) {
|
|
var hook = updateWorkInProgressHook();
|
|
var nextDeps = deps === void 0 ? null : deps;
|
|
var prevState = hook.memoizedState;
|
|
if (prevState !== null) {
|
|
if (nextDeps !== null) {
|
|
var prevDeps = prevState[1];
|
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
return prevState[0];
|
|
}
|
|
}
|
|
}
|
|
var nextValue = nextCreate();
|
|
hook.memoizedState = [nextValue, nextDeps];
|
|
return nextValue;
|
|
}
|
|
function mountDeferredValue(value) {
|
|
var hook = mountWorkInProgressHook();
|
|
hook.memoizedState = value;
|
|
return value;
|
|
}
|
|
function updateDeferredValue(value) {
|
|
var hook = updateWorkInProgressHook();
|
|
var resolvedCurrentHook = currentHook;
|
|
var prevValue = resolvedCurrentHook.memoizedState;
|
|
return updateDeferredValueImpl(hook, prevValue, value);
|
|
}
|
|
function rerenderDeferredValue(value) {
|
|
var hook = updateWorkInProgressHook();
|
|
if (currentHook === null) {
|
|
hook.memoizedState = value;
|
|
return value;
|
|
} else {
|
|
var prevValue = currentHook.memoizedState;
|
|
return updateDeferredValueImpl(hook, prevValue, value);
|
|
}
|
|
}
|
|
function updateDeferredValueImpl(hook, prevValue, value) {
|
|
var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
|
|
if (shouldDeferValue) {
|
|
if (!objectIs(value, prevValue)) {
|
|
var deferredLane = claimNextTransitionLane();
|
|
currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
|
|
markSkippedUpdateLanes(deferredLane);
|
|
hook.baseState = true;
|
|
}
|
|
return prevValue;
|
|
} else {
|
|
if (hook.baseState) {
|
|
hook.baseState = false;
|
|
markWorkInProgressReceivedUpdate();
|
|
}
|
|
hook.memoizedState = value;
|
|
return value;
|
|
}
|
|
}
|
|
function startTransition(setPending, callback, options2) {
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
|
|
setPending(true);
|
|
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
|
ReactCurrentBatchConfig$2.transition = {};
|
|
var currentTransition = ReactCurrentBatchConfig$2.transition;
|
|
{
|
|
ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
}
|
|
try {
|
|
setPending(false);
|
|
callback();
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig$2.transition = prevTransition;
|
|
{
|
|
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
if (updatedFibersCount > 10) {
|
|
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
|
}
|
|
currentTransition._updatedFibers.clear();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function mountTransition() {
|
|
var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
|
|
var start = startTransition.bind(null, setPending);
|
|
var hook = mountWorkInProgressHook();
|
|
hook.memoizedState = start;
|
|
return [isPending, start];
|
|
}
|
|
function updateTransition() {
|
|
var _updateState = updateState(), isPending = _updateState[0];
|
|
var hook = updateWorkInProgressHook();
|
|
var start = hook.memoizedState;
|
|
return [isPending, start];
|
|
}
|
|
function rerenderTransition() {
|
|
var _rerenderState = rerenderState(), isPending = _rerenderState[0];
|
|
var hook = updateWorkInProgressHook();
|
|
var start = hook.memoizedState;
|
|
return [isPending, start];
|
|
}
|
|
var isUpdatingOpaqueValueInRenderPhase = false;
|
|
function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
|
|
{
|
|
return isUpdatingOpaqueValueInRenderPhase;
|
|
}
|
|
}
|
|
function mountId() {
|
|
var hook = mountWorkInProgressHook();
|
|
var root2 = getWorkInProgressRoot();
|
|
var identifierPrefix = root2.identifierPrefix;
|
|
var id;
|
|
if (getIsHydrating()) {
|
|
var treeId = getTreeId();
|
|
id = ":" + identifierPrefix + "R" + treeId;
|
|
var localId = localIdCounter++;
|
|
if (localId > 0) {
|
|
id += "H" + localId.toString(32);
|
|
}
|
|
id += ":";
|
|
} else {
|
|
var globalClientId = globalClientIdCounter++;
|
|
id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
|
|
}
|
|
hook.memoizedState = id;
|
|
return id;
|
|
}
|
|
function updateId() {
|
|
var hook = updateWorkInProgressHook();
|
|
var id = hook.memoizedState;
|
|
return id;
|
|
}
|
|
function dispatchReducerAction(fiber, queue, action) {
|
|
{
|
|
if (typeof arguments[3] === "function") {
|
|
error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
|
|
}
|
|
}
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = {
|
|
lane,
|
|
action,
|
|
hasEagerState: false,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
if (isRenderPhaseUpdate(fiber)) {
|
|
enqueueRenderPhaseUpdate(queue, update);
|
|
} else {
|
|
var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
|
|
if (root2 !== null) {
|
|
var eventTime = requestEventTime();
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
entangleTransitionUpdate(root2, queue, lane);
|
|
}
|
|
}
|
|
markUpdateInDevTools(fiber, lane);
|
|
}
|
|
function dispatchSetState(fiber, queue, action) {
|
|
{
|
|
if (typeof arguments[3] === "function") {
|
|
error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
|
|
}
|
|
}
|
|
var lane = requestUpdateLane(fiber);
|
|
var update = {
|
|
lane,
|
|
action,
|
|
hasEagerState: false,
|
|
eagerState: null,
|
|
next: null
|
|
};
|
|
if (isRenderPhaseUpdate(fiber)) {
|
|
enqueueRenderPhaseUpdate(queue, update);
|
|
} else {
|
|
var alternate = fiber.alternate;
|
|
if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
|
|
var lastRenderedReducer = queue.lastRenderedReducer;
|
|
if (lastRenderedReducer !== null) {
|
|
var prevDispatcher;
|
|
{
|
|
prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
}
|
|
try {
|
|
var currentState = queue.lastRenderedState;
|
|
var eagerState = lastRenderedReducer(currentState, action);
|
|
update.hasEagerState = true;
|
|
update.eagerState = eagerState;
|
|
if (objectIs(eagerState, currentState)) {
|
|
enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
|
|
return;
|
|
}
|
|
} catch (error2) {
|
|
} finally {
|
|
{
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
|
|
if (root2 !== null) {
|
|
var eventTime = requestEventTime();
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
entangleTransitionUpdate(root2, queue, lane);
|
|
}
|
|
}
|
|
markUpdateInDevTools(fiber, lane);
|
|
}
|
|
function isRenderPhaseUpdate(fiber) {
|
|
var alternate = fiber.alternate;
|
|
return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
|
|
}
|
|
function enqueueRenderPhaseUpdate(queue, update) {
|
|
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
var pending = queue.pending;
|
|
if (pending === null) {
|
|
update.next = update;
|
|
} else {
|
|
update.next = pending.next;
|
|
pending.next = update;
|
|
}
|
|
queue.pending = update;
|
|
}
|
|
function entangleTransitionUpdate(root2, queue, lane) {
|
|
if (isTransitionLane(lane)) {
|
|
var queueLanes = queue.lanes;
|
|
queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
|
|
var newQueueLanes = mergeLanes(queueLanes, lane);
|
|
queue.lanes = newQueueLanes;
|
|
markRootEntangled(root2, newQueueLanes);
|
|
}
|
|
}
|
|
function markUpdateInDevTools(fiber, lane, action) {
|
|
{
|
|
markStateUpdateScheduled(fiber, lane);
|
|
}
|
|
}
|
|
var ContextOnlyDispatcher = {
|
|
readContext,
|
|
useCallback: throwInvalidHookError,
|
|
useContext: throwInvalidHookError,
|
|
useEffect: throwInvalidHookError,
|
|
useImperativeHandle: throwInvalidHookError,
|
|
useInsertionEffect: throwInvalidHookError,
|
|
useLayoutEffect: throwInvalidHookError,
|
|
useMemo: throwInvalidHookError,
|
|
useReducer: throwInvalidHookError,
|
|
useRef: throwInvalidHookError,
|
|
useState: throwInvalidHookError,
|
|
useDebugValue: throwInvalidHookError,
|
|
useDeferredValue: throwInvalidHookError,
|
|
useTransition: throwInvalidHookError,
|
|
useMutableSource: throwInvalidHookError,
|
|
useSyncExternalStore: throwInvalidHookError,
|
|
useId: throwInvalidHookError,
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
var HooksDispatcherOnMountInDEV = null;
|
|
var HooksDispatcherOnMountWithHookTypesInDEV = null;
|
|
var HooksDispatcherOnUpdateInDEV = null;
|
|
var HooksDispatcherOnRerenderInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnMountInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
{
|
|
var warnInvalidContextAccess = function() {
|
|
error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
|
|
};
|
|
var warnInvalidHookAccess = function() {
|
|
error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
|
|
};
|
|
HooksDispatcherOnMountInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
mountHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
mountHookTypesDev();
|
|
checkDepsAreArrayDev(deps);
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
mountHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
mountHookTypesDev();
|
|
return mountMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
mountHookTypesDev();
|
|
return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
mountHookTypesDev();
|
|
return mountId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnMountWithHookTypesInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
return mountInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return mountMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return mountId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
return updateInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return updateMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return updateId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
HooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context) {
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
updateHookTypesDev();
|
|
return updateInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
try {
|
|
return rerenderState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
updateHookTypesDev();
|
|
return updateMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
updateHookTypesDev();
|
|
return updateId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnMountInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountRef(initialValue);
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
try {
|
|
return mountState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
mountHookTypesDev();
|
|
return mountId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnUpdateInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
InvalidNestedHooksDispatcherOnRerenderInDEV = {
|
|
readContext: function(context) {
|
|
warnInvalidContextAccess();
|
|
return readContext(context);
|
|
},
|
|
useCallback: function(callback, deps) {
|
|
currentHookNameInDev = "useCallback";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateCallback(callback, deps);
|
|
},
|
|
useContext: function(context) {
|
|
currentHookNameInDev = "useContext";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return readContext(context);
|
|
},
|
|
useEffect: function(create, deps) {
|
|
currentHookNameInDev = "useEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateEffect(create, deps);
|
|
},
|
|
useImperativeHandle: function(ref, create, deps) {
|
|
currentHookNameInDev = "useImperativeHandle";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateImperativeHandle(ref, create, deps);
|
|
},
|
|
useInsertionEffect: function(create, deps) {
|
|
currentHookNameInDev = "useInsertionEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateInsertionEffect(create, deps);
|
|
},
|
|
useLayoutEffect: function(create, deps) {
|
|
currentHookNameInDev = "useLayoutEffect";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateLayoutEffect(create, deps);
|
|
},
|
|
useMemo: function(create, deps) {
|
|
currentHookNameInDev = "useMemo";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return updateMemo(create, deps);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useReducer: function(reducer, initialArg, init) {
|
|
currentHookNameInDev = "useReducer";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderReducer(reducer, initialArg, init);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useRef: function(initialValue) {
|
|
currentHookNameInDev = "useRef";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateRef();
|
|
},
|
|
useState: function(initialState3) {
|
|
currentHookNameInDev = "useState";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
try {
|
|
return rerenderState(initialState3);
|
|
} finally {
|
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
}
|
|
},
|
|
useDebugValue: function(value, formatterFn) {
|
|
currentHookNameInDev = "useDebugValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateDebugValue();
|
|
},
|
|
useDeferredValue: function(value) {
|
|
currentHookNameInDev = "useDeferredValue";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderDeferredValue(value);
|
|
},
|
|
useTransition: function() {
|
|
currentHookNameInDev = "useTransition";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return rerenderTransition();
|
|
},
|
|
useMutableSource: function(source, getSnapshot, subscribe) {
|
|
currentHookNameInDev = "useMutableSource";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateMutableSource();
|
|
},
|
|
useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
|
|
currentHookNameInDev = "useSyncExternalStore";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
},
|
|
useId: function() {
|
|
currentHookNameInDev = "useId";
|
|
warnInvalidHookAccess();
|
|
updateHookTypesDev();
|
|
return updateId();
|
|
},
|
|
unstable_isNewReconciler: enableNewReconciler
|
|
};
|
|
}
|
|
var now$1 = Scheduler.unstable_now;
|
|
var commitTime = 0;
|
|
var layoutEffectStartTime = -1;
|
|
var profilerStartTime = -1;
|
|
var passiveEffectStartTime = -1;
|
|
var currentUpdateIsNested = false;
|
|
var nestedUpdateScheduled = false;
|
|
function isCurrentUpdateNested() {
|
|
return currentUpdateIsNested;
|
|
}
|
|
function markNestedUpdateScheduled() {
|
|
{
|
|
nestedUpdateScheduled = true;
|
|
}
|
|
}
|
|
function resetNestedUpdateFlag() {
|
|
{
|
|
currentUpdateIsNested = false;
|
|
nestedUpdateScheduled = false;
|
|
}
|
|
}
|
|
function syncNestedUpdateFlag() {
|
|
{
|
|
currentUpdateIsNested = nestedUpdateScheduled;
|
|
nestedUpdateScheduled = false;
|
|
}
|
|
}
|
|
function getCommitTime() {
|
|
return commitTime;
|
|
}
|
|
function recordCommitTime() {
|
|
commitTime = now$1();
|
|
}
|
|
function startProfilerTimer(fiber) {
|
|
profilerStartTime = now$1();
|
|
if (fiber.actualStartTime < 0) {
|
|
fiber.actualStartTime = now$1();
|
|
}
|
|
}
|
|
function stopProfilerTimerIfRunning(fiber) {
|
|
profilerStartTime = -1;
|
|
}
|
|
function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
|
|
if (profilerStartTime >= 0) {
|
|
var elapsedTime = now$1() - profilerStartTime;
|
|
fiber.actualDuration += elapsedTime;
|
|
if (overrideBaseTime) {
|
|
fiber.selfBaseDuration = elapsedTime;
|
|
}
|
|
profilerStartTime = -1;
|
|
}
|
|
}
|
|
function recordLayoutEffectDuration(fiber) {
|
|
if (layoutEffectStartTime >= 0) {
|
|
var elapsedTime = now$1() - layoutEffectStartTime;
|
|
layoutEffectStartTime = -1;
|
|
var parentFiber = fiber.return;
|
|
while (parentFiber !== null) {
|
|
switch (parentFiber.tag) {
|
|
case HostRoot:
|
|
var root2 = parentFiber.stateNode;
|
|
root2.effectDuration += elapsedTime;
|
|
return;
|
|
case Profiler:
|
|
var parentStateNode = parentFiber.stateNode;
|
|
parentStateNode.effectDuration += elapsedTime;
|
|
return;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
}
|
|
}
|
|
function recordPassiveEffectDuration(fiber) {
|
|
if (passiveEffectStartTime >= 0) {
|
|
var elapsedTime = now$1() - passiveEffectStartTime;
|
|
passiveEffectStartTime = -1;
|
|
var parentFiber = fiber.return;
|
|
while (parentFiber !== null) {
|
|
switch (parentFiber.tag) {
|
|
case HostRoot:
|
|
var root2 = parentFiber.stateNode;
|
|
if (root2 !== null) {
|
|
root2.passiveEffectDuration += elapsedTime;
|
|
}
|
|
return;
|
|
case Profiler:
|
|
var parentStateNode = parentFiber.stateNode;
|
|
if (parentStateNode !== null) {
|
|
parentStateNode.passiveEffectDuration += elapsedTime;
|
|
}
|
|
return;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
}
|
|
}
|
|
function startLayoutEffectTimer() {
|
|
layoutEffectStartTime = now$1();
|
|
}
|
|
function startPassiveEffectTimer() {
|
|
passiveEffectStartTime = now$1();
|
|
}
|
|
function transferActualDuration(fiber) {
|
|
var child = fiber.child;
|
|
while (child) {
|
|
fiber.actualDuration += child.actualDuration;
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
function createCapturedValueAtFiber(value, source) {
|
|
return {
|
|
value,
|
|
source,
|
|
stack: getStackByFiberInDevAndProd(source),
|
|
digest: null
|
|
};
|
|
}
|
|
function createCapturedValue(value, digest, stack) {
|
|
return {
|
|
value,
|
|
source: null,
|
|
stack: stack != null ? stack : null,
|
|
digest: digest != null ? digest : null
|
|
};
|
|
}
|
|
function showErrorDialog(boundary, errorInfo) {
|
|
return true;
|
|
}
|
|
function logCapturedError(boundary, errorInfo) {
|
|
try {
|
|
var logError = showErrorDialog(boundary, errorInfo);
|
|
if (logError === false) {
|
|
return;
|
|
}
|
|
var error2 = errorInfo.value;
|
|
if (true) {
|
|
var source = errorInfo.source;
|
|
var stack = errorInfo.stack;
|
|
var componentStack = stack !== null ? stack : "";
|
|
if (error2 != null && error2._suppressLogging) {
|
|
if (boundary.tag === ClassComponent) {
|
|
return;
|
|
}
|
|
console["error"](error2);
|
|
}
|
|
var componentName = source ? getComponentNameFromFiber(source) : null;
|
|
var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
|
|
var errorBoundaryMessage;
|
|
if (boundary.tag === HostRoot) {
|
|
errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
|
|
} else {
|
|
var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
|
|
errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
|
|
}
|
|
var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
|
|
console["error"](combinedMessage);
|
|
} else {
|
|
console["error"](error2);
|
|
}
|
|
} catch (e) {
|
|
setTimeout(function() {
|
|
throw e;
|
|
});
|
|
}
|
|
}
|
|
var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
|
|
function createRootErrorUpdate(fiber, errorInfo, lane) {
|
|
var update = createUpdate(NoTimestamp, lane);
|
|
update.tag = CaptureUpdate;
|
|
update.payload = {
|
|
element: null
|
|
};
|
|
var error2 = errorInfo.value;
|
|
update.callback = function() {
|
|
onUncaughtError(error2);
|
|
logCapturedError(fiber, errorInfo);
|
|
};
|
|
return update;
|
|
}
|
|
function createClassErrorUpdate(fiber, errorInfo, lane) {
|
|
var update = createUpdate(NoTimestamp, lane);
|
|
update.tag = CaptureUpdate;
|
|
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
|
if (typeof getDerivedStateFromError === "function") {
|
|
var error$1 = errorInfo.value;
|
|
update.payload = function() {
|
|
return getDerivedStateFromError(error$1);
|
|
};
|
|
update.callback = function() {
|
|
{
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
}
|
|
logCapturedError(fiber, errorInfo);
|
|
};
|
|
}
|
|
var inst = fiber.stateNode;
|
|
if (inst !== null && typeof inst.componentDidCatch === "function") {
|
|
update.callback = function callback() {
|
|
{
|
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
}
|
|
logCapturedError(fiber, errorInfo);
|
|
if (typeof getDerivedStateFromError !== "function") {
|
|
markLegacyErrorBoundaryAsFailed(this);
|
|
}
|
|
var error$12 = errorInfo.value;
|
|
var stack = errorInfo.stack;
|
|
this.componentDidCatch(error$12, {
|
|
componentStack: stack !== null ? stack : ""
|
|
});
|
|
{
|
|
if (typeof getDerivedStateFromError !== "function") {
|
|
if (!includesSomeLane(fiber.lanes, SyncLane)) {
|
|
error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown");
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
return update;
|
|
}
|
|
function attachPingListener(root2, wakeable, lanes) {
|
|
var pingCache = root2.pingCache;
|
|
var threadIDs;
|
|
if (pingCache === null) {
|
|
pingCache = root2.pingCache = new PossiblyWeakMap$1();
|
|
threadIDs = /* @__PURE__ */ new Set();
|
|
pingCache.set(wakeable, threadIDs);
|
|
} else {
|
|
threadIDs = pingCache.get(wakeable);
|
|
if (threadIDs === void 0) {
|
|
threadIDs = /* @__PURE__ */ new Set();
|
|
pingCache.set(wakeable, threadIDs);
|
|
}
|
|
}
|
|
if (!threadIDs.has(lanes)) {
|
|
threadIDs.add(lanes);
|
|
var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
|
|
{
|
|
if (isDevToolsPresent) {
|
|
restorePendingUpdaters(root2, lanes);
|
|
}
|
|
}
|
|
wakeable.then(ping, ping);
|
|
}
|
|
}
|
|
function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
|
|
var wakeables = suspenseBoundary.updateQueue;
|
|
if (wakeables === null) {
|
|
var updateQueue = /* @__PURE__ */ new Set();
|
|
updateQueue.add(wakeable);
|
|
suspenseBoundary.updateQueue = updateQueue;
|
|
} else {
|
|
wakeables.add(wakeable);
|
|
}
|
|
}
|
|
function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
|
|
var tag = sourceFiber.tag;
|
|
if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef2 || tag === SimpleMemoComponent)) {
|
|
var currentSource = sourceFiber.alternate;
|
|
if (currentSource) {
|
|
sourceFiber.updateQueue = currentSource.updateQueue;
|
|
sourceFiber.memoizedState = currentSource.memoizedState;
|
|
sourceFiber.lanes = currentSource.lanes;
|
|
} else {
|
|
sourceFiber.updateQueue = null;
|
|
sourceFiber.memoizedState = null;
|
|
}
|
|
}
|
|
}
|
|
function getNearestSuspenseBoundaryToCapture(returnFiber) {
|
|
var node = returnFiber;
|
|
do {
|
|
if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
|
|
return node;
|
|
}
|
|
node = node.return;
|
|
} while (node !== null);
|
|
return null;
|
|
}
|
|
function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
|
|
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
if (suspenseBoundary === returnFiber) {
|
|
suspenseBoundary.flags |= ShouldCapture;
|
|
} else {
|
|
suspenseBoundary.flags |= DidCapture;
|
|
sourceFiber.flags |= ForceUpdateForLegacySuspense;
|
|
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
if (sourceFiber.tag === ClassComponent) {
|
|
var currentSourceFiber = sourceFiber.alternate;
|
|
if (currentSourceFiber === null) {
|
|
sourceFiber.tag = IncompleteClassComponent;
|
|
} else {
|
|
var update = createUpdate(NoTimestamp, SyncLane);
|
|
update.tag = ForceUpdate;
|
|
enqueueUpdate(sourceFiber, update, SyncLane);
|
|
}
|
|
}
|
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
}
|
|
return suspenseBoundary;
|
|
}
|
|
suspenseBoundary.flags |= ShouldCapture;
|
|
suspenseBoundary.lanes = rootRenderLanes;
|
|
return suspenseBoundary;
|
|
}
|
|
function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
|
|
sourceFiber.flags |= Incomplete;
|
|
{
|
|
if (isDevToolsPresent) {
|
|
restorePendingUpdaters(root2, rootRenderLanes);
|
|
}
|
|
}
|
|
if (value !== null && typeof value === "object" && typeof value.then === "function") {
|
|
var wakeable = value;
|
|
resetSuspendedComponent(sourceFiber);
|
|
{
|
|
if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
|
|
markDidThrowWhileHydratingDEV();
|
|
}
|
|
}
|
|
var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
|
|
if (suspenseBoundary !== null) {
|
|
suspenseBoundary.flags &= ~ForceClientRender;
|
|
markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
|
|
if (suspenseBoundary.mode & ConcurrentMode) {
|
|
attachPingListener(root2, wakeable, rootRenderLanes);
|
|
}
|
|
attachRetryListener(suspenseBoundary, root2, wakeable);
|
|
return;
|
|
} else {
|
|
if (!includesSyncLane(rootRenderLanes)) {
|
|
attachPingListener(root2, wakeable, rootRenderLanes);
|
|
renderDidSuspendDelayIfPossible();
|
|
return;
|
|
}
|
|
var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
|
|
value = uncaughtSuspenseError;
|
|
}
|
|
} else {
|
|
if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
|
|
markDidThrowWhileHydratingDEV();
|
|
var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
|
|
if (_suspenseBoundary !== null) {
|
|
if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
|
|
_suspenseBoundary.flags |= ForceClientRender;
|
|
}
|
|
markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
|
|
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
value = createCapturedValueAtFiber(value, sourceFiber);
|
|
renderDidError(value);
|
|
var workInProgress2 = returnFiber;
|
|
do {
|
|
switch (workInProgress2.tag) {
|
|
case HostRoot: {
|
|
var _errorInfo = value;
|
|
workInProgress2.flags |= ShouldCapture;
|
|
var lane = pickArbitraryLane(rootRenderLanes);
|
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
|
|
var update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
|
|
enqueueCapturedUpdate(workInProgress2, update);
|
|
return;
|
|
}
|
|
case ClassComponent:
|
|
var errorInfo = value;
|
|
var ctor = workInProgress2.type;
|
|
var instance = workInProgress2.stateNode;
|
|
if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
|
|
workInProgress2.flags |= ShouldCapture;
|
|
var _lane = pickArbitraryLane(rootRenderLanes);
|
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
|
|
var _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
|
|
enqueueCapturedUpdate(workInProgress2, _update);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
workInProgress2 = workInProgress2.return;
|
|
} while (workInProgress2 !== null);
|
|
}
|
|
function getSuspendedCache() {
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
var didReceiveUpdate = false;
|
|
var didWarnAboutBadClass;
|
|
var didWarnAboutModulePatternComponent;
|
|
var didWarnAboutContextTypeOnFunctionComponent;
|
|
var didWarnAboutGetDerivedStateOnFunctionComponent;
|
|
var didWarnAboutFunctionRefs;
|
|
var didWarnAboutReassigningProps;
|
|
var didWarnAboutRevealOrder;
|
|
var didWarnAboutTailOptions;
|
|
{
|
|
didWarnAboutBadClass = {};
|
|
didWarnAboutModulePatternComponent = {};
|
|
didWarnAboutContextTypeOnFunctionComponent = {};
|
|
didWarnAboutGetDerivedStateOnFunctionComponent = {};
|
|
didWarnAboutFunctionRefs = {};
|
|
didWarnAboutReassigningProps = false;
|
|
didWarnAboutRevealOrder = {};
|
|
didWarnAboutTailOptions = {};
|
|
}
|
|
function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
if (current2 === null) {
|
|
workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
} else {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
|
|
}
|
|
}
|
|
function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
}
|
|
function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(
|
|
innerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(Component)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
var render2 = Component.render;
|
|
var ref = workInProgress2.ref;
|
|
var nextChildren;
|
|
var hasId;
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
{
|
|
markComponentRenderStarted(workInProgress2);
|
|
}
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
{
|
|
markComponentRenderStopped();
|
|
}
|
|
if (current2 !== null && !didReceiveUpdate) {
|
|
bailoutHooks(current2, workInProgress2, renderLanes2);
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
if (getIsHydrating() && hasId) {
|
|
pushMaterializedTreeId(workInProgress2);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
if (current2 === null) {
|
|
var type = Component.type;
|
|
if (isSimpleFunctionComponent(type) && Component.compare === null && Component.defaultProps === void 0) {
|
|
var resolvedType = type;
|
|
{
|
|
resolvedType = resolveFunctionForHotReloading(type);
|
|
}
|
|
workInProgress2.tag = SimpleMemoComponent;
|
|
workInProgress2.type = resolvedType;
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, type);
|
|
}
|
|
return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
|
|
}
|
|
{
|
|
var innerPropTypes = type.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(
|
|
innerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(type)
|
|
);
|
|
}
|
|
}
|
|
var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
|
|
child.ref = workInProgress2.ref;
|
|
child.return = workInProgress2;
|
|
workInProgress2.child = child;
|
|
return child;
|
|
}
|
|
{
|
|
var _type = Component.type;
|
|
var _innerPropTypes = _type.propTypes;
|
|
if (_innerPropTypes) {
|
|
checkPropTypes(
|
|
_innerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(_type)
|
|
);
|
|
}
|
|
}
|
|
var currentChild = current2.child;
|
|
var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
|
|
if (!hasScheduledUpdateOrContext) {
|
|
var prevProps = currentChild.memoizedProps;
|
|
var compare = Component.compare;
|
|
compare = compare !== null ? compare : shallowEqual2;
|
|
if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
var newChild = createWorkInProgress(currentChild, nextProps);
|
|
newChild.ref = workInProgress2.ref;
|
|
newChild.return = workInProgress2;
|
|
workInProgress2.child = newChild;
|
|
return newChild;
|
|
}
|
|
function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerMemoType = workInProgress2.elementType;
|
|
if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
|
|
var lazyComponent = outerMemoType;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
outerMemoType = init(payload);
|
|
} catch (x2) {
|
|
outerMemoType = null;
|
|
}
|
|
var outerPropTypes = outerMemoType && outerMemoType.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(
|
|
outerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(outerMemoType)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (current2 !== null) {
|
|
var prevProps = current2.memoizedProps;
|
|
if (shallowEqual2(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) {
|
|
didReceiveUpdate = false;
|
|
workInProgress2.pendingProps = nextProps = prevProps;
|
|
if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
|
|
workInProgress2.lanes = current2.lanes;
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
} else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
didReceiveUpdate = true;
|
|
}
|
|
}
|
|
}
|
|
return updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2);
|
|
}
|
|
function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var nextChildren = nextProps.children;
|
|
var prevState = current2 !== null ? current2.memoizedState : null;
|
|
if (nextProps.mode === "hidden" || enableLegacyHidden) {
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
var nextState = {
|
|
baseLanes: NoLanes,
|
|
cachePool: null,
|
|
transitions: null
|
|
};
|
|
workInProgress2.memoizedState = nextState;
|
|
pushRenderLanes(workInProgress2, renderLanes2);
|
|
} else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
|
|
var spawnedCachePool = null;
|
|
var nextBaseLanes;
|
|
if (prevState !== null) {
|
|
var prevBaseLanes = prevState.baseLanes;
|
|
nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
|
|
} else {
|
|
nextBaseLanes = renderLanes2;
|
|
}
|
|
workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
|
|
var _nextState = {
|
|
baseLanes: nextBaseLanes,
|
|
cachePool: spawnedCachePool,
|
|
transitions: null
|
|
};
|
|
workInProgress2.memoizedState = _nextState;
|
|
workInProgress2.updateQueue = null;
|
|
pushRenderLanes(workInProgress2, nextBaseLanes);
|
|
return null;
|
|
} else {
|
|
var _nextState2 = {
|
|
baseLanes: NoLanes,
|
|
cachePool: null,
|
|
transitions: null
|
|
};
|
|
workInProgress2.memoizedState = _nextState2;
|
|
var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
|
|
pushRenderLanes(workInProgress2, subtreeRenderLanes2);
|
|
}
|
|
} else {
|
|
var _subtreeRenderLanes;
|
|
if (prevState !== null) {
|
|
_subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
|
|
workInProgress2.memoizedState = null;
|
|
} else {
|
|
_subtreeRenderLanes = renderLanes2;
|
|
}
|
|
pushRenderLanes(workInProgress2, _subtreeRenderLanes);
|
|
}
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateFragment(current2, workInProgress2, renderLanes2) {
|
|
var nextChildren = workInProgress2.pendingProps;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateMode(current2, workInProgress2, renderLanes2) {
|
|
var nextChildren = workInProgress2.pendingProps.children;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateProfiler(current2, workInProgress2, renderLanes2) {
|
|
{
|
|
workInProgress2.flags |= Update;
|
|
{
|
|
var stateNode = workInProgress2.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
}
|
|
}
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var nextChildren = nextProps.children;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function markRef(current2, workInProgress2) {
|
|
var ref = workInProgress2.ref;
|
|
if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
|
|
workInProgress2.flags |= Ref;
|
|
{
|
|
workInProgress2.flags |= RefStatic;
|
|
}
|
|
}
|
|
}
|
|
function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(
|
|
innerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(Component)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
var context;
|
|
{
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, Component, true);
|
|
context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
var nextChildren;
|
|
var hasId;
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
{
|
|
markComponentRenderStarted(workInProgress2);
|
|
}
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
{
|
|
markComponentRenderStopped();
|
|
}
|
|
if (current2 !== null && !didReceiveUpdate) {
|
|
bailoutHooks(current2, workInProgress2, renderLanes2);
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
if (getIsHydrating() && hasId) {
|
|
pushMaterializedTreeId(workInProgress2);
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
|
|
{
|
|
switch (shouldError(workInProgress2)) {
|
|
case false: {
|
|
var _instance = workInProgress2.stateNode;
|
|
var ctor = workInProgress2.type;
|
|
var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
|
|
var state = tempInstance.state;
|
|
_instance.updater.enqueueSetState(_instance, state, null);
|
|
break;
|
|
}
|
|
case true: {
|
|
workInProgress2.flags |= DidCapture;
|
|
workInProgress2.flags |= ShouldCapture;
|
|
var error$1 = new Error("Simulated error coming from DevTools");
|
|
var lane = pickArbitraryLane(renderLanes2);
|
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
|
|
var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
|
|
enqueueCapturedUpdate(workInProgress2, update);
|
|
break;
|
|
}
|
|
}
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var innerPropTypes = Component.propTypes;
|
|
if (innerPropTypes) {
|
|
checkPropTypes(
|
|
innerPropTypes,
|
|
nextProps,
|
|
"prop",
|
|
getComponentNameFromType(Component)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
var hasContext;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var instance = workInProgress2.stateNode;
|
|
var shouldUpdate;
|
|
if (instance === null) {
|
|
resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
|
|
constructClassInstance(workInProgress2, Component, nextProps);
|
|
mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
shouldUpdate = true;
|
|
} else if (current2 === null) {
|
|
shouldUpdate = resumeMountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
} else {
|
|
shouldUpdate = updateClassInstance(current2, workInProgress2, Component, nextProps, renderLanes2);
|
|
}
|
|
var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2);
|
|
{
|
|
var inst = workInProgress2.stateNode;
|
|
if (shouldUpdate && inst.props !== nextProps) {
|
|
if (!didWarnAboutReassigningProps) {
|
|
error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress2) || "a component");
|
|
}
|
|
didWarnAboutReassigningProps = true;
|
|
}
|
|
}
|
|
return nextUnitOfWork;
|
|
}
|
|
function finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2) {
|
|
markRef(current2, workInProgress2);
|
|
var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
if (!shouldUpdate && !didCaptureError) {
|
|
if (hasContext) {
|
|
invalidateContextProvider(workInProgress2, Component, false);
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
var nextChildren;
|
|
if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") {
|
|
nextChildren = null;
|
|
{
|
|
stopProfilerTimerIfRunning();
|
|
}
|
|
} else {
|
|
{
|
|
markComponentRenderStarted(workInProgress2);
|
|
}
|
|
{
|
|
setIsRendering(true);
|
|
nextChildren = instance.render();
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
instance.render();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
setIsRendering(false);
|
|
}
|
|
{
|
|
markComponentRenderStopped();
|
|
}
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
if (current2 !== null && didCaptureError) {
|
|
forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
|
|
} else {
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
}
|
|
workInProgress2.memoizedState = instance.state;
|
|
if (hasContext) {
|
|
invalidateContextProvider(workInProgress2, Component, true);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function pushHostRootContext(workInProgress2) {
|
|
var root2 = workInProgress2.stateNode;
|
|
if (root2.pendingContext) {
|
|
pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
|
|
} else if (root2.context) {
|
|
pushTopLevelContextObject(workInProgress2, root2.context, false);
|
|
}
|
|
pushHostContainer(workInProgress2, root2.containerInfo);
|
|
}
|
|
function updateHostRoot(current2, workInProgress2, renderLanes2) {
|
|
pushHostRootContext(workInProgress2);
|
|
if (current2 === null) {
|
|
throw new Error("Should have a current fiber. This is a bug in React.");
|
|
}
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var prevState = workInProgress2.memoizedState;
|
|
var prevChildren = prevState.element;
|
|
cloneUpdateQueue(current2, workInProgress2);
|
|
processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
|
|
var nextState = workInProgress2.memoizedState;
|
|
var root2 = workInProgress2.stateNode;
|
|
var nextChildren = nextState.element;
|
|
if (prevState.isDehydrated) {
|
|
var overrideState = {
|
|
element: nextChildren,
|
|
isDehydrated: false,
|
|
cache: nextState.cache,
|
|
pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
|
|
transitions: nextState.transitions
|
|
};
|
|
var updateQueue = workInProgress2.updateQueue;
|
|
updateQueue.baseState = overrideState;
|
|
workInProgress2.memoizedState = overrideState;
|
|
if (workInProgress2.flags & ForceClientRender) {
|
|
var recoverableError = createCapturedValueAtFiber(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress2);
|
|
return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
|
|
} else if (nextChildren !== prevChildren) {
|
|
var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
|
|
return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
|
|
} else {
|
|
enterHydrationState(workInProgress2);
|
|
var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
workInProgress2.child = child;
|
|
var node = child;
|
|
while (node) {
|
|
node.flags = node.flags & ~Placement | Hydrating;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
} else {
|
|
resetHydrationState();
|
|
if (nextChildren === prevChildren) {
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
|
|
resetHydrationState();
|
|
queueHydrationError(recoverableError);
|
|
workInProgress2.flags |= ForceClientRender;
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateHostComponent(current2, workInProgress2, renderLanes2) {
|
|
pushHostContext(workInProgress2);
|
|
if (current2 === null) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
}
|
|
var type = workInProgress2.type;
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var prevProps = current2 !== null ? current2.memoizedProps : null;
|
|
var nextChildren = nextProps.children;
|
|
var isDirectTextChild = shouldSetTextContent(type, nextProps);
|
|
if (isDirectTextChild) {
|
|
nextChildren = null;
|
|
} else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
|
|
workInProgress2.flags |= ContentReset;
|
|
}
|
|
markRef(current2, workInProgress2);
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function updateHostText(current2, workInProgress2) {
|
|
if (current2 === null) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
}
|
|
return null;
|
|
}
|
|
function mountLazyComponent(_current, workInProgress2, elementType, renderLanes2) {
|
|
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
|
|
var props = workInProgress2.pendingProps;
|
|
var lazyComponent = elementType;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
var Component = init(payload);
|
|
workInProgress2.type = Component;
|
|
var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component);
|
|
var resolvedProps = resolveDefaultProps(Component, props);
|
|
var child;
|
|
switch (resolvedTag) {
|
|
case FunctionComponent: {
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
|
|
}
|
|
child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case ClassComponent: {
|
|
{
|
|
workInProgress2.type = Component = resolveClassForHotReloading(Component);
|
|
}
|
|
child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case ForwardRef2: {
|
|
{
|
|
workInProgress2.type = Component = resolveForwardRefForHotReloading(Component);
|
|
}
|
|
child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
return child;
|
|
}
|
|
case MemoComponent: {
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerPropTypes = Component.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(
|
|
outerPropTypes,
|
|
resolvedProps,
|
|
"prop",
|
|
getComponentNameFromType(Component)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
child = updateMemoComponent(
|
|
null,
|
|
workInProgress2,
|
|
Component,
|
|
resolveDefaultProps(Component.type, resolvedProps),
|
|
renderLanes2
|
|
);
|
|
return child;
|
|
}
|
|
}
|
|
var hint = "";
|
|
{
|
|
if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) {
|
|
hint = " Did you wrap a component in React.lazy() more than once?";
|
|
}
|
|
}
|
|
throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint));
|
|
}
|
|
function mountIncompleteClassComponent(_current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
|
|
workInProgress2.tag = ClassComponent;
|
|
var hasContext;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
constructClassInstance(workInProgress2, Component, nextProps);
|
|
mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
|
|
return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
|
|
}
|
|
function mountIndeterminateComponent(_current, workInProgress2, Component, renderLanes2) {
|
|
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
|
|
var props = workInProgress2.pendingProps;
|
|
var context;
|
|
{
|
|
var unmaskedContext = getUnmaskedContext(workInProgress2, Component, false);
|
|
context = getMaskedContext(workInProgress2, unmaskedContext);
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var value;
|
|
var hasId;
|
|
{
|
|
markComponentRenderStarted(workInProgress2);
|
|
}
|
|
{
|
|
if (Component.prototype && typeof Component.prototype.render === "function") {
|
|
var componentName = getComponentNameFromType(Component) || "Unknown";
|
|
if (!didWarnAboutBadClass[componentName]) {
|
|
error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
|
|
didWarnAboutBadClass[componentName] = true;
|
|
}
|
|
}
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
|
|
}
|
|
setIsRendering(true);
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
setIsRendering(false);
|
|
}
|
|
{
|
|
markComponentRenderStopped();
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
{
|
|
if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
|
|
var _componentName = getComponentNameFromType(Component) || "Unknown";
|
|
if (!didWarnAboutModulePatternComponent[_componentName]) {
|
|
error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
|
|
didWarnAboutModulePatternComponent[_componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
|
|
{
|
|
var _componentName2 = getComponentNameFromType(Component) || "Unknown";
|
|
if (!didWarnAboutModulePatternComponent[_componentName2]) {
|
|
error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
|
|
didWarnAboutModulePatternComponent[_componentName2] = true;
|
|
}
|
|
}
|
|
workInProgress2.tag = ClassComponent;
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
var hasContext = false;
|
|
if (isContextProvider(Component)) {
|
|
hasContext = true;
|
|
pushContextProvider(workInProgress2);
|
|
} else {
|
|
hasContext = false;
|
|
}
|
|
workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
|
|
initializeUpdateQueue(workInProgress2);
|
|
adoptClassInstance(workInProgress2, value);
|
|
mountClassInstance(workInProgress2, Component, props, renderLanes2);
|
|
return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
|
|
} else {
|
|
workInProgress2.tag = FunctionComponent;
|
|
{
|
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
setIsStrictModeForDevtools(true);
|
|
try {
|
|
value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
|
|
hasId = checkDidRenderIdHook();
|
|
} finally {
|
|
setIsStrictModeForDevtools(false);
|
|
}
|
|
}
|
|
}
|
|
if (getIsHydrating() && hasId) {
|
|
pushMaterializedTreeId(workInProgress2);
|
|
}
|
|
reconcileChildren(null, workInProgress2, value, renderLanes2);
|
|
{
|
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
}
|
|
function validateFunctionComponentInDev(workInProgress2, Component) {
|
|
{
|
|
if (Component) {
|
|
if (Component.childContextTypes) {
|
|
error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component");
|
|
}
|
|
}
|
|
if (workInProgress2.ref !== null) {
|
|
var info = "";
|
|
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
|
if (ownerName) {
|
|
info += "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
var warningKey = ownerName || "";
|
|
var debugSource = workInProgress2._debugSource;
|
|
if (debugSource) {
|
|
warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
|
|
}
|
|
if (!didWarnAboutFunctionRefs[warningKey]) {
|
|
didWarnAboutFunctionRefs[warningKey] = true;
|
|
error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
|
|
}
|
|
}
|
|
if (typeof Component.getDerivedStateFromProps === "function") {
|
|
var _componentName3 = getComponentNameFromType(Component) || "Unknown";
|
|
if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
|
|
error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
|
|
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
|
|
}
|
|
}
|
|
if (typeof Component.contextType === "object" && Component.contextType !== null) {
|
|
var _componentName4 = getComponentNameFromType(Component) || "Unknown";
|
|
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
|
|
error("%s: Function components do not support contextType.", _componentName4);
|
|
didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var SUSPENDED_MARKER = {
|
|
dehydrated: null,
|
|
treeContext: null,
|
|
retryLane: NoLane
|
|
};
|
|
function mountSuspenseOffscreenState(renderLanes2) {
|
|
return {
|
|
baseLanes: renderLanes2,
|
|
cachePool: getSuspendedCache(),
|
|
transitions: null
|
|
};
|
|
}
|
|
function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
|
|
var cachePool = null;
|
|
return {
|
|
baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
|
|
cachePool,
|
|
transitions: prevOffscreenState.transitions
|
|
};
|
|
}
|
|
function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
|
|
if (current2 !== null) {
|
|
var suspenseState = current2.memoizedState;
|
|
if (suspenseState === null) {
|
|
return false;
|
|
}
|
|
}
|
|
return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
}
|
|
function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
|
|
return removeLanes(current2.childLanes, renderLanes2);
|
|
}
|
|
function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
{
|
|
if (shouldSuspend(workInProgress2)) {
|
|
workInProgress2.flags |= DidCapture;
|
|
}
|
|
}
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
var showFallback = false;
|
|
var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
|
|
showFallback = true;
|
|
workInProgress2.flags &= ~DidCapture;
|
|
} else {
|
|
if (current2 === null || current2.memoizedState !== null) {
|
|
{
|
|
suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
|
|
}
|
|
}
|
|
}
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
if (current2 === null) {
|
|
tryToClaimNextHydratableInstance(workInProgress2);
|
|
var suspenseState = workInProgress2.memoizedState;
|
|
if (suspenseState !== null) {
|
|
var dehydrated = suspenseState.dehydrated;
|
|
if (dehydrated !== null) {
|
|
return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
|
|
}
|
|
}
|
|
var nextPrimaryChildren = nextProps.children;
|
|
var nextFallbackChildren = nextProps.fallback;
|
|
if (showFallback) {
|
|
var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
|
|
var primaryChildFragment = workInProgress2.child;
|
|
primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return fallbackFragment;
|
|
} else {
|
|
return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
|
|
}
|
|
} else {
|
|
var prevState = current2.memoizedState;
|
|
if (prevState !== null) {
|
|
var _dehydrated = prevState.dehydrated;
|
|
if (_dehydrated !== null) {
|
|
return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
|
|
}
|
|
}
|
|
if (showFallback) {
|
|
var _nextFallbackChildren = nextProps.fallback;
|
|
var _nextPrimaryChildren = nextProps.children;
|
|
var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
|
|
var _primaryChildFragment2 = workInProgress2.child;
|
|
var prevOffscreenState = current2.child.memoizedState;
|
|
_primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
|
|
_primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return fallbackChildFragment;
|
|
} else {
|
|
var _nextPrimaryChildren2 = nextProps.children;
|
|
var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
|
|
workInProgress2.memoizedState = null;
|
|
return _primaryChildFragment3;
|
|
}
|
|
}
|
|
}
|
|
function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var primaryChildProps = {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
|
|
primaryChildFragment.return = workInProgress2;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return primaryChildFragment;
|
|
}
|
|
function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var progressedPrimaryFragment = workInProgress2.child;
|
|
var primaryChildProps = {
|
|
mode: "hidden",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment;
|
|
var fallbackChildFragment;
|
|
if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
|
|
primaryChildFragment = progressedPrimaryFragment;
|
|
primaryChildFragment.childLanes = NoLanes;
|
|
primaryChildFragment.pendingProps = primaryChildProps;
|
|
if (workInProgress2.mode & ProfileMode) {
|
|
primaryChildFragment.actualDuration = 0;
|
|
primaryChildFragment.actualStartTime = -1;
|
|
primaryChildFragment.selfBaseDuration = 0;
|
|
primaryChildFragment.treeBaseDuration = 0;
|
|
}
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
} else {
|
|
primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
}
|
|
primaryChildFragment.return = workInProgress2;
|
|
fallbackChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = fallbackChildFragment;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return fallbackChildFragment;
|
|
}
|
|
function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
|
|
return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
|
|
}
|
|
function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
|
|
return createWorkInProgress(current2, offscreenProps);
|
|
}
|
|
function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
|
|
var currentPrimaryChildFragment = current2.child;
|
|
var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
|
|
var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
});
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
primaryChildFragment.lanes = renderLanes2;
|
|
}
|
|
primaryChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = null;
|
|
if (currentFallbackChildFragment !== null) {
|
|
var deletions = workInProgress2.deletions;
|
|
if (deletions === null) {
|
|
workInProgress2.deletions = [currentFallbackChildFragment];
|
|
workInProgress2.flags |= ChildDeletion;
|
|
} else {
|
|
deletions.push(currentFallbackChildFragment);
|
|
}
|
|
}
|
|
workInProgress2.child = primaryChildFragment;
|
|
return primaryChildFragment;
|
|
}
|
|
function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
|
|
var mode = workInProgress2.mode;
|
|
var currentPrimaryChildFragment = current2.child;
|
|
var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
|
|
var primaryChildProps = {
|
|
mode: "hidden",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment;
|
|
if ((mode & ConcurrentMode) === NoMode && workInProgress2.child !== currentPrimaryChildFragment) {
|
|
var progressedPrimaryFragment = workInProgress2.child;
|
|
primaryChildFragment = progressedPrimaryFragment;
|
|
primaryChildFragment.childLanes = NoLanes;
|
|
primaryChildFragment.pendingProps = primaryChildProps;
|
|
if (workInProgress2.mode & ProfileMode) {
|
|
primaryChildFragment.actualDuration = 0;
|
|
primaryChildFragment.actualStartTime = -1;
|
|
primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
|
|
primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
|
|
}
|
|
workInProgress2.deletions = null;
|
|
} else {
|
|
primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
|
|
primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
|
|
}
|
|
var fallbackChildFragment;
|
|
if (currentFallbackChildFragment !== null) {
|
|
fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
|
|
} else {
|
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
|
|
fallbackChildFragment.flags |= Placement;
|
|
}
|
|
fallbackChildFragment.return = workInProgress2;
|
|
primaryChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = fallbackChildFragment;
|
|
workInProgress2.child = primaryChildFragment;
|
|
return fallbackChildFragment;
|
|
}
|
|
function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
|
|
if (recoverableError !== null) {
|
|
queueHydrationError(recoverableError);
|
|
}
|
|
reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var primaryChildren = nextProps.children;
|
|
var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
|
|
primaryChildFragment.flags |= Placement;
|
|
workInProgress2.memoizedState = null;
|
|
return primaryChildFragment;
|
|
}
|
|
function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
|
|
var fiberMode = workInProgress2.mode;
|
|
var primaryChildProps = {
|
|
mode: "visible",
|
|
children: primaryChildren
|
|
};
|
|
var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
|
|
var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
|
|
fallbackChildFragment.flags |= Placement;
|
|
primaryChildFragment.return = workInProgress2;
|
|
fallbackChildFragment.return = workInProgress2;
|
|
primaryChildFragment.sibling = fallbackChildFragment;
|
|
workInProgress2.child = primaryChildFragment;
|
|
if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
|
|
reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
|
|
}
|
|
return fallbackChildFragment;
|
|
}
|
|
function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
{
|
|
error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
|
|
}
|
|
workInProgress2.lanes = laneToLanes(SyncLane);
|
|
} else if (isSuspenseInstanceFallback(suspenseInstance)) {
|
|
workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
|
|
} else {
|
|
workInProgress2.lanes = laneToLanes(OffscreenLane);
|
|
}
|
|
return null;
|
|
}
|
|
function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
|
|
if (!didSuspend) {
|
|
warnIfHydrating();
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
return retrySuspenseComponentWithoutHydrating(
|
|
current2,
|
|
workInProgress2,
|
|
renderLanes2,
|
|
null
|
|
);
|
|
}
|
|
if (isSuspenseInstanceFallback(suspenseInstance)) {
|
|
var digest, message, stack;
|
|
{
|
|
var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
|
|
digest = _getSuspenseInstanceF.digest;
|
|
message = _getSuspenseInstanceF.message;
|
|
stack = _getSuspenseInstanceF.stack;
|
|
}
|
|
var error2;
|
|
if (message) {
|
|
error2 = new Error(message);
|
|
} else {
|
|
error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
|
|
}
|
|
var capturedValue = createCapturedValue(error2, digest, stack);
|
|
return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
|
|
}
|
|
var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
|
|
if (didReceiveUpdate || hasContextChanged2) {
|
|
var root2 = getWorkInProgressRoot();
|
|
if (root2 !== null) {
|
|
var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
|
|
if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
|
|
suspenseState.retryLane = attemptHydrationAtLane;
|
|
var eventTime = NoTimestamp;
|
|
enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
|
|
scheduleUpdateOnFiber(root2, current2, attemptHydrationAtLane, eventTime);
|
|
}
|
|
}
|
|
renderDidSuspendDelayIfPossible();
|
|
var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
|
|
return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
|
|
} else if (isSuspenseInstancePending(suspenseInstance)) {
|
|
workInProgress2.flags |= DidCapture;
|
|
workInProgress2.child = current2.child;
|
|
var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
|
|
registerSuspenseInstanceRetry(suspenseInstance, retry);
|
|
return null;
|
|
} else {
|
|
reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
|
|
var primaryChildren = nextProps.children;
|
|
var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
|
|
primaryChildFragment.flags |= Hydrating;
|
|
return primaryChildFragment;
|
|
}
|
|
} else {
|
|
if (workInProgress2.flags & ForceClientRender) {
|
|
workInProgress2.flags &= ~ForceClientRender;
|
|
var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
|
|
return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
|
|
} else if (workInProgress2.memoizedState !== null) {
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.flags |= DidCapture;
|
|
return null;
|
|
} else {
|
|
var nextPrimaryChildren = nextProps.children;
|
|
var nextFallbackChildren = nextProps.fallback;
|
|
var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
|
|
var _primaryChildFragment4 = workInProgress2.child;
|
|
_primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
|
|
workInProgress2.memoizedState = SUSPENDED_MARKER;
|
|
return fallbackChildFragment;
|
|
}
|
|
}
|
|
}
|
|
function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
|
|
fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
|
|
}
|
|
scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
|
|
}
|
|
function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
|
|
var node = firstChild;
|
|
while (node !== null) {
|
|
if (node.tag === SuspenseComponent) {
|
|
var state = node.memoizedState;
|
|
if (state !== null) {
|
|
scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
|
|
}
|
|
} else if (node.tag === SuspenseListComponent) {
|
|
scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === workInProgress2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === workInProgress2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
function findLastContentRow(firstChild) {
|
|
var row = firstChild;
|
|
var lastContentRow = null;
|
|
while (row !== null) {
|
|
var currentRow = row.alternate;
|
|
if (currentRow !== null && findFirstSuspended(currentRow) === null) {
|
|
lastContentRow = row;
|
|
}
|
|
row = row.sibling;
|
|
}
|
|
return lastContentRow;
|
|
}
|
|
function validateRevealOrder(revealOrder) {
|
|
{
|
|
if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
|
|
didWarnAboutRevealOrder[revealOrder] = true;
|
|
if (typeof revealOrder === "string") {
|
|
switch (revealOrder.toLowerCase()) {
|
|
case "together":
|
|
case "forwards":
|
|
case "backwards": {
|
|
error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
|
|
break;
|
|
}
|
|
case "forward":
|
|
case "backward": {
|
|
error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
|
|
break;
|
|
}
|
|
default:
|
|
error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
|
|
break;
|
|
}
|
|
} else {
|
|
error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validateTailOptions(tailMode, revealOrder) {
|
|
{
|
|
if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
|
|
if (tailMode !== "collapsed" && tailMode !== "hidden") {
|
|
didWarnAboutTailOptions[tailMode] = true;
|
|
error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
|
|
} else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
|
|
didWarnAboutTailOptions[tailMode] = true;
|
|
error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validateSuspenseListNestedChild(childSlot, index2) {
|
|
{
|
|
var isAnArray = isArray(childSlot);
|
|
var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
|
|
if (isAnArray || isIterable) {
|
|
var type = isAnArray ? "array" : "iterable";
|
|
error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function validateSuspenseListChildren(children, revealOrder) {
|
|
{
|
|
if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
|
|
if (isArray(children)) {
|
|
for (var i2 = 0; i2 < children.length; i2++) {
|
|
if (!validateSuspenseListNestedChild(children[i2], i2)) {
|
|
return;
|
|
}
|
|
}
|
|
} else {
|
|
var iteratorFn = getIteratorFn(children);
|
|
if (typeof iteratorFn === "function") {
|
|
var childrenIterator = iteratorFn.call(children);
|
|
if (childrenIterator) {
|
|
var step = childrenIterator.next();
|
|
var _i = 0;
|
|
for (; !step.done; step = childrenIterator.next()) {
|
|
if (!validateSuspenseListNestedChild(step.value, _i)) {
|
|
return;
|
|
}
|
|
_i++;
|
|
}
|
|
}
|
|
} else {
|
|
error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState === null) {
|
|
workInProgress2.memoizedState = {
|
|
isBackwards,
|
|
rendering: null,
|
|
renderingStartTime: 0,
|
|
last: lastContentRow,
|
|
tail,
|
|
tailMode
|
|
};
|
|
} else {
|
|
renderState.isBackwards = isBackwards;
|
|
renderState.rendering = null;
|
|
renderState.renderingStartTime = 0;
|
|
renderState.last = lastContentRow;
|
|
renderState.tail = tail;
|
|
renderState.tailMode = tailMode;
|
|
}
|
|
}
|
|
function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
|
|
var nextProps = workInProgress2.pendingProps;
|
|
var revealOrder = nextProps.revealOrder;
|
|
var tailMode = nextProps.tail;
|
|
var newChildren = nextProps.children;
|
|
validateRevealOrder(revealOrder);
|
|
validateTailOptions(tailMode, revealOrder);
|
|
validateSuspenseListChildren(newChildren, revealOrder);
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
if (shouldForceFallback) {
|
|
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
workInProgress2.flags |= DidCapture;
|
|
} else {
|
|
var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
|
|
if (didSuspendBefore) {
|
|
propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
|
|
}
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
workInProgress2.memoizedState = null;
|
|
} else {
|
|
switch (revealOrder) {
|
|
case "forwards": {
|
|
var lastContentRow = findLastContentRow(workInProgress2.child);
|
|
var tail;
|
|
if (lastContentRow === null) {
|
|
tail = workInProgress2.child;
|
|
workInProgress2.child = null;
|
|
} else {
|
|
tail = lastContentRow.sibling;
|
|
lastContentRow.sibling = null;
|
|
}
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
false,
|
|
tail,
|
|
lastContentRow,
|
|
tailMode
|
|
);
|
|
break;
|
|
}
|
|
case "backwards": {
|
|
var _tail = null;
|
|
var row = workInProgress2.child;
|
|
workInProgress2.child = null;
|
|
while (row !== null) {
|
|
var currentRow = row.alternate;
|
|
if (currentRow !== null && findFirstSuspended(currentRow) === null) {
|
|
workInProgress2.child = row;
|
|
break;
|
|
}
|
|
var nextRow = row.sibling;
|
|
row.sibling = _tail;
|
|
_tail = row;
|
|
row = nextRow;
|
|
}
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
true,
|
|
_tail,
|
|
null,
|
|
tailMode
|
|
);
|
|
break;
|
|
}
|
|
case "together": {
|
|
initSuspenseListRenderState(
|
|
workInProgress2,
|
|
false,
|
|
null,
|
|
null,
|
|
void 0
|
|
);
|
|
break;
|
|
}
|
|
default: {
|
|
workInProgress2.memoizedState = null;
|
|
}
|
|
}
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
function updatePortalComponent(current2, workInProgress2, renderLanes2) {
|
|
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
|
|
var nextChildren = workInProgress2.pendingProps;
|
|
if (current2 === null) {
|
|
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
} else {
|
|
reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
|
|
}
|
|
return workInProgress2.child;
|
|
}
|
|
var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
|
|
function updateContextProvider(current2, workInProgress2, renderLanes2) {
|
|
var providerType = workInProgress2.type;
|
|
var context = providerType._context;
|
|
var newProps = workInProgress2.pendingProps;
|
|
var oldProps = workInProgress2.memoizedProps;
|
|
var newValue = newProps.value;
|
|
{
|
|
if (!("value" in newProps)) {
|
|
if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
|
|
hasWarnedAboutUsingNoValuePropOnContextProvider = true;
|
|
error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
|
|
}
|
|
}
|
|
var providerPropTypes = workInProgress2.type.propTypes;
|
|
if (providerPropTypes) {
|
|
checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
|
|
}
|
|
}
|
|
pushProvider(workInProgress2, context, newValue);
|
|
{
|
|
if (oldProps !== null) {
|
|
var oldValue = oldProps.value;
|
|
if (objectIs(oldValue, newValue)) {
|
|
if (oldProps.children === newProps.children && !hasContextChanged()) {
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
} else {
|
|
propagateContextChange(workInProgress2, context, renderLanes2);
|
|
}
|
|
}
|
|
}
|
|
var newChildren = newProps.children;
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
var hasWarnedAboutUsingContextAsConsumer = false;
|
|
function updateContextConsumer(current2, workInProgress2, renderLanes2) {
|
|
var context = workInProgress2.type;
|
|
{
|
|
if (context._context === void 0) {
|
|
if (context !== context.Consumer) {
|
|
if (!hasWarnedAboutUsingContextAsConsumer) {
|
|
hasWarnedAboutUsingContextAsConsumer = true;
|
|
error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
}
|
|
}
|
|
} else {
|
|
context = context._context;
|
|
}
|
|
}
|
|
var newProps = workInProgress2.pendingProps;
|
|
var render2 = newProps.children;
|
|
{
|
|
if (typeof render2 !== "function") {
|
|
error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
|
|
}
|
|
}
|
|
prepareToReadContext(workInProgress2, renderLanes2);
|
|
var newValue = readContext(context);
|
|
{
|
|
markComponentRenderStarted(workInProgress2);
|
|
}
|
|
var newChildren;
|
|
{
|
|
ReactCurrentOwner$1.current = workInProgress2;
|
|
setIsRendering(true);
|
|
newChildren = render2(newValue);
|
|
setIsRendering(false);
|
|
}
|
|
{
|
|
markComponentRenderStopped();
|
|
}
|
|
workInProgress2.flags |= PerformedWork;
|
|
reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
|
|
return workInProgress2.child;
|
|
}
|
|
function markWorkInProgressReceivedUpdate() {
|
|
didReceiveUpdate = true;
|
|
}
|
|
function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
|
|
if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
if (current2 !== null) {
|
|
current2.alternate = null;
|
|
workInProgress2.alternate = null;
|
|
workInProgress2.flags |= Placement;
|
|
}
|
|
}
|
|
}
|
|
function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
|
|
if (current2 !== null) {
|
|
workInProgress2.dependencies = current2.dependencies;
|
|
}
|
|
{
|
|
stopProfilerTimerIfRunning();
|
|
}
|
|
markSkippedUpdateLanes(workInProgress2.lanes);
|
|
if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
cloneChildFibers(current2, workInProgress2);
|
|
return workInProgress2.child;
|
|
}
|
|
function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
|
|
{
|
|
var returnFiber = oldWorkInProgress.return;
|
|
if (returnFiber === null) {
|
|
throw new Error("Cannot swap the root fiber.");
|
|
}
|
|
current2.alternate = null;
|
|
oldWorkInProgress.alternate = null;
|
|
newWorkInProgress.index = oldWorkInProgress.index;
|
|
newWorkInProgress.sibling = oldWorkInProgress.sibling;
|
|
newWorkInProgress.return = oldWorkInProgress.return;
|
|
newWorkInProgress.ref = oldWorkInProgress.ref;
|
|
if (oldWorkInProgress === returnFiber.child) {
|
|
returnFiber.child = newWorkInProgress;
|
|
} else {
|
|
var prevSibling = returnFiber.child;
|
|
if (prevSibling === null) {
|
|
throw new Error("Expected parent to have a child.");
|
|
}
|
|
while (prevSibling.sibling !== oldWorkInProgress) {
|
|
prevSibling = prevSibling.sibling;
|
|
if (prevSibling === null) {
|
|
throw new Error("Expected to find the previous sibling.");
|
|
}
|
|
}
|
|
prevSibling.sibling = newWorkInProgress;
|
|
}
|
|
var deletions = returnFiber.deletions;
|
|
if (deletions === null) {
|
|
returnFiber.deletions = [current2];
|
|
returnFiber.flags |= ChildDeletion;
|
|
} else {
|
|
deletions.push(current2);
|
|
}
|
|
newWorkInProgress.flags |= Placement;
|
|
return newWorkInProgress;
|
|
}
|
|
}
|
|
function checkScheduledUpdateOrContext(current2, renderLanes2) {
|
|
var updateLanes = current2.lanes;
|
|
if (includesSomeLane(updateLanes, renderLanes2)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
|
|
switch (workInProgress2.tag) {
|
|
case HostRoot:
|
|
pushHostRootContext(workInProgress2);
|
|
var root2 = workInProgress2.stateNode;
|
|
resetHydrationState();
|
|
break;
|
|
case HostComponent:
|
|
pushHostContext(workInProgress2);
|
|
break;
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
pushContextProvider(workInProgress2);
|
|
}
|
|
break;
|
|
}
|
|
case HostPortal:
|
|
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
|
|
break;
|
|
case ContextProvider: {
|
|
var newValue = workInProgress2.memoizedProps.value;
|
|
var context = workInProgress2.type._context;
|
|
pushProvider(workInProgress2, context, newValue);
|
|
break;
|
|
}
|
|
case Profiler:
|
|
{
|
|
var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
|
|
if (hasChildWork) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
{
|
|
var stateNode = workInProgress2.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
}
|
|
}
|
|
break;
|
|
case SuspenseComponent: {
|
|
var state = workInProgress2.memoizedState;
|
|
if (state !== null) {
|
|
if (state.dehydrated !== null) {
|
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
workInProgress2.flags |= DidCapture;
|
|
return null;
|
|
}
|
|
var primaryChildFragment = workInProgress2.child;
|
|
var primaryChildLanes = primaryChildFragment.childLanes;
|
|
if (includesSomeLane(renderLanes2, primaryChildLanes)) {
|
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
} else {
|
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
if (child !== null) {
|
|
return child.sibling;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
} else {
|
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
}
|
|
break;
|
|
}
|
|
case SuspenseListComponent: {
|
|
var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
|
|
var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
|
|
if (didSuspendBefore) {
|
|
if (_hasChildWork) {
|
|
return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
workInProgress2.flags |= DidCapture;
|
|
}
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState !== null) {
|
|
renderState.rendering = null;
|
|
renderState.tail = null;
|
|
renderState.lastEffect = null;
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
|
|
if (_hasChildWork) {
|
|
break;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent: {
|
|
workInProgress2.lanes = NoLanes;
|
|
return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
}
|
|
function beginWork(current2, workInProgress2, renderLanes2) {
|
|
{
|
|
if (workInProgress2._debugNeedsRemount && current2 !== null) {
|
|
return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
|
|
}
|
|
}
|
|
if (current2 !== null) {
|
|
var oldProps = current2.memoizedProps;
|
|
var newProps = workInProgress2.pendingProps;
|
|
if (oldProps !== newProps || hasContextChanged() || workInProgress2.type !== current2.type) {
|
|
didReceiveUpdate = true;
|
|
} else {
|
|
var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
|
|
if (!hasScheduledUpdateOrContext && (workInProgress2.flags & DidCapture) === NoFlags) {
|
|
didReceiveUpdate = false;
|
|
return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
|
|
}
|
|
if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
didReceiveUpdate = true;
|
|
} else {
|
|
didReceiveUpdate = false;
|
|
}
|
|
}
|
|
} else {
|
|
didReceiveUpdate = false;
|
|
if (getIsHydrating() && isForkedChild(workInProgress2)) {
|
|
var slotIndex = workInProgress2.index;
|
|
var numberOfForks = getForksAtLevel();
|
|
pushTreeId(workInProgress2, numberOfForks, slotIndex);
|
|
}
|
|
}
|
|
workInProgress2.lanes = NoLanes;
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent: {
|
|
return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
|
|
}
|
|
case LazyComponent: {
|
|
var elementType = workInProgress2.elementType;
|
|
return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
|
|
}
|
|
case FunctionComponent: {
|
|
var Component = workInProgress2.type;
|
|
var unresolvedProps = workInProgress2.pendingProps;
|
|
var resolvedProps = workInProgress2.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps);
|
|
return updateFunctionComponent(current2, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
}
|
|
case ClassComponent: {
|
|
var _Component = workInProgress2.type;
|
|
var _unresolvedProps = workInProgress2.pendingProps;
|
|
var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
|
|
return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
|
|
}
|
|
case HostRoot:
|
|
return updateHostRoot(current2, workInProgress2, renderLanes2);
|
|
case HostComponent:
|
|
return updateHostComponent(current2, workInProgress2, renderLanes2);
|
|
case HostText:
|
|
return updateHostText(current2, workInProgress2);
|
|
case SuspenseComponent:
|
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
case HostPortal:
|
|
return updatePortalComponent(current2, workInProgress2, renderLanes2);
|
|
case ForwardRef2: {
|
|
var type = workInProgress2.type;
|
|
var _unresolvedProps2 = workInProgress2.pendingProps;
|
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
|
}
|
|
case Fragment6:
|
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
|
case Mode:
|
|
return updateMode(current2, workInProgress2, renderLanes2);
|
|
case Profiler:
|
|
return updateProfiler(current2, workInProgress2, renderLanes2);
|
|
case ContextProvider:
|
|
return updateContextProvider(current2, workInProgress2, renderLanes2);
|
|
case ContextConsumer:
|
|
return updateContextConsumer(current2, workInProgress2, renderLanes2);
|
|
case MemoComponent: {
|
|
var _type2 = workInProgress2.type;
|
|
var _unresolvedProps3 = workInProgress2.pendingProps;
|
|
var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
|
|
{
|
|
if (workInProgress2.type !== workInProgress2.elementType) {
|
|
var outerPropTypes = _type2.propTypes;
|
|
if (outerPropTypes) {
|
|
checkPropTypes(
|
|
outerPropTypes,
|
|
_resolvedProps3,
|
|
"prop",
|
|
getComponentNameFromType(_type2)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
_resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
|
|
return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
|
|
}
|
|
case SimpleMemoComponent: {
|
|
return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
|
|
}
|
|
case IncompleteClassComponent: {
|
|
var _Component2 = workInProgress2.type;
|
|
var _unresolvedProps4 = workInProgress2.pendingProps;
|
|
var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
|
|
return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
|
|
}
|
|
case SuspenseListComponent: {
|
|
return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
case ScopeComponent: {
|
|
break;
|
|
}
|
|
case OffscreenComponent: {
|
|
return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
|
|
}
|
|
}
|
|
throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
function markUpdate(workInProgress2) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
function markRef$1(workInProgress2) {
|
|
workInProgress2.flags |= Ref;
|
|
{
|
|
workInProgress2.flags |= RefStatic;
|
|
}
|
|
}
|
|
var appendAllChildren;
|
|
var updateHostContainer;
|
|
var updateHostComponent$1;
|
|
var updateHostText$1;
|
|
{
|
|
appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
|
|
var node = workInProgress2.child;
|
|
while (node !== null) {
|
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
appendInitialChild(parent, node.stateNode);
|
|
} else if (node.tag === HostPortal)
|
|
;
|
|
else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === workInProgress2) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === workInProgress2) {
|
|
return;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
};
|
|
updateHostContainer = function(current2, workInProgress2) {
|
|
};
|
|
updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
|
|
var oldProps = current2.memoizedProps;
|
|
if (oldProps === newProps) {
|
|
return;
|
|
}
|
|
var instance = workInProgress2.stateNode;
|
|
var currentHostContext = getHostContext();
|
|
var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
|
|
workInProgress2.updateQueue = updatePayload;
|
|
if (updatePayload) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
};
|
|
updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
|
|
if (oldText !== newText) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
};
|
|
}
|
|
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
|
if (getIsHydrating()) {
|
|
return;
|
|
}
|
|
switch (renderState.tailMode) {
|
|
case "hidden": {
|
|
var tailNode = renderState.tail;
|
|
var lastTailNode = null;
|
|
while (tailNode !== null) {
|
|
if (tailNode.alternate !== null) {
|
|
lastTailNode = tailNode;
|
|
}
|
|
tailNode = tailNode.sibling;
|
|
}
|
|
if (lastTailNode === null) {
|
|
renderState.tail = null;
|
|
} else {
|
|
lastTailNode.sibling = null;
|
|
}
|
|
break;
|
|
}
|
|
case "collapsed": {
|
|
var _tailNode = renderState.tail;
|
|
var _lastTailNode = null;
|
|
while (_tailNode !== null) {
|
|
if (_tailNode.alternate !== null) {
|
|
_lastTailNode = _tailNode;
|
|
}
|
|
_tailNode = _tailNode.sibling;
|
|
}
|
|
if (_lastTailNode === null) {
|
|
if (!hasRenderedATailFallback && renderState.tail !== null) {
|
|
renderState.tail.sibling = null;
|
|
} else {
|
|
renderState.tail = null;
|
|
}
|
|
} else {
|
|
_lastTailNode.sibling = null;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function bubbleProperties(completedWork) {
|
|
var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
|
|
var newChildLanes = NoLanes;
|
|
var subtreeFlags = NoFlags;
|
|
if (!didBailout) {
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
var actualDuration = completedWork.actualDuration;
|
|
var treeBaseDuration = completedWork.selfBaseDuration;
|
|
var child = completedWork.child;
|
|
while (child !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
|
|
subtreeFlags |= child.subtreeFlags;
|
|
subtreeFlags |= child.flags;
|
|
actualDuration += child.actualDuration;
|
|
treeBaseDuration += child.treeBaseDuration;
|
|
child = child.sibling;
|
|
}
|
|
completedWork.actualDuration = actualDuration;
|
|
completedWork.treeBaseDuration = treeBaseDuration;
|
|
} else {
|
|
var _child = completedWork.child;
|
|
while (_child !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
|
|
subtreeFlags |= _child.subtreeFlags;
|
|
subtreeFlags |= _child.flags;
|
|
_child.return = completedWork;
|
|
_child = _child.sibling;
|
|
}
|
|
}
|
|
completedWork.subtreeFlags |= subtreeFlags;
|
|
} else {
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
var _treeBaseDuration = completedWork.selfBaseDuration;
|
|
var _child2 = completedWork.child;
|
|
while (_child2 !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
|
|
subtreeFlags |= _child2.subtreeFlags & StaticMask;
|
|
subtreeFlags |= _child2.flags & StaticMask;
|
|
_treeBaseDuration += _child2.treeBaseDuration;
|
|
_child2 = _child2.sibling;
|
|
}
|
|
completedWork.treeBaseDuration = _treeBaseDuration;
|
|
} else {
|
|
var _child3 = completedWork.child;
|
|
while (_child3 !== null) {
|
|
newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
|
|
subtreeFlags |= _child3.subtreeFlags & StaticMask;
|
|
subtreeFlags |= _child3.flags & StaticMask;
|
|
_child3.return = completedWork;
|
|
_child3 = _child3.sibling;
|
|
}
|
|
}
|
|
completedWork.subtreeFlags |= subtreeFlags;
|
|
}
|
|
completedWork.childLanes = newChildLanes;
|
|
return didBailout;
|
|
}
|
|
function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
|
|
if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
|
|
warnIfUnhydratedTailNodes(workInProgress2);
|
|
resetHydrationState();
|
|
workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
|
|
return false;
|
|
}
|
|
var wasHydrated = popHydrationState(workInProgress2);
|
|
if (nextState !== null && nextState.dehydrated !== null) {
|
|
if (current2 === null) {
|
|
if (!wasHydrated) {
|
|
throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
|
|
}
|
|
prepareToHydrateHostSuspenseInstance(workInProgress2);
|
|
bubbleProperties(workInProgress2);
|
|
{
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
var isTimedOutSuspense = nextState !== null;
|
|
if (isTimedOutSuspense) {
|
|
var primaryChildFragment = workInProgress2.child;
|
|
if (primaryChildFragment !== null) {
|
|
workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
} else {
|
|
resetHydrationState();
|
|
if ((workInProgress2.flags & DidCapture) === NoFlags) {
|
|
workInProgress2.memoizedState = null;
|
|
}
|
|
workInProgress2.flags |= Update;
|
|
bubbleProperties(workInProgress2);
|
|
{
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
var _isTimedOutSuspense = nextState !== null;
|
|
if (_isTimedOutSuspense) {
|
|
var _primaryChildFragment = workInProgress2.child;
|
|
if (_primaryChildFragment !== null) {
|
|
workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
} else {
|
|
upgradeHydrationErrorsToRecoverable();
|
|
return true;
|
|
}
|
|
}
|
|
function completeWork(current2, workInProgress2, renderLanes2) {
|
|
var newProps = workInProgress2.pendingProps;
|
|
popTreeContext(workInProgress2);
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent:
|
|
case LazyComponent:
|
|
case SimpleMemoComponent:
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case Fragment6:
|
|
case Mode:
|
|
case Profiler:
|
|
case ContextConsumer:
|
|
case MemoComponent:
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostRoot: {
|
|
var fiberRoot = workInProgress2.stateNode;
|
|
popHostContainer(workInProgress2);
|
|
popTopLevelContextObject(workInProgress2);
|
|
resetWorkInProgressVersions();
|
|
if (fiberRoot.pendingContext) {
|
|
fiberRoot.context = fiberRoot.pendingContext;
|
|
fiberRoot.pendingContext = null;
|
|
}
|
|
if (current2 === null || current2.child === null) {
|
|
var wasHydrated = popHydrationState(workInProgress2);
|
|
if (wasHydrated) {
|
|
markUpdate(workInProgress2);
|
|
} else {
|
|
if (current2 !== null) {
|
|
var prevState = current2.memoizedState;
|
|
if (!prevState.isDehydrated || (workInProgress2.flags & ForceClientRender) !== NoFlags) {
|
|
workInProgress2.flags |= Snapshot;
|
|
upgradeHydrationErrorsToRecoverable();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
updateHostContainer(current2, workInProgress2);
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(workInProgress2);
|
|
var rootContainerInstance = getRootHostContainer();
|
|
var type = workInProgress2.type;
|
|
if (current2 !== null && workInProgress2.stateNode != null) {
|
|
updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
|
|
if (current2.ref !== workInProgress2.ref) {
|
|
markRef$1(workInProgress2);
|
|
}
|
|
} else {
|
|
if (!newProps) {
|
|
if (workInProgress2.stateNode === null) {
|
|
throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
var currentHostContext = getHostContext();
|
|
var _wasHydrated = popHydrationState(workInProgress2);
|
|
if (_wasHydrated) {
|
|
if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
} else {
|
|
var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
|
|
appendAllChildren(instance, workInProgress2, false, false);
|
|
workInProgress2.stateNode = instance;
|
|
if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
}
|
|
if (workInProgress2.ref !== null) {
|
|
markRef$1(workInProgress2);
|
|
}
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostText: {
|
|
var newText = newProps;
|
|
if (current2 && workInProgress2.stateNode != null) {
|
|
var oldText = current2.memoizedProps;
|
|
updateHostText$1(current2, workInProgress2, oldText, newText);
|
|
} else {
|
|
if (typeof newText !== "string") {
|
|
if (workInProgress2.stateNode === null) {
|
|
throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
var _rootContainerInstance = getRootHostContainer();
|
|
var _currentHostContext = getHostContext();
|
|
var _wasHydrated2 = popHydrationState(workInProgress2);
|
|
if (_wasHydrated2) {
|
|
if (prepareToHydrateHostTextInstance(workInProgress2)) {
|
|
markUpdate(workInProgress2);
|
|
}
|
|
} else {
|
|
workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
|
|
}
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case SuspenseComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var nextState = workInProgress2.memoizedState;
|
|
if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
|
|
var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
|
|
if (!fallthroughToNormalSuspensePath) {
|
|
if (workInProgress2.flags & ShouldCapture) {
|
|
return workInProgress2;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
if ((workInProgress2.flags & DidCapture) !== NoFlags) {
|
|
workInProgress2.lanes = renderLanes2;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
var nextDidTimeout = nextState !== null;
|
|
var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
|
|
if (nextDidTimeout !== prevDidTimeout) {
|
|
if (nextDidTimeout) {
|
|
var _offscreenFiber2 = workInProgress2.child;
|
|
_offscreenFiber2.flags |= Visibility;
|
|
if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
|
|
var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
|
|
if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
|
|
renderDidSuspend();
|
|
} else {
|
|
renderDidSuspendDelayIfPossible();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var wakeables = workInProgress2.updateQueue;
|
|
if (wakeables !== null) {
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
{
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
if (nextDidTimeout) {
|
|
var primaryChildFragment = workInProgress2.child;
|
|
if (primaryChildFragment !== null) {
|
|
workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(workInProgress2);
|
|
updateHostContainer(current2, workInProgress2);
|
|
if (current2 === null) {
|
|
preparePortalMount(workInProgress2.stateNode.containerInfo);
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case ContextProvider:
|
|
var context = workInProgress2.type._context;
|
|
popProvider(context, workInProgress2);
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
case IncompleteClassComponent: {
|
|
var _Component = workInProgress2.type;
|
|
if (isContextProvider(_Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case SuspenseListComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var renderState = workInProgress2.memoizedState;
|
|
if (renderState === null) {
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
|
|
var renderedTail = renderState.rendering;
|
|
if (renderedTail === null) {
|
|
if (!didSuspendAlready) {
|
|
var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
|
|
if (!cannotBeSuspended) {
|
|
var row = workInProgress2.child;
|
|
while (row !== null) {
|
|
var suspended = findFirstSuspended(row);
|
|
if (suspended !== null) {
|
|
didSuspendAlready = true;
|
|
workInProgress2.flags |= DidCapture;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
var newThenables = suspended.updateQueue;
|
|
if (newThenables !== null) {
|
|
workInProgress2.updateQueue = newThenables;
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
workInProgress2.subtreeFlags = NoFlags;
|
|
resetChildFibers(workInProgress2, renderLanes2);
|
|
pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
|
|
return workInProgress2.child;
|
|
}
|
|
row = row.sibling;
|
|
}
|
|
}
|
|
if (renderState.tail !== null && now() > getRenderTargetTime()) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
workInProgress2.lanes = SomeRetryLane;
|
|
}
|
|
} else {
|
|
cutOffTailIfNeeded(renderState, false);
|
|
}
|
|
} else {
|
|
if (!didSuspendAlready) {
|
|
var _suspended = findFirstSuspended(renderedTail);
|
|
if (_suspended !== null) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
var _newThenables = _suspended.updateQueue;
|
|
if (_newThenables !== null) {
|
|
workInProgress2.updateQueue = _newThenables;
|
|
workInProgress2.flags |= Update;
|
|
}
|
|
cutOffTailIfNeeded(renderState, true);
|
|
if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
} else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) {
|
|
workInProgress2.flags |= DidCapture;
|
|
didSuspendAlready = true;
|
|
cutOffTailIfNeeded(renderState, false);
|
|
workInProgress2.lanes = SomeRetryLane;
|
|
}
|
|
}
|
|
if (renderState.isBackwards) {
|
|
renderedTail.sibling = workInProgress2.child;
|
|
workInProgress2.child = renderedTail;
|
|
} else {
|
|
var previousSibling = renderState.last;
|
|
if (previousSibling !== null) {
|
|
previousSibling.sibling = renderedTail;
|
|
} else {
|
|
workInProgress2.child = renderedTail;
|
|
}
|
|
renderState.last = renderedTail;
|
|
}
|
|
}
|
|
if (renderState.tail !== null) {
|
|
var next = renderState.tail;
|
|
renderState.rendering = next;
|
|
renderState.tail = next.sibling;
|
|
renderState.renderingStartTime = now();
|
|
next.sibling = null;
|
|
var suspenseContext = suspenseStackCursor.current;
|
|
if (didSuspendAlready) {
|
|
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
} else {
|
|
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
|
|
}
|
|
pushSuspenseContext(workInProgress2, suspenseContext);
|
|
return next;
|
|
}
|
|
bubbleProperties(workInProgress2);
|
|
return null;
|
|
}
|
|
case ScopeComponent: {
|
|
break;
|
|
}
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent: {
|
|
popRenderLanes(workInProgress2);
|
|
var _nextState = workInProgress2.memoizedState;
|
|
var nextIsHidden = _nextState !== null;
|
|
if (current2 !== null) {
|
|
var _prevState = current2.memoizedState;
|
|
var prevIsHidden = _prevState !== null;
|
|
if (prevIsHidden !== nextIsHidden && !enableLegacyHidden) {
|
|
workInProgress2.flags |= Visibility;
|
|
}
|
|
}
|
|
if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
|
|
bubbleProperties(workInProgress2);
|
|
} else {
|
|
if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
|
|
bubbleProperties(workInProgress2);
|
|
{
|
|
if (workInProgress2.subtreeFlags & (Placement | Update)) {
|
|
workInProgress2.flags |= Visibility;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
case CacheComponent: {
|
|
return null;
|
|
}
|
|
case TracingMarkerComponent: {
|
|
return null;
|
|
}
|
|
}
|
|
throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
function unwindWork(current2, workInProgress2, renderLanes2) {
|
|
popTreeContext(workInProgress2);
|
|
switch (workInProgress2.tag) {
|
|
case ClassComponent: {
|
|
var Component = workInProgress2.type;
|
|
if (isContextProvider(Component)) {
|
|
popContext(workInProgress2);
|
|
}
|
|
var flags = workInProgress2.flags;
|
|
if (flags & ShouldCapture) {
|
|
workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
return null;
|
|
}
|
|
case HostRoot: {
|
|
var root2 = workInProgress2.stateNode;
|
|
popHostContainer(workInProgress2);
|
|
popTopLevelContextObject(workInProgress2);
|
|
resetWorkInProgressVersions();
|
|
var _flags = workInProgress2.flags;
|
|
if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
|
|
workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
|
|
return workInProgress2;
|
|
}
|
|
return null;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(workInProgress2);
|
|
return null;
|
|
}
|
|
case SuspenseComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
var suspenseState = workInProgress2.memoizedState;
|
|
if (suspenseState !== null && suspenseState.dehydrated !== null) {
|
|
if (workInProgress2.alternate === null) {
|
|
throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
|
|
}
|
|
resetHydrationState();
|
|
}
|
|
var _flags2 = workInProgress2.flags;
|
|
if (_flags2 & ShouldCapture) {
|
|
workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
|
|
if ((workInProgress2.mode & ProfileMode) !== NoMode) {
|
|
transferActualDuration(workInProgress2);
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
return null;
|
|
}
|
|
case SuspenseListComponent: {
|
|
popSuspenseContext(workInProgress2);
|
|
return null;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(workInProgress2);
|
|
return null;
|
|
case ContextProvider:
|
|
var context = workInProgress2.type._context;
|
|
popProvider(context, workInProgress2);
|
|
return null;
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
popRenderLanes(workInProgress2);
|
|
return null;
|
|
case CacheComponent:
|
|
return null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
|
|
popTreeContext(interruptedWork);
|
|
switch (interruptedWork.tag) {
|
|
case ClassComponent: {
|
|
var childContextTypes = interruptedWork.type.childContextTypes;
|
|
if (childContextTypes !== null && childContextTypes !== void 0) {
|
|
popContext(interruptedWork);
|
|
}
|
|
break;
|
|
}
|
|
case HostRoot: {
|
|
var root2 = interruptedWork.stateNode;
|
|
popHostContainer(interruptedWork);
|
|
popTopLevelContextObject(interruptedWork);
|
|
resetWorkInProgressVersions();
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
popHostContext(interruptedWork);
|
|
break;
|
|
}
|
|
case HostPortal:
|
|
popHostContainer(interruptedWork);
|
|
break;
|
|
case SuspenseComponent:
|
|
popSuspenseContext(interruptedWork);
|
|
break;
|
|
case SuspenseListComponent:
|
|
popSuspenseContext(interruptedWork);
|
|
break;
|
|
case ContextProvider:
|
|
var context = interruptedWork.type._context;
|
|
popProvider(context, interruptedWork);
|
|
break;
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
popRenderLanes(interruptedWork);
|
|
break;
|
|
}
|
|
}
|
|
var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
|
|
{
|
|
didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
|
|
}
|
|
var offscreenSubtreeIsHidden = false;
|
|
var offscreenSubtreeWasHidden = false;
|
|
var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
|
|
var nextEffect = null;
|
|
var inProgressLanes = null;
|
|
var inProgressRoot = null;
|
|
function reportUncaughtErrorInDEV(error2) {
|
|
{
|
|
invokeGuardedCallback(null, function() {
|
|
throw error2;
|
|
});
|
|
clearCaughtError();
|
|
}
|
|
}
|
|
var callComponentWillUnmountWithTimer = function(current2, instance) {
|
|
instance.props = current2.memoizedProps;
|
|
instance.state = current2.memoizedState;
|
|
if (current2.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
instance.componentWillUnmount();
|
|
} finally {
|
|
recordLayoutEffectDuration(current2);
|
|
}
|
|
} else {
|
|
instance.componentWillUnmount();
|
|
}
|
|
};
|
|
function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
|
|
try {
|
|
commitHookEffectListMount(Layout, current2);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
}
|
|
function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
|
|
try {
|
|
callComponentWillUnmountWithTimer(current2, instance);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
}
|
|
function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
|
|
try {
|
|
instance.componentDidMount();
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
}
|
|
function safelyAttachRef(current2, nearestMountedAncestor) {
|
|
try {
|
|
commitAttachRef(current2);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
}
|
|
function safelyDetachRef(current2, nearestMountedAncestor) {
|
|
var ref = current2.ref;
|
|
if (ref !== null) {
|
|
if (typeof ref === "function") {
|
|
var retVal;
|
|
try {
|
|
if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
retVal = ref(null);
|
|
} finally {
|
|
recordLayoutEffectDuration(current2);
|
|
}
|
|
} else {
|
|
retVal = ref(null);
|
|
}
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
{
|
|
if (typeof retVal === "function") {
|
|
error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
|
|
}
|
|
}
|
|
} else {
|
|
ref.current = null;
|
|
}
|
|
}
|
|
}
|
|
function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
|
|
try {
|
|
destroy();
|
|
} catch (error2) {
|
|
captureCommitPhaseError(current2, nearestMountedAncestor, error2);
|
|
}
|
|
}
|
|
var focusedInstanceHandle = null;
|
|
var shouldFireAfterActiveInstanceBlur = false;
|
|
function commitBeforeMutationEffects(root2, firstChild) {
|
|
focusedInstanceHandle = prepareForCommit(root2.containerInfo);
|
|
nextEffect = firstChild;
|
|
commitBeforeMutationEffects_begin();
|
|
var shouldFire = shouldFireAfterActiveInstanceBlur;
|
|
shouldFireAfterActiveInstanceBlur = false;
|
|
focusedInstanceHandle = null;
|
|
return shouldFire;
|
|
}
|
|
function commitBeforeMutationEffects_begin() {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var child = fiber.child;
|
|
if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
|
|
child.return = fiber;
|
|
nextEffect = child;
|
|
} else {
|
|
commitBeforeMutationEffects_complete();
|
|
}
|
|
}
|
|
}
|
|
function commitBeforeMutationEffects_complete() {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
setCurrentFiber(fiber);
|
|
try {
|
|
commitBeforeMutationEffectsOnFiber(fiber);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
resetCurrentFiber();
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function commitBeforeMutationEffectsOnFiber(finishedWork) {
|
|
var current2 = finishedWork.alternate;
|
|
var flags = finishedWork.flags;
|
|
if ((flags & Snapshot) !== NoFlags) {
|
|
setCurrentFiber(finishedWork);
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
if (current2 !== null) {
|
|
var prevProps = current2.memoizedProps;
|
|
var prevState = current2.memoizedState;
|
|
var instance = finishedWork.stateNode;
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
}
|
|
}
|
|
var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
|
|
{
|
|
var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
|
|
if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
|
|
didWarnSet.add(finishedWork.type);
|
|
error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork));
|
|
}
|
|
}
|
|
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
|
}
|
|
break;
|
|
}
|
|
case HostRoot: {
|
|
{
|
|
var root2 = finishedWork.stateNode;
|
|
clearContainer(root2.containerInfo);
|
|
}
|
|
break;
|
|
}
|
|
case HostComponent:
|
|
case HostText:
|
|
case HostPortal:
|
|
case IncompleteClassComponent:
|
|
break;
|
|
default: {
|
|
throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
if ((effect.tag & flags) === flags) {
|
|
var destroy = effect.destroy;
|
|
effect.destroy = void 0;
|
|
if (destroy !== void 0) {
|
|
{
|
|
if ((flags & Passive$1) !== NoFlags$1) {
|
|
markComponentPassiveEffectUnmountStarted(finishedWork);
|
|
} else if ((flags & Layout) !== NoFlags$1) {
|
|
markComponentLayoutEffectUnmountStarted(finishedWork);
|
|
}
|
|
}
|
|
{
|
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
setIsRunningInsertionEffect(true);
|
|
}
|
|
}
|
|
safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
|
|
{
|
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
setIsRunningInsertionEffect(false);
|
|
}
|
|
}
|
|
{
|
|
if ((flags & Passive$1) !== NoFlags$1) {
|
|
markComponentPassiveEffectUnmountStopped();
|
|
} else if ((flags & Layout) !== NoFlags$1) {
|
|
markComponentLayoutEffectUnmountStopped();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
function commitHookEffectListMount(flags, finishedWork) {
|
|
var updateQueue = finishedWork.updateQueue;
|
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
if ((effect.tag & flags) === flags) {
|
|
{
|
|
if ((flags & Passive$1) !== NoFlags$1) {
|
|
markComponentPassiveEffectMountStarted(finishedWork);
|
|
} else if ((flags & Layout) !== NoFlags$1) {
|
|
markComponentLayoutEffectMountStarted(finishedWork);
|
|
}
|
|
}
|
|
var create = effect.create;
|
|
{
|
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
setIsRunningInsertionEffect(true);
|
|
}
|
|
}
|
|
effect.destroy = create();
|
|
{
|
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
setIsRunningInsertionEffect(false);
|
|
}
|
|
}
|
|
{
|
|
if ((flags & Passive$1) !== NoFlags$1) {
|
|
markComponentPassiveEffectMountStopped();
|
|
} else if ((flags & Layout) !== NoFlags$1) {
|
|
markComponentLayoutEffectMountStopped();
|
|
}
|
|
}
|
|
{
|
|
var destroy = effect.destroy;
|
|
if (destroy !== void 0 && typeof destroy !== "function") {
|
|
var hookName = void 0;
|
|
if ((effect.tag & Layout) !== NoFlags) {
|
|
hookName = "useLayoutEffect";
|
|
} else if ((effect.tag & Insertion) !== NoFlags) {
|
|
hookName = "useInsertionEffect";
|
|
} else {
|
|
hookName = "useEffect";
|
|
}
|
|
var addendum = void 0;
|
|
if (destroy === null) {
|
|
addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
|
|
} else if (typeof destroy.then === "function") {
|
|
addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
|
|
} else {
|
|
addendum = " You returned: " + destroy;
|
|
}
|
|
error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
function commitPassiveEffectDurations(finishedRoot, finishedWork) {
|
|
{
|
|
if ((finishedWork.flags & Update) !== NoFlags) {
|
|
switch (finishedWork.tag) {
|
|
case Profiler: {
|
|
var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
|
|
var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
|
|
var commitTime2 = getCommitTime();
|
|
var phase = finishedWork.alternate === null ? "mount" : "update";
|
|
{
|
|
if (isCurrentUpdateNested()) {
|
|
phase = "nested-update";
|
|
}
|
|
}
|
|
if (typeof onPostCommit === "function") {
|
|
onPostCommit(id, phase, passiveEffectDuration, commitTime2);
|
|
}
|
|
var parentFiber = finishedWork.return;
|
|
outer:
|
|
while (parentFiber !== null) {
|
|
switch (parentFiber.tag) {
|
|
case HostRoot:
|
|
var root2 = parentFiber.stateNode;
|
|
root2.passiveEffectDuration += passiveEffectDuration;
|
|
break outer;
|
|
case Profiler:
|
|
var parentStateNode = parentFiber.stateNode;
|
|
parentStateNode.passiveEffectDuration += passiveEffectDuration;
|
|
break outer;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
|
|
if ((finishedWork.flags & LayoutMask) !== NoFlags) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
if (!offscreenSubtreeWasHidden) {
|
|
if (finishedWork.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
commitHookEffectListMount(Layout | HasEffect, finishedWork);
|
|
} finally {
|
|
recordLayoutEffectDuration(finishedWork);
|
|
}
|
|
} else {
|
|
commitHookEffectListMount(Layout | HasEffect, finishedWork);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
var instance = finishedWork.stateNode;
|
|
if (finishedWork.flags & Update) {
|
|
if (!offscreenSubtreeWasHidden) {
|
|
if (current2 === null) {
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
}
|
|
}
|
|
if (finishedWork.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
instance.componentDidMount();
|
|
} finally {
|
|
recordLayoutEffectDuration(finishedWork);
|
|
}
|
|
} else {
|
|
instance.componentDidMount();
|
|
}
|
|
} else {
|
|
var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
|
|
var prevState = current2.memoizedState;
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
}
|
|
}
|
|
if (finishedWork.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
|
|
} finally {
|
|
recordLayoutEffectDuration(finishedWork);
|
|
}
|
|
} else {
|
|
instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var updateQueue = finishedWork.updateQueue;
|
|
if (updateQueue !== null) {
|
|
{
|
|
if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
|
if (instance.props !== finishedWork.memoizedProps) {
|
|
error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
if (instance.state !== finishedWork.memoizedState) {
|
|
error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
|
|
}
|
|
}
|
|
}
|
|
commitUpdateQueue(finishedWork, updateQueue, instance);
|
|
}
|
|
break;
|
|
}
|
|
case HostRoot: {
|
|
var _updateQueue = finishedWork.updateQueue;
|
|
if (_updateQueue !== null) {
|
|
var _instance = null;
|
|
if (finishedWork.child !== null) {
|
|
switch (finishedWork.child.tag) {
|
|
case HostComponent:
|
|
_instance = getPublicInstance(finishedWork.child.stateNode);
|
|
break;
|
|
case ClassComponent:
|
|
_instance = finishedWork.child.stateNode;
|
|
break;
|
|
}
|
|
}
|
|
commitUpdateQueue(finishedWork, _updateQueue, _instance);
|
|
}
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
var _instance2 = finishedWork.stateNode;
|
|
if (current2 === null && finishedWork.flags & Update) {
|
|
var type = finishedWork.type;
|
|
var props = finishedWork.memoizedProps;
|
|
commitMount(_instance2, type, props);
|
|
}
|
|
break;
|
|
}
|
|
case HostText: {
|
|
break;
|
|
}
|
|
case HostPortal: {
|
|
break;
|
|
}
|
|
case Profiler: {
|
|
{
|
|
var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
|
|
var effectDuration = finishedWork.stateNode.effectDuration;
|
|
var commitTime2 = getCommitTime();
|
|
var phase = current2 === null ? "mount" : "update";
|
|
{
|
|
if (isCurrentUpdateNested()) {
|
|
phase = "nested-update";
|
|
}
|
|
}
|
|
if (typeof onRender === "function") {
|
|
onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
|
|
}
|
|
{
|
|
if (typeof onCommit === "function") {
|
|
onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
|
|
}
|
|
enqueuePendingPassiveProfilerEffect(finishedWork);
|
|
var parentFiber = finishedWork.return;
|
|
outer:
|
|
while (parentFiber !== null) {
|
|
switch (parentFiber.tag) {
|
|
case HostRoot:
|
|
var root2 = parentFiber.stateNode;
|
|
root2.effectDuration += effectDuration;
|
|
break outer;
|
|
case Profiler:
|
|
var parentStateNode = parentFiber.stateNode;
|
|
parentStateNode.effectDuration += effectDuration;
|
|
break outer;
|
|
}
|
|
parentFiber = parentFiber.return;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case SuspenseComponent: {
|
|
commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
|
|
break;
|
|
}
|
|
case SuspenseListComponent:
|
|
case IncompleteClassComponent:
|
|
case ScopeComponent:
|
|
case OffscreenComponent:
|
|
case LegacyHiddenComponent:
|
|
case TracingMarkerComponent: {
|
|
break;
|
|
}
|
|
default:
|
|
throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
if (!offscreenSubtreeWasHidden) {
|
|
{
|
|
if (finishedWork.flags & Ref) {
|
|
commitAttachRef(finishedWork);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function reappearLayoutEffectsOnFiber(node) {
|
|
switch (node.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
if (node.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
safelyCallCommitHookLayoutEffectListMount(node, node.return);
|
|
} finally {
|
|
recordLayoutEffectDuration(node);
|
|
}
|
|
} else {
|
|
safelyCallCommitHookLayoutEffectListMount(node, node.return);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
var instance = node.stateNode;
|
|
if (typeof instance.componentDidMount === "function") {
|
|
safelyCallComponentDidMount(node, node.return, instance);
|
|
}
|
|
safelyAttachRef(node, node.return);
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
safelyAttachRef(node, node.return);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function hideOrUnhideAllChildren(finishedWork, isHidden) {
|
|
var hostSubtreeRoot = null;
|
|
{
|
|
var node = finishedWork;
|
|
while (true) {
|
|
if (node.tag === HostComponent) {
|
|
if (hostSubtreeRoot === null) {
|
|
hostSubtreeRoot = node;
|
|
try {
|
|
var instance = node.stateNode;
|
|
if (isHidden) {
|
|
hideInstance(instance);
|
|
} else {
|
|
unhideInstance(node.stateNode, node.memoizedProps);
|
|
}
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
} else if (node.tag === HostText) {
|
|
if (hostSubtreeRoot === null) {
|
|
try {
|
|
var _instance3 = node.stateNode;
|
|
if (isHidden) {
|
|
hideTextInstance(_instance3);
|
|
} else {
|
|
unhideTextInstance(_instance3, node.memoizedProps);
|
|
}
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
} else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork)
|
|
;
|
|
else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === finishedWork) {
|
|
return;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === finishedWork) {
|
|
return;
|
|
}
|
|
if (hostSubtreeRoot === node) {
|
|
hostSubtreeRoot = null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
if (hostSubtreeRoot === node) {
|
|
hostSubtreeRoot = null;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
}
|
|
function commitAttachRef(finishedWork) {
|
|
var ref = finishedWork.ref;
|
|
if (ref !== null) {
|
|
var instance = finishedWork.stateNode;
|
|
var instanceToUse;
|
|
switch (finishedWork.tag) {
|
|
case HostComponent:
|
|
instanceToUse = getPublicInstance(instance);
|
|
break;
|
|
default:
|
|
instanceToUse = instance;
|
|
}
|
|
if (typeof ref === "function") {
|
|
var retVal;
|
|
if (finishedWork.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
retVal = ref(instanceToUse);
|
|
} finally {
|
|
recordLayoutEffectDuration(finishedWork);
|
|
}
|
|
} else {
|
|
retVal = ref(instanceToUse);
|
|
}
|
|
{
|
|
if (typeof retVal === "function") {
|
|
error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
|
|
}
|
|
}
|
|
} else {
|
|
{
|
|
if (!ref.hasOwnProperty("current")) {
|
|
error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
|
|
}
|
|
}
|
|
ref.current = instanceToUse;
|
|
}
|
|
}
|
|
}
|
|
function detachFiberMutation(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
alternate.return = null;
|
|
}
|
|
fiber.return = null;
|
|
}
|
|
function detachFiberAfterEffects(fiber) {
|
|
var alternate = fiber.alternate;
|
|
if (alternate !== null) {
|
|
fiber.alternate = null;
|
|
detachFiberAfterEffects(alternate);
|
|
}
|
|
{
|
|
fiber.child = null;
|
|
fiber.deletions = null;
|
|
fiber.sibling = null;
|
|
if (fiber.tag === HostComponent) {
|
|
var hostInstance = fiber.stateNode;
|
|
if (hostInstance !== null) {
|
|
detachDeletedInstance(hostInstance);
|
|
}
|
|
}
|
|
fiber.stateNode = null;
|
|
{
|
|
fiber._debugOwner = null;
|
|
}
|
|
{
|
|
fiber.return = null;
|
|
fiber.dependencies = null;
|
|
fiber.memoizedProps = null;
|
|
fiber.memoizedState = null;
|
|
fiber.pendingProps = null;
|
|
fiber.stateNode = null;
|
|
fiber.updateQueue = null;
|
|
}
|
|
}
|
|
}
|
|
function getHostParentFiber(fiber) {
|
|
var parent = fiber.return;
|
|
while (parent !== null) {
|
|
if (isHostParent(parent)) {
|
|
return parent;
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
function isHostParent(fiber) {
|
|
return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
|
|
}
|
|
function getHostSibling(fiber) {
|
|
var node = fiber;
|
|
siblings:
|
|
while (true) {
|
|
while (node.sibling === null) {
|
|
if (node.return === null || isHostParent(node.return)) {
|
|
return null;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
|
|
if (node.flags & Placement) {
|
|
continue siblings;
|
|
}
|
|
if (node.child === null || node.tag === HostPortal) {
|
|
continue siblings;
|
|
} else {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
}
|
|
}
|
|
if (!(node.flags & Placement)) {
|
|
return node.stateNode;
|
|
}
|
|
}
|
|
}
|
|
function commitPlacement(finishedWork) {
|
|
var parentFiber = getHostParentFiber(finishedWork);
|
|
switch (parentFiber.tag) {
|
|
case HostComponent: {
|
|
var parent = parentFiber.stateNode;
|
|
if (parentFiber.flags & ContentReset) {
|
|
resetTextContent(parent);
|
|
parentFiber.flags &= ~ContentReset;
|
|
}
|
|
var before = getHostSibling(finishedWork);
|
|
insertOrAppendPlacementNode(finishedWork, before, parent);
|
|
break;
|
|
}
|
|
case HostRoot:
|
|
case HostPortal: {
|
|
var _parent = parentFiber.stateNode.containerInfo;
|
|
var _before = getHostSibling(finishedWork);
|
|
insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
|
|
break;
|
|
}
|
|
default:
|
|
throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
|
|
var tag = node.tag;
|
|
var isHost = tag === HostComponent || tag === HostText;
|
|
if (isHost) {
|
|
var stateNode = node.stateNode;
|
|
if (before) {
|
|
insertInContainerBefore(parent, stateNode, before);
|
|
} else {
|
|
appendChildToContainer(parent, stateNode);
|
|
}
|
|
} else if (tag === HostPortal)
|
|
;
|
|
else {
|
|
var child = node.child;
|
|
if (child !== null) {
|
|
insertOrAppendPlacementNodeIntoContainer(child, before, parent);
|
|
var sibling = child.sibling;
|
|
while (sibling !== null) {
|
|
insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
|
|
sibling = sibling.sibling;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function insertOrAppendPlacementNode(node, before, parent) {
|
|
var tag = node.tag;
|
|
var isHost = tag === HostComponent || tag === HostText;
|
|
if (isHost) {
|
|
var stateNode = node.stateNode;
|
|
if (before) {
|
|
insertBefore(parent, stateNode, before);
|
|
} else {
|
|
appendChild(parent, stateNode);
|
|
}
|
|
} else if (tag === HostPortal)
|
|
;
|
|
else {
|
|
var child = node.child;
|
|
if (child !== null) {
|
|
insertOrAppendPlacementNode(child, before, parent);
|
|
var sibling = child.sibling;
|
|
while (sibling !== null) {
|
|
insertOrAppendPlacementNode(sibling, before, parent);
|
|
sibling = sibling.sibling;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var hostParent = null;
|
|
var hostParentIsContainer = false;
|
|
function commitDeletionEffects(root2, returnFiber, deletedFiber) {
|
|
{
|
|
var parent = returnFiber;
|
|
findParent:
|
|
while (parent !== null) {
|
|
switch (parent.tag) {
|
|
case HostComponent: {
|
|
hostParent = parent.stateNode;
|
|
hostParentIsContainer = false;
|
|
break findParent;
|
|
}
|
|
case HostRoot: {
|
|
hostParent = parent.stateNode.containerInfo;
|
|
hostParentIsContainer = true;
|
|
break findParent;
|
|
}
|
|
case HostPortal: {
|
|
hostParent = parent.stateNode.containerInfo;
|
|
hostParentIsContainer = true;
|
|
break findParent;
|
|
}
|
|
}
|
|
parent = parent.return;
|
|
}
|
|
if (hostParent === null) {
|
|
throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
commitDeletionEffectsOnFiber(root2, returnFiber, deletedFiber);
|
|
hostParent = null;
|
|
hostParentIsContainer = false;
|
|
}
|
|
detachFiberMutation(deletedFiber);
|
|
}
|
|
function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
|
|
var child = parent.child;
|
|
while (child !== null) {
|
|
commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
|
|
onCommitUnmount(deletedFiber);
|
|
switch (deletedFiber.tag) {
|
|
case HostComponent: {
|
|
if (!offscreenSubtreeWasHidden) {
|
|
safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
}
|
|
}
|
|
case HostText: {
|
|
{
|
|
var prevHostParent = hostParent;
|
|
var prevHostParentIsContainer = hostParentIsContainer;
|
|
hostParent = null;
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
hostParent = prevHostParent;
|
|
hostParentIsContainer = prevHostParentIsContainer;
|
|
if (hostParent !== null) {
|
|
if (hostParentIsContainer) {
|
|
removeChildFromContainer(hostParent, deletedFiber.stateNode);
|
|
} else {
|
|
removeChild(hostParent, deletedFiber.stateNode);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case DehydratedFragment: {
|
|
{
|
|
if (hostParent !== null) {
|
|
if (hostParentIsContainer) {
|
|
clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
|
|
} else {
|
|
clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostPortal: {
|
|
{
|
|
var _prevHostParent = hostParent;
|
|
var _prevHostParentIsContainer = hostParentIsContainer;
|
|
hostParent = deletedFiber.stateNode.containerInfo;
|
|
hostParentIsContainer = true;
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
hostParent = _prevHostParent;
|
|
hostParentIsContainer = _prevHostParentIsContainer;
|
|
}
|
|
return;
|
|
}
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent: {
|
|
if (!offscreenSubtreeWasHidden) {
|
|
var updateQueue = deletedFiber.updateQueue;
|
|
if (updateQueue !== null) {
|
|
var lastEffect = updateQueue.lastEffect;
|
|
if (lastEffect !== null) {
|
|
var firstEffect = lastEffect.next;
|
|
var effect = firstEffect;
|
|
do {
|
|
var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
|
|
if (destroy !== void 0) {
|
|
if ((tag & Insertion) !== NoFlags$1) {
|
|
safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
|
|
} else if ((tag & Layout) !== NoFlags$1) {
|
|
{
|
|
markComponentLayoutEffectUnmountStarted(deletedFiber);
|
|
}
|
|
if (deletedFiber.mode & ProfileMode) {
|
|
startLayoutEffectTimer();
|
|
safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
|
|
recordLayoutEffectDuration(deletedFiber);
|
|
} else {
|
|
safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
|
|
}
|
|
{
|
|
markComponentLayoutEffectUnmountStopped();
|
|
}
|
|
}
|
|
}
|
|
effect = effect.next;
|
|
} while (effect !== firstEffect);
|
|
}
|
|
}
|
|
}
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
if (!offscreenSubtreeWasHidden) {
|
|
safelyDetachRef(deletedFiber, nearestMountedAncestor);
|
|
var instance = deletedFiber.stateNode;
|
|
if (typeof instance.componentWillUnmount === "function") {
|
|
safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
|
|
}
|
|
}
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
return;
|
|
}
|
|
case ScopeComponent: {
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
return;
|
|
}
|
|
case OffscreenComponent: {
|
|
if (deletedFiber.mode & ConcurrentMode) {
|
|
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
} else {
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
}
|
|
break;
|
|
}
|
|
default: {
|
|
recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function commitSuspenseCallback(finishedWork) {
|
|
var newState = finishedWork.memoizedState;
|
|
}
|
|
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
|
|
var newState = finishedWork.memoizedState;
|
|
if (newState === null) {
|
|
var current2 = finishedWork.alternate;
|
|
if (current2 !== null) {
|
|
var prevState = current2.memoizedState;
|
|
if (prevState !== null) {
|
|
var suspenseInstance = prevState.dehydrated;
|
|
if (suspenseInstance !== null) {
|
|
commitHydratedSuspenseInstance(suspenseInstance);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function attachSuspenseRetryListeners(finishedWork) {
|
|
var wakeables = finishedWork.updateQueue;
|
|
if (wakeables !== null) {
|
|
finishedWork.updateQueue = null;
|
|
var retryCache = finishedWork.stateNode;
|
|
if (retryCache === null) {
|
|
retryCache = finishedWork.stateNode = new PossiblyWeakSet();
|
|
}
|
|
wakeables.forEach(function(wakeable) {
|
|
var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
|
|
if (!retryCache.has(wakeable)) {
|
|
retryCache.add(wakeable);
|
|
{
|
|
if (isDevToolsPresent) {
|
|
if (inProgressLanes !== null && inProgressRoot !== null) {
|
|
restorePendingUpdaters(inProgressRoot, inProgressLanes);
|
|
} else {
|
|
throw Error("Expected finished root and lanes to be set. This is a bug in React.");
|
|
}
|
|
}
|
|
}
|
|
wakeable.then(retry, retry);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function commitMutationEffects(root2, finishedWork, committedLanes) {
|
|
inProgressLanes = committedLanes;
|
|
inProgressRoot = root2;
|
|
setCurrentFiber(finishedWork);
|
|
commitMutationEffectsOnFiber(finishedWork, root2);
|
|
setCurrentFiber(finishedWork);
|
|
inProgressLanes = null;
|
|
inProgressRoot = null;
|
|
}
|
|
function recursivelyTraverseMutationEffects(root2, parentFiber, lanes) {
|
|
var deletions = parentFiber.deletions;
|
|
if (deletions !== null) {
|
|
for (var i2 = 0; i2 < deletions.length; i2++) {
|
|
var childToDelete = deletions[i2];
|
|
try {
|
|
commitDeletionEffects(root2, parentFiber, childToDelete);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(childToDelete, parentFiber, error2);
|
|
}
|
|
}
|
|
}
|
|
var prevDebugFiber = getCurrentFiber();
|
|
if (parentFiber.subtreeFlags & MutationMask) {
|
|
var child = parentFiber.child;
|
|
while (child !== null) {
|
|
setCurrentFiber(child);
|
|
commitMutationEffectsOnFiber(child, root2);
|
|
child = child.sibling;
|
|
}
|
|
}
|
|
setCurrentFiber(prevDebugFiber);
|
|
}
|
|
function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
|
|
var current2 = finishedWork.alternate;
|
|
var flags = finishedWork.flags;
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Update) {
|
|
try {
|
|
commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);
|
|
commitHookEffectListMount(Insertion | HasEffect, finishedWork);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
if (finishedWork.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
recordLayoutEffectDuration(finishedWork);
|
|
} else {
|
|
try {
|
|
commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case ClassComponent: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Ref) {
|
|
if (current2 !== null) {
|
|
safelyDetachRef(current2, current2.return);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostComponent: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Ref) {
|
|
if (current2 !== null) {
|
|
safelyDetachRef(current2, current2.return);
|
|
}
|
|
}
|
|
{
|
|
if (finishedWork.flags & ContentReset) {
|
|
var instance = finishedWork.stateNode;
|
|
try {
|
|
resetTextContent(instance);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
if (flags & Update) {
|
|
var _instance4 = finishedWork.stateNode;
|
|
if (_instance4 != null) {
|
|
var newProps = finishedWork.memoizedProps;
|
|
var oldProps = current2 !== null ? current2.memoizedProps : newProps;
|
|
var type = finishedWork.type;
|
|
var updatePayload = finishedWork.updateQueue;
|
|
finishedWork.updateQueue = null;
|
|
if (updatePayload !== null) {
|
|
try {
|
|
commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostText: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Update) {
|
|
{
|
|
if (finishedWork.stateNode === null) {
|
|
throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
var textInstance = finishedWork.stateNode;
|
|
var newText = finishedWork.memoizedProps;
|
|
var oldText = current2 !== null ? current2.memoizedProps : newText;
|
|
try {
|
|
commitTextUpdate(textInstance, oldText, newText);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostRoot: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Update) {
|
|
{
|
|
if (current2 !== null) {
|
|
var prevRootState = current2.memoizedState;
|
|
if (prevRootState.isDehydrated) {
|
|
try {
|
|
commitHydratedContainer(root2.containerInfo);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case HostPortal: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
return;
|
|
}
|
|
case SuspenseComponent: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
var offscreenFiber = finishedWork.child;
|
|
if (offscreenFiber.flags & Visibility) {
|
|
var offscreenInstance = offscreenFiber.stateNode;
|
|
var newState = offscreenFiber.memoizedState;
|
|
var isHidden = newState !== null;
|
|
offscreenInstance.isHidden = isHidden;
|
|
if (isHidden) {
|
|
var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
|
|
if (!wasHidden) {
|
|
markCommitTimeOfFallback();
|
|
}
|
|
}
|
|
}
|
|
if (flags & Update) {
|
|
try {
|
|
commitSuspenseCallback(finishedWork);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
}
|
|
return;
|
|
}
|
|
case OffscreenComponent: {
|
|
var _wasHidden = current2 !== null && current2.memoizedState !== null;
|
|
if (finishedWork.mode & ConcurrentMode) {
|
|
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
} else {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
}
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Visibility) {
|
|
var _offscreenInstance = finishedWork.stateNode;
|
|
var _newState = finishedWork.memoizedState;
|
|
var _isHidden = _newState !== null;
|
|
var offscreenBoundary = finishedWork;
|
|
_offscreenInstance.isHidden = _isHidden;
|
|
{
|
|
if (_isHidden) {
|
|
if (!_wasHidden) {
|
|
if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
|
|
nextEffect = offscreenBoundary;
|
|
var offscreenChild = offscreenBoundary.child;
|
|
while (offscreenChild !== null) {
|
|
nextEffect = offscreenChild;
|
|
disappearLayoutEffects_begin(offscreenChild);
|
|
offscreenChild = offscreenChild.sibling;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{
|
|
hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
case SuspenseListComponent: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
if (flags & Update) {
|
|
attachSuspenseRetryListeners(finishedWork);
|
|
}
|
|
return;
|
|
}
|
|
case ScopeComponent: {
|
|
return;
|
|
}
|
|
default: {
|
|
recursivelyTraverseMutationEffects(root2, finishedWork);
|
|
commitReconciliationEffects(finishedWork);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function commitReconciliationEffects(finishedWork) {
|
|
var flags = finishedWork.flags;
|
|
if (flags & Placement) {
|
|
try {
|
|
commitPlacement(finishedWork);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(finishedWork, finishedWork.return, error2);
|
|
}
|
|
finishedWork.flags &= ~Placement;
|
|
}
|
|
if (flags & Hydrating) {
|
|
finishedWork.flags &= ~Hydrating;
|
|
}
|
|
}
|
|
function commitLayoutEffects(finishedWork, root2, committedLanes) {
|
|
inProgressLanes = committedLanes;
|
|
inProgressRoot = root2;
|
|
nextEffect = finishedWork;
|
|
commitLayoutEffects_begin(finishedWork, root2, committedLanes);
|
|
inProgressLanes = null;
|
|
inProgressRoot = null;
|
|
}
|
|
function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
|
|
var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var firstChild = fiber.child;
|
|
if (fiber.tag === OffscreenComponent && isModernRoot) {
|
|
var isHidden = fiber.memoizedState !== null;
|
|
var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
|
|
if (newOffscreenSubtreeIsHidden) {
|
|
commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
|
|
continue;
|
|
} else {
|
|
var current2 = fiber.alternate;
|
|
var wasHidden = current2 !== null && current2.memoizedState !== null;
|
|
var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
|
|
var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
|
|
var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
|
|
offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
|
|
offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
|
|
if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
|
|
nextEffect = fiber;
|
|
reappearLayoutEffects_begin(fiber);
|
|
}
|
|
var child = firstChild;
|
|
while (child !== null) {
|
|
nextEffect = child;
|
|
commitLayoutEffects_begin(
|
|
child,
|
|
root2,
|
|
committedLanes
|
|
);
|
|
child = child.sibling;
|
|
}
|
|
nextEffect = fiber;
|
|
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
|
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
|
|
continue;
|
|
}
|
|
}
|
|
if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
|
|
firstChild.return = fiber;
|
|
nextEffect = firstChild;
|
|
} else {
|
|
commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
|
|
}
|
|
}
|
|
}
|
|
function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
if ((fiber.flags & LayoutMask) !== NoFlags) {
|
|
var current2 = fiber.alternate;
|
|
setCurrentFiber(fiber);
|
|
try {
|
|
commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
if (fiber === subtreeRoot) {
|
|
nextEffect = null;
|
|
return;
|
|
}
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function disappearLayoutEffects_begin(subtreeRoot) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var firstChild = fiber.child;
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case MemoComponent:
|
|
case SimpleMemoComponent: {
|
|
if (fiber.mode & ProfileMode) {
|
|
try {
|
|
startLayoutEffectTimer();
|
|
commitHookEffectListUnmount(Layout, fiber, fiber.return);
|
|
} finally {
|
|
recordLayoutEffectDuration(fiber);
|
|
}
|
|
} else {
|
|
commitHookEffectListUnmount(Layout, fiber, fiber.return);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
safelyDetachRef(fiber, fiber.return);
|
|
var instance = fiber.stateNode;
|
|
if (typeof instance.componentWillUnmount === "function") {
|
|
safelyCallComponentWillUnmount(fiber, fiber.return, instance);
|
|
}
|
|
break;
|
|
}
|
|
case HostComponent: {
|
|
safelyDetachRef(fiber, fiber.return);
|
|
break;
|
|
}
|
|
case OffscreenComponent: {
|
|
var isHidden = fiber.memoizedState !== null;
|
|
if (isHidden) {
|
|
disappearLayoutEffects_complete(subtreeRoot);
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
if (firstChild !== null) {
|
|
firstChild.return = fiber;
|
|
nextEffect = firstChild;
|
|
} else {
|
|
disappearLayoutEffects_complete(subtreeRoot);
|
|
}
|
|
}
|
|
}
|
|
function disappearLayoutEffects_complete(subtreeRoot) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
if (fiber === subtreeRoot) {
|
|
nextEffect = null;
|
|
return;
|
|
}
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function reappearLayoutEffects_begin(subtreeRoot) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var firstChild = fiber.child;
|
|
if (fiber.tag === OffscreenComponent) {
|
|
var isHidden = fiber.memoizedState !== null;
|
|
if (isHidden) {
|
|
reappearLayoutEffects_complete(subtreeRoot);
|
|
continue;
|
|
}
|
|
}
|
|
if (firstChild !== null) {
|
|
firstChild.return = fiber;
|
|
nextEffect = firstChild;
|
|
} else {
|
|
reappearLayoutEffects_complete(subtreeRoot);
|
|
}
|
|
}
|
|
}
|
|
function reappearLayoutEffects_complete(subtreeRoot) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
setCurrentFiber(fiber);
|
|
try {
|
|
reappearLayoutEffectsOnFiber(fiber);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
resetCurrentFiber();
|
|
if (fiber === subtreeRoot) {
|
|
nextEffect = null;
|
|
return;
|
|
}
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function commitPassiveMountEffects(root2, finishedWork, committedLanes, committedTransitions) {
|
|
nextEffect = finishedWork;
|
|
commitPassiveMountEffects_begin(finishedWork, root2, committedLanes, committedTransitions);
|
|
}
|
|
function commitPassiveMountEffects_begin(subtreeRoot, root2, committedLanes, committedTransitions) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var firstChild = fiber.child;
|
|
if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
|
|
firstChild.return = fiber;
|
|
nextEffect = firstChild;
|
|
} else {
|
|
commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions);
|
|
}
|
|
}
|
|
}
|
|
function commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
if ((fiber.flags & Passive) !== NoFlags) {
|
|
setCurrentFiber(fiber);
|
|
try {
|
|
commitPassiveMountOnFiber(root2, fiber, committedLanes, committedTransitions);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
if (fiber === subtreeRoot) {
|
|
nextEffect = null;
|
|
return;
|
|
}
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
if (finishedWork.mode & ProfileMode) {
|
|
startPassiveEffectTimer();
|
|
try {
|
|
commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
|
|
} finally {
|
|
recordPassiveEffectDuration(finishedWork);
|
|
}
|
|
} else {
|
|
commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function commitPassiveUnmountEffects(firstChild) {
|
|
nextEffect = firstChild;
|
|
commitPassiveUnmountEffects_begin();
|
|
}
|
|
function commitPassiveUnmountEffects_begin() {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var child = fiber.child;
|
|
if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
|
|
var deletions = fiber.deletions;
|
|
if (deletions !== null) {
|
|
for (var i2 = 0; i2 < deletions.length; i2++) {
|
|
var fiberToDelete = deletions[i2];
|
|
nextEffect = fiberToDelete;
|
|
commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
|
|
}
|
|
{
|
|
var previousFiber = fiber.alternate;
|
|
if (previousFiber !== null) {
|
|
var detachedChild = previousFiber.child;
|
|
if (detachedChild !== null) {
|
|
previousFiber.child = null;
|
|
do {
|
|
var detachedSibling = detachedChild.sibling;
|
|
detachedChild.sibling = null;
|
|
detachedChild = detachedSibling;
|
|
} while (detachedChild !== null);
|
|
}
|
|
}
|
|
}
|
|
nextEffect = fiber;
|
|
}
|
|
}
|
|
if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
|
|
child.return = fiber;
|
|
nextEffect = child;
|
|
} else {
|
|
commitPassiveUnmountEffects_complete();
|
|
}
|
|
}
|
|
}
|
|
function commitPassiveUnmountEffects_complete() {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
if ((fiber.flags & Passive) !== NoFlags) {
|
|
setCurrentFiber(fiber);
|
|
commitPassiveUnmountOnFiber(fiber);
|
|
resetCurrentFiber();
|
|
}
|
|
var sibling = fiber.sibling;
|
|
if (sibling !== null) {
|
|
sibling.return = fiber.return;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = fiber.return;
|
|
}
|
|
}
|
|
function commitPassiveUnmountOnFiber(finishedWork) {
|
|
switch (finishedWork.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
if (finishedWork.mode & ProfileMode) {
|
|
startPassiveEffectTimer();
|
|
commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
|
|
recordPassiveEffectDuration(finishedWork);
|
|
} else {
|
|
commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
setCurrentFiber(fiber);
|
|
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
|
resetCurrentFiber();
|
|
var child = fiber.child;
|
|
if (child !== null) {
|
|
child.return = fiber;
|
|
nextEffect = child;
|
|
} else {
|
|
commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
|
|
}
|
|
}
|
|
}
|
|
function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
|
|
while (nextEffect !== null) {
|
|
var fiber = nextEffect;
|
|
var sibling = fiber.sibling;
|
|
var returnFiber = fiber.return;
|
|
{
|
|
detachFiberAfterEffects(fiber);
|
|
if (fiber === deletedSubtreeRoot) {
|
|
nextEffect = null;
|
|
return;
|
|
}
|
|
}
|
|
if (sibling !== null) {
|
|
sibling.return = returnFiber;
|
|
nextEffect = sibling;
|
|
return;
|
|
}
|
|
nextEffect = returnFiber;
|
|
}
|
|
}
|
|
function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
|
|
switch (current2.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
if (current2.mode & ProfileMode) {
|
|
startPassiveEffectTimer();
|
|
commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
|
|
recordPassiveEffectDuration(current2);
|
|
} else {
|
|
commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function invokeLayoutEffectMountInDEV(fiber) {
|
|
{
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
try {
|
|
commitHookEffectListMount(Layout | HasEffect, fiber);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
var instance = fiber.stateNode;
|
|
try {
|
|
instance.componentDidMount();
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function invokePassiveEffectMountInDEV(fiber) {
|
|
{
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
try {
|
|
commitHookEffectListMount(Passive$1 | HasEffect, fiber);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function invokeLayoutEffectUnmountInDEV(fiber) {
|
|
{
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
try {
|
|
commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
var instance = fiber.stateNode;
|
|
if (typeof instance.componentWillUnmount === "function") {
|
|
safelyCallComponentWillUnmount(fiber, fiber.return, instance);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function invokePassiveEffectUnmountInDEV(fiber) {
|
|
{
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
try {
|
|
commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
|
|
} catch (error2) {
|
|
captureCommitPhaseError(fiber, fiber.return, error2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var COMPONENT_TYPE = 0;
|
|
var HAS_PSEUDO_CLASS_TYPE = 1;
|
|
var ROLE_TYPE = 2;
|
|
var TEST_NAME_TYPE = 3;
|
|
var TEXT_TYPE = 4;
|
|
if (typeof Symbol === "function" && Symbol.for) {
|
|
var symbolFor = Symbol.for;
|
|
COMPONENT_TYPE = symbolFor("selector.component");
|
|
HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
|
|
ROLE_TYPE = symbolFor("selector.role");
|
|
TEST_NAME_TYPE = symbolFor("selector.test_id");
|
|
TEXT_TYPE = symbolFor("selector.text");
|
|
}
|
|
var commitHooks = [];
|
|
function onCommitRoot$1() {
|
|
{
|
|
commitHooks.forEach(function(commitHook) {
|
|
return commitHook();
|
|
});
|
|
}
|
|
}
|
|
var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
|
|
function isLegacyActEnvironment(fiber) {
|
|
{
|
|
var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0;
|
|
var jestIsDefined = typeof jest !== "undefined";
|
|
return jestIsDefined && isReactActEnvironmentGlobal !== false;
|
|
}
|
|
}
|
|
function isConcurrentActEnvironment() {
|
|
{
|
|
var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0;
|
|
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
|
|
error("The current testing environment is not configured to support act(...)");
|
|
}
|
|
return isReactActEnvironmentGlobal;
|
|
}
|
|
}
|
|
var ceil = Math.ceil;
|
|
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
|
|
var NoContext = 0;
|
|
var BatchedContext = 1;
|
|
var RenderContext = 2;
|
|
var CommitContext = 4;
|
|
var RootInProgress = 0;
|
|
var RootFatalErrored = 1;
|
|
var RootErrored = 2;
|
|
var RootSuspended = 3;
|
|
var RootSuspendedWithDelay = 4;
|
|
var RootCompleted = 5;
|
|
var RootDidNotComplete = 6;
|
|
var executionContext = NoContext;
|
|
var workInProgressRoot = null;
|
|
var workInProgress = null;
|
|
var workInProgressRootRenderLanes = NoLanes;
|
|
var subtreeRenderLanes = NoLanes;
|
|
var subtreeRenderLanesCursor = createCursor(NoLanes);
|
|
var workInProgressRootExitStatus = RootInProgress;
|
|
var workInProgressRootFatalError = null;
|
|
var workInProgressRootIncludedLanes = NoLanes;
|
|
var workInProgressRootSkippedLanes = NoLanes;
|
|
var workInProgressRootInterleavedUpdatedLanes = NoLanes;
|
|
var workInProgressRootPingedLanes = NoLanes;
|
|
var workInProgressRootConcurrentErrors = null;
|
|
var workInProgressRootRecoverableErrors = null;
|
|
var globalMostRecentFallbackTime = 0;
|
|
var FALLBACK_THROTTLE_MS = 500;
|
|
var workInProgressRootRenderTargetTime = Infinity;
|
|
var RENDER_TIMEOUT_MS = 500;
|
|
var workInProgressTransitions = null;
|
|
function resetRenderTimer() {
|
|
workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
|
|
}
|
|
function getRenderTargetTime() {
|
|
return workInProgressRootRenderTargetTime;
|
|
}
|
|
var hasUncaughtError = false;
|
|
var firstUncaughtError = null;
|
|
var legacyErrorBoundariesThatAlreadyFailed = null;
|
|
var rootDoesHavePassiveEffects = false;
|
|
var rootWithPendingPassiveEffects = null;
|
|
var pendingPassiveEffectsLanes = NoLanes;
|
|
var pendingPassiveProfilerEffects = [];
|
|
var pendingPassiveTransitions = null;
|
|
var NESTED_UPDATE_LIMIT = 50;
|
|
var nestedUpdateCount = 0;
|
|
var rootWithNestedUpdates = null;
|
|
var isFlushingPassiveEffects = false;
|
|
var didScheduleUpdateDuringPassiveEffects = false;
|
|
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
|
|
var nestedPassiveUpdateCount = 0;
|
|
var rootWithPassiveNestedUpdates = null;
|
|
var currentEventTime = NoTimestamp;
|
|
var currentEventTransitionLane = NoLanes;
|
|
var isRunningInsertionEffect = false;
|
|
function getWorkInProgressRoot() {
|
|
return workInProgressRoot;
|
|
}
|
|
function requestEventTime() {
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
return now();
|
|
}
|
|
if (currentEventTime !== NoTimestamp) {
|
|
return currentEventTime;
|
|
}
|
|
currentEventTime = now();
|
|
return currentEventTime;
|
|
}
|
|
function requestUpdateLane(fiber) {
|
|
var mode = fiber.mode;
|
|
if ((mode & ConcurrentMode) === NoMode) {
|
|
return SyncLane;
|
|
} else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
|
|
return pickArbitraryLane(workInProgressRootRenderLanes);
|
|
}
|
|
var isTransition = requestCurrentTransition() !== NoTransition;
|
|
if (isTransition) {
|
|
if (ReactCurrentBatchConfig$3.transition !== null) {
|
|
var transition = ReactCurrentBatchConfig$3.transition;
|
|
if (!transition._updatedFibers) {
|
|
transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
}
|
|
transition._updatedFibers.add(fiber);
|
|
}
|
|
if (currentEventTransitionLane === NoLane) {
|
|
currentEventTransitionLane = claimNextTransitionLane();
|
|
}
|
|
return currentEventTransitionLane;
|
|
}
|
|
var updateLane = getCurrentUpdatePriority();
|
|
if (updateLane !== NoLane) {
|
|
return updateLane;
|
|
}
|
|
var eventLane = getCurrentEventPriority();
|
|
return eventLane;
|
|
}
|
|
function requestRetryLane(fiber) {
|
|
var mode = fiber.mode;
|
|
if ((mode & ConcurrentMode) === NoMode) {
|
|
return SyncLane;
|
|
}
|
|
return claimNextRetryLane();
|
|
}
|
|
function scheduleUpdateOnFiber(root2, fiber, lane, eventTime) {
|
|
checkForNestedUpdates();
|
|
{
|
|
if (isRunningInsertionEffect) {
|
|
error("useInsertionEffect must not schedule updates.");
|
|
}
|
|
}
|
|
{
|
|
if (isFlushingPassiveEffects) {
|
|
didScheduleUpdateDuringPassiveEffects = true;
|
|
}
|
|
}
|
|
markRootUpdated(root2, lane, eventTime);
|
|
if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
|
|
warnAboutRenderPhaseUpdatesInDEV(fiber);
|
|
} else {
|
|
{
|
|
if (isDevToolsPresent) {
|
|
addFiberToLanesMap(root2, fiber, lane);
|
|
}
|
|
}
|
|
warnIfUpdatesNotWrappedWithActDEV(fiber);
|
|
if (root2 === workInProgressRoot) {
|
|
if ((executionContext & RenderContext) === NoContext) {
|
|
workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
|
|
}
|
|
if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
|
|
markRootSuspended$1(root2, workInProgressRootRenderLanes);
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && !ReactCurrentActQueue$1.isBatchingLegacy) {
|
|
resetRenderTimer();
|
|
flushSyncCallbacksOnlyInLegacyMode();
|
|
}
|
|
}
|
|
}
|
|
function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
|
|
var current2 = root2.current;
|
|
current2.lanes = lane;
|
|
markRootUpdated(root2, lane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
}
|
|
function isUnsafeClassRenderPhaseUpdate(fiber) {
|
|
return (executionContext & RenderContext) !== NoContext;
|
|
}
|
|
function ensureRootIsScheduled(root2, currentTime) {
|
|
var existingCallbackNode = root2.callbackNode;
|
|
markStarvedLanesAsExpired(root2, currentTime);
|
|
var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
|
|
if (nextLanes === NoLanes) {
|
|
if (existingCallbackNode !== null) {
|
|
cancelCallback$1(existingCallbackNode);
|
|
}
|
|
root2.callbackNode = null;
|
|
root2.callbackPriority = NoLane;
|
|
return;
|
|
}
|
|
var newCallbackPriority = getHighestPriorityLane(nextLanes);
|
|
var existingCallbackPriority = root2.callbackPriority;
|
|
if (existingCallbackPriority === newCallbackPriority && !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
|
|
{
|
|
if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
|
|
error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
if (existingCallbackNode != null) {
|
|
cancelCallback$1(existingCallbackNode);
|
|
}
|
|
var newCallbackNode;
|
|
if (newCallbackPriority === SyncLane) {
|
|
if (root2.tag === LegacyRoot) {
|
|
if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
|
|
ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
|
|
}
|
|
scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
|
|
} else {
|
|
scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
|
|
}
|
|
{
|
|
if (ReactCurrentActQueue$1.current !== null) {
|
|
ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
|
|
} else {
|
|
scheduleMicrotask(function() {
|
|
if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
flushSyncCallbacks();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
newCallbackNode = null;
|
|
} else {
|
|
var schedulerPriorityLevel;
|
|
switch (lanesToEventPriority(nextLanes)) {
|
|
case DiscreteEventPriority:
|
|
schedulerPriorityLevel = ImmediatePriority;
|
|
break;
|
|
case ContinuousEventPriority:
|
|
schedulerPriorityLevel = UserBlockingPriority;
|
|
break;
|
|
case DefaultEventPriority:
|
|
schedulerPriorityLevel = NormalPriority;
|
|
break;
|
|
case IdleEventPriority:
|
|
schedulerPriorityLevel = IdlePriority;
|
|
break;
|
|
default:
|
|
schedulerPriorityLevel = NormalPriority;
|
|
break;
|
|
}
|
|
newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
|
|
}
|
|
root2.callbackPriority = newCallbackPriority;
|
|
root2.callbackNode = newCallbackNode;
|
|
}
|
|
function performConcurrentWorkOnRoot(root2, didTimeout) {
|
|
{
|
|
resetNestedUpdateFlag();
|
|
}
|
|
currentEventTime = NoTimestamp;
|
|
currentEventTransitionLane = NoLanes;
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
throw new Error("Should not already be working.");
|
|
}
|
|
var originalCallbackNode = root2.callbackNode;
|
|
var didFlushPassiveEffects = flushPassiveEffects();
|
|
if (didFlushPassiveEffects) {
|
|
if (root2.callbackNode !== originalCallbackNode) {
|
|
return null;
|
|
}
|
|
}
|
|
var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
|
|
if (lanes === NoLanes) {
|
|
return null;
|
|
}
|
|
var shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
|
|
var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
|
|
if (exitStatus !== RootInProgress) {
|
|
if (exitStatus === RootErrored) {
|
|
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
|
|
if (errorRetryLanes !== NoLanes) {
|
|
lanes = errorRetryLanes;
|
|
exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
|
|
}
|
|
}
|
|
if (exitStatus === RootFatalErrored) {
|
|
var fatalError = workInProgressRootFatalError;
|
|
prepareFreshStack(root2, NoLanes);
|
|
markRootSuspended$1(root2, lanes);
|
|
ensureRootIsScheduled(root2, now());
|
|
throw fatalError;
|
|
}
|
|
if (exitStatus === RootDidNotComplete) {
|
|
markRootSuspended$1(root2, lanes);
|
|
} else {
|
|
var renderWasConcurrent = !includesBlockingLane(root2, lanes);
|
|
var finishedWork = root2.current.alternate;
|
|
if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
|
|
exitStatus = renderRootSync(root2, lanes);
|
|
if (exitStatus === RootErrored) {
|
|
var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
|
|
if (_errorRetryLanes !== NoLanes) {
|
|
lanes = _errorRetryLanes;
|
|
exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
|
|
}
|
|
}
|
|
if (exitStatus === RootFatalErrored) {
|
|
var _fatalError = workInProgressRootFatalError;
|
|
prepareFreshStack(root2, NoLanes);
|
|
markRootSuspended$1(root2, lanes);
|
|
ensureRootIsScheduled(root2, now());
|
|
throw _fatalError;
|
|
}
|
|
}
|
|
root2.finishedWork = finishedWork;
|
|
root2.finishedLanes = lanes;
|
|
finishConcurrentRender(root2, exitStatus, lanes);
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root2, now());
|
|
if (root2.callbackNode === originalCallbackNode) {
|
|
return performConcurrentWorkOnRoot.bind(null, root2);
|
|
}
|
|
return null;
|
|
}
|
|
function recoverFromConcurrentError(root2, errorRetryLanes) {
|
|
var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
|
|
if (isRootDehydrated(root2)) {
|
|
var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
|
|
rootWorkInProgress.flags |= ForceClientRender;
|
|
{
|
|
errorHydratingContainer(root2.containerInfo);
|
|
}
|
|
}
|
|
var exitStatus = renderRootSync(root2, errorRetryLanes);
|
|
if (exitStatus !== RootErrored) {
|
|
var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
|
|
workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
|
|
if (errorsFromSecondAttempt !== null) {
|
|
queueRecoverableErrors(errorsFromSecondAttempt);
|
|
}
|
|
}
|
|
return exitStatus;
|
|
}
|
|
function queueRecoverableErrors(errors) {
|
|
if (workInProgressRootRecoverableErrors === null) {
|
|
workInProgressRootRecoverableErrors = errors;
|
|
} else {
|
|
workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
|
|
}
|
|
}
|
|
function finishConcurrentRender(root2, exitStatus, lanes) {
|
|
switch (exitStatus) {
|
|
case RootInProgress:
|
|
case RootFatalErrored: {
|
|
throw new Error("Root did not complete. This is a bug in React.");
|
|
}
|
|
case RootErrored: {
|
|
commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
break;
|
|
}
|
|
case RootSuspended: {
|
|
markRootSuspended$1(root2, lanes);
|
|
if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) {
|
|
var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
|
|
if (msUntilTimeout > 10) {
|
|
var nextLanes = getNextLanes(root2, NoLanes);
|
|
if (nextLanes !== NoLanes) {
|
|
break;
|
|
}
|
|
var suspendedLanes = root2.suspendedLanes;
|
|
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
|
|
var eventTime = requestEventTime();
|
|
markRootPinged(root2, suspendedLanes);
|
|
break;
|
|
}
|
|
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
|
|
break;
|
|
}
|
|
}
|
|
commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
break;
|
|
}
|
|
case RootSuspendedWithDelay: {
|
|
markRootSuspended$1(root2, lanes);
|
|
if (includesOnlyTransitions(lanes)) {
|
|
break;
|
|
}
|
|
if (!shouldForceFlushFallbacksInDEV()) {
|
|
var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
|
|
var eventTimeMs = mostRecentEventTime;
|
|
var timeElapsedMs = now() - eventTimeMs;
|
|
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
|
|
if (_msUntilTimeout > 10) {
|
|
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
|
|
break;
|
|
}
|
|
}
|
|
commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
break;
|
|
}
|
|
case RootCompleted: {
|
|
commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
break;
|
|
}
|
|
default: {
|
|
throw new Error("Unknown root exit status.");
|
|
}
|
|
}
|
|
}
|
|
function isRenderConsistentWithExternalStores(finishedWork) {
|
|
var node = finishedWork;
|
|
while (true) {
|
|
if (node.flags & StoreConsistency) {
|
|
var updateQueue = node.updateQueue;
|
|
if (updateQueue !== null) {
|
|
var checks = updateQueue.stores;
|
|
if (checks !== null) {
|
|
for (var i2 = 0; i2 < checks.length; i2++) {
|
|
var check = checks[i2];
|
|
var getSnapshot = check.getSnapshot;
|
|
var renderedValue = check.value;
|
|
try {
|
|
if (!objectIs(getSnapshot(), renderedValue)) {
|
|
return false;
|
|
}
|
|
} catch (error2) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var child = node.child;
|
|
if (node.subtreeFlags & StoreConsistency && child !== null) {
|
|
child.return = node;
|
|
node = child;
|
|
continue;
|
|
}
|
|
if (node === finishedWork) {
|
|
return true;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === finishedWork) {
|
|
return true;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
return true;
|
|
}
|
|
function markRootSuspended$1(root2, suspendedLanes) {
|
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
|
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
|
|
markRootSuspended(root2, suspendedLanes);
|
|
}
|
|
function performSyncWorkOnRoot(root2) {
|
|
{
|
|
syncNestedUpdateFlag();
|
|
}
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
throw new Error("Should not already be working.");
|
|
}
|
|
flushPassiveEffects();
|
|
var lanes = getNextLanes(root2, NoLanes);
|
|
if (!includesSomeLane(lanes, SyncLane)) {
|
|
ensureRootIsScheduled(root2, now());
|
|
return null;
|
|
}
|
|
var exitStatus = renderRootSync(root2, lanes);
|
|
if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
|
|
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
|
|
if (errorRetryLanes !== NoLanes) {
|
|
lanes = errorRetryLanes;
|
|
exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
|
|
}
|
|
}
|
|
if (exitStatus === RootFatalErrored) {
|
|
var fatalError = workInProgressRootFatalError;
|
|
prepareFreshStack(root2, NoLanes);
|
|
markRootSuspended$1(root2, lanes);
|
|
ensureRootIsScheduled(root2, now());
|
|
throw fatalError;
|
|
}
|
|
if (exitStatus === RootDidNotComplete) {
|
|
throw new Error("Root did not complete. This is a bug in React.");
|
|
}
|
|
var finishedWork = root2.current.alternate;
|
|
root2.finishedWork = finishedWork;
|
|
root2.finishedLanes = lanes;
|
|
commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
ensureRootIsScheduled(root2, now());
|
|
return null;
|
|
}
|
|
function flushRoot(root2, lanes) {
|
|
if (lanes !== NoLanes) {
|
|
markRootEntangled(root2, mergeLanes(lanes, SyncLane));
|
|
ensureRootIsScheduled(root2, now());
|
|
if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
resetRenderTimer();
|
|
flushSyncCallbacks();
|
|
}
|
|
}
|
|
}
|
|
function batchedUpdates$1(fn2, a2) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= BatchedContext;
|
|
try {
|
|
return fn2(a2);
|
|
} finally {
|
|
executionContext = prevExecutionContext;
|
|
if (executionContext === NoContext && !ReactCurrentActQueue$1.isBatchingLegacy) {
|
|
resetRenderTimer();
|
|
flushSyncCallbacksOnlyInLegacyMode();
|
|
}
|
|
}
|
|
}
|
|
function discreteUpdates(fn2, a2, b2, c2, d2) {
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
|
try {
|
|
ReactCurrentBatchConfig$3.transition = null;
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
return fn2(a2, b2, c2, d2);
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig$3.transition = prevTransition;
|
|
if (executionContext === NoContext) {
|
|
resetRenderTimer();
|
|
}
|
|
}
|
|
}
|
|
function flushSync(fn2) {
|
|
if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
flushPassiveEffects();
|
|
}
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= BatchedContext;
|
|
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
try {
|
|
ReactCurrentBatchConfig$3.transition = null;
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
if (fn2) {
|
|
return fn2();
|
|
} else {
|
|
return void 0;
|
|
}
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig$3.transition = prevTransition;
|
|
executionContext = prevExecutionContext;
|
|
if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
flushSyncCallbacks();
|
|
}
|
|
}
|
|
}
|
|
function isAlreadyRendering() {
|
|
return (executionContext & (RenderContext | CommitContext)) !== NoContext;
|
|
}
|
|
function pushRenderLanes(fiber, lanes) {
|
|
push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
|
|
subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
|
|
workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
|
|
}
|
|
function popRenderLanes(fiber) {
|
|
subtreeRenderLanes = subtreeRenderLanesCursor.current;
|
|
pop(subtreeRenderLanesCursor, fiber);
|
|
}
|
|
function prepareFreshStack(root2, lanes) {
|
|
root2.finishedWork = null;
|
|
root2.finishedLanes = NoLanes;
|
|
var timeoutHandle = root2.timeoutHandle;
|
|
if (timeoutHandle !== noTimeout) {
|
|
root2.timeoutHandle = noTimeout;
|
|
cancelTimeout(timeoutHandle);
|
|
}
|
|
if (workInProgress !== null) {
|
|
var interruptedWork = workInProgress.return;
|
|
while (interruptedWork !== null) {
|
|
var current2 = interruptedWork.alternate;
|
|
unwindInterruptedWork(current2, interruptedWork);
|
|
interruptedWork = interruptedWork.return;
|
|
}
|
|
}
|
|
workInProgressRoot = root2;
|
|
var rootWorkInProgress = createWorkInProgress(root2.current, null);
|
|
workInProgress = rootWorkInProgress;
|
|
workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
|
|
workInProgressRootExitStatus = RootInProgress;
|
|
workInProgressRootFatalError = null;
|
|
workInProgressRootSkippedLanes = NoLanes;
|
|
workInProgressRootInterleavedUpdatedLanes = NoLanes;
|
|
workInProgressRootPingedLanes = NoLanes;
|
|
workInProgressRootConcurrentErrors = null;
|
|
workInProgressRootRecoverableErrors = null;
|
|
finishQueueingConcurrentUpdates();
|
|
{
|
|
ReactStrictModeWarnings.discardPendingWarnings();
|
|
}
|
|
return rootWorkInProgress;
|
|
}
|
|
function handleError(root2, thrownValue) {
|
|
do {
|
|
var erroredWork = workInProgress;
|
|
try {
|
|
resetContextDependencies();
|
|
resetHooksAfterThrow();
|
|
resetCurrentFiber();
|
|
ReactCurrentOwner$2.current = null;
|
|
if (erroredWork === null || erroredWork.return === null) {
|
|
workInProgressRootExitStatus = RootFatalErrored;
|
|
workInProgressRootFatalError = thrownValue;
|
|
workInProgress = null;
|
|
return;
|
|
}
|
|
if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
|
|
stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
|
|
}
|
|
if (enableSchedulingProfiler) {
|
|
markComponentRenderStopped();
|
|
if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
|
|
var wakeable = thrownValue;
|
|
markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
|
|
} else {
|
|
markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
|
|
}
|
|
}
|
|
throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
|
|
completeUnitOfWork(erroredWork);
|
|
} catch (yetAnotherThrownValue) {
|
|
thrownValue = yetAnotherThrownValue;
|
|
if (workInProgress === erroredWork && erroredWork !== null) {
|
|
erroredWork = erroredWork.return;
|
|
workInProgress = erroredWork;
|
|
} else {
|
|
erroredWork = workInProgress;
|
|
}
|
|
continue;
|
|
}
|
|
return;
|
|
} while (true);
|
|
}
|
|
function pushDispatcher() {
|
|
var prevDispatcher = ReactCurrentDispatcher$2.current;
|
|
ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
|
|
if (prevDispatcher === null) {
|
|
return ContextOnlyDispatcher;
|
|
} else {
|
|
return prevDispatcher;
|
|
}
|
|
}
|
|
function popDispatcher(prevDispatcher) {
|
|
ReactCurrentDispatcher$2.current = prevDispatcher;
|
|
}
|
|
function markCommitTimeOfFallback() {
|
|
globalMostRecentFallbackTime = now();
|
|
}
|
|
function markSkippedUpdateLanes(lane) {
|
|
workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
|
|
}
|
|
function renderDidSuspend() {
|
|
if (workInProgressRootExitStatus === RootInProgress) {
|
|
workInProgressRootExitStatus = RootSuspended;
|
|
}
|
|
}
|
|
function renderDidSuspendDelayIfPossible() {
|
|
if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
|
|
workInProgressRootExitStatus = RootSuspendedWithDelay;
|
|
}
|
|
if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
|
|
markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
|
|
}
|
|
}
|
|
function renderDidError(error2) {
|
|
if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
|
|
workInProgressRootExitStatus = RootErrored;
|
|
}
|
|
if (workInProgressRootConcurrentErrors === null) {
|
|
workInProgressRootConcurrentErrors = [error2];
|
|
} else {
|
|
workInProgressRootConcurrentErrors.push(error2);
|
|
}
|
|
}
|
|
function renderHasNotSuspendedYet() {
|
|
return workInProgressRootExitStatus === RootInProgress;
|
|
}
|
|
function renderRootSync(root2, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
{
|
|
if (isDevToolsPresent) {
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
if (memoizedUpdaters.size > 0) {
|
|
restorePendingUpdaters(root2, workInProgressRootRenderLanes);
|
|
memoizedUpdaters.clear();
|
|
}
|
|
movePendingFibersToMemoized(root2, lanes);
|
|
}
|
|
}
|
|
workInProgressTransitions = getTransitionsForLanes();
|
|
prepareFreshStack(root2, lanes);
|
|
}
|
|
{
|
|
markRenderStarted(lanes);
|
|
}
|
|
do {
|
|
try {
|
|
workLoopSync();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root2, thrownValue);
|
|
}
|
|
} while (true);
|
|
resetContextDependencies();
|
|
executionContext = prevExecutionContext;
|
|
popDispatcher(prevDispatcher);
|
|
if (workInProgress !== null) {
|
|
throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
{
|
|
markRenderStopped();
|
|
}
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
function workLoopSync() {
|
|
while (workInProgress !== null) {
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
}
|
|
function renderRootConcurrent(root2, lanes) {
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= RenderContext;
|
|
var prevDispatcher = pushDispatcher();
|
|
if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
|
|
{
|
|
if (isDevToolsPresent) {
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
if (memoizedUpdaters.size > 0) {
|
|
restorePendingUpdaters(root2, workInProgressRootRenderLanes);
|
|
memoizedUpdaters.clear();
|
|
}
|
|
movePendingFibersToMemoized(root2, lanes);
|
|
}
|
|
}
|
|
workInProgressTransitions = getTransitionsForLanes();
|
|
resetRenderTimer();
|
|
prepareFreshStack(root2, lanes);
|
|
}
|
|
{
|
|
markRenderStarted(lanes);
|
|
}
|
|
do {
|
|
try {
|
|
workLoopConcurrent();
|
|
break;
|
|
} catch (thrownValue) {
|
|
handleError(root2, thrownValue);
|
|
}
|
|
} while (true);
|
|
resetContextDependencies();
|
|
popDispatcher(prevDispatcher);
|
|
executionContext = prevExecutionContext;
|
|
if (workInProgress !== null) {
|
|
{
|
|
markRenderYielded();
|
|
}
|
|
return RootInProgress;
|
|
} else {
|
|
{
|
|
markRenderStopped();
|
|
}
|
|
workInProgressRoot = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
return workInProgressRootExitStatus;
|
|
}
|
|
}
|
|
function workLoopConcurrent() {
|
|
while (workInProgress !== null && !shouldYield()) {
|
|
performUnitOfWork(workInProgress);
|
|
}
|
|
}
|
|
function performUnitOfWork(unitOfWork) {
|
|
var current2 = unitOfWork.alternate;
|
|
setCurrentFiber(unitOfWork);
|
|
var next;
|
|
if ((unitOfWork.mode & ProfileMode) !== NoMode) {
|
|
startProfilerTimer(unitOfWork);
|
|
next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
|
|
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
|
|
} else {
|
|
next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
|
|
}
|
|
resetCurrentFiber();
|
|
unitOfWork.memoizedProps = unitOfWork.pendingProps;
|
|
if (next === null) {
|
|
completeUnitOfWork(unitOfWork);
|
|
} else {
|
|
workInProgress = next;
|
|
}
|
|
ReactCurrentOwner$2.current = null;
|
|
}
|
|
function completeUnitOfWork(unitOfWork) {
|
|
var completedWork = unitOfWork;
|
|
do {
|
|
var current2 = completedWork.alternate;
|
|
var returnFiber = completedWork.return;
|
|
if ((completedWork.flags & Incomplete) === NoFlags) {
|
|
setCurrentFiber(completedWork);
|
|
var next = void 0;
|
|
if ((completedWork.mode & ProfileMode) === NoMode) {
|
|
next = completeWork(current2, completedWork, subtreeRenderLanes);
|
|
} else {
|
|
startProfilerTimer(completedWork);
|
|
next = completeWork(current2, completedWork, subtreeRenderLanes);
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
|
|
}
|
|
resetCurrentFiber();
|
|
if (next !== null) {
|
|
workInProgress = next;
|
|
return;
|
|
}
|
|
} else {
|
|
var _next = unwindWork(current2, completedWork);
|
|
if (_next !== null) {
|
|
_next.flags &= HostEffectMask;
|
|
workInProgress = _next;
|
|
return;
|
|
}
|
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
|
|
var actualDuration = completedWork.actualDuration;
|
|
var child = completedWork.child;
|
|
while (child !== null) {
|
|
actualDuration += child.actualDuration;
|
|
child = child.sibling;
|
|
}
|
|
completedWork.actualDuration = actualDuration;
|
|
}
|
|
if (returnFiber !== null) {
|
|
returnFiber.flags |= Incomplete;
|
|
returnFiber.subtreeFlags = NoFlags;
|
|
returnFiber.deletions = null;
|
|
} else {
|
|
workInProgressRootExitStatus = RootDidNotComplete;
|
|
workInProgress = null;
|
|
return;
|
|
}
|
|
}
|
|
var siblingFiber = completedWork.sibling;
|
|
if (siblingFiber !== null) {
|
|
workInProgress = siblingFiber;
|
|
return;
|
|
}
|
|
completedWork = returnFiber;
|
|
workInProgress = completedWork;
|
|
} while (completedWork !== null);
|
|
if (workInProgressRootExitStatus === RootInProgress) {
|
|
workInProgressRootExitStatus = RootCompleted;
|
|
}
|
|
}
|
|
function commitRoot(root2, recoverableErrors, transitions) {
|
|
var previousUpdateLanePriority = getCurrentUpdatePriority();
|
|
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
|
try {
|
|
ReactCurrentBatchConfig$3.transition = null;
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
commitRootImpl(root2, recoverableErrors, transitions, previousUpdateLanePriority);
|
|
} finally {
|
|
ReactCurrentBatchConfig$3.transition = prevTransition;
|
|
setCurrentUpdatePriority(previousUpdateLanePriority);
|
|
}
|
|
return null;
|
|
}
|
|
function commitRootImpl(root2, recoverableErrors, transitions, renderPriorityLevel) {
|
|
do {
|
|
flushPassiveEffects();
|
|
} while (rootWithPendingPassiveEffects !== null);
|
|
flushRenderPhaseStrictModeWarningsInDEV();
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
throw new Error("Should not already be working.");
|
|
}
|
|
var finishedWork = root2.finishedWork;
|
|
var lanes = root2.finishedLanes;
|
|
{
|
|
markCommitStarted(lanes);
|
|
}
|
|
if (finishedWork === null) {
|
|
{
|
|
markCommitStopped();
|
|
}
|
|
return null;
|
|
} else {
|
|
{
|
|
if (lanes === NoLanes) {
|
|
error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
|
|
}
|
|
}
|
|
}
|
|
root2.finishedWork = null;
|
|
root2.finishedLanes = NoLanes;
|
|
if (finishedWork === root2.current) {
|
|
throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
|
|
}
|
|
root2.callbackNode = null;
|
|
root2.callbackPriority = NoLane;
|
|
var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
|
|
markRootFinished(root2, remainingLanes);
|
|
if (root2 === workInProgressRoot) {
|
|
workInProgressRoot = null;
|
|
workInProgress = null;
|
|
workInProgressRootRenderLanes = NoLanes;
|
|
}
|
|
if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
|
|
if (!rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = true;
|
|
pendingPassiveTransitions = transitions;
|
|
scheduleCallback$1(NormalPriority, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
});
|
|
}
|
|
}
|
|
var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
|
|
var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
|
|
if (subtreeHasEffects || rootHasEffect) {
|
|
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
|
ReactCurrentBatchConfig$3.transition = null;
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
setCurrentUpdatePriority(DiscreteEventPriority);
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
ReactCurrentOwner$2.current = null;
|
|
var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
|
|
{
|
|
recordCommitTime();
|
|
}
|
|
commitMutationEffects(root2, finishedWork, lanes);
|
|
resetAfterCommit(root2.containerInfo);
|
|
root2.current = finishedWork;
|
|
{
|
|
markLayoutEffectsStarted(lanes);
|
|
}
|
|
commitLayoutEffects(finishedWork, root2, lanes);
|
|
{
|
|
markLayoutEffectsStopped();
|
|
}
|
|
requestPaint();
|
|
executionContext = prevExecutionContext;
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig$3.transition = prevTransition;
|
|
} else {
|
|
root2.current = finishedWork;
|
|
{
|
|
recordCommitTime();
|
|
}
|
|
}
|
|
var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
|
|
if (rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = false;
|
|
rootWithPendingPassiveEffects = root2;
|
|
pendingPassiveEffectsLanes = lanes;
|
|
} else {
|
|
{
|
|
nestedPassiveUpdateCount = 0;
|
|
rootWithPassiveNestedUpdates = null;
|
|
}
|
|
}
|
|
remainingLanes = root2.pendingLanes;
|
|
if (remainingLanes === NoLanes) {
|
|
legacyErrorBoundariesThatAlreadyFailed = null;
|
|
}
|
|
{
|
|
if (!rootDidHavePassiveEffects) {
|
|
commitDoubleInvokeEffectsInDEV(root2.current, false);
|
|
}
|
|
}
|
|
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
|
|
{
|
|
if (isDevToolsPresent) {
|
|
root2.memoizedUpdaters.clear();
|
|
}
|
|
}
|
|
{
|
|
onCommitRoot$1();
|
|
}
|
|
ensureRootIsScheduled(root2, now());
|
|
if (recoverableErrors !== null) {
|
|
var onRecoverableError = root2.onRecoverableError;
|
|
for (var i2 = 0; i2 < recoverableErrors.length; i2++) {
|
|
var recoverableError = recoverableErrors[i2];
|
|
var componentStack = recoverableError.stack;
|
|
var digest = recoverableError.digest;
|
|
onRecoverableError(recoverableError.value, {
|
|
componentStack,
|
|
digest
|
|
});
|
|
}
|
|
}
|
|
if (hasUncaughtError) {
|
|
hasUncaughtError = false;
|
|
var error$1 = firstUncaughtError;
|
|
firstUncaughtError = null;
|
|
throw error$1;
|
|
}
|
|
if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
|
|
flushPassiveEffects();
|
|
}
|
|
remainingLanes = root2.pendingLanes;
|
|
if (includesSomeLane(remainingLanes, SyncLane)) {
|
|
{
|
|
markNestedUpdateScheduled();
|
|
}
|
|
if (root2 === rootWithNestedUpdates) {
|
|
nestedUpdateCount++;
|
|
} else {
|
|
nestedUpdateCount = 0;
|
|
rootWithNestedUpdates = root2;
|
|
}
|
|
} else {
|
|
nestedUpdateCount = 0;
|
|
}
|
|
flushSyncCallbacks();
|
|
{
|
|
markCommitStopped();
|
|
}
|
|
return null;
|
|
}
|
|
function flushPassiveEffects() {
|
|
if (rootWithPendingPassiveEffects !== null) {
|
|
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
|
|
var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
|
|
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
|
var previousPriority = getCurrentUpdatePriority();
|
|
try {
|
|
ReactCurrentBatchConfig$3.transition = null;
|
|
setCurrentUpdatePriority(priority);
|
|
return flushPassiveEffectsImpl();
|
|
} finally {
|
|
setCurrentUpdatePriority(previousPriority);
|
|
ReactCurrentBatchConfig$3.transition = prevTransition;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function enqueuePendingPassiveProfilerEffect(fiber) {
|
|
{
|
|
pendingPassiveProfilerEffects.push(fiber);
|
|
if (!rootDoesHavePassiveEffects) {
|
|
rootDoesHavePassiveEffects = true;
|
|
scheduleCallback$1(NormalPriority, function() {
|
|
flushPassiveEffects();
|
|
return null;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function flushPassiveEffectsImpl() {
|
|
if (rootWithPendingPassiveEffects === null) {
|
|
return false;
|
|
}
|
|
var transitions = pendingPassiveTransitions;
|
|
pendingPassiveTransitions = null;
|
|
var root2 = rootWithPendingPassiveEffects;
|
|
var lanes = pendingPassiveEffectsLanes;
|
|
rootWithPendingPassiveEffects = null;
|
|
pendingPassiveEffectsLanes = NoLanes;
|
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
throw new Error("Cannot flush passive effects while already rendering.");
|
|
}
|
|
{
|
|
isFlushingPassiveEffects = true;
|
|
didScheduleUpdateDuringPassiveEffects = false;
|
|
}
|
|
{
|
|
markPassiveEffectsStarted(lanes);
|
|
}
|
|
var prevExecutionContext = executionContext;
|
|
executionContext |= CommitContext;
|
|
commitPassiveUnmountEffects(root2.current);
|
|
commitPassiveMountEffects(root2, root2.current, lanes, transitions);
|
|
{
|
|
var profilerEffects = pendingPassiveProfilerEffects;
|
|
pendingPassiveProfilerEffects = [];
|
|
for (var i2 = 0; i2 < profilerEffects.length; i2++) {
|
|
var _fiber = profilerEffects[i2];
|
|
commitPassiveEffectDurations(root2, _fiber);
|
|
}
|
|
}
|
|
{
|
|
markPassiveEffectsStopped();
|
|
}
|
|
{
|
|
commitDoubleInvokeEffectsInDEV(root2.current, true);
|
|
}
|
|
executionContext = prevExecutionContext;
|
|
flushSyncCallbacks();
|
|
{
|
|
if (didScheduleUpdateDuringPassiveEffects) {
|
|
if (root2 === rootWithPassiveNestedUpdates) {
|
|
nestedPassiveUpdateCount++;
|
|
} else {
|
|
nestedPassiveUpdateCount = 0;
|
|
rootWithPassiveNestedUpdates = root2;
|
|
}
|
|
} else {
|
|
nestedPassiveUpdateCount = 0;
|
|
}
|
|
isFlushingPassiveEffects = false;
|
|
didScheduleUpdateDuringPassiveEffects = false;
|
|
}
|
|
onPostCommitRoot(root2);
|
|
{
|
|
var stateNode = root2.current.stateNode;
|
|
stateNode.effectDuration = 0;
|
|
stateNode.passiveEffectDuration = 0;
|
|
}
|
|
return true;
|
|
}
|
|
function isAlreadyFailedLegacyErrorBoundary(instance) {
|
|
return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
|
|
}
|
|
function markLegacyErrorBoundaryAsFailed(instance) {
|
|
if (legacyErrorBoundariesThatAlreadyFailed === null) {
|
|
legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
|
|
} else {
|
|
legacyErrorBoundariesThatAlreadyFailed.add(instance);
|
|
}
|
|
}
|
|
function prepareToThrowUncaughtError(error2) {
|
|
if (!hasUncaughtError) {
|
|
hasUncaughtError = true;
|
|
firstUncaughtError = error2;
|
|
}
|
|
}
|
|
var onUncaughtError = prepareToThrowUncaughtError;
|
|
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
|
|
var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
|
|
var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
|
|
var root2 = enqueueUpdate(rootFiber, update, SyncLane);
|
|
var eventTime = requestEventTime();
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, SyncLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
}
|
|
}
|
|
function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
|
|
{
|
|
reportUncaughtErrorInDEV(error$1);
|
|
setIsRunningInsertionEffect(false);
|
|
}
|
|
if (sourceFiber.tag === HostRoot) {
|
|
captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
|
|
return;
|
|
}
|
|
var fiber = null;
|
|
{
|
|
fiber = nearestMountedAncestor;
|
|
}
|
|
while (fiber !== null) {
|
|
if (fiber.tag === HostRoot) {
|
|
captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
|
|
return;
|
|
} else if (fiber.tag === ClassComponent) {
|
|
var ctor = fiber.type;
|
|
var instance = fiber.stateNode;
|
|
if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
|
|
var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
|
|
var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
|
|
var root2 = enqueueUpdate(fiber, update, SyncLane);
|
|
var eventTime = requestEventTime();
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, SyncLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
fiber = fiber.return;
|
|
}
|
|
{
|
|
error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
|
|
}
|
|
}
|
|
function pingSuspendedRoot(root2, wakeable, pingedLanes) {
|
|
var pingCache = root2.pingCache;
|
|
if (pingCache !== null) {
|
|
pingCache.delete(wakeable);
|
|
}
|
|
var eventTime = requestEventTime();
|
|
markRootPinged(root2, pingedLanes);
|
|
warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
|
|
if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
|
|
if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
|
|
prepareFreshStack(root2, NoLanes);
|
|
} else {
|
|
workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
|
|
}
|
|
}
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
}
|
|
function retryTimedOutBoundary(boundaryFiber, retryLane) {
|
|
if (retryLane === NoLane) {
|
|
retryLane = requestRetryLane(boundaryFiber);
|
|
}
|
|
var eventTime = requestEventTime();
|
|
var root2 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
|
|
if (root2 !== null) {
|
|
markRootUpdated(root2, retryLane, eventTime);
|
|
ensureRootIsScheduled(root2, eventTime);
|
|
}
|
|
}
|
|
function retryDehydratedSuspenseBoundary(boundaryFiber) {
|
|
var suspenseState = boundaryFiber.memoizedState;
|
|
var retryLane = NoLane;
|
|
if (suspenseState !== null) {
|
|
retryLane = suspenseState.retryLane;
|
|
}
|
|
retryTimedOutBoundary(boundaryFiber, retryLane);
|
|
}
|
|
function resolveRetryWakeable(boundaryFiber, wakeable) {
|
|
var retryLane = NoLane;
|
|
var retryCache;
|
|
switch (boundaryFiber.tag) {
|
|
case SuspenseComponent:
|
|
retryCache = boundaryFiber.stateNode;
|
|
var suspenseState = boundaryFiber.memoizedState;
|
|
if (suspenseState !== null) {
|
|
retryLane = suspenseState.retryLane;
|
|
}
|
|
break;
|
|
case SuspenseListComponent:
|
|
retryCache = boundaryFiber.stateNode;
|
|
break;
|
|
default:
|
|
throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
|
|
}
|
|
if (retryCache !== null) {
|
|
retryCache.delete(wakeable);
|
|
}
|
|
retryTimedOutBoundary(boundaryFiber, retryLane);
|
|
}
|
|
function jnd(timeElapsed) {
|
|
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
|
|
}
|
|
function checkForNestedUpdates() {
|
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
|
nestedUpdateCount = 0;
|
|
rootWithNestedUpdates = null;
|
|
throw new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
|
|
}
|
|
{
|
|
if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
|
|
nestedPassiveUpdateCount = 0;
|
|
rootWithPassiveNestedUpdates = null;
|
|
error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
|
|
}
|
|
}
|
|
}
|
|
function flushRenderPhaseStrictModeWarningsInDEV() {
|
|
{
|
|
ReactStrictModeWarnings.flushLegacyContextWarning();
|
|
{
|
|
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
|
|
}
|
|
}
|
|
}
|
|
function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
|
|
{
|
|
setCurrentFiber(fiber);
|
|
invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
|
|
if (hasPassiveEffects) {
|
|
invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
|
|
}
|
|
invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
|
|
if (hasPassiveEffects) {
|
|
invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
|
|
}
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
|
|
{
|
|
var current2 = firstChild;
|
|
var subtreeRoot = null;
|
|
while (current2 !== null) {
|
|
var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
|
|
if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
|
|
current2 = current2.child;
|
|
} else {
|
|
if ((current2.flags & fiberFlags) !== NoFlags) {
|
|
invokeEffectFn(current2);
|
|
}
|
|
if (current2.sibling !== null) {
|
|
current2 = current2.sibling;
|
|
} else {
|
|
current2 = subtreeRoot = current2.return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var didWarnStateUpdateForNotYetMountedComponent = null;
|
|
function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
|
|
{
|
|
if ((executionContext & RenderContext) !== NoContext) {
|
|
return;
|
|
}
|
|
if (!(fiber.mode & ConcurrentMode)) {
|
|
return;
|
|
}
|
|
var tag = fiber.tag;
|
|
if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef2 && tag !== MemoComponent && tag !== SimpleMemoComponent) {
|
|
return;
|
|
}
|
|
var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
|
|
if (didWarnStateUpdateForNotYetMountedComponent !== null) {
|
|
if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
|
|
return;
|
|
}
|
|
didWarnStateUpdateForNotYetMountedComponent.add(componentName);
|
|
} else {
|
|
didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
|
|
}
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var beginWork$1;
|
|
{
|
|
var dummyFiber = null;
|
|
beginWork$1 = function(current2, unitOfWork, lanes) {
|
|
var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
|
|
try {
|
|
return beginWork(current2, unitOfWork, lanes);
|
|
} catch (originalError) {
|
|
if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
|
|
throw originalError;
|
|
}
|
|
resetContextDependencies();
|
|
resetHooksAfterThrow();
|
|
unwindInterruptedWork(current2, unitOfWork);
|
|
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
|
if (unitOfWork.mode & ProfileMode) {
|
|
startProfilerTimer(unitOfWork);
|
|
}
|
|
invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
|
|
if (hasCaughtError()) {
|
|
var replayError = clearCaughtError();
|
|
if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
|
|
originalError._suppressLogging = true;
|
|
}
|
|
}
|
|
throw originalError;
|
|
}
|
|
};
|
|
}
|
|
var didWarnAboutUpdateInRender = false;
|
|
var didWarnAboutUpdateInRenderForAnotherComponent;
|
|
{
|
|
didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
|
|
}
|
|
function warnAboutRenderPhaseUpdatesInDEV(fiber) {
|
|
{
|
|
if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
|
|
switch (fiber.tag) {
|
|
case FunctionComponent:
|
|
case ForwardRef2:
|
|
case SimpleMemoComponent: {
|
|
var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
|
|
var dedupeKey = renderingComponentName;
|
|
if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
|
|
didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
|
|
var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown";
|
|
error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
|
|
}
|
|
break;
|
|
}
|
|
case ClassComponent: {
|
|
if (!didWarnAboutUpdateInRender) {
|
|
error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
|
|
didWarnAboutUpdateInRender = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function restorePendingUpdaters(root2, lanes) {
|
|
{
|
|
if (isDevToolsPresent) {
|
|
var memoizedUpdaters = root2.memoizedUpdaters;
|
|
memoizedUpdaters.forEach(function(schedulingFiber) {
|
|
addFiberToLanesMap(root2, schedulingFiber, lanes);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
var fakeActCallbackNode = {};
|
|
function scheduleCallback$1(priorityLevel, callback) {
|
|
{
|
|
var actQueue = ReactCurrentActQueue$1.current;
|
|
if (actQueue !== null) {
|
|
actQueue.push(callback);
|
|
return fakeActCallbackNode;
|
|
} else {
|
|
return scheduleCallback(priorityLevel, callback);
|
|
}
|
|
}
|
|
}
|
|
function cancelCallback$1(callbackNode) {
|
|
if (callbackNode === fakeActCallbackNode) {
|
|
return;
|
|
}
|
|
return cancelCallback(callbackNode);
|
|
}
|
|
function shouldForceFlushFallbacksInDEV() {
|
|
return ReactCurrentActQueue$1.current !== null;
|
|
}
|
|
function warnIfUpdatesNotWrappedWithActDEV(fiber) {
|
|
{
|
|
if (fiber.mode & ConcurrentMode) {
|
|
if (!isConcurrentActEnvironment()) {
|
|
return;
|
|
}
|
|
} else {
|
|
if (!isLegacyActEnvironment()) {
|
|
return;
|
|
}
|
|
if (executionContext !== NoContext) {
|
|
return;
|
|
}
|
|
if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef2 && fiber.tag !== SimpleMemoComponent) {
|
|
return;
|
|
}
|
|
}
|
|
if (ReactCurrentActQueue$1.current === null) {
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(fiber);
|
|
error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentNameFromFiber(fiber));
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(fiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
|
|
{
|
|
if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
|
|
error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act");
|
|
}
|
|
}
|
|
}
|
|
function setIsRunningInsertionEffect(isRunning) {
|
|
{
|
|
isRunningInsertionEffect = isRunning;
|
|
}
|
|
}
|
|
var resolveFamily = null;
|
|
var failedBoundaries = null;
|
|
var setRefreshHandler = function(handler) {
|
|
{
|
|
resolveFamily = handler;
|
|
}
|
|
};
|
|
function resolveFunctionForHotReloading(type) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return type;
|
|
}
|
|
var family = resolveFamily(type);
|
|
if (family === void 0) {
|
|
return type;
|
|
}
|
|
return family.current;
|
|
}
|
|
}
|
|
function resolveClassForHotReloading(type) {
|
|
return resolveFunctionForHotReloading(type);
|
|
}
|
|
function resolveForwardRefForHotReloading(type) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return type;
|
|
}
|
|
var family = resolveFamily(type);
|
|
if (family === void 0) {
|
|
if (type !== null && type !== void 0 && typeof type.render === "function") {
|
|
var currentRender = resolveFunctionForHotReloading(type.render);
|
|
if (type.render !== currentRender) {
|
|
var syntheticType = {
|
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
render: currentRender
|
|
};
|
|
if (type.displayName !== void 0) {
|
|
syntheticType.displayName = type.displayName;
|
|
}
|
|
return syntheticType;
|
|
}
|
|
}
|
|
return type;
|
|
}
|
|
return family.current;
|
|
}
|
|
}
|
|
function isCompatibleFamilyForHotReloading(fiber, element) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return false;
|
|
}
|
|
var prevType = fiber.elementType;
|
|
var nextType = element.type;
|
|
var needsCompareFamilies = false;
|
|
var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
|
|
switch (fiber.tag) {
|
|
case ClassComponent: {
|
|
if (typeof nextType === "function") {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case FunctionComponent: {
|
|
if (typeof nextType === "function") {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case ForwardRef2: {
|
|
if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
case MemoComponent:
|
|
case SimpleMemoComponent: {
|
|
if ($$typeofNextType === REACT_MEMO_TYPE) {
|
|
needsCompareFamilies = true;
|
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
needsCompareFamilies = true;
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
return false;
|
|
}
|
|
if (needsCompareFamilies) {
|
|
var prevFamily = resolveFamily(prevType);
|
|
if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
function markFailedErrorBoundaryForHotReloading(fiber) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return;
|
|
}
|
|
if (typeof WeakSet !== "function") {
|
|
return;
|
|
}
|
|
if (failedBoundaries === null) {
|
|
failedBoundaries = /* @__PURE__ */ new WeakSet();
|
|
}
|
|
failedBoundaries.add(fiber);
|
|
}
|
|
}
|
|
var scheduleRefresh = function(root2, update) {
|
|
{
|
|
if (resolveFamily === null) {
|
|
return;
|
|
}
|
|
var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
|
|
flushPassiveEffects();
|
|
flushSync(function() {
|
|
scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
|
|
});
|
|
}
|
|
};
|
|
var scheduleRoot = function(root2, element) {
|
|
{
|
|
if (root2.context !== emptyContextObject) {
|
|
return;
|
|
}
|
|
flushPassiveEffects();
|
|
flushSync(function() {
|
|
updateContainer(element, root2, null, null);
|
|
});
|
|
}
|
|
};
|
|
function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
|
|
{
|
|
var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
var candidateType = null;
|
|
switch (tag) {
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
case ClassComponent:
|
|
candidateType = type;
|
|
break;
|
|
case ForwardRef2:
|
|
candidateType = type.render;
|
|
break;
|
|
}
|
|
if (resolveFamily === null) {
|
|
throw new Error("Expected resolveFamily to be set during hot reload.");
|
|
}
|
|
var needsRender = false;
|
|
var needsRemount = false;
|
|
if (candidateType !== null) {
|
|
var family = resolveFamily(candidateType);
|
|
if (family !== void 0) {
|
|
if (staleFamilies.has(family)) {
|
|
needsRemount = true;
|
|
} else if (updatedFamilies.has(family)) {
|
|
if (tag === ClassComponent) {
|
|
needsRemount = true;
|
|
} else {
|
|
needsRender = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (failedBoundaries !== null) {
|
|
if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
|
|
needsRemount = true;
|
|
}
|
|
}
|
|
if (needsRemount) {
|
|
fiber._debugNeedsRemount = true;
|
|
}
|
|
if (needsRemount || needsRender) {
|
|
var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (_root !== null) {
|
|
scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
}
|
|
if (child !== null && !needsRemount) {
|
|
scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
|
|
}
|
|
if (sibling !== null) {
|
|
scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
|
|
}
|
|
}
|
|
}
|
|
var findHostInstancesForRefresh = function(root2, families) {
|
|
{
|
|
var hostInstances = /* @__PURE__ */ new Set();
|
|
var types = new Set(families.map(function(family) {
|
|
return family.current;
|
|
}));
|
|
findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
|
|
return hostInstances;
|
|
}
|
|
};
|
|
function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
|
|
{
|
|
var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
var candidateType = null;
|
|
switch (tag) {
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
case ClassComponent:
|
|
candidateType = type;
|
|
break;
|
|
case ForwardRef2:
|
|
candidateType = type.render;
|
|
break;
|
|
}
|
|
var didMatch = false;
|
|
if (candidateType !== null) {
|
|
if (types.has(candidateType)) {
|
|
didMatch = true;
|
|
}
|
|
}
|
|
if (didMatch) {
|
|
findHostInstancesForFiberShallowly(fiber, hostInstances);
|
|
} else {
|
|
if (child !== null) {
|
|
findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
|
|
}
|
|
}
|
|
if (sibling !== null) {
|
|
findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
|
|
}
|
|
}
|
|
}
|
|
function findHostInstancesForFiberShallowly(fiber, hostInstances) {
|
|
{
|
|
var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
|
|
if (foundHostInstances) {
|
|
return;
|
|
}
|
|
var node = fiber;
|
|
while (true) {
|
|
switch (node.tag) {
|
|
case HostComponent:
|
|
hostInstances.add(node.stateNode);
|
|
return;
|
|
case HostPortal:
|
|
hostInstances.add(node.stateNode.containerInfo);
|
|
return;
|
|
case HostRoot:
|
|
hostInstances.add(node.stateNode.containerInfo);
|
|
return;
|
|
}
|
|
if (node.return === null) {
|
|
throw new Error("Expected to reach root first.");
|
|
}
|
|
node = node.return;
|
|
}
|
|
}
|
|
}
|
|
function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
|
|
{
|
|
var node = fiber;
|
|
var foundHostInstances = false;
|
|
while (true) {
|
|
if (node.tag === HostComponent) {
|
|
foundHostInstances = true;
|
|
hostInstances.add(node.stateNode);
|
|
} else if (node.child !== null) {
|
|
node.child.return = node;
|
|
node = node.child;
|
|
continue;
|
|
}
|
|
if (node === fiber) {
|
|
return foundHostInstances;
|
|
}
|
|
while (node.sibling === null) {
|
|
if (node.return === null || node.return === fiber) {
|
|
return foundHostInstances;
|
|
}
|
|
node = node.return;
|
|
}
|
|
node.sibling.return = node.return;
|
|
node = node.sibling;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
var hasBadMapPolyfill;
|
|
{
|
|
hasBadMapPolyfill = false;
|
|
try {
|
|
var nonExtensibleObject = Object.preventExtensions({});
|
|
/* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
|
|
/* @__PURE__ */ new Set([nonExtensibleObject]);
|
|
} catch (e) {
|
|
hasBadMapPolyfill = true;
|
|
}
|
|
}
|
|
function FiberNode(tag, pendingProps, key, mode) {
|
|
this.tag = tag;
|
|
this.key = key;
|
|
this.elementType = null;
|
|
this.type = null;
|
|
this.stateNode = null;
|
|
this.return = null;
|
|
this.child = null;
|
|
this.sibling = null;
|
|
this.index = 0;
|
|
this.ref = null;
|
|
this.pendingProps = pendingProps;
|
|
this.memoizedProps = null;
|
|
this.updateQueue = null;
|
|
this.memoizedState = null;
|
|
this.dependencies = null;
|
|
this.mode = mode;
|
|
this.flags = NoFlags;
|
|
this.subtreeFlags = NoFlags;
|
|
this.deletions = null;
|
|
this.lanes = NoLanes;
|
|
this.childLanes = NoLanes;
|
|
this.alternate = null;
|
|
{
|
|
this.actualDuration = Number.NaN;
|
|
this.actualStartTime = Number.NaN;
|
|
this.selfBaseDuration = Number.NaN;
|
|
this.treeBaseDuration = Number.NaN;
|
|
this.actualDuration = 0;
|
|
this.actualStartTime = -1;
|
|
this.selfBaseDuration = 0;
|
|
this.treeBaseDuration = 0;
|
|
}
|
|
{
|
|
this._debugSource = null;
|
|
this._debugOwner = null;
|
|
this._debugNeedsRemount = false;
|
|
this._debugHookTypes = null;
|
|
if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
|
|
Object.preventExtensions(this);
|
|
}
|
|
}
|
|
}
|
|
var createFiber = function(tag, pendingProps, key, mode) {
|
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
};
|
|
function shouldConstruct$1(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function isSimpleFunctionComponent(type) {
|
|
return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
|
|
}
|
|
function resolveLazyComponentTag(Component) {
|
|
if (typeof Component === "function") {
|
|
return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
|
|
} else if (Component !== void 0 && Component !== null) {
|
|
var $$typeof = Component.$$typeof;
|
|
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
|
return ForwardRef2;
|
|
}
|
|
if ($$typeof === REACT_MEMO_TYPE) {
|
|
return MemoComponent;
|
|
}
|
|
}
|
|
return IndeterminateComponent;
|
|
}
|
|
function createWorkInProgress(current2, pendingProps) {
|
|
var workInProgress2 = current2.alternate;
|
|
if (workInProgress2 === null) {
|
|
workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
|
|
workInProgress2.elementType = current2.elementType;
|
|
workInProgress2.type = current2.type;
|
|
workInProgress2.stateNode = current2.stateNode;
|
|
{
|
|
workInProgress2._debugSource = current2._debugSource;
|
|
workInProgress2._debugOwner = current2._debugOwner;
|
|
workInProgress2._debugHookTypes = current2._debugHookTypes;
|
|
}
|
|
workInProgress2.alternate = current2;
|
|
current2.alternate = workInProgress2;
|
|
} else {
|
|
workInProgress2.pendingProps = pendingProps;
|
|
workInProgress2.type = current2.type;
|
|
workInProgress2.flags = NoFlags;
|
|
workInProgress2.subtreeFlags = NoFlags;
|
|
workInProgress2.deletions = null;
|
|
{
|
|
workInProgress2.actualDuration = 0;
|
|
workInProgress2.actualStartTime = -1;
|
|
}
|
|
}
|
|
workInProgress2.flags = current2.flags & StaticMask;
|
|
workInProgress2.childLanes = current2.childLanes;
|
|
workInProgress2.lanes = current2.lanes;
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.memoizedProps = current2.memoizedProps;
|
|
workInProgress2.memoizedState = current2.memoizedState;
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
var currentDependencies = current2.dependencies;
|
|
workInProgress2.dependencies = currentDependencies === null ? null : {
|
|
lanes: currentDependencies.lanes,
|
|
firstContext: currentDependencies.firstContext
|
|
};
|
|
workInProgress2.sibling = current2.sibling;
|
|
workInProgress2.index = current2.index;
|
|
workInProgress2.ref = current2.ref;
|
|
{
|
|
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
|
|
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
|
|
}
|
|
{
|
|
workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
|
|
switch (workInProgress2.tag) {
|
|
case IndeterminateComponent:
|
|
case FunctionComponent:
|
|
case SimpleMemoComponent:
|
|
workInProgress2.type = resolveFunctionForHotReloading(current2.type);
|
|
break;
|
|
case ClassComponent:
|
|
workInProgress2.type = resolveClassForHotReloading(current2.type);
|
|
break;
|
|
case ForwardRef2:
|
|
workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
|
|
break;
|
|
}
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
function resetWorkInProgress(workInProgress2, renderLanes2) {
|
|
workInProgress2.flags &= StaticMask | Placement;
|
|
var current2 = workInProgress2.alternate;
|
|
if (current2 === null) {
|
|
workInProgress2.childLanes = NoLanes;
|
|
workInProgress2.lanes = renderLanes2;
|
|
workInProgress2.child = null;
|
|
workInProgress2.subtreeFlags = NoFlags;
|
|
workInProgress2.memoizedProps = null;
|
|
workInProgress2.memoizedState = null;
|
|
workInProgress2.updateQueue = null;
|
|
workInProgress2.dependencies = null;
|
|
workInProgress2.stateNode = null;
|
|
{
|
|
workInProgress2.selfBaseDuration = 0;
|
|
workInProgress2.treeBaseDuration = 0;
|
|
}
|
|
} else {
|
|
workInProgress2.childLanes = current2.childLanes;
|
|
workInProgress2.lanes = current2.lanes;
|
|
workInProgress2.child = current2.child;
|
|
workInProgress2.subtreeFlags = NoFlags;
|
|
workInProgress2.deletions = null;
|
|
workInProgress2.memoizedProps = current2.memoizedProps;
|
|
workInProgress2.memoizedState = current2.memoizedState;
|
|
workInProgress2.updateQueue = current2.updateQueue;
|
|
workInProgress2.type = current2.type;
|
|
var currentDependencies = current2.dependencies;
|
|
workInProgress2.dependencies = currentDependencies === null ? null : {
|
|
lanes: currentDependencies.lanes,
|
|
firstContext: currentDependencies.firstContext
|
|
};
|
|
{
|
|
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
|
|
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
|
|
}
|
|
}
|
|
return workInProgress2;
|
|
}
|
|
function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {
|
|
var mode;
|
|
if (tag === ConcurrentRoot) {
|
|
mode = ConcurrentMode;
|
|
if (isStrictMode === true) {
|
|
mode |= StrictLegacyMode;
|
|
{
|
|
mode |= StrictEffectsMode;
|
|
}
|
|
}
|
|
} else {
|
|
mode = NoMode;
|
|
}
|
|
if (isDevToolsPresent) {
|
|
mode |= ProfileMode;
|
|
}
|
|
return createFiber(HostRoot, null, null, mode);
|
|
}
|
|
function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
|
|
var fiberTag = IndeterminateComponent;
|
|
var resolvedType = type;
|
|
if (typeof type === "function") {
|
|
if (shouldConstruct$1(type)) {
|
|
fiberTag = ClassComponent;
|
|
{
|
|
resolvedType = resolveClassForHotReloading(resolvedType);
|
|
}
|
|
} else {
|
|
{
|
|
resolvedType = resolveFunctionForHotReloading(resolvedType);
|
|
}
|
|
}
|
|
} else if (typeof type === "string") {
|
|
fiberTag = HostComponent;
|
|
} else {
|
|
getTag:
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
return createFiberFromFragment(pendingProps.children, mode, lanes, key);
|
|
case REACT_STRICT_MODE_TYPE:
|
|
fiberTag = Mode;
|
|
mode |= StrictLegacyMode;
|
|
if ((mode & ConcurrentMode) !== NoMode) {
|
|
mode |= StrictEffectsMode;
|
|
}
|
|
break;
|
|
case REACT_PROFILER_TYPE:
|
|
return createFiberFromProfiler(pendingProps, mode, lanes, key);
|
|
case REACT_SUSPENSE_TYPE:
|
|
return createFiberFromSuspense(pendingProps, mode, lanes, key);
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
|
|
case REACT_OFFSCREEN_TYPE:
|
|
return createFiberFromOffscreen(pendingProps, mode, lanes, key);
|
|
case REACT_LEGACY_HIDDEN_TYPE:
|
|
case REACT_SCOPE_TYPE:
|
|
case REACT_CACHE_TYPE:
|
|
case REACT_TRACING_MARKER_TYPE:
|
|
case REACT_DEBUG_TRACING_MODE_TYPE:
|
|
default: {
|
|
if (typeof type === "object" && type !== null) {
|
|
switch (type.$$typeof) {
|
|
case REACT_PROVIDER_TYPE:
|
|
fiberTag = ContextProvider;
|
|
break getTag;
|
|
case REACT_CONTEXT_TYPE:
|
|
fiberTag = ContextConsumer;
|
|
break getTag;
|
|
case REACT_FORWARD_REF_TYPE:
|
|
fiberTag = ForwardRef2;
|
|
{
|
|
resolvedType = resolveForwardRefForHotReloading(resolvedType);
|
|
}
|
|
break getTag;
|
|
case REACT_MEMO_TYPE:
|
|
fiberTag = MemoComponent;
|
|
break getTag;
|
|
case REACT_LAZY_TYPE:
|
|
fiberTag = LazyComponent;
|
|
resolvedType = null;
|
|
break getTag;
|
|
}
|
|
}
|
|
var info = "";
|
|
{
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " 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 ownerName = owner ? getComponentNameFromFiber(owner) : null;
|
|
if (ownerName) {
|
|
info += "\n\nCheck the render method of `" + ownerName + "`.";
|
|
}
|
|
}
|
|
throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info));
|
|
}
|
|
}
|
|
}
|
|
var fiber = createFiber(fiberTag, pendingProps, key, mode);
|
|
fiber.elementType = type;
|
|
fiber.type = resolvedType;
|
|
fiber.lanes = lanes;
|
|
{
|
|
fiber._debugOwner = owner;
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromElement(element, mode, lanes) {
|
|
var owner = null;
|
|
{
|
|
owner = element._owner;
|
|
}
|
|
var type = element.type;
|
|
var key = element.key;
|
|
var pendingProps = element.props;
|
|
var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
|
|
{
|
|
fiber._debugSource = element._source;
|
|
fiber._debugOwner = element._owner;
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
var fiber = createFiber(Fragment6, elements, key, mode);
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromProfiler(pendingProps, mode, lanes, key) {
|
|
{
|
|
if (typeof pendingProps.id !== "string") {
|
|
error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
|
|
}
|
|
}
|
|
var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
|
|
fiber.elementType = REACT_PROFILER_TYPE;
|
|
fiber.lanes = lanes;
|
|
{
|
|
fiber.stateNode = {
|
|
effectDuration: 0,
|
|
passiveEffectDuration: 0
|
|
};
|
|
}
|
|
return fiber;
|
|
}
|
|
function createFiberFromSuspense(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
|
|
fiber.elementType = REACT_SUSPENSE_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
|
|
fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
|
|
var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
|
|
fiber.elementType = REACT_OFFSCREEN_TYPE;
|
|
fiber.lanes = lanes;
|
|
var primaryChildInstance = {
|
|
isHidden: false
|
|
};
|
|
fiber.stateNode = primaryChildInstance;
|
|
return fiber;
|
|
}
|
|
function createFiberFromText(content, mode, lanes) {
|
|
var fiber = createFiber(HostText, content, null, mode);
|
|
fiber.lanes = lanes;
|
|
return fiber;
|
|
}
|
|
function createFiberFromHostInstanceForDeletion() {
|
|
var fiber = createFiber(HostComponent, null, null, NoMode);
|
|
fiber.elementType = "DELETED";
|
|
return fiber;
|
|
}
|
|
function createFiberFromDehydratedFragment(dehydratedNode) {
|
|
var fiber = createFiber(DehydratedFragment, null, null, NoMode);
|
|
fiber.stateNode = dehydratedNode;
|
|
return fiber;
|
|
}
|
|
function createFiberFromPortal(portal, mode, lanes) {
|
|
var pendingProps = portal.children !== null ? portal.children : [];
|
|
var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
|
|
fiber.lanes = lanes;
|
|
fiber.stateNode = {
|
|
containerInfo: portal.containerInfo,
|
|
pendingChildren: null,
|
|
implementation: portal.implementation
|
|
};
|
|
return fiber;
|
|
}
|
|
function assignFiberPropertiesInDEV(target, source) {
|
|
if (target === null) {
|
|
target = createFiber(IndeterminateComponent, null, null, NoMode);
|
|
}
|
|
target.tag = source.tag;
|
|
target.key = source.key;
|
|
target.elementType = source.elementType;
|
|
target.type = source.type;
|
|
target.stateNode = source.stateNode;
|
|
target.return = source.return;
|
|
target.child = source.child;
|
|
target.sibling = source.sibling;
|
|
target.index = source.index;
|
|
target.ref = source.ref;
|
|
target.pendingProps = source.pendingProps;
|
|
target.memoizedProps = source.memoizedProps;
|
|
target.updateQueue = source.updateQueue;
|
|
target.memoizedState = source.memoizedState;
|
|
target.dependencies = source.dependencies;
|
|
target.mode = source.mode;
|
|
target.flags = source.flags;
|
|
target.subtreeFlags = source.subtreeFlags;
|
|
target.deletions = source.deletions;
|
|
target.lanes = source.lanes;
|
|
target.childLanes = source.childLanes;
|
|
target.alternate = source.alternate;
|
|
{
|
|
target.actualDuration = source.actualDuration;
|
|
target.actualStartTime = source.actualStartTime;
|
|
target.selfBaseDuration = source.selfBaseDuration;
|
|
target.treeBaseDuration = source.treeBaseDuration;
|
|
}
|
|
target._debugSource = source._debugSource;
|
|
target._debugOwner = source._debugOwner;
|
|
target._debugNeedsRemount = source._debugNeedsRemount;
|
|
target._debugHookTypes = source._debugHookTypes;
|
|
return target;
|
|
}
|
|
function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
|
|
this.tag = tag;
|
|
this.containerInfo = containerInfo;
|
|
this.pendingChildren = null;
|
|
this.current = null;
|
|
this.pingCache = null;
|
|
this.finishedWork = null;
|
|
this.timeoutHandle = noTimeout;
|
|
this.context = null;
|
|
this.pendingContext = null;
|
|
this.callbackNode = null;
|
|
this.callbackPriority = NoLane;
|
|
this.eventTimes = createLaneMap(NoLanes);
|
|
this.expirationTimes = createLaneMap(NoTimestamp);
|
|
this.pendingLanes = NoLanes;
|
|
this.suspendedLanes = NoLanes;
|
|
this.pingedLanes = NoLanes;
|
|
this.expiredLanes = NoLanes;
|
|
this.mutableReadLanes = NoLanes;
|
|
this.finishedLanes = NoLanes;
|
|
this.entangledLanes = NoLanes;
|
|
this.entanglements = createLaneMap(NoLanes);
|
|
this.identifierPrefix = identifierPrefix;
|
|
this.onRecoverableError = onRecoverableError;
|
|
{
|
|
this.mutableSourceEagerHydrationData = null;
|
|
}
|
|
{
|
|
this.effectDuration = 0;
|
|
this.passiveEffectDuration = 0;
|
|
}
|
|
{
|
|
this.memoizedUpdaters = /* @__PURE__ */ new Set();
|
|
var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
|
|
for (var _i = 0; _i < TotalLanes; _i++) {
|
|
pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
|
|
}
|
|
}
|
|
{
|
|
switch (tag) {
|
|
case ConcurrentRoot:
|
|
this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
|
|
break;
|
|
case LegacyRoot:
|
|
this._debugRootType = hydrate2 ? "hydrate()" : "render()";
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
|
|
var root2 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
|
|
var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
|
|
root2.current = uninitializedFiber;
|
|
uninitializedFiber.stateNode = root2;
|
|
{
|
|
var _initialState = {
|
|
element: initialChildren,
|
|
isDehydrated: hydrate2,
|
|
cache: null,
|
|
transitions: null,
|
|
pendingSuspenseBoundaries: null
|
|
};
|
|
uninitializedFiber.memoizedState = _initialState;
|
|
}
|
|
initializeUpdateQueue(uninitializedFiber);
|
|
return root2;
|
|
}
|
|
var ReactVersion = "18.2.0";
|
|
function createPortal(children, containerInfo, implementation) {
|
|
var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
{
|
|
checkKeyStringCoercion(key);
|
|
}
|
|
return {
|
|
$$typeof: REACT_PORTAL_TYPE,
|
|
key: key == null ? null : "" + key,
|
|
children,
|
|
containerInfo,
|
|
implementation
|
|
};
|
|
}
|
|
var didWarnAboutNestedUpdates;
|
|
var didWarnAboutFindNodeInStrictMode;
|
|
{
|
|
didWarnAboutNestedUpdates = false;
|
|
didWarnAboutFindNodeInStrictMode = {};
|
|
}
|
|
function getContextForSubtree(parentComponent) {
|
|
if (!parentComponent) {
|
|
return emptyContextObject;
|
|
}
|
|
var fiber = get(parentComponent);
|
|
var parentContext = findCurrentUnmaskedContext(fiber);
|
|
if (fiber.tag === ClassComponent) {
|
|
var Component = fiber.type;
|
|
if (isContextProvider(Component)) {
|
|
return processChildContext(fiber, Component, parentContext);
|
|
}
|
|
}
|
|
return parentContext;
|
|
}
|
|
function findHostInstanceWithWarning(component, methodName) {
|
|
{
|
|
var fiber = get(component);
|
|
if (fiber === void 0) {
|
|
if (typeof component.render === "function") {
|
|
throw new Error("Unable to find node on an unmounted component.");
|
|
} else {
|
|
var keys = Object.keys(component).join(",");
|
|
throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys);
|
|
}
|
|
}
|
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
if (hostFiber.mode & StrictLegacyMode) {
|
|
var componentName = getComponentNameFromFiber(fiber) || "Component";
|
|
if (!didWarnAboutFindNodeInStrictMode[componentName]) {
|
|
didWarnAboutFindNodeInStrictMode[componentName] = true;
|
|
var previousFiber = current;
|
|
try {
|
|
setCurrentFiber(hostFiber);
|
|
if (fiber.mode & StrictLegacyMode) {
|
|
error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
|
|
} else {
|
|
error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
|
|
}
|
|
} finally {
|
|
if (previousFiber) {
|
|
setCurrentFiber(previousFiber);
|
|
} else {
|
|
resetCurrentFiber();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
}
|
|
function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
|
|
var hydrate2 = false;
|
|
var initialChildren = null;
|
|
return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
|
|
}
|
|
function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
|
|
var hydrate2 = true;
|
|
var root2 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
|
|
root2.context = getContextForSubtree(null);
|
|
var current2 = root2.current;
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(current2);
|
|
var update = createUpdate(eventTime, lane);
|
|
update.callback = callback !== void 0 && callback !== null ? callback : null;
|
|
enqueueUpdate(current2, update, lane);
|
|
scheduleInitialHydrationOnRoot(root2, lane, eventTime);
|
|
return root2;
|
|
}
|
|
function updateContainer(element, container, parentComponent, callback) {
|
|
{
|
|
onScheduleRoot(container, element);
|
|
}
|
|
var current$1 = container.current;
|
|
var eventTime = requestEventTime();
|
|
var lane = requestUpdateLane(current$1);
|
|
{
|
|
markRenderScheduled(lane);
|
|
}
|
|
var context = getContextForSubtree(parentComponent);
|
|
if (container.context === null) {
|
|
container.context = context;
|
|
} else {
|
|
container.pendingContext = context;
|
|
}
|
|
{
|
|
if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
|
|
didWarnAboutNestedUpdates = true;
|
|
error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown");
|
|
}
|
|
}
|
|
var update = createUpdate(eventTime, lane);
|
|
update.payload = {
|
|
element
|
|
};
|
|
callback = callback === void 0 ? null : callback;
|
|
if (callback !== null) {
|
|
{
|
|
if (typeof callback !== "function") {
|
|
error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
|
|
}
|
|
}
|
|
update.callback = callback;
|
|
}
|
|
var root2 = enqueueUpdate(current$1, update, lane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, current$1, lane, eventTime);
|
|
entangleTransitions(root2, current$1, lane);
|
|
}
|
|
return lane;
|
|
}
|
|
function getPublicRootInstance(container) {
|
|
var containerFiber = container.current;
|
|
if (!containerFiber.child) {
|
|
return null;
|
|
}
|
|
switch (containerFiber.child.tag) {
|
|
case HostComponent:
|
|
return getPublicInstance(containerFiber.child.stateNode);
|
|
default:
|
|
return containerFiber.child.stateNode;
|
|
}
|
|
}
|
|
function attemptSynchronousHydration$1(fiber) {
|
|
switch (fiber.tag) {
|
|
case HostRoot: {
|
|
var root2 = fiber.stateNode;
|
|
if (isRootDehydrated(root2)) {
|
|
var lanes = getHighestPriorityPendingLanes(root2);
|
|
flushRoot(root2, lanes);
|
|
}
|
|
break;
|
|
}
|
|
case SuspenseComponent: {
|
|
flushSync(function() {
|
|
var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root3 !== null) {
|
|
var eventTime = requestEventTime();
|
|
scheduleUpdateOnFiber(root3, fiber, SyncLane, eventTime);
|
|
}
|
|
});
|
|
var retryLane = SyncLane;
|
|
markRetryLaneIfNotHydrated(fiber, retryLane);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
function markRetryLaneImpl(fiber, retryLane) {
|
|
var suspenseState = fiber.memoizedState;
|
|
if (suspenseState !== null && suspenseState.dehydrated !== null) {
|
|
suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
|
|
}
|
|
}
|
|
function markRetryLaneIfNotHydrated(fiber, retryLane) {
|
|
markRetryLaneImpl(fiber, retryLane);
|
|
var alternate = fiber.alternate;
|
|
if (alternate) {
|
|
markRetryLaneImpl(alternate, retryLane);
|
|
}
|
|
}
|
|
function attemptContinuousHydration$1(fiber) {
|
|
if (fiber.tag !== SuspenseComponent) {
|
|
return;
|
|
}
|
|
var lane = SelectiveHydrationLane;
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, lane);
|
|
if (root2 !== null) {
|
|
var eventTime = requestEventTime();
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
}
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
function attemptHydrationAtCurrentPriority$1(fiber) {
|
|
if (fiber.tag !== SuspenseComponent) {
|
|
return;
|
|
}
|
|
var lane = requestUpdateLane(fiber);
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, lane);
|
|
if (root2 !== null) {
|
|
var eventTime = requestEventTime();
|
|
scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
|
|
}
|
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
}
|
|
function findHostInstanceWithNoPortals(fiber) {
|
|
var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
var shouldErrorImpl = function(fiber) {
|
|
return null;
|
|
};
|
|
function shouldError(fiber) {
|
|
return shouldErrorImpl(fiber);
|
|
}
|
|
var shouldSuspendImpl = function(fiber) {
|
|
return false;
|
|
};
|
|
function shouldSuspend(fiber) {
|
|
return shouldSuspendImpl(fiber);
|
|
}
|
|
var overrideHookState = null;
|
|
var overrideHookStateDeletePath = null;
|
|
var overrideHookStateRenamePath = null;
|
|
var overrideProps = null;
|
|
var overridePropsDeletePath = null;
|
|
var overridePropsRenamePath = null;
|
|
var scheduleUpdate = null;
|
|
var setErrorHandler = null;
|
|
var setSuspenseHandler = null;
|
|
{
|
|
var copyWithDeleteImpl = function(obj, path, index2) {
|
|
var key = path[index2];
|
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
if (index2 + 1 === path.length) {
|
|
if (isArray(updated)) {
|
|
updated.splice(key, 1);
|
|
} else {
|
|
delete updated[key];
|
|
}
|
|
return updated;
|
|
}
|
|
updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1);
|
|
return updated;
|
|
};
|
|
var copyWithDelete = function(obj, path) {
|
|
return copyWithDeleteImpl(obj, path, 0);
|
|
};
|
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
var oldKey = oldPath[index2];
|
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
if (index2 + 1 === oldPath.length) {
|
|
var newKey = newPath[index2];
|
|
updated[newKey] = updated[oldKey];
|
|
if (isArray(updated)) {
|
|
updated.splice(oldKey, 1);
|
|
} else {
|
|
delete updated[oldKey];
|
|
}
|
|
} else {
|
|
updated[oldKey] = copyWithRenameImpl(
|
|
obj[oldKey],
|
|
oldPath,
|
|
newPath,
|
|
index2 + 1
|
|
);
|
|
}
|
|
return updated;
|
|
};
|
|
var copyWithRename = function(obj, oldPath, newPath) {
|
|
if (oldPath.length !== newPath.length) {
|
|
warn("copyWithRename() expects paths of the same length");
|
|
return;
|
|
} else {
|
|
for (var i2 = 0; i2 < newPath.length - 1; i2++) {
|
|
if (oldPath[i2] !== newPath[i2]) {
|
|
warn("copyWithRename() expects paths to be the same except for the deepest key");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
};
|
|
var copyWithSetImpl = function(obj, path, index2, value) {
|
|
if (index2 >= path.length) {
|
|
return value;
|
|
}
|
|
var key = path[index2];
|
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value);
|
|
return updated;
|
|
};
|
|
var copyWithSet = function(obj, path, value) {
|
|
return copyWithSetImpl(obj, path, 0, value);
|
|
};
|
|
var findHook = function(fiber, id) {
|
|
var currentHook2 = fiber.memoizedState;
|
|
while (currentHook2 !== null && id > 0) {
|
|
currentHook2 = currentHook2.next;
|
|
id--;
|
|
}
|
|
return currentHook2;
|
|
};
|
|
overrideHookState = function(fiber, id, path, value) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithSet(hook.memoizedState, path, value);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
}
|
|
};
|
|
overrideHookStateDeletePath = function(fiber, id, path) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithDelete(hook.memoizedState, path);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
}
|
|
};
|
|
overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
|
|
var hook = findHook(fiber, id);
|
|
if (hook !== null) {
|
|
var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
|
|
hook.memoizedState = newState;
|
|
hook.baseState = newState;
|
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
}
|
|
};
|
|
overrideProps = function(fiber, path, value) {
|
|
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
overridePropsDeletePath = function(fiber, path) {
|
|
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
overridePropsRenamePath = function(fiber, oldPath, newPath) {
|
|
fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
|
|
if (fiber.alternate) {
|
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
}
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
scheduleUpdate = function(fiber) {
|
|
var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
if (root2 !== null) {
|
|
scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
|
|
}
|
|
};
|
|
setErrorHandler = function(newShouldErrorImpl) {
|
|
shouldErrorImpl = newShouldErrorImpl;
|
|
};
|
|
setSuspenseHandler = function(newShouldSuspendImpl) {
|
|
shouldSuspendImpl = newShouldSuspendImpl;
|
|
};
|
|
}
|
|
function findHostInstanceByFiber(fiber) {
|
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
if (hostFiber === null) {
|
|
return null;
|
|
}
|
|
return hostFiber.stateNode;
|
|
}
|
|
function emptyFindFiberByHostInstance(instance) {
|
|
return null;
|
|
}
|
|
function getCurrentFiberForDevTools() {
|
|
return current;
|
|
}
|
|
function injectIntoDevTools(devToolsConfig) {
|
|
var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
|
|
var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
return injectInternals({
|
|
bundleType: devToolsConfig.bundleType,
|
|
version: devToolsConfig.version,
|
|
rendererPackageName: devToolsConfig.rendererPackageName,
|
|
rendererConfig: devToolsConfig.rendererConfig,
|
|
overrideHookState,
|
|
overrideHookStateDeletePath,
|
|
overrideHookStateRenamePath,
|
|
overrideProps,
|
|
overridePropsDeletePath,
|
|
overridePropsRenamePath,
|
|
setErrorHandler,
|
|
setSuspenseHandler,
|
|
scheduleUpdate,
|
|
currentDispatcherRef: ReactCurrentDispatcher2,
|
|
findHostInstanceByFiber,
|
|
findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
|
|
findHostInstancesForRefresh,
|
|
scheduleRefresh,
|
|
scheduleRoot,
|
|
setRefreshHandler,
|
|
getCurrentFiber: getCurrentFiberForDevTools,
|
|
reconcilerVersion: ReactVersion
|
|
});
|
|
}
|
|
var defaultOnRecoverableError = typeof reportError === "function" ? reportError : function(error2) {
|
|
console["error"](error2);
|
|
};
|
|
function ReactDOMRoot(internalRoot) {
|
|
this._internalRoot = internalRoot;
|
|
}
|
|
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
|
|
var root2 = this._internalRoot;
|
|
if (root2 === null) {
|
|
throw new Error("Cannot update an unmounted root.");
|
|
}
|
|
{
|
|
if (typeof arguments[1] === "function") {
|
|
error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
|
|
} else if (isValidContainer(arguments[1])) {
|
|
error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");
|
|
} else if (typeof arguments[1] !== "undefined") {
|
|
error("You passed a second argument to root.render(...) but it only accepts one argument.");
|
|
}
|
|
var container = root2.containerInfo;
|
|
if (container.nodeType !== COMMENT_NODE) {
|
|
var hostInstance = findHostInstanceWithNoPortals(root2.current);
|
|
if (hostInstance) {
|
|
if (hostInstance.parentNode !== container) {
|
|
error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
updateContainer(children, root2, null, null);
|
|
};
|
|
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
|
|
{
|
|
if (typeof arguments[0] === "function") {
|
|
error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
|
|
}
|
|
}
|
|
var root2 = this._internalRoot;
|
|
if (root2 !== null) {
|
|
this._internalRoot = null;
|
|
var container = root2.containerInfo;
|
|
{
|
|
if (isAlreadyRendering()) {
|
|
error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");
|
|
}
|
|
}
|
|
flushSync(function() {
|
|
updateContainer(null, root2, null, null);
|
|
});
|
|
unmarkContainerAsRoot(container);
|
|
}
|
|
};
|
|
function createRoot2(container, options2) {
|
|
if (!isValidContainer(container)) {
|
|
throw new Error("createRoot(...): Target container is not a DOM element.");
|
|
}
|
|
warnIfReactDOMContainerInDEV(container);
|
|
var isStrictMode = false;
|
|
var concurrentUpdatesByDefaultOverride = false;
|
|
var identifierPrefix = "";
|
|
var onRecoverableError = defaultOnRecoverableError;
|
|
var transitionCallbacks = null;
|
|
if (options2 !== null && options2 !== void 0) {
|
|
{
|
|
if (options2.hydrate) {
|
|
warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
|
|
} else {
|
|
if (typeof options2 === "object" && options2 !== null && options2.$$typeof === REACT_ELEMENT_TYPE) {
|
|
error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);");
|
|
}
|
|
}
|
|
}
|
|
if (options2.unstable_strictMode === true) {
|
|
isStrictMode = true;
|
|
}
|
|
if (options2.identifierPrefix !== void 0) {
|
|
identifierPrefix = options2.identifierPrefix;
|
|
}
|
|
if (options2.onRecoverableError !== void 0) {
|
|
onRecoverableError = options2.onRecoverableError;
|
|
}
|
|
if (options2.transitionCallbacks !== void 0) {
|
|
transitionCallbacks = options2.transitionCallbacks;
|
|
}
|
|
}
|
|
var root2 = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
|
|
markContainerAsRoot(root2.current, container);
|
|
var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
|
|
listenToAllSupportedEvents(rootContainerElement);
|
|
return new ReactDOMRoot(root2);
|
|
}
|
|
function ReactDOMHydrationRoot(internalRoot) {
|
|
this._internalRoot = internalRoot;
|
|
}
|
|
function scheduleHydration(target) {
|
|
if (target) {
|
|
queueExplicitHydrationTarget(target);
|
|
}
|
|
}
|
|
ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
|
|
function hydrateRoot(container, initialChildren, options2) {
|
|
if (!isValidContainer(container)) {
|
|
throw new Error("hydrateRoot(...): Target container is not a DOM element.");
|
|
}
|
|
warnIfReactDOMContainerInDEV(container);
|
|
{
|
|
if (initialChildren === void 0) {
|
|
error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
|
|
}
|
|
}
|
|
var hydrationCallbacks = options2 != null ? options2 : null;
|
|
var mutableSources = options2 != null && options2.hydratedSources || null;
|
|
var isStrictMode = false;
|
|
var concurrentUpdatesByDefaultOverride = false;
|
|
var identifierPrefix = "";
|
|
var onRecoverableError = defaultOnRecoverableError;
|
|
if (options2 !== null && options2 !== void 0) {
|
|
if (options2.unstable_strictMode === true) {
|
|
isStrictMode = true;
|
|
}
|
|
if (options2.identifierPrefix !== void 0) {
|
|
identifierPrefix = options2.identifierPrefix;
|
|
}
|
|
if (options2.onRecoverableError !== void 0) {
|
|
onRecoverableError = options2.onRecoverableError;
|
|
}
|
|
}
|
|
var root2 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
|
|
markContainerAsRoot(root2.current, container);
|
|
listenToAllSupportedEvents(container);
|
|
if (mutableSources) {
|
|
for (var i2 = 0; i2 < mutableSources.length; i2++) {
|
|
var mutableSource = mutableSources[i2];
|
|
registerMutableSourceForHydration(root2, mutableSource);
|
|
}
|
|
}
|
|
return new ReactDOMHydrationRoot(root2);
|
|
}
|
|
function isValidContainer(node) {
|
|
return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
|
|
}
|
|
function isValidContainerLegacy(node) {
|
|
return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
|
|
}
|
|
function warnIfReactDOMContainerInDEV(container) {
|
|
{
|
|
if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
|
|
error("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");
|
|
}
|
|
if (isContainerMarkedAsRoot(container)) {
|
|
if (container._reactRootContainer) {
|
|
error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
|
|
} else {
|
|
error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
|
|
var topLevelUpdateWarnings;
|
|
{
|
|
topLevelUpdateWarnings = function(container) {
|
|
if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
|
|
var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);
|
|
if (hostInstance) {
|
|
if (hostInstance.parentNode !== container) {
|
|
error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
|
|
}
|
|
}
|
|
}
|
|
var isRootRenderedBySomeReact = !!container._reactRootContainer;
|
|
var rootEl = getReactRootElementInContainer(container);
|
|
var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
|
|
if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
|
|
error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
|
|
}
|
|
if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
|
|
error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
|
|
}
|
|
};
|
|
}
|
|
function getReactRootElementInContainer(container) {
|
|
if (!container) {
|
|
return null;
|
|
}
|
|
if (container.nodeType === DOCUMENT_NODE) {
|
|
return container.documentElement;
|
|
} else {
|
|
return container.firstChild;
|
|
}
|
|
}
|
|
function noopOnRecoverableError() {
|
|
}
|
|
function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
|
|
if (isHydrationContainer) {
|
|
if (typeof callback === "function") {
|
|
var originalCallback = callback;
|
|
callback = function() {
|
|
var instance = getPublicRootInstance(root2);
|
|
originalCallback.call(instance);
|
|
};
|
|
}
|
|
var root2 = createHydrationContainer(
|
|
initialChildren,
|
|
callback,
|
|
container,
|
|
LegacyRoot,
|
|
null,
|
|
false,
|
|
false,
|
|
"",
|
|
noopOnRecoverableError
|
|
);
|
|
container._reactRootContainer = root2;
|
|
markContainerAsRoot(root2.current, container);
|
|
var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
|
|
listenToAllSupportedEvents(rootContainerElement);
|
|
flushSync();
|
|
return root2;
|
|
} else {
|
|
var rootSibling;
|
|
while (rootSibling = container.lastChild) {
|
|
container.removeChild(rootSibling);
|
|
}
|
|
if (typeof callback === "function") {
|
|
var _originalCallback = callback;
|
|
callback = function() {
|
|
var instance = getPublicRootInstance(_root);
|
|
_originalCallback.call(instance);
|
|
};
|
|
}
|
|
var _root = createContainer(
|
|
container,
|
|
LegacyRoot,
|
|
null,
|
|
false,
|
|
false,
|
|
"",
|
|
noopOnRecoverableError
|
|
);
|
|
container._reactRootContainer = _root;
|
|
markContainerAsRoot(_root.current, container);
|
|
var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
|
|
listenToAllSupportedEvents(_rootContainerElement);
|
|
flushSync(function() {
|
|
updateContainer(initialChildren, _root, parentComponent, callback);
|
|
});
|
|
return _root;
|
|
}
|
|
}
|
|
function warnOnInvalidCallback$1(callback, callerName) {
|
|
{
|
|
if (callback !== null && typeof callback !== "function") {
|
|
error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
|
|
}
|
|
}
|
|
}
|
|
function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
|
|
{
|
|
topLevelUpdateWarnings(container);
|
|
warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
|
|
}
|
|
var maybeRoot = container._reactRootContainer;
|
|
var root2;
|
|
if (!maybeRoot) {
|
|
root2 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
|
|
} else {
|
|
root2 = maybeRoot;
|
|
if (typeof callback === "function") {
|
|
var originalCallback = callback;
|
|
callback = function() {
|
|
var instance = getPublicRootInstance(root2);
|
|
originalCallback.call(instance);
|
|
};
|
|
}
|
|
updateContainer(children, root2, parentComponent, callback);
|
|
}
|
|
return getPublicRootInstance(root2);
|
|
}
|
|
function findDOMNode(componentOrElement) {
|
|
{
|
|
var owner = ReactCurrentOwner$3.current;
|
|
if (owner !== null && owner.stateNode !== null) {
|
|
var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
|
|
if (!warnedAboutRefsInRender) {
|
|
error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component");
|
|
}
|
|
owner.stateNode._warnedAboutRefsInRender = true;
|
|
}
|
|
}
|
|
if (componentOrElement == null) {
|
|
return null;
|
|
}
|
|
if (componentOrElement.nodeType === ELEMENT_NODE) {
|
|
return componentOrElement;
|
|
}
|
|
{
|
|
return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
|
|
}
|
|
}
|
|
function hydrate(element, container, callback) {
|
|
{
|
|
error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
|
|
}
|
|
if (!isValidContainerLegacy(container)) {
|
|
throw new Error("Target container is not a DOM element.");
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
|
|
}
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
|
|
}
|
|
function render(element, container, callback) {
|
|
{
|
|
error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
|
|
}
|
|
if (!isValidContainerLegacy(container)) {
|
|
throw new Error("Target container is not a DOM element.");
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
|
|
}
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
|
|
}
|
|
function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
|
|
{
|
|
error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
|
|
}
|
|
if (!isValidContainerLegacy(containerNode)) {
|
|
throw new Error("Target container is not a DOM element.");
|
|
}
|
|
if (parentComponent == null || !has(parentComponent)) {
|
|
throw new Error("parentComponent must be a valid React Component");
|
|
}
|
|
return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
|
|
}
|
|
function unmountComponentAtNode(container) {
|
|
if (!isValidContainerLegacy(container)) {
|
|
throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
|
|
}
|
|
{
|
|
var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
|
|
if (isModernRoot) {
|
|
error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
|
|
}
|
|
}
|
|
if (container._reactRootContainer) {
|
|
{
|
|
var rootEl = getReactRootElementInContainer(container);
|
|
var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
|
|
if (renderedByDifferentReact) {
|
|
error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
|
|
}
|
|
}
|
|
flushSync(function() {
|
|
legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
|
|
container._reactRootContainer = null;
|
|
unmarkContainerAsRoot(container);
|
|
});
|
|
});
|
|
return true;
|
|
} else {
|
|
{
|
|
var _rootEl = getReactRootElementInContainer(container);
|
|
var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
|
|
var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;
|
|
if (hasNonRootReactChild) {
|
|
error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
setAttemptSynchronousHydration(attemptSynchronousHydration$1);
|
|
setAttemptContinuousHydration(attemptContinuousHydration$1);
|
|
setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
|
|
setGetCurrentUpdatePriority(getCurrentUpdatePriority);
|
|
setAttemptHydrationAtPriority(runWithPriority);
|
|
{
|
|
if (typeof Map !== "function" || Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
|
|
error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
|
|
}
|
|
}
|
|
setRestoreImplementation(restoreControlledState$3);
|
|
setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);
|
|
function createPortal$1(children, container) {
|
|
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
if (!isValidContainer(container)) {
|
|
throw new Error("Target container is not a DOM element.");
|
|
}
|
|
return createPortal(children, container, null, key);
|
|
}
|
|
function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
|
|
return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
|
|
}
|
|
var Internals = {
|
|
usingClientEntryPoint: false,
|
|
Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
|
|
};
|
|
function createRoot$1(container, options2) {
|
|
{
|
|
if (!Internals.usingClientEntryPoint && true) {
|
|
error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
|
|
}
|
|
}
|
|
return createRoot2(container, options2);
|
|
}
|
|
function hydrateRoot$1(container, initialChildren, options2) {
|
|
{
|
|
if (!Internals.usingClientEntryPoint && true) {
|
|
error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
|
|
}
|
|
}
|
|
return hydrateRoot(container, initialChildren, options2);
|
|
}
|
|
function flushSync$1(fn2) {
|
|
{
|
|
if (isAlreadyRendering()) {
|
|
error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
|
|
}
|
|
}
|
|
return flushSync(fn2);
|
|
}
|
|
var foundDevTools = injectIntoDevTools({
|
|
findFiberByHostInstance: getClosestInstanceFromNode,
|
|
bundleType: 1,
|
|
version: ReactVersion,
|
|
rendererPackageName: "react-dom"
|
|
});
|
|
{
|
|
if (!foundDevTools && canUseDOM2 && window.top === window.self) {
|
|
if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
|
|
var protocol = window.location.protocol;
|
|
if (/^(https?|file):$/.test(protocol)) {
|
|
console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
|
exports.createPortal = createPortal$1;
|
|
exports.createRoot = createRoot$1;
|
|
exports.findDOMNode = findDOMNode;
|
|
exports.flushSync = flushSync$1;
|
|
exports.hydrate = hydrate;
|
|
exports.hydrateRoot = hydrateRoot$1;
|
|
exports.render = render;
|
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
exports.unstable_batchedUpdates = batchedUpdates$1;
|
|
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
|
|
exports.version = ReactVersion;
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
}
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/index.js
|
|
var require_react_dom = __commonJS({
|
|
"node_modules/react-dom/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
checkDCE();
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_dom_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-dom/client.js
|
|
var require_client = __commonJS({
|
|
"node_modules/react-dom/client.js"(exports) {
|
|
"use strict";
|
|
var m2 = require_react_dom();
|
|
if (false) {
|
|
exports.createRoot = m2.createRoot;
|
|
exports.hydrateRoot = m2.hydrateRoot;
|
|
} else {
|
|
i2 = m2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
exports.createRoot = function(c2, o2) {
|
|
i2.usingClientEntryPoint = true;
|
|
try {
|
|
return m2.createRoot(c2, o2);
|
|
} finally {
|
|
i2.usingClientEntryPoint = false;
|
|
}
|
|
};
|
|
exports.hydrateRoot = function(c2, h2, o2) {
|
|
i2.usingClientEntryPoint = true;
|
|
try {
|
|
return m2.hydrateRoot(c2, h2, o2);
|
|
} finally {
|
|
i2.usingClientEntryPoint = false;
|
|
}
|
|
};
|
|
}
|
|
var i2;
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/lodash.js
|
|
var require_lodash = __commonJS({
|
|
"node_modules/lodash/lodash.js"(exports, module2) {
|
|
(function() {
|
|
var undefined2;
|
|
var VERSION = "4.17.21";
|
|
var LARGE_ARRAY_SIZE = 200;
|
|
var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
|
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
var MAX_MEMOIZE_SIZE = 500;
|
|
var PLACEHOLDER = "__lodash_placeholder__";
|
|
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
|
|
var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
|
|
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
|
|
var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
|
|
var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
|
var wrapFlags = [
|
|
["ary", WRAP_ARY_FLAG],
|
|
["bind", WRAP_BIND_FLAG],
|
|
["bindKey", WRAP_BIND_KEY_FLAG],
|
|
["curry", WRAP_CURRY_FLAG],
|
|
["curryRight", WRAP_CURRY_RIGHT_FLAG],
|
|
["flip", WRAP_FLIP_FLAG],
|
|
["partial", WRAP_PARTIAL_FLAG],
|
|
["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
|
|
["rearg", WRAP_REARG_FLAG]
|
|
];
|
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
|
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
|
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
|
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
var reTrimStart = /^\s+/;
|
|
var reWhitespace = /\s/;
|
|
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
|
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
|
var reEscapeChar = /\\(\\)?/g;
|
|
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
|
var reFlags = /\w*$/;
|
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
var reIsBinary = /^0b[01]+$/i;
|
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
var reIsOctal = /^0o[0-7]+$/i;
|
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
var reNoMatch = /($^)/;
|
|
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
|
|
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
var reApos = RegExp(rsApos, "g");
|
|
var reComboMark = RegExp(rsCombo, "g");
|
|
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
var reUnicodeWord = RegExp([
|
|
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
rsUpper + "+" + rsOptContrUpper,
|
|
rsOrdUpper,
|
|
rsOrdLower,
|
|
rsDigits,
|
|
rsEmoji
|
|
].join("|"), "g");
|
|
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
var contextProps = [
|
|
"Array",
|
|
"Buffer",
|
|
"DataView",
|
|
"Date",
|
|
"Error",
|
|
"Float32Array",
|
|
"Float64Array",
|
|
"Function",
|
|
"Int8Array",
|
|
"Int16Array",
|
|
"Int32Array",
|
|
"Map",
|
|
"Math",
|
|
"Object",
|
|
"Promise",
|
|
"RegExp",
|
|
"Set",
|
|
"String",
|
|
"Symbol",
|
|
"TypeError",
|
|
"Uint8Array",
|
|
"Uint8ClampedArray",
|
|
"Uint16Array",
|
|
"Uint32Array",
|
|
"WeakMap",
|
|
"_",
|
|
"clearTimeout",
|
|
"isFinite",
|
|
"parseInt",
|
|
"setTimeout"
|
|
];
|
|
var templateCounter = -1;
|
|
var typedArrayTags = {};
|
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
var cloneableTags = {};
|
|
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
var deburredLetters = {
|
|
"\xC0": "A",
|
|
"\xC1": "A",
|
|
"\xC2": "A",
|
|
"\xC3": "A",
|
|
"\xC4": "A",
|
|
"\xC5": "A",
|
|
"\xE0": "a",
|
|
"\xE1": "a",
|
|
"\xE2": "a",
|
|
"\xE3": "a",
|
|
"\xE4": "a",
|
|
"\xE5": "a",
|
|
"\xC7": "C",
|
|
"\xE7": "c",
|
|
"\xD0": "D",
|
|
"\xF0": "d",
|
|
"\xC8": "E",
|
|
"\xC9": "E",
|
|
"\xCA": "E",
|
|
"\xCB": "E",
|
|
"\xE8": "e",
|
|
"\xE9": "e",
|
|
"\xEA": "e",
|
|
"\xEB": "e",
|
|
"\xCC": "I",
|
|
"\xCD": "I",
|
|
"\xCE": "I",
|
|
"\xCF": "I",
|
|
"\xEC": "i",
|
|
"\xED": "i",
|
|
"\xEE": "i",
|
|
"\xEF": "i",
|
|
"\xD1": "N",
|
|
"\xF1": "n",
|
|
"\xD2": "O",
|
|
"\xD3": "O",
|
|
"\xD4": "O",
|
|
"\xD5": "O",
|
|
"\xD6": "O",
|
|
"\xD8": "O",
|
|
"\xF2": "o",
|
|
"\xF3": "o",
|
|
"\xF4": "o",
|
|
"\xF5": "o",
|
|
"\xF6": "o",
|
|
"\xF8": "o",
|
|
"\xD9": "U",
|
|
"\xDA": "U",
|
|
"\xDB": "U",
|
|
"\xDC": "U",
|
|
"\xF9": "u",
|
|
"\xFA": "u",
|
|
"\xFB": "u",
|
|
"\xFC": "u",
|
|
"\xDD": "Y",
|
|
"\xFD": "y",
|
|
"\xFF": "y",
|
|
"\xC6": "Ae",
|
|
"\xE6": "ae",
|
|
"\xDE": "Th",
|
|
"\xFE": "th",
|
|
"\xDF": "ss",
|
|
"\u0100": "A",
|
|
"\u0102": "A",
|
|
"\u0104": "A",
|
|
"\u0101": "a",
|
|
"\u0103": "a",
|
|
"\u0105": "a",
|
|
"\u0106": "C",
|
|
"\u0108": "C",
|
|
"\u010A": "C",
|
|
"\u010C": "C",
|
|
"\u0107": "c",
|
|
"\u0109": "c",
|
|
"\u010B": "c",
|
|
"\u010D": "c",
|
|
"\u010E": "D",
|
|
"\u0110": "D",
|
|
"\u010F": "d",
|
|
"\u0111": "d",
|
|
"\u0112": "E",
|
|
"\u0114": "E",
|
|
"\u0116": "E",
|
|
"\u0118": "E",
|
|
"\u011A": "E",
|
|
"\u0113": "e",
|
|
"\u0115": "e",
|
|
"\u0117": "e",
|
|
"\u0119": "e",
|
|
"\u011B": "e",
|
|
"\u011C": "G",
|
|
"\u011E": "G",
|
|
"\u0120": "G",
|
|
"\u0122": "G",
|
|
"\u011D": "g",
|
|
"\u011F": "g",
|
|
"\u0121": "g",
|
|
"\u0123": "g",
|
|
"\u0124": "H",
|
|
"\u0126": "H",
|
|
"\u0125": "h",
|
|
"\u0127": "h",
|
|
"\u0128": "I",
|
|
"\u012A": "I",
|
|
"\u012C": "I",
|
|
"\u012E": "I",
|
|
"\u0130": "I",
|
|
"\u0129": "i",
|
|
"\u012B": "i",
|
|
"\u012D": "i",
|
|
"\u012F": "i",
|
|
"\u0131": "i",
|
|
"\u0134": "J",
|
|
"\u0135": "j",
|
|
"\u0136": "K",
|
|
"\u0137": "k",
|
|
"\u0138": "k",
|
|
"\u0139": "L",
|
|
"\u013B": "L",
|
|
"\u013D": "L",
|
|
"\u013F": "L",
|
|
"\u0141": "L",
|
|
"\u013A": "l",
|
|
"\u013C": "l",
|
|
"\u013E": "l",
|
|
"\u0140": "l",
|
|
"\u0142": "l",
|
|
"\u0143": "N",
|
|
"\u0145": "N",
|
|
"\u0147": "N",
|
|
"\u014A": "N",
|
|
"\u0144": "n",
|
|
"\u0146": "n",
|
|
"\u0148": "n",
|
|
"\u014B": "n",
|
|
"\u014C": "O",
|
|
"\u014E": "O",
|
|
"\u0150": "O",
|
|
"\u014D": "o",
|
|
"\u014F": "o",
|
|
"\u0151": "o",
|
|
"\u0154": "R",
|
|
"\u0156": "R",
|
|
"\u0158": "R",
|
|
"\u0155": "r",
|
|
"\u0157": "r",
|
|
"\u0159": "r",
|
|
"\u015A": "S",
|
|
"\u015C": "S",
|
|
"\u015E": "S",
|
|
"\u0160": "S",
|
|
"\u015B": "s",
|
|
"\u015D": "s",
|
|
"\u015F": "s",
|
|
"\u0161": "s",
|
|
"\u0162": "T",
|
|
"\u0164": "T",
|
|
"\u0166": "T",
|
|
"\u0163": "t",
|
|
"\u0165": "t",
|
|
"\u0167": "t",
|
|
"\u0168": "U",
|
|
"\u016A": "U",
|
|
"\u016C": "U",
|
|
"\u016E": "U",
|
|
"\u0170": "U",
|
|
"\u0172": "U",
|
|
"\u0169": "u",
|
|
"\u016B": "u",
|
|
"\u016D": "u",
|
|
"\u016F": "u",
|
|
"\u0171": "u",
|
|
"\u0173": "u",
|
|
"\u0174": "W",
|
|
"\u0175": "w",
|
|
"\u0176": "Y",
|
|
"\u0177": "y",
|
|
"\u0178": "Y",
|
|
"\u0179": "Z",
|
|
"\u017B": "Z",
|
|
"\u017D": "Z",
|
|
"\u017A": "z",
|
|
"\u017C": "z",
|
|
"\u017E": "z",
|
|
"\u0132": "IJ",
|
|
"\u0133": "ij",
|
|
"\u0152": "Oe",
|
|
"\u0153": "oe",
|
|
"\u0149": "'n",
|
|
"\u017F": "s"
|
|
};
|
|
var htmlEscapes = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
'"': """,
|
|
"'": "'"
|
|
};
|
|
var htmlUnescapes = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
""": '"',
|
|
"'": "'"
|
|
};
|
|
var stringEscapes = {
|
|
"\\": "\\",
|
|
"'": "'",
|
|
"\n": "n",
|
|
"\r": "r",
|
|
"\u2028": "u2028",
|
|
"\u2029": "u2029"
|
|
};
|
|
var freeParseFloat = parseFloat, freeParseInt = parseInt;
|
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
|
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
var nodeUtil = function() {
|
|
try {
|
|
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
if (types) {
|
|
return types;
|
|
}
|
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
function apply(func, thisArg, args) {
|
|
switch (args.length) {
|
|
case 0:
|
|
return func.call(thisArg);
|
|
case 1:
|
|
return func.call(thisArg, args[0]);
|
|
case 2:
|
|
return func.call(thisArg, args[0], args[1]);
|
|
case 3:
|
|
return func.call(thisArg, args[0], args[1], args[2]);
|
|
}
|
|
return func.apply(thisArg, args);
|
|
}
|
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
setter(accumulator, value, iteratee(value), array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arrayEach(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (iteratee(array[index], index, array) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function arrayEachRight(array, iteratee) {
|
|
var length = array == null ? 0 : array.length;
|
|
while (length--) {
|
|
if (iteratee(array[length], length, array) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function arrayEvery(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (!predicate(array[index], index, array)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function arrayFilter(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (predicate(value, index, array)) {
|
|
result[resIndex++] = value;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function arrayIncludes(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
}
|
|
function arrayIncludesWith(array, value, comparator) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (comparator(value, array[index])) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function arrayMap(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
while (++index < length) {
|
|
result[index] = iteratee(array[index], index, array);
|
|
}
|
|
return result;
|
|
}
|
|
function arrayPush(array, values2) {
|
|
var index = -1, length = values2.length, offset = array.length;
|
|
while (++index < length) {
|
|
array[offset + index] = values2[index];
|
|
}
|
|
return array;
|
|
}
|
|
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
if (initAccum && length) {
|
|
accumulator = array[++index];
|
|
}
|
|
while (++index < length) {
|
|
accumulator = iteratee(accumulator, array[index], index, array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (initAccum && length) {
|
|
accumulator = array[--length];
|
|
}
|
|
while (length--) {
|
|
accumulator = iteratee(accumulator, array[length], length, array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arraySome(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (predicate(array[index], index, array)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
var asciiSize = baseProperty("length");
|
|
function asciiToArray(string) {
|
|
return string.split("");
|
|
}
|
|
function asciiWords(string) {
|
|
return string.match(reAsciiWord) || [];
|
|
}
|
|
function baseFindKey(collection, predicate, eachFunc) {
|
|
var result;
|
|
eachFunc(collection, function(value, key, collection2) {
|
|
if (predicate(value, key, collection2)) {
|
|
result = key;
|
|
return false;
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
while (fromRight ? index-- : ++index < length) {
|
|
if (predicate(array[index], index, array)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseIndexOf(array, value, fromIndex) {
|
|
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
}
|
|
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
|
var index = fromIndex - 1, length = array.length;
|
|
while (++index < length) {
|
|
if (comparator(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseIsNaN(value) {
|
|
return value !== value;
|
|
}
|
|
function baseMean(array, iteratee) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSum(array, iteratee) / length : NAN;
|
|
}
|
|
function baseProperty(key) {
|
|
return function(object) {
|
|
return object == null ? undefined2 : object[key];
|
|
};
|
|
}
|
|
function basePropertyOf(object) {
|
|
return function(key) {
|
|
return object == null ? undefined2 : object[key];
|
|
};
|
|
}
|
|
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
|
eachFunc(collection, function(value, index, collection2) {
|
|
accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseSortBy(array, comparer) {
|
|
var length = array.length;
|
|
array.sort(comparer);
|
|
while (length--) {
|
|
array[length] = array[length].value;
|
|
}
|
|
return array;
|
|
}
|
|
function baseSum(array, iteratee) {
|
|
var result, index = -1, length = array.length;
|
|
while (++index < length) {
|
|
var current = iteratee(array[index]);
|
|
if (current !== undefined2) {
|
|
result = result === undefined2 ? current : result + current;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function baseTimes(n2, iteratee) {
|
|
var index = -1, result = Array(n2);
|
|
while (++index < n2) {
|
|
result[index] = iteratee(index);
|
|
}
|
|
return result;
|
|
}
|
|
function baseToPairs(object, props) {
|
|
return arrayMap(props, function(key) {
|
|
return [key, object[key]];
|
|
});
|
|
}
|
|
function baseTrim(string) {
|
|
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
}
|
|
function baseUnary(func) {
|
|
return function(value) {
|
|
return func(value);
|
|
};
|
|
}
|
|
function baseValues(object, props) {
|
|
return arrayMap(props, function(key) {
|
|
return object[key];
|
|
});
|
|
}
|
|
function cacheHas(cache, key) {
|
|
return cache.has(key);
|
|
}
|
|
function charsStartIndex(strSymbols, chrSymbols) {
|
|
var index = -1, length = strSymbols.length;
|
|
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
}
|
|
return index;
|
|
}
|
|
function charsEndIndex(strSymbols, chrSymbols) {
|
|
var index = strSymbols.length;
|
|
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
}
|
|
return index;
|
|
}
|
|
function countHolders(array, placeholder) {
|
|
var length = array.length, result = 0;
|
|
while (length--) {
|
|
if (array[length] === placeholder) {
|
|
++result;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
var deburrLetter = basePropertyOf(deburredLetters);
|
|
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
|
function escapeStringChar(chr) {
|
|
return "\\" + stringEscapes[chr];
|
|
}
|
|
function getValue3(object, key) {
|
|
return object == null ? undefined2 : object[key];
|
|
}
|
|
function hasUnicode(string) {
|
|
return reHasUnicode.test(string);
|
|
}
|
|
function hasUnicodeWord(string) {
|
|
return reHasUnicodeWord.test(string);
|
|
}
|
|
function iteratorToArray(iterator) {
|
|
var data, result = [];
|
|
while (!(data = iterator.next()).done) {
|
|
result.push(data.value);
|
|
}
|
|
return result;
|
|
}
|
|
function mapToArray(map) {
|
|
var index = -1, result = Array(map.size);
|
|
map.forEach(function(value, key) {
|
|
result[++index] = [key, value];
|
|
});
|
|
return result;
|
|
}
|
|
function overArg(func, transform2) {
|
|
return function(arg) {
|
|
return func(transform2(arg));
|
|
};
|
|
}
|
|
function replaceHolders(array, placeholder) {
|
|
var index = -1, length = array.length, resIndex = 0, result = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (value === placeholder || value === PLACEHOLDER) {
|
|
array[index] = PLACEHOLDER;
|
|
result[resIndex++] = index;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function setToArray(set) {
|
|
var index = -1, result = Array(set.size);
|
|
set.forEach(function(value) {
|
|
result[++index] = value;
|
|
});
|
|
return result;
|
|
}
|
|
function setToPairs(set) {
|
|
var index = -1, result = Array(set.size);
|
|
set.forEach(function(value) {
|
|
result[++index] = [value, value];
|
|
});
|
|
return result;
|
|
}
|
|
function strictIndexOf(array, value, fromIndex) {
|
|
var index = fromIndex - 1, length = array.length;
|
|
while (++index < length) {
|
|
if (array[index] === value) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function strictLastIndexOf(array, value, fromIndex) {
|
|
var index = fromIndex + 1;
|
|
while (index--) {
|
|
if (array[index] === value) {
|
|
return index;
|
|
}
|
|
}
|
|
return index;
|
|
}
|
|
function stringSize(string) {
|
|
return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
|
|
}
|
|
function stringToArray(string) {
|
|
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
}
|
|
function trimmedEndIndex(string) {
|
|
var index = string.length;
|
|
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
}
|
|
return index;
|
|
}
|
|
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
|
|
function unicodeSize(string) {
|
|
var result = reUnicode.lastIndex = 0;
|
|
while (reUnicode.test(string)) {
|
|
++result;
|
|
}
|
|
return result;
|
|
}
|
|
function unicodeToArray(string) {
|
|
return string.match(reUnicode) || [];
|
|
}
|
|
function unicodeWords(string) {
|
|
return string.match(reUnicodeWord) || [];
|
|
}
|
|
var runInContext = function runInContext2(context) {
|
|
context = context == null ? root : _3.defaults(root.Object(), context, _3.pick(root, contextProps));
|
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
var coreJsData = context["__core-js_shared__"];
|
|
var funcToString = funcProto.toString;
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
var idCounter = 0;
|
|
var maskSrcKey = function() {
|
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
}();
|
|
var nativeObjectToString = objectProto.toString;
|
|
var objectCtorString = funcToString.call(Object2);
|
|
var oldDash = root._;
|
|
var reIsNative = RegExp2(
|
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
);
|
|
var Buffer2 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
|
|
var defineProperty = function() {
|
|
try {
|
|
var func = getNative(Object2, "defineProperty");
|
|
func({}, "", {});
|
|
return func;
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
var realNames = {};
|
|
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
|
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2;
|
|
function lodash(value) {
|
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
if (value instanceof LodashWrapper) {
|
|
return value;
|
|
}
|
|
if (hasOwnProperty.call(value, "__wrapped__")) {
|
|
return wrapperClone(value);
|
|
}
|
|
}
|
|
return new LodashWrapper(value);
|
|
}
|
|
var baseCreate = function() {
|
|
function object() {
|
|
}
|
|
return function(proto) {
|
|
if (!isObject(proto)) {
|
|
return {};
|
|
}
|
|
if (objectCreate) {
|
|
return objectCreate(proto);
|
|
}
|
|
object.prototype = proto;
|
|
var result2 = new object();
|
|
object.prototype = undefined2;
|
|
return result2;
|
|
};
|
|
}();
|
|
function baseLodash() {
|
|
}
|
|
function LodashWrapper(value, chainAll) {
|
|
this.__wrapped__ = value;
|
|
this.__actions__ = [];
|
|
this.__chain__ = !!chainAll;
|
|
this.__index__ = 0;
|
|
this.__values__ = undefined2;
|
|
}
|
|
lodash.templateSettings = {
|
|
"escape": reEscape,
|
|
"evaluate": reEvaluate,
|
|
"interpolate": reInterpolate,
|
|
"variable": "",
|
|
"imports": {
|
|
"_": lodash
|
|
}
|
|
};
|
|
lodash.prototype = baseLodash.prototype;
|
|
lodash.prototype.constructor = lodash;
|
|
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
|
|
LodashWrapper.prototype.constructor = LodashWrapper;
|
|
function LazyWrapper(value) {
|
|
this.__wrapped__ = value;
|
|
this.__actions__ = [];
|
|
this.__dir__ = 1;
|
|
this.__filtered__ = false;
|
|
this.__iteratees__ = [];
|
|
this.__takeCount__ = MAX_ARRAY_LENGTH;
|
|
this.__views__ = [];
|
|
}
|
|
function lazyClone() {
|
|
var result2 = new LazyWrapper(this.__wrapped__);
|
|
result2.__actions__ = copyArray(this.__actions__);
|
|
result2.__dir__ = this.__dir__;
|
|
result2.__filtered__ = this.__filtered__;
|
|
result2.__iteratees__ = copyArray(this.__iteratees__);
|
|
result2.__takeCount__ = this.__takeCount__;
|
|
result2.__views__ = copyArray(this.__views__);
|
|
return result2;
|
|
}
|
|
function lazyReverse() {
|
|
if (this.__filtered__) {
|
|
var result2 = new LazyWrapper(this);
|
|
result2.__dir__ = -1;
|
|
result2.__filtered__ = true;
|
|
} else {
|
|
result2 = this.clone();
|
|
result2.__dir__ *= -1;
|
|
}
|
|
return result2;
|
|
}
|
|
function lazyValue() {
|
|
var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
|
|
if (!isArr || !isRight && arrLength == length && takeCount == length) {
|
|
return baseWrapperValue(array, this.__actions__);
|
|
}
|
|
var result2 = [];
|
|
outer:
|
|
while (length-- && resIndex < takeCount) {
|
|
index += dir;
|
|
var iterIndex = -1, value = array[index];
|
|
while (++iterIndex < iterLength) {
|
|
var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
|
|
if (type == LAZY_MAP_FLAG) {
|
|
value = computed;
|
|
} else if (!computed) {
|
|
if (type == LAZY_FILTER_FLAG) {
|
|
continue outer;
|
|
} else {
|
|
break outer;
|
|
}
|
|
}
|
|
}
|
|
result2[resIndex++] = value;
|
|
}
|
|
return result2;
|
|
}
|
|
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
|
|
LazyWrapper.prototype.constructor = LazyWrapper;
|
|
function Hash(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function hashClear() {
|
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
this.size = 0;
|
|
}
|
|
function hashDelete(key) {
|
|
var result2 = this.has(key) && delete this.__data__[key];
|
|
this.size -= result2 ? 1 : 0;
|
|
return result2;
|
|
}
|
|
function hashGet(key) {
|
|
var data = this.__data__;
|
|
if (nativeCreate) {
|
|
var result2 = data[key];
|
|
return result2 === HASH_UNDEFINED ? undefined2 : result2;
|
|
}
|
|
return hasOwnProperty.call(data, key) ? data[key] : undefined2;
|
|
}
|
|
function hashHas(key) {
|
|
var data = this.__data__;
|
|
return nativeCreate ? data[key] !== undefined2 : hasOwnProperty.call(data, key);
|
|
}
|
|
function hashSet(key, value) {
|
|
var data = this.__data__;
|
|
this.size += this.has(key) ? 0 : 1;
|
|
data[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value;
|
|
return this;
|
|
}
|
|
Hash.prototype.clear = hashClear;
|
|
Hash.prototype["delete"] = hashDelete;
|
|
Hash.prototype.get = hashGet;
|
|
Hash.prototype.has = hashHas;
|
|
Hash.prototype.set = hashSet;
|
|
function ListCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function listCacheClear() {
|
|
this.__data__ = [];
|
|
this.size = 0;
|
|
}
|
|
function listCacheDelete(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
return false;
|
|
}
|
|
var lastIndex = data.length - 1;
|
|
if (index == lastIndex) {
|
|
data.pop();
|
|
} else {
|
|
splice.call(data, index, 1);
|
|
}
|
|
--this.size;
|
|
return true;
|
|
}
|
|
function listCacheGet(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
return index < 0 ? undefined2 : data[index][1];
|
|
}
|
|
function listCacheHas(key) {
|
|
return assocIndexOf(this.__data__, key) > -1;
|
|
}
|
|
function listCacheSet(key, value) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
++this.size;
|
|
data.push([key, value]);
|
|
} else {
|
|
data[index][1] = value;
|
|
}
|
|
return this;
|
|
}
|
|
ListCache.prototype.clear = listCacheClear;
|
|
ListCache.prototype["delete"] = listCacheDelete;
|
|
ListCache.prototype.get = listCacheGet;
|
|
ListCache.prototype.has = listCacheHas;
|
|
ListCache.prototype.set = listCacheSet;
|
|
function MapCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function mapCacheClear() {
|
|
this.size = 0;
|
|
this.__data__ = {
|
|
"hash": new Hash(),
|
|
"map": new (Map2 || ListCache)(),
|
|
"string": new Hash()
|
|
};
|
|
}
|
|
function mapCacheDelete(key) {
|
|
var result2 = getMapData(this, key)["delete"](key);
|
|
this.size -= result2 ? 1 : 0;
|
|
return result2;
|
|
}
|
|
function mapCacheGet(key) {
|
|
return getMapData(this, key).get(key);
|
|
}
|
|
function mapCacheHas(key) {
|
|
return getMapData(this, key).has(key);
|
|
}
|
|
function mapCacheSet(key, value) {
|
|
var data = getMapData(this, key), size2 = data.size;
|
|
data.set(key, value);
|
|
this.size += data.size == size2 ? 0 : 1;
|
|
return this;
|
|
}
|
|
MapCache.prototype.clear = mapCacheClear;
|
|
MapCache.prototype["delete"] = mapCacheDelete;
|
|
MapCache.prototype.get = mapCacheGet;
|
|
MapCache.prototype.has = mapCacheHas;
|
|
MapCache.prototype.set = mapCacheSet;
|
|
function SetCache(values3) {
|
|
var index = -1, length = values3 == null ? 0 : values3.length;
|
|
this.__data__ = new MapCache();
|
|
while (++index < length) {
|
|
this.add(values3[index]);
|
|
}
|
|
}
|
|
function setCacheAdd(value) {
|
|
this.__data__.set(value, HASH_UNDEFINED);
|
|
return this;
|
|
}
|
|
function setCacheHas(value) {
|
|
return this.__data__.has(value);
|
|
}
|
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
SetCache.prototype.has = setCacheHas;
|
|
function Stack3(entries) {
|
|
var data = this.__data__ = new ListCache(entries);
|
|
this.size = data.size;
|
|
}
|
|
function stackClear() {
|
|
this.__data__ = new ListCache();
|
|
this.size = 0;
|
|
}
|
|
function stackDelete(key) {
|
|
var data = this.__data__, result2 = data["delete"](key);
|
|
this.size = data.size;
|
|
return result2;
|
|
}
|
|
function stackGet(key) {
|
|
return this.__data__.get(key);
|
|
}
|
|
function stackHas(key) {
|
|
return this.__data__.has(key);
|
|
}
|
|
function stackSet(key, value) {
|
|
var data = this.__data__;
|
|
if (data instanceof ListCache) {
|
|
var pairs = data.__data__;
|
|
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
pairs.push([key, value]);
|
|
this.size = ++data.size;
|
|
return this;
|
|
}
|
|
data = this.__data__ = new MapCache(pairs);
|
|
}
|
|
data.set(key, value);
|
|
this.size = data.size;
|
|
return this;
|
|
}
|
|
Stack3.prototype.clear = stackClear;
|
|
Stack3.prototype["delete"] = stackDelete;
|
|
Stack3.prototype.get = stackGet;
|
|
Stack3.prototype.has = stackHas;
|
|
Stack3.prototype.set = stackSet;
|
|
function arrayLikeKeys(value, inherited) {
|
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
|
|
for (var key in value) {
|
|
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function arraySample(array) {
|
|
var length = array.length;
|
|
return length ? array[baseRandom(0, length - 1)] : undefined2;
|
|
}
|
|
function arraySampleSize(array, n2) {
|
|
return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length));
|
|
}
|
|
function arrayShuffle(array) {
|
|
return shuffleSelf(copyArray(array));
|
|
}
|
|
function assignMergeValue(object, key, value) {
|
|
if (value !== undefined2 && !eq(object[key], value) || value === undefined2 && !(key in object)) {
|
|
baseAssignValue(object, key, value);
|
|
}
|
|
}
|
|
function assignValue(object, key, value) {
|
|
var objValue = object[key];
|
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined2 && !(key in object)) {
|
|
baseAssignValue(object, key, value);
|
|
}
|
|
}
|
|
function assocIndexOf(array, key) {
|
|
var length = array.length;
|
|
while (length--) {
|
|
if (eq(array[length][0], key)) {
|
|
return length;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseAggregator(collection, setter, iteratee2, accumulator) {
|
|
baseEach(collection, function(value, key, collection2) {
|
|
setter(accumulator, value, iteratee2(value), collection2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseAssign(object, source) {
|
|
return object && copyObject(source, keys(source), object);
|
|
}
|
|
function baseAssignIn(object, source) {
|
|
return object && copyObject(source, keysIn(source), object);
|
|
}
|
|
function baseAssignValue(object, key, value) {
|
|
if (key == "__proto__" && defineProperty) {
|
|
defineProperty(object, key, {
|
|
"configurable": true,
|
|
"enumerable": true,
|
|
"value": value,
|
|
"writable": true
|
|
});
|
|
} else {
|
|
object[key] = value;
|
|
}
|
|
}
|
|
function baseAt(object, paths) {
|
|
var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
while (++index < length) {
|
|
result2[index] = skip ? undefined2 : get(object, paths[index]);
|
|
}
|
|
return result2;
|
|
}
|
|
function baseClamp(number, lower, upper) {
|
|
if (number === number) {
|
|
if (upper !== undefined2) {
|
|
number = number <= upper ? number : upper;
|
|
}
|
|
if (lower !== undefined2) {
|
|
number = number >= lower ? number : lower;
|
|
}
|
|
}
|
|
return number;
|
|
}
|
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
|
if (customizer) {
|
|
result2 = object ? customizer(value, key, object, stack) : customizer(value);
|
|
}
|
|
if (result2 !== undefined2) {
|
|
return result2;
|
|
}
|
|
if (!isObject(value)) {
|
|
return value;
|
|
}
|
|
var isArr = isArray(value);
|
|
if (isArr) {
|
|
result2 = initCloneArray(value);
|
|
if (!isDeep) {
|
|
return copyArray(value, result2);
|
|
}
|
|
} else {
|
|
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
if (isBuffer(value)) {
|
|
return cloneBuffer(value, isDeep);
|
|
}
|
|
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
result2 = isFlat || isFunc ? {} : initCloneObject(value);
|
|
if (!isDeep) {
|
|
return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
|
|
}
|
|
} else {
|
|
if (!cloneableTags[tag]) {
|
|
return object ? value : {};
|
|
}
|
|
result2 = initCloneByTag(value, tag, isDeep);
|
|
}
|
|
}
|
|
stack || (stack = new Stack3());
|
|
var stacked = stack.get(value);
|
|
if (stacked) {
|
|
return stacked;
|
|
}
|
|
stack.set(value, result2);
|
|
if (isSet(value)) {
|
|
value.forEach(function(subValue) {
|
|
result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
|
});
|
|
} else if (isMap(value)) {
|
|
value.forEach(function(subValue, key2) {
|
|
result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
}
|
|
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
var props = isArr ? undefined2 : keysFunc(value);
|
|
arrayEach(props || value, function(subValue, key2) {
|
|
if (props) {
|
|
key2 = subValue;
|
|
subValue = value[key2];
|
|
}
|
|
assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
return result2;
|
|
}
|
|
function baseConforms(source) {
|
|
var props = keys(source);
|
|
return function(object) {
|
|
return baseConformsTo(object, source, props);
|
|
};
|
|
}
|
|
function baseConformsTo(object, source, props) {
|
|
var length = props.length;
|
|
if (object == null) {
|
|
return !length;
|
|
}
|
|
object = Object2(object);
|
|
while (length--) {
|
|
var key = props[length], predicate = source[key], value = object[key];
|
|
if (value === undefined2 && !(key in object) || !predicate(value)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function baseDelay(func, wait, args) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return setTimeout2(function() {
|
|
func.apply(undefined2, args);
|
|
}, wait);
|
|
}
|
|
function baseDifference(array, values3, iteratee2, comparator) {
|
|
var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values3.length;
|
|
if (!length) {
|
|
return result2;
|
|
}
|
|
if (iteratee2) {
|
|
values3 = arrayMap(values3, baseUnary(iteratee2));
|
|
}
|
|
if (comparator) {
|
|
includes2 = arrayIncludesWith;
|
|
isCommon = false;
|
|
} else if (values3.length >= LARGE_ARRAY_SIZE) {
|
|
includes2 = cacheHas;
|
|
isCommon = false;
|
|
values3 = new SetCache(values3);
|
|
}
|
|
outer:
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (isCommon && computed === computed) {
|
|
var valuesIndex = valuesLength;
|
|
while (valuesIndex--) {
|
|
if (values3[valuesIndex] === computed) {
|
|
continue outer;
|
|
}
|
|
}
|
|
result2.push(value);
|
|
} else if (!includes2(values3, computed, comparator)) {
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var baseEach = createBaseEach(baseForOwn);
|
|
var baseEachRight = createBaseEach(baseForOwnRight, true);
|
|
function baseEvery(collection, predicate) {
|
|
var result2 = true;
|
|
baseEach(collection, function(value, index, collection2) {
|
|
result2 = !!predicate(value, index, collection2);
|
|
return result2;
|
|
});
|
|
return result2;
|
|
}
|
|
function baseExtremum(array, iteratee2, comparator) {
|
|
var index = -1, length = array.length;
|
|
while (++index < length) {
|
|
var value = array[index], current = iteratee2(value);
|
|
if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) {
|
|
var computed = current, result2 = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseFill(array, value, start, end) {
|
|
var length = array.length;
|
|
start = toInteger(start);
|
|
if (start < 0) {
|
|
start = -start > length ? 0 : length + start;
|
|
}
|
|
end = end === undefined2 || end > length ? length : toInteger(end);
|
|
if (end < 0) {
|
|
end += length;
|
|
}
|
|
end = start > end ? 0 : toLength(end);
|
|
while (start < end) {
|
|
array[start++] = value;
|
|
}
|
|
return array;
|
|
}
|
|
function baseFilter(collection, predicate) {
|
|
var result2 = [];
|
|
baseEach(collection, function(value, index, collection2) {
|
|
if (predicate(value, index, collection2)) {
|
|
result2.push(value);
|
|
}
|
|
});
|
|
return result2;
|
|
}
|
|
function baseFlatten(array, depth, predicate, isStrict, result2) {
|
|
var index = -1, length = array.length;
|
|
predicate || (predicate = isFlattenable);
|
|
result2 || (result2 = []);
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (depth > 0 && predicate(value)) {
|
|
if (depth > 1) {
|
|
baseFlatten(value, depth - 1, predicate, isStrict, result2);
|
|
} else {
|
|
arrayPush(result2, value);
|
|
}
|
|
} else if (!isStrict) {
|
|
result2[result2.length] = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var baseFor = createBaseFor();
|
|
var baseForRight = createBaseFor(true);
|
|
function baseForOwn(object, iteratee2) {
|
|
return object && baseFor(object, iteratee2, keys);
|
|
}
|
|
function baseForOwnRight(object, iteratee2) {
|
|
return object && baseForRight(object, iteratee2, keys);
|
|
}
|
|
function baseFunctions(object, props) {
|
|
return arrayFilter(props, function(key) {
|
|
return isFunction(object[key]);
|
|
});
|
|
}
|
|
function baseGet(object, path) {
|
|
path = castPath(path, object);
|
|
var index = 0, length = path.length;
|
|
while (object != null && index < length) {
|
|
object = object[toKey(path[index++])];
|
|
}
|
|
return index && index == length ? object : undefined2;
|
|
}
|
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
var result2 = keysFunc(object);
|
|
return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
|
|
}
|
|
function baseGetTag(value) {
|
|
if (value == null) {
|
|
return value === undefined2 ? undefinedTag : nullTag;
|
|
}
|
|
return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
|
|
}
|
|
function baseGt(value, other) {
|
|
return value > other;
|
|
}
|
|
function baseHas(object, key) {
|
|
return object != null && hasOwnProperty.call(object, key);
|
|
}
|
|
function baseHasIn(object, key) {
|
|
return object != null && key in Object2(object);
|
|
}
|
|
function baseInRange(number, start, end) {
|
|
return number >= nativeMin(start, end) && number < nativeMax(start, end);
|
|
}
|
|
function baseIntersection(arrays, iteratee2, comparator) {
|
|
var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
|
|
while (othIndex--) {
|
|
var array = arrays[othIndex];
|
|
if (othIndex && iteratee2) {
|
|
array = arrayMap(array, baseUnary(iteratee2));
|
|
}
|
|
maxLength = nativeMin(array.length, maxLength);
|
|
caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2;
|
|
}
|
|
array = arrays[0];
|
|
var index = -1, seen = caches[0];
|
|
outer:
|
|
while (++index < length && result2.length < maxLength) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
|
|
othIndex = othLength;
|
|
while (--othIndex) {
|
|
var cache = caches[othIndex];
|
|
if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
|
|
continue outer;
|
|
}
|
|
}
|
|
if (seen) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseInverter(object, setter, iteratee2, accumulator) {
|
|
baseForOwn(object, function(value, key, object2) {
|
|
setter(accumulator, iteratee2(value), key, object2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseInvoke(object, path, args) {
|
|
path = castPath(path, object);
|
|
object = parent(object, path);
|
|
var func = object == null ? object : object[toKey(last(path))];
|
|
return func == null ? undefined2 : apply(func, object, args);
|
|
}
|
|
function baseIsArguments(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
}
|
|
function baseIsArrayBuffer(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
|
|
}
|
|
function baseIsDate(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == dateTag;
|
|
}
|
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
if (value === other) {
|
|
return true;
|
|
}
|
|
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
return value !== value && other !== other;
|
|
}
|
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
}
|
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
if (isSameTag && isBuffer(object)) {
|
|
if (!isBuffer(other)) {
|
|
return false;
|
|
}
|
|
objIsArr = true;
|
|
objIsObj = false;
|
|
}
|
|
if (isSameTag && !objIsObj) {
|
|
stack || (stack = new Stack3());
|
|
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
if (objIsWrapped || othIsWrapped) {
|
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
stack || (stack = new Stack3());
|
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
}
|
|
}
|
|
if (!isSameTag) {
|
|
return false;
|
|
}
|
|
stack || (stack = new Stack3());
|
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
function baseIsMap(value) {
|
|
return isObjectLike(value) && getTag(value) == mapTag;
|
|
}
|
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
if (object == null) {
|
|
return !length;
|
|
}
|
|
object = Object2(object);
|
|
while (index--) {
|
|
var data = matchData[index];
|
|
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
return false;
|
|
}
|
|
}
|
|
while (++index < length) {
|
|
data = matchData[index];
|
|
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
if (noCustomizer && data[2]) {
|
|
if (objValue === undefined2 && !(key in object)) {
|
|
return false;
|
|
}
|
|
} else {
|
|
var stack = new Stack3();
|
|
if (customizer) {
|
|
var result2 = customizer(objValue, srcValue, key, object, source, stack);
|
|
}
|
|
if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function baseIsNative(value) {
|
|
if (!isObject(value) || isMasked(value)) {
|
|
return false;
|
|
}
|
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
return pattern.test(toSource(value));
|
|
}
|
|
function baseIsRegExp(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == regexpTag;
|
|
}
|
|
function baseIsSet(value) {
|
|
return isObjectLike(value) && getTag(value) == setTag;
|
|
}
|
|
function baseIsTypedArray(value) {
|
|
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
}
|
|
function baseIteratee(value) {
|
|
if (typeof value == "function") {
|
|
return value;
|
|
}
|
|
if (value == null) {
|
|
return identity;
|
|
}
|
|
if (typeof value == "object") {
|
|
return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
}
|
|
return property(value);
|
|
}
|
|
function baseKeys(object) {
|
|
if (!isPrototype(object)) {
|
|
return nativeKeys(object);
|
|
}
|
|
var result2 = [];
|
|
for (var key in Object2(object)) {
|
|
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseKeysIn(object) {
|
|
if (!isObject(object)) {
|
|
return nativeKeysIn(object);
|
|
}
|
|
var isProto = isPrototype(object), result2 = [];
|
|
for (var key in object) {
|
|
if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseLt(value, other) {
|
|
return value < other;
|
|
}
|
|
function baseMap(collection, iteratee2) {
|
|
var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
baseEach(collection, function(value, key, collection2) {
|
|
result2[++index] = iteratee2(value, key, collection2);
|
|
});
|
|
return result2;
|
|
}
|
|
function baseMatches(source) {
|
|
var matchData = getMatchData(source);
|
|
if (matchData.length == 1 && matchData[0][2]) {
|
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
}
|
|
return function(object) {
|
|
return object === source || baseIsMatch(object, source, matchData);
|
|
};
|
|
}
|
|
function baseMatchesProperty(path, srcValue) {
|
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
}
|
|
return function(object) {
|
|
var objValue = get(object, path);
|
|
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
};
|
|
}
|
|
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
if (object === source) {
|
|
return;
|
|
}
|
|
baseFor(source, function(srcValue, key) {
|
|
stack || (stack = new Stack3());
|
|
if (isObject(srcValue)) {
|
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
} else {
|
|
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = srcValue;
|
|
}
|
|
assignMergeValue(object, key, newValue);
|
|
}
|
|
}, keysIn);
|
|
}
|
|
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
|
|
if (stacked) {
|
|
assignMergeValue(object, key, stacked);
|
|
return;
|
|
}
|
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2;
|
|
var isCommon = newValue === undefined2;
|
|
if (isCommon) {
|
|
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
newValue = srcValue;
|
|
if (isArr || isBuff || isTyped) {
|
|
if (isArray(objValue)) {
|
|
newValue = objValue;
|
|
} else if (isArrayLikeObject(objValue)) {
|
|
newValue = copyArray(objValue);
|
|
} else if (isBuff) {
|
|
isCommon = false;
|
|
newValue = cloneBuffer(srcValue, true);
|
|
} else if (isTyped) {
|
|
isCommon = false;
|
|
newValue = cloneTypedArray(srcValue, true);
|
|
} else {
|
|
newValue = [];
|
|
}
|
|
} else if (isPlainObject5(srcValue) || isArguments(srcValue)) {
|
|
newValue = objValue;
|
|
if (isArguments(objValue)) {
|
|
newValue = toPlainObject(objValue);
|
|
} else if (!isObject(objValue) || isFunction(objValue)) {
|
|
newValue = initCloneObject(srcValue);
|
|
}
|
|
} else {
|
|
isCommon = false;
|
|
}
|
|
}
|
|
if (isCommon) {
|
|
stack.set(srcValue, newValue);
|
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
stack["delete"](srcValue);
|
|
}
|
|
assignMergeValue(object, key, newValue);
|
|
}
|
|
function baseNth(array, n2) {
|
|
var length = array.length;
|
|
if (!length) {
|
|
return;
|
|
}
|
|
n2 += n2 < 0 ? length : 0;
|
|
return isIndex(n2, length) ? array[n2] : undefined2;
|
|
}
|
|
function baseOrderBy(collection, iteratees, orders) {
|
|
if (iteratees.length) {
|
|
iteratees = arrayMap(iteratees, function(iteratee2) {
|
|
if (isArray(iteratee2)) {
|
|
return function(value) {
|
|
return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
|
|
};
|
|
}
|
|
return iteratee2;
|
|
});
|
|
} else {
|
|
iteratees = [identity];
|
|
}
|
|
var index = -1;
|
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
|
var result2 = baseMap(collection, function(value, key, collection2) {
|
|
var criteria = arrayMap(iteratees, function(iteratee2) {
|
|
return iteratee2(value);
|
|
});
|
|
return { "criteria": criteria, "index": ++index, "value": value };
|
|
});
|
|
return baseSortBy(result2, function(object, other) {
|
|
return compareMultiple(object, other, orders);
|
|
});
|
|
}
|
|
function basePick(object, paths) {
|
|
return basePickBy(object, paths, function(value, path) {
|
|
return hasIn(object, path);
|
|
});
|
|
}
|
|
function basePickBy(object, paths, predicate) {
|
|
var index = -1, length = paths.length, result2 = {};
|
|
while (++index < length) {
|
|
var path = paths[index], value = baseGet(object, path);
|
|
if (predicate(value, path)) {
|
|
baseSet(result2, castPath(path, object), value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function basePropertyDeep(path) {
|
|
return function(object) {
|
|
return baseGet(object, path);
|
|
};
|
|
}
|
|
function basePullAll(array, values3, iteratee2, comparator) {
|
|
var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values3.length, seen = array;
|
|
if (array === values3) {
|
|
values3 = copyArray(values3);
|
|
}
|
|
if (iteratee2) {
|
|
seen = arrayMap(array, baseUnary(iteratee2));
|
|
}
|
|
while (++index < length) {
|
|
var fromIndex = 0, value = values3[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
|
|
if (seen !== array) {
|
|
splice.call(seen, fromIndex, 1);
|
|
}
|
|
splice.call(array, fromIndex, 1);
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function basePullAt(array, indexes) {
|
|
var length = array ? indexes.length : 0, lastIndex = length - 1;
|
|
while (length--) {
|
|
var index = indexes[length];
|
|
if (length == lastIndex || index !== previous) {
|
|
var previous = index;
|
|
if (isIndex(index)) {
|
|
splice.call(array, index, 1);
|
|
} else {
|
|
baseUnset(array, index);
|
|
}
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function baseRandom(lower, upper) {
|
|
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
|
}
|
|
function baseRange(start, end, step, fromRight) {
|
|
var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
|
|
while (length--) {
|
|
result2[fromRight ? length : ++index] = start;
|
|
start += step;
|
|
}
|
|
return result2;
|
|
}
|
|
function baseRepeat(string, n2) {
|
|
var result2 = "";
|
|
if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) {
|
|
return result2;
|
|
}
|
|
do {
|
|
if (n2 % 2) {
|
|
result2 += string;
|
|
}
|
|
n2 = nativeFloor(n2 / 2);
|
|
if (n2) {
|
|
string += string;
|
|
}
|
|
} while (n2);
|
|
return result2;
|
|
}
|
|
function baseRest(func, start) {
|
|
return setToString(overRest(func, start, identity), func + "");
|
|
}
|
|
function baseSample(collection) {
|
|
return arraySample(values2(collection));
|
|
}
|
|
function baseSampleSize(collection, n2) {
|
|
var array = values2(collection);
|
|
return shuffleSelf(array, baseClamp(n2, 0, array.length));
|
|
}
|
|
function baseSet(object, path, value, customizer) {
|
|
if (!isObject(object)) {
|
|
return object;
|
|
}
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
while (nested != null && ++index < length) {
|
|
var key = toKey(path[index]), newValue = value;
|
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
return object;
|
|
}
|
|
if (index != lastIndex) {
|
|
var objValue = nested[key];
|
|
newValue = customizer ? customizer(objValue, key, nested) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
}
|
|
}
|
|
assignValue(nested, key, newValue);
|
|
nested = nested[key];
|
|
}
|
|
return object;
|
|
}
|
|
var baseSetData = !metaMap ? identity : function(func, data) {
|
|
metaMap.set(func, data);
|
|
return func;
|
|
};
|
|
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
return defineProperty(func, "toString", {
|
|
"configurable": true,
|
|
"enumerable": false,
|
|
"value": constant(string),
|
|
"writable": true
|
|
});
|
|
};
|
|
function baseShuffle(collection) {
|
|
return shuffleSelf(values2(collection));
|
|
}
|
|
function baseSlice(array, start, end) {
|
|
var index = -1, length = array.length;
|
|
if (start < 0) {
|
|
start = -start > length ? 0 : length + start;
|
|
}
|
|
end = end > length ? length : end;
|
|
if (end < 0) {
|
|
end += length;
|
|
}
|
|
length = start > end ? 0 : end - start >>> 0;
|
|
start >>>= 0;
|
|
var result2 = Array2(length);
|
|
while (++index < length) {
|
|
result2[index] = array[index + start];
|
|
}
|
|
return result2;
|
|
}
|
|
function baseSome(collection, predicate) {
|
|
var result2;
|
|
baseEach(collection, function(value, index, collection2) {
|
|
result2 = predicate(value, index, collection2);
|
|
return !result2;
|
|
});
|
|
return !!result2;
|
|
}
|
|
function baseSortedIndex(array, value, retHighest) {
|
|
var low = 0, high = array == null ? low : array.length;
|
|
if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
|
while (low < high) {
|
|
var mid = low + high >>> 1, computed = array[mid];
|
|
if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
|
|
low = mid + 1;
|
|
} else {
|
|
high = mid;
|
|
}
|
|
}
|
|
return high;
|
|
}
|
|
return baseSortedIndexBy(array, value, identity, retHighest);
|
|
}
|
|
function baseSortedIndexBy(array, value, iteratee2, retHighest) {
|
|
var low = 0, high = array == null ? 0 : array.length;
|
|
if (high === 0) {
|
|
return 0;
|
|
}
|
|
value = iteratee2(value);
|
|
var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2;
|
|
while (low < high) {
|
|
var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
|
|
if (valIsNaN) {
|
|
var setLow = retHighest || othIsReflexive;
|
|
} else if (valIsUndefined) {
|
|
setLow = othIsReflexive && (retHighest || othIsDefined);
|
|
} else if (valIsNull) {
|
|
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
|
} else if (valIsSymbol) {
|
|
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
|
} else if (othIsNull || othIsSymbol) {
|
|
setLow = false;
|
|
} else {
|
|
setLow = retHighest ? computed <= value : computed < value;
|
|
}
|
|
if (setLow) {
|
|
low = mid + 1;
|
|
} else {
|
|
high = mid;
|
|
}
|
|
}
|
|
return nativeMin(high, MAX_ARRAY_INDEX);
|
|
}
|
|
function baseSortedUniq(array, iteratee2) {
|
|
var index = -1, length = array.length, resIndex = 0, result2 = [];
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
if (!index || !eq(computed, seen)) {
|
|
var seen = computed;
|
|
result2[resIndex++] = value === 0 ? 0 : value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseToNumber(value) {
|
|
if (typeof value == "number") {
|
|
return value;
|
|
}
|
|
if (isSymbol(value)) {
|
|
return NAN;
|
|
}
|
|
return +value;
|
|
}
|
|
function baseToString(value) {
|
|
if (typeof value == "string") {
|
|
return value;
|
|
}
|
|
if (isArray(value)) {
|
|
return arrayMap(value, baseToString) + "";
|
|
}
|
|
if (isSymbol(value)) {
|
|
return symbolToString ? symbolToString.call(value) : "";
|
|
}
|
|
var result2 = value + "";
|
|
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
}
|
|
function baseUniq(array, iteratee2, comparator) {
|
|
var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
if (comparator) {
|
|
isCommon = false;
|
|
includes2 = arrayIncludesWith;
|
|
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
var set2 = iteratee2 ? null : createSet(array);
|
|
if (set2) {
|
|
return setToArray(set2);
|
|
}
|
|
isCommon = false;
|
|
includes2 = cacheHas;
|
|
seen = new SetCache();
|
|
} else {
|
|
seen = iteratee2 ? [] : result2;
|
|
}
|
|
outer:
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (isCommon && computed === computed) {
|
|
var seenIndex = seen.length;
|
|
while (seenIndex--) {
|
|
if (seen[seenIndex] === computed) {
|
|
continue outer;
|
|
}
|
|
}
|
|
if (iteratee2) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
} else if (!includes2(seen, computed, comparator)) {
|
|
if (seen !== result2) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseUnset(object, path) {
|
|
path = castPath(path, object);
|
|
object = parent(object, path);
|
|
return object == null || delete object[toKey(last(path))];
|
|
}
|
|
function baseUpdate(object, path, updater, customizer) {
|
|
return baseSet(object, path, updater(baseGet(object, path)), customizer);
|
|
}
|
|
function baseWhile(array, predicate, isDrop, fromRight) {
|
|
var length = array.length, index = fromRight ? length : -1;
|
|
while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
|
|
}
|
|
return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
|
|
}
|
|
function baseWrapperValue(value, actions) {
|
|
var result2 = value;
|
|
if (result2 instanceof LazyWrapper) {
|
|
result2 = result2.value();
|
|
}
|
|
return arrayReduce(actions, function(result3, action) {
|
|
return action.func.apply(action.thisArg, arrayPush([result3], action.args));
|
|
}, result2);
|
|
}
|
|
function baseXor(arrays, iteratee2, comparator) {
|
|
var length = arrays.length;
|
|
if (length < 2) {
|
|
return length ? baseUniq(arrays[0]) : [];
|
|
}
|
|
var index = -1, result2 = Array2(length);
|
|
while (++index < length) {
|
|
var array = arrays[index], othIndex = -1;
|
|
while (++othIndex < length) {
|
|
if (othIndex != index) {
|
|
result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
|
|
}
|
|
}
|
|
}
|
|
return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
|
|
}
|
|
function baseZipObject(props, values3, assignFunc) {
|
|
var index = -1, length = props.length, valsLength = values3.length, result2 = {};
|
|
while (++index < length) {
|
|
var value = index < valsLength ? values3[index] : undefined2;
|
|
assignFunc(result2, props[index], value);
|
|
}
|
|
return result2;
|
|
}
|
|
function castArrayLikeObject(value) {
|
|
return isArrayLikeObject(value) ? value : [];
|
|
}
|
|
function castFunction(value) {
|
|
return typeof value == "function" ? value : identity;
|
|
}
|
|
function castPath(value, object) {
|
|
if (isArray(value)) {
|
|
return value;
|
|
}
|
|
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
}
|
|
var castRest = baseRest;
|
|
function castSlice(array, start, end) {
|
|
var length = array.length;
|
|
end = end === undefined2 ? length : end;
|
|
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
}
|
|
var clearTimeout2 = ctxClearTimeout || function(id) {
|
|
return root.clearTimeout(id);
|
|
};
|
|
function cloneBuffer(buffer, isDeep) {
|
|
if (isDeep) {
|
|
return buffer.slice();
|
|
}
|
|
var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
buffer.copy(result2);
|
|
return result2;
|
|
}
|
|
function cloneArrayBuffer(arrayBuffer) {
|
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
|
|
return result2;
|
|
}
|
|
function cloneDataView(dataView, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
}
|
|
function cloneRegExp(regexp) {
|
|
var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
result2.lastIndex = regexp.lastIndex;
|
|
return result2;
|
|
}
|
|
function cloneSymbol(symbol) {
|
|
return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
|
|
}
|
|
function cloneTypedArray(typedArray, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
}
|
|
function compareAscending(value, other) {
|
|
if (value !== other) {
|
|
var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
|
|
var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
|
|
if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
|
|
return 1;
|
|
}
|
|
if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
|
|
return -1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
function compareMultiple(object, other, orders) {
|
|
var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
|
|
while (++index < length) {
|
|
var result2 = compareAscending(objCriteria[index], othCriteria[index]);
|
|
if (result2) {
|
|
if (index >= ordersLength) {
|
|
return result2;
|
|
}
|
|
var order2 = orders[index];
|
|
return result2 * (order2 == "desc" ? -1 : 1);
|
|
}
|
|
}
|
|
return object.index - other.index;
|
|
}
|
|
function composeArgs(args, partials, holders, isCurried) {
|
|
var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
|
|
while (++leftIndex < leftLength) {
|
|
result2[leftIndex] = partials[leftIndex];
|
|
}
|
|
while (++argsIndex < holdersLength) {
|
|
if (isUncurried || argsIndex < argsLength) {
|
|
result2[holders[argsIndex]] = args[argsIndex];
|
|
}
|
|
}
|
|
while (rangeLength--) {
|
|
result2[leftIndex++] = args[argsIndex++];
|
|
}
|
|
return result2;
|
|
}
|
|
function composeArgsRight(args, partials, holders, isCurried) {
|
|
var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
|
|
while (++argsIndex < rangeLength) {
|
|
result2[argsIndex] = args[argsIndex];
|
|
}
|
|
var offset = argsIndex;
|
|
while (++rightIndex < rightLength) {
|
|
result2[offset + rightIndex] = partials[rightIndex];
|
|
}
|
|
while (++holdersIndex < holdersLength) {
|
|
if (isUncurried || argsIndex < argsLength) {
|
|
result2[offset + holders[holdersIndex]] = args[argsIndex++];
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function copyArray(source, array) {
|
|
var index = -1, length = source.length;
|
|
array || (array = Array2(length));
|
|
while (++index < length) {
|
|
array[index] = source[index];
|
|
}
|
|
return array;
|
|
}
|
|
function copyObject(source, props, object, customizer) {
|
|
var isNew = !object;
|
|
object || (object = {});
|
|
var index = -1, length = props.length;
|
|
while (++index < length) {
|
|
var key = props[index];
|
|
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = source[key];
|
|
}
|
|
if (isNew) {
|
|
baseAssignValue(object, key, newValue);
|
|
} else {
|
|
assignValue(object, key, newValue);
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
function copySymbols(source, object) {
|
|
return copyObject(source, getSymbols(source), object);
|
|
}
|
|
function copySymbolsIn(source, object) {
|
|
return copyObject(source, getSymbolsIn(source), object);
|
|
}
|
|
function createAggregator(setter, initializer) {
|
|
return function(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
|
|
return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
|
|
};
|
|
}
|
|
function createAssigner(assigner) {
|
|
return baseRest(function(object, sources) {
|
|
var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2;
|
|
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2;
|
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
customizer = length < 3 ? undefined2 : customizer;
|
|
length = 1;
|
|
}
|
|
object = Object2(object);
|
|
while (++index < length) {
|
|
var source = sources[index];
|
|
if (source) {
|
|
assigner(object, source, index, customizer);
|
|
}
|
|
}
|
|
return object;
|
|
});
|
|
}
|
|
function createBaseEach(eachFunc, fromRight) {
|
|
return function(collection, iteratee2) {
|
|
if (collection == null) {
|
|
return collection;
|
|
}
|
|
if (!isArrayLike(collection)) {
|
|
return eachFunc(collection, iteratee2);
|
|
}
|
|
var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
|
|
while (fromRight ? index-- : ++index < length) {
|
|
if (iteratee2(iterable[index], index, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return collection;
|
|
};
|
|
}
|
|
function createBaseFor(fromRight) {
|
|
return function(object, iteratee2, keysFunc) {
|
|
var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
|
|
while (length--) {
|
|
var key = props[fromRight ? length : ++index];
|
|
if (iteratee2(iterable[key], key, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return object;
|
|
};
|
|
}
|
|
function createBind(func, bitmask, thisArg) {
|
|
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
return fn2.apply(isBind ? thisArg : this, arguments);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createCaseFirst(methodName) {
|
|
return function(string) {
|
|
string = toString(string);
|
|
var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2;
|
|
var chr = strSymbols ? strSymbols[0] : string.charAt(0);
|
|
var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
|
|
return chr[methodName]() + trailing;
|
|
};
|
|
}
|
|
function createCompounder(callback) {
|
|
return function(string) {
|
|
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
};
|
|
}
|
|
function createCtor(Ctor) {
|
|
return function() {
|
|
var args = arguments;
|
|
switch (args.length) {
|
|
case 0:
|
|
return new Ctor();
|
|
case 1:
|
|
return new Ctor(args[0]);
|
|
case 2:
|
|
return new Ctor(args[0], args[1]);
|
|
case 3:
|
|
return new Ctor(args[0], args[1], args[2]);
|
|
case 4:
|
|
return new Ctor(args[0], args[1], args[2], args[3]);
|
|
case 5:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4]);
|
|
case 6:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
case 7:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
}
|
|
var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
|
|
return isObject(result2) ? result2 : thisBinding;
|
|
};
|
|
}
|
|
function createCurry(func, bitmask, arity) {
|
|
var Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
|
|
while (index--) {
|
|
args[index] = arguments[index];
|
|
}
|
|
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
|
|
length -= holders.length;
|
|
if (length < arity) {
|
|
return createRecurry(
|
|
func,
|
|
bitmask,
|
|
createHybrid,
|
|
wrapper.placeholder,
|
|
undefined2,
|
|
args,
|
|
holders,
|
|
undefined2,
|
|
undefined2,
|
|
arity - length
|
|
);
|
|
}
|
|
var fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
return apply(fn2, this, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createFind(findIndexFunc) {
|
|
return function(collection, predicate, fromIndex) {
|
|
var iterable = Object2(collection);
|
|
if (!isArrayLike(collection)) {
|
|
var iteratee2 = getIteratee(predicate, 3);
|
|
collection = keys(collection);
|
|
predicate = function(key) {
|
|
return iteratee2(iterable[key], key, iterable);
|
|
};
|
|
}
|
|
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2;
|
|
};
|
|
}
|
|
function createFlow(fromRight) {
|
|
return flatRest(function(funcs) {
|
|
var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
|
|
if (fromRight) {
|
|
funcs.reverse();
|
|
}
|
|
while (index--) {
|
|
var func = funcs[index];
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
if (prereq && !wrapper && getFuncName(func) == "wrapper") {
|
|
var wrapper = new LodashWrapper([], true);
|
|
}
|
|
}
|
|
index = wrapper ? index : length;
|
|
while (++index < length) {
|
|
func = funcs[index];
|
|
var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2;
|
|
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
|
|
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
|
} else {
|
|
wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
|
|
}
|
|
}
|
|
return function() {
|
|
var args = arguments, value = args[0];
|
|
if (wrapper && args.length == 1 && isArray(value)) {
|
|
return wrapper.plant(value).value();
|
|
}
|
|
var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
|
|
while (++index2 < length) {
|
|
result2 = funcs[index2].call(this, result2);
|
|
}
|
|
return result2;
|
|
};
|
|
});
|
|
}
|
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
|
|
var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func);
|
|
function wrapper() {
|
|
var length = arguments.length, args = Array2(length), index = length;
|
|
while (index--) {
|
|
args[index] = arguments[index];
|
|
}
|
|
if (isCurried) {
|
|
var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
|
|
}
|
|
if (partials) {
|
|
args = composeArgs(args, partials, holders, isCurried);
|
|
}
|
|
if (partialsRight) {
|
|
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
|
}
|
|
length -= holdersCount;
|
|
if (isCurried && length < arity) {
|
|
var newHolders = replaceHolders(args, placeholder);
|
|
return createRecurry(
|
|
func,
|
|
bitmask,
|
|
createHybrid,
|
|
wrapper.placeholder,
|
|
thisArg,
|
|
args,
|
|
newHolders,
|
|
argPos,
|
|
ary2,
|
|
arity - length
|
|
);
|
|
}
|
|
var thisBinding = isBind ? thisArg : this, fn2 = isBindKey ? thisBinding[func] : func;
|
|
length = args.length;
|
|
if (argPos) {
|
|
args = reorder(args, argPos);
|
|
} else if (isFlip && length > 1) {
|
|
args.reverse();
|
|
}
|
|
if (isAry && ary2 < length) {
|
|
args.length = ary2;
|
|
}
|
|
if (this && this !== root && this instanceof wrapper) {
|
|
fn2 = Ctor || createCtor(fn2);
|
|
}
|
|
return fn2.apply(thisBinding, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createInverter(setter, toIteratee) {
|
|
return function(object, iteratee2) {
|
|
return baseInverter(object, setter, toIteratee(iteratee2), {});
|
|
};
|
|
}
|
|
function createMathOperation(operator, defaultValue) {
|
|
return function(value, other) {
|
|
var result2;
|
|
if (value === undefined2 && other === undefined2) {
|
|
return defaultValue;
|
|
}
|
|
if (value !== undefined2) {
|
|
result2 = value;
|
|
}
|
|
if (other !== undefined2) {
|
|
if (result2 === undefined2) {
|
|
return other;
|
|
}
|
|
if (typeof value == "string" || typeof other == "string") {
|
|
value = baseToString(value);
|
|
other = baseToString(other);
|
|
} else {
|
|
value = baseToNumber(value);
|
|
other = baseToNumber(other);
|
|
}
|
|
result2 = operator(value, other);
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
function createOver(arrayFunc) {
|
|
return flatRest(function(iteratees) {
|
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
|
return baseRest(function(args) {
|
|
var thisArg = this;
|
|
return arrayFunc(iteratees, function(iteratee2) {
|
|
return apply(iteratee2, thisArg, args);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function createPadding(length, chars) {
|
|
chars = chars === undefined2 ? " " : baseToString(chars);
|
|
var charsLength = chars.length;
|
|
if (charsLength < 2) {
|
|
return charsLength ? baseRepeat(chars, length) : chars;
|
|
}
|
|
var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
|
return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
|
|
}
|
|
function createPartial(func, bitmask, thisArg, partials) {
|
|
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn2 = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
while (++leftIndex < leftLength) {
|
|
args[leftIndex] = partials[leftIndex];
|
|
}
|
|
while (argsLength--) {
|
|
args[leftIndex++] = arguments[++argsIndex];
|
|
}
|
|
return apply(fn2, isBind ? thisArg : this, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createRange(fromRight) {
|
|
return function(start, end, step) {
|
|
if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
|
|
end = step = undefined2;
|
|
}
|
|
start = toFinite(start);
|
|
if (end === undefined2) {
|
|
end = start;
|
|
start = 0;
|
|
} else {
|
|
end = toFinite(end);
|
|
}
|
|
step = step === undefined2 ? start < end ? 1 : -1 : toFinite(step);
|
|
return baseRange(start, end, step, fromRight);
|
|
};
|
|
}
|
|
function createRelationalOperation(operator) {
|
|
return function(value, other) {
|
|
if (!(typeof value == "string" && typeof other == "string")) {
|
|
value = toNumber(value);
|
|
other = toNumber(other);
|
|
}
|
|
return operator(value, other);
|
|
};
|
|
}
|
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
|
|
var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials;
|
|
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
|
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
|
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
|
|
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
|
|
}
|
|
var newData = [
|
|
func,
|
|
bitmask,
|
|
thisArg,
|
|
newPartials,
|
|
newHolders,
|
|
newPartialsRight,
|
|
newHoldersRight,
|
|
argPos,
|
|
ary2,
|
|
arity
|
|
];
|
|
var result2 = wrapFunc.apply(undefined2, newData);
|
|
if (isLaziable(func)) {
|
|
setData(result2, newData);
|
|
}
|
|
result2.placeholder = placeholder;
|
|
return setWrapToString(result2, func, bitmask);
|
|
}
|
|
function createRound(methodName) {
|
|
var func = Math2[methodName];
|
|
return function(number, precision) {
|
|
number = toNumber(number);
|
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
if (precision && nativeIsFinite(number)) {
|
|
var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
|
|
pair = (toString(value) + "e").split("e");
|
|
return +(pair[0] + "e" + (+pair[1] - precision));
|
|
}
|
|
return func(number);
|
|
};
|
|
}
|
|
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values3) {
|
|
return new Set2(values3);
|
|
};
|
|
function createToPairs(keysFunc) {
|
|
return function(object) {
|
|
var tag = getTag(object);
|
|
if (tag == mapTag) {
|
|
return mapToArray(object);
|
|
}
|
|
if (tag == setTag) {
|
|
return setToPairs(object);
|
|
}
|
|
return baseToPairs(object, keysFunc(object));
|
|
};
|
|
}
|
|
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
|
|
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
|
|
if (!isBindKey && typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
var length = partials ? partials.length : 0;
|
|
if (!length) {
|
|
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
|
|
partials = holders = undefined2;
|
|
}
|
|
ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0);
|
|
arity = arity === undefined2 ? arity : toInteger(arity);
|
|
length -= holders ? holders.length : 0;
|
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
|
var partialsRight = partials, holdersRight = holders;
|
|
partials = holders = undefined2;
|
|
}
|
|
var data = isBindKey ? undefined2 : getData(func);
|
|
var newData = [
|
|
func,
|
|
bitmask,
|
|
thisArg,
|
|
partials,
|
|
holders,
|
|
partialsRight,
|
|
holdersRight,
|
|
argPos,
|
|
ary2,
|
|
arity
|
|
];
|
|
if (data) {
|
|
mergeData(newData, data);
|
|
}
|
|
func = newData[0];
|
|
bitmask = newData[1];
|
|
thisArg = newData[2];
|
|
partials = newData[3];
|
|
holders = newData[4];
|
|
arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
|
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
|
|
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
|
|
}
|
|
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
|
|
var result2 = createBind(func, bitmask, thisArg);
|
|
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
|
|
result2 = createCurry(func, bitmask, arity);
|
|
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
|
|
result2 = createPartial(func, bitmask, thisArg, partials);
|
|
} else {
|
|
result2 = createHybrid.apply(undefined2, newData);
|
|
}
|
|
var setter = data ? baseSetData : setData;
|
|
return setWrapToString(setter(result2, newData), func, bitmask);
|
|
}
|
|
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
|
if (objValue === undefined2 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
|
|
return srcValue;
|
|
}
|
|
return objValue;
|
|
}
|
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
if (isObject(objValue) && isObject(srcValue)) {
|
|
stack.set(srcValue, objValue);
|
|
baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
|
|
stack["delete"](srcValue);
|
|
}
|
|
return objValue;
|
|
}
|
|
function customOmitClone(value) {
|
|
return isPlainObject5(value) ? undefined2 : value;
|
|
}
|
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
return false;
|
|
}
|
|
var arrStacked = stack.get(array);
|
|
var othStacked = stack.get(other);
|
|
if (arrStacked && othStacked) {
|
|
return arrStacked == other && othStacked == array;
|
|
}
|
|
var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2;
|
|
stack.set(array, other);
|
|
stack.set(other, array);
|
|
while (++index < arrLength) {
|
|
var arrValue = array[index], othValue = other[index];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
}
|
|
if (compared !== undefined2) {
|
|
if (compared) {
|
|
continue;
|
|
}
|
|
result2 = false;
|
|
break;
|
|
}
|
|
if (seen) {
|
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
return seen.push(othIndex);
|
|
}
|
|
})) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
}
|
|
stack["delete"](array);
|
|
stack["delete"](other);
|
|
return result2;
|
|
}
|
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
switch (tag) {
|
|
case dataViewTag:
|
|
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
return false;
|
|
}
|
|
object = object.buffer;
|
|
other = other.buffer;
|
|
case arrayBufferTag:
|
|
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
return false;
|
|
}
|
|
return true;
|
|
case boolTag:
|
|
case dateTag:
|
|
case numberTag:
|
|
return eq(+object, +other);
|
|
case errorTag:
|
|
return object.name == other.name && object.message == other.message;
|
|
case regexpTag:
|
|
case stringTag:
|
|
return object == other + "";
|
|
case mapTag:
|
|
var convert = mapToArray;
|
|
case setTag:
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
convert || (convert = setToArray);
|
|
if (object.size != other.size && !isPartial) {
|
|
return false;
|
|
}
|
|
var stacked = stack.get(object);
|
|
if (stacked) {
|
|
return stacked == other;
|
|
}
|
|
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
stack.set(object, other);
|
|
var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
stack["delete"](object);
|
|
return result2;
|
|
case symbolTag:
|
|
if (symbolValueOf) {
|
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
if (objLength != othLength && !isPartial) {
|
|
return false;
|
|
}
|
|
var index = objLength;
|
|
while (index--) {
|
|
var key = objProps[index];
|
|
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
return false;
|
|
}
|
|
}
|
|
var objStacked = stack.get(object);
|
|
var othStacked = stack.get(other);
|
|
if (objStacked && othStacked) {
|
|
return objStacked == other && othStacked == object;
|
|
}
|
|
var result2 = true;
|
|
stack.set(object, other);
|
|
stack.set(other, object);
|
|
var skipCtor = isPartial;
|
|
while (++index < objLength) {
|
|
key = objProps[index];
|
|
var objValue = object[key], othValue = other[key];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
}
|
|
if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
skipCtor || (skipCtor = key == "constructor");
|
|
}
|
|
if (result2 && !skipCtor) {
|
|
var objCtor = object.constructor, othCtor = other.constructor;
|
|
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
result2 = false;
|
|
}
|
|
}
|
|
stack["delete"](object);
|
|
stack["delete"](other);
|
|
return result2;
|
|
}
|
|
function flatRest(func) {
|
|
return setToString(overRest(func, undefined2, flatten), func + "");
|
|
}
|
|
function getAllKeys(object) {
|
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
}
|
|
function getAllKeysIn(object) {
|
|
return baseGetAllKeys(object, keysIn, getSymbolsIn);
|
|
}
|
|
var getData = !metaMap ? noop : function(func) {
|
|
return metaMap.get(func);
|
|
};
|
|
function getFuncName(func) {
|
|
var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
|
|
while (length--) {
|
|
var data = array[length], otherFunc = data.func;
|
|
if (otherFunc == null || otherFunc == func) {
|
|
return data.name;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function getHolder(func) {
|
|
var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func;
|
|
return object.placeholder;
|
|
}
|
|
function getIteratee() {
|
|
var result2 = lodash.iteratee || iteratee;
|
|
result2 = result2 === iteratee ? baseIteratee : result2;
|
|
return arguments.length ? result2(arguments[0], arguments[1]) : result2;
|
|
}
|
|
function getMapData(map2, key) {
|
|
var data = map2.__data__;
|
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
}
|
|
function getMatchData(object) {
|
|
var result2 = keys(object), length = result2.length;
|
|
while (length--) {
|
|
var key = result2[length], value = object[key];
|
|
result2[length] = [key, value, isStrictComparable(value)];
|
|
}
|
|
return result2;
|
|
}
|
|
function getNative(object, key) {
|
|
var value = getValue3(object, key);
|
|
return baseIsNative(value) ? value : undefined2;
|
|
}
|
|
function getRawTag(value) {
|
|
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
try {
|
|
value[symToStringTag] = undefined2;
|
|
var unmasked = true;
|
|
} catch (e) {
|
|
}
|
|
var result2 = nativeObjectToString.call(value);
|
|
if (unmasked) {
|
|
if (isOwn) {
|
|
value[symToStringTag] = tag;
|
|
} else {
|
|
delete value[symToStringTag];
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
if (object == null) {
|
|
return [];
|
|
}
|
|
object = Object2(object);
|
|
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
return propertyIsEnumerable.call(object, symbol);
|
|
});
|
|
};
|
|
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
var result2 = [];
|
|
while (object) {
|
|
arrayPush(result2, getSymbols(object));
|
|
object = getPrototype(object);
|
|
}
|
|
return result2;
|
|
};
|
|
var getTag = baseGetTag;
|
|
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
getTag = function(value) {
|
|
var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : "";
|
|
if (ctorString) {
|
|
switch (ctorString) {
|
|
case dataViewCtorString:
|
|
return dataViewTag;
|
|
case mapCtorString:
|
|
return mapTag;
|
|
case promiseCtorString:
|
|
return promiseTag;
|
|
case setCtorString:
|
|
return setTag;
|
|
case weakMapCtorString:
|
|
return weakMapTag;
|
|
}
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
function getView(start, end, transforms) {
|
|
var index = -1, length = transforms.length;
|
|
while (++index < length) {
|
|
var data = transforms[index], size2 = data.size;
|
|
switch (data.type) {
|
|
case "drop":
|
|
start += size2;
|
|
break;
|
|
case "dropRight":
|
|
end -= size2;
|
|
break;
|
|
case "take":
|
|
end = nativeMin(end, start + size2);
|
|
break;
|
|
case "takeRight":
|
|
start = nativeMax(start, end - size2);
|
|
break;
|
|
}
|
|
}
|
|
return { "start": start, "end": end };
|
|
}
|
|
function getWrapDetails(source) {
|
|
var match = source.match(reWrapDetails);
|
|
return match ? match[1].split(reSplitDetails) : [];
|
|
}
|
|
function hasPath(object, path, hasFunc) {
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length, result2 = false;
|
|
while (++index < length) {
|
|
var key = toKey(path[index]);
|
|
if (!(result2 = object != null && hasFunc(object, key))) {
|
|
break;
|
|
}
|
|
object = object[key];
|
|
}
|
|
if (result2 || ++index != length) {
|
|
return result2;
|
|
}
|
|
length = object == null ? 0 : object.length;
|
|
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
|
|
}
|
|
function initCloneArray(array) {
|
|
var length = array.length, result2 = new array.constructor(length);
|
|
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
result2.index = array.index;
|
|
result2.input = array.input;
|
|
}
|
|
return result2;
|
|
}
|
|
function initCloneObject(object) {
|
|
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
}
|
|
function initCloneByTag(object, tag, isDeep) {
|
|
var Ctor = object.constructor;
|
|
switch (tag) {
|
|
case arrayBufferTag:
|
|
return cloneArrayBuffer(object);
|
|
case boolTag:
|
|
case dateTag:
|
|
return new Ctor(+object);
|
|
case dataViewTag:
|
|
return cloneDataView(object, isDeep);
|
|
case float32Tag:
|
|
case float64Tag:
|
|
case int8Tag:
|
|
case int16Tag:
|
|
case int32Tag:
|
|
case uint8Tag:
|
|
case uint8ClampedTag:
|
|
case uint16Tag:
|
|
case uint32Tag:
|
|
return cloneTypedArray(object, isDeep);
|
|
case mapTag:
|
|
return new Ctor();
|
|
case numberTag:
|
|
case stringTag:
|
|
return new Ctor(object);
|
|
case regexpTag:
|
|
return cloneRegExp(object);
|
|
case setTag:
|
|
return new Ctor();
|
|
case symbolTag:
|
|
return cloneSymbol(object);
|
|
}
|
|
}
|
|
function insertWrapDetails(source, details) {
|
|
var length = details.length;
|
|
if (!length) {
|
|
return source;
|
|
}
|
|
var lastIndex = length - 1;
|
|
details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
|
|
details = details.join(length > 2 ? ", " : " ");
|
|
return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
|
|
}
|
|
function isFlattenable(value) {
|
|
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
}
|
|
function isIndex(value, length) {
|
|
var type = typeof value;
|
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
}
|
|
function isIterateeCall(value, index, object) {
|
|
if (!isObject(object)) {
|
|
return false;
|
|
}
|
|
var type = typeof index;
|
|
if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
|
|
return eq(object[index], value);
|
|
}
|
|
return false;
|
|
}
|
|
function isKey(value, object) {
|
|
if (isArray(value)) {
|
|
return false;
|
|
}
|
|
var type = typeof value;
|
|
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
return true;
|
|
}
|
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
|
|
}
|
|
function isKeyable(value) {
|
|
var type = typeof value;
|
|
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
}
|
|
function isLaziable(func) {
|
|
var funcName = getFuncName(func), other = lodash[funcName];
|
|
if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
|
|
return false;
|
|
}
|
|
if (func === other) {
|
|
return true;
|
|
}
|
|
var data = getData(other);
|
|
return !!data && func === data[0];
|
|
}
|
|
function isMasked(func) {
|
|
return !!maskSrcKey && maskSrcKey in func;
|
|
}
|
|
var isMaskable = coreJsData ? isFunction : stubFalse;
|
|
function isPrototype(value) {
|
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
return value === proto;
|
|
}
|
|
function isStrictComparable(value) {
|
|
return value === value && !isObject(value);
|
|
}
|
|
function matchesStrictComparable(key, srcValue) {
|
|
return function(object) {
|
|
if (object == null) {
|
|
return false;
|
|
}
|
|
return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object));
|
|
};
|
|
}
|
|
function memoizeCapped(func) {
|
|
var result2 = memoize2(func, function(key) {
|
|
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
cache.clear();
|
|
}
|
|
return key;
|
|
});
|
|
var cache = result2.cache;
|
|
return result2;
|
|
}
|
|
function mergeData(data, source) {
|
|
var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
|
|
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
|
|
if (!(isCommon || isCombo)) {
|
|
return data;
|
|
}
|
|
if (srcBitmask & WRAP_BIND_FLAG) {
|
|
data[2] = source[2];
|
|
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
|
|
}
|
|
var value = source[3];
|
|
if (value) {
|
|
var partials = data[3];
|
|
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
|
|
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
|
|
}
|
|
value = source[5];
|
|
if (value) {
|
|
partials = data[5];
|
|
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
|
|
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
|
|
}
|
|
value = source[7];
|
|
if (value) {
|
|
data[7] = value;
|
|
}
|
|
if (srcBitmask & WRAP_ARY_FLAG) {
|
|
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
|
|
}
|
|
if (data[9] == null) {
|
|
data[9] = source[9];
|
|
}
|
|
data[0] = source[0];
|
|
data[1] = newBitmask;
|
|
return data;
|
|
}
|
|
function nativeKeysIn(object) {
|
|
var result2 = [];
|
|
if (object != null) {
|
|
for (var key in Object2(object)) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function objectToString(value) {
|
|
return nativeObjectToString.call(value);
|
|
}
|
|
function overRest(func, start, transform3) {
|
|
start = nativeMax(start === undefined2 ? func.length - 1 : start, 0);
|
|
return function() {
|
|
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
|
|
while (++index < length) {
|
|
array[index] = args[start + index];
|
|
}
|
|
index = -1;
|
|
var otherArgs = Array2(start + 1);
|
|
while (++index < start) {
|
|
otherArgs[index] = args[index];
|
|
}
|
|
otherArgs[start] = transform3(array);
|
|
return apply(func, this, otherArgs);
|
|
};
|
|
}
|
|
function parent(object, path) {
|
|
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
}
|
|
function reorder(array, indexes) {
|
|
var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
|
|
while (length--) {
|
|
var index = indexes[length];
|
|
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2;
|
|
}
|
|
return array;
|
|
}
|
|
function safeGet(object, key) {
|
|
if (key === "constructor" && typeof object[key] === "function") {
|
|
return;
|
|
}
|
|
if (key == "__proto__") {
|
|
return;
|
|
}
|
|
return object[key];
|
|
}
|
|
var setData = shortOut(baseSetData);
|
|
var setTimeout2 = ctxSetTimeout || function(func, wait) {
|
|
return root.setTimeout(func, wait);
|
|
};
|
|
var setToString = shortOut(baseSetToString);
|
|
function setWrapToString(wrapper, reference, bitmask) {
|
|
var source = reference + "";
|
|
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
|
|
}
|
|
function shortOut(func) {
|
|
var count = 0, lastCalled = 0;
|
|
return function() {
|
|
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
lastCalled = stamp;
|
|
if (remaining > 0) {
|
|
if (++count >= HOT_COUNT) {
|
|
return arguments[0];
|
|
}
|
|
} else {
|
|
count = 0;
|
|
}
|
|
return func.apply(undefined2, arguments);
|
|
};
|
|
}
|
|
function shuffleSelf(array, size2) {
|
|
var index = -1, length = array.length, lastIndex = length - 1;
|
|
size2 = size2 === undefined2 ? length : size2;
|
|
while (++index < size2) {
|
|
var rand = baseRandom(index, lastIndex), value = array[rand];
|
|
array[rand] = array[index];
|
|
array[index] = value;
|
|
}
|
|
array.length = size2;
|
|
return array;
|
|
}
|
|
var stringToPath = memoizeCapped(function(string) {
|
|
var result2 = [];
|
|
if (string.charCodeAt(0) === 46) {
|
|
result2.push("");
|
|
}
|
|
string.replace(rePropName, function(match, number, quote, subString) {
|
|
result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
});
|
|
return result2;
|
|
});
|
|
function toKey(value) {
|
|
if (typeof value == "string" || isSymbol(value)) {
|
|
return value;
|
|
}
|
|
var result2 = value + "";
|
|
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
}
|
|
function toSource(func) {
|
|
if (func != null) {
|
|
try {
|
|
return funcToString.call(func);
|
|
} catch (e) {
|
|
}
|
|
try {
|
|
return func + "";
|
|
} catch (e) {
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function updateWrapDetails(details, bitmask) {
|
|
arrayEach(wrapFlags, function(pair) {
|
|
var value = "_." + pair[0];
|
|
if (bitmask & pair[1] && !arrayIncludes(details, value)) {
|
|
details.push(value);
|
|
}
|
|
});
|
|
return details.sort();
|
|
}
|
|
function wrapperClone(wrapper) {
|
|
if (wrapper instanceof LazyWrapper) {
|
|
return wrapper.clone();
|
|
}
|
|
var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
|
|
result2.__actions__ = copyArray(wrapper.__actions__);
|
|
result2.__index__ = wrapper.__index__;
|
|
result2.__values__ = wrapper.__values__;
|
|
return result2;
|
|
}
|
|
function chunk(array, size2, guard) {
|
|
if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) {
|
|
size2 = 1;
|
|
} else {
|
|
size2 = nativeMax(toInteger(size2), 0);
|
|
}
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length || size2 < 1) {
|
|
return [];
|
|
}
|
|
var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
|
|
while (index < length) {
|
|
result2[resIndex++] = baseSlice(array, index, index += size2);
|
|
}
|
|
return result2;
|
|
}
|
|
function compact(array) {
|
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (value) {
|
|
result2[resIndex++] = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function concat() {
|
|
var length = arguments.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
var args = Array2(length - 1), array = arguments[0], index = length;
|
|
while (index--) {
|
|
args[index - 1] = arguments[index];
|
|
}
|
|
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
|
|
}
|
|
var difference = baseRest(function(array, values3) {
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values3, 1, isArrayLikeObject, true)) : [];
|
|
});
|
|
var differenceBy = baseRest(function(array, values3) {
|
|
var iteratee2 = last(values3);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values3, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
|
|
});
|
|
var differenceWith = baseRest(function(array, values3) {
|
|
var comparator = last(values3);
|
|
if (isArrayLikeObject(comparator)) {
|
|
comparator = undefined2;
|
|
}
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values3, 1, isArrayLikeObject, true), undefined2, comparator) : [];
|
|
});
|
|
function drop(array, n2, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n2 = guard || n2 === undefined2 ? 1 : toInteger(n2);
|
|
return baseSlice(array, n2 < 0 ? 0 : n2, length);
|
|
}
|
|
function dropRight(array, n2, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n2 = guard || n2 === undefined2 ? 1 : toInteger(n2);
|
|
n2 = length - n2;
|
|
return baseSlice(array, 0, n2 < 0 ? 0 : n2);
|
|
}
|
|
function dropRightWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
|
|
}
|
|
function dropWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
|
|
}
|
|
function fill(array, value, start, end) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
|
|
start = 0;
|
|
end = length;
|
|
}
|
|
return baseFill(array, value, start, end);
|
|
}
|
|
function findIndex(array, predicate, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
if (index < 0) {
|
|
index = nativeMax(length + index, 0);
|
|
}
|
|
return baseFindIndex(array, getIteratee(predicate, 3), index);
|
|
}
|
|
function findLastIndex(array, predicate, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = length - 1;
|
|
if (fromIndex !== undefined2) {
|
|
index = toInteger(fromIndex);
|
|
index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
|
|
}
|
|
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
|
|
}
|
|
function flatten(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseFlatten(array, 1) : [];
|
|
}
|
|
function flattenDeep(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseFlatten(array, INFINITY) : [];
|
|
}
|
|
function flattenDepth(array, depth) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
depth = depth === undefined2 ? 1 : toInteger(depth);
|
|
return baseFlatten(array, depth);
|
|
}
|
|
function fromPairs(pairs) {
|
|
var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
|
|
while (++index < length) {
|
|
var pair = pairs[index];
|
|
result2[pair[0]] = pair[1];
|
|
}
|
|
return result2;
|
|
}
|
|
function head(array) {
|
|
return array && array.length ? array[0] : undefined2;
|
|
}
|
|
function indexOf(array, value, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
if (index < 0) {
|
|
index = nativeMax(length + index, 0);
|
|
}
|
|
return baseIndexOf(array, value, index);
|
|
}
|
|
function initial(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSlice(array, 0, -1) : [];
|
|
}
|
|
var intersection = baseRest(function(arrays) {
|
|
var mapped = arrayMap(arrays, castArrayLikeObject);
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
|
|
});
|
|
var intersectionBy = baseRest(function(arrays) {
|
|
var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
|
|
if (iteratee2 === last(mapped)) {
|
|
iteratee2 = undefined2;
|
|
} else {
|
|
mapped.pop();
|
|
}
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
|
|
});
|
|
var intersectionWith = baseRest(function(arrays) {
|
|
var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
if (comparator) {
|
|
mapped.pop();
|
|
}
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
});
|
|
function join(array, separator) {
|
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
}
|
|
function last(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? array[length - 1] : undefined2;
|
|
}
|
|
function lastIndexOf(array, value, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = length;
|
|
if (fromIndex !== undefined2) {
|
|
index = toInteger(fromIndex);
|
|
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
|
|
}
|
|
return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
|
|
}
|
|
function nth(array, n2) {
|
|
return array && array.length ? baseNth(array, toInteger(n2)) : undefined2;
|
|
}
|
|
var pull = baseRest(pullAll);
|
|
function pullAll(array, values3) {
|
|
return array && array.length && values3 && values3.length ? basePullAll(array, values3) : array;
|
|
}
|
|
function pullAllBy(array, values3, iteratee2) {
|
|
return array && array.length && values3 && values3.length ? basePullAll(array, values3, getIteratee(iteratee2, 2)) : array;
|
|
}
|
|
function pullAllWith(array, values3, comparator) {
|
|
return array && array.length && values3 && values3.length ? basePullAll(array, values3, undefined2, comparator) : array;
|
|
}
|
|
var pullAt = flatRest(function(array, indexes) {
|
|
var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
|
|
basePullAt(array, arrayMap(indexes, function(index) {
|
|
return isIndex(index, length) ? +index : index;
|
|
}).sort(compareAscending));
|
|
return result2;
|
|
});
|
|
function remove(array, predicate) {
|
|
var result2 = [];
|
|
if (!(array && array.length)) {
|
|
return result2;
|
|
}
|
|
var index = -1, indexes = [], length = array.length;
|
|
predicate = getIteratee(predicate, 3);
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (predicate(value, index, array)) {
|
|
result2.push(value);
|
|
indexes.push(index);
|
|
}
|
|
}
|
|
basePullAt(array, indexes);
|
|
return result2;
|
|
}
|
|
function reverse(array) {
|
|
return array == null ? array : nativeReverse.call(array);
|
|
}
|
|
function slice(array, start, end) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
|
|
start = 0;
|
|
end = length;
|
|
} else {
|
|
start = start == null ? 0 : toInteger(start);
|
|
end = end === undefined2 ? length : toInteger(end);
|
|
}
|
|
return baseSlice(array, start, end);
|
|
}
|
|
function sortedIndex(array, value) {
|
|
return baseSortedIndex(array, value);
|
|
}
|
|
function sortedIndexBy(array, value, iteratee2) {
|
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
|
|
}
|
|
function sortedIndexOf(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (length) {
|
|
var index = baseSortedIndex(array, value);
|
|
if (index < length && eq(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function sortedLastIndex(array, value) {
|
|
return baseSortedIndex(array, value, true);
|
|
}
|
|
function sortedLastIndexBy(array, value, iteratee2) {
|
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
|
|
}
|
|
function sortedLastIndexOf(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (length) {
|
|
var index = baseSortedIndex(array, value, true) - 1;
|
|
if (eq(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function sortedUniq(array) {
|
|
return array && array.length ? baseSortedUniq(array) : [];
|
|
}
|
|
function sortedUniqBy(array, iteratee2) {
|
|
return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
|
|
}
|
|
function tail(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSlice(array, 1, length) : [];
|
|
}
|
|
function take(array, n2, guard) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
n2 = guard || n2 === undefined2 ? 1 : toInteger(n2);
|
|
return baseSlice(array, 0, n2 < 0 ? 0 : n2);
|
|
}
|
|
function takeRight(array, n2, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n2 = guard || n2 === undefined2 ? 1 : toInteger(n2);
|
|
n2 = length - n2;
|
|
return baseSlice(array, n2 < 0 ? 0 : n2, length);
|
|
}
|
|
function takeRightWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
|
|
}
|
|
function takeWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
|
|
}
|
|
var union = baseRest(function(arrays) {
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
|
|
});
|
|
var unionBy = baseRest(function(arrays) {
|
|
var iteratee2 = last(arrays);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
|
|
});
|
|
var unionWith = baseRest(function(arrays) {
|
|
var comparator = last(arrays);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator);
|
|
});
|
|
function uniq(array) {
|
|
return array && array.length ? baseUniq(array) : [];
|
|
}
|
|
function uniqBy(array, iteratee2) {
|
|
return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
|
|
}
|
|
function uniqWith(array, comparator) {
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return array && array.length ? baseUniq(array, undefined2, comparator) : [];
|
|
}
|
|
function unzip(array) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
var length = 0;
|
|
array = arrayFilter(array, function(group) {
|
|
if (isArrayLikeObject(group)) {
|
|
length = nativeMax(group.length, length);
|
|
return true;
|
|
}
|
|
});
|
|
return baseTimes(length, function(index) {
|
|
return arrayMap(array, baseProperty(index));
|
|
});
|
|
}
|
|
function unzipWith(array, iteratee2) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
var result2 = unzip(array);
|
|
if (iteratee2 == null) {
|
|
return result2;
|
|
}
|
|
return arrayMap(result2, function(group) {
|
|
return apply(iteratee2, undefined2, group);
|
|
});
|
|
}
|
|
var without = baseRest(function(array, values3) {
|
|
return isArrayLikeObject(array) ? baseDifference(array, values3) : [];
|
|
});
|
|
var xor = baseRest(function(arrays) {
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject));
|
|
});
|
|
var xorBy = baseRest(function(arrays) {
|
|
var iteratee2 = last(arrays);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
|
|
});
|
|
var xorWith = baseRest(function(arrays) {
|
|
var comparator = last(arrays);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator);
|
|
});
|
|
var zip = baseRest(unzip);
|
|
function zipObject(props, values3) {
|
|
return baseZipObject(props || [], values3 || [], assignValue);
|
|
}
|
|
function zipObjectDeep(props, values3) {
|
|
return baseZipObject(props || [], values3 || [], baseSet);
|
|
}
|
|
var zipWith = baseRest(function(arrays) {
|
|
var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2;
|
|
iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2;
|
|
return unzipWith(arrays, iteratee2);
|
|
});
|
|
function chain(value) {
|
|
var result2 = lodash(value);
|
|
result2.__chain__ = true;
|
|
return result2;
|
|
}
|
|
function tap(value, interceptor) {
|
|
interceptor(value);
|
|
return value;
|
|
}
|
|
function thru(value, interceptor) {
|
|
return interceptor(value);
|
|
}
|
|
var wrapperAt = flatRest(function(paths) {
|
|
var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
|
|
return baseAt(object, paths);
|
|
};
|
|
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
|
|
return this.thru(interceptor);
|
|
}
|
|
value = value.slice(start, +start + (length ? 1 : 0));
|
|
value.__actions__.push({
|
|
"func": thru,
|
|
"args": [interceptor],
|
|
"thisArg": undefined2
|
|
});
|
|
return new LodashWrapper(value, this.__chain__).thru(function(array) {
|
|
if (length && !array.length) {
|
|
array.push(undefined2);
|
|
}
|
|
return array;
|
|
});
|
|
});
|
|
function wrapperChain() {
|
|
return chain(this);
|
|
}
|
|
function wrapperCommit() {
|
|
return new LodashWrapper(this.value(), this.__chain__);
|
|
}
|
|
function wrapperNext() {
|
|
if (this.__values__ === undefined2) {
|
|
this.__values__ = toArray(this.value());
|
|
}
|
|
var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++];
|
|
return { "done": done, "value": value };
|
|
}
|
|
function wrapperToIterator() {
|
|
return this;
|
|
}
|
|
function wrapperPlant(value) {
|
|
var result2, parent2 = this;
|
|
while (parent2 instanceof baseLodash) {
|
|
var clone2 = wrapperClone(parent2);
|
|
clone2.__index__ = 0;
|
|
clone2.__values__ = undefined2;
|
|
if (result2) {
|
|
previous.__wrapped__ = clone2;
|
|
} else {
|
|
result2 = clone2;
|
|
}
|
|
var previous = clone2;
|
|
parent2 = parent2.__wrapped__;
|
|
}
|
|
previous.__wrapped__ = value;
|
|
return result2;
|
|
}
|
|
function wrapperReverse() {
|
|
var value = this.__wrapped__;
|
|
if (value instanceof LazyWrapper) {
|
|
var wrapped = value;
|
|
if (this.__actions__.length) {
|
|
wrapped = new LazyWrapper(this);
|
|
}
|
|
wrapped = wrapped.reverse();
|
|
wrapped.__actions__.push({
|
|
"func": thru,
|
|
"args": [reverse],
|
|
"thisArg": undefined2
|
|
});
|
|
return new LodashWrapper(wrapped, this.__chain__);
|
|
}
|
|
return this.thru(reverse);
|
|
}
|
|
function wrapperValue() {
|
|
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
|
}
|
|
var countBy = createAggregator(function(result2, value, key) {
|
|
if (hasOwnProperty.call(result2, key)) {
|
|
++result2[key];
|
|
} else {
|
|
baseAssignValue(result2, key, 1);
|
|
}
|
|
});
|
|
function every(collection, predicate, guard) {
|
|
var func = isArray(collection) ? arrayEvery : baseEvery;
|
|
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
predicate = undefined2;
|
|
}
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
function filter(collection, predicate) {
|
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
var find = createFind(findIndex);
|
|
var findLast = createFind(findLastIndex);
|
|
function flatMap(collection, iteratee2) {
|
|
return baseFlatten(map(collection, iteratee2), 1);
|
|
}
|
|
function flatMapDeep(collection, iteratee2) {
|
|
return baseFlatten(map(collection, iteratee2), INFINITY);
|
|
}
|
|
function flatMapDepth(collection, iteratee2, depth) {
|
|
depth = depth === undefined2 ? 1 : toInteger(depth);
|
|
return baseFlatten(map(collection, iteratee2), depth);
|
|
}
|
|
function forEach(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayEach : baseEach;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
function forEachRight(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayEachRight : baseEachRight;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
var groupBy = createAggregator(function(result2, value, key) {
|
|
if (hasOwnProperty.call(result2, key)) {
|
|
result2[key].push(value);
|
|
} else {
|
|
baseAssignValue(result2, key, [value]);
|
|
}
|
|
});
|
|
function includes(collection, value, fromIndex, guard) {
|
|
collection = isArrayLike(collection) ? collection : values2(collection);
|
|
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
|
|
var length = collection.length;
|
|
if (fromIndex < 0) {
|
|
fromIndex = nativeMax(length + fromIndex, 0);
|
|
}
|
|
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
}
|
|
var invokeMap = baseRest(function(collection, path, args) {
|
|
var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
baseEach(collection, function(value) {
|
|
result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
|
});
|
|
return result2;
|
|
});
|
|
var keyBy = createAggregator(function(result2, value, key) {
|
|
baseAssignValue(result2, key, value);
|
|
});
|
|
function map(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayMap : baseMap;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
function orderBy(collection, iteratees, orders, guard) {
|
|
if (collection == null) {
|
|
return [];
|
|
}
|
|
if (!isArray(iteratees)) {
|
|
iteratees = iteratees == null ? [] : [iteratees];
|
|
}
|
|
orders = guard ? undefined2 : orders;
|
|
if (!isArray(orders)) {
|
|
orders = orders == null ? [] : [orders];
|
|
}
|
|
return baseOrderBy(collection, iteratees, orders);
|
|
}
|
|
var partition = createAggregator(function(result2, value, key) {
|
|
result2[key ? 0 : 1].push(value);
|
|
}, function() {
|
|
return [[], []];
|
|
});
|
|
function reduce(collection, iteratee2, accumulator) {
|
|
var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
|
|
return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
|
|
}
|
|
function reduceRight(collection, iteratee2, accumulator) {
|
|
var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
|
|
return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
|
|
}
|
|
function reject(collection, predicate) {
|
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
|
return func(collection, negate(getIteratee(predicate, 3)));
|
|
}
|
|
function sample(collection) {
|
|
var func = isArray(collection) ? arraySample : baseSample;
|
|
return func(collection);
|
|
}
|
|
function sampleSize(collection, n2, guard) {
|
|
if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined2) {
|
|
n2 = 1;
|
|
} else {
|
|
n2 = toInteger(n2);
|
|
}
|
|
var func = isArray(collection) ? arraySampleSize : baseSampleSize;
|
|
return func(collection, n2);
|
|
}
|
|
function shuffle(collection) {
|
|
var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
|
return func(collection);
|
|
}
|
|
function size(collection) {
|
|
if (collection == null) {
|
|
return 0;
|
|
}
|
|
if (isArrayLike(collection)) {
|
|
return isString(collection) ? stringSize(collection) : collection.length;
|
|
}
|
|
var tag = getTag(collection);
|
|
if (tag == mapTag || tag == setTag) {
|
|
return collection.size;
|
|
}
|
|
return baseKeys(collection).length;
|
|
}
|
|
function some(collection, predicate, guard) {
|
|
var func = isArray(collection) ? arraySome : baseSome;
|
|
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
predicate = undefined2;
|
|
}
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
var sortBy = baseRest(function(collection, iteratees) {
|
|
if (collection == null) {
|
|
return [];
|
|
}
|
|
var length = iteratees.length;
|
|
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
iteratees = [];
|
|
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
iteratees = [iteratees[0]];
|
|
}
|
|
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
|
|
});
|
|
var now = ctxNow || function() {
|
|
return root.Date.now();
|
|
};
|
|
function after(n2, func) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
n2 = toInteger(n2);
|
|
return function() {
|
|
if (--n2 < 1) {
|
|
return func.apply(this, arguments);
|
|
}
|
|
};
|
|
}
|
|
function ary(func, n2, guard) {
|
|
n2 = guard ? undefined2 : n2;
|
|
n2 = func && n2 == null ? func.length : n2;
|
|
return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n2);
|
|
}
|
|
function before(n2, func) {
|
|
var result2;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
n2 = toInteger(n2);
|
|
return function() {
|
|
if (--n2 > 0) {
|
|
result2 = func.apply(this, arguments);
|
|
}
|
|
if (n2 <= 1) {
|
|
func = undefined2;
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
var bind = baseRest(function(func, thisArg, partials) {
|
|
var bitmask = WRAP_BIND_FLAG;
|
|
if (partials.length) {
|
|
var holders = replaceHolders(partials, getHolder(bind));
|
|
bitmask |= WRAP_PARTIAL_FLAG;
|
|
}
|
|
return createWrap(func, bitmask, thisArg, partials, holders);
|
|
});
|
|
var bindKey = baseRest(function(object, key, partials) {
|
|
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
|
|
if (partials.length) {
|
|
var holders = replaceHolders(partials, getHolder(bindKey));
|
|
bitmask |= WRAP_PARTIAL_FLAG;
|
|
}
|
|
return createWrap(key, bitmask, object, partials, holders);
|
|
});
|
|
function curry(func, arity, guard) {
|
|
arity = guard ? undefined2 : arity;
|
|
var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
|
|
result2.placeholder = curry.placeholder;
|
|
return result2;
|
|
}
|
|
function curryRight(func, arity, guard) {
|
|
arity = guard ? undefined2 : arity;
|
|
var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
|
|
result2.placeholder = curryRight.placeholder;
|
|
return result2;
|
|
}
|
|
function debounce(func, wait, options) {
|
|
var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
wait = toNumber(wait) || 0;
|
|
if (isObject(options)) {
|
|
leading = !!options.leading;
|
|
maxing = "maxWait" in options;
|
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
function invokeFunc(time) {
|
|
var args = lastArgs, thisArg = lastThis;
|
|
lastArgs = lastThis = undefined2;
|
|
lastInvokeTime = time;
|
|
result2 = func.apply(thisArg, args);
|
|
return result2;
|
|
}
|
|
function leadingEdge(time) {
|
|
lastInvokeTime = time;
|
|
timerId = setTimeout2(timerExpired, wait);
|
|
return leading ? invokeFunc(time) : result2;
|
|
}
|
|
function remainingWait(time) {
|
|
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
}
|
|
function shouldInvoke(time) {
|
|
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
}
|
|
function timerExpired() {
|
|
var time = now();
|
|
if (shouldInvoke(time)) {
|
|
return trailingEdge(time);
|
|
}
|
|
timerId = setTimeout2(timerExpired, remainingWait(time));
|
|
}
|
|
function trailingEdge(time) {
|
|
timerId = undefined2;
|
|
if (trailing && lastArgs) {
|
|
return invokeFunc(time);
|
|
}
|
|
lastArgs = lastThis = undefined2;
|
|
return result2;
|
|
}
|
|
function cancel() {
|
|
if (timerId !== undefined2) {
|
|
clearTimeout2(timerId);
|
|
}
|
|
lastInvokeTime = 0;
|
|
lastArgs = lastCallTime = lastThis = timerId = undefined2;
|
|
}
|
|
function flush() {
|
|
return timerId === undefined2 ? result2 : trailingEdge(now());
|
|
}
|
|
function debounced() {
|
|
var time = now(), isInvoking = shouldInvoke(time);
|
|
lastArgs = arguments;
|
|
lastThis = this;
|
|
lastCallTime = time;
|
|
if (isInvoking) {
|
|
if (timerId === undefined2) {
|
|
return leadingEdge(lastCallTime);
|
|
}
|
|
if (maxing) {
|
|
clearTimeout2(timerId);
|
|
timerId = setTimeout2(timerExpired, wait);
|
|
return invokeFunc(lastCallTime);
|
|
}
|
|
}
|
|
if (timerId === undefined2) {
|
|
timerId = setTimeout2(timerExpired, wait);
|
|
}
|
|
return result2;
|
|
}
|
|
debounced.cancel = cancel;
|
|
debounced.flush = flush;
|
|
return debounced;
|
|
}
|
|
var defer = baseRest(function(func, args) {
|
|
return baseDelay(func, 1, args);
|
|
});
|
|
var delay = baseRest(function(func, wait, args) {
|
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
});
|
|
function flip(func) {
|
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
}
|
|
function memoize2(func, resolver) {
|
|
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
var memoized = function() {
|
|
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
if (cache.has(key)) {
|
|
return cache.get(key);
|
|
}
|
|
var result2 = func.apply(this, args);
|
|
memoized.cache = cache.set(key, result2) || cache;
|
|
return result2;
|
|
};
|
|
memoized.cache = new (memoize2.Cache || MapCache)();
|
|
return memoized;
|
|
}
|
|
memoize2.Cache = MapCache;
|
|
function negate(predicate) {
|
|
if (typeof predicate != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return function() {
|
|
var args = arguments;
|
|
switch (args.length) {
|
|
case 0:
|
|
return !predicate.call(this);
|
|
case 1:
|
|
return !predicate.call(this, args[0]);
|
|
case 2:
|
|
return !predicate.call(this, args[0], args[1]);
|
|
case 3:
|
|
return !predicate.call(this, args[0], args[1], args[2]);
|
|
}
|
|
return !predicate.apply(this, args);
|
|
};
|
|
}
|
|
function once(func) {
|
|
return before(2, func);
|
|
}
|
|
var overArgs = castRest(function(func, transforms) {
|
|
transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
|
|
var funcsLength = transforms.length;
|
|
return baseRest(function(args) {
|
|
var index = -1, length = nativeMin(args.length, funcsLength);
|
|
while (++index < length) {
|
|
args[index] = transforms[index].call(this, args[index]);
|
|
}
|
|
return apply(func, this, args);
|
|
});
|
|
});
|
|
var partial = baseRest(function(func, partials) {
|
|
var holders = replaceHolders(partials, getHolder(partial));
|
|
return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders);
|
|
});
|
|
var partialRight = baseRest(function(func, partials) {
|
|
var holders = replaceHolders(partials, getHolder(partialRight));
|
|
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders);
|
|
});
|
|
var rearg = flatRest(function(func, indexes) {
|
|
return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes);
|
|
});
|
|
function rest(func, start) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
start = start === undefined2 ? start : toInteger(start);
|
|
return baseRest(func, start);
|
|
}
|
|
function spread(func, start) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
start = start == null ? 0 : nativeMax(toInteger(start), 0);
|
|
return baseRest(function(args) {
|
|
var array = args[start], otherArgs = castSlice(args, 0, start);
|
|
if (array) {
|
|
arrayPush(otherArgs, array);
|
|
}
|
|
return apply(func, this, otherArgs);
|
|
});
|
|
}
|
|
function throttle(func, wait, options) {
|
|
var leading = true, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
if (isObject(options)) {
|
|
leading = "leading" in options ? !!options.leading : leading;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
return debounce(func, wait, {
|
|
"leading": leading,
|
|
"maxWait": wait,
|
|
"trailing": trailing
|
|
});
|
|
}
|
|
function unary(func) {
|
|
return ary(func, 1);
|
|
}
|
|
function wrap(value, wrapper) {
|
|
return partial(castFunction(wrapper), value);
|
|
}
|
|
function castArray() {
|
|
if (!arguments.length) {
|
|
return [];
|
|
}
|
|
var value = arguments[0];
|
|
return isArray(value) ? value : [value];
|
|
}
|
|
function clone(value) {
|
|
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
}
|
|
function cloneWith(value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
}
|
|
function cloneDeep(value) {
|
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
}
|
|
function cloneDeepWith(value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
|
|
}
|
|
function conformsTo(object, source) {
|
|
return source == null || baseConformsTo(object, source, keys(source));
|
|
}
|
|
function eq(value, other) {
|
|
return value === other || value !== value && other !== other;
|
|
}
|
|
var gt = createRelationalOperation(baseGt);
|
|
var gte = createRelationalOperation(function(value, other) {
|
|
return value >= other;
|
|
});
|
|
var isArguments = baseIsArguments(function() {
|
|
return arguments;
|
|
}()) ? baseIsArguments : function(value) {
|
|
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
};
|
|
var isArray = Array2.isArray;
|
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
function isArrayLike(value) {
|
|
return value != null && isLength(value.length) && !isFunction(value);
|
|
}
|
|
function isArrayLikeObject(value) {
|
|
return isObjectLike(value) && isArrayLike(value);
|
|
}
|
|
function isBoolean2(value) {
|
|
return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
}
|
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
var isDate3 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
function isElement(value) {
|
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject5(value);
|
|
}
|
|
function isEmpty3(value) {
|
|
if (value == null) {
|
|
return true;
|
|
}
|
|
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
return !value.length;
|
|
}
|
|
var tag = getTag(value);
|
|
if (tag == mapTag || tag == setTag) {
|
|
return !value.size;
|
|
}
|
|
if (isPrototype(value)) {
|
|
return !baseKeys(value).length;
|
|
}
|
|
for (var key in value) {
|
|
if (hasOwnProperty.call(value, key)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function isEqual(value, other) {
|
|
return baseIsEqual(value, other);
|
|
}
|
|
function isEqualWith(value, other, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
var result2 = customizer ? customizer(value, other) : undefined2;
|
|
return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2;
|
|
}
|
|
function isError2(value) {
|
|
if (!isObjectLike(value)) {
|
|
return false;
|
|
}
|
|
var tag = baseGetTag(value);
|
|
return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject5(value);
|
|
}
|
|
function isFinite2(value) {
|
|
return typeof value == "number" && nativeIsFinite(value);
|
|
}
|
|
function isFunction(value) {
|
|
if (!isObject(value)) {
|
|
return false;
|
|
}
|
|
var tag = baseGetTag(value);
|
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
}
|
|
function isInteger(value) {
|
|
return typeof value == "number" && value == toInteger(value);
|
|
}
|
|
function isLength(value) {
|
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
}
|
|
function isObject(value) {
|
|
var type = typeof value;
|
|
return value != null && (type == "object" || type == "function");
|
|
}
|
|
function isObjectLike(value) {
|
|
return value != null && typeof value == "object";
|
|
}
|
|
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
function isMatch2(object, source) {
|
|
return object === source || baseIsMatch(object, source, getMatchData(source));
|
|
}
|
|
function isMatchWith(object, source, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseIsMatch(object, source, getMatchData(source), customizer);
|
|
}
|
|
function isNaN2(value) {
|
|
return isNumber2(value) && value != +value;
|
|
}
|
|
function isNative(value) {
|
|
if (isMaskable(value)) {
|
|
throw new Error2(CORE_ERROR_TEXT);
|
|
}
|
|
return baseIsNative(value);
|
|
}
|
|
function isNull(value) {
|
|
return value === null;
|
|
}
|
|
function isNil(value) {
|
|
return value == null;
|
|
}
|
|
function isNumber2(value) {
|
|
return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
|
|
}
|
|
function isPlainObject5(value) {
|
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
return false;
|
|
}
|
|
var proto = getPrototype(value);
|
|
if (proto === null) {
|
|
return true;
|
|
}
|
|
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
}
|
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
function isSafeInteger(value) {
|
|
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
}
|
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
function isString(value) {
|
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
}
|
|
function isSymbol(value) {
|
|
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
}
|
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
function isUndefined(value) {
|
|
return value === undefined2;
|
|
}
|
|
function isWeakMap(value) {
|
|
return isObjectLike(value) && getTag(value) == weakMapTag;
|
|
}
|
|
function isWeakSet(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == weakSetTag;
|
|
}
|
|
var lt = createRelationalOperation(baseLt);
|
|
var lte = createRelationalOperation(function(value, other) {
|
|
return value <= other;
|
|
});
|
|
function toArray(value) {
|
|
if (!value) {
|
|
return [];
|
|
}
|
|
if (isArrayLike(value)) {
|
|
return isString(value) ? stringToArray(value) : copyArray(value);
|
|
}
|
|
if (symIterator && value[symIterator]) {
|
|
return iteratorToArray(value[symIterator]());
|
|
}
|
|
var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values2;
|
|
return func(value);
|
|
}
|
|
function toFinite(value) {
|
|
if (!value) {
|
|
return value === 0 ? value : 0;
|
|
}
|
|
value = toNumber(value);
|
|
if (value === INFINITY || value === -INFINITY) {
|
|
var sign = value < 0 ? -1 : 1;
|
|
return sign * MAX_INTEGER;
|
|
}
|
|
return value === value ? value : 0;
|
|
}
|
|
function toInteger(value) {
|
|
var result2 = toFinite(value), remainder = result2 % 1;
|
|
return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
|
|
}
|
|
function toLength(value) {
|
|
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
|
|
}
|
|
function toNumber(value) {
|
|
if (typeof value == "number") {
|
|
return value;
|
|
}
|
|
if (isSymbol(value)) {
|
|
return NAN;
|
|
}
|
|
if (isObject(value)) {
|
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
value = isObject(other) ? other + "" : other;
|
|
}
|
|
if (typeof value != "string") {
|
|
return value === 0 ? value : +value;
|
|
}
|
|
value = baseTrim(value);
|
|
var isBinary = reIsBinary.test(value);
|
|
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
}
|
|
function toPlainObject(value) {
|
|
return copyObject(value, keysIn(value));
|
|
}
|
|
function toSafeInteger(value) {
|
|
return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
}
|
|
function toString(value) {
|
|
return value == null ? "" : baseToString(value);
|
|
}
|
|
var assign = createAssigner(function(object, source) {
|
|
if (isPrototype(source) || isArrayLike(source)) {
|
|
copyObject(source, keys(source), object);
|
|
return;
|
|
}
|
|
for (var key in source) {
|
|
if (hasOwnProperty.call(source, key)) {
|
|
assignValue(object, key, source[key]);
|
|
}
|
|
}
|
|
});
|
|
var assignIn = createAssigner(function(object, source) {
|
|
copyObject(source, keysIn(source), object);
|
|
});
|
|
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
copyObject(source, keysIn(source), object, customizer);
|
|
});
|
|
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
copyObject(source, keys(source), object, customizer);
|
|
});
|
|
var at = flatRest(baseAt);
|
|
function create(prototype, properties2) {
|
|
var result2 = baseCreate(prototype);
|
|
return properties2 == null ? result2 : baseAssign(result2, properties2);
|
|
}
|
|
var defaults = baseRest(function(object, sources) {
|
|
object = Object2(object);
|
|
var index = -1;
|
|
var length = sources.length;
|
|
var guard = length > 2 ? sources[2] : undefined2;
|
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
length = 1;
|
|
}
|
|
while (++index < length) {
|
|
var source = sources[index];
|
|
var props = keysIn(source);
|
|
var propsIndex = -1;
|
|
var propsLength = props.length;
|
|
while (++propsIndex < propsLength) {
|
|
var key = props[propsIndex];
|
|
var value = object[key];
|
|
if (value === undefined2 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
|
|
object[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return object;
|
|
});
|
|
var defaultsDeep = baseRest(function(args) {
|
|
args.push(undefined2, customDefaultsMerge);
|
|
return apply(mergeWith, undefined2, args);
|
|
});
|
|
function findKey(object, predicate) {
|
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
|
|
}
|
|
function findLastKey(object, predicate) {
|
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
|
|
}
|
|
function forIn(object, iteratee2) {
|
|
return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
|
|
}
|
|
function forInRight(object, iteratee2) {
|
|
return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
|
|
}
|
|
function forOwn(object, iteratee2) {
|
|
return object && baseForOwn(object, getIteratee(iteratee2, 3));
|
|
}
|
|
function forOwnRight(object, iteratee2) {
|
|
return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
|
|
}
|
|
function functions(object) {
|
|
return object == null ? [] : baseFunctions(object, keys(object));
|
|
}
|
|
function functionsIn(object) {
|
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
}
|
|
function get(object, path, defaultValue) {
|
|
var result2 = object == null ? undefined2 : baseGet(object, path);
|
|
return result2 === undefined2 ? defaultValue : result2;
|
|
}
|
|
function has(object, path) {
|
|
return object != null && hasPath(object, path, baseHas);
|
|
}
|
|
function hasIn(object, path) {
|
|
return object != null && hasPath(object, path, baseHasIn);
|
|
}
|
|
var invert = createInverter(function(result2, value, key) {
|
|
if (value != null && typeof value.toString != "function") {
|
|
value = nativeObjectToString.call(value);
|
|
}
|
|
result2[value] = key;
|
|
}, constant(identity));
|
|
var invertBy = createInverter(function(result2, value, key) {
|
|
if (value != null && typeof value.toString != "function") {
|
|
value = nativeObjectToString.call(value);
|
|
}
|
|
if (hasOwnProperty.call(result2, value)) {
|
|
result2[value].push(key);
|
|
} else {
|
|
result2[value] = [key];
|
|
}
|
|
}, getIteratee);
|
|
var invoke = baseRest(baseInvoke);
|
|
function keys(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
}
|
|
function keysIn(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
}
|
|
function mapKeys(object, iteratee2) {
|
|
var result2 = {};
|
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
baseForOwn(object, function(value, key, object2) {
|
|
baseAssignValue(result2, iteratee2(value, key, object2), value);
|
|
});
|
|
return result2;
|
|
}
|
|
function mapValues(object, iteratee2) {
|
|
var result2 = {};
|
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
baseForOwn(object, function(value, key, object2) {
|
|
baseAssignValue(result2, key, iteratee2(value, key, object2));
|
|
});
|
|
return result2;
|
|
}
|
|
var merge2 = createAssigner(function(object, source, srcIndex) {
|
|
baseMerge(object, source, srcIndex);
|
|
});
|
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
baseMerge(object, source, srcIndex, customizer);
|
|
});
|
|
var omit = flatRest(function(object, paths) {
|
|
var result2 = {};
|
|
if (object == null) {
|
|
return result2;
|
|
}
|
|
var isDeep = false;
|
|
paths = arrayMap(paths, function(path) {
|
|
path = castPath(path, object);
|
|
isDeep || (isDeep = path.length > 1);
|
|
return path;
|
|
});
|
|
copyObject(object, getAllKeysIn(object), result2);
|
|
if (isDeep) {
|
|
result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
}
|
|
var length = paths.length;
|
|
while (length--) {
|
|
baseUnset(result2, paths[length]);
|
|
}
|
|
return result2;
|
|
});
|
|
function omitBy(object, predicate) {
|
|
return pickBy(object, negate(getIteratee(predicate)));
|
|
}
|
|
var pick = flatRest(function(object, paths) {
|
|
return object == null ? {} : basePick(object, paths);
|
|
});
|
|
function pickBy(object, predicate) {
|
|
if (object == null) {
|
|
return {};
|
|
}
|
|
var props = arrayMap(getAllKeysIn(object), function(prop) {
|
|
return [prop];
|
|
});
|
|
predicate = getIteratee(predicate);
|
|
return basePickBy(object, props, function(value, path) {
|
|
return predicate(value, path[0]);
|
|
});
|
|
}
|
|
function result(object, path, defaultValue) {
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length;
|
|
if (!length) {
|
|
length = 1;
|
|
object = undefined2;
|
|
}
|
|
while (++index < length) {
|
|
var value = object == null ? undefined2 : object[toKey(path[index])];
|
|
if (value === undefined2) {
|
|
index = length;
|
|
value = defaultValue;
|
|
}
|
|
object = isFunction(value) ? value.call(object) : value;
|
|
}
|
|
return object;
|
|
}
|
|
function set(object, path, value) {
|
|
return object == null ? object : baseSet(object, path, value);
|
|
}
|
|
function setWith(object, path, value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return object == null ? object : baseSet(object, path, value, customizer);
|
|
}
|
|
var toPairs = createToPairs(keys);
|
|
var toPairsIn = createToPairs(keysIn);
|
|
function transform2(object, iteratee2, accumulator) {
|
|
var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
|
iteratee2 = getIteratee(iteratee2, 4);
|
|
if (accumulator == null) {
|
|
var Ctor = object && object.constructor;
|
|
if (isArrLike) {
|
|
accumulator = isArr ? new Ctor() : [];
|
|
} else if (isObject(object)) {
|
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
|
} else {
|
|
accumulator = {};
|
|
}
|
|
}
|
|
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
|
|
return iteratee2(accumulator, value, index, object2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function unset(object, path) {
|
|
return object == null ? true : baseUnset(object, path);
|
|
}
|
|
function update(object, path, updater) {
|
|
return object == null ? object : baseUpdate(object, path, castFunction(updater));
|
|
}
|
|
function updateWith(object, path, updater, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
|
|
}
|
|
function values2(object) {
|
|
return object == null ? [] : baseValues(object, keys(object));
|
|
}
|
|
function valuesIn(object) {
|
|
return object == null ? [] : baseValues(object, keysIn(object));
|
|
}
|
|
function clamp2(number, lower, upper) {
|
|
if (upper === undefined2) {
|
|
upper = lower;
|
|
lower = undefined2;
|
|
}
|
|
if (upper !== undefined2) {
|
|
upper = toNumber(upper);
|
|
upper = upper === upper ? upper : 0;
|
|
}
|
|
if (lower !== undefined2) {
|
|
lower = toNumber(lower);
|
|
lower = lower === lower ? lower : 0;
|
|
}
|
|
return baseClamp(toNumber(number), lower, upper);
|
|
}
|
|
function inRange(number, start, end) {
|
|
start = toFinite(start);
|
|
if (end === undefined2) {
|
|
end = start;
|
|
start = 0;
|
|
} else {
|
|
end = toFinite(end);
|
|
}
|
|
number = toNumber(number);
|
|
return baseInRange(number, start, end);
|
|
}
|
|
function random(lower, upper, floating) {
|
|
if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
|
|
upper = floating = undefined2;
|
|
}
|
|
if (floating === undefined2) {
|
|
if (typeof upper == "boolean") {
|
|
floating = upper;
|
|
upper = undefined2;
|
|
} else if (typeof lower == "boolean") {
|
|
floating = lower;
|
|
lower = undefined2;
|
|
}
|
|
}
|
|
if (lower === undefined2 && upper === undefined2) {
|
|
lower = 0;
|
|
upper = 1;
|
|
} else {
|
|
lower = toFinite(lower);
|
|
if (upper === undefined2) {
|
|
upper = lower;
|
|
lower = 0;
|
|
} else {
|
|
upper = toFinite(upper);
|
|
}
|
|
}
|
|
if (lower > upper) {
|
|
var temp = lower;
|
|
lower = upper;
|
|
upper = temp;
|
|
}
|
|
if (floating || lower % 1 || upper % 1) {
|
|
var rand = nativeRandom();
|
|
return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
|
|
}
|
|
return baseRandom(lower, upper);
|
|
}
|
|
var camelCase = createCompounder(function(result2, word, index) {
|
|
word = word.toLowerCase();
|
|
return result2 + (index ? capitalize2(word) : word);
|
|
});
|
|
function capitalize2(string) {
|
|
return upperFirst(toString(string).toLowerCase());
|
|
}
|
|
function deburr(string) {
|
|
string = toString(string);
|
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
}
|
|
function endsWith(string, target, position2) {
|
|
string = toString(string);
|
|
target = baseToString(target);
|
|
var length = string.length;
|
|
position2 = position2 === undefined2 ? length : baseClamp(toInteger(position2), 0, length);
|
|
var end = position2;
|
|
position2 -= target.length;
|
|
return position2 >= 0 && string.slice(position2, end) == target;
|
|
}
|
|
function escape(string) {
|
|
string = toString(string);
|
|
return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
|
|
}
|
|
function escapeRegExp(string) {
|
|
string = toString(string);
|
|
return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
|
|
}
|
|
var kebabCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? "-" : "") + word.toLowerCase();
|
|
});
|
|
var lowerCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + word.toLowerCase();
|
|
});
|
|
var lowerFirst = createCaseFirst("toLowerCase");
|
|
function pad(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
if (!length || strLength >= length) {
|
|
return string;
|
|
}
|
|
var mid = (length - strLength) / 2;
|
|
return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
|
|
}
|
|
function padEnd(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
|
|
}
|
|
function padStart(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
|
|
}
|
|
function parseInt2(string, radix, guard) {
|
|
if (guard || radix == null) {
|
|
radix = 0;
|
|
} else if (radix) {
|
|
radix = +radix;
|
|
}
|
|
return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
|
|
}
|
|
function repeat(string, n2, guard) {
|
|
if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined2) {
|
|
n2 = 1;
|
|
} else {
|
|
n2 = toInteger(n2);
|
|
}
|
|
return baseRepeat(toString(string), n2);
|
|
}
|
|
function replace() {
|
|
var args = arguments, string = toString(args[0]);
|
|
return args.length < 3 ? string : string.replace(args[1], args[2]);
|
|
}
|
|
var snakeCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? "_" : "") + word.toLowerCase();
|
|
});
|
|
function split(string, separator, limit) {
|
|
if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
|
|
separator = limit = undefined2;
|
|
}
|
|
limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0;
|
|
if (!limit) {
|
|
return [];
|
|
}
|
|
string = toString(string);
|
|
if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
|
|
separator = baseToString(separator);
|
|
if (!separator && hasUnicode(string)) {
|
|
return castSlice(stringToArray(string), 0, limit);
|
|
}
|
|
}
|
|
return string.split(separator, limit);
|
|
}
|
|
var startCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + upperFirst(word);
|
|
});
|
|
function startsWith(string, target, position2) {
|
|
string = toString(string);
|
|
position2 = position2 == null ? 0 : baseClamp(toInteger(position2), 0, string.length);
|
|
target = baseToString(target);
|
|
return string.slice(position2, position2 + target.length) == target;
|
|
}
|
|
function template(string, options, guard) {
|
|
var settings = lodash.templateSettings;
|
|
if (guard && isIterateeCall(string, options, guard)) {
|
|
options = undefined2;
|
|
}
|
|
string = toString(string);
|
|
options = assignInWith({}, options, settings, customDefaultsAssignIn);
|
|
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
|
|
var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
|
|
var reDelimiters = RegExp2(
|
|
(options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
|
|
"g"
|
|
);
|
|
var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
|
|
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
|
interpolateValue || (interpolateValue = esTemplateValue);
|
|
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
|
|
if (escapeValue) {
|
|
isEscaping = true;
|
|
source += "' +\n__e(" + escapeValue + ") +\n'";
|
|
}
|
|
if (evaluateValue) {
|
|
isEvaluating = true;
|
|
source += "';\n" + evaluateValue + ";\n__p += '";
|
|
}
|
|
if (interpolateValue) {
|
|
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
|
|
}
|
|
index = offset + match.length;
|
|
return match;
|
|
});
|
|
source += "';\n";
|
|
var variable = hasOwnProperty.call(options, "variable") && options.variable;
|
|
if (!variable) {
|
|
source = "with (obj) {\n" + source + "\n}\n";
|
|
} else if (reForbiddenIdentifierChars.test(variable)) {
|
|
throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
|
|
}
|
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
|
|
source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
|
|
var result2 = attempt(function() {
|
|
return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues);
|
|
});
|
|
result2.source = source;
|
|
if (isError2(result2)) {
|
|
throw result2;
|
|
}
|
|
return result2;
|
|
}
|
|
function toLower(value) {
|
|
return toString(value).toLowerCase();
|
|
}
|
|
function toUpper(value) {
|
|
return toString(value).toUpperCase();
|
|
}
|
|
function trim(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return baseTrim(string);
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
|
return castSlice(strSymbols, start, end).join("");
|
|
}
|
|
function trimEnd(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return string.slice(0, trimmedEndIndex(string) + 1);
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
|
|
return castSlice(strSymbols, 0, end).join("");
|
|
}
|
|
function trimStart(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return string.replace(reTrimStart, "");
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
|
|
return castSlice(strSymbols, start).join("");
|
|
}
|
|
function truncate(string, options) {
|
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
if (isObject(options)) {
|
|
var separator = "separator" in options ? options.separator : separator;
|
|
length = "length" in options ? toInteger(options.length) : length;
|
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
}
|
|
string = toString(string);
|
|
var strLength = string.length;
|
|
if (hasUnicode(string)) {
|
|
var strSymbols = stringToArray(string);
|
|
strLength = strSymbols.length;
|
|
}
|
|
if (length >= strLength) {
|
|
return string;
|
|
}
|
|
var end = length - stringSize(omission);
|
|
if (end < 1) {
|
|
return omission;
|
|
}
|
|
var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
|
|
if (separator === undefined2) {
|
|
return result2 + omission;
|
|
}
|
|
if (strSymbols) {
|
|
end += result2.length - end;
|
|
}
|
|
if (isRegExp(separator)) {
|
|
if (string.slice(end).search(separator)) {
|
|
var match, substring = result2;
|
|
if (!separator.global) {
|
|
separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
|
|
}
|
|
separator.lastIndex = 0;
|
|
while (match = separator.exec(substring)) {
|
|
var newEnd = match.index;
|
|
}
|
|
result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd);
|
|
}
|
|
} else if (string.indexOf(baseToString(separator), end) != end) {
|
|
var index = result2.lastIndexOf(separator);
|
|
if (index > -1) {
|
|
result2 = result2.slice(0, index);
|
|
}
|
|
}
|
|
return result2 + omission;
|
|
}
|
|
function unescape(string) {
|
|
string = toString(string);
|
|
return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
|
|
}
|
|
var upperCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + word.toUpperCase();
|
|
});
|
|
var upperFirst = createCaseFirst("toUpperCase");
|
|
function words(string, pattern, guard) {
|
|
string = toString(string);
|
|
pattern = guard ? undefined2 : pattern;
|
|
if (pattern === undefined2) {
|
|
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
}
|
|
return string.match(pattern) || [];
|
|
}
|
|
var attempt = baseRest(function(func, args) {
|
|
try {
|
|
return apply(func, undefined2, args);
|
|
} catch (e) {
|
|
return isError2(e) ? e : new Error2(e);
|
|
}
|
|
});
|
|
var bindAll = flatRest(function(object, methodNames) {
|
|
arrayEach(methodNames, function(key) {
|
|
key = toKey(key);
|
|
baseAssignValue(object, key, bind(object[key], object));
|
|
});
|
|
return object;
|
|
});
|
|
function cond(pairs) {
|
|
var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
|
|
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
|
if (typeof pair[1] != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return [toIteratee(pair[0]), pair[1]];
|
|
});
|
|
return baseRest(function(args) {
|
|
var index = -1;
|
|
while (++index < length) {
|
|
var pair = pairs[index];
|
|
if (apply(pair[0], this, args)) {
|
|
return apply(pair[1], this, args);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function conforms(source) {
|
|
return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
|
|
}
|
|
function constant(value) {
|
|
return function() {
|
|
return value;
|
|
};
|
|
}
|
|
function defaultTo(value, defaultValue) {
|
|
return value == null || value !== value ? defaultValue : value;
|
|
}
|
|
var flow = createFlow();
|
|
var flowRight = createFlow(true);
|
|
function identity(value) {
|
|
return value;
|
|
}
|
|
function iteratee(func) {
|
|
return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
|
|
}
|
|
function matches(source) {
|
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
|
}
|
|
function matchesProperty(path, srcValue) {
|
|
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
}
|
|
var method = baseRest(function(path, args) {
|
|
return function(object) {
|
|
return baseInvoke(object, path, args);
|
|
};
|
|
});
|
|
var methodOf = baseRest(function(object, args) {
|
|
return function(path) {
|
|
return baseInvoke(object, path, args);
|
|
};
|
|
});
|
|
function mixin(object, source, options) {
|
|
var props = keys(source), methodNames = baseFunctions(source, props);
|
|
if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
|
|
options = source;
|
|
source = object;
|
|
object = this;
|
|
methodNames = baseFunctions(source, keys(source));
|
|
}
|
|
var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
|
|
arrayEach(methodNames, function(methodName) {
|
|
var func = source[methodName];
|
|
object[methodName] = func;
|
|
if (isFunc) {
|
|
object.prototype[methodName] = function() {
|
|
var chainAll = this.__chain__;
|
|
if (chain2 || chainAll) {
|
|
var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
|
|
actions.push({ "func": func, "args": arguments, "thisArg": object });
|
|
result2.__chain__ = chainAll;
|
|
return result2;
|
|
}
|
|
return func.apply(object, arrayPush([this.value()], arguments));
|
|
};
|
|
}
|
|
});
|
|
return object;
|
|
}
|
|
function noConflict() {
|
|
if (root._ === this) {
|
|
root._ = oldDash;
|
|
}
|
|
return this;
|
|
}
|
|
function noop() {
|
|
}
|
|
function nthArg(n2) {
|
|
n2 = toInteger(n2);
|
|
return baseRest(function(args) {
|
|
return baseNth(args, n2);
|
|
});
|
|
}
|
|
var over = createOver(arrayMap);
|
|
var overEvery = createOver(arrayEvery);
|
|
var overSome = createOver(arraySome);
|
|
function property(path) {
|
|
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
}
|
|
function propertyOf(object) {
|
|
return function(path) {
|
|
return object == null ? undefined2 : baseGet(object, path);
|
|
};
|
|
}
|
|
var range = createRange();
|
|
var rangeRight = createRange(true);
|
|
function stubArray() {
|
|
return [];
|
|
}
|
|
function stubFalse() {
|
|
return false;
|
|
}
|
|
function stubObject() {
|
|
return {};
|
|
}
|
|
function stubString() {
|
|
return "";
|
|
}
|
|
function stubTrue() {
|
|
return true;
|
|
}
|
|
function times(n2, iteratee2) {
|
|
n2 = toInteger(n2);
|
|
if (n2 < 1 || n2 > MAX_SAFE_INTEGER) {
|
|
return [];
|
|
}
|
|
var index = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH);
|
|
iteratee2 = getIteratee(iteratee2);
|
|
n2 -= MAX_ARRAY_LENGTH;
|
|
var result2 = baseTimes(length, iteratee2);
|
|
while (++index < n2) {
|
|
iteratee2(index);
|
|
}
|
|
return result2;
|
|
}
|
|
function toPath(value) {
|
|
if (isArray(value)) {
|
|
return arrayMap(value, toKey);
|
|
}
|
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
}
|
|
function uniqueId(prefix2) {
|
|
var id = ++idCounter;
|
|
return toString(prefix2) + id;
|
|
}
|
|
var add = createMathOperation(function(augend, addend) {
|
|
return augend + addend;
|
|
}, 0);
|
|
var ceil = createRound("ceil");
|
|
var divide = createMathOperation(function(dividend, divisor) {
|
|
return dividend / divisor;
|
|
}, 1);
|
|
var floor = createRound("floor");
|
|
function max(array) {
|
|
return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2;
|
|
}
|
|
function maxBy(array, iteratee2) {
|
|
return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2;
|
|
}
|
|
function mean(array) {
|
|
return baseMean(array, identity);
|
|
}
|
|
function meanBy(array, iteratee2) {
|
|
return baseMean(array, getIteratee(iteratee2, 2));
|
|
}
|
|
function min(array) {
|
|
return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2;
|
|
}
|
|
function minBy(array, iteratee2) {
|
|
return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2;
|
|
}
|
|
var multiply = createMathOperation(function(multiplier, multiplicand) {
|
|
return multiplier * multiplicand;
|
|
}, 1);
|
|
var round2 = createRound("round");
|
|
var subtract = createMathOperation(function(minuend, subtrahend) {
|
|
return minuend - subtrahend;
|
|
}, 0);
|
|
function sum(array) {
|
|
return array && array.length ? baseSum(array, identity) : 0;
|
|
}
|
|
function sumBy(array, iteratee2) {
|
|
return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
|
|
}
|
|
lodash.after = after;
|
|
lodash.ary = ary;
|
|
lodash.assign = assign;
|
|
lodash.assignIn = assignIn;
|
|
lodash.assignInWith = assignInWith;
|
|
lodash.assignWith = assignWith;
|
|
lodash.at = at;
|
|
lodash.before = before;
|
|
lodash.bind = bind;
|
|
lodash.bindAll = bindAll;
|
|
lodash.bindKey = bindKey;
|
|
lodash.castArray = castArray;
|
|
lodash.chain = chain;
|
|
lodash.chunk = chunk;
|
|
lodash.compact = compact;
|
|
lodash.concat = concat;
|
|
lodash.cond = cond;
|
|
lodash.conforms = conforms;
|
|
lodash.constant = constant;
|
|
lodash.countBy = countBy;
|
|
lodash.create = create;
|
|
lodash.curry = curry;
|
|
lodash.curryRight = curryRight;
|
|
lodash.debounce = debounce;
|
|
lodash.defaults = defaults;
|
|
lodash.defaultsDeep = defaultsDeep;
|
|
lodash.defer = defer;
|
|
lodash.delay = delay;
|
|
lodash.difference = difference;
|
|
lodash.differenceBy = differenceBy;
|
|
lodash.differenceWith = differenceWith;
|
|
lodash.drop = drop;
|
|
lodash.dropRight = dropRight;
|
|
lodash.dropRightWhile = dropRightWhile;
|
|
lodash.dropWhile = dropWhile;
|
|
lodash.fill = fill;
|
|
lodash.filter = filter;
|
|
lodash.flatMap = flatMap;
|
|
lodash.flatMapDeep = flatMapDeep;
|
|
lodash.flatMapDepth = flatMapDepth;
|
|
lodash.flatten = flatten;
|
|
lodash.flattenDeep = flattenDeep;
|
|
lodash.flattenDepth = flattenDepth;
|
|
lodash.flip = flip;
|
|
lodash.flow = flow;
|
|
lodash.flowRight = flowRight;
|
|
lodash.fromPairs = fromPairs;
|
|
lodash.functions = functions;
|
|
lodash.functionsIn = functionsIn;
|
|
lodash.groupBy = groupBy;
|
|
lodash.initial = initial;
|
|
lodash.intersection = intersection;
|
|
lodash.intersectionBy = intersectionBy;
|
|
lodash.intersectionWith = intersectionWith;
|
|
lodash.invert = invert;
|
|
lodash.invertBy = invertBy;
|
|
lodash.invokeMap = invokeMap;
|
|
lodash.iteratee = iteratee;
|
|
lodash.keyBy = keyBy;
|
|
lodash.keys = keys;
|
|
lodash.keysIn = keysIn;
|
|
lodash.map = map;
|
|
lodash.mapKeys = mapKeys;
|
|
lodash.mapValues = mapValues;
|
|
lodash.matches = matches;
|
|
lodash.matchesProperty = matchesProperty;
|
|
lodash.memoize = memoize2;
|
|
lodash.merge = merge2;
|
|
lodash.mergeWith = mergeWith;
|
|
lodash.method = method;
|
|
lodash.methodOf = methodOf;
|
|
lodash.mixin = mixin;
|
|
lodash.negate = negate;
|
|
lodash.nthArg = nthArg;
|
|
lodash.omit = omit;
|
|
lodash.omitBy = omitBy;
|
|
lodash.once = once;
|
|
lodash.orderBy = orderBy;
|
|
lodash.over = over;
|
|
lodash.overArgs = overArgs;
|
|
lodash.overEvery = overEvery;
|
|
lodash.overSome = overSome;
|
|
lodash.partial = partial;
|
|
lodash.partialRight = partialRight;
|
|
lodash.partition = partition;
|
|
lodash.pick = pick;
|
|
lodash.pickBy = pickBy;
|
|
lodash.property = property;
|
|
lodash.propertyOf = propertyOf;
|
|
lodash.pull = pull;
|
|
lodash.pullAll = pullAll;
|
|
lodash.pullAllBy = pullAllBy;
|
|
lodash.pullAllWith = pullAllWith;
|
|
lodash.pullAt = pullAt;
|
|
lodash.range = range;
|
|
lodash.rangeRight = rangeRight;
|
|
lodash.rearg = rearg;
|
|
lodash.reject = reject;
|
|
lodash.remove = remove;
|
|
lodash.rest = rest;
|
|
lodash.reverse = reverse;
|
|
lodash.sampleSize = sampleSize;
|
|
lodash.set = set;
|
|
lodash.setWith = setWith;
|
|
lodash.shuffle = shuffle;
|
|
lodash.slice = slice;
|
|
lodash.sortBy = sortBy;
|
|
lodash.sortedUniq = sortedUniq;
|
|
lodash.sortedUniqBy = sortedUniqBy;
|
|
lodash.split = split;
|
|
lodash.spread = spread;
|
|
lodash.tail = tail;
|
|
lodash.take = take;
|
|
lodash.takeRight = takeRight;
|
|
lodash.takeRightWhile = takeRightWhile;
|
|
lodash.takeWhile = takeWhile;
|
|
lodash.tap = tap;
|
|
lodash.throttle = throttle;
|
|
lodash.thru = thru;
|
|
lodash.toArray = toArray;
|
|
lodash.toPairs = toPairs;
|
|
lodash.toPairsIn = toPairsIn;
|
|
lodash.toPath = toPath;
|
|
lodash.toPlainObject = toPlainObject;
|
|
lodash.transform = transform2;
|
|
lodash.unary = unary;
|
|
lodash.union = union;
|
|
lodash.unionBy = unionBy;
|
|
lodash.unionWith = unionWith;
|
|
lodash.uniq = uniq;
|
|
lodash.uniqBy = uniqBy;
|
|
lodash.uniqWith = uniqWith;
|
|
lodash.unset = unset;
|
|
lodash.unzip = unzip;
|
|
lodash.unzipWith = unzipWith;
|
|
lodash.update = update;
|
|
lodash.updateWith = updateWith;
|
|
lodash.values = values2;
|
|
lodash.valuesIn = valuesIn;
|
|
lodash.without = without;
|
|
lodash.words = words;
|
|
lodash.wrap = wrap;
|
|
lodash.xor = xor;
|
|
lodash.xorBy = xorBy;
|
|
lodash.xorWith = xorWith;
|
|
lodash.zip = zip;
|
|
lodash.zipObject = zipObject;
|
|
lodash.zipObjectDeep = zipObjectDeep;
|
|
lodash.zipWith = zipWith;
|
|
lodash.entries = toPairs;
|
|
lodash.entriesIn = toPairsIn;
|
|
lodash.extend = assignIn;
|
|
lodash.extendWith = assignInWith;
|
|
mixin(lodash, lodash);
|
|
lodash.add = add;
|
|
lodash.attempt = attempt;
|
|
lodash.camelCase = camelCase;
|
|
lodash.capitalize = capitalize2;
|
|
lodash.ceil = ceil;
|
|
lodash.clamp = clamp2;
|
|
lodash.clone = clone;
|
|
lodash.cloneDeep = cloneDeep;
|
|
lodash.cloneDeepWith = cloneDeepWith;
|
|
lodash.cloneWith = cloneWith;
|
|
lodash.conformsTo = conformsTo;
|
|
lodash.deburr = deburr;
|
|
lodash.defaultTo = defaultTo;
|
|
lodash.divide = divide;
|
|
lodash.endsWith = endsWith;
|
|
lodash.eq = eq;
|
|
lodash.escape = escape;
|
|
lodash.escapeRegExp = escapeRegExp;
|
|
lodash.every = every;
|
|
lodash.find = find;
|
|
lodash.findIndex = findIndex;
|
|
lodash.findKey = findKey;
|
|
lodash.findLast = findLast;
|
|
lodash.findLastIndex = findLastIndex;
|
|
lodash.findLastKey = findLastKey;
|
|
lodash.floor = floor;
|
|
lodash.forEach = forEach;
|
|
lodash.forEachRight = forEachRight;
|
|
lodash.forIn = forIn;
|
|
lodash.forInRight = forInRight;
|
|
lodash.forOwn = forOwn;
|
|
lodash.forOwnRight = forOwnRight;
|
|
lodash.get = get;
|
|
lodash.gt = gt;
|
|
lodash.gte = gte;
|
|
lodash.has = has;
|
|
lodash.hasIn = hasIn;
|
|
lodash.head = head;
|
|
lodash.identity = identity;
|
|
lodash.includes = includes;
|
|
lodash.indexOf = indexOf;
|
|
lodash.inRange = inRange;
|
|
lodash.invoke = invoke;
|
|
lodash.isArguments = isArguments;
|
|
lodash.isArray = isArray;
|
|
lodash.isArrayBuffer = isArrayBuffer;
|
|
lodash.isArrayLike = isArrayLike;
|
|
lodash.isArrayLikeObject = isArrayLikeObject;
|
|
lodash.isBoolean = isBoolean2;
|
|
lodash.isBuffer = isBuffer;
|
|
lodash.isDate = isDate3;
|
|
lodash.isElement = isElement;
|
|
lodash.isEmpty = isEmpty3;
|
|
lodash.isEqual = isEqual;
|
|
lodash.isEqualWith = isEqualWith;
|
|
lodash.isError = isError2;
|
|
lodash.isFinite = isFinite2;
|
|
lodash.isFunction = isFunction;
|
|
lodash.isInteger = isInteger;
|
|
lodash.isLength = isLength;
|
|
lodash.isMap = isMap;
|
|
lodash.isMatch = isMatch2;
|
|
lodash.isMatchWith = isMatchWith;
|
|
lodash.isNaN = isNaN2;
|
|
lodash.isNative = isNative;
|
|
lodash.isNil = isNil;
|
|
lodash.isNull = isNull;
|
|
lodash.isNumber = isNumber2;
|
|
lodash.isObject = isObject;
|
|
lodash.isObjectLike = isObjectLike;
|
|
lodash.isPlainObject = isPlainObject5;
|
|
lodash.isRegExp = isRegExp;
|
|
lodash.isSafeInteger = isSafeInteger;
|
|
lodash.isSet = isSet;
|
|
lodash.isString = isString;
|
|
lodash.isSymbol = isSymbol;
|
|
lodash.isTypedArray = isTypedArray;
|
|
lodash.isUndefined = isUndefined;
|
|
lodash.isWeakMap = isWeakMap;
|
|
lodash.isWeakSet = isWeakSet;
|
|
lodash.join = join;
|
|
lodash.kebabCase = kebabCase;
|
|
lodash.last = last;
|
|
lodash.lastIndexOf = lastIndexOf;
|
|
lodash.lowerCase = lowerCase;
|
|
lodash.lowerFirst = lowerFirst;
|
|
lodash.lt = lt;
|
|
lodash.lte = lte;
|
|
lodash.max = max;
|
|
lodash.maxBy = maxBy;
|
|
lodash.mean = mean;
|
|
lodash.meanBy = meanBy;
|
|
lodash.min = min;
|
|
lodash.minBy = minBy;
|
|
lodash.stubArray = stubArray;
|
|
lodash.stubFalse = stubFalse;
|
|
lodash.stubObject = stubObject;
|
|
lodash.stubString = stubString;
|
|
lodash.stubTrue = stubTrue;
|
|
lodash.multiply = multiply;
|
|
lodash.nth = nth;
|
|
lodash.noConflict = noConflict;
|
|
lodash.noop = noop;
|
|
lodash.now = now;
|
|
lodash.pad = pad;
|
|
lodash.padEnd = padEnd;
|
|
lodash.padStart = padStart;
|
|
lodash.parseInt = parseInt2;
|
|
lodash.random = random;
|
|
lodash.reduce = reduce;
|
|
lodash.reduceRight = reduceRight;
|
|
lodash.repeat = repeat;
|
|
lodash.replace = replace;
|
|
lodash.result = result;
|
|
lodash.round = round2;
|
|
lodash.runInContext = runInContext2;
|
|
lodash.sample = sample;
|
|
lodash.size = size;
|
|
lodash.snakeCase = snakeCase;
|
|
lodash.some = some;
|
|
lodash.sortedIndex = sortedIndex;
|
|
lodash.sortedIndexBy = sortedIndexBy;
|
|
lodash.sortedIndexOf = sortedIndexOf;
|
|
lodash.sortedLastIndex = sortedLastIndex;
|
|
lodash.sortedLastIndexBy = sortedLastIndexBy;
|
|
lodash.sortedLastIndexOf = sortedLastIndexOf;
|
|
lodash.startCase = startCase;
|
|
lodash.startsWith = startsWith;
|
|
lodash.subtract = subtract;
|
|
lodash.sum = sum;
|
|
lodash.sumBy = sumBy;
|
|
lodash.template = template;
|
|
lodash.times = times;
|
|
lodash.toFinite = toFinite;
|
|
lodash.toInteger = toInteger;
|
|
lodash.toLength = toLength;
|
|
lodash.toLower = toLower;
|
|
lodash.toNumber = toNumber;
|
|
lodash.toSafeInteger = toSafeInteger;
|
|
lodash.toString = toString;
|
|
lodash.toUpper = toUpper;
|
|
lodash.trim = trim;
|
|
lodash.trimEnd = trimEnd;
|
|
lodash.trimStart = trimStart;
|
|
lodash.truncate = truncate;
|
|
lodash.unescape = unescape;
|
|
lodash.uniqueId = uniqueId;
|
|
lodash.upperCase = upperCase;
|
|
lodash.upperFirst = upperFirst;
|
|
lodash.each = forEach;
|
|
lodash.eachRight = forEachRight;
|
|
lodash.first = head;
|
|
mixin(lodash, function() {
|
|
var source = {};
|
|
baseForOwn(lodash, function(func, methodName) {
|
|
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
|
|
source[methodName] = func;
|
|
}
|
|
});
|
|
return source;
|
|
}(), { "chain": false });
|
|
lodash.VERSION = VERSION;
|
|
arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
|
|
lodash[methodName].placeholder = lodash;
|
|
});
|
|
arrayEach(["drop", "take"], function(methodName, index) {
|
|
LazyWrapper.prototype[methodName] = function(n2) {
|
|
n2 = n2 === undefined2 ? 1 : nativeMax(toInteger(n2), 0);
|
|
var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
|
|
if (result2.__filtered__) {
|
|
result2.__takeCount__ = nativeMin(n2, result2.__takeCount__);
|
|
} else {
|
|
result2.__views__.push({
|
|
"size": nativeMin(n2, MAX_ARRAY_LENGTH),
|
|
"type": methodName + (result2.__dir__ < 0 ? "Right" : "")
|
|
});
|
|
}
|
|
return result2;
|
|
};
|
|
LazyWrapper.prototype[methodName + "Right"] = function(n2) {
|
|
return this.reverse()[methodName](n2).reverse();
|
|
};
|
|
});
|
|
arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
|
|
var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
|
|
LazyWrapper.prototype[methodName] = function(iteratee2) {
|
|
var result2 = this.clone();
|
|
result2.__iteratees__.push({
|
|
"iteratee": getIteratee(iteratee2, 3),
|
|
"type": type
|
|
});
|
|
result2.__filtered__ = result2.__filtered__ || isFilter;
|
|
return result2;
|
|
};
|
|
});
|
|
arrayEach(["head", "last"], function(methodName, index) {
|
|
var takeName = "take" + (index ? "Right" : "");
|
|
LazyWrapper.prototype[methodName] = function() {
|
|
return this[takeName](1).value()[0];
|
|
};
|
|
});
|
|
arrayEach(["initial", "tail"], function(methodName, index) {
|
|
var dropName = "drop" + (index ? "" : "Right");
|
|
LazyWrapper.prototype[methodName] = function() {
|
|
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
|
|
};
|
|
});
|
|
LazyWrapper.prototype.compact = function() {
|
|
return this.filter(identity);
|
|
};
|
|
LazyWrapper.prototype.find = function(predicate) {
|
|
return this.filter(predicate).head();
|
|
};
|
|
LazyWrapper.prototype.findLast = function(predicate) {
|
|
return this.reverse().find(predicate);
|
|
};
|
|
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
|
|
if (typeof path == "function") {
|
|
return new LazyWrapper(this);
|
|
}
|
|
return this.map(function(value) {
|
|
return baseInvoke(value, path, args);
|
|
});
|
|
});
|
|
LazyWrapper.prototype.reject = function(predicate) {
|
|
return this.filter(negate(getIteratee(predicate)));
|
|
};
|
|
LazyWrapper.prototype.slice = function(start, end) {
|
|
start = toInteger(start);
|
|
var result2 = this;
|
|
if (result2.__filtered__ && (start > 0 || end < 0)) {
|
|
return new LazyWrapper(result2);
|
|
}
|
|
if (start < 0) {
|
|
result2 = result2.takeRight(-start);
|
|
} else if (start) {
|
|
result2 = result2.drop(start);
|
|
}
|
|
if (end !== undefined2) {
|
|
end = toInteger(end);
|
|
result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
|
|
}
|
|
return result2;
|
|
};
|
|
LazyWrapper.prototype.takeRightWhile = function(predicate) {
|
|
return this.reverse().takeWhile(predicate).reverse();
|
|
};
|
|
LazyWrapper.prototype.toArray = function() {
|
|
return this.take(MAX_ARRAY_LENGTH);
|
|
};
|
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
|
|
if (!lodashFunc) {
|
|
return;
|
|
}
|
|
lodash.prototype[methodName] = function() {
|
|
var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
|
|
var interceptor = function(value2) {
|
|
var result3 = lodashFunc.apply(lodash, arrayPush([value2], args));
|
|
return isTaker && chainAll ? result3[0] : result3;
|
|
};
|
|
if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
|
|
isLazy = useLazy = false;
|
|
}
|
|
var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
|
|
if (!retUnwrapped && useLazy) {
|
|
value = onlyLazy ? value : new LazyWrapper(this);
|
|
var result2 = func.apply(value, args);
|
|
result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 });
|
|
return new LodashWrapper(result2, chainAll);
|
|
}
|
|
if (isUnwrapped && onlyLazy) {
|
|
return func.apply(this, args);
|
|
}
|
|
result2 = this.thru(interceptor);
|
|
return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
|
|
};
|
|
});
|
|
arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
|
|
var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
lodash.prototype[methodName] = function() {
|
|
var args = arguments;
|
|
if (retUnwrapped && !this.__chain__) {
|
|
var value = this.value();
|
|
return func.apply(isArray(value) ? value : [], args);
|
|
}
|
|
return this[chainName](function(value2) {
|
|
return func.apply(isArray(value2) ? value2 : [], args);
|
|
});
|
|
};
|
|
});
|
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
var lodashFunc = lodash[methodName];
|
|
if (lodashFunc) {
|
|
var key = lodashFunc.name + "";
|
|
if (!hasOwnProperty.call(realNames, key)) {
|
|
realNames[key] = [];
|
|
}
|
|
realNames[key].push({ "name": methodName, "func": lodashFunc });
|
|
}
|
|
});
|
|
realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{
|
|
"name": "wrapper",
|
|
"func": undefined2
|
|
}];
|
|
LazyWrapper.prototype.clone = lazyClone;
|
|
LazyWrapper.prototype.reverse = lazyReverse;
|
|
LazyWrapper.prototype.value = lazyValue;
|
|
lodash.prototype.at = wrapperAt;
|
|
lodash.prototype.chain = wrapperChain;
|
|
lodash.prototype.commit = wrapperCommit;
|
|
lodash.prototype.next = wrapperNext;
|
|
lodash.prototype.plant = wrapperPlant;
|
|
lodash.prototype.reverse = wrapperReverse;
|
|
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
|
|
lodash.prototype.first = lodash.prototype.head;
|
|
if (symIterator) {
|
|
lodash.prototype[symIterator] = wrapperToIterator;
|
|
}
|
|
return lodash;
|
|
};
|
|
var _3 = runInContext();
|
|
if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
|
|
root._ = _3;
|
|
define(function() {
|
|
return _3;
|
|
});
|
|
} else if (freeModule) {
|
|
(freeModule.exports = _3)._ = _3;
|
|
freeExports._ = _3;
|
|
} else {
|
|
root._ = _3;
|
|
}
|
|
}).call(exports);
|
|
}
|
|
});
|
|
|
|
// node_modules/react-property/lib/possibleStandardNamesOptimized.js
|
|
var require_possibleStandardNamesOptimized = __commonJS({
|
|
"node_modules/react-property/lib/possibleStandardNamesOptimized.js"(exports) {
|
|
var SAME = 0;
|
|
exports.SAME = SAME;
|
|
var CAMELCASE = 1;
|
|
exports.CAMELCASE = CAMELCASE;
|
|
exports.possibleStandardNames = {
|
|
accept: 0,
|
|
acceptCharset: 1,
|
|
"accept-charset": "acceptCharset",
|
|
accessKey: 1,
|
|
action: 0,
|
|
allowFullScreen: 1,
|
|
alt: 0,
|
|
as: 0,
|
|
async: 0,
|
|
autoCapitalize: 1,
|
|
autoComplete: 1,
|
|
autoCorrect: 1,
|
|
autoFocus: 1,
|
|
autoPlay: 1,
|
|
autoSave: 1,
|
|
capture: 0,
|
|
cellPadding: 1,
|
|
cellSpacing: 1,
|
|
challenge: 0,
|
|
charSet: 1,
|
|
checked: 0,
|
|
children: 0,
|
|
cite: 0,
|
|
class: "className",
|
|
classID: 1,
|
|
className: 1,
|
|
cols: 0,
|
|
colSpan: 1,
|
|
content: 0,
|
|
contentEditable: 1,
|
|
contextMenu: 1,
|
|
controls: 0,
|
|
controlsList: 1,
|
|
coords: 0,
|
|
crossOrigin: 1,
|
|
dangerouslySetInnerHTML: 1,
|
|
data: 0,
|
|
dateTime: 1,
|
|
default: 0,
|
|
defaultChecked: 1,
|
|
defaultValue: 1,
|
|
defer: 0,
|
|
dir: 0,
|
|
disabled: 0,
|
|
disablePictureInPicture: 1,
|
|
disableRemotePlayback: 1,
|
|
download: 0,
|
|
draggable: 0,
|
|
encType: 1,
|
|
enterKeyHint: 1,
|
|
for: "htmlFor",
|
|
form: 0,
|
|
formMethod: 1,
|
|
formAction: 1,
|
|
formEncType: 1,
|
|
formNoValidate: 1,
|
|
formTarget: 1,
|
|
frameBorder: 1,
|
|
headers: 0,
|
|
height: 0,
|
|
hidden: 0,
|
|
high: 0,
|
|
href: 0,
|
|
hrefLang: 1,
|
|
htmlFor: 1,
|
|
httpEquiv: 1,
|
|
"http-equiv": "httpEquiv",
|
|
icon: 0,
|
|
id: 0,
|
|
innerHTML: 1,
|
|
inputMode: 1,
|
|
integrity: 0,
|
|
is: 0,
|
|
itemID: 1,
|
|
itemProp: 1,
|
|
itemRef: 1,
|
|
itemScope: 1,
|
|
itemType: 1,
|
|
keyParams: 1,
|
|
keyType: 1,
|
|
kind: 0,
|
|
label: 0,
|
|
lang: 0,
|
|
list: 0,
|
|
loop: 0,
|
|
low: 0,
|
|
manifest: 0,
|
|
marginWidth: 1,
|
|
marginHeight: 1,
|
|
max: 0,
|
|
maxLength: 1,
|
|
media: 0,
|
|
mediaGroup: 1,
|
|
method: 0,
|
|
min: 0,
|
|
minLength: 1,
|
|
multiple: 0,
|
|
muted: 0,
|
|
name: 0,
|
|
noModule: 1,
|
|
nonce: 0,
|
|
noValidate: 1,
|
|
open: 0,
|
|
optimum: 0,
|
|
pattern: 0,
|
|
placeholder: 0,
|
|
playsInline: 1,
|
|
poster: 0,
|
|
preload: 0,
|
|
profile: 0,
|
|
radioGroup: 1,
|
|
readOnly: 1,
|
|
referrerPolicy: 1,
|
|
rel: 0,
|
|
required: 0,
|
|
reversed: 0,
|
|
role: 0,
|
|
rows: 0,
|
|
rowSpan: 1,
|
|
sandbox: 0,
|
|
scope: 0,
|
|
scoped: 0,
|
|
scrolling: 0,
|
|
seamless: 0,
|
|
selected: 0,
|
|
shape: 0,
|
|
size: 0,
|
|
sizes: 0,
|
|
span: 0,
|
|
spellCheck: 1,
|
|
src: 0,
|
|
srcDoc: 1,
|
|
srcLang: 1,
|
|
srcSet: 1,
|
|
start: 0,
|
|
step: 0,
|
|
style: 0,
|
|
summary: 0,
|
|
tabIndex: 1,
|
|
target: 0,
|
|
title: 0,
|
|
type: 0,
|
|
useMap: 1,
|
|
value: 0,
|
|
width: 0,
|
|
wmode: 0,
|
|
wrap: 0,
|
|
about: 0,
|
|
accentHeight: 1,
|
|
"accent-height": "accentHeight",
|
|
accumulate: 0,
|
|
additive: 0,
|
|
alignmentBaseline: 1,
|
|
"alignment-baseline": "alignmentBaseline",
|
|
allowReorder: 1,
|
|
alphabetic: 0,
|
|
amplitude: 0,
|
|
arabicForm: 1,
|
|
"arabic-form": "arabicForm",
|
|
ascent: 0,
|
|
attributeName: 1,
|
|
attributeType: 1,
|
|
autoReverse: 1,
|
|
azimuth: 0,
|
|
baseFrequency: 1,
|
|
baselineShift: 1,
|
|
"baseline-shift": "baselineShift",
|
|
baseProfile: 1,
|
|
bbox: 0,
|
|
begin: 0,
|
|
bias: 0,
|
|
by: 0,
|
|
calcMode: 1,
|
|
capHeight: 1,
|
|
"cap-height": "capHeight",
|
|
clip: 0,
|
|
clipPath: 1,
|
|
"clip-path": "clipPath",
|
|
clipPathUnits: 1,
|
|
clipRule: 1,
|
|
"clip-rule": "clipRule",
|
|
color: 0,
|
|
colorInterpolation: 1,
|
|
"color-interpolation": "colorInterpolation",
|
|
colorInterpolationFilters: 1,
|
|
"color-interpolation-filters": "colorInterpolationFilters",
|
|
colorProfile: 1,
|
|
"color-profile": "colorProfile",
|
|
colorRendering: 1,
|
|
"color-rendering": "colorRendering",
|
|
contentScriptType: 1,
|
|
contentStyleType: 1,
|
|
cursor: 0,
|
|
cx: 0,
|
|
cy: 0,
|
|
d: 0,
|
|
datatype: 0,
|
|
decelerate: 0,
|
|
descent: 0,
|
|
diffuseConstant: 1,
|
|
direction: 0,
|
|
display: 0,
|
|
divisor: 0,
|
|
dominantBaseline: 1,
|
|
"dominant-baseline": "dominantBaseline",
|
|
dur: 0,
|
|
dx: 0,
|
|
dy: 0,
|
|
edgeMode: 1,
|
|
elevation: 0,
|
|
enableBackground: 1,
|
|
"enable-background": "enableBackground",
|
|
end: 0,
|
|
exponent: 0,
|
|
externalResourcesRequired: 1,
|
|
fill: 0,
|
|
fillOpacity: 1,
|
|
"fill-opacity": "fillOpacity",
|
|
fillRule: 1,
|
|
"fill-rule": "fillRule",
|
|
filter: 0,
|
|
filterRes: 1,
|
|
filterUnits: 1,
|
|
floodOpacity: 1,
|
|
"flood-opacity": "floodOpacity",
|
|
floodColor: 1,
|
|
"flood-color": "floodColor",
|
|
focusable: 0,
|
|
fontFamily: 1,
|
|
"font-family": "fontFamily",
|
|
fontSize: 1,
|
|
"font-size": "fontSize",
|
|
fontSizeAdjust: 1,
|
|
"font-size-adjust": "fontSizeAdjust",
|
|
fontStretch: 1,
|
|
"font-stretch": "fontStretch",
|
|
fontStyle: 1,
|
|
"font-style": "fontStyle",
|
|
fontVariant: 1,
|
|
"font-variant": "fontVariant",
|
|
fontWeight: 1,
|
|
"font-weight": "fontWeight",
|
|
format: 0,
|
|
from: 0,
|
|
fx: 0,
|
|
fy: 0,
|
|
g1: 0,
|
|
g2: 0,
|
|
glyphName: 1,
|
|
"glyph-name": "glyphName",
|
|
glyphOrientationHorizontal: 1,
|
|
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
glyphOrientationVertical: 1,
|
|
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
glyphRef: 1,
|
|
gradientTransform: 1,
|
|
gradientUnits: 1,
|
|
hanging: 0,
|
|
horizAdvX: 1,
|
|
"horiz-adv-x": "horizAdvX",
|
|
horizOriginX: 1,
|
|
"horiz-origin-x": "horizOriginX",
|
|
ideographic: 0,
|
|
imageRendering: 1,
|
|
"image-rendering": "imageRendering",
|
|
in2: 0,
|
|
in: 0,
|
|
inlist: 0,
|
|
intercept: 0,
|
|
k1: 0,
|
|
k2: 0,
|
|
k3: 0,
|
|
k4: 0,
|
|
k: 0,
|
|
kernelMatrix: 1,
|
|
kernelUnitLength: 1,
|
|
kerning: 0,
|
|
keyPoints: 1,
|
|
keySplines: 1,
|
|
keyTimes: 1,
|
|
lengthAdjust: 1,
|
|
letterSpacing: 1,
|
|
"letter-spacing": "letterSpacing",
|
|
lightingColor: 1,
|
|
"lighting-color": "lightingColor",
|
|
limitingConeAngle: 1,
|
|
local: 0,
|
|
markerEnd: 1,
|
|
"marker-end": "markerEnd",
|
|
markerHeight: 1,
|
|
markerMid: 1,
|
|
"marker-mid": "markerMid",
|
|
markerStart: 1,
|
|
"marker-start": "markerStart",
|
|
markerUnits: 1,
|
|
markerWidth: 1,
|
|
mask: 0,
|
|
maskContentUnits: 1,
|
|
maskUnits: 1,
|
|
mathematical: 0,
|
|
mode: 0,
|
|
numOctaves: 1,
|
|
offset: 0,
|
|
opacity: 0,
|
|
operator: 0,
|
|
order: 0,
|
|
orient: 0,
|
|
orientation: 0,
|
|
origin: 0,
|
|
overflow: 0,
|
|
overlinePosition: 1,
|
|
"overline-position": "overlinePosition",
|
|
overlineThickness: 1,
|
|
"overline-thickness": "overlineThickness",
|
|
paintOrder: 1,
|
|
"paint-order": "paintOrder",
|
|
panose1: 0,
|
|
"panose-1": "panose1",
|
|
pathLength: 1,
|
|
patternContentUnits: 1,
|
|
patternTransform: 1,
|
|
patternUnits: 1,
|
|
pointerEvents: 1,
|
|
"pointer-events": "pointerEvents",
|
|
points: 0,
|
|
pointsAtX: 1,
|
|
pointsAtY: 1,
|
|
pointsAtZ: 1,
|
|
prefix: 0,
|
|
preserveAlpha: 1,
|
|
preserveAspectRatio: 1,
|
|
primitiveUnits: 1,
|
|
property: 0,
|
|
r: 0,
|
|
radius: 0,
|
|
refX: 1,
|
|
refY: 1,
|
|
renderingIntent: 1,
|
|
"rendering-intent": "renderingIntent",
|
|
repeatCount: 1,
|
|
repeatDur: 1,
|
|
requiredExtensions: 1,
|
|
requiredFeatures: 1,
|
|
resource: 0,
|
|
restart: 0,
|
|
result: 0,
|
|
results: 0,
|
|
rotate: 0,
|
|
rx: 0,
|
|
ry: 0,
|
|
scale: 0,
|
|
security: 0,
|
|
seed: 0,
|
|
shapeRendering: 1,
|
|
"shape-rendering": "shapeRendering",
|
|
slope: 0,
|
|
spacing: 0,
|
|
specularConstant: 1,
|
|
specularExponent: 1,
|
|
speed: 0,
|
|
spreadMethod: 1,
|
|
startOffset: 1,
|
|
stdDeviation: 1,
|
|
stemh: 0,
|
|
stemv: 0,
|
|
stitchTiles: 1,
|
|
stopColor: 1,
|
|
"stop-color": "stopColor",
|
|
stopOpacity: 1,
|
|
"stop-opacity": "stopOpacity",
|
|
strikethroughPosition: 1,
|
|
"strikethrough-position": "strikethroughPosition",
|
|
strikethroughThickness: 1,
|
|
"strikethrough-thickness": "strikethroughThickness",
|
|
string: 0,
|
|
stroke: 0,
|
|
strokeDasharray: 1,
|
|
"stroke-dasharray": "strokeDasharray",
|
|
strokeDashoffset: 1,
|
|
"stroke-dashoffset": "strokeDashoffset",
|
|
strokeLinecap: 1,
|
|
"stroke-linecap": "strokeLinecap",
|
|
strokeLinejoin: 1,
|
|
"stroke-linejoin": "strokeLinejoin",
|
|
strokeMiterlimit: 1,
|
|
"stroke-miterlimit": "strokeMiterlimit",
|
|
strokeWidth: 1,
|
|
"stroke-width": "strokeWidth",
|
|
strokeOpacity: 1,
|
|
"stroke-opacity": "strokeOpacity",
|
|
suppressContentEditableWarning: 1,
|
|
suppressHydrationWarning: 1,
|
|
surfaceScale: 1,
|
|
systemLanguage: 1,
|
|
tableValues: 1,
|
|
targetX: 1,
|
|
targetY: 1,
|
|
textAnchor: 1,
|
|
"text-anchor": "textAnchor",
|
|
textDecoration: 1,
|
|
"text-decoration": "textDecoration",
|
|
textLength: 1,
|
|
textRendering: 1,
|
|
"text-rendering": "textRendering",
|
|
to: 0,
|
|
transform: 0,
|
|
typeof: 0,
|
|
u1: 0,
|
|
u2: 0,
|
|
underlinePosition: 1,
|
|
"underline-position": "underlinePosition",
|
|
underlineThickness: 1,
|
|
"underline-thickness": "underlineThickness",
|
|
unicode: 0,
|
|
unicodeBidi: 1,
|
|
"unicode-bidi": "unicodeBidi",
|
|
unicodeRange: 1,
|
|
"unicode-range": "unicodeRange",
|
|
unitsPerEm: 1,
|
|
"units-per-em": "unitsPerEm",
|
|
unselectable: 0,
|
|
vAlphabetic: 1,
|
|
"v-alphabetic": "vAlphabetic",
|
|
values: 0,
|
|
vectorEffect: 1,
|
|
"vector-effect": "vectorEffect",
|
|
version: 0,
|
|
vertAdvY: 1,
|
|
"vert-adv-y": "vertAdvY",
|
|
vertOriginX: 1,
|
|
"vert-origin-x": "vertOriginX",
|
|
vertOriginY: 1,
|
|
"vert-origin-y": "vertOriginY",
|
|
vHanging: 1,
|
|
"v-hanging": "vHanging",
|
|
vIdeographic: 1,
|
|
"v-ideographic": "vIdeographic",
|
|
viewBox: 1,
|
|
viewTarget: 1,
|
|
visibility: 0,
|
|
vMathematical: 1,
|
|
"v-mathematical": "vMathematical",
|
|
vocab: 0,
|
|
widths: 0,
|
|
wordSpacing: 1,
|
|
"word-spacing": "wordSpacing",
|
|
writingMode: 1,
|
|
"writing-mode": "writingMode",
|
|
x1: 0,
|
|
x2: 0,
|
|
x: 0,
|
|
xChannelSelector: 1,
|
|
xHeight: 1,
|
|
"x-height": "xHeight",
|
|
xlinkActuate: 1,
|
|
"xlink:actuate": "xlinkActuate",
|
|
xlinkArcrole: 1,
|
|
"xlink:arcrole": "xlinkArcrole",
|
|
xlinkHref: 1,
|
|
"xlink:href": "xlinkHref",
|
|
xlinkRole: 1,
|
|
"xlink:role": "xlinkRole",
|
|
xlinkShow: 1,
|
|
"xlink:show": "xlinkShow",
|
|
xlinkTitle: 1,
|
|
"xlink:title": "xlinkTitle",
|
|
xlinkType: 1,
|
|
"xlink:type": "xlinkType",
|
|
xmlBase: 1,
|
|
"xml:base": "xmlBase",
|
|
xmlLang: 1,
|
|
"xml:lang": "xmlLang",
|
|
xmlns: 0,
|
|
"xml:space": "xmlSpace",
|
|
xmlnsXlink: 1,
|
|
"xmlns:xlink": "xmlnsXlink",
|
|
xmlSpace: 1,
|
|
y1: 0,
|
|
y2: 0,
|
|
y: 0,
|
|
yChannelSelector: 1,
|
|
z: 0,
|
|
zoomAndPan: 1
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-property/lib/index.js
|
|
var require_lib = __commonJS({
|
|
"node_modules/react-property/lib/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function _slicedToArray(arr, i2) {
|
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
}
|
|
function _arrayWithHoles(arr) {
|
|
if (Array.isArray(arr))
|
|
return arr;
|
|
}
|
|
function _iterableToArrayLimit(arr, i2) {
|
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
if (_i == null)
|
|
return;
|
|
var _arr = [];
|
|
var _n = true;
|
|
var _d = false;
|
|
var _s, _e;
|
|
try {
|
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
_arr.push(_s.value);
|
|
if (i2 && _arr.length === i2)
|
|
break;
|
|
}
|
|
} catch (err) {
|
|
_d = true;
|
|
_e = err;
|
|
} finally {
|
|
try {
|
|
if (!_n && _i["return"] != null)
|
|
_i["return"]();
|
|
} finally {
|
|
if (_d)
|
|
throw _e;
|
|
}
|
|
}
|
|
return _arr;
|
|
}
|
|
function _unsupportedIterableToArray(o2, minLen) {
|
|
if (!o2)
|
|
return;
|
|
if (typeof o2 === "string")
|
|
return _arrayLikeToArray(o2, minLen);
|
|
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
|
|
if (n2 === "Object" && o2.constructor)
|
|
n2 = o2.constructor.name;
|
|
if (n2 === "Map" || n2 === "Set")
|
|
return Array.from(o2);
|
|
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
return _arrayLikeToArray(o2, minLen);
|
|
}
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length)
|
|
len = arr.length;
|
|
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
|
|
arr2[i2] = arr[i2];
|
|
return arr2;
|
|
}
|
|
function _nonIterableRest() {
|
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
var RESERVED = 0;
|
|
var STRING = 1;
|
|
var BOOLEANISH_STRING = 2;
|
|
var BOOLEAN = 3;
|
|
var OVERLOADED_BOOLEAN = 4;
|
|
var NUMERIC = 5;
|
|
var POSITIVE_NUMERIC = 6;
|
|
function getPropertyInfo(name) {
|
|
return properties2.hasOwnProperty(name) ? properties2[name] : null;
|
|
}
|
|
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {
|
|
this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
|
this.attributeName = attributeName;
|
|
this.attributeNamespace = attributeNamespace;
|
|
this.mustUseProperty = mustUseProperty;
|
|
this.propertyName = name;
|
|
this.type = type;
|
|
this.sanitizeURL = sanitizeURL;
|
|
this.removeEmptyString = removeEmptyString;
|
|
}
|
|
var properties2 = {};
|
|
var reservedProps = [
|
|
"children",
|
|
"dangerouslySetInnerHTML",
|
|
"defaultValue",
|
|
"defaultChecked",
|
|
"innerHTML",
|
|
"suppressContentEditableWarning",
|
|
"suppressHydrationWarning",
|
|
"style"
|
|
];
|
|
reservedProps.forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
RESERVED,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
|
|
var _ref2 = _slicedToArray(_ref, 2), name = _ref2[0], attributeName = _ref2[1];
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEANISH_STRING,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEANISH_STRING,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"allowFullScreen",
|
|
"async",
|
|
"autoFocus",
|
|
"autoPlay",
|
|
"controls",
|
|
"default",
|
|
"defer",
|
|
"disabled",
|
|
"disablePictureInPicture",
|
|
"disableRemotePlayback",
|
|
"formNoValidate",
|
|
"hidden",
|
|
"loop",
|
|
"noModule",
|
|
"noValidate",
|
|
"open",
|
|
"playsInline",
|
|
"readOnly",
|
|
"required",
|
|
"reversed",
|
|
"scoped",
|
|
"seamless",
|
|
"itemScope"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEAN,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"checked",
|
|
"multiple",
|
|
"muted",
|
|
"selected"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
BOOLEAN,
|
|
true,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"capture",
|
|
"download"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
OVERLOADED_BOOLEAN,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"cols",
|
|
"rows",
|
|
"size",
|
|
"span"
|
|
].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
POSITIVE_NUMERIC,
|
|
false,
|
|
name,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["rowSpan", "start"].forEach(function(name) {
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
NUMERIC,
|
|
false,
|
|
name.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
var capitalize2 = function capitalize3(token) {
|
|
return token[1].toUpperCase();
|
|
};
|
|
[
|
|
"accent-height",
|
|
"alignment-baseline",
|
|
"arabic-form",
|
|
"baseline-shift",
|
|
"cap-height",
|
|
"clip-path",
|
|
"clip-rule",
|
|
"color-interpolation",
|
|
"color-interpolation-filters",
|
|
"color-profile",
|
|
"color-rendering",
|
|
"dominant-baseline",
|
|
"enable-background",
|
|
"fill-opacity",
|
|
"fill-rule",
|
|
"flood-color",
|
|
"flood-opacity",
|
|
"font-family",
|
|
"font-size",
|
|
"font-size-adjust",
|
|
"font-stretch",
|
|
"font-style",
|
|
"font-variant",
|
|
"font-weight",
|
|
"glyph-name",
|
|
"glyph-orientation-horizontal",
|
|
"glyph-orientation-vertical",
|
|
"horiz-adv-x",
|
|
"horiz-origin-x",
|
|
"image-rendering",
|
|
"letter-spacing",
|
|
"lighting-color",
|
|
"marker-end",
|
|
"marker-mid",
|
|
"marker-start",
|
|
"overline-position",
|
|
"overline-thickness",
|
|
"paint-order",
|
|
"panose-1",
|
|
"pointer-events",
|
|
"rendering-intent",
|
|
"shape-rendering",
|
|
"stop-color",
|
|
"stop-opacity",
|
|
"strikethrough-position",
|
|
"strikethrough-thickness",
|
|
"stroke-dasharray",
|
|
"stroke-dashoffset",
|
|
"stroke-linecap",
|
|
"stroke-linejoin",
|
|
"stroke-miterlimit",
|
|
"stroke-opacity",
|
|
"stroke-width",
|
|
"text-anchor",
|
|
"text-decoration",
|
|
"text-rendering",
|
|
"underline-position",
|
|
"underline-thickness",
|
|
"unicode-bidi",
|
|
"unicode-range",
|
|
"units-per-em",
|
|
"v-alphabetic",
|
|
"v-hanging",
|
|
"v-ideographic",
|
|
"v-mathematical",
|
|
"vector-effect",
|
|
"vert-adv-y",
|
|
"vert-origin-x",
|
|
"vert-origin-y",
|
|
"word-spacing",
|
|
"writing-mode",
|
|
"xmlns:xlink",
|
|
"x-height"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"xlink:actuate",
|
|
"xlink:arcrole",
|
|
"xlink:role",
|
|
"xlink:show",
|
|
"xlink:title",
|
|
"xlink:type"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
"http://www.w3.org/1999/xlink",
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
[
|
|
"xml:base",
|
|
"xml:lang",
|
|
"xml:space"
|
|
].forEach(function(attributeName) {
|
|
var name = attributeName.replace(CAMELIZE, capitalize2);
|
|
properties2[name] = new PropertyInfoRecord(
|
|
name,
|
|
STRING,
|
|
false,
|
|
attributeName,
|
|
"http://www.w3.org/XML/1998/namespace",
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
|
|
properties2[attributeName] = new PropertyInfoRecord(
|
|
attributeName,
|
|
STRING,
|
|
false,
|
|
attributeName.toLowerCase(),
|
|
null,
|
|
false,
|
|
false
|
|
);
|
|
});
|
|
var xlinkHref = "xlinkHref";
|
|
properties2[xlinkHref] = new PropertyInfoRecord(
|
|
"xlinkHref",
|
|
STRING,
|
|
false,
|
|
"xlink:href",
|
|
"http://www.w3.org/1999/xlink",
|
|
true,
|
|
false
|
|
);
|
|
["src", "href", "action", "formAction"].forEach(function(attributeName) {
|
|
properties2[attributeName] = new PropertyInfoRecord(
|
|
attributeName,
|
|
STRING,
|
|
false,
|
|
attributeName.toLowerCase(),
|
|
null,
|
|
true,
|
|
true
|
|
);
|
|
});
|
|
var _require = require_possibleStandardNamesOptimized();
|
|
var CAMELCASE = _require.CAMELCASE;
|
|
var SAME = _require.SAME;
|
|
var possibleStandardNamesOptimized = _require.possibleStandardNames;
|
|
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
var isCustomAttribute = RegExp.prototype.test.bind(
|
|
new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$")
|
|
);
|
|
var possibleStandardNames = Object.keys(possibleStandardNamesOptimized).reduce(function(accumulator, standardName) {
|
|
var propName = possibleStandardNamesOptimized[standardName];
|
|
if (propName === SAME) {
|
|
accumulator[standardName] = standardName;
|
|
} else if (propName === CAMELCASE) {
|
|
accumulator[standardName.toLowerCase()] = standardName;
|
|
} else {
|
|
accumulator[standardName] = propName;
|
|
}
|
|
return accumulator;
|
|
}, {});
|
|
exports.BOOLEAN = BOOLEAN;
|
|
exports.BOOLEANISH_STRING = BOOLEANISH_STRING;
|
|
exports.NUMERIC = NUMERIC;
|
|
exports.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN;
|
|
exports.POSITIVE_NUMERIC = POSITIVE_NUMERIC;
|
|
exports.RESERVED = RESERVED;
|
|
exports.STRING = STRING;
|
|
exports.getPropertyInfo = getPropertyInfo;
|
|
exports.isCustomAttribute = isCustomAttribute;
|
|
exports.possibleStandardNames = possibleStandardNames;
|
|
}
|
|
});
|
|
|
|
// node_modules/inline-style-parser/index.js
|
|
var require_inline_style_parser = __commonJS({
|
|
"node_modules/inline-style-parser/index.js"(exports, module2) {
|
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
var NEWLINE_REGEX = /\n/g;
|
|
var WHITESPACE_REGEX = /^\s*/;
|
|
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
var COLON_REGEX = /^:\s*/;
|
|
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
|
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
var NEWLINE = "\n";
|
|
var FORWARD_SLASH = "/";
|
|
var ASTERISK = "*";
|
|
var EMPTY_STRING = "";
|
|
var TYPE_COMMENT = "comment";
|
|
var TYPE_DECLARATION = "declaration";
|
|
module2.exports = function(style3, options) {
|
|
if (typeof style3 !== "string") {
|
|
throw new TypeError("First argument must be a string");
|
|
}
|
|
if (!style3)
|
|
return [];
|
|
options = options || {};
|
|
var lineno = 1;
|
|
var column = 1;
|
|
function updatePosition(str) {
|
|
var lines = str.match(NEWLINE_REGEX);
|
|
if (lines)
|
|
lineno += lines.length;
|
|
var i2 = str.lastIndexOf(NEWLINE);
|
|
column = ~i2 ? str.length - i2 : column + str.length;
|
|
}
|
|
function position2() {
|
|
var start = { line: lineno, column };
|
|
return function(node) {
|
|
node.position = new Position(start);
|
|
whitespace();
|
|
return node;
|
|
};
|
|
}
|
|
function Position(start) {
|
|
this.start = start;
|
|
this.end = { line: lineno, column };
|
|
this.source = options.source;
|
|
}
|
|
Position.prototype.content = style3;
|
|
var errorsList = [];
|
|
function error(msg) {
|
|
var err = new Error(
|
|
options.source + ":" + lineno + ":" + column + ": " + msg
|
|
);
|
|
err.reason = msg;
|
|
err.filename = options.source;
|
|
err.line = lineno;
|
|
err.column = column;
|
|
err.source = style3;
|
|
if (options.silent) {
|
|
errorsList.push(err);
|
|
} else {
|
|
throw err;
|
|
}
|
|
}
|
|
function match(re) {
|
|
var m2 = re.exec(style3);
|
|
if (!m2)
|
|
return;
|
|
var str = m2[0];
|
|
updatePosition(str);
|
|
style3 = style3.slice(str.length);
|
|
return m2;
|
|
}
|
|
function whitespace() {
|
|
match(WHITESPACE_REGEX);
|
|
}
|
|
function comments(rules) {
|
|
var c2;
|
|
rules = rules || [];
|
|
while (c2 = comment()) {
|
|
if (c2 !== false) {
|
|
rules.push(c2);
|
|
}
|
|
}
|
|
return rules;
|
|
}
|
|
function comment() {
|
|
var pos = position2();
|
|
if (FORWARD_SLASH != style3.charAt(0) || ASTERISK != style3.charAt(1))
|
|
return;
|
|
var i2 = 2;
|
|
while (EMPTY_STRING != style3.charAt(i2) && (ASTERISK != style3.charAt(i2) || FORWARD_SLASH != style3.charAt(i2 + 1))) {
|
|
++i2;
|
|
}
|
|
i2 += 2;
|
|
if (EMPTY_STRING === style3.charAt(i2 - 1)) {
|
|
return error("End of comment missing");
|
|
}
|
|
var str = style3.slice(2, i2 - 2);
|
|
column += 2;
|
|
updatePosition(str);
|
|
style3 = style3.slice(i2);
|
|
column += 2;
|
|
return pos({
|
|
type: TYPE_COMMENT,
|
|
comment: str
|
|
});
|
|
}
|
|
function declaration() {
|
|
var pos = position2();
|
|
var prop = match(PROPERTY_REGEX);
|
|
if (!prop)
|
|
return;
|
|
comment();
|
|
if (!match(COLON_REGEX))
|
|
return error("property missing ':'");
|
|
var val = match(VALUE_REGEX);
|
|
var ret = pos({
|
|
type: TYPE_DECLARATION,
|
|
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
|
value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING
|
|
});
|
|
match(SEMICOLON_REGEX);
|
|
return ret;
|
|
}
|
|
function declarations() {
|
|
var decls = [];
|
|
comments(decls);
|
|
var decl;
|
|
while (decl = declaration()) {
|
|
if (decl !== false) {
|
|
decls.push(decl);
|
|
comments(decls);
|
|
}
|
|
}
|
|
return decls;
|
|
}
|
|
whitespace();
|
|
return declarations();
|
|
};
|
|
function trim(str) {
|
|
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-object/index.js
|
|
var require_style_to_object = __commonJS({
|
|
"node_modules/style-to-object/index.js"(exports, module2) {
|
|
var parse = require_inline_style_parser();
|
|
function StyleToObject(style3, iterator) {
|
|
var output = null;
|
|
if (!style3 || typeof style3 !== "string") {
|
|
return output;
|
|
}
|
|
var declaration;
|
|
var declarations = parse(style3);
|
|
var hasIterator = typeof iterator === "function";
|
|
var property;
|
|
var value;
|
|
for (var i2 = 0, len = declarations.length; i2 < len; i2++) {
|
|
declaration = declarations[i2];
|
|
property = declaration.property;
|
|
value = declaration.value;
|
|
if (hasIterator) {
|
|
iterator(property, value, declaration);
|
|
} else if (value) {
|
|
output || (output = {});
|
|
output[property] = value;
|
|
}
|
|
}
|
|
return output;
|
|
}
|
|
module2.exports = StyleToObject;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/utilities.js
|
|
var require_utilities = __commonJS({
|
|
"node_modules/style-to-js/cjs/utilities.js"(exports) {
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
exports.camelCase = void 0;
|
|
var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;
|
|
var HYPHEN_REGEX = /-([a-z])/g;
|
|
var NO_HYPHEN_REGEX = /^[^-]+$/;
|
|
var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;
|
|
var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;
|
|
var skipCamelCase = function(property) {
|
|
return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property);
|
|
};
|
|
var capitalize2 = function(match, character) {
|
|
return character.toUpperCase();
|
|
};
|
|
var trimHyphen = function(match, prefix2) {
|
|
return "".concat(prefix2, "-");
|
|
};
|
|
var camelCase = function(property, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
if (skipCamelCase(property)) {
|
|
return property;
|
|
}
|
|
property = property.toLowerCase();
|
|
if (options.reactCompat) {
|
|
property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);
|
|
} else {
|
|
property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);
|
|
}
|
|
return property.replace(HYPHEN_REGEX, capitalize2);
|
|
};
|
|
exports.camelCase = camelCase;
|
|
}
|
|
});
|
|
|
|
// node_modules/style-to-js/cjs/index.js
|
|
var require_cjs = __commonJS({
|
|
"node_modules/style-to-js/cjs/index.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
exports.__esModule = true;
|
|
var style_to_object_1 = __importDefault(require_style_to_object());
|
|
var utilities_1 = require_utilities();
|
|
function StyleToJS(style3, options) {
|
|
var output = {};
|
|
if (!style3 || typeof style3 !== "string") {
|
|
return output;
|
|
}
|
|
(0, style_to_object_1["default"])(style3, function(property, value) {
|
|
if (property && value) {
|
|
output[(0, utilities_1.camelCase)(property, options)] = value;
|
|
}
|
|
});
|
|
return output;
|
|
}
|
|
exports["default"] = StyleToJS;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/utilities.js
|
|
var require_utilities2 = __commonJS({
|
|
"node_modules/html-react-parser/lib/utilities.js"(exports, module2) {
|
|
var React11 = require_react();
|
|
var styleToJS = require_cjs().default;
|
|
function invertObject(obj, override) {
|
|
if (!obj || typeof obj !== "object") {
|
|
throw new TypeError("First argument must be an object");
|
|
}
|
|
var key;
|
|
var value;
|
|
var isOverridePresent = typeof override === "function";
|
|
var overrides = {};
|
|
var result = {};
|
|
for (key in obj) {
|
|
value = obj[key];
|
|
if (isOverridePresent) {
|
|
overrides = override(key, value);
|
|
if (overrides && overrides.length === 2) {
|
|
result[overrides[0]] = overrides[1];
|
|
continue;
|
|
}
|
|
}
|
|
if (typeof value === "string") {
|
|
result[value] = key;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function isCustomComponent(tagName, props) {
|
|
if (tagName.indexOf("-") === -1) {
|
|
return props && typeof props.is === "string";
|
|
}
|
|
switch (tagName) {
|
|
case "annotation-xml":
|
|
case "color-profile":
|
|
case "font-face":
|
|
case "font-face-src":
|
|
case "font-face-uri":
|
|
case "font-face-format":
|
|
case "font-face-name":
|
|
case "missing-glyph":
|
|
return false;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
var styleToJSOptions = { reactCompat: true };
|
|
function setStyleProp(style3, props) {
|
|
if (style3 === null || style3 === void 0) {
|
|
return;
|
|
}
|
|
try {
|
|
props.style = styleToJS(style3, styleToJSOptions);
|
|
} catch (err) {
|
|
props.style = {};
|
|
}
|
|
}
|
|
var PRESERVE_CUSTOM_ATTRIBUTES = React11.version.split(".")[0] >= 16;
|
|
var elementsWithNoTextChildren = /* @__PURE__ */ new Set([
|
|
"tr",
|
|
"tbody",
|
|
"thead",
|
|
"tfoot",
|
|
"colgroup",
|
|
"table",
|
|
"head",
|
|
"html",
|
|
"frameset"
|
|
]);
|
|
function canTextBeChildOfNode(node) {
|
|
return !elementsWithNoTextChildren.has(node.name);
|
|
}
|
|
module2.exports = {
|
|
PRESERVE_CUSTOM_ATTRIBUTES,
|
|
invertObject,
|
|
isCustomComponent,
|
|
setStyleProp,
|
|
canTextBeChildOfNode,
|
|
elementsWithNoTextChildren
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/attributes-to-props.js
|
|
var require_attributes_to_props = __commonJS({
|
|
"node_modules/html-react-parser/lib/attributes-to-props.js"(exports, module2) {
|
|
var reactProperty = require_lib();
|
|
var utilities = require_utilities2();
|
|
module2.exports = function attributesToProps2(attributes) {
|
|
attributes = attributes || {};
|
|
var valueOnlyInputs = {
|
|
reset: true,
|
|
submit: true
|
|
};
|
|
var attributeName;
|
|
var attributeNameLowerCased;
|
|
var attributeValue;
|
|
var propName;
|
|
var propertyInfo;
|
|
var props = {};
|
|
var inputIsValueOnly = attributes.type && valueOnlyInputs[attributes.type];
|
|
for (attributeName in attributes) {
|
|
attributeValue = attributes[attributeName];
|
|
if (reactProperty.isCustomAttribute(attributeName)) {
|
|
props[attributeName] = attributeValue;
|
|
continue;
|
|
}
|
|
attributeNameLowerCased = attributeName.toLowerCase();
|
|
propName = getPropName(attributeNameLowerCased);
|
|
if (propName) {
|
|
propertyInfo = reactProperty.getPropertyInfo(propName);
|
|
if ((propName === "checked" || propName === "value") && !inputIsValueOnly) {
|
|
propName = getPropName("default" + attributeNameLowerCased);
|
|
}
|
|
props[propName] = attributeValue;
|
|
switch (propertyInfo && propertyInfo.type) {
|
|
case reactProperty.BOOLEAN:
|
|
props[propName] = true;
|
|
break;
|
|
case reactProperty.OVERLOADED_BOOLEAN:
|
|
if (attributeValue === "") {
|
|
props[propName] = true;
|
|
}
|
|
break;
|
|
}
|
|
continue;
|
|
}
|
|
if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
|
|
props[attributeName] = attributeValue;
|
|
}
|
|
}
|
|
utilities.setStyleProp(attributes.style, props);
|
|
return props;
|
|
};
|
|
function getPropName(attributeName) {
|
|
return reactProperty.possibleStandardNames[attributeName];
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/lib/dom-to-react.js
|
|
var require_dom_to_react = __commonJS({
|
|
"node_modules/html-react-parser/lib/dom-to-react.js"(exports, module2) {
|
|
var React11 = require_react();
|
|
var attributesToProps2 = require_attributes_to_props();
|
|
var utilities = require_utilities2();
|
|
var setStyleProp = utilities.setStyleProp;
|
|
var canTextBeChildOfNode = utilities.canTextBeChildOfNode;
|
|
function domToReact2(nodes, options) {
|
|
options = options || {};
|
|
var library = options.library || React11;
|
|
var cloneElement = library.cloneElement;
|
|
var createElement = library.createElement;
|
|
var isValidElement = library.isValidElement;
|
|
var result = [];
|
|
var node;
|
|
var isWhitespace;
|
|
var hasReplace = typeof options.replace === "function";
|
|
var replaceElement;
|
|
var props;
|
|
var children;
|
|
var trim = options.trim;
|
|
for (var i2 = 0, len = nodes.length; i2 < len; i2++) {
|
|
node = nodes[i2];
|
|
if (hasReplace) {
|
|
replaceElement = options.replace(node);
|
|
if (isValidElement(replaceElement)) {
|
|
if (len > 1) {
|
|
replaceElement = cloneElement(replaceElement, {
|
|
key: replaceElement.key || i2
|
|
});
|
|
}
|
|
result.push(replaceElement);
|
|
continue;
|
|
}
|
|
}
|
|
if (node.type === "text") {
|
|
isWhitespace = !node.data.trim().length;
|
|
if (isWhitespace && node.parent && !canTextBeChildOfNode(node.parent)) {
|
|
continue;
|
|
}
|
|
if (trim && isWhitespace) {
|
|
continue;
|
|
}
|
|
result.push(node.data);
|
|
continue;
|
|
}
|
|
props = node.attribs;
|
|
if (skipAttributesToProps(node)) {
|
|
setStyleProp(props.style, props);
|
|
} else if (props) {
|
|
props = attributesToProps2(props);
|
|
}
|
|
children = null;
|
|
switch (node.type) {
|
|
case "script":
|
|
case "style":
|
|
if (node.children[0]) {
|
|
props.dangerouslySetInnerHTML = {
|
|
__html: node.children[0].data
|
|
};
|
|
}
|
|
break;
|
|
case "tag":
|
|
if (node.name === "textarea" && node.children[0]) {
|
|
props.defaultValue = node.children[0].data;
|
|
} else if (node.children && node.children.length) {
|
|
children = domToReact2(node.children, options);
|
|
}
|
|
break;
|
|
default:
|
|
continue;
|
|
}
|
|
if (len > 1) {
|
|
props.key = i2;
|
|
}
|
|
result.push(createElement(node.name, props, children));
|
|
}
|
|
return result.length === 1 ? result[0] : result;
|
|
}
|
|
function skipAttributesToProps(node) {
|
|
return utilities.PRESERVE_CUSTOM_ATTRIBUTES && node.type === "tag" && utilities.isCustomComponent(node.name, node.attribs);
|
|
}
|
|
module2.exports = domToReact2;
|
|
}
|
|
});
|
|
|
|
// node_modules/entities/lib/decode_codepoint.js
|
|
var require_decode_codepoint = __commonJS({
|
|
"node_modules/entities/lib/decode_codepoint.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var decodeMap = /* @__PURE__ */ new Map([
|
|
[0, 65533],
|
|
[128, 8364],
|
|
[130, 8218],
|
|
[131, 402],
|
|
[132, 8222],
|
|
[133, 8230],
|
|
[134, 8224],
|
|
[135, 8225],
|
|
[136, 710],
|
|
[137, 8240],
|
|
[138, 352],
|
|
[139, 8249],
|
|
[140, 338],
|
|
[142, 381],
|
|
[145, 8216],
|
|
[146, 8217],
|
|
[147, 8220],
|
|
[148, 8221],
|
|
[149, 8226],
|
|
[150, 8211],
|
|
[151, 8212],
|
|
[152, 732],
|
|
[153, 8482],
|
|
[154, 353],
|
|
[155, 8250],
|
|
[156, 339],
|
|
[158, 382],
|
|
[159, 376]
|
|
]);
|
|
var fromCodePoint = String.fromCodePoint || function(codePoint) {
|
|
var output = "";
|
|
if (codePoint > 65535) {
|
|
codePoint -= 65536;
|
|
output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
|
|
codePoint = 56320 | codePoint & 1023;
|
|
}
|
|
output += String.fromCharCode(codePoint);
|
|
return output;
|
|
};
|
|
function decodeCodePoint(codePoint) {
|
|
var _a;
|
|
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
|
|
return "\uFFFD";
|
|
}
|
|
return fromCodePoint((_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint);
|
|
}
|
|
exports.default = decodeCodePoint;
|
|
}
|
|
});
|
|
|
|
// node_modules/entities/lib/generated/decode-data-html.js
|
|
var require_decode_data_html = __commonJS({
|
|
"node_modules/entities/lib/generated/decode-data-html.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = new Uint16Array([14866, 60, 237, 340, 721, 1312, 1562, 1654, 1838, 1957, 2183, 2239, 2301, 2958, 3037, 3893, 4123, 4298, 4330, 4801, 5191, 5395, 5752, 5903, 5943, 5972, 6050, 0, 0, 0, 0, 0, 0, 6135, 6565, 7422, 8183, 8738, 9242, 9503, 9938, 10189, 10573, 10637, 10715, 11950, 12246, 13539, 13950, 14445, 14533, 15364, 16514, 16980, 17390, 17763, 17849, 18036, 18125, 4096, 69, 77, 97, 98, 99, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 92, 100, 106, 115, 122, 137, 142, 151, 157, 163, 167, 182, 196, 204, 220, 229, 108, 105, 103, 33024, 198, 59, 32768, 198, 80, 33024, 38, 59, 32768, 38, 99, 117, 116, 101, 33024, 193, 59, 32768, 193, 114, 101, 118, 101, 59, 32768, 258, 512, 105, 121, 127, 134, 114, 99, 33024, 194, 59, 32768, 194, 59, 32768, 1040, 114, 59, 32896, 55349, 56580, 114, 97, 118, 101, 33024, 192, 59, 32768, 192, 112, 104, 97, 59, 32768, 913, 97, 99, 114, 59, 32768, 256, 100, 59, 32768, 10835, 512, 103, 112, 172, 177, 111, 110, 59, 32768, 260, 102, 59, 32896, 55349, 56632, 112, 108, 121, 70, 117, 110, 99, 116, 105, 111, 110, 59, 32768, 8289, 105, 110, 103, 33024, 197, 59, 32768, 197, 512, 99, 115, 209, 214, 114, 59, 32896, 55349, 56476, 105, 103, 110, 59, 32768, 8788, 105, 108, 100, 101, 33024, 195, 59, 32768, 195, 109, 108, 33024, 196, 59, 32768, 196, 2048, 97, 99, 101, 102, 111, 114, 115, 117, 253, 278, 282, 310, 315, 321, 327, 332, 512, 99, 114, 258, 267, 107, 115, 108, 97, 115, 104, 59, 32768, 8726, 583, 271, 274, 59, 32768, 10983, 101, 100, 59, 32768, 8966, 121, 59, 32768, 1041, 768, 99, 114, 116, 289, 296, 306, 97, 117, 115, 101, 59, 32768, 8757, 110, 111, 117, 108, 108, 105, 115, 59, 32768, 8492, 97, 59, 32768, 914, 114, 59, 32896, 55349, 56581, 112, 102, 59, 32896, 55349, 56633, 101, 118, 101, 59, 32768, 728, 99, 114, 59, 32768, 8492, 109, 112, 101, 113, 59, 32768, 8782, 3584, 72, 79, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 117, 368, 373, 380, 426, 461, 466, 487, 491, 495, 533, 593, 695, 701, 707, 99, 121, 59, 32768, 1063, 80, 89, 33024, 169, 59, 32768, 169, 768, 99, 112, 121, 387, 393, 419, 117, 116, 101, 59, 32768, 262, 512, 59, 105, 398, 400, 32768, 8914, 116, 97, 108, 68, 105, 102, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 32768, 8517, 108, 101, 121, 115, 59, 32768, 8493, 1024, 97, 101, 105, 111, 435, 441, 449, 454, 114, 111, 110, 59, 32768, 268, 100, 105, 108, 33024, 199, 59, 32768, 199, 114, 99, 59, 32768, 264, 110, 105, 110, 116, 59, 32768, 8752, 111, 116, 59, 32768, 266, 512, 100, 110, 471, 478, 105, 108, 108, 97, 59, 32768, 184, 116, 101, 114, 68, 111, 116, 59, 32768, 183, 114, 59, 32768, 8493, 105, 59, 32768, 935, 114, 99, 108, 101, 1024, 68, 77, 80, 84, 508, 513, 520, 526, 111, 116, 59, 32768, 8857, 105, 110, 117, 115, 59, 32768, 8854, 108, 117, 115, 59, 32768, 8853, 105, 109, 101, 115, 59, 32768, 8855, 111, 512, 99, 115, 539, 562, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8754, 101, 67, 117, 114, 108, 121, 512, 68, 81, 573, 586, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 32768, 8221, 117, 111, 116, 101, 59, 32768, 8217, 1024, 108, 110, 112, 117, 602, 614, 648, 664, 111, 110, 512, 59, 101, 609, 611, 32768, 8759, 59, 32768, 10868, 768, 103, 105, 116, 621, 629, 634, 114, 117, 101, 110, 116, 59, 32768, 8801, 110, 116, 59, 32768, 8751, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8750, 512, 102, 114, 653, 656, 59, 32768, 8450, 111, 100, 117, 99, 116, 59, 32768, 8720, 110, 116, 101, 114, 67, 108, 111, 99, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8755, 111, 115, 115, 59, 32768, 10799, 99, 114, 59, 32896, 55349, 56478, 112, 512, 59, 67, 713, 715, 32768, 8915, 97, 112, 59, 32768, 8781, 2816, 68, 74, 83, 90, 97, 99, 101, 102, 105, 111, 115, 743, 758, 763, 768, 773, 795, 809, 821, 826, 910, 1295, 512, 59, 111, 748, 750, 32768, 8517, 116, 114, 97, 104, 100, 59, 32768, 10513, 99, 121, 59, 32768, 1026, 99, 121, 59, 32768, 1029, 99, 121, 59, 32768, 1039, 768, 103, 114, 115, 780, 786, 790, 103, 101, 114, 59, 32768, 8225, 114, 59, 32768, 8609, 104, 118, 59, 32768, 10980, 512, 97, 121, 800, 806, 114, 111, 110, 59, 32768, 270, 59, 32768, 1044, 108, 512, 59, 116, 815, 817, 32768, 8711, 97, 59, 32768, 916, 114, 59, 32896, 55349, 56583, 512, 97, 102, 831, 897, 512, 99, 109, 836, 891, 114, 105, 116, 105, 99, 97, 108, 1024, 65, 68, 71, 84, 852, 859, 877, 884, 99, 117, 116, 101, 59, 32768, 180, 111, 581, 864, 867, 59, 32768, 729, 98, 108, 101, 65, 99, 117, 116, 101, 59, 32768, 733, 114, 97, 118, 101, 59, 32768, 96, 105, 108, 100, 101, 59, 32768, 732, 111, 110, 100, 59, 32768, 8900, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 32768, 8518, 2113, 920, 0, 0, 0, 925, 946, 0, 1139, 102, 59, 32896, 55349, 56635, 768, 59, 68, 69, 931, 933, 938, 32768, 168, 111, 116, 59, 32768, 8412, 113, 117, 97, 108, 59, 32768, 8784, 98, 108, 101, 1536, 67, 68, 76, 82, 85, 86, 961, 978, 996, 1080, 1101, 1125, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 32768, 8751, 111, 1093, 985, 0, 0, 988, 59, 32768, 168, 110, 65, 114, 114, 111, 119, 59, 32768, 8659, 512, 101, 111, 1001, 1034, 102, 116, 768, 65, 82, 84, 1010, 1017, 1029, 114, 114, 111, 119, 59, 32768, 8656, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8660, 101, 101, 59, 32768, 10980, 110, 103, 512, 76, 82, 1041, 1068, 101, 102, 116, 512, 65, 82, 1049, 1056, 114, 114, 111, 119, 59, 32768, 10232, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10234, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10233, 105, 103, 104, 116, 512, 65, 84, 1089, 1096, 114, 114, 111, 119, 59, 32768, 8658, 101, 101, 59, 32768, 8872, 112, 1042, 1108, 0, 0, 1115, 114, 114, 111, 119, 59, 32768, 8657, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8661, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8741, 110, 1536, 65, 66, 76, 82, 84, 97, 1152, 1179, 1186, 1236, 1272, 1288, 114, 114, 111, 119, 768, 59, 66, 85, 1163, 1165, 1170, 32768, 8595, 97, 114, 59, 32768, 10515, 112, 65, 114, 114, 111, 119, 59, 32768, 8693, 114, 101, 118, 101, 59, 32768, 785, 101, 102, 116, 1315, 1196, 0, 1209, 0, 1220, 105, 103, 104, 116, 86, 101, 99, 116, 111, 114, 59, 32768, 10576, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10590, 101, 99, 116, 111, 114, 512, 59, 66, 1229, 1231, 32768, 8637, 97, 114, 59, 32768, 10582, 105, 103, 104, 116, 805, 1245, 0, 1256, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10591, 101, 99, 116, 111, 114, 512, 59, 66, 1265, 1267, 32768, 8641, 97, 114, 59, 32768, 10583, 101, 101, 512, 59, 65, 1279, 1281, 32768, 8868, 114, 114, 111, 119, 59, 32768, 8615, 114, 114, 111, 119, 59, 32768, 8659, 512, 99, 116, 1300, 1305, 114, 59, 32896, 55349, 56479, 114, 111, 107, 59, 32768, 272, 4096, 78, 84, 97, 99, 100, 102, 103, 108, 109, 111, 112, 113, 115, 116, 117, 120, 1344, 1348, 1354, 1363, 1386, 1391, 1396, 1405, 1413, 1460, 1475, 1483, 1514, 1527, 1531, 1538, 71, 59, 32768, 330, 72, 33024, 208, 59, 32768, 208, 99, 117, 116, 101, 33024, 201, 59, 32768, 201, 768, 97, 105, 121, 1370, 1376, 1383, 114, 111, 110, 59, 32768, 282, 114, 99, 33024, 202, 59, 32768, 202, 59, 32768, 1069, 111, 116, 59, 32768, 278, 114, 59, 32896, 55349, 56584, 114, 97, 118, 101, 33024, 200, 59, 32768, 200, 101, 109, 101, 110, 116, 59, 32768, 8712, 512, 97, 112, 1418, 1423, 99, 114, 59, 32768, 274, 116, 121, 1060, 1431, 0, 0, 1444, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9723, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9643, 512, 103, 112, 1465, 1470, 111, 110, 59, 32768, 280, 102, 59, 32896, 55349, 56636, 115, 105, 108, 111, 110, 59, 32768, 917, 117, 512, 97, 105, 1489, 1504, 108, 512, 59, 84, 1495, 1497, 32768, 10869, 105, 108, 100, 101, 59, 32768, 8770, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 8652, 512, 99, 105, 1519, 1523, 114, 59, 32768, 8496, 109, 59, 32768, 10867, 97, 59, 32768, 919, 109, 108, 33024, 203, 59, 32768, 203, 512, 105, 112, 1543, 1549, 115, 116, 115, 59, 32768, 8707, 111, 110, 101, 110, 116, 105, 97, 108, 69, 59, 32768, 8519, 1280, 99, 102, 105, 111, 115, 1572, 1576, 1581, 1620, 1648, 121, 59, 32768, 1060, 114, 59, 32896, 55349, 56585, 108, 108, 101, 100, 1060, 1591, 0, 0, 1604, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9724, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 32768, 9642, 1601, 1628, 0, 1633, 0, 0, 1639, 102, 59, 32896, 55349, 56637, 65, 108, 108, 59, 32768, 8704, 114, 105, 101, 114, 116, 114, 102, 59, 32768, 8497, 99, 114, 59, 32768, 8497, 3072, 74, 84, 97, 98, 99, 100, 102, 103, 111, 114, 115, 116, 1678, 1683, 1688, 1701, 1708, 1729, 1734, 1739, 1742, 1748, 1828, 1834, 99, 121, 59, 32768, 1027, 33024, 62, 59, 32768, 62, 109, 109, 97, 512, 59, 100, 1696, 1698, 32768, 915, 59, 32768, 988, 114, 101, 118, 101, 59, 32768, 286, 768, 101, 105, 121, 1715, 1721, 1726, 100, 105, 108, 59, 32768, 290, 114, 99, 59, 32768, 284, 59, 32768, 1043, 111, 116, 59, 32768, 288, 114, 59, 32896, 55349, 56586, 59, 32768, 8921, 112, 102, 59, 32896, 55349, 56638, 101, 97, 116, 101, 114, 1536, 69, 70, 71, 76, 83, 84, 1766, 1783, 1794, 1803, 1809, 1821, 113, 117, 97, 108, 512, 59, 76, 1775, 1777, 32768, 8805, 101, 115, 115, 59, 32768, 8923, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8807, 114, 101, 97, 116, 101, 114, 59, 32768, 10914, 101, 115, 115, 59, 32768, 8823, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 10878, 105, 108, 100, 101, 59, 32768, 8819, 99, 114, 59, 32896, 55349, 56482, 59, 32768, 8811, 2048, 65, 97, 99, 102, 105, 111, 115, 117, 1854, 1861, 1874, 1880, 1884, 1897, 1919, 1934, 82, 68, 99, 121, 59, 32768, 1066, 512, 99, 116, 1866, 1871, 101, 107, 59, 32768, 711, 59, 32768, 94, 105, 114, 99, 59, 32768, 292, 114, 59, 32768, 8460, 108, 98, 101, 114, 116, 83, 112, 97, 99, 101, 59, 32768, 8459, 833, 1902, 0, 1906, 102, 59, 32768, 8461, 105, 122, 111, 110, 116, 97, 108, 76, 105, 110, 101, 59, 32768, 9472, 512, 99, 116, 1924, 1928, 114, 59, 32768, 8459, 114, 111, 107, 59, 32768, 294, 109, 112, 533, 1940, 1950, 111, 119, 110, 72, 117, 109, 112, 59, 32768, 8782, 113, 117, 97, 108, 59, 32768, 8783, 3584, 69, 74, 79, 97, 99, 100, 102, 103, 109, 110, 111, 115, 116, 117, 1985, 1990, 1996, 2001, 2010, 2025, 2030, 2034, 2043, 2077, 2134, 2155, 2160, 2167, 99, 121, 59, 32768, 1045, 108, 105, 103, 59, 32768, 306, 99, 121, 59, 32768, 1025, 99, 117, 116, 101, 33024, 205, 59, 32768, 205, 512, 105, 121, 2015, 2022, 114, 99, 33024, 206, 59, 32768, 206, 59, 32768, 1048, 111, 116, 59, 32768, 304, 114, 59, 32768, 8465, 114, 97, 118, 101, 33024, 204, 59, 32768, 204, 768, 59, 97, 112, 2050, 2052, 2070, 32768, 8465, 512, 99, 103, 2057, 2061, 114, 59, 32768, 298, 105, 110, 97, 114, 121, 73, 59, 32768, 8520, 108, 105, 101, 115, 59, 32768, 8658, 837, 2082, 0, 2110, 512, 59, 101, 2086, 2088, 32768, 8748, 512, 103, 114, 2093, 2099, 114, 97, 108, 59, 32768, 8747, 115, 101, 99, 116, 105, 111, 110, 59, 32768, 8898, 105, 115, 105, 98, 108, 101, 512, 67, 84, 2120, 2127, 111, 109, 109, 97, 59, 32768, 8291, 105, 109, 101, 115, 59, 32768, 8290, 768, 103, 112, 116, 2141, 2146, 2151, 111, 110, 59, 32768, 302, 102, 59, 32896, 55349, 56640, 97, 59, 32768, 921, 99, 114, 59, 32768, 8464, 105, 108, 100, 101, 59, 32768, 296, 828, 2172, 0, 2177, 99, 121, 59, 32768, 1030, 108, 33024, 207, 59, 32768, 207, 1280, 99, 102, 111, 115, 117, 2193, 2206, 2211, 2217, 2232, 512, 105, 121, 2198, 2203, 114, 99, 59, 32768, 308, 59, 32768, 1049, 114, 59, 32896, 55349, 56589, 112, 102, 59, 32896, 55349, 56641, 820, 2222, 0, 2227, 114, 59, 32896, 55349, 56485, 114, 99, 121, 59, 32768, 1032, 107, 99, 121, 59, 32768, 1028, 1792, 72, 74, 97, 99, 102, 111, 115, 2253, 2258, 2263, 2269, 2283, 2288, 2294, 99, 121, 59, 32768, 1061, 99, 121, 59, 32768, 1036, 112, 112, 97, 59, 32768, 922, 512, 101, 121, 2274, 2280, 100, 105, 108, 59, 32768, 310, 59, 32768, 1050, 114, 59, 32896, 55349, 56590, 112, 102, 59, 32896, 55349, 56642, 99, 114, 59, 32896, 55349, 56486, 2816, 74, 84, 97, 99, 101, 102, 108, 109, 111, 115, 116, 2323, 2328, 2333, 2374, 2396, 2775, 2780, 2797, 2804, 2934, 2954, 99, 121, 59, 32768, 1033, 33024, 60, 59, 32768, 60, 1280, 99, 109, 110, 112, 114, 2344, 2350, 2356, 2360, 2370, 117, 116, 101, 59, 32768, 313, 98, 100, 97, 59, 32768, 923, 103, 59, 32768, 10218, 108, 97, 99, 101, 116, 114, 102, 59, 32768, 8466, 114, 59, 32768, 8606, 768, 97, 101, 121, 2381, 2387, 2393, 114, 111, 110, 59, 32768, 317, 100, 105, 108, 59, 32768, 315, 59, 32768, 1051, 512, 102, 115, 2401, 2702, 116, 2560, 65, 67, 68, 70, 82, 84, 85, 86, 97, 114, 2423, 2470, 2479, 2530, 2537, 2561, 2618, 2666, 2683, 2690, 512, 110, 114, 2428, 2441, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10216, 114, 111, 119, 768, 59, 66, 82, 2451, 2453, 2458, 32768, 8592, 97, 114, 59, 32768, 8676, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8646, 101, 105, 108, 105, 110, 103, 59, 32768, 8968, 111, 838, 2485, 0, 2498, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10214, 110, 805, 2503, 0, 2514, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10593, 101, 99, 116, 111, 114, 512, 59, 66, 2523, 2525, 32768, 8643, 97, 114, 59, 32768, 10585, 108, 111, 111, 114, 59, 32768, 8970, 105, 103, 104, 116, 512, 65, 86, 2546, 2553, 114, 114, 111, 119, 59, 32768, 8596, 101, 99, 116, 111, 114, 59, 32768, 10574, 512, 101, 114, 2566, 2591, 101, 768, 59, 65, 86, 2574, 2576, 2583, 32768, 8867, 114, 114, 111, 119, 59, 32768, 8612, 101, 99, 116, 111, 114, 59, 32768, 10586, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 2604, 2606, 2611, 32768, 8882, 97, 114, 59, 32768, 10703, 113, 117, 97, 108, 59, 32768, 8884, 112, 768, 68, 84, 86, 2626, 2638, 2649, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 32768, 10577, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10592, 101, 99, 116, 111, 114, 512, 59, 66, 2659, 2661, 32768, 8639, 97, 114, 59, 32768, 10584, 101, 99, 116, 111, 114, 512, 59, 66, 2676, 2678, 32768, 8636, 97, 114, 59, 32768, 10578, 114, 114, 111, 119, 59, 32768, 8656, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8660, 115, 1536, 69, 70, 71, 76, 83, 84, 2716, 2730, 2741, 2750, 2756, 2768, 113, 117, 97, 108, 71, 114, 101, 97, 116, 101, 114, 59, 32768, 8922, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8806, 114, 101, 97, 116, 101, 114, 59, 32768, 8822, 101, 115, 115, 59, 32768, 10913, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 10877, 105, 108, 100, 101, 59, 32768, 8818, 114, 59, 32896, 55349, 56591, 512, 59, 101, 2785, 2787, 32768, 8920, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8666, 105, 100, 111, 116, 59, 32768, 319, 768, 110, 112, 119, 2811, 2899, 2904, 103, 1024, 76, 82, 108, 114, 2821, 2848, 2860, 2887, 101, 102, 116, 512, 65, 82, 2829, 2836, 114, 114, 111, 119, 59, 32768, 10229, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10231, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 10230, 101, 102, 116, 512, 97, 114, 2868, 2875, 114, 114, 111, 119, 59, 32768, 10232, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10234, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10233, 102, 59, 32896, 55349, 56643, 101, 114, 512, 76, 82, 2911, 2922, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8601, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8600, 768, 99, 104, 116, 2941, 2945, 2948, 114, 59, 32768, 8466, 59, 32768, 8624, 114, 111, 107, 59, 32768, 321, 59, 32768, 8810, 2048, 97, 99, 101, 102, 105, 111, 115, 117, 2974, 2978, 2982, 3007, 3012, 3022, 3028, 3033, 112, 59, 32768, 10501, 121, 59, 32768, 1052, 512, 100, 108, 2987, 2998, 105, 117, 109, 83, 112, 97, 99, 101, 59, 32768, 8287, 108, 105, 110, 116, 114, 102, 59, 32768, 8499, 114, 59, 32896, 55349, 56592, 110, 117, 115, 80, 108, 117, 115, 59, 32768, 8723, 112, 102, 59, 32896, 55349, 56644, 99, 114, 59, 32768, 8499, 59, 32768, 924, 2304, 74, 97, 99, 101, 102, 111, 115, 116, 117, 3055, 3060, 3067, 3089, 3201, 3206, 3874, 3880, 3889, 99, 121, 59, 32768, 1034, 99, 117, 116, 101, 59, 32768, 323, 768, 97, 101, 121, 3074, 3080, 3086, 114, 111, 110, 59, 32768, 327, 100, 105, 108, 59, 32768, 325, 59, 32768, 1053, 768, 103, 115, 119, 3096, 3160, 3194, 97, 116, 105, 118, 101, 768, 77, 84, 86, 3108, 3121, 3145, 101, 100, 105, 117, 109, 83, 112, 97, 99, 101, 59, 32768, 8203, 104, 105, 512, 99, 110, 3128, 3137, 107, 83, 112, 97, 99, 101, 59, 32768, 8203, 83, 112, 97, 99, 101, 59, 32768, 8203, 101, 114, 121, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 32768, 8203, 116, 101, 100, 512, 71, 76, 3168, 3184, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 32768, 8811, 101, 115, 115, 76, 101, 115, 115, 59, 32768, 8810, 76, 105, 110, 101, 59, 32768, 10, 114, 59, 32896, 55349, 56593, 1024, 66, 110, 112, 116, 3215, 3222, 3238, 3242, 114, 101, 97, 107, 59, 32768, 8288, 66, 114, 101, 97, 107, 105, 110, 103, 83, 112, 97, 99, 101, 59, 32768, 160, 102, 59, 32768, 8469, 3328, 59, 67, 68, 69, 71, 72, 76, 78, 80, 82, 83, 84, 86, 3269, 3271, 3293, 3312, 3352, 3430, 3455, 3551, 3589, 3625, 3678, 3821, 3861, 32768, 10988, 512, 111, 117, 3276, 3286, 110, 103, 114, 117, 101, 110, 116, 59, 32768, 8802, 112, 67, 97, 112, 59, 32768, 8813, 111, 117, 98, 108, 101, 86, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8742, 768, 108, 113, 120, 3319, 3327, 3345, 101, 109, 101, 110, 116, 59, 32768, 8713, 117, 97, 108, 512, 59, 84, 3335, 3337, 32768, 8800, 105, 108, 100, 101, 59, 32896, 8770, 824, 105, 115, 116, 115, 59, 32768, 8708, 114, 101, 97, 116, 101, 114, 1792, 59, 69, 70, 71, 76, 83, 84, 3373, 3375, 3382, 3394, 3404, 3410, 3423, 32768, 8815, 113, 117, 97, 108, 59, 32768, 8817, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32896, 8807, 824, 114, 101, 97, 116, 101, 114, 59, 32896, 8811, 824, 101, 115, 115, 59, 32768, 8825, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32896, 10878, 824, 105, 108, 100, 101, 59, 32768, 8821, 117, 109, 112, 533, 3437, 3448, 111, 119, 110, 72, 117, 109, 112, 59, 32896, 8782, 824, 113, 117, 97, 108, 59, 32896, 8783, 824, 101, 512, 102, 115, 3461, 3492, 116, 84, 114, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 3477, 3479, 3485, 32768, 8938, 97, 114, 59, 32896, 10703, 824, 113, 117, 97, 108, 59, 32768, 8940, 115, 1536, 59, 69, 71, 76, 83, 84, 3506, 3508, 3515, 3524, 3531, 3544, 32768, 8814, 113, 117, 97, 108, 59, 32768, 8816, 114, 101, 97, 116, 101, 114, 59, 32768, 8824, 101, 115, 115, 59, 32896, 8810, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32896, 10877, 824, 105, 108, 100, 101, 59, 32768, 8820, 101, 115, 116, 101, 100, 512, 71, 76, 3561, 3578, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 32896, 10914, 824, 101, 115, 115, 76, 101, 115, 115, 59, 32896, 10913, 824, 114, 101, 99, 101, 100, 101, 115, 768, 59, 69, 83, 3603, 3605, 3613, 32768, 8832, 113, 117, 97, 108, 59, 32896, 10927, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8928, 512, 101, 105, 3630, 3645, 118, 101, 114, 115, 101, 69, 108, 101, 109, 101, 110, 116, 59, 32768, 8716, 103, 104, 116, 84, 114, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 3663, 3665, 3671, 32768, 8939, 97, 114, 59, 32896, 10704, 824, 113, 117, 97, 108, 59, 32768, 8941, 512, 113, 117, 3683, 3732, 117, 97, 114, 101, 83, 117, 512, 98, 112, 3694, 3712, 115, 101, 116, 512, 59, 69, 3702, 3705, 32896, 8847, 824, 113, 117, 97, 108, 59, 32768, 8930, 101, 114, 115, 101, 116, 512, 59, 69, 3722, 3725, 32896, 8848, 824, 113, 117, 97, 108, 59, 32768, 8931, 768, 98, 99, 112, 3739, 3757, 3801, 115, 101, 116, 512, 59, 69, 3747, 3750, 32896, 8834, 8402, 113, 117, 97, 108, 59, 32768, 8840, 99, 101, 101, 100, 115, 1024, 59, 69, 83, 84, 3771, 3773, 3781, 3793, 32768, 8833, 113, 117, 97, 108, 59, 32896, 10928, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8929, 105, 108, 100, 101, 59, 32896, 8831, 824, 101, 114, 115, 101, 116, 512, 59, 69, 3811, 3814, 32896, 8835, 8402, 113, 117, 97, 108, 59, 32768, 8841, 105, 108, 100, 101, 1024, 59, 69, 70, 84, 3834, 3836, 3843, 3854, 32768, 8769, 113, 117, 97, 108, 59, 32768, 8772, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8775, 105, 108, 100, 101, 59, 32768, 8777, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 32768, 8740, 99, 114, 59, 32896, 55349, 56489, 105, 108, 100, 101, 33024, 209, 59, 32768, 209, 59, 32768, 925, 3584, 69, 97, 99, 100, 102, 103, 109, 111, 112, 114, 115, 116, 117, 118, 3921, 3927, 3936, 3951, 3958, 3963, 3972, 3996, 4002, 4034, 4037, 4055, 4071, 4078, 108, 105, 103, 59, 32768, 338, 99, 117, 116, 101, 33024, 211, 59, 32768, 211, 512, 105, 121, 3941, 3948, 114, 99, 33024, 212, 59, 32768, 212, 59, 32768, 1054, 98, 108, 97, 99, 59, 32768, 336, 114, 59, 32896, 55349, 56594, 114, 97, 118, 101, 33024, 210, 59, 32768, 210, 768, 97, 101, 105, 3979, 3984, 3989, 99, 114, 59, 32768, 332, 103, 97, 59, 32768, 937, 99, 114, 111, 110, 59, 32768, 927, 112, 102, 59, 32896, 55349, 56646, 101, 110, 67, 117, 114, 108, 121, 512, 68, 81, 4014, 4027, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 32768, 8220, 117, 111, 116, 101, 59, 32768, 8216, 59, 32768, 10836, 512, 99, 108, 4042, 4047, 114, 59, 32896, 55349, 56490, 97, 115, 104, 33024, 216, 59, 32768, 216, 105, 573, 4060, 4067, 100, 101, 33024, 213, 59, 32768, 213, 101, 115, 59, 32768, 10807, 109, 108, 33024, 214, 59, 32768, 214, 101, 114, 512, 66, 80, 4085, 4109, 512, 97, 114, 4090, 4094, 114, 59, 32768, 8254, 97, 99, 512, 101, 107, 4101, 4104, 59, 32768, 9182, 101, 116, 59, 32768, 9140, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 32768, 9180, 2304, 97, 99, 102, 104, 105, 108, 111, 114, 115, 4141, 4150, 4154, 4159, 4163, 4166, 4176, 4198, 4284, 114, 116, 105, 97, 108, 68, 59, 32768, 8706, 121, 59, 32768, 1055, 114, 59, 32896, 55349, 56595, 105, 59, 32768, 934, 59, 32768, 928, 117, 115, 77, 105, 110, 117, 115, 59, 32768, 177, 512, 105, 112, 4181, 4194, 110, 99, 97, 114, 101, 112, 108, 97, 110, 101, 59, 32768, 8460, 102, 59, 32768, 8473, 1024, 59, 101, 105, 111, 4207, 4209, 4251, 4256, 32768, 10939, 99, 101, 100, 101, 115, 1024, 59, 69, 83, 84, 4223, 4225, 4232, 4244, 32768, 8826, 113, 117, 97, 108, 59, 32768, 10927, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8828, 105, 108, 100, 101, 59, 32768, 8830, 109, 101, 59, 32768, 8243, 512, 100, 112, 4261, 4267, 117, 99, 116, 59, 32768, 8719, 111, 114, 116, 105, 111, 110, 512, 59, 97, 4278, 4280, 32768, 8759, 108, 59, 32768, 8733, 512, 99, 105, 4289, 4294, 114, 59, 32896, 55349, 56491, 59, 32768, 936, 1024, 85, 102, 111, 115, 4306, 4313, 4318, 4323, 79, 84, 33024, 34, 59, 32768, 34, 114, 59, 32896, 55349, 56596, 112, 102, 59, 32768, 8474, 99, 114, 59, 32896, 55349, 56492, 3072, 66, 69, 97, 99, 101, 102, 104, 105, 111, 114, 115, 117, 4354, 4360, 4366, 4395, 4417, 4473, 4477, 4481, 4743, 4764, 4776, 4788, 97, 114, 114, 59, 32768, 10512, 71, 33024, 174, 59, 32768, 174, 768, 99, 110, 114, 4373, 4379, 4383, 117, 116, 101, 59, 32768, 340, 103, 59, 32768, 10219, 114, 512, 59, 116, 4389, 4391, 32768, 8608, 108, 59, 32768, 10518, 768, 97, 101, 121, 4402, 4408, 4414, 114, 111, 110, 59, 32768, 344, 100, 105, 108, 59, 32768, 342, 59, 32768, 1056, 512, 59, 118, 4422, 4424, 32768, 8476, 101, 114, 115, 101, 512, 69, 85, 4433, 4458, 512, 108, 113, 4438, 4446, 101, 109, 101, 110, 116, 59, 32768, 8715, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 8651, 112, 69, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 10607, 114, 59, 32768, 8476, 111, 59, 32768, 929, 103, 104, 116, 2048, 65, 67, 68, 70, 84, 85, 86, 97, 4501, 4547, 4556, 4607, 4614, 4671, 4719, 4736, 512, 110, 114, 4506, 4519, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10217, 114, 111, 119, 768, 59, 66, 76, 4529, 4531, 4536, 32768, 8594, 97, 114, 59, 32768, 8677, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8644, 101, 105, 108, 105, 110, 103, 59, 32768, 8969, 111, 838, 4562, 0, 4575, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 32768, 10215, 110, 805, 4580, 0, 4591, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10589, 101, 99, 116, 111, 114, 512, 59, 66, 4600, 4602, 32768, 8642, 97, 114, 59, 32768, 10581, 108, 111, 111, 114, 59, 32768, 8971, 512, 101, 114, 4619, 4644, 101, 768, 59, 65, 86, 4627, 4629, 4636, 32768, 8866, 114, 114, 111, 119, 59, 32768, 8614, 101, 99, 116, 111, 114, 59, 32768, 10587, 105, 97, 110, 103, 108, 101, 768, 59, 66, 69, 4657, 4659, 4664, 32768, 8883, 97, 114, 59, 32768, 10704, 113, 117, 97, 108, 59, 32768, 8885, 112, 768, 68, 84, 86, 4679, 4691, 4702, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 32768, 10575, 101, 101, 86, 101, 99, 116, 111, 114, 59, 32768, 10588, 101, 99, 116, 111, 114, 512, 59, 66, 4712, 4714, 32768, 8638, 97, 114, 59, 32768, 10580, 101, 99, 116, 111, 114, 512, 59, 66, 4729, 4731, 32768, 8640, 97, 114, 59, 32768, 10579, 114, 114, 111, 119, 59, 32768, 8658, 512, 112, 117, 4748, 4752, 102, 59, 32768, 8477, 110, 100, 73, 109, 112, 108, 105, 101, 115, 59, 32768, 10608, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8667, 512, 99, 104, 4781, 4785, 114, 59, 32768, 8475, 59, 32768, 8625, 108, 101, 68, 101, 108, 97, 121, 101, 100, 59, 32768, 10740, 3328, 72, 79, 97, 99, 102, 104, 105, 109, 111, 113, 115, 116, 117, 4827, 4842, 4849, 4856, 4889, 4894, 4949, 4955, 4967, 4973, 5059, 5065, 5070, 512, 67, 99, 4832, 4838, 72, 99, 121, 59, 32768, 1065, 121, 59, 32768, 1064, 70, 84, 99, 121, 59, 32768, 1068, 99, 117, 116, 101, 59, 32768, 346, 1280, 59, 97, 101, 105, 121, 4867, 4869, 4875, 4881, 4886, 32768, 10940, 114, 111, 110, 59, 32768, 352, 100, 105, 108, 59, 32768, 350, 114, 99, 59, 32768, 348, 59, 32768, 1057, 114, 59, 32896, 55349, 56598, 111, 114, 116, 1024, 68, 76, 82, 85, 4906, 4917, 4928, 4940, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8595, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8592, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8594, 112, 65, 114, 114, 111, 119, 59, 32768, 8593, 103, 109, 97, 59, 32768, 931, 97, 108, 108, 67, 105, 114, 99, 108, 101, 59, 32768, 8728, 112, 102, 59, 32896, 55349, 56650, 1091, 4979, 0, 0, 4983, 116, 59, 32768, 8730, 97, 114, 101, 1024, 59, 73, 83, 85, 4994, 4996, 5010, 5052, 32768, 9633, 110, 116, 101, 114, 115, 101, 99, 116, 105, 111, 110, 59, 32768, 8851, 117, 512, 98, 112, 5016, 5033, 115, 101, 116, 512, 59, 69, 5024, 5026, 32768, 8847, 113, 117, 97, 108, 59, 32768, 8849, 101, 114, 115, 101, 116, 512, 59, 69, 5043, 5045, 32768, 8848, 113, 117, 97, 108, 59, 32768, 8850, 110, 105, 111, 110, 59, 32768, 8852, 99, 114, 59, 32896, 55349, 56494, 97, 114, 59, 32768, 8902, 1024, 98, 99, 109, 112, 5079, 5102, 5155, 5158, 512, 59, 115, 5084, 5086, 32768, 8912, 101, 116, 512, 59, 69, 5093, 5095, 32768, 8912, 113, 117, 97, 108, 59, 32768, 8838, 512, 99, 104, 5107, 5148, 101, 101, 100, 115, 1024, 59, 69, 83, 84, 5120, 5122, 5129, 5141, 32768, 8827, 113, 117, 97, 108, 59, 32768, 10928, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 32768, 8829, 105, 108, 100, 101, 59, 32768, 8831, 84, 104, 97, 116, 59, 32768, 8715, 59, 32768, 8721, 768, 59, 101, 115, 5165, 5167, 5185, 32768, 8913, 114, 115, 101, 116, 512, 59, 69, 5176, 5178, 32768, 8835, 113, 117, 97, 108, 59, 32768, 8839, 101, 116, 59, 32768, 8913, 2816, 72, 82, 83, 97, 99, 102, 104, 105, 111, 114, 115, 5213, 5221, 5227, 5241, 5252, 5274, 5279, 5323, 5362, 5368, 5378, 79, 82, 78, 33024, 222, 59, 32768, 222, 65, 68, 69, 59, 32768, 8482, 512, 72, 99, 5232, 5237, 99, 121, 59, 32768, 1035, 121, 59, 32768, 1062, 512, 98, 117, 5246, 5249, 59, 32768, 9, 59, 32768, 932, 768, 97, 101, 121, 5259, 5265, 5271, 114, 111, 110, 59, 32768, 356, 100, 105, 108, 59, 32768, 354, 59, 32768, 1058, 114, 59, 32896, 55349, 56599, 512, 101, 105, 5284, 5300, 835, 5289, 0, 5297, 101, 102, 111, 114, 101, 59, 32768, 8756, 97, 59, 32768, 920, 512, 99, 110, 5305, 5315, 107, 83, 112, 97, 99, 101, 59, 32896, 8287, 8202, 83, 112, 97, 99, 101, 59, 32768, 8201, 108, 100, 101, 1024, 59, 69, 70, 84, 5335, 5337, 5344, 5355, 32768, 8764, 113, 117, 97, 108, 59, 32768, 8771, 117, 108, 108, 69, 113, 117, 97, 108, 59, 32768, 8773, 105, 108, 100, 101, 59, 32768, 8776, 112, 102, 59, 32896, 55349, 56651, 105, 112, 108, 101, 68, 111, 116, 59, 32768, 8411, 512, 99, 116, 5383, 5388, 114, 59, 32896, 55349, 56495, 114, 111, 107, 59, 32768, 358, 5426, 5417, 5444, 5458, 5473, 0, 5480, 5485, 0, 0, 0, 0, 0, 5494, 5500, 5564, 5579, 0, 5726, 5732, 5738, 5745, 512, 99, 114, 5421, 5429, 117, 116, 101, 33024, 218, 59, 32768, 218, 114, 512, 59, 111, 5435, 5437, 32768, 8607, 99, 105, 114, 59, 32768, 10569, 114, 820, 5449, 0, 5453, 121, 59, 32768, 1038, 118, 101, 59, 32768, 364, 512, 105, 121, 5462, 5469, 114, 99, 33024, 219, 59, 32768, 219, 59, 32768, 1059, 98, 108, 97, 99, 59, 32768, 368, 114, 59, 32896, 55349, 56600, 114, 97, 118, 101, 33024, 217, 59, 32768, 217, 97, 99, 114, 59, 32768, 362, 512, 100, 105, 5504, 5548, 101, 114, 512, 66, 80, 5511, 5535, 512, 97, 114, 5516, 5520, 114, 59, 32768, 95, 97, 99, 512, 101, 107, 5527, 5530, 59, 32768, 9183, 101, 116, 59, 32768, 9141, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 32768, 9181, 111, 110, 512, 59, 80, 5555, 5557, 32768, 8899, 108, 117, 115, 59, 32768, 8846, 512, 103, 112, 5568, 5573, 111, 110, 59, 32768, 370, 102, 59, 32896, 55349, 56652, 2048, 65, 68, 69, 84, 97, 100, 112, 115, 5595, 5624, 5635, 5648, 5664, 5671, 5682, 5712, 114, 114, 111, 119, 768, 59, 66, 68, 5606, 5608, 5613, 32768, 8593, 97, 114, 59, 32768, 10514, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8645, 111, 119, 110, 65, 114, 114, 111, 119, 59, 32768, 8597, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 32768, 10606, 101, 101, 512, 59, 65, 5655, 5657, 32768, 8869, 114, 114, 111, 119, 59, 32768, 8613, 114, 114, 111, 119, 59, 32768, 8657, 111, 119, 110, 97, 114, 114, 111, 119, 59, 32768, 8661, 101, 114, 512, 76, 82, 5689, 5700, 101, 102, 116, 65, 114, 114, 111, 119, 59, 32768, 8598, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 32768, 8599, 105, 512, 59, 108, 5718, 5720, 32768, 978, 111, 110, 59, 32768, 933, 105, 110, 103, 59, 32768, 366, 99, 114, 59, 32896, 55349, 56496, 105, 108, 100, 101, 59, 32768, 360, 109, 108, 33024, 220, 59, 32768, 220, 2304, 68, 98, 99, 100, 101, 102, 111, 115, 118, 5770, 5776, 5781, 5785, 5798, 5878, 5883, 5889, 5895, 97, 115, 104, 59, 32768, 8875, 97, 114, 59, 32768, 10987, 121, 59, 32768, 1042, 97, 115, 104, 512, 59, 108, 5793, 5795, 32768, 8873, 59, 32768, 10982, 512, 101, 114, 5803, 5806, 59, 32768, 8897, 768, 98, 116, 121, 5813, 5818, 5866, 97, 114, 59, 32768, 8214, 512, 59, 105, 5823, 5825, 32768, 8214, 99, 97, 108, 1024, 66, 76, 83, 84, 5837, 5842, 5848, 5859, 97, 114, 59, 32768, 8739, 105, 110, 101, 59, 32768, 124, 101, 112, 97, 114, 97, 116, 111, 114, 59, 32768, 10072, 105, 108, 100, 101, 59, 32768, 8768, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 32768, 8202, 114, 59, 32896, 55349, 56601, 112, 102, 59, 32896, 55349, 56653, 99, 114, 59, 32896, 55349, 56497, 100, 97, 115, 104, 59, 32768, 8874, 1280, 99, 101, 102, 111, 115, 5913, 5919, 5925, 5930, 5936, 105, 114, 99, 59, 32768, 372, 100, 103, 101, 59, 32768, 8896, 114, 59, 32896, 55349, 56602, 112, 102, 59, 32896, 55349, 56654, 99, 114, 59, 32896, 55349, 56498, 1024, 102, 105, 111, 115, 5951, 5956, 5959, 5965, 114, 59, 32896, 55349, 56603, 59, 32768, 926, 112, 102, 59, 32896, 55349, 56655, 99, 114, 59, 32896, 55349, 56499, 2304, 65, 73, 85, 97, 99, 102, 111, 115, 117, 5990, 5995, 6e3, 6005, 6014, 6027, 6032, 6038, 6044, 99, 121, 59, 32768, 1071, 99, 121, 59, 32768, 1031, 99, 121, 59, 32768, 1070, 99, 117, 116, 101, 33024, 221, 59, 32768, 221, 512, 105, 121, 6019, 6024, 114, 99, 59, 32768, 374, 59, 32768, 1067, 114, 59, 32896, 55349, 56604, 112, 102, 59, 32896, 55349, 56656, 99, 114, 59, 32896, 55349, 56500, 109, 108, 59, 32768, 376, 2048, 72, 97, 99, 100, 101, 102, 111, 115, 6066, 6071, 6078, 6092, 6097, 6119, 6123, 6128, 99, 121, 59, 32768, 1046, 99, 117, 116, 101, 59, 32768, 377, 512, 97, 121, 6083, 6089, 114, 111, 110, 59, 32768, 381, 59, 32768, 1047, 111, 116, 59, 32768, 379, 835, 6102, 0, 6116, 111, 87, 105, 100, 116, 104, 83, 112, 97, 99, 101, 59, 32768, 8203, 97, 59, 32768, 918, 114, 59, 32768, 8488, 112, 102, 59, 32768, 8484, 99, 114, 59, 32896, 55349, 56501, 5938, 6159, 6168, 6175, 0, 6214, 6222, 6233, 0, 0, 0, 0, 6242, 6267, 6290, 6429, 6444, 0, 6495, 6503, 6531, 6540, 0, 6547, 99, 117, 116, 101, 33024, 225, 59, 32768, 225, 114, 101, 118, 101, 59, 32768, 259, 1536, 59, 69, 100, 105, 117, 121, 6187, 6189, 6193, 6196, 6203, 6210, 32768, 8766, 59, 32896, 8766, 819, 59, 32768, 8767, 114, 99, 33024, 226, 59, 32768, 226, 116, 101, 33024, 180, 59, 32768, 180, 59, 32768, 1072, 108, 105, 103, 33024, 230, 59, 32768, 230, 512, 59, 114, 6226, 6228, 32768, 8289, 59, 32896, 55349, 56606, 114, 97, 118, 101, 33024, 224, 59, 32768, 224, 512, 101, 112, 6246, 6261, 512, 102, 112, 6251, 6257, 115, 121, 109, 59, 32768, 8501, 104, 59, 32768, 8501, 104, 97, 59, 32768, 945, 512, 97, 112, 6271, 6284, 512, 99, 108, 6276, 6280, 114, 59, 32768, 257, 103, 59, 32768, 10815, 33024, 38, 59, 32768, 38, 1077, 6295, 0, 0, 6326, 1280, 59, 97, 100, 115, 118, 6305, 6307, 6312, 6315, 6322, 32768, 8743, 110, 100, 59, 32768, 10837, 59, 32768, 10844, 108, 111, 112, 101, 59, 32768, 10840, 59, 32768, 10842, 1792, 59, 101, 108, 109, 114, 115, 122, 6340, 6342, 6345, 6349, 6391, 6410, 6422, 32768, 8736, 59, 32768, 10660, 101, 59, 32768, 8736, 115, 100, 512, 59, 97, 6356, 6358, 32768, 8737, 2098, 6368, 6371, 6374, 6377, 6380, 6383, 6386, 6389, 59, 32768, 10664, 59, 32768, 10665, 59, 32768, 10666, 59, 32768, 10667, 59, 32768, 10668, 59, 32768, 10669, 59, 32768, 10670, 59, 32768, 10671, 116, 512, 59, 118, 6397, 6399, 32768, 8735, 98, 512, 59, 100, 6405, 6407, 32768, 8894, 59, 32768, 10653, 512, 112, 116, 6415, 6419, 104, 59, 32768, 8738, 59, 32768, 197, 97, 114, 114, 59, 32768, 9084, 512, 103, 112, 6433, 6438, 111, 110, 59, 32768, 261, 102, 59, 32896, 55349, 56658, 1792, 59, 69, 97, 101, 105, 111, 112, 6458, 6460, 6463, 6469, 6472, 6476, 6480, 32768, 8776, 59, 32768, 10864, 99, 105, 114, 59, 32768, 10863, 59, 32768, 8778, 100, 59, 32768, 8779, 115, 59, 32768, 39, 114, 111, 120, 512, 59, 101, 6488, 6490, 32768, 8776, 113, 59, 32768, 8778, 105, 110, 103, 33024, 229, 59, 32768, 229, 768, 99, 116, 121, 6509, 6514, 6517, 114, 59, 32896, 55349, 56502, 59, 32768, 42, 109, 112, 512, 59, 101, 6524, 6526, 32768, 8776, 113, 59, 32768, 8781, 105, 108, 100, 101, 33024, 227, 59, 32768, 227, 109, 108, 33024, 228, 59, 32768, 228, 512, 99, 105, 6551, 6559, 111, 110, 105, 110, 116, 59, 32768, 8755, 110, 116, 59, 32768, 10769, 4096, 78, 97, 98, 99, 100, 101, 102, 105, 107, 108, 110, 111, 112, 114, 115, 117, 6597, 6602, 6673, 6688, 6701, 6707, 6768, 6773, 6891, 6898, 6999, 7023, 7309, 7316, 7334, 7383, 111, 116, 59, 32768, 10989, 512, 99, 114, 6607, 6652, 107, 1024, 99, 101, 112, 115, 6617, 6623, 6632, 6639, 111, 110, 103, 59, 32768, 8780, 112, 115, 105, 108, 111, 110, 59, 32768, 1014, 114, 105, 109, 101, 59, 32768, 8245, 105, 109, 512, 59, 101, 6646, 6648, 32768, 8765, 113, 59, 32768, 8909, 583, 6656, 6661, 101, 101, 59, 32768, 8893, 101, 100, 512, 59, 103, 6667, 6669, 32768, 8965, 101, 59, 32768, 8965, 114, 107, 512, 59, 116, 6680, 6682, 32768, 9141, 98, 114, 107, 59, 32768, 9142, 512, 111, 121, 6693, 6698, 110, 103, 59, 32768, 8780, 59, 32768, 1073, 113, 117, 111, 59, 32768, 8222, 1280, 99, 109, 112, 114, 116, 6718, 6731, 6738, 6743, 6749, 97, 117, 115, 512, 59, 101, 6726, 6728, 32768, 8757, 59, 32768, 8757, 112, 116, 121, 118, 59, 32768, 10672, 115, 105, 59, 32768, 1014, 110, 111, 117, 59, 32768, 8492, 768, 97, 104, 119, 6756, 6759, 6762, 59, 32768, 946, 59, 32768, 8502, 101, 101, 110, 59, 32768, 8812, 114, 59, 32896, 55349, 56607, 103, 1792, 99, 111, 115, 116, 117, 118, 119, 6789, 6809, 6834, 6850, 6872, 6879, 6884, 768, 97, 105, 117, 6796, 6800, 6805, 112, 59, 32768, 8898, 114, 99, 59, 32768, 9711, 112, 59, 32768, 8899, 768, 100, 112, 116, 6816, 6821, 6827, 111, 116, 59, 32768, 10752, 108, 117, 115, 59, 32768, 10753, 105, 109, 101, 115, 59, 32768, 10754, 1090, 6840, 0, 0, 6846, 99, 117, 112, 59, 32768, 10758, 97, 114, 59, 32768, 9733, 114, 105, 97, 110, 103, 108, 101, 512, 100, 117, 6862, 6868, 111, 119, 110, 59, 32768, 9661, 112, 59, 32768, 9651, 112, 108, 117, 115, 59, 32768, 10756, 101, 101, 59, 32768, 8897, 101, 100, 103, 101, 59, 32768, 8896, 97, 114, 111, 119, 59, 32768, 10509, 768, 97, 107, 111, 6905, 6976, 6994, 512, 99, 110, 6910, 6972, 107, 768, 108, 115, 116, 6918, 6927, 6935, 111, 122, 101, 110, 103, 101, 59, 32768, 10731, 113, 117, 97, 114, 101, 59, 32768, 9642, 114, 105, 97, 110, 103, 108, 101, 1024, 59, 100, 108, 114, 6951, 6953, 6959, 6965, 32768, 9652, 111, 119, 110, 59, 32768, 9662, 101, 102, 116, 59, 32768, 9666, 105, 103, 104, 116, 59, 32768, 9656, 107, 59, 32768, 9251, 770, 6981, 0, 6991, 771, 6985, 0, 6988, 59, 32768, 9618, 59, 32768, 9617, 52, 59, 32768, 9619, 99, 107, 59, 32768, 9608, 512, 101, 111, 7004, 7019, 512, 59, 113, 7009, 7012, 32896, 61, 8421, 117, 105, 118, 59, 32896, 8801, 8421, 116, 59, 32768, 8976, 1024, 112, 116, 119, 120, 7032, 7037, 7049, 7055, 102, 59, 32896, 55349, 56659, 512, 59, 116, 7042, 7044, 32768, 8869, 111, 109, 59, 32768, 8869, 116, 105, 101, 59, 32768, 8904, 3072, 68, 72, 85, 86, 98, 100, 104, 109, 112, 116, 117, 118, 7080, 7101, 7126, 7147, 7182, 7187, 7208, 7233, 7240, 7246, 7253, 7274, 1024, 76, 82, 108, 114, 7089, 7092, 7095, 7098, 59, 32768, 9559, 59, 32768, 9556, 59, 32768, 9558, 59, 32768, 9555, 1280, 59, 68, 85, 100, 117, 7112, 7114, 7117, 7120, 7123, 32768, 9552, 59, 32768, 9574, 59, 32768, 9577, 59, 32768, 9572, 59, 32768, 9575, 1024, 76, 82, 108, 114, 7135, 7138, 7141, 7144, 59, 32768, 9565, 59, 32768, 9562, 59, 32768, 9564, 59, 32768, 9561, 1792, 59, 72, 76, 82, 104, 108, 114, 7162, 7164, 7167, 7170, 7173, 7176, 7179, 32768, 9553, 59, 32768, 9580, 59, 32768, 9571, 59, 32768, 9568, 59, 32768, 9579, 59, 32768, 9570, 59, 32768, 9567, 111, 120, 59, 32768, 10697, 1024, 76, 82, 108, 114, 7196, 7199, 7202, 7205, 59, 32768, 9557, 59, 32768, 9554, 59, 32768, 9488, 59, 32768, 9484, 1280, 59, 68, 85, 100, 117, 7219, 7221, 7224, 7227, 7230, 32768, 9472, 59, 32768, 9573, 59, 32768, 9576, 59, 32768, 9516, 59, 32768, 9524, 105, 110, 117, 115, 59, 32768, 8863, 108, 117, 115, 59, 32768, 8862, 105, 109, 101, 115, 59, 32768, 8864, 1024, 76, 82, 108, 114, 7262, 7265, 7268, 7271, 59, 32768, 9563, 59, 32768, 9560, 59, 32768, 9496, 59, 32768, 9492, 1792, 59, 72, 76, 82, 104, 108, 114, 7289, 7291, 7294, 7297, 7300, 7303, 7306, 32768, 9474, 59, 32768, 9578, 59, 32768, 9569, 59, 32768, 9566, 59, 32768, 9532, 59, 32768, 9508, 59, 32768, 9500, 114, 105, 109, 101, 59, 32768, 8245, 512, 101, 118, 7321, 7326, 118, 101, 59, 32768, 728, 98, 97, 114, 33024, 166, 59, 32768, 166, 1024, 99, 101, 105, 111, 7343, 7348, 7353, 7364, 114, 59, 32896, 55349, 56503, 109, 105, 59, 32768, 8271, 109, 512, 59, 101, 7359, 7361, 32768, 8765, 59, 32768, 8909, 108, 768, 59, 98, 104, 7372, 7374, 7377, 32768, 92, 59, 32768, 10693, 115, 117, 98, 59, 32768, 10184, 573, 7387, 7399, 108, 512, 59, 101, 7392, 7394, 32768, 8226, 116, 59, 32768, 8226, 112, 768, 59, 69, 101, 7406, 7408, 7411, 32768, 8782, 59, 32768, 10926, 512, 59, 113, 7416, 7418, 32768, 8783, 59, 32768, 8783, 6450, 7448, 0, 7523, 7571, 7576, 7613, 0, 7618, 7647, 0, 0, 7764, 0, 0, 7779, 0, 0, 7899, 7914, 7949, 7955, 0, 8158, 0, 8176, 768, 99, 112, 114, 7454, 7460, 7509, 117, 116, 101, 59, 32768, 263, 1536, 59, 97, 98, 99, 100, 115, 7473, 7475, 7480, 7487, 7500, 7505, 32768, 8745, 110, 100, 59, 32768, 10820, 114, 99, 117, 112, 59, 32768, 10825, 512, 97, 117, 7492, 7496, 112, 59, 32768, 10827, 112, 59, 32768, 10823, 111, 116, 59, 32768, 10816, 59, 32896, 8745, 65024, 512, 101, 111, 7514, 7518, 116, 59, 32768, 8257, 110, 59, 32768, 711, 1024, 97, 101, 105, 117, 7531, 7544, 7552, 7557, 833, 7536, 0, 7540, 115, 59, 32768, 10829, 111, 110, 59, 32768, 269, 100, 105, 108, 33024, 231, 59, 32768, 231, 114, 99, 59, 32768, 265, 112, 115, 512, 59, 115, 7564, 7566, 32768, 10828, 109, 59, 32768, 10832, 111, 116, 59, 32768, 267, 768, 100, 109, 110, 7582, 7589, 7596, 105, 108, 33024, 184, 59, 32768, 184, 112, 116, 121, 118, 59, 32768, 10674, 116, 33280, 162, 59, 101, 7603, 7605, 32768, 162, 114, 100, 111, 116, 59, 32768, 183, 114, 59, 32896, 55349, 56608, 768, 99, 101, 105, 7624, 7628, 7643, 121, 59, 32768, 1095, 99, 107, 512, 59, 109, 7635, 7637, 32768, 10003, 97, 114, 107, 59, 32768, 10003, 59, 32768, 967, 114, 1792, 59, 69, 99, 101, 102, 109, 115, 7662, 7664, 7667, 7742, 7745, 7752, 7757, 32768, 9675, 59, 32768, 10691, 768, 59, 101, 108, 7674, 7676, 7680, 32768, 710, 113, 59, 32768, 8791, 101, 1074, 7687, 0, 0, 7709, 114, 114, 111, 119, 512, 108, 114, 7695, 7701, 101, 102, 116, 59, 32768, 8634, 105, 103, 104, 116, 59, 32768, 8635, 1280, 82, 83, 97, 99, 100, 7719, 7722, 7725, 7730, 7736, 59, 32768, 174, 59, 32768, 9416, 115, 116, 59, 32768, 8859, 105, 114, 99, 59, 32768, 8858, 97, 115, 104, 59, 32768, 8861, 59, 32768, 8791, 110, 105, 110, 116, 59, 32768, 10768, 105, 100, 59, 32768, 10991, 99, 105, 114, 59, 32768, 10690, 117, 98, 115, 512, 59, 117, 7771, 7773, 32768, 9827, 105, 116, 59, 32768, 9827, 1341, 7785, 7804, 7850, 0, 7871, 111, 110, 512, 59, 101, 7791, 7793, 32768, 58, 512, 59, 113, 7798, 7800, 32768, 8788, 59, 32768, 8788, 1086, 7809, 0, 0, 7820, 97, 512, 59, 116, 7814, 7816, 32768, 44, 59, 32768, 64, 768, 59, 102, 108, 7826, 7828, 7832, 32768, 8705, 110, 59, 32768, 8728, 101, 512, 109, 120, 7838, 7844, 101, 110, 116, 59, 32768, 8705, 101, 115, 59, 32768, 8450, 824, 7854, 0, 7866, 512, 59, 100, 7858, 7860, 32768, 8773, 111, 116, 59, 32768, 10861, 110, 116, 59, 32768, 8750, 768, 102, 114, 121, 7877, 7881, 7886, 59, 32896, 55349, 56660, 111, 100, 59, 32768, 8720, 33280, 169, 59, 115, 7892, 7894, 32768, 169, 114, 59, 32768, 8471, 512, 97, 111, 7903, 7908, 114, 114, 59, 32768, 8629, 115, 115, 59, 32768, 10007, 512, 99, 117, 7918, 7923, 114, 59, 32896, 55349, 56504, 512, 98, 112, 7928, 7938, 512, 59, 101, 7933, 7935, 32768, 10959, 59, 32768, 10961, 512, 59, 101, 7943, 7945, 32768, 10960, 59, 32768, 10962, 100, 111, 116, 59, 32768, 8943, 1792, 100, 101, 108, 112, 114, 118, 119, 7969, 7983, 7996, 8009, 8057, 8147, 8152, 97, 114, 114, 512, 108, 114, 7977, 7980, 59, 32768, 10552, 59, 32768, 10549, 1089, 7989, 0, 0, 7993, 114, 59, 32768, 8926, 99, 59, 32768, 8927, 97, 114, 114, 512, 59, 112, 8004, 8006, 32768, 8630, 59, 32768, 10557, 1536, 59, 98, 99, 100, 111, 115, 8022, 8024, 8031, 8044, 8049, 8053, 32768, 8746, 114, 99, 97, 112, 59, 32768, 10824, 512, 97, 117, 8036, 8040, 112, 59, 32768, 10822, 112, 59, 32768, 10826, 111, 116, 59, 32768, 8845, 114, 59, 32768, 10821, 59, 32896, 8746, 65024, 1024, 97, 108, 114, 118, 8066, 8078, 8116, 8123, 114, 114, 512, 59, 109, 8073, 8075, 32768, 8631, 59, 32768, 10556, 121, 768, 101, 118, 119, 8086, 8104, 8109, 113, 1089, 8093, 0, 0, 8099, 114, 101, 99, 59, 32768, 8926, 117, 99, 99, 59, 32768, 8927, 101, 101, 59, 32768, 8910, 101, 100, 103, 101, 59, 32768, 8911, 101, 110, 33024, 164, 59, 32768, 164, 101, 97, 114, 114, 111, 119, 512, 108, 114, 8134, 8140, 101, 102, 116, 59, 32768, 8630, 105, 103, 104, 116, 59, 32768, 8631, 101, 101, 59, 32768, 8910, 101, 100, 59, 32768, 8911, 512, 99, 105, 8162, 8170, 111, 110, 105, 110, 116, 59, 32768, 8754, 110, 116, 59, 32768, 8753, 108, 99, 116, 121, 59, 32768, 9005, 4864, 65, 72, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 111, 114, 115, 116, 117, 119, 122, 8221, 8226, 8231, 8267, 8282, 8296, 8327, 8351, 8366, 8379, 8466, 8471, 8487, 8621, 8647, 8676, 8697, 8712, 8720, 114, 114, 59, 32768, 8659, 97, 114, 59, 32768, 10597, 1024, 103, 108, 114, 115, 8240, 8246, 8252, 8256, 103, 101, 114, 59, 32768, 8224, 101, 116, 104, 59, 32768, 8504, 114, 59, 32768, 8595, 104, 512, 59, 118, 8262, 8264, 32768, 8208, 59, 32768, 8867, 572, 8271, 8278, 97, 114, 111, 119, 59, 32768, 10511, 97, 99, 59, 32768, 733, 512, 97, 121, 8287, 8293, 114, 111, 110, 59, 32768, 271, 59, 32768, 1076, 768, 59, 97, 111, 8303, 8305, 8320, 32768, 8518, 512, 103, 114, 8310, 8316, 103, 101, 114, 59, 32768, 8225, 114, 59, 32768, 8650, 116, 115, 101, 113, 59, 32768, 10871, 768, 103, 108, 109, 8334, 8339, 8344, 33024, 176, 59, 32768, 176, 116, 97, 59, 32768, 948, 112, 116, 121, 118, 59, 32768, 10673, 512, 105, 114, 8356, 8362, 115, 104, 116, 59, 32768, 10623, 59, 32896, 55349, 56609, 97, 114, 512, 108, 114, 8373, 8376, 59, 32768, 8643, 59, 32768, 8642, 1280, 97, 101, 103, 115, 118, 8390, 8418, 8421, 8428, 8433, 109, 768, 59, 111, 115, 8398, 8400, 8415, 32768, 8900, 110, 100, 512, 59, 115, 8407, 8409, 32768, 8900, 117, 105, 116, 59, 32768, 9830, 59, 32768, 9830, 59, 32768, 168, 97, 109, 109, 97, 59, 32768, 989, 105, 110, 59, 32768, 8946, 768, 59, 105, 111, 8440, 8442, 8461, 32768, 247, 100, 101, 33280, 247, 59, 111, 8450, 8452, 32768, 247, 110, 116, 105, 109, 101, 115, 59, 32768, 8903, 110, 120, 59, 32768, 8903, 99, 121, 59, 32768, 1106, 99, 1088, 8478, 0, 0, 8483, 114, 110, 59, 32768, 8990, 111, 112, 59, 32768, 8973, 1280, 108, 112, 116, 117, 119, 8498, 8504, 8509, 8556, 8570, 108, 97, 114, 59, 32768, 36, 102, 59, 32896, 55349, 56661, 1280, 59, 101, 109, 112, 115, 8520, 8522, 8535, 8542, 8548, 32768, 729, 113, 512, 59, 100, 8528, 8530, 32768, 8784, 111, 116, 59, 32768, 8785, 105, 110, 117, 115, 59, 32768, 8760, 108, 117, 115, 59, 32768, 8724, 113, 117, 97, 114, 101, 59, 32768, 8865, 98, 108, 101, 98, 97, 114, 119, 101, 100, 103, 101, 59, 32768, 8966, 110, 768, 97, 100, 104, 8578, 8585, 8597, 114, 114, 111, 119, 59, 32768, 8595, 111, 119, 110, 97, 114, 114, 111, 119, 115, 59, 32768, 8650, 97, 114, 112, 111, 111, 110, 512, 108, 114, 8608, 8614, 101, 102, 116, 59, 32768, 8643, 105, 103, 104, 116, 59, 32768, 8642, 563, 8625, 8633, 107, 97, 114, 111, 119, 59, 32768, 10512, 1088, 8638, 0, 0, 8643, 114, 110, 59, 32768, 8991, 111, 112, 59, 32768, 8972, 768, 99, 111, 116, 8654, 8666, 8670, 512, 114, 121, 8659, 8663, 59, 32896, 55349, 56505, 59, 32768, 1109, 108, 59, 32768, 10742, 114, 111, 107, 59, 32768, 273, 512, 100, 114, 8681, 8686, 111, 116, 59, 32768, 8945, 105, 512, 59, 102, 8692, 8694, 32768, 9663, 59, 32768, 9662, 512, 97, 104, 8702, 8707, 114, 114, 59, 32768, 8693, 97, 114, 59, 32768, 10607, 97, 110, 103, 108, 101, 59, 32768, 10662, 512, 99, 105, 8725, 8729, 121, 59, 32768, 1119, 103, 114, 97, 114, 114, 59, 32768, 10239, 4608, 68, 97, 99, 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 120, 8774, 8788, 8807, 8844, 8849, 8852, 8866, 8895, 8929, 8977, 8989, 9004, 9046, 9136, 9151, 9171, 9184, 9199, 512, 68, 111, 8779, 8784, 111, 116, 59, 32768, 10871, 116, 59, 32768, 8785, 512, 99, 115, 8793, 8801, 117, 116, 101, 33024, 233, 59, 32768, 233, 116, 101, 114, 59, 32768, 10862, 1024, 97, 105, 111, 121, 8816, 8822, 8835, 8841, 114, 111, 110, 59, 32768, 283, 114, 512, 59, 99, 8828, 8830, 32768, 8790, 33024, 234, 59, 32768, 234, 108, 111, 110, 59, 32768, 8789, 59, 32768, 1101, 111, 116, 59, 32768, 279, 59, 32768, 8519, 512, 68, 114, 8857, 8862, 111, 116, 59, 32768, 8786, 59, 32896, 55349, 56610, 768, 59, 114, 115, 8873, 8875, 8883, 32768, 10906, 97, 118, 101, 33024, 232, 59, 32768, 232, 512, 59, 100, 8888, 8890, 32768, 10902, 111, 116, 59, 32768, 10904, 1024, 59, 105, 108, 115, 8904, 8906, 8914, 8917, 32768, 10905, 110, 116, 101, 114, 115, 59, 32768, 9191, 59, 32768, 8467, 512, 59, 100, 8922, 8924, 32768, 10901, 111, 116, 59, 32768, 10903, 768, 97, 112, 115, 8936, 8941, 8960, 99, 114, 59, 32768, 275, 116, 121, 768, 59, 115, 118, 8950, 8952, 8957, 32768, 8709, 101, 116, 59, 32768, 8709, 59, 32768, 8709, 112, 512, 49, 59, 8966, 8975, 516, 8970, 8973, 59, 32768, 8196, 59, 32768, 8197, 32768, 8195, 512, 103, 115, 8982, 8985, 59, 32768, 331, 112, 59, 32768, 8194, 512, 103, 112, 8994, 8999, 111, 110, 59, 32768, 281, 102, 59, 32896, 55349, 56662, 768, 97, 108, 115, 9011, 9023, 9028, 114, 512, 59, 115, 9017, 9019, 32768, 8917, 108, 59, 32768, 10723, 117, 115, 59, 32768, 10865, 105, 768, 59, 108, 118, 9036, 9038, 9043, 32768, 949, 111, 110, 59, 32768, 949, 59, 32768, 1013, 1024, 99, 115, 117, 118, 9055, 9071, 9099, 9128, 512, 105, 111, 9060, 9065, 114, 99, 59, 32768, 8790, 108, 111, 110, 59, 32768, 8789, 1082, 9077, 0, 0, 9081, 109, 59, 32768, 8770, 97, 110, 116, 512, 103, 108, 9088, 9093, 116, 114, 59, 32768, 10902, 101, 115, 115, 59, 32768, 10901, 768, 97, 101, 105, 9106, 9111, 9116, 108, 115, 59, 32768, 61, 115, 116, 59, 32768, 8799, 118, 512, 59, 68, 9122, 9124, 32768, 8801, 68, 59, 32768, 10872, 112, 97, 114, 115, 108, 59, 32768, 10725, 512, 68, 97, 9141, 9146, 111, 116, 59, 32768, 8787, 114, 114, 59, 32768, 10609, 768, 99, 100, 105, 9158, 9162, 9167, 114, 59, 32768, 8495, 111, 116, 59, 32768, 8784, 109, 59, 32768, 8770, 512, 97, 104, 9176, 9179, 59, 32768, 951, 33024, 240, 59, 32768, 240, 512, 109, 114, 9189, 9195, 108, 33024, 235, 59, 32768, 235, 111, 59, 32768, 8364, 768, 99, 105, 112, 9206, 9210, 9215, 108, 59, 32768, 33, 115, 116, 59, 32768, 8707, 512, 101, 111, 9220, 9230, 99, 116, 97, 116, 105, 111, 110, 59, 32768, 8496, 110, 101, 110, 116, 105, 97, 108, 101, 59, 32768, 8519, 4914, 9262, 0, 9276, 0, 9280, 9287, 0, 0, 9318, 9324, 0, 9331, 0, 9352, 9357, 9386, 0, 9395, 9497, 108, 108, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 32768, 8786, 121, 59, 32768, 1092, 109, 97, 108, 101, 59, 32768, 9792, 768, 105, 108, 114, 9293, 9299, 9313, 108, 105, 103, 59, 32768, 64259, 1082, 9305, 0, 0, 9309, 103, 59, 32768, 64256, 105, 103, 59, 32768, 64260, 59, 32896, 55349, 56611, 108, 105, 103, 59, 32768, 64257, 108, 105, 103, 59, 32896, 102, 106, 768, 97, 108, 116, 9337, 9341, 9346, 116, 59, 32768, 9837, 105, 103, 59, 32768, 64258, 110, 115, 59, 32768, 9649, 111, 102, 59, 32768, 402, 833, 9361, 0, 9366, 102, 59, 32896, 55349, 56663, 512, 97, 107, 9370, 9375, 108, 108, 59, 32768, 8704, 512, 59, 118, 9380, 9382, 32768, 8916, 59, 32768, 10969, 97, 114, 116, 105, 110, 116, 59, 32768, 10765, 512, 97, 111, 9399, 9491, 512, 99, 115, 9404, 9487, 1794, 9413, 9443, 9453, 9470, 9474, 0, 9484, 1795, 9421, 9426, 9429, 9434, 9437, 0, 9440, 33024, 189, 59, 32768, 189, 59, 32768, 8531, 33024, 188, 59, 32768, 188, 59, 32768, 8533, 59, 32768, 8537, 59, 32768, 8539, 772, 9447, 0, 9450, 59, 32768, 8532, 59, 32768, 8534, 1285, 9459, 9464, 0, 0, 9467, 33024, 190, 59, 32768, 190, 59, 32768, 8535, 59, 32768, 8540, 53, 59, 32768, 8536, 775, 9478, 0, 9481, 59, 32768, 8538, 59, 32768, 8541, 56, 59, 32768, 8542, 108, 59, 32768, 8260, 119, 110, 59, 32768, 8994, 99, 114, 59, 32896, 55349, 56507, 4352, 69, 97, 98, 99, 100, 101, 102, 103, 105, 106, 108, 110, 111, 114, 115, 116, 118, 9537, 9547, 9575, 9582, 9595, 9600, 9679, 9684, 9694, 9700, 9705, 9725, 9773, 9779, 9785, 9810, 9917, 512, 59, 108, 9542, 9544, 32768, 8807, 59, 32768, 10892, 768, 99, 109, 112, 9554, 9560, 9572, 117, 116, 101, 59, 32768, 501, 109, 97, 512, 59, 100, 9567, 9569, 32768, 947, 59, 32768, 989, 59, 32768, 10886, 114, 101, 118, 101, 59, 32768, 287, 512, 105, 121, 9587, 9592, 114, 99, 59, 32768, 285, 59, 32768, 1075, 111, 116, 59, 32768, 289, 1024, 59, 108, 113, 115, 9609, 9611, 9614, 9633, 32768, 8805, 59, 32768, 8923, 768, 59, 113, 115, 9621, 9623, 9626, 32768, 8805, 59, 32768, 8807, 108, 97, 110, 116, 59, 32768, 10878, 1024, 59, 99, 100, 108, 9642, 9644, 9648, 9667, 32768, 10878, 99, 59, 32768, 10921, 111, 116, 512, 59, 111, 9655, 9657, 32768, 10880, 512, 59, 108, 9662, 9664, 32768, 10882, 59, 32768, 10884, 512, 59, 101, 9672, 9675, 32896, 8923, 65024, 115, 59, 32768, 10900, 114, 59, 32896, 55349, 56612, 512, 59, 103, 9689, 9691, 32768, 8811, 59, 32768, 8921, 109, 101, 108, 59, 32768, 8503, 99, 121, 59, 32768, 1107, 1024, 59, 69, 97, 106, 9714, 9716, 9719, 9722, 32768, 8823, 59, 32768, 10898, 59, 32768, 10917, 59, 32768, 10916, 1024, 69, 97, 101, 115, 9734, 9737, 9751, 9768, 59, 32768, 8809, 112, 512, 59, 112, 9743, 9745, 32768, 10890, 114, 111, 120, 59, 32768, 10890, 512, 59, 113, 9756, 9758, 32768, 10888, 512, 59, 113, 9763, 9765, 32768, 10888, 59, 32768, 8809, 105, 109, 59, 32768, 8935, 112, 102, 59, 32896, 55349, 56664, 97, 118, 101, 59, 32768, 96, 512, 99, 105, 9790, 9794, 114, 59, 32768, 8458, 109, 768, 59, 101, 108, 9802, 9804, 9807, 32768, 8819, 59, 32768, 10894, 59, 32768, 10896, 34304, 62, 59, 99, 100, 108, 113, 114, 9824, 9826, 9838, 9843, 9849, 9856, 32768, 62, 512, 99, 105, 9831, 9834, 59, 32768, 10919, 114, 59, 32768, 10874, 111, 116, 59, 32768, 8919, 80, 97, 114, 59, 32768, 10645, 117, 101, 115, 116, 59, 32768, 10876, 1280, 97, 100, 101, 108, 115, 9867, 9882, 9887, 9906, 9912, 833, 9872, 0, 9879, 112, 114, 111, 120, 59, 32768, 10886, 114, 59, 32768, 10616, 111, 116, 59, 32768, 8919, 113, 512, 108, 113, 9893, 9899, 101, 115, 115, 59, 32768, 8923, 108, 101, 115, 115, 59, 32768, 10892, 101, 115, 115, 59, 32768, 8823, 105, 109, 59, 32768, 8819, 512, 101, 110, 9922, 9932, 114, 116, 110, 101, 113, 113, 59, 32896, 8809, 65024, 69, 59, 32896, 8809, 65024, 2560, 65, 97, 98, 99, 101, 102, 107, 111, 115, 121, 9958, 9963, 10015, 10020, 10026, 10060, 10065, 10085, 10147, 10171, 114, 114, 59, 32768, 8660, 1024, 105, 108, 109, 114, 9972, 9978, 9982, 9988, 114, 115, 112, 59, 32768, 8202, 102, 59, 32768, 189, 105, 108, 116, 59, 32768, 8459, 512, 100, 114, 9993, 9998, 99, 121, 59, 32768, 1098, 768, 59, 99, 119, 10005, 10007, 10012, 32768, 8596, 105, 114, 59, 32768, 10568, 59, 32768, 8621, 97, 114, 59, 32768, 8463, 105, 114, 99, 59, 32768, 293, 768, 97, 108, 114, 10033, 10048, 10054, 114, 116, 115, 512, 59, 117, 10041, 10043, 32768, 9829, 105, 116, 59, 32768, 9829, 108, 105, 112, 59, 32768, 8230, 99, 111, 110, 59, 32768, 8889, 114, 59, 32896, 55349, 56613, 115, 512, 101, 119, 10071, 10078, 97, 114, 111, 119, 59, 32768, 10533, 97, 114, 111, 119, 59, 32768, 10534, 1280, 97, 109, 111, 112, 114, 10096, 10101, 10107, 10136, 10141, 114, 114, 59, 32768, 8703, 116, 104, 116, 59, 32768, 8763, 107, 512, 108, 114, 10113, 10124, 101, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8617, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8618, 102, 59, 32896, 55349, 56665, 98, 97, 114, 59, 32768, 8213, 768, 99, 108, 116, 10154, 10159, 10165, 114, 59, 32896, 55349, 56509, 97, 115, 104, 59, 32768, 8463, 114, 111, 107, 59, 32768, 295, 512, 98, 112, 10176, 10182, 117, 108, 108, 59, 32768, 8259, 104, 101, 110, 59, 32768, 8208, 5426, 10211, 0, 10220, 0, 10239, 10255, 10267, 0, 10276, 10312, 0, 0, 10318, 10371, 10458, 10485, 10491, 0, 10500, 10545, 10558, 99, 117, 116, 101, 33024, 237, 59, 32768, 237, 768, 59, 105, 121, 10226, 10228, 10235, 32768, 8291, 114, 99, 33024, 238, 59, 32768, 238, 59, 32768, 1080, 512, 99, 120, 10243, 10247, 121, 59, 32768, 1077, 99, 108, 33024, 161, 59, 32768, 161, 512, 102, 114, 10259, 10262, 59, 32768, 8660, 59, 32896, 55349, 56614, 114, 97, 118, 101, 33024, 236, 59, 32768, 236, 1024, 59, 105, 110, 111, 10284, 10286, 10300, 10306, 32768, 8520, 512, 105, 110, 10291, 10296, 110, 116, 59, 32768, 10764, 116, 59, 32768, 8749, 102, 105, 110, 59, 32768, 10716, 116, 97, 59, 32768, 8489, 108, 105, 103, 59, 32768, 307, 768, 97, 111, 112, 10324, 10361, 10365, 768, 99, 103, 116, 10331, 10335, 10357, 114, 59, 32768, 299, 768, 101, 108, 112, 10342, 10345, 10351, 59, 32768, 8465, 105, 110, 101, 59, 32768, 8464, 97, 114, 116, 59, 32768, 8465, 104, 59, 32768, 305, 102, 59, 32768, 8887, 101, 100, 59, 32768, 437, 1280, 59, 99, 102, 111, 116, 10381, 10383, 10389, 10403, 10409, 32768, 8712, 97, 114, 101, 59, 32768, 8453, 105, 110, 512, 59, 116, 10396, 10398, 32768, 8734, 105, 101, 59, 32768, 10717, 100, 111, 116, 59, 32768, 305, 1280, 59, 99, 101, 108, 112, 10420, 10422, 10427, 10444, 10451, 32768, 8747, 97, 108, 59, 32768, 8890, 512, 103, 114, 10432, 10438, 101, 114, 115, 59, 32768, 8484, 99, 97, 108, 59, 32768, 8890, 97, 114, 104, 107, 59, 32768, 10775, 114, 111, 100, 59, 32768, 10812, 1024, 99, 103, 112, 116, 10466, 10470, 10475, 10480, 121, 59, 32768, 1105, 111, 110, 59, 32768, 303, 102, 59, 32896, 55349, 56666, 97, 59, 32768, 953, 114, 111, 100, 59, 32768, 10812, 117, 101, 115, 116, 33024, 191, 59, 32768, 191, 512, 99, 105, 10504, 10509, 114, 59, 32896, 55349, 56510, 110, 1280, 59, 69, 100, 115, 118, 10521, 10523, 10526, 10531, 10541, 32768, 8712, 59, 32768, 8953, 111, 116, 59, 32768, 8949, 512, 59, 118, 10536, 10538, 32768, 8948, 59, 32768, 8947, 59, 32768, 8712, 512, 59, 105, 10549, 10551, 32768, 8290, 108, 100, 101, 59, 32768, 297, 828, 10562, 0, 10567, 99, 121, 59, 32768, 1110, 108, 33024, 239, 59, 32768, 239, 1536, 99, 102, 109, 111, 115, 117, 10585, 10598, 10603, 10609, 10615, 10630, 512, 105, 121, 10590, 10595, 114, 99, 59, 32768, 309, 59, 32768, 1081, 114, 59, 32896, 55349, 56615, 97, 116, 104, 59, 32768, 567, 112, 102, 59, 32896, 55349, 56667, 820, 10620, 0, 10625, 114, 59, 32896, 55349, 56511, 114, 99, 121, 59, 32768, 1112, 107, 99, 121, 59, 32768, 1108, 2048, 97, 99, 102, 103, 104, 106, 111, 115, 10653, 10666, 10680, 10685, 10692, 10697, 10702, 10708, 112, 112, 97, 512, 59, 118, 10661, 10663, 32768, 954, 59, 32768, 1008, 512, 101, 121, 10671, 10677, 100, 105, 108, 59, 32768, 311, 59, 32768, 1082, 114, 59, 32896, 55349, 56616, 114, 101, 101, 110, 59, 32768, 312, 99, 121, 59, 32768, 1093, 99, 121, 59, 32768, 1116, 112, 102, 59, 32896, 55349, 56668, 99, 114, 59, 32896, 55349, 56512, 5888, 65, 66, 69, 72, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 10761, 10783, 10789, 10799, 10804, 10957, 11011, 11047, 11094, 11349, 11372, 11382, 11409, 11414, 11451, 11478, 11526, 11698, 11711, 11755, 11823, 11910, 11929, 768, 97, 114, 116, 10768, 10773, 10777, 114, 114, 59, 32768, 8666, 114, 59, 32768, 8656, 97, 105, 108, 59, 32768, 10523, 97, 114, 114, 59, 32768, 10510, 512, 59, 103, 10794, 10796, 32768, 8806, 59, 32768, 10891, 97, 114, 59, 32768, 10594, 4660, 10824, 0, 10830, 0, 10838, 0, 0, 0, 0, 0, 10844, 10850, 0, 10867, 10870, 10877, 0, 10933, 117, 116, 101, 59, 32768, 314, 109, 112, 116, 121, 118, 59, 32768, 10676, 114, 97, 110, 59, 32768, 8466, 98, 100, 97, 59, 32768, 955, 103, 768, 59, 100, 108, 10857, 10859, 10862, 32768, 10216, 59, 32768, 10641, 101, 59, 32768, 10216, 59, 32768, 10885, 117, 111, 33024, 171, 59, 32768, 171, 114, 2048, 59, 98, 102, 104, 108, 112, 115, 116, 10894, 10896, 10907, 10911, 10915, 10919, 10923, 10928, 32768, 8592, 512, 59, 102, 10901, 10903, 32768, 8676, 115, 59, 32768, 10527, 115, 59, 32768, 10525, 107, 59, 32768, 8617, 112, 59, 32768, 8619, 108, 59, 32768, 10553, 105, 109, 59, 32768, 10611, 108, 59, 32768, 8610, 768, 59, 97, 101, 10939, 10941, 10946, 32768, 10923, 105, 108, 59, 32768, 10521, 512, 59, 115, 10951, 10953, 32768, 10925, 59, 32896, 10925, 65024, 768, 97, 98, 114, 10964, 10969, 10974, 114, 114, 59, 32768, 10508, 114, 107, 59, 32768, 10098, 512, 97, 107, 10979, 10991, 99, 512, 101, 107, 10985, 10988, 59, 32768, 123, 59, 32768, 91, 512, 101, 115, 10996, 10999, 59, 32768, 10635, 108, 512, 100, 117, 11005, 11008, 59, 32768, 10639, 59, 32768, 10637, 1024, 97, 101, 117, 121, 11020, 11026, 11040, 11044, 114, 111, 110, 59, 32768, 318, 512, 100, 105, 11031, 11036, 105, 108, 59, 32768, 316, 108, 59, 32768, 8968, 98, 59, 32768, 123, 59, 32768, 1083, 1024, 99, 113, 114, 115, 11056, 11060, 11072, 11090, 97, 59, 32768, 10550, 117, 111, 512, 59, 114, 11067, 11069, 32768, 8220, 59, 32768, 8222, 512, 100, 117, 11077, 11083, 104, 97, 114, 59, 32768, 10599, 115, 104, 97, 114, 59, 32768, 10571, 104, 59, 32768, 8626, 1280, 59, 102, 103, 113, 115, 11105, 11107, 11228, 11231, 11250, 32768, 8804, 116, 1280, 97, 104, 108, 114, 116, 11119, 11136, 11157, 11169, 11216, 114, 114, 111, 119, 512, 59, 116, 11128, 11130, 32768, 8592, 97, 105, 108, 59, 32768, 8610, 97, 114, 112, 111, 111, 110, 512, 100, 117, 11147, 11153, 111, 119, 110, 59, 32768, 8637, 112, 59, 32768, 8636, 101, 102, 116, 97, 114, 114, 111, 119, 115, 59, 32768, 8647, 105, 103, 104, 116, 768, 97, 104, 115, 11180, 11194, 11204, 114, 114, 111, 119, 512, 59, 115, 11189, 11191, 32768, 8596, 59, 32768, 8646, 97, 114, 112, 111, 111, 110, 115, 59, 32768, 8651, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 32768, 8621, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 32768, 8907, 59, 32768, 8922, 768, 59, 113, 115, 11238, 11240, 11243, 32768, 8804, 59, 32768, 8806, 108, 97, 110, 116, 59, 32768, 10877, 1280, 59, 99, 100, 103, 115, 11261, 11263, 11267, 11286, 11298, 32768, 10877, 99, 59, 32768, 10920, 111, 116, 512, 59, 111, 11274, 11276, 32768, 10879, 512, 59, 114, 11281, 11283, 32768, 10881, 59, 32768, 10883, 512, 59, 101, 11291, 11294, 32896, 8922, 65024, 115, 59, 32768, 10899, 1280, 97, 100, 101, 103, 115, 11309, 11317, 11322, 11339, 11344, 112, 112, 114, 111, 120, 59, 32768, 10885, 111, 116, 59, 32768, 8918, 113, 512, 103, 113, 11328, 11333, 116, 114, 59, 32768, 8922, 103, 116, 114, 59, 32768, 10891, 116, 114, 59, 32768, 8822, 105, 109, 59, 32768, 8818, 768, 105, 108, 114, 11356, 11362, 11368, 115, 104, 116, 59, 32768, 10620, 111, 111, 114, 59, 32768, 8970, 59, 32896, 55349, 56617, 512, 59, 69, 11377, 11379, 32768, 8822, 59, 32768, 10897, 562, 11386, 11405, 114, 512, 100, 117, 11391, 11394, 59, 32768, 8637, 512, 59, 108, 11399, 11401, 32768, 8636, 59, 32768, 10602, 108, 107, 59, 32768, 9604, 99, 121, 59, 32768, 1113, 1280, 59, 97, 99, 104, 116, 11425, 11427, 11432, 11440, 11446, 32768, 8810, 114, 114, 59, 32768, 8647, 111, 114, 110, 101, 114, 59, 32768, 8990, 97, 114, 100, 59, 32768, 10603, 114, 105, 59, 32768, 9722, 512, 105, 111, 11456, 11462, 100, 111, 116, 59, 32768, 320, 117, 115, 116, 512, 59, 97, 11470, 11472, 32768, 9136, 99, 104, 101, 59, 32768, 9136, 1024, 69, 97, 101, 115, 11487, 11490, 11504, 11521, 59, 32768, 8808, 112, 512, 59, 112, 11496, 11498, 32768, 10889, 114, 111, 120, 59, 32768, 10889, 512, 59, 113, 11509, 11511, 32768, 10887, 512, 59, 113, 11516, 11518, 32768, 10887, 59, 32768, 8808, 105, 109, 59, 32768, 8934, 2048, 97, 98, 110, 111, 112, 116, 119, 122, 11543, 11556, 11561, 11616, 11640, 11660, 11667, 11680, 512, 110, 114, 11548, 11552, 103, 59, 32768, 10220, 114, 59, 32768, 8701, 114, 107, 59, 32768, 10214, 103, 768, 108, 109, 114, 11569, 11596, 11604, 101, 102, 116, 512, 97, 114, 11577, 11584, 114, 114, 111, 119, 59, 32768, 10229, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10231, 97, 112, 115, 116, 111, 59, 32768, 10236, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 10230, 112, 97, 114, 114, 111, 119, 512, 108, 114, 11627, 11633, 101, 102, 116, 59, 32768, 8619, 105, 103, 104, 116, 59, 32768, 8620, 768, 97, 102, 108, 11647, 11651, 11655, 114, 59, 32768, 10629, 59, 32896, 55349, 56669, 117, 115, 59, 32768, 10797, 105, 109, 101, 115, 59, 32768, 10804, 562, 11671, 11676, 115, 116, 59, 32768, 8727, 97, 114, 59, 32768, 95, 768, 59, 101, 102, 11687, 11689, 11695, 32768, 9674, 110, 103, 101, 59, 32768, 9674, 59, 32768, 10731, 97, 114, 512, 59, 108, 11705, 11707, 32768, 40, 116, 59, 32768, 10643, 1280, 97, 99, 104, 109, 116, 11722, 11727, 11735, 11747, 11750, 114, 114, 59, 32768, 8646, 111, 114, 110, 101, 114, 59, 32768, 8991, 97, 114, 512, 59, 100, 11742, 11744, 32768, 8651, 59, 32768, 10605, 59, 32768, 8206, 114, 105, 59, 32768, 8895, 1536, 97, 99, 104, 105, 113, 116, 11768, 11774, 11779, 11782, 11798, 11817, 113, 117, 111, 59, 32768, 8249, 114, 59, 32896, 55349, 56513, 59, 32768, 8624, 109, 768, 59, 101, 103, 11790, 11792, 11795, 32768, 8818, 59, 32768, 10893, 59, 32768, 10895, 512, 98, 117, 11803, 11806, 59, 32768, 91, 111, 512, 59, 114, 11812, 11814, 32768, 8216, 59, 32768, 8218, 114, 111, 107, 59, 32768, 322, 34816, 60, 59, 99, 100, 104, 105, 108, 113, 114, 11841, 11843, 11855, 11860, 11866, 11872, 11878, 11885, 32768, 60, 512, 99, 105, 11848, 11851, 59, 32768, 10918, 114, 59, 32768, 10873, 111, 116, 59, 32768, 8918, 114, 101, 101, 59, 32768, 8907, 109, 101, 115, 59, 32768, 8905, 97, 114, 114, 59, 32768, 10614, 117, 101, 115, 116, 59, 32768, 10875, 512, 80, 105, 11890, 11895, 97, 114, 59, 32768, 10646, 768, 59, 101, 102, 11902, 11904, 11907, 32768, 9667, 59, 32768, 8884, 59, 32768, 9666, 114, 512, 100, 117, 11916, 11923, 115, 104, 97, 114, 59, 32768, 10570, 104, 97, 114, 59, 32768, 10598, 512, 101, 110, 11934, 11944, 114, 116, 110, 101, 113, 113, 59, 32896, 8808, 65024, 69, 59, 32896, 8808, 65024, 3584, 68, 97, 99, 100, 101, 102, 104, 105, 108, 110, 111, 112, 115, 117, 11978, 11984, 12061, 12075, 12081, 12095, 12100, 12104, 12170, 12181, 12188, 12204, 12207, 12223, 68, 111, 116, 59, 32768, 8762, 1024, 99, 108, 112, 114, 11993, 11999, 12019, 12055, 114, 33024, 175, 59, 32768, 175, 512, 101, 116, 12004, 12007, 59, 32768, 9794, 512, 59, 101, 12012, 12014, 32768, 10016, 115, 101, 59, 32768, 10016, 512, 59, 115, 12024, 12026, 32768, 8614, 116, 111, 1024, 59, 100, 108, 117, 12037, 12039, 12045, 12051, 32768, 8614, 111, 119, 110, 59, 32768, 8615, 101, 102, 116, 59, 32768, 8612, 112, 59, 32768, 8613, 107, 101, 114, 59, 32768, 9646, 512, 111, 121, 12066, 12072, 109, 109, 97, 59, 32768, 10793, 59, 32768, 1084, 97, 115, 104, 59, 32768, 8212, 97, 115, 117, 114, 101, 100, 97, 110, 103, 108, 101, 59, 32768, 8737, 114, 59, 32896, 55349, 56618, 111, 59, 32768, 8487, 768, 99, 100, 110, 12111, 12118, 12146, 114, 111, 33024, 181, 59, 32768, 181, 1024, 59, 97, 99, 100, 12127, 12129, 12134, 12139, 32768, 8739, 115, 116, 59, 32768, 42, 105, 114, 59, 32768, 10992, 111, 116, 33024, 183, 59, 32768, 183, 117, 115, 768, 59, 98, 100, 12155, 12157, 12160, 32768, 8722, 59, 32768, 8863, 512, 59, 117, 12165, 12167, 32768, 8760, 59, 32768, 10794, 564, 12174, 12178, 112, 59, 32768, 10971, 114, 59, 32768, 8230, 112, 108, 117, 115, 59, 32768, 8723, 512, 100, 112, 12193, 12199, 101, 108, 115, 59, 32768, 8871, 102, 59, 32896, 55349, 56670, 59, 32768, 8723, 512, 99, 116, 12212, 12217, 114, 59, 32896, 55349, 56514, 112, 111, 115, 59, 32768, 8766, 768, 59, 108, 109, 12230, 12232, 12240, 32768, 956, 116, 105, 109, 97, 112, 59, 32768, 8888, 97, 112, 59, 32768, 8888, 6144, 71, 76, 82, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 111, 112, 114, 115, 116, 117, 118, 119, 12294, 12315, 12364, 12376, 12393, 12472, 12496, 12547, 12553, 12636, 12641, 12703, 12725, 12747, 12752, 12876, 12881, 12957, 13033, 13089, 13294, 13359, 13384, 13499, 512, 103, 116, 12299, 12303, 59, 32896, 8921, 824, 512, 59, 118, 12308, 12311, 32896, 8811, 8402, 59, 32896, 8811, 824, 768, 101, 108, 116, 12322, 12348, 12352, 102, 116, 512, 97, 114, 12329, 12336, 114, 114, 111, 119, 59, 32768, 8653, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8654, 59, 32896, 8920, 824, 512, 59, 118, 12357, 12360, 32896, 8810, 8402, 59, 32896, 8810, 824, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8655, 512, 68, 100, 12381, 12387, 97, 115, 104, 59, 32768, 8879, 97, 115, 104, 59, 32768, 8878, 1280, 98, 99, 110, 112, 116, 12404, 12409, 12415, 12420, 12452, 108, 97, 59, 32768, 8711, 117, 116, 101, 59, 32768, 324, 103, 59, 32896, 8736, 8402, 1280, 59, 69, 105, 111, 112, 12431, 12433, 12437, 12442, 12446, 32768, 8777, 59, 32896, 10864, 824, 100, 59, 32896, 8779, 824, 115, 59, 32768, 329, 114, 111, 120, 59, 32768, 8777, 117, 114, 512, 59, 97, 12459, 12461, 32768, 9838, 108, 512, 59, 115, 12467, 12469, 32768, 9838, 59, 32768, 8469, 836, 12477, 0, 12483, 112, 33024, 160, 59, 32768, 160, 109, 112, 512, 59, 101, 12489, 12492, 32896, 8782, 824, 59, 32896, 8783, 824, 1280, 97, 101, 111, 117, 121, 12507, 12519, 12525, 12540, 12544, 833, 12512, 0, 12515, 59, 32768, 10819, 111, 110, 59, 32768, 328, 100, 105, 108, 59, 32768, 326, 110, 103, 512, 59, 100, 12532, 12534, 32768, 8775, 111, 116, 59, 32896, 10861, 824, 112, 59, 32768, 10818, 59, 32768, 1085, 97, 115, 104, 59, 32768, 8211, 1792, 59, 65, 97, 100, 113, 115, 120, 12568, 12570, 12575, 12596, 12602, 12608, 12623, 32768, 8800, 114, 114, 59, 32768, 8663, 114, 512, 104, 114, 12581, 12585, 107, 59, 32768, 10532, 512, 59, 111, 12590, 12592, 32768, 8599, 119, 59, 32768, 8599, 111, 116, 59, 32896, 8784, 824, 117, 105, 118, 59, 32768, 8802, 512, 101, 105, 12613, 12618, 97, 114, 59, 32768, 10536, 109, 59, 32896, 8770, 824, 105, 115, 116, 512, 59, 115, 12631, 12633, 32768, 8708, 59, 32768, 8708, 114, 59, 32896, 55349, 56619, 1024, 69, 101, 115, 116, 12650, 12654, 12688, 12693, 59, 32896, 8807, 824, 768, 59, 113, 115, 12661, 12663, 12684, 32768, 8817, 768, 59, 113, 115, 12670, 12672, 12676, 32768, 8817, 59, 32896, 8807, 824, 108, 97, 110, 116, 59, 32896, 10878, 824, 59, 32896, 10878, 824, 105, 109, 59, 32768, 8821, 512, 59, 114, 12698, 12700, 32768, 8815, 59, 32768, 8815, 768, 65, 97, 112, 12710, 12715, 12720, 114, 114, 59, 32768, 8654, 114, 114, 59, 32768, 8622, 97, 114, 59, 32768, 10994, 768, 59, 115, 118, 12732, 12734, 12744, 32768, 8715, 512, 59, 100, 12739, 12741, 32768, 8956, 59, 32768, 8954, 59, 32768, 8715, 99, 121, 59, 32768, 1114, 1792, 65, 69, 97, 100, 101, 115, 116, 12767, 12772, 12776, 12781, 12785, 12853, 12858, 114, 114, 59, 32768, 8653, 59, 32896, 8806, 824, 114, 114, 59, 32768, 8602, 114, 59, 32768, 8229, 1024, 59, 102, 113, 115, 12794, 12796, 12821, 12842, 32768, 8816, 116, 512, 97, 114, 12802, 12809, 114, 114, 111, 119, 59, 32768, 8602, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8622, 768, 59, 113, 115, 12828, 12830, 12834, 32768, 8816, 59, 32896, 8806, 824, 108, 97, 110, 116, 59, 32896, 10877, 824, 512, 59, 115, 12847, 12850, 32896, 10877, 824, 59, 32768, 8814, 105, 109, 59, 32768, 8820, 512, 59, 114, 12863, 12865, 32768, 8814, 105, 512, 59, 101, 12871, 12873, 32768, 8938, 59, 32768, 8940, 105, 100, 59, 32768, 8740, 512, 112, 116, 12886, 12891, 102, 59, 32896, 55349, 56671, 33536, 172, 59, 105, 110, 12899, 12901, 12936, 32768, 172, 110, 1024, 59, 69, 100, 118, 12911, 12913, 12917, 12923, 32768, 8713, 59, 32896, 8953, 824, 111, 116, 59, 32896, 8949, 824, 818, 12928, 12931, 12934, 59, 32768, 8713, 59, 32768, 8951, 59, 32768, 8950, 105, 512, 59, 118, 12942, 12944, 32768, 8716, 818, 12949, 12952, 12955, 59, 32768, 8716, 59, 32768, 8958, 59, 32768, 8957, 768, 97, 111, 114, 12964, 12992, 12999, 114, 1024, 59, 97, 115, 116, 12974, 12976, 12983, 12988, 32768, 8742, 108, 108, 101, 108, 59, 32768, 8742, 108, 59, 32896, 11005, 8421, 59, 32896, 8706, 824, 108, 105, 110, 116, 59, 32768, 10772, 768, 59, 99, 101, 13006, 13008, 13013, 32768, 8832, 117, 101, 59, 32768, 8928, 512, 59, 99, 13018, 13021, 32896, 10927, 824, 512, 59, 101, 13026, 13028, 32768, 8832, 113, 59, 32896, 10927, 824, 1024, 65, 97, 105, 116, 13042, 13047, 13066, 13077, 114, 114, 59, 32768, 8655, 114, 114, 768, 59, 99, 119, 13056, 13058, 13062, 32768, 8603, 59, 32896, 10547, 824, 59, 32896, 8605, 824, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8603, 114, 105, 512, 59, 101, 13084, 13086, 32768, 8939, 59, 32768, 8941, 1792, 99, 104, 105, 109, 112, 113, 117, 13104, 13128, 13151, 13169, 13174, 13179, 13194, 1024, 59, 99, 101, 114, 13113, 13115, 13120, 13124, 32768, 8833, 117, 101, 59, 32768, 8929, 59, 32896, 10928, 824, 59, 32896, 55349, 56515, 111, 114, 116, 1086, 13137, 0, 0, 13142, 105, 100, 59, 32768, 8740, 97, 114, 97, 108, 108, 101, 108, 59, 32768, 8742, 109, 512, 59, 101, 13157, 13159, 32768, 8769, 512, 59, 113, 13164, 13166, 32768, 8772, 59, 32768, 8772, 105, 100, 59, 32768, 8740, 97, 114, 59, 32768, 8742, 115, 117, 512, 98, 112, 13186, 13190, 101, 59, 32768, 8930, 101, 59, 32768, 8931, 768, 98, 99, 112, 13201, 13241, 13254, 1024, 59, 69, 101, 115, 13210, 13212, 13216, 13219, 32768, 8836, 59, 32896, 10949, 824, 59, 32768, 8840, 101, 116, 512, 59, 101, 13226, 13229, 32896, 8834, 8402, 113, 512, 59, 113, 13235, 13237, 32768, 8840, 59, 32896, 10949, 824, 99, 512, 59, 101, 13247, 13249, 32768, 8833, 113, 59, 32896, 10928, 824, 1024, 59, 69, 101, 115, 13263, 13265, 13269, 13272, 32768, 8837, 59, 32896, 10950, 824, 59, 32768, 8841, 101, 116, 512, 59, 101, 13279, 13282, 32896, 8835, 8402, 113, 512, 59, 113, 13288, 13290, 32768, 8841, 59, 32896, 10950, 824, 1024, 103, 105, 108, 114, 13303, 13307, 13315, 13319, 108, 59, 32768, 8825, 108, 100, 101, 33024, 241, 59, 32768, 241, 103, 59, 32768, 8824, 105, 97, 110, 103, 108, 101, 512, 108, 114, 13330, 13344, 101, 102, 116, 512, 59, 101, 13338, 13340, 32768, 8938, 113, 59, 32768, 8940, 105, 103, 104, 116, 512, 59, 101, 13353, 13355, 32768, 8939, 113, 59, 32768, 8941, 512, 59, 109, 13364, 13366, 32768, 957, 768, 59, 101, 115, 13373, 13375, 13380, 32768, 35, 114, 111, 59, 32768, 8470, 112, 59, 32768, 8199, 2304, 68, 72, 97, 100, 103, 105, 108, 114, 115, 13403, 13409, 13415, 13420, 13426, 13439, 13446, 13476, 13493, 97, 115, 104, 59, 32768, 8877, 97, 114, 114, 59, 32768, 10500, 112, 59, 32896, 8781, 8402, 97, 115, 104, 59, 32768, 8876, 512, 101, 116, 13431, 13435, 59, 32896, 8805, 8402, 59, 32896, 62, 8402, 110, 102, 105, 110, 59, 32768, 10718, 768, 65, 101, 116, 13453, 13458, 13462, 114, 114, 59, 32768, 10498, 59, 32896, 8804, 8402, 512, 59, 114, 13467, 13470, 32896, 60, 8402, 105, 101, 59, 32896, 8884, 8402, 512, 65, 116, 13481, 13486, 114, 114, 59, 32768, 10499, 114, 105, 101, 59, 32896, 8885, 8402, 105, 109, 59, 32896, 8764, 8402, 768, 65, 97, 110, 13506, 13511, 13532, 114, 114, 59, 32768, 8662, 114, 512, 104, 114, 13517, 13521, 107, 59, 32768, 10531, 512, 59, 111, 13526, 13528, 32768, 8598, 119, 59, 32768, 8598, 101, 97, 114, 59, 32768, 10535, 9252, 13576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13579, 0, 13596, 13617, 13653, 13659, 13673, 13695, 13708, 0, 0, 13713, 13750, 0, 13788, 13794, 0, 13815, 13890, 13913, 13937, 13944, 59, 32768, 9416, 512, 99, 115, 13583, 13591, 117, 116, 101, 33024, 243, 59, 32768, 243, 116, 59, 32768, 8859, 512, 105, 121, 13600, 13613, 114, 512, 59, 99, 13606, 13608, 32768, 8858, 33024, 244, 59, 32768, 244, 59, 32768, 1086, 1280, 97, 98, 105, 111, 115, 13627, 13632, 13638, 13642, 13646, 115, 104, 59, 32768, 8861, 108, 97, 99, 59, 32768, 337, 118, 59, 32768, 10808, 116, 59, 32768, 8857, 111, 108, 100, 59, 32768, 10684, 108, 105, 103, 59, 32768, 339, 512, 99, 114, 13663, 13668, 105, 114, 59, 32768, 10687, 59, 32896, 55349, 56620, 1600, 13680, 0, 0, 13684, 0, 13692, 110, 59, 32768, 731, 97, 118, 101, 33024, 242, 59, 32768, 242, 59, 32768, 10689, 512, 98, 109, 13699, 13704, 97, 114, 59, 32768, 10677, 59, 32768, 937, 110, 116, 59, 32768, 8750, 1024, 97, 99, 105, 116, 13721, 13726, 13741, 13746, 114, 114, 59, 32768, 8634, 512, 105, 114, 13731, 13735, 114, 59, 32768, 10686, 111, 115, 115, 59, 32768, 10683, 110, 101, 59, 32768, 8254, 59, 32768, 10688, 768, 97, 101, 105, 13756, 13761, 13766, 99, 114, 59, 32768, 333, 103, 97, 59, 32768, 969, 768, 99, 100, 110, 13773, 13779, 13782, 114, 111, 110, 59, 32768, 959, 59, 32768, 10678, 117, 115, 59, 32768, 8854, 112, 102, 59, 32896, 55349, 56672, 768, 97, 101, 108, 13800, 13804, 13809, 114, 59, 32768, 10679, 114, 112, 59, 32768, 10681, 117, 115, 59, 32768, 8853, 1792, 59, 97, 100, 105, 111, 115, 118, 13829, 13831, 13836, 13869, 13875, 13879, 13886, 32768, 8744, 114, 114, 59, 32768, 8635, 1024, 59, 101, 102, 109, 13845, 13847, 13859, 13864, 32768, 10845, 114, 512, 59, 111, 13853, 13855, 32768, 8500, 102, 59, 32768, 8500, 33024, 170, 59, 32768, 170, 33024, 186, 59, 32768, 186, 103, 111, 102, 59, 32768, 8886, 114, 59, 32768, 10838, 108, 111, 112, 101, 59, 32768, 10839, 59, 32768, 10843, 768, 99, 108, 111, 13896, 13900, 13908, 114, 59, 32768, 8500, 97, 115, 104, 33024, 248, 59, 32768, 248, 108, 59, 32768, 8856, 105, 573, 13917, 13924, 100, 101, 33024, 245, 59, 32768, 245, 101, 115, 512, 59, 97, 13930, 13932, 32768, 8855, 115, 59, 32768, 10806, 109, 108, 33024, 246, 59, 32768, 246, 98, 97, 114, 59, 32768, 9021, 5426, 13972, 0, 14013, 0, 14017, 14053, 0, 14058, 14086, 0, 0, 14107, 14199, 0, 14202, 0, 0, 14229, 14425, 0, 14438, 114, 1024, 59, 97, 115, 116, 13981, 13983, 13997, 14009, 32768, 8741, 33280, 182, 59, 108, 13989, 13991, 32768, 182, 108, 101, 108, 59, 32768, 8741, 1082, 14003, 0, 0, 14007, 109, 59, 32768, 10995, 59, 32768, 11005, 59, 32768, 8706, 121, 59, 32768, 1087, 114, 1280, 99, 105, 109, 112, 116, 14028, 14033, 14038, 14043, 14046, 110, 116, 59, 32768, 37, 111, 100, 59, 32768, 46, 105, 108, 59, 32768, 8240, 59, 32768, 8869, 101, 110, 107, 59, 32768, 8241, 114, 59, 32896, 55349, 56621, 768, 105, 109, 111, 14064, 14074, 14080, 512, 59, 118, 14069, 14071, 32768, 966, 59, 32768, 981, 109, 97, 116, 59, 32768, 8499, 110, 101, 59, 32768, 9742, 768, 59, 116, 118, 14092, 14094, 14103, 32768, 960, 99, 104, 102, 111, 114, 107, 59, 32768, 8916, 59, 32768, 982, 512, 97, 117, 14111, 14132, 110, 512, 99, 107, 14117, 14128, 107, 512, 59, 104, 14123, 14125, 32768, 8463, 59, 32768, 8462, 118, 59, 32768, 8463, 115, 2304, 59, 97, 98, 99, 100, 101, 109, 115, 116, 14152, 14154, 14160, 14163, 14168, 14179, 14182, 14188, 14193, 32768, 43, 99, 105, 114, 59, 32768, 10787, 59, 32768, 8862, 105, 114, 59, 32768, 10786, 512, 111, 117, 14173, 14176, 59, 32768, 8724, 59, 32768, 10789, 59, 32768, 10866, 110, 33024, 177, 59, 32768, 177, 105, 109, 59, 32768, 10790, 119, 111, 59, 32768, 10791, 59, 32768, 177, 768, 105, 112, 117, 14208, 14216, 14221, 110, 116, 105, 110, 116, 59, 32768, 10773, 102, 59, 32896, 55349, 56673, 110, 100, 33024, 163, 59, 32768, 163, 2560, 59, 69, 97, 99, 101, 105, 110, 111, 115, 117, 14249, 14251, 14254, 14258, 14263, 14336, 14348, 14367, 14413, 14418, 32768, 8826, 59, 32768, 10931, 112, 59, 32768, 10935, 117, 101, 59, 32768, 8828, 512, 59, 99, 14268, 14270, 32768, 10927, 1536, 59, 97, 99, 101, 110, 115, 14283, 14285, 14293, 14302, 14306, 14331, 32768, 8826, 112, 112, 114, 111, 120, 59, 32768, 10935, 117, 114, 108, 121, 101, 113, 59, 32768, 8828, 113, 59, 32768, 10927, 768, 97, 101, 115, 14313, 14321, 14326, 112, 112, 114, 111, 120, 59, 32768, 10937, 113, 113, 59, 32768, 10933, 105, 109, 59, 32768, 8936, 105, 109, 59, 32768, 8830, 109, 101, 512, 59, 115, 14343, 14345, 32768, 8242, 59, 32768, 8473, 768, 69, 97, 115, 14355, 14358, 14362, 59, 32768, 10933, 112, 59, 32768, 10937, 105, 109, 59, 32768, 8936, 768, 100, 102, 112, 14374, 14377, 14402, 59, 32768, 8719, 768, 97, 108, 115, 14384, 14390, 14396, 108, 97, 114, 59, 32768, 9006, 105, 110, 101, 59, 32768, 8978, 117, 114, 102, 59, 32768, 8979, 512, 59, 116, 14407, 14409, 32768, 8733, 111, 59, 32768, 8733, 105, 109, 59, 32768, 8830, 114, 101, 108, 59, 32768, 8880, 512, 99, 105, 14429, 14434, 114, 59, 32896, 55349, 56517, 59, 32768, 968, 110, 99, 115, 112, 59, 32768, 8200, 1536, 102, 105, 111, 112, 115, 117, 14457, 14462, 14467, 14473, 14480, 14486, 114, 59, 32896, 55349, 56622, 110, 116, 59, 32768, 10764, 112, 102, 59, 32896, 55349, 56674, 114, 105, 109, 101, 59, 32768, 8279, 99, 114, 59, 32896, 55349, 56518, 768, 97, 101, 111, 14493, 14513, 14526, 116, 512, 101, 105, 14499, 14508, 114, 110, 105, 111, 110, 115, 59, 32768, 8461, 110, 116, 59, 32768, 10774, 115, 116, 512, 59, 101, 14520, 14522, 32768, 63, 113, 59, 32768, 8799, 116, 33024, 34, 59, 32768, 34, 5376, 65, 66, 72, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 110, 111, 112, 114, 115, 116, 117, 120, 14575, 14597, 14603, 14608, 14775, 14829, 14865, 14901, 14943, 14966, 15e3, 15139, 15159, 15176, 15182, 15236, 15261, 15267, 15309, 15352, 15360, 768, 97, 114, 116, 14582, 14587, 14591, 114, 114, 59, 32768, 8667, 114, 59, 32768, 8658, 97, 105, 108, 59, 32768, 10524, 97, 114, 114, 59, 32768, 10511, 97, 114, 59, 32768, 10596, 1792, 99, 100, 101, 110, 113, 114, 116, 14623, 14637, 14642, 14650, 14672, 14679, 14751, 512, 101, 117, 14628, 14632, 59, 32896, 8765, 817, 116, 101, 59, 32768, 341, 105, 99, 59, 32768, 8730, 109, 112, 116, 121, 118, 59, 32768, 10675, 103, 1024, 59, 100, 101, 108, 14660, 14662, 14665, 14668, 32768, 10217, 59, 32768, 10642, 59, 32768, 10661, 101, 59, 32768, 10217, 117, 111, 33024, 187, 59, 32768, 187, 114, 2816, 59, 97, 98, 99, 102, 104, 108, 112, 115, 116, 119, 14703, 14705, 14709, 14720, 14723, 14727, 14731, 14735, 14739, 14744, 14748, 32768, 8594, 112, 59, 32768, 10613, 512, 59, 102, 14714, 14716, 32768, 8677, 115, 59, 32768, 10528, 59, 32768, 10547, 115, 59, 32768, 10526, 107, 59, 32768, 8618, 112, 59, 32768, 8620, 108, 59, 32768, 10565, 105, 109, 59, 32768, 10612, 108, 59, 32768, 8611, 59, 32768, 8605, 512, 97, 105, 14756, 14761, 105, 108, 59, 32768, 10522, 111, 512, 59, 110, 14767, 14769, 32768, 8758, 97, 108, 115, 59, 32768, 8474, 768, 97, 98, 114, 14782, 14787, 14792, 114, 114, 59, 32768, 10509, 114, 107, 59, 32768, 10099, 512, 97, 107, 14797, 14809, 99, 512, 101, 107, 14803, 14806, 59, 32768, 125, 59, 32768, 93, 512, 101, 115, 14814, 14817, 59, 32768, 10636, 108, 512, 100, 117, 14823, 14826, 59, 32768, 10638, 59, 32768, 10640, 1024, 97, 101, 117, 121, 14838, 14844, 14858, 14862, 114, 111, 110, 59, 32768, 345, 512, 100, 105, 14849, 14854, 105, 108, 59, 32768, 343, 108, 59, 32768, 8969, 98, 59, 32768, 125, 59, 32768, 1088, 1024, 99, 108, 113, 115, 14874, 14878, 14885, 14897, 97, 59, 32768, 10551, 100, 104, 97, 114, 59, 32768, 10601, 117, 111, 512, 59, 114, 14892, 14894, 32768, 8221, 59, 32768, 8221, 104, 59, 32768, 8627, 768, 97, 99, 103, 14908, 14934, 14938, 108, 1024, 59, 105, 112, 115, 14918, 14920, 14925, 14931, 32768, 8476, 110, 101, 59, 32768, 8475, 97, 114, 116, 59, 32768, 8476, 59, 32768, 8477, 116, 59, 32768, 9645, 33024, 174, 59, 32768, 174, 768, 105, 108, 114, 14950, 14956, 14962, 115, 104, 116, 59, 32768, 10621, 111, 111, 114, 59, 32768, 8971, 59, 32896, 55349, 56623, 512, 97, 111, 14971, 14990, 114, 512, 100, 117, 14977, 14980, 59, 32768, 8641, 512, 59, 108, 14985, 14987, 32768, 8640, 59, 32768, 10604, 512, 59, 118, 14995, 14997, 32768, 961, 59, 32768, 1009, 768, 103, 110, 115, 15007, 15123, 15127, 104, 116, 1536, 97, 104, 108, 114, 115, 116, 15022, 15039, 15060, 15086, 15099, 15111, 114, 114, 111, 119, 512, 59, 116, 15031, 15033, 32768, 8594, 97, 105, 108, 59, 32768, 8611, 97, 114, 112, 111, 111, 110, 512, 100, 117, 15050, 15056, 111, 119, 110, 59, 32768, 8641, 112, 59, 32768, 8640, 101, 102, 116, 512, 97, 104, 15068, 15076, 114, 114, 111, 119, 115, 59, 32768, 8644, 97, 114, 112, 111, 111, 110, 115, 59, 32768, 8652, 105, 103, 104, 116, 97, 114, 114, 111, 119, 115, 59, 32768, 8649, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 32768, 8605, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 32768, 8908, 103, 59, 32768, 730, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 32768, 8787, 768, 97, 104, 109, 15146, 15151, 15156, 114, 114, 59, 32768, 8644, 97, 114, 59, 32768, 8652, 59, 32768, 8207, 111, 117, 115, 116, 512, 59, 97, 15168, 15170, 32768, 9137, 99, 104, 101, 59, 32768, 9137, 109, 105, 100, 59, 32768, 10990, 1024, 97, 98, 112, 116, 15191, 15204, 15209, 15229, 512, 110, 114, 15196, 15200, 103, 59, 32768, 10221, 114, 59, 32768, 8702, 114, 107, 59, 32768, 10215, 768, 97, 102, 108, 15216, 15220, 15224, 114, 59, 32768, 10630, 59, 32896, 55349, 56675, 117, 115, 59, 32768, 10798, 105, 109, 101, 115, 59, 32768, 10805, 512, 97, 112, 15241, 15253, 114, 512, 59, 103, 15247, 15249, 32768, 41, 116, 59, 32768, 10644, 111, 108, 105, 110, 116, 59, 32768, 10770, 97, 114, 114, 59, 32768, 8649, 1024, 97, 99, 104, 113, 15276, 15282, 15287, 15290, 113, 117, 111, 59, 32768, 8250, 114, 59, 32896, 55349, 56519, 59, 32768, 8625, 512, 98, 117, 15295, 15298, 59, 32768, 93, 111, 512, 59, 114, 15304, 15306, 32768, 8217, 59, 32768, 8217, 768, 104, 105, 114, 15316, 15322, 15328, 114, 101, 101, 59, 32768, 8908, 109, 101, 115, 59, 32768, 8906, 105, 1024, 59, 101, 102, 108, 15338, 15340, 15343, 15346, 32768, 9657, 59, 32768, 8885, 59, 32768, 9656, 116, 114, 105, 59, 32768, 10702, 108, 117, 104, 97, 114, 59, 32768, 10600, 59, 32768, 8478, 6706, 15391, 15398, 15404, 15499, 15516, 15592, 0, 15606, 15660, 0, 0, 15752, 15758, 0, 15827, 15863, 15886, 16e3, 16006, 16038, 16086, 0, 16467, 0, 0, 16506, 99, 117, 116, 101, 59, 32768, 347, 113, 117, 111, 59, 32768, 8218, 2560, 59, 69, 97, 99, 101, 105, 110, 112, 115, 121, 15424, 15426, 15429, 15441, 15446, 15458, 15463, 15482, 15490, 15495, 32768, 8827, 59, 32768, 10932, 833, 15434, 0, 15437, 59, 32768, 10936, 111, 110, 59, 32768, 353, 117, 101, 59, 32768, 8829, 512, 59, 100, 15451, 15453, 32768, 10928, 105, 108, 59, 32768, 351, 114, 99, 59, 32768, 349, 768, 69, 97, 115, 15470, 15473, 15477, 59, 32768, 10934, 112, 59, 32768, 10938, 105, 109, 59, 32768, 8937, 111, 108, 105, 110, 116, 59, 32768, 10771, 105, 109, 59, 32768, 8831, 59, 32768, 1089, 111, 116, 768, 59, 98, 101, 15507, 15509, 15512, 32768, 8901, 59, 32768, 8865, 59, 32768, 10854, 1792, 65, 97, 99, 109, 115, 116, 120, 15530, 15535, 15556, 15562, 15566, 15572, 15587, 114, 114, 59, 32768, 8664, 114, 512, 104, 114, 15541, 15545, 107, 59, 32768, 10533, 512, 59, 111, 15550, 15552, 32768, 8600, 119, 59, 32768, 8600, 116, 33024, 167, 59, 32768, 167, 105, 59, 32768, 59, 119, 97, 114, 59, 32768, 10537, 109, 512, 105, 110, 15578, 15584, 110, 117, 115, 59, 32768, 8726, 59, 32768, 8726, 116, 59, 32768, 10038, 114, 512, 59, 111, 15597, 15600, 32896, 55349, 56624, 119, 110, 59, 32768, 8994, 1024, 97, 99, 111, 121, 15614, 15619, 15632, 15654, 114, 112, 59, 32768, 9839, 512, 104, 121, 15624, 15629, 99, 121, 59, 32768, 1097, 59, 32768, 1096, 114, 116, 1086, 15640, 0, 0, 15645, 105, 100, 59, 32768, 8739, 97, 114, 97, 108, 108, 101, 108, 59, 32768, 8741, 33024, 173, 59, 32768, 173, 512, 103, 109, 15664, 15681, 109, 97, 768, 59, 102, 118, 15673, 15675, 15678, 32768, 963, 59, 32768, 962, 59, 32768, 962, 2048, 59, 100, 101, 103, 108, 110, 112, 114, 15698, 15700, 15705, 15715, 15725, 15735, 15739, 15745, 32768, 8764, 111, 116, 59, 32768, 10858, 512, 59, 113, 15710, 15712, 32768, 8771, 59, 32768, 8771, 512, 59, 69, 15720, 15722, 32768, 10910, 59, 32768, 10912, 512, 59, 69, 15730, 15732, 32768, 10909, 59, 32768, 10911, 101, 59, 32768, 8774, 108, 117, 115, 59, 32768, 10788, 97, 114, 114, 59, 32768, 10610, 97, 114, 114, 59, 32768, 8592, 1024, 97, 101, 105, 116, 15766, 15788, 15796, 15808, 512, 108, 115, 15771, 15783, 108, 115, 101, 116, 109, 105, 110, 117, 115, 59, 32768, 8726, 104, 112, 59, 32768, 10803, 112, 97, 114, 115, 108, 59, 32768, 10724, 512, 100, 108, 15801, 15804, 59, 32768, 8739, 101, 59, 32768, 8995, 512, 59, 101, 15813, 15815, 32768, 10922, 512, 59, 115, 15820, 15822, 32768, 10924, 59, 32896, 10924, 65024, 768, 102, 108, 112, 15833, 15839, 15857, 116, 99, 121, 59, 32768, 1100, 512, 59, 98, 15844, 15846, 32768, 47, 512, 59, 97, 15851, 15853, 32768, 10692, 114, 59, 32768, 9023, 102, 59, 32896, 55349, 56676, 97, 512, 100, 114, 15868, 15882, 101, 115, 512, 59, 117, 15875, 15877, 32768, 9824, 105, 116, 59, 32768, 9824, 59, 32768, 8741, 768, 99, 115, 117, 15892, 15921, 15977, 512, 97, 117, 15897, 15909, 112, 512, 59, 115, 15903, 15905, 32768, 8851, 59, 32896, 8851, 65024, 112, 512, 59, 115, 15915, 15917, 32768, 8852, 59, 32896, 8852, 65024, 117, 512, 98, 112, 15927, 15952, 768, 59, 101, 115, 15934, 15936, 15939, 32768, 8847, 59, 32768, 8849, 101, 116, 512, 59, 101, 15946, 15948, 32768, 8847, 113, 59, 32768, 8849, 768, 59, 101, 115, 15959, 15961, 15964, 32768, 8848, 59, 32768, 8850, 101, 116, 512, 59, 101, 15971, 15973, 32768, 8848, 113, 59, 32768, 8850, 768, 59, 97, 102, 15984, 15986, 15996, 32768, 9633, 114, 566, 15991, 15994, 59, 32768, 9633, 59, 32768, 9642, 59, 32768, 9642, 97, 114, 114, 59, 32768, 8594, 1024, 99, 101, 109, 116, 16014, 16019, 16025, 16031, 114, 59, 32896, 55349, 56520, 116, 109, 110, 59, 32768, 8726, 105, 108, 101, 59, 32768, 8995, 97, 114, 102, 59, 32768, 8902, 512, 97, 114, 16042, 16053, 114, 512, 59, 102, 16048, 16050, 32768, 9734, 59, 32768, 9733, 512, 97, 110, 16058, 16081, 105, 103, 104, 116, 512, 101, 112, 16067, 16076, 112, 115, 105, 108, 111, 110, 59, 32768, 1013, 104, 105, 59, 32768, 981, 115, 59, 32768, 175, 1280, 98, 99, 109, 110, 112, 16096, 16221, 16288, 16291, 16295, 2304, 59, 69, 100, 101, 109, 110, 112, 114, 115, 16115, 16117, 16120, 16125, 16137, 16143, 16154, 16160, 16166, 32768, 8834, 59, 32768, 10949, 111, 116, 59, 32768, 10941, 512, 59, 100, 16130, 16132, 32768, 8838, 111, 116, 59, 32768, 10947, 117, 108, 116, 59, 32768, 10945, 512, 69, 101, 16148, 16151, 59, 32768, 10955, 59, 32768, 8842, 108, 117, 115, 59, 32768, 10943, 97, 114, 114, 59, 32768, 10617, 768, 101, 105, 117, 16173, 16206, 16210, 116, 768, 59, 101, 110, 16181, 16183, 16194, 32768, 8834, 113, 512, 59, 113, 16189, 16191, 32768, 8838, 59, 32768, 10949, 101, 113, 512, 59, 113, 16201, 16203, 32768, 8842, 59, 32768, 10955, 109, 59, 32768, 10951, 512, 98, 112, 16215, 16218, 59, 32768, 10965, 59, 32768, 10963, 99, 1536, 59, 97, 99, 101, 110, 115, 16235, 16237, 16245, 16254, 16258, 16283, 32768, 8827, 112, 112, 114, 111, 120, 59, 32768, 10936, 117, 114, 108, 121, 101, 113, 59, 32768, 8829, 113, 59, 32768, 10928, 768, 97, 101, 115, 16265, 16273, 16278, 112, 112, 114, 111, 120, 59, 32768, 10938, 113, 113, 59, 32768, 10934, 105, 109, 59, 32768, 8937, 105, 109, 59, 32768, 8831, 59, 32768, 8721, 103, 59, 32768, 9834, 3328, 49, 50, 51, 59, 69, 100, 101, 104, 108, 109, 110, 112, 115, 16322, 16327, 16332, 16337, 16339, 16342, 16356, 16368, 16382, 16388, 16394, 16405, 16411, 33024, 185, 59, 32768, 185, 33024, 178, 59, 32768, 178, 33024, 179, 59, 32768, 179, 32768, 8835, 59, 32768, 10950, 512, 111, 115, 16347, 16351, 116, 59, 32768, 10942, 117, 98, 59, 32768, 10968, 512, 59, 100, 16361, 16363, 32768, 8839, 111, 116, 59, 32768, 10948, 115, 512, 111, 117, 16374, 16378, 108, 59, 32768, 10185, 98, 59, 32768, 10967, 97, 114, 114, 59, 32768, 10619, 117, 108, 116, 59, 32768, 10946, 512, 69, 101, 16399, 16402, 59, 32768, 10956, 59, 32768, 8843, 108, 117, 115, 59, 32768, 10944, 768, 101, 105, 117, 16418, 16451, 16455, 116, 768, 59, 101, 110, 16426, 16428, 16439, 32768, 8835, 113, 512, 59, 113, 16434, 16436, 32768, 8839, 59, 32768, 10950, 101, 113, 512, 59, 113, 16446, 16448, 32768, 8843, 59, 32768, 10956, 109, 59, 32768, 10952, 512, 98, 112, 16460, 16463, 59, 32768, 10964, 59, 32768, 10966, 768, 65, 97, 110, 16473, 16478, 16499, 114, 114, 59, 32768, 8665, 114, 512, 104, 114, 16484, 16488, 107, 59, 32768, 10534, 512, 59, 111, 16493, 16495, 32768, 8601, 119, 59, 32768, 8601, 119, 97, 114, 59, 32768, 10538, 108, 105, 103, 33024, 223, 59, 32768, 223, 5938, 16538, 16552, 16557, 16579, 16584, 16591, 0, 16596, 16692, 0, 0, 0, 0, 0, 16731, 16780, 0, 16787, 16908, 0, 0, 0, 16938, 1091, 16543, 0, 0, 16549, 103, 101, 116, 59, 32768, 8982, 59, 32768, 964, 114, 107, 59, 32768, 9140, 768, 97, 101, 121, 16563, 16569, 16575, 114, 111, 110, 59, 32768, 357, 100, 105, 108, 59, 32768, 355, 59, 32768, 1090, 111, 116, 59, 32768, 8411, 108, 114, 101, 99, 59, 32768, 8981, 114, 59, 32896, 55349, 56625, 1024, 101, 105, 107, 111, 16604, 16641, 16670, 16684, 835, 16609, 0, 16624, 101, 512, 52, 102, 16614, 16617, 59, 32768, 8756, 111, 114, 101, 59, 32768, 8756, 97, 768, 59, 115, 118, 16631, 16633, 16638, 32768, 952, 121, 109, 59, 32768, 977, 59, 32768, 977, 512, 99, 110, 16646, 16665, 107, 512, 97, 115, 16652, 16660, 112, 112, 114, 111, 120, 59, 32768, 8776, 105, 109, 59, 32768, 8764, 115, 112, 59, 32768, 8201, 512, 97, 115, 16675, 16679, 112, 59, 32768, 8776, 105, 109, 59, 32768, 8764, 114, 110, 33024, 254, 59, 32768, 254, 829, 16696, 16701, 16727, 100, 101, 59, 32768, 732, 101, 115, 33536, 215, 59, 98, 100, 16710, 16712, 16723, 32768, 215, 512, 59, 97, 16717, 16719, 32768, 8864, 114, 59, 32768, 10801, 59, 32768, 10800, 116, 59, 32768, 8749, 768, 101, 112, 115, 16737, 16741, 16775, 97, 59, 32768, 10536, 1024, 59, 98, 99, 102, 16750, 16752, 16757, 16762, 32768, 8868, 111, 116, 59, 32768, 9014, 105, 114, 59, 32768, 10993, 512, 59, 111, 16767, 16770, 32896, 55349, 56677, 114, 107, 59, 32768, 10970, 97, 59, 32768, 10537, 114, 105, 109, 101, 59, 32768, 8244, 768, 97, 105, 112, 16793, 16798, 16899, 100, 101, 59, 32768, 8482, 1792, 97, 100, 101, 109, 112, 115, 116, 16813, 16868, 16873, 16876, 16883, 16889, 16893, 110, 103, 108, 101, 1280, 59, 100, 108, 113, 114, 16828, 16830, 16836, 16850, 16853, 32768, 9653, 111, 119, 110, 59, 32768, 9663, 101, 102, 116, 512, 59, 101, 16844, 16846, 32768, 9667, 113, 59, 32768, 8884, 59, 32768, 8796, 105, 103, 104, 116, 512, 59, 101, 16862, 16864, 32768, 9657, 113, 59, 32768, 8885, 111, 116, 59, 32768, 9708, 59, 32768, 8796, 105, 110, 117, 115, 59, 32768, 10810, 108, 117, 115, 59, 32768, 10809, 98, 59, 32768, 10701, 105, 109, 101, 59, 32768, 10811, 101, 122, 105, 117, 109, 59, 32768, 9186, 768, 99, 104, 116, 16914, 16926, 16931, 512, 114, 121, 16919, 16923, 59, 32896, 55349, 56521, 59, 32768, 1094, 99, 121, 59, 32768, 1115, 114, 111, 107, 59, 32768, 359, 512, 105, 111, 16942, 16947, 120, 116, 59, 32768, 8812, 104, 101, 97, 100, 512, 108, 114, 16956, 16967, 101, 102, 116, 97, 114, 114, 111, 119, 59, 32768, 8606, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 32768, 8608, 4608, 65, 72, 97, 98, 99, 100, 102, 103, 104, 108, 109, 111, 112, 114, 115, 116, 117, 119, 17016, 17021, 17026, 17043, 17057, 17072, 17095, 17110, 17119, 17139, 17172, 17187, 17202, 17290, 17330, 17336, 17365, 17381, 114, 114, 59, 32768, 8657, 97, 114, 59, 32768, 10595, 512, 99, 114, 17031, 17039, 117, 116, 101, 33024, 250, 59, 32768, 250, 114, 59, 32768, 8593, 114, 820, 17049, 0, 17053, 121, 59, 32768, 1118, 118, 101, 59, 32768, 365, 512, 105, 121, 17062, 17069, 114, 99, 33024, 251, 59, 32768, 251, 59, 32768, 1091, 768, 97, 98, 104, 17079, 17084, 17090, 114, 114, 59, 32768, 8645, 108, 97, 99, 59, 32768, 369, 97, 114, 59, 32768, 10606, 512, 105, 114, 17100, 17106, 115, 104, 116, 59, 32768, 10622, 59, 32896, 55349, 56626, 114, 97, 118, 101, 33024, 249, 59, 32768, 249, 562, 17123, 17135, 114, 512, 108, 114, 17128, 17131, 59, 32768, 8639, 59, 32768, 8638, 108, 107, 59, 32768, 9600, 512, 99, 116, 17144, 17167, 1088, 17150, 0, 0, 17163, 114, 110, 512, 59, 101, 17156, 17158, 32768, 8988, 114, 59, 32768, 8988, 111, 112, 59, 32768, 8975, 114, 105, 59, 32768, 9720, 512, 97, 108, 17177, 17182, 99, 114, 59, 32768, 363, 33024, 168, 59, 32768, 168, 512, 103, 112, 17192, 17197, 111, 110, 59, 32768, 371, 102, 59, 32896, 55349, 56678, 1536, 97, 100, 104, 108, 115, 117, 17215, 17222, 17233, 17257, 17262, 17280, 114, 114, 111, 119, 59, 32768, 8593, 111, 119, 110, 97, 114, 114, 111, 119, 59, 32768, 8597, 97, 114, 112, 111, 111, 110, 512, 108, 114, 17244, 17250, 101, 102, 116, 59, 32768, 8639, 105, 103, 104, 116, 59, 32768, 8638, 117, 115, 59, 32768, 8846, 105, 768, 59, 104, 108, 17270, 17272, 17275, 32768, 965, 59, 32768, 978, 111, 110, 59, 32768, 965, 112, 97, 114, 114, 111, 119, 115, 59, 32768, 8648, 768, 99, 105, 116, 17297, 17320, 17325, 1088, 17303, 0, 0, 17316, 114, 110, 512, 59, 101, 17309, 17311, 32768, 8989, 114, 59, 32768, 8989, 111, 112, 59, 32768, 8974, 110, 103, 59, 32768, 367, 114, 105, 59, 32768, 9721, 99, 114, 59, 32896, 55349, 56522, 768, 100, 105, 114, 17343, 17348, 17354, 111, 116, 59, 32768, 8944, 108, 100, 101, 59, 32768, 361, 105, 512, 59, 102, 17360, 17362, 32768, 9653, 59, 32768, 9652, 512, 97, 109, 17370, 17375, 114, 114, 59, 32768, 8648, 108, 33024, 252, 59, 32768, 252, 97, 110, 103, 108, 101, 59, 32768, 10663, 3840, 65, 66, 68, 97, 99, 100, 101, 102, 108, 110, 111, 112, 114, 115, 122, 17420, 17425, 17437, 17443, 17613, 17617, 17623, 17667, 17672, 17678, 17693, 17699, 17705, 17711, 17754, 114, 114, 59, 32768, 8661, 97, 114, 512, 59, 118, 17432, 17434, 32768, 10984, 59, 32768, 10985, 97, 115, 104, 59, 32768, 8872, 512, 110, 114, 17448, 17454, 103, 114, 116, 59, 32768, 10652, 1792, 101, 107, 110, 112, 114, 115, 116, 17469, 17478, 17485, 17494, 17515, 17526, 17578, 112, 115, 105, 108, 111, 110, 59, 32768, 1013, 97, 112, 112, 97, 59, 32768, 1008, 111, 116, 104, 105, 110, 103, 59, 32768, 8709, 768, 104, 105, 114, 17501, 17505, 17508, 105, 59, 32768, 981, 59, 32768, 982, 111, 112, 116, 111, 59, 32768, 8733, 512, 59, 104, 17520, 17522, 32768, 8597, 111, 59, 32768, 1009, 512, 105, 117, 17531, 17537, 103, 109, 97, 59, 32768, 962, 512, 98, 112, 17542, 17560, 115, 101, 116, 110, 101, 113, 512, 59, 113, 17553, 17556, 32896, 8842, 65024, 59, 32896, 10955, 65024, 115, 101, 116, 110, 101, 113, 512, 59, 113, 17571, 17574, 32896, 8843, 65024, 59, 32896, 10956, 65024, 512, 104, 114, 17583, 17589, 101, 116, 97, 59, 32768, 977, 105, 97, 110, 103, 108, 101, 512, 108, 114, 17600, 17606, 101, 102, 116, 59, 32768, 8882, 105, 103, 104, 116, 59, 32768, 8883, 121, 59, 32768, 1074, 97, 115, 104, 59, 32768, 8866, 768, 101, 108, 114, 17630, 17648, 17654, 768, 59, 98, 101, 17637, 17639, 17644, 32768, 8744, 97, 114, 59, 32768, 8891, 113, 59, 32768, 8794, 108, 105, 112, 59, 32768, 8942, 512, 98, 116, 17659, 17664, 97, 114, 59, 32768, 124, 59, 32768, 124, 114, 59, 32896, 55349, 56627, 116, 114, 105, 59, 32768, 8882, 115, 117, 512, 98, 112, 17685, 17689, 59, 32896, 8834, 8402, 59, 32896, 8835, 8402, 112, 102, 59, 32896, 55349, 56679, 114, 111, 112, 59, 32768, 8733, 116, 114, 105, 59, 32768, 8883, 512, 99, 117, 17716, 17721, 114, 59, 32896, 55349, 56523, 512, 98, 112, 17726, 17740, 110, 512, 69, 101, 17732, 17736, 59, 32896, 10955, 65024, 59, 32896, 8842, 65024, 110, 512, 69, 101, 17746, 17750, 59, 32896, 10956, 65024, 59, 32896, 8843, 65024, 105, 103, 122, 97, 103, 59, 32768, 10650, 1792, 99, 101, 102, 111, 112, 114, 115, 17777, 17783, 17815, 17820, 17826, 17829, 17842, 105, 114, 99, 59, 32768, 373, 512, 100, 105, 17788, 17809, 512, 98, 103, 17793, 17798, 97, 114, 59, 32768, 10847, 101, 512, 59, 113, 17804, 17806, 32768, 8743, 59, 32768, 8793, 101, 114, 112, 59, 32768, 8472, 114, 59, 32896, 55349, 56628, 112, 102, 59, 32896, 55349, 56680, 59, 32768, 8472, 512, 59, 101, 17834, 17836, 32768, 8768, 97, 116, 104, 59, 32768, 8768, 99, 114, 59, 32896, 55349, 56524, 5428, 17871, 17891, 0, 17897, 0, 17902, 17917, 0, 0, 17920, 17935, 17940, 17945, 0, 0, 17977, 17992, 0, 18008, 18024, 18029, 768, 97, 105, 117, 17877, 17881, 17886, 112, 59, 32768, 8898, 114, 99, 59, 32768, 9711, 112, 59, 32768, 8899, 116, 114, 105, 59, 32768, 9661, 114, 59, 32896, 55349, 56629, 512, 65, 97, 17906, 17911, 114, 114, 59, 32768, 10234, 114, 114, 59, 32768, 10231, 59, 32768, 958, 512, 65, 97, 17924, 17929, 114, 114, 59, 32768, 10232, 114, 114, 59, 32768, 10229, 97, 112, 59, 32768, 10236, 105, 115, 59, 32768, 8955, 768, 100, 112, 116, 17951, 17956, 17970, 111, 116, 59, 32768, 10752, 512, 102, 108, 17961, 17965, 59, 32896, 55349, 56681, 117, 115, 59, 32768, 10753, 105, 109, 101, 59, 32768, 10754, 512, 65, 97, 17981, 17986, 114, 114, 59, 32768, 10233, 114, 114, 59, 32768, 10230, 512, 99, 113, 17996, 18001, 114, 59, 32896, 55349, 56525, 99, 117, 112, 59, 32768, 10758, 512, 112, 116, 18012, 18018, 108, 117, 115, 59, 32768, 10756, 114, 105, 59, 32768, 9651, 101, 101, 59, 32768, 8897, 101, 100, 103, 101, 59, 32768, 8896, 2048, 97, 99, 101, 102, 105, 111, 115, 117, 18052, 18068, 18081, 18087, 18092, 18097, 18103, 18109, 99, 512, 117, 121, 18058, 18065, 116, 101, 33024, 253, 59, 32768, 253, 59, 32768, 1103, 512, 105, 121, 18073, 18078, 114, 99, 59, 32768, 375, 59, 32768, 1099, 110, 33024, 165, 59, 32768, 165, 114, 59, 32896, 55349, 56630, 99, 121, 59, 32768, 1111, 112, 102, 59, 32896, 55349, 56682, 99, 114, 59, 32896, 55349, 56526, 512, 99, 109, 18114, 18118, 121, 59, 32768, 1102, 108, 33024, 255, 59, 32768, 255, 2560, 97, 99, 100, 101, 102, 104, 105, 111, 115, 119, 18145, 18152, 18166, 18171, 18186, 18191, 18196, 18204, 18210, 18216, 99, 117, 116, 101, 59, 32768, 378, 512, 97, 121, 18157, 18163, 114, 111, 110, 59, 32768, 382, 59, 32768, 1079, 111, 116, 59, 32768, 380, 512, 101, 116, 18176, 18182, 116, 114, 102, 59, 32768, 8488, 97, 59, 32768, 950, 114, 59, 32896, 55349, 56631, 99, 121, 59, 32768, 1078, 103, 114, 97, 114, 114, 59, 32768, 8669, 112, 102, 59, 32896, 55349, 56683, 99, 114, 59, 32896, 55349, 56527, 512, 106, 110, 18221, 18224, 59, 32768, 8205, 106, 59, 32768, 8204]);
|
|
}
|
|
});
|
|
|
|
// node_modules/entities/lib/generated/decode-data-xml.js
|
|
var require_decode_data_xml = __commonJS({
|
|
"node_modules/entities/lib/generated/decode-data-xml.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = new Uint16Array([1024, 97, 103, 108, 113, 9, 23, 27, 31, 1086, 15, 0, 0, 19, 112, 59, 32768, 38, 111, 115, 59, 32768, 39, 116, 59, 32768, 62, 116, 59, 32768, 60, 117, 111, 116, 59, 32768, 34]);
|
|
}
|
|
});
|
|
|
|
// node_modules/entities/lib/decode.js
|
|
var require_decode = __commonJS({
|
|
"node_modules/entities/lib/decode.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTML = exports.determineBranch = exports.JUMP_OFFSET_BASE = exports.BinTrieFlags = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0;
|
|
var decode_data_html_1 = __importDefault(require_decode_data_html());
|
|
exports.htmlDecodeTree = decode_data_html_1.default;
|
|
var decode_data_xml_1 = __importDefault(require_decode_data_xml());
|
|
exports.xmlDecodeTree = decode_data_xml_1.default;
|
|
var decode_codepoint_1 = __importDefault(require_decode_codepoint());
|
|
var BinTrieFlags;
|
|
(function(BinTrieFlags2) {
|
|
BinTrieFlags2[BinTrieFlags2["HAS_VALUE"] = 32768] = "HAS_VALUE";
|
|
BinTrieFlags2[BinTrieFlags2["BRANCH_LENGTH"] = 32512] = "BRANCH_LENGTH";
|
|
BinTrieFlags2[BinTrieFlags2["MULTI_BYTE"] = 128] = "MULTI_BYTE";
|
|
BinTrieFlags2[BinTrieFlags2["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
|
})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {}));
|
|
exports.JUMP_OFFSET_BASE = 48 - 1;
|
|
function getDecoder(decodeTree) {
|
|
return function decodeHTMLBinary(str, strict) {
|
|
var ret = "";
|
|
var lastIdx = 0;
|
|
var strIdx = 0;
|
|
while ((strIdx = str.indexOf("&", strIdx)) >= 0) {
|
|
ret += str.slice(lastIdx, strIdx);
|
|
lastIdx = strIdx;
|
|
strIdx += 1;
|
|
if (str.charCodeAt(strIdx) === 35) {
|
|
var start = strIdx + 1;
|
|
var base = 10;
|
|
var cp = str.charCodeAt(start);
|
|
if ((cp | 32) === 120) {
|
|
base = 16;
|
|
strIdx += 1;
|
|
start += 1;
|
|
}
|
|
while ((cp = str.charCodeAt(++strIdx)) >= 48 && cp <= 57 || base === 16 && (cp | 32) >= 97 && (cp | 32) <= 102)
|
|
;
|
|
if (start !== strIdx) {
|
|
var entity = str.substring(start, strIdx);
|
|
var parsed = parseInt(entity, base);
|
|
if (str.charCodeAt(strIdx) === 59) {
|
|
strIdx += 1;
|
|
} else if (strict) {
|
|
continue;
|
|
}
|
|
ret += decode_codepoint_1.default(parsed);
|
|
lastIdx = strIdx;
|
|
}
|
|
continue;
|
|
}
|
|
var result = null;
|
|
var excess = 1;
|
|
var treeIdx = 0;
|
|
var current = decodeTree[treeIdx];
|
|
for (; strIdx < str.length; strIdx++, excess++) {
|
|
treeIdx = determineBranch(decodeTree, current, treeIdx + 1, str.charCodeAt(strIdx));
|
|
if (treeIdx < 0)
|
|
break;
|
|
current = decodeTree[treeIdx];
|
|
if (current & BinTrieFlags.HAS_VALUE) {
|
|
if (strict && str.charCodeAt(strIdx) !== 59) {
|
|
treeIdx += 1;
|
|
} else {
|
|
result = current & BinTrieFlags.MULTI_BYTE ? String.fromCharCode(decodeTree[++treeIdx], decodeTree[++treeIdx]) : String.fromCharCode(decodeTree[++treeIdx]);
|
|
excess = 0;
|
|
}
|
|
}
|
|
}
|
|
if (result != null) {
|
|
ret += result;
|
|
lastIdx = strIdx - excess + 1;
|
|
}
|
|
}
|
|
return ret + str.slice(lastIdx);
|
|
};
|
|
}
|
|
function determineBranch(decodeTree, current, nodeIdx, char) {
|
|
if (current <= 128) {
|
|
return char === current ? nodeIdx : -1;
|
|
}
|
|
var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 8;
|
|
if (branchCount === 0) {
|
|
return -1;
|
|
}
|
|
if (branchCount === 1) {
|
|
return char === decodeTree[nodeIdx] ? nodeIdx + 1 : -1;
|
|
}
|
|
var jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
|
if (jumpOffset) {
|
|
var value = char - exports.JUMP_OFFSET_BASE - jumpOffset;
|
|
return value < 0 || value > branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
|
|
}
|
|
var lo = nodeIdx;
|
|
var hi = lo + branchCount - 1;
|
|
while (lo <= hi) {
|
|
var mid = lo + hi >>> 1;
|
|
var midVal = decodeTree[mid];
|
|
if (midVal < char) {
|
|
lo = mid + 1;
|
|
} else if (midVal > char) {
|
|
hi = mid - 1;
|
|
} else {
|
|
return decodeTree[mid + branchCount];
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
exports.determineBranch = determineBranch;
|
|
var htmlDecoder = getDecoder(decode_data_html_1.default);
|
|
var xmlDecoder = getDecoder(decode_data_xml_1.default);
|
|
function decodeHTML(str) {
|
|
return htmlDecoder(str, false);
|
|
}
|
|
exports.decodeHTML = decodeHTML;
|
|
function decodeHTMLStrict(str) {
|
|
return htmlDecoder(str, true);
|
|
}
|
|
exports.decodeHTMLStrict = decodeHTMLStrict;
|
|
function decodeXML(str) {
|
|
return xmlDecoder(str, true);
|
|
}
|
|
exports.decodeXML = decodeXML;
|
|
}
|
|
});
|
|
|
|
// node_modules/htmlparser2/lib/Tokenizer.js
|
|
var require_Tokenizer = __commonJS({
|
|
"node_modules/htmlparser2/lib/Tokenizer.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var decode_codepoint_1 = __importDefault(require_decode_codepoint());
|
|
var decode_1 = require_decode();
|
|
function isWhitespace(c2) {
|
|
return c2 === 32 || c2 === 10 || c2 === 9 || c2 === 12 || c2 === 13;
|
|
}
|
|
function isEndOfTagSection(c2) {
|
|
return c2 === 47 || c2 === 62 || isWhitespace(c2);
|
|
}
|
|
function isNumber2(c2) {
|
|
return c2 >= 48 && c2 <= 57;
|
|
}
|
|
function isASCIIAlpha(c2) {
|
|
return c2 >= 97 && c2 <= 122 || c2 >= 65 && c2 <= 90;
|
|
}
|
|
var Sequences = {
|
|
Cdata: new Uint16Array([67, 68, 65, 84, 65, 91]),
|
|
CdataEnd: new Uint16Array([93, 93, 62]),
|
|
CommentEnd: new Uint16Array([45, 45, 62]),
|
|
ScriptEnd: new Uint16Array([
|
|
60,
|
|
47,
|
|
115,
|
|
99,
|
|
114,
|
|
105,
|
|
112,
|
|
116
|
|
]),
|
|
StyleEnd: new Uint16Array([60, 47, 115, 116, 121, 108, 101]),
|
|
TitleEnd: new Uint16Array([60, 47, 116, 105, 116, 108, 101])
|
|
};
|
|
var Tokenizer = function() {
|
|
function Tokenizer2(_a, cbs) {
|
|
var _b = _a.xmlMode, xmlMode = _b === void 0 ? false : _b, _c = _a.decodeEntities, decodeEntities = _c === void 0 ? true : _c;
|
|
this.cbs = cbs;
|
|
this._state = 1;
|
|
this.buffer = "";
|
|
this.sectionStart = 0;
|
|
this._index = 0;
|
|
this.bufferOffset = 0;
|
|
this.baseState = 1;
|
|
this.isSpecial = false;
|
|
this.running = true;
|
|
this.ended = false;
|
|
this.sequenceIndex = 0;
|
|
this.trieIndex = 0;
|
|
this.trieCurrent = 0;
|
|
this.trieResult = null;
|
|
this.entityExcess = 0;
|
|
this.xmlMode = xmlMode;
|
|
this.decodeEntities = decodeEntities;
|
|
this.entityTrie = xmlMode ? decode_1.xmlDecodeTree : decode_1.htmlDecodeTree;
|
|
}
|
|
Tokenizer2.prototype.reset = function() {
|
|
this._state = 1;
|
|
this.buffer = "";
|
|
this.sectionStart = 0;
|
|
this._index = 0;
|
|
this.bufferOffset = 0;
|
|
this.baseState = 1;
|
|
this.currentSequence = void 0;
|
|
this.running = true;
|
|
this.ended = false;
|
|
};
|
|
Tokenizer2.prototype.write = function(chunk) {
|
|
if (this.ended)
|
|
return this.cbs.onerror(Error(".write() after done!"));
|
|
this.buffer += chunk;
|
|
this.parse();
|
|
};
|
|
Tokenizer2.prototype.end = function(chunk) {
|
|
if (this.ended)
|
|
return this.cbs.onerror(Error(".end() after done!"));
|
|
if (chunk)
|
|
this.write(chunk);
|
|
this.ended = true;
|
|
if (this.running)
|
|
this.finish();
|
|
};
|
|
Tokenizer2.prototype.pause = function() {
|
|
this.running = false;
|
|
};
|
|
Tokenizer2.prototype.resume = function() {
|
|
this.running = true;
|
|
if (this._index < this.buffer.length) {
|
|
this.parse();
|
|
}
|
|
if (this.ended) {
|
|
this.finish();
|
|
}
|
|
};
|
|
Tokenizer2.prototype.getAbsoluteSectionStart = function() {
|
|
return this.sectionStart + this.bufferOffset;
|
|
};
|
|
Tokenizer2.prototype.getAbsoluteIndex = function() {
|
|
return this.bufferOffset + this._index;
|
|
};
|
|
Tokenizer2.prototype.stateText = function(c2) {
|
|
if (c2 === 60 || !this.decodeEntities && this.fastForwardTo(60)) {
|
|
if (this._index > this.sectionStart) {
|
|
this.cbs.ontext(this.getSection());
|
|
}
|
|
this._state = 2;
|
|
this.sectionStart = this._index;
|
|
} else if (this.decodeEntities && c2 === 38) {
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateSpecialStartSequence = function(c2) {
|
|
var isEnd = this.sequenceIndex === this.currentSequence.length;
|
|
var isMatch2 = isEnd ? isEndOfTagSection(c2) : (c2 | 32) === this.currentSequence[this.sequenceIndex];
|
|
if (!isMatch2) {
|
|
this.isSpecial = false;
|
|
} else if (!isEnd) {
|
|
this.sequenceIndex++;
|
|
return;
|
|
}
|
|
this.sequenceIndex = 0;
|
|
this._state = 3;
|
|
this.stateInTagName(c2);
|
|
};
|
|
Tokenizer2.prototype.stateInSpecialTag = function(c2) {
|
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
if (c2 === 62 || isWhitespace(c2)) {
|
|
var endOfText = this._index - this.currentSequence.length;
|
|
if (this.sectionStart < endOfText) {
|
|
var actualIndex = this._index;
|
|
this._index = endOfText;
|
|
this.cbs.ontext(this.getSection());
|
|
this._index = actualIndex;
|
|
}
|
|
this.isSpecial = false;
|
|
this.sectionStart = endOfText + 2;
|
|
this.stateInClosingTagName(c2);
|
|
return;
|
|
}
|
|
this.sequenceIndex = 0;
|
|
}
|
|
if ((c2 | 32) === this.currentSequence[this.sequenceIndex]) {
|
|
this.sequenceIndex += 1;
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.currentSequence === Sequences.TitleEnd) {
|
|
if (this.decodeEntities && c2 === 38) {
|
|
this._state = 25;
|
|
}
|
|
} else if (this.fastForwardTo(60)) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = Number(c2 === 60);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateCDATASequence = function(c2) {
|
|
if (c2 === Sequences.Cdata[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === Sequences.Cdata.length) {
|
|
this._state = 21;
|
|
this.currentSequence = Sequences.CdataEnd;
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
} else {
|
|
this.sequenceIndex = 0;
|
|
this._state = 16;
|
|
this.stateInDeclaration(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.fastForwardTo = function(c2) {
|
|
while (++this._index < this.buffer.length) {
|
|
if (this.buffer.charCodeAt(this._index) === c2) {
|
|
return true;
|
|
}
|
|
}
|
|
this._index = this.buffer.length - 1;
|
|
return false;
|
|
};
|
|
Tokenizer2.prototype.stateInCommentLike = function(c2) {
|
|
if (c2 === this.currentSequence[this.sequenceIndex]) {
|
|
if (++this.sequenceIndex === this.currentSequence.length) {
|
|
var section = this.buffer.slice(this.sectionStart, this._index - 2);
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
this.cbs.oncdata(section);
|
|
} else {
|
|
this.cbs.oncomment(section);
|
|
}
|
|
this.sequenceIndex = 0;
|
|
this.sectionStart = this._index + 1;
|
|
this._state = 1;
|
|
}
|
|
} else if (this.sequenceIndex === 0) {
|
|
if (this.fastForwardTo(this.currentSequence[0])) {
|
|
this.sequenceIndex = 1;
|
|
}
|
|
} else if (c2 !== this.currentSequence[this.sequenceIndex - 1]) {
|
|
this.sequenceIndex = 0;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.isTagStartChar = function(c2) {
|
|
return this.xmlMode ? !isEndOfTagSection(c2) : isASCIIAlpha(c2);
|
|
};
|
|
Tokenizer2.prototype.startSpecial = function(sequence, offset) {
|
|
this.isSpecial = true;
|
|
this.currentSequence = sequence;
|
|
this.sequenceIndex = offset;
|
|
this._state = 23;
|
|
};
|
|
Tokenizer2.prototype.stateBeforeTagName = function(c2) {
|
|
if (c2 === 33) {
|
|
this._state = 15;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c2 === 63) {
|
|
this._state = 17;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (this.isTagStartChar(c2)) {
|
|
var lower = c2 | 32;
|
|
this.sectionStart = this._index;
|
|
if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {
|
|
this.startSpecial(Sequences.TitleEnd, 3);
|
|
} else {
|
|
this._state = !this.xmlMode && lower === Sequences.ScriptEnd[2] ? 22 : 3;
|
|
}
|
|
} else if (c2 === 47) {
|
|
this._state = 5;
|
|
} else {
|
|
this._state = 1;
|
|
this.stateText(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInTagName = function(c2) {
|
|
if (isEndOfTagSection(c2)) {
|
|
this.cbs.onopentagname(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeClosingTagName = function(c2) {
|
|
if (isWhitespace(c2)) {
|
|
} else if (c2 === 62) {
|
|
this._state = 1;
|
|
} else {
|
|
this._state = this.isTagStartChar(c2) ? 6 : 20;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInClosingTagName = function(c2) {
|
|
if (c2 === 62 || isWhitespace(c2)) {
|
|
this.cbs.onclosetag(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 7;
|
|
this.stateAfterClosingTagName(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateAfterClosingTagName = function(c2) {
|
|
if (c2 === 62 || this.fastForwardTo(62)) {
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeAttributeName = function(c2) {
|
|
if (c2 === 62) {
|
|
this.cbs.onopentagend();
|
|
if (this.isSpecial) {
|
|
this._state = 24;
|
|
this.sequenceIndex = 0;
|
|
} else {
|
|
this._state = 1;
|
|
}
|
|
this.baseState = this._state;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c2 === 47) {
|
|
this._state = 4;
|
|
} else if (!isWhitespace(c2)) {
|
|
this._state = 9;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInSelfClosingTag = function(c2) {
|
|
if (c2 === 62) {
|
|
this.cbs.onselfclosingtag();
|
|
this._state = 1;
|
|
this.baseState = 1;
|
|
this.sectionStart = this._index + 1;
|
|
this.isSpecial = false;
|
|
} else if (!isWhitespace(c2)) {
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeName = function(c2) {
|
|
if (c2 === 61 || isEndOfTagSection(c2)) {
|
|
this.cbs.onattribname(this.getSection());
|
|
this.sectionStart = -1;
|
|
this._state = 10;
|
|
this.stateAfterAttributeName(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateAfterAttributeName = function(c2) {
|
|
if (c2 === 61) {
|
|
this._state = 11;
|
|
} else if (c2 === 47 || c2 === 62) {
|
|
this.cbs.onattribend(void 0);
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c2);
|
|
} else if (!isWhitespace(c2)) {
|
|
this.cbs.onattribend(void 0);
|
|
this._state = 9;
|
|
this.sectionStart = this._index;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeAttributeValue = function(c2) {
|
|
if (c2 === 34) {
|
|
this._state = 12;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (c2 === 39) {
|
|
this._state = 13;
|
|
this.sectionStart = this._index + 1;
|
|
} else if (!isWhitespace(c2)) {
|
|
this.sectionStart = this._index;
|
|
this._state = 14;
|
|
this.stateInAttributeValueNoQuotes(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.handleInAttributeValue = function(c2, quote) {
|
|
if (c2 === quote || !this.decodeEntities && this.fastForwardTo(quote)) {
|
|
this.cbs.onattribdata(this.getSection());
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(String.fromCharCode(quote));
|
|
this._state = 8;
|
|
} else if (this.decodeEntities && c2 === 38) {
|
|
this.baseState = this._state;
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueDoubleQuotes = function(c2) {
|
|
this.handleInAttributeValue(c2, 34);
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueSingleQuotes = function(c2) {
|
|
this.handleInAttributeValue(c2, 39);
|
|
};
|
|
Tokenizer2.prototype.stateInAttributeValueNoQuotes = function(c2) {
|
|
if (isWhitespace(c2) || c2 === 62) {
|
|
this.cbs.onattribdata(this.getSection());
|
|
this.sectionStart = -1;
|
|
this.cbs.onattribend(null);
|
|
this._state = 8;
|
|
this.stateBeforeAttributeName(c2);
|
|
} else if (this.decodeEntities && c2 === 38) {
|
|
this.baseState = this._state;
|
|
this._state = 25;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeDeclaration = function(c2) {
|
|
if (c2 === 91) {
|
|
this._state = 19;
|
|
this.sequenceIndex = 0;
|
|
} else {
|
|
this._state = c2 === 45 ? 18 : 16;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInDeclaration = function(c2) {
|
|
if (c2 === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.ondeclaration(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInProcessingInstruction = function(c2) {
|
|
if (c2 === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.onprocessinginstruction(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeComment = function(c2) {
|
|
if (c2 === 45) {
|
|
this._state = 21;
|
|
this.currentSequence = Sequences.CommentEnd;
|
|
this.sequenceIndex = 2;
|
|
this.sectionStart = this._index + 1;
|
|
} else {
|
|
this._state = 16;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInSpecialComment = function(c2) {
|
|
if (c2 === 62 || this.fastForwardTo(62)) {
|
|
this.cbs.oncomment(this.getSection());
|
|
this._state = 1;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeSpecialS = function(c2) {
|
|
var lower = c2 | 32;
|
|
if (lower === Sequences.ScriptEnd[3]) {
|
|
this.startSpecial(Sequences.ScriptEnd, 4);
|
|
} else if (lower === Sequences.StyleEnd[3]) {
|
|
this.startSpecial(Sequences.StyleEnd, 4);
|
|
} else {
|
|
this._state = 3;
|
|
this.stateInTagName(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateBeforeEntity = function(c2) {
|
|
this.entityExcess = 1;
|
|
if (c2 === 35) {
|
|
this._state = 26;
|
|
} else if (c2 === 38) {
|
|
} else {
|
|
this.trieIndex = 0;
|
|
this.trieCurrent = this.entityTrie[0];
|
|
this.trieResult = null;
|
|
this._state = 27;
|
|
this.stateInNamedEntity(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInNamedEntity = function(c2) {
|
|
this.entityExcess += 1;
|
|
this.trieIndex = (0, decode_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c2);
|
|
if (this.trieIndex < 0) {
|
|
this.emitNamedEntity();
|
|
this._index--;
|
|
return;
|
|
}
|
|
this.trieCurrent = this.entityTrie[this.trieIndex];
|
|
if (this.trieCurrent & decode_1.BinTrieFlags.HAS_VALUE) {
|
|
if (!this.allowLegacyEntity() && c2 !== 59) {
|
|
this.trieIndex += 1;
|
|
} else {
|
|
var entityStart = this._index - this.entityExcess + 1;
|
|
if (entityStart > this.sectionStart) {
|
|
this.emitPartial(this.buffer.substring(this.sectionStart, entityStart));
|
|
}
|
|
this.trieResult = this.trieCurrent & decode_1.BinTrieFlags.MULTI_BYTE ? String.fromCharCode(this.entityTrie[++this.trieIndex], this.entityTrie[++this.trieIndex]) : String.fromCharCode(this.entityTrie[++this.trieIndex]);
|
|
this.entityExcess = 0;
|
|
this.sectionStart = this._index + 1;
|
|
}
|
|
}
|
|
};
|
|
Tokenizer2.prototype.emitNamedEntity = function() {
|
|
if (this.trieResult) {
|
|
this.emitPartial(this.trieResult);
|
|
}
|
|
this._state = this.baseState;
|
|
};
|
|
Tokenizer2.prototype.stateBeforeNumericEntity = function(c2) {
|
|
if ((c2 | 32) === 120) {
|
|
this.entityExcess++;
|
|
this._state = 29;
|
|
} else {
|
|
this._state = 28;
|
|
this.stateInNumericEntity(c2);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.decodeNumericEntity = function(base, strict) {
|
|
var entityStart = this._index - this.entityExcess - 1;
|
|
var numberStart = entityStart + 2 + (base >> 4);
|
|
if (numberStart !== this._index) {
|
|
if (entityStart > this.sectionStart) {
|
|
this.emitPartial(this.buffer.substring(this.sectionStart, entityStart));
|
|
}
|
|
var entity = this.buffer.substring(numberStart, this._index);
|
|
var parsed = parseInt(entity, base);
|
|
this.emitPartial((0, decode_codepoint_1.default)(parsed));
|
|
this.sectionStart = this._index + Number(strict);
|
|
}
|
|
this._state = this.baseState;
|
|
};
|
|
Tokenizer2.prototype.stateInNumericEntity = function(c2) {
|
|
if (c2 === 59) {
|
|
this.decodeNumericEntity(10, true);
|
|
} else if (!isNumber2(c2)) {
|
|
if (this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(10, false);
|
|
} else {
|
|
this._state = this.baseState;
|
|
}
|
|
this._index--;
|
|
} else {
|
|
this.entityExcess++;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.stateInHexEntity = function(c2) {
|
|
if (c2 === 59) {
|
|
this.decodeNumericEntity(16, true);
|
|
} else if ((c2 < 97 || c2 > 102) && (c2 < 65 || c2 > 70) && !isNumber2(c2)) {
|
|
if (this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(16, false);
|
|
} else {
|
|
this._state = this.baseState;
|
|
}
|
|
this._index--;
|
|
} else {
|
|
this.entityExcess++;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.allowLegacyEntity = function() {
|
|
return !this.xmlMode && (this.baseState === 1 || this.baseState === 24);
|
|
};
|
|
Tokenizer2.prototype.cleanup = function() {
|
|
if (this.running && this.sectionStart !== this._index && (this._state === 1 || this._state === 24 && this.sequenceIndex === 0)) {
|
|
this.cbs.ontext(this.buffer.substr(this.sectionStart));
|
|
this.sectionStart = this._index;
|
|
}
|
|
var start = this.sectionStart < 0 ? this._index : this.sectionStart;
|
|
this.buffer = start === this.buffer.length ? "" : this.buffer.substr(start);
|
|
this._index -= start;
|
|
this.bufferOffset += start;
|
|
if (this.sectionStart > 0) {
|
|
this.sectionStart = 0;
|
|
}
|
|
};
|
|
Tokenizer2.prototype.shouldContinue = function() {
|
|
return this._index < this.buffer.length && this.running;
|
|
};
|
|
Tokenizer2.prototype.parse = function() {
|
|
while (this.shouldContinue()) {
|
|
var c2 = this.buffer.charCodeAt(this._index);
|
|
if (this._state === 1) {
|
|
this.stateText(c2);
|
|
} else if (this._state === 23) {
|
|
this.stateSpecialStartSequence(c2);
|
|
} else if (this._state === 24) {
|
|
this.stateInSpecialTag(c2);
|
|
} else if (this._state === 19) {
|
|
this.stateCDATASequence(c2);
|
|
} else if (this._state === 12) {
|
|
this.stateInAttributeValueDoubleQuotes(c2);
|
|
} else if (this._state === 9) {
|
|
this.stateInAttributeName(c2);
|
|
} else if (this._state === 21) {
|
|
this.stateInCommentLike(c2);
|
|
} else if (this._state === 20) {
|
|
this.stateInSpecialComment(c2);
|
|
} else if (this._state === 8) {
|
|
this.stateBeforeAttributeName(c2);
|
|
} else if (this._state === 3) {
|
|
this.stateInTagName(c2);
|
|
} else if (this._state === 6) {
|
|
this.stateInClosingTagName(c2);
|
|
} else if (this._state === 2) {
|
|
this.stateBeforeTagName(c2);
|
|
} else if (this._state === 10) {
|
|
this.stateAfterAttributeName(c2);
|
|
} else if (this._state === 13) {
|
|
this.stateInAttributeValueSingleQuotes(c2);
|
|
} else if (this._state === 11) {
|
|
this.stateBeforeAttributeValue(c2);
|
|
} else if (this._state === 5) {
|
|
this.stateBeforeClosingTagName(c2);
|
|
} else if (this._state === 7) {
|
|
this.stateAfterClosingTagName(c2);
|
|
} else if (this._state === 22) {
|
|
this.stateBeforeSpecialS(c2);
|
|
} else if (this._state === 14) {
|
|
this.stateInAttributeValueNoQuotes(c2);
|
|
} else if (this._state === 4) {
|
|
this.stateInSelfClosingTag(c2);
|
|
} else if (this._state === 16) {
|
|
this.stateInDeclaration(c2);
|
|
} else if (this._state === 15) {
|
|
this.stateBeforeDeclaration(c2);
|
|
} else if (this._state === 18) {
|
|
this.stateBeforeComment(c2);
|
|
} else if (this._state === 17) {
|
|
this.stateInProcessingInstruction(c2);
|
|
} else if (this._state === 27) {
|
|
this.stateInNamedEntity(c2);
|
|
} else if (this._state === 25) {
|
|
this.stateBeforeEntity(c2);
|
|
} else if (this._state === 29) {
|
|
this.stateInHexEntity(c2);
|
|
} else if (this._state === 28) {
|
|
this.stateInNumericEntity(c2);
|
|
} else {
|
|
this.stateBeforeNumericEntity(c2);
|
|
}
|
|
this._index++;
|
|
}
|
|
this.cleanup();
|
|
};
|
|
Tokenizer2.prototype.finish = function() {
|
|
if (this._state === 27) {
|
|
this.emitNamedEntity();
|
|
}
|
|
if (this.sectionStart < this._index) {
|
|
this.handleTrailingData();
|
|
}
|
|
this.cbs.onend();
|
|
};
|
|
Tokenizer2.prototype.handleTrailingData = function() {
|
|
var data = this.buffer.substr(this.sectionStart);
|
|
if (this._state === 21) {
|
|
if (this.currentSequence === Sequences.CdataEnd) {
|
|
this.cbs.oncdata(data);
|
|
} else {
|
|
this.cbs.oncomment(data);
|
|
}
|
|
} else if (this._state === 28 && this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(10, false);
|
|
} else if (this._state === 29 && this.allowLegacyEntity()) {
|
|
this.decodeNumericEntity(16, false);
|
|
} else if (this._state === 3 || this._state === 8 || this._state === 11 || this._state === 10 || this._state === 9 || this._state === 13 || this._state === 12 || this._state === 14 || this._state === 6) {
|
|
} else {
|
|
this.cbs.ontext(data);
|
|
}
|
|
};
|
|
Tokenizer2.prototype.getSection = function() {
|
|
return this.buffer.substring(this.sectionStart, this._index);
|
|
};
|
|
Tokenizer2.prototype.emitPartial = function(value) {
|
|
if (this.baseState !== 1 && this.baseState !== 24) {
|
|
this.cbs.onattribdata(value);
|
|
} else {
|
|
this.cbs.ontext(value);
|
|
}
|
|
};
|
|
return Tokenizer2;
|
|
}();
|
|
exports.default = Tokenizer;
|
|
}
|
|
});
|
|
|
|
// node_modules/htmlparser2/lib/Parser.js
|
|
var require_Parser = __commonJS({
|
|
"node_modules/htmlparser2/lib/Parser.js"(exports) {
|
|
"use strict";
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Parser = void 0;
|
|
var Tokenizer_1 = __importDefault(require_Tokenizer());
|
|
var formTags = /* @__PURE__ */ new Set([
|
|
"input",
|
|
"option",
|
|
"optgroup",
|
|
"select",
|
|
"button",
|
|
"datalist",
|
|
"textarea"
|
|
]);
|
|
var pTag = /* @__PURE__ */ new Set(["p"]);
|
|
var tableSectionTags = /* @__PURE__ */ new Set(["thead", "tbody"]);
|
|
var ddtTags = /* @__PURE__ */ new Set(["dd", "dt"]);
|
|
var rtpTags = /* @__PURE__ */ new Set(["rt", "rp"]);
|
|
var openImpliesClose = /* @__PURE__ */ new Map([
|
|
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
|
["th", /* @__PURE__ */ new Set(["th"])],
|
|
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
|
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
|
["li", /* @__PURE__ */ new Set(["li"])],
|
|
["p", pTag],
|
|
["h1", pTag],
|
|
["h2", pTag],
|
|
["h3", pTag],
|
|
["h4", pTag],
|
|
["h5", pTag],
|
|
["h6", pTag],
|
|
["select", formTags],
|
|
["input", formTags],
|
|
["output", formTags],
|
|
["button", formTags],
|
|
["datalist", formTags],
|
|
["textarea", formTags],
|
|
["option", /* @__PURE__ */ new Set(["option"])],
|
|
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
|
["dd", ddtTags],
|
|
["dt", ddtTags],
|
|
["address", pTag],
|
|
["article", pTag],
|
|
["aside", pTag],
|
|
["blockquote", pTag],
|
|
["details", pTag],
|
|
["div", pTag],
|
|
["dl", pTag],
|
|
["fieldset", pTag],
|
|
["figcaption", pTag],
|
|
["figure", pTag],
|
|
["footer", pTag],
|
|
["form", pTag],
|
|
["header", pTag],
|
|
["hr", pTag],
|
|
["main", pTag],
|
|
["nav", pTag],
|
|
["ol", pTag],
|
|
["pre", pTag],
|
|
["section", pTag],
|
|
["table", pTag],
|
|
["ul", pTag],
|
|
["rt", rtpTags],
|
|
["rp", rtpTags],
|
|
["tbody", tableSectionTags],
|
|
["tfoot", tableSectionTags]
|
|
]);
|
|
var voidElements = /* @__PURE__ */ new Set([
|
|
"area",
|
|
"base",
|
|
"basefont",
|
|
"br",
|
|
"col",
|
|
"command",
|
|
"embed",
|
|
"frame",
|
|
"hr",
|
|
"img",
|
|
"input",
|
|
"isindex",
|
|
"keygen",
|
|
"link",
|
|
"meta",
|
|
"param",
|
|
"source",
|
|
"track",
|
|
"wbr"
|
|
]);
|
|
var foreignContextElements = /* @__PURE__ */ new Set(["math", "svg"]);
|
|
var htmlIntegrationElements = /* @__PURE__ */ new Set([
|
|
"mi",
|
|
"mo",
|
|
"mn",
|
|
"ms",
|
|
"mtext",
|
|
"annotation-xml",
|
|
"foreignobject",
|
|
"desc",
|
|
"title"
|
|
]);
|
|
var reNameEnd = /\s|\//;
|
|
var Parser = function() {
|
|
function Parser2(cbs, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _a, _b, _c, _d, _e;
|
|
this.options = options;
|
|
this.startIndex = 0;
|
|
this.endIndex = 0;
|
|
this.openTagStart = 0;
|
|
this.tagname = "";
|
|
this.attribname = "";
|
|
this.attribvalue = "";
|
|
this.attribs = null;
|
|
this.stack = [];
|
|
this.foreignContext = [];
|
|
this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
|
|
this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;
|
|
this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;
|
|
this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this);
|
|
(_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);
|
|
}
|
|
Parser2.prototype.ontext = function(data) {
|
|
var _a, _b;
|
|
var idx = this.tokenizer.getAbsoluteIndex();
|
|
this.endIndex = idx - 1;
|
|
(_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);
|
|
this.startIndex = idx;
|
|
};
|
|
Parser2.prototype.isVoidElement = function(name) {
|
|
return !this.options.xmlMode && voidElements.has(name);
|
|
};
|
|
Parser2.prototype.onopentagname = function(name) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
this.emitOpenTag(name);
|
|
};
|
|
Parser2.prototype.emitOpenTag = function(name) {
|
|
var _a, _b, _c, _d;
|
|
this.openTagStart = this.startIndex;
|
|
this.tagname = name;
|
|
var impliesClose = !this.options.xmlMode && openImpliesClose.get(name);
|
|
if (impliesClose) {
|
|
while (this.stack.length > 0 && impliesClose.has(this.stack[this.stack.length - 1])) {
|
|
var el = this.stack.pop();
|
|
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, el, true);
|
|
}
|
|
}
|
|
if (!this.isVoidElement(name)) {
|
|
this.stack.push(name);
|
|
if (foreignContextElements.has(name)) {
|
|
this.foreignContext.push(true);
|
|
} else if (htmlIntegrationElements.has(name)) {
|
|
this.foreignContext.push(false);
|
|
}
|
|
}
|
|
(_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);
|
|
if (this.cbs.onopentag)
|
|
this.attribs = {};
|
|
};
|
|
Parser2.prototype.endOpenTag = function(isImplied) {
|
|
var _a, _b;
|
|
this.startIndex = this.openTagStart;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.attribs) {
|
|
(_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);
|
|
this.attribs = null;
|
|
}
|
|
if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
|
|
this.cbs.onclosetag(this.tagname, true);
|
|
}
|
|
this.tagname = "";
|
|
};
|
|
Parser2.prototype.onopentagend = function() {
|
|
this.endOpenTag(false);
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onclosetag = function(name) {
|
|
var _a, _b, _c, _d, _e, _f;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
if (foreignContextElements.has(name) || htmlIntegrationElements.has(name)) {
|
|
this.foreignContext.pop();
|
|
}
|
|
if (!this.isVoidElement(name)) {
|
|
var pos = this.stack.lastIndexOf(name);
|
|
if (pos !== -1) {
|
|
if (this.cbs.onclosetag) {
|
|
var count = this.stack.length - pos;
|
|
while (count--) {
|
|
this.cbs.onclosetag(this.stack.pop(), count !== 0);
|
|
}
|
|
} else
|
|
this.stack.length = pos;
|
|
} else if (!this.options.xmlMode && name === "p") {
|
|
this.emitOpenTag(name);
|
|
this.closeCurrentTag(true);
|
|
}
|
|
} else if (!this.options.xmlMode && name === "br") {
|
|
(_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, name);
|
|
(_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, name, {}, true);
|
|
(_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, name, false);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onselfclosingtag = function() {
|
|
if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) {
|
|
this.closeCurrentTag(false);
|
|
this.startIndex = this.endIndex + 1;
|
|
} else {
|
|
this.onopentagend();
|
|
}
|
|
};
|
|
Parser2.prototype.closeCurrentTag = function(isOpenImplied) {
|
|
var _a, _b;
|
|
var name = this.tagname;
|
|
this.endOpenTag(isOpenImplied);
|
|
if (this.stack[this.stack.length - 1] === name) {
|
|
(_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);
|
|
this.stack.pop();
|
|
}
|
|
};
|
|
Parser2.prototype.onattribname = function(name) {
|
|
this.startIndex = this.tokenizer.getAbsoluteSectionStart();
|
|
if (this.lowerCaseAttributeNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
this.attribname = name;
|
|
};
|
|
Parser2.prototype.onattribdata = function(value) {
|
|
this.attribvalue += value;
|
|
};
|
|
Parser2.prototype.onattribend = function(quote) {
|
|
var _a, _b;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
(_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote);
|
|
if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
|
|
this.attribs[this.attribname] = this.attribvalue;
|
|
}
|
|
this.attribname = "";
|
|
this.attribvalue = "";
|
|
};
|
|
Parser2.prototype.getInstructionName = function(value) {
|
|
var idx = value.search(reNameEnd);
|
|
var name = idx < 0 ? value : value.substr(0, idx);
|
|
if (this.lowerCaseTagNames) {
|
|
name = name.toLowerCase();
|
|
}
|
|
return name;
|
|
};
|
|
Parser2.prototype.ondeclaration = function(value) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.cbs.onprocessinginstruction) {
|
|
var name_1 = this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction("!" + name_1, "!" + value);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onprocessinginstruction = function(value) {
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.cbs.onprocessinginstruction) {
|
|
var name_2 = this.getInstructionName(value);
|
|
this.cbs.onprocessinginstruction("?" + name_2, "?" + value);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.oncomment = function(value) {
|
|
var _a, _b, _c, _d;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
(_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
(_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.oncdata = function(value) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
this.endIndex = this.tokenizer.getAbsoluteIndex();
|
|
if (this.options.xmlMode || this.options.recognizeCDATA) {
|
|
(_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
(_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
|
|
(_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
} else {
|
|
(_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, "[CDATA[" + value + "]]");
|
|
(_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
|
|
}
|
|
this.startIndex = this.endIndex + 1;
|
|
};
|
|
Parser2.prototype.onerror = function(err) {
|
|
var _a, _b;
|
|
(_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
};
|
|
Parser2.prototype.onend = function() {
|
|
var _a, _b;
|
|
if (this.cbs.onclosetag) {
|
|
this.endIndex = this.startIndex;
|
|
for (var i2 = this.stack.length; i2 > 0; this.cbs.onclosetag(this.stack[--i2], true))
|
|
;
|
|
}
|
|
(_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
};
|
|
Parser2.prototype.reset = function() {
|
|
var _a, _b, _c, _d;
|
|
(_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
this.tokenizer.reset();
|
|
this.tagname = "";
|
|
this.attribname = "";
|
|
this.attribs = null;
|
|
this.stack = [];
|
|
this.startIndex = 0;
|
|
this.endIndex = 0;
|
|
(_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
|
|
};
|
|
Parser2.prototype.parseComplete = function(data) {
|
|
this.reset();
|
|
this.end(data);
|
|
};
|
|
Parser2.prototype.write = function(chunk) {
|
|
this.tokenizer.write(chunk);
|
|
};
|
|
Parser2.prototype.end = function(chunk) {
|
|
this.tokenizer.end(chunk);
|
|
};
|
|
Parser2.prototype.pause = function() {
|
|
this.tokenizer.pause();
|
|
};
|
|
Parser2.prototype.resume = function() {
|
|
this.tokenizer.resume();
|
|
};
|
|
Parser2.prototype.parseChunk = function(chunk) {
|
|
this.write(chunk);
|
|
};
|
|
Parser2.prototype.done = function(chunk) {
|
|
this.end(chunk);
|
|
};
|
|
return Parser2;
|
|
}();
|
|
exports.Parser = Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/domelementtype/lib/index.js
|
|
var require_lib2 = __commonJS({
|
|
"node_modules/domelementtype/lib/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
var ElementType;
|
|
(function(ElementType2) {
|
|
ElementType2["Root"] = "root";
|
|
ElementType2["Text"] = "text";
|
|
ElementType2["Directive"] = "directive";
|
|
ElementType2["Comment"] = "comment";
|
|
ElementType2["Script"] = "script";
|
|
ElementType2["Style"] = "style";
|
|
ElementType2["Tag"] = "tag";
|
|
ElementType2["CDATA"] = "cdata";
|
|
ElementType2["Doctype"] = "doctype";
|
|
})(ElementType = exports.ElementType || (exports.ElementType = {}));
|
|
function isTag(elem) {
|
|
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
}
|
|
exports.isTag = isTag;
|
|
exports.Root = ElementType.Root;
|
|
exports.Text = ElementType.Text;
|
|
exports.Directive = ElementType.Directive;
|
|
exports.Comment = ElementType.Comment;
|
|
exports.Script = ElementType.Script;
|
|
exports.Style = ElementType.Style;
|
|
exports.Tag = ElementType.Tag;
|
|
exports.CDATA = ElementType.CDATA;
|
|
exports.Doctype = ElementType.Doctype;
|
|
}
|
|
});
|
|
|
|
// node_modules/domhandler/lib/node.js
|
|
var require_node = __commonJS({
|
|
"node_modules/domhandler/lib/node.js"(exports) {
|
|
"use strict";
|
|
var __extends2 = exports && exports.__extends || function() {
|
|
var extendStatics = function(d2, b2) {
|
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
|
|
d3.__proto__ = b3;
|
|
} || function(d3, b3) {
|
|
for (var p2 in b3)
|
|
if (Object.prototype.hasOwnProperty.call(b3, p2))
|
|
d3[p2] = b3[p2];
|
|
};
|
|
return extendStatics(d2, b2);
|
|
};
|
|
return function(d2, b2) {
|
|
if (typeof b2 !== "function" && b2 !== null)
|
|
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
extendStatics(d2, b2);
|
|
function __() {
|
|
this.constructor = d2;
|
|
}
|
|
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
|
|
};
|
|
}();
|
|
var __assign = exports && exports.__assign || function() {
|
|
__assign = Object.assign || function(t2) {
|
|
for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
|
|
s2 = arguments[i2];
|
|
for (var p2 in s2)
|
|
if (Object.prototype.hasOwnProperty.call(s2, p2))
|
|
t2[p2] = s2[p2];
|
|
}
|
|
return t2;
|
|
};
|
|
return __assign.apply(this, arguments);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
|
|
var domelementtype_1 = require_lib2();
|
|
var nodeTypes = /* @__PURE__ */ new Map([
|
|
[domelementtype_1.ElementType.Tag, 1],
|
|
[domelementtype_1.ElementType.Script, 1],
|
|
[domelementtype_1.ElementType.Style, 1],
|
|
[domelementtype_1.ElementType.Directive, 1],
|
|
[domelementtype_1.ElementType.Text, 3],
|
|
[domelementtype_1.ElementType.CDATA, 4],
|
|
[domelementtype_1.ElementType.Comment, 8],
|
|
[domelementtype_1.ElementType.Root, 9]
|
|
]);
|
|
var Node = function() {
|
|
function Node2(type) {
|
|
this.type = type;
|
|
this.parent = null;
|
|
this.prev = null;
|
|
this.next = null;
|
|
this.startIndex = null;
|
|
this.endIndex = null;
|
|
}
|
|
Object.defineProperty(Node2.prototype, "nodeType", {
|
|
get: function() {
|
|
var _a;
|
|
return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "parentNode", {
|
|
get: function() {
|
|
return this.parent;
|
|
},
|
|
set: function(parent) {
|
|
this.parent = parent;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "previousSibling", {
|
|
get: function() {
|
|
return this.prev;
|
|
},
|
|
set: function(prev) {
|
|
this.prev = prev;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Node2.prototype, "nextSibling", {
|
|
get: function() {
|
|
return this.next;
|
|
},
|
|
set: function(next) {
|
|
this.next = next;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Node2.prototype.cloneNode = function(recursive) {
|
|
if (recursive === void 0) {
|
|
recursive = false;
|
|
}
|
|
return cloneNode(this, recursive);
|
|
};
|
|
return Node2;
|
|
}();
|
|
exports.Node = Node;
|
|
var DataNode = function(_super) {
|
|
__extends2(DataNode2, _super);
|
|
function DataNode2(type, data) {
|
|
var _this = _super.call(this, type) || this;
|
|
_this.data = data;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(DataNode2.prototype, "nodeValue", {
|
|
get: function() {
|
|
return this.data;
|
|
},
|
|
set: function(data) {
|
|
this.data = data;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return DataNode2;
|
|
}(Node);
|
|
exports.DataNode = DataNode;
|
|
var Text = function(_super) {
|
|
__extends2(Text2, _super);
|
|
function Text2(data) {
|
|
return _super.call(this, domelementtype_1.ElementType.Text, data) || this;
|
|
}
|
|
return Text2;
|
|
}(DataNode);
|
|
exports.Text = Text;
|
|
var Comment = function(_super) {
|
|
__extends2(Comment2, _super);
|
|
function Comment2(data) {
|
|
return _super.call(this, domelementtype_1.ElementType.Comment, data) || this;
|
|
}
|
|
return Comment2;
|
|
}(DataNode);
|
|
exports.Comment = Comment;
|
|
var ProcessingInstruction = function(_super) {
|
|
__extends2(ProcessingInstruction2, _super);
|
|
function ProcessingInstruction2(name, data) {
|
|
var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this;
|
|
_this.name = name;
|
|
return _this;
|
|
}
|
|
return ProcessingInstruction2;
|
|
}(DataNode);
|
|
exports.ProcessingInstruction = ProcessingInstruction;
|
|
var NodeWithChildren = function(_super) {
|
|
__extends2(NodeWithChildren2, _super);
|
|
function NodeWithChildren2(type, children) {
|
|
var _this = _super.call(this, type) || this;
|
|
_this.children = children;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
|
|
get: function() {
|
|
var _a;
|
|
return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
|
|
get: function() {
|
|
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
|
|
get: function() {
|
|
return this.children;
|
|
},
|
|
set: function(children) {
|
|
this.children = children;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return NodeWithChildren2;
|
|
}(Node);
|
|
exports.NodeWithChildren = NodeWithChildren;
|
|
var Document = function(_super) {
|
|
__extends2(Document2, _super);
|
|
function Document2(children) {
|
|
return _super.call(this, domelementtype_1.ElementType.Root, children) || this;
|
|
}
|
|
return Document2;
|
|
}(NodeWithChildren);
|
|
exports.Document = Document;
|
|
var Element3 = function(_super) {
|
|
__extends2(Element4, _super);
|
|
function Element4(name, attribs, children, type) {
|
|
if (children === void 0) {
|
|
children = [];
|
|
}
|
|
if (type === void 0) {
|
|
type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
|
|
}
|
|
var _this = _super.call(this, type, children) || this;
|
|
_this.name = name;
|
|
_this.attribs = attribs;
|
|
return _this;
|
|
}
|
|
Object.defineProperty(Element4.prototype, "tagName", {
|
|
get: function() {
|
|
return this.name;
|
|
},
|
|
set: function(name) {
|
|
this.name = name;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Object.defineProperty(Element4.prototype, "attributes", {
|
|
get: function() {
|
|
var _this = this;
|
|
return Object.keys(this.attribs).map(function(name) {
|
|
var _a, _b;
|
|
return {
|
|
name,
|
|
value: _this.attribs[name],
|
|
namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
|
|
prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
|
|
};
|
|
});
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
return Element4;
|
|
}(NodeWithChildren);
|
|
exports.Element = Element3;
|
|
function isTag(node) {
|
|
return (0, domelementtype_1.isTag)(node);
|
|
}
|
|
exports.isTag = isTag;
|
|
function isCDATA(node) {
|
|
return node.type === domelementtype_1.ElementType.CDATA;
|
|
}
|
|
exports.isCDATA = isCDATA;
|
|
function isText(node) {
|
|
return node.type === domelementtype_1.ElementType.Text;
|
|
}
|
|
exports.isText = isText;
|
|
function isComment(node) {
|
|
return node.type === domelementtype_1.ElementType.Comment;
|
|
}
|
|
exports.isComment = isComment;
|
|
function isDirective(node) {
|
|
return node.type === domelementtype_1.ElementType.Directive;
|
|
}
|
|
exports.isDirective = isDirective;
|
|
function isDocument(node) {
|
|
return node.type === domelementtype_1.ElementType.Root;
|
|
}
|
|
exports.isDocument = isDocument;
|
|
function hasChildren(node) {
|
|
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
}
|
|
exports.hasChildren = hasChildren;
|
|
function cloneNode(node, recursive) {
|
|
if (recursive === void 0) {
|
|
recursive = false;
|
|
}
|
|
var result;
|
|
if (isText(node)) {
|
|
result = new Text(node.data);
|
|
} else if (isComment(node)) {
|
|
result = new Comment(node.data);
|
|
} else if (isTag(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_1 = new Element3(node.name, __assign({}, node.attribs), children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_1;
|
|
});
|
|
if (node.namespace != null) {
|
|
clone_1.namespace = node.namespace;
|
|
}
|
|
if (node["x-attribsNamespace"]) {
|
|
clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]);
|
|
}
|
|
if (node["x-attribsPrefix"]) {
|
|
clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]);
|
|
}
|
|
result = clone_1;
|
|
} else if (isCDATA(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_2;
|
|
});
|
|
result = clone_2;
|
|
} else if (isDocument(node)) {
|
|
var children = recursive ? cloneChildren(node.children) : [];
|
|
var clone_3 = new Document(children);
|
|
children.forEach(function(child) {
|
|
return child.parent = clone_3;
|
|
});
|
|
if (node["x-mode"]) {
|
|
clone_3["x-mode"] = node["x-mode"];
|
|
}
|
|
result = clone_3;
|
|
} else if (isDirective(node)) {
|
|
var instruction = new ProcessingInstruction(node.name, node.data);
|
|
if (node["x-name"] != null) {
|
|
instruction["x-name"] = node["x-name"];
|
|
instruction["x-publicId"] = node["x-publicId"];
|
|
instruction["x-systemId"] = node["x-systemId"];
|
|
}
|
|
result = instruction;
|
|
} else {
|
|
throw new Error("Not implemented yet: ".concat(node.type));
|
|
}
|
|
result.startIndex = node.startIndex;
|
|
result.endIndex = node.endIndex;
|
|
if (node.sourceCodeLocation != null) {
|
|
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
}
|
|
return result;
|
|
}
|
|
exports.cloneNode = cloneNode;
|
|
function cloneChildren(childs) {
|
|
var children = childs.map(function(child) {
|
|
return cloneNode(child, true);
|
|
});
|
|
for (var i2 = 1; i2 < children.length; i2++) {
|
|
children[i2].prev = children[i2 - 1];
|
|
children[i2 - 1].next = children[i2];
|
|
}
|
|
return children;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/domhandler/lib/index.js
|
|
var require_lib3 = __commonJS({
|
|
"node_modules/domhandler/lib/index.js"(exports) {
|
|
"use strict";
|
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m2, k2, k22) {
|
|
if (k22 === void 0)
|
|
k22 = k2;
|
|
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() {
|
|
return m2[k2];
|
|
} };
|
|
}
|
|
Object.defineProperty(o2, k22, desc);
|
|
} : function(o2, m2, k2, k22) {
|
|
if (k22 === void 0)
|
|
k22 = k2;
|
|
o2[k22] = m2[k2];
|
|
});
|
|
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
for (var p2 in m2)
|
|
if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2))
|
|
__createBinding(exports2, m2, p2);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.DomHandler = void 0;
|
|
var domelementtype_1 = require_lib2();
|
|
var node_1 = require_node();
|
|
__exportStar(require_node(), exports);
|
|
var reWhitespace = /\s+/g;
|
|
var defaultOpts = {
|
|
normalizeWhitespace: false,
|
|
withStartIndices: false,
|
|
withEndIndices: false,
|
|
xmlMode: false
|
|
};
|
|
var DomHandler = function() {
|
|
function DomHandler2(callback, options, elementCB) {
|
|
this.dom = [];
|
|
this.root = new node_1.Document(this.dom);
|
|
this.done = false;
|
|
this.tagStack = [this.root];
|
|
this.lastNode = null;
|
|
this.parser = null;
|
|
if (typeof options === "function") {
|
|
elementCB = options;
|
|
options = defaultOpts;
|
|
}
|
|
if (typeof callback === "object") {
|
|
options = callback;
|
|
callback = void 0;
|
|
}
|
|
this.callback = callback !== null && callback !== void 0 ? callback : null;
|
|
this.options = options !== null && options !== void 0 ? options : defaultOpts;
|
|
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
|
|
}
|
|
DomHandler2.prototype.onparserinit = function(parser) {
|
|
this.parser = parser;
|
|
};
|
|
DomHandler2.prototype.onreset = function() {
|
|
this.dom = [];
|
|
this.root = new node_1.Document(this.dom);
|
|
this.done = false;
|
|
this.tagStack = [this.root];
|
|
this.lastNode = null;
|
|
this.parser = null;
|
|
};
|
|
DomHandler2.prototype.onend = function() {
|
|
if (this.done)
|
|
return;
|
|
this.done = true;
|
|
this.parser = null;
|
|
this.handleCallback(null);
|
|
};
|
|
DomHandler2.prototype.onerror = function(error) {
|
|
this.handleCallback(error);
|
|
};
|
|
DomHandler2.prototype.onclosetag = function() {
|
|
this.lastNode = null;
|
|
var elem = this.tagStack.pop();
|
|
if (this.options.withEndIndices) {
|
|
elem.endIndex = this.parser.endIndex;
|
|
}
|
|
if (this.elementCB)
|
|
this.elementCB(elem);
|
|
};
|
|
DomHandler2.prototype.onopentag = function(name, attribs) {
|
|
var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0;
|
|
var element = new node_1.Element(name, attribs, void 0, type);
|
|
this.addNode(element);
|
|
this.tagStack.push(element);
|
|
};
|
|
DomHandler2.prototype.ontext = function(data) {
|
|
var normalizeWhitespace = this.options.normalizeWhitespace;
|
|
var lastNode = this.lastNode;
|
|
if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {
|
|
if (normalizeWhitespace) {
|
|
lastNode.data = (lastNode.data + data).replace(reWhitespace, " ");
|
|
} else {
|
|
lastNode.data += data;
|
|
}
|
|
if (this.options.withEndIndices) {
|
|
lastNode.endIndex = this.parser.endIndex;
|
|
}
|
|
} else {
|
|
if (normalizeWhitespace) {
|
|
data = data.replace(reWhitespace, " ");
|
|
}
|
|
var node = new node_1.Text(data);
|
|
this.addNode(node);
|
|
this.lastNode = node;
|
|
}
|
|
};
|
|
DomHandler2.prototype.oncomment = function(data) {
|
|
if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {
|
|
this.lastNode.data += data;
|
|
return;
|
|
}
|
|
var node = new node_1.Comment(data);
|
|
this.addNode(node);
|
|
this.lastNode = node;
|
|
};
|
|
DomHandler2.prototype.oncommentend = function() {
|
|
this.lastNode = null;
|
|
};
|
|
DomHandler2.prototype.oncdatastart = function() {
|
|
var text = new node_1.Text("");
|
|
var node = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text]);
|
|
this.addNode(node);
|
|
text.parent = node;
|
|
this.lastNode = text;
|
|
};
|
|
DomHandler2.prototype.oncdataend = function() {
|
|
this.lastNode = null;
|
|
};
|
|
DomHandler2.prototype.onprocessinginstruction = function(name, data) {
|
|
var node = new node_1.ProcessingInstruction(name, data);
|
|
this.addNode(node);
|
|
};
|
|
DomHandler2.prototype.handleCallback = function(error) {
|
|
if (typeof this.callback === "function") {
|
|
this.callback(error, this.dom);
|
|
} else if (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
DomHandler2.prototype.addNode = function(node) {
|
|
var parent = this.tagStack[this.tagStack.length - 1];
|
|
var previousSibling = parent.children[parent.children.length - 1];
|
|
if (this.options.withStartIndices) {
|
|
node.startIndex = this.parser.startIndex;
|
|
}
|
|
if (this.options.withEndIndices) {
|
|
node.endIndex = this.parser.endIndex;
|
|
}
|
|
parent.children.push(node);
|
|
if (previousSibling) {
|
|
node.prev = previousSibling;
|
|
previousSibling.next = node;
|
|
}
|
|
node.parent = parent;
|
|
this.lastNode = null;
|
|
};
|
|
return DomHandler2;
|
|
}();
|
|
exports.DomHandler = DomHandler;
|
|
exports.default = DomHandler;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/lib/server/utilities.js
|
|
var require_utilities3 = __commonJS({
|
|
"node_modules/html-dom-parser/lib/server/utilities.js"(exports, module2) {
|
|
function unsetRootParent(nodes) {
|
|
for (var index = 0, len = nodes.length; index < len; index++) {
|
|
var node = nodes[index];
|
|
node.parent = null;
|
|
}
|
|
return nodes;
|
|
}
|
|
module2.exports = {
|
|
unsetRootParent
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/lib/server/html-to-dom.js
|
|
var require_html_to_dom = __commonJS({
|
|
"node_modules/html-dom-parser/lib/server/html-to-dom.js"(exports, module2) {
|
|
var Parser = require_Parser().Parser;
|
|
var DomHandler = require_lib3().DomHandler;
|
|
var unsetRootParent = require_utilities3().unsetRootParent;
|
|
function HTMLDOMParser(html, options) {
|
|
if (typeof html !== "string") {
|
|
throw new TypeError("First argument must be a string.");
|
|
}
|
|
if (html === "") {
|
|
return [];
|
|
}
|
|
var handler = new DomHandler(void 0, options);
|
|
new Parser(handler, options).end(html);
|
|
return unsetRootParent(handler.dom);
|
|
}
|
|
module2.exports = HTMLDOMParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/html-dom-parser/index.js
|
|
var require_html_dom_parser = __commonJS({
|
|
"node_modules/html-dom-parser/index.js"(exports, module2) {
|
|
module2.exports = require_html_to_dom();
|
|
}
|
|
});
|
|
|
|
// node_modules/html-react-parser/index.js
|
|
var require_html_react_parser = __commonJS({
|
|
"node_modules/html-react-parser/index.js"(exports, module2) {
|
|
var domToReact2 = require_dom_to_react();
|
|
var attributesToProps2 = require_attributes_to_props();
|
|
var htmlToDOM2 = require_html_dom_parser();
|
|
htmlToDOM2 = typeof htmlToDOM2.default === "function" ? htmlToDOM2.default : htmlToDOM2;
|
|
var domParserOptions = { lowerCaseAttributeNames: false };
|
|
function HTMLReactParser2(html, options) {
|
|
if (typeof html !== "string") {
|
|
throw new TypeError("First argument must be a string");
|
|
}
|
|
if (html === "") {
|
|
return [];
|
|
}
|
|
options = options || {};
|
|
return domToReact2(
|
|
htmlToDOM2(html, options.htmlparser2 || domParserOptions),
|
|
options
|
|
);
|
|
}
|
|
HTMLReactParser2.domToReact = domToReact2;
|
|
HTMLReactParser2.htmlToDOM = htmlToDOM2;
|
|
HTMLReactParser2.attributesToProps = attributesToProps2;
|
|
HTMLReactParser2.Element = require_lib3().Element;
|
|
module2.exports = HTMLReactParser2;
|
|
module2.exports.default = HTMLReactParser2;
|
|
}
|
|
});
|
|
|
|
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
var require_react_jsx_runtime_development = __commonJS({
|
|
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var React11 = require_react();
|
|
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 ReactSharedInternals = React11.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
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 enableScopeAPI = false;
|
|
var enableCacheElement = false;
|
|
var enableTransitionTracing = false;
|
|
var enableLegacyHidden = false;
|
|
var enableDebugTracing = false;
|
|
var REACT_MODULE_REFERENCE;
|
|
{
|
|
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
}
|
|
function isValidElementType2(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function getWrappedName2(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 getWrappedName2(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 assign = Object.assign;
|
|
var disabledDepth = 0;
|
|
var prevLog;
|
|
var prevInfo;
|
|
var prevWarn;
|
|
var prevError;
|
|
var prevGroup;
|
|
var prevGroupCollapsed;
|
|
var prevGroupEnd;
|
|
function disabledLog() {
|
|
}
|
|
disabledLog.__reactDisabledLog = true;
|
|
function disableLogs() {
|
|
{
|
|
if (disabledDepth === 0) {
|
|
prevLog = console.log;
|
|
prevInfo = console.info;
|
|
prevWarn = console.warn;
|
|
prevError = console.error;
|
|
prevGroup = console.group;
|
|
prevGroupCollapsed = console.groupCollapsed;
|
|
prevGroupEnd = console.groupEnd;
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
value: disabledLog,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
info: props,
|
|
log: props,
|
|
warn: props,
|
|
error: props,
|
|
group: props,
|
|
groupCollapsed: props,
|
|
groupEnd: props
|
|
});
|
|
}
|
|
disabledDepth++;
|
|
}
|
|
}
|
|
function reenableLogs() {
|
|
{
|
|
disabledDepth--;
|
|
if (disabledDepth === 0) {
|
|
var props = {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true
|
|
};
|
|
Object.defineProperties(console, {
|
|
log: assign({}, props, {
|
|
value: prevLog
|
|
}),
|
|
info: assign({}, props, {
|
|
value: prevInfo
|
|
}),
|
|
warn: assign({}, props, {
|
|
value: prevWarn
|
|
}),
|
|
error: assign({}, props, {
|
|
value: prevError
|
|
}),
|
|
group: assign({}, props, {
|
|
value: prevGroup
|
|
}),
|
|
groupCollapsed: assign({}, props, {
|
|
value: prevGroupCollapsed
|
|
}),
|
|
groupEnd: assign({}, props, {
|
|
value: prevGroupEnd
|
|
})
|
|
});
|
|
}
|
|
if (disabledDepth < 0) {
|
|
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
var prefix2;
|
|
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
{
|
|
if (prefix2 === void 0) {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
var match = x2.stack.trim().match(/\n( *(at )?)/);
|
|
prefix2 = match && match[1] || "";
|
|
}
|
|
}
|
|
return "\n" + prefix2 + name;
|
|
}
|
|
}
|
|
var reentry = false;
|
|
var componentFrameCache;
|
|
{
|
|
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
componentFrameCache = new PossiblyWeakMap();
|
|
}
|
|
function describeNativeComponentFrame(fn2, construct) {
|
|
if (!fn2 || reentry) {
|
|
return "";
|
|
}
|
|
{
|
|
var frame = componentFrameCache.get(fn2);
|
|
if (frame !== void 0) {
|
|
return frame;
|
|
}
|
|
}
|
|
var control;
|
|
reentry = true;
|
|
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
Error.prepareStackTrace = void 0;
|
|
var previousDispatcher;
|
|
{
|
|
previousDispatcher = ReactCurrentDispatcher.current;
|
|
ReactCurrentDispatcher.current = null;
|
|
disableLogs();
|
|
}
|
|
try {
|
|
if (construct) {
|
|
var Fake = function() {
|
|
throw Error();
|
|
};
|
|
Object.defineProperty(Fake.prototype, "props", {
|
|
set: function() {
|
|
throw Error();
|
|
}
|
|
});
|
|
if (typeof Reflect === "object" && Reflect.construct) {
|
|
try {
|
|
Reflect.construct(Fake, []);
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
Reflect.construct(fn2, [], Fake);
|
|
} else {
|
|
try {
|
|
Fake.call();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2.call(Fake.prototype);
|
|
}
|
|
} else {
|
|
try {
|
|
throw Error();
|
|
} catch (x2) {
|
|
control = x2;
|
|
}
|
|
fn2();
|
|
}
|
|
} catch (sample) {
|
|
if (sample && control && typeof sample.stack === "string") {
|
|
var sampleLines = sample.stack.split("\n");
|
|
var controlLines = control.stack.split("\n");
|
|
var s2 = sampleLines.length - 1;
|
|
var c2 = controlLines.length - 1;
|
|
while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
|
|
c2--;
|
|
}
|
|
for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
|
|
if (sampleLines[s2] !== controlLines[c2]) {
|
|
if (s2 !== 1 || c2 !== 1) {
|
|
do {
|
|
s2--;
|
|
c2--;
|
|
if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
|
|
var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
|
|
if (fn2.displayName && _frame.includes("<anonymous>")) {
|
|
_frame = _frame.replace("<anonymous>", fn2.displayName);
|
|
}
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, _frame);
|
|
}
|
|
}
|
|
return _frame;
|
|
}
|
|
} while (s2 >= 1 && c2 >= 0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} finally {
|
|
reentry = false;
|
|
{
|
|
ReactCurrentDispatcher.current = previousDispatcher;
|
|
reenableLogs();
|
|
}
|
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
}
|
|
var name = fn2 ? fn2.displayName || fn2.name : "";
|
|
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
{
|
|
if (typeof fn2 === "function") {
|
|
componentFrameCache.set(fn2, syntheticFrame);
|
|
}
|
|
}
|
|
return syntheticFrame;
|
|
}
|
|
function describeFunctionComponentFrame(fn2, source, ownerFn) {
|
|
{
|
|
return describeNativeComponentFrame(fn2, false);
|
|
}
|
|
}
|
|
function shouldConstruct(Component) {
|
|
var prototype = Component.prototype;
|
|
return !!(prototype && prototype.isReactComponent);
|
|
}
|
|
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
if (type == null) {
|
|
return "";
|
|
}
|
|
if (typeof type === "function") {
|
|
{
|
|
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
}
|
|
}
|
|
if (typeof type === "string") {
|
|
return describeBuiltInComponentFrame(type);
|
|
}
|
|
switch (type) {
|
|
case REACT_SUSPENSE_TYPE:
|
|
return describeBuiltInComponentFrame("Suspense");
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
}
|
|
if (typeof type === "object") {
|
|
switch (type.$$typeof) {
|
|
case REACT_FORWARD_REF_TYPE:
|
|
return describeFunctionComponentFrame(type.render);
|
|
case REACT_MEMO_TYPE:
|
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
case REACT_LAZY_TYPE: {
|
|
var lazyComponent = type;
|
|
var payload = lazyComponent._payload;
|
|
var init = lazyComponent._init;
|
|
try {
|
|
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
} catch (x2) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var loggedTypeFailures = {};
|
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
{
|
|
var has = Function.call.bind(hasOwnProperty);
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error$1 = void 0;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
} catch (ex) {
|
|
error$1 = ex;
|
|
}
|
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
setCurrentlyValidatingElement(element);
|
|
error("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error$1.message] = true;
|
|
setCurrentlyValidatingElement(element);
|
|
error("Failed %s type: %s", location, error$1.message);
|
|
setCurrentlyValidatingElement(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
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 (e) {
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
var RESERVED_PROPS = {
|
|
key: true,
|
|
ref: true,
|
|
__self: true,
|
|
__source: true
|
|
};
|
|
var specialPropKeyWarningShown;
|
|
var specialPropRefWarningShown;
|
|
var didWarnAboutStringRefs;
|
|
{
|
|
didWarnAboutStringRefs = {};
|
|
}
|
|
function hasValidRef(config) {
|
|
{
|
|
if (hasOwnProperty.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 (hasOwnProperty.call(config, "key")) {
|
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
if (getter && getter.isReactWarning) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return config.key !== void 0;
|
|
}
|
|
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
{
|
|
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
|
|
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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
didWarnAboutStringRefs[componentName] = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
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
|
|
});
|
|
}
|
|
}
|
|
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
var element = {
|
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
type,
|
|
key,
|
|
ref,
|
|
props,
|
|
_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 jsxDEV(type, config, maybeKey, source, self2) {
|
|
{
|
|
var propName;
|
|
var props = {};
|
|
var key = null;
|
|
var ref = null;
|
|
if (maybeKey !== void 0) {
|
|
{
|
|
checkKeyStringCoercion(maybeKey);
|
|
}
|
|
key = "" + maybeKey;
|
|
}
|
|
if (hasValidKey(config)) {
|
|
{
|
|
checkKeyStringCoercion(config.key);
|
|
}
|
|
key = "" + config.key;
|
|
}
|
|
if (hasValidRef(config)) {
|
|
ref = config.ref;
|
|
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
}
|
|
for (propName in config) {
|
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
props[propName] = config[propName];
|
|
}
|
|
}
|
|
if (type && type.defaultProps) {
|
|
var defaultProps = type.defaultProps;
|
|
for (propName in defaultProps) {
|
|
if (props[propName] === void 0) {
|
|
props[propName] = defaultProps[propName];
|
|
}
|
|
}
|
|
}
|
|
if (key || ref) {
|
|
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
if (key) {
|
|
defineKeyPropWarningGetter(props, displayName);
|
|
}
|
|
if (ref) {
|
|
defineRefPropWarningGetter(props, displayName);
|
|
}
|
|
}
|
|
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
}
|
|
}
|
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
function setCurrentlyValidatingElement$1(element) {
|
|
{
|
|
if (element) {
|
|
var owner = element._owner;
|
|
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
} else {
|
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
}
|
|
}
|
|
}
|
|
var propTypesMisspellWarningShown;
|
|
{
|
|
propTypesMisspellWarningShown = false;
|
|
}
|
|
function isValidElement(object) {
|
|
{
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
}
|
|
function getDeclarationErrorAddendum() {
|
|
{
|
|
if (ReactCurrentOwner$1.current) {
|
|
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
if (name) {
|
|
return "\n\nCheck the render method of `" + name + "`.";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
function getSourceInfoErrorAddendum(source) {
|
|
{
|
|
if (source !== void 0) {
|
|
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
var lineNumber = source.lineNumber;
|
|
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
var ownerHasKeyUseWarning = {};
|
|
function getCurrentComponentErrorInfo(parentType) {
|
|
{
|
|
var info = getDeclarationErrorAddendum();
|
|
if (!info) {
|
|
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
if (parentName) {
|
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
}
|
|
}
|
|
return info;
|
|
}
|
|
}
|
|
function validateExplicitKey(element, parentType) {
|
|
{
|
|
if (!element._store || element._store.validated || element.key != null) {
|
|
return;
|
|
}
|
|
element._store.validated = true;
|
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
return;
|
|
}
|
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
var childOwner = "";
|
|
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
}
|
|
setCurrentlyValidatingElement$1(element);
|
|
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
function validateChildKeys(node, parentType) {
|
|
{
|
|
if (typeof node !== "object") {
|
|
return;
|
|
}
|
|
if (isArray(node)) {
|
|
for (var i2 = 0; i2 < node.length; i2++) {
|
|
var child = node[i2];
|
|
if (isValidElement(child)) {
|
|
validateExplicitKey(child, parentType);
|
|
}
|
|
}
|
|
} else if (isValidElement(node)) {
|
|
if (node._store) {
|
|
node._store.validated = true;
|
|
}
|
|
} else if (node) {
|
|
var iteratorFn = getIteratorFn(node);
|
|
if (typeof iteratorFn === "function") {
|
|
if (iteratorFn !== node.entries) {
|
|
var iterator = iteratorFn.call(node);
|
|
var step;
|
|
while (!(step = iterator.next()).done) {
|
|
if (isValidElement(step.value)) {
|
|
validateExplicitKey(step.value, parentType);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function validatePropTypes(element) {
|
|
{
|
|
var type = element.type;
|
|
if (type === null || type === void 0 || typeof type === "string") {
|
|
return;
|
|
}
|
|
var propTypes;
|
|
if (typeof type === "function") {
|
|
propTypes = type.propTypes;
|
|
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) {
|
|
propTypes = type.propTypes;
|
|
} else {
|
|
return;
|
|
}
|
|
if (propTypes) {
|
|
var name = getComponentNameFromType(type);
|
|
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
propTypesMisspellWarningShown = true;
|
|
var _name = getComponentNameFromType(type);
|
|
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
}
|
|
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
}
|
|
}
|
|
}
|
|
function validateFragmentProps(fragment) {
|
|
{
|
|
var keys = Object.keys(fragment.props);
|
|
for (var i2 = 0; i2 < keys.length; i2++) {
|
|
var key = keys[i2];
|
|
if (key !== "children" && key !== "key") {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
setCurrentlyValidatingElement$1(null);
|
|
break;
|
|
}
|
|
}
|
|
if (fragment.ref !== null) {
|
|
setCurrentlyValidatingElement$1(fragment);
|
|
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
setCurrentlyValidatingElement$1(null);
|
|
}
|
|
}
|
|
}
|
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
|
|
{
|
|
var validType = isValidElementType2(type);
|
|
if (!validType) {
|
|
var info = "";
|
|
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
info += " 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 sourceInfo = getSourceInfoErrorAddendum(source);
|
|
if (sourceInfo) {
|
|
info += sourceInfo;
|
|
} else {
|
|
info += getDeclarationErrorAddendum();
|
|
}
|
|
var typeString;
|
|
if (type === null) {
|
|
typeString = "null";
|
|
} else if (isArray(type)) {
|
|
typeString = "array";
|
|
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
} else {
|
|
typeString = typeof type;
|
|
}
|
|
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
}
|
|
var element = jsxDEV(type, props, key, source, self2);
|
|
if (element == null) {
|
|
return element;
|
|
}
|
|
if (validType) {
|
|
var children = props.children;
|
|
if (children !== void 0) {
|
|
if (isStaticChildren) {
|
|
if (isArray(children)) {
|
|
for (var i2 = 0; i2 < children.length; i2++) {
|
|
validateChildKeys(children[i2], type);
|
|
}
|
|
if (Object.freeze) {
|
|
Object.freeze(children);
|
|
}
|
|
} else {
|
|
error("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 {
|
|
validateChildKeys(children, type);
|
|
}
|
|
}
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE) {
|
|
validateFragmentProps(element);
|
|
} else {
|
|
validatePropTypes(element);
|
|
}
|
|
return element;
|
|
}
|
|
}
|
|
function jsxWithValidationStatic(type, props, key) {
|
|
{
|
|
return jsxWithValidation(type, props, key, true);
|
|
}
|
|
}
|
|
function jsxWithValidationDynamic(type, props, key) {
|
|
{
|
|
return jsxWithValidation(type, props, key, false);
|
|
}
|
|
}
|
|
var jsx39 = jsxWithValidationDynamic;
|
|
var jsxs21 = jsxWithValidationStatic;
|
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
exports.jsx = jsx39;
|
|
exports.jsxs = jsxs21;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react/jsx-runtime.js
|
|
var require_jsx_runtime = __commonJS({
|
|
"node_modules/react/jsx-runtime.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_jsx_runtime_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
function isValidElementType2(type) {
|
|
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_ASYNC_MODE_TYPE:
|
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo2 = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
}
|
|
}
|
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
}
|
|
function isContextConsumer2(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
exports.AsyncMode = AsyncMode;
|
|
exports.ConcurrentMode = ConcurrentMode;
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef2;
|
|
exports.Fragment = Fragment6;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo2;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer2;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isValidElementType = isValidElementType2;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/node_modules/react-is/index.js
|
|
var require_react_is = __commonJS({
|
|
"node_modules/prop-types/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/object-assign/index.js
|
|
var require_object_assign = __commonJS({
|
|
"node_modules/object-assign/index.js"(exports, module2) {
|
|
"use strict";
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
function toObject(val) {
|
|
if (val === null || val === void 0) {
|
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
}
|
|
return Object(val);
|
|
}
|
|
function shouldUseNative() {
|
|
try {
|
|
if (!Object.assign) {
|
|
return false;
|
|
}
|
|
var test1 = new String("abc");
|
|
test1[5] = "de";
|
|
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
return false;
|
|
}
|
|
var test2 = {};
|
|
for (var i2 = 0; i2 < 10; i2++) {
|
|
test2["_" + String.fromCharCode(i2)] = i2;
|
|
}
|
|
var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
|
|
return test2[n2];
|
|
});
|
|
if (order2.join("") !== "0123456789") {
|
|
return false;
|
|
}
|
|
var test3 = {};
|
|
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
test3[letter] = letter;
|
|
});
|
|
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
return false;
|
|
}
|
|
return true;
|
|
} catch (err) {
|
|
return false;
|
|
}
|
|
}
|
|
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
var from;
|
|
var to = toObject(target);
|
|
var symbols;
|
|
for (var s2 = 1; s2 < arguments.length; s2++) {
|
|
from = Object(arguments[s2]);
|
|
for (var key in from) {
|
|
if (hasOwnProperty.call(from, key)) {
|
|
to[key] = from[key];
|
|
}
|
|
}
|
|
if (getOwnPropertySymbols) {
|
|
symbols = getOwnPropertySymbols(from);
|
|
for (var i2 = 0; i2 < symbols.length; i2++) {
|
|
if (propIsEnumerable.call(from, symbols[i2])) {
|
|
to[symbols[i2]] = from[symbols[i2]];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return to;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
var require_ReactPropTypesSecret = __commonJS({
|
|
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
module2.exports = ReactPropTypesSecret;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/lib/has.js
|
|
var require_has = __commonJS({
|
|
"node_modules/prop-types/lib/has.js"(exports, module2) {
|
|
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/checkPropTypes.js
|
|
var require_checkPropTypes = __commonJS({
|
|
"node_modules/prop-types/checkPropTypes.js"(exports, module2) {
|
|
"use strict";
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
loggedTypeFailures = {};
|
|
has = require_has();
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x2) {
|
|
}
|
|
};
|
|
}
|
|
var ReactPropTypesSecret;
|
|
var loggedTypeFailures;
|
|
var has;
|
|
function checkPropTypes(typeSpecs, values2, location, componentName, getStack) {
|
|
if (true) {
|
|
for (var typeSpecName in typeSpecs) {
|
|
if (has(typeSpecs, typeSpecName)) {
|
|
var error;
|
|
try {
|
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
var err = Error(
|
|
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
);
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
}
|
|
error = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
if (error && !(error instanceof Error)) {
|
|
printWarning(
|
|
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
);
|
|
}
|
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
loggedTypeFailures[error.message] = true;
|
|
var stack = getStack ? getStack() : "";
|
|
printWarning(
|
|
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
checkPropTypes.resetWarningCache = function() {
|
|
if (true) {
|
|
loggedTypeFailures = {};
|
|
}
|
|
};
|
|
module2.exports = checkPropTypes;
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/factoryWithTypeCheckers.js
|
|
var require_factoryWithTypeCheckers = __commonJS({
|
|
"node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) {
|
|
"use strict";
|
|
var ReactIs = require_react_is();
|
|
var assign = require_object_assign();
|
|
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
var has = require_has();
|
|
var checkPropTypes = require_checkPropTypes();
|
|
var printWarning = function() {
|
|
};
|
|
if (true) {
|
|
printWarning = function(text) {
|
|
var message = "Warning: " + text;
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x2) {
|
|
}
|
|
};
|
|
}
|
|
function emptyFunctionThatReturnsNull() {
|
|
return null;
|
|
}
|
|
module2.exports = function(isValidElement, throwOnDirectAccess) {
|
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
function getIteratorFn(maybeIterable) {
|
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
if (typeof iteratorFn === "function") {
|
|
return iteratorFn;
|
|
}
|
|
}
|
|
var ANONYMOUS = "<<anonymous>>";
|
|
var ReactPropTypes = {
|
|
array: createPrimitiveTypeChecker("array"),
|
|
bigint: createPrimitiveTypeChecker("bigint"),
|
|
bool: createPrimitiveTypeChecker("boolean"),
|
|
func: createPrimitiveTypeChecker("function"),
|
|
number: createPrimitiveTypeChecker("number"),
|
|
object: createPrimitiveTypeChecker("object"),
|
|
string: createPrimitiveTypeChecker("string"),
|
|
symbol: createPrimitiveTypeChecker("symbol"),
|
|
any: createAnyTypeChecker(),
|
|
arrayOf: createArrayOfTypeChecker,
|
|
element: createElementTypeChecker(),
|
|
elementType: createElementTypeTypeChecker(),
|
|
instanceOf: createInstanceTypeChecker,
|
|
node: createNodeChecker(),
|
|
objectOf: createObjectOfTypeChecker,
|
|
oneOf: createEnumTypeChecker,
|
|
oneOfType: createUnionTypeChecker,
|
|
shape: createShapeTypeChecker,
|
|
exact: createStrictShapeTypeChecker
|
|
};
|
|
function is(x2, y2) {
|
|
if (x2 === y2) {
|
|
return x2 !== 0 || 1 / x2 === 1 / y2;
|
|
} else {
|
|
return x2 !== x2 && y2 !== y2;
|
|
}
|
|
}
|
|
function PropTypeError(message, data) {
|
|
this.message = message;
|
|
this.data = data && typeof data === "object" ? data : {};
|
|
this.stack = "";
|
|
}
|
|
PropTypeError.prototype = Error.prototype;
|
|
function createChainableTypeChecker(validate) {
|
|
if (true) {
|
|
var manualPropTypeCallCache = {};
|
|
var manualPropTypeWarningCount = 0;
|
|
}
|
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
componentName = componentName || ANONYMOUS;
|
|
propFullName = propFullName || propName;
|
|
if (secret !== ReactPropTypesSecret) {
|
|
if (throwOnDirectAccess) {
|
|
var err = new Error(
|
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
);
|
|
err.name = "Invariant Violation";
|
|
throw err;
|
|
} else if (typeof console !== "undefined") {
|
|
var cacheKey = componentName + ":" + propName;
|
|
if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
|
|
printWarning(
|
|
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
);
|
|
manualPropTypeCallCache[cacheKey] = true;
|
|
manualPropTypeWarningCount++;
|
|
}
|
|
}
|
|
}
|
|
if (props[propName] == null) {
|
|
if (isRequired) {
|
|
if (props[propName] === null) {
|
|
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
}
|
|
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
}
|
|
return null;
|
|
} else {
|
|
return validate(props, propName, componentName, location, propFullName);
|
|
}
|
|
}
|
|
var chainedCheckType = checkType.bind(null, false);
|
|
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
return chainedCheckType;
|
|
}
|
|
function createPrimitiveTypeChecker(expectedType) {
|
|
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== expectedType) {
|
|
var preciseType = getPreciseType(propValue);
|
|
return new PropTypeError(
|
|
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
{ expectedType }
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createAnyTypeChecker() {
|
|
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
}
|
|
function createArrayOfTypeChecker(typeChecker) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (typeof typeChecker !== "function") {
|
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
}
|
|
var propValue = props[propName];
|
|
if (!Array.isArray(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
}
|
|
for (var i2 = 0; i2 < propValue.length; i2++) {
|
|
var error = typeChecker(propValue, i2, componentName, location, propFullName + "[" + i2 + "]", ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createElementTypeChecker() {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
if (!isValidElement(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createElementTypeTypeChecker() {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
if (!ReactIs.isValidElementType(propValue)) {
|
|
var propType = getPropType(propValue);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createInstanceTypeChecker(expectedClass) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (!(props[propName] instanceof expectedClass)) {
|
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
var actualClassName = getClassName(props[propName]);
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createEnumTypeChecker(expectedValues) {
|
|
if (!Array.isArray(expectedValues)) {
|
|
if (true) {
|
|
if (arguments.length > 1) {
|
|
printWarning(
|
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
);
|
|
} else {
|
|
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
}
|
|
}
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
for (var i2 = 0; i2 < expectedValues.length; i2++) {
|
|
if (is(propValue, expectedValues[i2])) {
|
|
return null;
|
|
}
|
|
}
|
|
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
var type = getPreciseType(value);
|
|
if (type === "symbol") {
|
|
return String(value);
|
|
}
|
|
return value;
|
|
});
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createObjectOfTypeChecker(typeChecker) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (typeof typeChecker !== "function") {
|
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
}
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
}
|
|
for (var key in propValue) {
|
|
if (has(propValue, key)) {
|
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error instanceof Error) {
|
|
return error;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
var checker = arrayOfTypeCheckers[i2];
|
|
if (typeof checker !== "function") {
|
|
printWarning(
|
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "."
|
|
);
|
|
return emptyFunctionThatReturnsNull;
|
|
}
|
|
}
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var expectedTypes = [];
|
|
for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) {
|
|
var checker2 = arrayOfTypeCheckers[i3];
|
|
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
if (checkerResult == null) {
|
|
return null;
|
|
}
|
|
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
expectedTypes.push(checkerResult.data.expectedType);
|
|
}
|
|
}
|
|
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createNodeChecker() {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
if (!isNode(props[propName])) {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
return new PropTypeError(
|
|
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
);
|
|
}
|
|
function createShapeTypeChecker(shapeTypes) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
}
|
|
for (var key in shapeTypes) {
|
|
var checker = shapeTypes[key];
|
|
if (typeof checker !== "function") {
|
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
}
|
|
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function createStrictShapeTypeChecker(shapeTypes) {
|
|
function validate(props, propName, componentName, location, propFullName) {
|
|
var propValue = props[propName];
|
|
var propType = getPropType(propValue);
|
|
if (propType !== "object") {
|
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
}
|
|
var allKeys = assign({}, props[propName], shapeTypes);
|
|
for (var key in allKeys) {
|
|
var checker = shapeTypes[key];
|
|
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
}
|
|
if (!checker) {
|
|
return new PropTypeError(
|
|
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
);
|
|
}
|
|
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
if (error) {
|
|
return error;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
return createChainableTypeChecker(validate);
|
|
}
|
|
function isNode(propValue) {
|
|
switch (typeof propValue) {
|
|
case "number":
|
|
case "string":
|
|
case "undefined":
|
|
return true;
|
|
case "boolean":
|
|
return !propValue;
|
|
case "object":
|
|
if (Array.isArray(propValue)) {
|
|
return propValue.every(isNode);
|
|
}
|
|
if (propValue === null || isValidElement(propValue)) {
|
|
return true;
|
|
}
|
|
var iteratorFn = getIteratorFn(propValue);
|
|
if (iteratorFn) {
|
|
var iterator = iteratorFn.call(propValue);
|
|
var step;
|
|
if (iteratorFn !== propValue.entries) {
|
|
while (!(step = iterator.next()).done) {
|
|
if (!isNode(step.value)) {
|
|
return false;
|
|
}
|
|
}
|
|
} else {
|
|
while (!(step = iterator.next()).done) {
|
|
var entry = step.value;
|
|
if (entry) {
|
|
if (!isNode(entry[1])) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function isSymbol(propType, propValue) {
|
|
if (propType === "symbol") {
|
|
return true;
|
|
}
|
|
if (!propValue) {
|
|
return false;
|
|
}
|
|
if (propValue["@@toStringTag"] === "Symbol") {
|
|
return true;
|
|
}
|
|
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function getPropType(propValue) {
|
|
var propType = typeof propValue;
|
|
if (Array.isArray(propValue)) {
|
|
return "array";
|
|
}
|
|
if (propValue instanceof RegExp) {
|
|
return "object";
|
|
}
|
|
if (isSymbol(propType, propValue)) {
|
|
return "symbol";
|
|
}
|
|
return propType;
|
|
}
|
|
function getPreciseType(propValue) {
|
|
if (typeof propValue === "undefined" || propValue === null) {
|
|
return "" + propValue;
|
|
}
|
|
var propType = getPropType(propValue);
|
|
if (propType === "object") {
|
|
if (propValue instanceof Date) {
|
|
return "date";
|
|
} else if (propValue instanceof RegExp) {
|
|
return "regexp";
|
|
}
|
|
}
|
|
return propType;
|
|
}
|
|
function getPostfixForTypeWarning(value) {
|
|
var type = getPreciseType(value);
|
|
switch (type) {
|
|
case "array":
|
|
case "object":
|
|
return "an " + type;
|
|
case "boolean":
|
|
case "date":
|
|
case "regexp":
|
|
return "a " + type;
|
|
default:
|
|
return type;
|
|
}
|
|
}
|
|
function getClassName(propValue) {
|
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
return ANONYMOUS;
|
|
}
|
|
return propValue.constructor.name;
|
|
}
|
|
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
return ReactPropTypes;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/prop-types/index.js
|
|
var require_prop_types = __commonJS({
|
|
"node_modules/prop-types/index.js"(exports, module2) {
|
|
if (true) {
|
|
ReactIs = require_react_is();
|
|
throwOnDirectAccess = true;
|
|
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
} else {
|
|
module2.exports = null();
|
|
}
|
|
var ReactIs;
|
|
var throwOnDirectAccess;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development2 = __commonJS({
|
|
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
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_SERVER_CONTEXT_TYPE = Symbol.for("react.server_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 enableScopeAPI = false;
|
|
var enableCacheElement = false;
|
|
var enableTransitionTracing = false;
|
|
var enableLegacyHidden = false;
|
|
var enableDebugTracing = false;
|
|
var REACT_MODULE_REFERENCE;
|
|
{
|
|
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
}
|
|
function isValidElementType2(type) {
|
|
if (typeof type === "string" || typeof type === "function") {
|
|
return true;
|
|
}
|
|
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
return true;
|
|
}
|
|
if (typeof type === "object" && type !== null) {
|
|
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_SERVER_CONTEXT_TYPE:
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo2 = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function isContextConsumer2(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
function isSuspenseList(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
}
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef2;
|
|
exports.Fragment = Fragment6;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo2;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.SuspenseList = SuspenseList;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer2;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isSuspenseList = isSuspenseList;
|
|
exports.isValidElementType = isValidElementType2;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-is/index.js
|
|
var require_react_is2 = __commonJS({
|
|
"node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development2();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@popperjs/core/dist/cjs/popper.js
|
|
var require_popper = __commonJS({
|
|
"node_modules/@popperjs/core/dist/cjs/popper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function getWindow(node) {
|
|
if (node == null) {
|
|
return window;
|
|
}
|
|
if (node.toString() !== "[object Window]") {
|
|
var ownerDocument = node.ownerDocument;
|
|
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
}
|
|
return node;
|
|
}
|
|
function isElement(node) {
|
|
var OwnElement = getWindow(node).Element;
|
|
return node instanceof OwnElement || node instanceof Element;
|
|
}
|
|
function isHTMLElement(node) {
|
|
var OwnElement = getWindow(node).HTMLElement;
|
|
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
}
|
|
function isShadowRoot(node) {
|
|
if (typeof ShadowRoot === "undefined") {
|
|
return false;
|
|
}
|
|
var OwnElement = getWindow(node).ShadowRoot;
|
|
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
}
|
|
var max = Math.max;
|
|
var min = Math.min;
|
|
var round2 = Math.round;
|
|
function getUAString() {
|
|
var uaData = navigator.userAgentData;
|
|
if (uaData != null && uaData.brands) {
|
|
return uaData.brands.map(function(item) {
|
|
return item.brand + "/" + item.version;
|
|
}).join(" ");
|
|
}
|
|
return navigator.userAgent;
|
|
}
|
|
function isLayoutViewport() {
|
|
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
}
|
|
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
if (includeScale === void 0) {
|
|
includeScale = false;
|
|
}
|
|
if (isFixedStrategy === void 0) {
|
|
isFixedStrategy = false;
|
|
}
|
|
var clientRect = element.getBoundingClientRect();
|
|
var scaleX = 1;
|
|
var scaleY = 1;
|
|
if (includeScale && isHTMLElement(element)) {
|
|
scaleX = element.offsetWidth > 0 ? round2(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
scaleY = element.offsetHeight > 0 ? round2(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
}
|
|
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
var width2 = clientRect.width / scaleX;
|
|
var height2 = clientRect.height / scaleY;
|
|
return {
|
|
width: width2,
|
|
height: height2,
|
|
top: y2,
|
|
right: x2 + width2,
|
|
bottom: y2 + height2,
|
|
left: x2,
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
}
|
|
function getWindowScroll(node) {
|
|
var win = getWindow(node);
|
|
var scrollLeft = win.pageXOffset;
|
|
var scrollTop = win.pageYOffset;
|
|
return {
|
|
scrollLeft,
|
|
scrollTop
|
|
};
|
|
}
|
|
function getHTMLElementScroll(element) {
|
|
return {
|
|
scrollLeft: element.scrollLeft,
|
|
scrollTop: element.scrollTop
|
|
};
|
|
}
|
|
function getNodeScroll(node) {
|
|
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
return getWindowScroll(node);
|
|
} else {
|
|
return getHTMLElementScroll(node);
|
|
}
|
|
}
|
|
function getNodeName(element) {
|
|
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
}
|
|
function getDocumentElement(element) {
|
|
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
|
}
|
|
function getWindowScrollBarX(element) {
|
|
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
}
|
|
function getComputedStyle(element) {
|
|
return getWindow(element).getComputedStyle(element);
|
|
}
|
|
function isScrollParent(element) {
|
|
var _getComputedStyle = getComputedStyle(element), overflow2 = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
|
return /auto|scroll|overlay|hidden/.test(overflow2 + overflowY + overflowX);
|
|
}
|
|
function isElementScaled(element) {
|
|
var rect = element.getBoundingClientRect();
|
|
var scaleX = round2(rect.width) / element.offsetWidth || 1;
|
|
var scaleY = round2(rect.height) / element.offsetHeight || 1;
|
|
return scaleX !== 1 || scaleY !== 1;
|
|
}
|
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
if (isFixed === void 0) {
|
|
isFixed = false;
|
|
}
|
|
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
var documentElement = getDocumentElement(offsetParent);
|
|
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
|
var scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
var offsets = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
|
scroll = getNodeScroll(offsetParent);
|
|
}
|
|
if (isHTMLElement(offsetParent)) {
|
|
offsets = getBoundingClientRect(offsetParent, true);
|
|
offsets.x += offsetParent.clientLeft;
|
|
offsets.y += offsetParent.clientTop;
|
|
} else if (documentElement) {
|
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
}
|
|
}
|
|
return {
|
|
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
y: rect.top + scroll.scrollTop - offsets.y,
|
|
width: rect.width,
|
|
height: rect.height
|
|
};
|
|
}
|
|
function getLayoutRect(element) {
|
|
var clientRect = getBoundingClientRect(element);
|
|
var width2 = element.offsetWidth;
|
|
var height2 = element.offsetHeight;
|
|
if (Math.abs(clientRect.width - width2) <= 1) {
|
|
width2 = clientRect.width;
|
|
}
|
|
if (Math.abs(clientRect.height - height2) <= 1) {
|
|
height2 = clientRect.height;
|
|
}
|
|
return {
|
|
x: element.offsetLeft,
|
|
y: element.offsetTop,
|
|
width: width2,
|
|
height: height2
|
|
};
|
|
}
|
|
function getParentNode(element) {
|
|
if (getNodeName(element) === "html") {
|
|
return element;
|
|
}
|
|
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
|
}
|
|
function getScrollParent(node) {
|
|
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
|
return node.ownerDocument.body;
|
|
}
|
|
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
return node;
|
|
}
|
|
return getScrollParent(getParentNode(node));
|
|
}
|
|
function listScrollParents(element, list) {
|
|
var _element$ownerDocumen;
|
|
if (list === void 0) {
|
|
list = [];
|
|
}
|
|
var scrollParent = getScrollParent(element);
|
|
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
var win = getWindow(scrollParent);
|
|
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
var updatedList = list.concat(target);
|
|
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
|
}
|
|
function isTableElement(element) {
|
|
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
}
|
|
function getTrueOffsetParent(element) {
|
|
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
|
return null;
|
|
}
|
|
return element.offsetParent;
|
|
}
|
|
function getContainingBlock(element) {
|
|
var isFirefox = /firefox/i.test(getUAString());
|
|
var isIE = /Trident/i.test(getUAString());
|
|
if (isIE && isHTMLElement(element)) {
|
|
var elementCss = getComputedStyle(element);
|
|
if (elementCss.position === "fixed") {
|
|
return null;
|
|
}
|
|
}
|
|
var currentNode = getParentNode(element);
|
|
if (isShadowRoot(currentNode)) {
|
|
currentNode = currentNode.host;
|
|
}
|
|
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
|
var css = getComputedStyle(currentNode);
|
|
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
|
return currentNode;
|
|
} else {
|
|
currentNode = currentNode.parentNode;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function getOffsetParent(element) {
|
|
var window2 = getWindow(element);
|
|
var offsetParent = getTrueOffsetParent(element);
|
|
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
offsetParent = getTrueOffsetParent(offsetParent);
|
|
}
|
|
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
|
return window2;
|
|
}
|
|
return offsetParent || getContainingBlock(element) || window2;
|
|
}
|
|
var top2 = "top";
|
|
var bottom2 = "bottom";
|
|
var right2 = "right";
|
|
var left2 = "left";
|
|
var auto = "auto";
|
|
var basePlacements = [top2, bottom2, right2, left2];
|
|
var start = "start";
|
|
var end = "end";
|
|
var clippingParents = "clippingParents";
|
|
var viewport = "viewport";
|
|
var popper = "popper";
|
|
var reference = "reference";
|
|
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
}, []);
|
|
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
}, []);
|
|
var beforeRead = "beforeRead";
|
|
var read = "read";
|
|
var afterRead = "afterRead";
|
|
var beforeMain = "beforeMain";
|
|
var main = "main";
|
|
var afterMain = "afterMain";
|
|
var beforeWrite = "beforeWrite";
|
|
var write = "write";
|
|
var afterWrite = "afterWrite";
|
|
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
function order2(modifiers) {
|
|
var map = /* @__PURE__ */ new Map();
|
|
var visited = /* @__PURE__ */ new Set();
|
|
var result = [];
|
|
modifiers.forEach(function(modifier) {
|
|
map.set(modifier.name, modifier);
|
|
});
|
|
function sort(modifier) {
|
|
visited.add(modifier.name);
|
|
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
requires.forEach(function(dep) {
|
|
if (!visited.has(dep)) {
|
|
var depModifier = map.get(dep);
|
|
if (depModifier) {
|
|
sort(depModifier);
|
|
}
|
|
}
|
|
});
|
|
result.push(modifier);
|
|
}
|
|
modifiers.forEach(function(modifier) {
|
|
if (!visited.has(modifier.name)) {
|
|
sort(modifier);
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
function orderModifiers(modifiers) {
|
|
var orderedModifiers = order2(modifiers);
|
|
return modifierPhases.reduce(function(acc, phase) {
|
|
return acc.concat(orderedModifiers.filter(function(modifier) {
|
|
return modifier.phase === phase;
|
|
}));
|
|
}, []);
|
|
}
|
|
function debounce(fn2) {
|
|
var pending;
|
|
return function() {
|
|
if (!pending) {
|
|
pending = new Promise(function(resolve) {
|
|
Promise.resolve().then(function() {
|
|
pending = void 0;
|
|
resolve(fn2());
|
|
});
|
|
});
|
|
}
|
|
return pending;
|
|
};
|
|
}
|
|
function format(str) {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
return [].concat(args).reduce(function(p2, c2) {
|
|
return p2.replace(/%s/, c2);
|
|
}, str);
|
|
}
|
|
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
|
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
|
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
|
|
function validateModifiers(modifiers) {
|
|
modifiers.forEach(function(modifier) {
|
|
[].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index, self2) {
|
|
return self2.indexOf(value) === index;
|
|
}).forEach(function(key) {
|
|
switch (key) {
|
|
case "name":
|
|
if (typeof modifier.name !== "string") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
|
|
}
|
|
break;
|
|
case "enabled":
|
|
if (typeof modifier.enabled !== "boolean") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
|
|
}
|
|
break;
|
|
case "phase":
|
|
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
|
|
}
|
|
break;
|
|
case "fn":
|
|
if (typeof modifier.fn !== "function") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
}
|
|
break;
|
|
case "effect":
|
|
if (modifier.effect != null && typeof modifier.effect !== "function") {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
}
|
|
break;
|
|
case "requires":
|
|
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
|
|
}
|
|
break;
|
|
case "requiresIfExists":
|
|
if (!Array.isArray(modifier.requiresIfExists)) {
|
|
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
|
|
}
|
|
break;
|
|
case "options":
|
|
case "data":
|
|
break;
|
|
default:
|
|
console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s2) {
|
|
return '"' + s2 + '"';
|
|
}).join(", ") + '; but "' + key + '" was provided.');
|
|
}
|
|
modifier.requires && modifier.requires.forEach(function(requirement) {
|
|
if (modifiers.find(function(mod) {
|
|
return mod.name === requirement;
|
|
}) == null) {
|
|
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
|
}
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function uniqueBy(arr, fn2) {
|
|
var identifiers = /* @__PURE__ */ new Set();
|
|
return arr.filter(function(item) {
|
|
var identifier = fn2(item);
|
|
if (!identifiers.has(identifier)) {
|
|
identifiers.add(identifier);
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
function getBasePlacement(placement) {
|
|
return placement.split("-")[0];
|
|
}
|
|
function mergeByName(modifiers) {
|
|
var merged = modifiers.reduce(function(merged2, current) {
|
|
var existing = merged2[current.name];
|
|
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
|
options: Object.assign({}, existing.options, current.options),
|
|
data: Object.assign({}, existing.data, current.data)
|
|
}) : current;
|
|
return merged2;
|
|
}, {});
|
|
return Object.keys(merged).map(function(key) {
|
|
return merged[key];
|
|
});
|
|
}
|
|
function getViewportRect(element, strategy) {
|
|
var win = getWindow(element);
|
|
var html = getDocumentElement(element);
|
|
var visualViewport = win.visualViewport;
|
|
var width2 = html.clientWidth;
|
|
var height2 = html.clientHeight;
|
|
var x2 = 0;
|
|
var y2 = 0;
|
|
if (visualViewport) {
|
|
width2 = visualViewport.width;
|
|
height2 = visualViewport.height;
|
|
var layoutViewport = isLayoutViewport();
|
|
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
|
x2 = visualViewport.offsetLeft;
|
|
y2 = visualViewport.offsetTop;
|
|
}
|
|
}
|
|
return {
|
|
width: width2,
|
|
height: height2,
|
|
x: x2 + getWindowScrollBarX(element),
|
|
y: y2
|
|
};
|
|
}
|
|
function getDocumentRect(element) {
|
|
var _element$ownerDocumen;
|
|
var html = getDocumentElement(element);
|
|
var winScroll = getWindowScroll(element);
|
|
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
var width2 = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
var height2 = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
var y2 = -winScroll.scrollTop;
|
|
if (getComputedStyle(body || html).direction === "rtl") {
|
|
x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width2;
|
|
}
|
|
return {
|
|
width: width2,
|
|
height: height2,
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
}
|
|
function contains(parent, child) {
|
|
var rootNode = child.getRootNode && child.getRootNode();
|
|
if (parent.contains(child)) {
|
|
return true;
|
|
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
var next = child;
|
|
do {
|
|
if (next && parent.isSameNode(next)) {
|
|
return true;
|
|
}
|
|
next = next.parentNode || next.host;
|
|
} while (next);
|
|
}
|
|
return false;
|
|
}
|
|
function rectToClientRect(rect) {
|
|
return Object.assign({}, rect, {
|
|
left: rect.x,
|
|
top: rect.y,
|
|
right: rect.x + rect.width,
|
|
bottom: rect.y + rect.height
|
|
});
|
|
}
|
|
function getInnerBoundingClientRect(element, strategy) {
|
|
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
|
rect.top = rect.top + element.clientTop;
|
|
rect.left = rect.left + element.clientLeft;
|
|
rect.bottom = rect.top + element.clientHeight;
|
|
rect.right = rect.left + element.clientWidth;
|
|
rect.width = element.clientWidth;
|
|
rect.height = element.clientHeight;
|
|
rect.x = rect.left;
|
|
rect.y = rect.top;
|
|
return rect;
|
|
}
|
|
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
|
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
}
|
|
function getClippingParents(element) {
|
|
var clippingParents2 = listScrollParents(getParentNode(element));
|
|
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
|
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
if (!isElement(clipperElement)) {
|
|
return [];
|
|
}
|
|
return clippingParents2.filter(function(clippingParent) {
|
|
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
|
});
|
|
}
|
|
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
|
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
|
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
|
var firstClippingParent = clippingParents2[0];
|
|
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
|
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
|
accRect.top = max(rect.top, accRect.top);
|
|
accRect.right = min(rect.right, accRect.right);
|
|
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
accRect.left = max(rect.left, accRect.left);
|
|
return accRect;
|
|
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
|
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
clippingRect.x = clippingRect.left;
|
|
clippingRect.y = clippingRect.top;
|
|
return clippingRect;
|
|
}
|
|
function getVariation(placement) {
|
|
return placement.split("-")[1];
|
|
}
|
|
function getMainAxisFromPlacement(placement) {
|
|
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
}
|
|
function computeOffsets(_ref) {
|
|
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
|
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
var variation = placement ? getVariation(placement) : null;
|
|
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
|
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
|
var offsets;
|
|
switch (basePlacement) {
|
|
case top2:
|
|
offsets = {
|
|
x: commonX,
|
|
y: reference2.y - element.height
|
|
};
|
|
break;
|
|
case bottom2:
|
|
offsets = {
|
|
x: commonX,
|
|
y: reference2.y + reference2.height
|
|
};
|
|
break;
|
|
case right2:
|
|
offsets = {
|
|
x: reference2.x + reference2.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
case left2:
|
|
offsets = {
|
|
x: reference2.x - element.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
default:
|
|
offsets = {
|
|
x: reference2.x,
|
|
y: reference2.y
|
|
};
|
|
}
|
|
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
if (mainAxis != null) {
|
|
var len = mainAxis === "y" ? "height" : "width";
|
|
switch (variation) {
|
|
case start:
|
|
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
|
break;
|
|
case end:
|
|
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
|
break;
|
|
}
|
|
}
|
|
return offsets;
|
|
}
|
|
function getFreshSideObject() {
|
|
return {
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0
|
|
};
|
|
}
|
|
function mergePaddingObject(paddingObject) {
|
|
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
}
|
|
function expandToHashMap(value, keys) {
|
|
return keys.reduce(function(hashMap, key) {
|
|
hashMap[key] = value;
|
|
return hashMap;
|
|
}, {});
|
|
}
|
|
function detectOverflow(state, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding2 = _options$padding === void 0 ? 0 : _options$padding;
|
|
var paddingObject = mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements));
|
|
var altContext = elementContext === popper ? reference : popper;
|
|
var popperRect = state.rects.popper;
|
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
|
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
var popperOffsets2 = computeOffsets({
|
|
reference: referenceClientRect,
|
|
element: popperRect,
|
|
strategy: "absolute",
|
|
placement
|
|
});
|
|
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
|
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
|
var overflowOffsets = {
|
|
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
};
|
|
var offsetData = state.modifiersData.offset;
|
|
if (elementContext === popper && offsetData) {
|
|
var offset2 = offsetData[placement];
|
|
Object.keys(overflowOffsets).forEach(function(key) {
|
|
var multiply = [right2, bottom2].indexOf(key) >= 0 ? 1 : -1;
|
|
var axis = [top2, bottom2].indexOf(key) >= 0 ? "y" : "x";
|
|
overflowOffsets[key] += offset2[axis] * multiply;
|
|
});
|
|
}
|
|
return overflowOffsets;
|
|
}
|
|
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
|
|
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
|
|
var DEFAULT_OPTIONS = {
|
|
placement: "bottom",
|
|
modifiers: [],
|
|
strategy: "absolute"
|
|
};
|
|
function areValidElements() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return !args.some(function(element) {
|
|
return !(element && typeof element.getBoundingClientRect === "function");
|
|
});
|
|
}
|
|
function popperGenerator(generatorOptions) {
|
|
if (generatorOptions === void 0) {
|
|
generatorOptions = {};
|
|
}
|
|
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
return function createPopper2(reference2, popper2, options) {
|
|
if (options === void 0) {
|
|
options = defaultOptions;
|
|
}
|
|
var state = {
|
|
placement: "bottom",
|
|
orderedModifiers: [],
|
|
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
modifiersData: {},
|
|
elements: {
|
|
reference: reference2,
|
|
popper: popper2
|
|
},
|
|
attributes: {},
|
|
styles: {}
|
|
};
|
|
var effectCleanupFns = [];
|
|
var isDestroyed = false;
|
|
var instance = {
|
|
state,
|
|
setOptions: function setOptions(setOptionsAction) {
|
|
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
|
cleanupModifierEffects();
|
|
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
|
state.scrollParents = {
|
|
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
|
popper: listScrollParents(popper2)
|
|
};
|
|
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
|
state.orderedModifiers = orderedModifiers.filter(function(m2) {
|
|
return m2.enabled;
|
|
});
|
|
if (true) {
|
|
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
|
|
var name = _ref.name;
|
|
return name;
|
|
});
|
|
validateModifiers(modifiers);
|
|
if (getBasePlacement(state.options.placement) === auto) {
|
|
var flipModifier = state.orderedModifiers.find(function(_ref2) {
|
|
var name = _ref2.name;
|
|
return name === "flip";
|
|
});
|
|
if (!flipModifier) {
|
|
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
|
}
|
|
}
|
|
var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
|
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin2) {
|
|
return parseFloat(margin2);
|
|
})) {
|
|
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
|
|
}
|
|
}
|
|
runModifierEffects();
|
|
return instance.update();
|
|
},
|
|
forceUpdate: function forceUpdate() {
|
|
if (isDestroyed) {
|
|
return;
|
|
}
|
|
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
if (!areValidElements(reference3, popper3)) {
|
|
if (true) {
|
|
console.error(INVALID_ELEMENT_ERROR);
|
|
}
|
|
return;
|
|
}
|
|
state.rects = {
|
|
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
|
popper: getLayoutRect(popper3)
|
|
};
|
|
state.reset = false;
|
|
state.placement = state.options.placement;
|
|
state.orderedModifiers.forEach(function(modifier) {
|
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
});
|
|
var __debug_loops__ = 0;
|
|
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
if (true) {
|
|
__debug_loops__ += 1;
|
|
if (__debug_loops__ > 100) {
|
|
console.error(INFINITE_LOOP_ERROR);
|
|
break;
|
|
}
|
|
}
|
|
if (state.reset === true) {
|
|
state.reset = false;
|
|
index = -1;
|
|
continue;
|
|
}
|
|
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
if (typeof fn2 === "function") {
|
|
state = fn2({
|
|
state,
|
|
options: _options,
|
|
name,
|
|
instance
|
|
}) || state;
|
|
}
|
|
}
|
|
},
|
|
update: debounce(function() {
|
|
return new Promise(function(resolve) {
|
|
instance.forceUpdate();
|
|
resolve(state);
|
|
});
|
|
}),
|
|
destroy: function destroy() {
|
|
cleanupModifierEffects();
|
|
isDestroyed = true;
|
|
}
|
|
};
|
|
if (!areValidElements(reference2, popper2)) {
|
|
if (true) {
|
|
console.error(INVALID_ELEMENT_ERROR);
|
|
}
|
|
return instance;
|
|
}
|
|
instance.setOptions(options).then(function(state2) {
|
|
if (!isDestroyed && options.onFirstUpdate) {
|
|
options.onFirstUpdate(state2);
|
|
}
|
|
});
|
|
function runModifierEffects() {
|
|
state.orderedModifiers.forEach(function(_ref3) {
|
|
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
|
if (typeof effect2 === "function") {
|
|
var cleanupFn = effect2({
|
|
state,
|
|
name,
|
|
instance,
|
|
options: options2
|
|
});
|
|
var noopFn = function noopFn2() {
|
|
};
|
|
effectCleanupFns.push(cleanupFn || noopFn);
|
|
}
|
|
});
|
|
}
|
|
function cleanupModifierEffects() {
|
|
effectCleanupFns.forEach(function(fn2) {
|
|
return fn2();
|
|
});
|
|
effectCleanupFns = [];
|
|
}
|
|
return instance;
|
|
};
|
|
}
|
|
var passive = {
|
|
passive: true
|
|
};
|
|
function effect$2(_ref) {
|
|
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
|
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
|
var window2 = getWindow(state.elements.popper);
|
|
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
if (scroll) {
|
|
scrollParents.forEach(function(scrollParent) {
|
|
scrollParent.addEventListener("scroll", instance.update, passive);
|
|
});
|
|
}
|
|
if (resize) {
|
|
window2.addEventListener("resize", instance.update, passive);
|
|
}
|
|
return function() {
|
|
if (scroll) {
|
|
scrollParents.forEach(function(scrollParent) {
|
|
scrollParent.removeEventListener("scroll", instance.update, passive);
|
|
});
|
|
}
|
|
if (resize) {
|
|
window2.removeEventListener("resize", instance.update, passive);
|
|
}
|
|
};
|
|
}
|
|
var eventListeners = {
|
|
name: "eventListeners",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: function fn2() {
|
|
},
|
|
effect: effect$2,
|
|
data: {}
|
|
};
|
|
function popperOffsets(_ref) {
|
|
var state = _ref.state, name = _ref.name;
|
|
state.modifiersData[name] = computeOffsets({
|
|
reference: state.rects.reference,
|
|
element: state.rects.popper,
|
|
strategy: "absolute",
|
|
placement: state.placement
|
|
});
|
|
}
|
|
var popperOffsets$1 = {
|
|
name: "popperOffsets",
|
|
enabled: true,
|
|
phase: "read",
|
|
fn: popperOffsets,
|
|
data: {}
|
|
};
|
|
var unsetSides = {
|
|
top: "auto",
|
|
right: "auto",
|
|
bottom: "auto",
|
|
left: "auto"
|
|
};
|
|
function roundOffsetsByDPR(_ref) {
|
|
var x2 = _ref.x, y2 = _ref.y;
|
|
var win = window;
|
|
var dpr = win.devicePixelRatio || 1;
|
|
return {
|
|
x: round2(x2 * dpr) / dpr || 0,
|
|
y: round2(y2 * dpr) / dpr || 0
|
|
};
|
|
}
|
|
function mapToStyles(_ref2) {
|
|
var _Object$assign2;
|
|
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position2 = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
|
var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
|
x: x2,
|
|
y: y2
|
|
}) : {
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
x2 = _ref3.x;
|
|
y2 = _ref3.y;
|
|
var hasX = offsets.hasOwnProperty("x");
|
|
var hasY = offsets.hasOwnProperty("y");
|
|
var sideX = left2;
|
|
var sideY = top2;
|
|
var win = window;
|
|
if (adaptive) {
|
|
var offsetParent = getOffsetParent(popper2);
|
|
var heightProp = "clientHeight";
|
|
var widthProp = "clientWidth";
|
|
if (offsetParent === getWindow(popper2)) {
|
|
offsetParent = getDocumentElement(popper2);
|
|
if (getComputedStyle(offsetParent).position !== "static" && position2 === "absolute") {
|
|
heightProp = "scrollHeight";
|
|
widthProp = "scrollWidth";
|
|
}
|
|
}
|
|
offsetParent = offsetParent;
|
|
if (placement === top2 || (placement === left2 || placement === right2) && variation === end) {
|
|
sideY = bottom2;
|
|
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
|
y2 -= offsetY - popperRect.height;
|
|
y2 *= gpuAcceleration ? 1 : -1;
|
|
}
|
|
if (placement === left2 || (placement === top2 || placement === bottom2) && variation === end) {
|
|
sideX = right2;
|
|
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
|
x2 -= offsetX - popperRect.width;
|
|
x2 *= gpuAcceleration ? 1 : -1;
|
|
}
|
|
}
|
|
var commonStyles = Object.assign({
|
|
position: position2
|
|
}, adaptive && unsetSides);
|
|
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
x: x2,
|
|
y: y2
|
|
}) : {
|
|
x: x2,
|
|
y: y2
|
|
};
|
|
x2 = _ref4.x;
|
|
y2 = _ref4.y;
|
|
if (gpuAcceleration) {
|
|
var _Object$assign;
|
|
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign));
|
|
}
|
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
|
}
|
|
function computeStyles(_ref5) {
|
|
var state = _ref5.state, options = _ref5.options;
|
|
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
if (true) {
|
|
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
|
|
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
|
return transitionProperty.indexOf(property) >= 0;
|
|
})) {
|
|
console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
|
|
}
|
|
}
|
|
var commonStyles = {
|
|
placement: getBasePlacement(state.placement),
|
|
variation: getVariation(state.placement),
|
|
popper: state.elements.popper,
|
|
popperRect: state.rects.popper,
|
|
gpuAcceleration,
|
|
isFixed: state.options.strategy === "fixed"
|
|
};
|
|
if (state.modifiersData.popperOffsets != null) {
|
|
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
offsets: state.modifiersData.popperOffsets,
|
|
position: state.options.strategy,
|
|
adaptive,
|
|
roundOffsets
|
|
})));
|
|
}
|
|
if (state.modifiersData.arrow != null) {
|
|
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
offsets: state.modifiersData.arrow,
|
|
position: "absolute",
|
|
adaptive: false,
|
|
roundOffsets
|
|
})));
|
|
}
|
|
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
"data-popper-placement": state.placement
|
|
});
|
|
}
|
|
var computeStyles$1 = {
|
|
name: "computeStyles",
|
|
enabled: true,
|
|
phase: "beforeWrite",
|
|
fn: computeStyles,
|
|
data: {}
|
|
};
|
|
function applyStyles(_ref) {
|
|
var state = _ref.state;
|
|
Object.keys(state.elements).forEach(function(name) {
|
|
var style3 = state.styles[name] || {};
|
|
var attributes = state.attributes[name] || {};
|
|
var element = state.elements[name];
|
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
return;
|
|
}
|
|
Object.assign(element.style, style3);
|
|
Object.keys(attributes).forEach(function(name2) {
|
|
var value = attributes[name2];
|
|
if (value === false) {
|
|
element.removeAttribute(name2);
|
|
} else {
|
|
element.setAttribute(name2, value === true ? "" : value);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function effect$1(_ref2) {
|
|
var state = _ref2.state;
|
|
var initialStyles = {
|
|
popper: {
|
|
position: state.options.strategy,
|
|
left: "0",
|
|
top: "0",
|
|
margin: "0"
|
|
},
|
|
arrow: {
|
|
position: "absolute"
|
|
},
|
|
reference: {}
|
|
};
|
|
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
state.styles = initialStyles;
|
|
if (state.elements.arrow) {
|
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
}
|
|
return function() {
|
|
Object.keys(state.elements).forEach(function(name) {
|
|
var element = state.elements[name];
|
|
var attributes = state.attributes[name] || {};
|
|
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
var style3 = styleProperties.reduce(function(style4, property) {
|
|
style4[property] = "";
|
|
return style4;
|
|
}, {});
|
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
return;
|
|
}
|
|
Object.assign(element.style, style3);
|
|
Object.keys(attributes).forEach(function(attribute) {
|
|
element.removeAttribute(attribute);
|
|
});
|
|
});
|
|
};
|
|
}
|
|
var applyStyles$1 = {
|
|
name: "applyStyles",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: applyStyles,
|
|
effect: effect$1,
|
|
requires: ["computeStyles"]
|
|
};
|
|
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
var basePlacement = getBasePlacement(placement);
|
|
var invertDistance = [left2, top2].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
|
placement
|
|
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
|
skidding = skidding || 0;
|
|
distance = (distance || 0) * invertDistance;
|
|
return [left2, right2].indexOf(basePlacement) >= 0 ? {
|
|
x: distance,
|
|
y: skidding
|
|
} : {
|
|
x: skidding,
|
|
y: distance
|
|
};
|
|
}
|
|
function offset(_ref2) {
|
|
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
var data = placements.reduce(function(acc, placement) {
|
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
return acc;
|
|
}, {});
|
|
var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y2 = _data$state$placement.y;
|
|
if (state.modifiersData.popperOffsets != null) {
|
|
state.modifiersData.popperOffsets.x += x2;
|
|
state.modifiersData.popperOffsets.y += y2;
|
|
}
|
|
state.modifiersData[name] = data;
|
|
}
|
|
var offset$1 = {
|
|
name: "offset",
|
|
enabled: true,
|
|
phase: "main",
|
|
requires: ["popperOffsets"],
|
|
fn: offset
|
|
};
|
|
var hash$1 = {
|
|
left: "right",
|
|
right: "left",
|
|
bottom: "top",
|
|
top: "bottom"
|
|
};
|
|
function getOppositePlacement(placement) {
|
|
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
return hash$1[matched];
|
|
});
|
|
}
|
|
var hash = {
|
|
start: "end",
|
|
end: "start"
|
|
};
|
|
function getOppositeVariationPlacement(placement) {
|
|
return placement.replace(/start|end/g, function(matched) {
|
|
return hash[matched];
|
|
});
|
|
}
|
|
function computeAutoPlacement(state, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding2 = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
var variation = getVariation(placement);
|
|
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
return getVariation(placement2) === variation;
|
|
}) : basePlacements;
|
|
var allowedPlacements = placements$1.filter(function(placement2) {
|
|
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
});
|
|
if (allowedPlacements.length === 0) {
|
|
allowedPlacements = placements$1;
|
|
if (true) {
|
|
console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" "));
|
|
}
|
|
}
|
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
acc[placement2] = detectOverflow(state, {
|
|
placement: placement2,
|
|
boundary,
|
|
rootBoundary,
|
|
padding: padding2
|
|
})[getBasePlacement(placement2)];
|
|
return acc;
|
|
}, {});
|
|
return Object.keys(overflows).sort(function(a2, b2) {
|
|
return overflows[a2] - overflows[b2];
|
|
});
|
|
}
|
|
function getExpandedFallbackPlacements(placement) {
|
|
if (getBasePlacement(placement) === auto) {
|
|
return [];
|
|
}
|
|
var oppositePlacement = getOppositePlacement(placement);
|
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
}
|
|
function flip(_ref) {
|
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
if (state.modifiersData[name]._skip) {
|
|
return;
|
|
}
|
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding2 = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
|
var preferredPlacement = state.options.placement;
|
|
var basePlacement = getBasePlacement(preferredPlacement);
|
|
var isBasePlacement = basePlacement === preferredPlacement;
|
|
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
|
placement: placement2,
|
|
boundary,
|
|
rootBoundary,
|
|
padding: padding2,
|
|
flipVariations,
|
|
allowedAutoPlacements
|
|
}) : placement2);
|
|
}, []);
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var checksMap = /* @__PURE__ */ new Map();
|
|
var makeFallbackChecks = true;
|
|
var firstFittingPlacement = placements2[0];
|
|
for (var i2 = 0; i2 < placements2.length; i2++) {
|
|
var placement = placements2[i2];
|
|
var _basePlacement = getBasePlacement(placement);
|
|
var isStartVariation = getVariation(placement) === start;
|
|
var isVertical = [top2, bottom2].indexOf(_basePlacement) >= 0;
|
|
var len = isVertical ? "width" : "height";
|
|
var overflow2 = detectOverflow(state, {
|
|
placement,
|
|
boundary,
|
|
rootBoundary,
|
|
altBoundary,
|
|
padding: padding2
|
|
});
|
|
var mainVariationSide = isVertical ? isStartVariation ? right2 : left2 : isStartVariation ? bottom2 : top2;
|
|
if (referenceRect[len] > popperRect[len]) {
|
|
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
}
|
|
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
var checks = [];
|
|
if (checkMainAxis) {
|
|
checks.push(overflow2[_basePlacement] <= 0);
|
|
}
|
|
if (checkAltAxis) {
|
|
checks.push(overflow2[mainVariationSide] <= 0, overflow2[altVariationSide] <= 0);
|
|
}
|
|
if (checks.every(function(check) {
|
|
return check;
|
|
})) {
|
|
firstFittingPlacement = placement;
|
|
makeFallbackChecks = false;
|
|
break;
|
|
}
|
|
checksMap.set(placement, checks);
|
|
}
|
|
if (makeFallbackChecks) {
|
|
var numberOfChecks = flipVariations ? 3 : 1;
|
|
var _loop = function _loop2(_i2) {
|
|
var fittingPlacement = placements2.find(function(placement2) {
|
|
var checks2 = checksMap.get(placement2);
|
|
if (checks2) {
|
|
return checks2.slice(0, _i2).every(function(check) {
|
|
return check;
|
|
});
|
|
}
|
|
});
|
|
if (fittingPlacement) {
|
|
firstFittingPlacement = fittingPlacement;
|
|
return "break";
|
|
}
|
|
};
|
|
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
var _ret = _loop(_i);
|
|
if (_ret === "break")
|
|
break;
|
|
}
|
|
}
|
|
if (state.placement !== firstFittingPlacement) {
|
|
state.modifiersData[name]._skip = true;
|
|
state.placement = firstFittingPlacement;
|
|
state.reset = true;
|
|
}
|
|
}
|
|
var flip$1 = {
|
|
name: "flip",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: flip,
|
|
requiresIfExists: ["offset"],
|
|
data: {
|
|
_skip: false
|
|
}
|
|
};
|
|
function getAltAxis(axis) {
|
|
return axis === "x" ? "y" : "x";
|
|
}
|
|
function within(min$1, value, max$1) {
|
|
return max(min$1, min(value, max$1));
|
|
}
|
|
function withinMaxClamp(min2, value, max2) {
|
|
var v2 = within(min2, value, max2);
|
|
return v2 > max2 ? max2 : v2;
|
|
}
|
|
function preventOverflow(_ref) {
|
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding2 = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
var overflow2 = detectOverflow(state, {
|
|
boundary,
|
|
rootBoundary,
|
|
padding: padding2,
|
|
altBoundary
|
|
});
|
|
var basePlacement = getBasePlacement(state.placement);
|
|
var variation = getVariation(state.placement);
|
|
var isBasePlacement = !variation;
|
|
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
var altAxis = getAltAxis(mainAxis);
|
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
|
placement: state.placement
|
|
})) : tetherOffset;
|
|
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
|
mainAxis: tetherOffsetValue,
|
|
altAxis: tetherOffsetValue
|
|
} : Object.assign({
|
|
mainAxis: 0,
|
|
altAxis: 0
|
|
}, tetherOffsetValue);
|
|
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
var data = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
if (!popperOffsets2) {
|
|
return;
|
|
}
|
|
if (checkMainAxis) {
|
|
var _offsetModifierState$;
|
|
var mainSide = mainAxis === "y" ? top2 : left2;
|
|
var altSide = mainAxis === "y" ? bottom2 : right2;
|
|
var len = mainAxis === "y" ? "height" : "width";
|
|
var offset2 = popperOffsets2[mainAxis];
|
|
var min$1 = offset2 + overflow2[mainSide];
|
|
var max$1 = offset2 - overflow2[altSide];
|
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
var arrowElement = state.elements.arrow;
|
|
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
width: 0,
|
|
height: 0
|
|
};
|
|
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
|
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
var arrowPaddingMax = arrowPaddingObject[altSide];
|
|
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1);
|
|
popperOffsets2[mainAxis] = preventedOffset;
|
|
data[mainAxis] = preventedOffset - offset2;
|
|
}
|
|
if (checkAltAxis) {
|
|
var _offsetModifierState$2;
|
|
var _mainSide = mainAxis === "x" ? top2 : left2;
|
|
var _altSide = mainAxis === "x" ? bottom2 : right2;
|
|
var _offset = popperOffsets2[altAxis];
|
|
var _len = altAxis === "y" ? "height" : "width";
|
|
var _min = _offset + overflow2[_mainSide];
|
|
var _max = _offset - overflow2[_altSide];
|
|
var isOriginSide = [top2, left2].indexOf(basePlacement) !== -1;
|
|
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
popperOffsets2[altAxis] = _preventedOffset;
|
|
data[altAxis] = _preventedOffset - _offset;
|
|
}
|
|
state.modifiersData[name] = data;
|
|
}
|
|
var preventOverflow$1 = {
|
|
name: "preventOverflow",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: preventOverflow,
|
|
requiresIfExists: ["offset"]
|
|
};
|
|
var toPaddingObject = function toPaddingObject2(padding2, state) {
|
|
padding2 = typeof padding2 === "function" ? padding2(Object.assign({}, state.rects, {
|
|
placement: state.placement
|
|
})) : padding2;
|
|
return mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements));
|
|
};
|
|
function arrow(_ref) {
|
|
var _state$modifiersData$;
|
|
var state = _ref.state, name = _ref.name, options = _ref.options;
|
|
var arrowElement = state.elements.arrow;
|
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
|
var basePlacement = getBasePlacement(state.placement);
|
|
var axis = getMainAxisFromPlacement(basePlacement);
|
|
var isVertical = [left2, right2].indexOf(basePlacement) >= 0;
|
|
var len = isVertical ? "height" : "width";
|
|
if (!arrowElement || !popperOffsets2) {
|
|
return;
|
|
}
|
|
var paddingObject = toPaddingObject(options.padding, state);
|
|
var arrowRect = getLayoutRect(arrowElement);
|
|
var minProp = axis === "y" ? top2 : left2;
|
|
var maxProp = axis === "y" ? bottom2 : right2;
|
|
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
|
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
|
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
var centerToReference = endDiff / 2 - startDiff / 2;
|
|
var min2 = paddingObject[minProp];
|
|
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
var offset2 = within(min2, center, max2);
|
|
var axisProp = axis;
|
|
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
|
}
|
|
function effect(_ref2) {
|
|
var state = _ref2.state, options = _ref2.options;
|
|
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
|
if (arrowElement == null) {
|
|
return;
|
|
}
|
|
if (typeof arrowElement === "string") {
|
|
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
if (!arrowElement) {
|
|
return;
|
|
}
|
|
}
|
|
if (true) {
|
|
if (!isHTMLElement(arrowElement)) {
|
|
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "));
|
|
}
|
|
}
|
|
if (!contains(state.elements.popper, arrowElement)) {
|
|
if (true) {
|
|
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
|
|
}
|
|
return;
|
|
}
|
|
state.elements.arrow = arrowElement;
|
|
}
|
|
var arrow$1 = {
|
|
name: "arrow",
|
|
enabled: true,
|
|
phase: "main",
|
|
fn: arrow,
|
|
effect,
|
|
requires: ["popperOffsets"],
|
|
requiresIfExists: ["preventOverflow"]
|
|
};
|
|
function getSideOffsets(overflow2, rect, preventedOffsets) {
|
|
if (preventedOffsets === void 0) {
|
|
preventedOffsets = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
}
|
|
return {
|
|
top: overflow2.top - rect.height - preventedOffsets.y,
|
|
right: overflow2.right - rect.width + preventedOffsets.x,
|
|
bottom: overflow2.bottom - rect.height + preventedOffsets.y,
|
|
left: overflow2.left - rect.width - preventedOffsets.x
|
|
};
|
|
}
|
|
function isAnySideFullyClipped(overflow2) {
|
|
return [top2, right2, bottom2, left2].some(function(side) {
|
|
return overflow2[side] >= 0;
|
|
});
|
|
}
|
|
function hide(_ref) {
|
|
var state = _ref.state, name = _ref.name;
|
|
var referenceRect = state.rects.reference;
|
|
var popperRect = state.rects.popper;
|
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
var referenceOverflow = detectOverflow(state, {
|
|
elementContext: "reference"
|
|
});
|
|
var popperAltOverflow = detectOverflow(state, {
|
|
altBoundary: true
|
|
});
|
|
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
state.modifiersData[name] = {
|
|
referenceClippingOffsets,
|
|
popperEscapeOffsets,
|
|
isReferenceHidden,
|
|
hasPopperEscaped
|
|
};
|
|
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
"data-popper-reference-hidden": isReferenceHidden,
|
|
"data-popper-escaped": hasPopperEscaped
|
|
});
|
|
}
|
|
var hide$1 = {
|
|
name: "hide",
|
|
enabled: true,
|
|
phase: "main",
|
|
requiresIfExists: ["preventOverflow"],
|
|
fn: hide
|
|
};
|
|
var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
|
var createPopper$1 = /* @__PURE__ */ popperGenerator({
|
|
defaultModifiers: defaultModifiers$1
|
|
});
|
|
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
defaultModifiers
|
|
});
|
|
exports.applyStyles = applyStyles$1;
|
|
exports.arrow = arrow$1;
|
|
exports.computeStyles = computeStyles$1;
|
|
exports.createPopper = createPopper;
|
|
exports.createPopperLite = createPopper$1;
|
|
exports.defaultModifiers = defaultModifiers;
|
|
exports.detectOverflow = detectOverflow;
|
|
exports.eventListeners = eventListeners;
|
|
exports.flip = flip$1;
|
|
exports.hide = hide$1;
|
|
exports.offset = offset$1;
|
|
exports.popperGenerator = popperGenerator;
|
|
exports.popperOffsets = popperOffsets$1;
|
|
exports.preventOverflow = preventOverflow$1;
|
|
}
|
|
});
|
|
|
|
// node_modules/@babel/runtime/helpers/extends.js
|
|
var require_extends = __commonJS({
|
|
"node_modules/@babel/runtime/helpers/extends.js"(exports, module2) {
|
|
function _extends2() {
|
|
module2.exports = _extends2 = Object.assign ? Object.assign.bind() : function(target) {
|
|
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
var source = arguments[i2];
|
|
for (var key in source) {
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
return _extends2.apply(this, arguments);
|
|
}
|
|
module2.exports = _extends2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js
|
|
var require_emotion_memoize_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function memoize2(fn2) {
|
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
return function(arg) {
|
|
if (cache[arg] === void 0)
|
|
cache[arg] = fn2(arg);
|
|
return cache[arg];
|
|
};
|
|
}
|
|
exports.default = memoize2;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/memoize/dist/emotion-memoize.cjs.js
|
|
var require_emotion_memoize_cjs = __commonJS({
|
|
"node_modules/@emotion/memoize/dist/emotion-memoize.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_memoize_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.dev.js
|
|
var require_emotion_is_prop_valid_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var memoize2 = require_emotion_memoize_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var memoize__default = /* @__PURE__ */ _interopDefault(memoize2);
|
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
var isPropValid = /* @__PURE__ */ memoize__default["default"](
|
|
function(prop) {
|
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
}
|
|
);
|
|
exports.default = isPropValid;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.js
|
|
var require_emotion_is_prop_valid_cjs = __commonJS({
|
|
"node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_is_prop_valid_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/sheet/dist/emotion-sheet.cjs.dev.js
|
|
var require_emotion_sheet_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/sheet/dist/emotion-sheet.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function sheetForTag(tag) {
|
|
if (tag.sheet) {
|
|
return tag.sheet;
|
|
}
|
|
for (var i2 = 0; i2 < document.styleSheets.length; i2++) {
|
|
if (document.styleSheets[i2].ownerNode === tag) {
|
|
return document.styleSheets[i2];
|
|
}
|
|
}
|
|
}
|
|
function createStyleElement(options) {
|
|
var tag = document.createElement("style");
|
|
tag.setAttribute("data-emotion", options.key);
|
|
if (options.nonce !== void 0) {
|
|
tag.setAttribute("nonce", options.nonce);
|
|
}
|
|
tag.appendChild(document.createTextNode(""));
|
|
tag.setAttribute("data-s", "");
|
|
return tag;
|
|
}
|
|
var StyleSheet = /* @__PURE__ */ function() {
|
|
function StyleSheet2(options) {
|
|
var _this = this;
|
|
this._insertTag = function(tag) {
|
|
var before;
|
|
if (_this.tags.length === 0) {
|
|
if (_this.insertionPoint) {
|
|
before = _this.insertionPoint.nextSibling;
|
|
} else if (_this.prepend) {
|
|
before = _this.container.firstChild;
|
|
} else {
|
|
before = _this.before;
|
|
}
|
|
} else {
|
|
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
}
|
|
_this.container.insertBefore(tag, before);
|
|
_this.tags.push(tag);
|
|
};
|
|
this.isSpeedy = options.speedy === void 0 ? false : options.speedy;
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
this.nonce = options.nonce;
|
|
this.key = options.key;
|
|
this.container = options.container;
|
|
this.prepend = options.prepend;
|
|
this.insertionPoint = options.insertionPoint;
|
|
this.before = null;
|
|
}
|
|
var _proto = StyleSheet2.prototype;
|
|
_proto.hydrate = function hydrate(nodes) {
|
|
nodes.forEach(this._insertTag);
|
|
};
|
|
_proto.insert = function insert(rule) {
|
|
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
|
|
this._insertTag(createStyleElement(this));
|
|
}
|
|
var tag = this.tags[this.tags.length - 1];
|
|
if (true) {
|
|
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
|
|
}
|
|
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
}
|
|
if (this.isSpeedy) {
|
|
var sheet = sheetForTag(tag);
|
|
try {
|
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
} catch (e) {
|
|
if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
|
|
console.error('There was a problem inserting the following rule: "' + rule + '"', e);
|
|
}
|
|
}
|
|
} else {
|
|
tag.appendChild(document.createTextNode(rule));
|
|
}
|
|
this.ctr++;
|
|
};
|
|
_proto.flush = function flush() {
|
|
this.tags.forEach(function(tag) {
|
|
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
});
|
|
this.tags = [];
|
|
this.ctr = 0;
|
|
if (true) {
|
|
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
}
|
|
};
|
|
return StyleSheet2;
|
|
}();
|
|
exports.StyleSheet = StyleSheet;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/sheet/dist/emotion-sheet.cjs.js
|
|
var require_emotion_sheet_cjs = __commonJS({
|
|
"node_modules/@emotion/sheet/dist/emotion-sheet.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_sheet_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/stylis/dist/umd/stylis.js
|
|
var require_stylis = __commonJS({
|
|
"node_modules/stylis/dist/umd/stylis.js"(exports, module2) {
|
|
(function(e, r3) {
|
|
typeof exports === "object" && typeof module2 !== "undefined" ? r3(exports) : typeof define === "function" && define.amd ? define(["exports"], r3) : (e = e || self, r3(e.stylis = {}));
|
|
})(exports, function(e) {
|
|
"use strict";
|
|
var r3 = "-ms-";
|
|
var a2 = "-moz-";
|
|
var c2 = "-webkit-";
|
|
var t2 = "comm";
|
|
var n2 = "rule";
|
|
var s2 = "decl";
|
|
var i2 = "@page";
|
|
var u2 = "@media";
|
|
var o2 = "@import";
|
|
var f2 = "@charset";
|
|
var l2 = "@viewport";
|
|
var h2 = "@supports";
|
|
var p2 = "@document";
|
|
var v2 = "@namespace";
|
|
var b2 = "@keyframes";
|
|
var d2 = "@font-face";
|
|
var m2 = "@counter-style";
|
|
var w2 = "@font-feature-values";
|
|
var k2 = Math.abs;
|
|
var $ = String.fromCharCode;
|
|
var g2 = Object.assign;
|
|
function x2(e2, r4) {
|
|
return (((r4 << 2 ^ O2(e2, 0)) << 2 ^ O2(e2, 1)) << 2 ^ O2(e2, 2)) << 2 ^ O2(e2, 3);
|
|
}
|
|
function E2(e2) {
|
|
return e2.trim();
|
|
}
|
|
function y2(e2, r4) {
|
|
return (e2 = r4.exec(e2)) ? e2[0] : e2;
|
|
}
|
|
function T(e2, r4, a3) {
|
|
return e2.replace(r4, a3);
|
|
}
|
|
function A2(e2, r4) {
|
|
return e2.indexOf(r4);
|
|
}
|
|
function O2(e2, r4) {
|
|
return e2.charCodeAt(r4) | 0;
|
|
}
|
|
function C(e2, r4, a3) {
|
|
return e2.slice(r4, a3);
|
|
}
|
|
function M2(e2) {
|
|
return e2.length;
|
|
}
|
|
function S2(e2) {
|
|
return e2.length;
|
|
}
|
|
function R2(e2, r4) {
|
|
return r4.push(e2), e2;
|
|
}
|
|
function z2(e2, r4) {
|
|
return e2.map(r4).join("");
|
|
}
|
|
e.line = 1;
|
|
e.column = 1;
|
|
e.length = 0;
|
|
e.position = 0;
|
|
e.character = 0;
|
|
e.characters = "";
|
|
function N2(r4, a3, c3, t3, n3, s3, i3) {
|
|
return { value: r4, root: a3, parent: c3, type: t3, props: n3, children: s3, line: e.line, column: e.column, length: i3, return: "" };
|
|
}
|
|
function P2(e2, r4) {
|
|
return g2(N2("", null, null, "", null, null, 0), e2, { length: -e2.length }, r4);
|
|
}
|
|
function j2() {
|
|
return e.character;
|
|
}
|
|
function U2() {
|
|
e.character = e.position > 0 ? O2(e.characters, --e.position) : 0;
|
|
if (e.column--, e.character === 10)
|
|
e.column = 1, e.line--;
|
|
return e.character;
|
|
}
|
|
function _3() {
|
|
e.character = e.position < e.length ? O2(e.characters, e.position++) : 0;
|
|
if (e.column++, e.character === 10)
|
|
e.column = 1, e.line++;
|
|
return e.character;
|
|
}
|
|
function F2() {
|
|
return O2(e.characters, e.position);
|
|
}
|
|
function I2() {
|
|
return e.position;
|
|
}
|
|
function L2(r4, a3) {
|
|
return C(e.characters, r4, a3);
|
|
}
|
|
function D2(e2) {
|
|
switch (e2) {
|
|
case 0:
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
return 5;
|
|
case 33:
|
|
case 43:
|
|
case 44:
|
|
case 47:
|
|
case 62:
|
|
case 64:
|
|
case 126:
|
|
case 59:
|
|
case 123:
|
|
case 125:
|
|
return 4;
|
|
case 58:
|
|
return 3;
|
|
case 34:
|
|
case 39:
|
|
case 40:
|
|
case 91:
|
|
return 2;
|
|
case 41:
|
|
case 93:
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
function K(r4) {
|
|
return e.line = e.column = 1, e.length = M2(e.characters = r4), e.position = 0, [];
|
|
}
|
|
function V(r4) {
|
|
return e.characters = "", r4;
|
|
}
|
|
function W2(r4) {
|
|
return E2(L2(e.position - 1, Z2(r4 === 91 ? r4 + 2 : r4 === 40 ? r4 + 1 : r4)));
|
|
}
|
|
function Y2(e2) {
|
|
return V(G2(K(e2)));
|
|
}
|
|
function B2(r4) {
|
|
while (e.character = F2())
|
|
if (e.character < 33)
|
|
_3();
|
|
else
|
|
break;
|
|
return D2(r4) > 2 || D2(e.character) > 3 ? "" : " ";
|
|
}
|
|
function G2(r4) {
|
|
while (_3())
|
|
switch (D2(e.character)) {
|
|
case 0:
|
|
R2(J(e.position - 1), r4);
|
|
break;
|
|
case 2:
|
|
R2(W2(e.character), r4);
|
|
break;
|
|
default:
|
|
R2($(e.character), r4);
|
|
}
|
|
return r4;
|
|
}
|
|
function H2(r4, a3) {
|
|
while (--a3 && _3())
|
|
if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97)
|
|
break;
|
|
return L2(r4, I2() + (a3 < 6 && F2() == 32 && _3() == 32));
|
|
}
|
|
function Z2(r4) {
|
|
while (_3())
|
|
switch (e.character) {
|
|
case r4:
|
|
return e.position;
|
|
case 34:
|
|
case 39:
|
|
if (r4 !== 34 && r4 !== 39)
|
|
Z2(e.character);
|
|
break;
|
|
case 40:
|
|
if (r4 === 41)
|
|
Z2(r4);
|
|
break;
|
|
case 92:
|
|
_3();
|
|
break;
|
|
}
|
|
return e.position;
|
|
}
|
|
function q2(r4, a3) {
|
|
while (_3())
|
|
if (r4 + e.character === 47 + 10)
|
|
break;
|
|
else if (r4 + e.character === 42 + 42 && F2() === 47)
|
|
break;
|
|
return "/*" + L2(a3, e.position - 1) + "*" + $(r4 === 47 ? r4 : _3());
|
|
}
|
|
function J(r4) {
|
|
while (!D2(F2()))
|
|
_3();
|
|
return L2(r4, e.position);
|
|
}
|
|
function Q2(e2) {
|
|
return V(X2("", null, null, null, [""], e2 = K(e2), 0, [0], e2));
|
|
}
|
|
function X2(e2, r4, a3, c3, t3, n3, s3, i3, u3) {
|
|
var o3 = 0;
|
|
var f3 = 0;
|
|
var l3 = s3;
|
|
var h3 = 0;
|
|
var p3 = 0;
|
|
var v3 = 0;
|
|
var b3 = 1;
|
|
var d3 = 1;
|
|
var m3 = 1;
|
|
var w3 = 0;
|
|
var k3 = "";
|
|
var g3 = t3;
|
|
var x3 = n3;
|
|
var E3 = c3;
|
|
var y3 = k3;
|
|
while (d3)
|
|
switch (v3 = w3, w3 = _3()) {
|
|
case 40:
|
|
if (v3 != 108 && y3.charCodeAt(l3 - 1) == 58) {
|
|
if (A2(y3 += T(W2(w3), "&", "&\f"), "&\f") != -1)
|
|
m3 = -1;
|
|
break;
|
|
}
|
|
case 34:
|
|
case 39:
|
|
case 91:
|
|
y3 += W2(w3);
|
|
break;
|
|
case 9:
|
|
case 10:
|
|
case 13:
|
|
case 32:
|
|
y3 += B2(v3);
|
|
break;
|
|
case 92:
|
|
y3 += H2(I2() - 1, 7);
|
|
continue;
|
|
case 47:
|
|
switch (F2()) {
|
|
case 42:
|
|
case 47:
|
|
R2(re(q2(_3(), I2()), r4, a3), u3);
|
|
break;
|
|
default:
|
|
y3 += "/";
|
|
}
|
|
break;
|
|
case 123 * b3:
|
|
i3[o3++] = M2(y3) * m3;
|
|
case 125 * b3:
|
|
case 59:
|
|
case 0:
|
|
switch (w3) {
|
|
case 0:
|
|
case 125:
|
|
d3 = 0;
|
|
case 59 + f3:
|
|
if (p3 > 0 && M2(y3) - l3)
|
|
R2(p3 > 32 ? ae(y3 + ";", c3, a3, l3 - 1) : ae(T(y3, " ", "") + ";", c3, a3, l3 - 2), u3);
|
|
break;
|
|
case 59:
|
|
y3 += ";";
|
|
default:
|
|
R2(E3 = ee(y3, r4, a3, o3, f3, t3, i3, k3, g3 = [], x3 = [], l3), n3);
|
|
if (w3 === 123)
|
|
if (f3 === 0)
|
|
X2(y3, r4, E3, E3, g3, n3, l3, i3, x3);
|
|
else
|
|
switch (h3) {
|
|
case 100:
|
|
case 109:
|
|
case 115:
|
|
X2(e2, E3, E3, c3 && R2(ee(e2, E3, E3, 0, 0, t3, i3, k3, t3, g3 = [], l3), x3), t3, x3, l3, i3, c3 ? g3 : x3);
|
|
break;
|
|
default:
|
|
X2(y3, E3, E3, E3, [""], x3, 0, i3, x3);
|
|
}
|
|
}
|
|
o3 = f3 = p3 = 0, b3 = m3 = 1, k3 = y3 = "", l3 = s3;
|
|
break;
|
|
case 58:
|
|
l3 = 1 + M2(y3), p3 = v3;
|
|
default:
|
|
if (b3 < 1) {
|
|
if (w3 == 123)
|
|
--b3;
|
|
else if (w3 == 125 && b3++ == 0 && U2() == 125)
|
|
continue;
|
|
}
|
|
switch (y3 += $(w3), w3 * b3) {
|
|
case 38:
|
|
m3 = f3 > 0 ? 1 : (y3 += "\f", -1);
|
|
break;
|
|
case 44:
|
|
i3[o3++] = (M2(y3) - 1) * m3, m3 = 1;
|
|
break;
|
|
case 64:
|
|
if (F2() === 45)
|
|
y3 += W2(_3());
|
|
h3 = F2(), f3 = l3 = M2(k3 = y3 += J(I2())), w3++;
|
|
break;
|
|
case 45:
|
|
if (v3 === 45 && M2(y3) == 2)
|
|
b3 = 0;
|
|
}
|
|
}
|
|
return n3;
|
|
}
|
|
function ee(e2, r4, a3, c3, t3, s3, i3, u3, o3, f3, l3) {
|
|
var h3 = t3 - 1;
|
|
var p3 = t3 === 0 ? s3 : [""];
|
|
var v3 = S2(p3);
|
|
for (var b3 = 0, d3 = 0, m3 = 0; b3 < c3; ++b3)
|
|
for (var w3 = 0, $2 = C(e2, h3 + 1, h3 = k2(d3 = i3[b3])), g3 = e2; w3 < v3; ++w3)
|
|
if (g3 = E2(d3 > 0 ? p3[w3] + " " + $2 : T($2, /&\f/g, p3[w3])))
|
|
o3[m3++] = g3;
|
|
return N2(e2, r4, a3, t3 === 0 ? n2 : u3, o3, f3, l3);
|
|
}
|
|
function re(e2, r4, a3) {
|
|
return N2(e2, r4, a3, t2, $(j2()), C(e2, 2, -2), 0);
|
|
}
|
|
function ae(e2, r4, a3, c3) {
|
|
return N2(e2, r4, a3, s2, C(e2, 0, c3), C(e2, c3 + 1, -1), c3);
|
|
}
|
|
function ce(e2, t3) {
|
|
switch (x2(e2, t3)) {
|
|
case 5103:
|
|
return c2 + "print-" + e2 + e2;
|
|
case 5737:
|
|
case 4201:
|
|
case 3177:
|
|
case 3433:
|
|
case 1641:
|
|
case 4457:
|
|
case 2921:
|
|
case 5572:
|
|
case 6356:
|
|
case 5844:
|
|
case 3191:
|
|
case 6645:
|
|
case 3005:
|
|
case 6391:
|
|
case 5879:
|
|
case 5623:
|
|
case 6135:
|
|
case 4599:
|
|
case 4855:
|
|
case 4215:
|
|
case 6389:
|
|
case 5109:
|
|
case 5365:
|
|
case 5621:
|
|
case 3829:
|
|
return c2 + e2 + e2;
|
|
case 5349:
|
|
case 4246:
|
|
case 4810:
|
|
case 6968:
|
|
case 2756:
|
|
return c2 + e2 + a2 + e2 + r3 + e2 + e2;
|
|
case 6828:
|
|
case 4268:
|
|
return c2 + e2 + r3 + e2 + e2;
|
|
case 6165:
|
|
return c2 + e2 + r3 + "flex-" + e2 + e2;
|
|
case 5187:
|
|
return c2 + e2 + T(e2, /(\w+).+(:[^]+)/, c2 + "box-$1$2" + r3 + "flex-$1$2") + e2;
|
|
case 5443:
|
|
return c2 + e2 + r3 + "flex-item-" + T(e2, /flex-|-self/, "") + e2;
|
|
case 4675:
|
|
return c2 + e2 + r3 + "flex-line-pack" + T(e2, /align-content|flex-|-self/, "") + e2;
|
|
case 5548:
|
|
return c2 + e2 + r3 + T(e2, "shrink", "negative") + e2;
|
|
case 5292:
|
|
return c2 + e2 + r3 + T(e2, "basis", "preferred-size") + e2;
|
|
case 6060:
|
|
return c2 + "box-" + T(e2, "-grow", "") + c2 + e2 + r3 + T(e2, "grow", "positive") + e2;
|
|
case 4554:
|
|
return c2 + T(e2, /([^-])(transform)/g, "$1" + c2 + "$2") + e2;
|
|
case 6187:
|
|
return T(T(T(e2, /(zoom-|grab)/, c2 + "$1"), /(image-set)/, c2 + "$1"), e2, "") + e2;
|
|
case 5495:
|
|
case 3959:
|
|
return T(e2, /(image-set\([^]*)/, c2 + "$1$`$1");
|
|
case 4968:
|
|
return T(T(e2, /(.+:)(flex-)?(.*)/, c2 + "box-pack:$3" + r3 + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c2 + e2 + e2;
|
|
case 4095:
|
|
case 3583:
|
|
case 4068:
|
|
case 2532:
|
|
return T(e2, /(.+)-inline(.+)/, c2 + "$1$2") + e2;
|
|
case 8116:
|
|
case 7059:
|
|
case 5753:
|
|
case 5535:
|
|
case 5445:
|
|
case 5701:
|
|
case 4933:
|
|
case 4677:
|
|
case 5533:
|
|
case 5789:
|
|
case 5021:
|
|
case 4765:
|
|
if (M2(e2) - 1 - t3 > 6)
|
|
switch (O2(e2, t3 + 1)) {
|
|
case 109:
|
|
if (O2(e2, t3 + 4) !== 45)
|
|
break;
|
|
case 102:
|
|
return T(e2, /(.+:)(.+)-([^]+)/, "$1" + c2 + "$2-$3$1" + a2 + (O2(e2, t3 + 3) == 108 ? "$3" : "$2-$3")) + e2;
|
|
case 115:
|
|
return ~A2(e2, "stretch") ? ce(T(e2, "stretch", "fill-available"), t3) + e2 : e2;
|
|
}
|
|
break;
|
|
case 4949:
|
|
if (O2(e2, t3 + 1) !== 115)
|
|
break;
|
|
case 6444:
|
|
switch (O2(e2, M2(e2) - 3 - (~A2(e2, "!important") && 10))) {
|
|
case 107:
|
|
return T(e2, ":", ":" + c2) + e2;
|
|
case 101:
|
|
return T(e2, /(.+:)([^;!]+)(;|!.+)?/, "$1" + c2 + (O2(e2, 14) === 45 ? "inline-" : "") + "box$3$1" + c2 + "$2$3$1" + r3 + "$2box$3") + e2;
|
|
}
|
|
break;
|
|
case 5936:
|
|
switch (O2(e2, t3 + 11)) {
|
|
case 114:
|
|
return c2 + e2 + r3 + T(e2, /[svh]\w+-[tblr]{2}/, "tb") + e2;
|
|
case 108:
|
|
return c2 + e2 + r3 + T(e2, /[svh]\w+-[tblr]{2}/, "tb-rl") + e2;
|
|
case 45:
|
|
return c2 + e2 + r3 + T(e2, /[svh]\w+-[tblr]{2}/, "lr") + e2;
|
|
}
|
|
return c2 + e2 + r3 + e2 + e2;
|
|
}
|
|
return e2;
|
|
}
|
|
function te(e2, r4) {
|
|
var a3 = "";
|
|
var c3 = S2(e2);
|
|
for (var t3 = 0; t3 < c3; t3++)
|
|
a3 += r4(e2[t3], t3, e2, r4) || "";
|
|
return a3;
|
|
}
|
|
function ne(e2, r4, a3, c3) {
|
|
switch (e2.type) {
|
|
case o2:
|
|
case s2:
|
|
return e2.return = e2.return || e2.value;
|
|
case t2:
|
|
return "";
|
|
case b2:
|
|
return e2.return = e2.value + "{" + te(e2.children, c3) + "}";
|
|
case n2:
|
|
e2.value = e2.props.join(",");
|
|
}
|
|
return M2(a3 = te(e2.children, c3)) ? e2.return = e2.value + "{" + a3 + "}" : "";
|
|
}
|
|
function se(e2) {
|
|
var r4 = S2(e2);
|
|
return function(a3, c3, t3, n3) {
|
|
var s3 = "";
|
|
for (var i3 = 0; i3 < r4; i3++)
|
|
s3 += e2[i3](a3, c3, t3, n3) || "";
|
|
return s3;
|
|
};
|
|
}
|
|
function ie(e2) {
|
|
return function(r4) {
|
|
if (!r4.root) {
|
|
if (r4 = r4.return)
|
|
e2(r4);
|
|
}
|
|
};
|
|
}
|
|
function ue(e2, t3, i3, u3) {
|
|
if (e2.length > -1) {
|
|
if (!e2.return)
|
|
switch (e2.type) {
|
|
case s2:
|
|
e2.return = ce(e2.value, e2.length);
|
|
break;
|
|
case b2:
|
|
return te([P2(e2, { value: T(e2.value, "@", "@" + c2) })], u3);
|
|
case n2:
|
|
if (e2.length)
|
|
return z2(e2.props, function(t4) {
|
|
switch (y2(t4, /(::plac\w+|:read-\w+)/)) {
|
|
case ":read-only":
|
|
case ":read-write":
|
|
return te([P2(e2, { props: [T(t4, /:(read-\w+)/, ":" + a2 + "$1")] })], u3);
|
|
case "::placeholder":
|
|
return te([P2(e2, { props: [T(t4, /:(plac\w+)/, ":" + c2 + "input-$1")] }), P2(e2, { props: [T(t4, /:(plac\w+)/, ":" + a2 + "$1")] }), P2(e2, { props: [T(t4, /:(plac\w+)/, r3 + "input-$1")] })], u3);
|
|
}
|
|
return "";
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function oe(e2) {
|
|
switch (e2.type) {
|
|
case n2:
|
|
e2.props = e2.props.map(function(r4) {
|
|
return z2(Y2(r4), function(r5, a3, c3) {
|
|
switch (O2(r5, 0)) {
|
|
case 12:
|
|
return C(r5, 1, M2(r5));
|
|
case 0:
|
|
case 40:
|
|
case 43:
|
|
case 62:
|
|
case 126:
|
|
return r5;
|
|
case 58:
|
|
if (c3[++a3] === "global")
|
|
c3[a3] = "", c3[++a3] = "\f" + C(c3[a3], a3 = 1, -1);
|
|
case 32:
|
|
return a3 === 1 ? "" : r5;
|
|
default:
|
|
switch (a3) {
|
|
case 0:
|
|
e2 = r5;
|
|
return S2(c3) > 1 ? "" : r5;
|
|
case (a3 = S2(c3) - 1):
|
|
case 2:
|
|
return a3 === 2 ? r5 + e2 + e2 : r5 + e2;
|
|
default:
|
|
return r5;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
e.CHARSET = f2;
|
|
e.COMMENT = t2;
|
|
e.COUNTER_STYLE = m2;
|
|
e.DECLARATION = s2;
|
|
e.DOCUMENT = p2;
|
|
e.FONT_FACE = d2;
|
|
e.FONT_FEATURE_VALUES = w2;
|
|
e.IMPORT = o2;
|
|
e.KEYFRAMES = b2;
|
|
e.MEDIA = u2;
|
|
e.MOZ = a2;
|
|
e.MS = r3;
|
|
e.NAMESPACE = v2;
|
|
e.PAGE = i2;
|
|
e.RULESET = n2;
|
|
e.SUPPORTS = h2;
|
|
e.VIEWPORT = l2;
|
|
e.WEBKIT = c2;
|
|
e.abs = k2;
|
|
e.alloc = K;
|
|
e.append = R2;
|
|
e.assign = g2;
|
|
e.caret = I2;
|
|
e.char = j2;
|
|
e.charat = O2;
|
|
e.combine = z2;
|
|
e.comment = re;
|
|
e.commenter = q2;
|
|
e.compile = Q2;
|
|
e.copy = P2;
|
|
e.dealloc = V;
|
|
e.declaration = ae;
|
|
e.delimit = W2;
|
|
e.delimiter = Z2;
|
|
e.escaping = H2;
|
|
e.from = $;
|
|
e.hash = x2;
|
|
e.identifier = J;
|
|
e.indexof = A2;
|
|
e.match = y2;
|
|
e.middleware = se;
|
|
e.namespace = oe;
|
|
e.next = _3;
|
|
e.node = N2;
|
|
e.parse = X2;
|
|
e.peek = F2;
|
|
e.prefix = ce;
|
|
e.prefixer = ue;
|
|
e.prev = U2;
|
|
e.replace = T;
|
|
e.ruleset = ee;
|
|
e.rulesheet = ie;
|
|
e.serialize = te;
|
|
e.sizeof = S2;
|
|
e.slice = L2;
|
|
e.stringify = ne;
|
|
e.strlen = M2;
|
|
e.substr = C;
|
|
e.token = D2;
|
|
e.tokenize = Y2;
|
|
e.tokenizer = G2;
|
|
e.trim = E2;
|
|
e.whitespace = B2;
|
|
Object.defineProperty(e, "__esModule", { value: true });
|
|
});
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.dev.js
|
|
var require_emotion_weak_memoize_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var weakMemoize = function weakMemoize2(func) {
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
return function(arg) {
|
|
if (cache.has(arg)) {
|
|
return cache.get(arg);
|
|
}
|
|
var ret = func(arg);
|
|
cache.set(arg, ret);
|
|
return ret;
|
|
};
|
|
};
|
|
exports.default = weakMemoize;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js
|
|
var require_emotion_weak_memoize_cjs = __commonJS({
|
|
"node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_weak_memoize_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js
|
|
var require_emotion_cache_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/cache/dist/emotion-cache.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var sheet = require_emotion_sheet_cjs();
|
|
var stylis = require_stylis();
|
|
var weakMemoize = require_emotion_weak_memoize_cjs();
|
|
var memoize2 = require_emotion_memoize_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var weakMemoize__default = /* @__PURE__ */ _interopDefault(weakMemoize);
|
|
var memoize__default = /* @__PURE__ */ _interopDefault(memoize2);
|
|
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
|
|
var previous = 0;
|
|
var character = 0;
|
|
while (true) {
|
|
previous = character;
|
|
character = stylis.peek();
|
|
if (previous === 38 && character === 12) {
|
|
points[index] = 1;
|
|
}
|
|
if (stylis.token(character)) {
|
|
break;
|
|
}
|
|
stylis.next();
|
|
}
|
|
return stylis.slice(begin, stylis.position);
|
|
};
|
|
var toRules = function toRules2(parsed, points) {
|
|
var index = -1;
|
|
var character = 44;
|
|
do {
|
|
switch (stylis.token(character)) {
|
|
case 0:
|
|
if (character === 38 && stylis.peek() === 12) {
|
|
points[index] = 1;
|
|
}
|
|
parsed[index] += identifierWithPointTracking(stylis.position - 1, points, index);
|
|
break;
|
|
case 2:
|
|
parsed[index] += stylis.delimit(character);
|
|
break;
|
|
case 4:
|
|
if (character === 44) {
|
|
parsed[++index] = stylis.peek() === 58 ? "&\f" : "";
|
|
points[index] = parsed[index].length;
|
|
break;
|
|
}
|
|
default:
|
|
parsed[index] += stylis.from(character);
|
|
}
|
|
} while (character = stylis.next());
|
|
return parsed;
|
|
};
|
|
var getRules = function getRules2(value, points) {
|
|
return stylis.dealloc(toRules(stylis.alloc(value), points));
|
|
};
|
|
var fixedElements = /* @__PURE__ */ new WeakMap();
|
|
var compat = function compat2(element) {
|
|
if (element.type !== "rule" || !element.parent || element.length < 1) {
|
|
return;
|
|
}
|
|
var value = element.value, parent = element.parent;
|
|
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
while (parent.type !== "rule") {
|
|
parent = parent.parent;
|
|
if (!parent)
|
|
return;
|
|
}
|
|
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
|
|
return;
|
|
}
|
|
if (isImplicitRule) {
|
|
return;
|
|
}
|
|
fixedElements.set(element, true);
|
|
var points = [];
|
|
var rules = getRules(value, points);
|
|
var parentRules = parent.props;
|
|
for (var i2 = 0, k2 = 0; i2 < rules.length; i2++) {
|
|
for (var j2 = 0; j2 < parentRules.length; j2++, k2++) {
|
|
element.props[k2] = points[i2] ? rules[i2].replace(/&\f/g, parentRules[j2]) : parentRules[j2] + " " + rules[i2];
|
|
}
|
|
}
|
|
};
|
|
var removeLabel = function removeLabel2(element) {
|
|
if (element.type === "decl") {
|
|
var value = element.value;
|
|
if (value.charCodeAt(0) === 108 && value.charCodeAt(2) === 98) {
|
|
element["return"] = "";
|
|
element.value = "";
|
|
}
|
|
}
|
|
};
|
|
var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
|
|
var isIgnoringComment = function isIgnoringComment2(element) {
|
|
return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1;
|
|
};
|
|
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache) {
|
|
return function(element, index, children) {
|
|
if (element.type !== "rule" || cache.compat)
|
|
return;
|
|
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
if (unsafePseudoClasses) {
|
|
var isNested = element.parent === children[0];
|
|
var commentContainer = isNested ? children[0].children : children;
|
|
for (var i2 = commentContainer.length - 1; i2 >= 0; i2--) {
|
|
var node = commentContainer[i2];
|
|
if (node.line < element.line) {
|
|
break;
|
|
}
|
|
if (node.column < element.column) {
|
|
if (isIgnoringComment(node)) {
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
|
|
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
|
|
});
|
|
}
|
|
};
|
|
};
|
|
var isImportRule = function isImportRule2(element) {
|
|
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
};
|
|
var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index, children) {
|
|
for (var i2 = index - 1; i2 >= 0; i2--) {
|
|
if (!isImportRule(children[i2])) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
var nullifyElement = function nullifyElement2(element) {
|
|
element.type = "";
|
|
element.value = "";
|
|
element["return"] = "";
|
|
element.children = "";
|
|
element.props = "";
|
|
};
|
|
var incorrectImportAlarm = function incorrectImportAlarm2(element, index, children) {
|
|
if (!isImportRule(element)) {
|
|
return;
|
|
}
|
|
if (element.parent) {
|
|
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
nullifyElement(element);
|
|
} else if (isPrependedWithRegularRules(index, children)) {
|
|
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
nullifyElement(element);
|
|
}
|
|
};
|
|
var isBrowser = typeof document !== "undefined";
|
|
var getServerStylisCache = isBrowser ? void 0 : weakMemoize__default["default"](function() {
|
|
return memoize__default["default"](function() {
|
|
var cache = {};
|
|
return function(name) {
|
|
return cache[name];
|
|
};
|
|
});
|
|
});
|
|
var defaultStylisPlugins = [stylis.prefixer];
|
|
var createCache = function createCache2(options) {
|
|
var key = options.key;
|
|
if (!key) {
|
|
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
}
|
|
if (isBrowser && key === "css") {
|
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
Array.prototype.forEach.call(ssrStyles, function(node) {
|
|
var dataEmotionAttribute = node.getAttribute("data-emotion");
|
|
if (dataEmotionAttribute.indexOf(" ") === -1) {
|
|
return;
|
|
}
|
|
document.head.appendChild(node);
|
|
node.setAttribute("data-s", "");
|
|
});
|
|
}
|
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
if (true) {
|
|
if (/[^a-z-]/.test(key)) {
|
|
throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
|
|
}
|
|
}
|
|
var inserted = {};
|
|
var container;
|
|
var nodesToHydrate = [];
|
|
if (isBrowser) {
|
|
container = options.container || document.head;
|
|
Array.prototype.forEach.call(
|
|
document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
|
|
function(node) {
|
|
var attrib = node.getAttribute("data-emotion").split(" ");
|
|
for (var i2 = 1; i2 < attrib.length; i2++) {
|
|
inserted[attrib[i2]] = true;
|
|
}
|
|
nodesToHydrate.push(node);
|
|
}
|
|
);
|
|
}
|
|
var _insert;
|
|
var omnipresentPlugins = [compat, removeLabel];
|
|
if (true) {
|
|
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
get compat() {
|
|
return cache.compat;
|
|
}
|
|
}), incorrectImportAlarm);
|
|
}
|
|
if (isBrowser) {
|
|
var currentSheet;
|
|
var finalizingPlugins = [stylis.stringify, true ? function(element) {
|
|
if (!element.root) {
|
|
if (element["return"]) {
|
|
currentSheet.insert(element["return"]);
|
|
} else if (element.value && element.type !== stylis.COMMENT) {
|
|
currentSheet.insert(element.value + "{}");
|
|
}
|
|
}
|
|
} : stylis.rulesheet(function(rule) {
|
|
currentSheet.insert(rule);
|
|
})];
|
|
var serializer = stylis.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
var stylis$1 = function stylis$12(styles) {
|
|
return stylis.serialize(stylis.compile(styles), serializer);
|
|
};
|
|
_insert = function insert(selector, serialized, sheet2, shouldCache) {
|
|
currentSheet = sheet2;
|
|
if (serialized.map !== void 0) {
|
|
currentSheet = {
|
|
insert: function insert2(rule) {
|
|
sheet2.insert(rule + serialized.map);
|
|
}
|
|
};
|
|
}
|
|
stylis$1(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
if (shouldCache) {
|
|
cache.inserted[serialized.name] = true;
|
|
}
|
|
};
|
|
} else {
|
|
var _finalizingPlugins = [stylis.stringify];
|
|
var _serializer = stylis.middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
|
|
var _stylis = function _stylis2(styles) {
|
|
return stylis.serialize(stylis.compile(styles), _serializer);
|
|
};
|
|
var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
|
|
var getRules2 = function getRules3(selector, serialized) {
|
|
var name = serialized.name;
|
|
if (serverStylisCache[name] === void 0) {
|
|
serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
}
|
|
return serverStylisCache[name];
|
|
};
|
|
_insert = function _insert2(selector, serialized, sheet2, shouldCache) {
|
|
var name = serialized.name;
|
|
var rules = getRules2(selector, serialized);
|
|
if (cache.compat === void 0) {
|
|
if (shouldCache) {
|
|
cache.inserted[name] = true;
|
|
}
|
|
if (serialized.map !== void 0) {
|
|
return rules + serialized.map;
|
|
}
|
|
return rules;
|
|
} else {
|
|
if (shouldCache) {
|
|
cache.inserted[name] = rules;
|
|
} else {
|
|
return rules;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var cache = {
|
|
key,
|
|
sheet: new sheet.StyleSheet({
|
|
key,
|
|
container,
|
|
nonce: options.nonce,
|
|
speedy: options.speedy,
|
|
prepend: options.prepend,
|
|
insertionPoint: options.insertionPoint
|
|
}),
|
|
nonce: options.nonce,
|
|
inserted,
|
|
registered: {},
|
|
insert: _insert
|
|
};
|
|
cache.sheet.hydrate(nodesToHydrate);
|
|
return cache;
|
|
};
|
|
exports.default = createCache;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/cache/dist/emotion-cache.cjs.js
|
|
var require_emotion_cache_cjs = __commonJS({
|
|
"node_modules/@emotion/cache/dist/emotion-cache.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_cache_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js
|
|
var require_react_is_development3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(function() {
|
|
"use strict";
|
|
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
function isValidElementType2(type) {
|
|
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
}
|
|
function typeOf(object) {
|
|
if (typeof object === "object" && object !== null) {
|
|
var $$typeof = object.$$typeof;
|
|
switch ($$typeof) {
|
|
case REACT_ELEMENT_TYPE:
|
|
var type = object.type;
|
|
switch (type) {
|
|
case REACT_ASYNC_MODE_TYPE:
|
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
case REACT_FRAGMENT_TYPE:
|
|
case REACT_PROFILER_TYPE:
|
|
case REACT_STRICT_MODE_TYPE:
|
|
case REACT_SUSPENSE_TYPE:
|
|
return type;
|
|
default:
|
|
var $$typeofType = type && type.$$typeof;
|
|
switch ($$typeofType) {
|
|
case REACT_CONTEXT_TYPE:
|
|
case REACT_FORWARD_REF_TYPE:
|
|
case REACT_LAZY_TYPE:
|
|
case REACT_MEMO_TYPE:
|
|
case REACT_PROVIDER_TYPE:
|
|
return $$typeofType;
|
|
default:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
case REACT_PORTAL_TYPE:
|
|
return $$typeof;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
var Element3 = REACT_ELEMENT_TYPE;
|
|
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
var Fragment6 = REACT_FRAGMENT_TYPE;
|
|
var Lazy = REACT_LAZY_TYPE;
|
|
var Memo2 = REACT_MEMO_TYPE;
|
|
var Portal = REACT_PORTAL_TYPE;
|
|
var Profiler = REACT_PROFILER_TYPE;
|
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
var Suspense = REACT_SUSPENSE_TYPE;
|
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
function isAsyncMode(object) {
|
|
{
|
|
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
}
|
|
}
|
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
}
|
|
function isConcurrentMode(object) {
|
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
}
|
|
function isContextConsumer2(object) {
|
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
}
|
|
function isContextProvider(object) {
|
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
}
|
|
function isElement(object) {
|
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
}
|
|
function isForwardRef(object) {
|
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
}
|
|
function isFragment(object) {
|
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
}
|
|
function isLazy(object) {
|
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
}
|
|
function isMemo(object) {
|
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
}
|
|
function isPortal(object) {
|
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
}
|
|
function isProfiler(object) {
|
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
}
|
|
function isStrictMode(object) {
|
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
}
|
|
function isSuspense(object) {
|
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
}
|
|
exports.AsyncMode = AsyncMode;
|
|
exports.ConcurrentMode = ConcurrentMode;
|
|
exports.ContextConsumer = ContextConsumer;
|
|
exports.ContextProvider = ContextProvider;
|
|
exports.Element = Element3;
|
|
exports.ForwardRef = ForwardRef2;
|
|
exports.Fragment = Fragment6;
|
|
exports.Lazy = Lazy;
|
|
exports.Memo = Memo2;
|
|
exports.Portal = Portal;
|
|
exports.Profiler = Profiler;
|
|
exports.StrictMode = StrictMode;
|
|
exports.Suspense = Suspense;
|
|
exports.isAsyncMode = isAsyncMode;
|
|
exports.isConcurrentMode = isConcurrentMode;
|
|
exports.isContextConsumer = isContextConsumer2;
|
|
exports.isContextProvider = isContextProvider;
|
|
exports.isElement = isElement;
|
|
exports.isForwardRef = isForwardRef;
|
|
exports.isFragment = isFragment;
|
|
exports.isLazy = isLazy;
|
|
exports.isMemo = isMemo;
|
|
exports.isPortal = isPortal;
|
|
exports.isProfiler = isProfiler;
|
|
exports.isStrictMode = isStrictMode;
|
|
exports.isSuspense = isSuspense;
|
|
exports.isValidElementType = isValidElementType2;
|
|
exports.typeOf = typeOf;
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/node_modules/react-is/index.js
|
|
var require_react_is3 = __commonJS({
|
|
"node_modules/hoist-non-react-statics/node_modules/react-is/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_react_is_development3();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
var require_hoist_non_react_statics_cjs = __commonJS({
|
|
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
var reactIs = require_react_is3();
|
|
var REACT_STATICS = {
|
|
childContextTypes: true,
|
|
contextType: true,
|
|
contextTypes: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
getDefaultProps: true,
|
|
getDerivedStateFromError: true,
|
|
getDerivedStateFromProps: true,
|
|
mixins: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var KNOWN_STATICS = {
|
|
name: true,
|
|
length: true,
|
|
prototype: true,
|
|
caller: true,
|
|
callee: true,
|
|
arguments: true,
|
|
arity: true
|
|
};
|
|
var FORWARD_REF_STATICS = {
|
|
"$$typeof": true,
|
|
render: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true
|
|
};
|
|
var MEMO_STATICS = {
|
|
"$$typeof": true,
|
|
compare: true,
|
|
defaultProps: true,
|
|
displayName: true,
|
|
propTypes: true,
|
|
type: true
|
|
};
|
|
var TYPE_STATICS = {};
|
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
function getStatics(component) {
|
|
if (reactIs.isMemo(component)) {
|
|
return MEMO_STATICS;
|
|
}
|
|
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
|
|
}
|
|
var defineProperty = Object.defineProperty;
|
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
var objectPrototype = Object.prototype;
|
|
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
if (typeof sourceComponent !== "string") {
|
|
if (objectPrototype) {
|
|
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
}
|
|
}
|
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
if (getOwnPropertySymbols) {
|
|
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
}
|
|
var targetStatics = getStatics(targetComponent);
|
|
var sourceStatics = getStatics(sourceComponent);
|
|
for (var i2 = 0; i2 < keys.length; ++i2) {
|
|
var key = keys[i2];
|
|
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
try {
|
|
defineProperty(targetComponent, key, descriptor);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return targetComponent;
|
|
}
|
|
module2.exports = hoistNonReactStatics;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.dev.js
|
|
var require_emotion_react_isolated_hnrs_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var hoistNonReactStatics$1 = require_hoist_non_react_statics_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var hoistNonReactStatics__default = /* @__PURE__ */ _interopDefault(hoistNonReactStatics$1);
|
|
var hoistNonReactStatics = function(targetComponent, sourceComponent) {
|
|
return hoistNonReactStatics__default["default"](targetComponent, sourceComponent);
|
|
};
|
|
exports.default = hoistNonReactStatics;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/utils/dist/emotion-utils.cjs.dev.js
|
|
var require_emotion_utils_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/utils/dist/emotion-utils.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var isBrowser = typeof document !== "undefined";
|
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
var rawClassName = "";
|
|
classNames.split(" ").forEach(function(className) {
|
|
if (registered[className] !== void 0) {
|
|
registeredStyles.push(registered[className] + ";");
|
|
} else {
|
|
rawClassName += className + " ";
|
|
}
|
|
});
|
|
return rawClassName;
|
|
}
|
|
var registerStyles = function registerStyles2(cache, serialized, isStringTag2) {
|
|
var className = cache.key + "-" + serialized.name;
|
|
if ((isStringTag2 === false || isBrowser === false && cache.compat !== void 0) && cache.registered[className] === void 0) {
|
|
cache.registered[className] = serialized.styles;
|
|
}
|
|
};
|
|
var insertStyles = function insertStyles2(cache, serialized, isStringTag2) {
|
|
registerStyles(cache, serialized, isStringTag2);
|
|
var className = cache.key + "-" + serialized.name;
|
|
if (cache.inserted[serialized.name] === void 0) {
|
|
var stylesForSSR = "";
|
|
var current = serialized;
|
|
do {
|
|
var maybeStyles = cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
|
|
if (!isBrowser && maybeStyles !== void 0) {
|
|
stylesForSSR += maybeStyles;
|
|
}
|
|
current = current.next;
|
|
} while (current !== void 0);
|
|
if (!isBrowser && stylesForSSR.length !== 0) {
|
|
return stylesForSSR;
|
|
}
|
|
}
|
|
};
|
|
exports.getRegisteredStyles = getRegisteredStyles;
|
|
exports.insertStyles = insertStyles;
|
|
exports.registerStyles = registerStyles;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/utils/dist/emotion-utils.cjs.js
|
|
var require_emotion_utils_cjs = __commonJS({
|
|
"node_modules/@emotion/utils/dist/emotion-utils.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_utils_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/hash/dist/emotion-hash.cjs.dev.js
|
|
var require_emotion_hash_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/hash/dist/emotion-hash.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
function murmur2(str) {
|
|
var h2 = 0;
|
|
var k2, i2 = 0, len = str.length;
|
|
for (; len >= 4; ++i2, len -= 4) {
|
|
k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24;
|
|
k2 = (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
|
|
k2 ^= k2 >>> 24;
|
|
h2 = (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
|
|
}
|
|
switch (len) {
|
|
case 3:
|
|
h2 ^= (str.charCodeAt(i2 + 2) & 255) << 16;
|
|
case 2:
|
|
h2 ^= (str.charCodeAt(i2 + 1) & 255) << 8;
|
|
case 1:
|
|
h2 ^= str.charCodeAt(i2) & 255;
|
|
h2 = (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
|
|
}
|
|
h2 ^= h2 >>> 13;
|
|
h2 = (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
|
|
return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
|
|
}
|
|
exports.default = murmur2;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/hash/dist/emotion-hash.cjs.js
|
|
var require_emotion_hash_cjs = __commonJS({
|
|
"node_modules/@emotion/hash/dist/emotion-hash.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_hash_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/unitless/dist/emotion-unitless.cjs.dev.js
|
|
var require_emotion_unitless_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/unitless/dist/emotion-unitless.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var unitlessKeys = {
|
|
animationIterationCount: 1,
|
|
borderImageOutset: 1,
|
|
borderImageSlice: 1,
|
|
borderImageWidth: 1,
|
|
boxFlex: 1,
|
|
boxFlexGroup: 1,
|
|
boxOrdinalGroup: 1,
|
|
columnCount: 1,
|
|
columns: 1,
|
|
flex: 1,
|
|
flexGrow: 1,
|
|
flexPositive: 1,
|
|
flexShrink: 1,
|
|
flexNegative: 1,
|
|
flexOrder: 1,
|
|
gridRow: 1,
|
|
gridRowEnd: 1,
|
|
gridRowSpan: 1,
|
|
gridRowStart: 1,
|
|
gridColumn: 1,
|
|
gridColumnEnd: 1,
|
|
gridColumnSpan: 1,
|
|
gridColumnStart: 1,
|
|
msGridRow: 1,
|
|
msGridRowSpan: 1,
|
|
msGridColumn: 1,
|
|
msGridColumnSpan: 1,
|
|
fontWeight: 1,
|
|
lineHeight: 1,
|
|
opacity: 1,
|
|
order: 1,
|
|
orphans: 1,
|
|
tabSize: 1,
|
|
widows: 1,
|
|
zIndex: 1,
|
|
zoom: 1,
|
|
WebkitLineClamp: 1,
|
|
fillOpacity: 1,
|
|
floodOpacity: 1,
|
|
stopOpacity: 1,
|
|
strokeDasharray: 1,
|
|
strokeDashoffset: 1,
|
|
strokeMiterlimit: 1,
|
|
strokeOpacity: 1,
|
|
strokeWidth: 1
|
|
};
|
|
exports.default = unitlessKeys;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/unitless/dist/emotion-unitless.cjs.js
|
|
var require_emotion_unitless_cjs = __commonJS({
|
|
"node_modules/@emotion/unitless/dist/emotion-unitless.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_unitless_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/serialize/dist/emotion-serialize.cjs.dev.js
|
|
var require_emotion_serialize_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/serialize/dist/emotion-serialize.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var hashString = require_emotion_hash_cjs();
|
|
var unitless = require_emotion_unitless_cjs();
|
|
var memoize2 = require_emotion_memoize_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var hashString__default = /* @__PURE__ */ _interopDefault(hashString);
|
|
var unitless__default = /* @__PURE__ */ _interopDefault(unitless);
|
|
var memoize__default = /* @__PURE__ */ _interopDefault(memoize2);
|
|
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
|
|
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
You can read more about this here:
|
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
var isCustomProperty = function isCustomProperty2(property) {
|
|
return property.charCodeAt(1) === 45;
|
|
};
|
|
var isProcessableValue = function isProcessableValue2(value) {
|
|
return value != null && typeof value !== "boolean";
|
|
};
|
|
var processStyleName = /* @__PURE__ */ memoize__default["default"](function(styleName) {
|
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
});
|
|
var processStyleValue = function processStyleValue2(key, value) {
|
|
switch (key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
if (typeof value === "string") {
|
|
return value.replace(animationRegex, function(match, p1, p2) {
|
|
cursor = {
|
|
name: p1,
|
|
styles: p2,
|
|
next: cursor
|
|
};
|
|
return p1;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
if (unitless__default["default"][key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
|
|
return value + "px";
|
|
}
|
|
return value;
|
|
};
|
|
if (true) {
|
|
contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
contentValues = ["normal", "none", "initial", "inherit", "unset"];
|
|
oldProcessStyleValue = processStyleValue;
|
|
msPattern = /^-ms-/;
|
|
hyphenPattern = /-(.)/g;
|
|
hyphenatedCache = {};
|
|
processStyleValue = function processStyleValue2(key, value) {
|
|
if (key === "content") {
|
|
if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
}
|
|
}
|
|
var processed = oldProcessStyleValue(key, value);
|
|
if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
|
|
hyphenatedCache[key] = true;
|
|
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
|
|
return _char.toUpperCase();
|
|
}) + "?");
|
|
}
|
|
return processed;
|
|
};
|
|
}
|
|
var contentValuePattern;
|
|
var contentValues;
|
|
var oldProcessStyleValue;
|
|
var msPattern;
|
|
var hyphenPattern;
|
|
var hyphenatedCache;
|
|
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
|
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
if (interpolation == null) {
|
|
return "";
|
|
}
|
|
if (interpolation.__emotion_styles !== void 0) {
|
|
if (interpolation.toString() === "NO_COMPONENT_SELECTOR") {
|
|
throw new Error(noComponentSelectorMessage);
|
|
}
|
|
return interpolation;
|
|
}
|
|
switch (typeof interpolation) {
|
|
case "boolean": {
|
|
return "";
|
|
}
|
|
case "object": {
|
|
if (interpolation.anim === 1) {
|
|
cursor = {
|
|
name: interpolation.name,
|
|
styles: interpolation.styles,
|
|
next: cursor
|
|
};
|
|
return interpolation.name;
|
|
}
|
|
if (interpolation.styles !== void 0) {
|
|
var next = interpolation.next;
|
|
if (next !== void 0) {
|
|
while (next !== void 0) {
|
|
cursor = {
|
|
name: next.name,
|
|
styles: next.styles,
|
|
next: cursor
|
|
};
|
|
next = next.next;
|
|
}
|
|
}
|
|
var styles = interpolation.styles + ";";
|
|
if (interpolation.map !== void 0) {
|
|
styles += interpolation.map;
|
|
}
|
|
return styles;
|
|
}
|
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
}
|
|
case "function": {
|
|
if (mergedProps !== void 0) {
|
|
var previousCursor = cursor;
|
|
var result = interpolation(mergedProps);
|
|
cursor = previousCursor;
|
|
return handleInterpolation(mergedProps, registered, result);
|
|
} else if (true) {
|
|
console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
|
|
}
|
|
break;
|
|
}
|
|
case "string":
|
|
if (true) {
|
|
var matched = [];
|
|
var replaced = interpolation.replace(animationRegex, function(match, p1, p2) {
|
|
var fakeVarName = "animation" + matched.length;
|
|
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
|
|
return "${" + fakeVarName + "}";
|
|
});
|
|
if (matched.length) {
|
|
console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\n" + ("css`" + replaced + "`"));
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
if (registered == null) {
|
|
return interpolation;
|
|
}
|
|
var cached = registered[interpolation];
|
|
return cached !== void 0 ? cached : interpolation;
|
|
}
|
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
var string = "";
|
|
if (Array.isArray(obj)) {
|
|
for (var i2 = 0; i2 < obj.length; i2++) {
|
|
string += handleInterpolation(mergedProps, registered, obj[i2]) + ";";
|
|
}
|
|
} else {
|
|
for (var _key in obj) {
|
|
var value = obj[_key];
|
|
if (typeof value !== "object") {
|
|
if (registered != null && registered[value] !== void 0) {
|
|
string += _key + "{" + registered[value] + "}";
|
|
} else if (isProcessableValue(value)) {
|
|
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
}
|
|
} else {
|
|
if (_key === "NO_COMPONENT_SELECTOR" && true) {
|
|
throw new Error(noComponentSelectorMessage);
|
|
}
|
|
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
for (var _i = 0; _i < value.length; _i++) {
|
|
if (isProcessableValue(value[_i])) {
|
|
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
}
|
|
}
|
|
} else {
|
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
switch (_key) {
|
|
case "animation":
|
|
case "animationName": {
|
|
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
break;
|
|
}
|
|
default: {
|
|
if (_key === "undefined") {
|
|
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
}
|
|
string += _key + "{" + interpolated + "}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return string;
|
|
}
|
|
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
var sourceMapPattern;
|
|
if (true) {
|
|
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
}
|
|
var cursor;
|
|
var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
|
|
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
return args[0];
|
|
}
|
|
var stringMode = true;
|
|
var styles = "";
|
|
cursor = void 0;
|
|
var strings = args[0];
|
|
if (strings == null || strings.raw === void 0) {
|
|
stringMode = false;
|
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
} else {
|
|
if (strings[0] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles += strings[0];
|
|
}
|
|
for (var i2 = 1; i2 < args.length; i2++) {
|
|
styles += handleInterpolation(mergedProps, registered, args[i2]);
|
|
if (stringMode) {
|
|
if (strings[i2] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles += strings[i2];
|
|
}
|
|
}
|
|
var sourceMap;
|
|
if (true) {
|
|
styles = styles.replace(sourceMapPattern, function(match2) {
|
|
sourceMap = match2;
|
|
return "";
|
|
});
|
|
}
|
|
labelPattern.lastIndex = 0;
|
|
var identifierName = "";
|
|
var match;
|
|
while ((match = labelPattern.exec(styles)) !== null) {
|
|
identifierName += "-" + match[1];
|
|
}
|
|
var name = hashString__default["default"](styles) + identifierName;
|
|
if (true) {
|
|
return {
|
|
name,
|
|
styles,
|
|
map: sourceMap,
|
|
next: cursor,
|
|
toString: function toString() {
|
|
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
}
|
|
};
|
|
}
|
|
return {
|
|
name,
|
|
styles,
|
|
next: cursor
|
|
};
|
|
};
|
|
exports.serializeStyles = serializeStyles;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/serialize/dist/emotion-serialize.cjs.js
|
|
var require_emotion_serialize_cjs = __commonJS({
|
|
"node_modules/@emotion/serialize/dist/emotion-serialize.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_serialize_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.dev.js
|
|
var require_emotion_use_insertion_effect_with_fallbacks_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var React11 = require_react();
|
|
function _interopNamespace(e) {
|
|
if (e && e.__esModule)
|
|
return e;
|
|
var n2 = /* @__PURE__ */ Object.create(null);
|
|
if (e) {
|
|
Object.keys(e).forEach(function(k2) {
|
|
if (k2 !== "default") {
|
|
var d2 = Object.getOwnPropertyDescriptor(e, k2);
|
|
Object.defineProperty(n2, k2, d2.get ? d2 : {
|
|
enumerable: true,
|
|
get: function() {
|
|
return e[k2];
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
n2["default"] = e;
|
|
return Object.freeze(n2);
|
|
}
|
|
var React__namespace = /* @__PURE__ */ _interopNamespace(React11);
|
|
var isBrowser = typeof document !== "undefined";
|
|
var syncFallback = function syncFallback2(create) {
|
|
return create();
|
|
};
|
|
var useInsertionEffect = React__namespace["useInsertionEffect"] ? React__namespace["useInsertionEffect"] : false;
|
|
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;
|
|
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React11.useLayoutEffect;
|
|
exports.useInsertionEffectAlwaysWithSyncFallback = useInsertionEffectAlwaysWithSyncFallback;
|
|
exports.useInsertionEffectWithLayoutFallback = useInsertionEffectWithLayoutFallback;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.js
|
|
var require_emotion_use_insertion_effect_with_fallbacks_cjs = __commonJS({
|
|
"node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_use_insertion_effect_with_fallbacks_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js
|
|
var require_emotion_element_b63ca7c6_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/react/dist/emotion-element-b63ca7c6.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
var React11 = require_react();
|
|
var createCache = require_emotion_cache_cjs();
|
|
var _extends2 = require_extends();
|
|
var weakMemoize = require_emotion_weak_memoize_cjs();
|
|
var _isolatedHnrs_dist_emotionReact_isolatedHnrs = require_emotion_react_isolated_hnrs_cjs_dev();
|
|
var utils = require_emotion_utils_cjs();
|
|
var serialize = require_emotion_serialize_cjs();
|
|
var useInsertionEffectWithFallbacks = require_emotion_use_insertion_effect_with_fallbacks_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var createCache__default = /* @__PURE__ */ _interopDefault(createCache);
|
|
var weakMemoize__default = /* @__PURE__ */ _interopDefault(weakMemoize);
|
|
var isBrowser = typeof document !== "undefined";
|
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
var EmotionCacheContext = /* @__PURE__ */ React11.createContext(
|
|
typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache__default["default"]({
|
|
key: "css"
|
|
}) : null
|
|
);
|
|
if (true) {
|
|
EmotionCacheContext.displayName = "EmotionCacheContext";
|
|
}
|
|
var CacheProvider = EmotionCacheContext.Provider;
|
|
var __unsafe_useEmotionCache = function useEmotionCache() {
|
|
return React11.useContext(EmotionCacheContext);
|
|
};
|
|
exports.withEmotionCache = function withEmotionCache(func) {
|
|
return /* @__PURE__ */ React11.forwardRef(function(props, ref) {
|
|
var cache = React11.useContext(EmotionCacheContext);
|
|
return func(props, cache, ref);
|
|
});
|
|
};
|
|
if (!isBrowser) {
|
|
exports.withEmotionCache = function withEmotionCache(func) {
|
|
return function(props) {
|
|
var cache = React11.useContext(EmotionCacheContext);
|
|
if (cache === null) {
|
|
cache = createCache__default["default"]({
|
|
key: "css"
|
|
});
|
|
return /* @__PURE__ */ React11.createElement(EmotionCacheContext.Provider, {
|
|
value: cache
|
|
}, func(props, cache));
|
|
} else {
|
|
return func(props, cache);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
var ThemeContext2 = /* @__PURE__ */ React11.createContext({});
|
|
if (true) {
|
|
ThemeContext2.displayName = "EmotionThemeContext";
|
|
}
|
|
var useTheme4 = function useTheme5() {
|
|
return React11.useContext(ThemeContext2);
|
|
};
|
|
var getTheme = function getTheme2(outerTheme, theme) {
|
|
if (typeof theme === "function") {
|
|
var mergedTheme = theme(outerTheme);
|
|
if (mergedTheme == null || typeof mergedTheme !== "object" || Array.isArray(mergedTheme)) {
|
|
throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");
|
|
}
|
|
return mergedTheme;
|
|
}
|
|
if (theme == null || typeof theme !== "object" || Array.isArray(theme)) {
|
|
throw new Error("[ThemeProvider] Please make your theme prop a plain object");
|
|
}
|
|
return _extends2({}, outerTheme, theme);
|
|
};
|
|
var createCacheWithTheme = /* @__PURE__ */ weakMemoize__default["default"](function(outerTheme) {
|
|
return weakMemoize__default["default"](function(theme) {
|
|
return getTheme(outerTheme, theme);
|
|
});
|
|
});
|
|
var ThemeProvider = function ThemeProvider2(props) {
|
|
var theme = React11.useContext(ThemeContext2);
|
|
if (props.theme !== theme) {
|
|
theme = createCacheWithTheme(theme)(props.theme);
|
|
}
|
|
return /* @__PURE__ */ React11.createElement(ThemeContext2.Provider, {
|
|
value: theme
|
|
}, props.children);
|
|
};
|
|
function withTheme(Component) {
|
|
var componentName = Component.displayName || Component.name || "Component";
|
|
var render = function render2(props, ref) {
|
|
var theme = React11.useContext(ThemeContext2);
|
|
return /* @__PURE__ */ React11.createElement(Component, _extends2({
|
|
theme,
|
|
ref
|
|
}, props));
|
|
};
|
|
var WithTheme = /* @__PURE__ */ React11.forwardRef(render);
|
|
WithTheme.displayName = "WithTheme(" + componentName + ")";
|
|
return _isolatedHnrs_dist_emotionReact_isolatedHnrs["default"](WithTheme, Component);
|
|
}
|
|
var getLastPart = function getLastPart2(functionName) {
|
|
var parts = functionName.split(".");
|
|
return parts[parts.length - 1];
|
|
};
|
|
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine2(line) {
|
|
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
if (match)
|
|
return getLastPart(match[1]);
|
|
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
if (match)
|
|
return getLastPart(match[1]);
|
|
return void 0;
|
|
};
|
|
var internalReactFunctionNames = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]);
|
|
var sanitizeIdentifier = function sanitizeIdentifier2(identifier) {
|
|
return identifier.replace(/\$/g, "-");
|
|
};
|
|
var getLabelFromStackTrace = function getLabelFromStackTrace2(stackTrace) {
|
|
if (!stackTrace)
|
|
return void 0;
|
|
var lines = stackTrace.split("\n");
|
|
for (var i2 = 0; i2 < lines.length; i2++) {
|
|
var functionName = getFunctionNameFromStackTraceLine(lines[i2]);
|
|
if (!functionName)
|
|
continue;
|
|
if (internalReactFunctionNames.has(functionName))
|
|
break;
|
|
if (/^[A-Z]/.test(functionName))
|
|
return sanitizeIdentifier(functionName);
|
|
}
|
|
return void 0;
|
|
};
|
|
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
|
|
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
|
|
var createEmotionProps = function createEmotionProps2(type, props) {
|
|
if (typeof props.css === "string" && props.css.indexOf(":") !== -1) {
|
|
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
|
|
}
|
|
var newProps = {};
|
|
for (var key in props) {
|
|
if (hasOwnProperty.call(props, key)) {
|
|
newProps[key] = props[key];
|
|
}
|
|
}
|
|
newProps[typePropName] = type;
|
|
if (!!props.css && (typeof props.css !== "object" || typeof props.css.name !== "string" || props.css.name.indexOf("-") === -1)) {
|
|
var label = getLabelFromStackTrace(new Error().stack);
|
|
if (label)
|
|
newProps[labelPropName] = label;
|
|
}
|
|
return newProps;
|
|
};
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
|
|
utils.registerStyles(cache, serialized, isStringTag2);
|
|
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
return utils.insertStyles(cache, serialized, isStringTag2);
|
|
});
|
|
if (!isBrowser && rules !== void 0) {
|
|
var _ref2;
|
|
var serializedNames = serialized.name;
|
|
var next = serialized.next;
|
|
while (next !== void 0) {
|
|
serializedNames += " " + next.name;
|
|
next = next.next;
|
|
}
|
|
return /* @__PURE__ */ React11.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
__html: rules
|
|
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
}
|
|
return null;
|
|
};
|
|
var Emotion = /* @__PURE__ */ exports.withEmotionCache(function(props, cache, ref) {
|
|
var cssProp = props.css;
|
|
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
|
|
cssProp = cache.registered[cssProp];
|
|
}
|
|
var WrappedComponent = props[typePropName];
|
|
var registeredStyles = [cssProp];
|
|
var className = "";
|
|
if (typeof props.className === "string") {
|
|
className = utils.getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serialize.serializeStyles(registeredStyles, void 0, React11.useContext(ThemeContext2));
|
|
if (serialized.name.indexOf("-") === -1) {
|
|
var labelFromStack = props[labelPropName];
|
|
if (labelFromStack) {
|
|
serialized = serialize.serializeStyles([serialized, "label:" + labelFromStack + ";"]);
|
|
}
|
|
}
|
|
className += cache.key + "-" + serialized.name;
|
|
var newProps = {};
|
|
for (var key in props) {
|
|
if (hasOwnProperty.call(props, key) && key !== "css" && key !== typePropName && key !== labelPropName) {
|
|
newProps[key] = props[key];
|
|
}
|
|
}
|
|
newProps.ref = ref;
|
|
newProps.className = className;
|
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Insertion, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof WrappedComponent === "string"
|
|
}), /* @__PURE__ */ React11.createElement(WrappedComponent, newProps));
|
|
});
|
|
if (true) {
|
|
Emotion.displayName = "EmotionCssPropInternal";
|
|
}
|
|
exports.CacheProvider = CacheProvider;
|
|
exports.Emotion = Emotion;
|
|
exports.ThemeContext = ThemeContext2;
|
|
exports.ThemeProvider = ThemeProvider;
|
|
exports.__unsafe_useEmotionCache = __unsafe_useEmotionCache;
|
|
exports.createEmotionProps = createEmotionProps;
|
|
exports.hasOwnProperty = hasOwnProperty;
|
|
exports.isBrowser = isBrowser;
|
|
exports.useTheme = useTheme4;
|
|
exports.withTheme = withTheme;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/dist/emotion-react.cjs.dev.js
|
|
var require_emotion_react_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/react/dist/emotion-react.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var React11 = require_react();
|
|
require_emotion_cache_cjs();
|
|
var emotionElement = require_emotion_element_b63ca7c6_cjs_dev();
|
|
require_extends();
|
|
require_emotion_weak_memoize_cjs();
|
|
require_hoist_non_react_statics_cjs();
|
|
require_emotion_react_isolated_hnrs_cjs_dev();
|
|
var utils = require_emotion_utils_cjs();
|
|
var serialize = require_emotion_serialize_cjs();
|
|
var useInsertionEffectWithFallbacks = require_emotion_use_insertion_effect_with_fallbacks_cjs();
|
|
var pkg = {
|
|
name: "@emotion/react",
|
|
version: "11.10.4",
|
|
main: "dist/emotion-react.cjs.js",
|
|
module: "dist/emotion-react.esm.js",
|
|
browser: {
|
|
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
|
|
},
|
|
exports: {
|
|
".": {
|
|
module: {
|
|
worker: "./dist/emotion-react.worker.esm.js",
|
|
browser: "./dist/emotion-react.browser.esm.js",
|
|
"default": "./dist/emotion-react.esm.js"
|
|
},
|
|
"default": "./dist/emotion-react.cjs.js"
|
|
},
|
|
"./jsx-runtime": {
|
|
module: {
|
|
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
},
|
|
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
},
|
|
"./_isolated-hnrs": {
|
|
module: {
|
|
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
},
|
|
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
},
|
|
"./jsx-dev-runtime": {
|
|
module: {
|
|
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
},
|
|
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
},
|
|
"./package.json": "./package.json",
|
|
"./types/css-prop": "./types/css-prop.d.ts",
|
|
"./macro": "./macro.js"
|
|
},
|
|
types: "types/index.d.ts",
|
|
files: [
|
|
"src",
|
|
"dist",
|
|
"jsx-runtime",
|
|
"jsx-dev-runtime",
|
|
"_isolated-hnrs",
|
|
"types/*.d.ts",
|
|
"macro.js",
|
|
"macro.d.ts",
|
|
"macro.js.flow"
|
|
],
|
|
sideEffects: false,
|
|
author: "Emotion Contributors",
|
|
license: "MIT",
|
|
scripts: {
|
|
"test:typescript": "dtslint types"
|
|
},
|
|
dependencies: {
|
|
"@babel/runtime": "^7.18.3",
|
|
"@emotion/babel-plugin": "^11.10.0",
|
|
"@emotion/cache": "^11.10.0",
|
|
"@emotion/serialize": "^1.1.0",
|
|
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.0",
|
|
"@emotion/utils": "^1.2.0",
|
|
"@emotion/weak-memoize": "^0.3.0",
|
|
"hoist-non-react-statics": "^3.3.1"
|
|
},
|
|
peerDependencies: {
|
|
"@babel/core": "^7.0.0",
|
|
react: ">=16.8.0"
|
|
},
|
|
peerDependenciesMeta: {
|
|
"@babel/core": {
|
|
optional: true
|
|
},
|
|
"@types/react": {
|
|
optional: true
|
|
}
|
|
},
|
|
devDependencies: {
|
|
"@babel/core": "^7.18.5",
|
|
"@definitelytyped/dtslint": "0.0.112",
|
|
"@emotion/css": "11.10.0",
|
|
"@emotion/css-prettifier": "1.1.0",
|
|
"@emotion/server": "11.10.0",
|
|
"@emotion/styled": "11.10.4",
|
|
"html-tag-names": "^1.1.2",
|
|
react: "16.14.0",
|
|
"svg-tag-names": "^1.1.1",
|
|
typescript: "^4.5.5"
|
|
},
|
|
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
publishConfig: {
|
|
access: "public"
|
|
},
|
|
"umd:main": "dist/emotion-react.umd.min.js",
|
|
preconstruct: {
|
|
entrypoints: [
|
|
"./index.js",
|
|
"./jsx-runtime.js",
|
|
"./jsx-dev-runtime.js",
|
|
"./_isolated-hnrs.js"
|
|
],
|
|
umdName: "emotionReact",
|
|
exports: {
|
|
envConditions: [
|
|
"browser",
|
|
"worker"
|
|
],
|
|
extra: {
|
|
"./types/css-prop": "./types/css-prop.d.ts",
|
|
"./macro": "./macro.js"
|
|
}
|
|
}
|
|
}
|
|
};
|
|
var jsx39 = function jsx40(type, props) {
|
|
var args = arguments;
|
|
if (props == null || !emotionElement.hasOwnProperty.call(props, "css")) {
|
|
return React11.createElement.apply(void 0, args);
|
|
}
|
|
var argsLength = args.length;
|
|
var createElementArgArray = new Array(argsLength);
|
|
createElementArgArray[0] = emotionElement.Emotion;
|
|
createElementArgArray[1] = emotionElement.createEmotionProps(type, props);
|
|
for (var i2 = 2; i2 < argsLength; i2++) {
|
|
createElementArgArray[i2] = args[i2];
|
|
}
|
|
return React11.createElement.apply(null, createElementArgArray);
|
|
};
|
|
var warnedAboutCssPropForGlobal = false;
|
|
var Global = /* @__PURE__ */ emotionElement.withEmotionCache(function(props, cache) {
|
|
if (!warnedAboutCssPropForGlobal && (props.className || props.css)) {
|
|
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
warnedAboutCssPropForGlobal = true;
|
|
}
|
|
var styles = props.styles;
|
|
var serialized = serialize.serializeStyles([styles], void 0, React11.useContext(emotionElement.ThemeContext));
|
|
if (!emotionElement.isBrowser) {
|
|
var _ref;
|
|
var serializedNames = serialized.name;
|
|
var serializedStyles = serialized.styles;
|
|
var next = serialized.next;
|
|
while (next !== void 0) {
|
|
serializedNames += " " + next.name;
|
|
serializedStyles += next.styles;
|
|
next = next.next;
|
|
}
|
|
var shouldCache = cache.compat === true;
|
|
var rules = cache.insert("", {
|
|
name: serializedNames,
|
|
styles: serializedStyles
|
|
}, cache.sheet, shouldCache);
|
|
if (shouldCache) {
|
|
return null;
|
|
}
|
|
return /* @__PURE__ */ React11.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
|
|
__html: rules
|
|
}, _ref.nonce = cache.sheet.nonce, _ref));
|
|
}
|
|
var sheetRef = React11.useRef();
|
|
useInsertionEffectWithFallbacks.useInsertionEffectWithLayoutFallback(function() {
|
|
var key = cache.key + "-global";
|
|
var sheet = new cache.sheet.constructor({
|
|
key,
|
|
nonce: cache.sheet.nonce,
|
|
container: cache.sheet.container,
|
|
speedy: cache.sheet.isSpeedy
|
|
});
|
|
var rehydrating = false;
|
|
var node = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
|
|
if (cache.sheet.tags.length) {
|
|
sheet.before = cache.sheet.tags[0];
|
|
}
|
|
if (node !== null) {
|
|
rehydrating = true;
|
|
node.setAttribute("data-emotion", key);
|
|
sheet.hydrate([node]);
|
|
}
|
|
sheetRef.current = [sheet, rehydrating];
|
|
return function() {
|
|
sheet.flush();
|
|
};
|
|
}, [cache]);
|
|
useInsertionEffectWithFallbacks.useInsertionEffectWithLayoutFallback(function() {
|
|
var sheetRefCurrent = sheetRef.current;
|
|
var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
|
|
if (rehydrating) {
|
|
sheetRefCurrent[1] = false;
|
|
return;
|
|
}
|
|
if (serialized.next !== void 0) {
|
|
utils.insertStyles(cache, serialized.next, true);
|
|
}
|
|
if (sheet.tags.length) {
|
|
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
sheet.before = element;
|
|
sheet.flush();
|
|
}
|
|
cache.insert("", serialized, sheet, false);
|
|
}, [cache, serialized.name]);
|
|
return null;
|
|
});
|
|
if (true) {
|
|
Global.displayName = "EmotionGlobal";
|
|
}
|
|
function css() {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return serialize.serializeStyles(args);
|
|
}
|
|
var keyframes = function keyframes2() {
|
|
var insertable = css.apply(void 0, arguments);
|
|
var name = "animation-" + insertable.name;
|
|
return {
|
|
name,
|
|
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
anim: 1,
|
|
toString: function toString() {
|
|
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
}
|
|
};
|
|
};
|
|
var classnames = function classnames2(args) {
|
|
var len = args.length;
|
|
var i2 = 0;
|
|
var cls = "";
|
|
for (; i2 < len; i2++) {
|
|
var arg = args[i2];
|
|
if (arg == null)
|
|
continue;
|
|
var toAdd = void 0;
|
|
switch (typeof arg) {
|
|
case "boolean":
|
|
break;
|
|
case "object": {
|
|
if (Array.isArray(arg)) {
|
|
toAdd = classnames2(arg);
|
|
} else {
|
|
if (arg.styles !== void 0 && arg.name !== void 0) {
|
|
console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.");
|
|
}
|
|
toAdd = "";
|
|
for (var k2 in arg) {
|
|
if (arg[k2] && k2) {
|
|
toAdd && (toAdd += " ");
|
|
toAdd += k2;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default: {
|
|
toAdd = arg;
|
|
}
|
|
}
|
|
if (toAdd) {
|
|
cls && (cls += " ");
|
|
cls += toAdd;
|
|
}
|
|
}
|
|
return cls;
|
|
};
|
|
function merge2(registered, css2, className) {
|
|
var registeredStyles = [];
|
|
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
|
|
if (registeredStyles.length < 2) {
|
|
return className;
|
|
}
|
|
return rawClassName + css2(registeredStyles);
|
|
}
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serializedArr = _ref.serializedArr;
|
|
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
var rules2 = "";
|
|
for (var i2 = 0; i2 < serializedArr.length; i2++) {
|
|
var res = utils.insertStyles(cache, serializedArr[i2], false);
|
|
if (!emotionElement.isBrowser && res !== void 0) {
|
|
rules2 += res;
|
|
}
|
|
}
|
|
if (!emotionElement.isBrowser) {
|
|
return rules2;
|
|
}
|
|
});
|
|
if (!emotionElement.isBrowser && rules.length !== 0) {
|
|
var _ref2;
|
|
return /* @__PURE__ */ React11.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function(serialized) {
|
|
return serialized.name;
|
|
}).join(" "), _ref2.dangerouslySetInnerHTML = {
|
|
__html: rules
|
|
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
}
|
|
return null;
|
|
};
|
|
var ClassNames = /* @__PURE__ */ emotionElement.withEmotionCache(function(props, cache) {
|
|
var hasRendered = false;
|
|
var serializedArr = [];
|
|
var css2 = function css3() {
|
|
if (hasRendered && true) {
|
|
throw new Error("css can only be used during render");
|
|
}
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
var serialized = serialize.serializeStyles(args, cache.registered);
|
|
serializedArr.push(serialized);
|
|
utils.registerStyles(cache, serialized, false);
|
|
return cache.key + "-" + serialized.name;
|
|
};
|
|
var cx = function cx2() {
|
|
if (hasRendered && true) {
|
|
throw new Error("cx can only be used during render");
|
|
}
|
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
args[_key2] = arguments[_key2];
|
|
}
|
|
return merge2(cache.registered, css2, classnames(args));
|
|
};
|
|
var content = {
|
|
css: css2,
|
|
cx,
|
|
theme: React11.useContext(emotionElement.ThemeContext)
|
|
};
|
|
var ele = props.children(content);
|
|
hasRendered = true;
|
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Insertion, {
|
|
cache,
|
|
serializedArr
|
|
}), ele);
|
|
});
|
|
if (true) {
|
|
ClassNames.displayName = "EmotionClassNames";
|
|
}
|
|
if (true) {
|
|
isBrowser = typeof document !== "undefined";
|
|
isJest = typeof jest !== "undefined";
|
|
if (isBrowser && !isJest) {
|
|
globalContext = typeof globalThis !== "undefined" ? globalThis : isBrowser ? window : global;
|
|
globalKey = "__EMOTION_REACT_" + pkg.version.split(".")[0] + "__";
|
|
if (globalContext[globalKey]) {
|
|
console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.");
|
|
}
|
|
globalContext[globalKey] = true;
|
|
}
|
|
}
|
|
var isBrowser;
|
|
var isJest;
|
|
var globalContext;
|
|
var globalKey;
|
|
exports.CacheProvider = emotionElement.CacheProvider;
|
|
exports.ThemeContext = emotionElement.ThemeContext;
|
|
exports.ThemeProvider = emotionElement.ThemeProvider;
|
|
exports.__unsafe_useEmotionCache = emotionElement.__unsafe_useEmotionCache;
|
|
exports.useTheme = emotionElement.useTheme;
|
|
Object.defineProperty(exports, "withEmotionCache", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return emotionElement.withEmotionCache;
|
|
}
|
|
});
|
|
exports.withTheme = emotionElement.withTheme;
|
|
exports.ClassNames = ClassNames;
|
|
exports.Global = Global;
|
|
exports.createElement = jsx39;
|
|
exports.css = css;
|
|
exports.jsx = jsx39;
|
|
exports.keyframes = keyframes;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/react/dist/emotion-react.cjs.js
|
|
var require_emotion_react_cjs = __commonJS({
|
|
"node_modules/@emotion/react/dist/emotion-react.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_react_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/styled/base/dist/emotion-styled-base.cjs.dev.js
|
|
var require_emotion_styled_base_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/styled/base/dist/emotion-styled-base.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var _extends2 = require_extends();
|
|
var React11 = require_react();
|
|
var isPropValid = require_emotion_is_prop_valid_cjs();
|
|
var react = require_emotion_react_cjs();
|
|
var utils = require_emotion_utils_cjs();
|
|
var serialize = require_emotion_serialize_cjs();
|
|
var useInsertionEffectWithFallbacks = require_emotion_use_insertion_effect_with_fallbacks_cjs();
|
|
function _interopDefault(e) {
|
|
return e && e.__esModule ? e : { "default": e };
|
|
}
|
|
var isPropValid__default = /* @__PURE__ */ _interopDefault(isPropValid);
|
|
var testOmitPropsOnStringTag = isPropValid__default["default"];
|
|
var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
|
|
return key !== "theme";
|
|
};
|
|
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
|
|
return typeof tag === "string" && tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
};
|
|
var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
|
|
var shouldForwardProp2;
|
|
if (options) {
|
|
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
shouldForwardProp2 = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
|
|
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
} : optionsShouldForwardProp;
|
|
}
|
|
if (typeof shouldForwardProp2 !== "function" && isReal) {
|
|
shouldForwardProp2 = tag.__emotion_forwardProp;
|
|
}
|
|
return shouldForwardProp2;
|
|
};
|
|
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
|
|
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
You can read more about this here:
|
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
var isBrowser = typeof document !== "undefined";
|
|
var Insertion = function Insertion2(_ref) {
|
|
var cache = _ref.cache, serialized = _ref.serialized, isStringTag2 = _ref.isStringTag;
|
|
utils.registerStyles(cache, serialized, isStringTag2);
|
|
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function() {
|
|
return utils.insertStyles(cache, serialized, isStringTag2);
|
|
});
|
|
if (!isBrowser && rules !== void 0) {
|
|
var _ref2;
|
|
var serializedNames = serialized.name;
|
|
var next = serialized.next;
|
|
while (next !== void 0) {
|
|
serializedNames += " " + next.name;
|
|
next = next.next;
|
|
}
|
|
return /* @__PURE__ */ React11.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
__html: rules
|
|
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
}
|
|
return null;
|
|
};
|
|
var createStyled2 = function createStyled3(tag, options) {
|
|
if (true) {
|
|
if (tag === void 0) {
|
|
throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");
|
|
}
|
|
}
|
|
var isReal = tag.__emotion_real === tag;
|
|
var baseTag = isReal && tag.__emotion_base || tag;
|
|
var identifierName;
|
|
var targetClassName;
|
|
if (options !== void 0) {
|
|
identifierName = options.label;
|
|
targetClassName = options.target;
|
|
}
|
|
var shouldForwardProp2 = composeShouldForwardProps(tag, options, isReal);
|
|
var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
|
|
var shouldUseAs = !defaultShouldForwardProp("as");
|
|
return function() {
|
|
var args = arguments;
|
|
var styles = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
|
|
if (identifierName !== void 0) {
|
|
styles.push("label:" + identifierName + ";");
|
|
}
|
|
if (args[0] == null || args[0].raw === void 0) {
|
|
styles.push.apply(styles, args);
|
|
} else {
|
|
if (args[0][0] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles.push(args[0][0]);
|
|
var len = args.length;
|
|
var i2 = 1;
|
|
for (; i2 < len; i2++) {
|
|
if (args[0][i2] === void 0) {
|
|
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
}
|
|
styles.push(args[i2], args[0][i2]);
|
|
}
|
|
}
|
|
var Styled = react.withEmotionCache(function(props, cache, ref) {
|
|
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
var className = "";
|
|
var classInterpolations = [];
|
|
var mergedProps = props;
|
|
if (props.theme == null) {
|
|
mergedProps = {};
|
|
for (var key in props) {
|
|
mergedProps[key] = props[key];
|
|
}
|
|
mergedProps.theme = React11.useContext(react.ThemeContext);
|
|
}
|
|
if (typeof props.className === "string") {
|
|
className = utils.getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
} else if (props.className != null) {
|
|
className = props.className + " ";
|
|
}
|
|
var serialized = serialize.serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
className += cache.key + "-" + serialized.name;
|
|
if (targetClassName !== void 0) {
|
|
className += " " + targetClassName;
|
|
}
|
|
var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
var newProps = {};
|
|
for (var _key in props) {
|
|
if (shouldUseAs && _key === "as")
|
|
continue;
|
|
if (finalShouldForwardProp(_key)) {
|
|
newProps[_key] = props[_key];
|
|
}
|
|
}
|
|
newProps.className = className;
|
|
newProps.ref = ref;
|
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Insertion, {
|
|
cache,
|
|
serialized,
|
|
isStringTag: typeof FinalTag === "string"
|
|
}), /* @__PURE__ */ React11.createElement(FinalTag, newProps));
|
|
});
|
|
Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
|
|
Styled.defaultProps = tag.defaultProps;
|
|
Styled.__emotion_real = Styled;
|
|
Styled.__emotion_base = baseTag;
|
|
Styled.__emotion_styles = styles;
|
|
Styled.__emotion_forwardProp = shouldForwardProp2;
|
|
Object.defineProperty(Styled, "toString", {
|
|
value: function value() {
|
|
if (targetClassName === void 0 && true) {
|
|
return "NO_COMPONENT_SELECTOR";
|
|
}
|
|
return "." + targetClassName;
|
|
}
|
|
});
|
|
Styled.withComponent = function(nextTag, nextOptions) {
|
|
return createStyled3(nextTag, _extends2({}, options, nextOptions, {
|
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
})).apply(void 0, styles);
|
|
};
|
|
return Styled;
|
|
};
|
|
};
|
|
exports.default = createStyled2;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/styled/dist/emotion-styled.cjs.dev.js
|
|
var require_emotion_styled_cjs_dev = __commonJS({
|
|
"node_modules/@emotion/styled/dist/emotion-styled.cjs.dev.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require_extends();
|
|
require_react();
|
|
require_emotion_is_prop_valid_cjs();
|
|
var base_dist_emotionStyledBase = require_emotion_styled_base_cjs_dev();
|
|
require_emotion_react_cjs();
|
|
require_emotion_utils_cjs();
|
|
require_emotion_serialize_cjs();
|
|
require_emotion_use_insertion_effect_with_fallbacks_cjs();
|
|
var tags = [
|
|
"a",
|
|
"abbr",
|
|
"address",
|
|
"area",
|
|
"article",
|
|
"aside",
|
|
"audio",
|
|
"b",
|
|
"base",
|
|
"bdi",
|
|
"bdo",
|
|
"big",
|
|
"blockquote",
|
|
"body",
|
|
"br",
|
|
"button",
|
|
"canvas",
|
|
"caption",
|
|
"cite",
|
|
"code",
|
|
"col",
|
|
"colgroup",
|
|
"data",
|
|
"datalist",
|
|
"dd",
|
|
"del",
|
|
"details",
|
|
"dfn",
|
|
"dialog",
|
|
"div",
|
|
"dl",
|
|
"dt",
|
|
"em",
|
|
"embed",
|
|
"fieldset",
|
|
"figcaption",
|
|
"figure",
|
|
"footer",
|
|
"form",
|
|
"h1",
|
|
"h2",
|
|
"h3",
|
|
"h4",
|
|
"h5",
|
|
"h6",
|
|
"head",
|
|
"header",
|
|
"hgroup",
|
|
"hr",
|
|
"html",
|
|
"i",
|
|
"iframe",
|
|
"img",
|
|
"input",
|
|
"ins",
|
|
"kbd",
|
|
"keygen",
|
|
"label",
|
|
"legend",
|
|
"li",
|
|
"link",
|
|
"main",
|
|
"map",
|
|
"mark",
|
|
"marquee",
|
|
"menu",
|
|
"menuitem",
|
|
"meta",
|
|
"meter",
|
|
"nav",
|
|
"noscript",
|
|
"object",
|
|
"ol",
|
|
"optgroup",
|
|
"option",
|
|
"output",
|
|
"p",
|
|
"param",
|
|
"picture",
|
|
"pre",
|
|
"progress",
|
|
"q",
|
|
"rp",
|
|
"rt",
|
|
"ruby",
|
|
"s",
|
|
"samp",
|
|
"script",
|
|
"section",
|
|
"select",
|
|
"small",
|
|
"source",
|
|
"span",
|
|
"strong",
|
|
"style",
|
|
"sub",
|
|
"summary",
|
|
"sup",
|
|
"table",
|
|
"tbody",
|
|
"td",
|
|
"textarea",
|
|
"tfoot",
|
|
"th",
|
|
"thead",
|
|
"time",
|
|
"title",
|
|
"tr",
|
|
"track",
|
|
"u",
|
|
"ul",
|
|
"var",
|
|
"video",
|
|
"wbr",
|
|
"circle",
|
|
"clipPath",
|
|
"defs",
|
|
"ellipse",
|
|
"foreignObject",
|
|
"g",
|
|
"image",
|
|
"line",
|
|
"linearGradient",
|
|
"mask",
|
|
"path",
|
|
"pattern",
|
|
"polygon",
|
|
"polyline",
|
|
"radialGradient",
|
|
"rect",
|
|
"stop",
|
|
"svg",
|
|
"text",
|
|
"tspan"
|
|
];
|
|
var newStyled = base_dist_emotionStyledBase["default"].bind();
|
|
tags.forEach(function(tagName) {
|
|
newStyled[tagName] = newStyled(tagName);
|
|
});
|
|
exports.default = newStyled;
|
|
}
|
|
});
|
|
|
|
// node_modules/@emotion/styled/dist/emotion-styled.cjs.js
|
|
var require_emotion_styled_cjs = __commonJS({
|
|
"node_modules/@emotion/styled/dist/emotion-styled.cjs.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_emotion_styled_cjs_dev();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
var require_use_sync_external_store_shim_development = __commonJS({
|
|
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(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 React11 = require_react();
|
|
var ReactSharedInternals = React11.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
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 ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
var stack = ReactDebugCurrentFrame.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);
|
|
}
|
|
}
|
|
function is(x2, y2) {
|
|
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
}
|
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
var useState7 = React11.useState, useEffect7 = React11.useEffect, useLayoutEffect2 = React11.useLayoutEffect, useDebugValue3 = React11.useDebugValue;
|
|
var didWarnOld18Alpha = false;
|
|
var didWarnUncachedGetSnapshot = false;
|
|
function useSyncExternalStore3(subscribe, getSnapshot, getServerSnapshot) {
|
|
{
|
|
if (!didWarnOld18Alpha) {
|
|
if (React11.startTransition !== void 0) {
|
|
didWarnOld18Alpha = true;
|
|
error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
|
|
}
|
|
}
|
|
}
|
|
var value = getSnapshot();
|
|
{
|
|
if (!didWarnUncachedGetSnapshot) {
|
|
var cachedValue = getSnapshot();
|
|
if (!objectIs(value, cachedValue)) {
|
|
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
didWarnUncachedGetSnapshot = true;
|
|
}
|
|
}
|
|
}
|
|
var _useState = useState7({
|
|
inst: {
|
|
value,
|
|
getSnapshot
|
|
}
|
|
}), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
useLayoutEffect2(function() {
|
|
inst.value = value;
|
|
inst.getSnapshot = getSnapshot;
|
|
if (checkIfSnapshotChanged(inst)) {
|
|
forceUpdate({
|
|
inst
|
|
});
|
|
}
|
|
}, [subscribe, value, getSnapshot]);
|
|
useEffect7(function() {
|
|
if (checkIfSnapshotChanged(inst)) {
|
|
forceUpdate({
|
|
inst
|
|
});
|
|
}
|
|
var handleStoreChange = function() {
|
|
if (checkIfSnapshotChanged(inst)) {
|
|
forceUpdate({
|
|
inst
|
|
});
|
|
}
|
|
};
|
|
return subscribe(handleStoreChange);
|
|
}, [subscribe]);
|
|
useDebugValue3(value);
|
|
return value;
|
|
}
|
|
function checkIfSnapshotChanged(inst) {
|
|
var latestGetSnapshot = inst.getSnapshot;
|
|
var prevValue = inst.value;
|
|
try {
|
|
var nextValue = latestGetSnapshot();
|
|
return !objectIs(prevValue, nextValue);
|
|
} catch (error2) {
|
|
return true;
|
|
}
|
|
}
|
|
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
return getSnapshot();
|
|
}
|
|
var canUseDOM2 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
var isServerEnvironment = !canUseDOM2;
|
|
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore3;
|
|
var useSyncExternalStore$2 = React11.useSyncExternalStore !== void 0 ? React11.useSyncExternalStore : shim;
|
|
exports.useSyncExternalStore = useSyncExternalStore$2;
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
}
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/shim/index.js
|
|
var require_shim = __commonJS({
|
|
"node_modules/use-sync-external-store/shim/index.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_use_sync_external_store_shim_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
|
|
var require_with_selector_development = __commonJS({
|
|
"node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
|
|
"use strict";
|
|
if (true) {
|
|
(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 React11 = require_react();
|
|
var shim = require_shim();
|
|
function is(x2, y2) {
|
|
return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
|
|
}
|
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
var useSyncExternalStore3 = shim.useSyncExternalStore;
|
|
var useRef7 = React11.useRef, useEffect7 = React11.useEffect, useMemo4 = React11.useMemo, useDebugValue3 = React11.useDebugValue;
|
|
function useSyncExternalStoreWithSelector3(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
var instRef = useRef7(null);
|
|
var inst;
|
|
if (instRef.current === null) {
|
|
inst = {
|
|
hasValue: false,
|
|
value: null
|
|
};
|
|
instRef.current = inst;
|
|
} else {
|
|
inst = instRef.current;
|
|
}
|
|
var _useMemo = useMemo4(function() {
|
|
var hasMemo = false;
|
|
var memoizedSnapshot;
|
|
var memoizedSelection;
|
|
var memoizedSelector = function(nextSnapshot) {
|
|
if (!hasMemo) {
|
|
hasMemo = true;
|
|
memoizedSnapshot = nextSnapshot;
|
|
var _nextSelection = selector(nextSnapshot);
|
|
if (isEqual !== void 0) {
|
|
if (inst.hasValue) {
|
|
var currentSelection = inst.value;
|
|
if (isEqual(currentSelection, _nextSelection)) {
|
|
memoizedSelection = currentSelection;
|
|
return currentSelection;
|
|
}
|
|
}
|
|
}
|
|
memoizedSelection = _nextSelection;
|
|
return _nextSelection;
|
|
}
|
|
var prevSnapshot = memoizedSnapshot;
|
|
var prevSelection = memoizedSelection;
|
|
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
return prevSelection;
|
|
}
|
|
var nextSelection = selector(nextSnapshot);
|
|
if (isEqual !== void 0 && isEqual(prevSelection, nextSelection)) {
|
|
return prevSelection;
|
|
}
|
|
memoizedSnapshot = nextSnapshot;
|
|
memoizedSelection = nextSelection;
|
|
return nextSelection;
|
|
};
|
|
var maybeGetServerSnapshot = getServerSnapshot === void 0 ? null : getServerSnapshot;
|
|
var getSnapshotWithSelector = function() {
|
|
return memoizedSelector(getSnapshot());
|
|
};
|
|
var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : function() {
|
|
return memoizedSelector(maybeGetServerSnapshot());
|
|
};
|
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection = _useMemo[0], getServerSelection = _useMemo[1];
|
|
var value = useSyncExternalStore3(subscribe, getSelection, getServerSelection);
|
|
useEffect7(function() {
|
|
inst.hasValue = true;
|
|
inst.value = value;
|
|
}, [value]);
|
|
useDebugValue3(value);
|
|
return value;
|
|
}
|
|
exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector3;
|
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
}
|
|
})();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/use-sync-external-store/shim/with-selector.js
|
|
var require_with_selector = __commonJS({
|
|
"node_modules/use-sync-external-store/shim/with-selector.js"(exports, module2) {
|
|
"use strict";
|
|
if (false) {
|
|
module2.exports = null;
|
|
} else {
|
|
module2.exports = require_with_selector_development();
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/entities/lib/maps/entities.json
|
|
var require_entities = __commonJS({
|
|
"node_modules/entities/lib/maps/entities.json"(exports, module2) {
|
|
module2.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angmsd: "\u2221", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\u{1D538}", aopf: "\u{1D552}", apacir: "\u2A6F", ap: "\u2248", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\u{1D49C}", ascr: "\u{1D4B6}", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", barwed: "\u2305", Barwed: "\u2306", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", because: "\u2235", Because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\u{1D505}", bfr: "\u{1D51F}", bigcap: "\u22C2", bigcirc: "\u25EF", bigcup: "\u22C3", bigodot: "\u2A00", bigoplus: "\u2A01", bigotimes: "\u2A02", bigsqcup: "\u2A06", bigstar: "\u2605", bigtriangledown: "\u25BD", bigtriangleup: "\u25B3", biguplus: "\u2A04", bigvee: "\u22C1", bigwedge: "\u22C0", bkarow: "\u290D", blacklozenge: "\u29EB", blacksquare: "\u25AA", blacktriangle: "\u25B4", blacktriangledown: "\u25BE", blacktriangleleft: "\u25C2", blacktriangleright: "\u25B8", blank: "\u2423", blk12: "\u2592", blk14: "\u2591", blk34: "\u2593", block: "\u2588", bne: "=\u20E5", bnequiv: "\u2261\u20E5", bNot: "\u2AED", bnot: "\u2310", Bopf: "\u{1D539}", bopf: "\u{1D553}", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxdl: "\u2510", boxdL: "\u2555", boxDl: "\u2556", boxDL: "\u2557", boxdr: "\u250C", boxdR: "\u2552", boxDr: "\u2553", boxDR: "\u2554", boxh: "\u2500", boxH: "\u2550", boxhd: "\u252C", boxHd: "\u2564", boxhD: "\u2565", boxHD: "\u2566", boxhu: "\u2534", boxHu: "\u2567", boxhU: "\u2568", boxHU: "\u2569", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxul: "\u2518", boxuL: "\u255B", boxUl: "\u255C", boxUL: "\u255D", boxur: "\u2514", boxuR: "\u2558", boxUr: "\u2559", boxUR: "\u255A", boxv: "\u2502", boxV: "\u2551", boxvh: "\u253C", boxvH: "\u256A", boxVh: "\u256B", boxVH: "\u256C", boxvl: "\u2524", boxvL: "\u2561", boxVl: "\u2562", boxVL: "\u2563", boxvr: "\u251C", boxvR: "\u255E", boxVr: "\u255F", boxVR: "\u2560", bprime: "\u2035", breve: "\u02D8", Breve: "\u02D8", brvbar: "\xA6", bscr: "\u{1D4B7}", Bscr: "\u212C", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsolb: "\u29C5", bsol: "\\", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", cap: "\u2229", Cap: "\u22D2", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", centerdot: "\xB7", CenterDot: "\xB7", cfr: "\u{1D520}", Cfr: "\u212D", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cir: "\u25CB", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", colon: ":", Colon: "\u2237", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", conint: "\u222E", Conint: "\u222F", ContourIntegral: "\u222E", copf: "\u{1D554}", Copf: "\u2102", coprod: "\u2210", Coproduct: "\u2210", copy: "\xA9", COPY: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", cross: "\u2717", Cross: "\u2A2F", Cscr: "\u{1D49E}", cscr: "\u{1D4B8}", csub: "\u2ACF", csube: "\u2AD1", csup: "\u2AD0", csupe: "\u2AD2", ctdot: "\u22EF", cudarrl: "\u2938", cudarrr: "\u2935", cuepr: "\u22DE", cuesc: "\u22DF", cularr: "\u21B6", cularrp: "\u293D", cupbrcap: "\u2A48", cupcap: "\u2A46", CupCap: "\u224D", cup: "\u222A", Cup: "\u22D3", cupcup: "\u2A4A", cupdot: "\u228D", cupor: "\u2A45", cups: "\u222A\uFE00", curarr: "\u21B7", curarrm: "\u293C", curlyeqprec: "\u22DE", curlyeqsucc: "\u22DF", curlyvee: "\u22CE", curlywedge: "\u22CF", curren: "\xA4", curvearrowleft: "\u21B6", curvearrowright: "\u21B7", cuvee: "\u22CE", cuwed: "\u22CF", cwconint: "\u2232", cwint: "\u2231", cylcty: "\u232D", dagger: "\u2020", Dagger: "\u2021", daleth: "\u2138", darr: "\u2193", Darr: "\u21A1", dArr: "\u21D3", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", ddagger: "\u2021", ddarr: "\u21CA", DD: "\u2145", dd: "\u2146", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\u{1D507}", dfr: "\u{1D521}", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", diamond: "\u22C4", Diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\u{1D53B}", dopf: "\u{1D555}", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", DoubleContourIntegral: "\u222F", DoubleDot: "\xA8", DoubleDownArrow: "\u21D3", DoubleLeftArrow: "\u21D0", DoubleLeftRightArrow: "\u21D4", DoubleLeftTee: "\u2AE4", DoubleLongLeftArrow: "\u27F8", DoubleLongLeftRightArrow: "\u27FA", DoubleLongRightArrow: "\u27F9", DoubleRightArrow: "\u21D2", DoubleRightTee: "\u22A8", DoubleUpArrow: "\u21D1", DoubleUpDownArrow: "\u21D5", DoubleVerticalBar: "\u2225", DownArrowBar: "\u2913", downarrow: "\u2193", DownArrow: "\u2193", Downarrow: "\u21D3", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVectorBar: "\u2956", DownLeftVector: "\u21BD", DownRightTeeVector: "\u295F", DownRightVectorBar: "\u2957", DownRightVector: "\u21C1", DownTeeArrow: "\u21A7", DownTee: "\u22A4", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\u{1D49F}", dscr: "\u{1D4B9}", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", Ecirc: "\xCA", ecirc: "\xEA", ecir: "\u2256", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", edot: "\u0117", eDot: "\u2251", ee: "\u2147", efDot: "\u2252", Efr: "\u{1D508}", efr: "\u{1D522}", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp13: "\u2004", emsp14: "\u2005", emsp: "\u2003", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\u{1D53C}", eopf: "\u{1D556}", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", escr: "\u212F", Escr: "\u2130", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", exponentiale: "\u2147", ExponentialE: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\u{1D509}", ffr: "\u{1D523}", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\u{1D53D}", fopf: "\u{1D557}", forall: "\u2200", ForAll: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", fpartint: "\u2A0D", frac12: "\xBD", frac13: "\u2153", frac14: "\xBC", frac15: "\u2155", frac16: "\u2159", frac18: "\u215B", frac23: "\u2154", frac25: "\u2156", frac34: "\xBE", frac35: "\u2157", frac38: "\u215C", frac45: "\u2158", frac56: "\u215A", frac58: "\u215D", frac78: "\u215E", frasl: "\u2044", frown: "\u2322", fscr: "\u{1D4BB}", Fscr: "\u2131", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", ge: "\u2265", gE: "\u2267", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", gescc: "\u2AA9", ges: "\u2A7E", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\u{1D50A}", gfr: "\u{1D524}", gg: "\u226B", Gg: "\u22D9", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gla: "\u2AA5", gl: "\u2277", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gne: "\u2A88", gnE: "\u2269", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\u{1D53E}", gopf: "\u{1D558}", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\u{1D4A2}", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", gtcc: "\u2AA7", gtcir: "\u2A7A", gt: ">", GT: ">", Gt: "\u226B", gtdot: "\u22D7", gtlPar: "\u2995", gtquest: "\u2A7C", gtrapprox: "\u2A86", gtrarr: "\u2978", gtrdot: "\u22D7", gtreqless: "\u22DB", gtreqqless: "\u2A8C", gtrless: "\u2277", gtrsim: "\u2273", gvertneqq: "\u2269\uFE00", gvnE: "\u2269\uFE00", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", harrcir: "\u2948", harr: "\u2194", hArr: "\u21D4", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", hfr: "\u{1D525}", Hfr: "\u210C", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", hopf: "\u{1D559}", Hopf: "\u210D", horbar: "\u2015", HorizontalLine: "\u2500", hscr: "\u{1D4BD}", Hscr: "\u210B", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", ifr: "\u{1D526}", Ifr: "\u2111", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", Im: "\u2111", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", incare: "\u2105", in: "\u2208", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", intcal: "\u22BA", int: "\u222B", Int: "\u222C", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\u{1D540}", iopf: "\u{1D55A}", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", iscr: "\u{1D4BE}", Iscr: "\u2110", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\u{1D50D}", jfr: "\u{1D527}", jmath: "\u0237", Jopf: "\u{1D541}", jopf: "\u{1D55B}", Jscr: "\u{1D4A5}", jscr: "\u{1D4BF}", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\u{1D50E}", kfr: "\u{1D528}", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\u{1D542}", kopf: "\u{1D55C}", Kscr: "\u{1D4A6}", kscr: "\u{1D4C0}", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", lang: "\u27E8", Lang: "\u27EA", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", larrb: "\u21E4", larrbfs: "\u291F", larr: "\u2190", Larr: "\u219E", lArr: "\u21D0", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", latail: "\u2919", lAtail: "\u291B", lat: "\u2AAB", late: "\u2AAD", lates: "\u2AAD\uFE00", lbarr: "\u290C", lBarr: "\u290E", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", le: "\u2264", lE: "\u2266", LeftAngleBracket: "\u27E8", LeftArrowBar: "\u21E4", leftarrow: "\u2190", LeftArrow: "\u2190", Leftarrow: "\u21D0", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVectorBar: "\u2959", LeftDownVector: "\u21C3", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", leftrightarrow: "\u2194", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTeeArrow: "\u21A4", LeftTee: "\u22A3", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangleBar: "\u29CF", LeftTriangle: "\u22B2", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVectorBar: "\u2958", LeftUpVector: "\u21BF", LeftVectorBar: "\u2952", LeftVector: "\u21BC", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", lescc: "\u2AA8", les: "\u2A7D", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\u{1D50F}", lfr: "\u{1D529}", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", llarr: "\u21C7", ll: "\u226A", Ll: "\u22D8", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoustache: "\u23B0", lmoust: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lne: "\u2A87", lnE: "\u2268", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", longleftarrow: "\u27F5", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftrightarrow: "\u27F7", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longmapsto: "\u27FC", longrightarrow: "\u27F6", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\u{1D543}", lopf: "\u{1D55D}", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", loz: "\u25CA", lozenge: "\u25CA", lozf: "\u29EB", lpar: "(", lparlt: "\u2993", lrarr: "\u21C6", lrcorner: "\u231F", lrhar: "\u21CB", lrhard: "\u296D", lrm: "\u200E", lrtri: "\u22BF", lsaquo: "\u2039", lscr: "\u{1D4C1}", Lscr: "\u2112", lsh: "\u21B0", Lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", ltcc: "\u2AA6", ltcir: "\u2A79", lt: "<", LT: "<", Lt: "\u226A", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\u{1D510}", mfr: "\u{1D52A}", mho: "\u2127", micro: "\xB5", midast: "*", midcir: "\u2AF0", mid: "\u2223", middot: "\xB7", minusb: "\u229F", minus: "\u2212", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\u{1D544}", mopf: "\u{1D55E}", mp: "\u2213", mscr: "\u{1D4C2}", Mscr: "\u2133", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natural: "\u266E", naturals: "\u2115", natur: "\u266E", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", nearhk: "\u2924", nearr: "\u2197", neArr: "\u21D7", nearrow: "\u2197", ne: "\u2260", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\u{1D511}", nfr: "\u{1D52B}", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nharr: "\u21AE", nhArr: "\u21CE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlarr: "\u219A", nlArr: "\u21CD", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nleftarrow: "\u219A", nLeftarrow: "\u21CD", nleftrightarrow: "\u21AE", nLeftrightarrow: "\u21CE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", nopf: "\u{1D55F}", Nopf: "\u2115", Not: "\u2AEC", not: "\xAC", NotCongruent: "\u2262", NotCupCap: "\u226D", NotDoubleVerticalBar: "\u2226", NotElement: "\u2209", NotEqual: "\u2260", NotEqualTilde: "\u2242\u0338", NotExists: "\u2204", NotGreater: "\u226F", NotGreaterEqual: "\u2271", NotGreaterFullEqual: "\u2267\u0338", NotGreaterGreater: "\u226B\u0338", NotGreaterLess: "\u2279", NotGreaterSlantEqual: "\u2A7E\u0338", NotGreaterTilde: "\u2275", NotHumpDownHump: "\u224E\u0338", NotHumpEqual: "\u224F\u0338", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangle: "\u22EA", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangle: "\u22EB", NotRightTriangleEqual: "\u22ED", NotSquareSubset: "\u228F\u0338", NotSquareSubsetEqual: "\u22E2", NotSquareSuperset: "\u2290\u0338", NotSquareSupersetEqual: "\u22E3", NotSubset: "\u2282\u20D2", NotSubsetEqual: "\u2288", NotSucceeds: "\u2281", NotSucceedsEqual: "\u2AB0\u0338", NotSucceedsSlantEqual: "\u22E1", NotSucceedsTilde: "\u227F\u0338", NotSuperset: "\u2283\u20D2", NotSupersetEqual: "\u2289", NotTilde: "\u2241", NotTildeEqual: "\u2244", NotTildeFullEqual: "\u2247", NotTildeTilde: "\u2249", NotVerticalBar: "\u2224", nparallel: "\u2226", npar: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", nprec: "\u2280", npreceq: "\u2AAF\u0338", npre: "\u2AAF\u0338", nrarrc: "\u2933\u0338", nrarr: "\u219B", nrArr: "\u21CF", nrarrw: "\u219D\u0338", nrightarrow: "\u219B", nRightarrow: "\u21CF", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\u{1D4A9}", nscr: "\u{1D4C3}", nshortmid: "\u2224", nshortparallel: "\u2226", nsim: "\u2241", nsime: "\u2244", nsimeq: "\u2244", nsmid: "\u2224", nspar: "\u2226", nsqsube: "\u22E2", nsqsupe: "\u22E3", nsub: "\u2284", nsubE: "\u2AC5\u0338", nsube: "\u2288", nsubset: "\u2282\u20D2", nsubseteq: "\u2288", nsubseteqq: "\u2AC5\u0338", nsucc: "\u2281", nsucceq: "\u2AB0\u0338", nsup: "\u2285", nsupE: "\u2AC6\u0338", nsupe: "\u2289", nsupset: "\u2283\u20D2", nsupseteq: "\u2289", nsupseteqq: "\u2AC6\u0338", ntgl: "\u2279", Ntilde: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nvdash: "\u22AC", nvDash: "\u22AD", nVdash: "\u22AE", nVDash: "\u22AF", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwarr: "\u2196", nwArr: "\u21D6", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", Ocirc: "\xD4", ocirc: "\xF4", ocir: "\u229A", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\u{1D512}", ofr: "\u{1D52C}", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\u{1D546}", oopf: "\u{1D560}", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", orarr: "\u21BB", Or: "\u2A54", or: "\u2228", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\u{1D4AA}", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", otimesas: "\u2A36", Otimes: "\u2A37", otimes: "\u2297", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", para: "\xB6", parallel: "\u2225", par: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\u{1D513}", pfr: "\u{1D52D}", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plus: "+", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", popf: "\u{1D561}", Popf: "\u2119", pound: "\xA3", prap: "\u2AB7", Pr: "\u2ABB", pr: "\u227A", prcue: "\u227C", precapprox: "\u2AB7", prec: "\u227A", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", pre: "\u2AAF", prE: "\u2AB3", precsim: "\u227E", prime: "\u2032", Prime: "\u2033", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportional: "\u221D", Proportion: "\u2237", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\u{1D4AB}", pscr: "\u{1D4C5}", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\u{1D514}", qfr: "\u{1D52E}", qint: "\u2A0C", qopf: "\u{1D562}", Qopf: "\u211A", qprime: "\u2057", Qscr: "\u{1D4AC}", qscr: "\u{1D4C6}", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", quot: '"', QUOT: '"', rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", rang: "\u27E9", Rang: "\u27EB", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarr: "\u2192", Rarr: "\u21A0", rArr: "\u21D2", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", ratail: "\u291A", rAtail: "\u291C", ratio: "\u2236", rationals: "\u211A", rbarr: "\u290D", rBarr: "\u290F", RBarr: "\u2910", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", Re: "\u211C", rect: "\u25AD", reg: "\xAE", REG: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", rfr: "\u{1D52F}", Rfr: "\u211C", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrowBar: "\u21E5", rightarrow: "\u2192", RightArrow: "\u2192", Rightarrow: "\u21D2", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVectorBar: "\u2955", RightDownVector: "\u21C2", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTeeArrow: "\u21A6", RightTee: "\u22A2", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangleBar: "\u29D0", RightTriangle: "\u22B3", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVectorBar: "\u2954", RightUpVector: "\u21BE", RightVectorBar: "\u2953", RightVector: "\u21C0", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoustache: "\u23B1", rmoust: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", ropf: "\u{1D563}", Ropf: "\u211D", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", rscr: "\u{1D4C7}", Rscr: "\u211B", rsh: "\u21B1", Rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", Sc: "\u2ABC", sc: "\u227B", sccue: "\u227D", sce: "\u2AB0", scE: "\u2AB4", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdotb: "\u22A1", sdot: "\u22C5", sdote: "\u2A66", searhk: "\u2925", searr: "\u2198", seArr: "\u21D8", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\u{1D516}", sfr: "\u{1D530}", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", sigma: "\u03C3", sigmaf: "\u03C2", sigmav: "\u03C2", sim: "\u223C", simdot: "\u2A6A", sime: "\u2243", simeq: "\u2243", simg: "\u2A9E", simgE: "\u2AA0", siml: "\u2A9D", simlE: "\u2A9F", simne: "\u2246", simplus: "\u2A24", simrarr: "\u2972", slarr: "\u2190", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", solbar: "\u233F", solb: "\u29C4", sol: "/", Sopf: "\u{1D54A}", sopf: "\u{1D564}", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", square: "\u25A1", Square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squ: "\u25A1", squf: "\u25AA", srarr: "\u2192", Sscr: "\u{1D4AE}", sscr: "\u{1D4C8}", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", sub: "\u2282", Sub: "\u22D0", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", subset: "\u2282", Subset: "\u22D0", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succapprox: "\u2AB8", succ: "\u227B", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", sum: "\u2211", Sum: "\u2211", sung: "\u266A", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", sup: "\u2283", Sup: "\u22D1", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", supset: "\u2283", Supset: "\u22D1", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swarr: "\u2199", swArr: "\u21D9", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: " ", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\u{1D517}", tfr: "\u{1D531}", there4: "\u2234", therefore: "\u2234", Therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", ThinSpace: "\u2009", thinsp: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", tilde: "\u02DC", Tilde: "\u223C", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", timesbar: "\u2A31", timesb: "\u22A0", times: "\xD7", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", topbot: "\u2336", topcir: "\u2AF1", top: "\u22A4", Topf: "\u{1D54B}", topf: "\u{1D565}", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", trade: "\u2122", TRADE: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\u{1D4AF}", tscr: "\u{1D4C9}", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", uarr: "\u2191", Uarr: "\u219F", uArr: "\u21D1", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\u{1D518}", ufr: "\u{1D532}", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\u{1D54C}", uopf: "\u{1D566}", UpArrowBar: "\u2912", uparrow: "\u2191", UpArrow: "\u2191", Uparrow: "\u21D1", UpArrowDownArrow: "\u21C5", updownarrow: "\u2195", UpDownArrow: "\u2195", Updownarrow: "\u21D5", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", upsi: "\u03C5", Upsi: "\u03D2", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTeeArrow: "\u21A5", UpTee: "\u22A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\u{1D4B0}", uscr: "\u{1D4CA}", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", varr: "\u2195", vArr: "\u21D5", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", vBar: "\u2AE8", Vbar: "\u2AEB", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", vdash: "\u22A2", vDash: "\u22A8", Vdash: "\u22A9", VDash: "\u22AB", Vdashl: "\u2AE6", veebar: "\u22BB", vee: "\u2228", Vee: "\u22C1", veeeq: "\u225A", vellip: "\u22EE", verbar: "|", Verbar: "\u2016", vert: "|", Vert: "\u2016", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\u{1D519}", vfr: "\u{1D533}", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\u{1D54D}", vopf: "\u{1D567}", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\u{1D4B1}", vscr: "\u{1D4CB}", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", wedge: "\u2227", Wedge: "\u22C0", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\u{1D51A}", wfr: "\u{1D534}", Wopf: "\u{1D54E}", wopf: "\u{1D568}", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\u{1D4B2}", wscr: "\u{1D4CC}", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\u{1D51B}", xfr: "\u{1D535}", xharr: "\u27F7", xhArr: "\u27FA", Xi: "\u039E", xi: "\u03BE", xlarr: "\u27F5", xlArr: "\u27F8", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\u{1D54F}", xopf: "\u{1D569}", xoplus: "\u2A01", xotime: "\u2A02", xrarr: "\u27F6", xrArr: "\u27F9", Xscr: "\u{1D4B3}", xscr: "\u{1D4CD}", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\u{1D51C}", yfr: "\u{1D536}", YIcy: "\u0407", yicy: "\u0457", Yopf: "\u{1D550}", yopf: "\u{1D56A}", Yscr: "\u{1D4B4}", yscr: "\u{1D4CE}", YUcy: "\u042E", yucy: "\u044E", yuml: "\xFF", Yuml: "\u0178", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", zfr: "\u{1D537}", Zfr: "\u2128", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", zopf: "\u{1D56B}", Zopf: "\u2124", Zscr: "\u{1D4B5}", zscr: "\u{1D4CF}", zwj: "\u200D", zwnj: "\u200C" };
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/common/entities.js
|
|
var require_entities2 = __commonJS({
|
|
"node_modules/markdown-it/lib/common/entities.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = require_entities();
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/categories/P/regex.js
|
|
var require_regex = __commonJS({
|
|
"node_modules/uc.micro/categories/P/regex.js"(exports, module2) {
|
|
module2.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
|
|
}
|
|
});
|
|
|
|
// node_modules/mdurl/encode.js
|
|
var require_encode = __commonJS({
|
|
"node_modules/mdurl/encode.js"(exports, module2) {
|
|
"use strict";
|
|
var encodeCache = {};
|
|
function getEncodeCache(exclude) {
|
|
var i2, ch, cache = encodeCache[exclude];
|
|
if (cache) {
|
|
return cache;
|
|
}
|
|
cache = encodeCache[exclude] = [];
|
|
for (i2 = 0; i2 < 128; i2++) {
|
|
ch = String.fromCharCode(i2);
|
|
if (/^[0-9a-z]$/i.test(ch)) {
|
|
cache.push(ch);
|
|
} else {
|
|
cache.push("%" + ("0" + i2.toString(16).toUpperCase()).slice(-2));
|
|
}
|
|
}
|
|
for (i2 = 0; i2 < exclude.length; i2++) {
|
|
cache[exclude.charCodeAt(i2)] = exclude[i2];
|
|
}
|
|
return cache;
|
|
}
|
|
function encode(string, exclude, keepEscaped) {
|
|
var i2, l2, code, nextCode, cache, result = "";
|
|
if (typeof exclude !== "string") {
|
|
keepEscaped = exclude;
|
|
exclude = encode.defaultChars;
|
|
}
|
|
if (typeof keepEscaped === "undefined") {
|
|
keepEscaped = true;
|
|
}
|
|
cache = getEncodeCache(exclude);
|
|
for (i2 = 0, l2 = string.length; i2 < l2; i2++) {
|
|
code = string.charCodeAt(i2);
|
|
if (keepEscaped && code === 37 && i2 + 2 < l2) {
|
|
if (/^[0-9a-f]{2}$/i.test(string.slice(i2 + 1, i2 + 3))) {
|
|
result += string.slice(i2, i2 + 3);
|
|
i2 += 2;
|
|
continue;
|
|
}
|
|
}
|
|
if (code < 128) {
|
|
result += cache[code];
|
|
continue;
|
|
}
|
|
if (code >= 55296 && code <= 57343) {
|
|
if (code >= 55296 && code <= 56319 && i2 + 1 < l2) {
|
|
nextCode = string.charCodeAt(i2 + 1);
|
|
if (nextCode >= 56320 && nextCode <= 57343) {
|
|
result += encodeURIComponent(string[i2] + string[i2 + 1]);
|
|
i2++;
|
|
continue;
|
|
}
|
|
}
|
|
result += "%EF%BF%BD";
|
|
continue;
|
|
}
|
|
result += encodeURIComponent(string[i2]);
|
|
}
|
|
return result;
|
|
}
|
|
encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
|
|
encode.componentChars = "-_.!~*'()";
|
|
module2.exports = encode;
|
|
}
|
|
});
|
|
|
|
// node_modules/mdurl/decode.js
|
|
var require_decode2 = __commonJS({
|
|
"node_modules/mdurl/decode.js"(exports, module2) {
|
|
"use strict";
|
|
var decodeCache = {};
|
|
function getDecodeCache(exclude) {
|
|
var i2, ch, cache = decodeCache[exclude];
|
|
if (cache) {
|
|
return cache;
|
|
}
|
|
cache = decodeCache[exclude] = [];
|
|
for (i2 = 0; i2 < 128; i2++) {
|
|
ch = String.fromCharCode(i2);
|
|
cache.push(ch);
|
|
}
|
|
for (i2 = 0; i2 < exclude.length; i2++) {
|
|
ch = exclude.charCodeAt(i2);
|
|
cache[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2);
|
|
}
|
|
return cache;
|
|
}
|
|
function decode(string, exclude) {
|
|
var cache;
|
|
if (typeof exclude !== "string") {
|
|
exclude = decode.defaultChars;
|
|
}
|
|
cache = getDecodeCache(exclude);
|
|
return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
|
|
var i2, l2, b1, b2, b3, b4, chr, result = "";
|
|
for (i2 = 0, l2 = seq.length; i2 < l2; i2 += 3) {
|
|
b1 = parseInt(seq.slice(i2 + 1, i2 + 3), 16);
|
|
if (b1 < 128) {
|
|
result += cache[b1];
|
|
continue;
|
|
}
|
|
if ((b1 & 224) === 192 && i2 + 3 < l2) {
|
|
b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
|
|
if ((b2 & 192) === 128) {
|
|
chr = b1 << 6 & 1984 | b2 & 63;
|
|
if (chr < 128) {
|
|
result += "\uFFFD\uFFFD";
|
|
} else {
|
|
result += String.fromCharCode(chr);
|
|
}
|
|
i2 += 3;
|
|
continue;
|
|
}
|
|
}
|
|
if ((b1 & 240) === 224 && i2 + 6 < l2) {
|
|
b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
|
|
b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
|
|
if ((b2 & 192) === 128 && (b3 & 192) === 128) {
|
|
chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;
|
|
if (chr < 2048 || chr >= 55296 && chr <= 57343) {
|
|
result += "\uFFFD\uFFFD\uFFFD";
|
|
} else {
|
|
result += String.fromCharCode(chr);
|
|
}
|
|
i2 += 6;
|
|
continue;
|
|
}
|
|
}
|
|
if ((b1 & 248) === 240 && i2 + 9 < l2) {
|
|
b2 = parseInt(seq.slice(i2 + 4, i2 + 6), 16);
|
|
b3 = parseInt(seq.slice(i2 + 7, i2 + 9), 16);
|
|
b4 = parseInt(seq.slice(i2 + 10, i2 + 12), 16);
|
|
if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {
|
|
chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;
|
|
if (chr < 65536 || chr > 1114111) {
|
|
result += "\uFFFD\uFFFD\uFFFD\uFFFD";
|
|
} else {
|
|
chr -= 65536;
|
|
result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));
|
|
}
|
|
i2 += 9;
|
|
continue;
|
|
}
|
|
}
|
|
result += "\uFFFD";
|
|
}
|
|
return result;
|
|
});
|
|
}
|
|
decode.defaultChars = ";/?:@&=+$,#";
|
|
decode.componentChars = "";
|
|
module2.exports = decode;
|
|
}
|
|
});
|
|
|
|
// node_modules/mdurl/format.js
|
|
var require_format = __commonJS({
|
|
"node_modules/mdurl/format.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function format(url) {
|
|
var result = "";
|
|
result += url.protocol || "";
|
|
result += url.slashes ? "//" : "";
|
|
result += url.auth ? url.auth + "@" : "";
|
|
if (url.hostname && url.hostname.indexOf(":") !== -1) {
|
|
result += "[" + url.hostname + "]";
|
|
} else {
|
|
result += url.hostname || "";
|
|
}
|
|
result += url.port ? ":" + url.port : "";
|
|
result += url.pathname || "";
|
|
result += url.search || "";
|
|
result += url.hash || "";
|
|
return result;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/mdurl/parse.js
|
|
var require_parse = __commonJS({
|
|
"node_modules/mdurl/parse.js"(exports, module2) {
|
|
"use strict";
|
|
function Url() {
|
|
this.protocol = null;
|
|
this.slashes = null;
|
|
this.auth = null;
|
|
this.port = null;
|
|
this.hostname = null;
|
|
this.hash = null;
|
|
this.search = null;
|
|
this.pathname = null;
|
|
}
|
|
var protocolPattern = /^([a-z0-9.+-]+:)/i;
|
|
var portPattern = /:[0-9]*$/;
|
|
var simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
|
|
var delims = ["<", ">", '"', "`", " ", "\r", "\n", " "];
|
|
var unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
|
|
var autoEscape = ["'"].concat(unwise);
|
|
var nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
|
|
var hostEndingChars = ["/", "?", "#"];
|
|
var hostnameMaxLen = 255;
|
|
var hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
|
|
var hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
|
|
var hostlessProtocol = {
|
|
"javascript": true,
|
|
"javascript:": true
|
|
};
|
|
var slashedProtocol = {
|
|
"http": true,
|
|
"https": true,
|
|
"ftp": true,
|
|
"gopher": true,
|
|
"file": true,
|
|
"http:": true,
|
|
"https:": true,
|
|
"ftp:": true,
|
|
"gopher:": true,
|
|
"file:": true
|
|
};
|
|
function urlParse(url, slashesDenoteHost) {
|
|
if (url && url instanceof Url) {
|
|
return url;
|
|
}
|
|
var u2 = new Url();
|
|
u2.parse(url, slashesDenoteHost);
|
|
return u2;
|
|
}
|
|
Url.prototype.parse = function(url, slashesDenoteHost) {
|
|
var i2, l2, lowerProto, hec, slashes, rest = url;
|
|
rest = rest.trim();
|
|
if (!slashesDenoteHost && url.split("#").length === 1) {
|
|
var simplePath = simplePathPattern.exec(rest);
|
|
if (simplePath) {
|
|
this.pathname = simplePath[1];
|
|
if (simplePath[2]) {
|
|
this.search = simplePath[2];
|
|
}
|
|
return this;
|
|
}
|
|
}
|
|
var proto = protocolPattern.exec(rest);
|
|
if (proto) {
|
|
proto = proto[0];
|
|
lowerProto = proto.toLowerCase();
|
|
this.protocol = proto;
|
|
rest = rest.substr(proto.length);
|
|
}
|
|
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
slashes = rest.substr(0, 2) === "//";
|
|
if (slashes && !(proto && hostlessProtocol[proto])) {
|
|
rest = rest.substr(2);
|
|
this.slashes = true;
|
|
}
|
|
}
|
|
if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
|
|
var hostEnd = -1;
|
|
for (i2 = 0; i2 < hostEndingChars.length; i2++) {
|
|
hec = rest.indexOf(hostEndingChars[i2]);
|
|
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
|
|
hostEnd = hec;
|
|
}
|
|
}
|
|
var auth, atSign;
|
|
if (hostEnd === -1) {
|
|
atSign = rest.lastIndexOf("@");
|
|
} else {
|
|
atSign = rest.lastIndexOf("@", hostEnd);
|
|
}
|
|
if (atSign !== -1) {
|
|
auth = rest.slice(0, atSign);
|
|
rest = rest.slice(atSign + 1);
|
|
this.auth = auth;
|
|
}
|
|
hostEnd = -1;
|
|
for (i2 = 0; i2 < nonHostChars.length; i2++) {
|
|
hec = rest.indexOf(nonHostChars[i2]);
|
|
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
|
|
hostEnd = hec;
|
|
}
|
|
}
|
|
if (hostEnd === -1) {
|
|
hostEnd = rest.length;
|
|
}
|
|
if (rest[hostEnd - 1] === ":") {
|
|
hostEnd--;
|
|
}
|
|
var host = rest.slice(0, hostEnd);
|
|
rest = rest.slice(hostEnd);
|
|
this.parseHost(host);
|
|
this.hostname = this.hostname || "";
|
|
var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
if (!ipv6Hostname) {
|
|
var hostparts = this.hostname.split(/\./);
|
|
for (i2 = 0, l2 = hostparts.length; i2 < l2; i2++) {
|
|
var part = hostparts[i2];
|
|
if (!part) {
|
|
continue;
|
|
}
|
|
if (!part.match(hostnamePartPattern)) {
|
|
var newpart = "";
|
|
for (var j2 = 0, k2 = part.length; j2 < k2; j2++) {
|
|
if (part.charCodeAt(j2) > 127) {
|
|
newpart += "x";
|
|
} else {
|
|
newpart += part[j2];
|
|
}
|
|
}
|
|
if (!newpart.match(hostnamePartPattern)) {
|
|
var validParts = hostparts.slice(0, i2);
|
|
var notHost = hostparts.slice(i2 + 1);
|
|
var bit = part.match(hostnamePartStart);
|
|
if (bit) {
|
|
validParts.push(bit[1]);
|
|
notHost.unshift(bit[2]);
|
|
}
|
|
if (notHost.length) {
|
|
rest = notHost.join(".") + rest;
|
|
}
|
|
this.hostname = validParts.join(".");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.hostname.length > hostnameMaxLen) {
|
|
this.hostname = "";
|
|
}
|
|
if (ipv6Hostname) {
|
|
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
|
}
|
|
}
|
|
var hash = rest.indexOf("#");
|
|
if (hash !== -1) {
|
|
this.hash = rest.substr(hash);
|
|
rest = rest.slice(0, hash);
|
|
}
|
|
var qm = rest.indexOf("?");
|
|
if (qm !== -1) {
|
|
this.search = rest.substr(qm);
|
|
rest = rest.slice(0, qm);
|
|
}
|
|
if (rest) {
|
|
this.pathname = rest;
|
|
}
|
|
if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
|
|
this.pathname = "";
|
|
}
|
|
return this;
|
|
};
|
|
Url.prototype.parseHost = function(host) {
|
|
var port = portPattern.exec(host);
|
|
if (port) {
|
|
port = port[0];
|
|
if (port !== ":") {
|
|
this.port = port.substr(1);
|
|
}
|
|
host = host.substr(0, host.length - port.length);
|
|
}
|
|
if (host) {
|
|
this.hostname = host;
|
|
}
|
|
};
|
|
module2.exports = urlParse;
|
|
}
|
|
});
|
|
|
|
// node_modules/mdurl/index.js
|
|
var require_mdurl = __commonJS({
|
|
"node_modules/mdurl/index.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports.encode = require_encode();
|
|
module2.exports.decode = require_decode2();
|
|
module2.exports.format = require_format();
|
|
module2.exports.parse = require_parse();
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/properties/Any/regex.js
|
|
var require_regex2 = __commonJS({
|
|
"node_modules/uc.micro/properties/Any/regex.js"(exports, module2) {
|
|
module2.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/categories/Cc/regex.js
|
|
var require_regex3 = __commonJS({
|
|
"node_modules/uc.micro/categories/Cc/regex.js"(exports, module2) {
|
|
module2.exports = /[\0-\x1F\x7F-\x9F]/;
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/categories/Cf/regex.js
|
|
var require_regex4 = __commonJS({
|
|
"node_modules/uc.micro/categories/Cf/regex.js"(exports, module2) {
|
|
module2.exports = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/categories/Z/regex.js
|
|
var require_regex5 = __commonJS({
|
|
"node_modules/uc.micro/categories/Z/regex.js"(exports, module2) {
|
|
module2.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
|
|
}
|
|
});
|
|
|
|
// node_modules/uc.micro/index.js
|
|
var require_uc = __commonJS({
|
|
"node_modules/uc.micro/index.js"(exports) {
|
|
"use strict";
|
|
exports.Any = require_regex2();
|
|
exports.Cc = require_regex3();
|
|
exports.Cf = require_regex4();
|
|
exports.P = require_regex();
|
|
exports.Z = require_regex5();
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/common/utils.js
|
|
var require_utils = __commonJS({
|
|
"node_modules/markdown-it/lib/common/utils.js"(exports) {
|
|
"use strict";
|
|
function _class(obj) {
|
|
return Object.prototype.toString.call(obj);
|
|
}
|
|
function isString(obj) {
|
|
return _class(obj) === "[object String]";
|
|
}
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
function has(object, key) {
|
|
return _hasOwnProperty.call(object, key);
|
|
}
|
|
function assign(obj) {
|
|
var sources = Array.prototype.slice.call(arguments, 1);
|
|
sources.forEach(function(source) {
|
|
if (!source) {
|
|
return;
|
|
}
|
|
if (typeof source !== "object") {
|
|
throw new TypeError(source + "must be object");
|
|
}
|
|
Object.keys(source).forEach(function(key) {
|
|
obj[key] = source[key];
|
|
});
|
|
});
|
|
return obj;
|
|
}
|
|
function arrayReplaceAt(src, pos, newElements) {
|
|
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
|
|
}
|
|
function isValidEntityCode(c2) {
|
|
if (c2 >= 55296 && c2 <= 57343) {
|
|
return false;
|
|
}
|
|
if (c2 >= 64976 && c2 <= 65007) {
|
|
return false;
|
|
}
|
|
if ((c2 & 65535) === 65535 || (c2 & 65535) === 65534) {
|
|
return false;
|
|
}
|
|
if (c2 >= 0 && c2 <= 8) {
|
|
return false;
|
|
}
|
|
if (c2 === 11) {
|
|
return false;
|
|
}
|
|
if (c2 >= 14 && c2 <= 31) {
|
|
return false;
|
|
}
|
|
if (c2 >= 127 && c2 <= 159) {
|
|
return false;
|
|
}
|
|
if (c2 > 1114111) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function fromCodePoint(c2) {
|
|
if (c2 > 65535) {
|
|
c2 -= 65536;
|
|
var surrogate1 = 55296 + (c2 >> 10), surrogate2 = 56320 + (c2 & 1023);
|
|
return String.fromCharCode(surrogate1, surrogate2);
|
|
}
|
|
return String.fromCharCode(c2);
|
|
}
|
|
var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
|
|
var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
|
|
var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
|
|
var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
|
|
var entities = require_entities2();
|
|
function replaceEntityPattern(match, name) {
|
|
var code = 0;
|
|
if (has(entities, name)) {
|
|
return entities[name];
|
|
}
|
|
if (name.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name)) {
|
|
code = name[1].toLowerCase() === "x" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
|
|
if (isValidEntityCode(code)) {
|
|
return fromCodePoint(code);
|
|
}
|
|
}
|
|
return match;
|
|
}
|
|
function unescapeMd(str) {
|
|
if (str.indexOf("\\") < 0) {
|
|
return str;
|
|
}
|
|
return str.replace(UNESCAPE_MD_RE, "$1");
|
|
}
|
|
function unescapeAll(str) {
|
|
if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) {
|
|
return str;
|
|
}
|
|
return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {
|
|
if (escaped) {
|
|
return escaped;
|
|
}
|
|
return replaceEntityPattern(match, entity);
|
|
});
|
|
}
|
|
var HTML_ESCAPE_TEST_RE = /[&<>"]/;
|
|
var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
|
|
var HTML_REPLACEMENTS = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
'"': """
|
|
};
|
|
function replaceUnsafeChar(ch) {
|
|
return HTML_REPLACEMENTS[ch];
|
|
}
|
|
function escapeHtml(str) {
|
|
if (HTML_ESCAPE_TEST_RE.test(str)) {
|
|
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
|
|
}
|
|
return str;
|
|
}
|
|
var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
|
|
function escapeRE(str) {
|
|
return str.replace(REGEXP_ESCAPE_RE, "\\$&");
|
|
}
|
|
function isSpace(code) {
|
|
switch (code) {
|
|
case 9:
|
|
case 32:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
function isWhiteSpace(code) {
|
|
if (code >= 8192 && code <= 8202) {
|
|
return true;
|
|
}
|
|
switch (code) {
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 32:
|
|
case 160:
|
|
case 5760:
|
|
case 8239:
|
|
case 8287:
|
|
case 12288:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
var UNICODE_PUNCT_RE = require_regex();
|
|
function isPunctChar(ch) {
|
|
return UNICODE_PUNCT_RE.test(ch);
|
|
}
|
|
function isMdAsciiPunct(ch) {
|
|
switch (ch) {
|
|
case 33:
|
|
case 34:
|
|
case 35:
|
|
case 36:
|
|
case 37:
|
|
case 38:
|
|
case 39:
|
|
case 40:
|
|
case 41:
|
|
case 42:
|
|
case 43:
|
|
case 44:
|
|
case 45:
|
|
case 46:
|
|
case 47:
|
|
case 58:
|
|
case 59:
|
|
case 60:
|
|
case 61:
|
|
case 62:
|
|
case 63:
|
|
case 64:
|
|
case 91:
|
|
case 92:
|
|
case 93:
|
|
case 94:
|
|
case 95:
|
|
case 96:
|
|
case 123:
|
|
case 124:
|
|
case 125:
|
|
case 126:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
function normalizeReference(str) {
|
|
str = str.trim().replace(/\s+/g, " ");
|
|
if ("\u1E9E".toLowerCase() === "\u1E7E") {
|
|
str = str.replace(/ẞ/g, "\xDF");
|
|
}
|
|
return str.toLowerCase().toUpperCase();
|
|
}
|
|
exports.lib = {};
|
|
exports.lib.mdurl = require_mdurl();
|
|
exports.lib.ucmicro = require_uc();
|
|
exports.assign = assign;
|
|
exports.isString = isString;
|
|
exports.has = has;
|
|
exports.unescapeMd = unescapeMd;
|
|
exports.unescapeAll = unescapeAll;
|
|
exports.isValidEntityCode = isValidEntityCode;
|
|
exports.fromCodePoint = fromCodePoint;
|
|
exports.escapeHtml = escapeHtml;
|
|
exports.arrayReplaceAt = arrayReplaceAt;
|
|
exports.isSpace = isSpace;
|
|
exports.isWhiteSpace = isWhiteSpace;
|
|
exports.isMdAsciiPunct = isMdAsciiPunct;
|
|
exports.isPunctChar = isPunctChar;
|
|
exports.escapeRE = escapeRE;
|
|
exports.normalizeReference = normalizeReference;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/helpers/parse_link_label.js
|
|
var require_parse_link_label = __commonJS({
|
|
"node_modules/markdown-it/lib/helpers/parse_link_label.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function parseLinkLabel(state, start, disableNested) {
|
|
var level, found, marker, prevPos, labelEnd = -1, max = state.posMax, oldPos = state.pos;
|
|
state.pos = start + 1;
|
|
level = 1;
|
|
while (state.pos < max) {
|
|
marker = state.src.charCodeAt(state.pos);
|
|
if (marker === 93) {
|
|
level--;
|
|
if (level === 0) {
|
|
found = true;
|
|
break;
|
|
}
|
|
}
|
|
prevPos = state.pos;
|
|
state.md.inline.skipToken(state);
|
|
if (marker === 91) {
|
|
if (prevPos === state.pos - 1) {
|
|
level++;
|
|
} else if (disableNested) {
|
|
state.pos = oldPos;
|
|
return -1;
|
|
}
|
|
}
|
|
}
|
|
if (found) {
|
|
labelEnd = state.pos;
|
|
}
|
|
state.pos = oldPos;
|
|
return labelEnd;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/helpers/parse_link_destination.js
|
|
var require_parse_link_destination = __commonJS({
|
|
"node_modules/markdown-it/lib/helpers/parse_link_destination.js"(exports, module2) {
|
|
"use strict";
|
|
var unescapeAll = require_utils().unescapeAll;
|
|
module2.exports = function parseLinkDestination(str, pos, max) {
|
|
var code, level, lines = 0, start = pos, result = {
|
|
ok: false,
|
|
pos: 0,
|
|
lines: 0,
|
|
str: ""
|
|
};
|
|
if (str.charCodeAt(pos) === 60) {
|
|
pos++;
|
|
while (pos < max) {
|
|
code = str.charCodeAt(pos);
|
|
if (code === 10) {
|
|
return result;
|
|
}
|
|
if (code === 60) {
|
|
return result;
|
|
}
|
|
if (code === 62) {
|
|
result.pos = pos + 1;
|
|
result.str = unescapeAll(str.slice(start + 1, pos));
|
|
result.ok = true;
|
|
return result;
|
|
}
|
|
if (code === 92 && pos + 1 < max) {
|
|
pos += 2;
|
|
continue;
|
|
}
|
|
pos++;
|
|
}
|
|
return result;
|
|
}
|
|
level = 0;
|
|
while (pos < max) {
|
|
code = str.charCodeAt(pos);
|
|
if (code === 32) {
|
|
break;
|
|
}
|
|
if (code < 32 || code === 127) {
|
|
break;
|
|
}
|
|
if (code === 92 && pos + 1 < max) {
|
|
if (str.charCodeAt(pos + 1) === 32) {
|
|
break;
|
|
}
|
|
pos += 2;
|
|
continue;
|
|
}
|
|
if (code === 40) {
|
|
level++;
|
|
if (level > 32) {
|
|
return result;
|
|
}
|
|
}
|
|
if (code === 41) {
|
|
if (level === 0) {
|
|
break;
|
|
}
|
|
level--;
|
|
}
|
|
pos++;
|
|
}
|
|
if (start === pos) {
|
|
return result;
|
|
}
|
|
if (level !== 0) {
|
|
return result;
|
|
}
|
|
result.str = unescapeAll(str.slice(start, pos));
|
|
result.lines = lines;
|
|
result.pos = pos;
|
|
result.ok = true;
|
|
return result;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/helpers/parse_link_title.js
|
|
var require_parse_link_title = __commonJS({
|
|
"node_modules/markdown-it/lib/helpers/parse_link_title.js"(exports, module2) {
|
|
"use strict";
|
|
var unescapeAll = require_utils().unescapeAll;
|
|
module2.exports = function parseLinkTitle(str, pos, max) {
|
|
var code, marker, lines = 0, start = pos, result = {
|
|
ok: false,
|
|
pos: 0,
|
|
lines: 0,
|
|
str: ""
|
|
};
|
|
if (pos >= max) {
|
|
return result;
|
|
}
|
|
marker = str.charCodeAt(pos);
|
|
if (marker !== 34 && marker !== 39 && marker !== 40) {
|
|
return result;
|
|
}
|
|
pos++;
|
|
if (marker === 40) {
|
|
marker = 41;
|
|
}
|
|
while (pos < max) {
|
|
code = str.charCodeAt(pos);
|
|
if (code === marker) {
|
|
result.pos = pos + 1;
|
|
result.lines = lines;
|
|
result.str = unescapeAll(str.slice(start + 1, pos));
|
|
result.ok = true;
|
|
return result;
|
|
} else if (code === 40 && marker === 41) {
|
|
return result;
|
|
} else if (code === 10) {
|
|
lines++;
|
|
} else if (code === 92 && pos + 1 < max) {
|
|
pos++;
|
|
if (str.charCodeAt(pos) === 10) {
|
|
lines++;
|
|
}
|
|
}
|
|
pos++;
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/helpers/index.js
|
|
var require_helpers = __commonJS({
|
|
"node_modules/markdown-it/lib/helpers/index.js"(exports) {
|
|
"use strict";
|
|
exports.parseLinkLabel = require_parse_link_label();
|
|
exports.parseLinkDestination = require_parse_link_destination();
|
|
exports.parseLinkTitle = require_parse_link_title();
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/renderer.js
|
|
var require_renderer = __commonJS({
|
|
"node_modules/markdown-it/lib/renderer.js"(exports, module2) {
|
|
"use strict";
|
|
var assign = require_utils().assign;
|
|
var unescapeAll = require_utils().unescapeAll;
|
|
var escapeHtml = require_utils().escapeHtml;
|
|
var default_rules = {};
|
|
default_rules.code_inline = function(tokens, idx, options, env, slf) {
|
|
var token = tokens[idx];
|
|
return "<code" + slf.renderAttrs(token) + ">" + escapeHtml(tokens[idx].content) + "</code>";
|
|
};
|
|
default_rules.code_block = function(tokens, idx, options, env, slf) {
|
|
var token = tokens[idx];
|
|
return "<pre" + slf.renderAttrs(token) + "><code>" + escapeHtml(tokens[idx].content) + "</code></pre>\n";
|
|
};
|
|
default_rules.fence = function(tokens, idx, options, env, slf) {
|
|
var token = tokens[idx], info = token.info ? unescapeAll(token.info).trim() : "", langName = "", langAttrs = "", highlighted, i2, arr, tmpAttrs, tmpToken;
|
|
if (info) {
|
|
arr = info.split(/(\s+)/g);
|
|
langName = arr[0];
|
|
langAttrs = arr.slice(2).join("");
|
|
}
|
|
if (options.highlight) {
|
|
highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
|
|
} else {
|
|
highlighted = escapeHtml(token.content);
|
|
}
|
|
if (highlighted.indexOf("<pre") === 0) {
|
|
return highlighted + "\n";
|
|
}
|
|
if (info) {
|
|
i2 = token.attrIndex("class");
|
|
tmpAttrs = token.attrs ? token.attrs.slice() : [];
|
|
if (i2 < 0) {
|
|
tmpAttrs.push(["class", options.langPrefix + langName]);
|
|
} else {
|
|
tmpAttrs[i2] = tmpAttrs[i2].slice();
|
|
tmpAttrs[i2][1] += " " + options.langPrefix + langName;
|
|
}
|
|
tmpToken = {
|
|
attrs: tmpAttrs
|
|
};
|
|
return "<pre><code" + slf.renderAttrs(tmpToken) + ">" + highlighted + "</code></pre>\n";
|
|
}
|
|
return "<pre><code" + slf.renderAttrs(token) + ">" + highlighted + "</code></pre>\n";
|
|
};
|
|
default_rules.image = function(tokens, idx, options, env, slf) {
|
|
var token = tokens[idx];
|
|
token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
|
|
return slf.renderToken(tokens, idx, options);
|
|
};
|
|
default_rules.hardbreak = function(tokens, idx, options) {
|
|
return options.xhtmlOut ? "<br />\n" : "<br>\n";
|
|
};
|
|
default_rules.softbreak = function(tokens, idx, options) {
|
|
return options.breaks ? options.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
|
};
|
|
default_rules.text = function(tokens, idx) {
|
|
return escapeHtml(tokens[idx].content);
|
|
};
|
|
default_rules.html_block = function(tokens, idx) {
|
|
return tokens[idx].content;
|
|
};
|
|
default_rules.html_inline = function(tokens, idx) {
|
|
return tokens[idx].content;
|
|
};
|
|
function Renderer() {
|
|
this.rules = assign({}, default_rules);
|
|
}
|
|
Renderer.prototype.renderAttrs = function renderAttrs(token) {
|
|
var i2, l2, result;
|
|
if (!token.attrs) {
|
|
return "";
|
|
}
|
|
result = "";
|
|
for (i2 = 0, l2 = token.attrs.length; i2 < l2; i2++) {
|
|
result += " " + escapeHtml(token.attrs[i2][0]) + '="' + escapeHtml(token.attrs[i2][1]) + '"';
|
|
}
|
|
return result;
|
|
};
|
|
Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
|
|
var nextToken, result = "", needLf = false, token = tokens[idx];
|
|
if (token.hidden) {
|
|
return "";
|
|
}
|
|
if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
|
|
result += "\n";
|
|
}
|
|
result += (token.nesting === -1 ? "</" : "<") + token.tag;
|
|
result += this.renderAttrs(token);
|
|
if (token.nesting === 0 && options.xhtmlOut) {
|
|
result += " /";
|
|
}
|
|
if (token.block) {
|
|
needLf = true;
|
|
if (token.nesting === 1) {
|
|
if (idx + 1 < tokens.length) {
|
|
nextToken = tokens[idx + 1];
|
|
if (nextToken.type === "inline" || nextToken.hidden) {
|
|
needLf = false;
|
|
} else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
|
|
needLf = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
result += needLf ? ">\n" : ">";
|
|
return result;
|
|
};
|
|
Renderer.prototype.renderInline = function(tokens, options, env) {
|
|
var type, result = "", rules = this.rules;
|
|
for (var i2 = 0, len = tokens.length; i2 < len; i2++) {
|
|
type = tokens[i2].type;
|
|
if (typeof rules[type] !== "undefined") {
|
|
result += rules[type](tokens, i2, options, env, this);
|
|
} else {
|
|
result += this.renderToken(tokens, i2, options);
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
Renderer.prototype.renderInlineAsText = function(tokens, options, env) {
|
|
var result = "";
|
|
for (var i2 = 0, len = tokens.length; i2 < len; i2++) {
|
|
if (tokens[i2].type === "text") {
|
|
result += tokens[i2].content;
|
|
} else if (tokens[i2].type === "image") {
|
|
result += this.renderInlineAsText(tokens[i2].children, options, env);
|
|
} else if (tokens[i2].type === "softbreak") {
|
|
result += "\n";
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
Renderer.prototype.render = function(tokens, options, env) {
|
|
var i2, len, type, result = "", rules = this.rules;
|
|
for (i2 = 0, len = tokens.length; i2 < len; i2++) {
|
|
type = tokens[i2].type;
|
|
if (type === "inline") {
|
|
result += this.renderInline(tokens[i2].children, options, env);
|
|
} else if (typeof rules[type] !== "undefined") {
|
|
result += rules[tokens[i2].type](tokens, i2, options, env, this);
|
|
} else {
|
|
result += this.renderToken(tokens, i2, options, env);
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
module2.exports = Renderer;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/ruler.js
|
|
var require_ruler = __commonJS({
|
|
"node_modules/markdown-it/lib/ruler.js"(exports, module2) {
|
|
"use strict";
|
|
function Ruler() {
|
|
this.__rules__ = [];
|
|
this.__cache__ = null;
|
|
}
|
|
Ruler.prototype.__find__ = function(name) {
|
|
for (var i2 = 0; i2 < this.__rules__.length; i2++) {
|
|
if (this.__rules__[i2].name === name) {
|
|
return i2;
|
|
}
|
|
}
|
|
return -1;
|
|
};
|
|
Ruler.prototype.__compile__ = function() {
|
|
var self2 = this;
|
|
var chains = [""];
|
|
self2.__rules__.forEach(function(rule) {
|
|
if (!rule.enabled) {
|
|
return;
|
|
}
|
|
rule.alt.forEach(function(altName) {
|
|
if (chains.indexOf(altName) < 0) {
|
|
chains.push(altName);
|
|
}
|
|
});
|
|
});
|
|
self2.__cache__ = {};
|
|
chains.forEach(function(chain) {
|
|
self2.__cache__[chain] = [];
|
|
self2.__rules__.forEach(function(rule) {
|
|
if (!rule.enabled) {
|
|
return;
|
|
}
|
|
if (chain && rule.alt.indexOf(chain) < 0) {
|
|
return;
|
|
}
|
|
self2.__cache__[chain].push(rule.fn);
|
|
});
|
|
});
|
|
};
|
|
Ruler.prototype.at = function(name, fn2, options) {
|
|
var index = this.__find__(name);
|
|
var opt = options || {};
|
|
if (index === -1) {
|
|
throw new Error("Parser rule not found: " + name);
|
|
}
|
|
this.__rules__[index].fn = fn2;
|
|
this.__rules__[index].alt = opt.alt || [];
|
|
this.__cache__ = null;
|
|
};
|
|
Ruler.prototype.before = function(beforeName, ruleName, fn2, options) {
|
|
var index = this.__find__(beforeName);
|
|
var opt = options || {};
|
|
if (index === -1) {
|
|
throw new Error("Parser rule not found: " + beforeName);
|
|
}
|
|
this.__rules__.splice(index, 0, {
|
|
name: ruleName,
|
|
enabled: true,
|
|
fn: fn2,
|
|
alt: opt.alt || []
|
|
});
|
|
this.__cache__ = null;
|
|
};
|
|
Ruler.prototype.after = function(afterName, ruleName, fn2, options) {
|
|
var index = this.__find__(afterName);
|
|
var opt = options || {};
|
|
if (index === -1) {
|
|
throw new Error("Parser rule not found: " + afterName);
|
|
}
|
|
this.__rules__.splice(index + 1, 0, {
|
|
name: ruleName,
|
|
enabled: true,
|
|
fn: fn2,
|
|
alt: opt.alt || []
|
|
});
|
|
this.__cache__ = null;
|
|
};
|
|
Ruler.prototype.push = function(ruleName, fn2, options) {
|
|
var opt = options || {};
|
|
this.__rules__.push({
|
|
name: ruleName,
|
|
enabled: true,
|
|
fn: fn2,
|
|
alt: opt.alt || []
|
|
});
|
|
this.__cache__ = null;
|
|
};
|
|
Ruler.prototype.enable = function(list, ignoreInvalid) {
|
|
if (!Array.isArray(list)) {
|
|
list = [list];
|
|
}
|
|
var result = [];
|
|
list.forEach(function(name) {
|
|
var idx = this.__find__(name);
|
|
if (idx < 0) {
|
|
if (ignoreInvalid) {
|
|
return;
|
|
}
|
|
throw new Error("Rules manager: invalid rule name " + name);
|
|
}
|
|
this.__rules__[idx].enabled = true;
|
|
result.push(name);
|
|
}, this);
|
|
this.__cache__ = null;
|
|
return result;
|
|
};
|
|
Ruler.prototype.enableOnly = function(list, ignoreInvalid) {
|
|
if (!Array.isArray(list)) {
|
|
list = [list];
|
|
}
|
|
this.__rules__.forEach(function(rule) {
|
|
rule.enabled = false;
|
|
});
|
|
this.enable(list, ignoreInvalid);
|
|
};
|
|
Ruler.prototype.disable = function(list, ignoreInvalid) {
|
|
if (!Array.isArray(list)) {
|
|
list = [list];
|
|
}
|
|
var result = [];
|
|
list.forEach(function(name) {
|
|
var idx = this.__find__(name);
|
|
if (idx < 0) {
|
|
if (ignoreInvalid) {
|
|
return;
|
|
}
|
|
throw new Error("Rules manager: invalid rule name " + name);
|
|
}
|
|
this.__rules__[idx].enabled = false;
|
|
result.push(name);
|
|
}, this);
|
|
this.__cache__ = null;
|
|
return result;
|
|
};
|
|
Ruler.prototype.getRules = function(chainName) {
|
|
if (this.__cache__ === null) {
|
|
this.__compile__();
|
|
}
|
|
return this.__cache__[chainName] || [];
|
|
};
|
|
module2.exports = Ruler;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/normalize.js
|
|
var require_normalize = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/normalize.js"(exports, module2) {
|
|
"use strict";
|
|
var NEWLINES_RE = /\r\n?|\n/g;
|
|
var NULL_RE = /\0/g;
|
|
module2.exports = function normalize(state) {
|
|
var str;
|
|
str = state.src.replace(NEWLINES_RE, "\n");
|
|
str = str.replace(NULL_RE, "\uFFFD");
|
|
state.src = str;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/block.js
|
|
var require_block = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/block.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function block(state) {
|
|
var token;
|
|
if (state.inlineMode) {
|
|
token = new state.Token("inline", "", 0);
|
|
token.content = state.src;
|
|
token.map = [0, 1];
|
|
token.children = [];
|
|
state.tokens.push(token);
|
|
} else {
|
|
state.md.block.parse(state.src, state.md, state.env, state.tokens);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/inline.js
|
|
var require_inline = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/inline.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function inline(state) {
|
|
var tokens = state.tokens, tok, i2, l2;
|
|
for (i2 = 0, l2 = tokens.length; i2 < l2; i2++) {
|
|
tok = tokens[i2];
|
|
if (tok.type === "inline") {
|
|
state.md.inline.parse(tok.content, state.md, state.env, tok.children);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/linkify.js
|
|
var require_linkify = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/linkify.js"(exports, module2) {
|
|
"use strict";
|
|
var arrayReplaceAt = require_utils().arrayReplaceAt;
|
|
function isLinkOpen(str) {
|
|
return /^<a[>\s]/i.test(str);
|
|
}
|
|
function isLinkClose(str) {
|
|
return /^<\/a\s*>/i.test(str);
|
|
}
|
|
module2.exports = function linkify(state) {
|
|
var i2, j2, l2, tokens, token, currentToken, nodes, ln2, text, pos, lastPos, level, htmlLinkLevel, url, fullUrl, urlText, blockTokens = state.tokens, links;
|
|
if (!state.md.options.linkify) {
|
|
return;
|
|
}
|
|
for (j2 = 0, l2 = blockTokens.length; j2 < l2; j2++) {
|
|
if (blockTokens[j2].type !== "inline" || !state.md.linkify.pretest(blockTokens[j2].content)) {
|
|
continue;
|
|
}
|
|
tokens = blockTokens[j2].children;
|
|
htmlLinkLevel = 0;
|
|
for (i2 = tokens.length - 1; i2 >= 0; i2--) {
|
|
currentToken = tokens[i2];
|
|
if (currentToken.type === "link_close") {
|
|
i2--;
|
|
while (tokens[i2].level !== currentToken.level && tokens[i2].type !== "link_open") {
|
|
i2--;
|
|
}
|
|
continue;
|
|
}
|
|
if (currentToken.type === "html_inline") {
|
|
if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
|
|
htmlLinkLevel--;
|
|
}
|
|
if (isLinkClose(currentToken.content)) {
|
|
htmlLinkLevel++;
|
|
}
|
|
}
|
|
if (htmlLinkLevel > 0) {
|
|
continue;
|
|
}
|
|
if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
|
|
text = currentToken.content;
|
|
links = state.md.linkify.match(text);
|
|
nodes = [];
|
|
level = currentToken.level;
|
|
lastPos = 0;
|
|
if (links.length > 0 && links[0].index === 0 && i2 > 0 && tokens[i2 - 1].type === "text_special") {
|
|
links = links.slice(1);
|
|
}
|
|
for (ln2 = 0; ln2 < links.length; ln2++) {
|
|
url = links[ln2].url;
|
|
fullUrl = state.md.normalizeLink(url);
|
|
if (!state.md.validateLink(fullUrl)) {
|
|
continue;
|
|
}
|
|
urlText = links[ln2].text;
|
|
if (!links[ln2].schema) {
|
|
urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, "");
|
|
} else if (links[ln2].schema === "mailto:" && !/^mailto:/i.test(urlText)) {
|
|
urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, "");
|
|
} else {
|
|
urlText = state.md.normalizeLinkText(urlText);
|
|
}
|
|
pos = links[ln2].index;
|
|
if (pos > lastPos) {
|
|
token = new state.Token("text", "", 0);
|
|
token.content = text.slice(lastPos, pos);
|
|
token.level = level;
|
|
nodes.push(token);
|
|
}
|
|
token = new state.Token("link_open", "a", 1);
|
|
token.attrs = [["href", fullUrl]];
|
|
token.level = level++;
|
|
token.markup = "linkify";
|
|
token.info = "auto";
|
|
nodes.push(token);
|
|
token = new state.Token("text", "", 0);
|
|
token.content = urlText;
|
|
token.level = level;
|
|
nodes.push(token);
|
|
token = new state.Token("link_close", "a", -1);
|
|
token.level = --level;
|
|
token.markup = "linkify";
|
|
token.info = "auto";
|
|
nodes.push(token);
|
|
lastPos = links[ln2].lastIndex;
|
|
}
|
|
if (lastPos < text.length) {
|
|
token = new state.Token("text", "", 0);
|
|
token.content = text.slice(lastPos);
|
|
token.level = level;
|
|
nodes.push(token);
|
|
}
|
|
blockTokens[j2].children = tokens = arrayReplaceAt(tokens, i2, nodes);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/replacements.js
|
|
var require_replacements = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/replacements.js"(exports, module2) {
|
|
"use strict";
|
|
var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
|
|
var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
|
|
var SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
|
|
var SCOPED_ABBR = {
|
|
c: "\xA9",
|
|
r: "\xAE",
|
|
tm: "\u2122"
|
|
};
|
|
function replaceFn(match, name) {
|
|
return SCOPED_ABBR[name.toLowerCase()];
|
|
}
|
|
function replace_scoped(inlineTokens) {
|
|
var i2, token, inside_autolink = 0;
|
|
for (i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
|
|
token = inlineTokens[i2];
|
|
if (token.type === "text" && !inside_autolink) {
|
|
token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
|
|
}
|
|
if (token.type === "link_open" && token.info === "auto") {
|
|
inside_autolink--;
|
|
}
|
|
if (token.type === "link_close" && token.info === "auto") {
|
|
inside_autolink++;
|
|
}
|
|
}
|
|
}
|
|
function replace_rare(inlineTokens) {
|
|
var i2, token, inside_autolink = 0;
|
|
for (i2 = inlineTokens.length - 1; i2 >= 0; i2--) {
|
|
token = inlineTokens[i2];
|
|
if (token.type === "text" && !inside_autolink) {
|
|
if (RARE_RE.test(token.content)) {
|
|
token.content = token.content.replace(/\+-/g, "\xB1").replace(/\.{2,}/g, "\u2026").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1\u2014").replace(/(^|\s)--(?=\s|$)/mg, "$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1\u2013");
|
|
}
|
|
}
|
|
if (token.type === "link_open" && token.info === "auto") {
|
|
inside_autolink--;
|
|
}
|
|
if (token.type === "link_close" && token.info === "auto") {
|
|
inside_autolink++;
|
|
}
|
|
}
|
|
}
|
|
module2.exports = function replace(state) {
|
|
var blkIdx;
|
|
if (!state.md.options.typographer) {
|
|
return;
|
|
}
|
|
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
|
if (state.tokens[blkIdx].type !== "inline") {
|
|
continue;
|
|
}
|
|
if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
|
|
replace_scoped(state.tokens[blkIdx].children);
|
|
}
|
|
if (RARE_RE.test(state.tokens[blkIdx].content)) {
|
|
replace_rare(state.tokens[blkIdx].children);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/smartquotes.js
|
|
var require_smartquotes = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/smartquotes.js"(exports, module2) {
|
|
"use strict";
|
|
var isWhiteSpace = require_utils().isWhiteSpace;
|
|
var isPunctChar = require_utils().isPunctChar;
|
|
var isMdAsciiPunct = require_utils().isMdAsciiPunct;
|
|
var QUOTE_TEST_RE = /['"]/;
|
|
var QUOTE_RE = /['"]/g;
|
|
var APOSTROPHE = "\u2019";
|
|
function replaceAt(str, index, ch) {
|
|
return str.slice(0, index) + ch + str.slice(index + 1);
|
|
}
|
|
function process_inlines(tokens, state) {
|
|
var i2, token, text, t2, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j2, isSingle, stack, openQuote, closeQuote;
|
|
stack = [];
|
|
for (i2 = 0; i2 < tokens.length; i2++) {
|
|
token = tokens[i2];
|
|
thisLevel = tokens[i2].level;
|
|
for (j2 = stack.length - 1; j2 >= 0; j2--) {
|
|
if (stack[j2].level <= thisLevel) {
|
|
break;
|
|
}
|
|
}
|
|
stack.length = j2 + 1;
|
|
if (token.type !== "text") {
|
|
continue;
|
|
}
|
|
text = token.content;
|
|
pos = 0;
|
|
max = text.length;
|
|
OUTER:
|
|
while (pos < max) {
|
|
QUOTE_RE.lastIndex = pos;
|
|
t2 = QUOTE_RE.exec(text);
|
|
if (!t2) {
|
|
break;
|
|
}
|
|
canOpen = canClose = true;
|
|
pos = t2.index + 1;
|
|
isSingle = t2[0] === "'";
|
|
lastChar = 32;
|
|
if (t2.index - 1 >= 0) {
|
|
lastChar = text.charCodeAt(t2.index - 1);
|
|
} else {
|
|
for (j2 = i2 - 1; j2 >= 0; j2--) {
|
|
if (tokens[j2].type === "softbreak" || tokens[j2].type === "hardbreak")
|
|
break;
|
|
if (!tokens[j2].content)
|
|
continue;
|
|
lastChar = tokens[j2].content.charCodeAt(tokens[j2].content.length - 1);
|
|
break;
|
|
}
|
|
}
|
|
nextChar = 32;
|
|
if (pos < max) {
|
|
nextChar = text.charCodeAt(pos);
|
|
} else {
|
|
for (j2 = i2 + 1; j2 < tokens.length; j2++) {
|
|
if (tokens[j2].type === "softbreak" || tokens[j2].type === "hardbreak")
|
|
break;
|
|
if (!tokens[j2].content)
|
|
continue;
|
|
nextChar = tokens[j2].content.charCodeAt(0);
|
|
break;
|
|
}
|
|
}
|
|
isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
|
|
isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
|
|
isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
if (isNextWhiteSpace) {
|
|
canOpen = false;
|
|
} else if (isNextPunctChar) {
|
|
if (!(isLastWhiteSpace || isLastPunctChar)) {
|
|
canOpen = false;
|
|
}
|
|
}
|
|
if (isLastWhiteSpace) {
|
|
canClose = false;
|
|
} else if (isLastPunctChar) {
|
|
if (!(isNextWhiteSpace || isNextPunctChar)) {
|
|
canClose = false;
|
|
}
|
|
}
|
|
if (nextChar === 34 && t2[0] === '"') {
|
|
if (lastChar >= 48 && lastChar <= 57) {
|
|
canClose = canOpen = false;
|
|
}
|
|
}
|
|
if (canOpen && canClose) {
|
|
canOpen = isLastPunctChar;
|
|
canClose = isNextPunctChar;
|
|
}
|
|
if (!canOpen && !canClose) {
|
|
if (isSingle) {
|
|
token.content = replaceAt(token.content, t2.index, APOSTROPHE);
|
|
}
|
|
continue;
|
|
}
|
|
if (canClose) {
|
|
for (j2 = stack.length - 1; j2 >= 0; j2--) {
|
|
item = stack[j2];
|
|
if (stack[j2].level < thisLevel) {
|
|
break;
|
|
}
|
|
if (item.single === isSingle && stack[j2].level === thisLevel) {
|
|
item = stack[j2];
|
|
if (isSingle) {
|
|
openQuote = state.md.options.quotes[2];
|
|
closeQuote = state.md.options.quotes[3];
|
|
} else {
|
|
openQuote = state.md.options.quotes[0];
|
|
closeQuote = state.md.options.quotes[1];
|
|
}
|
|
token.content = replaceAt(token.content, t2.index, closeQuote);
|
|
tokens[item.token].content = replaceAt(
|
|
tokens[item.token].content,
|
|
item.pos,
|
|
openQuote
|
|
);
|
|
pos += closeQuote.length - 1;
|
|
if (item.token === i2) {
|
|
pos += openQuote.length - 1;
|
|
}
|
|
text = token.content;
|
|
max = text.length;
|
|
stack.length = j2;
|
|
continue OUTER;
|
|
}
|
|
}
|
|
}
|
|
if (canOpen) {
|
|
stack.push({
|
|
token: i2,
|
|
pos: t2.index,
|
|
single: isSingle,
|
|
level: thisLevel
|
|
});
|
|
} else if (canClose && isSingle) {
|
|
token.content = replaceAt(token.content, t2.index, APOSTROPHE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
module2.exports = function smartquotes(state) {
|
|
var blkIdx;
|
|
if (!state.md.options.typographer) {
|
|
return;
|
|
}
|
|
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
|
if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
|
|
continue;
|
|
}
|
|
process_inlines(state.tokens[blkIdx].children, state);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/text_join.js
|
|
var require_text_join = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/text_join.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function text_join(state) {
|
|
var j2, l2, tokens, curr, max, last, blockTokens = state.tokens;
|
|
for (j2 = 0, l2 = blockTokens.length; j2 < l2; j2++) {
|
|
if (blockTokens[j2].type !== "inline")
|
|
continue;
|
|
tokens = blockTokens[j2].children;
|
|
max = tokens.length;
|
|
for (curr = 0; curr < max; curr++) {
|
|
if (tokens[curr].type === "text_special") {
|
|
tokens[curr].type = "text";
|
|
}
|
|
}
|
|
for (curr = last = 0; curr < max; curr++) {
|
|
if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
|
|
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
|
|
} else {
|
|
if (curr !== last) {
|
|
tokens[last] = tokens[curr];
|
|
}
|
|
last++;
|
|
}
|
|
}
|
|
if (curr !== last) {
|
|
tokens.length = last;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/token.js
|
|
var require_token = __commonJS({
|
|
"node_modules/markdown-it/lib/token.js"(exports, module2) {
|
|
"use strict";
|
|
function Token(type, tag, nesting) {
|
|
this.type = type;
|
|
this.tag = tag;
|
|
this.attrs = null;
|
|
this.map = null;
|
|
this.nesting = nesting;
|
|
this.level = 0;
|
|
this.children = null;
|
|
this.content = "";
|
|
this.markup = "";
|
|
this.info = "";
|
|
this.meta = null;
|
|
this.block = false;
|
|
this.hidden = false;
|
|
}
|
|
Token.prototype.attrIndex = function attrIndex(name) {
|
|
var attrs, i2, len;
|
|
if (!this.attrs) {
|
|
return -1;
|
|
}
|
|
attrs = this.attrs;
|
|
for (i2 = 0, len = attrs.length; i2 < len; i2++) {
|
|
if (attrs[i2][0] === name) {
|
|
return i2;
|
|
}
|
|
}
|
|
return -1;
|
|
};
|
|
Token.prototype.attrPush = function attrPush(attrData) {
|
|
if (this.attrs) {
|
|
this.attrs.push(attrData);
|
|
} else {
|
|
this.attrs = [attrData];
|
|
}
|
|
};
|
|
Token.prototype.attrSet = function attrSet(name, value) {
|
|
var idx = this.attrIndex(name), attrData = [name, value];
|
|
if (idx < 0) {
|
|
this.attrPush(attrData);
|
|
} else {
|
|
this.attrs[idx] = attrData;
|
|
}
|
|
};
|
|
Token.prototype.attrGet = function attrGet(name) {
|
|
var idx = this.attrIndex(name), value = null;
|
|
if (idx >= 0) {
|
|
value = this.attrs[idx][1];
|
|
}
|
|
return value;
|
|
};
|
|
Token.prototype.attrJoin = function attrJoin(name, value) {
|
|
var idx = this.attrIndex(name);
|
|
if (idx < 0) {
|
|
this.attrPush([name, value]);
|
|
} else {
|
|
this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
|
|
}
|
|
};
|
|
module2.exports = Token;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_core/state_core.js
|
|
var require_state_core = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_core/state_core.js"(exports, module2) {
|
|
"use strict";
|
|
var Token = require_token();
|
|
function StateCore(src, md2, env) {
|
|
this.src = src;
|
|
this.env = env;
|
|
this.tokens = [];
|
|
this.inlineMode = false;
|
|
this.md = md2;
|
|
}
|
|
StateCore.prototype.Token = Token;
|
|
module2.exports = StateCore;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/parser_core.js
|
|
var require_parser_core = __commonJS({
|
|
"node_modules/markdown-it/lib/parser_core.js"(exports, module2) {
|
|
"use strict";
|
|
var Ruler = require_ruler();
|
|
var _rules = [
|
|
["normalize", require_normalize()],
|
|
["block", require_block()],
|
|
["inline", require_inline()],
|
|
["linkify", require_linkify()],
|
|
["replacements", require_replacements()],
|
|
["smartquotes", require_smartquotes()],
|
|
["text_join", require_text_join()]
|
|
];
|
|
function Core() {
|
|
this.ruler = new Ruler();
|
|
for (var i2 = 0; i2 < _rules.length; i2++) {
|
|
this.ruler.push(_rules[i2][0], _rules[i2][1]);
|
|
}
|
|
}
|
|
Core.prototype.process = function(state) {
|
|
var i2, l2, rules;
|
|
rules = this.ruler.getRules("");
|
|
for (i2 = 0, l2 = rules.length; i2 < l2; i2++) {
|
|
rules[i2](state);
|
|
}
|
|
};
|
|
Core.prototype.State = require_state_core();
|
|
module2.exports = Core;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/table.js
|
|
var require_table = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/table.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
function getLine(state, line) {
|
|
var pos = state.bMarks[line] + state.tShift[line], max = state.eMarks[line];
|
|
return state.src.slice(pos, max);
|
|
}
|
|
function escapedSplit(str) {
|
|
var result = [], pos = 0, max = str.length, ch, isEscaped = false, lastPos = 0, current = "";
|
|
ch = str.charCodeAt(pos);
|
|
while (pos < max) {
|
|
if (ch === 124) {
|
|
if (!isEscaped) {
|
|
result.push(current + str.substring(lastPos, pos));
|
|
current = "";
|
|
lastPos = pos + 1;
|
|
} else {
|
|
current += str.substring(lastPos, pos - 1);
|
|
lastPos = pos;
|
|
}
|
|
}
|
|
isEscaped = ch === 92;
|
|
pos++;
|
|
ch = str.charCodeAt(pos);
|
|
}
|
|
result.push(current + str.substring(lastPos));
|
|
return result;
|
|
}
|
|
module2.exports = function table(state, startLine, endLine, silent) {
|
|
var ch, lineText, pos, i2, l2, nextLine, columns, columnCount, token, aligns, t2, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh;
|
|
if (startLine + 2 > endLine) {
|
|
return false;
|
|
}
|
|
nextLine = startLine + 1;
|
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
return false;
|
|
}
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
if (pos >= state.eMarks[nextLine]) {
|
|
return false;
|
|
}
|
|
firstCh = state.src.charCodeAt(pos++);
|
|
if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) {
|
|
return false;
|
|
}
|
|
if (pos >= state.eMarks[nextLine]) {
|
|
return false;
|
|
}
|
|
secondCh = state.src.charCodeAt(pos++);
|
|
if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) {
|
|
return false;
|
|
}
|
|
if (firstCh === 45 && isSpace(secondCh)) {
|
|
return false;
|
|
}
|
|
while (pos < state.eMarks[nextLine]) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) {
|
|
return false;
|
|
}
|
|
pos++;
|
|
}
|
|
lineText = getLine(state, startLine + 1);
|
|
columns = lineText.split("|");
|
|
aligns = [];
|
|
for (i2 = 0; i2 < columns.length; i2++) {
|
|
t2 = columns[i2].trim();
|
|
if (!t2) {
|
|
if (i2 === 0 || i2 === columns.length - 1) {
|
|
continue;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
if (!/^:?-+:?$/.test(t2)) {
|
|
return false;
|
|
}
|
|
if (t2.charCodeAt(t2.length - 1) === 58) {
|
|
aligns.push(t2.charCodeAt(0) === 58 ? "center" : "right");
|
|
} else if (t2.charCodeAt(0) === 58) {
|
|
aligns.push("left");
|
|
} else {
|
|
aligns.push("");
|
|
}
|
|
}
|
|
lineText = getLine(state, startLine).trim();
|
|
if (lineText.indexOf("|") === -1) {
|
|
return false;
|
|
}
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
columns = escapedSplit(lineText);
|
|
if (columns.length && columns[0] === "")
|
|
columns.shift();
|
|
if (columns.length && columns[columns.length - 1] === "")
|
|
columns.pop();
|
|
columnCount = columns.length;
|
|
if (columnCount === 0 || columnCount !== aligns.length) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
oldParentType = state.parentType;
|
|
state.parentType = "table";
|
|
terminatorRules = state.md.block.ruler.getRules("blockquote");
|
|
token = state.push("table_open", "table", 1);
|
|
token.map = tableLines = [startLine, 0];
|
|
token = state.push("thead_open", "thead", 1);
|
|
token.map = [startLine, startLine + 1];
|
|
token = state.push("tr_open", "tr", 1);
|
|
token.map = [startLine, startLine + 1];
|
|
for (i2 = 0; i2 < columns.length; i2++) {
|
|
token = state.push("th_open", "th", 1);
|
|
if (aligns[i2]) {
|
|
token.attrs = [["style", "text-align:" + aligns[i2]]];
|
|
}
|
|
token = state.push("inline", "", 0);
|
|
token.content = columns[i2].trim();
|
|
token.children = [];
|
|
token = state.push("th_close", "th", -1);
|
|
}
|
|
token = state.push("tr_close", "tr", -1);
|
|
token = state.push("thead_close", "thead", -1);
|
|
for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
|
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
break;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
break;
|
|
}
|
|
lineText = getLine(state, nextLine).trim();
|
|
if (!lineText) {
|
|
break;
|
|
}
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
break;
|
|
}
|
|
columns = escapedSplit(lineText);
|
|
if (columns.length && columns[0] === "")
|
|
columns.shift();
|
|
if (columns.length && columns[columns.length - 1] === "")
|
|
columns.pop();
|
|
if (nextLine === startLine + 2) {
|
|
token = state.push("tbody_open", "tbody", 1);
|
|
token.map = tbodyLines = [startLine + 2, 0];
|
|
}
|
|
token = state.push("tr_open", "tr", 1);
|
|
token.map = [nextLine, nextLine + 1];
|
|
for (i2 = 0; i2 < columnCount; i2++) {
|
|
token = state.push("td_open", "td", 1);
|
|
if (aligns[i2]) {
|
|
token.attrs = [["style", "text-align:" + aligns[i2]]];
|
|
}
|
|
token = state.push("inline", "", 0);
|
|
token.content = columns[i2] ? columns[i2].trim() : "";
|
|
token.children = [];
|
|
token = state.push("td_close", "td", -1);
|
|
}
|
|
token = state.push("tr_close", "tr", -1);
|
|
}
|
|
if (tbodyLines) {
|
|
token = state.push("tbody_close", "tbody", -1);
|
|
tbodyLines[1] = nextLine;
|
|
}
|
|
token = state.push("table_close", "table", -1);
|
|
tableLines[1] = nextLine;
|
|
state.parentType = oldParentType;
|
|
state.line = nextLine;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/code.js
|
|
var require_code = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/code.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function code(state, startLine, endLine) {
|
|
var nextLine, last, token;
|
|
if (state.sCount[startLine] - state.blkIndent < 4) {
|
|
return false;
|
|
}
|
|
last = nextLine = startLine + 1;
|
|
while (nextLine < endLine) {
|
|
if (state.isEmpty(nextLine)) {
|
|
nextLine++;
|
|
continue;
|
|
}
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
nextLine++;
|
|
last = nextLine;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
state.line = last;
|
|
token = state.push("code_block", "code", 0);
|
|
token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
|
|
token.map = [startLine, state.line];
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/fence.js
|
|
var require_fence = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/fence.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function fence(state, startLine, endLine, silent) {
|
|
var marker, len, params, nextLine, mem, token, markup, haveEndMarker = false, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
if (pos + 3 > max) {
|
|
return false;
|
|
}
|
|
marker = state.src.charCodeAt(pos);
|
|
if (marker !== 126 && marker !== 96) {
|
|
return false;
|
|
}
|
|
mem = pos;
|
|
pos = state.skipChars(pos, marker);
|
|
len = pos - mem;
|
|
if (len < 3) {
|
|
return false;
|
|
}
|
|
markup = state.src.slice(mem, pos);
|
|
params = state.src.slice(pos, max);
|
|
if (marker === 96) {
|
|
if (params.indexOf(String.fromCharCode(marker)) >= 0) {
|
|
return false;
|
|
}
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
nextLine = startLine;
|
|
for (; ; ) {
|
|
nextLine++;
|
|
if (nextLine >= endLine) {
|
|
break;
|
|
}
|
|
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
max = state.eMarks[nextLine];
|
|
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
|
|
break;
|
|
}
|
|
if (state.src.charCodeAt(pos) !== marker) {
|
|
continue;
|
|
}
|
|
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
continue;
|
|
}
|
|
pos = state.skipChars(pos, marker);
|
|
if (pos - mem < len) {
|
|
continue;
|
|
}
|
|
pos = state.skipSpaces(pos);
|
|
if (pos < max) {
|
|
continue;
|
|
}
|
|
haveEndMarker = true;
|
|
break;
|
|
}
|
|
len = state.sCount[startLine];
|
|
state.line = nextLine + (haveEndMarker ? 1 : 0);
|
|
token = state.push("fence", "code", 0);
|
|
token.info = params;
|
|
token.content = state.getLines(startLine + 1, nextLine, len, true);
|
|
token.markup = markup;
|
|
token.map = [startLine, state.line];
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/blockquote.js
|
|
var require_blockquote = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/blockquote.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function blockquote(state, startLine, endLine, silent) {
|
|
var adjustTab, ch, i2, initial, l2, lastLineEmpty, lines, nextLine, offset, oldBMarks, oldBSCount, oldIndent, oldParentType, oldSCount, oldTShift, spaceAfterMarker, terminate, terminatorRules, token, isOutdented, oldLineMax = state.lineMax, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
if (state.src.charCodeAt(pos++) !== 62) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
initial = offset = state.sCount[startLine] + 1;
|
|
if (state.src.charCodeAt(pos) === 32) {
|
|
pos++;
|
|
initial++;
|
|
offset++;
|
|
adjustTab = false;
|
|
spaceAfterMarker = true;
|
|
} else if (state.src.charCodeAt(pos) === 9) {
|
|
spaceAfterMarker = true;
|
|
if ((state.bsCount[startLine] + offset) % 4 === 3) {
|
|
pos++;
|
|
initial++;
|
|
offset++;
|
|
adjustTab = false;
|
|
} else {
|
|
adjustTab = true;
|
|
}
|
|
} else {
|
|
spaceAfterMarker = false;
|
|
}
|
|
oldBMarks = [state.bMarks[startLine]];
|
|
state.bMarks[startLine] = pos;
|
|
while (pos < max) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (isSpace(ch)) {
|
|
if (ch === 9) {
|
|
offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
|
|
} else {
|
|
offset++;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
oldBSCount = [state.bsCount[startLine]];
|
|
state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
|
|
lastLineEmpty = pos >= max;
|
|
oldSCount = [state.sCount[startLine]];
|
|
state.sCount[startLine] = offset - initial;
|
|
oldTShift = [state.tShift[startLine]];
|
|
state.tShift[startLine] = pos - state.bMarks[startLine];
|
|
terminatorRules = state.md.block.ruler.getRules("blockquote");
|
|
oldParentType = state.parentType;
|
|
state.parentType = "blockquote";
|
|
for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
|
|
isOutdented = state.sCount[nextLine] < state.blkIndent;
|
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
max = state.eMarks[nextLine];
|
|
if (pos >= max) {
|
|
break;
|
|
}
|
|
if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
|
|
initial = offset = state.sCount[nextLine] + 1;
|
|
if (state.src.charCodeAt(pos) === 32) {
|
|
pos++;
|
|
initial++;
|
|
offset++;
|
|
adjustTab = false;
|
|
spaceAfterMarker = true;
|
|
} else if (state.src.charCodeAt(pos) === 9) {
|
|
spaceAfterMarker = true;
|
|
if ((state.bsCount[nextLine] + offset) % 4 === 3) {
|
|
pos++;
|
|
initial++;
|
|
offset++;
|
|
adjustTab = false;
|
|
} else {
|
|
adjustTab = true;
|
|
}
|
|
} else {
|
|
spaceAfterMarker = false;
|
|
}
|
|
oldBMarks.push(state.bMarks[nextLine]);
|
|
state.bMarks[nextLine] = pos;
|
|
while (pos < max) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (isSpace(ch)) {
|
|
if (ch === 9) {
|
|
offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
|
|
} else {
|
|
offset++;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
lastLineEmpty = pos >= max;
|
|
oldBSCount.push(state.bsCount[nextLine]);
|
|
state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
|
|
oldSCount.push(state.sCount[nextLine]);
|
|
state.sCount[nextLine] = offset - initial;
|
|
oldTShift.push(state.tShift[nextLine]);
|
|
state.tShift[nextLine] = pos - state.bMarks[nextLine];
|
|
continue;
|
|
}
|
|
if (lastLineEmpty) {
|
|
break;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
state.lineMax = nextLine;
|
|
if (state.blkIndent !== 0) {
|
|
oldBMarks.push(state.bMarks[nextLine]);
|
|
oldBSCount.push(state.bsCount[nextLine]);
|
|
oldTShift.push(state.tShift[nextLine]);
|
|
oldSCount.push(state.sCount[nextLine]);
|
|
state.sCount[nextLine] -= state.blkIndent;
|
|
}
|
|
break;
|
|
}
|
|
oldBMarks.push(state.bMarks[nextLine]);
|
|
oldBSCount.push(state.bsCount[nextLine]);
|
|
oldTShift.push(state.tShift[nextLine]);
|
|
oldSCount.push(state.sCount[nextLine]);
|
|
state.sCount[nextLine] = -1;
|
|
}
|
|
oldIndent = state.blkIndent;
|
|
state.blkIndent = 0;
|
|
token = state.push("blockquote_open", "blockquote", 1);
|
|
token.markup = ">";
|
|
token.map = lines = [startLine, 0];
|
|
state.md.block.tokenize(state, startLine, nextLine);
|
|
token = state.push("blockquote_close", "blockquote", -1);
|
|
token.markup = ">";
|
|
state.lineMax = oldLineMax;
|
|
state.parentType = oldParentType;
|
|
lines[1] = state.line;
|
|
for (i2 = 0; i2 < oldTShift.length; i2++) {
|
|
state.bMarks[i2 + startLine] = oldBMarks[i2];
|
|
state.tShift[i2 + startLine] = oldTShift[i2];
|
|
state.sCount[i2 + startLine] = oldSCount[i2];
|
|
state.bsCount[i2 + startLine] = oldBSCount[i2];
|
|
}
|
|
state.blkIndent = oldIndent;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/hr.js
|
|
var require_hr = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/hr.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function hr(state, startLine, endLine, silent) {
|
|
var marker, cnt, ch, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
marker = state.src.charCodeAt(pos++);
|
|
if (marker !== 42 && marker !== 45 && marker !== 95) {
|
|
return false;
|
|
}
|
|
cnt = 1;
|
|
while (pos < max) {
|
|
ch = state.src.charCodeAt(pos++);
|
|
if (ch !== marker && !isSpace(ch)) {
|
|
return false;
|
|
}
|
|
if (ch === marker) {
|
|
cnt++;
|
|
}
|
|
}
|
|
if (cnt < 3) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
state.line = startLine + 1;
|
|
token = state.push("hr", "hr", 0);
|
|
token.map = [startLine, state.line];
|
|
token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/list.js
|
|
var require_list = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/list.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
function skipBulletListMarker(state, startLine) {
|
|
var marker, pos, max, ch;
|
|
pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
max = state.eMarks[startLine];
|
|
marker = state.src.charCodeAt(pos++);
|
|
if (marker !== 42 && marker !== 45 && marker !== 43) {
|
|
return -1;
|
|
}
|
|
if (pos < max) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (!isSpace(ch)) {
|
|
return -1;
|
|
}
|
|
}
|
|
return pos;
|
|
}
|
|
function skipOrderedListMarker(state, startLine) {
|
|
var ch, start = state.bMarks[startLine] + state.tShift[startLine], pos = start, max = state.eMarks[startLine];
|
|
if (pos + 1 >= max) {
|
|
return -1;
|
|
}
|
|
ch = state.src.charCodeAt(pos++);
|
|
if (ch < 48 || ch > 57) {
|
|
return -1;
|
|
}
|
|
for (; ; ) {
|
|
if (pos >= max) {
|
|
return -1;
|
|
}
|
|
ch = state.src.charCodeAt(pos++);
|
|
if (ch >= 48 && ch <= 57) {
|
|
if (pos - start >= 10) {
|
|
return -1;
|
|
}
|
|
continue;
|
|
}
|
|
if (ch === 41 || ch === 46) {
|
|
break;
|
|
}
|
|
return -1;
|
|
}
|
|
if (pos < max) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (!isSpace(ch)) {
|
|
return -1;
|
|
}
|
|
}
|
|
return pos;
|
|
}
|
|
function markTightParagraphs(state, idx) {
|
|
var i2, l2, level = state.level + 2;
|
|
for (i2 = idx + 2, l2 = state.tokens.length - 2; i2 < l2; i2++) {
|
|
if (state.tokens[i2].level === level && state.tokens[i2].type === "paragraph_open") {
|
|
state.tokens[i2 + 2].hidden = true;
|
|
state.tokens[i2].hidden = true;
|
|
i2 += 2;
|
|
}
|
|
}
|
|
}
|
|
module2.exports = function list(state, startLine, endLine, silent) {
|
|
var ch, contentStart, i2, indent, indentAfterMarker, initial, isOrdered, itemLines, l2, listLines, listTokIdx, markerCharCode, markerValue, max, nextLine, offset, oldListIndent, oldParentType, oldSCount, oldTShift, oldTight, pos, posAfterMarker, prevEmptyEnd, start, terminate, terminatorRules, token, isTerminatingParagraph = false, tight = true;
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) {
|
|
return false;
|
|
}
|
|
if (silent && state.parentType === "paragraph") {
|
|
if (state.sCount[startLine] >= state.blkIndent) {
|
|
isTerminatingParagraph = true;
|
|
}
|
|
}
|
|
if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
|
|
isOrdered = true;
|
|
start = state.bMarks[startLine] + state.tShift[startLine];
|
|
markerValue = Number(state.src.slice(start, posAfterMarker - 1));
|
|
if (isTerminatingParagraph && markerValue !== 1)
|
|
return false;
|
|
} else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
|
|
isOrdered = false;
|
|
} else {
|
|
return false;
|
|
}
|
|
if (isTerminatingParagraph) {
|
|
if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine])
|
|
return false;
|
|
}
|
|
markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
listTokIdx = state.tokens.length;
|
|
if (isOrdered) {
|
|
token = state.push("ordered_list_open", "ol", 1);
|
|
if (markerValue !== 1) {
|
|
token.attrs = [["start", markerValue]];
|
|
}
|
|
} else {
|
|
token = state.push("bullet_list_open", "ul", 1);
|
|
}
|
|
token.map = listLines = [startLine, 0];
|
|
token.markup = String.fromCharCode(markerCharCode);
|
|
nextLine = startLine;
|
|
prevEmptyEnd = false;
|
|
terminatorRules = state.md.block.ruler.getRules("list");
|
|
oldParentType = state.parentType;
|
|
state.parentType = "list";
|
|
while (nextLine < endLine) {
|
|
pos = posAfterMarker;
|
|
max = state.eMarks[nextLine];
|
|
initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
|
|
while (pos < max) {
|
|
ch = state.src.charCodeAt(pos);
|
|
if (ch === 9) {
|
|
offset += 4 - (offset + state.bsCount[nextLine]) % 4;
|
|
} else if (ch === 32) {
|
|
offset++;
|
|
} else {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
contentStart = pos;
|
|
if (contentStart >= max) {
|
|
indentAfterMarker = 1;
|
|
} else {
|
|
indentAfterMarker = offset - initial;
|
|
}
|
|
if (indentAfterMarker > 4) {
|
|
indentAfterMarker = 1;
|
|
}
|
|
indent = initial + indentAfterMarker;
|
|
token = state.push("list_item_open", "li", 1);
|
|
token.markup = String.fromCharCode(markerCharCode);
|
|
token.map = itemLines = [startLine, 0];
|
|
if (isOrdered) {
|
|
token.info = state.src.slice(start, posAfterMarker - 1);
|
|
}
|
|
oldTight = state.tight;
|
|
oldTShift = state.tShift[startLine];
|
|
oldSCount = state.sCount[startLine];
|
|
oldListIndent = state.listIndent;
|
|
state.listIndent = state.blkIndent;
|
|
state.blkIndent = indent;
|
|
state.tight = true;
|
|
state.tShift[startLine] = contentStart - state.bMarks[startLine];
|
|
state.sCount[startLine] = offset;
|
|
if (contentStart >= max && state.isEmpty(startLine + 1)) {
|
|
state.line = Math.min(state.line + 2, endLine);
|
|
} else {
|
|
state.md.block.tokenize(state, startLine, endLine, true);
|
|
}
|
|
if (!state.tight || prevEmptyEnd) {
|
|
tight = false;
|
|
}
|
|
prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1);
|
|
state.blkIndent = state.listIndent;
|
|
state.listIndent = oldListIndent;
|
|
state.tShift[startLine] = oldTShift;
|
|
state.sCount[startLine] = oldSCount;
|
|
state.tight = oldTight;
|
|
token = state.push("list_item_close", "li", -1);
|
|
token.markup = String.fromCharCode(markerCharCode);
|
|
nextLine = startLine = state.line;
|
|
itemLines[1] = nextLine;
|
|
contentStart = state.bMarks[startLine];
|
|
if (nextLine >= endLine) {
|
|
break;
|
|
}
|
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
break;
|
|
}
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
break;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
break;
|
|
}
|
|
if (isOrdered) {
|
|
posAfterMarker = skipOrderedListMarker(state, nextLine);
|
|
if (posAfterMarker < 0) {
|
|
break;
|
|
}
|
|
start = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
} else {
|
|
posAfterMarker = skipBulletListMarker(state, nextLine);
|
|
if (posAfterMarker < 0) {
|
|
break;
|
|
}
|
|
}
|
|
if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {
|
|
break;
|
|
}
|
|
}
|
|
if (isOrdered) {
|
|
token = state.push("ordered_list_close", "ol", -1);
|
|
} else {
|
|
token = state.push("bullet_list_close", "ul", -1);
|
|
}
|
|
token.markup = String.fromCharCode(markerCharCode);
|
|
listLines[1] = nextLine;
|
|
state.line = nextLine;
|
|
state.parentType = oldParentType;
|
|
if (tight) {
|
|
markTightParagraphs(state, listTokIdx);
|
|
}
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/reference.js
|
|
var require_reference = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/reference.js"(exports, module2) {
|
|
"use strict";
|
|
var normalizeReference = require_utils().normalizeReference;
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function reference(state, startLine, _endLine, silent) {
|
|
var ch, destEndPos, destEndLineNo, endLine, href, i2, l2, label, labelEnd, oldParentType, res, start, str, terminate, terminatorRules, title, lines = 0, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine], nextLine = startLine + 1;
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
if (state.src.charCodeAt(pos) !== 91) {
|
|
return false;
|
|
}
|
|
while (++pos < max) {
|
|
if (state.src.charCodeAt(pos) === 93 && state.src.charCodeAt(pos - 1) !== 92) {
|
|
if (pos + 1 === max) {
|
|
return false;
|
|
}
|
|
if (state.src.charCodeAt(pos + 1) !== 58) {
|
|
return false;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
endLine = state.lineMax;
|
|
terminatorRules = state.md.block.ruler.getRules("reference");
|
|
oldParentType = state.parentType;
|
|
state.parentType = "reference";
|
|
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
if (state.sCount[nextLine] - state.blkIndent > 3) {
|
|
continue;
|
|
}
|
|
if (state.sCount[nextLine] < 0) {
|
|
continue;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
break;
|
|
}
|
|
}
|
|
str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
|
max = str.length;
|
|
for (pos = 1; pos < max; pos++) {
|
|
ch = str.charCodeAt(pos);
|
|
if (ch === 91) {
|
|
return false;
|
|
} else if (ch === 93) {
|
|
labelEnd = pos;
|
|
break;
|
|
} else if (ch === 10) {
|
|
lines++;
|
|
} else if (ch === 92) {
|
|
pos++;
|
|
if (pos < max && str.charCodeAt(pos) === 10) {
|
|
lines++;
|
|
}
|
|
}
|
|
}
|
|
if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) {
|
|
return false;
|
|
}
|
|
for (pos = labelEnd + 2; pos < max; pos++) {
|
|
ch = str.charCodeAt(pos);
|
|
if (ch === 10) {
|
|
lines++;
|
|
} else if (isSpace(ch)) {
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
res = state.md.helpers.parseLinkDestination(str, pos, max);
|
|
if (!res.ok) {
|
|
return false;
|
|
}
|
|
href = state.md.normalizeLink(res.str);
|
|
if (!state.md.validateLink(href)) {
|
|
return false;
|
|
}
|
|
pos = res.pos;
|
|
lines += res.lines;
|
|
destEndPos = pos;
|
|
destEndLineNo = lines;
|
|
start = pos;
|
|
for (; pos < max; pos++) {
|
|
ch = str.charCodeAt(pos);
|
|
if (ch === 10) {
|
|
lines++;
|
|
} else if (isSpace(ch)) {
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
res = state.md.helpers.parseLinkTitle(str, pos, max);
|
|
if (pos < max && start !== pos && res.ok) {
|
|
title = res.str;
|
|
pos = res.pos;
|
|
lines += res.lines;
|
|
} else {
|
|
title = "";
|
|
pos = destEndPos;
|
|
lines = destEndLineNo;
|
|
}
|
|
while (pos < max) {
|
|
ch = str.charCodeAt(pos);
|
|
if (!isSpace(ch)) {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
if (pos < max && str.charCodeAt(pos) !== 10) {
|
|
if (title) {
|
|
title = "";
|
|
pos = destEndPos;
|
|
lines = destEndLineNo;
|
|
while (pos < max) {
|
|
ch = str.charCodeAt(pos);
|
|
if (!isSpace(ch)) {
|
|
break;
|
|
}
|
|
pos++;
|
|
}
|
|
}
|
|
}
|
|
if (pos < max && str.charCodeAt(pos) !== 10) {
|
|
return false;
|
|
}
|
|
label = normalizeReference(str.slice(1, labelEnd));
|
|
if (!label) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
if (typeof state.env.references === "undefined") {
|
|
state.env.references = {};
|
|
}
|
|
if (typeof state.env.references[label] === "undefined") {
|
|
state.env.references[label] = { title, href };
|
|
}
|
|
state.parentType = oldParentType;
|
|
state.line = startLine + lines + 1;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/common/html_blocks.js
|
|
var require_html_blocks = __commonJS({
|
|
"node_modules/markdown-it/lib/common/html_blocks.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = [
|
|
"address",
|
|
"article",
|
|
"aside",
|
|
"base",
|
|
"basefont",
|
|
"blockquote",
|
|
"body",
|
|
"caption",
|
|
"center",
|
|
"col",
|
|
"colgroup",
|
|
"dd",
|
|
"details",
|
|
"dialog",
|
|
"dir",
|
|
"div",
|
|
"dl",
|
|
"dt",
|
|
"fieldset",
|
|
"figcaption",
|
|
"figure",
|
|
"footer",
|
|
"form",
|
|
"frame",
|
|
"frameset",
|
|
"h1",
|
|
"h2",
|
|
"h3",
|
|
"h4",
|
|
"h5",
|
|
"h6",
|
|
"head",
|
|
"header",
|
|
"hr",
|
|
"html",
|
|
"iframe",
|
|
"legend",
|
|
"li",
|
|
"link",
|
|
"main",
|
|
"menu",
|
|
"menuitem",
|
|
"nav",
|
|
"noframes",
|
|
"ol",
|
|
"optgroup",
|
|
"option",
|
|
"p",
|
|
"param",
|
|
"section",
|
|
"source",
|
|
"summary",
|
|
"table",
|
|
"tbody",
|
|
"td",
|
|
"tfoot",
|
|
"th",
|
|
"thead",
|
|
"title",
|
|
"tr",
|
|
"track",
|
|
"ul"
|
|
];
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/common/html_re.js
|
|
var require_html_re = __commonJS({
|
|
"node_modules/markdown-it/lib/common/html_re.js"(exports, module2) {
|
|
"use strict";
|
|
var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
|
|
var unquoted = "[^\"'=<>`\\x00-\\x20]+";
|
|
var single_quoted = "'[^']*'";
|
|
var double_quoted = '"[^"]*"';
|
|
var attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")";
|
|
var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
|
|
var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
|
|
var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
|
|
var comment = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->";
|
|
var processing = "<[?][\\s\\S]*?[?]>";
|
|
var declaration = "<![A-Z]+\\s+[^>]*>";
|
|
var cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
|
|
var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
|
|
var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
|
|
module2.exports.HTML_TAG_RE = HTML_TAG_RE;
|
|
module2.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/html_block.js
|
|
var require_html_block = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/html_block.js"(exports, module2) {
|
|
"use strict";
|
|
var block_names = require_html_blocks();
|
|
var HTML_OPEN_CLOSE_TAG_RE = require_html_re().HTML_OPEN_CLOSE_TAG_RE;
|
|
var HTML_SEQUENCES = [
|
|
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
|
|
[/^<!--/, /-->/, true],
|
|
[/^<\?/, /\?>/, true],
|
|
[/^<![A-Z]/, />/, true],
|
|
[/^<!\[CDATA\[/, /\]\]>/, true],
|
|
[new RegExp("^</?(" + block_names.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, true],
|
|
[new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]
|
|
];
|
|
module2.exports = function html_block(state, startLine, endLine, silent) {
|
|
var i2, nextLine, token, lineText, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
if (!state.md.options.html) {
|
|
return false;
|
|
}
|
|
if (state.src.charCodeAt(pos) !== 60) {
|
|
return false;
|
|
}
|
|
lineText = state.src.slice(pos, max);
|
|
for (i2 = 0; i2 < HTML_SEQUENCES.length; i2++) {
|
|
if (HTML_SEQUENCES[i2][0].test(lineText)) {
|
|
break;
|
|
}
|
|
}
|
|
if (i2 === HTML_SEQUENCES.length) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return HTML_SEQUENCES[i2][2];
|
|
}
|
|
nextLine = startLine + 1;
|
|
if (!HTML_SEQUENCES[i2][1].test(lineText)) {
|
|
for (; nextLine < endLine; nextLine++) {
|
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
break;
|
|
}
|
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
max = state.eMarks[nextLine];
|
|
lineText = state.src.slice(pos, max);
|
|
if (HTML_SEQUENCES[i2][1].test(lineText)) {
|
|
if (lineText.length !== 0) {
|
|
nextLine++;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
state.line = nextLine;
|
|
token = state.push("html_block", "", 0);
|
|
token.map = [startLine, nextLine];
|
|
token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/heading.js
|
|
var require_heading = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/heading.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function heading(state, startLine, endLine, silent) {
|
|
var ch, level, tmp, token, pos = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
ch = state.src.charCodeAt(pos);
|
|
if (ch !== 35 || pos >= max) {
|
|
return false;
|
|
}
|
|
level = 1;
|
|
ch = state.src.charCodeAt(++pos);
|
|
while (ch === 35 && pos < max && level <= 6) {
|
|
level++;
|
|
ch = state.src.charCodeAt(++pos);
|
|
}
|
|
if (level > 6 || pos < max && !isSpace(ch)) {
|
|
return false;
|
|
}
|
|
if (silent) {
|
|
return true;
|
|
}
|
|
max = state.skipSpacesBack(max, pos);
|
|
tmp = state.skipCharsBack(max, 35, pos);
|
|
if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
|
|
max = tmp;
|
|
}
|
|
state.line = startLine + 1;
|
|
token = state.push("heading_open", "h" + String(level), 1);
|
|
token.markup = "########".slice(0, level);
|
|
token.map = [startLine, state.line];
|
|
token = state.push("inline", "", 0);
|
|
token.content = state.src.slice(pos, max).trim();
|
|
token.map = [startLine, state.line];
|
|
token.children = [];
|
|
token = state.push("heading_close", "h" + String(level), -1);
|
|
token.markup = "########".slice(0, level);
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/lheading.js
|
|
var require_lheading = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/lheading.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function lheading(state, startLine, endLine) {
|
|
var content, terminate, i2, l2, token, pos, max, level, marker, nextLine = startLine + 1, oldParentType, terminatorRules = state.md.block.ruler.getRules("paragraph");
|
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
return false;
|
|
}
|
|
oldParentType = state.parentType;
|
|
state.parentType = "paragraph";
|
|
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
if (state.sCount[nextLine] - state.blkIndent > 3) {
|
|
continue;
|
|
}
|
|
if (state.sCount[nextLine] >= state.blkIndent) {
|
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
max = state.eMarks[nextLine];
|
|
if (pos < max) {
|
|
marker = state.src.charCodeAt(pos);
|
|
if (marker === 45 || marker === 61) {
|
|
pos = state.skipChars(pos, marker);
|
|
pos = state.skipSpaces(pos);
|
|
if (pos >= max) {
|
|
level = marker === 61 ? 1 : 2;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (state.sCount[nextLine] < 0) {
|
|
continue;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
break;
|
|
}
|
|
}
|
|
if (!level) {
|
|
return false;
|
|
}
|
|
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
|
state.line = nextLine + 1;
|
|
token = state.push("heading_open", "h" + String(level), 1);
|
|
token.markup = String.fromCharCode(marker);
|
|
token.map = [startLine, state.line];
|
|
token = state.push("inline", "", 0);
|
|
token.content = content;
|
|
token.map = [startLine, state.line - 1];
|
|
token.children = [];
|
|
token = state.push("heading_close", "h" + String(level), -1);
|
|
token.markup = String.fromCharCode(marker);
|
|
state.parentType = oldParentType;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/paragraph.js
|
|
var require_paragraph = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/paragraph.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function paragraph(state, startLine) {
|
|
var content, terminate, i2, l2, token, oldParentType, nextLine = startLine + 1, terminatorRules = state.md.block.ruler.getRules("paragraph"), endLine = state.lineMax;
|
|
oldParentType = state.parentType;
|
|
state.parentType = "paragraph";
|
|
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
if (state.sCount[nextLine] - state.blkIndent > 3) {
|
|
continue;
|
|
}
|
|
if (state.sCount[nextLine] < 0) {
|
|
continue;
|
|
}
|
|
terminate = false;
|
|
for (i2 = 0, l2 = terminatorRules.length; i2 < l2; i2++) {
|
|
if (terminatorRules[i2](state, nextLine, endLine, true)) {
|
|
terminate = true;
|
|
break;
|
|
}
|
|
}
|
|
if (terminate) {
|
|
break;
|
|
}
|
|
}
|
|
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
|
state.line = nextLine;
|
|
token = state.push("paragraph_open", "p", 1);
|
|
token.map = [startLine, state.line];
|
|
token = state.push("inline", "", 0);
|
|
token.content = content;
|
|
token.map = [startLine, state.line];
|
|
token.children = [];
|
|
token = state.push("paragraph_close", "p", -1);
|
|
state.parentType = oldParentType;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_block/state_block.js
|
|
var require_state_block = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_block/state_block.js"(exports, module2) {
|
|
"use strict";
|
|
var Token = require_token();
|
|
var isSpace = require_utils().isSpace;
|
|
function StateBlock(src, md2, env, tokens) {
|
|
var ch, s2, start, pos, len, indent, offset, indent_found;
|
|
this.src = src;
|
|
this.md = md2;
|
|
this.env = env;
|
|
this.tokens = tokens;
|
|
this.bMarks = [];
|
|
this.eMarks = [];
|
|
this.tShift = [];
|
|
this.sCount = [];
|
|
this.bsCount = [];
|
|
this.blkIndent = 0;
|
|
this.line = 0;
|
|
this.lineMax = 0;
|
|
this.tight = false;
|
|
this.ddIndent = -1;
|
|
this.listIndent = -1;
|
|
this.parentType = "root";
|
|
this.level = 0;
|
|
this.result = "";
|
|
s2 = this.src;
|
|
indent_found = false;
|
|
for (start = pos = indent = offset = 0, len = s2.length; pos < len; pos++) {
|
|
ch = s2.charCodeAt(pos);
|
|
if (!indent_found) {
|
|
if (isSpace(ch)) {
|
|
indent++;
|
|
if (ch === 9) {
|
|
offset += 4 - offset % 4;
|
|
} else {
|
|
offset++;
|
|
}
|
|
continue;
|
|
} else {
|
|
indent_found = true;
|
|
}
|
|
}
|
|
if (ch === 10 || pos === len - 1) {
|
|
if (ch !== 10) {
|
|
pos++;
|
|
}
|
|
this.bMarks.push(start);
|
|
this.eMarks.push(pos);
|
|
this.tShift.push(indent);
|
|
this.sCount.push(offset);
|
|
this.bsCount.push(0);
|
|
indent_found = false;
|
|
indent = 0;
|
|
offset = 0;
|
|
start = pos + 1;
|
|
}
|
|
}
|
|
this.bMarks.push(s2.length);
|
|
this.eMarks.push(s2.length);
|
|
this.tShift.push(0);
|
|
this.sCount.push(0);
|
|
this.bsCount.push(0);
|
|
this.lineMax = this.bMarks.length - 1;
|
|
}
|
|
StateBlock.prototype.push = function(type, tag, nesting) {
|
|
var token = new Token(type, tag, nesting);
|
|
token.block = true;
|
|
if (nesting < 0)
|
|
this.level--;
|
|
token.level = this.level;
|
|
if (nesting > 0)
|
|
this.level++;
|
|
this.tokens.push(token);
|
|
return token;
|
|
};
|
|
StateBlock.prototype.isEmpty = function isEmpty3(line) {
|
|
return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
|
|
};
|
|
StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
|
|
for (var max = this.lineMax; from < max; from++) {
|
|
if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
|
|
break;
|
|
}
|
|
}
|
|
return from;
|
|
};
|
|
StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
|
|
var ch;
|
|
for (var max = this.src.length; pos < max; pos++) {
|
|
ch = this.src.charCodeAt(pos);
|
|
if (!isSpace(ch)) {
|
|
break;
|
|
}
|
|
}
|
|
return pos;
|
|
};
|
|
StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
|
|
if (pos <= min) {
|
|
return pos;
|
|
}
|
|
while (pos > min) {
|
|
if (!isSpace(this.src.charCodeAt(--pos))) {
|
|
return pos + 1;
|
|
}
|
|
}
|
|
return pos;
|
|
};
|
|
StateBlock.prototype.skipChars = function skipChars(pos, code) {
|
|
for (var max = this.src.length; pos < max; pos++) {
|
|
if (this.src.charCodeAt(pos) !== code) {
|
|
break;
|
|
}
|
|
}
|
|
return pos;
|
|
};
|
|
StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
|
|
if (pos <= min) {
|
|
return pos;
|
|
}
|
|
while (pos > min) {
|
|
if (code !== this.src.charCodeAt(--pos)) {
|
|
return pos + 1;
|
|
}
|
|
}
|
|
return pos;
|
|
};
|
|
StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
|
|
var i2, lineIndent, ch, first, last, queue, lineStart, line = begin;
|
|
if (begin >= end) {
|
|
return "";
|
|
}
|
|
queue = new Array(end - begin);
|
|
for (i2 = 0; line < end; line++, i2++) {
|
|
lineIndent = 0;
|
|
lineStart = first = this.bMarks[line];
|
|
if (line + 1 < end || keepLastLF) {
|
|
last = this.eMarks[line] + 1;
|
|
} else {
|
|
last = this.eMarks[line];
|
|
}
|
|
while (first < last && lineIndent < indent) {
|
|
ch = this.src.charCodeAt(first);
|
|
if (isSpace(ch)) {
|
|
if (ch === 9) {
|
|
lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
|
|
} else {
|
|
lineIndent++;
|
|
}
|
|
} else if (first - lineStart < this.tShift[line]) {
|
|
lineIndent++;
|
|
} else {
|
|
break;
|
|
}
|
|
first++;
|
|
}
|
|
if (lineIndent > indent) {
|
|
queue[i2] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last);
|
|
} else {
|
|
queue[i2] = this.src.slice(first, last);
|
|
}
|
|
}
|
|
return queue.join("");
|
|
};
|
|
StateBlock.prototype.Token = Token;
|
|
module2.exports = StateBlock;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/parser_block.js
|
|
var require_parser_block = __commonJS({
|
|
"node_modules/markdown-it/lib/parser_block.js"(exports, module2) {
|
|
"use strict";
|
|
var Ruler = require_ruler();
|
|
var _rules = [
|
|
["table", require_table(), ["paragraph", "reference"]],
|
|
["code", require_code()],
|
|
["fence", require_fence(), ["paragraph", "reference", "blockquote", "list"]],
|
|
["blockquote", require_blockquote(), ["paragraph", "reference", "blockquote", "list"]],
|
|
["hr", require_hr(), ["paragraph", "reference", "blockquote", "list"]],
|
|
["list", require_list(), ["paragraph", "reference", "blockquote"]],
|
|
["reference", require_reference()],
|
|
["html_block", require_html_block(), ["paragraph", "reference", "blockquote"]],
|
|
["heading", require_heading(), ["paragraph", "reference", "blockquote"]],
|
|
["lheading", require_lheading()],
|
|
["paragraph", require_paragraph()]
|
|
];
|
|
function ParserBlock() {
|
|
this.ruler = new Ruler();
|
|
for (var i2 = 0; i2 < _rules.length; i2++) {
|
|
this.ruler.push(_rules[i2][0], _rules[i2][1], { alt: (_rules[i2][2] || []).slice() });
|
|
}
|
|
}
|
|
ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
|
|
var ok, i2, rules = this.ruler.getRules(""), len = rules.length, line = startLine, hasEmptyLines = false, maxNesting = state.md.options.maxNesting;
|
|
while (line < endLine) {
|
|
state.line = line = state.skipEmptyLines(line);
|
|
if (line >= endLine) {
|
|
break;
|
|
}
|
|
if (state.sCount[line] < state.blkIndent) {
|
|
break;
|
|
}
|
|
if (state.level >= maxNesting) {
|
|
state.line = endLine;
|
|
break;
|
|
}
|
|
for (i2 = 0; i2 < len; i2++) {
|
|
ok = rules[i2](state, line, endLine, false);
|
|
if (ok) {
|
|
break;
|
|
}
|
|
}
|
|
state.tight = !hasEmptyLines;
|
|
if (state.isEmpty(state.line - 1)) {
|
|
hasEmptyLines = true;
|
|
}
|
|
line = state.line;
|
|
if (line < endLine && state.isEmpty(line)) {
|
|
hasEmptyLines = true;
|
|
line++;
|
|
state.line = line;
|
|
}
|
|
}
|
|
};
|
|
ParserBlock.prototype.parse = function(src, md2, env, outTokens) {
|
|
var state;
|
|
if (!src) {
|
|
return;
|
|
}
|
|
state = new this.State(src, md2, env, outTokens);
|
|
this.tokenize(state, state.line, state.lineMax);
|
|
};
|
|
ParserBlock.prototype.State = require_state_block();
|
|
module2.exports = ParserBlock;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/text.js
|
|
var require_text = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/text.js"(exports, module2) {
|
|
"use strict";
|
|
function isTerminatorChar(ch) {
|
|
switch (ch) {
|
|
case 10:
|
|
case 33:
|
|
case 35:
|
|
case 36:
|
|
case 37:
|
|
case 38:
|
|
case 42:
|
|
case 43:
|
|
case 45:
|
|
case 58:
|
|
case 60:
|
|
case 61:
|
|
case 62:
|
|
case 64:
|
|
case 91:
|
|
case 92:
|
|
case 93:
|
|
case 94:
|
|
case 95:
|
|
case 96:
|
|
case 123:
|
|
case 125:
|
|
case 126:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
module2.exports = function text(state, silent) {
|
|
var pos = state.pos;
|
|
while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
|
|
pos++;
|
|
}
|
|
if (pos === state.pos) {
|
|
return false;
|
|
}
|
|
if (!silent) {
|
|
state.pending += state.src.slice(state.pos, pos);
|
|
}
|
|
state.pos = pos;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/linkify.js
|
|
var require_linkify2 = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/linkify.js"(exports, module2) {
|
|
"use strict";
|
|
var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
|
|
module2.exports = function linkify(state, silent) {
|
|
var pos, max, match, proto, link, url, fullUrl, token;
|
|
if (!state.md.options.linkify)
|
|
return false;
|
|
if (state.linkLevel > 0)
|
|
return false;
|
|
pos = state.pos;
|
|
max = state.posMax;
|
|
if (pos + 3 > max)
|
|
return false;
|
|
if (state.src.charCodeAt(pos) !== 58)
|
|
return false;
|
|
if (state.src.charCodeAt(pos + 1) !== 47)
|
|
return false;
|
|
if (state.src.charCodeAt(pos + 2) !== 47)
|
|
return false;
|
|
match = state.pending.match(SCHEME_RE);
|
|
if (!match)
|
|
return false;
|
|
proto = match[1];
|
|
link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length));
|
|
if (!link)
|
|
return false;
|
|
url = link.url;
|
|
url = url.replace(/\*+$/, "");
|
|
fullUrl = state.md.normalizeLink(url);
|
|
if (!state.md.validateLink(fullUrl))
|
|
return false;
|
|
if (!silent) {
|
|
state.pending = state.pending.slice(0, -proto.length);
|
|
token = state.push("link_open", "a", 1);
|
|
token.attrs = [["href", fullUrl]];
|
|
token.markup = "linkify";
|
|
token.info = "auto";
|
|
token = state.push("text", "", 0);
|
|
token.content = state.md.normalizeLinkText(url);
|
|
token = state.push("link_close", "a", -1);
|
|
token.markup = "linkify";
|
|
token.info = "auto";
|
|
}
|
|
state.pos += url.length - proto.length;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/newline.js
|
|
var require_newline = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/newline.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function newline(state, silent) {
|
|
var pmax, max, ws, pos = state.pos;
|
|
if (state.src.charCodeAt(pos) !== 10) {
|
|
return false;
|
|
}
|
|
pmax = state.pending.length - 1;
|
|
max = state.posMax;
|
|
if (!silent) {
|
|
if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
|
|
if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
|
|
ws = pmax - 1;
|
|
while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32)
|
|
ws--;
|
|
state.pending = state.pending.slice(0, ws);
|
|
state.push("hardbreak", "br", 0);
|
|
} else {
|
|
state.pending = state.pending.slice(0, -1);
|
|
state.push("softbreak", "br", 0);
|
|
}
|
|
} else {
|
|
state.push("softbreak", "br", 0);
|
|
}
|
|
}
|
|
pos++;
|
|
while (pos < max && isSpace(state.src.charCodeAt(pos))) {
|
|
pos++;
|
|
}
|
|
state.pos = pos;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/escape.js
|
|
var require_escape = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/escape.js"(exports, module2) {
|
|
"use strict";
|
|
var isSpace = require_utils().isSpace;
|
|
var ESCAPED = [];
|
|
for (i2 = 0; i2 < 256; i2++) {
|
|
ESCAPED.push(0);
|
|
}
|
|
var i2;
|
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
|
|
ESCAPED[ch.charCodeAt(0)] = 1;
|
|
});
|
|
module2.exports = function escape(state, silent) {
|
|
var ch1, ch2, origStr, escapedStr, token, pos = state.pos, max = state.posMax;
|
|
if (state.src.charCodeAt(pos) !== 92)
|
|
return false;
|
|
pos++;
|
|
if (pos >= max)
|
|
return false;
|
|
ch1 = state.src.charCodeAt(pos);
|
|
if (ch1 === 10) {
|
|
if (!silent) {
|
|
state.push("hardbreak", "br", 0);
|
|
}
|
|
pos++;
|
|
while (pos < max) {
|
|
ch1 = state.src.charCodeAt(pos);
|
|
if (!isSpace(ch1))
|
|
break;
|
|
pos++;
|
|
}
|
|
state.pos = pos;
|
|
return true;
|
|
}
|
|
escapedStr = state.src[pos];
|
|
if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
|
|
ch2 = state.src.charCodeAt(pos + 1);
|
|
if (ch2 >= 56320 && ch2 <= 57343) {
|
|
escapedStr += state.src[pos + 1];
|
|
pos++;
|
|
}
|
|
}
|
|
origStr = "\\" + escapedStr;
|
|
if (!silent) {
|
|
token = state.push("text_special", "", 0);
|
|
if (ch1 < 256 && ESCAPED[ch1] !== 0) {
|
|
token.content = escapedStr;
|
|
} else {
|
|
token.content = origStr;
|
|
}
|
|
token.markup = origStr;
|
|
token.info = "escape";
|
|
}
|
|
state.pos = pos + 1;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/backticks.js
|
|
var require_backticks = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/backticks.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function backtick(state, silent) {
|
|
var start, max, marker, token, matchStart, matchEnd, openerLength, closerLength, pos = state.pos, ch = state.src.charCodeAt(pos);
|
|
if (ch !== 96) {
|
|
return false;
|
|
}
|
|
start = pos;
|
|
pos++;
|
|
max = state.posMax;
|
|
while (pos < max && state.src.charCodeAt(pos) === 96) {
|
|
pos++;
|
|
}
|
|
marker = state.src.slice(start, pos);
|
|
openerLength = marker.length;
|
|
if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
|
|
if (!silent)
|
|
state.pending += marker;
|
|
state.pos += openerLength;
|
|
return true;
|
|
}
|
|
matchStart = matchEnd = pos;
|
|
while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
|
|
matchEnd = matchStart + 1;
|
|
while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) {
|
|
matchEnd++;
|
|
}
|
|
closerLength = matchEnd - matchStart;
|
|
if (closerLength === openerLength) {
|
|
if (!silent) {
|
|
token = state.push("code_inline", "code", 0);
|
|
token.markup = marker;
|
|
token.content = state.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
|
|
}
|
|
state.pos = matchEnd;
|
|
return true;
|
|
}
|
|
state.backticks[closerLength] = matchStart;
|
|
}
|
|
state.backticksScanned = true;
|
|
if (!silent)
|
|
state.pending += marker;
|
|
state.pos += openerLength;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/strikethrough.js
|
|
var require_strikethrough = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/strikethrough.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports.tokenize = function strikethrough(state, silent) {
|
|
var i2, scanned, token, len, ch, start = state.pos, marker = state.src.charCodeAt(start);
|
|
if (silent) {
|
|
return false;
|
|
}
|
|
if (marker !== 126) {
|
|
return false;
|
|
}
|
|
scanned = state.scanDelims(state.pos, true);
|
|
len = scanned.length;
|
|
ch = String.fromCharCode(marker);
|
|
if (len < 2) {
|
|
return false;
|
|
}
|
|
if (len % 2) {
|
|
token = state.push("text", "", 0);
|
|
token.content = ch;
|
|
len--;
|
|
}
|
|
for (i2 = 0; i2 < len; i2 += 2) {
|
|
token = state.push("text", "", 0);
|
|
token.content = ch + ch;
|
|
state.delimiters.push({
|
|
marker,
|
|
length: 0,
|
|
token: state.tokens.length - 1,
|
|
end: -1,
|
|
open: scanned.can_open,
|
|
close: scanned.can_close
|
|
});
|
|
}
|
|
state.pos += scanned.length;
|
|
return true;
|
|
};
|
|
function postProcess(state, delimiters) {
|
|
var i2, j2, startDelim, endDelim, token, loneMarkers = [], max = delimiters.length;
|
|
for (i2 = 0; i2 < max; i2++) {
|
|
startDelim = delimiters[i2];
|
|
if (startDelim.marker !== 126) {
|
|
continue;
|
|
}
|
|
if (startDelim.end === -1) {
|
|
continue;
|
|
}
|
|
endDelim = delimiters[startDelim.end];
|
|
token = state.tokens[startDelim.token];
|
|
token.type = "s_open";
|
|
token.tag = "s";
|
|
token.nesting = 1;
|
|
token.markup = "~~";
|
|
token.content = "";
|
|
token = state.tokens[endDelim.token];
|
|
token.type = "s_close";
|
|
token.tag = "s";
|
|
token.nesting = -1;
|
|
token.markup = "~~";
|
|
token.content = "";
|
|
if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") {
|
|
loneMarkers.push(endDelim.token - 1);
|
|
}
|
|
}
|
|
while (loneMarkers.length) {
|
|
i2 = loneMarkers.pop();
|
|
j2 = i2 + 1;
|
|
while (j2 < state.tokens.length && state.tokens[j2].type === "s_close") {
|
|
j2++;
|
|
}
|
|
j2--;
|
|
if (i2 !== j2) {
|
|
token = state.tokens[j2];
|
|
state.tokens[j2] = state.tokens[i2];
|
|
state.tokens[i2] = token;
|
|
}
|
|
}
|
|
}
|
|
module2.exports.postProcess = function strikethrough(state) {
|
|
var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
|
|
postProcess(state, state.delimiters);
|
|
for (curr = 0; curr < max; curr++) {
|
|
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
|
|
postProcess(state, tokens_meta[curr].delimiters);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/emphasis.js
|
|
var require_emphasis = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/emphasis.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports.tokenize = function emphasis(state, silent) {
|
|
var i2, scanned, token, start = state.pos, marker = state.src.charCodeAt(start);
|
|
if (silent) {
|
|
return false;
|
|
}
|
|
if (marker !== 95 && marker !== 42) {
|
|
return false;
|
|
}
|
|
scanned = state.scanDelims(state.pos, marker === 42);
|
|
for (i2 = 0; i2 < scanned.length; i2++) {
|
|
token = state.push("text", "", 0);
|
|
token.content = String.fromCharCode(marker);
|
|
state.delimiters.push({
|
|
marker,
|
|
length: scanned.length,
|
|
token: state.tokens.length - 1,
|
|
end: -1,
|
|
open: scanned.can_open,
|
|
close: scanned.can_close
|
|
});
|
|
}
|
|
state.pos += scanned.length;
|
|
return true;
|
|
};
|
|
function postProcess(state, delimiters) {
|
|
var i2, startDelim, endDelim, token, ch, isStrong, max = delimiters.length;
|
|
for (i2 = max - 1; i2 >= 0; i2--) {
|
|
startDelim = delimiters[i2];
|
|
if (startDelim.marker !== 95 && startDelim.marker !== 42) {
|
|
continue;
|
|
}
|
|
if (startDelim.end === -1) {
|
|
continue;
|
|
}
|
|
endDelim = delimiters[startDelim.end];
|
|
isStrong = i2 > 0 && delimiters[i2 - 1].end === startDelim.end + 1 && delimiters[i2 - 1].marker === startDelim.marker && delimiters[i2 - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1;
|
|
ch = String.fromCharCode(startDelim.marker);
|
|
token = state.tokens[startDelim.token];
|
|
token.type = isStrong ? "strong_open" : "em_open";
|
|
token.tag = isStrong ? "strong" : "em";
|
|
token.nesting = 1;
|
|
token.markup = isStrong ? ch + ch : ch;
|
|
token.content = "";
|
|
token = state.tokens[endDelim.token];
|
|
token.type = isStrong ? "strong_close" : "em_close";
|
|
token.tag = isStrong ? "strong" : "em";
|
|
token.nesting = -1;
|
|
token.markup = isStrong ? ch + ch : ch;
|
|
token.content = "";
|
|
if (isStrong) {
|
|
state.tokens[delimiters[i2 - 1].token].content = "";
|
|
state.tokens[delimiters[startDelim.end + 1].token].content = "";
|
|
i2--;
|
|
}
|
|
}
|
|
}
|
|
module2.exports.postProcess = function emphasis(state) {
|
|
var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
|
|
postProcess(state, state.delimiters);
|
|
for (curr = 0; curr < max; curr++) {
|
|
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
|
|
postProcess(state, tokens_meta[curr].delimiters);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/link.js
|
|
var require_link = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/link.js"(exports, module2) {
|
|
"use strict";
|
|
var normalizeReference = require_utils().normalizeReference;
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function link(state, silent) {
|
|
var attrs, code, label, labelEnd, labelStart, pos, res, ref, token, href = "", title = "", oldPos = state.pos, max = state.posMax, start = state.pos, parseReference = true;
|
|
if (state.src.charCodeAt(state.pos) !== 91) {
|
|
return false;
|
|
}
|
|
labelStart = state.pos + 1;
|
|
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
|
|
if (labelEnd < 0) {
|
|
return false;
|
|
}
|
|
pos = labelEnd + 1;
|
|
if (pos < max && state.src.charCodeAt(pos) === 40) {
|
|
parseReference = false;
|
|
pos++;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
if (pos >= max) {
|
|
return false;
|
|
}
|
|
start = pos;
|
|
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
|
|
if (res.ok) {
|
|
href = state.md.normalizeLink(res.str);
|
|
if (state.md.validateLink(href)) {
|
|
pos = res.pos;
|
|
} else {
|
|
href = "";
|
|
}
|
|
start = pos;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
|
|
if (pos < max && start !== pos && res.ok) {
|
|
title = res.str;
|
|
pos = res.pos;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (pos >= max || state.src.charCodeAt(pos) !== 41) {
|
|
parseReference = true;
|
|
}
|
|
pos++;
|
|
}
|
|
if (parseReference) {
|
|
if (typeof state.env.references === "undefined") {
|
|
return false;
|
|
}
|
|
if (pos < max && state.src.charCodeAt(pos) === 91) {
|
|
start = pos + 1;
|
|
pos = state.md.helpers.parseLinkLabel(state, pos);
|
|
if (pos >= 0) {
|
|
label = state.src.slice(start, pos++);
|
|
} else {
|
|
pos = labelEnd + 1;
|
|
}
|
|
} else {
|
|
pos = labelEnd + 1;
|
|
}
|
|
if (!label) {
|
|
label = state.src.slice(labelStart, labelEnd);
|
|
}
|
|
ref = state.env.references[normalizeReference(label)];
|
|
if (!ref) {
|
|
state.pos = oldPos;
|
|
return false;
|
|
}
|
|
href = ref.href;
|
|
title = ref.title;
|
|
}
|
|
if (!silent) {
|
|
state.pos = labelStart;
|
|
state.posMax = labelEnd;
|
|
token = state.push("link_open", "a", 1);
|
|
token.attrs = attrs = [["href", href]];
|
|
if (title) {
|
|
attrs.push(["title", title]);
|
|
}
|
|
state.linkLevel++;
|
|
state.md.inline.tokenize(state);
|
|
state.linkLevel--;
|
|
token = state.push("link_close", "a", -1);
|
|
}
|
|
state.pos = pos;
|
|
state.posMax = max;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/image.js
|
|
var require_image = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/image.js"(exports, module2) {
|
|
"use strict";
|
|
var normalizeReference = require_utils().normalizeReference;
|
|
var isSpace = require_utils().isSpace;
|
|
module2.exports = function image(state, silent) {
|
|
var attrs, code, content, label, labelEnd, labelStart, pos, ref, res, title, token, tokens, start, href = "", oldPos = state.pos, max = state.posMax;
|
|
if (state.src.charCodeAt(state.pos) !== 33) {
|
|
return false;
|
|
}
|
|
if (state.src.charCodeAt(state.pos + 1) !== 91) {
|
|
return false;
|
|
}
|
|
labelStart = state.pos + 2;
|
|
labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
|
|
if (labelEnd < 0) {
|
|
return false;
|
|
}
|
|
pos = labelEnd + 1;
|
|
if (pos < max && state.src.charCodeAt(pos) === 40) {
|
|
pos++;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
if (pos >= max) {
|
|
return false;
|
|
}
|
|
start = pos;
|
|
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
|
|
if (res.ok) {
|
|
href = state.md.normalizeLink(res.str);
|
|
if (state.md.validateLink(href)) {
|
|
pos = res.pos;
|
|
} else {
|
|
href = "";
|
|
}
|
|
}
|
|
start = pos;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
|
|
if (pos < max && start !== pos && res.ok) {
|
|
title = res.str;
|
|
pos = res.pos;
|
|
for (; pos < max; pos++) {
|
|
code = state.src.charCodeAt(pos);
|
|
if (!isSpace(code) && code !== 10) {
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
title = "";
|
|
}
|
|
if (pos >= max || state.src.charCodeAt(pos) !== 41) {
|
|
state.pos = oldPos;
|
|
return false;
|
|
}
|
|
pos++;
|
|
} else {
|
|
if (typeof state.env.references === "undefined") {
|
|
return false;
|
|
}
|
|
if (pos < max && state.src.charCodeAt(pos) === 91) {
|
|
start = pos + 1;
|
|
pos = state.md.helpers.parseLinkLabel(state, pos);
|
|
if (pos >= 0) {
|
|
label = state.src.slice(start, pos++);
|
|
} else {
|
|
pos = labelEnd + 1;
|
|
}
|
|
} else {
|
|
pos = labelEnd + 1;
|
|
}
|
|
if (!label) {
|
|
label = state.src.slice(labelStart, labelEnd);
|
|
}
|
|
ref = state.env.references[normalizeReference(label)];
|
|
if (!ref) {
|
|
state.pos = oldPos;
|
|
return false;
|
|
}
|
|
href = ref.href;
|
|
title = ref.title;
|
|
}
|
|
if (!silent) {
|
|
content = state.src.slice(labelStart, labelEnd);
|
|
state.md.inline.parse(
|
|
content,
|
|
state.md,
|
|
state.env,
|
|
tokens = []
|
|
);
|
|
token = state.push("image", "img", 0);
|
|
token.attrs = attrs = [["src", href], ["alt", ""]];
|
|
token.children = tokens;
|
|
token.content = content;
|
|
if (title) {
|
|
attrs.push(["title", title]);
|
|
}
|
|
}
|
|
state.pos = pos;
|
|
state.posMax = max;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/autolink.js
|
|
var require_autolink = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/autolink.js"(exports, module2) {
|
|
"use strict";
|
|
var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
|
|
var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;
|
|
module2.exports = function autolink(state, silent) {
|
|
var url, fullUrl, token, ch, start, max, pos = state.pos;
|
|
if (state.src.charCodeAt(pos) !== 60) {
|
|
return false;
|
|
}
|
|
start = state.pos;
|
|
max = state.posMax;
|
|
for (; ; ) {
|
|
if (++pos >= max)
|
|
return false;
|
|
ch = state.src.charCodeAt(pos);
|
|
if (ch === 60)
|
|
return false;
|
|
if (ch === 62)
|
|
break;
|
|
}
|
|
url = state.src.slice(start + 1, pos);
|
|
if (AUTOLINK_RE.test(url)) {
|
|
fullUrl = state.md.normalizeLink(url);
|
|
if (!state.md.validateLink(fullUrl)) {
|
|
return false;
|
|
}
|
|
if (!silent) {
|
|
token = state.push("link_open", "a", 1);
|
|
token.attrs = [["href", fullUrl]];
|
|
token.markup = "autolink";
|
|
token.info = "auto";
|
|
token = state.push("text", "", 0);
|
|
token.content = state.md.normalizeLinkText(url);
|
|
token = state.push("link_close", "a", -1);
|
|
token.markup = "autolink";
|
|
token.info = "auto";
|
|
}
|
|
state.pos += url.length + 2;
|
|
return true;
|
|
}
|
|
if (EMAIL_RE.test(url)) {
|
|
fullUrl = state.md.normalizeLink("mailto:" + url);
|
|
if (!state.md.validateLink(fullUrl)) {
|
|
return false;
|
|
}
|
|
if (!silent) {
|
|
token = state.push("link_open", "a", 1);
|
|
token.attrs = [["href", fullUrl]];
|
|
token.markup = "autolink";
|
|
token.info = "auto";
|
|
token = state.push("text", "", 0);
|
|
token.content = state.md.normalizeLinkText(url);
|
|
token = state.push("link_close", "a", -1);
|
|
token.markup = "autolink";
|
|
token.info = "auto";
|
|
}
|
|
state.pos += url.length + 2;
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/html_inline.js
|
|
var require_html_inline = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/html_inline.js"(exports, module2) {
|
|
"use strict";
|
|
var HTML_TAG_RE = require_html_re().HTML_TAG_RE;
|
|
function isLinkOpen(str) {
|
|
return /^<a[>\s]/i.test(str);
|
|
}
|
|
function isLinkClose(str) {
|
|
return /^<\/a\s*>/i.test(str);
|
|
}
|
|
function isLetter(ch) {
|
|
var lc = ch | 32;
|
|
return lc >= 97 && lc <= 122;
|
|
}
|
|
module2.exports = function html_inline(state, silent) {
|
|
var ch, match, max, token, pos = state.pos;
|
|
if (!state.md.options.html) {
|
|
return false;
|
|
}
|
|
max = state.posMax;
|
|
if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) {
|
|
return false;
|
|
}
|
|
ch = state.src.charCodeAt(pos + 1);
|
|
if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) {
|
|
return false;
|
|
}
|
|
match = state.src.slice(pos).match(HTML_TAG_RE);
|
|
if (!match) {
|
|
return false;
|
|
}
|
|
if (!silent) {
|
|
token = state.push("html_inline", "", 0);
|
|
token.content = state.src.slice(pos, pos + match[0].length);
|
|
if (isLinkOpen(token.content))
|
|
state.linkLevel++;
|
|
if (isLinkClose(token.content))
|
|
state.linkLevel--;
|
|
}
|
|
state.pos += match[0].length;
|
|
return true;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/entity.js
|
|
var require_entity = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/entity.js"(exports, module2) {
|
|
"use strict";
|
|
var entities = require_entities2();
|
|
var has = require_utils().has;
|
|
var isValidEntityCode = require_utils().isValidEntityCode;
|
|
var fromCodePoint = require_utils().fromCodePoint;
|
|
var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
|
|
var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
|
|
module2.exports = function entity(state, silent) {
|
|
var ch, code, match, token, pos = state.pos, max = state.posMax;
|
|
if (state.src.charCodeAt(pos) !== 38)
|
|
return false;
|
|
if (pos + 1 >= max)
|
|
return false;
|
|
ch = state.src.charCodeAt(pos + 1);
|
|
if (ch === 35) {
|
|
match = state.src.slice(pos).match(DIGITAL_RE);
|
|
if (match) {
|
|
if (!silent) {
|
|
code = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
|
|
token = state.push("text_special", "", 0);
|
|
token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);
|
|
token.markup = match[0];
|
|
token.info = "entity";
|
|
}
|
|
state.pos += match[0].length;
|
|
return true;
|
|
}
|
|
} else {
|
|
match = state.src.slice(pos).match(NAMED_RE);
|
|
if (match) {
|
|
if (has(entities, match[1])) {
|
|
if (!silent) {
|
|
token = state.push("text_special", "", 0);
|
|
token.content = entities[match[1]];
|
|
token.markup = match[0];
|
|
token.info = "entity";
|
|
}
|
|
state.pos += match[0].length;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/balance_pairs.js
|
|
var require_balance_pairs = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(exports, module2) {
|
|
"use strict";
|
|
function processDelimiters(state, delimiters) {
|
|
var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, isOddMatch, lastJump, openersBottom = {}, max = delimiters.length;
|
|
if (!max)
|
|
return;
|
|
var headerIdx = 0;
|
|
var lastTokenIdx = -2;
|
|
var jumps = [];
|
|
for (closerIdx = 0; closerIdx < max; closerIdx++) {
|
|
closer = delimiters[closerIdx];
|
|
jumps.push(0);
|
|
if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
|
|
headerIdx = closerIdx;
|
|
}
|
|
lastTokenIdx = closer.token;
|
|
closer.length = closer.length || 0;
|
|
if (!closer.close)
|
|
continue;
|
|
if (!openersBottom.hasOwnProperty(closer.marker)) {
|
|
openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
|
|
}
|
|
minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
|
|
openerIdx = headerIdx - jumps[headerIdx] - 1;
|
|
newMinOpenerIdx = openerIdx;
|
|
for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
|
|
opener = delimiters[openerIdx];
|
|
if (opener.marker !== closer.marker)
|
|
continue;
|
|
if (opener.open && opener.end < 0) {
|
|
isOddMatch = false;
|
|
if (opener.close || closer.open) {
|
|
if ((opener.length + closer.length) % 3 === 0) {
|
|
if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
|
|
isOddMatch = true;
|
|
}
|
|
}
|
|
}
|
|
if (!isOddMatch) {
|
|
lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
|
|
jumps[closerIdx] = closerIdx - openerIdx + lastJump;
|
|
jumps[openerIdx] = lastJump;
|
|
closer.open = false;
|
|
opener.end = closerIdx;
|
|
opener.close = false;
|
|
newMinOpenerIdx = -1;
|
|
lastTokenIdx = -2;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (newMinOpenerIdx !== -1) {
|
|
openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
|
|
}
|
|
}
|
|
}
|
|
module2.exports = function link_pairs(state) {
|
|
var curr, tokens_meta = state.tokens_meta, max = state.tokens_meta.length;
|
|
processDelimiters(state, state.delimiters);
|
|
for (curr = 0; curr < max; curr++) {
|
|
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
|
|
processDelimiters(state, tokens_meta[curr].delimiters);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/fragments_join.js
|
|
var require_fragments_join = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/fragments_join.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function fragments_join(state) {
|
|
var curr, last, level = 0, tokens = state.tokens, max = state.tokens.length;
|
|
for (curr = last = 0; curr < max; curr++) {
|
|
if (tokens[curr].nesting < 0)
|
|
level--;
|
|
tokens[curr].level = level;
|
|
if (tokens[curr].nesting > 0)
|
|
level++;
|
|
if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
|
|
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
|
|
} else {
|
|
if (curr !== last) {
|
|
tokens[last] = tokens[curr];
|
|
}
|
|
last++;
|
|
}
|
|
}
|
|
if (curr !== last) {
|
|
tokens.length = last;
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/rules_inline/state_inline.js
|
|
var require_state_inline = __commonJS({
|
|
"node_modules/markdown-it/lib/rules_inline/state_inline.js"(exports, module2) {
|
|
"use strict";
|
|
var Token = require_token();
|
|
var isWhiteSpace = require_utils().isWhiteSpace;
|
|
var isPunctChar = require_utils().isPunctChar;
|
|
var isMdAsciiPunct = require_utils().isMdAsciiPunct;
|
|
function StateInline(src, md2, env, outTokens) {
|
|
this.src = src;
|
|
this.env = env;
|
|
this.md = md2;
|
|
this.tokens = outTokens;
|
|
this.tokens_meta = Array(outTokens.length);
|
|
this.pos = 0;
|
|
this.posMax = this.src.length;
|
|
this.level = 0;
|
|
this.pending = "";
|
|
this.pendingLevel = 0;
|
|
this.cache = {};
|
|
this.delimiters = [];
|
|
this._prev_delimiters = [];
|
|
this.backticks = {};
|
|
this.backticksScanned = false;
|
|
this.linkLevel = 0;
|
|
}
|
|
StateInline.prototype.pushPending = function() {
|
|
var token = new Token("text", "", 0);
|
|
token.content = this.pending;
|
|
token.level = this.pendingLevel;
|
|
this.tokens.push(token);
|
|
this.pending = "";
|
|
return token;
|
|
};
|
|
StateInline.prototype.push = function(type, tag, nesting) {
|
|
if (this.pending) {
|
|
this.pushPending();
|
|
}
|
|
var token = new Token(type, tag, nesting);
|
|
var token_meta = null;
|
|
if (nesting < 0) {
|
|
this.level--;
|
|
this.delimiters = this._prev_delimiters.pop();
|
|
}
|
|
token.level = this.level;
|
|
if (nesting > 0) {
|
|
this.level++;
|
|
this._prev_delimiters.push(this.delimiters);
|
|
this.delimiters = [];
|
|
token_meta = { delimiters: this.delimiters };
|
|
}
|
|
this.pendingLevel = this.level;
|
|
this.tokens.push(token);
|
|
this.tokens_meta.push(token_meta);
|
|
return token;
|
|
};
|
|
StateInline.prototype.scanDelims = function(start, canSplitWord) {
|
|
var pos = start, lastChar, nextChar, count, can_open, can_close, isLastWhiteSpace, isLastPunctChar, isNextWhiteSpace, isNextPunctChar, left_flanking = true, right_flanking = true, max = this.posMax, marker = this.src.charCodeAt(start);
|
|
lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;
|
|
while (pos < max && this.src.charCodeAt(pos) === marker) {
|
|
pos++;
|
|
}
|
|
count = pos - start;
|
|
nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
|
|
isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
|
|
isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
|
|
isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
if (isNextWhiteSpace) {
|
|
left_flanking = false;
|
|
} else if (isNextPunctChar) {
|
|
if (!(isLastWhiteSpace || isLastPunctChar)) {
|
|
left_flanking = false;
|
|
}
|
|
}
|
|
if (isLastWhiteSpace) {
|
|
right_flanking = false;
|
|
} else if (isLastPunctChar) {
|
|
if (!(isNextWhiteSpace || isNextPunctChar)) {
|
|
right_flanking = false;
|
|
}
|
|
}
|
|
if (!canSplitWord) {
|
|
can_open = left_flanking && (!right_flanking || isLastPunctChar);
|
|
can_close = right_flanking && (!left_flanking || isNextPunctChar);
|
|
} else {
|
|
can_open = left_flanking;
|
|
can_close = right_flanking;
|
|
}
|
|
return {
|
|
can_open,
|
|
can_close,
|
|
length: count
|
|
};
|
|
};
|
|
StateInline.prototype.Token = Token;
|
|
module2.exports = StateInline;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/parser_inline.js
|
|
var require_parser_inline = __commonJS({
|
|
"node_modules/markdown-it/lib/parser_inline.js"(exports, module2) {
|
|
"use strict";
|
|
var Ruler = require_ruler();
|
|
var _rules = [
|
|
["text", require_text()],
|
|
["linkify", require_linkify2()],
|
|
["newline", require_newline()],
|
|
["escape", require_escape()],
|
|
["backticks", require_backticks()],
|
|
["strikethrough", require_strikethrough().tokenize],
|
|
["emphasis", require_emphasis().tokenize],
|
|
["link", require_link()],
|
|
["image", require_image()],
|
|
["autolink", require_autolink()],
|
|
["html_inline", require_html_inline()],
|
|
["entity", require_entity()]
|
|
];
|
|
var _rules2 = [
|
|
["balance_pairs", require_balance_pairs()],
|
|
["strikethrough", require_strikethrough().postProcess],
|
|
["emphasis", require_emphasis().postProcess],
|
|
["fragments_join", require_fragments_join()]
|
|
];
|
|
function ParserInline() {
|
|
var i2;
|
|
this.ruler = new Ruler();
|
|
for (i2 = 0; i2 < _rules.length; i2++) {
|
|
this.ruler.push(_rules[i2][0], _rules[i2][1]);
|
|
}
|
|
this.ruler2 = new Ruler();
|
|
for (i2 = 0; i2 < _rules2.length; i2++) {
|
|
this.ruler2.push(_rules2[i2][0], _rules2[i2][1]);
|
|
}
|
|
}
|
|
ParserInline.prototype.skipToken = function(state) {
|
|
var ok, i2, pos = state.pos, rules = this.ruler.getRules(""), len = rules.length, maxNesting = state.md.options.maxNesting, cache = state.cache;
|
|
if (typeof cache[pos] !== "undefined") {
|
|
state.pos = cache[pos];
|
|
return;
|
|
}
|
|
if (state.level < maxNesting) {
|
|
for (i2 = 0; i2 < len; i2++) {
|
|
state.level++;
|
|
ok = rules[i2](state, true);
|
|
state.level--;
|
|
if (ok) {
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
state.pos = state.posMax;
|
|
}
|
|
if (!ok) {
|
|
state.pos++;
|
|
}
|
|
cache[pos] = state.pos;
|
|
};
|
|
ParserInline.prototype.tokenize = function(state) {
|
|
var ok, i2, rules = this.ruler.getRules(""), len = rules.length, end = state.posMax, maxNesting = state.md.options.maxNesting;
|
|
while (state.pos < end) {
|
|
if (state.level < maxNesting) {
|
|
for (i2 = 0; i2 < len; i2++) {
|
|
ok = rules[i2](state, false);
|
|
if (ok) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (ok) {
|
|
if (state.pos >= end) {
|
|
break;
|
|
}
|
|
continue;
|
|
}
|
|
state.pending += state.src[state.pos++];
|
|
}
|
|
if (state.pending) {
|
|
state.pushPending();
|
|
}
|
|
};
|
|
ParserInline.prototype.parse = function(str, md2, env, outTokens) {
|
|
var i2, rules, len;
|
|
var state = new this.State(str, md2, env, outTokens);
|
|
this.tokenize(state);
|
|
rules = this.ruler2.getRules("");
|
|
len = rules.length;
|
|
for (i2 = 0; i2 < len; i2++) {
|
|
rules[i2](state);
|
|
}
|
|
};
|
|
ParserInline.prototype.State = require_state_inline();
|
|
module2.exports = ParserInline;
|
|
}
|
|
});
|
|
|
|
// node_modules/linkify-it/lib/re.js
|
|
var require_re = __commonJS({
|
|
"node_modules/linkify-it/lib/re.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = function(opts) {
|
|
var re = {};
|
|
opts = opts || {};
|
|
re.src_Any = require_regex2().source;
|
|
re.src_Cc = require_regex3().source;
|
|
re.src_Z = require_regex5().source;
|
|
re.src_P = require_regex().source;
|
|
re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
|
|
re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
|
|
var text_separators = "[><\uFF5C]";
|
|
re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")";
|
|
re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
|
|
re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?";
|
|
re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
|
|
re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))";
|
|
re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + re.src_ZCc + "|$)|;(?!" + re.src_ZCc + "|$)|\\!+(?!" + re.src_ZCc + "|[!]|$)|\\?(?!" + re.src_ZCc + "|[?]|$))+|\\/)?";
|
|
re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
|
|
re.src_xn = "xn--[a-z0-9\\-]{1,59}";
|
|
re.src_domain_root = "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})";
|
|
re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))";
|
|
re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))";
|
|
re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))";
|
|
re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))";
|
|
re.src_host_strict = re.src_host + re.src_host_terminator;
|
|
re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
|
|
re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
|
|
re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
|
|
re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
|
|
re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))";
|
|
re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")";
|
|
re.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")";
|
|
re.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")";
|
|
return re;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/linkify-it/index.js
|
|
var require_linkify_it = __commonJS({
|
|
"node_modules/linkify-it/index.js"(exports, module2) {
|
|
"use strict";
|
|
function assign(obj) {
|
|
var sources = Array.prototype.slice.call(arguments, 1);
|
|
sources.forEach(function(source) {
|
|
if (!source) {
|
|
return;
|
|
}
|
|
Object.keys(source).forEach(function(key) {
|
|
obj[key] = source[key];
|
|
});
|
|
});
|
|
return obj;
|
|
}
|
|
function _class(obj) {
|
|
return Object.prototype.toString.call(obj);
|
|
}
|
|
function isString(obj) {
|
|
return _class(obj) === "[object String]";
|
|
}
|
|
function isObject(obj) {
|
|
return _class(obj) === "[object Object]";
|
|
}
|
|
function isRegExp(obj) {
|
|
return _class(obj) === "[object RegExp]";
|
|
}
|
|
function isFunction(obj) {
|
|
return _class(obj) === "[object Function]";
|
|
}
|
|
function escapeRE(str) {
|
|
return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
}
|
|
var defaultOptions = {
|
|
fuzzyLink: true,
|
|
fuzzyEmail: true,
|
|
fuzzyIP: false
|
|
};
|
|
function isOptionsObj(obj) {
|
|
return Object.keys(obj || {}).reduce(function(acc, k2) {
|
|
return acc || defaultOptions.hasOwnProperty(k2);
|
|
}, false);
|
|
}
|
|
var defaultSchemas = {
|
|
"http:": {
|
|
validate: function(text, pos, self2) {
|
|
var tail = text.slice(pos);
|
|
if (!self2.re.http) {
|
|
self2.re.http = new RegExp(
|
|
"^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path,
|
|
"i"
|
|
);
|
|
}
|
|
if (self2.re.http.test(tail)) {
|
|
return tail.match(self2.re.http)[0].length;
|
|
}
|
|
return 0;
|
|
}
|
|
},
|
|
"https:": "http:",
|
|
"ftp:": "http:",
|
|
"//": {
|
|
validate: function(text, pos, self2) {
|
|
var tail = text.slice(pos);
|
|
if (!self2.re.no_http) {
|
|
self2.re.no_http = new RegExp(
|
|
"^" + self2.re.src_auth + "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path,
|
|
"i"
|
|
);
|
|
}
|
|
if (self2.re.no_http.test(tail)) {
|
|
if (pos >= 3 && text[pos - 3] === ":") {
|
|
return 0;
|
|
}
|
|
if (pos >= 3 && text[pos - 3] === "/") {
|
|
return 0;
|
|
}
|
|
return tail.match(self2.re.no_http)[0].length;
|
|
}
|
|
return 0;
|
|
}
|
|
},
|
|
"mailto:": {
|
|
validate: function(text, pos, self2) {
|
|
var tail = text.slice(pos);
|
|
if (!self2.re.mailto) {
|
|
self2.re.mailto = new RegExp(
|
|
"^" + self2.re.src_email_name + "@" + self2.re.src_host_strict,
|
|
"i"
|
|
);
|
|
}
|
|
if (self2.re.mailto.test(tail)) {
|
|
return tail.match(self2.re.mailto)[0].length;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
};
|
|
var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
|
|
var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
|
|
function resetScanCache(self2) {
|
|
self2.__index__ = -1;
|
|
self2.__text_cache__ = "";
|
|
}
|
|
function createValidator(re) {
|
|
return function(text, pos) {
|
|
var tail = text.slice(pos);
|
|
if (re.test(tail)) {
|
|
return tail.match(re)[0].length;
|
|
}
|
|
return 0;
|
|
};
|
|
}
|
|
function createNormalizer() {
|
|
return function(match, self2) {
|
|
self2.normalize(match);
|
|
};
|
|
}
|
|
function compile(self2) {
|
|
var re = self2.re = require_re()(self2.__opts__);
|
|
var tlds = self2.__tlds__.slice();
|
|
self2.onCompile();
|
|
if (!self2.__tlds_replaced__) {
|
|
tlds.push(tlds_2ch_src_re);
|
|
}
|
|
tlds.push(re.src_xn);
|
|
re.src_tlds = tlds.join("|");
|
|
function untpl(tpl) {
|
|
return tpl.replace("%TLDS%", re.src_tlds);
|
|
}
|
|
re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
|
|
re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
|
|
re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
|
|
re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
|
|
var aliases2 = [];
|
|
self2.__compiled__ = {};
|
|
function schemaError(name, val) {
|
|
throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
|
|
}
|
|
Object.keys(self2.__schemas__).forEach(function(name) {
|
|
var val = self2.__schemas__[name];
|
|
if (val === null) {
|
|
return;
|
|
}
|
|
var compiled = { validate: null, link: null };
|
|
self2.__compiled__[name] = compiled;
|
|
if (isObject(val)) {
|
|
if (isRegExp(val.validate)) {
|
|
compiled.validate = createValidator(val.validate);
|
|
} else if (isFunction(val.validate)) {
|
|
compiled.validate = val.validate;
|
|
} else {
|
|
schemaError(name, val);
|
|
}
|
|
if (isFunction(val.normalize)) {
|
|
compiled.normalize = val.normalize;
|
|
} else if (!val.normalize) {
|
|
compiled.normalize = createNormalizer();
|
|
} else {
|
|
schemaError(name, val);
|
|
}
|
|
return;
|
|
}
|
|
if (isString(val)) {
|
|
aliases2.push(name);
|
|
return;
|
|
}
|
|
schemaError(name, val);
|
|
});
|
|
aliases2.forEach(function(alias) {
|
|
if (!self2.__compiled__[self2.__schemas__[alias]]) {
|
|
return;
|
|
}
|
|
self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate;
|
|
self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize;
|
|
});
|
|
self2.__compiled__[""] = { validate: null, normalize: createNormalizer() };
|
|
var slist = Object.keys(self2.__compiled__).filter(function(name) {
|
|
return name.length > 0 && self2.__compiled__[name];
|
|
}).map(escapeRE).join("|");
|
|
self2.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i");
|
|
self2.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
|
|
self2.re.schema_at_start = RegExp("^" + self2.re.schema_search.source, "i");
|
|
self2.re.pretest = RegExp(
|
|
"(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@",
|
|
"i"
|
|
);
|
|
resetScanCache(self2);
|
|
}
|
|
function Match(self2, shift) {
|
|
var start = self2.__index__, end = self2.__last_index__, text = self2.__text_cache__.slice(start, end);
|
|
this.schema = self2.__schema__.toLowerCase();
|
|
this.index = start + shift;
|
|
this.lastIndex = end + shift;
|
|
this.raw = text;
|
|
this.text = text;
|
|
this.url = text;
|
|
}
|
|
function createMatch(self2, shift) {
|
|
var match = new Match(self2, shift);
|
|
self2.__compiled__[match.schema].normalize(match, self2);
|
|
return match;
|
|
}
|
|
function LinkifyIt(schemas, options) {
|
|
if (!(this instanceof LinkifyIt)) {
|
|
return new LinkifyIt(schemas, options);
|
|
}
|
|
if (!options) {
|
|
if (isOptionsObj(schemas)) {
|
|
options = schemas;
|
|
schemas = {};
|
|
}
|
|
}
|
|
this.__opts__ = assign({}, defaultOptions, options);
|
|
this.__index__ = -1;
|
|
this.__last_index__ = -1;
|
|
this.__schema__ = "";
|
|
this.__text_cache__ = "";
|
|
this.__schemas__ = assign({}, defaultSchemas, schemas);
|
|
this.__compiled__ = {};
|
|
this.__tlds__ = tlds_default;
|
|
this.__tlds_replaced__ = false;
|
|
this.re = {};
|
|
compile(this);
|
|
}
|
|
LinkifyIt.prototype.add = function add(schema, definition) {
|
|
this.__schemas__[schema] = definition;
|
|
compile(this);
|
|
return this;
|
|
};
|
|
LinkifyIt.prototype.set = function set(options) {
|
|
this.__opts__ = assign(this.__opts__, options);
|
|
return this;
|
|
};
|
|
LinkifyIt.prototype.test = function test(text) {
|
|
this.__text_cache__ = text;
|
|
this.__index__ = -1;
|
|
if (!text.length) {
|
|
return false;
|
|
}
|
|
var m2, ml, me, len, shift, next, re, tld_pos, at_pos;
|
|
if (this.re.schema_test.test(text)) {
|
|
re = this.re.schema_search;
|
|
re.lastIndex = 0;
|
|
while ((m2 = re.exec(text)) !== null) {
|
|
len = this.testSchemaAt(text, m2[2], re.lastIndex);
|
|
if (len) {
|
|
this.__schema__ = m2[2];
|
|
this.__index__ = m2.index + m2[1].length;
|
|
this.__last_index__ = m2.index + m2[0].length + len;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
|
|
tld_pos = text.search(this.re.host_fuzzy_test);
|
|
if (tld_pos >= 0) {
|
|
if (this.__index__ < 0 || tld_pos < this.__index__) {
|
|
if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
|
|
shift = ml.index + ml[1].length;
|
|
if (this.__index__ < 0 || shift < this.__index__) {
|
|
this.__schema__ = "";
|
|
this.__index__ = shift;
|
|
this.__last_index__ = ml.index + ml[0].length;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
|
|
at_pos = text.indexOf("@");
|
|
if (at_pos >= 0) {
|
|
if ((me = text.match(this.re.email_fuzzy)) !== null) {
|
|
shift = me.index + me[1].length;
|
|
next = me.index + me[0].length;
|
|
if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
|
|
this.__schema__ = "mailto:";
|
|
this.__index__ = shift;
|
|
this.__last_index__ = next;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return this.__index__ >= 0;
|
|
};
|
|
LinkifyIt.prototype.pretest = function pretest(text) {
|
|
return this.re.pretest.test(text);
|
|
};
|
|
LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
|
|
if (!this.__compiled__[schema.toLowerCase()]) {
|
|
return 0;
|
|
}
|
|
return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
|
|
};
|
|
LinkifyIt.prototype.match = function match(text) {
|
|
var shift = 0, result = [];
|
|
if (this.__index__ >= 0 && this.__text_cache__ === text) {
|
|
result.push(createMatch(this, shift));
|
|
shift = this.__last_index__;
|
|
}
|
|
var tail = shift ? text.slice(shift) : text;
|
|
while (this.test(tail)) {
|
|
result.push(createMatch(this, shift));
|
|
tail = tail.slice(this.__last_index__);
|
|
shift += this.__last_index__;
|
|
}
|
|
if (result.length) {
|
|
return result;
|
|
}
|
|
return null;
|
|
};
|
|
LinkifyIt.prototype.matchAtStart = function matchAtStart(text) {
|
|
this.__text_cache__ = text;
|
|
this.__index__ = -1;
|
|
if (!text.length)
|
|
return null;
|
|
var m2 = this.re.schema_at_start.exec(text);
|
|
if (!m2)
|
|
return null;
|
|
var len = this.testSchemaAt(text, m2[2], m2[0].length);
|
|
if (!len)
|
|
return null;
|
|
this.__schema__ = m2[2];
|
|
this.__index__ = m2.index + m2[1].length;
|
|
this.__last_index__ = m2.index + m2[0].length + len;
|
|
return createMatch(this, 0);
|
|
};
|
|
LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
|
|
list = Array.isArray(list) ? list : [list];
|
|
if (!keepOld) {
|
|
this.__tlds__ = list.slice();
|
|
this.__tlds_replaced__ = true;
|
|
compile(this);
|
|
return this;
|
|
}
|
|
this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) {
|
|
return el !== arr[idx - 1];
|
|
}).reverse();
|
|
compile(this);
|
|
return this;
|
|
};
|
|
LinkifyIt.prototype.normalize = function normalize(match) {
|
|
if (!match.schema) {
|
|
match.url = "http://" + match.url;
|
|
}
|
|
if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) {
|
|
match.url = "mailto:" + match.url;
|
|
}
|
|
};
|
|
LinkifyIt.prototype.onCompile = function onCompile() {
|
|
};
|
|
module2.exports = LinkifyIt;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/presets/default.js
|
|
var require_default = __commonJS({
|
|
"node_modules/markdown-it/lib/presets/default.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = {
|
|
options: {
|
|
html: false,
|
|
xhtmlOut: false,
|
|
breaks: false,
|
|
langPrefix: "language-",
|
|
linkify: false,
|
|
typographer: false,
|
|
quotes: "\u201C\u201D\u2018\u2019",
|
|
highlight: null,
|
|
maxNesting: 100
|
|
},
|
|
components: {
|
|
core: {},
|
|
block: {},
|
|
inline: {}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/presets/zero.js
|
|
var require_zero = __commonJS({
|
|
"node_modules/markdown-it/lib/presets/zero.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = {
|
|
options: {
|
|
html: false,
|
|
xhtmlOut: false,
|
|
breaks: false,
|
|
langPrefix: "language-",
|
|
linkify: false,
|
|
typographer: false,
|
|
quotes: "\u201C\u201D\u2018\u2019",
|
|
highlight: null,
|
|
maxNesting: 20
|
|
},
|
|
components: {
|
|
core: {
|
|
rules: [
|
|
"normalize",
|
|
"block",
|
|
"inline",
|
|
"text_join"
|
|
]
|
|
},
|
|
block: {
|
|
rules: [
|
|
"paragraph"
|
|
]
|
|
},
|
|
inline: {
|
|
rules: [
|
|
"text"
|
|
],
|
|
rules2: [
|
|
"balance_pairs",
|
|
"fragments_join"
|
|
]
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/presets/commonmark.js
|
|
var require_commonmark = __commonJS({
|
|
"node_modules/markdown-it/lib/presets/commonmark.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = {
|
|
options: {
|
|
html: true,
|
|
xhtmlOut: true,
|
|
breaks: false,
|
|
langPrefix: "language-",
|
|
linkify: false,
|
|
typographer: false,
|
|
quotes: "\u201C\u201D\u2018\u2019",
|
|
highlight: null,
|
|
maxNesting: 20
|
|
},
|
|
components: {
|
|
core: {
|
|
rules: [
|
|
"normalize",
|
|
"block",
|
|
"inline",
|
|
"text_join"
|
|
]
|
|
},
|
|
block: {
|
|
rules: [
|
|
"blockquote",
|
|
"code",
|
|
"fence",
|
|
"heading",
|
|
"hr",
|
|
"html_block",
|
|
"lheading",
|
|
"list",
|
|
"reference",
|
|
"paragraph"
|
|
]
|
|
},
|
|
inline: {
|
|
rules: [
|
|
"autolink",
|
|
"backticks",
|
|
"emphasis",
|
|
"entity",
|
|
"escape",
|
|
"html_inline",
|
|
"image",
|
|
"link",
|
|
"newline",
|
|
"text"
|
|
],
|
|
rules2: [
|
|
"balance_pairs",
|
|
"emphasis",
|
|
"fragments_join"
|
|
]
|
|
}
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/lib/index.js
|
|
var require_lib4 = __commonJS({
|
|
"node_modules/markdown-it/lib/index.js"(exports, module2) {
|
|
"use strict";
|
|
var utils = require_utils();
|
|
var helpers = require_helpers();
|
|
var Renderer = require_renderer();
|
|
var ParserCore = require_parser_core();
|
|
var ParserBlock = require_parser_block();
|
|
var ParserInline = require_parser_inline();
|
|
var LinkifyIt = require_linkify_it();
|
|
var mdurl = require_mdurl();
|
|
var punycode = require("punycode");
|
|
var config = {
|
|
default: require_default(),
|
|
zero: require_zero(),
|
|
commonmark: require_commonmark()
|
|
};
|
|
var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
|
|
var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
|
|
function validateLink(url) {
|
|
var str = url.trim().toLowerCase();
|
|
return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) ? true : false : true;
|
|
}
|
|
var RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"];
|
|
function normalizeLink(url) {
|
|
var parsed = mdurl.parse(url, true);
|
|
if (parsed.hostname) {
|
|
if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
|
|
try {
|
|
parsed.hostname = punycode.toASCII(parsed.hostname);
|
|
} catch (er) {
|
|
}
|
|
}
|
|
}
|
|
return mdurl.encode(mdurl.format(parsed));
|
|
}
|
|
function normalizeLinkText(url) {
|
|
var parsed = mdurl.parse(url, true);
|
|
if (parsed.hostname) {
|
|
if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
|
|
try {
|
|
parsed.hostname = punycode.toUnicode(parsed.hostname);
|
|
} catch (er) {
|
|
}
|
|
}
|
|
}
|
|
return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%");
|
|
}
|
|
function MarkdownIt2(presetName, options) {
|
|
if (!(this instanceof MarkdownIt2)) {
|
|
return new MarkdownIt2(presetName, options);
|
|
}
|
|
if (!options) {
|
|
if (!utils.isString(presetName)) {
|
|
options = presetName || {};
|
|
presetName = "default";
|
|
}
|
|
}
|
|
this.inline = new ParserInline();
|
|
this.block = new ParserBlock();
|
|
this.core = new ParserCore();
|
|
this.renderer = new Renderer();
|
|
this.linkify = new LinkifyIt();
|
|
this.validateLink = validateLink;
|
|
this.normalizeLink = normalizeLink;
|
|
this.normalizeLinkText = normalizeLinkText;
|
|
this.utils = utils;
|
|
this.helpers = utils.assign({}, helpers);
|
|
this.options = {};
|
|
this.configure(presetName);
|
|
if (options) {
|
|
this.set(options);
|
|
}
|
|
}
|
|
MarkdownIt2.prototype.set = function(options) {
|
|
utils.assign(this.options, options);
|
|
return this;
|
|
};
|
|
MarkdownIt2.prototype.configure = function(presets) {
|
|
var self2 = this, presetName;
|
|
if (utils.isString(presets)) {
|
|
presetName = presets;
|
|
presets = config[presetName];
|
|
if (!presets) {
|
|
throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name');
|
|
}
|
|
}
|
|
if (!presets) {
|
|
throw new Error("Wrong `markdown-it` preset, can't be empty");
|
|
}
|
|
if (presets.options) {
|
|
self2.set(presets.options);
|
|
}
|
|
if (presets.components) {
|
|
Object.keys(presets.components).forEach(function(name) {
|
|
if (presets.components[name].rules) {
|
|
self2[name].ruler.enableOnly(presets.components[name].rules);
|
|
}
|
|
if (presets.components[name].rules2) {
|
|
self2[name].ruler2.enableOnly(presets.components[name].rules2);
|
|
}
|
|
});
|
|
}
|
|
return this;
|
|
};
|
|
MarkdownIt2.prototype.enable = function(list, ignoreInvalid) {
|
|
var result = [];
|
|
if (!Array.isArray(list)) {
|
|
list = [list];
|
|
}
|
|
["core", "block", "inline"].forEach(function(chain) {
|
|
result = result.concat(this[chain].ruler.enable(list, true));
|
|
}, this);
|
|
result = result.concat(this.inline.ruler2.enable(list, true));
|
|
var missed = list.filter(function(name) {
|
|
return result.indexOf(name) < 0;
|
|
});
|
|
if (missed.length && !ignoreInvalid) {
|
|
throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed);
|
|
}
|
|
return this;
|
|
};
|
|
MarkdownIt2.prototype.disable = function(list, ignoreInvalid) {
|
|
var result = [];
|
|
if (!Array.isArray(list)) {
|
|
list = [list];
|
|
}
|
|
["core", "block", "inline"].forEach(function(chain) {
|
|
result = result.concat(this[chain].ruler.disable(list, true));
|
|
}, this);
|
|
result = result.concat(this.inline.ruler2.disable(list, true));
|
|
var missed = list.filter(function(name) {
|
|
return result.indexOf(name) < 0;
|
|
});
|
|
if (missed.length && !ignoreInvalid) {
|
|
throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed);
|
|
}
|
|
return this;
|
|
};
|
|
MarkdownIt2.prototype.use = function(plugin) {
|
|
var args = [this].concat(Array.prototype.slice.call(arguments, 1));
|
|
plugin.apply(plugin, args);
|
|
return this;
|
|
};
|
|
MarkdownIt2.prototype.parse = function(src, env) {
|
|
if (typeof src !== "string") {
|
|
throw new Error("Input data should be a String");
|
|
}
|
|
var state = new this.core.State(src, this, env);
|
|
this.core.process(state);
|
|
return state.tokens;
|
|
};
|
|
MarkdownIt2.prototype.render = function(src, env) {
|
|
env = env || {};
|
|
return this.renderer.render(this.parse(src, env), this.options, env);
|
|
};
|
|
MarkdownIt2.prototype.parseInline = function(src, env) {
|
|
var state = new this.core.State(src, this, env);
|
|
state.inlineMode = true;
|
|
this.core.process(state);
|
|
return state.tokens;
|
|
};
|
|
MarkdownIt2.prototype.renderInline = function(src, env) {
|
|
env = env || {};
|
|
return this.renderer.render(this.parseInline(src, env), this.options, env);
|
|
};
|
|
module2.exports = MarkdownIt2;
|
|
}
|
|
});
|
|
|
|
// node_modules/markdown-it/index.js
|
|
var require_markdown_it = __commonJS({
|
|
"node_modules/markdown-it/index.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = require_lib4();
|
|
}
|
|
});
|
|
|
|
// node_modules/classnames/index.js
|
|
var require_classnames = __commonJS({
|
|
"node_modules/classnames/index.js"(exports, module2) {
|
|
(function() {
|
|
"use strict";
|
|
var hasOwn = {}.hasOwnProperty;
|
|
var nativeCodeString = "[native code]";
|
|
function classNames() {
|
|
var classes = [];
|
|
for (var i2 = 0; i2 < arguments.length; i2++) {
|
|
var arg = arguments[i2];
|
|
if (!arg)
|
|
continue;
|
|
var argType = typeof arg;
|
|
if (argType === "string" || argType === "number") {
|
|
classes.push(arg);
|
|
} else if (Array.isArray(arg)) {
|
|
if (arg.length) {
|
|
var inner = classNames.apply(null, arg);
|
|
if (inner) {
|
|
classes.push(inner);
|
|
}
|
|
}
|
|
} else if (argType === "object") {
|
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
classes.push(arg.toString());
|
|
continue;
|
|
}
|
|
for (var key in arg) {
|
|
if (hasOwn.call(arg, key) && arg[key]) {
|
|
classes.push(key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return classes.join(" ");
|
|
}
|
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
classNames.default = classNames;
|
|
module2.exports = classNames;
|
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
define("classnames", [], function() {
|
|
return classNames;
|
|
});
|
|
} else {
|
|
window.classNames = classNames;
|
|
}
|
|
})();
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/requiredArgs/index.js
|
|
var require_requiredArgs = __commonJS({
|
|
"node_modules/date-fns/_lib/requiredArgs/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = requiredArgs;
|
|
function requiredArgs(required, args) {
|
|
if (args.length < required) {
|
|
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isDate/index.js
|
|
var require_isDate = __commonJS({
|
|
"node_modules/date-fns/isDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isDate3;
|
|
var _index = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
function isDate3(value) {
|
|
(0, _index.default)(1, arguments);
|
|
return value instanceof Date || _typeof(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/toDate/index.js
|
|
var require_toDate = __commonJS({
|
|
"node_modules/date-fns/toDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = toDate;
|
|
var _index = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
function toDate(argument) {
|
|
(0, _index.default)(1, arguments);
|
|
var argStr = Object.prototype.toString.call(argument);
|
|
if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
|
|
return new Date(argument.getTime());
|
|
} else if (typeof argument === "number" || argStr === "[object Number]") {
|
|
return new Date(argument);
|
|
} else {
|
|
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
|
|
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
console.warn(new Error().stack);
|
|
}
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isValid/index.js
|
|
var require_isValid = __commonJS({
|
|
"node_modules/date-fns/isValid/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isValid;
|
|
var _index = _interopRequireDefault(require_isDate());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isValid(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
if (!(0, _index.default)(dirtyDate) && typeof dirtyDate !== "number") {
|
|
return false;
|
|
}
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
return !isNaN(Number(date));
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/toInteger/index.js
|
|
var require_toInteger = __commonJS({
|
|
"node_modules/date-fns/_lib/toInteger/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = toInteger;
|
|
function toInteger(dirtyNumber) {
|
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
return NaN;
|
|
}
|
|
var number = Number(dirtyNumber);
|
|
if (isNaN(number)) {
|
|
return number;
|
|
}
|
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMilliseconds/index.js
|
|
var require_addMilliseconds = __commonJS({
|
|
"node_modules/date-fns/addMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMilliseconds;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var timestamp = (0, _index2.default)(dirtyDate).getTime();
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return new Date(timestamp + amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMilliseconds/index.js
|
|
var require_subMilliseconds = __commonJS({
|
|
"node_modules/date-fns/subMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMilliseconds;
|
|
var _index = _interopRequireDefault(require_addMilliseconds());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
|
(0, _index2.default)(2, arguments);
|
|
var amount = (0, _index3.default)(dirtyAmount);
|
|
return (0, _index.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCDayOfYear/index.js
|
|
var require_getUTCDayOfYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCDayOfYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCDayOfYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_DAY = 864e5;
|
|
function getUTCDayOfYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var timestamp = date.getTime();
|
|
date.setUTCMonth(0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
var startOfYearTimestamp = date.getTime();
|
|
var difference = timestamp - startOfYearTimestamp;
|
|
return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCISOWeek/index.js
|
|
var require_startOfUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCISOWeek(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var weekStartsOn = 1;
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getUTCDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCISOWeekYear/index.js
|
|
var require_getUTCISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCISOWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getUTCISOWeekYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getUTCFullYear();
|
|
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
|
|
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index3.default)(fourthOfJanuaryOfNextYear);
|
|
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
|
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index3.default)(fourthOfJanuaryOfThisYear);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js
|
|
var require_startOfUTCISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCISOWeekYear;
|
|
var _index = _interopRequireDefault(require_getUTCISOWeekYear());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var year = (0, _index.default)(dirtyDate);
|
|
var fourthOfJanuary = new Date(0);
|
|
fourthOfJanuary.setUTCFullYear(year, 0, 4);
|
|
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
|
|
var date = (0, _index2.default)(fourthOfJanuary);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCISOWeek/index.js
|
|
var require_getUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getUTCISOWeek(dirtyDate) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/defaultOptions/index.js
|
|
var require_defaultOptions = __commonJS({
|
|
"node_modules/date-fns/_lib/defaultOptions/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getDefaultOptions = getDefaultOptions;
|
|
exports.setDefaultOptions = setDefaultOptions;
|
|
var defaultOptions = {};
|
|
function getDefaultOptions() {
|
|
return defaultOptions;
|
|
}
|
|
function setDefaultOptions(newOptions) {
|
|
defaultOptions = newOptions;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCWeek/index.js
|
|
var require_startOfUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
var _index4 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCWeek(dirtyDate, options) {
|
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index2.default)(1, arguments);
|
|
var defaultOptions = (0, _index4.getDefaultOptions)();
|
|
var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getUTCDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setUTCDate(date.getUTCDate() - diff);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCWeekYear/index.js
|
|
var require_getUTCWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_toInteger());
|
|
var _index5 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getUTCWeekYear(dirtyDate, options) {
|
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getUTCFullYear();
|
|
var defaultOptions = (0, _index5.getDefaultOptions)();
|
|
var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var firstWeekOfNextYear = new Date(0);
|
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, options);
|
|
var firstWeekOfThisYear = new Date(0);
|
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, options);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/startOfUTCWeekYear/index.js
|
|
var require_startOfUTCWeekYear = __commonJS({
|
|
"node_modules/date-fns/_lib/startOfUTCWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfUTCWeekYear;
|
|
var _index = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_toInteger());
|
|
var _index5 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfUTCWeekYear(dirtyDate, options) {
|
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index2.default)(1, arguments);
|
|
var defaultOptions = (0, _index5.getDefaultOptions)();
|
|
var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
|
var year = (0, _index.default)(dirtyDate, options);
|
|
var firstWeek = new Date(0);
|
|
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
|
|
firstWeek.setUTCHours(0, 0, 0, 0);
|
|
var date = (0, _index3.default)(firstWeek, options);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getUTCWeek/index.js
|
|
var require_getUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/getUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getUTCWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfUTCWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getUTCWeek(dirtyDate, options) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/addLeadingZeros/index.js
|
|
var require_addLeadingZeros = __commonJS({
|
|
"node_modules/date-fns/_lib/addLeadingZeros/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addLeadingZeros;
|
|
function addLeadingZeros(number, targetLength) {
|
|
var sign = number < 0 ? "-" : "";
|
|
var output = Math.abs(number).toString();
|
|
while (output.length < targetLength) {
|
|
output = "0" + output;
|
|
}
|
|
return sign + output;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/lightFormatters/index.js
|
|
var require_lightFormatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/lightFormatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_addLeadingZeros());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var formatters = {
|
|
y: function y2(date, token) {
|
|
var signedYear = date.getUTCFullYear();
|
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
return (0, _index.default)(token === "yy" ? year % 100 : year, token.length);
|
|
},
|
|
M: function M2(date, token) {
|
|
var month = date.getUTCMonth();
|
|
return token === "M" ? String(month + 1) : (0, _index.default)(month + 1, 2);
|
|
},
|
|
d: function d2(date, token) {
|
|
return (0, _index.default)(date.getUTCDate(), token.length);
|
|
},
|
|
a: function a2(date, token) {
|
|
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
return dayPeriodEnumValue.toUpperCase();
|
|
case "aaa":
|
|
return dayPeriodEnumValue;
|
|
case "aaaaa":
|
|
return dayPeriodEnumValue[0];
|
|
case "aaaa":
|
|
default:
|
|
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
}
|
|
},
|
|
h: function h2(date, token) {
|
|
return (0, _index.default)(date.getUTCHours() % 12 || 12, token.length);
|
|
},
|
|
H: function H2(date, token) {
|
|
return (0, _index.default)(date.getUTCHours(), token.length);
|
|
},
|
|
m: function m2(date, token) {
|
|
return (0, _index.default)(date.getUTCMinutes(), token.length);
|
|
},
|
|
s: function s2(date, token) {
|
|
return (0, _index.default)(date.getUTCSeconds(), token.length);
|
|
},
|
|
S: function S2(date, token) {
|
|
var numberOfDigits = token.length;
|
|
var milliseconds = date.getUTCMilliseconds();
|
|
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
|
|
return (0, _index.default)(fractionalSeconds, token.length);
|
|
}
|
|
};
|
|
var _default = formatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/formatters/index.js
|
|
var require_formatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/formatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_getUTCDayOfYear());
|
|
var _index2 = _interopRequireDefault(require_getUTCISOWeek());
|
|
var _index3 = _interopRequireDefault(require_getUTCISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_getUTCWeek());
|
|
var _index5 = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index6 = _interopRequireDefault(require_addLeadingZeros());
|
|
var _index7 = _interopRequireDefault(require_lightFormatters());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var dayPeriodEnum = {
|
|
am: "am",
|
|
pm: "pm",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
};
|
|
var formatters = {
|
|
G: function G2(date, token, localize) {
|
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
switch (token) {
|
|
case "G":
|
|
case "GG":
|
|
case "GGG":
|
|
return localize.era(era, {
|
|
width: "abbreviated"
|
|
});
|
|
case "GGGGG":
|
|
return localize.era(era, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGG":
|
|
default:
|
|
return localize.era(era, {
|
|
width: "wide"
|
|
});
|
|
}
|
|
},
|
|
y: function y2(date, token, localize) {
|
|
if (token === "yo") {
|
|
var signedYear = date.getUTCFullYear();
|
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
return localize.ordinalNumber(year, {
|
|
unit: "year"
|
|
});
|
|
}
|
|
return _index7.default.y(date, token);
|
|
},
|
|
Y: function Y2(date, token, localize, options) {
|
|
var signedWeekYear = (0, _index5.default)(date, options);
|
|
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
if (token === "YY") {
|
|
var twoDigitYear = weekYear % 100;
|
|
return (0, _index6.default)(twoDigitYear, 2);
|
|
}
|
|
if (token === "Yo") {
|
|
return localize.ordinalNumber(weekYear, {
|
|
unit: "year"
|
|
});
|
|
}
|
|
return (0, _index6.default)(weekYear, token.length);
|
|
},
|
|
R: function R2(date, token) {
|
|
var isoWeekYear = (0, _index3.default)(date);
|
|
return (0, _index6.default)(isoWeekYear, token.length);
|
|
},
|
|
u: function u2(date, token) {
|
|
var year = date.getUTCFullYear();
|
|
return (0, _index6.default)(year, token.length);
|
|
},
|
|
Q: function Q2(date, token, localize) {
|
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
switch (token) {
|
|
case "Q":
|
|
return String(quarter);
|
|
case "QQ":
|
|
return (0, _index6.default)(quarter, 2);
|
|
case "Qo":
|
|
return localize.ordinalNumber(quarter, {
|
|
unit: "quarter"
|
|
});
|
|
case "QQQ":
|
|
return localize.quarter(quarter, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQQ":
|
|
return localize.quarter(quarter, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQ":
|
|
default:
|
|
return localize.quarter(quarter, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
q: function q2(date, token, localize) {
|
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
switch (token) {
|
|
case "q":
|
|
return String(quarter);
|
|
case "qq":
|
|
return (0, _index6.default)(quarter, 2);
|
|
case "qo":
|
|
return localize.ordinalNumber(quarter, {
|
|
unit: "quarter"
|
|
});
|
|
case "qqq":
|
|
return localize.quarter(quarter, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "qqqqq":
|
|
return localize.quarter(quarter, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqq":
|
|
default:
|
|
return localize.quarter(quarter, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
M: function M2(date, token, localize) {
|
|
var month = date.getUTCMonth();
|
|
switch (token) {
|
|
case "M":
|
|
case "MM":
|
|
return _index7.default.M(date, token);
|
|
case "Mo":
|
|
return localize.ordinalNumber(month + 1, {
|
|
unit: "month"
|
|
});
|
|
case "MMM":
|
|
return localize.month(month, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "MMMMM":
|
|
return localize.month(month, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMM":
|
|
default:
|
|
return localize.month(month, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
L: function L2(date, token, localize) {
|
|
var month = date.getUTCMonth();
|
|
switch (token) {
|
|
case "L":
|
|
return String(month + 1);
|
|
case "LL":
|
|
return (0, _index6.default)(month + 1, 2);
|
|
case "Lo":
|
|
return localize.ordinalNumber(month + 1, {
|
|
unit: "month"
|
|
});
|
|
case "LLL":
|
|
return localize.month(month, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "LLLLL":
|
|
return localize.month(month, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLL":
|
|
default:
|
|
return localize.month(month, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
w: function w2(date, token, localize, options) {
|
|
var week = (0, _index4.default)(date, options);
|
|
if (token === "wo") {
|
|
return localize.ordinalNumber(week, {
|
|
unit: "week"
|
|
});
|
|
}
|
|
return (0, _index6.default)(week, token.length);
|
|
},
|
|
I: function I2(date, token, localize) {
|
|
var isoWeek = (0, _index2.default)(date);
|
|
if (token === "Io") {
|
|
return localize.ordinalNumber(isoWeek, {
|
|
unit: "week"
|
|
});
|
|
}
|
|
return (0, _index6.default)(isoWeek, token.length);
|
|
},
|
|
d: function d2(date, token, localize) {
|
|
if (token === "do") {
|
|
return localize.ordinalNumber(date.getUTCDate(), {
|
|
unit: "date"
|
|
});
|
|
}
|
|
return _index7.default.d(date, token);
|
|
},
|
|
D: function D2(date, token, localize) {
|
|
var dayOfYear = (0, _index.default)(date);
|
|
if (token === "Do") {
|
|
return localize.ordinalNumber(dayOfYear, {
|
|
unit: "dayOfYear"
|
|
});
|
|
}
|
|
return (0, _index6.default)(dayOfYear, token.length);
|
|
},
|
|
E: function E2(date, token, localize) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
switch (token) {
|
|
case "E":
|
|
case "EE":
|
|
case "EEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEEE":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "EEEE":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
e: function e(date, token, localize, options) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
switch (token) {
|
|
case "e":
|
|
return String(localDayOfWeek);
|
|
case "ee":
|
|
return (0, _index6.default)(localDayOfWeek, 2);
|
|
case "eo":
|
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "eee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "eeeee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeeee":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "eeee":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
c: function c2(date, token, localize, options) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
switch (token) {
|
|
case "c":
|
|
return String(localDayOfWeek);
|
|
case "cc":
|
|
return (0, _index6.default)(localDayOfWeek, token.length);
|
|
case "co":
|
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "ccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
});
|
|
case "ccccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccccc":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "standalone"
|
|
});
|
|
case "cccc":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
},
|
|
i: function i2(date, token, localize) {
|
|
var dayOfWeek = date.getUTCDay();
|
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
switch (token) {
|
|
case "i":
|
|
return String(isoDayOfWeek);
|
|
case "ii":
|
|
return (0, _index6.default)(isoDayOfWeek, token.length);
|
|
case "io":
|
|
return localize.ordinalNumber(isoDayOfWeek, {
|
|
unit: "day"
|
|
});
|
|
case "iii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "iiiii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "iiiiii":
|
|
return localize.day(dayOfWeek, {
|
|
width: "short",
|
|
context: "formatting"
|
|
});
|
|
case "iiii":
|
|
default:
|
|
return localize.day(dayOfWeek, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
a: function a2(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "aaa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}).toLowerCase();
|
|
case "aaaaa":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaa":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
b: function b2(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue;
|
|
if (hours === 12) {
|
|
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
} else if (hours === 0) {
|
|
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
} else {
|
|
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
}
|
|
switch (token) {
|
|
case "b":
|
|
case "bb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "bbb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}).toLowerCase();
|
|
case "bbbbb":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbb":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
B: function B2(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
var dayPeriodEnumValue;
|
|
if (hours >= 17) {
|
|
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
} else if (hours >= 12) {
|
|
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
} else if (hours >= 4) {
|
|
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
} else {
|
|
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
}
|
|
switch (token) {
|
|
case "B":
|
|
case "BB":
|
|
case "BBB":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
});
|
|
case "BBBBB":
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBB":
|
|
default:
|
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
},
|
|
h: function h2(date, token, localize) {
|
|
if (token === "ho") {
|
|
var hours = date.getUTCHours() % 12;
|
|
if (hours === 0)
|
|
hours = 12;
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return _index7.default.h(date, token);
|
|
},
|
|
H: function H2(date, token, localize) {
|
|
if (token === "Ho") {
|
|
return localize.ordinalNumber(date.getUTCHours(), {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return _index7.default.H(date, token);
|
|
},
|
|
K: function K(date, token, localize) {
|
|
var hours = date.getUTCHours() % 12;
|
|
if (token === "Ko") {
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return (0, _index6.default)(hours, token.length);
|
|
},
|
|
k: function k2(date, token, localize) {
|
|
var hours = date.getUTCHours();
|
|
if (hours === 0)
|
|
hours = 24;
|
|
if (token === "ko") {
|
|
return localize.ordinalNumber(hours, {
|
|
unit: "hour"
|
|
});
|
|
}
|
|
return (0, _index6.default)(hours, token.length);
|
|
},
|
|
m: function m2(date, token, localize) {
|
|
if (token === "mo") {
|
|
return localize.ordinalNumber(date.getUTCMinutes(), {
|
|
unit: "minute"
|
|
});
|
|
}
|
|
return _index7.default.m(date, token);
|
|
},
|
|
s: function s2(date, token, localize) {
|
|
if (token === "so") {
|
|
return localize.ordinalNumber(date.getUTCSeconds(), {
|
|
unit: "second"
|
|
});
|
|
}
|
|
return _index7.default.s(date, token);
|
|
},
|
|
S: function S2(date, token) {
|
|
return _index7.default.S(date, token);
|
|
},
|
|
X: function X2(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
if (timezoneOffset === 0) {
|
|
return "Z";
|
|
}
|
|
switch (token) {
|
|
case "X":
|
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
case "XXXX":
|
|
case "XX":
|
|
return formatTimezone(timezoneOffset);
|
|
case "XXXXX":
|
|
case "XXX":
|
|
default:
|
|
return formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
x: function x2(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "x":
|
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
case "xxxx":
|
|
case "xx":
|
|
return formatTimezone(timezoneOffset);
|
|
case "xxxxx":
|
|
case "xxx":
|
|
default:
|
|
return formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
O: function O2(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "O":
|
|
case "OO":
|
|
case "OOO":
|
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
case "OOOO":
|
|
default:
|
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
z: function z2(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
switch (token) {
|
|
case "z":
|
|
case "zz":
|
|
case "zzz":
|
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
case "zzzz":
|
|
default:
|
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
}
|
|
},
|
|
t: function t2(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timestamp = Math.floor(originalDate.getTime() / 1e3);
|
|
return (0, _index6.default)(timestamp, token.length);
|
|
},
|
|
T: function T(date, token, _localize, options) {
|
|
var originalDate = options._originalDate || date;
|
|
var timestamp = originalDate.getTime();
|
|
return (0, _index6.default)(timestamp, token.length);
|
|
}
|
|
};
|
|
function formatTimezoneShort(offset, dirtyDelimiter) {
|
|
var sign = offset > 0 ? "-" : "+";
|
|
var absOffset = Math.abs(offset);
|
|
var hours = Math.floor(absOffset / 60);
|
|
var minutes = absOffset % 60;
|
|
if (minutes === 0) {
|
|
return sign + String(hours);
|
|
}
|
|
var delimiter = dirtyDelimiter || "";
|
|
return sign + String(hours) + delimiter + (0, _index6.default)(minutes, 2);
|
|
}
|
|
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
|
if (offset % 60 === 0) {
|
|
var sign = offset > 0 ? "-" : "+";
|
|
return sign + (0, _index6.default)(Math.abs(offset) / 60, 2);
|
|
}
|
|
return formatTimezone(offset, dirtyDelimiter);
|
|
}
|
|
function formatTimezone(offset, dirtyDelimiter) {
|
|
var delimiter = dirtyDelimiter || "";
|
|
var sign = offset > 0 ? "-" : "+";
|
|
var absOffset = Math.abs(offset);
|
|
var hours = (0, _index6.default)(Math.floor(absOffset / 60), 2);
|
|
var minutes = (0, _index6.default)(absOffset % 60, 2);
|
|
return sign + hours + delimiter + minutes;
|
|
}
|
|
var _default = formatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/format/longFormatters/index.js
|
|
var require_longFormatters = __commonJS({
|
|
"node_modules/date-fns/_lib/format/longFormatters/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var dateLongFormatter = function dateLongFormatter2(pattern, formatLong) {
|
|
switch (pattern) {
|
|
case "P":
|
|
return formatLong.date({
|
|
width: "short"
|
|
});
|
|
case "PP":
|
|
return formatLong.date({
|
|
width: "medium"
|
|
});
|
|
case "PPP":
|
|
return formatLong.date({
|
|
width: "long"
|
|
});
|
|
case "PPPP":
|
|
default:
|
|
return formatLong.date({
|
|
width: "full"
|
|
});
|
|
}
|
|
};
|
|
var timeLongFormatter = function timeLongFormatter2(pattern, formatLong) {
|
|
switch (pattern) {
|
|
case "p":
|
|
return formatLong.time({
|
|
width: "short"
|
|
});
|
|
case "pp":
|
|
return formatLong.time({
|
|
width: "medium"
|
|
});
|
|
case "ppp":
|
|
return formatLong.time({
|
|
width: "long"
|
|
});
|
|
case "pppp":
|
|
default:
|
|
return formatLong.time({
|
|
width: "full"
|
|
});
|
|
}
|
|
};
|
|
var dateTimeLongFormatter = function dateTimeLongFormatter2(pattern, formatLong) {
|
|
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
var datePattern = matchResult[1];
|
|
var timePattern = matchResult[2];
|
|
if (!timePattern) {
|
|
return dateLongFormatter(pattern, formatLong);
|
|
}
|
|
var dateTimeFormat;
|
|
switch (datePattern) {
|
|
case "P":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "short"
|
|
});
|
|
break;
|
|
case "PP":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "medium"
|
|
});
|
|
break;
|
|
case "PPP":
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "long"
|
|
});
|
|
break;
|
|
case "PPPP":
|
|
default:
|
|
dateTimeFormat = formatLong.dateTime({
|
|
width: "full"
|
|
});
|
|
break;
|
|
}
|
|
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
|
|
};
|
|
var longFormatters = {
|
|
p: timeLongFormatter,
|
|
P: dateTimeLongFormatter
|
|
};
|
|
var _default = longFormatters;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js
|
|
var require_getTimezoneOffsetInMilliseconds = __commonJS({
|
|
"node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getTimezoneOffsetInMilliseconds;
|
|
function getTimezoneOffsetInMilliseconds(date) {
|
|
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
utcDate.setUTCFullYear(date.getFullYear());
|
|
return date.getTime() - utcDate.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/protectedTokens/index.js
|
|
var require_protectedTokens = __commonJS({
|
|
"node_modules/date-fns/_lib/protectedTokens/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
|
|
exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
|
|
exports.throwProtectedError = throwProtectedError;
|
|
var protectedDayOfYearTokens = ["D", "DD"];
|
|
var protectedWeekYearTokens = ["YY", "YYYY"];
|
|
function isProtectedDayOfYearToken(token) {
|
|
return protectedDayOfYearTokens.indexOf(token) !== -1;
|
|
}
|
|
function isProtectedWeekYearToken(token) {
|
|
return protectedWeekYearTokens.indexOf(token) !== -1;
|
|
}
|
|
function throwProtectedError(token, format, input) {
|
|
if (token === "YYYY") {
|
|
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
} else if (token === "YY") {
|
|
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
} else if (token === "D") {
|
|
throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
} else if (token === "DD") {
|
|
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js
|
|
var require_formatDistance = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var formatDistanceLocale = {
|
|
lessThanXSeconds: {
|
|
one: "less than a second",
|
|
other: "less than {{count}} seconds"
|
|
},
|
|
xSeconds: {
|
|
one: "1 second",
|
|
other: "{{count}} seconds"
|
|
},
|
|
halfAMinute: "half a minute",
|
|
lessThanXMinutes: {
|
|
one: "less than a minute",
|
|
other: "less than {{count}} minutes"
|
|
},
|
|
xMinutes: {
|
|
one: "1 minute",
|
|
other: "{{count}} minutes"
|
|
},
|
|
aboutXHours: {
|
|
one: "about 1 hour",
|
|
other: "about {{count}} hours"
|
|
},
|
|
xHours: {
|
|
one: "1 hour",
|
|
other: "{{count}} hours"
|
|
},
|
|
xDays: {
|
|
one: "1 day",
|
|
other: "{{count}} days"
|
|
},
|
|
aboutXWeeks: {
|
|
one: "about 1 week",
|
|
other: "about {{count}} weeks"
|
|
},
|
|
xWeeks: {
|
|
one: "1 week",
|
|
other: "{{count}} weeks"
|
|
},
|
|
aboutXMonths: {
|
|
one: "about 1 month",
|
|
other: "about {{count}} months"
|
|
},
|
|
xMonths: {
|
|
one: "1 month",
|
|
other: "{{count}} months"
|
|
},
|
|
aboutXYears: {
|
|
one: "about 1 year",
|
|
other: "about {{count}} years"
|
|
},
|
|
xYears: {
|
|
one: "1 year",
|
|
other: "{{count}} years"
|
|
},
|
|
overXYears: {
|
|
one: "over 1 year",
|
|
other: "over {{count}} years"
|
|
},
|
|
almostXYears: {
|
|
one: "almost 1 year",
|
|
other: "almost {{count}} years"
|
|
}
|
|
};
|
|
var formatDistance = function formatDistance2(token, count, options) {
|
|
var result;
|
|
var tokenValue = formatDistanceLocale[token];
|
|
if (typeof tokenValue === "string") {
|
|
result = tokenValue;
|
|
} else if (count === 1) {
|
|
result = tokenValue.one;
|
|
} else {
|
|
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
}
|
|
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
if (options.comparison && options.comparison > 0) {
|
|
return "in " + result;
|
|
} else {
|
|
return result + " ago";
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
var _default = formatDistance;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js
|
|
var require_buildFormatLongFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildFormatLongFn;
|
|
function buildFormatLongFn(args) {
|
|
return function() {
|
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
var width2 = options.width ? String(options.width) : args.defaultWidth;
|
|
var format = args.formats[width2] || args.formats[args.defaultWidth];
|
|
return format;
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatLong/index.js
|
|
var require_formatLong = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatLong/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildFormatLongFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var dateFormats = {
|
|
full: "EEEE, MMMM do, y",
|
|
long: "MMMM do, y",
|
|
medium: "MMM d, y",
|
|
short: "MM/dd/yyyy"
|
|
};
|
|
var timeFormats = {
|
|
full: "h:mm:ss a zzzz",
|
|
long: "h:mm:ss a z",
|
|
medium: "h:mm:ss a",
|
|
short: "h:mm a"
|
|
};
|
|
var dateTimeFormats = {
|
|
full: "{{date}} 'at' {{time}}",
|
|
long: "{{date}} 'at' {{time}}",
|
|
medium: "{{date}}, {{time}}",
|
|
short: "{{date}}, {{time}}"
|
|
};
|
|
var formatLong = {
|
|
date: (0, _index.default)({
|
|
formats: dateFormats,
|
|
defaultWidth: "full"
|
|
}),
|
|
time: (0, _index.default)({
|
|
formats: timeFormats,
|
|
defaultWidth: "full"
|
|
}),
|
|
dateTime: (0, _index.default)({
|
|
formats: dateTimeFormats,
|
|
defaultWidth: "full"
|
|
})
|
|
};
|
|
var _default = formatLong;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js
|
|
var require_formatRelative = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var formatRelativeLocale = {
|
|
lastWeek: "'last' eeee 'at' p",
|
|
yesterday: "'yesterday at' p",
|
|
today: "'today at' p",
|
|
tomorrow: "'tomorrow at' p",
|
|
nextWeek: "eeee 'at' p",
|
|
other: "P"
|
|
};
|
|
var formatRelative = function formatRelative2(token, _date, _baseDate, _options) {
|
|
return formatRelativeLocale[token];
|
|
};
|
|
var _default = formatRelative;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js
|
|
var require_buildLocalizeFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildLocalizeFn;
|
|
function buildLocalizeFn(args) {
|
|
return function(dirtyIndex, options) {
|
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
|
|
var valuesArray;
|
|
if (context === "formatting" && args.formattingValues) {
|
|
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
var width2 = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
|
|
valuesArray = args.formattingValues[width2] || args.formattingValues[defaultWidth];
|
|
} else {
|
|
var _defaultWidth = args.defaultWidth;
|
|
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
|
|
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
}
|
|
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
|
return valuesArray[index];
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/localize/index.js
|
|
var require_localize = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/localize/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildLocalizeFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var eraValues = {
|
|
narrow: ["B", "A"],
|
|
abbreviated: ["BC", "AD"],
|
|
wide: ["Before Christ", "Anno Domini"]
|
|
};
|
|
var quarterValues = {
|
|
narrow: ["1", "2", "3", "4"],
|
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
};
|
|
var monthValues = {
|
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
|
};
|
|
var dayValues = {
|
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
};
|
|
var dayPeriodValues = {
|
|
narrow: {
|
|
am: "a",
|
|
pm: "p",
|
|
midnight: "mi",
|
|
noon: "n",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
},
|
|
abbreviated: {
|
|
am: "AM",
|
|
pm: "PM",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
},
|
|
wide: {
|
|
am: "a.m.",
|
|
pm: "p.m.",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "morning",
|
|
afternoon: "afternoon",
|
|
evening: "evening",
|
|
night: "night"
|
|
}
|
|
};
|
|
var formattingDayPeriodValues = {
|
|
narrow: {
|
|
am: "a",
|
|
pm: "p",
|
|
midnight: "mi",
|
|
noon: "n",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
},
|
|
abbreviated: {
|
|
am: "AM",
|
|
pm: "PM",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
},
|
|
wide: {
|
|
am: "a.m.",
|
|
pm: "p.m.",
|
|
midnight: "midnight",
|
|
noon: "noon",
|
|
morning: "in the morning",
|
|
afternoon: "in the afternoon",
|
|
evening: "in the evening",
|
|
night: "at night"
|
|
}
|
|
};
|
|
var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) {
|
|
var number = Number(dirtyNumber);
|
|
var rem100 = number % 100;
|
|
if (rem100 > 20 || rem100 < 10) {
|
|
switch (rem100 % 10) {
|
|
case 1:
|
|
return number + "st";
|
|
case 2:
|
|
return number + "nd";
|
|
case 3:
|
|
return number + "rd";
|
|
}
|
|
}
|
|
return number + "th";
|
|
};
|
|
var localize = {
|
|
ordinalNumber,
|
|
era: (0, _index.default)({
|
|
values: eraValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
quarter: (0, _index.default)({
|
|
values: quarterValues,
|
|
defaultWidth: "wide",
|
|
argumentCallback: function argumentCallback(quarter) {
|
|
return quarter - 1;
|
|
}
|
|
}),
|
|
month: (0, _index.default)({
|
|
values: monthValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
day: (0, _index.default)({
|
|
values: dayValues,
|
|
defaultWidth: "wide"
|
|
}),
|
|
dayPeriod: (0, _index.default)({
|
|
values: dayPeriodValues,
|
|
defaultWidth: "wide",
|
|
formattingValues: formattingDayPeriodValues,
|
|
defaultFormattingWidth: "wide"
|
|
})
|
|
};
|
|
var _default = localize;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildMatchFn/index.js
|
|
var require_buildMatchFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildMatchFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildMatchFn;
|
|
function buildMatchFn(args) {
|
|
return function(string) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var width2 = options.width;
|
|
var matchPattern = width2 && args.matchPatterns[width2] || args.matchPatterns[args.defaultMatchWidth];
|
|
var matchResult = string.match(matchPattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
var matchedString = matchResult[0];
|
|
var parsePatterns = width2 && args.parsePatterns[width2] || args.parsePatterns[args.defaultParseWidth];
|
|
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
|
|
return pattern.test(matchedString);
|
|
}) : findKey(parsePatterns, function(pattern) {
|
|
return pattern.test(matchedString);
|
|
});
|
|
var value;
|
|
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
var rest = string.slice(matchedString.length);
|
|
return {
|
|
value,
|
|
rest
|
|
};
|
|
};
|
|
}
|
|
function findKey(object, predicate) {
|
|
for (var key in object) {
|
|
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
return key;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
function findIndex(array, predicate) {
|
|
for (var key = 0; key < array.length; key++) {
|
|
if (predicate(array[key])) {
|
|
return key;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js
|
|
var require_buildMatchPatternFn = __commonJS({
|
|
"node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = buildMatchPatternFn;
|
|
function buildMatchPatternFn(args) {
|
|
return function(string) {
|
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
var matchResult = string.match(args.matchPattern);
|
|
if (!matchResult)
|
|
return null;
|
|
var matchedString = matchResult[0];
|
|
var parseResult = string.match(args.parsePattern);
|
|
if (!parseResult)
|
|
return null;
|
|
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
var rest = string.slice(matchedString.length);
|
|
return {
|
|
value,
|
|
rest
|
|
};
|
|
};
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/_lib/match/index.js
|
|
var require_match = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/_lib/match/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_buildMatchFn());
|
|
var _index2 = _interopRequireDefault(require_buildMatchPatternFn());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
var parseOrdinalNumberPattern = /\d+/i;
|
|
var matchEraPatterns = {
|
|
narrow: /^(b|a)/i,
|
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
};
|
|
var parseEraPatterns = {
|
|
any: [/^b/i, /^(a|c)/i]
|
|
};
|
|
var matchQuarterPatterns = {
|
|
narrow: /^[1234]/i,
|
|
abbreviated: /^q[1234]/i,
|
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
};
|
|
var parseQuarterPatterns = {
|
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
};
|
|
var matchMonthPatterns = {
|
|
narrow: /^[jfmasond]/i,
|
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
};
|
|
var parseMonthPatterns = {
|
|
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
|
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
|
};
|
|
var matchDayPatterns = {
|
|
narrow: /^[smtwf]/i,
|
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
};
|
|
var parseDayPatterns = {
|
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
};
|
|
var matchDayPeriodPatterns = {
|
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
};
|
|
var parseDayPeriodPatterns = {
|
|
any: {
|
|
am: /^a/i,
|
|
pm: /^p/i,
|
|
midnight: /^mi/i,
|
|
noon: /^no/i,
|
|
morning: /morning/i,
|
|
afternoon: /afternoon/i,
|
|
evening: /evening/i,
|
|
night: /night/i
|
|
}
|
|
};
|
|
var match = {
|
|
ordinalNumber: (0, _index2.default)({
|
|
matchPattern: matchOrdinalNumberPattern,
|
|
parsePattern: parseOrdinalNumberPattern,
|
|
valueCallback: function valueCallback(value) {
|
|
return parseInt(value, 10);
|
|
}
|
|
}),
|
|
era: (0, _index.default)({
|
|
matchPatterns: matchEraPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseEraPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
quarter: (0, _index.default)({
|
|
matchPatterns: matchQuarterPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseQuarterPatterns,
|
|
defaultParseWidth: "any",
|
|
valueCallback: function valueCallback(index) {
|
|
return index + 1;
|
|
}
|
|
}),
|
|
month: (0, _index.default)({
|
|
matchPatterns: matchMonthPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseMonthPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
day: (0, _index.default)({
|
|
matchPatterns: matchDayPatterns,
|
|
defaultMatchWidth: "wide",
|
|
parsePatterns: parseDayPatterns,
|
|
defaultParseWidth: "any"
|
|
}),
|
|
dayPeriod: (0, _index.default)({
|
|
matchPatterns: matchDayPeriodPatterns,
|
|
defaultMatchWidth: "any",
|
|
parsePatterns: parseDayPeriodPatterns,
|
|
defaultParseWidth: "any"
|
|
})
|
|
};
|
|
var _default = match;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/locale/en-US/index.js
|
|
var require_en_US = __commonJS({
|
|
"node_modules/date-fns/locale/en-US/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_formatDistance());
|
|
var _index2 = _interopRequireDefault(require_formatLong());
|
|
var _index3 = _interopRequireDefault(require_formatRelative());
|
|
var _index4 = _interopRequireDefault(require_localize());
|
|
var _index5 = _interopRequireDefault(require_match());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var locale = {
|
|
code: "en-US",
|
|
formatDistance: _index.default,
|
|
formatLong: _index2.default,
|
|
formatRelative: _index3.default,
|
|
localize: _index4.default,
|
|
match: _index5.default,
|
|
options: {
|
|
weekStartsOn: 0,
|
|
firstWeekContainsDate: 1
|
|
}
|
|
};
|
|
var _default = locale;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/defaultLocale/index.js
|
|
var require_defaultLocale = __commonJS({
|
|
"node_modules/date-fns/_lib/defaultLocale/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
var _index = _interopRequireDefault(require_en_US());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var _default = _index.default;
|
|
exports.default = _default;
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/format/index.js
|
|
var require_format2 = __commonJS({
|
|
"node_modules/date-fns/format/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = format;
|
|
var _index = _interopRequireDefault(require_isValid());
|
|
var _index2 = _interopRequireDefault(require_subMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_toDate());
|
|
var _index4 = _interopRequireDefault(require_formatters());
|
|
var _index5 = _interopRequireDefault(require_longFormatters());
|
|
var _index6 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index7 = require_protectedTokens();
|
|
var _index8 = _interopRequireDefault(require_toInteger());
|
|
var _index9 = _interopRequireDefault(require_requiredArgs());
|
|
var _index10 = require_defaultOptions();
|
|
var _index11 = _interopRequireDefault(require_defaultLocale());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
var doubleQuoteRegExp = /''/g;
|
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
function format(dirtyDate, dirtyFormatStr, options) {
|
|
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
|
(0, _index9.default)(2, arguments);
|
|
var formatStr = String(dirtyFormatStr);
|
|
var defaultOptions = (0, _index10.getDefaultOptions)();
|
|
var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : _index11.default;
|
|
var firstWeekContainsDate = (0, _index8.default)((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var weekStartsOn = (0, _index8.default)((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
if (!locale.localize) {
|
|
throw new RangeError("locale must contain localize property");
|
|
}
|
|
if (!locale.formatLong) {
|
|
throw new RangeError("locale must contain formatLong property");
|
|
}
|
|
var originalDate = (0, _index3.default)(dirtyDate);
|
|
if (!(0, _index.default)(originalDate)) {
|
|
throw new RangeError("Invalid time value");
|
|
}
|
|
var timezoneOffset = (0, _index6.default)(originalDate);
|
|
var utcDate = (0, _index2.default)(originalDate, timezoneOffset);
|
|
var formatterOptions = {
|
|
firstWeekContainsDate,
|
|
weekStartsOn,
|
|
locale,
|
|
_originalDate: originalDate
|
|
};
|
|
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
|
|
var firstCharacter = substring[0];
|
|
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
var longFormatter = _index5.default[firstCharacter];
|
|
return longFormatter(substring, locale.formatLong);
|
|
}
|
|
return substring;
|
|
}).join("").match(formattingTokensRegExp).map(function(substring) {
|
|
if (substring === "''") {
|
|
return "'";
|
|
}
|
|
var firstCharacter = substring[0];
|
|
if (firstCharacter === "'") {
|
|
return cleanEscapedString(substring);
|
|
}
|
|
var formatter = _index4.default[firstCharacter];
|
|
if (formatter) {
|
|
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(substring)) {
|
|
(0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));
|
|
}
|
|
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(substring)) {
|
|
(0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));
|
|
}
|
|
return formatter(utcDate, substring, locale.localize, formatterOptions);
|
|
}
|
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
|
}
|
|
return substring;
|
|
}).join("");
|
|
return result;
|
|
}
|
|
function cleanEscapedString(input) {
|
|
var matched = input.match(escapedStringRegExp);
|
|
if (!matched) {
|
|
return input;
|
|
}
|
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMinutes/index.js
|
|
var require_addMinutes = __commonJS({
|
|
"node_modules/date-fns/addMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMinutes;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_MINUTE = 6e4;
|
|
function addMinutes(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_MINUTE);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addHours/index.js
|
|
var require_addHours = __commonJS({
|
|
"node_modules/date-fns/addHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addHours;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_HOUR = 36e5;
|
|
function addHours(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * MILLISECONDS_IN_HOUR);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addDays/index.js
|
|
var require_addDays = __commonJS({
|
|
"node_modules/date-fns/addDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addDays;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addDays(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
if (isNaN(amount)) {
|
|
return new Date(NaN);
|
|
}
|
|
if (!amount) {
|
|
return date;
|
|
}
|
|
date.setDate(date.getDate() + amount);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addWeeks/index.js
|
|
var require_addWeeks = __commonJS({
|
|
"node_modules/date-fns/addWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addWeeks;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addDays());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addWeeks(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
var days = amount * 7;
|
|
return (0, _index2.default)(dirtyDate, days);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addMonths/index.js
|
|
var require_addMonths = __commonJS({
|
|
"node_modules/date-fns/addMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addMonths;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addMonths(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
if (isNaN(amount)) {
|
|
return new Date(NaN);
|
|
}
|
|
if (!amount) {
|
|
return date;
|
|
}
|
|
var dayOfMonth = date.getDate();
|
|
var endOfDesiredMonth = new Date(date.getTime());
|
|
endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
|
|
var daysInMonth = endOfDesiredMonth.getDate();
|
|
if (dayOfMonth >= daysInMonth) {
|
|
return endOfDesiredMonth;
|
|
} else {
|
|
date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
|
|
return date;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/addYears/index.js
|
|
var require_addYears = __commonJS({
|
|
"node_modules/date-fns/addYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = addYears;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMonths());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function addYears(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, amount * 12);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMinutes/index.js
|
|
var require_subMinutes = __commonJS({
|
|
"node_modules/date-fns/subMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMinutes;
|
|
var _index = _interopRequireDefault(require_addMinutes());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMinutes(dirtyDate, dirtyAmount) {
|
|
(0, _index2.default)(2, arguments);
|
|
var amount = (0, _index3.default)(dirtyAmount);
|
|
return (0, _index.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subHours/index.js
|
|
var require_subHours = __commonJS({
|
|
"node_modules/date-fns/subHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subHours;
|
|
var _index = _interopRequireDefault(require_addHours());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subHours(dirtyDate, dirtyAmount) {
|
|
(0, _index2.default)(2, arguments);
|
|
var amount = (0, _index3.default)(dirtyAmount);
|
|
return (0, _index.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subDays/index.js
|
|
var require_subDays = __commonJS({
|
|
"node_modules/date-fns/subDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subDays;
|
|
var _index = _interopRequireDefault(require_addDays());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subDays(dirtyDate, dirtyAmount) {
|
|
(0, _index2.default)(2, arguments);
|
|
var amount = (0, _index3.default)(dirtyAmount);
|
|
return (0, _index.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subWeeks/index.js
|
|
var require_subWeeks = __commonJS({
|
|
"node_modules/date-fns/subWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subWeeks;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addWeeks());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subWeeks(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subMonths/index.js
|
|
var require_subMonths = __commonJS({
|
|
"node_modules/date-fns/subMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subMonths;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addMonths());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subMonths(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/subYears/index.js
|
|
var require_subYears = __commonJS({
|
|
"node_modules/date-fns/subYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = subYears;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_addYears());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function subYears(dirtyDate, dirtyAmount) {
|
|
(0, _index3.default)(2, arguments);
|
|
var amount = (0, _index.default)(dirtyAmount);
|
|
return (0, _index2.default)(dirtyDate, -amount);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getSeconds/index.js
|
|
var require_getSeconds = __commonJS({
|
|
"node_modules/date-fns/getSeconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getSeconds;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getSeconds(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var seconds = date.getSeconds();
|
|
return seconds;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getMinutes/index.js
|
|
var require_getMinutes = __commonJS({
|
|
"node_modules/date-fns/getMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getMinutes;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getMinutes(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var minutes = date.getMinutes();
|
|
return minutes;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getHours/index.js
|
|
var require_getHours = __commonJS({
|
|
"node_modules/date-fns/getHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getHours;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getHours(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var hours = date.getHours();
|
|
return hours;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDay/index.js
|
|
var require_getDay = __commonJS({
|
|
"node_modules/date-fns/getDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
return day;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDate/index.js
|
|
var require_getDate = __commonJS({
|
|
"node_modules/date-fns/getDate/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDate;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDate(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dayOfMonth = date.getDate();
|
|
return dayOfMonth;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfWeek/index.js
|
|
var require_startOfWeek = __commonJS({
|
|
"node_modules/date-fns/startOfWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_toInteger());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
var _index4 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfWeek(dirtyDate, options) {
|
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index3.default)(1, arguments);
|
|
var defaultOptions = (0, _index4.getDefaultOptions)();
|
|
var weekStartsOn = (0, _index2.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
date.setDate(date.getDate() - diff);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfISOWeek/index.js
|
|
var require_startOfISOWeek = __commonJS({
|
|
"node_modules/date-fns/startOfISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfISOWeek;
|
|
var _index = _interopRequireDefault(require_startOfWeek());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfISOWeek(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
return (0, _index.default)(dirtyDate, {
|
|
weekStartsOn: 1
|
|
});
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getISOWeekYear/index.js
|
|
var require_getISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/getISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getISOWeekYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getFullYear();
|
|
var fourthOfJanuaryOfNextYear = new Date(0);
|
|
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
var startOfNextYear = (0, _index2.default)(fourthOfJanuaryOfNextYear);
|
|
var fourthOfJanuaryOfThisYear = new Date(0);
|
|
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
var startOfThisYear = (0, _index2.default)(fourthOfJanuaryOfThisYear);
|
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
|
return year + 1;
|
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
|
return year;
|
|
} else {
|
|
return year - 1;
|
|
}
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfISOWeekYear/index.js
|
|
var require_startOfISOWeekYear = __commonJS({
|
|
"node_modules/date-fns/startOfISOWeekYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfISOWeekYear;
|
|
var _index = _interopRequireDefault(require_getISOWeekYear());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfISOWeekYear(dirtyDate) {
|
|
(0, _index3.default)(1, arguments);
|
|
var year = (0, _index.default)(dirtyDate);
|
|
var fourthOfJanuary = new Date(0);
|
|
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
var date = (0, _index2.default)(fourthOfJanuary);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getISOWeek/index.js
|
|
var require_getISOWeek = __commonJS({
|
|
"node_modules/date-fns/getISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getISOWeek;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_startOfISOWeek());
|
|
var _index3 = _interopRequireDefault(require_startOfISOWeekYear());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function getISOWeek(dirtyDate) {
|
|
(0, _index4.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime();
|
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getMonth/index.js
|
|
var require_getMonth = __commonJS({
|
|
"node_modules/date-fns/getMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var month = date.getMonth();
|
|
return month;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getQuarter/index.js
|
|
var require_getQuarter = __commonJS({
|
|
"node_modules/date-fns/getQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getQuarter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getQuarter(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var quarter = Math.floor(date.getMonth() / 3) + 1;
|
|
return quarter;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getYear/index.js
|
|
var require_getYear = __commonJS({
|
|
"node_modules/date-fns/getYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
return (0, _index.default)(dirtyDate).getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getTime/index.js
|
|
var require_getTime = __commonJS({
|
|
"node_modules/date-fns/getTime/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getTime;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getTime(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var timestamp = date.getTime();
|
|
return timestamp;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setSeconds/index.js
|
|
var require_setSeconds = __commonJS({
|
|
"node_modules/date-fns/setSeconds/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setSeconds;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setSeconds(dirtyDate, dirtySeconds) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var seconds = (0, _index.default)(dirtySeconds);
|
|
date.setSeconds(seconds);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setMinutes/index.js
|
|
var require_setMinutes = __commonJS({
|
|
"node_modules/date-fns/setMinutes/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setMinutes;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setMinutes(dirtyDate, dirtyMinutes) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var minutes = (0, _index.default)(dirtyMinutes);
|
|
date.setMinutes(minutes);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setHours/index.js
|
|
var require_setHours = __commonJS({
|
|
"node_modules/date-fns/setHours/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setHours;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setHours(dirtyDate, dirtyHours) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var hours = (0, _index.default)(dirtyHours);
|
|
date.setHours(hours);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/getDaysInMonth/index.js
|
|
var require_getDaysInMonth = __commonJS({
|
|
"node_modules/date-fns/getDaysInMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = getDaysInMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function getDaysInMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var year = date.getFullYear();
|
|
var monthIndex = date.getMonth();
|
|
var lastDayOfMonth = new Date(0);
|
|
lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
|
|
lastDayOfMonth.setHours(0, 0, 0, 0);
|
|
return lastDayOfMonth.getDate();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setMonth/index.js
|
|
var require_setMonth = __commonJS({
|
|
"node_modules/date-fns/setMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setMonth;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getDaysInMonth());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setMonth(dirtyDate, dirtyMonth) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var month = (0, _index.default)(dirtyMonth);
|
|
var year = date.getFullYear();
|
|
var day = date.getDate();
|
|
var dateWithDesiredMonth = new Date(0);
|
|
dateWithDesiredMonth.setFullYear(year, month, 15);
|
|
dateWithDesiredMonth.setHours(0, 0, 0, 0);
|
|
var daysInMonth = (0, _index3.default)(dateWithDesiredMonth);
|
|
date.setMonth(month, Math.min(day, daysInMonth));
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setQuarter/index.js
|
|
var require_setQuarter = __commonJS({
|
|
"node_modules/date-fns/setQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setQuarter;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_setMonth());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setQuarter(dirtyDate, dirtyQuarter) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var quarter = (0, _index.default)(dirtyQuarter);
|
|
var oldQuarter = Math.floor(date.getMonth() / 3) + 1;
|
|
var diff = quarter - oldQuarter;
|
|
return (0, _index3.default)(date, date.getMonth() + diff * 3);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/setYear/index.js
|
|
var require_setYear = __commonJS({
|
|
"node_modules/date-fns/setYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setYear;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setYear(dirtyDate, dirtyYear) {
|
|
(0, _index3.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var year = (0, _index.default)(dirtyYear);
|
|
if (isNaN(date.getTime())) {
|
|
return new Date(NaN);
|
|
}
|
|
date.setFullYear(year);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/min/index.js
|
|
var require_min = __commonJS({
|
|
"node_modules/date-fns/min/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = min;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
function min(dirtyDatesArray) {
|
|
(0, _index2.default)(1, arguments);
|
|
var datesArray;
|
|
if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") {
|
|
datesArray = dirtyDatesArray;
|
|
} else if (_typeof(dirtyDatesArray) === "object" && dirtyDatesArray !== null) {
|
|
datesArray = Array.prototype.slice.call(dirtyDatesArray);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
var result;
|
|
datesArray.forEach(function(dirtyDate) {
|
|
var currentDate = (0, _index.default)(dirtyDate);
|
|
if (result === void 0 || result > currentDate || isNaN(currentDate.getDate())) {
|
|
result = currentDate;
|
|
}
|
|
});
|
|
return result || new Date(NaN);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/max/index.js
|
|
var require_max = __commonJS({
|
|
"node_modules/date-fns/max/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = max;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
function max(dirtyDatesArray) {
|
|
(0, _index2.default)(1, arguments);
|
|
var datesArray;
|
|
if (dirtyDatesArray && typeof dirtyDatesArray.forEach === "function") {
|
|
datesArray = dirtyDatesArray;
|
|
} else if (_typeof(dirtyDatesArray) === "object" && dirtyDatesArray !== null) {
|
|
datesArray = Array.prototype.slice.call(dirtyDatesArray);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
var result;
|
|
datesArray.forEach(function(dirtyDate) {
|
|
var currentDate = (0, _index.default)(dirtyDate);
|
|
if (result === void 0 || result < currentDate || isNaN(Number(currentDate))) {
|
|
result = currentDate;
|
|
}
|
|
});
|
|
return result || new Date(NaN);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfDay/index.js
|
|
var require_startOfDay = __commonJS({
|
|
"node_modules/date-fns/startOfDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarDays/index.js
|
|
var require_differenceInCalendarDays = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarDays/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarDays;
|
|
var _index = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index2 = _interopRequireDefault(require_startOfDay());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_DAY = 864e5;
|
|
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index3.default)(2, arguments);
|
|
var startOfDayLeft = (0, _index2.default)(dirtyDateLeft);
|
|
var startOfDayRight = (0, _index2.default)(dirtyDateRight);
|
|
var timestampLeft = startOfDayLeft.getTime() - (0, _index.default)(startOfDayLeft);
|
|
var timestampRight = startOfDayRight.getTime() - (0, _index.default)(startOfDayRight);
|
|
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarMonths/index.js
|
|
var require_differenceInCalendarMonths = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarMonths/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarMonths;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
|
|
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
|
|
return yearDiff * 12 + monthDiff;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarWeeks/index.js
|
|
var require_differenceInCalendarWeeks = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarWeeks/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarWeeks;
|
|
var _index = _interopRequireDefault(require_startOfWeek());
|
|
var _index2 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, options) {
|
|
(0, _index3.default)(2, arguments);
|
|
var startOfWeekLeft = (0, _index.default)(dirtyDateLeft, options);
|
|
var startOfWeekRight = (0, _index.default)(dirtyDateRight, options);
|
|
var timestampLeft = startOfWeekLeft.getTime() - (0, _index2.default)(startOfWeekLeft);
|
|
var timestampRight = startOfWeekRight.getTime() - (0, _index2.default)(startOfWeekRight);
|
|
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/differenceInCalendarYears/index.js
|
|
var require_differenceInCalendarYears = __commonJS({
|
|
"node_modules/date-fns/differenceInCalendarYears/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = differenceInCalendarYears;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() - dateRight.getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfMonth/index.js
|
|
var require_startOfMonth = __commonJS({
|
|
"node_modules/date-fns/startOfMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setDate(1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfQuarter/index.js
|
|
var require_startOfQuarter = __commonJS({
|
|
"node_modules/date-fns/startOfQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfQuarter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfQuarter(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var currentMonth = date.getMonth();
|
|
var month = currentMonth - currentMonth % 3;
|
|
date.setMonth(month, 1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/startOfYear/index.js
|
|
var require_startOfYear = __commonJS({
|
|
"node_modules/date-fns/startOfYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = startOfYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function startOfYear(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var cleanDate = (0, _index.default)(dirtyDate);
|
|
var date = new Date(0);
|
|
date.setFullYear(cleanDate.getFullYear(), 0, 1);
|
|
date.setHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfDay/index.js
|
|
var require_endOfDay = __commonJS({
|
|
"node_modules/date-fns/endOfDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfDay(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfWeek/index.js
|
|
var require_endOfWeek = __commonJS({
|
|
"node_modules/date-fns/endOfWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfWeek;
|
|
var _index = require_defaultOptions();
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfWeek(dirtyDate, options) {
|
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index4.default)(1, arguments);
|
|
var defaultOptions = (0, _index.getDefaultOptions)();
|
|
var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var day = date.getDay();
|
|
var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
|
|
date.setDate(date.getDate() + diff);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/endOfMonth/index.js
|
|
var require_endOfMonth = __commonJS({
|
|
"node_modules/date-fns/endOfMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = endOfMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function endOfMonth(dirtyDate) {
|
|
(0, _index2.default)(1, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var month = date.getMonth();
|
|
date.setFullYear(date.getFullYear(), month + 1, 0);
|
|
date.setHours(23, 59, 59, 999);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isEqual/index.js
|
|
var require_isEqual = __commonJS({
|
|
"node_modules/date-fns/isEqual/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isEqual;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isEqual(dirtyLeftDate, dirtyRightDate) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyLeftDate);
|
|
var dateRight = (0, _index.default)(dirtyRightDate);
|
|
return dateLeft.getTime() === dateRight.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameDay/index.js
|
|
var require_isSameDay = __commonJS({
|
|
"node_modules/date-fns/isSameDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameDay;
|
|
var _index = _interopRequireDefault(require_startOfDay());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeftStartOfDay = (0, _index.default)(dirtyDateLeft);
|
|
var dateRightStartOfDay = (0, _index.default)(dirtyDateRight);
|
|
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameMonth/index.js
|
|
var require_isSameMonth = __commonJS({
|
|
"node_modules/date-fns/isSameMonth/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameMonth;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameMonth(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameYear/index.js
|
|
var require_isSameYear = __commonJS({
|
|
"node_modules/date-fns/isSameYear/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameYear;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameYear(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeft = (0, _index.default)(dirtyDateLeft);
|
|
var dateRight = (0, _index.default)(dirtyDateRight);
|
|
return dateLeft.getFullYear() === dateRight.getFullYear();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isSameQuarter/index.js
|
|
var require_isSameQuarter = __commonJS({
|
|
"node_modules/date-fns/isSameQuarter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isSameQuarter;
|
|
var _index = _interopRequireDefault(require_startOfQuarter());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isSameQuarter(dirtyDateLeft, dirtyDateRight) {
|
|
(0, _index2.default)(2, arguments);
|
|
var dateLeftStartOfQuarter = (0, _index.default)(dirtyDateLeft);
|
|
var dateRightStartOfQuarter = (0, _index.default)(dirtyDateRight);
|
|
return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isAfter/index.js
|
|
var require_isAfter = __commonJS({
|
|
"node_modules/date-fns/isAfter/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isAfter;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
(0, _index2.default)(2, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dateToCompare = (0, _index.default)(dirtyDateToCompare);
|
|
return date.getTime() > dateToCompare.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isBefore/index.js
|
|
var require_isBefore = __commonJS({
|
|
"node_modules/date-fns/isBefore/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isBefore;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
(0, _index2.default)(2, arguments);
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var dateToCompare = (0, _index.default)(dirtyDateToCompare);
|
|
return date.getTime() < dateToCompare.getTime();
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/isWithinInterval/index.js
|
|
var require_isWithinInterval = __commonJS({
|
|
"node_modules/date-fns/isWithinInterval/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = isWithinInterval;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function isWithinInterval(dirtyDate, interval) {
|
|
(0, _index2.default)(2, arguments);
|
|
var time = (0, _index.default)(dirtyDate).getTime();
|
|
var startTime = (0, _index.default)(interval.start).getTime();
|
|
var endTime = (0, _index.default)(interval.end).getTime();
|
|
if (!(startTime <= endTime)) {
|
|
throw new RangeError("Invalid interval");
|
|
}
|
|
return time >= startTime && time <= endTime;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/assign/index.js
|
|
var require_assign = __commonJS({
|
|
"node_modules/date-fns/_lib/assign/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = assign;
|
|
function assign(target, object) {
|
|
if (target == null) {
|
|
throw new TypeError("assign requires that input parameter not be null or undefined");
|
|
}
|
|
for (var property in object) {
|
|
if (Object.prototype.hasOwnProperty.call(object, property)) {
|
|
;
|
|
target[property] = object[property];
|
|
}
|
|
}
|
|
return target;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/Setter.js
|
|
var require_Setter = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/Setter.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ValueSetter = exports.Setter = exports.DateToSystemTimezoneSetter = void 0;
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var TIMEZONE_UNIT_PRIORITY = 10;
|
|
var Setter = /* @__PURE__ */ function() {
|
|
function Setter2() {
|
|
_classCallCheck(this, Setter2);
|
|
_defineProperty2(this, "subPriority", 0);
|
|
}
|
|
_createClass(Setter2, [{
|
|
key: "validate",
|
|
value: function validate(_utcDate, _options) {
|
|
return true;
|
|
}
|
|
}]);
|
|
return Setter2;
|
|
}();
|
|
exports.Setter = Setter;
|
|
var ValueSetter = /* @__PURE__ */ function(_Setter) {
|
|
_inherits(ValueSetter2, _Setter);
|
|
var _super = _createSuper(ValueSetter2);
|
|
function ValueSetter2(value, validateValue, setValue, priority, subPriority) {
|
|
var _this;
|
|
_classCallCheck(this, ValueSetter2);
|
|
_this = _super.call(this);
|
|
_this.value = value;
|
|
_this.validateValue = validateValue;
|
|
_this.setValue = setValue;
|
|
_this.priority = priority;
|
|
if (subPriority) {
|
|
_this.subPriority = subPriority;
|
|
}
|
|
return _this;
|
|
}
|
|
_createClass(ValueSetter2, [{
|
|
key: "validate",
|
|
value: function validate(utcDate, options) {
|
|
return this.validateValue(utcDate, this.value, options);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(utcDate, flags, options) {
|
|
return this.setValue(utcDate, flags, this.value, options);
|
|
}
|
|
}]);
|
|
return ValueSetter2;
|
|
}(Setter);
|
|
exports.ValueSetter = ValueSetter;
|
|
var DateToSystemTimezoneSetter = /* @__PURE__ */ function(_Setter2) {
|
|
_inherits(DateToSystemTimezoneSetter2, _Setter2);
|
|
var _super2 = _createSuper(DateToSystemTimezoneSetter2);
|
|
function DateToSystemTimezoneSetter2() {
|
|
var _this2;
|
|
_classCallCheck(this, DateToSystemTimezoneSetter2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this2), "priority", TIMEZONE_UNIT_PRIORITY);
|
|
_defineProperty2(_assertThisInitialized(_this2), "subPriority", -1);
|
|
return _this2;
|
|
}
|
|
_createClass(DateToSystemTimezoneSetter2, [{
|
|
key: "set",
|
|
value: function set(date, flags) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
var convertedDate = new Date(0);
|
|
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
|
return convertedDate;
|
|
}
|
|
}]);
|
|
return DateToSystemTimezoneSetter2;
|
|
}(Setter);
|
|
exports.DateToSystemTimezoneSetter = DateToSystemTimezoneSetter;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/Parser.js
|
|
var require_Parser2 = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/Parser.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Parser = void 0;
|
|
var _Setter = require_Setter();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
var Parser = /* @__PURE__ */ function() {
|
|
function Parser2() {
|
|
_classCallCheck(this, Parser2);
|
|
}
|
|
_createClass(Parser2, [{
|
|
key: "run",
|
|
value: function run(dateString, token, match, options) {
|
|
var result = this.parse(dateString, token, match, options);
|
|
if (!result) {
|
|
return null;
|
|
}
|
|
return {
|
|
setter: new _Setter.ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
|
|
rest: result.rest
|
|
};
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_utcDate, _value, _options) {
|
|
return true;
|
|
}
|
|
}]);
|
|
return Parser2;
|
|
}();
|
|
exports.Parser = Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/EraParser.js
|
|
var require_EraParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/EraParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.EraParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var EraParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(EraParser2, _Parser);
|
|
var _super = _createSuper(EraParser2);
|
|
function EraParser2() {
|
|
var _this;
|
|
_classCallCheck(this, EraParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 140);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(EraParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "G":
|
|
case "GG":
|
|
case "GGG":
|
|
return match.era(dateString, {
|
|
width: "abbreviated"
|
|
}) || match.era(dateString, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGGG":
|
|
return match.era(dateString, {
|
|
width: "narrow"
|
|
});
|
|
case "GGGG":
|
|
default:
|
|
return match.era(dateString, {
|
|
width: "wide"
|
|
}) || match.era(dateString, {
|
|
width: "abbreviated"
|
|
}) || match.era(dateString, {
|
|
width: "narrow"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, flags, value) {
|
|
flags.era = value;
|
|
date.setUTCFullYear(value, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return EraParser2;
|
|
}(_Parser2.Parser);
|
|
exports.EraParser = EraParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/constants/index.js
|
|
var require_constants = __commonJS({
|
|
"node_modules/date-fns/constants/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.secondsInYear = exports.secondsInWeek = exports.secondsInQuarter = exports.secondsInMonth = exports.secondsInMinute = exports.secondsInHour = exports.secondsInDay = exports.quartersInYear = exports.monthsInYear = exports.monthsInQuarter = exports.minutesInHour = exports.minTime = exports.millisecondsInSecond = exports.millisecondsInMinute = exports.millisecondsInHour = exports.maxTime = exports.daysInYear = exports.daysInWeek = void 0;
|
|
var daysInWeek = 7;
|
|
exports.daysInWeek = daysInWeek;
|
|
var daysInYear = 365.2425;
|
|
exports.daysInYear = daysInYear;
|
|
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
exports.maxTime = maxTime;
|
|
var millisecondsInMinute = 6e4;
|
|
exports.millisecondsInMinute = millisecondsInMinute;
|
|
var millisecondsInHour = 36e5;
|
|
exports.millisecondsInHour = millisecondsInHour;
|
|
var millisecondsInSecond = 1e3;
|
|
exports.millisecondsInSecond = millisecondsInSecond;
|
|
var minTime = -maxTime;
|
|
exports.minTime = minTime;
|
|
var minutesInHour = 60;
|
|
exports.minutesInHour = minutesInHour;
|
|
var monthsInQuarter = 3;
|
|
exports.monthsInQuarter = monthsInQuarter;
|
|
var monthsInYear = 12;
|
|
exports.monthsInYear = monthsInYear;
|
|
var quartersInYear = 4;
|
|
exports.quartersInYear = quartersInYear;
|
|
var secondsInHour = 3600;
|
|
exports.secondsInHour = secondsInHour;
|
|
var secondsInMinute = 60;
|
|
exports.secondsInMinute = secondsInMinute;
|
|
var secondsInDay = secondsInHour * 24;
|
|
exports.secondsInDay = secondsInDay;
|
|
var secondsInWeek = secondsInDay * 7;
|
|
exports.secondsInWeek = secondsInWeek;
|
|
var secondsInYear = secondsInDay * daysInYear;
|
|
exports.secondsInYear = secondsInYear;
|
|
var secondsInMonth = secondsInYear / 12;
|
|
exports.secondsInMonth = secondsInMonth;
|
|
var secondsInQuarter = secondsInMonth * 3;
|
|
exports.secondsInQuarter = secondsInQuarter;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/constants.js
|
|
var require_constants2 = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/constants.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.timezonePatterns = exports.numericPatterns = void 0;
|
|
var numericPatterns = {
|
|
month: /^(1[0-2]|0?\d)/,
|
|
date: /^(3[0-1]|[0-2]?\d)/,
|
|
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
week: /^(5[0-3]|[0-4]?\d)/,
|
|
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
hour11h: /^(1[0-1]|0?\d)/,
|
|
hour12h: /^(1[0-2]|0?\d)/,
|
|
minute: /^[0-5]?\d/,
|
|
second: /^[0-5]?\d/,
|
|
singleDigit: /^\d/,
|
|
twoDigits: /^\d{1,2}/,
|
|
threeDigits: /^\d{1,3}/,
|
|
fourDigits: /^\d{1,4}/,
|
|
anyDigitsSigned: /^-?\d+/,
|
|
singleDigitSigned: /^-?\d/,
|
|
twoDigitsSigned: /^-?\d{1,2}/,
|
|
threeDigitsSigned: /^-?\d{1,3}/,
|
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
};
|
|
exports.numericPatterns = numericPatterns;
|
|
var timezonePatterns = {
|
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
};
|
|
exports.timezonePatterns = timezonePatterns;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/utils.js
|
|
var require_utils2 = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/utils.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.dayPeriodEnumToHours = dayPeriodEnumToHours;
|
|
exports.isLeapYearIndex = isLeapYearIndex;
|
|
exports.mapValue = mapValue;
|
|
exports.normalizeTwoDigitYear = normalizeTwoDigitYear;
|
|
exports.parseAnyDigitsSigned = parseAnyDigitsSigned;
|
|
exports.parseNDigits = parseNDigits;
|
|
exports.parseNDigitsSigned = parseNDigitsSigned;
|
|
exports.parseNumericPattern = parseNumericPattern;
|
|
exports.parseTimezonePattern = parseTimezonePattern;
|
|
var _index = require_constants();
|
|
var _constants = require_constants2();
|
|
function mapValue(parseFnResult, mapFn) {
|
|
if (!parseFnResult) {
|
|
return parseFnResult;
|
|
}
|
|
return {
|
|
value: mapFn(parseFnResult.value),
|
|
rest: parseFnResult.rest
|
|
};
|
|
}
|
|
function parseNumericPattern(pattern, dateString) {
|
|
var matchResult = dateString.match(pattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
return {
|
|
value: parseInt(matchResult[0], 10),
|
|
rest: dateString.slice(matchResult[0].length)
|
|
};
|
|
}
|
|
function parseTimezonePattern(pattern, dateString) {
|
|
var matchResult = dateString.match(pattern);
|
|
if (!matchResult) {
|
|
return null;
|
|
}
|
|
if (matchResult[0] === "Z") {
|
|
return {
|
|
value: 0,
|
|
rest: dateString.slice(1)
|
|
};
|
|
}
|
|
var sign = matchResult[1] === "+" ? 1 : -1;
|
|
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
|
|
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
|
|
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
|
|
return {
|
|
value: sign * (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute + seconds * _index.millisecondsInSecond),
|
|
rest: dateString.slice(matchResult[0].length)
|
|
};
|
|
}
|
|
function parseAnyDigitsSigned(dateString) {
|
|
return parseNumericPattern(_constants.numericPatterns.anyDigitsSigned, dateString);
|
|
}
|
|
function parseNDigits(n2, dateString) {
|
|
switch (n2) {
|
|
case 1:
|
|
return parseNumericPattern(_constants.numericPatterns.singleDigit, dateString);
|
|
case 2:
|
|
return parseNumericPattern(_constants.numericPatterns.twoDigits, dateString);
|
|
case 3:
|
|
return parseNumericPattern(_constants.numericPatterns.threeDigits, dateString);
|
|
case 4:
|
|
return parseNumericPattern(_constants.numericPatterns.fourDigits, dateString);
|
|
default:
|
|
return parseNumericPattern(new RegExp("^\\d{1," + n2 + "}"), dateString);
|
|
}
|
|
}
|
|
function parseNDigitsSigned(n2, dateString) {
|
|
switch (n2) {
|
|
case 1:
|
|
return parseNumericPattern(_constants.numericPatterns.singleDigitSigned, dateString);
|
|
case 2:
|
|
return parseNumericPattern(_constants.numericPatterns.twoDigitsSigned, dateString);
|
|
case 3:
|
|
return parseNumericPattern(_constants.numericPatterns.threeDigitsSigned, dateString);
|
|
case 4:
|
|
return parseNumericPattern(_constants.numericPatterns.fourDigitsSigned, dateString);
|
|
default:
|
|
return parseNumericPattern(new RegExp("^-?\\d{1," + n2 + "}"), dateString);
|
|
}
|
|
}
|
|
function dayPeriodEnumToHours(dayPeriod) {
|
|
switch (dayPeriod) {
|
|
case "morning":
|
|
return 4;
|
|
case "evening":
|
|
return 17;
|
|
case "pm":
|
|
case "noon":
|
|
case "afternoon":
|
|
return 12;
|
|
case "am":
|
|
case "midnight":
|
|
case "night":
|
|
default:
|
|
return 0;
|
|
}
|
|
}
|
|
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
|
|
var isCommonEra = currentYear > 0;
|
|
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
|
|
var result;
|
|
if (absCurrentYear <= 50) {
|
|
result = twoDigitYear || 100;
|
|
} else {
|
|
var rangeEnd = absCurrentYear + 50;
|
|
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
|
|
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
|
|
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
|
|
}
|
|
return isCommonEra ? result : 1 - result;
|
|
}
|
|
function isLeapYearIndex(year) {
|
|
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/YearParser.js
|
|
var require_YearParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/YearParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.YearParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var YearParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(YearParser2, _Parser);
|
|
var _super = _createSuper(YearParser2);
|
|
function YearParser2() {
|
|
var _this;
|
|
_classCallCheck(this, YearParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 130);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(YearParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
var valueCallback = function valueCallback2(year) {
|
|
return {
|
|
year,
|
|
isTwoDigitYear: token === "yy"
|
|
};
|
|
};
|
|
switch (token) {
|
|
case "y":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(4, dateString), valueCallback);
|
|
case "yo":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "year"
|
|
}), valueCallback);
|
|
default:
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value.isTwoDigitYear || value.year > 0;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, flags, value) {
|
|
var currentYear = date.getUTCFullYear();
|
|
if (value.isTwoDigitYear) {
|
|
var normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(value.year, currentYear);
|
|
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
date.setUTCFullYear(year, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return YearParser2;
|
|
}(_Parser2.Parser);
|
|
exports.YearParser = YearParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js
|
|
var require_LocalWeekYearParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.LocalWeekYearParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_getUTCWeekYear());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var LocalWeekYearParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(LocalWeekYearParser2, _Parser);
|
|
var _super = _createSuper(LocalWeekYearParser2);
|
|
function LocalWeekYearParser2() {
|
|
var _this;
|
|
_classCallCheck(this, LocalWeekYearParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 130);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(LocalWeekYearParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
var valueCallback = function valueCallback2(year) {
|
|
return {
|
|
year,
|
|
isTwoDigitYear: token === "YY"
|
|
};
|
|
};
|
|
switch (token) {
|
|
case "Y":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(4, dateString), valueCallback);
|
|
case "Yo":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "year"
|
|
}), valueCallback);
|
|
default:
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value.isTwoDigitYear || value.year > 0;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, flags, value, options) {
|
|
var currentYear = (0, _index.default)(date, options);
|
|
if (value.isTwoDigitYear) {
|
|
var normalizedTwoDigitYear = (0, _utils.normalizeTwoDigitYear)(value.year, currentYear);
|
|
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index2.default)(date, options);
|
|
}
|
|
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
|
|
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index2.default)(date, options);
|
|
}
|
|
}]);
|
|
return LocalWeekYearParser2;
|
|
}(_Parser2.Parser);
|
|
exports.LocalWeekYearParser = LocalWeekYearParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js
|
|
var require_ISOWeekYearParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ISOWeekYearParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ISOWeekYearParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ISOWeekYearParser2, _Parser);
|
|
var _super = _createSuper(ISOWeekYearParser2);
|
|
function ISOWeekYearParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ISOWeekYearParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 130);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(ISOWeekYearParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token) {
|
|
if (token === "R") {
|
|
return (0, _utils.parseNDigitsSigned)(4, dateString);
|
|
}
|
|
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(_date, _flags, value) {
|
|
var firstWeekOfYear = new Date(0);
|
|
firstWeekOfYear.setUTCFullYear(value, 0, 4);
|
|
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
|
|
return (0, _index.default)(firstWeekOfYear);
|
|
}
|
|
}]);
|
|
return ISOWeekYearParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ISOWeekYearParser = ISOWeekYearParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js
|
|
var require_ExtendedYearParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ExtendedYearParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ExtendedYearParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ExtendedYearParser2, _Parser);
|
|
var _super = _createSuper(ExtendedYearParser2);
|
|
function ExtendedYearParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ExtendedYearParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 130);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(ExtendedYearParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token) {
|
|
if (token === "u") {
|
|
return (0, _utils.parseNDigitsSigned)(4, dateString);
|
|
}
|
|
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCFullYear(value, 0, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return ExtendedYearParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ExtendedYearParser = ExtendedYearParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/QuarterParser.js
|
|
var require_QuarterParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/QuarterParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.QuarterParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var QuarterParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(QuarterParser2, _Parser);
|
|
var _super = _createSuper(QuarterParser2);
|
|
function QuarterParser2() {
|
|
var _this;
|
|
_classCallCheck(this, QuarterParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 120);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(QuarterParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "Q":
|
|
case "QQ":
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
case "Qo":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "quarter"
|
|
});
|
|
case "QQQ":
|
|
return match.quarter(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQQ":
|
|
return match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "QQQQ":
|
|
default:
|
|
return match.quarter(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.quarter(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 4;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMonth((value - 1) * 3, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return QuarterParser2;
|
|
}(_Parser2.Parser);
|
|
exports.QuarterParser = QuarterParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js
|
|
var require_StandAloneQuarterParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.StandAloneQuarterParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var StandAloneQuarterParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(StandAloneQuarterParser2, _Parser);
|
|
var _super = _createSuper(StandAloneQuarterParser2);
|
|
function StandAloneQuarterParser2() {
|
|
var _this;
|
|
_classCallCheck(this, StandAloneQuarterParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 120);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(StandAloneQuarterParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "q":
|
|
case "qq":
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
case "qo":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "quarter"
|
|
});
|
|
case "qqq":
|
|
return match.quarter(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqqq":
|
|
return match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "qqqq":
|
|
default:
|
|
return match.quarter(dateString, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.quarter(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.quarter(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 4;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMonth((value - 1) * 3, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return StandAloneQuarterParser2;
|
|
}(_Parser2.Parser);
|
|
exports.StandAloneQuarterParser = StandAloneQuarterParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/MonthParser.js
|
|
var require_MonthParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/MonthParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.MonthParser = void 0;
|
|
var _utils = require_utils2();
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var MonthParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(MonthParser2, _Parser);
|
|
var _super = _createSuper(MonthParser2);
|
|
function MonthParser2() {
|
|
var _this;
|
|
_classCallCheck(this, MonthParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]);
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 110);
|
|
return _this;
|
|
}
|
|
_createClass(MonthParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
return value - 1;
|
|
};
|
|
switch (token) {
|
|
case "M":
|
|
return (0, _utils.mapValue)((0, _utils.parseNumericPattern)(_constants.numericPatterns.month, dateString), valueCallback);
|
|
case "MM":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(2, dateString), valueCallback);
|
|
case "Mo":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "month"
|
|
}), valueCallback);
|
|
case "MMM":
|
|
return match.month(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.month(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMMM":
|
|
return match.month(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "MMMM":
|
|
default:
|
|
return match.month(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.month(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.month(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 11;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMonth(value, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return MonthParser2;
|
|
}(_Parser2.Parser);
|
|
exports.MonthParser = MonthParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js
|
|
var require_StandAloneMonthParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.StandAloneMonthParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var StandAloneMonthParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(StandAloneMonthParser2, _Parser);
|
|
var _super = _createSuper(StandAloneMonthParser2);
|
|
function StandAloneMonthParser2() {
|
|
var _this;
|
|
_classCallCheck(this, StandAloneMonthParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 110);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(StandAloneMonthParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
return value - 1;
|
|
};
|
|
switch (token) {
|
|
case "L":
|
|
return (0, _utils.mapValue)((0, _utils.parseNumericPattern)(_constants.numericPatterns.month, dateString), valueCallback);
|
|
case "LL":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(2, dateString), valueCallback);
|
|
case "Lo":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "month"
|
|
}), valueCallback);
|
|
case "LLL":
|
|
return match.month(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.month(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLLL":
|
|
return match.month(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "LLLL":
|
|
default:
|
|
return match.month(dateString, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.month(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.month(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 11;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMonth(value, 1);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return StandAloneMonthParser2;
|
|
}(_Parser2.Parser);
|
|
exports.StandAloneMonthParser = StandAloneMonthParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCWeek/index.js
|
|
var require_setUTCWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCWeek;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getUTCWeek());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCWeek(dirtyDate, dirtyWeek, options) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var week = (0, _index.default)(dirtyWeek);
|
|
var diff = (0, _index3.default)(date, options) - week;
|
|
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js
|
|
var require_LocalWeekParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.LocalWeekParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_setUTCWeek());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var LocalWeekParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(LocalWeekParser2, _Parser);
|
|
var _super = _createSuper(LocalWeekParser2);
|
|
function LocalWeekParser2() {
|
|
var _this;
|
|
_classCallCheck(this, LocalWeekParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 100);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(LocalWeekParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "w":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.week, dateString);
|
|
case "wo":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "week"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 53;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value, options) {
|
|
return (0, _index2.default)((0, _index.default)(date, value, options), options);
|
|
}
|
|
}]);
|
|
return LocalWeekParser2;
|
|
}(_Parser2.Parser);
|
|
exports.LocalWeekParser = LocalWeekParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCISOWeek/index.js
|
|
var require_setUTCISOWeek = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCISOWeek/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCISOWeek;
|
|
var _index = _interopRequireDefault(require_toInteger());
|
|
var _index2 = _interopRequireDefault(require_toDate());
|
|
var _index3 = _interopRequireDefault(require_getUTCISOWeek());
|
|
var _index4 = _interopRequireDefault(require_requiredArgs());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
|
|
(0, _index4.default)(2, arguments);
|
|
var date = (0, _index2.default)(dirtyDate);
|
|
var isoWeek = (0, _index.default)(dirtyISOWeek);
|
|
var diff = (0, _index3.default)(date) - isoWeek;
|
|
date.setUTCDate(date.getUTCDate() - diff * 7);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js
|
|
var require_ISOWeekParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ISOWeekParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_setUTCISOWeek());
|
|
var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ISOWeekParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ISOWeekParser2, _Parser);
|
|
var _super = _createSuper(ISOWeekParser2);
|
|
function ISOWeekParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ISOWeekParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 100);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(ISOWeekParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "I":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.week, dateString);
|
|
case "Io":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "week"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 53;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
return (0, _index2.default)((0, _index.default)(date, value));
|
|
}
|
|
}]);
|
|
return ISOWeekParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ISOWeekParser = ISOWeekParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/DateParser.js
|
|
var require_DateParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/DateParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DateParser = void 0;
|
|
var _utils = require_utils2();
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
var DateParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(DateParser2, _Parser);
|
|
var _super = _createSuper(DateParser2);
|
|
function DateParser2() {
|
|
var _this;
|
|
_classCallCheck(this, DateParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "subPriority", 1);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(DateParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "d":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.date, dateString);
|
|
case "do":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "date"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(date, value) {
|
|
var year = date.getUTCFullYear();
|
|
var isLeapYear = (0, _utils.isLeapYearIndex)(year);
|
|
var month = date.getUTCMonth();
|
|
if (isLeapYear) {
|
|
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
|
|
} else {
|
|
return value >= 1 && value <= DAYS_IN_MONTH[month];
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCDate(value);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return DateParser2;
|
|
}(_Parser2.Parser);
|
|
exports.DateParser = DateParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js
|
|
var require_DayOfYearParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DayOfYearParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var DayOfYearParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(DayOfYearParser2, _Parser);
|
|
var _super = _createSuper(DayOfYearParser2);
|
|
function DayOfYearParser2() {
|
|
var _this;
|
|
_classCallCheck(this, DayOfYearParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "subpriority", 1);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(DayOfYearParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "D":
|
|
case "DD":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.dayOfYear, dateString);
|
|
case "Do":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "date"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(date, value) {
|
|
var year = date.getUTCFullYear();
|
|
var isLeapYear = (0, _utils.isLeapYearIndex)(year);
|
|
if (isLeapYear) {
|
|
return value >= 1 && value <= 366;
|
|
} else {
|
|
return value >= 1 && value <= 365;
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMonth(0, value);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return DayOfYearParser2;
|
|
}(_Parser2.Parser);
|
|
exports.DayOfYearParser = DayOfYearParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCDay/index.js
|
|
var require_setUTCDay = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCDay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCDay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
var _index4 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCDay(dirtyDate, dirtyDay, options) {
|
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
|
(0, _index2.default)(2, arguments);
|
|
var defaultOptions = (0, _index4.getDefaultOptions)();
|
|
var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var day = (0, _index3.default)(dirtyDay);
|
|
var currentDay = date.getUTCDay();
|
|
var remainder = day % 7;
|
|
var dayIndex = (remainder + 7) % 7;
|
|
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/DayParser.js
|
|
var require_DayParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/DayParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DayParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _index = _interopRequireDefault(require_setUTCDay());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var DayParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(DayParser2, _Parser);
|
|
var _super = _createSuper(DayParser2);
|
|
function DayParser2() {
|
|
var _this;
|
|
_classCallCheck(this, DayParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(DayParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "E":
|
|
case "EE":
|
|
case "EEE":
|
|
return match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEE":
|
|
return match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEEEE":
|
|
return match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "EEEE":
|
|
default:
|
|
return match.day(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 6;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value, options) {
|
|
date = (0, _index.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return DayParser2;
|
|
}(_Parser2.Parser);
|
|
exports.DayParser = DayParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js
|
|
var require_LocalDayParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.LocalDayParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_setUTCDay());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var LocalDayParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(LocalDayParser2, _Parser);
|
|
var _super = _createSuper(LocalDayParser2);
|
|
function LocalDayParser2() {
|
|
var _this;
|
|
_classCallCheck(this, LocalDayParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(LocalDayParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match, options) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
};
|
|
switch (token) {
|
|
case "e":
|
|
case "ee":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback);
|
|
case "eo":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "day"
|
|
}), valueCallback);
|
|
case "eee":
|
|
return match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeee":
|
|
return match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeeeee":
|
|
return match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "eeee":
|
|
default:
|
|
return match.day(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 6;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value, options) {
|
|
date = (0, _index.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return LocalDayParser2;
|
|
}(_Parser2.Parser);
|
|
exports.LocalDayParser = LocalDayParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js
|
|
var require_StandAloneLocalDayParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.StandAloneLocalDayParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_setUTCDay());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var StandAloneLocalDayParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(StandAloneLocalDayParser2, _Parser);
|
|
var _super = _createSuper(StandAloneLocalDayParser2);
|
|
function StandAloneLocalDayParser2() {
|
|
var _this;
|
|
_classCallCheck(this, StandAloneLocalDayParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(StandAloneLocalDayParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match, options) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
|
|
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
|
|
};
|
|
switch (token) {
|
|
case "c":
|
|
case "cc":
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback);
|
|
case "co":
|
|
return (0, _utils.mapValue)(match.ordinalNumber(dateString, {
|
|
unit: "day"
|
|
}), valueCallback);
|
|
case "ccc":
|
|
return match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "ccccc":
|
|
return match.day(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccccc":
|
|
return match.day(dateString, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
case "cccc":
|
|
default:
|
|
return match.day(dateString, {
|
|
width: "wide",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "standalone"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "standalone"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 6;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value, options) {
|
|
date = (0, _index.default)(date, value, options);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return StandAloneLocalDayParser2;
|
|
}(_Parser2.Parser);
|
|
exports.StandAloneLocalDayParser = StandAloneLocalDayParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/_lib/setUTCISODay/index.js
|
|
var require_setUTCISODay = __commonJS({
|
|
"node_modules/date-fns/_lib/setUTCISODay/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = setUTCISODay;
|
|
var _index = _interopRequireDefault(require_toDate());
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function setUTCISODay(dirtyDate, dirtyDay) {
|
|
(0, _index2.default)(2, arguments);
|
|
var day = (0, _index3.default)(dirtyDay);
|
|
if (day % 7 === 0) {
|
|
day = day - 7;
|
|
}
|
|
var weekStartsOn = 1;
|
|
var date = (0, _index.default)(dirtyDate);
|
|
var currentDay = date.getUTCDay();
|
|
var remainder = day % 7;
|
|
var dayIndex = (remainder + 7) % 7;
|
|
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ISODayParser.js
|
|
var require_ISODayParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ISODayParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ISODayParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
var _index = _interopRequireDefault(require_setUTCISODay());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ISODayParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ISODayParser2, _Parser);
|
|
var _super = _createSuper(ISODayParser2);
|
|
function ISODayParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ISODayParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 90);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(ISODayParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
if (value === 0) {
|
|
return 7;
|
|
}
|
|
return value;
|
|
};
|
|
switch (token) {
|
|
case "i":
|
|
case "ii":
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
case "io":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "day"
|
|
});
|
|
case "iii":
|
|
return (0, _utils.mapValue)(match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
}), valueCallback);
|
|
case "iiiii":
|
|
return (0, _utils.mapValue)(match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
}), valueCallback);
|
|
case "iiiiii":
|
|
return (0, _utils.mapValue)(match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
}), valueCallback);
|
|
case "iiii":
|
|
default:
|
|
return (0, _utils.mapValue)(match.day(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "short",
|
|
context: "formatting"
|
|
}) || match.day(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
}), valueCallback);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 7;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date = (0, _index.default)(date, value);
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return ISODayParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ISODayParser = ISODayParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/AMPMParser.js
|
|
var require_AMPMParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/AMPMParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.AMPMParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var AMPMParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(AMPMParser2, _Parser);
|
|
var _super = _createSuper(AMPMParser2);
|
|
function AMPMParser2() {
|
|
var _this;
|
|
_classCallCheck(this, AMPMParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 80);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(AMPMParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "a":
|
|
case "aa":
|
|
case "aaa":
|
|
return match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaaa":
|
|
return match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "aaaa":
|
|
default:
|
|
return match.dayPeriod(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return AMPMParser2;
|
|
}(_Parser2.Parser);
|
|
exports.AMPMParser = AMPMParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js
|
|
var require_AMPMMidnightParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.AMPMMidnightParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var AMPMMidnightParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(AMPMMidnightParser2, _Parser);
|
|
var _super = _createSuper(AMPMMidnightParser2);
|
|
function AMPMMidnightParser2() {
|
|
var _this;
|
|
_classCallCheck(this, AMPMMidnightParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 80);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(AMPMMidnightParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "b":
|
|
case "bb":
|
|
case "bbb":
|
|
return match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbbb":
|
|
return match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "bbbb":
|
|
default:
|
|
return match.dayPeriod(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return AMPMMidnightParser2;
|
|
}(_Parser2.Parser);
|
|
exports.AMPMMidnightParser = AMPMMidnightParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js
|
|
var require_DayPeriodParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.DayPeriodParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var DayPeriodParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(DayPeriodParser2, _Parser);
|
|
var _super = _createSuper(DayPeriodParser2);
|
|
function DayPeriodParser2() {
|
|
var _this;
|
|
_classCallCheck(this, DayPeriodParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 80);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(DayPeriodParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "B":
|
|
case "BB":
|
|
case "BBB":
|
|
return match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBBB":
|
|
return match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
case "BBBB":
|
|
default:
|
|
return match.dayPeriod(dateString, {
|
|
width: "wide",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "abbreviated",
|
|
context: "formatting"
|
|
}) || match.dayPeriod(dateString, {
|
|
width: "narrow",
|
|
context: "formatting"
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCHours((0, _utils.dayPeriodEnumToHours)(value), 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return DayPeriodParser2;
|
|
}(_Parser2.Parser);
|
|
exports.DayPeriodParser = DayPeriodParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js
|
|
var require_Hour1to12Parser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Hour1to12Parser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var Hour1to12Parser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(Hour1to12Parser2, _Parser);
|
|
var _super = _createSuper(Hour1to12Parser2);
|
|
function Hour1to12Parser2() {
|
|
var _this;
|
|
_classCallCheck(this, Hour1to12Parser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 70);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(Hour1to12Parser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "h":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour12h, dateString);
|
|
case "ho":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 12;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
var isPM = date.getUTCHours() >= 12;
|
|
if (isPM && value < 12) {
|
|
date.setUTCHours(value + 12, 0, 0, 0);
|
|
} else if (!isPM && value === 12) {
|
|
date.setUTCHours(0, 0, 0, 0);
|
|
} else {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
}
|
|
return date;
|
|
}
|
|
}]);
|
|
return Hour1to12Parser2;
|
|
}(_Parser2.Parser);
|
|
exports.Hour1to12Parser = Hour1to12Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js
|
|
var require_Hour0to23Parser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Hour0to23Parser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var Hour0to23Parser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(Hour0to23Parser2, _Parser);
|
|
var _super = _createSuper(Hour0to23Parser2);
|
|
function Hour0to23Parser2() {
|
|
var _this;
|
|
_classCallCheck(this, Hour0to23Parser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 70);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(Hour0to23Parser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "H":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour23h, dateString);
|
|
case "Ho":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 23;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return Hour0to23Parser2;
|
|
}(_Parser2.Parser);
|
|
exports.Hour0to23Parser = Hour0to23Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js
|
|
var require_Hour0To11Parser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Hour0To11Parser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var Hour0To11Parser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(Hour0To11Parser2, _Parser);
|
|
var _super = _createSuper(Hour0To11Parser2);
|
|
function Hour0To11Parser2() {
|
|
var _this;
|
|
_classCallCheck(this, Hour0To11Parser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 70);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(Hour0To11Parser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "K":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour11h, dateString);
|
|
case "Ko":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 11;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
var isPM = date.getUTCHours() >= 12;
|
|
if (isPM && value < 12) {
|
|
date.setUTCHours(value + 12, 0, 0, 0);
|
|
} else {
|
|
date.setUTCHours(value, 0, 0, 0);
|
|
}
|
|
return date;
|
|
}
|
|
}]);
|
|
return Hour0To11Parser2;
|
|
}(_Parser2.Parser);
|
|
exports.Hour0To11Parser = Hour0To11Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
|
|
var require_Hour1To24Parser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Hour1To24Parser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var Hour1To24Parser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(Hour1To24Parser2, _Parser);
|
|
var _super = _createSuper(Hour1To24Parser2);
|
|
function Hour1To24Parser2() {
|
|
var _this;
|
|
_classCallCheck(this, Hour1To24Parser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 70);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(Hour1To24Parser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "k":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.hour24h, dateString);
|
|
case "ko":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "hour"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 1 && value <= 24;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
var hours = value <= 24 ? value % 24 : value;
|
|
date.setUTCHours(hours, 0, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return Hour1To24Parser2;
|
|
}(_Parser2.Parser);
|
|
exports.Hour1To24Parser = Hour1To24Parser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/MinuteParser.js
|
|
var require_MinuteParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/MinuteParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.MinuteParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var MinuteParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(MinuteParser2, _Parser);
|
|
var _super = _createSuper(MinuteParser2);
|
|
function MinuteParser2() {
|
|
var _this;
|
|
_classCallCheck(this, MinuteParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 60);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(MinuteParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "m":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.minute, dateString);
|
|
case "mo":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "minute"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 59;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMinutes(value, 0, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return MinuteParser2;
|
|
}(_Parser2.Parser);
|
|
exports.MinuteParser = MinuteParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/SecondParser.js
|
|
var require_SecondParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/SecondParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.SecondParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var SecondParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(SecondParser2, _Parser);
|
|
var _super = _createSuper(SecondParser2);
|
|
function SecondParser2() {
|
|
var _this;
|
|
_classCallCheck(this, SecondParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 50);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(SecondParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token, match) {
|
|
switch (token) {
|
|
case "s":
|
|
return (0, _utils.parseNumericPattern)(_constants.numericPatterns.second, dateString);
|
|
case "so":
|
|
return match.ordinalNumber(dateString, {
|
|
unit: "second"
|
|
});
|
|
default:
|
|
return (0, _utils.parseNDigits)(token.length, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(_date, value) {
|
|
return value >= 0 && value <= 59;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCSeconds(value, 0);
|
|
return date;
|
|
}
|
|
}]);
|
|
return SecondParser2;
|
|
}(_Parser2.Parser);
|
|
exports.SecondParser = SecondParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js
|
|
var require_FractionOfSecondParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.FractionOfSecondParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var FractionOfSecondParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(FractionOfSecondParser2, _Parser);
|
|
var _super = _createSuper(FractionOfSecondParser2);
|
|
function FractionOfSecondParser2() {
|
|
var _this;
|
|
_classCallCheck(this, FractionOfSecondParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 30);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T"]);
|
|
return _this;
|
|
}
|
|
_createClass(FractionOfSecondParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token) {
|
|
var valueCallback = function valueCallback2(value) {
|
|
return Math.floor(value * Math.pow(10, -token.length + 3));
|
|
};
|
|
return (0, _utils.mapValue)((0, _utils.parseNDigits)(token.length, dateString), valueCallback);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, _flags, value) {
|
|
date.setUTCMilliseconds(value);
|
|
return date;
|
|
}
|
|
}]);
|
|
return FractionOfSecondParser2;
|
|
}(_Parser2.Parser);
|
|
exports.FractionOfSecondParser = FractionOfSecondParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
|
|
var require_ISOTimezoneWithZParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ISOTimezoneWithZParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ISOTimezoneWithZParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ISOTimezoneWithZParser2, _Parser);
|
|
var _super = _createSuper(ISOTimezoneWithZParser2);
|
|
function ISOTimezoneWithZParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ISOTimezoneWithZParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 10);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T", "x"]);
|
|
return _this;
|
|
}
|
|
_createClass(ISOTimezoneWithZParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token) {
|
|
switch (token) {
|
|
case "X":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalMinutes, dateString);
|
|
case "XX":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basic, dateString);
|
|
case "XXXX":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalSeconds, dateString);
|
|
case "XXXXX":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extendedOptionalSeconds, dateString);
|
|
case "XXX":
|
|
default:
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extended, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, flags, value) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
return new Date(date.getTime() - value);
|
|
}
|
|
}]);
|
|
return ISOTimezoneWithZParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ISOTimezoneWithZParser = ISOTimezoneWithZParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js
|
|
var require_ISOTimezoneParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.ISOTimezoneParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _constants = require_constants2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var ISOTimezoneParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(ISOTimezoneParser2, _Parser);
|
|
var _super = _createSuper(ISOTimezoneParser2);
|
|
function ISOTimezoneParser2() {
|
|
var _this;
|
|
_classCallCheck(this, ISOTimezoneParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 10);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", ["t", "T", "X"]);
|
|
return _this;
|
|
}
|
|
_createClass(ISOTimezoneParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString, token) {
|
|
switch (token) {
|
|
case "x":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalMinutes, dateString);
|
|
case "xx":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basic, dateString);
|
|
case "xxxx":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.basicOptionalSeconds, dateString);
|
|
case "xxxxx":
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extendedOptionalSeconds, dateString);
|
|
case "xxx":
|
|
default:
|
|
return (0, _utils.parseTimezonePattern)(_constants.timezonePatterns.extended, dateString);
|
|
}
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(date, flags, value) {
|
|
if (flags.timestampIsSet) {
|
|
return date;
|
|
}
|
|
return new Date(date.getTime() - value);
|
|
}
|
|
}]);
|
|
return ISOTimezoneParser2;
|
|
}(_Parser2.Parser);
|
|
exports.ISOTimezoneParser = ISOTimezoneParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js
|
|
var require_TimestampSecondsParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.TimestampSecondsParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var TimestampSecondsParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(TimestampSecondsParser2, _Parser);
|
|
var _super = _createSuper(TimestampSecondsParser2);
|
|
function TimestampSecondsParser2() {
|
|
var _this;
|
|
_classCallCheck(this, TimestampSecondsParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 40);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", "*");
|
|
return _this;
|
|
}
|
|
_createClass(TimestampSecondsParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString) {
|
|
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(_date, _flags, value) {
|
|
return [new Date(value * 1e3), {
|
|
timestampIsSet: true
|
|
}];
|
|
}
|
|
}]);
|
|
return TimestampSecondsParser2;
|
|
}(_Parser2.Parser);
|
|
exports.TimestampSecondsParser = TimestampSecondsParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js
|
|
var require_TimestampMillisecondsParser = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js"(exports) {
|
|
"use strict";
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.TimestampMillisecondsParser = void 0;
|
|
var _Parser2 = require_Parser2();
|
|
var _utils = require_utils2();
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
function _defineProperties(target, props) {
|
|
for (var i2 = 0; i2 < props.length; i2++) {
|
|
var descriptor = props[i2];
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
descriptor.configurable = true;
|
|
if ("value" in descriptor)
|
|
descriptor.writable = true;
|
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
}
|
|
}
|
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
if (protoProps)
|
|
_defineProperties(Constructor.prototype, protoProps);
|
|
if (staticProps)
|
|
_defineProperties(Constructor, staticProps);
|
|
return Constructor;
|
|
}
|
|
function _inherits(subClass, superClass) {
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
if (superClass)
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _createSuper(Derived) {
|
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
return function _createSuperInternal() {
|
|
var Super = _getPrototypeOf(Derived), result;
|
|
if (hasNativeReflectConstruct) {
|
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
} else {
|
|
result = Super.apply(this, arguments);
|
|
}
|
|
return _possibleConstructorReturn(this, result);
|
|
};
|
|
}
|
|
function _possibleConstructorReturn(self2, call) {
|
|
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
return call;
|
|
}
|
|
return _assertThisInitialized(self2);
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function _isNativeReflectConstruct() {
|
|
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if (typeof Proxy === "function")
|
|
return true;
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
}));
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
function _getPrototypeOf(o2) {
|
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
|
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
};
|
|
return _getPrototypeOf(o2);
|
|
}
|
|
function _defineProperty2(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
var TimestampMillisecondsParser = /* @__PURE__ */ function(_Parser) {
|
|
_inherits(TimestampMillisecondsParser2, _Parser);
|
|
var _super = _createSuper(TimestampMillisecondsParser2);
|
|
function TimestampMillisecondsParser2() {
|
|
var _this;
|
|
_classCallCheck(this, TimestampMillisecondsParser2);
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
_defineProperty2(_assertThisInitialized(_this), "priority", 20);
|
|
_defineProperty2(_assertThisInitialized(_this), "incompatibleTokens", "*");
|
|
return _this;
|
|
}
|
|
_createClass(TimestampMillisecondsParser2, [{
|
|
key: "parse",
|
|
value: function parse(dateString) {
|
|
return (0, _utils.parseAnyDigitsSigned)(dateString);
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(_date, _flags, value) {
|
|
return [new Date(value), {
|
|
timestampIsSet: true
|
|
}];
|
|
}
|
|
}]);
|
|
return TimestampMillisecondsParser2;
|
|
}(_Parser2.Parser);
|
|
exports.TimestampMillisecondsParser = TimestampMillisecondsParser;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/_lib/parsers/index.js
|
|
var require_parsers = __commonJS({
|
|
"node_modules/date-fns/parse/_lib/parsers/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.parsers = void 0;
|
|
var _EraParser = require_EraParser();
|
|
var _YearParser = require_YearParser();
|
|
var _LocalWeekYearParser = require_LocalWeekYearParser();
|
|
var _ISOWeekYearParser = require_ISOWeekYearParser();
|
|
var _ExtendedYearParser = require_ExtendedYearParser();
|
|
var _QuarterParser = require_QuarterParser();
|
|
var _StandAloneQuarterParser = require_StandAloneQuarterParser();
|
|
var _MonthParser = require_MonthParser();
|
|
var _StandAloneMonthParser = require_StandAloneMonthParser();
|
|
var _LocalWeekParser = require_LocalWeekParser();
|
|
var _ISOWeekParser = require_ISOWeekParser();
|
|
var _DateParser = require_DateParser();
|
|
var _DayOfYearParser = require_DayOfYearParser();
|
|
var _DayParser = require_DayParser();
|
|
var _LocalDayParser = require_LocalDayParser();
|
|
var _StandAloneLocalDayParser = require_StandAloneLocalDayParser();
|
|
var _ISODayParser = require_ISODayParser();
|
|
var _AMPMParser = require_AMPMParser();
|
|
var _AMPMMidnightParser = require_AMPMMidnightParser();
|
|
var _DayPeriodParser = require_DayPeriodParser();
|
|
var _Hour1to12Parser = require_Hour1to12Parser();
|
|
var _Hour0to23Parser = require_Hour0to23Parser();
|
|
var _Hour0To11Parser = require_Hour0To11Parser();
|
|
var _Hour1To24Parser = require_Hour1To24Parser();
|
|
var _MinuteParser = require_MinuteParser();
|
|
var _SecondParser = require_SecondParser();
|
|
var _FractionOfSecondParser = require_FractionOfSecondParser();
|
|
var _ISOTimezoneWithZParser = require_ISOTimezoneWithZParser();
|
|
var _ISOTimezoneParser = require_ISOTimezoneParser();
|
|
var _TimestampSecondsParser = require_TimestampSecondsParser();
|
|
var _TimestampMillisecondsParser = require_TimestampMillisecondsParser();
|
|
var parsers = {
|
|
G: new _EraParser.EraParser(),
|
|
y: new _YearParser.YearParser(),
|
|
Y: new _LocalWeekYearParser.LocalWeekYearParser(),
|
|
R: new _ISOWeekYearParser.ISOWeekYearParser(),
|
|
u: new _ExtendedYearParser.ExtendedYearParser(),
|
|
Q: new _QuarterParser.QuarterParser(),
|
|
q: new _StandAloneQuarterParser.StandAloneQuarterParser(),
|
|
M: new _MonthParser.MonthParser(),
|
|
L: new _StandAloneMonthParser.StandAloneMonthParser(),
|
|
w: new _LocalWeekParser.LocalWeekParser(),
|
|
I: new _ISOWeekParser.ISOWeekParser(),
|
|
d: new _DateParser.DateParser(),
|
|
D: new _DayOfYearParser.DayOfYearParser(),
|
|
E: new _DayParser.DayParser(),
|
|
e: new _LocalDayParser.LocalDayParser(),
|
|
c: new _StandAloneLocalDayParser.StandAloneLocalDayParser(),
|
|
i: new _ISODayParser.ISODayParser(),
|
|
a: new _AMPMParser.AMPMParser(),
|
|
b: new _AMPMMidnightParser.AMPMMidnightParser(),
|
|
B: new _DayPeriodParser.DayPeriodParser(),
|
|
h: new _Hour1to12Parser.Hour1to12Parser(),
|
|
H: new _Hour0to23Parser.Hour0to23Parser(),
|
|
K: new _Hour0To11Parser.Hour0To11Parser(),
|
|
k: new _Hour1To24Parser.Hour1To24Parser(),
|
|
m: new _MinuteParser.MinuteParser(),
|
|
s: new _SecondParser.SecondParser(),
|
|
S: new _FractionOfSecondParser.FractionOfSecondParser(),
|
|
X: new _ISOTimezoneWithZParser.ISOTimezoneWithZParser(),
|
|
x: new _ISOTimezoneParser.ISOTimezoneParser(),
|
|
t: new _TimestampSecondsParser.TimestampSecondsParser(),
|
|
T: new _TimestampMillisecondsParser.TimestampMillisecondsParser()
|
|
};
|
|
exports.parsers = parsers;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parse/index.js
|
|
var require_parse2 = __commonJS({
|
|
"node_modules/date-fns/parse/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = parse;
|
|
var _index = _interopRequireDefault(require_defaultLocale());
|
|
var _index2 = _interopRequireDefault(require_subMilliseconds());
|
|
var _index3 = _interopRequireDefault(require_toDate());
|
|
var _index4 = _interopRequireDefault(require_assign());
|
|
var _index5 = _interopRequireDefault(require_longFormatters());
|
|
var _index6 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
|
|
var _index7 = require_protectedTokens();
|
|
var _index8 = _interopRequireDefault(require_toInteger());
|
|
var _index9 = _interopRequireDefault(require_requiredArgs());
|
|
var _Setter = require_Setter();
|
|
var _index10 = require_parsers();
|
|
var _index11 = require_defaultOptions();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function _typeof(obj) {
|
|
"@babel/helpers - typeof";
|
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
_typeof = function _typeof2(obj2) {
|
|
return typeof obj2;
|
|
};
|
|
} else {
|
|
_typeof = function _typeof2(obj2) {
|
|
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
};
|
|
}
|
|
return _typeof(obj);
|
|
}
|
|
function _createForOfIteratorHelper(o2, allowArrayLike) {
|
|
var it;
|
|
if (typeof Symbol === "undefined" || o2[Symbol.iterator] == null) {
|
|
if (Array.isArray(o2) || (it = _unsupportedIterableToArray(o2)) || allowArrayLike && o2 && typeof o2.length === "number") {
|
|
if (it)
|
|
o2 = it;
|
|
var i2 = 0;
|
|
var F2 = function F3() {
|
|
};
|
|
return { s: F2, n: function n2() {
|
|
if (i2 >= o2.length)
|
|
return { done: true };
|
|
return { done: false, value: o2[i2++] };
|
|
}, e: function e(_e) {
|
|
throw _e;
|
|
}, f: F2 };
|
|
}
|
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}
|
|
var normalCompletion = true, didErr = false, err;
|
|
return { s: function s2() {
|
|
it = o2[Symbol.iterator]();
|
|
}, n: function n2() {
|
|
var step = it.next();
|
|
normalCompletion = step.done;
|
|
return step;
|
|
}, e: function e(_e2) {
|
|
didErr = true;
|
|
err = _e2;
|
|
}, f: function f2() {
|
|
try {
|
|
if (!normalCompletion && it.return != null)
|
|
it.return();
|
|
} finally {
|
|
if (didErr)
|
|
throw err;
|
|
}
|
|
} };
|
|
}
|
|
function _unsupportedIterableToArray(o2, minLen) {
|
|
if (!o2)
|
|
return;
|
|
if (typeof o2 === "string")
|
|
return _arrayLikeToArray(o2, minLen);
|
|
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
|
|
if (n2 === "Object" && o2.constructor)
|
|
n2 = o2.constructor.name;
|
|
if (n2 === "Map" || n2 === "Set")
|
|
return Array.from(o2);
|
|
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
|
|
return _arrayLikeToArray(o2, minLen);
|
|
}
|
|
function _arrayLikeToArray(arr, len) {
|
|
if (len == null || len > arr.length)
|
|
len = arr.length;
|
|
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
|
|
arr2[i2] = arr[i2];
|
|
}
|
|
return arr2;
|
|
}
|
|
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
var doubleQuoteRegExp = /''/g;
|
|
var notWhitespaceRegExp = /\S/;
|
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, options) {
|
|
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
|
(0, _index9.default)(3, arguments);
|
|
var dateString = String(dirtyDateString);
|
|
var formatString = String(dirtyFormatString);
|
|
var defaultOptions = (0, _index11.getDefaultOptions)();
|
|
var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : _index.default;
|
|
if (!locale.match) {
|
|
throw new RangeError("locale must contain match property");
|
|
}
|
|
var firstWeekContainsDate = (0, _index8.default)((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
|
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
}
|
|
var weekStartsOn = (0, _index8.default)((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
}
|
|
if (formatString === "") {
|
|
if (dateString === "") {
|
|
return (0, _index3.default)(dirtyReferenceDate);
|
|
} else {
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
var subFnOptions = {
|
|
firstWeekContainsDate,
|
|
weekStartsOn,
|
|
locale
|
|
};
|
|
var setters = [new _Setter.DateToSystemTimezoneSetter()];
|
|
var tokens = formatString.match(longFormattingTokensRegExp).map(function(substring) {
|
|
var firstCharacter = substring[0];
|
|
if (firstCharacter in _index5.default) {
|
|
var longFormatter = _index5.default[firstCharacter];
|
|
return longFormatter(substring, locale.formatLong);
|
|
}
|
|
return substring;
|
|
}).join("").match(formattingTokensRegExp);
|
|
var usedTokens = [];
|
|
var _iterator = _createForOfIteratorHelper(tokens), _step;
|
|
try {
|
|
var _loop = function _loop2() {
|
|
var token = _step.value;
|
|
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(token)) {
|
|
(0, _index7.throwProtectedError)(token, formatString, dirtyDateString);
|
|
}
|
|
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(token)) {
|
|
(0, _index7.throwProtectedError)(token, formatString, dirtyDateString);
|
|
}
|
|
var firstCharacter = token[0];
|
|
var parser = _index10.parsers[firstCharacter];
|
|
if (parser) {
|
|
var incompatibleTokens = parser.incompatibleTokens;
|
|
if (Array.isArray(incompatibleTokens)) {
|
|
var incompatibleToken = usedTokens.find(function(usedToken) {
|
|
return incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter;
|
|
});
|
|
if (incompatibleToken) {
|
|
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
|
|
}
|
|
} else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) {
|
|
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
|
|
}
|
|
usedTokens.push({
|
|
token: firstCharacter,
|
|
fullToken: token
|
|
});
|
|
var parseResult = parser.run(dateString, token, locale.match, subFnOptions);
|
|
if (!parseResult) {
|
|
return {
|
|
v: new Date(NaN)
|
|
};
|
|
}
|
|
setters.push(parseResult.setter);
|
|
dateString = parseResult.rest;
|
|
} else {
|
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
|
|
}
|
|
if (token === "''") {
|
|
token = "'";
|
|
} else if (firstCharacter === "'") {
|
|
token = cleanEscapedString(token);
|
|
}
|
|
if (dateString.indexOf(token) === 0) {
|
|
dateString = dateString.slice(token.length);
|
|
} else {
|
|
return {
|
|
v: new Date(NaN)
|
|
};
|
|
}
|
|
}
|
|
};
|
|
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
var _ret = _loop();
|
|
if (_typeof(_ret) === "object")
|
|
return _ret.v;
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
|
|
return new Date(NaN);
|
|
}
|
|
var uniquePrioritySetters = setters.map(function(setter2) {
|
|
return setter2.priority;
|
|
}).sort(function(a2, b2) {
|
|
return b2 - a2;
|
|
}).filter(function(priority, index, array) {
|
|
return array.indexOf(priority) === index;
|
|
}).map(function(priority) {
|
|
return setters.filter(function(setter2) {
|
|
return setter2.priority === priority;
|
|
}).sort(function(a2, b2) {
|
|
return b2.subPriority - a2.subPriority;
|
|
});
|
|
}).map(function(setterArray) {
|
|
return setterArray[0];
|
|
});
|
|
var date = (0, _index3.default)(dirtyReferenceDate);
|
|
if (isNaN(date.getTime())) {
|
|
return new Date(NaN);
|
|
}
|
|
var utcDate = (0, _index2.default)(date, (0, _index6.default)(date));
|
|
var flags = {};
|
|
var _iterator2 = _createForOfIteratorHelper(uniquePrioritySetters), _step2;
|
|
try {
|
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
|
|
var setter = _step2.value;
|
|
if (!setter.validate(utcDate, subFnOptions)) {
|
|
return new Date(NaN);
|
|
}
|
|
var result = setter.set(utcDate, flags, subFnOptions);
|
|
if (Array.isArray(result)) {
|
|
utcDate = result[0];
|
|
(0, _index4.default)(flags, result[1]);
|
|
} else {
|
|
utcDate = result;
|
|
}
|
|
}
|
|
} catch (err) {
|
|
_iterator2.e(err);
|
|
} finally {
|
|
_iterator2.f();
|
|
}
|
|
return utcDate;
|
|
}
|
|
function cleanEscapedString(input) {
|
|
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/date-fns/parseISO/index.js
|
|
var require_parseISO = __commonJS({
|
|
"node_modules/date-fns/parseISO/index.js"(exports, module2) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = parseISO;
|
|
var _index = require_constants();
|
|
var _index2 = _interopRequireDefault(require_requiredArgs());
|
|
var _index3 = _interopRequireDefault(require_toInteger());
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
function parseISO(argument, options) {
|
|
var _options$additionalDi;
|
|
(0, _index2.default)(1, arguments);
|
|
var additionalDigits = (0, _index3.default)((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
}
|
|
if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
|
|
return new Date(NaN);
|
|
}
|
|
var dateStrings = splitDateString(argument);
|
|
var date;
|
|
if (dateStrings.date) {
|
|
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
}
|
|
if (!date || isNaN(date.getTime())) {
|
|
return new Date(NaN);
|
|
}
|
|
var timestamp = date.getTime();
|
|
var time = 0;
|
|
var offset;
|
|
if (dateStrings.time) {
|
|
time = parseTime(dateStrings.time);
|
|
if (isNaN(time)) {
|
|
return new Date(NaN);
|
|
}
|
|
}
|
|
if (dateStrings.timezone) {
|
|
offset = parseTimezone(dateStrings.timezone);
|
|
if (isNaN(offset)) {
|
|
return new Date(NaN);
|
|
}
|
|
} else {
|
|
var dirtyDate = new Date(timestamp + time);
|
|
var result = new Date(0);
|
|
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
return result;
|
|
}
|
|
return new Date(timestamp + time + offset);
|
|
}
|
|
var patterns = {
|
|
dateTimeDelimiter: /[T ]/,
|
|
timeZoneDelimiter: /[Z ]/i,
|
|
timezone: /([Z+-].*)$/
|
|
};
|
|
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
function splitDateString(dateString) {
|
|
var dateStrings = {};
|
|
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
var timeString;
|
|
if (array.length > 2) {
|
|
return dateStrings;
|
|
}
|
|
if (/:/.test(array[0])) {
|
|
timeString = array[0];
|
|
} else {
|
|
dateStrings.date = array[0];
|
|
timeString = array[1];
|
|
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
}
|
|
}
|
|
if (timeString) {
|
|
var token = patterns.timezone.exec(timeString);
|
|
if (token) {
|
|
dateStrings.time = timeString.replace(token[1], "");
|
|
dateStrings.timezone = token[1];
|
|
} else {
|
|
dateStrings.time = timeString;
|
|
}
|
|
}
|
|
return dateStrings;
|
|
}
|
|
function parseYear(dateString, additionalDigits) {
|
|
var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
|
|
var captures = dateString.match(regex);
|
|
if (!captures)
|
|
return {
|
|
year: NaN,
|
|
restDateString: ""
|
|
};
|
|
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
return {
|
|
year: century === null ? year : century * 100,
|
|
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
};
|
|
}
|
|
function parseDate(dateString, year) {
|
|
if (year === null)
|
|
return new Date(NaN);
|
|
var captures = dateString.match(dateRegex);
|
|
if (!captures)
|
|
return new Date(NaN);
|
|
var isWeekDate = !!captures[4];
|
|
var dayOfYear = parseDateUnit(captures[1]);
|
|
var month = parseDateUnit(captures[2]) - 1;
|
|
var day = parseDateUnit(captures[3]);
|
|
var week = parseDateUnit(captures[4]);
|
|
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
if (isWeekDate) {
|
|
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
return new Date(NaN);
|
|
}
|
|
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
} else {
|
|
var date = new Date(0);
|
|
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
return new Date(NaN);
|
|
}
|
|
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
return date;
|
|
}
|
|
}
|
|
function parseDateUnit(value) {
|
|
return value ? parseInt(value) : 1;
|
|
}
|
|
function parseTime(timeString) {
|
|
var captures = timeString.match(timeRegex);
|
|
if (!captures)
|
|
return NaN;
|
|
var hours = parseTimeUnit(captures[1]);
|
|
var minutes = parseTimeUnit(captures[2]);
|
|
var seconds = parseTimeUnit(captures[3]);
|
|
if (!validateTime(hours, minutes, seconds)) {
|
|
return NaN;
|
|
}
|
|
return hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute + seconds * 1e3;
|
|
}
|
|
function parseTimeUnit(value) {
|
|
return value && parseFloat(value.replace(",", ".")) || 0;
|
|
}
|
|
function parseTimezone(timezoneString) {
|
|
if (timezoneString === "Z")
|
|
return 0;
|
|
var captures = timezoneString.match(timezoneRegex);
|
|
if (!captures)
|
|
return 0;
|
|
var sign = captures[1] === "+" ? -1 : 1;
|
|
var hours = parseInt(captures[2]);
|
|
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
if (!validateTimezone(hours, minutes)) {
|
|
return NaN;
|
|
}
|
|
return sign * (hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute);
|
|
}
|
|
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
var date = new Date(0);
|
|
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
date.setUTCDate(date.getUTCDate() + diff);
|
|
return date;
|
|
}
|
|
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
function isLeapYearIndex(year) {
|
|
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
}
|
|
function validateDate(year, month, date) {
|
|
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
}
|
|
function validateDayOfYearDate(year, dayOfYear) {
|
|
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
}
|
|
function validateWeekDate(_year, week, day) {
|
|
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
}
|
|
function validateTime(hours, minutes, seconds) {
|
|
if (hours === 24) {
|
|
return minutes === 0 && seconds === 0;
|
|
}
|
|
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
}
|
|
function validateTimezone(_hours, minutes) {
|
|
return minutes >= 0 && minutes <= 59;
|
|
}
|
|
module2.exports = exports.default;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-onclickoutside/dist/react-onclickoutside.cjs.js
|
|
var require_react_onclickoutside_cjs = __commonJS({
|
|
"node_modules/react-onclickoutside/dist/react-onclickoutside.cjs.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var react = require_react();
|
|
var reactDom = require_react_dom();
|
|
function _inheritsLoose(subClass, superClass) {
|
|
subClass.prototype = Object.create(superClass.prototype);
|
|
subClass.prototype.constructor = subClass;
|
|
_setPrototypeOf(subClass, superClass);
|
|
}
|
|
function _setPrototypeOf(o2, p2) {
|
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p3) {
|
|
o3.__proto__ = p3;
|
|
return o3;
|
|
};
|
|
return _setPrototypeOf(o2, p2);
|
|
}
|
|
function _objectWithoutPropertiesLoose2(source, excluded) {
|
|
if (source == null)
|
|
return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i2;
|
|
for (i2 = 0; i2 < sourceKeys.length; i2++) {
|
|
key = sourceKeys[i2];
|
|
if (excluded.indexOf(key) >= 0)
|
|
continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
function _assertThisInitialized(self2) {
|
|
if (self2 === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
return self2;
|
|
}
|
|
function isNodeFound(current, componentNode, ignoreClass) {
|
|
if (current === componentNode) {
|
|
return true;
|
|
}
|
|
if (current.correspondingElement) {
|
|
return current.correspondingElement.classList.contains(ignoreClass);
|
|
}
|
|
return current.classList.contains(ignoreClass);
|
|
}
|
|
function findHighest(current, componentNode, ignoreClass) {
|
|
if (current === componentNode) {
|
|
return true;
|
|
}
|
|
while (current.parentNode || current.host) {
|
|
if (current.parentNode && isNodeFound(current, componentNode, ignoreClass)) {
|
|
return true;
|
|
}
|
|
current = current.parentNode || current.host;
|
|
}
|
|
return current;
|
|
}
|
|
function clickedScrollbar(evt) {
|
|
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
|
|
}
|
|
var testPassiveEventSupport = function testPassiveEventSupport2() {
|
|
if (typeof window === "undefined" || typeof window.addEventListener !== "function") {
|
|
return;
|
|
}
|
|
var passive = false;
|
|
var options = Object.defineProperty({}, "passive", {
|
|
get: function get() {
|
|
passive = true;
|
|
}
|
|
});
|
|
var noop = function noop2() {
|
|
};
|
|
window.addEventListener("testPassiveEventSupport", noop, options);
|
|
window.removeEventListener("testPassiveEventSupport", noop, options);
|
|
return passive;
|
|
};
|
|
function autoInc(seed) {
|
|
if (seed === void 0) {
|
|
seed = 0;
|
|
}
|
|
return function() {
|
|
return ++seed;
|
|
};
|
|
}
|
|
var uid = autoInc();
|
|
var passiveEventSupport;
|
|
var handlersMap = {};
|
|
var enabledInstances = {};
|
|
var touchEvents = ["touchstart", "touchmove"];
|
|
var IGNORE_CLASS_NAME = "ignore-react-onclickoutside";
|
|
function getEventHandlerOptions(instance, eventName) {
|
|
var handlerOptions = null;
|
|
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
|
|
if (isTouchEvent && passiveEventSupport) {
|
|
handlerOptions = {
|
|
passive: !instance.props.preventDefault
|
|
};
|
|
}
|
|
return handlerOptions;
|
|
}
|
|
function onClickOutsideHOC(WrappedComponent, config) {
|
|
var _class, _temp;
|
|
var componentName = WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
return _temp = _class = /* @__PURE__ */ function(_Component) {
|
|
_inheritsLoose(onClickOutside, _Component);
|
|
function onClickOutside(props) {
|
|
var _this;
|
|
_this = _Component.call(this, props) || this;
|
|
_this.__outsideClickHandler = function(event) {
|
|
if (typeof _this.__clickOutsideHandlerProp === "function") {
|
|
_this.__clickOutsideHandlerProp(event);
|
|
return;
|
|
}
|
|
var instance = _this.getInstance();
|
|
if (typeof instance.props.handleClickOutside === "function") {
|
|
instance.props.handleClickOutside(event);
|
|
return;
|
|
}
|
|
if (typeof instance.handleClickOutside === "function") {
|
|
instance.handleClickOutside(event);
|
|
return;
|
|
}
|
|
throw new Error("WrappedComponent: " + componentName + " lacks a handleClickOutside(event) function for processing outside click events.");
|
|
};
|
|
_this.__getComponentNode = function() {
|
|
var instance = _this.getInstance();
|
|
if (config && typeof config.setClickOutsideRef === "function") {
|
|
return config.setClickOutsideRef()(instance);
|
|
}
|
|
if (typeof instance.setClickOutsideRef === "function") {
|
|
return instance.setClickOutsideRef();
|
|
}
|
|
return reactDom.findDOMNode(instance);
|
|
};
|
|
_this.enableOnClickOutside = function() {
|
|
if (typeof document === "undefined" || enabledInstances[_this._uid]) {
|
|
return;
|
|
}
|
|
if (typeof passiveEventSupport === "undefined") {
|
|
passiveEventSupport = testPassiveEventSupport();
|
|
}
|
|
enabledInstances[_this._uid] = true;
|
|
var events = _this.props.eventTypes;
|
|
if (!events.forEach) {
|
|
events = [events];
|
|
}
|
|
handlersMap[_this._uid] = function(event) {
|
|
if (_this.componentNode === null)
|
|
return;
|
|
if (_this.props.preventDefault) {
|
|
event.preventDefault();
|
|
}
|
|
if (_this.props.stopPropagation) {
|
|
event.stopPropagation();
|
|
}
|
|
if (_this.props.excludeScrollbar && clickedScrollbar(event))
|
|
return;
|
|
var current = event.composed && event.composedPath && event.composedPath().shift() || event.target;
|
|
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
|
|
return;
|
|
}
|
|
_this.__outsideClickHandler(event);
|
|
};
|
|
events.forEach(function(eventName) {
|
|
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
});
|
|
};
|
|
_this.disableOnClickOutside = function() {
|
|
delete enabledInstances[_this._uid];
|
|
var fn2 = handlersMap[_this._uid];
|
|
if (fn2 && typeof document !== "undefined") {
|
|
var events = _this.props.eventTypes;
|
|
if (!events.forEach) {
|
|
events = [events];
|
|
}
|
|
events.forEach(function(eventName) {
|
|
return document.removeEventListener(eventName, fn2, getEventHandlerOptions(_assertThisInitialized(_this), eventName));
|
|
});
|
|
delete handlersMap[_this._uid];
|
|
}
|
|
};
|
|
_this.getRef = function(ref) {
|
|
return _this.instanceRef = ref;
|
|
};
|
|
_this._uid = uid();
|
|
return _this;
|
|
}
|
|
var _proto = onClickOutside.prototype;
|
|
_proto.getInstance = function getInstance() {
|
|
if (WrappedComponent.prototype && !WrappedComponent.prototype.isReactComponent) {
|
|
return this;
|
|
}
|
|
var ref = this.instanceRef;
|
|
return ref.getInstance ? ref.getInstance() : ref;
|
|
};
|
|
_proto.componentDidMount = function componentDidMount() {
|
|
if (typeof document === "undefined" || !document.createElement) {
|
|
return;
|
|
}
|
|
var instance = this.getInstance();
|
|
if (config && typeof config.handleClickOutside === "function") {
|
|
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
|
|
if (typeof this.__clickOutsideHandlerProp !== "function") {
|
|
throw new Error("WrappedComponent: " + componentName + " lacks a function for processing outside click events specified by the handleClickOutside config option.");
|
|
}
|
|
}
|
|
this.componentNode = this.__getComponentNode();
|
|
if (this.props.disableOnClickOutside)
|
|
return;
|
|
this.enableOnClickOutside();
|
|
};
|
|
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
this.componentNode = this.__getComponentNode();
|
|
};
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
this.disableOnClickOutside();
|
|
};
|
|
_proto.render = function render() {
|
|
var _this$props = this.props;
|
|
_this$props.excludeScrollbar;
|
|
var props = _objectWithoutPropertiesLoose2(_this$props, ["excludeScrollbar"]);
|
|
if (WrappedComponent.prototype && WrappedComponent.prototype.isReactComponent) {
|
|
props.ref = this.getRef;
|
|
} else {
|
|
props.wrappedRef = this.getRef;
|
|
}
|
|
props.disableOnClickOutside = this.disableOnClickOutside;
|
|
props.enableOnClickOutside = this.enableOnClickOutside;
|
|
return react.createElement(WrappedComponent, props);
|
|
};
|
|
return onClickOutside;
|
|
}(react.Component), _class.displayName = "OnClickOutside(" + componentName + ")", _class.defaultProps = {
|
|
eventTypes: ["mousedown", "touchstart"],
|
|
excludeScrollbar: config && config.excludeScrollbar || false,
|
|
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
|
|
preventDefault: false,
|
|
stopPropagation: false
|
|
}, _class.getClass = function() {
|
|
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
|
|
}, _temp;
|
|
}
|
|
exports.IGNORE_CLASS_NAME = IGNORE_CLASS_NAME;
|
|
exports.default = onClickOutsideHOC;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Manager.js
|
|
var require_Manager = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Manager.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Manager = Manager;
|
|
exports.ManagerReferenceNodeSetterContext = exports.ManagerReferenceNodeContext = void 0;
|
|
var React11 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var ManagerReferenceNodeContext = React11.createContext();
|
|
exports.ManagerReferenceNodeContext = ManagerReferenceNodeContext;
|
|
var ManagerReferenceNodeSetterContext = React11.createContext();
|
|
exports.ManagerReferenceNodeSetterContext = ManagerReferenceNodeSetterContext;
|
|
function Manager(_ref) {
|
|
var children = _ref.children;
|
|
var _React$useState = React11.useState(null), referenceNode = _React$useState[0], setReferenceNode = _React$useState[1];
|
|
var hasUnmounted = React11.useRef(false);
|
|
React11.useEffect(function() {
|
|
return function() {
|
|
hasUnmounted.current = true;
|
|
};
|
|
}, []);
|
|
var handleSetReferenceNode = React11.useCallback(function(node) {
|
|
if (!hasUnmounted.current) {
|
|
setReferenceNode(node);
|
|
}
|
|
}, []);
|
|
return /* @__PURE__ */ React11.createElement(ManagerReferenceNodeContext.Provider, {
|
|
value: referenceNode
|
|
}, /* @__PURE__ */ React11.createElement(ManagerReferenceNodeSetterContext.Provider, {
|
|
value: handleSetReferenceNode
|
|
}, children));
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/utils.js
|
|
var require_utils3 = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/utils.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.useIsomorphicLayoutEffect = exports.fromEntries = exports.setRef = exports.safeInvoke = exports.unwrapArray = void 0;
|
|
var React11 = _interopRequireWildcard(require_react());
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var unwrapArray = function unwrapArray2(arg) {
|
|
return Array.isArray(arg) ? arg[0] : arg;
|
|
};
|
|
exports.unwrapArray = unwrapArray;
|
|
var safeInvoke = function safeInvoke2(fn2) {
|
|
if (typeof fn2 === "function") {
|
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
args[_key - 1] = arguments[_key];
|
|
}
|
|
return fn2.apply(void 0, args);
|
|
}
|
|
};
|
|
exports.safeInvoke = safeInvoke;
|
|
var setRef = function setRef2(ref, node) {
|
|
if (typeof ref === "function") {
|
|
return safeInvoke(ref, node);
|
|
} else if (ref != null) {
|
|
ref.current = node;
|
|
}
|
|
};
|
|
exports.setRef = setRef;
|
|
var fromEntries = function fromEntries2(entries) {
|
|
return entries.reduce(function(acc, _ref) {
|
|
var key = _ref[0], value = _ref[1];
|
|
acc[key] = value;
|
|
return acc;
|
|
}, {});
|
|
};
|
|
exports.fromEntries = fromEntries;
|
|
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" && window.document && window.document.createElement ? React11.useLayoutEffect : React11.useEffect;
|
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect2;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-fast-compare/index.js
|
|
var require_react_fast_compare = __commonJS({
|
|
"node_modules/react-fast-compare/index.js"(exports, module2) {
|
|
var hasElementType = typeof Element !== "undefined";
|
|
var hasMap = typeof Map === "function";
|
|
var hasSet = typeof Set === "function";
|
|
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
|
|
function equal(a2, b2) {
|
|
if (a2 === b2)
|
|
return true;
|
|
if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
|
|
if (a2.constructor !== b2.constructor)
|
|
return false;
|
|
var length, i2, keys;
|
|
if (Array.isArray(a2)) {
|
|
length = a2.length;
|
|
if (length != b2.length)
|
|
return false;
|
|
for (i2 = length; i2-- !== 0; )
|
|
if (!equal(a2[i2], b2[i2]))
|
|
return false;
|
|
return true;
|
|
}
|
|
var it;
|
|
if (hasMap && a2 instanceof Map && b2 instanceof Map) {
|
|
if (a2.size !== b2.size)
|
|
return false;
|
|
it = a2.entries();
|
|
while (!(i2 = it.next()).done)
|
|
if (!b2.has(i2.value[0]))
|
|
return false;
|
|
it = a2.entries();
|
|
while (!(i2 = it.next()).done)
|
|
if (!equal(i2.value[1], b2.get(i2.value[0])))
|
|
return false;
|
|
return true;
|
|
}
|
|
if (hasSet && a2 instanceof Set && b2 instanceof Set) {
|
|
if (a2.size !== b2.size)
|
|
return false;
|
|
it = a2.entries();
|
|
while (!(i2 = it.next()).done)
|
|
if (!b2.has(i2.value[0]))
|
|
return false;
|
|
return true;
|
|
}
|
|
if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
|
|
length = a2.length;
|
|
if (length != b2.length)
|
|
return false;
|
|
for (i2 = length; i2-- !== 0; )
|
|
if (a2[i2] !== b2[i2])
|
|
return false;
|
|
return true;
|
|
}
|
|
if (a2.constructor === RegExp)
|
|
return a2.source === b2.source && a2.flags === b2.flags;
|
|
if (a2.valueOf !== Object.prototype.valueOf)
|
|
return a2.valueOf() === b2.valueOf();
|
|
if (a2.toString !== Object.prototype.toString)
|
|
return a2.toString() === b2.toString();
|
|
keys = Object.keys(a2);
|
|
length = keys.length;
|
|
if (length !== Object.keys(b2).length)
|
|
return false;
|
|
for (i2 = length; i2-- !== 0; )
|
|
if (!Object.prototype.hasOwnProperty.call(b2, keys[i2]))
|
|
return false;
|
|
if (hasElementType && a2 instanceof Element)
|
|
return false;
|
|
for (i2 = length; i2-- !== 0; ) {
|
|
if ((keys[i2] === "_owner" || keys[i2] === "__v" || keys[i2] === "__o") && a2.$$typeof) {
|
|
continue;
|
|
}
|
|
if (!equal(a2[keys[i2]], b2[keys[i2]]))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
return a2 !== a2 && b2 !== b2;
|
|
}
|
|
module2.exports = function isEqual(a2, b2) {
|
|
try {
|
|
return equal(a2, b2);
|
|
} catch (error) {
|
|
if ((error.message || "").match(/stack|recursion/i)) {
|
|
console.warn("react-fast-compare cannot handle circular refs");
|
|
return false;
|
|
}
|
|
throw error;
|
|
}
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/usePopper.js
|
|
var require_usePopper = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/usePopper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.usePopper = void 0;
|
|
var React11 = _interopRequireWildcard(require_react());
|
|
var ReactDOM2 = _interopRequireWildcard(require_react_dom());
|
|
var _core = require_popper();
|
|
var _reactFastCompare = _interopRequireDefault(require_react_fast_compare());
|
|
var _utils = require_utils3();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var EMPTY_MODIFIERS = [];
|
|
var usePopper = function usePopper2(referenceElement, popperElement, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var prevOptions = React11.useRef(null);
|
|
var optionsWithDefaults = {
|
|
onFirstUpdate: options.onFirstUpdate,
|
|
placement: options.placement || "bottom",
|
|
strategy: options.strategy || "absolute",
|
|
modifiers: options.modifiers || EMPTY_MODIFIERS
|
|
};
|
|
var _React$useState = React11.useState({
|
|
styles: {
|
|
popper: {
|
|
position: optionsWithDefaults.strategy,
|
|
left: "0",
|
|
top: "0"
|
|
},
|
|
arrow: {
|
|
position: "absolute"
|
|
}
|
|
},
|
|
attributes: {}
|
|
}), state = _React$useState[0], setState = _React$useState[1];
|
|
var updateStateModifier = React11.useMemo(function() {
|
|
return {
|
|
name: "updateState",
|
|
enabled: true,
|
|
phase: "write",
|
|
fn: function fn2(_ref) {
|
|
var state2 = _ref.state;
|
|
var elements = Object.keys(state2.elements);
|
|
ReactDOM2.flushSync(function() {
|
|
setState({
|
|
styles: (0, _utils.fromEntries)(elements.map(function(element) {
|
|
return [element, state2.styles[element] || {}];
|
|
})),
|
|
attributes: (0, _utils.fromEntries)(elements.map(function(element) {
|
|
return [element, state2.attributes[element]];
|
|
}))
|
|
});
|
|
});
|
|
},
|
|
requires: ["computeStyles"]
|
|
};
|
|
}, []);
|
|
var popperOptions = React11.useMemo(function() {
|
|
var newOptions = {
|
|
onFirstUpdate: optionsWithDefaults.onFirstUpdate,
|
|
placement: optionsWithDefaults.placement,
|
|
strategy: optionsWithDefaults.strategy,
|
|
modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
|
|
name: "applyStyles",
|
|
enabled: false
|
|
}])
|
|
};
|
|
if ((0, _reactFastCompare["default"])(prevOptions.current, newOptions)) {
|
|
return prevOptions.current || newOptions;
|
|
} else {
|
|
prevOptions.current = newOptions;
|
|
return newOptions;
|
|
}
|
|
}, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
|
|
var popperInstanceRef = React11.useRef();
|
|
(0, _utils.useIsomorphicLayoutEffect)(function() {
|
|
if (popperInstanceRef.current) {
|
|
popperInstanceRef.current.setOptions(popperOptions);
|
|
}
|
|
}, [popperOptions]);
|
|
(0, _utils.useIsomorphicLayoutEffect)(function() {
|
|
if (referenceElement == null || popperElement == null) {
|
|
return;
|
|
}
|
|
var createPopper = options.createPopper || _core.createPopper;
|
|
var popperInstance = createPopper(referenceElement, popperElement, popperOptions);
|
|
popperInstanceRef.current = popperInstance;
|
|
return function() {
|
|
popperInstance.destroy();
|
|
popperInstanceRef.current = null;
|
|
};
|
|
}, [referenceElement, popperElement, options.createPopper]);
|
|
return {
|
|
state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
|
|
styles: state.styles,
|
|
attributes: state.attributes,
|
|
update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
|
|
forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
|
|
};
|
|
};
|
|
exports.usePopper = usePopper;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Popper.js
|
|
var require_Popper = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Popper.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Popper = Popper;
|
|
var React11 = _interopRequireWildcard(require_react());
|
|
var _Manager = require_Manager();
|
|
var _utils = require_utils3();
|
|
var _usePopper2 = require_usePopper();
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
var NOOP = function NOOP2() {
|
|
return void 0;
|
|
};
|
|
var NOOP_PROMISE = function NOOP_PROMISE2() {
|
|
return Promise.resolve(null);
|
|
};
|
|
var EMPTY_MODIFIERS = [];
|
|
function Popper(_ref) {
|
|
var _ref$placement = _ref.placement, placement = _ref$placement === void 0 ? "bottom" : _ref$placement, _ref$strategy = _ref.strategy, strategy = _ref$strategy === void 0 ? "absolute" : _ref$strategy, _ref$modifiers = _ref.modifiers, modifiers = _ref$modifiers === void 0 ? EMPTY_MODIFIERS : _ref$modifiers, referenceElement = _ref.referenceElement, onFirstUpdate = _ref.onFirstUpdate, innerRef = _ref.innerRef, children = _ref.children;
|
|
var referenceNode = React11.useContext(_Manager.ManagerReferenceNodeContext);
|
|
var _React$useState = React11.useState(null), popperElement = _React$useState[0], setPopperElement = _React$useState[1];
|
|
var _React$useState2 = React11.useState(null), arrowElement = _React$useState2[0], setArrowElement = _React$useState2[1];
|
|
React11.useEffect(function() {
|
|
(0, _utils.setRef)(innerRef, popperElement);
|
|
}, [innerRef, popperElement]);
|
|
var options = React11.useMemo(function() {
|
|
return {
|
|
placement,
|
|
strategy,
|
|
onFirstUpdate,
|
|
modifiers: [].concat(modifiers, [{
|
|
name: "arrow",
|
|
enabled: arrowElement != null,
|
|
options: {
|
|
element: arrowElement
|
|
}
|
|
}])
|
|
};
|
|
}, [placement, strategy, onFirstUpdate, modifiers, arrowElement]);
|
|
var _usePopper = (0, _usePopper2.usePopper)(referenceElement || referenceNode, popperElement, options), state = _usePopper.state, styles = _usePopper.styles, forceUpdate = _usePopper.forceUpdate, update = _usePopper.update;
|
|
var childrenProps = React11.useMemo(function() {
|
|
return {
|
|
ref: setPopperElement,
|
|
style: styles.popper,
|
|
placement: state ? state.placement : placement,
|
|
hasPopperEscaped: state && state.modifiersData.hide ? state.modifiersData.hide.hasPopperEscaped : null,
|
|
isReferenceHidden: state && state.modifiersData.hide ? state.modifiersData.hide.isReferenceHidden : null,
|
|
arrowProps: {
|
|
style: styles.arrow,
|
|
ref: setArrowElement
|
|
},
|
|
forceUpdate: forceUpdate || NOOP,
|
|
update: update || NOOP_PROMISE
|
|
};
|
|
}, [setPopperElement, setArrowElement, placement, state, styles, update, forceUpdate]);
|
|
return (0, _utils.unwrapArray)(children)(childrenProps);
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/warning/warning.js
|
|
var require_warning = __commonJS({
|
|
"node_modules/warning/warning.js"(exports, module2) {
|
|
"use strict";
|
|
var __DEV__ = true;
|
|
var warning3 = function() {
|
|
};
|
|
if (__DEV__) {
|
|
printWarning = function printWarning2(format, args) {
|
|
var len = arguments.length;
|
|
args = new Array(len > 1 ? len - 1 : 0);
|
|
for (var key = 1; key < len; key++) {
|
|
args[key - 1] = arguments[key];
|
|
}
|
|
var argIndex = 0;
|
|
var message = "Warning: " + format.replace(/%s/g, function() {
|
|
return args[argIndex++];
|
|
});
|
|
if (typeof console !== "undefined") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (x2) {
|
|
}
|
|
};
|
|
warning3 = function(condition, format, args) {
|
|
var len = arguments.length;
|
|
args = new Array(len > 2 ? len - 2 : 0);
|
|
for (var key = 2; key < len; key++) {
|
|
args[key - 2] = arguments[key];
|
|
}
|
|
if (format === void 0) {
|
|
throw new Error(
|
|
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
);
|
|
}
|
|
if (!condition) {
|
|
printWarning.apply(null, [format].concat(args));
|
|
}
|
|
};
|
|
}
|
|
var printWarning;
|
|
module2.exports = warning3;
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/Reference.js
|
|
var require_Reference = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/Reference.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.Reference = Reference;
|
|
var React11 = _interopRequireWildcard(require_react());
|
|
var _warning = _interopRequireDefault(require_warning());
|
|
var _Manager = require_Manager();
|
|
var _utils = require_utils3();
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
}
|
|
function _getRequireWildcardCache() {
|
|
if (typeof WeakMap !== "function")
|
|
return null;
|
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
_getRequireWildcardCache = function _getRequireWildcardCache2() {
|
|
return cache;
|
|
};
|
|
return cache;
|
|
}
|
|
function _interopRequireWildcard(obj) {
|
|
if (obj && obj.__esModule) {
|
|
return obj;
|
|
}
|
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
return { "default": obj };
|
|
}
|
|
var cache = _getRequireWildcardCache();
|
|
if (cache && cache.has(obj)) {
|
|
return cache.get(obj);
|
|
}
|
|
var newObj = {};
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
for (var key in obj) {
|
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
if (desc && (desc.get || desc.set)) {
|
|
Object.defineProperty(newObj, key, desc);
|
|
} else {
|
|
newObj[key] = obj[key];
|
|
}
|
|
}
|
|
}
|
|
newObj["default"] = obj;
|
|
if (cache) {
|
|
cache.set(obj, newObj);
|
|
}
|
|
return newObj;
|
|
}
|
|
function Reference(_ref) {
|
|
var children = _ref.children, innerRef = _ref.innerRef;
|
|
var setReferenceNode = React11.useContext(_Manager.ManagerReferenceNodeSetterContext);
|
|
var refHandler = React11.useCallback(function(node) {
|
|
(0, _utils.setRef)(innerRef, node);
|
|
(0, _utils.safeInvoke)(setReferenceNode, node);
|
|
}, [innerRef, setReferenceNode]);
|
|
React11.useEffect(function() {
|
|
return function() {
|
|
return (0, _utils.setRef)(innerRef, null);
|
|
};
|
|
}, []);
|
|
React11.useEffect(function() {
|
|
(0, _warning["default"])(Boolean(setReferenceNode), "`Reference` should not be used outside of a `Manager` component.");
|
|
}, [setReferenceNode]);
|
|
return (0, _utils.unwrapArray)(children)({
|
|
ref: refHandler
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
// node_modules/react-popper/lib/cjs/index.js
|
|
var require_cjs2 = __commonJS({
|
|
"node_modules/react-popper/lib/cjs/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "Popper", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Popper.Popper;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Manager", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Manager.Manager;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "Reference", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _Reference.Reference;
|
|
}
|
|
});
|
|
Object.defineProperty(exports, "usePopper", {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _usePopper.usePopper;
|
|
}
|
|
});
|
|
var _Popper = require_Popper();
|
|
var _Manager = require_Manager();
|
|
var _Reference = require_Reference();
|
|
var _usePopper = require_usePopper();
|
|
}
|
|
});
|
|
|
|
// node_modules/react-datepicker/dist/react-datepicker.min.js
|
|
var require_react_datepicker_min = __commonJS({
|
|
"node_modules/react-datepicker/dist/react-datepicker.min.js"(exports, module2) {
|
|
!function(e, t2) {
|
|
"object" == typeof exports && "undefined" != typeof module2 ? t2(exports, require_react(), require_prop_types(), require_classnames(), require_isDate(), require_isValid(), require_format2(), require_addMinutes(), require_addHours(), require_addDays(), require_addWeeks(), require_addMonths(), require_addYears(), require_subMinutes(), require_subHours(), require_subDays(), require_subWeeks(), require_subMonths(), require_subYears(), require_getSeconds(), require_getMinutes(), require_getHours(), require_getDay(), require_getDate(), require_getISOWeek(), require_getMonth(), require_getQuarter(), require_getYear(), require_getTime(), require_setSeconds(), require_setMinutes(), require_setHours(), require_setMonth(), require_setQuarter(), require_setYear(), require_min(), require_max(), require_differenceInCalendarDays(), require_differenceInCalendarMonths(), require_differenceInCalendarWeeks(), require_differenceInCalendarYears(), require_startOfDay(), require_startOfWeek(), require_startOfMonth(), require_startOfQuarter(), require_startOfYear(), require_endOfDay(), require_endOfWeek(), require_endOfMonth(), require_isEqual(), require_isSameDay(), require_isSameMonth(), require_isSameYear(), require_isSameQuarter(), require_isAfter(), require_isBefore(), require_isWithinInterval(), require_toDate(), require_parse2(), require_parseISO(), require_react_onclickoutside_cjs(), require_react_dom(), require_cjs2()) : "function" == typeof define && define.amd ? define(["exports", "react", "prop-types", "classnames", "date-fns/isDate", "date-fns/isValid", "date-fns/format", "date-fns/addMinutes", "date-fns/addHours", "date-fns/addDays", "date-fns/addWeeks", "date-fns/addMonths", "date-fns/addYears", "date-fns/subMinutes", "date-fns/subHours", "date-fns/subDays", "date-fns/subWeeks", "date-fns/subMonths", "date-fns/subYears", "date-fns/getSeconds", "date-fns/getMinutes", "date-fns/getHours", "date-fns/getDay", "date-fns/getDate", "date-fns/getISOWeek", "date-fns/getMonth", "date-fns/getQuarter", "date-fns/getYear", "date-fns/getTime", "date-fns/setSeconds", "date-fns/setMinutes", "date-fns/setHours", "date-fns/setMonth", "date-fns/setQuarter", "date-fns/setYear", "date-fns/min", "date-fns/max", "date-fns/differenceInCalendarDays", "date-fns/differenceInCalendarMonths", "date-fns/differenceInCalendarWeeks", "date-fns/differenceInCalendarYears", "date-fns/startOfDay", "date-fns/startOfWeek", "date-fns/startOfMonth", "date-fns/startOfQuarter", "date-fns/startOfYear", "date-fns/endOfDay", "date-fns/endOfWeek", "date-fns/endOfMonth", "date-fns/isEqual", "date-fns/isSameDay", "date-fns/isSameMonth", "date-fns/isSameYear", "date-fns/isSameQuarter", "date-fns/isAfter", "date-fns/isBefore", "date-fns/isWithinInterval", "date-fns/toDate", "date-fns/parse", "date-fns/parseISO", "react-onclickoutside", "react-dom", "react-popper"], t2) : t2((e = "undefined" != typeof globalThis ? globalThis : e || self).DatePicker = {}, e.React, e.PropTypes, e.classNames, e.isDate, e.isValidDate, e.format, e.addMinutes, e.addHours, e.addDays, e.addWeeks, e.addMonths, e.addYears, null, null, e.subDays, e.subWeeks, e.subMonths, e.subYears, e.getSeconds, e.getMinutes, e.getHours, e.getDay, e.getDate, e.getISOWeek, e.getMonth, e.getQuarter, e.getYear, e.getTime, e.setSeconds, e.setMinutes, e.setHours, e.setMonth, e.setQuarter, e.setYear, e.min, e.max, e.differenceInCalendarDays, e.differenceInCalendarMonths, null, e.differenceInCalendarYears, e.startOfDay, e.startOfWeek, e.startOfMonth, e.startOfQuarter, e.startOfYear, e.endOfDay, null, null, e.dfIsEqual, e.dfIsSameDay, e.dfIsSameMonth, e.dfIsSameYear, e.dfIsSameQuarter, e.isAfter, e.isBefore, e.isWithinInterval, e.toDate, e.parse, e.parseISO, e.onClickOutside, e.ReactDOM, e.ReactPopper);
|
|
}(exports, function(e, t2, r3, a2, n2, o2, s2, i2, p2, l2, d2, c2, u2, f2, h2, m2, y2, D2, v2, w2, g2, k2, b2, S2, C, _3, M2, P2, E2, N2, x2, O2, Y2, I2, T, L2, R2, F2, A2, q2, W2, B2, K, H2, j2, Q2, V, U2, $, z2, G2, J, X2, Z2, ee, te, re, ae, ne, oe, se, ie, pe) {
|
|
"use strict";
|
|
function le(e2) {
|
|
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
|
}
|
|
var de = le(t2), ce = le(a2), ue = le(n2), fe = le(o2), he = le(s2), me = le(i2), ye = le(p2), De = le(l2), ve = le(d2), we = le(c2), ge = le(u2), ke = le(m2), be = le(y2), Se = le(D2), Ce = le(v2), _e = le(w2), Me = le(g2), Pe = le(k2), Ee = le(b2), Ne = le(S2), xe = le(C), Oe = le(_3), Ye = le(M2), Ie = le(P2), Te = le(E2), Le = le(N2), Re = le(x2), Fe = le(O2), Ae = le(Y2), qe = le(I2), We = le(T), Be = le(L2), Ke = le(R2), He = le(F2), je = le(A2), Qe = le(W2), Ve = le(B2), Ue = le(K), $e = le(H2), ze = le(j2), Ge = le(Q2), Je = le(V), Xe = le(z2), Ze = le(G2), et = le(J), tt = le(X2), rt = le(Z2), at = le(ee), nt = le(te), ot = le(re), st = le(ae), it = le(ne), pt = le(oe), lt = le(se), dt = le(ie);
|
|
function ct(e2, t3) {
|
|
var r4 = Object.keys(e2);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var a3 = Object.getOwnPropertySymbols(e2);
|
|
t3 && (a3 = a3.filter(function(t4) {
|
|
return Object.getOwnPropertyDescriptor(e2, t4).enumerable;
|
|
})), r4.push.apply(r4, a3);
|
|
}
|
|
return r4;
|
|
}
|
|
function ut(e2) {
|
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
var r4 = null != arguments[t3] ? arguments[t3] : {};
|
|
t3 % 2 ? ct(Object(r4), true).forEach(function(t4) {
|
|
Dt(e2, t4, r4[t4]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(r4)) : ct(Object(r4)).forEach(function(t4) {
|
|
Object.defineProperty(e2, t4, Object.getOwnPropertyDescriptor(r4, t4));
|
|
});
|
|
}
|
|
return e2;
|
|
}
|
|
function ft(e2) {
|
|
return (ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
|
|
return typeof e3;
|
|
} : function(e3) {
|
|
return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
|
|
})(e2);
|
|
}
|
|
function ht(e2, t3) {
|
|
if (!(e2 instanceof t3))
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
function mt(e2, t3) {
|
|
for (var r4 = 0; r4 < t3.length; r4++) {
|
|
var a3 = t3[r4];
|
|
a3.enumerable = a3.enumerable || false, a3.configurable = true, "value" in a3 && (a3.writable = true), Object.defineProperty(e2, a3.key, a3);
|
|
}
|
|
}
|
|
function yt(e2, t3, r4) {
|
|
return t3 && mt(e2.prototype, t3), r4 && mt(e2, r4), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
}
|
|
function Dt(e2, t3, r4) {
|
|
return t3 in e2 ? Object.defineProperty(e2, t3, { value: r4, enumerable: true, configurable: true, writable: true }) : e2[t3] = r4, e2;
|
|
}
|
|
function vt() {
|
|
return (vt = Object.assign || function(e2) {
|
|
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
var r4 = arguments[t3];
|
|
for (var a3 in r4)
|
|
Object.prototype.hasOwnProperty.call(r4, a3) && (e2[a3] = r4[a3]);
|
|
}
|
|
return e2;
|
|
}).apply(this, arguments);
|
|
}
|
|
function wt(e2, t3) {
|
|
if ("function" != typeof t3 && null !== t3)
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
Object.defineProperty(e2, "prototype", { value: Object.create(t3 && t3.prototype, { constructor: { value: e2, writable: true, configurable: true } }), writable: false }), t3 && kt(e2, t3);
|
|
}
|
|
function gt(e2) {
|
|
return (gt = Object.setPrototypeOf ? Object.getPrototypeOf : function(e3) {
|
|
return e3.__proto__ || Object.getPrototypeOf(e3);
|
|
})(e2);
|
|
}
|
|
function kt(e2, t3) {
|
|
return (kt = Object.setPrototypeOf || function(e3, t4) {
|
|
return e3.__proto__ = t4, e3;
|
|
})(e2, t3);
|
|
}
|
|
function bt(e2) {
|
|
if (void 0 === e2)
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
return e2;
|
|
}
|
|
function St(e2, t3) {
|
|
if (t3 && ("object" == typeof t3 || "function" == typeof t3))
|
|
return t3;
|
|
if (void 0 !== t3)
|
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
return bt(e2);
|
|
}
|
|
function Ct(e2) {
|
|
var t3 = function() {
|
|
if ("undefined" == typeof Reflect || !Reflect.construct)
|
|
return false;
|
|
if (Reflect.construct.sham)
|
|
return false;
|
|
if ("function" == typeof Proxy)
|
|
return true;
|
|
try {
|
|
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
})), true;
|
|
} catch (e3) {
|
|
return false;
|
|
}
|
|
}();
|
|
return function() {
|
|
var r4, a3 = gt(e2);
|
|
if (t3) {
|
|
var n3 = gt(this).constructor;
|
|
r4 = Reflect.construct(a3, arguments, n3);
|
|
} else
|
|
r4 = a3.apply(this, arguments);
|
|
return St(this, r4);
|
|
};
|
|
}
|
|
function _t(e2) {
|
|
return function(e3) {
|
|
if (Array.isArray(e3))
|
|
return Mt(e3);
|
|
}(e2) || function(e3) {
|
|
if ("undefined" != typeof Symbol && null != e3[Symbol.iterator] || null != e3["@@iterator"])
|
|
return Array.from(e3);
|
|
}(e2) || function(e3, t3) {
|
|
if (!e3)
|
|
return;
|
|
if ("string" == typeof e3)
|
|
return Mt(e3, t3);
|
|
var r4 = Object.prototype.toString.call(e3).slice(8, -1);
|
|
"Object" === r4 && e3.constructor && (r4 = e3.constructor.name);
|
|
if ("Map" === r4 || "Set" === r4)
|
|
return Array.from(e3);
|
|
if ("Arguments" === r4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r4))
|
|
return Mt(e3, t3);
|
|
}(e2) || function() {
|
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
}();
|
|
}
|
|
function Mt(e2, t3) {
|
|
(null == t3 || t3 > e2.length) && (t3 = e2.length);
|
|
for (var r4 = 0, a3 = new Array(t3); r4 < t3; r4++)
|
|
a3[r4] = e2[r4];
|
|
return a3;
|
|
}
|
|
function Pt(e2, t3) {
|
|
switch (e2) {
|
|
case "P":
|
|
return t3.date({ width: "short" });
|
|
case "PP":
|
|
return t3.date({ width: "medium" });
|
|
case "PPP":
|
|
return t3.date({ width: "long" });
|
|
case "PPPP":
|
|
default:
|
|
return t3.date({ width: "full" });
|
|
}
|
|
}
|
|
function Et(e2, t3) {
|
|
switch (e2) {
|
|
case "p":
|
|
return t3.time({ width: "short" });
|
|
case "pp":
|
|
return t3.time({ width: "medium" });
|
|
case "ppp":
|
|
return t3.time({ width: "long" });
|
|
case "pppp":
|
|
default:
|
|
return t3.time({ width: "full" });
|
|
}
|
|
}
|
|
var Nt = { p: Et, P: function(e2, t3) {
|
|
var r4, a3 = e2.match(/(P+)(p+)?/) || [], n3 = a3[1], o3 = a3[2];
|
|
if (!o3)
|
|
return Pt(e2, t3);
|
|
switch (n3) {
|
|
case "P":
|
|
r4 = t3.dateTime({ width: "short" });
|
|
break;
|
|
case "PP":
|
|
r4 = t3.dateTime({ width: "medium" });
|
|
break;
|
|
case "PPP":
|
|
r4 = t3.dateTime({ width: "long" });
|
|
break;
|
|
case "PPPP":
|
|
default:
|
|
r4 = t3.dateTime({ width: "full" });
|
|
}
|
|
return r4.replace("{{date}}", Pt(n3, t3)).replace("{{time}}", Et(o3, t3));
|
|
} }, xt = 12, Ot = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
function Yt(e2) {
|
|
var t3 = e2 ? "string" == typeof e2 || e2 instanceof String ? pt.default(e2) : st.default(e2) : new Date();
|
|
return Tt(t3) ? t3 : null;
|
|
}
|
|
function It(e2, t3, r4, a3, n3) {
|
|
var o3 = null, s3 = Xt(r4) || Xt(Jt()), i3 = true;
|
|
return Array.isArray(t3) ? (t3.forEach(function(t4) {
|
|
var p3 = it.default(e2, t4, new Date(), { locale: s3 });
|
|
a3 && (i3 = Tt(p3, n3) && e2 === Lt(p3, t4, r4)), Tt(p3, n3) && i3 && (o3 = p3);
|
|
}), o3) : (o3 = it.default(e2, t3, new Date(), { locale: s3 }), a3 ? i3 = Tt(o3) && e2 === Lt(o3, t3, r4) : Tt(o3) || (t3 = t3.match(Ot).map(function(e3) {
|
|
var t4 = e3[0];
|
|
return "p" === t4 || "P" === t4 ? s3 ? (0, Nt[t4])(e3, s3.formatLong) : t4 : e3;
|
|
}).join(""), e2.length > 0 && (o3 = it.default(e2, t3.slice(0, e2.length), new Date())), Tt(o3) || (o3 = new Date(e2))), Tt(o3) && i3 ? o3 : null);
|
|
}
|
|
function Tt(e2, t3) {
|
|
return t3 = t3 || new Date("1/1/1000"), fe.default(e2) && !nt.default(e2, t3);
|
|
}
|
|
function Lt(e2, t3, r4) {
|
|
if ("en" === r4)
|
|
return he.default(e2, t3, { awareOfUnicodeTokens: true });
|
|
var a3 = Xt(r4);
|
|
return r4 && !a3 && console.warn('A locale object was not found for the provided string ["'.concat(r4, '"].')), !a3 && Jt() && Xt(Jt()) && (a3 = Xt(Jt())), he.default(e2, t3, { locale: a3 || null, awareOfUnicodeTokens: true });
|
|
}
|
|
function Rt(e2, t3) {
|
|
var r4 = t3.dateFormat, a3 = t3.locale;
|
|
return e2 && Lt(e2, Array.isArray(r4) ? r4[0] : r4, a3) || "";
|
|
}
|
|
function Ft(e2, t3) {
|
|
var r4 = t3.hour, a3 = void 0 === r4 ? 0 : r4, n3 = t3.minute, o3 = void 0 === n3 ? 0 : n3, s3 = t3.second, i3 = void 0 === s3 ? 0 : s3;
|
|
return Fe.default(Re.default(Le.default(e2, i3), o3), a3);
|
|
}
|
|
function At(e2, t3) {
|
|
var r4 = t3 && Xt(t3) || Jt() && Xt(Jt());
|
|
return xe.default(e2, r4 ? { locale: r4 } : null);
|
|
}
|
|
function qt(e2, t3) {
|
|
return Lt(e2, "ddd", t3);
|
|
}
|
|
function Wt(e2) {
|
|
return Ve.default(e2);
|
|
}
|
|
function Bt(e2, t3, r4) {
|
|
var a3 = Xt(t3 || Jt());
|
|
return Ue.default(e2, { locale: a3, weekStartsOn: r4 });
|
|
}
|
|
function Kt(e2) {
|
|
return $e.default(e2);
|
|
}
|
|
function Ht(e2) {
|
|
return Ge.default(e2);
|
|
}
|
|
function jt(e2) {
|
|
return ze.default(e2);
|
|
}
|
|
function Qt(e2, t3) {
|
|
return e2 && t3 ? tt.default(e2, t3) : !e2 && !t3;
|
|
}
|
|
function Vt(e2, t3) {
|
|
return e2 && t3 ? et.default(e2, t3) : !e2 && !t3;
|
|
}
|
|
function Ut(e2, t3) {
|
|
return e2 && t3 ? rt.default(e2, t3) : !e2 && !t3;
|
|
}
|
|
function $t(e2, t3) {
|
|
return e2 && t3 ? Ze.default(e2, t3) : !e2 && !t3;
|
|
}
|
|
function zt(e2, t3) {
|
|
return e2 && t3 ? Xe.default(e2, t3) : !e2 && !t3;
|
|
}
|
|
function Gt(e2, t3, r4) {
|
|
var a3, n3 = Ve.default(t3), o3 = Je.default(r4);
|
|
try {
|
|
a3 = ot.default(e2, { start: n3, end: o3 });
|
|
} catch (e3) {
|
|
a3 = false;
|
|
}
|
|
return a3;
|
|
}
|
|
function Jt() {
|
|
return ("undefined" != typeof window ? window : globalThis).__localeId__;
|
|
}
|
|
function Xt(e2) {
|
|
if ("string" == typeof e2) {
|
|
var t3 = "undefined" != typeof window ? window : globalThis;
|
|
return t3.__localeData__ ? t3.__localeData__[e2] : null;
|
|
}
|
|
return e2;
|
|
}
|
|
function Zt(e2, t3) {
|
|
return Lt(Ae.default(Yt(), e2), "LLLL", t3);
|
|
}
|
|
function er(e2, t3) {
|
|
return Lt(Ae.default(Yt(), e2), "LLL", t3);
|
|
}
|
|
function tr(e2, t3) {
|
|
return Lt(qe.default(Yt(), e2), "QQQ", t3);
|
|
}
|
|
function rr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.maxDate, n3 = t3.excludeDates, o3 = t3.excludeDateIntervals, s3 = t3.includeDates, i3 = t3.includeDateIntervals, p3 = t3.filterDate;
|
|
return lr(e2, { minDate: r4, maxDate: a3 }) || n3 && n3.some(function(t4) {
|
|
return $t(e2, t4);
|
|
}) || o3 && o3.some(function(t4) {
|
|
var r5 = t4.start, a4 = t4.end;
|
|
return ot.default(e2, { start: r5, end: a4 });
|
|
}) || s3 && !s3.some(function(t4) {
|
|
return $t(e2, t4);
|
|
}) || i3 && !i3.some(function(t4) {
|
|
var r5 = t4.start, a4 = t4.end;
|
|
return ot.default(e2, { start: r5, end: a4 });
|
|
}) || p3 && !p3(Yt(e2)) || false;
|
|
}
|
|
function ar(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.excludeDates, a3 = t3.excludeDateIntervals;
|
|
return a3 && a3.length > 0 ? a3.some(function(t4) {
|
|
var r5 = t4.start, a4 = t4.end;
|
|
return ot.default(e2, { start: r5, end: a4 });
|
|
}) : r4 && r4.some(function(t4) {
|
|
return $t(e2, t4);
|
|
}) || false;
|
|
}
|
|
function nr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.maxDate, n3 = t3.excludeDates, o3 = t3.includeDates, s3 = t3.filterDate;
|
|
return lr(e2, { minDate: r4, maxDate: a3 }) || n3 && n3.some(function(t4) {
|
|
return Vt(e2, t4);
|
|
}) || o3 && !o3.some(function(t4) {
|
|
return Vt(e2, t4);
|
|
}) || s3 && !s3(Yt(e2)) || false;
|
|
}
|
|
function or(e2, t3, r4, a3) {
|
|
var n3 = Ie.default(e2), o3 = Oe.default(e2), s3 = Ie.default(t3), i3 = Oe.default(t3), p3 = Ie.default(a3);
|
|
return n3 === s3 && n3 === p3 ? o3 <= r4 && r4 <= i3 : n3 < s3 ? p3 === n3 && o3 <= r4 || p3 === s3 && i3 >= r4 || p3 < s3 && p3 > n3 : void 0;
|
|
}
|
|
function sr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.maxDate, n3 = t3.excludeDates, o3 = t3.includeDates, s3 = t3.filterDate;
|
|
return lr(e2, { minDate: r4, maxDate: a3 }) || n3 && n3.some(function(t4) {
|
|
return Ut(e2, t4);
|
|
}) || o3 && !o3.some(function(t4) {
|
|
return Ut(e2, t4);
|
|
}) || s3 && !s3(Yt(e2)) || false;
|
|
}
|
|
function ir(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.maxDate, n3 = new Date(e2, 0, 1);
|
|
return lr(n3, { minDate: r4, maxDate: a3 }) || false;
|
|
}
|
|
function pr(e2, t3, r4, a3) {
|
|
var n3 = Ie.default(e2), o3 = Ye.default(e2), s3 = Ie.default(t3), i3 = Ye.default(t3), p3 = Ie.default(a3);
|
|
return n3 === s3 && n3 === p3 ? o3 <= r4 && r4 <= i3 : n3 < s3 ? p3 === n3 && o3 <= r4 || p3 === s3 && i3 >= r4 || p3 < s3 && p3 > n3 : void 0;
|
|
}
|
|
function lr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.maxDate;
|
|
return r4 && He.default(e2, r4) < 0 || a3 && He.default(e2, a3) > 0;
|
|
}
|
|
function dr(e2, t3) {
|
|
return t3.some(function(t4) {
|
|
return Pe.default(t4) === Pe.default(e2) && Me.default(t4) === Me.default(e2);
|
|
});
|
|
}
|
|
function cr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.excludeTimes, a3 = t3.includeTimes, n3 = t3.filterTime;
|
|
return r4 && dr(e2, r4) || a3 && !dr(e2, a3) || n3 && !n3(e2) || false;
|
|
}
|
|
function ur(e2, t3) {
|
|
var r4 = t3.minTime, a3 = t3.maxTime;
|
|
if (!r4 || !a3)
|
|
throw new Error("Both minTime and maxTime props required");
|
|
var n3, o3 = Yt(), s3 = Fe.default(Re.default(o3, Me.default(e2)), Pe.default(e2)), i3 = Fe.default(Re.default(o3, Me.default(r4)), Pe.default(r4)), p3 = Fe.default(Re.default(o3, Me.default(a3)), Pe.default(a3));
|
|
try {
|
|
n3 = !ot.default(s3, { start: i3, end: p3 });
|
|
} catch (e3) {
|
|
n3 = false;
|
|
}
|
|
return n3;
|
|
}
|
|
function fr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.includeDates, n3 = Se.default(e2, 1);
|
|
return r4 && je.default(r4, n3) > 0 || a3 && a3.every(function(e3) {
|
|
return je.default(e3, n3) > 0;
|
|
}) || false;
|
|
}
|
|
function hr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.maxDate, a3 = t3.includeDates, n3 = we.default(e2, 1);
|
|
return r4 && je.default(n3, r4) > 0 || a3 && a3.every(function(e3) {
|
|
return je.default(n3, e3) > 0;
|
|
}) || false;
|
|
}
|
|
function mr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.minDate, a3 = t3.includeDates, n3 = Ce.default(e2, 1);
|
|
return r4 && Qe.default(r4, n3) > 0 || a3 && a3.every(function(e3) {
|
|
return Qe.default(e3, n3) > 0;
|
|
}) || false;
|
|
}
|
|
function yr(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r4 = t3.maxDate, a3 = t3.includeDates, n3 = ge.default(e2, 1);
|
|
return r4 && Qe.default(n3, r4) > 0 || a3 && a3.every(function(e3) {
|
|
return Qe.default(n3, e3) > 0;
|
|
}) || false;
|
|
}
|
|
function Dr(e2) {
|
|
var t3 = e2.minDate, r4 = e2.includeDates;
|
|
if (r4 && t3) {
|
|
var a3 = r4.filter(function(e3) {
|
|
return He.default(e3, t3) >= 0;
|
|
});
|
|
return Be.default(a3);
|
|
}
|
|
return r4 ? Be.default(r4) : t3;
|
|
}
|
|
function vr(e2) {
|
|
var t3 = e2.maxDate, r4 = e2.includeDates;
|
|
if (r4 && t3) {
|
|
var a3 = r4.filter(function(e3) {
|
|
return He.default(e3, t3) <= 0;
|
|
});
|
|
return Ke.default(a3);
|
|
}
|
|
return r4 ? Ke.default(r4) : t3;
|
|
}
|
|
function wr() {
|
|
for (var e2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "react-datepicker__day--highlighted", r4 = /* @__PURE__ */ new Map(), a3 = 0, n3 = e2.length; a3 < n3; a3++) {
|
|
var o3 = e2[a3];
|
|
if (ue.default(o3)) {
|
|
var s3 = Lt(o3, "MM.dd.yyyy"), i3 = r4.get(s3) || [];
|
|
i3.includes(t3) || (i3.push(t3), r4.set(s3, i3));
|
|
} else if ("object" === ft(o3)) {
|
|
var p3 = Object.keys(o3), l3 = p3[0], d3 = o3[p3[0]];
|
|
if ("string" == typeof l3 && d3.constructor === Array)
|
|
for (var c3 = 0, u3 = d3.length; c3 < u3; c3++) {
|
|
var f3 = Lt(d3[c3], "MM.dd.yyyy"), h3 = r4.get(f3) || [];
|
|
h3.includes(l3) || (h3.push(l3), r4.set(f3, h3));
|
|
}
|
|
}
|
|
}
|
|
return r4;
|
|
}
|
|
function gr(e2, t3, r4, a3, n3) {
|
|
for (var o3 = n3.length, s3 = [], i3 = 0; i3 < o3; i3++) {
|
|
var p3 = me.default(ye.default(e2, Pe.default(n3[i3])), Me.default(n3[i3])), l3 = me.default(e2, (r4 + 1) * a3);
|
|
at.default(p3, t3) && nt.default(p3, l3) && s3.push(n3[i3]);
|
|
}
|
|
return s3;
|
|
}
|
|
function kr(e2) {
|
|
return e2 < 10 ? "0".concat(e2) : "".concat(e2);
|
|
}
|
|
function br(e2) {
|
|
var t3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : xt, r4 = Math.ceil(Ie.default(e2) / t3) * t3, a3 = r4 - (t3 - 1);
|
|
return { startPeriod: a3, endPeriod: r4 };
|
|
}
|
|
function Sr(e2, t3, r4, a3) {
|
|
for (var n3 = [], o3 = 0; o3 < 2 * t3 + 1; o3++) {
|
|
var s3 = e2 + t3 - o3, i3 = true;
|
|
r4 && (i3 = Ie.default(r4) <= s3), a3 && i3 && (i3 = Ie.default(a3) >= s3), i3 && n3.push(s3);
|
|
}
|
|
return n3;
|
|
}
|
|
var Cr = function(e2) {
|
|
wt(a3, e2);
|
|
var r4 = Ct(a3);
|
|
function a3(e3) {
|
|
var n3;
|
|
ht(this, a3), Dt(bt(n3 = r4.call(this, e3)), "renderOptions", function() {
|
|
var e4 = n3.props.year, t3 = n3.state.yearsList.map(function(t4) {
|
|
return de.default.createElement("div", { className: e4 === t4 ? "react-datepicker__year-option react-datepicker__year-option--selected_year" : "react-datepicker__year-option", key: t4, onClick: n3.onChange.bind(bt(n3), t4), "aria-selected": e4 === t4 ? "true" : void 0 }, e4 === t4 ? de.default.createElement("span", { className: "react-datepicker__year-option--selected" }, "\u2713") : "", t4);
|
|
}), r5 = n3.props.minDate ? Ie.default(n3.props.minDate) : null, a4 = n3.props.maxDate ? Ie.default(n3.props.maxDate) : null;
|
|
return a4 && n3.state.yearsList.find(function(e5) {
|
|
return e5 === a4;
|
|
}) || t3.unshift(de.default.createElement("div", { className: "react-datepicker__year-option", key: "upcoming", onClick: n3.incrementYears }, de.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming" }))), r5 && n3.state.yearsList.find(function(e5) {
|
|
return e5 === r5;
|
|
}) || t3.push(de.default.createElement("div", { className: "react-datepicker__year-option", key: "previous", onClick: n3.decrementYears }, de.default.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous" }))), t3;
|
|
}), Dt(bt(n3), "onChange", function(e4) {
|
|
n3.props.onChange(e4);
|
|
}), Dt(bt(n3), "handleClickOutside", function() {
|
|
n3.props.onCancel();
|
|
}), Dt(bt(n3), "shiftYears", function(e4) {
|
|
var t3 = n3.state.yearsList.map(function(t4) {
|
|
return t4 + e4;
|
|
});
|
|
n3.setState({ yearsList: t3 });
|
|
}), Dt(bt(n3), "incrementYears", function() {
|
|
return n3.shiftYears(1);
|
|
}), Dt(bt(n3), "decrementYears", function() {
|
|
return n3.shiftYears(-1);
|
|
});
|
|
var o3 = e3.yearDropdownItemNumber, s3 = e3.scrollableYearDropdown, i3 = o3 || (s3 ? 10 : 5);
|
|
return n3.state = { yearsList: Sr(n3.props.year, i3, n3.props.minDate, n3.props.maxDate) }, n3.dropdownRef = t2.createRef(), n3;
|
|
}
|
|
return yt(a3, [{ key: "componentDidMount", value: function() {
|
|
var e3 = this.dropdownRef.current;
|
|
e3 && (e3.scrollTop = e3.scrollHeight / 2 - e3.clientHeight / 2);
|
|
} }, { key: "render", value: function() {
|
|
var e3 = ce.default({ "react-datepicker__year-dropdown": true, "react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown });
|
|
return de.default.createElement("div", { className: e3, ref: this.dropdownRef }, this.renderOptions());
|
|
} }]), a3;
|
|
}(de.default.Component), _r = lt.default(Cr), Mr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function() {
|
|
for (var t4 = e3.props.minDate ? Ie.default(e3.props.minDate) : 1900, r5 = e3.props.maxDate ? Ie.default(e3.props.maxDate) : 2100, a4 = [], n4 = t4; n4 <= r5; n4++)
|
|
a4.push(de.default.createElement("option", { key: n4, value: n4 }, n4));
|
|
return a4;
|
|
}), Dt(bt(e3), "onSelectChange", function(t4) {
|
|
e3.onChange(t4.target.value);
|
|
}), Dt(bt(e3), "renderSelectMode", function() {
|
|
return de.default.createElement("select", { value: e3.props.year, className: "react-datepicker__year-select", onChange: e3.onSelectChange }, e3.renderSelectOptions());
|
|
}), Dt(bt(e3), "renderReadView", function(t4) {
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t4 ? "visible" : "hidden" }, className: "react-datepicker__year-read-view", onClick: function(t5) {
|
|
return e3.toggleDropdown(t5);
|
|
} }, de.default.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__year-read-view--selected-year" }, e3.props.year));
|
|
}), Dt(bt(e3), "renderDropdown", function() {
|
|
return de.default.createElement(_r, { key: "dropdown", year: e3.props.year, onChange: e3.onChange, onCancel: e3.toggleDropdown, minDate: e3.props.minDate, maxDate: e3.props.maxDate, scrollableYearDropdown: e3.props.scrollableYearDropdown, yearDropdownItemNumber: e3.props.yearDropdownItemNumber });
|
|
}), Dt(bt(e3), "renderScrollMode", function() {
|
|
var t4 = e3.state.dropdownVisible, r5 = [e3.renderReadView(!t4)];
|
|
return t4 && r5.unshift(e3.renderDropdown()), r5;
|
|
}), Dt(bt(e3), "onChange", function(t4) {
|
|
e3.toggleDropdown(), t4 !== e3.props.year && e3.props.onChange(t4);
|
|
}), Dt(bt(e3), "toggleDropdown", function(t4) {
|
|
e3.setState({ dropdownVisible: !e3.state.dropdownVisible }, function() {
|
|
e3.props.adjustDateOnChange && e3.handleYearChange(e3.props.date, t4);
|
|
});
|
|
}), Dt(bt(e3), "handleYearChange", function(t4, r5) {
|
|
e3.onSelect(t4, r5), e3.setOpen();
|
|
}), Dt(bt(e3), "onSelect", function(t4, r5) {
|
|
e3.props.onSelect && e3.props.onSelect(t4, r5);
|
|
}), Dt(bt(e3), "setOpen", function() {
|
|
e3.props.setOpen && e3.props.setOpen(true);
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3;
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode();
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode();
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r4;
|
|
}(de.default.Component), Pr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "isSelectedMonth", function(t4) {
|
|
return e3.props.month === t4;
|
|
}), Dt(bt(e3), "renderOptions", function() {
|
|
return e3.props.monthNames.map(function(t4, r5) {
|
|
return de.default.createElement("div", { className: e3.isSelectedMonth(r5) ? "react-datepicker__month-option react-datepicker__month-option--selected_month" : "react-datepicker__month-option", key: t4, onClick: e3.onChange.bind(bt(e3), r5), "aria-selected": e3.isSelectedMonth(r5) ? "true" : void 0 }, e3.isSelectedMonth(r5) ? de.default.createElement("span", { className: "react-datepicker__month-option--selected" }, "\u2713") : "", t4);
|
|
});
|
|
}), Dt(bt(e3), "onChange", function(t4) {
|
|
return e3.props.onChange(t4);
|
|
}), Dt(bt(e3), "handleClickOutside", function() {
|
|
return e3.props.onCancel();
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__month-dropdown" }, this.renderOptions());
|
|
} }]), r4;
|
|
}(de.default.Component), Er = lt.default(Pr), Nr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function(e4) {
|
|
return e4.map(function(e5, t4) {
|
|
return de.default.createElement("option", { key: t4, value: t4 }, e5);
|
|
});
|
|
}), Dt(bt(e3), "renderSelectMode", function(t4) {
|
|
return de.default.createElement("select", { value: e3.props.month, className: "react-datepicker__month-select", onChange: function(t5) {
|
|
return e3.onChange(t5.target.value);
|
|
} }, e3.renderSelectOptions(t4));
|
|
}), Dt(bt(e3), "renderReadView", function(t4, r5) {
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t4 ? "visible" : "hidden" }, className: "react-datepicker__month-read-view", onClick: e3.toggleDropdown }, de.default.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__month-read-view--selected-month" }, r5[e3.props.month]));
|
|
}), Dt(bt(e3), "renderDropdown", function(t4) {
|
|
return de.default.createElement(Er, { key: "dropdown", month: e3.props.month, monthNames: t4, onChange: e3.onChange, onCancel: e3.toggleDropdown });
|
|
}), Dt(bt(e3), "renderScrollMode", function(t4) {
|
|
var r5 = e3.state.dropdownVisible, a4 = [e3.renderReadView(!r5, t4)];
|
|
return r5 && a4.unshift(e3.renderDropdown(t4)), a4;
|
|
}), Dt(bt(e3), "onChange", function(t4) {
|
|
e3.toggleDropdown(), t4 !== e3.props.month && e3.props.onChange(t4);
|
|
}), Dt(bt(e3), "toggleDropdown", function() {
|
|
return e3.setState({ dropdownVisible: !e3.state.dropdownVisible });
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3, t4 = this, r5 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function(e4) {
|
|
return er(e4, t4.props.locale);
|
|
} : function(e4) {
|
|
return Zt(e4, t4.props.locale);
|
|
});
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode(r5);
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode(r5);
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r4;
|
|
}(de.default.Component);
|
|
function xr(e2, t3) {
|
|
for (var r4 = [], a3 = Kt(e2), n3 = Kt(t3); !at.default(a3, n3); )
|
|
r4.push(Yt(a3)), a3 = we.default(a3, 1);
|
|
return r4;
|
|
}
|
|
var Or = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "renderOptions", function() {
|
|
return a3.state.monthYearsList.map(function(e4) {
|
|
var t4 = Te.default(e4), r5 = Qt(a3.props.date, e4) && Vt(a3.props.date, e4);
|
|
return de.default.createElement("div", { className: r5 ? "react-datepicker__month-year-option--selected_month-year" : "react-datepicker__month-year-option", key: t4, onClick: a3.onChange.bind(bt(a3), t4), "aria-selected": r5 ? "true" : void 0 }, r5 ? de.default.createElement("span", { className: "react-datepicker__month-year-option--selected" }, "\u2713") : "", Lt(e4, a3.props.dateFormat, a3.props.locale));
|
|
});
|
|
}), Dt(bt(a3), "onChange", function(e4) {
|
|
return a3.props.onChange(e4);
|
|
}), Dt(bt(a3), "handleClickOutside", function() {
|
|
a3.props.onCancel();
|
|
}), a3.state = { monthYearsList: xr(a3.props.minDate, a3.props.maxDate) }, a3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3 = ce.default({ "react-datepicker__month-year-dropdown": true, "react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown });
|
|
return de.default.createElement("div", { className: e3 }, this.renderOptions());
|
|
} }]), r4;
|
|
}(de.default.Component), Yr = lt.default(Or), Ir = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "state", { dropdownVisible: false }), Dt(bt(e3), "renderSelectOptions", function() {
|
|
for (var t4 = Kt(e3.props.minDate), r5 = Kt(e3.props.maxDate), a4 = []; !at.default(t4, r5); ) {
|
|
var n4 = Te.default(t4);
|
|
a4.push(de.default.createElement("option", { key: n4, value: n4 }, Lt(t4, e3.props.dateFormat, e3.props.locale))), t4 = we.default(t4, 1);
|
|
}
|
|
return a4;
|
|
}), Dt(bt(e3), "onSelectChange", function(t4) {
|
|
e3.onChange(t4.target.value);
|
|
}), Dt(bt(e3), "renderSelectMode", function() {
|
|
return de.default.createElement("select", { value: Te.default(Kt(e3.props.date)), className: "react-datepicker__month-year-select", onChange: e3.onSelectChange }, e3.renderSelectOptions());
|
|
}), Dt(bt(e3), "renderReadView", function(t4) {
|
|
var r5 = Lt(e3.props.date, e3.props.dateFormat, e3.props.locale);
|
|
return de.default.createElement("div", { key: "read", style: { visibility: t4 ? "visible" : "hidden" }, className: "react-datepicker__month-year-read-view", onClick: function(t5) {
|
|
return e3.toggleDropdown(t5);
|
|
} }, de.default.createElement("span", { className: "react-datepicker__month-year-read-view--down-arrow" }), de.default.createElement("span", { className: "react-datepicker__month-year-read-view--selected-month-year" }, r5));
|
|
}), Dt(bt(e3), "renderDropdown", function() {
|
|
return de.default.createElement(Yr, { key: "dropdown", date: e3.props.date, dateFormat: e3.props.dateFormat, onChange: e3.onChange, onCancel: e3.toggleDropdown, minDate: e3.props.minDate, maxDate: e3.props.maxDate, scrollableMonthYearDropdown: e3.props.scrollableMonthYearDropdown, locale: e3.props.locale });
|
|
}), Dt(bt(e3), "renderScrollMode", function() {
|
|
var t4 = e3.state.dropdownVisible, r5 = [e3.renderReadView(!t4)];
|
|
return t4 && r5.unshift(e3.renderDropdown()), r5;
|
|
}), Dt(bt(e3), "onChange", function(t4) {
|
|
e3.toggleDropdown();
|
|
var r5 = Yt(parseInt(t4));
|
|
Qt(e3.props.date, r5) && Vt(e3.props.date, r5) || e3.props.onChange(r5);
|
|
}), Dt(bt(e3), "toggleDropdown", function() {
|
|
return e3.setState({ dropdownVisible: !e3.state.dropdownVisible });
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3;
|
|
switch (this.props.dropdownMode) {
|
|
case "scroll":
|
|
e3 = this.renderScrollMode();
|
|
break;
|
|
case "select":
|
|
e3 = this.renderSelectMode();
|
|
}
|
|
return de.default.createElement("div", { className: "react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode) }, e3);
|
|
} }]), r4;
|
|
}(de.default.Component), Tr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "dayEl", de.default.createRef()), Dt(bt(e3), "handleClick", function(t4) {
|
|
!e3.isDisabled() && e3.props.onClick && e3.props.onClick(t4);
|
|
}), Dt(bt(e3), "handleMouseEnter", function(t4) {
|
|
!e3.isDisabled() && e3.props.onMouseEnter && e3.props.onMouseEnter(t4);
|
|
}), Dt(bt(e3), "handleOnKeyDown", function(t4) {
|
|
" " === t4.key && (t4.preventDefault(), t4.key = "Enter"), e3.props.handleOnKeyDown(t4);
|
|
}), Dt(bt(e3), "isSameDay", function(t4) {
|
|
return $t(e3.props.day, t4);
|
|
}), Dt(bt(e3), "isKeyboardSelected", function() {
|
|
return !e3.props.disabledKeyboardNavigation && !e3.isSameDay(e3.props.selected) && e3.isSameDay(e3.props.preSelection);
|
|
}), Dt(bt(e3), "isDisabled", function() {
|
|
return rr(e3.props.day, e3.props);
|
|
}), Dt(bt(e3), "isExcluded", function() {
|
|
return ar(e3.props.day, e3.props);
|
|
}), Dt(bt(e3), "getHighLightedClass", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.highlightDates;
|
|
if (!n4)
|
|
return false;
|
|
var o4 = Lt(a4, "MM.dd.yyyy");
|
|
return n4.get(o4);
|
|
}), Dt(bt(e3), "isInRange", function() {
|
|
var t4 = e3.props, r5 = t4.day, a4 = t4.startDate, n4 = t4.endDate;
|
|
return !(!a4 || !n4) && Gt(r5, a4, n4);
|
|
}), Dt(bt(e3), "isInSelectingRange", function() {
|
|
var t4, r5 = e3.props, a4 = r5.day, n4 = r5.selectsStart, o4 = r5.selectsEnd, s3 = r5.selectsRange, i3 = r5.selectsDisabledDaysInRange, p3 = r5.startDate, l3 = r5.endDate, d3 = null !== (t4 = e3.props.selectingDate) && void 0 !== t4 ? t4 : e3.props.preSelection;
|
|
return !(!(n4 || o4 || s3) || !d3 || !i3 && e3.isDisabled()) && (n4 && l3 && (nt.default(d3, l3) || zt(d3, l3)) ? Gt(a4, d3, l3) : (o4 && p3 && (at.default(d3, p3) || zt(d3, p3)) || !(!s3 || !p3 || l3 || !at.default(d3, p3) && !zt(d3, p3))) && Gt(a4, p3, d3));
|
|
}), Dt(bt(e3), "isSelectingRangeStart", function() {
|
|
var t4;
|
|
if (!e3.isInSelectingRange())
|
|
return false;
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.selectsStart, s3 = null !== (t4 = e3.props.selectingDate) && void 0 !== t4 ? t4 : e3.props.preSelection;
|
|
return $t(a4, o4 ? s3 : n4);
|
|
}), Dt(bt(e3), "isSelectingRangeEnd", function() {
|
|
var t4;
|
|
if (!e3.isInSelectingRange())
|
|
return false;
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.endDate, o4 = r5.selectsEnd, s3 = null !== (t4 = e3.props.selectingDate) && void 0 !== t4 ? t4 : e3.props.preSelection;
|
|
return $t(a4, o4 ? s3 : n4);
|
|
}), Dt(bt(e3), "isRangeStart", function() {
|
|
var t4 = e3.props, r5 = t4.day, a4 = t4.startDate, n4 = t4.endDate;
|
|
return !(!a4 || !n4) && $t(a4, r5);
|
|
}), Dt(bt(e3), "isRangeEnd", function() {
|
|
var t4 = e3.props, r5 = t4.day, a4 = t4.startDate, n4 = t4.endDate;
|
|
return !(!a4 || !n4) && $t(n4, r5);
|
|
}), Dt(bt(e3), "isWeekend", function() {
|
|
var t4 = Ee.default(e3.props.day);
|
|
return 0 === t4 || 6 === t4;
|
|
}), Dt(bt(e3), "isAfterMonth", function() {
|
|
return void 0 !== e3.props.month && (e3.props.month + 1) % 12 === Oe.default(e3.props.day);
|
|
}), Dt(bt(e3), "isBeforeMonth", function() {
|
|
return void 0 !== e3.props.month && (Oe.default(e3.props.day) + 1) % 12 === e3.props.month;
|
|
}), Dt(bt(e3), "isCurrentDay", function() {
|
|
return e3.isSameDay(Yt());
|
|
}), Dt(bt(e3), "isSelected", function() {
|
|
return e3.isSameDay(e3.props.selected);
|
|
}), Dt(bt(e3), "getClassNames", function(t4) {
|
|
var r5 = e3.props.dayClassName ? e3.props.dayClassName(t4) : void 0;
|
|
return ce.default("react-datepicker__day", r5, "react-datepicker__day--" + qt(e3.props.day), { "react-datepicker__day--disabled": e3.isDisabled(), "react-datepicker__day--excluded": e3.isExcluded(), "react-datepicker__day--selected": e3.isSelected(), "react-datepicker__day--keyboard-selected": e3.isKeyboardSelected(), "react-datepicker__day--range-start": e3.isRangeStart(), "react-datepicker__day--range-end": e3.isRangeEnd(), "react-datepicker__day--in-range": e3.isInRange(), "react-datepicker__day--in-selecting-range": e3.isInSelectingRange(), "react-datepicker__day--selecting-range-start": e3.isSelectingRangeStart(), "react-datepicker__day--selecting-range-end": e3.isSelectingRangeEnd(), "react-datepicker__day--today": e3.isCurrentDay(), "react-datepicker__day--weekend": e3.isWeekend(), "react-datepicker__day--outside-month": e3.isAfterMonth() || e3.isBeforeMonth() }, e3.getHighLightedClass("react-datepicker__day--highlighted"));
|
|
}), Dt(bt(e3), "getAriaLabel", function() {
|
|
var t4 = e3.props, r5 = t4.day, a4 = t4.ariaLabelPrefixWhenEnabled, n4 = void 0 === a4 ? "Choose" : a4, o4 = t4.ariaLabelPrefixWhenDisabled, s3 = void 0 === o4 ? "Not available" : o4, i3 = e3.isDisabled() || e3.isExcluded() ? s3 : n4;
|
|
return "".concat(i3, " ").concat(Lt(r5, "PPPP", e3.props.locale));
|
|
}), Dt(bt(e3), "getTabIndex", function(t4, r5) {
|
|
var a4 = t4 || e3.props.selected, n4 = r5 || e3.props.preSelection;
|
|
return e3.isKeyboardSelected() || e3.isSameDay(a4) && $t(n4, a4) ? 0 : -1;
|
|
}), Dt(bt(e3), "handleFocusDay", function() {
|
|
var t4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r5 = false;
|
|
0 === e3.getTabIndex() && !t4.isInputFocused && e3.isSameDay(e3.props.preSelection) && (document.activeElement && document.activeElement !== document.body || (r5 = true), e3.props.inline && !e3.props.shouldFocusDayInline && (r5 = false), e3.props.containerRef && e3.props.containerRef.current && e3.props.containerRef.current.contains(document.activeElement) && document.activeElement.classList.contains("react-datepicker__day") && (r5 = true)), r5 && e3.dayEl.current.focus({ preventScroll: true });
|
|
}), Dt(bt(e3), "renderDayContents", function() {
|
|
return e3.props.monthShowsDuplicateDaysEnd && e3.isAfterMonth() || e3.props.monthShowsDuplicateDaysStart && e3.isBeforeMonth() ? null : e3.props.renderDayContents ? e3.props.renderDayContents(Ne.default(e3.props.day), e3.props.day) : Ne.default(e3.props.day);
|
|
}), Dt(bt(e3), "render", function() {
|
|
return de.default.createElement("div", { ref: e3.dayEl, className: e3.getClassNames(e3.props.day), onKeyDown: e3.handleOnKeyDown, onClick: e3.handleClick, onMouseEnter: e3.handleMouseEnter, tabIndex: e3.getTabIndex(), "aria-label": e3.getAriaLabel(), role: "option", "aria-disabled": e3.isDisabled(), "aria-current": e3.isCurrentDay() ? "date" : void 0, "aria-selected": e3.isSelected() }, e3.renderDayContents());
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "componentDidMount", value: function() {
|
|
this.handleFocusDay();
|
|
} }, { key: "componentDidUpdate", value: function(e3) {
|
|
this.handleFocusDay(e3);
|
|
} }]), r4;
|
|
}(de.default.Component), Lr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "handleClick", function(t4) {
|
|
e3.props.onClick && e3.props.onClick(t4);
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3 = this.props, t4 = e3.weekNumber, r5 = e3.ariaLabelPrefix, a3 = void 0 === r5 ? "week " : r5, n3 = { "react-datepicker__week-number": true, "react-datepicker__week-number--clickable": !!e3.onClick };
|
|
return de.default.createElement("div", { className: ce.default(n3), "aria-label": "".concat(a3, " ").concat(this.props.weekNumber), onClick: this.handleClick }, t4);
|
|
} }]), r4;
|
|
}(de.default.Component), Rr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "handleDayClick", function(t4, r5) {
|
|
e3.props.onDayClick && e3.props.onDayClick(t4, r5);
|
|
}), Dt(bt(e3), "handleDayMouseEnter", function(t4) {
|
|
e3.props.onDayMouseEnter && e3.props.onDayMouseEnter(t4);
|
|
}), Dt(bt(e3), "handleWeekClick", function(t4, r5, a4) {
|
|
"function" == typeof e3.props.onWeekSelect && e3.props.onWeekSelect(t4, r5, a4), e3.props.shouldCloseOnSelect && e3.props.setOpen(false);
|
|
}), Dt(bt(e3), "formatWeekNumber", function(t4) {
|
|
return e3.props.formatWeekNumber ? e3.props.formatWeekNumber(t4) : At(t4);
|
|
}), Dt(bt(e3), "renderDays", function() {
|
|
var t4 = Bt(e3.props.day, e3.props.locale, e3.props.calendarStartDay), r5 = [], a4 = e3.formatWeekNumber(t4);
|
|
if (e3.props.showWeekNumber) {
|
|
var n4 = e3.props.onWeekSelect ? e3.handleWeekClick.bind(bt(e3), t4, a4) : void 0;
|
|
r5.push(de.default.createElement(Lr, { key: "W", weekNumber: a4, onClick: n4, ariaLabelPrefix: e3.props.ariaLabelPrefix }));
|
|
}
|
|
return r5.concat([0, 1, 2, 3, 4, 5, 6].map(function(r6) {
|
|
var a5 = De.default(t4, r6);
|
|
return de.default.createElement(Tr, { ariaLabelPrefixWhenEnabled: e3.props.chooseDayAriaLabelPrefix, ariaLabelPrefixWhenDisabled: e3.props.disabledDayAriaLabelPrefix, key: a5.valueOf(), day: a5, month: e3.props.month, onClick: e3.handleDayClick.bind(bt(e3), a5), onMouseEnter: e3.handleDayMouseEnter.bind(bt(e3), a5), minDate: e3.props.minDate, maxDate: e3.props.maxDate, excludeDates: e3.props.excludeDates, excludeDateIntervals: e3.props.excludeDateIntervals, includeDates: e3.props.includeDates, includeDateIntervals: e3.props.includeDateIntervals, highlightDates: e3.props.highlightDates, selectingDate: e3.props.selectingDate, filterDate: e3.props.filterDate, preSelection: e3.props.preSelection, selected: e3.props.selected, selectsStart: e3.props.selectsStart, selectsEnd: e3.props.selectsEnd, selectsRange: e3.props.selectsRange, selectsDisabledDaysInRange: e3.props.selectsDisabledDaysInRange, startDate: e3.props.startDate, endDate: e3.props.endDate, dayClassName: e3.props.dayClassName, renderDayContents: e3.props.renderDayContents, disabledKeyboardNavigation: e3.props.disabledKeyboardNavigation, handleOnKeyDown: e3.props.handleOnKeyDown, isInputFocused: e3.props.isInputFocused, containerRef: e3.props.containerRef, inline: e3.props.inline, shouldFocusDayInline: e3.props.shouldFocusDayInline, monthShowsDuplicateDaysEnd: e3.props.monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: e3.props.monthShowsDuplicateDaysStart, locale: e3.props.locale });
|
|
}));
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__week" }, this.renderDays());
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { shouldCloseOnSelect: true };
|
|
} }]), r4;
|
|
}(de.default.Component), Fr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "MONTH_REFS", _t(Array(12)).map(function() {
|
|
return de.default.createRef();
|
|
})), Dt(bt(e3), "isDisabled", function(t4) {
|
|
return rr(t4, e3.props);
|
|
}), Dt(bt(e3), "isExcluded", function(t4) {
|
|
return ar(t4, e3.props);
|
|
}), Dt(bt(e3), "handleDayClick", function(t4, r5) {
|
|
e3.props.onDayClick && e3.props.onDayClick(t4, r5, e3.props.orderInDisplay);
|
|
}), Dt(bt(e3), "handleDayMouseEnter", function(t4) {
|
|
e3.props.onDayMouseEnter && e3.props.onDayMouseEnter(t4);
|
|
}), Dt(bt(e3), "handleMouseLeave", function() {
|
|
e3.props.onMouseLeave && e3.props.onMouseLeave();
|
|
}), Dt(bt(e3), "isRangeStartMonth", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate;
|
|
return !(!n4 || !o4) && Vt(Ae.default(a4, t4), n4);
|
|
}), Dt(bt(e3), "isRangeStartQuarter", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate;
|
|
return !(!n4 || !o4) && Ut(qe.default(a4, t4), n4);
|
|
}), Dt(bt(e3), "isRangeEndMonth", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate;
|
|
return !(!n4 || !o4) && Vt(Ae.default(a4, t4), o4);
|
|
}), Dt(bt(e3), "isRangeEndQuarter", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate;
|
|
return !(!n4 || !o4) && Ut(qe.default(a4, t4), o4);
|
|
}), Dt(bt(e3), "isWeekInMonth", function(t4) {
|
|
var r5 = e3.props.day, a4 = De.default(t4, 6);
|
|
return Vt(t4, r5) || Vt(a4, r5);
|
|
}), Dt(bt(e3), "isCurrentMonth", function(e4, t4) {
|
|
return Ie.default(e4) === Ie.default(Yt()) && t4 === Oe.default(Yt());
|
|
}), Dt(bt(e3), "isSelectedMonth", function(e4, t4, r5) {
|
|
return Oe.default(e4) === t4 && Ie.default(e4) === Ie.default(r5);
|
|
}), Dt(bt(e3), "isSelectedQuarter", function(e4, t4, r5) {
|
|
return Ye.default(e4) === t4 && Ie.default(e4) === Ie.default(r5);
|
|
}), Dt(bt(e3), "renderWeeks", function() {
|
|
for (var t4 = [], r5 = e3.props.fixedHeight, a4 = 0, n4 = false, o4 = Bt(Kt(e3.props.day), e3.props.locale, e3.props.calendarStartDay); t4.push(de.default.createElement(Rr, { ariaLabelPrefix: e3.props.weekAriaLabelPrefix, chooseDayAriaLabelPrefix: e3.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: e3.props.disabledDayAriaLabelPrefix, key: a4, day: o4, month: Oe.default(e3.props.day), onDayClick: e3.handleDayClick, onDayMouseEnter: e3.handleDayMouseEnter, onWeekSelect: e3.props.onWeekSelect, formatWeekNumber: e3.props.formatWeekNumber, locale: e3.props.locale, minDate: e3.props.minDate, maxDate: e3.props.maxDate, excludeDates: e3.props.excludeDates, excludeDateIntervals: e3.props.excludeDateIntervals, includeDates: e3.props.includeDates, includeDateIntervals: e3.props.includeDateIntervals, inline: e3.props.inline, shouldFocusDayInline: e3.props.shouldFocusDayInline, highlightDates: e3.props.highlightDates, selectingDate: e3.props.selectingDate, filterDate: e3.props.filterDate, preSelection: e3.props.preSelection, selected: e3.props.selected, selectsStart: e3.props.selectsStart, selectsEnd: e3.props.selectsEnd, selectsRange: e3.props.selectsRange, selectsDisabledDaysInRange: e3.props.selectsDisabledDaysInRange, showWeekNumber: e3.props.showWeekNumbers, startDate: e3.props.startDate, endDate: e3.props.endDate, dayClassName: e3.props.dayClassName, setOpen: e3.props.setOpen, shouldCloseOnSelect: e3.props.shouldCloseOnSelect, disabledKeyboardNavigation: e3.props.disabledKeyboardNavigation, renderDayContents: e3.props.renderDayContents, handleOnKeyDown: e3.props.handleOnKeyDown, isInputFocused: e3.props.isInputFocused, containerRef: e3.props.containerRef, calendarStartDay: e3.props.calendarStartDay, monthShowsDuplicateDaysEnd: e3.props.monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: e3.props.monthShowsDuplicateDaysStart })), !n4; ) {
|
|
a4++, o4 = ve.default(o4, 1);
|
|
var s3 = r5 && a4 >= 6, i3 = !r5 && !e3.isWeekInMonth(o4);
|
|
if (s3 || i3) {
|
|
if (!e3.props.peekNextMonth)
|
|
break;
|
|
n4 = true;
|
|
}
|
|
}
|
|
return t4;
|
|
}), Dt(bt(e3), "onMonthClick", function(t4, r5) {
|
|
e3.handleDayClick(Kt(Ae.default(e3.props.day, r5)), t4);
|
|
}), Dt(bt(e3), "handleMonthNavigation", function(t4, r5) {
|
|
e3.isDisabled(r5) || e3.isExcluded(r5) || (e3.props.setPreSelection(r5), e3.MONTH_REFS[t4].current && e3.MONTH_REFS[t4].current.focus());
|
|
}), Dt(bt(e3), "onMonthKeyDown", function(t4, r5) {
|
|
var a4 = t4.key;
|
|
if (!e3.props.disabledKeyboardNavigation)
|
|
switch (a4) {
|
|
case "Enter":
|
|
e3.onMonthClick(t4, r5), e3.props.setPreSelection(e3.props.selected);
|
|
break;
|
|
case "ArrowRight":
|
|
e3.handleMonthNavigation(11 === r5 ? 0 : r5 + 1, we.default(e3.props.preSelection, 1));
|
|
break;
|
|
case "ArrowLeft":
|
|
e3.handleMonthNavigation(0 === r5 ? 11 : r5 - 1, Se.default(e3.props.preSelection, 1));
|
|
}
|
|
}), Dt(bt(e3), "onQuarterClick", function(t4, r5) {
|
|
e3.handleDayClick(jt(qe.default(e3.props.day, r5)), t4);
|
|
}), Dt(bt(e3), "getMonthClassNames", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate, s3 = r5.selected, i3 = r5.minDate, p3 = r5.maxDate, l3 = r5.preSelection, d3 = r5.monthClassName, c3 = d3 ? d3(a4) : void 0;
|
|
return ce.default("react-datepicker__month-text", "react-datepicker__month-".concat(t4), c3, { "react-datepicker__month--disabled": (i3 || p3) && nr(Ae.default(a4, t4), e3.props), "react-datepicker__month--selected": e3.isSelectedMonth(a4, t4, s3), "react-datepicker__month-text--keyboard-selected": Oe.default(l3) === t4, "react-datepicker__month--in-range": or(n4, o4, t4, a4), "react-datepicker__month--range-start": e3.isRangeStartMonth(t4), "react-datepicker__month--range-end": e3.isRangeEndMonth(t4), "react-datepicker__month-text--today": e3.isCurrentMonth(a4, t4) });
|
|
}), Dt(bt(e3), "getTabIndex", function(t4) {
|
|
var r5 = Oe.default(e3.props.preSelection);
|
|
return e3.props.disabledKeyboardNavigation || t4 !== r5 ? "-1" : "0";
|
|
}), Dt(bt(e3), "getAriaLabel", function(t4) {
|
|
var r5 = e3.props, a4 = r5.chooseDayAriaLabelPrefix, n4 = void 0 === a4 ? "Choose" : a4, o4 = r5.disabledDayAriaLabelPrefix, s3 = void 0 === o4 ? "Not available" : o4, i3 = r5.day, p3 = Ae.default(i3, t4), l3 = e3.isDisabled(p3) || e3.isExcluded(p3) ? s3 : n4;
|
|
return "".concat(l3, " ").concat(Lt(p3, "MMMM yyyy"));
|
|
}), Dt(bt(e3), "getQuarterClassNames", function(t4) {
|
|
var r5 = e3.props, a4 = r5.day, n4 = r5.startDate, o4 = r5.endDate, s3 = r5.selected, i3 = r5.minDate, p3 = r5.maxDate;
|
|
return ce.default("react-datepicker__quarter-text", "react-datepicker__quarter-".concat(t4), { "react-datepicker__quarter--disabled": (i3 || p3) && sr(qe.default(a4, t4), e3.props), "react-datepicker__quarter--selected": e3.isSelectedQuarter(a4, t4, s3), "react-datepicker__quarter--in-range": pr(n4, o4, t4, a4), "react-datepicker__quarter--range-start": e3.isRangeStartQuarter(t4), "react-datepicker__quarter--range-end": e3.isRangeEndQuarter(t4) });
|
|
}), Dt(bt(e3), "renderMonths", function() {
|
|
var t4 = e3.props, r5 = t4.showFullMonthYearPicker, a4 = t4.showTwoColumnMonthYearPicker, n4 = t4.showFourColumnMonthYearPicker, o4 = t4.locale, s3 = t4.day, i3 = t4.selected;
|
|
return (n4 ? [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] : a4 ? [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11]] : [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]).map(function(t5, a5) {
|
|
return de.default.createElement("div", { className: "react-datepicker__month-wrapper", key: a5 }, t5.map(function(t6, a6) {
|
|
return de.default.createElement("div", { ref: e3.MONTH_REFS[t6], key: a6, onClick: function(r6) {
|
|
e3.onMonthClick(r6, t6);
|
|
}, onKeyDown: function(r6) {
|
|
e3.onMonthKeyDown(r6, t6);
|
|
}, tabIndex: e3.getTabIndex(t6), className: e3.getMonthClassNames(t6), role: "option", "aria-label": e3.getAriaLabel(t6), "aria-current": e3.isCurrentMonth(s3, t6) ? "date" : void 0, "aria-selected": e3.isSelectedMonth(s3, t6, i3) }, r5 ? Zt(t6, o4) : er(t6, o4));
|
|
}));
|
|
});
|
|
}), Dt(bt(e3), "renderQuarters", function() {
|
|
var t4 = e3.props, r5 = t4.day, a4 = t4.selected;
|
|
return de.default.createElement("div", { className: "react-datepicker__quarter-wrapper" }, [1, 2, 3, 4].map(function(t5, n4) {
|
|
return de.default.createElement("div", { key: n4, role: "option", onClick: function(r6) {
|
|
e3.onQuarterClick(r6, t5);
|
|
}, className: e3.getQuarterClassNames(t5), "aria-selected": e3.isSelectedQuarter(r5, t5, a4) }, tr(t5, e3.props.locale));
|
|
}));
|
|
}), Dt(bt(e3), "getClassNames", function() {
|
|
var t4 = e3.props;
|
|
t4.day;
|
|
var r5 = t4.selectingDate, a4 = t4.selectsStart, n4 = t4.selectsEnd, o4 = t4.showMonthYearPicker, s3 = t4.showQuarterYearPicker;
|
|
return ce.default("react-datepicker__month", { "react-datepicker__month--selecting-range": r5 && (a4 || n4) }, { "react-datepicker__monthPicker": o4 }, { "react-datepicker__quarterPicker": s3 });
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3 = this.props, t4 = e3.showMonthYearPicker, r5 = e3.showQuarterYearPicker, a3 = e3.day, n3 = e3.ariaLabelPrefix, o3 = void 0 === n3 ? "month " : n3;
|
|
return de.default.createElement("div", { className: this.getClassNames(), onMouseLeave: this.handleMouseLeave, "aria-label": "".concat(o3, " ").concat(Lt(a3, "yyyy-MM")), role: "listbox" }, t4 ? this.renderMonths() : r5 ? this.renderQuarters() : this.renderWeeks());
|
|
} }]), r4;
|
|
}(de.default.Component), Ar = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
var e3;
|
|
ht(this, r4);
|
|
for (var a3 = arguments.length, n3 = new Array(a3), o3 = 0; o3 < a3; o3++)
|
|
n3[o3] = arguments[o3];
|
|
return Dt(bt(e3 = t3.call.apply(t3, [this].concat(n3))), "state", { height: null }), Dt(bt(e3), "handleClick", function(t4) {
|
|
(e3.props.minTime || e3.props.maxTime) && ur(t4, e3.props) || (e3.props.excludeTimes || e3.props.includeTimes || e3.props.filterTime) && cr(t4, e3.props) || e3.props.onChange(t4);
|
|
}), Dt(bt(e3), "isSelectedTime", function(t4, r5, a4) {
|
|
return e3.props.selected && r5 === Pe.default(t4) && a4 === Me.default(t4);
|
|
}), Dt(bt(e3), "liClasses", function(t4, r5, a4) {
|
|
var n4 = ["react-datepicker__time-list-item", e3.props.timeClassName ? e3.props.timeClassName(t4, r5, a4) : void 0];
|
|
return e3.isSelectedTime(t4, r5, a4) && n4.push("react-datepicker__time-list-item--selected"), ((e3.props.minTime || e3.props.maxTime) && ur(t4, e3.props) || (e3.props.excludeTimes || e3.props.includeTimes || e3.props.filterTime) && cr(t4, e3.props)) && n4.push("react-datepicker__time-list-item--disabled"), e3.props.injectTimes && (60 * Pe.default(t4) + Me.default(t4)) % e3.props.intervals != 0 && n4.push("react-datepicker__time-list-item--injected"), n4.join(" ");
|
|
}), Dt(bt(e3), "handleOnKeyDown", function(t4, r5) {
|
|
" " === t4.key && (t4.preventDefault(), t4.key = "Enter"), "Enter" === t4.key && e3.handleClick(r5), e3.props.handleOnKeyDown(t4);
|
|
}), Dt(bt(e3), "renderTimes", function() {
|
|
for (var t4 = [], r5 = e3.props.format ? e3.props.format : "p", a4 = e3.props.intervals, n4 = Wt(Yt(e3.props.selected)), o4 = 1440 / a4, s3 = e3.props.injectTimes && e3.props.injectTimes.sort(function(e4, t5) {
|
|
return e4 - t5;
|
|
}), i3 = e3.props.selected || e3.props.openToDate || Yt(), p3 = Pe.default(i3), l3 = Me.default(i3), d3 = Fe.default(Re.default(n4, l3), p3), c3 = 0; c3 < o4; c3++) {
|
|
var u3 = me.default(n4, c3 * a4);
|
|
if (t4.push(u3), s3) {
|
|
var f3 = gr(n4, u3, c3, a4, s3);
|
|
t4 = t4.concat(f3);
|
|
}
|
|
}
|
|
return t4.map(function(t5, a5) {
|
|
return de.default.createElement("li", { key: a5, onClick: e3.handleClick.bind(bt(e3), t5), className: e3.liClasses(t5, p3, l3), ref: function(r6) {
|
|
(nt.default(t5, d3) || zt(t5, d3)) && (e3.centerLi = r6);
|
|
}, onKeyDown: function(r6) {
|
|
e3.handleOnKeyDown(r6, t5);
|
|
}, tabIndex: "0", "aria-selected": e3.isSelectedTime(t5, p3, l3) ? "true" : void 0 }, Lt(t5, r5, e3.props.locale));
|
|
});
|
|
}), e3;
|
|
}
|
|
return yt(r4, [{ key: "componentDidMount", value: function() {
|
|
this.list.scrollTop = r4.calcCenterPosition(this.props.monthRef ? this.props.monthRef.clientHeight - this.header.clientHeight : this.list.clientHeight, this.centerLi), this.props.monthRef && this.header && this.setState({ height: this.props.monthRef.clientHeight - this.header.clientHeight });
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this, t4 = this.state.height;
|
|
return de.default.createElement("div", { className: "react-datepicker__time-container ".concat(this.props.todayButton ? "react-datepicker__time-container--with-today-button" : "") }, de.default.createElement("div", { className: "react-datepicker__header react-datepicker__header--time ".concat(this.props.showTimeSelectOnly ? "react-datepicker__header--time--only" : ""), ref: function(t5) {
|
|
e3.header = t5;
|
|
} }, de.default.createElement("div", { className: "react-datepicker-time__header" }, this.props.timeCaption)), de.default.createElement("div", { className: "react-datepicker__time" }, de.default.createElement("div", { className: "react-datepicker__time-box" }, de.default.createElement("ul", { className: "react-datepicker__time-list", ref: function(t5) {
|
|
e3.list = t5;
|
|
}, style: t4 ? { height: t4 } : {}, tabIndex: "0" }, this.renderTimes()))));
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { intervals: 30, onTimeChange: function() {
|
|
}, todayButton: null, timeCaption: "Time" };
|
|
} }]), r4;
|
|
}(de.default.Component);
|
|
Dt(Ar, "calcCenterPosition", function(e2, t3) {
|
|
return t3.offsetTop - (e2 / 2 - t3.clientHeight / 2);
|
|
});
|
|
var qr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "YEAR_REFS", _t(Array(a3.props.yearItemNumber)).map(function() {
|
|
return de.default.createRef();
|
|
})), Dt(bt(a3), "isDisabled", function(e4) {
|
|
return rr(e4, a3.props);
|
|
}), Dt(bt(a3), "isExcluded", function(e4) {
|
|
return ar(e4, a3.props);
|
|
}), Dt(bt(a3), "updateFocusOnPaginate", function(e4) {
|
|
var t4 = function() {
|
|
this.YEAR_REFS[e4].current.focus();
|
|
}.bind(bt(a3));
|
|
window.requestAnimationFrame(t4);
|
|
}), Dt(bt(a3), "handleYearClick", function(e4, t4) {
|
|
a3.props.onDayClick && a3.props.onDayClick(e4, t4);
|
|
}), Dt(bt(a3), "handleYearNavigation", function(e4, t4) {
|
|
var r5 = a3.props, n3 = r5.date, o3 = r5.yearItemNumber, s3 = br(n3, o3).startPeriod;
|
|
a3.isDisabled(t4) || a3.isExcluded(t4) || (a3.props.setPreSelection(t4), e4 - s3 == -1 ? a3.updateFocusOnPaginate(o3 - 1) : e4 - s3 === o3 ? a3.updateFocusOnPaginate(0) : a3.YEAR_REFS[e4 - s3].current.focus());
|
|
}), Dt(bt(a3), "isSameDay", function(e4, t4) {
|
|
return $t(e4, t4);
|
|
}), Dt(bt(a3), "isCurrentYear", function(e4) {
|
|
return e4 === Ie.default(Yt());
|
|
}), Dt(bt(a3), "isKeyboardSelected", function(e4) {
|
|
var t4 = Ht(We.default(a3.props.date, e4));
|
|
return !a3.props.disabledKeyboardNavigation && !a3.props.inline && !$t(t4, Ht(a3.props.selected)) && $t(t4, Ht(a3.props.preSelection));
|
|
}), Dt(bt(a3), "onYearClick", function(e4, t4) {
|
|
var r5 = a3.props.date;
|
|
a3.handleYearClick(Ht(We.default(r5, t4)), e4);
|
|
}), Dt(bt(a3), "onYearKeyDown", function(e4, t4) {
|
|
var r5 = e4.key;
|
|
if (!a3.props.disabledKeyboardNavigation)
|
|
switch (r5) {
|
|
case "Enter":
|
|
a3.onYearClick(e4, t4), a3.props.setPreSelection(a3.props.selected);
|
|
break;
|
|
case "ArrowRight":
|
|
a3.handleYearNavigation(t4 + 1, ge.default(a3.props.preSelection, 1));
|
|
break;
|
|
case "ArrowLeft":
|
|
a3.handleYearNavigation(t4 - 1, Ce.default(a3.props.preSelection, 1));
|
|
}
|
|
}), Dt(bt(a3), "getYearClassNames", function(e4) {
|
|
var t4 = a3.props, r5 = t4.minDate, n3 = t4.maxDate, o3 = t4.selected;
|
|
return ce.default("react-datepicker__year-text", { "react-datepicker__year-text--selected": e4 === Ie.default(o3), "react-datepicker__year-text--disabled": (r5 || n3) && ir(e4, a3.props), "react-datepicker__year-text--keyboard-selected": a3.isKeyboardSelected(e4), "react-datepicker__year-text--today": a3.isCurrentYear(e4) });
|
|
}), Dt(bt(a3), "getYearTabIndex", function(e4) {
|
|
return a3.props.disabledKeyboardNavigation ? "-1" : e4 === Ie.default(a3.props.preSelection) ? "0" : "-1";
|
|
}), a3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
for (var e3 = this, t4 = [], r5 = this.props, a3 = br(r5.date, r5.yearItemNumber), n3 = a3.startPeriod, o3 = a3.endPeriod, s3 = function(r6) {
|
|
t4.push(de.default.createElement("div", { ref: e3.YEAR_REFS[r6 - n3], onClick: function(t5) {
|
|
e3.onYearClick(t5, r6);
|
|
}, onKeyDown: function(t5) {
|
|
e3.onYearKeyDown(t5, r6);
|
|
}, tabIndex: e3.getYearTabIndex(r6), className: e3.getYearClassNames(r6), key: r6, "aria-current": e3.isCurrentYear(r6) ? "date" : void 0 }, r6));
|
|
}, i3 = n3; i3 <= o3; i3++)
|
|
s3(i3);
|
|
return de.default.createElement("div", { className: "react-datepicker__year" }, de.default.createElement("div", { className: "react-datepicker__year-wrapper" }, t4));
|
|
} }]), r4;
|
|
}(de.default.Component), Wr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "onTimeChange", function(e4) {
|
|
a3.setState({ time: e4 });
|
|
var t4 = new Date();
|
|
t4.setHours(e4.split(":")[0]), t4.setMinutes(e4.split(":")[1]), a3.props.onChange(t4);
|
|
}), Dt(bt(a3), "renderTimeInput", function() {
|
|
var e4 = a3.state.time, t4 = a3.props, r5 = t4.date, n3 = t4.timeString, o3 = t4.customTimeInput;
|
|
return o3 ? de.default.cloneElement(o3, { date: r5, value: e4, onChange: a3.onTimeChange }) : de.default.createElement("input", { type: "time", className: "react-datepicker-time__input", placeholder: "Time", name: "time-input", required: true, value: e4, onChange: function(e5) {
|
|
a3.onTimeChange(e5.target.value || n3);
|
|
} });
|
|
}), a3.state = { time: a3.props.timeString }, a3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__input-time-container" }, de.default.createElement("div", { className: "react-datepicker-time__caption" }, this.props.timeInputLabel), de.default.createElement("div", { className: "react-datepicker-time__input-container" }, de.default.createElement("div", { className: "react-datepicker-time__input" }, this.renderTimeInput())));
|
|
} }], [{ key: "getDerivedStateFromProps", value: function(e3, t4) {
|
|
return e3.timeString !== t4.time ? { time: e3.timeString } : null;
|
|
} }]), r4;
|
|
}(de.default.Component);
|
|
function Br(e2) {
|
|
var t3 = e2.className, r4 = e2.children, a3 = e2.showPopperArrow, n3 = e2.arrowProps, o3 = void 0 === n3 ? {} : n3;
|
|
return de.default.createElement("div", { className: t3 }, a3 && de.default.createElement("div", vt({ className: "react-datepicker__triangle" }, o3)), r4);
|
|
}
|
|
var Kr = ["react-datepicker__year-select", "react-datepicker__month-select", "react-datepicker__month-year-select"], Hr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "handleClickOutside", function(e4) {
|
|
a3.props.onClickOutside(e4);
|
|
}), Dt(bt(a3), "setClickOutsideRef", function() {
|
|
return a3.containerRef.current;
|
|
}), Dt(bt(a3), "handleDropdownFocus", function(e4) {
|
|
(function() {
|
|
var e5 = ((arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).className || "").split(/\s+/);
|
|
return Kr.some(function(t4) {
|
|
return e5.indexOf(t4) >= 0;
|
|
});
|
|
})(e4.target) && a3.props.onDropdownFocus();
|
|
}), Dt(bt(a3), "getDateInView", function() {
|
|
var e4 = a3.props, t4 = e4.preSelection, r5 = e4.selected, n3 = e4.openToDate, o3 = Dr(a3.props), s3 = vr(a3.props), i3 = Yt(), p3 = n3 || r5 || t4;
|
|
return p3 || (o3 && nt.default(i3, o3) ? o3 : s3 && at.default(i3, s3) ? s3 : i3);
|
|
}), Dt(bt(a3), "increaseMonth", function() {
|
|
a3.setState(function(e4) {
|
|
var t4 = e4.date;
|
|
return { date: we.default(t4, 1) };
|
|
}, function() {
|
|
return a3.handleMonthChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "decreaseMonth", function() {
|
|
a3.setState(function(e4) {
|
|
var t4 = e4.date;
|
|
return { date: Se.default(t4, 1) };
|
|
}, function() {
|
|
return a3.handleMonthChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "handleDayClick", function(e4, t4, r5) {
|
|
a3.props.onSelect(e4, t4, r5), a3.props.setPreSelection && a3.props.setPreSelection(e4);
|
|
}), Dt(bt(a3), "handleDayMouseEnter", function(e4) {
|
|
a3.setState({ selectingDate: e4 }), a3.props.onDayMouseEnter && a3.props.onDayMouseEnter(e4);
|
|
}), Dt(bt(a3), "handleMonthMouseLeave", function() {
|
|
a3.setState({ selectingDate: null }), a3.props.onMonthMouseLeave && a3.props.onMonthMouseLeave();
|
|
}), Dt(bt(a3), "handleYearChange", function(e4) {
|
|
a3.props.onYearChange && a3.props.onYearChange(e4), a3.props.adjustDateOnChange && (a3.props.onSelect && a3.props.onSelect(e4), a3.props.setOpen && a3.props.setOpen(true)), a3.props.setPreSelection && a3.props.setPreSelection(e4);
|
|
}), Dt(bt(a3), "handleMonthChange", function(e4) {
|
|
a3.props.onMonthChange && a3.props.onMonthChange(e4), a3.props.adjustDateOnChange && (a3.props.onSelect && a3.props.onSelect(e4), a3.props.setOpen && a3.props.setOpen(true)), a3.props.setPreSelection && a3.props.setPreSelection(e4);
|
|
}), Dt(bt(a3), "handleMonthYearChange", function(e4) {
|
|
a3.handleYearChange(e4), a3.handleMonthChange(e4);
|
|
}), Dt(bt(a3), "changeYear", function(e4) {
|
|
a3.setState(function(t4) {
|
|
var r5 = t4.date;
|
|
return { date: We.default(r5, e4) };
|
|
}, function() {
|
|
return a3.handleYearChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "changeMonth", function(e4) {
|
|
a3.setState(function(t4) {
|
|
var r5 = t4.date;
|
|
return { date: Ae.default(r5, e4) };
|
|
}, function() {
|
|
return a3.handleMonthChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "changeMonthYear", function(e4) {
|
|
a3.setState(function(t4) {
|
|
var r5 = t4.date;
|
|
return { date: We.default(Ae.default(r5, Oe.default(e4)), Ie.default(e4)) };
|
|
}, function() {
|
|
return a3.handleMonthYearChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "header", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a3.state.date, t4 = Bt(e4, a3.props.locale, a3.props.calendarStartDay), r5 = [];
|
|
return a3.props.showWeekNumbers && r5.push(de.default.createElement("div", { key: "W", className: "react-datepicker__day-name" }, a3.props.weekLabel || "#")), r5.concat([0, 1, 2, 3, 4, 5, 6].map(function(e5) {
|
|
var r6 = De.default(t4, e5), n3 = a3.formatWeekday(r6, a3.props.locale), o3 = a3.props.weekDayClassName ? a3.props.weekDayClassName(r6) : void 0;
|
|
return de.default.createElement("div", { key: e5, className: ce.default("react-datepicker__day-name", o3) }, n3);
|
|
}));
|
|
}), Dt(bt(a3), "formatWeekday", function(e4, t4) {
|
|
return a3.props.formatWeekDay ? function(e5, t5, r5) {
|
|
return t5(Lt(e5, "EEEE", r5));
|
|
}(e4, a3.props.formatWeekDay, t4) : a3.props.useWeekdaysShort ? function(e5, t5) {
|
|
return Lt(e5, "EEE", t5);
|
|
}(e4, t4) : function(e5, t5) {
|
|
return Lt(e5, "EEEEEE", t5);
|
|
}(e4, t4);
|
|
}), Dt(bt(a3), "decreaseYear", function() {
|
|
a3.setState(function(e4) {
|
|
var t4 = e4.date;
|
|
return { date: Ce.default(t4, a3.props.showYearPicker ? a3.props.yearItemNumber : 1) };
|
|
}, function() {
|
|
return a3.handleYearChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "renderPreviousButton", function() {
|
|
if (!a3.props.renderCustomHeader) {
|
|
var e4;
|
|
switch (true) {
|
|
case a3.props.showMonthYearPicker:
|
|
e4 = mr(a3.state.date, a3.props);
|
|
break;
|
|
case a3.props.showYearPicker:
|
|
e4 = function(e5) {
|
|
var t5 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r6 = t5.minDate, a4 = t5.yearItemNumber, n4 = void 0 === a4 ? xt : a4, o4 = br(Ht(Ce.default(e5, n4)), n4).endPeriod, s4 = r6 && Ie.default(r6);
|
|
return s4 && s4 > o4 || false;
|
|
}(a3.state.date, a3.props);
|
|
break;
|
|
default:
|
|
e4 = fr(a3.state.date, a3.props);
|
|
}
|
|
if ((a3.props.forceShowMonthNavigation || a3.props.showDisabledMonthNavigation || !e4) && !a3.props.showTimeSelectOnly) {
|
|
var t4 = ["react-datepicker__navigation", "react-datepicker__navigation--previous"], r5 = a3.decreaseMonth;
|
|
(a3.props.showMonthYearPicker || a3.props.showQuarterYearPicker || a3.props.showYearPicker) && (r5 = a3.decreaseYear), e4 && a3.props.showDisabledMonthNavigation && (t4.push("react-datepicker__navigation--previous--disabled"), r5 = null);
|
|
var n3 = a3.props.showMonthYearPicker || a3.props.showQuarterYearPicker || a3.props.showYearPicker, o3 = a3.props, s3 = o3.previousMonthButtonLabel, i3 = o3.previousYearButtonLabel, p3 = a3.props, l3 = p3.previousMonthAriaLabel, d3 = void 0 === l3 ? "string" == typeof s3 ? s3 : "Previous Month" : l3, c3 = p3.previousYearAriaLabel, u3 = void 0 === c3 ? "string" == typeof i3 ? i3 : "Previous Year" : c3;
|
|
return de.default.createElement("button", { type: "button", className: t4.join(" "), onClick: r5, onKeyDown: a3.props.handleOnKeyDown, "aria-label": n3 ? u3 : d3 }, de.default.createElement("span", { className: ["react-datepicker__navigation-icon", "react-datepicker__navigation-icon--previous"].join(" ") }, n3 ? a3.props.previousYearButtonLabel : a3.props.previousMonthButtonLabel));
|
|
}
|
|
}
|
|
}), Dt(bt(a3), "increaseYear", function() {
|
|
a3.setState(function(e4) {
|
|
var t4 = e4.date;
|
|
return { date: ge.default(t4, a3.props.showYearPicker ? a3.props.yearItemNumber : 1) };
|
|
}, function() {
|
|
return a3.handleYearChange(a3.state.date);
|
|
});
|
|
}), Dt(bt(a3), "renderNextButton", function() {
|
|
if (!a3.props.renderCustomHeader) {
|
|
var e4;
|
|
switch (true) {
|
|
case a3.props.showMonthYearPicker:
|
|
e4 = yr(a3.state.date, a3.props);
|
|
break;
|
|
case a3.props.showYearPicker:
|
|
e4 = function(e5) {
|
|
var t5 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r6 = t5.maxDate, a4 = t5.yearItemNumber, n4 = void 0 === a4 ? xt : a4, o4 = br(ge.default(e5, n4), n4).startPeriod, s4 = r6 && Ie.default(r6);
|
|
return s4 && s4 < o4 || false;
|
|
}(a3.state.date, a3.props);
|
|
break;
|
|
default:
|
|
e4 = hr(a3.state.date, a3.props);
|
|
}
|
|
if ((a3.props.forceShowMonthNavigation || a3.props.showDisabledMonthNavigation || !e4) && !a3.props.showTimeSelectOnly) {
|
|
var t4 = ["react-datepicker__navigation", "react-datepicker__navigation--next"];
|
|
a3.props.showTimeSelect && t4.push("react-datepicker__navigation--next--with-time"), a3.props.todayButton && t4.push("react-datepicker__navigation--next--with-today-button");
|
|
var r5 = a3.increaseMonth;
|
|
(a3.props.showMonthYearPicker || a3.props.showQuarterYearPicker || a3.props.showYearPicker) && (r5 = a3.increaseYear), e4 && a3.props.showDisabledMonthNavigation && (t4.push("react-datepicker__navigation--next--disabled"), r5 = null);
|
|
var n3 = a3.props.showMonthYearPicker || a3.props.showQuarterYearPicker || a3.props.showYearPicker, o3 = a3.props, s3 = o3.nextMonthButtonLabel, i3 = o3.nextYearButtonLabel, p3 = a3.props, l3 = p3.nextMonthAriaLabel, d3 = void 0 === l3 ? "string" == typeof s3 ? s3 : "Next Month" : l3, c3 = p3.nextYearAriaLabel, u3 = void 0 === c3 ? "string" == typeof i3 ? i3 : "Next Year" : c3;
|
|
return de.default.createElement("button", { type: "button", className: t4.join(" "), onClick: r5, onKeyDown: a3.props.handleOnKeyDown, "aria-label": n3 ? u3 : d3 }, de.default.createElement("span", { className: ["react-datepicker__navigation-icon", "react-datepicker__navigation-icon--next"].join(" ") }, n3 ? a3.props.nextYearButtonLabel : a3.props.nextMonthButtonLabel));
|
|
}
|
|
}
|
|
}), Dt(bt(a3), "renderCurrentMonth", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a3.state.date, t4 = ["react-datepicker__current-month"];
|
|
return a3.props.showYearDropdown && t4.push("react-datepicker__current-month--hasYearDropdown"), a3.props.showMonthDropdown && t4.push("react-datepicker__current-month--hasMonthDropdown"), a3.props.showMonthYearDropdown && t4.push("react-datepicker__current-month--hasMonthYearDropdown"), de.default.createElement("div", { className: t4.join(" ") }, Lt(e4, a3.props.dateFormat, a3.props.locale));
|
|
}), Dt(bt(a3), "renderYearDropdown", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
|
if (a3.props.showYearDropdown && !e4)
|
|
return de.default.createElement(Mr, { adjustDateOnChange: a3.props.adjustDateOnChange, date: a3.state.date, onSelect: a3.props.onSelect, setOpen: a3.props.setOpen, dropdownMode: a3.props.dropdownMode, onChange: a3.changeYear, minDate: a3.props.minDate, maxDate: a3.props.maxDate, year: Ie.default(a3.state.date), scrollableYearDropdown: a3.props.scrollableYearDropdown, yearDropdownItemNumber: a3.props.yearDropdownItemNumber });
|
|
}), Dt(bt(a3), "renderMonthDropdown", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
|
if (a3.props.showMonthDropdown && !e4)
|
|
return de.default.createElement(Nr, { dropdownMode: a3.props.dropdownMode, locale: a3.props.locale, onChange: a3.changeMonth, month: Oe.default(a3.state.date), useShortMonthInDropdown: a3.props.useShortMonthInDropdown });
|
|
}), Dt(bt(a3), "renderMonthYearDropdown", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
|
if (a3.props.showMonthYearDropdown && !e4)
|
|
return de.default.createElement(Ir, { dropdownMode: a3.props.dropdownMode, locale: a3.props.locale, dateFormat: a3.props.dateFormat, onChange: a3.changeMonthYear, minDate: a3.props.minDate, maxDate: a3.props.maxDate, date: a3.state.date, scrollableMonthYearDropdown: a3.props.scrollableMonthYearDropdown });
|
|
}), Dt(bt(a3), "renderTodayButton", function() {
|
|
if (a3.props.todayButton && !a3.props.showTimeSelectOnly)
|
|
return de.default.createElement("div", { className: "react-datepicker__today-button", onClick: function(e4) {
|
|
return a3.props.onSelect(Ve.default(Yt()), e4);
|
|
} }, a3.props.todayButton);
|
|
}), Dt(bt(a3), "renderDefaultHeader", function(e4) {
|
|
var t4 = e4.monthDate, r5 = e4.i;
|
|
return de.default.createElement("div", { className: "react-datepicker__header ".concat(a3.props.showTimeSelect ? "react-datepicker__header--has-time-select" : "") }, a3.renderCurrentMonth(t4), de.default.createElement("div", { className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(a3.props.dropdownMode), onFocus: a3.handleDropdownFocus }, a3.renderMonthDropdown(0 !== r5), a3.renderMonthYearDropdown(0 !== r5), a3.renderYearDropdown(0 !== r5)), de.default.createElement("div", { className: "react-datepicker__day-names" }, a3.header(t4)));
|
|
}), Dt(bt(a3), "renderCustomHeader", function() {
|
|
var e4 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t4 = e4.monthDate, r5 = e4.i;
|
|
if (a3.props.showTimeSelect && !a3.state.monthContainer || a3.props.showTimeSelectOnly)
|
|
return null;
|
|
var n3 = fr(a3.state.date, a3.props), o3 = hr(a3.state.date, a3.props), s3 = mr(a3.state.date, a3.props), i3 = yr(a3.state.date, a3.props), p3 = !a3.props.showMonthYearPicker && !a3.props.showQuarterYearPicker && !a3.props.showYearPicker;
|
|
return de.default.createElement("div", { className: "react-datepicker__header react-datepicker__header--custom", onFocus: a3.props.onDropdownFocus }, a3.props.renderCustomHeader(ut(ut({}, a3.state), {}, { customHeaderCount: r5, monthDate: t4, changeMonth: a3.changeMonth, changeYear: a3.changeYear, decreaseMonth: a3.decreaseMonth, increaseMonth: a3.increaseMonth, decreaseYear: a3.decreaseYear, increaseYear: a3.increaseYear, prevMonthButtonDisabled: n3, nextMonthButtonDisabled: o3, prevYearButtonDisabled: s3, nextYearButtonDisabled: i3 })), p3 && de.default.createElement("div", { className: "react-datepicker__day-names" }, a3.header(t4)));
|
|
}), Dt(bt(a3), "renderYearHeader", function() {
|
|
var e4 = a3.state.date, t4 = a3.props, r5 = t4.showYearPicker, n3 = br(e4, t4.yearItemNumber), o3 = n3.startPeriod, s3 = n3.endPeriod;
|
|
return de.default.createElement("div", { className: "react-datepicker__header react-datepicker-year-header" }, r5 ? "".concat(o3, " - ").concat(s3) : Ie.default(e4));
|
|
}), Dt(bt(a3), "renderHeader", function(e4) {
|
|
switch (true) {
|
|
case void 0 !== a3.props.renderCustomHeader:
|
|
return a3.renderCustomHeader(e4);
|
|
case (a3.props.showMonthYearPicker || a3.props.showQuarterYearPicker || a3.props.showYearPicker):
|
|
return a3.renderYearHeader(e4);
|
|
default:
|
|
return a3.renderDefaultHeader(e4);
|
|
}
|
|
}), Dt(bt(a3), "renderMonths", function() {
|
|
if (!a3.props.showTimeSelectOnly && !a3.props.showYearPicker) {
|
|
for (var e4 = [], t4 = a3.props.showPreviousMonths ? a3.props.monthsShown - 1 : 0, r5 = Se.default(a3.state.date, t4), n3 = 0; n3 < a3.props.monthsShown; ++n3) {
|
|
var o3 = n3 - a3.props.monthSelectedIn, s3 = we.default(r5, o3), i3 = "month-".concat(n3), p3 = n3 < a3.props.monthsShown - 1, l3 = n3 > 0;
|
|
e4.push(de.default.createElement("div", { key: i3, ref: function(e5) {
|
|
a3.monthContainer = e5;
|
|
}, className: "react-datepicker__month-container" }, a3.renderHeader({ monthDate: s3, i: n3 }), de.default.createElement(Fr, { chooseDayAriaLabelPrefix: a3.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: a3.props.disabledDayAriaLabelPrefix, weekAriaLabelPrefix: a3.props.weekAriaLabelPrefix, ariaLabelPrefix: a3.props.monthAriaLabelPrefix, onChange: a3.changeMonthYear, day: s3, dayClassName: a3.props.dayClassName, calendarStartDay: a3.props.calendarStartDay, monthClassName: a3.props.monthClassName, onDayClick: a3.handleDayClick, handleOnKeyDown: a3.props.handleOnDayKeyDown, onDayMouseEnter: a3.handleDayMouseEnter, onMouseLeave: a3.handleMonthMouseLeave, onWeekSelect: a3.props.onWeekSelect, orderInDisplay: n3, formatWeekNumber: a3.props.formatWeekNumber, locale: a3.props.locale, minDate: a3.props.minDate, maxDate: a3.props.maxDate, excludeDates: a3.props.excludeDates, excludeDateIntervals: a3.props.excludeDateIntervals, highlightDates: a3.props.highlightDates, selectingDate: a3.state.selectingDate, includeDates: a3.props.includeDates, includeDateIntervals: a3.props.includeDateIntervals, inline: a3.props.inline, shouldFocusDayInline: a3.props.shouldFocusDayInline, fixedHeight: a3.props.fixedHeight, filterDate: a3.props.filterDate, preSelection: a3.props.preSelection, setPreSelection: a3.props.setPreSelection, selected: a3.props.selected, selectsStart: a3.props.selectsStart, selectsEnd: a3.props.selectsEnd, selectsRange: a3.props.selectsRange, selectsDisabledDaysInRange: a3.props.selectsDisabledDaysInRange, showWeekNumbers: a3.props.showWeekNumbers, startDate: a3.props.startDate, endDate: a3.props.endDate, peekNextMonth: a3.props.peekNextMonth, setOpen: a3.props.setOpen, shouldCloseOnSelect: a3.props.shouldCloseOnSelect, renderDayContents: a3.props.renderDayContents, disabledKeyboardNavigation: a3.props.disabledKeyboardNavigation, showMonthYearPicker: a3.props.showMonthYearPicker, showFullMonthYearPicker: a3.props.showFullMonthYearPicker, showTwoColumnMonthYearPicker: a3.props.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker: a3.props.showFourColumnMonthYearPicker, showYearPicker: a3.props.showYearPicker, showQuarterYearPicker: a3.props.showQuarterYearPicker, isInputFocused: a3.props.isInputFocused, containerRef: a3.containerRef, monthShowsDuplicateDaysEnd: p3, monthShowsDuplicateDaysStart: l3 })));
|
|
}
|
|
return e4;
|
|
}
|
|
}), Dt(bt(a3), "renderYears", function() {
|
|
if (!a3.props.showTimeSelectOnly)
|
|
return a3.props.showYearPicker ? de.default.createElement("div", { className: "react-datepicker__year--container" }, a3.renderHeader(), de.default.createElement(qr, vt({ onDayClick: a3.handleDayClick, date: a3.state.date }, a3.props))) : void 0;
|
|
}), Dt(bt(a3), "renderTimeSection", function() {
|
|
if (a3.props.showTimeSelect && (a3.state.monthContainer || a3.props.showTimeSelectOnly))
|
|
return de.default.createElement(Ar, { selected: a3.props.selected, openToDate: a3.props.openToDate, onChange: a3.props.onTimeChange, timeClassName: a3.props.timeClassName, format: a3.props.timeFormat, includeTimes: a3.props.includeTimes, intervals: a3.props.timeIntervals, minTime: a3.props.minTime, maxTime: a3.props.maxTime, excludeTimes: a3.props.excludeTimes, filterTime: a3.props.filterTime, timeCaption: a3.props.timeCaption, todayButton: a3.props.todayButton, showMonthDropdown: a3.props.showMonthDropdown, showMonthYearDropdown: a3.props.showMonthYearDropdown, showYearDropdown: a3.props.showYearDropdown, withPortal: a3.props.withPortal, monthRef: a3.state.monthContainer, injectTimes: a3.props.injectTimes, locale: a3.props.locale, handleOnKeyDown: a3.props.handleOnKeyDown, showTimeSelectOnly: a3.props.showTimeSelectOnly });
|
|
}), Dt(bt(a3), "renderInputTimeSection", function() {
|
|
var e4 = new Date(a3.props.selected), t4 = Tt(e4) && Boolean(a3.props.selected) ? "".concat(kr(e4.getHours()), ":").concat(kr(e4.getMinutes())) : "";
|
|
if (a3.props.showTimeInput)
|
|
return de.default.createElement(Wr, { date: e4, timeString: t4, timeInputLabel: a3.props.timeInputLabel, onChange: a3.props.onTimeChange, customTimeInput: a3.props.customTimeInput });
|
|
}), a3.containerRef = de.default.createRef(), a3.state = { date: a3.getDateInView(), selectingDate: null, monthContainer: null }, a3;
|
|
}
|
|
return yt(r4, [{ key: "componentDidMount", value: function() {
|
|
var e3 = this;
|
|
this.props.showTimeSelect && (this.assignMonthContainer = void e3.setState({ monthContainer: e3.monthContainer }));
|
|
} }, { key: "componentDidUpdate", value: function(e3) {
|
|
this.props.preSelection && !$t(this.props.preSelection, e3.preSelection) ? this.setState({ date: this.props.preSelection }) : this.props.openToDate && !$t(this.props.openToDate, e3.openToDate) && this.setState({ date: this.props.openToDate });
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this.props.container || Br;
|
|
return de.default.createElement("div", { ref: this.containerRef }, de.default.createElement(e3, { className: ce.default("react-datepicker", this.props.className, { "react-datepicker--time-only": this.props.showTimeSelectOnly }), showPopperArrow: this.props.showPopperArrow, arrowProps: this.props.arrowProps }, this.renderPreviousButton(), this.renderNextButton(), this.renderMonths(), this.renderYears(), this.renderTodayButton(), this.renderTimeSection(), this.renderInputTimeSection(), this.props.children));
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { onDropdownFocus: function() {
|
|
}, monthsShown: 1, monthSelectedIn: 0, forceShowMonthNavigation: false, timeCaption: "Time", previousYearButtonLabel: "Previous Year", nextYearButtonLabel: "Next Year", previousMonthButtonLabel: "Previous Month", nextMonthButtonLabel: "Next Month", customTimeInput: null, yearItemNumber: xt };
|
|
} }]), r4;
|
|
}(de.default.Component), jr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), (a3 = t3.call(this, e3)).el = document.createElement("div"), a3;
|
|
}
|
|
return yt(r4, [{ key: "componentDidMount", value: function() {
|
|
this.portalRoot = (this.props.portalHost || document).getElementById(this.props.portalId), this.portalRoot || (this.portalRoot = document.createElement("div"), this.portalRoot.setAttribute("id", this.props.portalId), (this.props.portalHost || document.body).appendChild(this.portalRoot)), this.portalRoot.appendChild(this.el);
|
|
} }, { key: "componentWillUnmount", value: function() {
|
|
this.portalRoot.removeChild(this.el);
|
|
} }, { key: "render", value: function() {
|
|
return dt.default.createPortal(this.props.children, this.el);
|
|
} }]), r4;
|
|
}(de.default.Component), Qr = function(e2) {
|
|
return !e2.disabled && -1 !== e2.tabIndex;
|
|
}, Vr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "getTabChildren", function() {
|
|
return Array.prototype.slice.call(a3.tabLoopRef.current.querySelectorAll("[tabindex], a, button, input, select, textarea"), 1, -1).filter(Qr);
|
|
}), Dt(bt(a3), "handleFocusStart", function(e4) {
|
|
var t4 = a3.getTabChildren();
|
|
t4 && t4.length > 1 && t4[t4.length - 1].focus();
|
|
}), Dt(bt(a3), "handleFocusEnd", function(e4) {
|
|
var t4 = a3.getTabChildren();
|
|
t4 && t4.length > 1 && t4[0].focus();
|
|
}), a3.tabLoopRef = de.default.createRef(), a3;
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
return this.props.enableTabLoop ? de.default.createElement("div", { className: "react-datepicker__tab-loop", ref: this.tabLoopRef }, de.default.createElement("div", { className: "react-datepicker__tab-loop__start", tabIndex: "0", onFocus: this.handleFocusStart }), this.props.children, de.default.createElement("div", { className: "react-datepicker__tab-loop__end", tabIndex: "0", onFocus: this.handleFocusEnd })) : this.props.children;
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { enableTabLoop: true };
|
|
} }]), r4;
|
|
}(de.default.Component), Ur = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4() {
|
|
return ht(this, r4), t3.apply(this, arguments);
|
|
}
|
|
return yt(r4, [{ key: "render", value: function() {
|
|
var e3, t4 = this.props, r5 = t4.className, a3 = t4.wrapperClassName, n3 = t4.hidePopper, o3 = t4.popperComponent, s3 = t4.popperModifiers, i3 = t4.popperPlacement, p3 = t4.popperProps, l3 = t4.targetComponent, d3 = t4.enableTabLoop, c3 = t4.popperOnKeyDown, u3 = t4.portalId, f3 = t4.portalHost;
|
|
if (!n3) {
|
|
var h3 = ce.default("react-datepicker-popper", r5);
|
|
e3 = de.default.createElement(pe.Popper, vt({ modifiers: s3, placement: i3 }, p3), function(e4) {
|
|
var t5 = e4.ref, r6 = e4.style, a4 = e4.placement, n4 = e4.arrowProps;
|
|
return de.default.createElement(Vr, { enableTabLoop: d3 }, de.default.createElement("div", { ref: t5, style: r6, className: h3, "data-placement": a4, onKeyDown: c3 }, de.default.cloneElement(o3, { arrowProps: n4 })));
|
|
});
|
|
}
|
|
this.props.popperContainer && (e3 = de.default.createElement(this.props.popperContainer, {}, e3)), u3 && !n3 && (e3 = de.default.createElement(jr, { portalId: u3, portalHost: f3 }, e3));
|
|
var m3 = ce.default("react-datepicker-wrapper", a3);
|
|
return de.default.createElement(pe.Manager, { className: "react-datepicker-manager" }, de.default.createElement(pe.Reference, null, function(e4) {
|
|
var t5 = e4.ref;
|
|
return de.default.createElement("div", { ref: t5, className: m3 }, l3);
|
|
}), e3);
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { hidePopper: true, popperModifiers: [], popperProps: {}, popperPlacement: "bottom-start" };
|
|
} }]), r4;
|
|
}(de.default.Component), $r = "react-datepicker-ignore-onclickoutside", zr = lt.default(Hr);
|
|
var Gr = "Date input not valid.", Jr = function(e2) {
|
|
wt(r4, e2);
|
|
var t3 = Ct(r4);
|
|
function r4(e3) {
|
|
var a3;
|
|
return ht(this, r4), Dt(bt(a3 = t3.call(this, e3)), "getPreSelection", function() {
|
|
return a3.props.openToDate ? a3.props.openToDate : a3.props.selectsEnd && a3.props.startDate ? a3.props.startDate : a3.props.selectsStart && a3.props.endDate ? a3.props.endDate : Yt();
|
|
}), Dt(bt(a3), "calcInitialState", function() {
|
|
var e4, t4 = a3.getPreSelection(), r5 = Dr(a3.props), n3 = vr(a3.props), o3 = r5 && nt.default(t4, Ve.default(r5)) ? r5 : n3 && at.default(t4, Je.default(n3)) ? n3 : t4;
|
|
return { open: a3.props.startOpen || false, preventFocus: false, preSelection: null !== (e4 = a3.props.selectsRange ? a3.props.startDate : a3.props.selected) && void 0 !== e4 ? e4 : o3, highlightDates: wr(a3.props.highlightDates), focused: false, shouldFocusDayInline: false };
|
|
}), Dt(bt(a3), "clearPreventFocusTimeout", function() {
|
|
a3.preventFocusTimeout && clearTimeout(a3.preventFocusTimeout);
|
|
}), Dt(bt(a3), "setFocus", function() {
|
|
a3.input && a3.input.focus && a3.input.focus({ preventScroll: true });
|
|
}), Dt(bt(a3), "setBlur", function() {
|
|
a3.input && a3.input.blur && a3.input.blur(), a3.cancelFocusInput();
|
|
}), Dt(bt(a3), "setOpen", function(e4) {
|
|
var t4 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
a3.setState({ open: e4, preSelection: e4 && a3.state.open ? a3.state.preSelection : a3.calcInitialState().preSelection, lastPreSelectChange: Zr }, function() {
|
|
e4 || a3.setState(function(e5) {
|
|
return { focused: !!t4 && e5.focused };
|
|
}, function() {
|
|
!t4 && a3.setBlur(), a3.setState({ inputValue: null });
|
|
});
|
|
});
|
|
}), Dt(bt(a3), "inputOk", function() {
|
|
return ue.default(a3.state.preSelection);
|
|
}), Dt(bt(a3), "isCalendarOpen", function() {
|
|
return void 0 === a3.props.open ? a3.state.open && !a3.props.disabled && !a3.props.readOnly : a3.props.open;
|
|
}), Dt(bt(a3), "handleFocus", function(e4) {
|
|
a3.state.preventFocus || (a3.props.onFocus(e4), a3.props.preventOpenOnFocus || a3.props.readOnly || a3.setOpen(true)), a3.setState({ focused: true });
|
|
}), Dt(bt(a3), "cancelFocusInput", function() {
|
|
clearTimeout(a3.inputFocusTimeout), a3.inputFocusTimeout = null;
|
|
}), Dt(bt(a3), "deferFocusInput", function() {
|
|
a3.cancelFocusInput(), a3.inputFocusTimeout = setTimeout(function() {
|
|
return a3.setFocus();
|
|
}, 1);
|
|
}), Dt(bt(a3), "handleDropdownFocus", function() {
|
|
a3.cancelFocusInput();
|
|
}), Dt(bt(a3), "handleBlur", function(e4) {
|
|
(!a3.state.open || a3.props.withPortal || a3.props.showTimeInput) && a3.props.onBlur(e4), a3.setState({ focused: false });
|
|
}), Dt(bt(a3), "handleCalendarClickOutside", function(e4) {
|
|
a3.props.inline || a3.setOpen(false), a3.props.onClickOutside(e4), a3.props.withPortal && e4.preventDefault();
|
|
}), Dt(bt(a3), "handleChange", function() {
|
|
for (var e4 = arguments.length, t4 = new Array(e4), r5 = 0; r5 < e4; r5++)
|
|
t4[r5] = arguments[r5];
|
|
var n3 = t4[0];
|
|
if (!a3.props.onChangeRaw || (a3.props.onChangeRaw.apply(bt(a3), t4), "function" == typeof n3.isDefaultPrevented && !n3.isDefaultPrevented())) {
|
|
a3.setState({ inputValue: n3.target.value, lastPreSelectChange: Xr });
|
|
var o3 = It(n3.target.value, a3.props.dateFormat, a3.props.locale, a3.props.strictParsing, a3.props.minDate);
|
|
!o3 && n3.target.value || a3.setSelected(o3, n3, true);
|
|
}
|
|
}), Dt(bt(a3), "handleSelect", function(e4, t4, r5) {
|
|
if (a3.setState({ preventFocus: true }, function() {
|
|
return a3.preventFocusTimeout = setTimeout(function() {
|
|
return a3.setState({ preventFocus: false });
|
|
}, 50), a3.preventFocusTimeout;
|
|
}), a3.props.onChangeRaw && a3.props.onChangeRaw(t4), a3.setSelected(e4, t4, false, r5), !a3.props.shouldCloseOnSelect || a3.props.showTimeSelect)
|
|
a3.setPreSelection(e4);
|
|
else if (!a3.props.inline) {
|
|
a3.props.selectsRange || a3.setOpen(false);
|
|
var n3 = a3.props, o3 = n3.startDate, s3 = n3.endDate;
|
|
!o3 || s3 || nt.default(e4, o3) || a3.setOpen(false);
|
|
}
|
|
}), Dt(bt(a3), "setSelected", function(e4, t4, r5, n3) {
|
|
var o3 = e4;
|
|
if (null === o3 || !rr(o3, a3.props)) {
|
|
var s3 = a3.props, i3 = s3.onChange, p3 = s3.selectsRange, l3 = s3.startDate, d3 = s3.endDate;
|
|
if (!zt(a3.props.selected, o3) || a3.props.allowSameDay || p3)
|
|
if (null !== o3 && (!a3.props.selected || r5 && (a3.props.showTimeSelect || a3.props.showTimeSelectOnly || a3.props.showTimeInput) || (o3 = Ft(o3, { hour: Pe.default(a3.props.selected), minute: Me.default(a3.props.selected), second: _e.default(a3.props.selected) })), a3.props.inline || a3.setState({ preSelection: o3 }), a3.props.focusSelectedMonth || a3.setState({ monthSelectedIn: n3 })), p3) {
|
|
var c3 = l3 && !d3, u3 = l3 && d3;
|
|
!l3 && !d3 ? i3([o3, null], t4) : c3 && (nt.default(o3, l3) ? i3([o3, null], t4) : i3([l3, o3], t4)), u3 && i3([o3, null], t4);
|
|
} else
|
|
i3(o3, t4);
|
|
r5 || (a3.props.onSelect(o3, t4), a3.setState({ inputValue: null }));
|
|
}
|
|
}), Dt(bt(a3), "setPreSelection", function(e4) {
|
|
var t4 = void 0 !== a3.props.minDate, r5 = void 0 !== a3.props.maxDate, n3 = true;
|
|
if (e4) {
|
|
var o3 = Ve.default(e4);
|
|
if (t4 && r5)
|
|
n3 = Gt(e4, a3.props.minDate, a3.props.maxDate);
|
|
else if (t4) {
|
|
var s3 = Ve.default(a3.props.minDate);
|
|
n3 = at.default(e4, s3) || zt(o3, s3);
|
|
} else if (r5) {
|
|
var i3 = Je.default(a3.props.maxDate);
|
|
n3 = nt.default(e4, i3) || zt(o3, i3);
|
|
}
|
|
}
|
|
n3 && a3.setState({ preSelection: e4 });
|
|
}), Dt(bt(a3), "handleTimeChange", function(e4) {
|
|
var t4 = Ft(a3.props.selected ? a3.props.selected : a3.getPreSelection(), { hour: Pe.default(e4), minute: Me.default(e4) });
|
|
a3.setState({ preSelection: t4 }), a3.props.onChange(t4), a3.props.shouldCloseOnSelect && a3.setOpen(false), a3.props.showTimeInput && a3.setOpen(true), a3.setState({ inputValue: null });
|
|
}), Dt(bt(a3), "onInputClick", function() {
|
|
a3.props.disabled || a3.props.readOnly || a3.setOpen(true), a3.props.onInputClick();
|
|
}), Dt(bt(a3), "onInputKeyDown", function(e4) {
|
|
a3.props.onKeyDown(e4);
|
|
var t4 = e4.key;
|
|
if (a3.state.open || a3.props.inline || a3.props.preventOpenOnFocus) {
|
|
if (a3.state.open) {
|
|
if ("ArrowDown" === t4 || "ArrowUp" === t4) {
|
|
e4.preventDefault();
|
|
var r5 = a3.calendar.componentNode && a3.calendar.componentNode.querySelector('.react-datepicker__day[tabindex="0"]');
|
|
return void (r5 && r5.focus({ preventScroll: true }));
|
|
}
|
|
var n3 = Yt(a3.state.preSelection);
|
|
"Enter" === t4 ? (e4.preventDefault(), a3.inputOk() && a3.state.lastPreSelectChange === Zr ? (a3.handleSelect(n3, e4), !a3.props.shouldCloseOnSelect && a3.setPreSelection(n3)) : a3.setOpen(false)) : "Escape" === t4 && (e4.preventDefault(), a3.setOpen(false)), a3.inputOk() || a3.props.onInputError({ code: 1, msg: Gr });
|
|
}
|
|
} else
|
|
"ArrowDown" !== t4 && "ArrowUp" !== t4 && "Enter" !== t4 || a3.onInputClick();
|
|
}), Dt(bt(a3), "onDayKeyDown", function(e4) {
|
|
a3.props.onKeyDown(e4);
|
|
var t4 = e4.key, r5 = Yt(a3.state.preSelection);
|
|
if ("Enter" === t4)
|
|
e4.preventDefault(), a3.handleSelect(r5, e4), !a3.props.shouldCloseOnSelect && a3.setPreSelection(r5);
|
|
else if ("Escape" === t4)
|
|
e4.preventDefault(), a3.setOpen(false), a3.inputOk() || a3.props.onInputError({ code: 1, msg: Gr });
|
|
else if (!a3.props.disabledKeyboardNavigation) {
|
|
var n3;
|
|
switch (t4) {
|
|
case "ArrowLeft":
|
|
n3 = ke.default(r5, 1);
|
|
break;
|
|
case "ArrowRight":
|
|
n3 = De.default(r5, 1);
|
|
break;
|
|
case "ArrowUp":
|
|
n3 = be.default(r5, 1);
|
|
break;
|
|
case "ArrowDown":
|
|
n3 = ve.default(r5, 1);
|
|
break;
|
|
case "PageUp":
|
|
n3 = Se.default(r5, 1);
|
|
break;
|
|
case "PageDown":
|
|
n3 = we.default(r5, 1);
|
|
break;
|
|
case "Home":
|
|
n3 = Ce.default(r5, 1);
|
|
break;
|
|
case "End":
|
|
n3 = ge.default(r5, 1);
|
|
}
|
|
if (!n3)
|
|
return void (a3.props.onInputError && a3.props.onInputError({ code: 1, msg: Gr }));
|
|
if (e4.preventDefault(), a3.setState({ lastPreSelectChange: Zr }), a3.props.adjustDateOnChange && a3.setSelected(n3), a3.setPreSelection(n3), a3.props.inline) {
|
|
var o3 = Oe.default(r5), s3 = Oe.default(n3), i3 = Ie.default(r5), p3 = Ie.default(n3);
|
|
o3 !== s3 || i3 !== p3 ? a3.setState({ shouldFocusDayInline: true }) : a3.setState({ shouldFocusDayInline: false });
|
|
}
|
|
}
|
|
}), Dt(bt(a3), "onPopperKeyDown", function(e4) {
|
|
"Escape" === e4.key && (e4.preventDefault(), a3.setState({ preventFocus: true }, function() {
|
|
a3.setOpen(false), setTimeout(function() {
|
|
a3.setFocus(), a3.setState({ preventFocus: false });
|
|
});
|
|
}));
|
|
}), Dt(bt(a3), "onClearClick", function(e4) {
|
|
e4 && e4.preventDefault && e4.preventDefault(), a3.props.selectsRange ? a3.props.onChange([null, null], e4) : a3.props.onChange(null, e4), a3.setState({ inputValue: null });
|
|
}), Dt(bt(a3), "clear", function() {
|
|
a3.onClearClick();
|
|
}), Dt(bt(a3), "onScroll", function(e4) {
|
|
"boolean" == typeof a3.props.closeOnScroll && a3.props.closeOnScroll ? e4.target !== document && e4.target !== document.documentElement && e4.target !== document.body || a3.setOpen(false) : "function" == typeof a3.props.closeOnScroll && a3.props.closeOnScroll(e4) && a3.setOpen(false);
|
|
}), Dt(bt(a3), "renderCalendar", function() {
|
|
return a3.props.inline || a3.isCalendarOpen() ? de.default.createElement(zr, { ref: function(e4) {
|
|
a3.calendar = e4;
|
|
}, locale: a3.props.locale, calendarStartDay: a3.props.calendarStartDay, chooseDayAriaLabelPrefix: a3.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: a3.props.disabledDayAriaLabelPrefix, weekAriaLabelPrefix: a3.props.weekAriaLabelPrefix, monthAriaLabelPrefix: a3.props.monthAriaLabelPrefix, adjustDateOnChange: a3.props.adjustDateOnChange, setOpen: a3.setOpen, shouldCloseOnSelect: a3.props.shouldCloseOnSelect, dateFormat: a3.props.dateFormatCalendar, useWeekdaysShort: a3.props.useWeekdaysShort, formatWeekDay: a3.props.formatWeekDay, dropdownMode: a3.props.dropdownMode, selected: a3.props.selected, preSelection: a3.state.preSelection, onSelect: a3.handleSelect, onWeekSelect: a3.props.onWeekSelect, openToDate: a3.props.openToDate, minDate: a3.props.minDate, maxDate: a3.props.maxDate, selectsStart: a3.props.selectsStart, selectsEnd: a3.props.selectsEnd, selectsRange: a3.props.selectsRange, startDate: a3.props.startDate, endDate: a3.props.endDate, excludeDates: a3.props.excludeDates, excludeDateIntervals: a3.props.excludeDateIntervals, filterDate: a3.props.filterDate, onClickOutside: a3.handleCalendarClickOutside, formatWeekNumber: a3.props.formatWeekNumber, highlightDates: a3.state.highlightDates, includeDates: a3.props.includeDates, includeDateIntervals: a3.props.includeDateIntervals, includeTimes: a3.props.includeTimes, injectTimes: a3.props.injectTimes, inline: a3.props.inline, shouldFocusDayInline: a3.state.shouldFocusDayInline, peekNextMonth: a3.props.peekNextMonth, showMonthDropdown: a3.props.showMonthDropdown, showPreviousMonths: a3.props.showPreviousMonths, useShortMonthInDropdown: a3.props.useShortMonthInDropdown, showMonthYearDropdown: a3.props.showMonthYearDropdown, showWeekNumbers: a3.props.showWeekNumbers, showYearDropdown: a3.props.showYearDropdown, withPortal: a3.props.withPortal, forceShowMonthNavigation: a3.props.forceShowMonthNavigation, showDisabledMonthNavigation: a3.props.showDisabledMonthNavigation, scrollableYearDropdown: a3.props.scrollableYearDropdown, scrollableMonthYearDropdown: a3.props.scrollableMonthYearDropdown, todayButton: a3.props.todayButton, weekLabel: a3.props.weekLabel, outsideClickIgnoreClass: $r, fixedHeight: a3.props.fixedHeight, monthsShown: a3.props.monthsShown, monthSelectedIn: a3.state.monthSelectedIn, onDropdownFocus: a3.handleDropdownFocus, onMonthChange: a3.props.onMonthChange, onYearChange: a3.props.onYearChange, dayClassName: a3.props.dayClassName, weekDayClassName: a3.props.weekDayClassName, monthClassName: a3.props.monthClassName, timeClassName: a3.props.timeClassName, showTimeSelect: a3.props.showTimeSelect, showTimeSelectOnly: a3.props.showTimeSelectOnly, onTimeChange: a3.handleTimeChange, timeFormat: a3.props.timeFormat, timeIntervals: a3.props.timeIntervals, minTime: a3.props.minTime, maxTime: a3.props.maxTime, excludeTimes: a3.props.excludeTimes, filterTime: a3.props.filterTime, timeCaption: a3.props.timeCaption, className: a3.props.calendarClassName, container: a3.props.calendarContainer, yearItemNumber: a3.props.yearItemNumber, yearDropdownItemNumber: a3.props.yearDropdownItemNumber, previousMonthAriaLabel: a3.props.previousMonthAriaLabel, previousMonthButtonLabel: a3.props.previousMonthButtonLabel, nextMonthAriaLabel: a3.props.nextMonthAriaLabel, nextMonthButtonLabel: a3.props.nextMonthButtonLabel, previousYearAriaLabel: a3.props.previousYearAriaLabel, previousYearButtonLabel: a3.props.previousYearButtonLabel, nextYearAriaLabel: a3.props.nextYearAriaLabel, nextYearButtonLabel: a3.props.nextYearButtonLabel, timeInputLabel: a3.props.timeInputLabel, disabledKeyboardNavigation: a3.props.disabledKeyboardNavigation, renderCustomHeader: a3.props.renderCustomHeader, popperProps: a3.props.popperProps, renderDayContents: a3.props.renderDayContents, onDayMouseEnter: a3.props.onDayMouseEnter, onMonthMouseLeave: a3.props.onMonthMouseLeave, selectsDisabledDaysInRange: a3.props.selectsDisabledDaysInRange, showTimeInput: a3.props.showTimeInput, showMonthYearPicker: a3.props.showMonthYearPicker, showFullMonthYearPicker: a3.props.showFullMonthYearPicker, showTwoColumnMonthYearPicker: a3.props.showTwoColumnMonthYearPicker, showFourColumnMonthYearPicker: a3.props.showFourColumnMonthYearPicker, showYearPicker: a3.props.showYearPicker, showQuarterYearPicker: a3.props.showQuarterYearPicker, showPopperArrow: a3.props.showPopperArrow, excludeScrollbar: a3.props.excludeScrollbar, handleOnKeyDown: a3.props.onKeyDown, handleOnDayKeyDown: a3.onDayKeyDown, isInputFocused: a3.state.focused, customTimeInput: a3.props.customTimeInput, setPreSelection: a3.setPreSelection }, a3.props.children) : null;
|
|
}), Dt(bt(a3), "renderDateInput", function() {
|
|
var e4, t4 = ce.default(a3.props.className, Dt({}, $r, a3.state.open)), r5 = a3.props.customInput || de.default.createElement("input", { type: "text" }), n3 = a3.props.customInputRef || "ref", o3 = "string" == typeof a3.props.value ? a3.props.value : "string" == typeof a3.state.inputValue ? a3.state.inputValue : a3.props.selectsRange ? function(e5, t5, r6) {
|
|
if (!e5)
|
|
return "";
|
|
var a4 = Rt(e5, r6), n4 = t5 ? Rt(t5, r6) : "";
|
|
return "".concat(a4, " - ").concat(n4);
|
|
}(a3.props.startDate, a3.props.endDate, a3.props) : Rt(a3.props.selected, a3.props);
|
|
return de.default.cloneElement(r5, (Dt(e4 = {}, n3, function(e5) {
|
|
a3.input = e5;
|
|
}), Dt(e4, "value", o3), Dt(e4, "onBlur", a3.handleBlur), Dt(e4, "onChange", a3.handleChange), Dt(e4, "onClick", a3.onInputClick), Dt(e4, "onFocus", a3.handleFocus), Dt(e4, "onKeyDown", a3.onInputKeyDown), Dt(e4, "id", a3.props.id), Dt(e4, "name", a3.props.name), Dt(e4, "autoFocus", a3.props.autoFocus), Dt(e4, "placeholder", a3.props.placeholderText), Dt(e4, "disabled", a3.props.disabled), Dt(e4, "autoComplete", a3.props.autoComplete), Dt(e4, "className", ce.default(r5.props.className, t4)), Dt(e4, "title", a3.props.title), Dt(e4, "readOnly", a3.props.readOnly), Dt(e4, "required", a3.props.required), Dt(e4, "tabIndex", a3.props.tabIndex), Dt(e4, "aria-describedby", a3.props.ariaDescribedBy), Dt(e4, "aria-invalid", a3.props.ariaInvalid), Dt(e4, "aria-labelledby", a3.props.ariaLabelledBy), Dt(e4, "aria-required", a3.props.ariaRequired), e4));
|
|
}), Dt(bt(a3), "renderClearButton", function() {
|
|
var e4 = a3.props, t4 = e4.isClearable, r5 = e4.selected, n3 = e4.startDate, o3 = e4.endDate, s3 = e4.clearButtonTitle, i3 = e4.clearButtonClassName, p3 = void 0 === i3 ? "" : i3, l3 = e4.ariaLabelClose, d3 = void 0 === l3 ? "Close" : l3;
|
|
return !t4 || null == r5 && null == n3 && null == o3 ? null : de.default.createElement("button", { type: "button", className: "react-datepicker__close-icon ".concat(p3).trim(), "aria-label": d3, onClick: a3.onClearClick, title: s3, tabIndex: -1 });
|
|
}), a3.state = a3.calcInitialState(), a3;
|
|
}
|
|
return yt(r4, [{ key: "componentDidMount", value: function() {
|
|
window.addEventListener("scroll", this.onScroll, true);
|
|
} }, { key: "componentDidUpdate", value: function(e3, t4) {
|
|
var r5, a3;
|
|
e3.inline && (r5 = e3.selected, a3 = this.props.selected, r5 && a3 ? Oe.default(r5) !== Oe.default(a3) || Ie.default(r5) !== Ie.default(a3) : r5 !== a3) && this.setPreSelection(this.props.selected), void 0 !== this.state.monthSelectedIn && e3.monthsShown !== this.props.monthsShown && this.setState({ monthSelectedIn: 0 }), e3.highlightDates !== this.props.highlightDates && this.setState({ highlightDates: wr(this.props.highlightDates) }), t4.focused || zt(e3.selected, this.props.selected) || this.setState({ inputValue: null }), t4.open !== this.state.open && (false === t4.open && true === this.state.open && this.props.onCalendarOpen(), true === t4.open && false === this.state.open && this.props.onCalendarClose());
|
|
} }, { key: "componentWillUnmount", value: function() {
|
|
this.clearPreventFocusTimeout(), window.removeEventListener("scroll", this.onScroll, true);
|
|
} }, { key: "renderInputContainer", value: function() {
|
|
return de.default.createElement("div", { className: "react-datepicker__input-container" }, this.renderDateInput(), this.renderClearButton());
|
|
} }, { key: "render", value: function() {
|
|
var e3 = this.renderCalendar();
|
|
if (this.props.inline)
|
|
return e3;
|
|
if (this.props.withPortal) {
|
|
var t4 = this.state.open ? de.default.createElement("div", { className: "react-datepicker__portal" }, e3) : null;
|
|
return this.state.open && this.props.portalId && (t4 = de.default.createElement(jr, { portalId: this.props.portalId, portalHost: this.props.portalHost }, t4)), de.default.createElement("div", null, this.renderInputContainer(), t4);
|
|
}
|
|
return de.default.createElement(Ur, { className: this.props.popperClassName, wrapperClassName: this.props.wrapperClassName, hidePopper: !this.isCalendarOpen(), portalId: this.props.portalId, portalHost: this.props.portalHost, popperModifiers: this.props.popperModifiers, targetComponent: this.renderInputContainer(), popperContainer: this.props.popperContainer, popperComponent: e3, popperPlacement: this.props.popperPlacement, popperProps: this.props.popperProps, popperOnKeyDown: this.onPopperKeyDown, enableTabLoop: this.props.enableTabLoop });
|
|
} }], [{ key: "defaultProps", get: function() {
|
|
return { allowSameDay: false, dateFormat: "MM/dd/yyyy", dateFormatCalendar: "LLLL yyyy", onChange: function() {
|
|
}, disabled: false, disabledKeyboardNavigation: false, dropdownMode: "scroll", onFocus: function() {
|
|
}, onBlur: function() {
|
|
}, onKeyDown: function() {
|
|
}, onInputClick: function() {
|
|
}, onSelect: function() {
|
|
}, onClickOutside: function() {
|
|
}, onMonthChange: function() {
|
|
}, onCalendarOpen: function() {
|
|
}, onCalendarClose: function() {
|
|
}, preventOpenOnFocus: false, onYearChange: function() {
|
|
}, onInputError: function() {
|
|
}, monthsShown: 1, readOnly: false, withPortal: false, selectsDisabledDaysInRange: false, shouldCloseOnSelect: true, showTimeSelect: false, showTimeInput: false, showPreviousMonths: false, showMonthYearPicker: false, showFullMonthYearPicker: false, showTwoColumnMonthYearPicker: false, showFourColumnMonthYearPicker: false, showYearPicker: false, showQuarterYearPicker: false, strictParsing: false, timeIntervals: 30, timeCaption: "Time", previousMonthAriaLabel: "Previous Month", previousMonthButtonLabel: "Previous Month", nextMonthAriaLabel: "Next Month", nextMonthButtonLabel: "Next Month", previousYearAriaLabel: "Previous Year", previousYearButtonLabel: "Previous Year", nextYearAriaLabel: "Next Year", nextYearButtonLabel: "Next Year", timeInputLabel: "Time", enableTabLoop: true, yearItemNumber: xt, renderDayContents: function(e3) {
|
|
return e3;
|
|
}, focusSelectedMonth: false, showPopperArrow: true, excludeScrollbar: true, customTimeInput: null, calendarStartDay: void 0 };
|
|
} }]), r4;
|
|
}(de.default.Component), Xr = "input", Zr = "navigate";
|
|
e.CalendarContainer = Br, e.default = Jr, e.getDefaultLocale = Jt, e.registerLocale = function(e2, t3) {
|
|
var r4 = "undefined" != typeof window ? window : globalThis;
|
|
r4.__localeData__ || (r4.__localeData__ = {}), r4.__localeData__[e2] = t3;
|
|
}, e.setDefaultLocale = function(e2) {
|
|
("undefined" != typeof window ? window : globalThis).__localeId__ = e2;
|
|
}, Object.defineProperty(e, "__esModule", { value: true });
|
|
});
|
|
}
|
|
});
|
|
|
|
// src/main.ts
|
|
var main_exports = {};
|
|
__export(main_exports, {
|
|
DEFAULT_SETTINGS: () => DEFAULT_SETTINGS,
|
|
default: () => NltPlugin
|
|
});
|
|
module.exports = __toCommonJS(main_exports);
|
|
var import_obsidian6 = require("obsidian");
|
|
|
|
// src/NltSettingsTab.ts
|
|
var import_obsidian = require("obsidian");
|
|
var import_obsidian2 = require("obsidian");
|
|
var NltSettingsTab = class extends import_obsidian.PluginSettingTab {
|
|
constructor(app2, plugin) {
|
|
super(app2, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
let { containerEl } = this;
|
|
containerEl.empty();
|
|
new import_obsidian2.Setting(containerEl).setName("Table definition folder").setDesc(
|
|
"The folder that contains the NLT table definition files. Do not include any slashes. e.g. '_notion-like-tables'"
|
|
).addText((cb) => {
|
|
cb.setValue(this.plugin.settings.tableFolder).onChange(
|
|
(value) => __async(this, null, function* () {
|
|
this.plugin.settings.tableFolder = value;
|
|
yield this.plugin.saveSettings();
|
|
})
|
|
);
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Debug mode").setDesc("Turns on console.log for various table events").addToggle((cb) => {
|
|
cb.setValue(this.plugin.settings.shouldDebug).onChange(
|
|
(value) => __async(this, null, function* () {
|
|
this.plugin.settings.shouldDebug = value;
|
|
yield this.plugin.saveSettings();
|
|
})
|
|
);
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/NltTable.tsx
|
|
var import_client = __toESM(require_client());
|
|
var import_obsidian4 = require("obsidian");
|
|
|
|
// src/App.tsx
|
|
var import_react17 = __toESM(require_react());
|
|
var import_lodash = __toESM(require_lodash());
|
|
|
|
// src/components/EditableTd/index.tsx
|
|
var import_obsidian3 = require("obsidian");
|
|
|
|
// node_modules/html-react-parser/index.mjs
|
|
var import_index = __toESM(require_html_react_parser(), 1);
|
|
var domToReact = import_index.default.domToReact;
|
|
var htmlToDOM = import_index.default.htmlToDOM;
|
|
var attributesToProps = import_index.default.attributesToProps;
|
|
var Element2 = import_index.default.Element;
|
|
var html_react_parser_default = import_index.default;
|
|
|
|
// src/components/TextCell/index.tsx
|
|
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
|
function TextCell({
|
|
content,
|
|
shouldWrapOverflow,
|
|
useAutoWidth
|
|
}) {
|
|
let className = "NLT__text-cell";
|
|
if (useAutoWidth) {
|
|
className += " NLT__auto-width";
|
|
} else {
|
|
if (shouldWrapOverflow) {
|
|
className += " NLT__wrap-overflow";
|
|
} else {
|
|
className += " NLT__hide-overflow";
|
|
}
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
className,
|
|
children: html_react_parser_default(content)
|
|
});
|
|
}
|
|
|
|
// src/constants.ts
|
|
var COLOR = {
|
|
LIGHT_GRAY: "light gray",
|
|
GRAY: "gray",
|
|
BROWN: "brown",
|
|
ORANGE: "orange",
|
|
YELLOW: "yellow",
|
|
GREEN: "green",
|
|
BLUE: "blue",
|
|
PURPLE: "purple",
|
|
PINK: "pink",
|
|
RED: "red"
|
|
};
|
|
var CURRENT_PLUGIN_VERSION = 505;
|
|
|
|
// src/services/color/index.ts
|
|
var findColorClass = (isDarkMode, color2) => {
|
|
switch (color2) {
|
|
case COLOR.LIGHT_GRAY:
|
|
return isDarkMode ? "NLT__light-gray--dark" : "NLT__light-gray--light";
|
|
case COLOR.GRAY:
|
|
return isDarkMode ? "NLT__gray--dark" : "NLT__gray--light";
|
|
case COLOR.BROWN:
|
|
return isDarkMode ? "NLT__brown--dark" : "NLT__brown--light";
|
|
case COLOR.ORANGE:
|
|
return isDarkMode ? "NLT__orange--dark" : "NLT__orange--light";
|
|
case COLOR.YELLOW:
|
|
return isDarkMode ? "NLT__yellow--dark" : "NLT__yellow--light";
|
|
case COLOR.GREEN:
|
|
return isDarkMode ? "NLT__green--dark" : "NLT__green--light";
|
|
case COLOR.BLUE:
|
|
return isDarkMode ? "NLT__blue--dark" : "NLT__blue--light";
|
|
case COLOR.PURPLE:
|
|
return isDarkMode ? "NLT__purple--dark" : "NLT__purple--light";
|
|
case COLOR.PINK:
|
|
return isDarkMode ? "NLT__pink--dark" : "NLT__pink--light";
|
|
case COLOR.RED:
|
|
return isDarkMode ? "NLT__red--dark" : "NLT__red--light";
|
|
default:
|
|
return "";
|
|
}
|
|
};
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/extends.js
|
|
function _extends() {
|
|
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
var source = arguments[i2];
|
|
for (var key in source) {
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
target[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return target;
|
|
};
|
|
return _extends.apply(this, arguments);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/deepmerge.js
|
|
function isPlainObject(item) {
|
|
return item !== null && typeof item === "object" && item.constructor === Object;
|
|
}
|
|
function deepmerge(target, source, options = {
|
|
clone: true
|
|
}) {
|
|
const output = options.clone ? _extends({}, target) : target;
|
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
Object.keys(source).forEach((key) => {
|
|
if (key === "__proto__") {
|
|
return;
|
|
}
|
|
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
output[key] = deepmerge(target[key], source[key], options);
|
|
} else {
|
|
output[key] = source[key];
|
|
}
|
|
});
|
|
}
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/getDisplayName.js
|
|
var import_react_is = __toESM(require_react_is2());
|
|
var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
function getFunctionName(fn2) {
|
|
const match = `${fn2}`.match(fnNameMatchRegex);
|
|
const name = match && match[1];
|
|
return name || "";
|
|
}
|
|
function getFunctionComponentName(Component, fallback = "") {
|
|
return Component.displayName || Component.name || getFunctionName(Component) || fallback;
|
|
}
|
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
const functionName = getFunctionComponentName(innerType);
|
|
return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
|
|
}
|
|
function getDisplayName(Component) {
|
|
if (Component == null) {
|
|
return void 0;
|
|
}
|
|
if (typeof Component === "string") {
|
|
return Component;
|
|
}
|
|
if (typeof Component === "function") {
|
|
return getFunctionComponentName(Component, "Component");
|
|
}
|
|
if (typeof Component === "object") {
|
|
switch (Component.$$typeof) {
|
|
case import_react_is.ForwardRef:
|
|
return getWrappedName(Component, Component.render, "ForwardRef");
|
|
case import_react_is.Memo:
|
|
return getWrappedName(Component, Component.type, "memo");
|
|
default:
|
|
return void 0;
|
|
}
|
|
}
|
|
return void 0;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/capitalize.js
|
|
function capitalize(string) {
|
|
if (typeof string !== "string") {
|
|
throw new Error(true ? `MUI: \`capitalize(string)\` expects a string argument.` : formatMuiErrorMessage(7));
|
|
}
|
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/resolveProps.js
|
|
function resolveProps(defaultProps, props) {
|
|
const output = _extends({}, props);
|
|
Object.keys(defaultProps).forEach((propName) => {
|
|
if (output[propName] === void 0) {
|
|
output[propName] = defaultProps[propName];
|
|
}
|
|
});
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/composeClasses/composeClasses.js
|
|
function composeClasses(slots, getUtilityClass, classes) {
|
|
const output = {};
|
|
Object.keys(slots).forEach(
|
|
(slot) => {
|
|
output[slot] = slots[slot].reduce((acc, key) => {
|
|
if (key) {
|
|
acc.push(getUtilityClass(key));
|
|
if (classes && classes[key]) {
|
|
acc.push(classes[key]);
|
|
}
|
|
}
|
|
return acc;
|
|
}, []).join(" ");
|
|
}
|
|
);
|
|
return output;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
|
|
var defaultGenerator = (componentName) => componentName;
|
|
var createClassNameGenerator = () => {
|
|
let generate = defaultGenerator;
|
|
return {
|
|
configure(generator) {
|
|
generate = generator;
|
|
},
|
|
generate(componentName) {
|
|
return generate(componentName);
|
|
},
|
|
reset() {
|
|
generate = defaultGenerator;
|
|
}
|
|
};
|
|
};
|
|
var ClassNameGenerator = createClassNameGenerator();
|
|
var ClassNameGenerator_default = ClassNameGenerator;
|
|
|
|
// node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js
|
|
var globalStateClassesMapping = {
|
|
active: "active",
|
|
checked: "checked",
|
|
completed: "completed",
|
|
disabled: "disabled",
|
|
error: "error",
|
|
expanded: "expanded",
|
|
focused: "focused",
|
|
focusVisible: "focusVisible",
|
|
required: "required",
|
|
selected: "selected"
|
|
};
|
|
function generateUtilityClass(componentName, slot, globalStatePrefix = "Mui") {
|
|
const globalStateClass = globalStateClassesMapping[slot];
|
|
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator_default.generate(componentName)}-${slot}`;
|
|
}
|
|
|
|
// node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
|
|
function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
|
|
const result = {};
|
|
slots.forEach((slot) => {
|
|
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
});
|
|
return result;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/utils/capitalize.js
|
|
var capitalize_default = capitalize;
|
|
|
|
// node_modules/@mui/material/esm/utils/createSvgIcon.js
|
|
var React4 = __toESM(require_react());
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
if (source == null)
|
|
return {};
|
|
var target = {};
|
|
var sourceKeys = Object.keys(source);
|
|
var key, i2;
|
|
for (i2 = 0; i2 < sourceKeys.length; i2++) {
|
|
key = sourceKeys[i2];
|
|
if (excluded.indexOf(key) >= 0)
|
|
continue;
|
|
target[key] = source[key];
|
|
}
|
|
return target;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/SvgIcon.js
|
|
var React3 = __toESM(require_react());
|
|
var import_prop_types2 = __toESM(require_prop_types());
|
|
|
|
// node_modules/clsx/dist/clsx.m.js
|
|
function r(e) {
|
|
var t2, f2, n2 = "";
|
|
if ("string" == typeof e || "number" == typeof e)
|
|
n2 += e;
|
|
else if ("object" == typeof e)
|
|
if (Array.isArray(e))
|
|
for (t2 = 0; t2 < e.length; t2++)
|
|
e[t2] && (f2 = r(e[t2])) && (n2 && (n2 += " "), n2 += f2);
|
|
else
|
|
for (t2 in e)
|
|
e[t2] && (n2 && (n2 += " "), n2 += t2);
|
|
return n2;
|
|
}
|
|
function clsx() {
|
|
for (var e, t2, f2 = 0, n2 = ""; f2 < arguments.length; )
|
|
(e = arguments[f2++]) && (t2 = r(e)) && (n2 && (n2 += " "), n2 += t2);
|
|
return n2;
|
|
}
|
|
var clsx_m_default = clsx;
|
|
|
|
// node_modules/@mui/styled-engine/index.js
|
|
var import_styled = __toESM(require_emotion_styled_cjs());
|
|
function styled(tag, options) {
|
|
const stylesFactory = (0, import_styled.default)(tag, options);
|
|
if (true) {
|
|
return (...styles) => {
|
|
const component = typeof tag === "string" ? `"${tag}"` : "component";
|
|
if (styles.length === 0) {
|
|
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n"));
|
|
} else if (styles.some((style3) => style3 === void 0)) {
|
|
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
}
|
|
return stylesFactory(...styles);
|
|
};
|
|
}
|
|
return stylesFactory;
|
|
}
|
|
var internal_processStyles = (tag, processor) => {
|
|
if (Array.isArray(tag.__emotion_styles)) {
|
|
tag.__emotion_styles = processor(tag.__emotion_styles);
|
|
}
|
|
};
|
|
|
|
// node_modules/@mui/system/esm/responsivePropType.js
|
|
var import_prop_types = __toESM(require_prop_types());
|
|
var responsivePropType = true ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.string, import_prop_types.default.object, import_prop_types.default.array]) : {};
|
|
var responsivePropType_default = responsivePropType;
|
|
|
|
// node_modules/@mui/system/esm/merge.js
|
|
function merge(acc, item) {
|
|
if (!item) {
|
|
return acc;
|
|
}
|
|
return deepmerge(acc, item, {
|
|
clone: false
|
|
});
|
|
}
|
|
var merge_default = merge;
|
|
|
|
// node_modules/@mui/system/esm/breakpoints.js
|
|
var values = {
|
|
xs: 0,
|
|
sm: 600,
|
|
md: 900,
|
|
lg: 1200,
|
|
xl: 1536
|
|
};
|
|
var defaultBreakpoints = {
|
|
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
up: (key) => `@media (min-width:${values[key]}px)`
|
|
};
|
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
const theme = props.theme || {};
|
|
if (Array.isArray(propValue)) {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return propValue.reduce((acc, item, index) => {
|
|
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
if (typeof propValue === "object") {
|
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
} else {
|
|
const cssKey = breakpoint;
|
|
acc[cssKey] = propValue[cssKey];
|
|
}
|
|
return acc;
|
|
}, {});
|
|
}
|
|
const output = styleFromPropValue(propValue);
|
|
return output;
|
|
}
|
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
var _breakpointsInput$key;
|
|
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
acc[breakpointStyleKey] = {};
|
|
return acc;
|
|
}, {});
|
|
return breakpointsInOrder || {};
|
|
}
|
|
function removeUnusedBreakpoints(breakpointKeys, style3) {
|
|
return breakpointKeys.reduce((acc, key) => {
|
|
const breakpointOutput = acc[key];
|
|
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
if (isBreakpointUnused) {
|
|
delete acc[key];
|
|
}
|
|
return acc;
|
|
}, style3);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/style.js
|
|
function getPath(obj, path, checkVars = true) {
|
|
if (!path || typeof path !== "string") {
|
|
return null;
|
|
}
|
|
if (obj && obj.vars && checkVars) {
|
|
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
if (val != null) {
|
|
return val;
|
|
}
|
|
}
|
|
return path.split(".").reduce((acc, item) => {
|
|
if (acc && acc[item] != null) {
|
|
return acc[item];
|
|
}
|
|
return null;
|
|
}, obj);
|
|
}
|
|
function getValue(themeMapping, transform2, propValueFinal, userValue = propValueFinal) {
|
|
let value;
|
|
if (typeof themeMapping === "function") {
|
|
value = themeMapping(propValueFinal);
|
|
} else if (Array.isArray(themeMapping)) {
|
|
value = themeMapping[propValueFinal] || userValue;
|
|
} else {
|
|
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
}
|
|
if (transform2) {
|
|
value = transform2(value);
|
|
}
|
|
return value;
|
|
}
|
|
function style(options) {
|
|
const {
|
|
prop,
|
|
cssProperty = options.prop,
|
|
themeKey,
|
|
transform: transform2
|
|
} = options;
|
|
const fn2 = (props) => {
|
|
if (props[prop] == null) {
|
|
return null;
|
|
}
|
|
const propValue = props[prop];
|
|
const theme = props.theme;
|
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
const styleFromPropValue = (propValueFinal) => {
|
|
let value = getValue(themeMapping, transform2, propValueFinal);
|
|
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
value = getValue(themeMapping, transform2, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
}
|
|
if (cssProperty === false) {
|
|
return value;
|
|
}
|
|
return {
|
|
[cssProperty]: value
|
|
};
|
|
};
|
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
};
|
|
fn2.propTypes = true ? {
|
|
[prop]: responsivePropType_default
|
|
} : {};
|
|
fn2.filterProps = [prop];
|
|
return fn2;
|
|
}
|
|
var style_default = style;
|
|
|
|
// node_modules/@mui/system/esm/compose.js
|
|
function compose(...styles) {
|
|
const handlers = styles.reduce((acc, style3) => {
|
|
style3.filterProps.forEach((prop) => {
|
|
acc[prop] = style3;
|
|
});
|
|
return acc;
|
|
}, {});
|
|
const fn2 = (props) => {
|
|
return Object.keys(props).reduce((acc, prop) => {
|
|
if (handlers[prop]) {
|
|
return merge_default(acc, handlers[prop](props));
|
|
}
|
|
return acc;
|
|
}, {});
|
|
};
|
|
fn2.propTypes = true ? styles.reduce((acc, style3) => Object.assign(acc, style3.propTypes), {}) : {};
|
|
fn2.filterProps = styles.reduce((acc, style3) => acc.concat(style3.filterProps), []);
|
|
return fn2;
|
|
}
|
|
var compose_default = compose;
|
|
|
|
// node_modules/@mui/system/esm/memoize.js
|
|
function memoize(fn2) {
|
|
const cache = {};
|
|
return (arg) => {
|
|
if (cache[arg] === void 0) {
|
|
cache[arg] = fn2(arg);
|
|
}
|
|
return cache[arg];
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/spacing.js
|
|
var properties = {
|
|
m: "margin",
|
|
p: "padding"
|
|
};
|
|
var directions = {
|
|
t: "Top",
|
|
r: "Right",
|
|
b: "Bottom",
|
|
l: "Left",
|
|
x: ["Left", "Right"],
|
|
y: ["Top", "Bottom"]
|
|
};
|
|
var aliases = {
|
|
marginX: "mx",
|
|
marginY: "my",
|
|
paddingX: "px",
|
|
paddingY: "py"
|
|
};
|
|
var getCssProperties = memoize((prop) => {
|
|
if (prop.length > 2) {
|
|
if (aliases[prop]) {
|
|
prop = aliases[prop];
|
|
} else {
|
|
return [prop];
|
|
}
|
|
}
|
|
const [a2, b2] = prop.split("");
|
|
const property = properties[a2];
|
|
const direction = directions[b2] || "";
|
|
return Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
});
|
|
var marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
|
|
var paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
var spacingKeys = [...marginKeys, ...paddingKeys];
|
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
var _getPath;
|
|
const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
if (typeof themeSpacing === "number") {
|
|
return (abs) => {
|
|
if (typeof abs === "string") {
|
|
return abs;
|
|
}
|
|
if (true) {
|
|
if (typeof abs !== "number") {
|
|
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
}
|
|
}
|
|
return themeSpacing * abs;
|
|
};
|
|
}
|
|
if (Array.isArray(themeSpacing)) {
|
|
return (abs) => {
|
|
if (typeof abs === "string") {
|
|
return abs;
|
|
}
|
|
if (true) {
|
|
if (!Number.isInteger(abs)) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join("\n"));
|
|
} else if (abs > themeSpacing.length - 1) {
|
|
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join("\n"));
|
|
}
|
|
}
|
|
return themeSpacing[abs];
|
|
};
|
|
}
|
|
if (typeof themeSpacing === "function") {
|
|
return themeSpacing;
|
|
}
|
|
if (true) {
|
|
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, "It should be a number, an array or a function."].join("\n"));
|
|
}
|
|
return () => void 0;
|
|
}
|
|
function createUnarySpacing(theme) {
|
|
return createUnaryUnit(theme, "spacing", 8, "spacing");
|
|
}
|
|
function getValue2(transformer, propValue) {
|
|
if (typeof propValue === "string" || propValue == null) {
|
|
return propValue;
|
|
}
|
|
const abs = Math.abs(propValue);
|
|
const transformed = transformer(abs);
|
|
if (propValue >= 0) {
|
|
return transformed;
|
|
}
|
|
if (typeof transformed === "number") {
|
|
return -transformed;
|
|
}
|
|
return `-${transformed}`;
|
|
}
|
|
function getStyleFromPropValue(cssProperties, transformer) {
|
|
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
acc[cssProperty] = getValue2(transformer, propValue);
|
|
return acc;
|
|
}, {});
|
|
}
|
|
function resolveCssProperty(props, keys, prop, transformer) {
|
|
if (keys.indexOf(prop) === -1) {
|
|
return null;
|
|
}
|
|
const cssProperties = getCssProperties(prop);
|
|
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
const propValue = props[prop];
|
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
}
|
|
function style2(props, keys) {
|
|
const transformer = createUnarySpacing(props.theme);
|
|
return Object.keys(props).map((prop) => resolveCssProperty(props, keys, prop, transformer)).reduce(merge_default, {});
|
|
}
|
|
function margin(props) {
|
|
return style2(props, marginKeys);
|
|
}
|
|
margin.propTypes = true ? marginKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
margin.filterProps = marginKeys;
|
|
function padding(props) {
|
|
return style2(props, paddingKeys);
|
|
}
|
|
padding.propTypes = true ? paddingKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
padding.filterProps = paddingKeys;
|
|
function spacing(props) {
|
|
return style2(props, spacingKeys);
|
|
}
|
|
spacing.propTypes = true ? spacingKeys.reduce((obj, key) => {
|
|
obj[key] = responsivePropType_default;
|
|
return obj;
|
|
}, {}) : {};
|
|
spacing.filterProps = spacingKeys;
|
|
var spacing_default = spacing;
|
|
|
|
// node_modules/@mui/system/esm/borders.js
|
|
function getBorder(value) {
|
|
if (typeof value !== "number") {
|
|
return value;
|
|
}
|
|
return `${value}px solid`;
|
|
}
|
|
var border = style_default({
|
|
prop: "border",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
var borderTop = style_default({
|
|
prop: "borderTop",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
var borderRight = style_default({
|
|
prop: "borderRight",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
var borderBottom = style_default({
|
|
prop: "borderBottom",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
var borderLeft = style_default({
|
|
prop: "borderLeft",
|
|
themeKey: "borders",
|
|
transform: getBorder
|
|
});
|
|
var borderColor = style_default({
|
|
prop: "borderColor",
|
|
themeKey: "palette"
|
|
});
|
|
var borderTopColor = style_default({
|
|
prop: "borderTopColor",
|
|
themeKey: "palette"
|
|
});
|
|
var borderRightColor = style_default({
|
|
prop: "borderRightColor",
|
|
themeKey: "palette"
|
|
});
|
|
var borderBottomColor = style_default({
|
|
prop: "borderBottomColor",
|
|
themeKey: "palette"
|
|
});
|
|
var borderLeftColor = style_default({
|
|
prop: "borderLeftColor",
|
|
themeKey: "palette"
|
|
});
|
|
var borderRadius = (props) => {
|
|
if (props.borderRadius !== void 0 && props.borderRadius !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "shape.borderRadius", 4, "borderRadius");
|
|
const styleFromPropValue = (propValue) => ({
|
|
borderRadius: getValue2(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
borderRadius.propTypes = true ? {
|
|
borderRadius: responsivePropType_default
|
|
} : {};
|
|
borderRadius.filterProps = ["borderRadius"];
|
|
var borders = compose_default(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
var borders_default = borders;
|
|
|
|
// node_modules/@mui/system/esm/display.js
|
|
var displayPrint = style_default({
|
|
prop: "displayPrint",
|
|
cssProperty: false,
|
|
transform: (value) => ({
|
|
"@media print": {
|
|
display: value
|
|
}
|
|
})
|
|
});
|
|
var displayRaw = style_default({
|
|
prop: "display"
|
|
});
|
|
var overflow = style_default({
|
|
prop: "overflow"
|
|
});
|
|
var textOverflow = style_default({
|
|
prop: "textOverflow"
|
|
});
|
|
var visibility = style_default({
|
|
prop: "visibility"
|
|
});
|
|
var whiteSpace = style_default({
|
|
prop: "whiteSpace"
|
|
});
|
|
var display_default = compose_default(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);
|
|
|
|
// node_modules/@mui/system/esm/flexbox.js
|
|
var flexBasis = style_default({
|
|
prop: "flexBasis"
|
|
});
|
|
var flexDirection = style_default({
|
|
prop: "flexDirection"
|
|
});
|
|
var flexWrap = style_default({
|
|
prop: "flexWrap"
|
|
});
|
|
var justifyContent = style_default({
|
|
prop: "justifyContent"
|
|
});
|
|
var alignItems = style_default({
|
|
prop: "alignItems"
|
|
});
|
|
var alignContent = style_default({
|
|
prop: "alignContent"
|
|
});
|
|
var order = style_default({
|
|
prop: "order"
|
|
});
|
|
var flex = style_default({
|
|
prop: "flex"
|
|
});
|
|
var flexGrow = style_default({
|
|
prop: "flexGrow"
|
|
});
|
|
var flexShrink = style_default({
|
|
prop: "flexShrink"
|
|
});
|
|
var alignSelf = style_default({
|
|
prop: "alignSelf"
|
|
});
|
|
var justifyItems = style_default({
|
|
prop: "justifyItems"
|
|
});
|
|
var justifySelf = style_default({
|
|
prop: "justifySelf"
|
|
});
|
|
var flexbox = compose_default(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
|
|
var flexbox_default = flexbox;
|
|
|
|
// node_modules/@mui/system/esm/cssGrid.js
|
|
var gap = (props) => {
|
|
if (props.gap !== void 0 && props.gap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "gap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
gap: getValue2(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
gap.propTypes = true ? {
|
|
gap: responsivePropType_default
|
|
} : {};
|
|
gap.filterProps = ["gap"];
|
|
var columnGap = (props) => {
|
|
if (props.columnGap !== void 0 && props.columnGap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "columnGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
columnGap: getValue2(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
columnGap.propTypes = true ? {
|
|
columnGap: responsivePropType_default
|
|
} : {};
|
|
columnGap.filterProps = ["columnGap"];
|
|
var rowGap = (props) => {
|
|
if (props.rowGap !== void 0 && props.rowGap !== null) {
|
|
const transformer = createUnaryUnit(props.theme, "spacing", 8, "rowGap");
|
|
const styleFromPropValue = (propValue) => ({
|
|
rowGap: getValue2(transformer, propValue)
|
|
});
|
|
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
rowGap.propTypes = true ? {
|
|
rowGap: responsivePropType_default
|
|
} : {};
|
|
rowGap.filterProps = ["rowGap"];
|
|
var gridColumn = style_default({
|
|
prop: "gridColumn"
|
|
});
|
|
var gridRow = style_default({
|
|
prop: "gridRow"
|
|
});
|
|
var gridAutoFlow = style_default({
|
|
prop: "gridAutoFlow"
|
|
});
|
|
var gridAutoColumns = style_default({
|
|
prop: "gridAutoColumns"
|
|
});
|
|
var gridAutoRows = style_default({
|
|
prop: "gridAutoRows"
|
|
});
|
|
var gridTemplateColumns = style_default({
|
|
prop: "gridTemplateColumns"
|
|
});
|
|
var gridTemplateRows = style_default({
|
|
prop: "gridTemplateRows"
|
|
});
|
|
var gridTemplateAreas = style_default({
|
|
prop: "gridTemplateAreas"
|
|
});
|
|
var gridArea = style_default({
|
|
prop: "gridArea"
|
|
});
|
|
var grid = compose_default(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
var cssGrid_default = grid;
|
|
|
|
// node_modules/@mui/system/esm/palette.js
|
|
var color = style_default({
|
|
prop: "color",
|
|
themeKey: "palette"
|
|
});
|
|
var bgcolor = style_default({
|
|
prop: "bgcolor",
|
|
cssProperty: "backgroundColor",
|
|
themeKey: "palette"
|
|
});
|
|
var backgroundColor = style_default({
|
|
prop: "backgroundColor",
|
|
themeKey: "palette"
|
|
});
|
|
var palette = compose_default(color, bgcolor, backgroundColor);
|
|
var palette_default = palette;
|
|
|
|
// node_modules/@mui/system/esm/positions.js
|
|
var position = style_default({
|
|
prop: "position"
|
|
});
|
|
var zIndex = style_default({
|
|
prop: "zIndex",
|
|
themeKey: "zIndex"
|
|
});
|
|
var top = style_default({
|
|
prop: "top"
|
|
});
|
|
var right = style_default({
|
|
prop: "right"
|
|
});
|
|
var bottom = style_default({
|
|
prop: "bottom"
|
|
});
|
|
var left = style_default({
|
|
prop: "left"
|
|
});
|
|
var positions_default = compose_default(position, zIndex, top, right, bottom, left);
|
|
|
|
// node_modules/@mui/system/esm/shadows.js
|
|
var boxShadow = style_default({
|
|
prop: "boxShadow",
|
|
themeKey: "shadows"
|
|
});
|
|
var shadows_default = boxShadow;
|
|
|
|
// node_modules/@mui/system/esm/sizing.js
|
|
function transform(value) {
|
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
}
|
|
var width = style_default({
|
|
prop: "width",
|
|
transform
|
|
});
|
|
var maxWidth = (props) => {
|
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
const styleFromPropValue = (propValue) => {
|
|
var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
|
|
const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || values[propValue];
|
|
return {
|
|
maxWidth: breakpoint || transform(propValue)
|
|
};
|
|
};
|
|
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
}
|
|
return null;
|
|
};
|
|
maxWidth.filterProps = ["maxWidth"];
|
|
var minWidth = style_default({
|
|
prop: "minWidth",
|
|
transform
|
|
});
|
|
var height = style_default({
|
|
prop: "height",
|
|
transform
|
|
});
|
|
var maxHeight = style_default({
|
|
prop: "maxHeight",
|
|
transform
|
|
});
|
|
var minHeight = style_default({
|
|
prop: "minHeight",
|
|
transform
|
|
});
|
|
var sizeWidth = style_default({
|
|
prop: "size",
|
|
cssProperty: "width",
|
|
transform
|
|
});
|
|
var sizeHeight = style_default({
|
|
prop: "size",
|
|
cssProperty: "height",
|
|
transform
|
|
});
|
|
var boxSizing = style_default({
|
|
prop: "boxSizing"
|
|
});
|
|
var sizing = compose_default(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
var sizing_default = sizing;
|
|
|
|
// node_modules/@mui/system/esm/typography.js
|
|
var fontFamily = style_default({
|
|
prop: "fontFamily",
|
|
themeKey: "typography"
|
|
});
|
|
var fontSize = style_default({
|
|
prop: "fontSize",
|
|
themeKey: "typography"
|
|
});
|
|
var fontStyle = style_default({
|
|
prop: "fontStyle",
|
|
themeKey: "typography"
|
|
});
|
|
var fontWeight = style_default({
|
|
prop: "fontWeight",
|
|
themeKey: "typography"
|
|
});
|
|
var letterSpacing = style_default({
|
|
prop: "letterSpacing"
|
|
});
|
|
var textTransform = style_default({
|
|
prop: "textTransform"
|
|
});
|
|
var lineHeight = style_default({
|
|
prop: "lineHeight"
|
|
});
|
|
var textAlign = style_default({
|
|
prop: "textAlign"
|
|
});
|
|
var typographyVariant = style_default({
|
|
prop: "typography",
|
|
cssProperty: false,
|
|
themeKey: "typography"
|
|
});
|
|
var typography = compose_default(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);
|
|
var typography_default = typography;
|
|
|
|
// node_modules/@mui/system/esm/getThemeValue.js
|
|
var filterPropsMapping = {
|
|
borders: borders_default.filterProps,
|
|
display: display_default.filterProps,
|
|
flexbox: flexbox_default.filterProps,
|
|
grid: cssGrid_default.filterProps,
|
|
positions: positions_default.filterProps,
|
|
palette: palette_default.filterProps,
|
|
shadows: shadows_default.filterProps,
|
|
sizing: sizing_default.filterProps,
|
|
spacing: spacing_default.filterProps,
|
|
typography: typography_default.filterProps
|
|
};
|
|
var styleFunctionMapping = {
|
|
borders: borders_default,
|
|
display: display_default,
|
|
flexbox: flexbox_default,
|
|
grid: cssGrid_default,
|
|
positions: positions_default,
|
|
palette: palette_default,
|
|
shadows: shadows_default,
|
|
sizing: sizing_default,
|
|
spacing: spacing_default,
|
|
typography: typography_default
|
|
};
|
|
var propToStyleFunction = Object.keys(filterPropsMapping).reduce((acc, styleFnName) => {
|
|
filterPropsMapping[styleFnName].forEach((propName) => {
|
|
acc[propName] = styleFunctionMapping[styleFnName];
|
|
});
|
|
return acc;
|
|
}, {});
|
|
|
|
// node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
|
|
function objectsHaveSameKeys(...objects) {
|
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
const union = new Set(allKeys);
|
|
return objects.every((object) => union.size === Object.keys(object).length);
|
|
}
|
|
function callIfFn(maybeFn, arg) {
|
|
return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
|
|
}
|
|
function unstable_createStyleFunctionSx(styleFunctionMapping2 = styleFunctionMapping) {
|
|
const propToStyleFunction2 = Object.keys(styleFunctionMapping2).reduce((acc, styleFnName) => {
|
|
styleFunctionMapping2[styleFnName].filterProps.forEach((propName) => {
|
|
acc[propName] = styleFunctionMapping2[styleFnName];
|
|
});
|
|
return acc;
|
|
}, {});
|
|
function getThemeValue(prop, value, theme) {
|
|
const inputProps = {
|
|
[prop]: value,
|
|
theme
|
|
};
|
|
const styleFunction = propToStyleFunction2[prop];
|
|
return styleFunction ? styleFunction(inputProps) : {
|
|
[prop]: value
|
|
};
|
|
}
|
|
function styleFunctionSx2(props) {
|
|
const {
|
|
sx,
|
|
theme = {}
|
|
} = props || {};
|
|
if (!sx) {
|
|
return null;
|
|
}
|
|
function traverse(sxInput) {
|
|
let sxObject = sxInput;
|
|
if (typeof sxInput === "function") {
|
|
sxObject = sxInput(theme);
|
|
} else if (typeof sxInput !== "object") {
|
|
return sxInput;
|
|
}
|
|
if (!sxObject) {
|
|
return null;
|
|
}
|
|
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
let css = emptyBreakpoints;
|
|
Object.keys(sxObject).forEach((styleKey) => {
|
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
if (value !== null && value !== void 0) {
|
|
if (typeof value === "object") {
|
|
if (propToStyleFunction2[styleKey]) {
|
|
css = merge_default(css, getThemeValue(styleKey, value, theme));
|
|
} else {
|
|
const breakpointsValues = handleBreakpoints({
|
|
theme
|
|
}, value, (x2) => ({
|
|
[styleKey]: x2
|
|
}));
|
|
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
css[styleKey] = styleFunctionSx2({
|
|
sx: value,
|
|
theme
|
|
});
|
|
} else {
|
|
css = merge_default(css, breakpointsValues);
|
|
}
|
|
}
|
|
} else {
|
|
css = merge_default(css, getThemeValue(styleKey, value, theme));
|
|
}
|
|
}
|
|
});
|
|
return removeUnusedBreakpoints(breakpointsKeys, css);
|
|
}
|
|
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
}
|
|
return styleFunctionSx2;
|
|
}
|
|
var styleFunctionSx = unstable_createStyleFunctionSx();
|
|
styleFunctionSx.filterProps = ["sx"];
|
|
var styleFunctionSx_default = styleFunctionSx;
|
|
|
|
// node_modules/@mui/system/esm/createTheme/createBreakpoints.js
|
|
var _excluded = ["values", "unit", "step"];
|
|
var sortBreakpointsValues = (values2) => {
|
|
const breakpointsAsArray = Object.keys(values2).map((key) => ({
|
|
key,
|
|
val: values2[key]
|
|
})) || [];
|
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
return _extends({}, acc, {
|
|
[obj.key]: obj.val
|
|
});
|
|
}, {});
|
|
};
|
|
function createBreakpoints(breakpoints) {
|
|
const {
|
|
values: values2 = {
|
|
xs: 0,
|
|
sm: 600,
|
|
md: 900,
|
|
lg: 1200,
|
|
xl: 1536
|
|
},
|
|
unit = "px",
|
|
step = 5
|
|
} = breakpoints, other = _objectWithoutPropertiesLoose(breakpoints, _excluded);
|
|
const sortedValues = sortBreakpointsValues(values2);
|
|
const keys = Object.keys(sortedValues);
|
|
function up(key) {
|
|
const value = typeof values2[key] === "number" ? values2[key] : key;
|
|
return `@media (min-width:${value}${unit})`;
|
|
}
|
|
function down(key) {
|
|
const value = typeof values2[key] === "number" ? values2[key] : key;
|
|
return `@media (max-width:${value - step / 100}${unit})`;
|
|
}
|
|
function between(start, end) {
|
|
const endIndex = keys.indexOf(end);
|
|
return `@media (min-width:${typeof values2[start] === "number" ? values2[start] : start}${unit}) and (max-width:${(endIndex !== -1 && typeof values2[keys[endIndex]] === "number" ? values2[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
}
|
|
function only(key) {
|
|
if (keys.indexOf(key) + 1 < keys.length) {
|
|
return between(key, keys[keys.indexOf(key) + 1]);
|
|
}
|
|
return up(key);
|
|
}
|
|
function not(key) {
|
|
const keyIndex = keys.indexOf(key);
|
|
if (keyIndex === 0) {
|
|
return up(keys[1]);
|
|
}
|
|
if (keyIndex === keys.length - 1) {
|
|
return down(keys[keyIndex]);
|
|
}
|
|
return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
}
|
|
return _extends({
|
|
keys,
|
|
values: sortedValues,
|
|
up,
|
|
down,
|
|
between,
|
|
only,
|
|
not,
|
|
unit
|
|
}, other);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createTheme/shape.js
|
|
var shape = {
|
|
borderRadius: 4
|
|
};
|
|
var shape_default = shape;
|
|
|
|
// node_modules/@mui/system/esm/createTheme/createSpacing.js
|
|
function createSpacing(spacingInput = 8) {
|
|
if (spacingInput.mui) {
|
|
return spacingInput;
|
|
}
|
|
const transform2 = createUnarySpacing({
|
|
spacing: spacingInput
|
|
});
|
|
const spacing2 = (...argsInput) => {
|
|
if (true) {
|
|
if (!(argsInput.length <= 4)) {
|
|
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
}
|
|
}
|
|
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
return args.map((argument) => {
|
|
const output = transform2(argument);
|
|
return typeof output === "number" ? `${output}px` : output;
|
|
}).join(" ");
|
|
};
|
|
spacing2.mui = true;
|
|
return spacing2;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createTheme/createTheme.js
|
|
var _excluded2 = ["breakpoints", "palette", "spacing", "shape"];
|
|
function createTheme(options = {}, ...args) {
|
|
const {
|
|
breakpoints: breakpointsInput = {},
|
|
palette: paletteInput = {},
|
|
spacing: spacingInput,
|
|
shape: shapeInput = {}
|
|
} = options, other = _objectWithoutPropertiesLoose(options, _excluded2);
|
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
const spacing2 = createSpacing(spacingInput);
|
|
let muiTheme = deepmerge({
|
|
breakpoints,
|
|
direction: "ltr",
|
|
components: {},
|
|
palette: _extends({
|
|
mode: "light"
|
|
}, paletteInput),
|
|
spacing: spacing2,
|
|
shape: _extends({}, shape_default, shapeInput)
|
|
}, other);
|
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
return muiTheme;
|
|
}
|
|
var createTheme_default = createTheme;
|
|
|
|
// node_modules/@mui/private-theming/useTheme/ThemeContext.js
|
|
var React = __toESM(require_react());
|
|
var ThemeContext = /* @__PURE__ */ React.createContext(null);
|
|
if (true) {
|
|
ThemeContext.displayName = "ThemeContext";
|
|
}
|
|
var ThemeContext_default = ThemeContext;
|
|
|
|
// node_modules/@mui/private-theming/useTheme/useTheme.js
|
|
var React2 = __toESM(require_react());
|
|
function useTheme() {
|
|
const theme = React2.useContext(ThemeContext_default);
|
|
if (true) {
|
|
React2.useDebugValue(theme);
|
|
}
|
|
return theme;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/useThemeWithoutDefault.js
|
|
function isObjectEmpty(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
function useTheme2(defaultTheme2 = null) {
|
|
const contextTheme = useTheme();
|
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
|
|
}
|
|
var useThemeWithoutDefault_default = useTheme2;
|
|
|
|
// node_modules/@mui/system/esm/useTheme.js
|
|
var systemDefaultTheme = createTheme_default();
|
|
function useTheme3(defaultTheme2 = systemDefaultTheme) {
|
|
return useThemeWithoutDefault_default(defaultTheme2);
|
|
}
|
|
var useTheme_default = useTheme3;
|
|
|
|
// node_modules/@mui/system/esm/propsToClassKey.js
|
|
var _excluded3 = ["variant"];
|
|
function isEmpty(string) {
|
|
return string.length === 0;
|
|
}
|
|
function propsToClassKey(props) {
|
|
const {
|
|
variant
|
|
} = props, other = _objectWithoutPropertiesLoose(props, _excluded3);
|
|
let classKey = variant || "";
|
|
Object.keys(other).sort().forEach((key) => {
|
|
if (key === "color") {
|
|
classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);
|
|
} else {
|
|
classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
|
|
}
|
|
});
|
|
return classKey;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/createStyled.js
|
|
var _excluded4 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
var _excluded22 = ["theme"];
|
|
var _excluded32 = ["theme"];
|
|
function isEmpty2(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
function isStringTag(tag) {
|
|
return typeof tag === "string" && tag.charCodeAt(0) > 96;
|
|
}
|
|
var getStyleOverrides = (name, theme) => {
|
|
if (theme.components && theme.components[name] && theme.components[name].styleOverrides) {
|
|
return theme.components[name].styleOverrides;
|
|
}
|
|
return null;
|
|
};
|
|
var getVariantStyles = (name, theme) => {
|
|
let variants = [];
|
|
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
variants = theme.components[name].variants;
|
|
}
|
|
const variantsStyles = {};
|
|
variants.forEach((definition) => {
|
|
const key = propsToClassKey(definition.props);
|
|
variantsStyles[key] = definition.style;
|
|
});
|
|
return variantsStyles;
|
|
};
|
|
var variantsResolver = (props, styles, theme, name) => {
|
|
var _theme$components, _theme$components$nam;
|
|
const {
|
|
ownerState = {}
|
|
} = props;
|
|
const variantsStyles = [];
|
|
const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;
|
|
if (themeVariants) {
|
|
themeVariants.forEach((themeVariant) => {
|
|
let isMatch2 = true;
|
|
Object.keys(themeVariant.props).forEach((key) => {
|
|
if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {
|
|
isMatch2 = false;
|
|
}
|
|
});
|
|
if (isMatch2) {
|
|
variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);
|
|
}
|
|
});
|
|
}
|
|
return variantsStyles;
|
|
};
|
|
function shouldForwardProp(prop) {
|
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
}
|
|
var systemDefaultTheme2 = createTheme_default();
|
|
var lowercaseFirstLetter = (string) => {
|
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
};
|
|
function createStyled(input = {}) {
|
|
const {
|
|
defaultTheme: defaultTheme2 = systemDefaultTheme2,
|
|
rootShouldForwardProp: rootShouldForwardProp2 = shouldForwardProp,
|
|
slotShouldForwardProp = shouldForwardProp,
|
|
styleFunctionSx: styleFunctionSx2 = styleFunctionSx_default
|
|
} = input;
|
|
const systemSx = (props) => {
|
|
const theme = isEmpty2(props.theme) ? defaultTheme2 : props.theme;
|
|
return styleFunctionSx2(_extends({}, props, {
|
|
theme
|
|
}));
|
|
};
|
|
systemSx.__mui_systemSx = true;
|
|
return (tag, inputOptions = {}) => {
|
|
internal_processStyles(tag, (styles) => styles.filter((style3) => !(style3 != null && style3.__mui_systemSx)));
|
|
const {
|
|
name: componentName,
|
|
slot: componentSlot,
|
|
skipVariantsResolver: inputSkipVariantsResolver,
|
|
skipSx: inputSkipSx,
|
|
overridesResolver
|
|
} = inputOptions, options = _objectWithoutPropertiesLoose(inputOptions, _excluded4);
|
|
const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : componentSlot && componentSlot !== "Root" || false;
|
|
const skipSx = inputSkipSx || false;
|
|
let label;
|
|
if (true) {
|
|
if (componentName) {
|
|
label = `${componentName}-${lowercaseFirstLetter(componentSlot || "Root")}`;
|
|
}
|
|
}
|
|
let shouldForwardPropOption = shouldForwardProp;
|
|
if (componentSlot === "Root") {
|
|
shouldForwardPropOption = rootShouldForwardProp2;
|
|
} else if (componentSlot) {
|
|
shouldForwardPropOption = slotShouldForwardProp;
|
|
} else if (isStringTag(tag)) {
|
|
shouldForwardPropOption = void 0;
|
|
}
|
|
const defaultStyledResolver = styled(tag, _extends({
|
|
shouldForwardProp: shouldForwardPropOption,
|
|
label
|
|
}, options));
|
|
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
const expressionsWithDefaultTheme = expressions ? expressions.map((stylesArg) => {
|
|
return typeof stylesArg === "function" && stylesArg.__emotion_real !== stylesArg ? (_ref) => {
|
|
let {
|
|
theme: themeInput
|
|
} = _ref, other = _objectWithoutPropertiesLoose(_ref, _excluded22);
|
|
return stylesArg(_extends({
|
|
theme: isEmpty2(themeInput) ? defaultTheme2 : themeInput
|
|
}, other));
|
|
} : stylesArg;
|
|
}) : [];
|
|
let transformedStyleArg = styleArg;
|
|
if (componentName && overridesResolver) {
|
|
expressionsWithDefaultTheme.push((props) => {
|
|
const theme = isEmpty2(props.theme) ? defaultTheme2 : props.theme;
|
|
const styleOverrides = getStyleOverrides(componentName, theme);
|
|
if (styleOverrides) {
|
|
const resolvedStyleOverrides = {};
|
|
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
resolvedStyleOverrides[slotKey] = typeof slotStyle === "function" ? slotStyle(_extends({}, props, {
|
|
theme
|
|
})) : slotStyle;
|
|
});
|
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
}
|
|
return null;
|
|
});
|
|
}
|
|
if (componentName && !skipVariantsResolver) {
|
|
expressionsWithDefaultTheme.push((props) => {
|
|
const theme = isEmpty2(props.theme) ? defaultTheme2 : props.theme;
|
|
return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
});
|
|
}
|
|
if (!skipSx) {
|
|
expressionsWithDefaultTheme.push(systemSx);
|
|
}
|
|
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
const placeholders = new Array(numOfCustomFnsApplied).fill("");
|
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
} else if (typeof styleArg === "function" && styleArg.__emotion_real !== styleArg) {
|
|
transformedStyleArg = (_ref2) => {
|
|
let {
|
|
theme: themeInput
|
|
} = _ref2, other = _objectWithoutPropertiesLoose(_ref2, _excluded32);
|
|
return styleArg(_extends({
|
|
theme: isEmpty2(themeInput) ? defaultTheme2 : themeInput
|
|
}, other));
|
|
};
|
|
}
|
|
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
if (true) {
|
|
let displayName;
|
|
if (componentName) {
|
|
displayName = `${componentName}${componentSlot || ""}`;
|
|
}
|
|
if (displayName === void 0) {
|
|
displayName = `Styled(${getDisplayName(tag)})`;
|
|
}
|
|
Component.displayName = displayName;
|
|
}
|
|
return Component;
|
|
};
|
|
if (defaultStyledResolver.withConfig) {
|
|
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
}
|
|
return muiStyledResolver;
|
|
};
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/useThemeProps/getThemeProps.js
|
|
function getThemeProps(params) {
|
|
const {
|
|
theme,
|
|
name,
|
|
props
|
|
} = params;
|
|
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
return props;
|
|
}
|
|
return resolveProps(theme.components[name].defaultProps, props);
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/useThemeProps/useThemeProps.js
|
|
function useThemeProps({
|
|
props,
|
|
name,
|
|
defaultTheme: defaultTheme2
|
|
}) {
|
|
const theme = useTheme_default(defaultTheme2);
|
|
const mergedProps = getThemeProps({
|
|
theme,
|
|
name,
|
|
props
|
|
});
|
|
return mergedProps;
|
|
}
|
|
|
|
// node_modules/@mui/system/esm/colorManipulator.js
|
|
function clamp(value, min = 0, max = 1) {
|
|
if (true) {
|
|
if (value < min || value > max) {
|
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
}
|
|
}
|
|
return Math.min(Math.max(min, value), max);
|
|
}
|
|
function hexToRgb(color2) {
|
|
color2 = color2.slice(1);
|
|
const re = new RegExp(`.{1,${color2.length >= 6 ? 2 : 1}}`, "g");
|
|
let colors = color2.match(re);
|
|
if (colors && colors[0].length === 1) {
|
|
colors = colors.map((n2) => n2 + n2);
|
|
}
|
|
return colors ? `rgb${colors.length === 4 ? "a" : ""}(${colors.map((n2, index) => {
|
|
return index < 3 ? parseInt(n2, 16) : Math.round(parseInt(n2, 16) / 255 * 1e3) / 1e3;
|
|
}).join(", ")})` : "";
|
|
}
|
|
function decomposeColor(color2) {
|
|
if (color2.type) {
|
|
return color2;
|
|
}
|
|
if (color2.charAt(0) === "#") {
|
|
return decomposeColor(hexToRgb(color2));
|
|
}
|
|
const marker = color2.indexOf("(");
|
|
const type = color2.substring(0, marker);
|
|
if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
|
|
throw new Error(true ? `MUI: Unsupported \`${color2}\` color.
|
|
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : formatMuiErrorMessage(9, color2));
|
|
}
|
|
let values2 = color2.substring(marker + 1, color2.length - 1);
|
|
let colorSpace;
|
|
if (type === "color") {
|
|
values2 = values2.split(" ");
|
|
colorSpace = values2.shift();
|
|
if (values2.length === 4 && values2[3].charAt(0) === "/") {
|
|
values2[3] = values2[3].slice(1);
|
|
}
|
|
if (["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].indexOf(colorSpace) === -1) {
|
|
throw new Error(true ? `MUI: unsupported \`${colorSpace}\` color space.
|
|
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : formatMuiErrorMessage(10, colorSpace));
|
|
}
|
|
} else {
|
|
values2 = values2.split(",");
|
|
}
|
|
values2 = values2.map((value) => parseFloat(value));
|
|
return {
|
|
type,
|
|
values: values2,
|
|
colorSpace
|
|
};
|
|
}
|
|
function recomposeColor(color2) {
|
|
const {
|
|
type,
|
|
colorSpace
|
|
} = color2;
|
|
let {
|
|
values: values2
|
|
} = color2;
|
|
if (type.indexOf("rgb") !== -1) {
|
|
values2 = values2.map((n2, i2) => i2 < 3 ? parseInt(n2, 10) : n2);
|
|
} else if (type.indexOf("hsl") !== -1) {
|
|
values2[1] = `${values2[1]}%`;
|
|
values2[2] = `${values2[2]}%`;
|
|
}
|
|
if (type.indexOf("color") !== -1) {
|
|
values2 = `${colorSpace} ${values2.join(" ")}`;
|
|
} else {
|
|
values2 = `${values2.join(", ")}`;
|
|
}
|
|
return `${type}(${values2})`;
|
|
}
|
|
function hslToRgb(color2) {
|
|
color2 = decomposeColor(color2);
|
|
const {
|
|
values: values2
|
|
} = color2;
|
|
const h2 = values2[0];
|
|
const s2 = values2[1] / 100;
|
|
const l2 = values2[2] / 100;
|
|
const a2 = s2 * Math.min(l2, 1 - l2);
|
|
const f2 = (n2, k2 = (n2 + h2 / 30) % 12) => l2 - a2 * Math.max(Math.min(k2 - 3, 9 - k2, 1), -1);
|
|
let type = "rgb";
|
|
const rgb = [Math.round(f2(0) * 255), Math.round(f2(8) * 255), Math.round(f2(4) * 255)];
|
|
if (color2.type === "hsla") {
|
|
type += "a";
|
|
rgb.push(values2[3]);
|
|
}
|
|
return recomposeColor({
|
|
type,
|
|
values: rgb
|
|
});
|
|
}
|
|
function getLuminance(color2) {
|
|
color2 = decomposeColor(color2);
|
|
let rgb = color2.type === "hsl" ? decomposeColor(hslToRgb(color2)).values : color2.values;
|
|
rgb = rgb.map((val) => {
|
|
if (color2.type !== "color") {
|
|
val /= 255;
|
|
}
|
|
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
});
|
|
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
|
}
|
|
function getContrastRatio(foreground, background) {
|
|
const lumA = getLuminance(foreground);
|
|
const lumB = getLuminance(background);
|
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
}
|
|
function darken(color2, coefficient) {
|
|
color2 = decomposeColor(color2);
|
|
coefficient = clamp(coefficient);
|
|
if (color2.type.indexOf("hsl") !== -1) {
|
|
color2.values[2] *= 1 - coefficient;
|
|
} else if (color2.type.indexOf("rgb") !== -1 || color2.type.indexOf("color") !== -1) {
|
|
for (let i2 = 0; i2 < 3; i2 += 1) {
|
|
color2.values[i2] *= 1 - coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color2);
|
|
}
|
|
function lighten(color2, coefficient) {
|
|
color2 = decomposeColor(color2);
|
|
coefficient = clamp(coefficient);
|
|
if (color2.type.indexOf("hsl") !== -1) {
|
|
color2.values[2] += (100 - color2.values[2]) * coefficient;
|
|
} else if (color2.type.indexOf("rgb") !== -1) {
|
|
for (let i2 = 0; i2 < 3; i2 += 1) {
|
|
color2.values[i2] += (255 - color2.values[i2]) * coefficient;
|
|
}
|
|
} else if (color2.type.indexOf("color") !== -1) {
|
|
for (let i2 = 0; i2 < 3; i2 += 1) {
|
|
color2.values[i2] += (1 - color2.values[i2]) * coefficient;
|
|
}
|
|
}
|
|
return recomposeColor(color2);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createMixins.js
|
|
function createMixins(breakpoints, mixins) {
|
|
return _extends({
|
|
toolbar: {
|
|
minHeight: 56,
|
|
[breakpoints.up("xs")]: {
|
|
"@media (orientation: landscape)": {
|
|
minHeight: 48
|
|
}
|
|
},
|
|
[breakpoints.up("sm")]: {
|
|
minHeight: 64
|
|
}
|
|
}
|
|
}, mixins);
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/colors/common.js
|
|
var common = {
|
|
black: "#000",
|
|
white: "#fff"
|
|
};
|
|
var common_default = common;
|
|
|
|
// node_modules/@mui/material/esm/colors/grey.js
|
|
var grey = {
|
|
50: "#fafafa",
|
|
100: "#f5f5f5",
|
|
200: "#eeeeee",
|
|
300: "#e0e0e0",
|
|
400: "#bdbdbd",
|
|
500: "#9e9e9e",
|
|
600: "#757575",
|
|
700: "#616161",
|
|
800: "#424242",
|
|
900: "#212121",
|
|
A100: "#f5f5f5",
|
|
A200: "#eeeeee",
|
|
A400: "#bdbdbd",
|
|
A700: "#616161"
|
|
};
|
|
var grey_default = grey;
|
|
|
|
// node_modules/@mui/material/esm/colors/purple.js
|
|
var purple = {
|
|
50: "#f3e5f5",
|
|
100: "#e1bee7",
|
|
200: "#ce93d8",
|
|
300: "#ba68c8",
|
|
400: "#ab47bc",
|
|
500: "#9c27b0",
|
|
600: "#8e24aa",
|
|
700: "#7b1fa2",
|
|
800: "#6a1b9a",
|
|
900: "#4a148c",
|
|
A100: "#ea80fc",
|
|
A200: "#e040fb",
|
|
A400: "#d500f9",
|
|
A700: "#aa00ff"
|
|
};
|
|
var purple_default = purple;
|
|
|
|
// node_modules/@mui/material/esm/colors/red.js
|
|
var red = {
|
|
50: "#ffebee",
|
|
100: "#ffcdd2",
|
|
200: "#ef9a9a",
|
|
300: "#e57373",
|
|
400: "#ef5350",
|
|
500: "#f44336",
|
|
600: "#e53935",
|
|
700: "#d32f2f",
|
|
800: "#c62828",
|
|
900: "#b71c1c",
|
|
A100: "#ff8a80",
|
|
A200: "#ff5252",
|
|
A400: "#ff1744",
|
|
A700: "#d50000"
|
|
};
|
|
var red_default = red;
|
|
|
|
// node_modules/@mui/material/esm/colors/orange.js
|
|
var orange = {
|
|
50: "#fff3e0",
|
|
100: "#ffe0b2",
|
|
200: "#ffcc80",
|
|
300: "#ffb74d",
|
|
400: "#ffa726",
|
|
500: "#ff9800",
|
|
600: "#fb8c00",
|
|
700: "#f57c00",
|
|
800: "#ef6c00",
|
|
900: "#e65100",
|
|
A100: "#ffd180",
|
|
A200: "#ffab40",
|
|
A400: "#ff9100",
|
|
A700: "#ff6d00"
|
|
};
|
|
var orange_default = orange;
|
|
|
|
// node_modules/@mui/material/esm/colors/blue.js
|
|
var blue = {
|
|
50: "#e3f2fd",
|
|
100: "#bbdefb",
|
|
200: "#90caf9",
|
|
300: "#64b5f6",
|
|
400: "#42a5f5",
|
|
500: "#2196f3",
|
|
600: "#1e88e5",
|
|
700: "#1976d2",
|
|
800: "#1565c0",
|
|
900: "#0d47a1",
|
|
A100: "#82b1ff",
|
|
A200: "#448aff",
|
|
A400: "#2979ff",
|
|
A700: "#2962ff"
|
|
};
|
|
var blue_default = blue;
|
|
|
|
// node_modules/@mui/material/esm/colors/lightBlue.js
|
|
var lightBlue = {
|
|
50: "#e1f5fe",
|
|
100: "#b3e5fc",
|
|
200: "#81d4fa",
|
|
300: "#4fc3f7",
|
|
400: "#29b6f6",
|
|
500: "#03a9f4",
|
|
600: "#039be5",
|
|
700: "#0288d1",
|
|
800: "#0277bd",
|
|
900: "#01579b",
|
|
A100: "#80d8ff",
|
|
A200: "#40c4ff",
|
|
A400: "#00b0ff",
|
|
A700: "#0091ea"
|
|
};
|
|
var lightBlue_default = lightBlue;
|
|
|
|
// node_modules/@mui/material/esm/colors/green.js
|
|
var green = {
|
|
50: "#e8f5e9",
|
|
100: "#c8e6c9",
|
|
200: "#a5d6a7",
|
|
300: "#81c784",
|
|
400: "#66bb6a",
|
|
500: "#4caf50",
|
|
600: "#43a047",
|
|
700: "#388e3c",
|
|
800: "#2e7d32",
|
|
900: "#1b5e20",
|
|
A100: "#b9f6ca",
|
|
A200: "#69f0ae",
|
|
A400: "#00e676",
|
|
A700: "#00c853"
|
|
};
|
|
var green_default = green;
|
|
|
|
// node_modules/@mui/material/esm/styles/createPalette.js
|
|
var _excluded5 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
var light = {
|
|
text: {
|
|
primary: "rgba(0, 0, 0, 0.87)",
|
|
secondary: "rgba(0, 0, 0, 0.6)",
|
|
disabled: "rgba(0, 0, 0, 0.38)"
|
|
},
|
|
divider: "rgba(0, 0, 0, 0.12)",
|
|
background: {
|
|
paper: common_default.white,
|
|
default: common_default.white
|
|
},
|
|
action: {
|
|
active: "rgba(0, 0, 0, 0.54)",
|
|
hover: "rgba(0, 0, 0, 0.04)",
|
|
hoverOpacity: 0.04,
|
|
selected: "rgba(0, 0, 0, 0.08)",
|
|
selectedOpacity: 0.08,
|
|
disabled: "rgba(0, 0, 0, 0.26)",
|
|
disabledBackground: "rgba(0, 0, 0, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(0, 0, 0, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.12
|
|
}
|
|
};
|
|
var dark = {
|
|
text: {
|
|
primary: common_default.white,
|
|
secondary: "rgba(255, 255, 255, 0.7)",
|
|
disabled: "rgba(255, 255, 255, 0.5)",
|
|
icon: "rgba(255, 255, 255, 0.5)"
|
|
},
|
|
divider: "rgba(255, 255, 255, 0.12)",
|
|
background: {
|
|
paper: "#121212",
|
|
default: "#121212"
|
|
},
|
|
action: {
|
|
active: common_default.white,
|
|
hover: "rgba(255, 255, 255, 0.08)",
|
|
hoverOpacity: 0.08,
|
|
selected: "rgba(255, 255, 255, 0.16)",
|
|
selectedOpacity: 0.16,
|
|
disabled: "rgba(255, 255, 255, 0.3)",
|
|
disabledBackground: "rgba(255, 255, 255, 0.12)",
|
|
disabledOpacity: 0.38,
|
|
focus: "rgba(255, 255, 255, 0.12)",
|
|
focusOpacity: 0.12,
|
|
activatedOpacity: 0.24
|
|
}
|
|
};
|
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
if (!intent[direction]) {
|
|
if (intent.hasOwnProperty(shade)) {
|
|
intent[direction] = intent[shade];
|
|
} else if (direction === "light") {
|
|
intent.light = lighten(intent.main, tonalOffsetLight);
|
|
} else if (direction === "dark") {
|
|
intent.dark = darken(intent.main, tonalOffsetDark);
|
|
}
|
|
}
|
|
}
|
|
function getDefaultPrimary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: blue_default[200],
|
|
light: blue_default[50],
|
|
dark: blue_default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: blue_default[700],
|
|
light: blue_default[400],
|
|
dark: blue_default[800]
|
|
};
|
|
}
|
|
function getDefaultSecondary(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: purple_default[200],
|
|
light: purple_default[50],
|
|
dark: purple_default[400]
|
|
};
|
|
}
|
|
return {
|
|
main: purple_default[500],
|
|
light: purple_default[300],
|
|
dark: purple_default[700]
|
|
};
|
|
}
|
|
function getDefaultError(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: red_default[500],
|
|
light: red_default[300],
|
|
dark: red_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: red_default[700],
|
|
light: red_default[400],
|
|
dark: red_default[800]
|
|
};
|
|
}
|
|
function getDefaultInfo(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: lightBlue_default[400],
|
|
light: lightBlue_default[300],
|
|
dark: lightBlue_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: lightBlue_default[700],
|
|
light: lightBlue_default[500],
|
|
dark: lightBlue_default[900]
|
|
};
|
|
}
|
|
function getDefaultSuccess(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: green_default[400],
|
|
light: green_default[300],
|
|
dark: green_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: green_default[800],
|
|
light: green_default[500],
|
|
dark: green_default[900]
|
|
};
|
|
}
|
|
function getDefaultWarning(mode = "light") {
|
|
if (mode === "dark") {
|
|
return {
|
|
main: orange_default[400],
|
|
light: orange_default[300],
|
|
dark: orange_default[700]
|
|
};
|
|
}
|
|
return {
|
|
main: "#ed6c02",
|
|
light: orange_default[500],
|
|
dark: orange_default[900]
|
|
};
|
|
}
|
|
function createPalette(palette2) {
|
|
const {
|
|
mode = "light",
|
|
contrastThreshold = 3,
|
|
tonalOffset = 0.2
|
|
} = palette2, other = _objectWithoutPropertiesLoose(palette2, _excluded5);
|
|
const primary = palette2.primary || getDefaultPrimary(mode);
|
|
const secondary = palette2.secondary || getDefaultSecondary(mode);
|
|
const error = palette2.error || getDefaultError(mode);
|
|
const info = palette2.info || getDefaultInfo(mode);
|
|
const success = palette2.success || getDefaultSuccess(mode);
|
|
const warning3 = palette2.warning || getDefaultWarning(mode);
|
|
function getContrastText(background) {
|
|
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
if (true) {
|
|
const contrast = getContrastRatio(background, contrastText);
|
|
if (contrast < 3) {
|
|
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, "falls below the WCAG recommended absolute minimum contrast ratio of 3:1.", "https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join("\n"));
|
|
}
|
|
}
|
|
return contrastText;
|
|
}
|
|
const augmentColor = ({
|
|
color: color2,
|
|
name,
|
|
mainShade = 500,
|
|
lightShade = 300,
|
|
darkShade = 700
|
|
}) => {
|
|
color2 = _extends({}, color2);
|
|
if (!color2.main && color2[mainShade]) {
|
|
color2.main = color2[mainShade];
|
|
}
|
|
if (!color2.hasOwnProperty("main")) {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : formatMuiErrorMessage(11, name ? ` (${name})` : "", mainShade));
|
|
}
|
|
if (typeof color2.main !== "string") {
|
|
throw new Error(true ? `MUI: The color${name ? ` (${name})` : ""} provided to augmentColor(color) is invalid.
|
|
\`color.main\` should be a string, but \`${JSON.stringify(color2.main)}\` was provided instead.
|
|
|
|
Did you intend to use one of the following approaches?
|
|
|
|
import { green } from "@mui/material/colors";
|
|
|
|
const theme1 = createTheme({ palette: {
|
|
primary: green,
|
|
} });
|
|
|
|
const theme2 = createTheme({ palette: {
|
|
primary: { main: green[500] },
|
|
} });` : formatMuiErrorMessage(12, name ? ` (${name})` : "", JSON.stringify(color2.main)));
|
|
}
|
|
addLightOrDark(color2, "light", lightShade, tonalOffset);
|
|
addLightOrDark(color2, "dark", darkShade, tonalOffset);
|
|
if (!color2.contrastText) {
|
|
color2.contrastText = getContrastText(color2.main);
|
|
}
|
|
return color2;
|
|
};
|
|
const modes = {
|
|
dark,
|
|
light
|
|
};
|
|
if (true) {
|
|
if (!modes[mode]) {
|
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
}
|
|
}
|
|
const paletteOutput = deepmerge(_extends({
|
|
common: _extends({}, common_default),
|
|
mode,
|
|
primary: augmentColor({
|
|
color: primary,
|
|
name: "primary"
|
|
}),
|
|
secondary: augmentColor({
|
|
color: secondary,
|
|
name: "secondary",
|
|
mainShade: "A400",
|
|
lightShade: "A200",
|
|
darkShade: "A700"
|
|
}),
|
|
error: augmentColor({
|
|
color: error,
|
|
name: "error"
|
|
}),
|
|
warning: augmentColor({
|
|
color: warning3,
|
|
name: "warning"
|
|
}),
|
|
info: augmentColor({
|
|
color: info,
|
|
name: "info"
|
|
}),
|
|
success: augmentColor({
|
|
color: success,
|
|
name: "success"
|
|
}),
|
|
grey: grey_default,
|
|
contrastThreshold,
|
|
getContrastText,
|
|
augmentColor,
|
|
tonalOffset
|
|
}, modes[mode]), other);
|
|
return paletteOutput;
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/createTypography.js
|
|
var _excluded6 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
function round(value) {
|
|
return Math.round(value * 1e5) / 1e5;
|
|
}
|
|
var caseAllCaps = {
|
|
textTransform: "uppercase"
|
|
};
|
|
var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
function createTypography(palette2, typography2) {
|
|
const _ref = typeof typography2 === "function" ? typography2(palette2) : typography2, {
|
|
fontFamily: fontFamily2 = defaultFontFamily,
|
|
fontSize: fontSize2 = 14,
|
|
fontWeightLight = 300,
|
|
fontWeightRegular = 400,
|
|
fontWeightMedium = 500,
|
|
fontWeightBold = 700,
|
|
htmlFontSize = 16,
|
|
allVariants,
|
|
pxToRem: pxToRem2
|
|
} = _ref, other = _objectWithoutPropertiesLoose(_ref, _excluded6);
|
|
if (true) {
|
|
if (typeof fontSize2 !== "number") {
|
|
console.error("MUI: `fontSize` is required to be a number.");
|
|
}
|
|
if (typeof htmlFontSize !== "number") {
|
|
console.error("MUI: `htmlFontSize` is required to be a number.");
|
|
}
|
|
}
|
|
const coef = fontSize2 / 14;
|
|
const pxToRem = pxToRem2 || ((size) => `${size / htmlFontSize * coef}rem`);
|
|
const buildVariant = (fontWeight2, size, lineHeight2, letterSpacing2, casing) => _extends({
|
|
fontFamily: fontFamily2,
|
|
fontWeight: fontWeight2,
|
|
fontSize: pxToRem(size),
|
|
lineHeight: lineHeight2
|
|
}, fontFamily2 === defaultFontFamily ? {
|
|
letterSpacing: `${round(letterSpacing2 / size)}em`
|
|
} : {}, casing, allVariants);
|
|
const variants = {
|
|
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
|
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
|
h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
|
|
h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
|
|
h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
|
|
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
|
|
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
|
|
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
|
|
body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
|
|
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
|
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
|
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
|
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)
|
|
};
|
|
return deepmerge(_extends({
|
|
htmlFontSize,
|
|
pxToRem,
|
|
fontFamily: fontFamily2,
|
|
fontSize: fontSize2,
|
|
fontWeightLight,
|
|
fontWeightRegular,
|
|
fontWeightMedium,
|
|
fontWeightBold
|
|
}, variants), other, {
|
|
clone: false
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/shadows.js
|
|
var shadowKeyUmbraOpacity = 0.2;
|
|
var shadowKeyPenumbraOpacity = 0.14;
|
|
var shadowAmbientShadowOpacity = 0.12;
|
|
function createShadow(...px) {
|
|
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
|
|
}
|
|
var shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
var shadows_default2 = shadows;
|
|
|
|
// node_modules/@mui/material/esm/styles/createTransitions.js
|
|
var _excluded7 = ["duration", "easing", "delay"];
|
|
var easing = {
|
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
|
|
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
|
|
};
|
|
var duration = {
|
|
shortest: 150,
|
|
shorter: 200,
|
|
short: 250,
|
|
standard: 300,
|
|
complex: 375,
|
|
enteringScreen: 225,
|
|
leavingScreen: 195
|
|
};
|
|
function formatMs(milliseconds) {
|
|
return `${Math.round(milliseconds)}ms`;
|
|
}
|
|
function getAutoHeightDuration(height2) {
|
|
if (!height2) {
|
|
return 0;
|
|
}
|
|
const constant = height2 / 36;
|
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
}
|
|
function createTransitions(inputTransitions) {
|
|
const mergedEasing = _extends({}, easing, inputTransitions.easing);
|
|
const mergedDuration = _extends({}, duration, inputTransitions.duration);
|
|
const create = (props = ["all"], options = {}) => {
|
|
const {
|
|
duration: durationOption = mergedDuration.standard,
|
|
easing: easingOption = mergedEasing.easeInOut,
|
|
delay = 0
|
|
} = options, other = _objectWithoutPropertiesLoose(options, _excluded7);
|
|
if (true) {
|
|
const isString = (value) => typeof value === "string";
|
|
const isNumber2 = (value) => !isNaN(parseFloat(value));
|
|
if (!isString(props) && !Array.isArray(props)) {
|
|
console.error('MUI: Argument "props" must be a string or Array.');
|
|
}
|
|
if (!isNumber2(durationOption) && !isString(durationOption)) {
|
|
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
|
}
|
|
if (!isString(easingOption)) {
|
|
console.error('MUI: Argument "easing" must be a string.');
|
|
}
|
|
if (!isNumber2(delay) && !isString(delay)) {
|
|
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
}
|
|
if (Object.keys(other).length !== 0) {
|
|
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(",")}].`);
|
|
}
|
|
}
|
|
return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
|
|
};
|
|
return _extends({
|
|
getAutoHeightDuration,
|
|
create
|
|
}, inputTransitions, {
|
|
easing: mergedEasing,
|
|
duration: mergedDuration
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/zIndex.js
|
|
var zIndex2 = {
|
|
mobileStepper: 1e3,
|
|
fab: 1050,
|
|
speedDial: 1050,
|
|
appBar: 1100,
|
|
drawer: 1200,
|
|
modal: 1300,
|
|
snackbar: 1400,
|
|
tooltip: 1500
|
|
};
|
|
var zIndex_default = zIndex2;
|
|
|
|
// node_modules/@mui/material/esm/styles/createTheme.js
|
|
var _excluded8 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
function createTheme2(options = {}, ...args) {
|
|
const {
|
|
mixins: mixinsInput = {},
|
|
palette: paletteInput = {},
|
|
transitions: transitionsInput = {},
|
|
typography: typographyInput = {}
|
|
} = options, other = _objectWithoutPropertiesLoose(options, _excluded8);
|
|
if (options.vars) {
|
|
throw new Error(true ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
Please use another name.` : formatMuiErrorMessage(18));
|
|
}
|
|
const palette2 = createPalette(paletteInput);
|
|
const systemTheme = createTheme_default(options);
|
|
let muiTheme = deepmerge(systemTheme, {
|
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
palette: palette2,
|
|
shadows: shadows_default2.slice(),
|
|
typography: createTypography(palette2, typographyInput),
|
|
transitions: createTransitions(transitionsInput),
|
|
zIndex: _extends({}, zIndex_default)
|
|
});
|
|
muiTheme = deepmerge(muiTheme, other);
|
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
if (true) {
|
|
const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
|
|
const traverse = (node, component) => {
|
|
let key;
|
|
for (key in node) {
|
|
const child = node[key];
|
|
if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {
|
|
if (true) {
|
|
const stateClass = generateUtilityClass("", key);
|
|
console.error([`MUI: The \`${component}\` component increases the CSS specificity of the \`${key}\` internal state.`, "You can not override it like this: ", JSON.stringify(node, null, 2), "", `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
|
root: {
|
|
[`&.${stateClass}`]: child
|
|
}
|
|
}, null, 2), "", "https://mui.com/r/state-classes-guide"].join("\n"));
|
|
}
|
|
node[key] = {};
|
|
}
|
|
}
|
|
};
|
|
Object.keys(muiTheme.components).forEach((component) => {
|
|
const styleOverrides = muiTheme.components[component].styleOverrides;
|
|
if (styleOverrides && component.indexOf("Mui") === 0) {
|
|
traverse(styleOverrides, component);
|
|
}
|
|
});
|
|
}
|
|
return muiTheme;
|
|
}
|
|
var createTheme_default2 = createTheme2;
|
|
|
|
// node_modules/@mui/material/esm/styles/defaultTheme.js
|
|
var defaultTheme = createTheme_default2();
|
|
var defaultTheme_default = defaultTheme;
|
|
|
|
// node_modules/@mui/material/esm/styles/useThemeProps.js
|
|
function useThemeProps2({
|
|
props,
|
|
name
|
|
}) {
|
|
return useThemeProps({
|
|
props,
|
|
name,
|
|
defaultTheme: defaultTheme_default
|
|
});
|
|
}
|
|
|
|
// node_modules/@mui/material/esm/styles/styled.js
|
|
var rootShouldForwardProp = (prop) => shouldForwardProp(prop) && prop !== "classes";
|
|
var styled2 = createStyled({
|
|
defaultTheme: defaultTheme_default,
|
|
rootShouldForwardProp
|
|
});
|
|
var styled_default = styled2;
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/svgIconClasses.js
|
|
function getSvgIconUtilityClass(slot) {
|
|
return generateUtilityClass("MuiSvgIcon", slot);
|
|
}
|
|
var svgIconClasses = generateUtilityClasses("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
|
|
|
|
// node_modules/@mui/material/esm/SvgIcon/SvgIcon.js
|
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime());
|
|
var _excluded9 = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
var useUtilityClasses = (ownerState) => {
|
|
const {
|
|
color: color2,
|
|
fontSize: fontSize2,
|
|
classes
|
|
} = ownerState;
|
|
const slots = {
|
|
root: ["root", color2 !== "inherit" && `color${capitalize_default(color2)}`, `fontSize${capitalize_default(fontSize2)}`]
|
|
};
|
|
return composeClasses(slots, getSvgIconUtilityClass, classes);
|
|
};
|
|
var SvgIconRoot = styled_default("svg", {
|
|
name: "MuiSvgIcon",
|
|
slot: "Root",
|
|
overridesResolver: (props, styles) => {
|
|
const {
|
|
ownerState
|
|
} = props;
|
|
return [styles.root, ownerState.color !== "inherit" && styles[`color${capitalize_default(ownerState.color)}`], styles[`fontSize${capitalize_default(ownerState.fontSize)}`]];
|
|
}
|
|
})(({
|
|
theme,
|
|
ownerState
|
|
}) => {
|
|
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette$ownerState$c2, _palette2, _palette2$action, _palette3, _palette3$action;
|
|
return {
|
|
userSelect: "none",
|
|
width: "1em",
|
|
height: "1em",
|
|
display: "inline-block",
|
|
fill: "currentColor",
|
|
flexShrink: 0,
|
|
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, "fill", {
|
|
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
}),
|
|
fontSize: {
|
|
inherit: "inherit",
|
|
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || "1.25rem",
|
|
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || "1.5rem",
|
|
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || "2.1875"
|
|
}[ownerState.fontSize],
|
|
color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {
|
|
action: (_palette2 = (theme.vars || theme).palette) == null ? void 0 : (_palette2$action = _palette2.action) == null ? void 0 : _palette2$action.active,
|
|
disabled: (_palette3 = (theme.vars || theme).palette) == null ? void 0 : (_palette3$action = _palette3.action) == null ? void 0 : _palette3$action.disabled,
|
|
inherit: void 0
|
|
}[ownerState.color]
|
|
};
|
|
});
|
|
var SvgIcon = /* @__PURE__ */ React3.forwardRef(function SvgIcon2(inProps, ref) {
|
|
const props = useThemeProps2({
|
|
props: inProps,
|
|
name: "MuiSvgIcon"
|
|
});
|
|
const {
|
|
children,
|
|
className,
|
|
color: color2 = "inherit",
|
|
component = "svg",
|
|
fontSize: fontSize2 = "medium",
|
|
htmlColor,
|
|
inheritViewBox = false,
|
|
titleAccess,
|
|
viewBox = "0 0 24 24"
|
|
} = props, other = _objectWithoutPropertiesLoose(props, _excluded9);
|
|
const ownerState = _extends({}, props, {
|
|
color: color2,
|
|
component,
|
|
fontSize: fontSize2,
|
|
instanceFontSize: inProps.fontSize,
|
|
inheritViewBox,
|
|
viewBox
|
|
});
|
|
const more = {};
|
|
if (!inheritViewBox) {
|
|
more.viewBox = viewBox;
|
|
}
|
|
const classes = useUtilityClasses(ownerState);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(SvgIconRoot, _extends({
|
|
as: component,
|
|
className: clsx_m_default(classes.root, className),
|
|
ownerState,
|
|
focusable: "false",
|
|
color: htmlColor,
|
|
"aria-hidden": titleAccess ? void 0 : true,
|
|
role: titleAccess ? "img" : void 0,
|
|
ref
|
|
}, more, other, {
|
|
children: [children, titleAccess ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", {
|
|
children: titleAccess
|
|
}) : null]
|
|
}));
|
|
});
|
|
true ? SvgIcon.propTypes = {
|
|
children: import_prop_types2.default.node,
|
|
classes: import_prop_types2.default.object,
|
|
className: import_prop_types2.default.string,
|
|
color: import_prop_types2.default.oneOfType([import_prop_types2.default.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), import_prop_types2.default.string]),
|
|
component: import_prop_types2.default.elementType,
|
|
fontSize: import_prop_types2.default.oneOfType([import_prop_types2.default.oneOf(["inherit", "large", "medium", "small"]), import_prop_types2.default.string]),
|
|
htmlColor: import_prop_types2.default.string,
|
|
inheritViewBox: import_prop_types2.default.bool,
|
|
shapeRendering: import_prop_types2.default.string,
|
|
sx: import_prop_types2.default.oneOfType([import_prop_types2.default.arrayOf(import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.object, import_prop_types2.default.bool])), import_prop_types2.default.func, import_prop_types2.default.object]),
|
|
titleAccess: import_prop_types2.default.string,
|
|
viewBox: import_prop_types2.default.string
|
|
} : void 0;
|
|
SvgIcon.muiName = "SvgIcon";
|
|
var SvgIcon_default = SvgIcon;
|
|
|
|
// node_modules/@mui/material/esm/utils/createSvgIcon.js
|
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime());
|
|
function createSvgIcon(path, displayName) {
|
|
const Component = (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SvgIcon_default, _extends({
|
|
"data-testid": `${displayName}Icon`,
|
|
ref
|
|
}, props, {
|
|
children: path
|
|
}));
|
|
if (true) {
|
|
Component.displayName = `${displayName}Icon`;
|
|
}
|
|
Component.muiName = SvgIcon_default.muiName;
|
|
return /* @__PURE__ */ React4.memo(/* @__PURE__ */ React4.forwardRef(Component));
|
|
}
|
|
|
|
// node_modules/@mui/icons-material/esm/ArrowDownward.js
|
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime());
|
|
var ArrowDownward_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", {
|
|
d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
}), "ArrowDownward");
|
|
|
|
// node_modules/@mui/icons-material/esm/ArrowUpward.js
|
|
var import_jsx_runtime6 = __toESM(require_jsx_runtime());
|
|
var ArrowUpward_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", {
|
|
d: "m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
|
|
}), "ArrowUpward");
|
|
|
|
// node_modules/@mui/icons-material/esm/Close.js
|
|
var import_jsx_runtime7 = __toESM(require_jsx_runtime());
|
|
var Close_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", {
|
|
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
}), "Close");
|
|
|
|
// node_modules/@mui/icons-material/esm/Delete.js
|
|
var import_jsx_runtime8 = __toESM(require_jsx_runtime());
|
|
var Delete_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", {
|
|
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"
|
|
}), "Delete");
|
|
|
|
// node_modules/@mui/icons-material/esm/Edit.js
|
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime());
|
|
var Edit_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", {
|
|
d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"
|
|
}), "Edit");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardArrowDown.js
|
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime());
|
|
var KeyboardArrowDown_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", {
|
|
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
}), "KeyboardArrowDown");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardArrowLeft.js
|
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime());
|
|
var KeyboardArrowLeft_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", {
|
|
d: "M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
|
|
}), "KeyboardArrowLeft");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardArrowRight.js
|
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime());
|
|
var KeyboardArrowRight_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", {
|
|
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
|
|
}), "KeyboardArrowRight");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardArrowUp.js
|
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime());
|
|
var KeyboardArrowUp_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", {
|
|
d: "M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"
|
|
}), "KeyboardArrowUp");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardBackspace.js
|
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime());
|
|
var KeyboardBackspace_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", {
|
|
d: "M21 11H6.83l3.58-3.59L9 6l-6 6 6 6 1.41-1.41L6.83 13H21z"
|
|
}), "KeyboardBackspace");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardDoubleArrowDown.js
|
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
|
|
var KeyboardDoubleArrowDown_default = createSvgIcon([/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", {
|
|
d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"
|
|
}, "0"), /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", {
|
|
d: "m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"
|
|
}, "1")], "KeyboardDoubleArrowDown");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardDoubleArrowLeft.js
|
|
var import_jsx_runtime16 = __toESM(require_jsx_runtime());
|
|
var KeyboardDoubleArrowLeft_default = createSvgIcon([/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", {
|
|
d: "M17.59 18 19 16.59 14.42 12 19 7.41 17.59 6l-6 6z"
|
|
}, "0"), /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", {
|
|
d: "m11 18 1.41-1.41L7.83 12l4.58-4.59L11 6l-6 6z"
|
|
}, "1")], "KeyboardDoubleArrowLeft");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardDoubleArrowRight.js
|
|
var import_jsx_runtime17 = __toESM(require_jsx_runtime());
|
|
var KeyboardDoubleArrowRight_default = createSvgIcon([/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", {
|
|
d: "M6.41 6 5 7.41 9.58 12 5 16.59 6.41 18l6-6z"
|
|
}, "0"), /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", {
|
|
d: "m13 6-1.41 1.41L16.17 12l-4.58 4.59L13 18l6-6z"
|
|
}, "1")], "KeyboardDoubleArrowRight");
|
|
|
|
// node_modules/@mui/icons-material/esm/KeyboardDoubleArrowUp.js
|
|
var import_jsx_runtime18 = __toESM(require_jsx_runtime());
|
|
var KeyboardDoubleArrowUp_default = createSvgIcon([/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", {
|
|
d: "M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"
|
|
}, "0"), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", {
|
|
d: "m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"
|
|
}, "1")], "KeyboardDoubleArrowUp");
|
|
|
|
// node_modules/@mui/icons-material/esm/MoreHoriz.js
|
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime());
|
|
var MoreHoriz_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", {
|
|
d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
}), "MoreHoriz");
|
|
|
|
// node_modules/@mui/icons-material/esm/MoreVert.js
|
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime());
|
|
var MoreVert_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", {
|
|
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
}), "MoreVert");
|
|
|
|
// node_modules/@mui/icons-material/esm/MoveDown.js
|
|
var import_jsx_runtime21 = __toESM(require_jsx_runtime());
|
|
var MoveDown_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("path", {
|
|
d: "M3 11c0 2.45 1.76 4.47 4.08 4.91l-1.49-1.49L7 13l4 4.01L7 21l-1.41-1.41 1.58-1.58v-.06C3.7 17.54 1 14.58 1 11c0-3.87 3.13-7 7-7h3v2H8c-2.76 0-5 2.24-5 5zm19 0V4h-9v7h9zm-2-2h-5V6h5v3zm-7 4h9v7h-9z"
|
|
}), "MoveDown");
|
|
|
|
// node_modules/@mui/icons-material/esm/MoveUp.js
|
|
var import_jsx_runtime22 = __toESM(require_jsx_runtime());
|
|
var MoveUp_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", {
|
|
d: "M3 13c0-2.45 1.76-4.47 4.08-4.91l-1.49 1.5L7 11l4-4.01L7 3 5.59 4.41l1.58 1.58v.06C3.7 6.46 1 9.42 1 13c0 3.87 3.13 7 7 7h3v-2H8c-2.76 0-5-2.24-5-5zm10 0v7h9v-7h-9zm7 5h-5v-3h5v3zM13 4h9v7h-9z"
|
|
}), "MoveUp");
|
|
|
|
// node_modules/@mui/icons-material/esm/Sort.js
|
|
var import_jsx_runtime23 = __toESM(require_jsx_runtime());
|
|
var Sort_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", {
|
|
d: "M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"
|
|
}), "Sort");
|
|
|
|
// node_modules/@mui/icons-material/esm/TextSnippet.js
|
|
var import_jsx_runtime24 = __toESM(require_jsx_runtime());
|
|
var TextSnippet_default = createSvgIcon(/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", {
|
|
d: "m20.41 8.41-4.83-4.83c-.37-.37-.88-.58-1.41-.58H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.42zM7 7h7v2H7V7zm10 10H7v-2h10v2zm0-4H7v-2h10v2z"
|
|
}), "TextSnippet");
|
|
|
|
// src/components/Icon/services/utils.tsx
|
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime());
|
|
var findIcon = (icon, className) => {
|
|
switch (icon) {
|
|
case 0 /* ARROW_UPWARD */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArrowUpward_default, {
|
|
className
|
|
});
|
|
case 1 /* ARROW_DOWNWARD */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArrowDownward_default, {
|
|
className
|
|
});
|
|
case "KeyboardArrowUp" /* KEYBOARD_ARROW_UP */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardArrowUp_default, {
|
|
className
|
|
});
|
|
case "KeyboardArrowDown" /* KEYBOARD_ARROW_DOWN */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardArrowDown_default, {
|
|
className
|
|
});
|
|
case "KeyboardDoubleArrowUp" /* KEYBOARD_DOUBLE_ARROW_UP */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardDoubleArrowUp_default, {
|
|
className
|
|
});
|
|
case "KeyboardDoubleArrowDown" /* KEYBOARD_DOUBLE_ARROW_DOWN */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardDoubleArrowDown_default, {
|
|
className
|
|
});
|
|
case "KeyboardArrowLeft" /* KEYBOARD_ARROW_LEFT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardArrowLeft_default, {
|
|
className
|
|
});
|
|
case "KeyboardArrowRight" /* KEYBOARD_ARROW_RIGHT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardArrowRight_default, {
|
|
className
|
|
});
|
|
case "KeyboardDoubleArrowLeft" /* KEYBOARD_DOUBLE_ARROW_LEFT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardDoubleArrowLeft_default, {
|
|
className
|
|
});
|
|
case "KeyboardDoubleArrowRight" /* KEYBOARD_DOUBLE_ARROW_RIGHT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardDoubleArrowRight_default, {
|
|
className
|
|
});
|
|
case "Delete" /* DELETE */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Delete_default, {
|
|
className
|
|
});
|
|
case "MoreVert" /* MORE_VERT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MoreVert_default, {
|
|
className
|
|
});
|
|
case "Sort" /* SORT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Sort_default, {
|
|
className
|
|
});
|
|
case "KeyboardBackspace" /* KEYBOARD_BACKSPACE */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(KeyboardBackspace_default, {
|
|
className
|
|
});
|
|
case "MoveUp" /* MOVE_UP */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MoveUp_default, {
|
|
className
|
|
});
|
|
case "MoveDown" /* MOVE_DOWN */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MoveDown_default, {
|
|
className
|
|
});
|
|
case "TextSnippet" /* TEXT_SNIPPET */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TextSnippet_default, {
|
|
className
|
|
});
|
|
case "Edit" /* EDIT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Edit_default, {
|
|
className
|
|
});
|
|
case "MoreHoriz" /* MORE_HORIZ */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MoreHoriz_default, {
|
|
className
|
|
});
|
|
case "Close" /* CLOSE */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Close_default, {
|
|
className
|
|
});
|
|
default:
|
|
return "";
|
|
}
|
|
};
|
|
|
|
// src/components/Icon/index.tsx
|
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime());
|
|
function Icon({ icon, variant = "md", onClick }) {
|
|
let className = "";
|
|
if (variant === "sm") {
|
|
className = "NLT__icon--sm";
|
|
} else if (variant === "md") {
|
|
className = "NLT__icon--md";
|
|
} else if (variant === "lg") {
|
|
className = "NLT__icon--lg";
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", {
|
|
className: "NLT__icon",
|
|
onClick: onClick && onClick,
|
|
children: findIcon(icon, className)
|
|
});
|
|
}
|
|
|
|
// src/components/Button/index.tsx
|
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime());
|
|
function Button({
|
|
style: style3,
|
|
children,
|
|
icon,
|
|
isDarker,
|
|
onClick
|
|
}) {
|
|
let className = "NLT__button";
|
|
if (icon)
|
|
className += " NLT__button--icon";
|
|
if (isDarker)
|
|
className += " NLT__button--icon-darker";
|
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", {
|
|
style: style3,
|
|
className,
|
|
onClick: (e) => onClick(e),
|
|
children: icon ? icon : children
|
|
});
|
|
}
|
|
|
|
// src/components/Stack/index.tsx
|
|
var import_jsx_runtime28 = __toESM(require_jsx_runtime());
|
|
function Stack({ spacing: spacing2 = "md", children, isVertical }) {
|
|
let gap2 = "";
|
|
if (spacing2 === "sm") {
|
|
gap2 = "var(--nlt-spacing--sm)";
|
|
} else if (spacing2 === "md") {
|
|
gap2 = "var(--nlt-spacing--md)";
|
|
} else if (spacing2 === "lg") {
|
|
gap2 = "var(--nlt-spacing--lg)";
|
|
} else if (spacing2 === "xl") {
|
|
gap2 = "var(--nlt-spacing--xl)";
|
|
} else if (spacing2 === "2xl") {
|
|
gap2 = "var(--nlt-spacing--2xl)";
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", {
|
|
style: {
|
|
display: "flex",
|
|
flexDirection: isVertical ? "column" : "row",
|
|
alignItems: isVertical ? "flex-start" : "center",
|
|
justifyContent: isVertical ? "center" : "flex-start",
|
|
[isVertical ? "rowGap" : "columnGap"]: gap2
|
|
},
|
|
children
|
|
});
|
|
}
|
|
|
|
// src/components/Tag/index.tsx
|
|
var import_jsx_runtime29 = __toESM(require_jsx_runtime());
|
|
function Tag({
|
|
isDarkMode,
|
|
id,
|
|
color: color2,
|
|
html,
|
|
showRemove,
|
|
onRemoveClick
|
|
}) {
|
|
let tagClass = "NLT__tag";
|
|
tagClass += " " + findColorClass(isDarkMode, color2);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", {
|
|
className: tagClass,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Stack, {
|
|
spacing: "sm",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", {
|
|
className: "NLT__tag-content",
|
|
children: html_react_parser_default(html)
|
|
}),
|
|
showRemove && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, {
|
|
variant: "sm",
|
|
icon: "Close" /* CLOSE */
|
|
}),
|
|
isDarker: true,
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onRemoveClick(id);
|
|
}
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/TagCell/index.tsx
|
|
var import_jsx_runtime30 = __toESM(require_jsx_runtime());
|
|
function TagCell({ isDarkMode, html, color: color2 }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
|
|
className: "NLT__tag-cell",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tag, {
|
|
isDarkMode,
|
|
html,
|
|
color: color2
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/services/string/regex.ts
|
|
var TAG_REGEX = new RegExp(/^[#][^\s]+$/);
|
|
var NUMBER_REGEX = new RegExp(/^\d+$/);
|
|
var TAGS_REGEX = new RegExp(/#[^ \t]+/g);
|
|
var CSS_MEASUREMENT_PIXEL_REGEX = new RegExp(/^([1-9])([0-9]*)px$/);
|
|
var DATE_REGEX = new RegExp(/^\d{4}\/\d{2}\/\d{2}$/);
|
|
var CHECKBOX_REGEX = new RegExp(/^\[[x ]{0,1}\]$/);
|
|
var CHECKBOX_CHECKED_REGEX = new RegExp(/^\[[x]\]$/);
|
|
var SLASH_REGEX = new RegExp(/\/|\\/);
|
|
var INTERNAL_LINK_REGEX = new RegExp(/\[\[[^\\\[\]]+\]\]/, "g");
|
|
var INTERNAL_LINK_ALIAS_REGEX = new RegExp(/\|[^\n\r\]]+/);
|
|
var LEFT_SQUARE_BRACKET_REGEX = new RegExp(/\[/, "g");
|
|
var RIGHT_SQUARE_BRACKET_REGEX = new RegExp(/\]/, "g");
|
|
var EXTERNAL_LINK_REGEX = new RegExp(/http[s]{0,1}:\/\/[^\s]+/, "g");
|
|
var UNESCAPED_PIPE_REGEX = new RegExp(/[^\\]\|/, "g");
|
|
var TABLE_ID_REGEX = new RegExp(/^table-id-[a-zA-Z0-9_-]+$/);
|
|
var ROW_ID_REGEX = new RegExp(/^row-id-[a-zA-Z0-9_-]+$/);
|
|
var COLUMN_ID_REGEX = new RegExp(/^column-id-[a-zA-Z0-9_-]+$/);
|
|
|
|
// src/services/string/validators.ts
|
|
var isMatch = (input, regex) => {
|
|
return (input.match(regex) || []).length !== 0;
|
|
};
|
|
var isNumber = (input) => {
|
|
return isMatch(input, NUMBER_REGEX);
|
|
};
|
|
var isDate = (input) => {
|
|
return isMatch(input, DATE_REGEX);
|
|
};
|
|
var isCheckbox = (input) => {
|
|
return isMatch(input, CHECKBOX_REGEX);
|
|
};
|
|
|
|
// src/services/table/types.ts
|
|
var DEFAULT_COLUMN_SETTINGS = {
|
|
sortDir: "default" /* NONE */,
|
|
width: "120px",
|
|
type: "text" /* TEXT */,
|
|
useAutoWidth: false,
|
|
shouldWrapOverflow: false,
|
|
tags: []
|
|
};
|
|
var DEFAULT_ROW_SETTINGS = {
|
|
creationDate: 0
|
|
};
|
|
|
|
// src/services/table/utils.ts
|
|
var sortCells = (rowIds, columnIds, cells) => {
|
|
return rowIds.map((id) => {
|
|
return cells.filter((c2) => c2.rowId === id);
|
|
}).map((row) => {
|
|
return row.sort((a2, b2) => {
|
|
const indexA = columnIds.findIndex(
|
|
(id) => id === a2.columnId
|
|
);
|
|
const indexB = columnIds.findIndex(
|
|
(id) => id === b2.columnId
|
|
);
|
|
return indexA - indexB;
|
|
});
|
|
}).flat(1);
|
|
};
|
|
var isValidCellContent = (content, cellType) => {
|
|
switch (cellType) {
|
|
case "number" /* NUMBER */:
|
|
return isNumber(content);
|
|
case "date" /* DATE */:
|
|
return isDate(content);
|
|
case "checkbox" /* CHECKBOX */:
|
|
return isCheckbox(content);
|
|
default:
|
|
return false;
|
|
}
|
|
};
|
|
var filterNumberFromContent = (content) => {
|
|
let result = "";
|
|
for (let i2 = 0; i2 < content.length; i2++) {
|
|
if (content[i2].match(NUMBER_REGEX))
|
|
result += content[i2];
|
|
}
|
|
return result;
|
|
};
|
|
var getUniqueTableId = (tableId, viewMode) => {
|
|
return "NLT_" + tableId + "-" + viewMode;
|
|
};
|
|
|
|
// src/components/CheckboxCell/index.tsx
|
|
var import_jsx_runtime31 = __toESM(require_jsx_runtime());
|
|
function CheckboxCell({ content, onCheckboxChange }) {
|
|
if (!isValidCellContent(content, "checkbox" /* CHECKBOX */))
|
|
content = "[ ]";
|
|
let isChecked = content.includes("x");
|
|
function handleClick() {
|
|
if (isChecked) {
|
|
onCheckboxChange("[ ]");
|
|
} else {
|
|
onCheckboxChange("[x]");
|
|
}
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", {
|
|
className: "NLT__checkbox-cell",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", {
|
|
className: "task-list-item-checkbox",
|
|
type: "checkbox",
|
|
checked: isChecked,
|
|
onChange: () => {
|
|
},
|
|
onClick: handleClick
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/DateCell/index.tsx
|
|
var import_jsx_runtime32 = __toESM(require_jsx_runtime());
|
|
function DateCell({ content }) {
|
|
if (!isValidCellContent(content, "date" /* DATE */))
|
|
content = "";
|
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
className: "NLT__date-cell",
|
|
children: content
|
|
});
|
|
}
|
|
|
|
// src/components/NumberCell/index.tsx
|
|
var import_jsx_runtime33 = __toESM(require_jsx_runtime());
|
|
function NumberCell({
|
|
content,
|
|
shouldWrapOverflow,
|
|
useAutoWidth
|
|
}) {
|
|
let className = "NLT__number-cell";
|
|
if (useAutoWidth) {
|
|
className += " NLT__auto-width";
|
|
} else {
|
|
if (shouldWrapOverflow) {
|
|
className += " NLT__wrap-overflow";
|
|
} else {
|
|
className += " NLT__hide-overflow";
|
|
}
|
|
}
|
|
if (!isValidCellContent(content, "number" /* NUMBER */))
|
|
content = filterNumberFromContent(content);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", {
|
|
className,
|
|
children: content
|
|
});
|
|
}
|
|
|
|
// src/components/NumberCellEdit/index.tsx
|
|
var import_react = __toESM(require_react());
|
|
var import_jsx_runtime34 = __toESM(require_jsx_runtime());
|
|
function NumberCellEdit({ content, onInputChange }) {
|
|
const inputRef = (0, import_react.useRef)(null);
|
|
function handleInputChange(value) {
|
|
value = value.replace("\n", "");
|
|
return onInputChange(value);
|
|
}
|
|
if (!isValidCellContent(content, "number" /* NUMBER */))
|
|
content = filterNumberFromContent(content);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", {
|
|
className: "NLT__number-cell-edit",
|
|
type: "number",
|
|
ref: inputRef,
|
|
autoFocus: true,
|
|
value: content,
|
|
onChange: (e) => handleInputChange(e.target.value)
|
|
});
|
|
}
|
|
|
|
// src/components/TextCellEdit/index.tsx
|
|
var import_react2 = __toESM(require_react());
|
|
|
|
// src/services/io/utils.ts
|
|
var replaceUnescapedPipes = (markdown) => {
|
|
const matches = Array.from(markdown.matchAll(UNESCAPED_PIPE_REGEX));
|
|
matches.forEach((match) => {
|
|
const pipe = match[0];
|
|
markdown = markdown.replace(pipe, pipe[0] + "\\|");
|
|
});
|
|
return markdown;
|
|
};
|
|
var serializeFrontMatter = (model) => {
|
|
const frontmatter = [];
|
|
frontmatter.push("---");
|
|
frontmatter.push(serializeColumnIds(model.columnIds));
|
|
frontmatter.push(serializeRowIds(model.rowIds));
|
|
frontmatter.push("---");
|
|
return frontmatter.join("\n");
|
|
};
|
|
var serializeColumnIds = (columnIds) => {
|
|
return `columnIds: ${JSON.stringify(columnIds)}`;
|
|
};
|
|
var serializeRowIds = (rowIds) => {
|
|
return `rowIds: ${JSON.stringify(rowIds)}`;
|
|
};
|
|
var findTableFile = (plugin, tableId) => __async(void 0, null, function* () {
|
|
const tableFolder = plugin.settings.tableFolder;
|
|
const folder = plugin.app.vault.getAbstractFileByPath(tableFolder);
|
|
if (!folder)
|
|
yield plugin.app.vault.createFolder(tableFolder);
|
|
const file = plugin.app.vault.getAbstractFileByPath(
|
|
`${tableFolder}/${tableId}.md`
|
|
);
|
|
if (file)
|
|
return { file, isNewFile: false };
|
|
const createdFile = yield plugin.app.vault.create(
|
|
`${tableFolder}/${tableId}.md`,
|
|
""
|
|
);
|
|
return { file: createdFile, isNewFile: true };
|
|
});
|
|
|
|
// src/components/TextCellEdit/index.tsx
|
|
var import_jsx_runtime35 = __toESM(require_jsx_runtime());
|
|
function TextCellEdit({ content, onInputChange }) {
|
|
const inputRef = (0, import_react2.useRef)(null);
|
|
function focusInput() {
|
|
inputRef.current.focus();
|
|
}
|
|
function setSelection(pos) {
|
|
inputRef.current.selectionStart = pos;
|
|
inputRef.current.selectionEnd = pos;
|
|
}
|
|
(0, import_react2.useEffect)(() => {
|
|
focusInput();
|
|
setSelection(content.length);
|
|
}, []);
|
|
function handleTextareaChange(value) {
|
|
value = value.replace("\n", "");
|
|
value = replaceUnescapedPipes(value);
|
|
onInputChange(value);
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("textarea", {
|
|
className: "NLT__textarea",
|
|
ref: inputRef,
|
|
autoFocus: true,
|
|
value: content,
|
|
onChange: (e) => handleTextareaChange(e.target.value)
|
|
});
|
|
}
|
|
|
|
// src/components/TagCellEdit/index.tsx
|
|
var import_react12 = __toESM(require_react());
|
|
|
|
// src/components/Menu/index.tsx
|
|
var import_react_dom = __toESM(require_react_dom());
|
|
|
|
// src/services/string/conversion.ts
|
|
var dateToString = (date) => {
|
|
const year = date.getFullYear();
|
|
const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
const day = ("0" + date.getDate()).slice(-2);
|
|
return `${year}/${month}/${day}`;
|
|
};
|
|
var pxToNum = (pixels) => {
|
|
return parseFloat(pixels.split("px")[0]);
|
|
};
|
|
var numToPx = (num) => {
|
|
return `${num}px`;
|
|
};
|
|
|
|
// src/components/Menu/index.tsx
|
|
var import_jsx_runtime36 = __toESM(require_jsx_runtime());
|
|
function Menu({
|
|
id,
|
|
isOpen,
|
|
top: top2 = 0,
|
|
left: left2 = 0,
|
|
minWidth: minWidth2 = 0,
|
|
maxWidth: maxWidth2 = 0,
|
|
width: width2 = 0,
|
|
height: height2 = 0,
|
|
children
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_jsx_runtime36.Fragment, {
|
|
children: isOpen && import_react_dom.default.createPortal(
|
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", {
|
|
className: "NLT__menu",
|
|
id,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", {
|
|
className: "NLT__menu-container",
|
|
style: {
|
|
top: numToPx(top2),
|
|
left: numToPx(left2),
|
|
minWidth: numToPx(minWidth2),
|
|
maxWidth: maxWidth2 === 0 ? "max-content" : numToPx(maxWidth2),
|
|
width: width2 === 0 ? "max-content" : numToPx(width2),
|
|
height: height2 === 0 ? "max-content" : numToPx(height2)
|
|
},
|
|
children
|
|
})
|
|
}),
|
|
document.body
|
|
)
|
|
});
|
|
}
|
|
|
|
// src/services/string/utils.ts
|
|
var uppercaseFirst = (input) => {
|
|
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
};
|
|
|
|
// src/components/TagColorMenu/components/ColorItem/index.tsx
|
|
var import_jsx_runtime37 = __toESM(require_jsx_runtime());
|
|
function ColorItem({
|
|
isDarkMode,
|
|
color: color2,
|
|
isSelected,
|
|
onColorClick
|
|
}) {
|
|
let containerClass = "NLT__color-item NLT__selectable";
|
|
if (isSelected)
|
|
containerClass += " NLT__selected";
|
|
const colorClass = findColorClass(isDarkMode, color2);
|
|
let squareClass = "NLT__color-item-square";
|
|
squareClass += " " + colorClass;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", {
|
|
className: containerClass,
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onColorClick(color2);
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", {
|
|
className: squareClass
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", {
|
|
children: uppercaseFirst(color2)
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// node_modules/react-redux/es/index.js
|
|
var import_shim = __toESM(require_shim());
|
|
var import_with_selector = __toESM(require_with_selector());
|
|
|
|
// node_modules/react-redux/es/utils/reactBatchedUpdates.js
|
|
var import_react_dom2 = __toESM(require_react_dom());
|
|
|
|
// node_modules/react-redux/es/utils/batch.js
|
|
function defaultNoopBatch(callback) {
|
|
callback();
|
|
}
|
|
var batch = defaultNoopBatch;
|
|
var setBatch = (newBatch) => batch = newBatch;
|
|
var getBatch = () => batch;
|
|
|
|
// node_modules/react-redux/es/hooks/useSelector.js
|
|
var import_react5 = __toESM(require_react());
|
|
|
|
// node_modules/react-redux/es/hooks/useReduxContext.js
|
|
var import_react4 = __toESM(require_react());
|
|
|
|
// node_modules/react-redux/es/components/Context.js
|
|
var import_react3 = __toESM(require_react());
|
|
var ReactReduxContext = /* @__PURE__ */ (0, import_react3.createContext)(null);
|
|
if (true) {
|
|
ReactReduxContext.displayName = "ReactRedux";
|
|
}
|
|
|
|
// node_modules/react-redux/es/hooks/useReduxContext.js
|
|
function useReduxContext() {
|
|
const contextValue = (0, import_react4.useContext)(ReactReduxContext);
|
|
if (!contextValue) {
|
|
throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");
|
|
}
|
|
return contextValue;
|
|
}
|
|
|
|
// node_modules/react-redux/es/utils/useSyncExternalStore.js
|
|
var notInitialized = () => {
|
|
throw new Error("uSES not initialized!");
|
|
};
|
|
|
|
// node_modules/react-redux/es/hooks/useSelector.js
|
|
var useSyncExternalStoreWithSelector = notInitialized;
|
|
var initializeUseSelector = (fn2) => {
|
|
useSyncExternalStoreWithSelector = fn2;
|
|
};
|
|
var refEquality = (a2, b2) => a2 === b2;
|
|
function createSelectorHook(context = ReactReduxContext) {
|
|
const useReduxContext2 = context === ReactReduxContext ? useReduxContext : () => (0, import_react5.useContext)(context);
|
|
return function useSelector2(selector, equalityFn = refEquality) {
|
|
if (true) {
|
|
if (!selector) {
|
|
throw new Error(`You must pass a selector to useSelector`);
|
|
}
|
|
if (typeof selector !== "function") {
|
|
throw new Error(`You must pass a function as a selector to useSelector`);
|
|
}
|
|
if (typeof equalityFn !== "function") {
|
|
throw new Error(`You must pass a function as an equality function to useSelector`);
|
|
}
|
|
}
|
|
const {
|
|
store: store2,
|
|
subscription,
|
|
getServerState
|
|
} = useReduxContext2();
|
|
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store2.getState, getServerState || store2.getState, selector, equalityFn);
|
|
(0, import_react5.useDebugValue)(selectedState);
|
|
return selectedState;
|
|
};
|
|
}
|
|
var useSelector = /* @__PURE__ */ createSelectorHook();
|
|
|
|
// node_modules/react-redux/es/components/connect.js
|
|
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
|
|
var import_react7 = __toESM(require_react());
|
|
var import_react_is2 = __toESM(require_react_is2());
|
|
|
|
// node_modules/react-redux/es/utils/Subscription.js
|
|
function createListenerCollection() {
|
|
const batch2 = getBatch();
|
|
let first = null;
|
|
let last = null;
|
|
return {
|
|
clear() {
|
|
first = null;
|
|
last = null;
|
|
},
|
|
notify() {
|
|
batch2(() => {
|
|
let listener2 = first;
|
|
while (listener2) {
|
|
listener2.callback();
|
|
listener2 = listener2.next;
|
|
}
|
|
});
|
|
},
|
|
get() {
|
|
let listeners = [];
|
|
let listener2 = first;
|
|
while (listener2) {
|
|
listeners.push(listener2);
|
|
listener2 = listener2.next;
|
|
}
|
|
return listeners;
|
|
},
|
|
subscribe(callback) {
|
|
let isSubscribed = true;
|
|
let listener2 = last = {
|
|
callback,
|
|
next: null,
|
|
prev: last
|
|
};
|
|
if (listener2.prev) {
|
|
listener2.prev.next = listener2;
|
|
} else {
|
|
first = listener2;
|
|
}
|
|
return function unsubscribe() {
|
|
if (!isSubscribed || first === null)
|
|
return;
|
|
isSubscribed = false;
|
|
if (listener2.next) {
|
|
listener2.next.prev = listener2.prev;
|
|
} else {
|
|
last = listener2.prev;
|
|
}
|
|
if (listener2.prev) {
|
|
listener2.prev.next = listener2.next;
|
|
} else {
|
|
first = listener2.next;
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}
|
|
var nullListeners = {
|
|
notify() {
|
|
},
|
|
get: () => []
|
|
};
|
|
function createSubscription(store2, parentSub) {
|
|
let unsubscribe;
|
|
let listeners = nullListeners;
|
|
function addNestedSub(listener2) {
|
|
trySubscribe();
|
|
return listeners.subscribe(listener2);
|
|
}
|
|
function notifyNestedSubs() {
|
|
listeners.notify();
|
|
}
|
|
function handleChangeWrapper() {
|
|
if (subscription.onStateChange) {
|
|
subscription.onStateChange();
|
|
}
|
|
}
|
|
function isSubscribed() {
|
|
return Boolean(unsubscribe);
|
|
}
|
|
function trySubscribe() {
|
|
if (!unsubscribe) {
|
|
unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store2.subscribe(handleChangeWrapper);
|
|
listeners = createListenerCollection();
|
|
}
|
|
}
|
|
function tryUnsubscribe() {
|
|
if (unsubscribe) {
|
|
unsubscribe();
|
|
unsubscribe = void 0;
|
|
listeners.clear();
|
|
listeners = nullListeners;
|
|
}
|
|
}
|
|
const subscription = {
|
|
addNestedSub,
|
|
notifyNestedSubs,
|
|
handleChangeWrapper,
|
|
isSubscribed,
|
|
trySubscribe,
|
|
tryUnsubscribe,
|
|
getListeners: () => listeners
|
|
};
|
|
return subscription;
|
|
}
|
|
|
|
// node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js
|
|
var import_react6 = __toESM(require_react());
|
|
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
var useIsomorphicLayoutEffect = canUseDOM ? import_react6.useLayoutEffect : import_react6.useEffect;
|
|
|
|
// node_modules/react-redux/es/components/connect.js
|
|
var useSyncExternalStore = notInitialized;
|
|
var initializeConnect = (fn2) => {
|
|
useSyncExternalStore = fn2;
|
|
};
|
|
|
|
// node_modules/react-redux/es/components/Provider.js
|
|
var import_react8 = __toESM(require_react());
|
|
function Provider({
|
|
store: store2,
|
|
context,
|
|
children,
|
|
serverState
|
|
}) {
|
|
const contextValue = (0, import_react8.useMemo)(() => {
|
|
const subscription = createSubscription(store2);
|
|
return {
|
|
store: store2,
|
|
subscription,
|
|
getServerState: serverState ? () => serverState : void 0
|
|
};
|
|
}, [store2, serverState]);
|
|
const previousState = (0, import_react8.useMemo)(() => store2.getState(), [store2]);
|
|
useIsomorphicLayoutEffect(() => {
|
|
const {
|
|
subscription
|
|
} = contextValue;
|
|
subscription.onStateChange = subscription.notifyNestedSubs;
|
|
subscription.trySubscribe();
|
|
if (previousState !== store2.getState()) {
|
|
subscription.notifyNestedSubs();
|
|
}
|
|
return () => {
|
|
subscription.tryUnsubscribe();
|
|
subscription.onStateChange = void 0;
|
|
};
|
|
}, [contextValue, previousState]);
|
|
const Context = context || ReactReduxContext;
|
|
return /* @__PURE__ */ import_react8.default.createElement(Context.Provider, {
|
|
value: contextValue
|
|
}, children);
|
|
}
|
|
var Provider_default = Provider;
|
|
|
|
// node_modules/react-redux/es/hooks/useStore.js
|
|
var import_react9 = __toESM(require_react());
|
|
function createStoreHook(context = ReactReduxContext) {
|
|
const useReduxContext2 = context === ReactReduxContext ? useReduxContext : () => (0, import_react9.useContext)(context);
|
|
return function useStore2() {
|
|
const {
|
|
store: store2
|
|
} = useReduxContext2();
|
|
return store2;
|
|
};
|
|
}
|
|
var useStore = /* @__PURE__ */ createStoreHook();
|
|
|
|
// node_modules/react-redux/es/hooks/useDispatch.js
|
|
function createDispatchHook(context = ReactReduxContext) {
|
|
const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);
|
|
return function useDispatch2() {
|
|
const store2 = useStore2();
|
|
return store2.dispatch;
|
|
};
|
|
}
|
|
var useDispatch = /* @__PURE__ */ createDispatchHook();
|
|
|
|
// node_modules/react-redux/es/index.js
|
|
initializeUseSelector(import_with_selector.useSyncExternalStoreWithSelector);
|
|
initializeConnect(import_shim.useSyncExternalStore);
|
|
setBatch(import_react_dom2.unstable_batchedUpdates);
|
|
|
|
// src/services/redux/hooks.ts
|
|
var useAppDispatch = useDispatch;
|
|
var useAppSelector = useSelector;
|
|
|
|
// node_modules/immer/dist/immer.esm.mjs
|
|
function n(n2) {
|
|
for (var r3 = arguments.length, t2 = Array(r3 > 1 ? r3 - 1 : 0), e = 1; e < r3; e++)
|
|
t2[e - 1] = arguments[e];
|
|
if (true) {
|
|
var i2 = Y[n2], o2 = i2 ? "function" == typeof i2 ? i2.apply(null, t2) : i2 : "unknown error nr: " + n2;
|
|
throw Error("[Immer] " + o2);
|
|
}
|
|
throw Error("[Immer] minified error nr: " + n2 + (t2.length ? " " + t2.map(function(n3) {
|
|
return "'" + n3 + "'";
|
|
}).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
|
|
}
|
|
function r2(n2) {
|
|
return !!n2 && !!n2[Q];
|
|
}
|
|
function t(n2) {
|
|
return !!n2 && (function(n3) {
|
|
if (!n3 || "object" != typeof n3)
|
|
return false;
|
|
var r3 = Object.getPrototypeOf(n3);
|
|
if (null === r3)
|
|
return true;
|
|
var t2 = Object.hasOwnProperty.call(r3, "constructor") && r3.constructor;
|
|
return t2 === Object || "function" == typeof t2 && Function.toString.call(t2) === Z;
|
|
}(n2) || Array.isArray(n2) || !!n2[L] || !!n2.constructor[L] || s(n2) || v(n2));
|
|
}
|
|
function i(n2, r3, t2) {
|
|
void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e) {
|
|
t2 && "symbol" == typeof e || r3(e, n2[e], n2);
|
|
}) : n2.forEach(function(t3, e) {
|
|
return r3(e, t3, n2);
|
|
});
|
|
}
|
|
function o(n2) {
|
|
var r3 = n2[Q];
|
|
return r3 ? r3.i > 3 ? r3.i - 4 : r3.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
|
|
}
|
|
function u(n2, r3) {
|
|
return 2 === o(n2) ? n2.has(r3) : Object.prototype.hasOwnProperty.call(n2, r3);
|
|
}
|
|
function a(n2, r3) {
|
|
return 2 === o(n2) ? n2.get(r3) : n2[r3];
|
|
}
|
|
function f(n2, r3, t2) {
|
|
var e = o(n2);
|
|
2 === e ? n2.set(r3, t2) : 3 === e ? (n2.delete(r3), n2.add(t2)) : n2[r3] = t2;
|
|
}
|
|
function c(n2, r3) {
|
|
return n2 === r3 ? 0 !== n2 || 1 / n2 == 1 / r3 : n2 != n2 && r3 != r3;
|
|
}
|
|
function s(n2) {
|
|
return X && n2 instanceof Map;
|
|
}
|
|
function v(n2) {
|
|
return q && n2 instanceof Set;
|
|
}
|
|
function p(n2) {
|
|
return n2.o || n2.t;
|
|
}
|
|
function l(n2) {
|
|
if (Array.isArray(n2))
|
|
return Array.prototype.slice.call(n2);
|
|
var r3 = rn(n2);
|
|
delete r3[Q];
|
|
for (var t2 = nn(r3), e = 0; e < t2.length; e++) {
|
|
var i2 = t2[e], o2 = r3[i2];
|
|
false === o2.writable && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r3[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
|
|
}
|
|
return Object.create(Object.getPrototypeOf(n2), r3);
|
|
}
|
|
function d(n2, e) {
|
|
return void 0 === e && (e = false), y(n2) || r2(n2) || !t(n2) ? n2 : (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e && i(n2, function(n3, r3) {
|
|
return d(r3, true);
|
|
}, true), n2);
|
|
}
|
|
function h() {
|
|
n(2);
|
|
}
|
|
function y(n2) {
|
|
return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
|
|
}
|
|
function b(r3) {
|
|
var t2 = tn[r3];
|
|
return t2 || n(18, r3), t2;
|
|
}
|
|
function m(n2, r3) {
|
|
tn[n2] || (tn[n2] = r3);
|
|
}
|
|
function _() {
|
|
return U || n(0), U;
|
|
}
|
|
function j(n2, r3) {
|
|
r3 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r3);
|
|
}
|
|
function O(n2) {
|
|
g(n2), n2.p.forEach(S), n2.p = null;
|
|
}
|
|
function g(n2) {
|
|
n2 === U && (U = n2.l);
|
|
}
|
|
function w(n2) {
|
|
return U = { p: [], l: U, h: n2, m: true, _: 0 };
|
|
}
|
|
function S(n2) {
|
|
var r3 = n2[Q];
|
|
0 === r3.i || 1 === r3.i ? r3.j() : r3.O = true;
|
|
}
|
|
function P(r3, e) {
|
|
e._ = e.p.length;
|
|
var i2 = e.p[0], o2 = void 0 !== r3 && r3 !== i2;
|
|
return e.h.g || b("ES5").S(e, r3, o2), o2 ? (i2[Q].P && (O(e), n(4)), t(r3) && (r3 = M(e, r3), e.l || x(e, r3)), e.u && b("Patches").M(i2[Q].t, r3, e.u, e.s)) : r3 = M(e, i2, []), O(e), e.u && e.v(e.u, e.s), r3 !== H ? r3 : void 0;
|
|
}
|
|
function M(n2, r3, t2) {
|
|
if (y(r3))
|
|
return r3;
|
|
var e = r3[Q];
|
|
if (!e)
|
|
return i(r3, function(i2, o3) {
|
|
return A(n2, e, r3, i2, o3, t2);
|
|
}, true), r3;
|
|
if (e.A !== n2)
|
|
return r3;
|
|
if (!e.P)
|
|
return x(n2, e.t, true), e.t;
|
|
if (!e.I) {
|
|
e.I = true, e.A._--;
|
|
var o2 = 4 === e.i || 5 === e.i ? e.o = l(e.k) : e.o;
|
|
i(3 === e.i ? new Set(o2) : o2, function(r4, i2) {
|
|
return A(n2, e, o2, r4, i2, t2);
|
|
}), x(n2, o2, false), t2 && n2.u && b("Patches").R(e, t2, n2.u, n2.s);
|
|
}
|
|
return e.o;
|
|
}
|
|
function A(e, i2, o2, a2, c2, s2) {
|
|
if (c2 === o2 && n(5), r2(c2)) {
|
|
var v2 = M(e, c2, s2 && i2 && 3 !== i2.i && !u(i2.D, a2) ? s2.concat(a2) : void 0);
|
|
if (f(o2, a2, v2), !r2(v2))
|
|
return;
|
|
e.m = false;
|
|
}
|
|
if (t(c2) && !y(c2)) {
|
|
if (!e.h.F && e._ < 1)
|
|
return;
|
|
M(e, c2), i2 && i2.A.l || x(e, c2);
|
|
}
|
|
}
|
|
function x(n2, r3, t2) {
|
|
void 0 === t2 && (t2 = false), n2.h.F && n2.m && d(r3, t2);
|
|
}
|
|
function z(n2, r3) {
|
|
var t2 = n2[Q];
|
|
return (t2 ? p(t2) : n2)[r3];
|
|
}
|
|
function I(n2, r3) {
|
|
if (r3 in n2)
|
|
for (var t2 = Object.getPrototypeOf(n2); t2; ) {
|
|
var e = Object.getOwnPropertyDescriptor(t2, r3);
|
|
if (e)
|
|
return e;
|
|
t2 = Object.getPrototypeOf(t2);
|
|
}
|
|
}
|
|
function k(n2) {
|
|
n2.P || (n2.P = true, n2.l && k(n2.l));
|
|
}
|
|
function E(n2) {
|
|
n2.o || (n2.o = l(n2.t));
|
|
}
|
|
function R(n2, r3, t2) {
|
|
var e = s(r3) ? b("MapSet").N(r3, t2) : v(r3) ? b("MapSet").T(r3, t2) : n2.g ? function(n3, r4) {
|
|
var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r4 ? r4.A : _(), P: false, I: false, D: {}, l: r4, t: n3, k: null, o: null, j: null, C: false }, i2 = e2, o2 = en;
|
|
t3 && (i2 = [e2], o2 = on);
|
|
var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy;
|
|
return e2.k = f2, e2.j = a2, f2;
|
|
}(r3, t2) : b("ES5").J(r3, t2);
|
|
return (t2 ? t2.A : _()).p.push(e), e;
|
|
}
|
|
function D(e) {
|
|
return r2(e) || n(22, e), function n2(r3) {
|
|
if (!t(r3))
|
|
return r3;
|
|
var e2, u2 = r3[Q], c2 = o(r3);
|
|
if (u2) {
|
|
if (!u2.P && (u2.i < 4 || !b("ES5").K(u2)))
|
|
return u2.t;
|
|
u2.I = true, e2 = F(r3, c2), u2.I = false;
|
|
} else
|
|
e2 = F(r3, c2);
|
|
return i(e2, function(r4, t2) {
|
|
u2 && a(u2.t, r4) === t2 || f(e2, r4, n2(t2));
|
|
}), 3 === c2 ? new Set(e2) : e2;
|
|
}(e);
|
|
}
|
|
function F(n2, r3) {
|
|
switch (r3) {
|
|
case 2:
|
|
return new Map(n2);
|
|
case 3:
|
|
return Array.from(n2);
|
|
}
|
|
return l(n2);
|
|
}
|
|
function N() {
|
|
function t2(n2, r3) {
|
|
var t3 = s2[n2];
|
|
return t3 ? t3.enumerable = r3 : s2[n2] = t3 = { configurable: true, enumerable: r3, get: function() {
|
|
var r4 = this[Q];
|
|
return f2(r4), en.get(r4, n2);
|
|
}, set: function(r4) {
|
|
var t4 = this[Q];
|
|
f2(t4), en.set(t4, n2, r4);
|
|
} }, t3;
|
|
}
|
|
function e(n2) {
|
|
for (var r3 = n2.length - 1; r3 >= 0; r3--) {
|
|
var t3 = n2[r3][Q];
|
|
if (!t3.P)
|
|
switch (t3.i) {
|
|
case 5:
|
|
a2(t3) && k(t3);
|
|
break;
|
|
case 4:
|
|
o2(t3) && k(t3);
|
|
}
|
|
}
|
|
}
|
|
function o2(n2) {
|
|
for (var r3 = n2.t, t3 = n2.k, e2 = nn(t3), i2 = e2.length - 1; i2 >= 0; i2--) {
|
|
var o3 = e2[i2];
|
|
if (o3 !== Q) {
|
|
var a3 = r3[o3];
|
|
if (void 0 === a3 && !u(r3, o3))
|
|
return true;
|
|
var f3 = t3[o3], s3 = f3 && f3[Q];
|
|
if (s3 ? s3.t !== a3 : !c(f3, a3))
|
|
return true;
|
|
}
|
|
}
|
|
var v2 = !!r3[Q];
|
|
return e2.length !== nn(r3).length + (v2 ? 0 : 1);
|
|
}
|
|
function a2(n2) {
|
|
var r3 = n2.k;
|
|
if (r3.length !== n2.t.length)
|
|
return true;
|
|
var t3 = Object.getOwnPropertyDescriptor(r3, r3.length - 1);
|
|
if (t3 && !t3.get)
|
|
return true;
|
|
for (var e2 = 0; e2 < r3.length; e2++)
|
|
if (!r3.hasOwnProperty(e2))
|
|
return true;
|
|
return false;
|
|
}
|
|
function f2(r3) {
|
|
r3.O && n(3, JSON.stringify(p(r3)));
|
|
}
|
|
var s2 = {};
|
|
m("ES5", { J: function(n2, r3) {
|
|
var e2 = Array.isArray(n2), i2 = function(n3, r4) {
|
|
if (n3) {
|
|
for (var e3 = Array(r4.length), i3 = 0; i3 < r4.length; i3++)
|
|
Object.defineProperty(e3, "" + i3, t2(i3, true));
|
|
return e3;
|
|
}
|
|
var o4 = rn(r4);
|
|
delete o4[Q];
|
|
for (var u2 = nn(o4), a3 = 0; a3 < u2.length; a3++) {
|
|
var f3 = u2[a3];
|
|
o4[f3] = t2(f3, n3 || !!o4[f3].enumerable);
|
|
}
|
|
return Object.create(Object.getPrototypeOf(r4), o4);
|
|
}(e2, n2), o3 = { i: e2 ? 5 : 4, A: r3 ? r3.A : _(), P: false, I: false, D: {}, l: r3, t: n2, k: i2, o: null, O: false, C: false };
|
|
return Object.defineProperty(i2, Q, { value: o3, writable: true }), i2;
|
|
}, S: function(n2, t3, o3) {
|
|
o3 ? r2(t3) && t3[Q].A === n2 && e(n2.p) : (n2.u && function n3(r3) {
|
|
if (r3 && "object" == typeof r3) {
|
|
var t4 = r3[Q];
|
|
if (t4) {
|
|
var e2 = t4.t, o4 = t4.k, f3 = t4.D, c2 = t4.i;
|
|
if (4 === c2)
|
|
i(o4, function(r4) {
|
|
r4 !== Q && (void 0 !== e2[r4] || u(e2, r4) ? f3[r4] || n3(o4[r4]) : (f3[r4] = true, k(t4)));
|
|
}), i(e2, function(n4) {
|
|
void 0 !== o4[n4] || u(o4, n4) || (f3[n4] = false, k(t4));
|
|
});
|
|
else if (5 === c2) {
|
|
if (a2(t4) && (k(t4), f3.length = true), o4.length < e2.length)
|
|
for (var s3 = o4.length; s3 < e2.length; s3++)
|
|
f3[s3] = false;
|
|
else
|
|
for (var v2 = e2.length; v2 < o4.length; v2++)
|
|
f3[v2] = true;
|
|
for (var p2 = Math.min(o4.length, e2.length), l2 = 0; l2 < p2; l2++)
|
|
o4.hasOwnProperty(l2) || (f3[l2] = true), void 0 === f3[l2] && n3(o4[l2]);
|
|
}
|
|
}
|
|
}
|
|
}(n2.p[0]), e(n2.p));
|
|
}, K: function(n2) {
|
|
return 4 === n2.i ? o2(n2) : a2(n2);
|
|
} });
|
|
}
|
|
var G;
|
|
var U;
|
|
var W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x");
|
|
var X = "undefined" != typeof Map;
|
|
var q = "undefined" != typeof Set;
|
|
var B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect;
|
|
var H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G);
|
|
var L = W ? Symbol.for("immer-draftable") : "__$immer_draftable";
|
|
var Q = W ? Symbol.for("immer-state") : "__$immer_state";
|
|
var Y = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(n2) {
|
|
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n2;
|
|
}, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(n2) {
|
|
return "Cannot apply patch, path doesn't resolve: " + n2;
|
|
}, 16: 'Sets cannot have "replace" patches.', 17: function(n2) {
|
|
return "Unsupported patch operation: " + n2;
|
|
}, 18: function(n2) {
|
|
return "The plugin for '" + n2 + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n2 + "()` when initializing your application.";
|
|
}, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(n2) {
|
|
return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + n2 + "'";
|
|
}, 22: function(n2) {
|
|
return "'current' expects a draft, got: " + n2;
|
|
}, 23: function(n2) {
|
|
return "'original' expects a draft, got: " + n2;
|
|
}, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" };
|
|
var Z = "" + Object.prototype.constructor;
|
|
var nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n2) {
|
|
return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
|
|
} : Object.getOwnPropertyNames;
|
|
var rn = Object.getOwnPropertyDescriptors || function(n2) {
|
|
var r3 = {};
|
|
return nn(n2).forEach(function(t2) {
|
|
r3[t2] = Object.getOwnPropertyDescriptor(n2, t2);
|
|
}), r3;
|
|
};
|
|
var tn = {};
|
|
var en = { get: function(n2, r3) {
|
|
if (r3 === Q)
|
|
return n2;
|
|
var e = p(n2);
|
|
if (!u(e, r3))
|
|
return function(n3, r4, t2) {
|
|
var e2, i3 = I(r4, t2);
|
|
return i3 ? "value" in i3 ? i3.value : null === (e2 = i3.get) || void 0 === e2 ? void 0 : e2.call(n3.k) : void 0;
|
|
}(n2, e, r3);
|
|
var i2 = e[r3];
|
|
return n2.I || !t(i2) ? i2 : i2 === z(n2.t, r3) ? (E(n2), n2.o[r3] = R(n2.A.h, i2, n2)) : i2;
|
|
}, has: function(n2, r3) {
|
|
return r3 in p(n2);
|
|
}, ownKeys: function(n2) {
|
|
return Reflect.ownKeys(p(n2));
|
|
}, set: function(n2, r3, t2) {
|
|
var e = I(p(n2), r3);
|
|
if (null == e ? void 0 : e.set)
|
|
return e.set.call(n2.k, t2), true;
|
|
if (!n2.P) {
|
|
var i2 = z(p(n2), r3), o2 = null == i2 ? void 0 : i2[Q];
|
|
if (o2 && o2.t === t2)
|
|
return n2.o[r3] = t2, n2.D[r3] = false, true;
|
|
if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r3)))
|
|
return true;
|
|
E(n2), k(n2);
|
|
}
|
|
return n2.o[r3] === t2 && "number" != typeof t2 && (void 0 !== t2 || r3 in n2.o) || (n2.o[r3] = t2, n2.D[r3] = true, true);
|
|
}, deleteProperty: function(n2, r3) {
|
|
return void 0 !== z(n2.t, r3) || r3 in n2.t ? (n2.D[r3] = false, E(n2), k(n2)) : delete n2.D[r3], n2.o && delete n2.o[r3], true;
|
|
}, getOwnPropertyDescriptor: function(n2, r3) {
|
|
var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r3);
|
|
return e ? { writable: true, configurable: 1 !== n2.i || "length" !== r3, enumerable: e.enumerable, value: t2[r3] } : e;
|
|
}, defineProperty: function() {
|
|
n(11);
|
|
}, getPrototypeOf: function(n2) {
|
|
return Object.getPrototypeOf(n2.t);
|
|
}, setPrototypeOf: function() {
|
|
n(12);
|
|
} };
|
|
var on = {};
|
|
i(en, function(n2, r3) {
|
|
on[n2] = function() {
|
|
return arguments[0] = arguments[0][0], r3.apply(this, arguments);
|
|
};
|
|
}), on.deleteProperty = function(r3, t2) {
|
|
return isNaN(parseInt(t2)) && n(13), on.set.call(this, r3, t2, void 0);
|
|
}, on.set = function(r3, t2, e) {
|
|
return "length" !== t2 && isNaN(parseInt(t2)) && n(14), en.set.call(this, r3[0], t2, e, r3[0]);
|
|
};
|
|
var un = function() {
|
|
function e(r3) {
|
|
var e2 = this;
|
|
this.g = B, this.F = true, this.produce = function(r4, i3, o2) {
|
|
if ("function" == typeof r4 && "function" != typeof i3) {
|
|
var u2 = i3;
|
|
i3 = r4;
|
|
var a2 = e2;
|
|
return function(n2) {
|
|
var r5 = this;
|
|
void 0 === n2 && (n2 = u2);
|
|
for (var t2 = arguments.length, e3 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++)
|
|
e3[o3 - 1] = arguments[o3];
|
|
return a2.produce(n2, function(n3) {
|
|
var t3;
|
|
return (t3 = i3).call.apply(t3, [r5, n3].concat(e3));
|
|
});
|
|
};
|
|
}
|
|
var f2;
|
|
if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r4)) {
|
|
var c2 = w(e2), s2 = R(e2, r4, void 0), v2 = true;
|
|
try {
|
|
f2 = i3(s2), v2 = false;
|
|
} finally {
|
|
v2 ? O(c2) : g(c2);
|
|
}
|
|
return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
|
|
return j(c2, o2), P(n2, c2);
|
|
}, function(n2) {
|
|
throw O(c2), n2;
|
|
}) : (j(c2, o2), P(f2, c2));
|
|
}
|
|
if (!r4 || "object" != typeof r4) {
|
|
if (void 0 === (f2 = i3(r4)) && (f2 = r4), f2 === H && (f2 = void 0), e2.F && d(f2, true), o2) {
|
|
var p2 = [], l2 = [];
|
|
b("Patches").M(r4, f2, p2, l2), o2(p2, l2);
|
|
}
|
|
return f2;
|
|
}
|
|
n(21, r4);
|
|
}, this.produceWithPatches = function(n2, r4) {
|
|
if ("function" == typeof n2)
|
|
return function(r5) {
|
|
for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++)
|
|
i4[o3 - 1] = arguments[o3];
|
|
return e2.produceWithPatches(r5, function(r6) {
|
|
return n2.apply(void 0, [r6].concat(i4));
|
|
});
|
|
};
|
|
var t2, i3, o2 = e2.produce(n2, r4, function(n3, r5) {
|
|
t2 = n3, i3 = r5;
|
|
});
|
|
return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
|
|
return [n3, t2, i3];
|
|
}) : [o2, t2, i3];
|
|
}, "boolean" == typeof (null == r3 ? void 0 : r3.useProxies) && this.setUseProxies(r3.useProxies), "boolean" == typeof (null == r3 ? void 0 : r3.autoFreeze) && this.setAutoFreeze(r3.autoFreeze);
|
|
}
|
|
var i2 = e.prototype;
|
|
return i2.createDraft = function(e2) {
|
|
t(e2) || n(8), r2(e2) && (e2 = D(e2));
|
|
var i3 = w(this), o2 = R(this, e2, void 0);
|
|
return o2[Q].C = true, g(i3), o2;
|
|
}, i2.finishDraft = function(r3, t2) {
|
|
var e2 = r3 && r3[Q];
|
|
e2 && e2.C || n(9), e2.I && n(10);
|
|
var i3 = e2.A;
|
|
return j(i3, t2), P(void 0, i3);
|
|
}, i2.setAutoFreeze = function(n2) {
|
|
this.F = n2;
|
|
}, i2.setUseProxies = function(r3) {
|
|
r3 && !B && n(20), this.g = r3;
|
|
}, i2.applyPatches = function(n2, t2) {
|
|
var e2;
|
|
for (e2 = t2.length - 1; e2 >= 0; e2--) {
|
|
var i3 = t2[e2];
|
|
if (0 === i3.path.length && "replace" === i3.op) {
|
|
n2 = i3.value;
|
|
break;
|
|
}
|
|
}
|
|
e2 > -1 && (t2 = t2.slice(e2 + 1));
|
|
var o2 = b("Patches").$;
|
|
return r2(n2) ? o2(n2, t2) : this.produce(n2, function(n3) {
|
|
return o2(n3, t2);
|
|
});
|
|
}, e;
|
|
}();
|
|
var an = new un();
|
|
var fn = an.produce;
|
|
var cn = an.produceWithPatches.bind(an);
|
|
var sn = an.setAutoFreeze.bind(an);
|
|
var vn = an.setUseProxies.bind(an);
|
|
var pn = an.applyPatches.bind(an);
|
|
var ln = an.createDraft.bind(an);
|
|
var dn = an.finishDraft.bind(an);
|
|
var immer_esm_default = fn;
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
function _defineProperty(obj, key, value) {
|
|
if (key in obj) {
|
|
Object.defineProperty(obj, key, {
|
|
value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
obj[key] = value;
|
|
}
|
|
return obj;
|
|
}
|
|
|
|
// node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
function ownKeys(object, enumerableOnly) {
|
|
var keys = Object.keys(object);
|
|
if (Object.getOwnPropertySymbols) {
|
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
})), keys.push.apply(keys, symbols);
|
|
}
|
|
return keys;
|
|
}
|
|
function _objectSpread2(target) {
|
|
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
var source = null != arguments[i2] ? arguments[i2] : {};
|
|
i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
_defineProperty(target, key, source[key]);
|
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
});
|
|
}
|
|
return target;
|
|
}
|
|
|
|
// node_modules/redux/es/redux.js
|
|
var $$observable = function() {
|
|
return typeof Symbol === "function" && Symbol.observable || "@@observable";
|
|
}();
|
|
var randomString = function randomString2() {
|
|
return Math.random().toString(36).substring(7).split("").join(".");
|
|
};
|
|
var ActionTypes = {
|
|
INIT: "@@redux/INIT" + randomString(),
|
|
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
}
|
|
};
|
|
function isPlainObject3(obj) {
|
|
if (typeof obj !== "object" || obj === null)
|
|
return false;
|
|
var proto = obj;
|
|
while (Object.getPrototypeOf(proto) !== null) {
|
|
proto = Object.getPrototypeOf(proto);
|
|
}
|
|
return Object.getPrototypeOf(obj) === proto;
|
|
}
|
|
function miniKindOf(val) {
|
|
if (val === void 0)
|
|
return "undefined";
|
|
if (val === null)
|
|
return "null";
|
|
var type = typeof val;
|
|
switch (type) {
|
|
case "boolean":
|
|
case "string":
|
|
case "number":
|
|
case "symbol":
|
|
case "function": {
|
|
return type;
|
|
}
|
|
}
|
|
if (Array.isArray(val))
|
|
return "array";
|
|
if (isDate2(val))
|
|
return "date";
|
|
if (isError(val))
|
|
return "error";
|
|
var constructorName = ctorName(val);
|
|
switch (constructorName) {
|
|
case "Symbol":
|
|
case "Promise":
|
|
case "WeakMap":
|
|
case "WeakSet":
|
|
case "Map":
|
|
case "Set":
|
|
return constructorName;
|
|
}
|
|
return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
}
|
|
function ctorName(val) {
|
|
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
}
|
|
function isError(val) {
|
|
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
}
|
|
function isDate2(val) {
|
|
if (val instanceof Date)
|
|
return true;
|
|
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
}
|
|
function kindOf(val) {
|
|
var typeOfVal = typeof val;
|
|
if (true) {
|
|
typeOfVal = miniKindOf(val);
|
|
}
|
|
return typeOfVal;
|
|
}
|
|
function createStore(reducer, preloadedState, enhancer) {
|
|
var _ref2;
|
|
if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
|
|
throw new Error(false ? formatProdErrorMessage(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
|
|
}
|
|
if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
|
|
enhancer = preloadedState;
|
|
preloadedState = void 0;
|
|
}
|
|
if (typeof enhancer !== "undefined") {
|
|
if (typeof enhancer !== "function") {
|
|
throw new Error(false ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
|
|
}
|
|
return enhancer(createStore)(reducer, preloadedState);
|
|
}
|
|
if (typeof reducer !== "function") {
|
|
throw new Error(false ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
|
|
}
|
|
var currentReducer = reducer;
|
|
var currentState = preloadedState;
|
|
var currentListeners = [];
|
|
var nextListeners = currentListeners;
|
|
var isDispatching = false;
|
|
function ensureCanMutateNextListeners() {
|
|
if (nextListeners === currentListeners) {
|
|
nextListeners = currentListeners.slice();
|
|
}
|
|
}
|
|
function getState() {
|
|
if (isDispatching) {
|
|
throw new Error(false ? formatProdErrorMessage(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
|
|
}
|
|
return currentState;
|
|
}
|
|
function subscribe(listener2) {
|
|
if (typeof listener2 !== "function") {
|
|
throw new Error(false ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener2) + "'");
|
|
}
|
|
if (isDispatching) {
|
|
throw new Error(false ? formatProdErrorMessage(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
}
|
|
var isSubscribed = true;
|
|
ensureCanMutateNextListeners();
|
|
nextListeners.push(listener2);
|
|
return function unsubscribe() {
|
|
if (!isSubscribed) {
|
|
return;
|
|
}
|
|
if (isDispatching) {
|
|
throw new Error(false ? formatProdErrorMessage(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
|
|
}
|
|
isSubscribed = false;
|
|
ensureCanMutateNextListeners();
|
|
var index = nextListeners.indexOf(listener2);
|
|
nextListeners.splice(index, 1);
|
|
currentListeners = null;
|
|
};
|
|
}
|
|
function dispatch(action) {
|
|
if (!isPlainObject3(action)) {
|
|
throw new Error(false ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
}
|
|
if (typeof action.type === "undefined") {
|
|
throw new Error(false ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
}
|
|
if (isDispatching) {
|
|
throw new Error(false ? formatProdErrorMessage(9) : "Reducers may not dispatch actions.");
|
|
}
|
|
try {
|
|
isDispatching = true;
|
|
currentState = currentReducer(currentState, action);
|
|
} finally {
|
|
isDispatching = false;
|
|
}
|
|
var listeners = currentListeners = nextListeners;
|
|
for (var i2 = 0; i2 < listeners.length; i2++) {
|
|
var listener2 = listeners[i2];
|
|
listener2();
|
|
}
|
|
return action;
|
|
}
|
|
function replaceReducer(nextReducer) {
|
|
if (typeof nextReducer !== "function") {
|
|
throw new Error(false ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
|
|
}
|
|
currentReducer = nextReducer;
|
|
dispatch({
|
|
type: ActionTypes.REPLACE
|
|
});
|
|
}
|
|
function observable() {
|
|
var _ref;
|
|
var outerSubscribe = subscribe;
|
|
return _ref = {
|
|
subscribe: function subscribe2(observer) {
|
|
if (typeof observer !== "object" || observer === null) {
|
|
throw new Error(false ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
|
|
}
|
|
function observeState() {
|
|
if (observer.next) {
|
|
observer.next(getState());
|
|
}
|
|
}
|
|
observeState();
|
|
var unsubscribe = outerSubscribe(observeState);
|
|
return {
|
|
unsubscribe
|
|
};
|
|
}
|
|
}, _ref[$$observable] = function() {
|
|
return this;
|
|
}, _ref;
|
|
}
|
|
dispatch({
|
|
type: ActionTypes.INIT
|
|
});
|
|
return _ref2 = {
|
|
dispatch,
|
|
subscribe,
|
|
getState,
|
|
replaceReducer
|
|
}, _ref2[$$observable] = observable, _ref2;
|
|
}
|
|
function warning2(message) {
|
|
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
console.error(message);
|
|
}
|
|
try {
|
|
throw new Error(message);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
var reducerKeys = Object.keys(reducers);
|
|
var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
|
|
if (reducerKeys.length === 0) {
|
|
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
|
|
}
|
|
if (!isPlainObject3(inputState)) {
|
|
return "The " + argumentName + ' has unexpected type of "' + kindOf(inputState) + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
|
|
}
|
|
var unexpectedKeys = Object.keys(inputState).filter(function(key) {
|
|
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
|
});
|
|
unexpectedKeys.forEach(function(key) {
|
|
unexpectedKeyCache[key] = true;
|
|
});
|
|
if (action && action.type === ActionTypes.REPLACE)
|
|
return;
|
|
if (unexpectedKeys.length > 0) {
|
|
return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
|
|
}
|
|
}
|
|
function assertReducerShape(reducers) {
|
|
Object.keys(reducers).forEach(function(key) {
|
|
var reducer = reducers[key];
|
|
var initialState3 = reducer(void 0, {
|
|
type: ActionTypes.INIT
|
|
});
|
|
if (typeof initialState3 === "undefined") {
|
|
throw new Error(false ? formatProdErrorMessage(12) : 'The slice reducer for key "' + key + `" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
}
|
|
if (typeof reducer(void 0, {
|
|
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
|
}) === "undefined") {
|
|
throw new Error(false ? formatProdErrorMessage(13) : 'The slice reducer for key "' + key + '" returned undefined when probed with a random type. ' + ("Don't try to handle '" + ActionTypes.INIT + `' or other actions in "redux/*" `) + "namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.");
|
|
}
|
|
});
|
|
}
|
|
function combineReducers(reducers) {
|
|
var reducerKeys = Object.keys(reducers);
|
|
var finalReducers = {};
|
|
for (var i2 = 0; i2 < reducerKeys.length; i2++) {
|
|
var key = reducerKeys[i2];
|
|
if (true) {
|
|
if (typeof reducers[key] === "undefined") {
|
|
warning2('No reducer provided for key "' + key + '"');
|
|
}
|
|
}
|
|
if (typeof reducers[key] === "function") {
|
|
finalReducers[key] = reducers[key];
|
|
}
|
|
}
|
|
var finalReducerKeys = Object.keys(finalReducers);
|
|
var unexpectedKeyCache;
|
|
if (true) {
|
|
unexpectedKeyCache = {};
|
|
}
|
|
var shapeAssertionError;
|
|
try {
|
|
assertReducerShape(finalReducers);
|
|
} catch (e) {
|
|
shapeAssertionError = e;
|
|
}
|
|
return function combination(state, action) {
|
|
if (state === void 0) {
|
|
state = {};
|
|
}
|
|
if (shapeAssertionError) {
|
|
throw shapeAssertionError;
|
|
}
|
|
if (true) {
|
|
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
if (warningMessage) {
|
|
warning2(warningMessage);
|
|
}
|
|
}
|
|
var hasChanged = false;
|
|
var nextState = {};
|
|
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
|
var _key = finalReducerKeys[_i];
|
|
var reducer = finalReducers[_key];
|
|
var previousStateForKey = state[_key];
|
|
var nextStateForKey = reducer(previousStateForKey, action);
|
|
if (typeof nextStateForKey === "undefined") {
|
|
var actionType = action && action.type;
|
|
throw new Error(false ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? '"' + String(actionType) + '"' : "(unknown type)") + ', the slice reducer for key "' + _key + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.');
|
|
}
|
|
nextState[_key] = nextStateForKey;
|
|
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
}
|
|
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
return hasChanged ? nextState : state;
|
|
};
|
|
}
|
|
function compose2() {
|
|
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
funcs[_key] = arguments[_key];
|
|
}
|
|
if (funcs.length === 0) {
|
|
return function(arg) {
|
|
return arg;
|
|
};
|
|
}
|
|
if (funcs.length === 1) {
|
|
return funcs[0];
|
|
}
|
|
return funcs.reduce(function(a2, b2) {
|
|
return function() {
|
|
return a2(b2.apply(void 0, arguments));
|
|
};
|
|
});
|
|
}
|
|
function applyMiddleware() {
|
|
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
middlewares[_key] = arguments[_key];
|
|
}
|
|
return function(createStore2) {
|
|
return function() {
|
|
var store2 = createStore2.apply(void 0, arguments);
|
|
var _dispatch = function dispatch() {
|
|
throw new Error(false ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
|
|
};
|
|
var middlewareAPI = {
|
|
getState: store2.getState,
|
|
dispatch: function dispatch() {
|
|
return _dispatch.apply(void 0, arguments);
|
|
}
|
|
};
|
|
var chain = middlewares.map(function(middleware) {
|
|
return middleware(middlewareAPI);
|
|
});
|
|
_dispatch = compose2.apply(void 0, chain)(store2.dispatch);
|
|
return _objectSpread2(_objectSpread2({}, store2), {}, {
|
|
dispatch: _dispatch
|
|
});
|
|
};
|
|
};
|
|
}
|
|
function isCrushed() {
|
|
}
|
|
if (typeof isCrushed.name === "string" && isCrushed.name !== "isCrushed") {
|
|
warning2('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');
|
|
}
|
|
|
|
// node_modules/redux-thunk/es/index.js
|
|
function createThunkMiddleware(extraArgument) {
|
|
var middleware = function middleware2(_ref) {
|
|
var dispatch = _ref.dispatch, getState = _ref.getState;
|
|
return function(next) {
|
|
return function(action) {
|
|
if (typeof action === "function") {
|
|
return action(dispatch, getState, extraArgument);
|
|
}
|
|
return next(action);
|
|
};
|
|
};
|
|
};
|
|
return middleware;
|
|
}
|
|
var thunk = createThunkMiddleware();
|
|
thunk.withExtraArgument = createThunkMiddleware;
|
|
var es_default = thunk;
|
|
|
|
// node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
|
|
var __extends = function() {
|
|
var extendStatics = function(d2, b2) {
|
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
|
|
d3.__proto__ = b3;
|
|
} || function(d3, b3) {
|
|
for (var p2 in b3)
|
|
if (Object.prototype.hasOwnProperty.call(b3, p2))
|
|
d3[p2] = b3[p2];
|
|
};
|
|
return extendStatics(d2, b2);
|
|
};
|
|
return function(d2, b2) {
|
|
if (typeof b2 !== "function" && b2 !== null)
|
|
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
extendStatics(d2, b2);
|
|
function __() {
|
|
this.constructor = d2;
|
|
}
|
|
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
|
|
};
|
|
}();
|
|
var __spreadArray = function(to, from) {
|
|
for (var i2 = 0, il = from.length, j2 = to.length; i2 < il; i2++, j2++)
|
|
to[j2] = from[i2];
|
|
return to;
|
|
};
|
|
var __defProp2 = Object.defineProperty;
|
|
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp2 = function(obj, key, value) {
|
|
return key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
};
|
|
var __spreadValues2 = function(a2, b2) {
|
|
for (var prop in b2 || (b2 = {}))
|
|
if (__hasOwnProp2.call(b2, prop))
|
|
__defNormalProp2(a2, prop, b2[prop]);
|
|
if (__getOwnPropSymbols2)
|
|
for (var _i = 0, _c = __getOwnPropSymbols2(b2); _i < _c.length; _i++) {
|
|
var prop = _c[_i];
|
|
if (__propIsEnum2.call(b2, prop))
|
|
__defNormalProp2(a2, prop, b2[prop]);
|
|
}
|
|
return a2;
|
|
};
|
|
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
|
|
if (arguments.length === 0)
|
|
return void 0;
|
|
if (typeof arguments[0] === "object")
|
|
return compose2;
|
|
return compose2.apply(null, arguments);
|
|
};
|
|
var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
|
|
return function(noop2) {
|
|
return noop2;
|
|
};
|
|
};
|
|
function isPlainObject4(value) {
|
|
if (typeof value !== "object" || value === null)
|
|
return false;
|
|
var proto = Object.getPrototypeOf(value);
|
|
if (proto === null)
|
|
return true;
|
|
var baseProto = proto;
|
|
while (Object.getPrototypeOf(baseProto) !== null) {
|
|
baseProto = Object.getPrototypeOf(baseProto);
|
|
}
|
|
return proto === baseProto;
|
|
}
|
|
function getTimeMeasureUtils(maxDelay, fnName) {
|
|
var elapsed = 0;
|
|
return {
|
|
measureTime: function(fn2) {
|
|
var started = Date.now();
|
|
try {
|
|
return fn2();
|
|
} finally {
|
|
var finished = Date.now();
|
|
elapsed += finished - started;
|
|
}
|
|
},
|
|
warnIfExceeded: function() {
|
|
if (elapsed > maxDelay) {
|
|
console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var MiddlewareArray = function(_super) {
|
|
__extends(MiddlewareArray2, _super);
|
|
function MiddlewareArray2() {
|
|
var args = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
args[_i] = arguments[_i];
|
|
}
|
|
var _this = _super.apply(this, args) || this;
|
|
Object.setPrototypeOf(_this, MiddlewareArray2.prototype);
|
|
return _this;
|
|
}
|
|
Object.defineProperty(MiddlewareArray2, Symbol.species, {
|
|
get: function() {
|
|
return MiddlewareArray2;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
MiddlewareArray2.prototype.concat = function() {
|
|
var arr = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
arr[_i] = arguments[_i];
|
|
}
|
|
return _super.prototype.concat.apply(this, arr);
|
|
};
|
|
MiddlewareArray2.prototype.prepend = function() {
|
|
var arr = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
arr[_i] = arguments[_i];
|
|
}
|
|
if (arr.length === 1 && Array.isArray(arr[0])) {
|
|
return new (MiddlewareArray2.bind.apply(MiddlewareArray2, __spreadArray([void 0], arr[0].concat(this))))();
|
|
}
|
|
return new (MiddlewareArray2.bind.apply(MiddlewareArray2, __spreadArray([void 0], arr.concat(this))))();
|
|
};
|
|
return MiddlewareArray2;
|
|
}(Array);
|
|
function freezeDraftable(val) {
|
|
return t(val) ? immer_esm_default(val, function() {
|
|
}) : val;
|
|
}
|
|
var isProduction = false;
|
|
var prefix = "Invariant failed";
|
|
function invariant(condition, message) {
|
|
if (condition) {
|
|
return;
|
|
}
|
|
if (isProduction) {
|
|
throw new Error(prefix);
|
|
}
|
|
throw new Error(prefix + ": " + (message || ""));
|
|
}
|
|
function stringify(obj, serializer, indent, decycler) {
|
|
return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
|
|
}
|
|
function getSerialize(serializer, decycler) {
|
|
var stack = [], keys = [];
|
|
if (!decycler)
|
|
decycler = function(_3, value) {
|
|
if (stack[0] === value)
|
|
return "[Circular ~]";
|
|
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
|
|
};
|
|
return function(key, value) {
|
|
if (stack.length > 0) {
|
|
var thisPos = stack.indexOf(this);
|
|
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
|
|
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
|
|
if (~stack.indexOf(value))
|
|
value = decycler.call(this, key, value);
|
|
} else
|
|
stack.push(value);
|
|
return serializer == null ? value : serializer.call(this, key, value);
|
|
};
|
|
}
|
|
function isImmutableDefault(value) {
|
|
return typeof value !== "object" || value == null || Object.isFrozen(value);
|
|
}
|
|
function trackForMutations(isImmutable, ignorePaths, obj) {
|
|
var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
|
|
return {
|
|
detectMutations: function() {
|
|
return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
|
|
}
|
|
};
|
|
}
|
|
function trackProperties(isImmutable, ignorePaths, obj, path) {
|
|
if (ignorePaths === void 0) {
|
|
ignorePaths = [];
|
|
}
|
|
if (path === void 0) {
|
|
path = "";
|
|
}
|
|
var tracked = { value: obj };
|
|
if (!isImmutable(obj)) {
|
|
tracked.children = {};
|
|
for (var key in obj) {
|
|
var childPath = path ? path + "." + key : key;
|
|
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
|
|
continue;
|
|
}
|
|
tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
|
|
}
|
|
}
|
|
return tracked;
|
|
}
|
|
function detectMutations(isImmutable, ignorePaths, trackedProperty, obj, sameParentRef, path) {
|
|
if (ignorePaths === void 0) {
|
|
ignorePaths = [];
|
|
}
|
|
if (sameParentRef === void 0) {
|
|
sameParentRef = false;
|
|
}
|
|
if (path === void 0) {
|
|
path = "";
|
|
}
|
|
var prevObj = trackedProperty ? trackedProperty.value : void 0;
|
|
var sameRef = prevObj === obj;
|
|
if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
|
|
return { wasMutated: true, path };
|
|
}
|
|
if (isImmutable(prevObj) || isImmutable(obj)) {
|
|
return { wasMutated: false };
|
|
}
|
|
var keysToDetect = {};
|
|
for (var key in trackedProperty.children) {
|
|
keysToDetect[key] = true;
|
|
}
|
|
for (var key in obj) {
|
|
keysToDetect[key] = true;
|
|
}
|
|
for (var key in keysToDetect) {
|
|
var childPath = path ? path + "." + key : key;
|
|
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
|
|
continue;
|
|
}
|
|
var result = detectMutations(isImmutable, ignorePaths, trackedProperty.children[key], obj[key], sameRef, childPath);
|
|
if (result.wasMutated) {
|
|
return result;
|
|
}
|
|
}
|
|
return { wasMutated: false };
|
|
}
|
|
function createImmutableStateInvariantMiddleware(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
if (false) {
|
|
return function() {
|
|
return function(next) {
|
|
return function(action) {
|
|
return next(action);
|
|
};
|
|
};
|
|
};
|
|
}
|
|
var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;
|
|
ignoredPaths = ignoredPaths || ignore;
|
|
var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
|
|
return function(_c2) {
|
|
var getState = _c2.getState;
|
|
var state = getState();
|
|
var tracker = track(state);
|
|
var result;
|
|
return function(next) {
|
|
return function(action) {
|
|
var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
|
|
measureUtils.measureTime(function() {
|
|
state = getState();
|
|
result = tracker.detectMutations();
|
|
tracker = track(state);
|
|
invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
});
|
|
var dispatchedAction = next(action);
|
|
measureUtils.measureTime(function() {
|
|
state = getState();
|
|
result = tracker.detectMutations();
|
|
tracker = track(state);
|
|
result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
});
|
|
measureUtils.warnIfExceeded();
|
|
return dispatchedAction;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
function isPlain(val) {
|
|
var type = typeof val;
|
|
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject4(val);
|
|
}
|
|
function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths) {
|
|
if (path === void 0) {
|
|
path = "";
|
|
}
|
|
if (isSerializable === void 0) {
|
|
isSerializable = isPlain;
|
|
}
|
|
if (ignoredPaths === void 0) {
|
|
ignoredPaths = [];
|
|
}
|
|
var foundNestedSerializable;
|
|
if (!isSerializable(value)) {
|
|
return {
|
|
keyPath: path || "<root>",
|
|
value
|
|
};
|
|
}
|
|
if (typeof value !== "object" || value === null) {
|
|
return false;
|
|
}
|
|
var entries = getEntries != null ? getEntries(value) : Object.entries(value);
|
|
var hasIgnoredPaths = ignoredPaths.length > 0;
|
|
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
|
|
var nestedPath = path ? path + "." + key : key;
|
|
if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath) >= 0) {
|
|
continue;
|
|
}
|
|
if (!isSerializable(nestedValue)) {
|
|
return {
|
|
keyPath: nestedPath,
|
|
value: nestedValue
|
|
};
|
|
}
|
|
if (typeof nestedValue === "object") {
|
|
foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths);
|
|
if (foundNestedSerializable) {
|
|
return foundNestedSerializable;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function createSerializableStateInvariantMiddleware(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
if (false) {
|
|
return function() {
|
|
return function(next) {
|
|
return function(action) {
|
|
return next(action);
|
|
};
|
|
};
|
|
};
|
|
}
|
|
var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j;
|
|
return function(storeAPI) {
|
|
return function(next) {
|
|
return function(action) {
|
|
var result = next(action);
|
|
var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
|
|
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
|
|
measureUtils.measureTime(function() {
|
|
var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
|
|
if (foundActionNonSerializableValue) {
|
|
var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
|
|
console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
|
|
}
|
|
});
|
|
}
|
|
if (!ignoreState) {
|
|
measureUtils.measureTime(function() {
|
|
var state = storeAPI.getState();
|
|
var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths);
|
|
if (foundStateNonSerializableValue) {
|
|
var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
|
|
console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
|
|
}
|
|
});
|
|
measureUtils.warnIfExceeded();
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
function isBoolean(x2) {
|
|
return typeof x2 === "boolean";
|
|
}
|
|
function curryGetDefaultMiddleware() {
|
|
return function curriedGetDefaultMiddleware(options) {
|
|
return getDefaultMiddleware(options);
|
|
};
|
|
}
|
|
function getDefaultMiddleware(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
var _c = options.thunk, thunk2 = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e;
|
|
var middlewareArray = new MiddlewareArray();
|
|
if (thunk2) {
|
|
if (isBoolean(thunk2)) {
|
|
middlewareArray.push(es_default);
|
|
} else {
|
|
middlewareArray.push(es_default.withExtraArgument(thunk2.extraArgument));
|
|
}
|
|
}
|
|
if (true) {
|
|
if (immutableCheck) {
|
|
var immutableOptions = {};
|
|
if (!isBoolean(immutableCheck)) {
|
|
immutableOptions = immutableCheck;
|
|
}
|
|
middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
|
|
}
|
|
if (serializableCheck) {
|
|
var serializableOptions = {};
|
|
if (!isBoolean(serializableCheck)) {
|
|
serializableOptions = serializableCheck;
|
|
}
|
|
middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
|
|
}
|
|
}
|
|
return middlewareArray;
|
|
}
|
|
var IS_PRODUCTION = false;
|
|
function configureStore(options) {
|
|
var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
|
|
var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
|
|
var rootReducer;
|
|
if (typeof reducer === "function") {
|
|
rootReducer = reducer;
|
|
} else if (isPlainObject4(reducer)) {
|
|
rootReducer = combineReducers(reducer);
|
|
} else {
|
|
throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
|
|
}
|
|
var finalMiddleware = middleware;
|
|
if (typeof finalMiddleware === "function") {
|
|
finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
|
|
if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
|
|
throw new Error("when using a middleware builder function, an array of middleware must be returned");
|
|
}
|
|
}
|
|
if (!IS_PRODUCTION && finalMiddleware.some(function(item) {
|
|
return typeof item !== "function";
|
|
})) {
|
|
throw new Error("each middleware provided to configureStore must be a function");
|
|
}
|
|
var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);
|
|
var finalCompose = compose2;
|
|
if (devTools) {
|
|
finalCompose = composeWithDevTools(__spreadValues2({
|
|
trace: !IS_PRODUCTION
|
|
}, typeof devTools === "object" && devTools));
|
|
}
|
|
var storeEnhancers = [middlewareEnhancer];
|
|
if (Array.isArray(enhancers)) {
|
|
storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
|
|
} else if (typeof enhancers === "function") {
|
|
storeEnhancers = enhancers(storeEnhancers);
|
|
}
|
|
var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
|
|
return createStore(rootReducer, preloadedState, composedEnhancer);
|
|
}
|
|
function createAction(type, prepareAction) {
|
|
function actionCreator() {
|
|
var args = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
args[_i] = arguments[_i];
|
|
}
|
|
if (prepareAction) {
|
|
var prepared = prepareAction.apply(void 0, args);
|
|
if (!prepared) {
|
|
throw new Error("prepareAction did not return an object");
|
|
}
|
|
return __spreadValues2(__spreadValues2({
|
|
type,
|
|
payload: prepared.payload
|
|
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
|
|
}
|
|
return { type, payload: args[0] };
|
|
}
|
|
actionCreator.toString = function() {
|
|
return "" + type;
|
|
};
|
|
actionCreator.type = type;
|
|
actionCreator.match = function(action) {
|
|
return action.type === type;
|
|
};
|
|
return actionCreator;
|
|
}
|
|
function executeReducerBuilderCallback(builderCallback) {
|
|
var actionsMap = {};
|
|
var actionMatchers = [];
|
|
var defaultCaseReducer;
|
|
var builder = {
|
|
addCase: function(typeOrActionCreator, reducer) {
|
|
if (true) {
|
|
if (actionMatchers.length > 0) {
|
|
throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
|
|
}
|
|
if (defaultCaseReducer) {
|
|
throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
|
|
}
|
|
}
|
|
var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
|
|
if (type in actionsMap) {
|
|
throw new Error("addCase cannot be called with two reducers for the same action type");
|
|
}
|
|
actionsMap[type] = reducer;
|
|
return builder;
|
|
},
|
|
addMatcher: function(matcher, reducer) {
|
|
if (true) {
|
|
if (defaultCaseReducer) {
|
|
throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
|
|
}
|
|
}
|
|
actionMatchers.push({ matcher, reducer });
|
|
return builder;
|
|
},
|
|
addDefaultCase: function(reducer) {
|
|
if (true) {
|
|
if (defaultCaseReducer) {
|
|
throw new Error("`builder.addDefaultCase` can only be called once");
|
|
}
|
|
}
|
|
defaultCaseReducer = reducer;
|
|
return builder;
|
|
}
|
|
};
|
|
builderCallback(builder);
|
|
return [actionsMap, actionMatchers, defaultCaseReducer];
|
|
}
|
|
function isStateFunction(x2) {
|
|
return typeof x2 === "function";
|
|
}
|
|
function createReducer(initialState3, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
|
|
if (actionMatchers === void 0) {
|
|
actionMatchers = [];
|
|
}
|
|
var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
|
|
var getInitialState;
|
|
if (isStateFunction(initialState3)) {
|
|
getInitialState = function() {
|
|
return freezeDraftable(initialState3());
|
|
};
|
|
} else {
|
|
var frozenInitialState_1 = freezeDraftable(initialState3);
|
|
getInitialState = function() {
|
|
return frozenInitialState_1;
|
|
};
|
|
}
|
|
function reducer(state, action) {
|
|
if (state === void 0) {
|
|
state = getInitialState();
|
|
}
|
|
var caseReducers = __spreadArray([
|
|
actionsMap[action.type]
|
|
], finalActionMatchers.filter(function(_c2) {
|
|
var matcher = _c2.matcher;
|
|
return matcher(action);
|
|
}).map(function(_c2) {
|
|
var reducer2 = _c2.reducer;
|
|
return reducer2;
|
|
}));
|
|
if (caseReducers.filter(function(cr) {
|
|
return !!cr;
|
|
}).length === 0) {
|
|
caseReducers = [finalDefaultCaseReducer];
|
|
}
|
|
return caseReducers.reduce(function(previousState, caseReducer) {
|
|
if (caseReducer) {
|
|
if (r2(previousState)) {
|
|
var draft = previousState;
|
|
var result = caseReducer(draft, action);
|
|
if (result === void 0) {
|
|
return previousState;
|
|
}
|
|
return result;
|
|
} else if (!t(previousState)) {
|
|
var result = caseReducer(previousState, action);
|
|
if (result === void 0) {
|
|
if (previousState === null) {
|
|
return previousState;
|
|
}
|
|
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
}
|
|
return result;
|
|
} else {
|
|
return immer_esm_default(previousState, function(draft2) {
|
|
return caseReducer(draft2, action);
|
|
});
|
|
}
|
|
}
|
|
return previousState;
|
|
}, state);
|
|
}
|
|
reducer.getInitialState = getInitialState;
|
|
return reducer;
|
|
}
|
|
function getType2(slice, actionKey) {
|
|
return slice + "/" + actionKey;
|
|
}
|
|
function createSlice(options) {
|
|
var name = options.name;
|
|
if (!name) {
|
|
throw new Error("`name` is a required option for createSlice");
|
|
}
|
|
if (typeof process !== "undefined" && true) {
|
|
if (options.initialState === void 0) {
|
|
console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
}
|
|
}
|
|
var initialState3 = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
|
|
var reducers = options.reducers || {};
|
|
var reducerNames = Object.keys(reducers);
|
|
var sliceCaseReducersByName = {};
|
|
var sliceCaseReducersByType = {};
|
|
var actionCreators = {};
|
|
reducerNames.forEach(function(reducerName) {
|
|
var maybeReducerWithPrepare = reducers[reducerName];
|
|
var type = getType2(name, reducerName);
|
|
var caseReducer;
|
|
var prepareCallback;
|
|
if ("reducer" in maybeReducerWithPrepare) {
|
|
caseReducer = maybeReducerWithPrepare.reducer;
|
|
prepareCallback = maybeReducerWithPrepare.prepare;
|
|
} else {
|
|
caseReducer = maybeReducerWithPrepare;
|
|
}
|
|
sliceCaseReducersByName[reducerName] = caseReducer;
|
|
sliceCaseReducersByType[type] = caseReducer;
|
|
actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
|
|
});
|
|
function buildReducer() {
|
|
var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
|
|
var finalCaseReducers = __spreadValues2(__spreadValues2({}, extraReducers), sliceCaseReducersByType);
|
|
return createReducer(initialState3, finalCaseReducers, actionMatchers, defaultCaseReducer);
|
|
}
|
|
var _reducer;
|
|
return {
|
|
name,
|
|
reducer: function(state, action) {
|
|
if (!_reducer)
|
|
_reducer = buildReducer();
|
|
return _reducer(state, action);
|
|
},
|
|
actions: actionCreators,
|
|
caseReducers: sliceCaseReducersByName,
|
|
getInitialState: function() {
|
|
if (!_reducer)
|
|
_reducer = buildReducer();
|
|
return _reducer.getInitialState();
|
|
}
|
|
};
|
|
}
|
|
var RejectWithValue = function() {
|
|
function RejectWithValue2(payload, meta) {
|
|
this.payload = payload;
|
|
this.meta = meta;
|
|
}
|
|
return RejectWithValue2;
|
|
}();
|
|
var FulfillWithMeta = function() {
|
|
function FulfillWithMeta2(payload, meta) {
|
|
this.payload = payload;
|
|
this.meta = meta;
|
|
}
|
|
return FulfillWithMeta2;
|
|
}();
|
|
var task = "task";
|
|
var listener = "listener";
|
|
var completed = "completed";
|
|
var cancelled = "cancelled";
|
|
var taskCancelled = "task-" + cancelled;
|
|
var taskCompleted = "task-" + completed;
|
|
var listenerCancelled = listener + "-" + cancelled;
|
|
var listenerCompleted = listener + "-" + completed;
|
|
var TaskAbortError = function() {
|
|
function TaskAbortError2(code) {
|
|
this.code = code;
|
|
this.name = "TaskAbortError";
|
|
this.message = task + " " + cancelled + " (reason: " + code + ")";
|
|
}
|
|
return TaskAbortError2;
|
|
}();
|
|
var alm = "listenerMiddleware";
|
|
var addListener = createAction(alm + "/add");
|
|
var clearAllListeners = createAction(alm + "/removeAll");
|
|
var removeListener = createAction(alm + "/remove");
|
|
N();
|
|
|
|
// src/services/menu/menuSlice.ts
|
|
var initialState = {
|
|
openMenus: [],
|
|
menuOpenTime: 0,
|
|
positionUpdateTime: 0
|
|
};
|
|
var menuSlice = createSlice({
|
|
name: "menu",
|
|
initialState,
|
|
reducers: {
|
|
openMenu: (state, action) => {
|
|
const canOpen = state.openMenus.find((m2) => m2.level < action.payload.level) || state.openMenus.length === 0;
|
|
if (!canOpen)
|
|
return;
|
|
state.openMenus.push(action.payload);
|
|
state.menuOpenTime = Date.now();
|
|
},
|
|
closeTopLevelMenu: (state) => {
|
|
state.openMenus.pop();
|
|
},
|
|
closeAllMenus: (state) => {
|
|
state.openMenus = [];
|
|
},
|
|
updateMenuPosition: (state) => {
|
|
state.positionUpdateTime = Date.now();
|
|
}
|
|
}
|
|
});
|
|
var {
|
|
openMenu,
|
|
closeTopLevelMenu,
|
|
closeAllMenus,
|
|
updateMenuPosition
|
|
} = menuSlice.actions;
|
|
var isMenuOpen = (state, menu) => state.menu.openMenus.find((m2) => m2.id === menu.id) ? true : false;
|
|
var getTopLevelMenu = (state) => {
|
|
if (state.menu.openMenus.length !== 0)
|
|
return state.menu.openMenus[state.menu.openMenus.length - 1];
|
|
return null;
|
|
};
|
|
var timeSinceMenuOpen = (state) => {
|
|
return Date.now() - state.menu.menuOpenTime;
|
|
};
|
|
var menuSlice_default = menuSlice.reducer;
|
|
|
|
// src/components/TagColorMenu/index.tsx
|
|
var import_jsx_runtime38 = __toESM(require_jsx_runtime());
|
|
function TagColorMenu({
|
|
menuId,
|
|
isOpen,
|
|
top: top2,
|
|
left: left2,
|
|
selectedColor,
|
|
onColorClick
|
|
}) {
|
|
const dispatch = useAppDispatch();
|
|
const { isDarkMode } = useAppSelector((state) => state.global);
|
|
function handleMenuCloseClick(e) {
|
|
e.stopPropagation();
|
|
dispatch(closeTopLevelMenu());
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Menu, {
|
|
id: menuId,
|
|
isOpen,
|
|
top: top2,
|
|
left: left2,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", {
|
|
className: "NLT__tag-color-menu",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", {
|
|
className: "NLT__tag-color-menu-header",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", {
|
|
className: "NLT__tag-color-menu-title",
|
|
children: "Colors"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, {
|
|
icon: "Close" /* CLOSE */
|
|
}),
|
|
onClick: handleMenuCloseClick
|
|
})
|
|
]
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", {
|
|
className: "NLT__tag-color-container",
|
|
children: Object.values(COLOR).map((color2) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ColorItem, {
|
|
isDarkMode,
|
|
color: color2,
|
|
onColorClick,
|
|
isSelected: selectedColor === color2
|
|
}, color2))
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/services/hooks/index.ts
|
|
var import_react10 = __toESM(require_react());
|
|
var usePositionRef = (deps = []) => {
|
|
const ref = (0, import_react10.useRef)(null);
|
|
const [position2, setPosition] = (0, import_react10.useState)({
|
|
top: 0,
|
|
left: 0,
|
|
width: 0,
|
|
height: 0
|
|
});
|
|
(0, import_react10.useEffect)(() => {
|
|
const node = ref.current;
|
|
if (node) {
|
|
const { top: top2, left: left2 } = node.getBoundingClientRect();
|
|
const { offsetWidth, offsetHeight } = node;
|
|
setPosition({
|
|
top: top2,
|
|
left: left2,
|
|
width: offsetWidth,
|
|
height: offsetHeight
|
|
});
|
|
}
|
|
}, [...deps]);
|
|
return { ref, position: position2 };
|
|
};
|
|
|
|
// src/services/menu/hooks.ts
|
|
var import_react11 = __toESM(require_react());
|
|
|
|
// src/services/random/index.ts
|
|
var randomColor = () => {
|
|
const index = Math.floor(Math.random() * Object.keys(COLOR).length);
|
|
return Object.values(COLOR)[index];
|
|
};
|
|
var randomTableId = () => {
|
|
return `table-id-${randomId(6)}`;
|
|
};
|
|
var randomRowId = () => {
|
|
return `row-id-${randomId(8)}`;
|
|
};
|
|
var randomColumnId = () => {
|
|
return `column-id-${randomId(8)}`;
|
|
};
|
|
var randomTagId = () => {
|
|
return `tag-id-${randomId(8)}`;
|
|
};
|
|
var randomCellId = () => {
|
|
return `cell-id-${randomId(8)}`;
|
|
};
|
|
var randomId = (numChars) => {
|
|
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345679";
|
|
let result = "";
|
|
for (let i2 = 0; i2 < numChars; i2++) {
|
|
result += chars[Math.floor(Math.random() * chars.length)];
|
|
}
|
|
return result;
|
|
};
|
|
var randomCell = (columnId, rowId, isHeader) => {
|
|
return {
|
|
id: randomCellId(),
|
|
columnId,
|
|
rowId,
|
|
markdown: "",
|
|
html: "",
|
|
isHeader
|
|
};
|
|
};
|
|
var emptyMarkdownTable = () => {
|
|
const table = [];
|
|
table.push("| New Column |");
|
|
table.push("| -------- |");
|
|
table.push("| |");
|
|
return table.join("\n");
|
|
};
|
|
var generateEmptyMarkdownTable = () => {
|
|
const columnId = randomColumnId();
|
|
const rowId1 = randomRowId();
|
|
const rowId2 = randomRowId();
|
|
const model = {
|
|
cells: [
|
|
randomCell(columnId, rowId1, true),
|
|
randomCell(columnId, rowId2, false)
|
|
],
|
|
columnIds: [columnId],
|
|
rowIds: [rowId1, rowId2]
|
|
};
|
|
const frontmatter = serializeFrontMatter(model);
|
|
return frontmatter + "\n\n" + emptyMarkdownTable();
|
|
};
|
|
var generateNLTCodeBlock = (tableId = "") => {
|
|
if (tableId === "")
|
|
tableId = randomTableId();
|
|
const codeblock = [];
|
|
codeblock.push("```notion-like-tables");
|
|
codeblock.push(tableId);
|
|
codeblock.push("```");
|
|
return codeblock.join("\n");
|
|
};
|
|
|
|
// src/services/menu/constants.ts
|
|
var MENU_PREFIX = "NLT__menu-id";
|
|
|
|
// src/services/menu/hooks.ts
|
|
var NUM_CHARS_MENU_ID = 8;
|
|
var randomMenuId = () => {
|
|
return `${MENU_PREFIX}-${randomId(NUM_CHARS_MENU_ID)}`;
|
|
};
|
|
var useMenu = (level, sortRowsOnClose) => {
|
|
const [id] = (0, import_react11.useState)(randomMenuId());
|
|
return {
|
|
id,
|
|
level,
|
|
sortRowsOnClose
|
|
};
|
|
};
|
|
|
|
// src/components/TagCellEdit/component/SelectableTag/index.tsx
|
|
var import_jsx_runtime39 = __toESM(require_jsx_runtime());
|
|
function SelectableTag({
|
|
isDarkMode,
|
|
id,
|
|
html,
|
|
color: color2,
|
|
onClick,
|
|
onColorChange
|
|
}) {
|
|
const menu = useMenu(1 /* TWO */);
|
|
const dispatch = useAppDispatch();
|
|
const isOpen = useAppSelector((state) => isMenuOpen(state, menu));
|
|
const positionUpdateTime = useAppSelector(
|
|
(state) => state.menu.positionUpdateTime
|
|
);
|
|
const { ref, position: position2 } = usePositionRef([positionUpdateTime]);
|
|
function handleColorChange(color3) {
|
|
onColorChange(id, color3);
|
|
dispatch(closeTopLevelMenu());
|
|
}
|
|
let tagClass = "NLT__tag";
|
|
tagClass += " " + findColorClass(isDarkMode, color2);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", {
|
|
ref,
|
|
className: "NLT__selectable-tag NLT__selectable",
|
|
onClick: () => onClick(id),
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TagColorMenu, {
|
|
menuId: menu.id,
|
|
top: position2.top - 125,
|
|
left: position2.left + position2.width - 50,
|
|
isOpen,
|
|
selectedColor: color2,
|
|
onColorClick: (color3) => handleColorChange(color3)
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", {
|
|
className: tagClass,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", {
|
|
className: "NLT__tag-content",
|
|
children: html_react_parser_default(html)
|
|
})
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, {
|
|
icon: "MoreHoriz" /* MORE_HORIZ */
|
|
}),
|
|
isDarker: true,
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
dispatch(openMenu(menu));
|
|
}
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/components/TagCellEdit/component/CreateTag/index.tsx
|
|
var import_jsx_runtime40 = __toESM(require_jsx_runtime());
|
|
function CreateTag({
|
|
isDarkMode,
|
|
markdown,
|
|
html,
|
|
color: color2,
|
|
onAddTag
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", {
|
|
className: "NLT__create-tag NLT__selectable",
|
|
onClick: () => {
|
|
onAddTag(markdown, html, color2);
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", {
|
|
children: "Create\xA0"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tag, {
|
|
isDarkMode,
|
|
html,
|
|
color: color2
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/services/io/deserialize.ts
|
|
var import_markdown_it = __toESM(require_markdown_it());
|
|
|
|
// src/services/debug/index.ts
|
|
var logFunc = (shouldDebug, fileName, functionName, args = {}) => {
|
|
if (shouldDebug) {
|
|
console.log("");
|
|
console.log(`[${fileName}]: ${functionName}`);
|
|
if (args)
|
|
console.log(args);
|
|
}
|
|
};
|
|
var logVar = (shouldDebug, fileName, functionName, description, variable) => {
|
|
if (shouldDebug) {
|
|
console.log("");
|
|
console.log(`[${fileName}]: ${functionName}`);
|
|
console.log(`${description}:`);
|
|
console.log(variable);
|
|
}
|
|
};
|
|
|
|
// src/services/io/deserialize.ts
|
|
var FILE_NAME = "deserialize";
|
|
var md = new import_markdown_it.default();
|
|
var replaceObsidianLinks = (markdown) => {
|
|
const matches = Array.from(markdown.matchAll(INTERNAL_LINK_REGEX));
|
|
matches.forEach((match) => {
|
|
const link = match[0];
|
|
let fileName = link.replace(LEFT_SQUARE_BRACKET_REGEX, "").replace(RIGHT_SQUARE_BRACKET_REGEX, "");
|
|
const alias = fileName.match(INTERNAL_LINK_ALIAS_REGEX);
|
|
if (alias)
|
|
fileName = fileName.replace(INTERNAL_LINK_ALIAS_REGEX, "");
|
|
const file = NltPlugin.getFiles().find(
|
|
(file2) => file2.basename === fileName
|
|
);
|
|
const el = document.body.createEl("a");
|
|
el.addClass("internal-link");
|
|
if (!file)
|
|
el.addClass("is-unresolved");
|
|
el.setAttr("data-href", fileName);
|
|
el.setAttr("href", fileName);
|
|
el.setAttr("target", "_blank");
|
|
el.setAttr("rel", "noopener");
|
|
if (alias) {
|
|
el.setText(alias[0].substring(1));
|
|
el.setAttr("aria-label-position", "top");
|
|
el.setAttr("aria-label", fileName);
|
|
} else {
|
|
el.setText(fileName);
|
|
}
|
|
el.remove();
|
|
markdown = markdown.replace(link, el.outerHTML);
|
|
});
|
|
return markdown;
|
|
};
|
|
var replaceExternalLinks = (markdown) => {
|
|
const matches = Array.from(markdown.matchAll(EXTERNAL_LINK_REGEX));
|
|
matches.forEach((match) => {
|
|
const link = match[0];
|
|
markdown = markdown.replace(
|
|
link,
|
|
`<a rel="noopener" class="external-link" href="${link}" target="_blank">${link}</a>`
|
|
);
|
|
});
|
|
return markdown;
|
|
};
|
|
var markdownToHtml = (markdown) => {
|
|
markdown = md.renderInline(markdown, {});
|
|
markdown = replaceObsidianLinks(markdown);
|
|
markdown = replaceExternalLinks(markdown);
|
|
return markdown;
|
|
};
|
|
var parseTableFromMarkdown = (data) => {
|
|
const tokens = md.parse(data, {});
|
|
let parsedFrontmatter;
|
|
let shouldParseFrontMatter = false;
|
|
for (let i2 = 0; i2 < tokens.length; i2++) {
|
|
const { type, content } = tokens[i2];
|
|
if (type === "hr")
|
|
shouldParseFrontMatter = true;
|
|
else if (type === "inline" && shouldParseFrontMatter) {
|
|
shouldParseFrontMatter = false;
|
|
parsedFrontmatter = content.split("\n");
|
|
break;
|
|
}
|
|
}
|
|
const parsedCells = [];
|
|
let shouldParseTable = false;
|
|
let shouldParseRow = false;
|
|
let numColumns = 0;
|
|
let numRows = 0;
|
|
for (let i2 = 0; i2 < tokens.length; i2++) {
|
|
const { type, content } = tokens[i2];
|
|
if (type === "table_open")
|
|
shouldParseTable = true;
|
|
else if (type === "table_close")
|
|
shouldParseTable = false;
|
|
else if (type === "tr_open")
|
|
shouldParseRow = true;
|
|
else if (type === "tr_close") {
|
|
shouldParseRow = false;
|
|
numRows++;
|
|
} else if (type === "inline" && shouldParseTable && shouldParseRow) {
|
|
let markdown = content;
|
|
markdown = replaceUnescapedPipes(markdown);
|
|
parsedCells.push(markdown);
|
|
if (numRows === 0)
|
|
numColumns++;
|
|
}
|
|
}
|
|
return {
|
|
parsedCells,
|
|
parsedFrontmatter,
|
|
numRows,
|
|
numColumns
|
|
};
|
|
};
|
|
var throwTableError = (tableId, message) => {
|
|
throw new Error(`${tableId}: ${message}`);
|
|
};
|
|
var validateParsedTable = (parsedTable, tableId) => {
|
|
const { parsedFrontmatter, parsedCells, numColumns, numRows } = parsedTable;
|
|
if (parsedFrontmatter.length < 2)
|
|
throwTableError(
|
|
tableId,
|
|
"missing frontmatter key 'columnIds' or 'rowIds'"
|
|
);
|
|
if (parsedCells.length === 0)
|
|
throwTableError(tableId, "file exists but no markdown was found");
|
|
const columnIds = JSON.parse(
|
|
parsedFrontmatter[0].split("columnIds: ")[1]
|
|
);
|
|
const rowIds = JSON.parse(
|
|
parsedFrontmatter[1].split("rowIds: ")[1]
|
|
);
|
|
if (columnIds.length !== numColumns)
|
|
throwTableError(tableId, "missing column ids");
|
|
if (rowIds.length !== numRows)
|
|
throwTableError(tableId, "missing rows ids");
|
|
columnIds.forEach((id) => {
|
|
if (!id.match(COLUMN_ID_REGEX))
|
|
throwTableError(tableId, `invalid column id "${id}"`);
|
|
});
|
|
rowIds.forEach((id) => {
|
|
if (!id.match(ROW_ID_REGEX))
|
|
throwTableError(tableId, `invalid row id "${id}"`);
|
|
});
|
|
return {
|
|
columnIds,
|
|
rowIds
|
|
};
|
|
};
|
|
var parseTableModelFromParsedTable = (table) => {
|
|
const { numRows, numColumns } = table;
|
|
const columnIds = Array(numColumns).fill(0).map((_i) => randomColumnId());
|
|
const rowIds = Array(numRows).fill(0).map((_i) => randomRowId());
|
|
return parseTableModel(table, columnIds, rowIds);
|
|
};
|
|
var parseTableModel = (table, columnIds, rowIds) => {
|
|
const model = {
|
|
columnIds: [],
|
|
rowIds: [],
|
|
cells: []
|
|
};
|
|
const { numRows, numColumns, parsedCells } = table;
|
|
for (let y2 = 0; y2 < numRows; y2++) {
|
|
for (let x2 = 0; x2 < numColumns; x2++) {
|
|
if (y2 === 0)
|
|
model.columnIds.push(columnIds[x2]);
|
|
if (x2 === 0)
|
|
model.rowIds.push(rowIds[y2]);
|
|
const markdown = parsedCells[x2 + y2 * numColumns];
|
|
const html = markdownToHtml(markdown);
|
|
model.cells.push({
|
|
id: randomCellId(),
|
|
columnId: columnIds[x2],
|
|
rowId: rowIds[y2],
|
|
markdown,
|
|
html,
|
|
isHeader: y2 === 0
|
|
});
|
|
}
|
|
}
|
|
return model;
|
|
};
|
|
var parseTableModelFromFileData = (data, tableId) => {
|
|
const parsedTable = parseTableFromMarkdown(data);
|
|
const { columnIds, rowIds } = validateParsedTable(parsedTable, tableId);
|
|
return parseTableModel(parsedTable, columnIds, rowIds);
|
|
};
|
|
var findTableModel = (plugin, tableId) => __async(void 0, null, function* () {
|
|
const { file, isNewFile } = yield findTableFile(plugin, tableId);
|
|
if (isNewFile)
|
|
yield plugin.app.vault.modify(file, generateEmptyMarkdownTable());
|
|
const data = yield app.vault.read(file);
|
|
return parseTableModelFromFileData(data, tableId);
|
|
});
|
|
var validateSettings = (plugin) => {
|
|
const { tableFolder } = plugin.settings;
|
|
if (tableFolder.match(SLASH_REGEX))
|
|
throw new Error(
|
|
"Table definition folder cannot include forward or back slashes. Please change it in the plugin settings."
|
|
);
|
|
};
|
|
var deserializeTable = (plugin, tableId) => __async(void 0, null, function* () {
|
|
const shouldDebug = plugin.settings.shouldDebug;
|
|
if (plugin.settings.shouldClear) {
|
|
console.log("Clearing previous NLT plugin settings");
|
|
plugin.settings = __spreadValues({}, DEFAULT_SETTINGS);
|
|
plugin.settings.shouldClear = false;
|
|
yield plugin.saveSettings();
|
|
}
|
|
validateSettings(plugin);
|
|
const model = yield findTableModel(plugin, tableId);
|
|
logVar(
|
|
shouldDebug,
|
|
FILE_NAME,
|
|
"deserializeTable",
|
|
"Loaded table model from definition file",
|
|
model
|
|
);
|
|
let tableState = {
|
|
model,
|
|
settings: {
|
|
columns: {},
|
|
rows: {}
|
|
},
|
|
pluginVersion: CURRENT_PLUGIN_VERSION
|
|
};
|
|
const savedState = plugin.settings.data[tableId];
|
|
if (savedState) {
|
|
const { pluginVersion, settings } = savedState;
|
|
logVar(
|
|
shouldDebug,
|
|
FILE_NAME,
|
|
"deserializeTable",
|
|
"Found cached table settings",
|
|
settings
|
|
);
|
|
tableState.settings = settings;
|
|
if (pluginVersion < CURRENT_PLUGIN_VERSION) {
|
|
}
|
|
}
|
|
model.columnIds.forEach((id) => {
|
|
if (!tableState.settings.columns[id])
|
|
tableState.settings.columns[id] = __spreadValues({}, DEFAULT_COLUMN_SETTINGS);
|
|
});
|
|
model.rowIds.forEach((id, i2) => {
|
|
if (!tableState.settings.rows[id]) {
|
|
tableState.settings.rows[id] = __spreadValues({}, DEFAULT_ROW_SETTINGS);
|
|
tableState.settings.rows[id].creationDate = Date.now() + i2;
|
|
}
|
|
});
|
|
Object.keys(tableState.settings.columns).forEach((key) => {
|
|
if (!model.columnIds.includes(key))
|
|
delete tableState.settings.columns[key];
|
|
});
|
|
Object.keys(tableState.settings.rows).forEach((key) => {
|
|
if (!model.rowIds.includes(key))
|
|
delete tableState.settings.rows[key];
|
|
});
|
|
plugin.settings.data[tableId] = tableState;
|
|
yield plugin.saveSettings();
|
|
return tableState;
|
|
});
|
|
|
|
// src/components/Wrap/index.tsx
|
|
var import_jsx_runtime41 = __toESM(require_jsx_runtime());
|
|
function Stack2({
|
|
spacingX = "md",
|
|
spacingY = "md",
|
|
style: style3,
|
|
children
|
|
}) {
|
|
function findSpacing(spacing2) {
|
|
let gap2 = "";
|
|
if (spacing2 === "sm") {
|
|
gap2 = "var(--nlt-spacing--sm)";
|
|
} else if (spacing2 === "md") {
|
|
gap2 = "var(--nlt-spacing--md)";
|
|
} else if (spacing2 === "lg") {
|
|
gap2 = "var(--nlt-spacing--lg)";
|
|
} else if (spacing2 === "xl") {
|
|
gap2 = "var(--nlt-spacing--xl)";
|
|
} else if (spacing2 === "2xl") {
|
|
gap2 = "var(--nlt-spacing--2xl)";
|
|
}
|
|
return gap2;
|
|
}
|
|
const rowGap2 = findSpacing(spacingX);
|
|
const columnGap2 = findSpacing(spacingY);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", {
|
|
style: __spreadProps(__spreadValues({}, style3), {
|
|
display: "flex",
|
|
flexWrap: "wrap",
|
|
rowGap: rowGap2,
|
|
columnGap: columnGap2
|
|
}),
|
|
children
|
|
});
|
|
}
|
|
|
|
// src/components/TagCellEdit/index.tsx
|
|
var import_jsx_runtime42 = __toESM(require_jsx_runtime());
|
|
var MenuHeader = ({
|
|
isDarkMode,
|
|
rowId,
|
|
columnId,
|
|
tags,
|
|
inputText,
|
|
onInputTextChange,
|
|
onRemoveTag
|
|
}) => {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", {
|
|
className: "NLT__tag-menu-header",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Stack2, {
|
|
spacingX: "sm",
|
|
style: { overflow: "hidden" },
|
|
children: [
|
|
tags.filter(
|
|
(tag) => tag.cells.find(
|
|
(c2) => c2.rowId === rowId && c2.columnId === columnId
|
|
)
|
|
).map((tag) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Tag, {
|
|
isDarkMode,
|
|
id: tag.id,
|
|
color: tag.color,
|
|
html: tag.html,
|
|
showRemove: true,
|
|
onRemoveClick: (tagId) => onRemoveTag(tagId)
|
|
}, tag.id)),
|
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", {
|
|
className: "NLT__tag-input",
|
|
autoFocus: true,
|
|
type: "text",
|
|
value: inputText,
|
|
onChange: onInputTextChange
|
|
})
|
|
]
|
|
})
|
|
});
|
|
};
|
|
var MenuBody = ({
|
|
isDarkMode,
|
|
tags,
|
|
inputText,
|
|
generatedColor,
|
|
onAddTag,
|
|
onTagClick,
|
|
onColorChange
|
|
}) => {
|
|
const found = tags.find((tag) => tag.markdown === inputText);
|
|
const filteredTags = tags.filter(
|
|
(tag) => tag.markdown.includes(inputText)
|
|
);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", {
|
|
className: "NLT__tag-menu-body",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", {
|
|
className: "NLT__tag-menu-text",
|
|
children: "Select an option or create one"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", {
|
|
style: {
|
|
overflowY: "scroll",
|
|
height: "140px"
|
|
},
|
|
children: [
|
|
!found && inputText !== "" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CreateTag, {
|
|
isDarkMode,
|
|
markdown: inputText,
|
|
html: markdownToHtml(inputText),
|
|
color: generatedColor,
|
|
onAddTag
|
|
}, "create-tag"),
|
|
filteredTags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectableTag, {
|
|
isDarkMode,
|
|
id: tag.id,
|
|
color: tag.color,
|
|
html: tag.html,
|
|
onColorChange,
|
|
onClick: onTagClick
|
|
}, tag.id))
|
|
]
|
|
})
|
|
]
|
|
});
|
|
};
|
|
function TagCellEdit({
|
|
tags,
|
|
rowId,
|
|
columnId,
|
|
onTagClick,
|
|
onAddTag,
|
|
onColorChange,
|
|
onRemoveTag
|
|
}) {
|
|
const [inputText, setInputText] = (0, import_react12.useState)("");
|
|
const [generatedColor] = (0, import_react12.useState)(randomColor());
|
|
const dispatch = useAppDispatch();
|
|
const { isDarkMode } = useAppSelector((state) => state.global);
|
|
function handleInputTextChange(e) {
|
|
if (e.target.value.match(/\s/))
|
|
return;
|
|
setInputText(e.target.value);
|
|
}
|
|
function handleAddTag(markdown, html, color2) {
|
|
onAddTag(markdown, html, color2);
|
|
setInputText("");
|
|
dispatch(closeTopLevelMenu());
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", {
|
|
className: "NLT__tag-menu",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", {
|
|
className: "NLT__tag-menu-container",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MenuHeader, {
|
|
isDarkMode,
|
|
rowId,
|
|
columnId,
|
|
inputText,
|
|
tags,
|
|
onInputTextChange: handleInputTextChange,
|
|
onRemoveTag
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MenuBody, {
|
|
isDarkMode,
|
|
inputText,
|
|
tags,
|
|
generatedColor,
|
|
onAddTag: handleAddTag,
|
|
onTagClick,
|
|
onColorChange
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/DateCellEdit/index.tsx
|
|
var import_react_datepicker = __toESM(require_react_datepicker_min());
|
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime());
|
|
function DateCellEdit({ content, onDateChange }) {
|
|
let selectedDate = new Date();
|
|
if (isValidCellContent(content, "date" /* DATE */))
|
|
selectedDate = new Date(content);
|
|
function handleChange(date) {
|
|
const updatedContent = dateToString(date);
|
|
onDateChange(updatedContent);
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_datepicker.default, {
|
|
className: "NLT__date-input",
|
|
autoFocus: true,
|
|
selected: selectedDate,
|
|
onChange: handleChange,
|
|
dateFormat: "yyyy/MM/dd",
|
|
showYearDropdown: true,
|
|
dateFormatCalendar: "MMMM",
|
|
yearDropdownItemNumber: 15,
|
|
scrollableYearDropdown: true
|
|
});
|
|
}
|
|
|
|
// src/components/MultiTagCell/index.tsx
|
|
var import_jsx_runtime44 = __toESM(require_jsx_runtime());
|
|
function MultiTagCell({ isDarkMode, tags }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", {
|
|
className: "NLT__multi-tag-cell",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Stack2, {
|
|
children: tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Tag, {
|
|
isDarkMode,
|
|
html: tag.html,
|
|
color: tag.color
|
|
}, tag.id))
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/EditableTd/index.tsx
|
|
var import_jsx_runtime45 = __toESM(require_jsx_runtime());
|
|
function EditableTd({
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
markdown,
|
|
html,
|
|
columnType,
|
|
tags,
|
|
width: width2,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
onRemoveTagClick,
|
|
onColorChange,
|
|
onTagClick,
|
|
onContentChange,
|
|
onAddTag
|
|
}) {
|
|
const menu = useMenu(0 /* ONE */, true);
|
|
const isOpen = useAppSelector((state) => isMenuOpen(state, menu));
|
|
const { positionUpdateTime } = useAppSelector((state) => state.menu);
|
|
const dispatch = useAppDispatch();
|
|
const { isDarkMode } = useAppSelector((state) => state.global);
|
|
const { position: position2, ref: positionRef } = usePositionRef([
|
|
positionUpdateTime,
|
|
markdown.length,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
width2
|
|
]);
|
|
function handleCellContextClick() {
|
|
return __async(this, null, function* () {
|
|
try {
|
|
yield navigator.clipboard.writeText(markdown);
|
|
new import_obsidian3.Notice("Copied text to clipboard");
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
});
|
|
}
|
|
function handleCellClick(e) {
|
|
if (columnType === "checkbox" /* CHECKBOX */) {
|
|
let isChecked = markdown.includes("x");
|
|
if (isChecked) {
|
|
handleCheckboxChange("[ ]");
|
|
} else {
|
|
handleCheckboxChange("[x]");
|
|
}
|
|
} else {
|
|
const el = e.target;
|
|
if (el.nodeName === "A")
|
|
return;
|
|
dispatch(openMenu(menu));
|
|
}
|
|
}
|
|
function handleAddTag(markdown2, html2, color2) {
|
|
onAddTag(
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
markdown2,
|
|
html2,
|
|
color2,
|
|
columnType === "multi-tag" /* MULTI_TAG */
|
|
);
|
|
}
|
|
function handleRemoveTagClick(tagId) {
|
|
onRemoveTagClick(cellId, columnId, rowId, tagId);
|
|
}
|
|
function handleColorChange(tagId, colorId) {
|
|
onColorChange(columnId, tagId, colorId);
|
|
}
|
|
function handleTagClick(tagId) {
|
|
onTagClick(
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
tagId,
|
|
columnType === "multi-tag" /* MULTI_TAG */
|
|
);
|
|
}
|
|
function handleTextInputChange(updatedMarkdown) {
|
|
onContentChange(cellId, updatedMarkdown);
|
|
}
|
|
function handleNumberInputChange(updatedMarkdown) {
|
|
onContentChange(cellId, updatedMarkdown);
|
|
}
|
|
function handleDateChange(updatedMarkdown) {
|
|
onContentChange(cellId, updatedMarkdown);
|
|
}
|
|
function handleCheckboxChange(updatedMarkdown) {
|
|
onContentChange(cellId, updatedMarkdown);
|
|
}
|
|
function renderCell() {
|
|
switch (columnType) {
|
|
case "text" /* TEXT */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TextCell, {
|
|
content: html,
|
|
shouldWrapOverflow,
|
|
useAutoWidth
|
|
});
|
|
case "number" /* NUMBER */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NumberCell, {
|
|
content: html,
|
|
shouldWrapOverflow,
|
|
useAutoWidth
|
|
});
|
|
case "tag" /* TAG */: {
|
|
const currentTag = tags.find(
|
|
(t2) => t2.cells.find(
|
|
(c2) => c2.rowId === rowId && c2.columnId === columnId
|
|
)
|
|
);
|
|
if (currentTag) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TagCell, {
|
|
isDarkMode,
|
|
html: currentTag.html,
|
|
color: currentTag.color
|
|
});
|
|
} else {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {});
|
|
}
|
|
}
|
|
case "multi-tag" /* MULTI_TAG */: {
|
|
const filteredTags = tags.filter(
|
|
(t2) => t2.cells.find(
|
|
(c2) => c2.rowId === rowId && c2.columnId === columnId
|
|
)
|
|
);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MultiTagCell, {
|
|
isDarkMode,
|
|
tags: filteredTags
|
|
});
|
|
}
|
|
case "date" /* DATE */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DateCell, {
|
|
content: html
|
|
});
|
|
case "checkbox" /* CHECKBOX */:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckboxCell, {
|
|
content: html,
|
|
onCheckboxChange: handleCheckboxChange
|
|
});
|
|
default:
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {});
|
|
}
|
|
}
|
|
const {
|
|
width: measuredWidth,
|
|
height: measuredHeight,
|
|
top: top2,
|
|
left: left2
|
|
} = position2;
|
|
function findHeight() {
|
|
if (useAutoWidth || !shouldWrapOverflow)
|
|
return 100;
|
|
return measuredHeight + 2;
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", {
|
|
className: "NLT__td",
|
|
ref: positionRef,
|
|
onClick: handleCellClick,
|
|
onContextMenu: handleCellContextClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", {
|
|
className: "NLT__td-container",
|
|
style: {
|
|
width: width2
|
|
},
|
|
children: [
|
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Menu, {
|
|
id: menu.id,
|
|
isOpen,
|
|
top: top2 - 2,
|
|
left: left2,
|
|
minWidth: columnType === "multi-tag" /* MULTI_TAG */ || columnType === "tag" /* TAG */ ? 250 : 150,
|
|
width: measuredWidth,
|
|
height: findHeight(),
|
|
children: [
|
|
columnType === "text" /* TEXT */ && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TextCellEdit, {
|
|
content: markdown,
|
|
onInputChange: handleTextInputChange
|
|
}),
|
|
columnType === "number" /* NUMBER */ && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NumberCellEdit, {
|
|
content: markdown,
|
|
onInputChange: handleNumberInputChange
|
|
}),
|
|
(columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TagCellEdit, {
|
|
tags,
|
|
rowId,
|
|
columnId,
|
|
onColorChange: handleColorChange,
|
|
onAddTag: handleAddTag,
|
|
onRemoveTag: handleRemoveTagClick,
|
|
onTagClick: handleTagClick
|
|
}),
|
|
columnType === "date" /* DATE */ && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DateCellEdit, {
|
|
content: markdown,
|
|
onDateChange: handleDateChange
|
|
})
|
|
]
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", {
|
|
className: "NLT__td-cell-container NLT__td-cell-padding",
|
|
children: renderCell()
|
|
})
|
|
]
|
|
})
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/Table/index.tsx
|
|
var import_react13 = __toESM(require_react());
|
|
var import_jsx_runtime46 = __toESM(require_jsx_runtime());
|
|
function Table({ headers, rows, footers }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("table", {
|
|
className: "NLT__table",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("thead", {
|
|
className: "NLT__thead",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tr", {
|
|
className: "NLT__tr",
|
|
children: headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react13.default.Fragment, {
|
|
children: header.component
|
|
}, header.id))
|
|
})
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tbody", {
|
|
className: "NLT__tbody",
|
|
children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tr", {
|
|
className: "NLT__tr",
|
|
children: row.component
|
|
}, row.id))
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tfoot", {
|
|
className: "NLT__tfoot",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tr", {
|
|
className: "NLT__tr",
|
|
children: footers.map((footer) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react13.default.Fragment, {
|
|
children: footer.component
|
|
}, footer.id))
|
|
})
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/components/RowMenu/components/RowMenuItem/index.tsx
|
|
var import_jsx_runtime47 = __toESM(require_jsx_runtime());
|
|
function RowMenuItem({ icon, content, onClick }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", {
|
|
onClick: () => onClick(),
|
|
className: "NLT__drag-menu-item NLT__selectable",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Stack, {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, {
|
|
icon
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", {
|
|
className: "NLT__p",
|
|
children: content
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/RowMenu/index.tsx
|
|
var import_jsx_runtime48 = __toESM(require_jsx_runtime());
|
|
function RowMenu({ rowId, onDeleteClick }) {
|
|
const menu = useMenu(0 /* ONE */);
|
|
const dispatch = useAppDispatch();
|
|
const isOpen = useAppSelector((state) => isMenuOpen(state, menu));
|
|
const positionUpdateTime = useAppSelector(
|
|
(state) => state.menu.positionUpdateTime
|
|
);
|
|
const { ref, position: position2 } = usePositionRef([positionUpdateTime]);
|
|
function handleButtonClick(e) {
|
|
if (isOpen) {
|
|
dispatch(closeTopLevelMenu());
|
|
} else {
|
|
dispatch(openMenu(menu));
|
|
}
|
|
}
|
|
function handleDeleteClick(rowId2) {
|
|
onDeleteClick(rowId2);
|
|
dispatch(closeTopLevelMenu());
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", {
|
|
ref,
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, {
|
|
icon: "MoreHoriz" /* MORE_HORIZ */
|
|
}),
|
|
onClick: (e) => handleButtonClick(e)
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Menu, {
|
|
id: menu.id,
|
|
isOpen,
|
|
top: position2.top + position2.height,
|
|
left: position2.left,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", {
|
|
className: "NLT__drag-menu",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RowMenuItem, {
|
|
icon: "Delete" /* DELETE */,
|
|
content: "Delete",
|
|
onClick: () => handleDeleteClick(rowId)
|
|
})
|
|
})
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/components/EditableTh/index.tsx
|
|
var import_react15 = __toESM(require_react());
|
|
|
|
// src/components/HeaderMenu/index.tsx
|
|
var import_react14 = __toESM(require_react());
|
|
|
|
// src/components/HeaderMenu/components/MenuItem/index.tsx
|
|
var import_jsx_runtime49 = __toESM(require_jsx_runtime());
|
|
function MenuItem({
|
|
icon,
|
|
content,
|
|
onClick,
|
|
selected = false
|
|
}) {
|
|
let className = "NLT__header-menu-item NLT__selectable";
|
|
if (selected)
|
|
className += " NLT__selected";
|
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", {
|
|
className,
|
|
onClick: () => onClick(),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Stack, {
|
|
children: [
|
|
icon !== null && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, {
|
|
icon
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", {
|
|
className: "NLT__p",
|
|
children: content
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/components/Submenu/index.tsx
|
|
var import_jsx_runtime50 = __toESM(require_jsx_runtime());
|
|
function Submenu({ title, children, onBackClick }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Stack, {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, {
|
|
icon: "KeyboardBackspace" /* KEYBOARD_BACKSPACE */
|
|
}),
|
|
onClick: () => onBackClick()
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", {
|
|
className: "NLT__header-menu-title",
|
|
children: title
|
|
})
|
|
]
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("hr", {
|
|
className: "NLT__hr"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", {
|
|
children
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/components/Switch/index.tsx
|
|
var import_jsx_runtime51 = __toESM(require_jsx_runtime());
|
|
function Switch({ isChecked, onToggle }) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", {
|
|
className: "NLT__switch",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("input", {
|
|
type: "checkbox",
|
|
checked: isChecked,
|
|
onChange: () => {
|
|
},
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
onToggle(!isChecked);
|
|
}
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", {
|
|
className: "NLT__slider"
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/components/EditSubmenu/index.tsx
|
|
var import_jsx_runtime52 = __toESM(require_jsx_runtime());
|
|
function EditMenu({
|
|
canDeleteColumn,
|
|
title,
|
|
cellId,
|
|
columnId,
|
|
columnType,
|
|
markdown,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
onNameChange,
|
|
onAutoWidthToggle,
|
|
onWrapOverflowToggle,
|
|
onBackClick,
|
|
onDeleteClick
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Submenu, {
|
|
title,
|
|
onBackClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, {
|
|
spacing: "sm",
|
|
isVertical: true,
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", {
|
|
className: "NLT__label",
|
|
children: "Header Name"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", {
|
|
className: "NLT__header-menu-input",
|
|
autoFocus: true,
|
|
value: markdown,
|
|
onChange: (e) => onNameChange(cellId, e.target.value)
|
|
})
|
|
]
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", {
|
|
className: "NLT__label",
|
|
children: "Auto Width"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Switch, {
|
|
isChecked: useAutoWidth,
|
|
onToggle: (value) => onAutoWidthToggle(columnId, value)
|
|
})
|
|
]
|
|
}),
|
|
!useAutoWidth && columnType === "text" /* TEXT */ && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", {
|
|
className: "NLT__label",
|
|
children: "Wrap Overflow"
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Switch, {
|
|
isChecked: shouldWrapOverflow,
|
|
onToggle: (value) => onWrapOverflowToggle(columnId, value)
|
|
})
|
|
]
|
|
}),
|
|
canDeleteColumn && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Button, {
|
|
onClick: () => onDeleteClick(columnId),
|
|
children: "Delete"
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/constants.ts
|
|
var SUBMENU_ITEM = {
|
|
EDIT: {
|
|
name: "edit",
|
|
content: "Edit",
|
|
icon: "Edit" /* EDIT */
|
|
},
|
|
SORT: {
|
|
name: "sort",
|
|
content: "Sort",
|
|
icon: "Sort" /* SORT */
|
|
},
|
|
MOVE: {
|
|
name: "move",
|
|
content: "Move",
|
|
icon: "MoveUp" /* MOVE_UP */
|
|
},
|
|
INSERT: {
|
|
name: "insert",
|
|
content: "Insert",
|
|
icon: "KeyboardDoubleArrowRight" /* KEYBOARD_DOUBLE_ARROW_RIGHT */
|
|
},
|
|
TYPE: {
|
|
name: "type",
|
|
content: "Type",
|
|
icon: "TextSnippet" /* TEXT_SNIPPET */
|
|
}
|
|
};
|
|
var TYPE_ITEMS = [
|
|
{ name: "text", content: "Text", type: "text" /* TEXT */ },
|
|
{ name: "number", content: "Number", type: "number" /* NUMBER */ },
|
|
{ name: "tag", content: "Tag", type: "tag" /* TAG */ },
|
|
{ name: "multi-tag", content: "Multi-Tag", type: "multi-tag" /* MULTI_TAG */ },
|
|
{ name: "date", content: "Date", type: "date" /* DATE */ },
|
|
{ name: "checkbox", content: "Checkbox", type: "checkbox" /* CHECKBOX */ }
|
|
];
|
|
var SORT_MENU_ITEM = {
|
|
ASC: {
|
|
name: "asc" /* ASC */,
|
|
content: "Ascending",
|
|
icon: 0 /* ARROW_UPWARD */
|
|
},
|
|
DESC: {
|
|
name: "desc" /* DESC */,
|
|
content: "Descending",
|
|
icon: 1 /* ARROW_DOWNWARD */
|
|
}
|
|
};
|
|
|
|
// src/components/HeaderMenu/components/SortSubmenu/index.tsx
|
|
var import_jsx_runtime53 = __toESM(require_jsx_runtime());
|
|
function SortSubmenu({
|
|
title,
|
|
columnSortDir,
|
|
onSortClick,
|
|
onBackClick
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Submenu, {
|
|
title,
|
|
onBackClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", {
|
|
className: "NLT__header-menu-ul",
|
|
children: Object.values(SORT_MENU_ITEM).map((item) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MenuItem, {
|
|
icon: item.icon && item.icon,
|
|
content: `${item.content}`,
|
|
onClick: () => onSortClick(item.name),
|
|
selected: columnSortDir === item.name
|
|
}, item.name))
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/components/InsertSubmenu/index.tsx
|
|
var import_jsx_runtime54 = __toESM(require_jsx_runtime());
|
|
function InsertSubmenu({
|
|
title,
|
|
onInsertClick,
|
|
onBackClick
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Submenu, {
|
|
title,
|
|
onBackClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("ul", {
|
|
className: "NLT__header-menu-ul",
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MenuItem, {
|
|
icon: "KeyboardDoubleArrowLeft" /* KEYBOARD_DOUBLE_ARROW_LEFT */,
|
|
content: "Insert Left",
|
|
onClick: () => onInsertClick(false)
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MenuItem, {
|
|
icon: "KeyboardDoubleArrowRight" /* KEYBOARD_DOUBLE_ARROW_RIGHT */,
|
|
content: "Insert Right",
|
|
onClick: () => onInsertClick(true)
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/components/MoveSubmenu/index.tsx
|
|
var import_jsx_runtime55 = __toESM(require_jsx_runtime());
|
|
function MoveSubmenu({
|
|
title,
|
|
columnIndex,
|
|
numColumns,
|
|
onMoveClick,
|
|
onBackClick
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Submenu, {
|
|
title,
|
|
onBackClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("ul", {
|
|
className: "NLT__header-menu-ul",
|
|
children: [
|
|
columnIndex !== 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MenuItem, {
|
|
icon: "KeyboardDoubleArrowLeft" /* KEYBOARD_DOUBLE_ARROW_LEFT */,
|
|
content: "Move Left",
|
|
onClick: () => onMoveClick(false)
|
|
}),
|
|
columnIndex !== numColumns - 1 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MenuItem, {
|
|
icon: "KeyboardDoubleArrowRight" /* KEYBOARD_DOUBLE_ARROW_RIGHT */,
|
|
content: "Move Right",
|
|
onClick: () => onMoveClick(true)
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/components/TypeSubmenu/index.tsx
|
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime());
|
|
function TypeSubmenu({
|
|
title,
|
|
columnType,
|
|
onTypeClick,
|
|
onBackClick
|
|
}) {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Submenu, {
|
|
title,
|
|
onBackClick,
|
|
children: TYPE_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(MenuItem, {
|
|
icon: null,
|
|
content: item.content,
|
|
onClick: () => onTypeClick(item.type),
|
|
selected: item.type === columnType
|
|
}, item.name))
|
|
});
|
|
}
|
|
|
|
// src/components/HeaderMenu/index.tsx
|
|
var import_jsx_runtime57 = __toESM(require_jsx_runtime());
|
|
var SubmenuList = ({ numColumns, onOptionClick }) => {
|
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_jsx_runtime57.Fragment, {
|
|
children: Object.values(SUBMENU_ITEM).filter((value) => {
|
|
if (numColumns === 1 && value.name === SUBMENU_ITEM.MOVE.name)
|
|
return false;
|
|
return true;
|
|
}).map((item) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(MenuItem, {
|
|
content: item.content,
|
|
icon: item.icon,
|
|
onClick: () => onOptionClick(item)
|
|
}, item.name))
|
|
});
|
|
};
|
|
function HeaderMenu({
|
|
isOpen,
|
|
cellId,
|
|
id,
|
|
top: top2,
|
|
left: left2,
|
|
markdown,
|
|
canDeleteColumn,
|
|
columnType,
|
|
columnSortDir,
|
|
columnId,
|
|
columnIndex,
|
|
numColumns,
|
|
useAutoWidth,
|
|
shouldWrapOverflow,
|
|
onTypeSelect,
|
|
onSortSelect,
|
|
onDeleteClick,
|
|
onInsertColumnClick,
|
|
onMoveColumnClick,
|
|
onClose,
|
|
onWrapOverflowToggle,
|
|
onAutoWidthToggle,
|
|
onNameChange
|
|
}) {
|
|
const [submenu, setSubmenu] = (0, import_react14.useState)(null);
|
|
function handleMoveColumnClick(columnId2, moveRight) {
|
|
onMoveColumnClick(columnId2, moveRight);
|
|
onClose();
|
|
setSubmenu(null);
|
|
}
|
|
function handleSortClick(columnId2, sortDir) {
|
|
onSortSelect(columnId2, sortDir);
|
|
onClose();
|
|
setSubmenu(null);
|
|
}
|
|
function handleInsertColumnClick(columnId2, insertRight) {
|
|
onInsertColumnClick(columnId2, insertRight);
|
|
onClose();
|
|
setSubmenu(null);
|
|
}
|
|
function handleTypeClick(columnId2, type) {
|
|
onTypeSelect(columnId2, type);
|
|
onClose();
|
|
setSubmenu(null);
|
|
}
|
|
function handleDeleteClick(columnId2) {
|
|
if (window.confirm("Are you sure you want to delete this column?")) {
|
|
onDeleteClick(columnId2);
|
|
onClose();
|
|
setSubmenu(null);
|
|
}
|
|
}
|
|
function handleBackClick() {
|
|
setSubmenu(null);
|
|
}
|
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Menu, {
|
|
isOpen,
|
|
id,
|
|
top: top2,
|
|
left: left2,
|
|
maxWidth: 175,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", {
|
|
className: "NLT__header-menu",
|
|
children: [
|
|
submenu === null && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SubmenuList, {
|
|
numColumns,
|
|
onOptionClick: setSubmenu
|
|
}),
|
|
submenu && submenu.name === SUBMENU_ITEM.EDIT.name && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(EditMenu, {
|
|
canDeleteColumn,
|
|
cellId,
|
|
title: submenu.content,
|
|
markdown,
|
|
columnType,
|
|
columnId,
|
|
useAutoWidth,
|
|
shouldWrapOverflow,
|
|
onBackClick: handleBackClick,
|
|
onAutoWidthToggle,
|
|
onWrapOverflowToggle,
|
|
onDeleteClick: handleDeleteClick,
|
|
onNameChange
|
|
}),
|
|
submenu && submenu.name === SUBMENU_ITEM.INSERT.name && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(InsertSubmenu, {
|
|
title: submenu.content,
|
|
onInsertClick: (isRightInsert) => handleInsertColumnClick(columnId, isRightInsert),
|
|
onBackClick: handleBackClick
|
|
}),
|
|
submenu && submenu.name === SUBMENU_ITEM.SORT.name && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SortSubmenu, {
|
|
title: submenu.content,
|
|
columnSortDir,
|
|
onSortClick: (sortDir) => handleSortClick(columnId, sortDir),
|
|
onBackClick: handleBackClick
|
|
}),
|
|
submenu && submenu.name === SUBMENU_ITEM.MOVE.name && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(MoveSubmenu, {
|
|
title: submenu.content,
|
|
columnIndex,
|
|
numColumns,
|
|
onMoveClick: (isRightMove) => handleMoveColumnClick(columnId, isRightMove),
|
|
onBackClick: handleBackClick
|
|
}),
|
|
submenu && submenu.name === SUBMENU_ITEM.TYPE.name && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TypeSubmenu, {
|
|
title: submenu.content,
|
|
columnType,
|
|
onTypeClick: (type) => handleTypeClick(columnId, type),
|
|
onBackClick: handleBackClick
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/services/table/constants.ts
|
|
var MIN_COLUMN_WIDTH = 40;
|
|
|
|
// src/components/EditableTh/index.tsx
|
|
var import_jsx_runtime58 = __toESM(require_jsx_runtime());
|
|
function EditableTh({
|
|
cellId,
|
|
columnIndex,
|
|
columnId,
|
|
width: width2,
|
|
markdown,
|
|
html,
|
|
useAutoWidth,
|
|
shouldWrapOverflow,
|
|
type,
|
|
sortDir,
|
|
numColumns,
|
|
onWidthChange,
|
|
onInsertColumnClick,
|
|
onMoveColumnClick,
|
|
onSortSelect,
|
|
onTypeSelect,
|
|
onDeleteClick,
|
|
onWrapOverflowToggle,
|
|
onAutoWidthToggle,
|
|
onNameChange
|
|
}) {
|
|
const mouseDownX = (0, import_react15.useRef)(0);
|
|
const isResizing = (0, import_react15.useRef)(false);
|
|
const menu = useMenu(0 /* ONE */);
|
|
const dispatch = useAppDispatch();
|
|
const isOpen = useAppSelector((state) => isMenuOpen(state, menu));
|
|
const { positionUpdateTime } = useAppSelector((state) => state.menu);
|
|
const { position: position2, ref: positionRef } = usePositionRef([
|
|
markdown,
|
|
html,
|
|
width2,
|
|
useAutoWidth,
|
|
shouldWrapOverflow,
|
|
positionUpdateTime
|
|
]);
|
|
function handleHeaderClick(e) {
|
|
if (e.target instanceof HTMLElement) {
|
|
const el = e.target;
|
|
if (!el.className.includes("NLT__th"))
|
|
return;
|
|
} else {
|
|
return;
|
|
}
|
|
if (isResizing.current)
|
|
return;
|
|
if (isOpen) {
|
|
closeHeaderMenu();
|
|
} else {
|
|
openHeaderMenu();
|
|
}
|
|
}
|
|
function openHeaderMenu() {
|
|
dispatch(openMenu(menu));
|
|
}
|
|
function closeHeaderMenu() {
|
|
dispatch(closeTopLevelMenu());
|
|
}
|
|
function handleMouseDown(e) {
|
|
mouseDownX.current = e.pageX;
|
|
isResizing.current = true;
|
|
}
|
|
function handleMouseMove(e) {
|
|
if (width2.match(CSS_MEASUREMENT_PIXEL_REGEX)) {
|
|
const oldWidth = pxToNum(width2);
|
|
const dist = e.pageX - mouseDownX.current;
|
|
const newWidth = oldWidth + dist;
|
|
if (newWidth < MIN_COLUMN_WIDTH)
|
|
return;
|
|
onWidthChange(columnId, numToPx(newWidth));
|
|
}
|
|
}
|
|
function handleMouseUp() {
|
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
setTimeout(() => {
|
|
isResizing.current = false;
|
|
}, 100);
|
|
}
|
|
const { top: top2, left: left2, height: height2 } = position2;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("th", {
|
|
className: "NLT__th NLT__selectable",
|
|
ref: positionRef,
|
|
onClick: handleHeaderClick,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", {
|
|
className: "NLT__th-container",
|
|
style: {
|
|
width: width2
|
|
},
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(HeaderMenu, {
|
|
isOpen,
|
|
top: top2,
|
|
left: left2,
|
|
canDeleteColumn: numColumns > 1,
|
|
columnId,
|
|
cellId,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
id: menu.id,
|
|
markdown,
|
|
columnSortDir: sortDir,
|
|
columnType: type,
|
|
columnIndex,
|
|
numColumns,
|
|
onSortSelect,
|
|
onMoveColumnClick,
|
|
onInsertColumnClick,
|
|
onTypeSelect,
|
|
onDeleteClick,
|
|
onClose: closeHeaderMenu,
|
|
onAutoWidthToggle,
|
|
onWrapOverflowToggle,
|
|
onNameChange
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {
|
|
className: "NLT__th-content",
|
|
children: html_react_parser_default(html)
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {
|
|
className: "NLT__th-resize-container",
|
|
children: !useAutoWidth && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {
|
|
className: "NLT__th-resize",
|
|
onMouseDown: (e) => {
|
|
closeHeaderMenu();
|
|
e.preventDefault();
|
|
handleMouseDown(e);
|
|
window.addEventListener(
|
|
"mousemove",
|
|
handleMouseMove
|
|
);
|
|
window.addEventListener(
|
|
"mouseup",
|
|
handleMouseUp
|
|
);
|
|
},
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
}
|
|
})
|
|
})
|
|
]
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/components/OptionBar/index.tsx
|
|
var import_react16 = __toESM(require_react());
|
|
var import_jsx_runtime59 = __toESM(require_jsx_runtime());
|
|
var SortBubble = ({
|
|
isDarkMode,
|
|
sortDir,
|
|
content,
|
|
onRemoveClick
|
|
}) => {
|
|
const color2 = findColorClass(isDarkMode, "blue");
|
|
let className = "NLT__sort-bubble " + color2;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", {
|
|
className,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Stack, {
|
|
spacing: "sm",
|
|
children: [
|
|
sortDir === "asc" /* ASC */ ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, {
|
|
icon: 0 /* ARROW_UPWARD */
|
|
}) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, {
|
|
icon: 1 /* ARROW_DOWNWARD */
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", {
|
|
children: content
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Button, {
|
|
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, {
|
|
icon: "Close" /* CLOSE */
|
|
}),
|
|
onClick: onRemoveClick
|
|
})
|
|
]
|
|
})
|
|
});
|
|
};
|
|
var SortBubbleList = ({ bubbles, onRemoveClick }) => {
|
|
const isDarkMode = useAppSelector((state) => state.global.isDarkMode);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Stack, {
|
|
spacing: "sm",
|
|
children: bubbles.map((bubble, i2) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SortBubble, {
|
|
isDarkMode,
|
|
sortDir: bubble.sortDir,
|
|
content: bubble.content,
|
|
onRemoveClick: () => onRemoveClick(bubble.columnId)
|
|
}, i2))
|
|
});
|
|
};
|
|
function OptionBar({
|
|
model,
|
|
settings,
|
|
onSortRemoveClick
|
|
}) {
|
|
const bubbles = (0, import_react16.useMemo)(() => {
|
|
return model.columnIds.map((id) => {
|
|
const cell = model.cells.find(
|
|
(c2) => c2.columnId === id && c2.isHeader
|
|
);
|
|
return cell;
|
|
}).filter((c2) => {
|
|
const { sortDir } = settings.columns[c2.columnId];
|
|
return sortDir !== "default" /* NONE */;
|
|
}).map((c2) => {
|
|
const { sortDir } = settings.columns[c2.columnId];
|
|
return {
|
|
columnId: c2.columnId,
|
|
content: c2.html,
|
|
sortDir
|
|
};
|
|
});
|
|
}, [model.cells, settings.columns]);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", {
|
|
className: "NLT__option-bar",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SortBubbleList, {
|
|
bubbles,
|
|
onRemoveClick: onSortRemoveClick
|
|
})
|
|
});
|
|
}
|
|
|
|
// src/services/io/serialize.ts
|
|
var FILE_NAME2 = "serialize";
|
|
var serializeMarkdownTable = (model) => {
|
|
const { columnIds, rowIds, cells } = model;
|
|
const columnCharLengths = calcColumnCharLengths(cells);
|
|
const buffer = new TableModelStringBuffer();
|
|
buffer.createRow();
|
|
for (let i2 = 0; i2 < columnIds.length; i2++) {
|
|
const columnId = columnIds[i2];
|
|
const cell = cells.find((c2) => c2.columnId === columnId && c2.isHeader);
|
|
buffer.writeCell(cell.markdown, columnCharLengths[columnId]);
|
|
}
|
|
buffer.createRow();
|
|
for (let i2 = 0; i2 < columnIds.length; i2++) {
|
|
const columnId = columnIds[i2];
|
|
let numChars = columnCharLengths[columnId] > 3 ? columnCharLengths[columnId] : 3;
|
|
const content = Array(numChars).fill("-").join("");
|
|
buffer.writeCell(content, numChars);
|
|
}
|
|
for (let i2 = 1; i2 < rowIds.length; i2++) {
|
|
buffer.createRow();
|
|
const rowId = rowIds[i2];
|
|
const rowCells = cells.filter((cell) => cell.rowId == rowId);
|
|
for (let j2 = 0; j2 < rowCells.length; j2++) {
|
|
const { columnId, markdown } = rowCells[j2];
|
|
buffer.writeCell(markdown, columnCharLengths[columnId]);
|
|
}
|
|
}
|
|
return buffer.toString();
|
|
};
|
|
var TableModelStringBuffer = class {
|
|
constructor() {
|
|
this.string = "";
|
|
}
|
|
createRow() {
|
|
if (this.string !== "")
|
|
this.string += "\n";
|
|
this.string += "|";
|
|
}
|
|
writeCell(content, columnCharLength) {
|
|
this.string += " ";
|
|
this.string += content;
|
|
const numWhiteSpace = columnCharLength - content.length;
|
|
for (let i2 = 0; i2 < numWhiteSpace; i2++)
|
|
this.string += " ";
|
|
this.string += " ";
|
|
this.string += "|";
|
|
}
|
|
toString() {
|
|
return this.string;
|
|
}
|
|
};
|
|
var calcColumnCharLengths = (cells) => {
|
|
const columnCharLengths = {};
|
|
for (let i2 = 0; i2 < cells.length; i2++) {
|
|
const { columnId, markdown } = cells[i2];
|
|
if (!columnCharLengths[columnId] || columnCharLengths[columnId] < markdown.length) {
|
|
columnCharLengths[columnId] = markdown.length;
|
|
}
|
|
}
|
|
return columnCharLengths;
|
|
};
|
|
var updateSettingsCache = (plugin, state, tableId, viewModesToUpdate) => __async(void 0, null, function* () {
|
|
const shouldDebug = plugin.settings.shouldDebug;
|
|
const settingsCopy = __spreadValues({}, plugin.settings);
|
|
settingsCopy.data = __spreadProps(__spreadValues({}, plugin.settings.data), {
|
|
[tableId]: state
|
|
});
|
|
settingsCopy.viewModeSync = {
|
|
tableId,
|
|
viewModes: viewModesToUpdate,
|
|
eventType: "update-state"
|
|
};
|
|
logVar(
|
|
shouldDebug,
|
|
FILE_NAME2,
|
|
"updateSettingsCache",
|
|
"Updating settings with new table state",
|
|
settingsCopy
|
|
);
|
|
plugin.settings = settingsCopy;
|
|
return yield plugin.saveData(plugin.settings);
|
|
});
|
|
var updateFileContent = (plugin, file, content) => __async(void 0, null, function* () {
|
|
return yield plugin.app.vault.modify(file, content);
|
|
});
|
|
var updateSortTime = (plugin, tableId) => __async(void 0, null, function* () {
|
|
const shouldDebug = plugin.settings.shouldDebug;
|
|
const settingsCopy = __spreadValues({}, plugin.settings);
|
|
settingsCopy.viewModeSync = {
|
|
tableId,
|
|
viewModes: ["source", "preview"],
|
|
eventType: "sort-rows"
|
|
};
|
|
logVar(
|
|
shouldDebug,
|
|
FILE_NAME2,
|
|
"updateSortTime",
|
|
"Updating settings file with new sync info",
|
|
settingsCopy
|
|
);
|
|
plugin.settings = settingsCopy;
|
|
return yield plugin.saveData(plugin.settings);
|
|
});
|
|
var serializeTableModel = (plugin, file, model) => __async(void 0, null, function* () {
|
|
const shouldDebug = plugin.settings.shouldDebug;
|
|
const frontmatter = serializeFrontMatter(model);
|
|
const tableMarkdown = serializeMarkdownTable(model);
|
|
const content = frontmatter + "\n\n" + tableMarkdown;
|
|
logVar(
|
|
shouldDebug,
|
|
FILE_NAME2,
|
|
"serializeTableModel",
|
|
"Updating table definition file",
|
|
content
|
|
);
|
|
yield updateFileContent(plugin, file, content);
|
|
});
|
|
var serializeTable = (shouldSaveModel, plugin, state, tableId, viewModesToUpdate) => __async(void 0, null, function* () {
|
|
const { model } = state;
|
|
if (shouldSaveModel) {
|
|
const { file } = yield findTableFile(plugin, tableId);
|
|
yield serializeTableModel(plugin, file, model);
|
|
}
|
|
yield updateSettingsCache(plugin, state, tableId, viewModesToUpdate);
|
|
});
|
|
|
|
// src/services/table/row.ts
|
|
var addRow = (prevState) => {
|
|
const rowId = randomRowId();
|
|
const cellsCopy = [...prevState.model.cells];
|
|
for (let i2 = 0; i2 < prevState.model.columnIds.length; i2++) {
|
|
cellsCopy.push({
|
|
id: randomCellId(),
|
|
columnId: prevState.model.columnIds[i2],
|
|
rowId,
|
|
markdown: "",
|
|
html: "",
|
|
isHeader: false
|
|
});
|
|
}
|
|
const settingsCopy = __spreadValues({}, prevState.settings.rows);
|
|
settingsCopy[rowId] = __spreadValues({}, DEFAULT_ROW_SETTINGS);
|
|
settingsCopy[rowId].creationDate = Date.now();
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: cellsCopy,
|
|
rowIds: [...prevState.model.rowIds, rowId]
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
rows: settingsCopy
|
|
})
|
|
});
|
|
};
|
|
|
|
// src/services/table/column.ts
|
|
var addColumn = (prevState) => {
|
|
const columnId = randomColumnId();
|
|
const updatedColumnIds = [...prevState.model.columnIds, columnId];
|
|
let updatedCells = [...prevState.model.cells];
|
|
for (let i2 = 0; i2 < prevState.model.rowIds.length; i2++) {
|
|
updatedCells.push({
|
|
id: randomCellId(),
|
|
columnId,
|
|
rowId: prevState.model.rowIds[i2],
|
|
markdown: i2 === 0 ? "New Column" : "",
|
|
html: i2 === 0 ? "New Column" : "",
|
|
isHeader: i2 === 0
|
|
});
|
|
}
|
|
updatedCells = sortCells(
|
|
prevState.model.rowIds,
|
|
updatedColumnIds,
|
|
updatedCells
|
|
);
|
|
return [
|
|
__spreadProps(__spreadValues({}, prevState.model), {
|
|
columnIds: updatedColumnIds,
|
|
cells: updatedCells
|
|
}),
|
|
__spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadValues({}, DEFAULT_COLUMN_SETTINGS)
|
|
})
|
|
})
|
|
];
|
|
};
|
|
var changeColumnType = (prevState, columnId, type) => {
|
|
const { type: previousType } = prevState.settings.columns[columnId];
|
|
if (previousType === type)
|
|
return prevState;
|
|
let tags = [...prevState.settings.columns[columnId].tags];
|
|
if (previousType === "multi-tag" /* MULTI_TAG */ && type !== "tag" /* TAG */ || previousType === "tag" /* TAG */ && type !== "multi-tag" /* MULTI_TAG */) {
|
|
tags = tags.map((t2) => {
|
|
return __spreadProps(__spreadValues({}, t2), {
|
|
cells: []
|
|
});
|
|
});
|
|
} else if (type === "tag" /* TAG */ || "multi-tag" /* MULTI_TAG */) {
|
|
const cells = prevState.model.cells.filter(
|
|
(cell) => cell.columnId === columnId && cell.markdown !== "" && !cell.isHeader
|
|
);
|
|
cells.forEach((cell) => {
|
|
cell.markdown.split(",").map((markdownTag, i2) => {
|
|
const found = tags.find((t2) => t2.markdown === markdownTag);
|
|
if (found) {
|
|
const index = tags.indexOf(found);
|
|
if (found.cells.find(
|
|
(c2) => c2.columnId === cell.columnId && c2.rowId === cell.rowId
|
|
)) {
|
|
if (i2 > 0 && type === "tag" /* TAG */) {
|
|
tags[index].cells = tags[index].cells.filter(
|
|
(c2) => c2.columnId !== cell.columnId || c2.rowId !== cell.rowId
|
|
);
|
|
}
|
|
} else {
|
|
tags[index].cells.push({
|
|
columnId: cell.columnId,
|
|
rowId: cell.rowId
|
|
});
|
|
}
|
|
return;
|
|
}
|
|
tags.push({
|
|
id: randomTagId(),
|
|
markdown: markdownTag,
|
|
html: markdownToHtml(markdownTag),
|
|
color: randomColor(),
|
|
cells: [
|
|
{
|
|
columnId: cell.columnId,
|
|
rowId: cell.rowId
|
|
}
|
|
]
|
|
});
|
|
});
|
|
});
|
|
}
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
type,
|
|
tags
|
|
})
|
|
})
|
|
})
|
|
});
|
|
};
|
|
|
|
// src/services/table/tag.ts
|
|
var addNewTag = (prevState, cellId, columnId, rowId, markdown, html, color2, canAddMultiple) => {
|
|
const tags = [...prevState.settings.columns[columnId].tags];
|
|
if (!canAddMultiple) {
|
|
const tag = tags.find(
|
|
(t2) => t2.cells.find((c2) => c2.columnId === columnId && c2.rowId === rowId)
|
|
);
|
|
if (tag) {
|
|
const arr = tag.cells.filter(
|
|
(c2) => c2.columnId !== columnId || c2.rowId !== rowId
|
|
);
|
|
tag.cells = arr;
|
|
}
|
|
}
|
|
tags.push({
|
|
id: randomTagId(),
|
|
markdown,
|
|
html,
|
|
color: color2,
|
|
cells: [
|
|
{
|
|
rowId,
|
|
columnId
|
|
}
|
|
]
|
|
});
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: prevState.model.cells.map((cell) => {
|
|
if (cell.id === cellId) {
|
|
let newMarkdown = "";
|
|
if (canAddMultiple && cell.markdown !== "") {
|
|
newMarkdown = cell.markdown + "," + markdown;
|
|
} else {
|
|
newMarkdown = markdown;
|
|
}
|
|
let newHtml = "";
|
|
if (canAddMultiple && cell.html !== "") {
|
|
newHtml = cell.html + "," + html;
|
|
} else {
|
|
newHtml = html;
|
|
}
|
|
return __spreadProps(__spreadValues({}, cell), {
|
|
markdown: newMarkdown,
|
|
html: newHtml
|
|
});
|
|
}
|
|
return cell;
|
|
})
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
tags
|
|
})
|
|
})
|
|
})
|
|
});
|
|
};
|
|
var removeTag = (prevState, cellId, columnId, rowId, tagId) => {
|
|
const tags = [...prevState.settings.columns[columnId].tags];
|
|
const tag = tags.find((t2) => t2.id === tagId);
|
|
const arr = tag.cells.filter(
|
|
(c2) => c2.columnId !== columnId || c2.rowId !== rowId
|
|
);
|
|
tag.cells = arr;
|
|
const assignedTags = tags.filter(
|
|
(tag2) => tag2.cells.find((c2) => c2.columnId === columnId && c2.rowId === rowId)
|
|
);
|
|
const newMarkdown = assignedTags.map((t2) => t2.markdown).join(",");
|
|
const newHtml = assignedTags.map((t2) => t2.html).join(",");
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: prevState.model.cells.map((cell) => {
|
|
if (cell.id === cellId) {
|
|
return __spreadProps(__spreadValues({}, cell), {
|
|
markdown: newMarkdown,
|
|
html: newHtml
|
|
});
|
|
}
|
|
return cell;
|
|
})
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
tags
|
|
})
|
|
})
|
|
})
|
|
});
|
|
};
|
|
var addExistingTag = (prevState, cellId, columnId, rowId, tagId, canAddMultiple) => {
|
|
const tags = [...prevState.settings.columns[columnId].tags];
|
|
if (!canAddMultiple) {
|
|
const tag2 = tags.find(
|
|
(t2) => t2.cells.find((c2) => c2.columnId === columnId && c2.rowId === rowId)
|
|
);
|
|
if (tag2) {
|
|
if (tag2.id === tagId)
|
|
return prevState;
|
|
const arr = tag2.cells.filter(
|
|
(c2) => c2.columnId !== columnId || c2.rowId !== rowId
|
|
);
|
|
tag2.cells = arr;
|
|
}
|
|
}
|
|
const tag = tags.find((t2) => t2.id === tagId);
|
|
const index = tags.indexOf(tag);
|
|
tags[index].cells.push({
|
|
rowId,
|
|
columnId
|
|
});
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: prevState.model.cells.map((cell) => {
|
|
if (cell.id === cellId) {
|
|
let newMarkdown = "";
|
|
if (canAddMultiple && cell.markdown !== "") {
|
|
newMarkdown = cell.markdown + "," + tag.markdown;
|
|
} else {
|
|
newMarkdown = tag.markdown;
|
|
}
|
|
let newHtml = "";
|
|
if (canAddMultiple && cell.html !== "") {
|
|
newHtml = cell.html + "," + tag.html;
|
|
} else {
|
|
newHtml = tag.html;
|
|
}
|
|
return __spreadProps(__spreadValues({}, cell), {
|
|
markdown: newMarkdown,
|
|
html: newHtml
|
|
});
|
|
}
|
|
return cell;
|
|
})
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
tags
|
|
})
|
|
})
|
|
})
|
|
});
|
|
};
|
|
|
|
// src/services/sort/sort.ts
|
|
var sortByDir = (columnId, sortDir, rowIds, cells) => {
|
|
const rowsCopy = [...rowIds];
|
|
rowsCopy.sort((a2, b2) => {
|
|
const cellA = cells.find(
|
|
(c2) => c2.columnId === columnId && c2.rowId === a2
|
|
);
|
|
const cellB = cells.find(
|
|
(c2) => c2.columnId === columnId && c2.rowId === b2
|
|
);
|
|
const markdownA = cellA.markdown;
|
|
const markdownB = cellB.markdown;
|
|
if (cellA.isHeader)
|
|
return -1;
|
|
if (cellB.isHeader)
|
|
return 1;
|
|
if (markdownA === "" && markdownB !== "")
|
|
return 1;
|
|
if (markdownA !== "" && markdownB === "")
|
|
return -1;
|
|
if (markdownA === "" && markdownB === "")
|
|
return 0;
|
|
if (sortDir === "asc" /* ASC */) {
|
|
return markdownA.localeCompare(markdownB);
|
|
} else if (sortDir === "desc" /* DESC */) {
|
|
return markdownB.localeCompare(markdownA);
|
|
}
|
|
});
|
|
return rowsCopy;
|
|
};
|
|
var sortByCreationDate = (settings, rowIds) => {
|
|
const rowsCopy = [...rowIds];
|
|
rowsCopy.sort((a2, b2) => {
|
|
const rowSettingsA = settings.rows[a2];
|
|
const rowSettingsB = settings.rows[b2];
|
|
return rowSettingsA.creationDate - rowSettingsB.creationDate;
|
|
});
|
|
return rowsCopy;
|
|
};
|
|
var sortRows = (prevState) => {
|
|
let headerSettings = null;
|
|
let columnId = "";
|
|
const { settings, model } = prevState;
|
|
for (let i2 = 0; i2 < model.columnIds.length; i2++) {
|
|
const cId = model.columnIds[i2];
|
|
if (settings.columns[cId].sortDir !== "default" /* NONE */) {
|
|
headerSettings = settings.columns[cId];
|
|
columnId = cId;
|
|
}
|
|
}
|
|
if (!headerSettings)
|
|
return __spreadProps(__spreadValues({}, model), {
|
|
rowIds: sortByCreationDate(settings, model.rowIds)
|
|
});
|
|
const rowsCopy = [...model.rowIds];
|
|
const { sortDir } = headerSettings;
|
|
return {
|
|
rowIds: sortByDir(columnId, sortDir, model.rowIds, model.cells),
|
|
columnIds: model.columnIds,
|
|
cells: sortCells(rowsCopy, model.columnIds, model.cells)
|
|
};
|
|
};
|
|
|
|
// src/App.tsx
|
|
var import_jsx_runtime60 = __toESM(require_jsx_runtime());
|
|
var FILE_NAME3 = "App";
|
|
function App2({ plugin, viewMode, tableId }) {
|
|
const [state, setTableState] = (0, import_react17.useState)({
|
|
pluginVersion: -1,
|
|
model: {
|
|
rowIds: [],
|
|
columnIds: [],
|
|
cells: []
|
|
},
|
|
settings: {
|
|
columns: {},
|
|
rows: {}
|
|
}
|
|
});
|
|
const [isLoading, setLoading] = (0, import_react17.useState)(true);
|
|
const [saveTime, setSaveTime] = (0, import_react17.useState)({
|
|
time: 0,
|
|
shouldSaveModel: false
|
|
});
|
|
const [sortTime, setSortTime] = (0, import_react17.useState)(0);
|
|
const { shouldDebug } = useAppSelector((state2) => state2.global);
|
|
const dispatch = useAppDispatch();
|
|
(0, import_react17.useEffect)(() => {
|
|
function load() {
|
|
return __async(this, null, function* () {
|
|
const tableState = yield deserializeTable(plugin, tableId);
|
|
setTableState(tableState);
|
|
setTimeout(() => {
|
|
setLoading(false);
|
|
}, 300);
|
|
});
|
|
}
|
|
load();
|
|
}, []);
|
|
(0, import_react17.useEffect)(() => {
|
|
if (saveTime.time !== 0) {
|
|
throttleSave(saveTime.shouldSaveModel);
|
|
}
|
|
}, [saveTime]);
|
|
const throttleSave = import_lodash.default.throttle((shouldSaveModel) => __async(this, null, function* () {
|
|
const viewModesToUpdate = [];
|
|
if (plugin.isLivePreviewEnabled()) {
|
|
viewModesToUpdate.push(
|
|
viewMode === "source" ? "preview" : "source"
|
|
);
|
|
}
|
|
yield serializeTable(
|
|
shouldSaveModel,
|
|
plugin,
|
|
state,
|
|
tableId,
|
|
viewModesToUpdate
|
|
);
|
|
dispatch(updateMenuPosition());
|
|
}), 150);
|
|
const handleSaveData = (shouldSaveModel) => {
|
|
setSaveTime({ shouldSaveModel, time: Date.now() });
|
|
};
|
|
(0, import_react17.useEffect)(() => {
|
|
let timer = null;
|
|
function checkForSyncEvents() {
|
|
return __async(this, null, function* () {
|
|
const {
|
|
tableId: tId,
|
|
viewModes,
|
|
eventType
|
|
} = plugin.settings.viewModeSync;
|
|
if (tId) {
|
|
const mode = viewModes.find((v2) => v2 === viewMode);
|
|
if (mode && tableId === tId) {
|
|
logFunc(shouldDebug, FILE_NAME3, "checkForSyncEvents", {
|
|
tableId,
|
|
viewModes,
|
|
eventType
|
|
});
|
|
if (eventType === "update-state") {
|
|
setTableState(plugin.settings.data[tableId]);
|
|
} else if (eventType === "sort-rows") {
|
|
handleSortRows();
|
|
}
|
|
const modeIndex = viewModes.indexOf(mode);
|
|
plugin.settings.viewModeSync.viewModes.splice(modeIndex, 1);
|
|
if (plugin.settings.viewModeSync.viewModes.length === 0)
|
|
plugin.settings.viewModeSync.tableId = null;
|
|
yield plugin.saveSettings();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function viewModeSync() {
|
|
timer = setInterval(() => {
|
|
checkForSyncEvents();
|
|
}, 50);
|
|
}
|
|
viewModeSync();
|
|
return () => {
|
|
clearInterval(timer);
|
|
};
|
|
}, []);
|
|
(0, import_react17.useEffect)(() => {
|
|
if (sortTime !== 0) {
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: sortRows(prevState)
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
}, [sortTime]);
|
|
function handleSortRows() {
|
|
setSortTime(Date.now());
|
|
}
|
|
function handleAddColumn() {
|
|
if (shouldDebug)
|
|
console.log("[App]: handleAddColumn called.");
|
|
setTableState((prevState) => {
|
|
const [model, settings] = addColumn(prevState);
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model,
|
|
settings
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleAddRow() {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleAddRow");
|
|
setTableState((prevState) => {
|
|
const newState = addRow(prevState);
|
|
return newState;
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleHeaderTypeClick(columnId, type) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleHeaderTypeClick", {
|
|
columnId,
|
|
type
|
|
});
|
|
setTableState(
|
|
(prevState) => changeColumnType(prevState, columnId, type)
|
|
);
|
|
handleSaveData(false);
|
|
}
|
|
function handleHeaderSortSelect(columnId, sortDir) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleHeaderSortSelect", {
|
|
columnId,
|
|
sortDir
|
|
});
|
|
setTableState((prevState) => {
|
|
const columnsCopy = __spreadValues({}, prevState.settings.columns);
|
|
Object.entries(columnsCopy).forEach((entry) => {
|
|
const [key, value] = entry;
|
|
if (value.sortDir !== "default" /* NONE */)
|
|
columnsCopy[key].sortDir = "default" /* NONE */;
|
|
if (key === columnId)
|
|
columnsCopy[key].sortDir = sortDir;
|
|
});
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: columnsCopy
|
|
})
|
|
});
|
|
});
|
|
handleSortRows();
|
|
}
|
|
function handleCellContentChange(cellId, updatedMarkdown) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleCellContentChange", {
|
|
cellId,
|
|
updatedMarkdown
|
|
});
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: prevState.model.cells.map((cell) => {
|
|
if (cell.id === cellId) {
|
|
return __spreadProps(__spreadValues({}, cell), {
|
|
markdown: updatedMarkdown,
|
|
html: markdownToHtml(updatedMarkdown)
|
|
});
|
|
}
|
|
return cell;
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleAddTag(cellId, columnId, rowId, markdown, html, color2, canAddMultiple) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleAddTag", {
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
markdown,
|
|
html,
|
|
color: color2,
|
|
canAddMultiple
|
|
});
|
|
setTableState(
|
|
(prevState) => addNewTag(
|
|
prevState,
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
markdown,
|
|
html,
|
|
color2,
|
|
canAddMultiple
|
|
)
|
|
);
|
|
handleSaveData(true);
|
|
}
|
|
function handleTagClick(cellId, columnId, rowId, tagId, canAddMultiple) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleTagClick", {
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
tagId,
|
|
canAddMultiple
|
|
});
|
|
setTableState(
|
|
(prevState) => addExistingTag(
|
|
prevState,
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
tagId,
|
|
canAddMultiple
|
|
)
|
|
);
|
|
handleSaveData(true);
|
|
}
|
|
function handleRemoveTagClick(cellId, columnId, rowId, tagId) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleRemoveTagClick", {
|
|
cellId,
|
|
columnId,
|
|
rowId,
|
|
tagId
|
|
});
|
|
setTableState(
|
|
(prevState) => removeTag(prevState, cellId, columnId, rowId, tagId)
|
|
);
|
|
handleSaveData(true);
|
|
}
|
|
function handleHeaderDeleteClick(columnId) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleHeaderDeleteClick", {
|
|
columnId
|
|
});
|
|
setTableState((prevState) => {
|
|
const columnsCopy = __spreadValues({}, prevState.settings.columns);
|
|
delete columnsCopy[columnId];
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
columnIds: prevState.model.columnIds.filter(
|
|
(column) => column !== columnId
|
|
),
|
|
cells: cells.filter((cell) => cell.columnId !== columnId)
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: columnsCopy
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleRowDeleteClick(rowId) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleRowDeleteClick", {
|
|
rowId
|
|
});
|
|
setTableState((prevState) => {
|
|
const rowsCopy = __spreadValues({}, prevState.settings.rows);
|
|
delete rowsCopy[rowId];
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, prevState.model), {
|
|
cells: prevState.model.cells.filter(
|
|
(cell) => cell.rowId !== rowId
|
|
),
|
|
rowIds: prevState.model.rowIds.filter((id) => id !== rowId)
|
|
}),
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
rows: rowsCopy
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleSortRemoveClick(columnId) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleSortRemoveClick", {
|
|
columnId
|
|
});
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
sortDir: "default" /* NONE */
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSortRows();
|
|
}
|
|
function handleHeaderWidthChange(columnId, width2) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleHeaderWidthChange", {
|
|
columnId,
|
|
width: width2
|
|
});
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
width: width2
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(false);
|
|
}
|
|
function handleMoveColumnClick(columnId, moveRight) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleMoveColumnClick", {
|
|
columnId,
|
|
moveRight
|
|
});
|
|
setTableState((prevState) => {
|
|
const { model } = prevState;
|
|
const updatedColumnIds = [...model.columnIds];
|
|
const index = model.columnIds.indexOf(columnId);
|
|
const moveIndex = moveRight ? index + 1 : index - 1;
|
|
const old = updatedColumnIds[moveIndex];
|
|
updatedColumnIds[moveIndex] = updatedColumnIds[index];
|
|
updatedColumnIds[index] = old;
|
|
const updatedCells = sortCells(
|
|
model.rowIds,
|
|
updatedColumnIds,
|
|
model.cells
|
|
);
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, model), {
|
|
columnIds: updatedColumnIds,
|
|
cells: updatedCells
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleInsertColumnClick(columnId, insertRight) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleInsertColumnClick", {
|
|
columnId,
|
|
insertRight
|
|
});
|
|
setTableState((prevState) => {
|
|
const { model, settings } = prevState;
|
|
const index = model.columnIds.indexOf(columnId);
|
|
const insertIndex = insertRight ? index + 1 : index;
|
|
const newColId = randomColumnId();
|
|
const updatedColumnIds = [...model.columnIds];
|
|
updatedColumnIds.splice(insertIndex, 0, newColId);
|
|
let updatedCells = [...model.cells];
|
|
for (let i2 = 0; i2 < model.rowIds.length; i2++) {
|
|
updatedCells.push({
|
|
id: randomCellId(),
|
|
columnId: newColId,
|
|
rowId: model.rowIds[i2],
|
|
markdown: i2 === 0 ? "New Column" : "",
|
|
html: i2 === 0 ? "New Column" : "",
|
|
isHeader: i2 === 0
|
|
});
|
|
}
|
|
updatedCells = sortCells(
|
|
model.rowIds,
|
|
updatedColumnIds,
|
|
updatedCells
|
|
);
|
|
const settingsObj = __spreadValues({}, settings);
|
|
settingsObj.columns[newColId] = __spreadValues({}, DEFAULT_COLUMN_SETTINGS);
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
model: __spreadProps(__spreadValues({}, model), {
|
|
columnIds: updatedColumnIds,
|
|
cells: updatedCells
|
|
}),
|
|
settings: settingsObj
|
|
});
|
|
});
|
|
handleSaveData(true);
|
|
}
|
|
function handleChangeColor(columnId, tagId, color2) {
|
|
setTableState((prevState) => {
|
|
const tags = [...prevState.settings.columns[columnId].tags];
|
|
const index = tags.findIndex((t2) => t2.id === tagId);
|
|
tags[index].color = color2;
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
tags
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(false);
|
|
}
|
|
function handleAutoWidthToggle(columnId, value) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleAutoWidthToggle", {
|
|
columnId,
|
|
value
|
|
});
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
useAutoWidth: value
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(false);
|
|
}
|
|
function handleWrapContentToggle(columnId, value) {
|
|
logFunc(shouldDebug, FILE_NAME3, "handleWrapContentToggle", {
|
|
columnId,
|
|
value
|
|
});
|
|
setTableState((prevState) => {
|
|
return __spreadProps(__spreadValues({}, prevState), {
|
|
settings: __spreadProps(__spreadValues({}, prevState.settings), {
|
|
columns: __spreadProps(__spreadValues({}, prevState.settings.columns), {
|
|
[columnId]: __spreadProps(__spreadValues({}, prevState.settings.columns[columnId]), {
|
|
shouldWrapOverflow: value
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
handleSaveData(false);
|
|
}
|
|
if (isLoading)
|
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
children: "Loading table..."
|
|
});
|
|
const { rowIds, columnIds, cells } = state.model;
|
|
const tableIdWithMode = getUniqueTableId(tableId, viewMode);
|
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", {
|
|
id: tableIdWithMode,
|
|
"data-id": tableId,
|
|
className: "NLT__app",
|
|
tabIndex: 0,
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(OptionBar, {
|
|
model: state.model,
|
|
settings: state.settings,
|
|
onSortRemoveClick: handleSortRemoveClick
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__table-wrapper",
|
|
onScroll: () => dispatch(updateMenuPosition()),
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Table, {
|
|
headers: [
|
|
...columnIds.map((columnId, i2) => {
|
|
const {
|
|
width: width2,
|
|
type,
|
|
sortDir,
|
|
shouldWrapOverflow,
|
|
useAutoWidth
|
|
} = state.settings.columns[columnId];
|
|
const cell = cells.find(
|
|
(c2) => c2.columnId === columnId && c2.isHeader
|
|
);
|
|
const { id, markdown, html } = cell;
|
|
return {
|
|
id,
|
|
component: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(EditableTh, {
|
|
cellId: id,
|
|
columnIndex: i2,
|
|
numColumns: columnIds.length,
|
|
columnId: cell.columnId,
|
|
width: useAutoWidth ? "max-content" : width2,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
markdown,
|
|
html,
|
|
type,
|
|
sortDir,
|
|
onSortSelect: handleHeaderSortSelect,
|
|
onInsertColumnClick: handleInsertColumnClick,
|
|
onMoveColumnClick: handleMoveColumnClick,
|
|
onWidthChange: handleHeaderWidthChange,
|
|
onDeleteClick: handleHeaderDeleteClick,
|
|
onTypeSelect: handleHeaderTypeClick,
|
|
onAutoWidthToggle: handleAutoWidthToggle,
|
|
onWrapOverflowToggle: handleWrapContentToggle,
|
|
onNameChange: handleCellContentChange
|
|
}, id)
|
|
};
|
|
}),
|
|
{
|
|
id: randomColumnId(),
|
|
component: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("th", {
|
|
className: "NLT__th",
|
|
style: { height: "1.8rem" },
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__th-container",
|
|
style: { paddingLeft: "10px" },
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, {
|
|
onClick: () => handleAddColumn(),
|
|
children: "New"
|
|
})
|
|
})
|
|
})
|
|
}
|
|
],
|
|
rows: rowIds.filter((_row, i2) => i2 !== 0).map((rowId) => {
|
|
const rowCells = cells.filter(
|
|
(cell) => cell.rowId === rowId
|
|
);
|
|
return {
|
|
id: rowId,
|
|
component: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, {
|
|
children: [
|
|
rowCells.map((cell) => {
|
|
const {
|
|
width: width2,
|
|
type,
|
|
useAutoWidth,
|
|
shouldWrapOverflow,
|
|
tags
|
|
} = state.settings.columns[cell.columnId];
|
|
const { id, markdown, html } = cell;
|
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(EditableTd, {
|
|
cellId: id,
|
|
tags,
|
|
rowId: cell.rowId,
|
|
columnId: cell.columnId,
|
|
markdown,
|
|
html,
|
|
columnType: type,
|
|
shouldWrapOverflow,
|
|
useAutoWidth,
|
|
width: useAutoWidth ? "max-content" : width2,
|
|
onTagClick: handleTagClick,
|
|
onRemoveTagClick: handleRemoveTagClick,
|
|
onContentChange: handleCellContentChange,
|
|
onColorChange: handleChangeColor,
|
|
onAddTag: handleAddTag
|
|
}, id);
|
|
}),
|
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", {
|
|
className: "NLT__td",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__td-container",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__td-cell-padding",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(RowMenu, {
|
|
rowId,
|
|
onDeleteClick: handleRowDeleteClick
|
|
})
|
|
})
|
|
})
|
|
})
|
|
]
|
|
})
|
|
};
|
|
}),
|
|
footers: [0].map((_id) => {
|
|
const { width: width2, useAutoWidth } = state.settings.columns[columnIds[0]];
|
|
return {
|
|
id: randomRowId(),
|
|
component: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, {
|
|
children: [
|
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", {
|
|
className: "NLT__td",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__td-container",
|
|
style: {
|
|
width: useAutoWidth ? "max-content" : width2
|
|
},
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
|
|
className: "NLT__td-cell-container NLT__td-cell-padding",
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, {
|
|
onClick: () => handleAddRow(),
|
|
children: "New"
|
|
})
|
|
})
|
|
})
|
|
}),
|
|
columnIds.map((_id2) => {
|
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", {
|
|
className: "NLT__td"
|
|
});
|
|
})
|
|
]
|
|
})
|
|
};
|
|
})
|
|
})
|
|
})
|
|
]
|
|
});
|
|
}
|
|
|
|
// src/services/redux/globalSlice.ts
|
|
var initialState2 = {
|
|
isDarkMode: false,
|
|
shouldDebug: false
|
|
};
|
|
var globalSlice = createSlice({
|
|
name: "global",
|
|
initialState: initialState2,
|
|
reducers: {
|
|
setDarkMode(state, action) {
|
|
state.isDarkMode = action.payload;
|
|
},
|
|
setDebugMode(state, action) {
|
|
state.shouldDebug = action.payload;
|
|
}
|
|
}
|
|
});
|
|
var { setDarkMode, setDebugMode } = globalSlice.actions;
|
|
var globalSlice_default = globalSlice.reducer;
|
|
|
|
// src/services/redux/store.ts
|
|
var store = configureStore({
|
|
reducer: {
|
|
menu: menuSlice_default,
|
|
global: globalSlice_default
|
|
}
|
|
});
|
|
|
|
// src/NltTable.tsx
|
|
var import_jsx_runtime61 = __toESM(require_jsx_runtime());
|
|
var NltTable = class extends import_obsidian4.MarkdownRenderChild {
|
|
constructor(el, plugin, tableId, viewMode) {
|
|
super(el);
|
|
this.el = el;
|
|
this.plugin = plugin;
|
|
this.tableId = tableId;
|
|
this.viewMode = viewMode;
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
const rootEl = this.el.createEl("div");
|
|
this.root = (0, import_client.createRoot)(rootEl);
|
|
this.root.render(
|
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Provider_default, {
|
|
store,
|
|
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(App2, {
|
|
plugin: this.plugin,
|
|
tableId: this.tableId,
|
|
viewMode: this.viewMode
|
|
})
|
|
})
|
|
);
|
|
this.el.children[0].replaceWith(rootEl);
|
|
});
|
|
}
|
|
onunload() {
|
|
return __async(this, null, function* () {
|
|
this.root.unmount();
|
|
});
|
|
}
|
|
};
|
|
|
|
// src/services/menu/utils.tsx
|
|
var isMenuId = (id) => {
|
|
return id.includes(MENU_PREFIX);
|
|
};
|
|
|
|
// src/MigrationModal.ts
|
|
var import_obsidian5 = require("obsidian");
|
|
var MigrationModal = class extends import_obsidian5.Modal {
|
|
constructor(plugin) {
|
|
super(plugin.app);
|
|
this.plugin = plugin;
|
|
this.markdown = "";
|
|
}
|
|
generateCodeblock() {
|
|
return __async(this, null, function* () {
|
|
const tableId = randomTableId();
|
|
const codeblock = generateNLTCodeBlock(tableId);
|
|
const table = parseTableFromMarkdown(this.markdown);
|
|
if (table.numColumns < 1 || table.numRows < 1) {
|
|
return null;
|
|
}
|
|
const { file } = yield findTableFile(this.plugin, tableId);
|
|
const model = parseTableModelFromParsedTable(table);
|
|
yield serializeTableModel(this.plugin, file, model);
|
|
return codeblock;
|
|
});
|
|
}
|
|
onOpen() {
|
|
const { contentEl, titleEl } = this;
|
|
titleEl.createDiv({ text: "Notion-Like Tables Migration Tool" });
|
|
contentEl.createDiv({ text: "Markdown" });
|
|
const subtitle = contentEl.createDiv({
|
|
text: "Place previous table markdown here"
|
|
});
|
|
subtitle.style.fontSize = "12px";
|
|
const markdownEl = contentEl.createEl("textarea");
|
|
markdownEl.style.width = "100%";
|
|
markdownEl.style.height = "200px";
|
|
markdownEl.style.marginBottom = "10px";
|
|
markdownEl.addEventListener("input", () => {
|
|
this.markdown = markdownEl.value;
|
|
});
|
|
this.errorEl = contentEl.createDiv({ text: "" });
|
|
this.errorEl.style.fontSize = "12px";
|
|
this.errorEl.style.color = "var(--text-error)";
|
|
const generateEl = contentEl.createEl("button", {
|
|
text: "Generate code block"
|
|
});
|
|
generateEl.className = "mod-cta";
|
|
generateEl.addEventListener("click", () => __async(this, null, function* () {
|
|
const codeblock = yield this.generateCodeblock();
|
|
if (codeblock) {
|
|
this.errorEl.setText("");
|
|
this.codeblockEl.setText(codeblock);
|
|
} else {
|
|
this.errorEl.setText("Invalid table markdown");
|
|
}
|
|
}));
|
|
contentEl.createEl("hr");
|
|
contentEl.createDiv({ text: "Generated NLT codeblock" });
|
|
this.codeblockEl = contentEl.createEl("textarea");
|
|
this.codeblockEl.style.width = "100%";
|
|
this.codeblockEl.style.height = "100px";
|
|
this.codeblockEl.style.marginBottom = "10px";
|
|
this.codeblockEl.setAttr("readonly", "true");
|
|
const copyEl = contentEl.createEl("button", { text: "Copy" });
|
|
copyEl.addEventListener("click", () => __async(this, null, function* () {
|
|
yield navigator.clipboard.writeText(this.codeblockEl.getText());
|
|
new import_obsidian5.Notice("Copied code block to clipboard");
|
|
}));
|
|
}
|
|
onClose() {
|
|
let { contentEl } = this;
|
|
contentEl.empty();
|
|
}
|
|
};
|
|
|
|
// src/main.ts
|
|
var DEFAULT_SETTINGS = {
|
|
data: {},
|
|
tableFolder: "_notion-like-tables",
|
|
viewModeSync: {
|
|
eventType: "update-state",
|
|
tableId: null,
|
|
viewModes: []
|
|
},
|
|
shouldClear: true,
|
|
shouldDebug: false
|
|
};
|
|
var NltPlugin = class extends import_obsidian6.Plugin {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.focusedTableId = null;
|
|
this.getViewMode = (el) => {
|
|
const parent = el.parentElement;
|
|
if (parent) {
|
|
return parent.className.includes("cm-preview-code-block") ? "source" : "preview";
|
|
}
|
|
return null;
|
|
};
|
|
this.hasDarkTheme = () => {
|
|
const el = document.querySelector("body");
|
|
return el.className.includes("theme-dark");
|
|
};
|
|
this.focusTable = (tableId) => {
|
|
this.focusedTableId = tableId;
|
|
};
|
|
this.blurTable = () => {
|
|
this.focusedTableId = null;
|
|
};
|
|
}
|
|
isLivePreviewEnabled() {
|
|
var _a;
|
|
return (_a = this.app.vault.config) == null ? void 0 : _a.livePreview;
|
|
}
|
|
onload() {
|
|
return __async(this, null, function* () {
|
|
yield this.loadSettings();
|
|
yield this.forcePostProcessorReload();
|
|
this.registerMarkdownCodeBlockProcessor(
|
|
"notion-like-tables",
|
|
(source, el, ctx) => {
|
|
const text = source.trim();
|
|
const tableId = text.match(TABLE_ID_REGEX) ? text : null;
|
|
if (tableId) {
|
|
const viewMode = this.getViewMode(el);
|
|
if (viewMode) {
|
|
ctx.addChild(new NltTable(el, this, tableId, viewMode));
|
|
}
|
|
}
|
|
}
|
|
);
|
|
this.addSettingTab(new NltSettingsTab(this.app, this));
|
|
this.registerCommands();
|
|
this.registerEvents();
|
|
this.app.workspace.onLayoutReady(() => {
|
|
this.checkForDarkMode();
|
|
this.checkForDebug();
|
|
});
|
|
});
|
|
}
|
|
checkForDebug() {
|
|
store.dispatch(setDebugMode(this.settings.shouldDebug));
|
|
}
|
|
checkForDarkMode() {
|
|
store.dispatch(setDarkMode(this.hasDarkTheme()));
|
|
}
|
|
registerEvents() {
|
|
this.registerEvent(
|
|
this.app.workspace.on("file-open", () => {
|
|
this.blurTable();
|
|
const livePreviewScroller = document.querySelector(".cm-scroller");
|
|
const readingModeScroller = document.querySelector(
|
|
".markdown-preview-view"
|
|
);
|
|
if (livePreviewScroller) {
|
|
livePreviewScroller.addEventListener("scroll", () => {
|
|
store.dispatch(updateMenuPosition());
|
|
});
|
|
}
|
|
if (readingModeScroller) {
|
|
readingModeScroller.addEventListener("scroll", () => {
|
|
store.dispatch(updateMenuPosition());
|
|
});
|
|
}
|
|
})
|
|
);
|
|
this.registerEvent(
|
|
this.app.workspace.on("resize", () => {
|
|
store.dispatch(updateMenuPosition());
|
|
})
|
|
);
|
|
this.registerEvent(
|
|
this.app.workspace.on("css-change", () => {
|
|
this.checkForDarkMode();
|
|
})
|
|
);
|
|
this.registerDomEvent(activeDocument, "keydown", (e) => __async(this, null, function* () {
|
|
if (e.key === "Enter" || e.key === "Escape") {
|
|
if (this.focusedTableId) {
|
|
const topLevelMenu = getTopLevelMenu(store.getState());
|
|
if (topLevelMenu && topLevelMenu.sortRowsOnClose) {
|
|
updateSortTime(this, this.focusedTableId);
|
|
}
|
|
store.dispatch(closeTopLevelMenu());
|
|
}
|
|
}
|
|
}));
|
|
this.registerDomEvent(activeDocument, "click", (el) => {
|
|
const topLevelMenu = getTopLevelMenu(store.getState());
|
|
const time = timeSinceMenuOpen(store.getState());
|
|
if (topLevelMenu !== null && time > 100) {
|
|
for (let i2 = 0; i2 < el.path.length; i2++) {
|
|
const element = el.path[i2];
|
|
if (element instanceof HTMLElement) {
|
|
const { id } = element;
|
|
if (id === topLevelMenu.id)
|
|
break;
|
|
if (isMenuId(id) || element.className.includes("NLT__app")) {
|
|
store.dispatch(closeTopLevelMenu());
|
|
if (this.focusedTableId && topLevelMenu.sortRowsOnClose)
|
|
updateSortTime(this, this.focusedTableId);
|
|
break;
|
|
}
|
|
if (element.className.includes("view-content")) {
|
|
store.dispatch(closeAllMenus());
|
|
if (this.focusedTableId && topLevelMenu.sortRowsOnClose)
|
|
updateSortTime(this, this.focusedTableId);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
for (let i2 = 0; i2 < el.path.length; i2++) {
|
|
const element = el.path[i2];
|
|
if (element instanceof HTMLElement) {
|
|
if (element.className.includes("NLT__app")) {
|
|
const id = element.getAttribute("data-id");
|
|
this.focusTable(id);
|
|
break;
|
|
}
|
|
if (element.className.includes("view-content")) {
|
|
this.blurTable();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
registerCommands() {
|
|
this.addCommand({
|
|
id: "nlt-migration-tool",
|
|
name: "Migration tool",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "m" }],
|
|
callback: () => __async(this, null, function* () {
|
|
new MigrationModal(this).open();
|
|
})
|
|
});
|
|
this.addCommand({
|
|
id: "nlt-add-table",
|
|
name: "Add table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "=" }],
|
|
editorCallback: (editor) => {
|
|
editor.replaceSelection(generateNLTCodeBlock());
|
|
}
|
|
});
|
|
this.addCommand({
|
|
id: "nlt-add-column",
|
|
name: "Add column to focused table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "\\" }],
|
|
callback: () => __async(this, null, function* () {
|
|
if (this.focusedTableId) {
|
|
const tableId = this.focusedTableId;
|
|
const prevState = this.settings.data[tableId];
|
|
const [updatedModel, updatedSettings] = addColumn(prevState);
|
|
const newState = __spreadProps(__spreadValues({}, this.settings.data[tableId]), {
|
|
model: updatedModel,
|
|
settings: updatedSettings
|
|
});
|
|
const viewModesToUpdate = [
|
|
"preview"
|
|
];
|
|
if (this.isLivePreviewEnabled())
|
|
viewModesToUpdate.push("source");
|
|
yield serializeTable(
|
|
true,
|
|
this,
|
|
newState,
|
|
tableId,
|
|
viewModesToUpdate
|
|
);
|
|
} else {
|
|
new import_obsidian6.Notice(
|
|
"No focused table. Please click a table to focus it and retry this operation again."
|
|
);
|
|
}
|
|
})
|
|
});
|
|
this.addCommand({
|
|
id: "nlt-add-row",
|
|
name: "Add row to focused table",
|
|
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "Enter" }],
|
|
callback: () => __async(this, null, function* () {
|
|
if (this.focusedTableId) {
|
|
const tableId = this.focusedTableId;
|
|
const prevState = this.settings.data[tableId];
|
|
const newState = addRow(prevState);
|
|
const viewModesToUpdate = [
|
|
"preview"
|
|
];
|
|
if (this.isLivePreviewEnabled())
|
|
viewModesToUpdate.push("source");
|
|
yield serializeTable(
|
|
true,
|
|
this,
|
|
newState,
|
|
tableId,
|
|
viewModesToUpdate
|
|
);
|
|
} else {
|
|
new import_obsidian6.Notice(
|
|
"No focused table. Please click a table to focus it and retry this operation."
|
|
);
|
|
}
|
|
})
|
|
});
|
|
}
|
|
loadSettings() {
|
|
return __async(this, null, function* () {
|
|
this.settings = Object.assign(
|
|
{},
|
|
DEFAULT_SETTINGS,
|
|
yield this.loadData()
|
|
);
|
|
});
|
|
}
|
|
saveSettings() {
|
|
return __async(this, null, function* () {
|
|
yield this.saveData(this.settings);
|
|
});
|
|
}
|
|
onunload() {
|
|
return __async(this, null, function* () {
|
|
yield this.forcePostProcessorReload();
|
|
});
|
|
}
|
|
forcePostProcessorReload() {
|
|
return __async(this, null, function* () {
|
|
this.app.workspace.iterateAllLeaves((leaf) => {
|
|
const view = leaf.view;
|
|
if (view.getViewType() === "markdown") {
|
|
if (view instanceof import_obsidian6.MarkdownView)
|
|
view.previewMode.rerender(true);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
static getFiles() {
|
|
return app.vault.getFiles();
|
|
}
|
|
};
|
|
/*
|
|
object-assign
|
|
(c) Sindre Sorhus
|
|
@license MIT
|
|
*/
|
|
/*!
|
|
Copyright (c) 2018 Jed Watson.
|
|
Licensed under the MIT License (MIT), see
|
|
http://jedwatson.github.io/classnames
|
|
*/
|
|
/**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*/
|
|
/**
|
|
* @license React
|
|
* react-dom.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.
|
|
*/
|
|
/**
|
|
* @license React
|
|
* react-is.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.
|
|
*/
|
|
/**
|
|
* @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.
|
|
*/
|
|
/**
|
|
* @license React
|
|
* react.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.
|
|
*/
|
|
/**
|
|
* @license React
|
|
* scheduler.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.
|
|
*/
|
|
/**
|
|
* @license React
|
|
* use-sync-external-store-shim.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.
|
|
*/
|
|
/**
|
|
* @license React
|
|
* use-sync-external-store-shim/with-selector.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.
|
|
*/
|
|
/**
|
|
* Checks if an event is supported in the current execution environment.
|
|
*
|
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
* `reset`, `load`, `error`, and `select`.
|
|
*
|
|
* Borrows from Modernizr.
|
|
*
|
|
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
* @return {boolean} True if the event is supported.
|
|
* @internal
|
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
*/
|
|
/** @license MUI v5.0.0-alpha.97
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license MUI v5.10.3
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license MUI v5.10.5
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/** @license React v16.13.1
|
|
* react-is.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.
|
|
*/
|