Files
Obsidian/.obsidian/plugins/notion-like-tables/main.js
2023-06-18 12:33:15 +08:00

56635 lines
2.2 MiB

"use strict";
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 __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
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 __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
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 getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || "";
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
}
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromType(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
}
}
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if (typeof type === "object") {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + ".Consumer";
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + ".Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
if (outerName !== null) {
return outerName;
}
return getComponentNameFromType(type.type) || "Memo";
case REACT_LAZY_TYPE: {
var lazyComponent = type;
var payload = lazyComponent._payload;
var init2 = lazyComponent._init;
try {
return getComponentNameFromType(init2(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 createElement2(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 createContext2(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 forwardRef(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 memo(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 useContext5(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 useState2(initialState2) {
var dispatcher = resolveDispatcher();
return dispatcher.useState(initialState2);
}
function useReducer(reducer, initialArg, init2) {
var dispatcher = resolveDispatcher();
return dispatcher.useReducer(reducer, initialArg, init2);
}
function useRef3(initialValue) {
var dispatcher = resolveDispatcher();
return dispatcher.useRef(initialValue);
}
function useEffect2(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 useMemo3(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 useDebugValue2(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(subscribe2, getSnapshot, getServerSnapshot) {
var dispatcher = resolveDispatcher();
return dispatcher.useSyncExternalStore(subscribe2, 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 init2 = lazyComponent._init;
try {
return describeUnknownElementTypeFrameInDEV(init2(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, values, 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](values, 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 = createElement2.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 = createContext2;
exports.createElement = createElement$1;
exports.createFactory = createFactory;
exports.createRef = createRef;
exports.forwardRef = forwardRef;
exports.isValidElement = isValidElement;
exports.lazy = lazy;
exports.memo = memo;
exports.startTransition = startTransition;
exports.unstable_act = act;
exports.useCallback = useCallback;
exports.useContext = useContext5;
exports.useDebugValue = useDebugValue2;
exports.useDeferredValue = useDeferredValue;
exports.useEffect = useEffect2;
exports.useId = useId;
exports.useImperativeHandle = useImperativeHandle;
exports.useInsertionEffect = useInsertionEffect;
exports.useLayoutEffect = useLayoutEffect2;
exports.useMemo = useMemo3;
exports.useReducer = useReducer;
exports.useRef = useRef3;
exports.useState = useState2;
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 last2 = heap.pop();
if (last2 !== first) {
heap[0] = last2;
siftDown(heap, last2, 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 left = heap[leftIndex];
var rightIndex = leftIndex + 1;
var right = heap[rightIndex];
if (compare(left, node) < 0) {
if (rightIndex < length && compare(right, left) < 0) {
heap[index] = right;
heap[rightIndex] = node;
index = rightIndex;
} else {
heap[index] = left;
heap[leftIndex] = node;
index = leftIndex;
}
} else if (rightIndex < length && compare(right, node) < 0) {
heap[index] = right;
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, eventHandler2) {
switch (priorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
case LowPriority:
case IdlePriority:
break;
default:
priorityLevel = NormalPriority;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler2();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
}
function unstable_next(eventHandler2) {
var priorityLevel;
switch (currentPriorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
priorityLevel = NormalPriority;
break;
default:
priorityLevel = currentPriorityLevel;
break;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler2();
} 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 React49 = require_react();
var Scheduler = require_scheduler();
var ReactSharedInternals = React49.__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 Fragment2 = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 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 properties.hasOwnProperty(name) ? properties[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 properties = {};
var reservedProps = [
"children",
"dangerouslySetInnerHTML",
"defaultValue",
"defaultChecked",
"innerHTML",
"suppressContentEditableWarning",
"suppressHydrationWarning",
"style"
];
reservedProps.forEach(function(name) {
properties[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];
properties[name] = new PropertyInfoRecord(
name,
STRING,
false,
attributeName,
null,
false,
false
);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
properties[name] = new PropertyInfoRecord(
name,
BOOLEANISH_STRING,
false,
name.toLowerCase(),
null,
false,
false
);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
properties[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) {
properties[name] = new PropertyInfoRecord(
name,
BOOLEAN,
false,
name.toLowerCase(),
null,
false,
false
);
});
[
"checked",
"multiple",
"muted",
"selected"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(
name,
BOOLEAN,
true,
name,
null,
false,
false
);
});
[
"capture",
"download"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(
name,
OVERLOADED_BOOLEAN,
false,
name,
null,
false,
false
);
});
[
"cols",
"rows",
"size",
"span"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(
name,
POSITIVE_NUMERIC,
false,
name,
null,
false,
false
);
});
["rowSpan", "start"].forEach(function(name) {
properties[name] = new PropertyInfoRecord(
name,
NUMERIC,
false,
name.toLowerCase(),
null,
false,
false
);
});
var CAMELIZE = /[\-\:]([a-z])/g;
var capitalize = 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, capitalize);
properties[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, capitalize);
properties[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, capitalize);
properties[name] = new PropertyInfoRecord(
name,
STRING,
false,
attributeName,
"http://www.w3.org/XML/1998/namespace",
false,
false
);
});
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
properties[attributeName] = new PropertyInfoRecord(
attributeName,
STRING,
false,
attributeName.toLowerCase(),
null,
false,
false
);
});
var xlinkHref = "xlinkHref";
properties[xlinkHref] = new PropertyInfoRecord(
"xlinkHref",
STRING,
false,
"xlink:href",
"http://www.w3.org/1999/xlink",
true,
false
);
["src", "href", "action", "formAction"].forEach(function(attributeName) {
properties[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 init2 = lazyComponent._init;
try {
return describeUnknownElementTypeFrameInDEV(init2(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 ForwardRef:
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 getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || "";
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
}
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromType(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
}
}
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if (typeof type === "object") {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + ".Consumer";
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + ".Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
if (outerName !== null) {
return outerName;
}
return getComponentNameFromType(type.type) || "Memo";
case REACT_LAZY_TYPE: {
var lazyComponent = type;
var payload = lazyComponent._payload;
var init2 = lazyComponent._init;
try {
return getComponentNameFromType(init2(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 ForwardRef:
return getWrappedName$1(type, type.render, "ForwardRef");
case Fragment2:
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) {
React49.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 isEmpty = value == null || typeof value === "boolean" || value === "";
if (isEmpty) {
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 style2 = 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) {
style2.setProperty(styleName, styleValue);
} else {
style2[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, f3) {
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, f3) {
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, f3) {
hasError = false;
caughtError = null;
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a2, b2, c2, d2, e, f3) {
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 map2 = /* @__PURE__ */ new Map();
var lane = 1;
for (var index2 = 0; index2 < TotalLanes; index2++) {
var label = getLabelForLane(lane);
map2.set(lane, label);
lane *= 2;
}
return map2;
}
}
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 log2 = Math.log;
var LN2 = Math.LN2;
function clz32Fallback(x2) {
var asUint = x2 >>> 0;
if (asUint === 0) {
return 32;
}
return 31 - (log2(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, map2) {
if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
map2.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 reset2() {
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();
reset2();
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 style = {};
if (canUseDOM2) {
style = 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 style) {
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, common, inCapturePhase) {
var registrationName = event._reactName;
var listeners = [];
var instance = target;
while (instance !== null) {
if (instance === common) {
break;
}
var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
if (alternate !== null && alternate === common) {
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 common = from && to ? getLowestCommonAncestor(from, to) : null;
if (from !== null) {
accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
}
if (to !== null && enterEvent !== null) {
accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, 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 noop2() {
}
function trapClickOnNonInteractiveElement(node) {
node.onclick = noop2;
}
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 createElement2(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 = createElement2(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 style2 = instance.style;
if (typeof style2.setProperty === "function") {
style2.setProperty("display", "none", "important");
} else {
style2.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, values, 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](values, 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 overflow = treeContextOverflow;
var idWithLeadingBit = treeContextId;
var id2 = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
return id2.toString(32) + overflow;
}
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 id2 = restOfNewBits | restOfBaseId;
var overflow = newOverflow + baseOverflow;
treeContextId = 1 << restOfLength | id2;
treeContextOverflow = overflow;
} 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(id2) {
return 1 << getBitLength(id2) - 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 clone2 = {
baseState: currentQueue.baseState,
firstBaseUpdate: currentQueue.firstBaseUpdate,
lastBaseUpdate: currentQueue.lastBaseUpdate,
shared: currentQueue.shared,
effects: currentQueue.effects
};
workInProgress2.updateQueue = clone2;
}
}
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 clone2 = {
eventTime: update.eventTime,
lane: update.lane,
tag: update.tag,
payload: update.payload,
callback: update.callback,
next: null
};
if (newLast === null) {
newFirst = newLast = clone2;
} else {
newLast.next = clone2;
newLast = clone2;
}
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 clone2 = {
eventTime: updateEventTime,
lane: updateLane,
tag: update.tag,
payload: update.payload,
callback: update.callback,
next: null
};
if (newLastBaseUpdate === null) {
newFirstBaseUpdate = newLastBaseUpdate = clone2;
newBaseState = newState;
} else {
newLastBaseUpdate = newLastBaseUpdate.next = clone2;
}
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 React49.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 init2 = lazyType._init;
return init2(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 clone2 = createWorkInProgress(fiber, pendingProps);
clone2.index = 0;
clone2.sibling = null;
return clone2;
}
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 !== Fragment2) {
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 init2 = newChild._init;
return createChild(returnFiber, init2(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 init2 = newChild._init;
return updateSlot(returnFiber, oldFiber, init2(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 init2 = newChild._init;
return updateFromMap(existingChildren, returnFiber, newIdx, init2(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 init2 = child._init;
warnOnInvalidKey(init2(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 === Fragment2) {
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 init2 = newChild._init;
return reconcileChildFibers2(returnFiber, currentFirstChild, init2(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, init2) {
var hook = mountWorkInProgressHook();
var initialState2;
if (init2 !== void 0) {
initialState2 = init2(initialArg);
} else {
initialState2 = initialArg;
}
hook.memoizedState = hook.baseState = initialState2;
var queue = {
pending: null,
interleaved: null,
lanes: NoLanes,
dispatch: null,
lastRenderedReducer: reducer,
lastRenderedState: initialState2
};
hook.queue = queue;
var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
return [hook.memoizedState, dispatch];
}
function updateReducer(reducer, initialArg, init2) {
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 clone2 = {
lane: updateLane,
action: update.action,
hasEagerState: update.hasEagerState,
eagerState: update.eagerState,
next: null
};
if (newBaseQueueLast === null) {
newBaseQueueFirst = newBaseQueueLast = clone2;
newBaseState = newState;
} else {
newBaseQueueLast = newBaseQueueLast.next = clone2;
}
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, init2) {
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, subscribe2) {
{
return void 0;
}
}
function updateMutableSource(source, getSnapshot, subscribe2) {
{
return void 0;
}
}
function mountSyncExternalStore(subscribe2, 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, subscribe2), [subscribe2]);
fiber.flags |= Passive;
pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
return nextSnapshot;
}
function updateSyncExternalStore(subscribe2, 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, subscribe2), [subscribe2]);
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, subscribe2) {
var handleStoreChange = function() {
if (checkIfSnapshotChanged(inst)) {
forceStoreRerender(fiber);
}
};
return subscribe2(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(initialState2) {
var hook = mountWorkInProgressHook();
if (typeof initialState2 === "function") {
initialState2 = initialState2();
}
hook.memoizedState = hook.baseState = initialState2;
var queue = {
pending: null,
interleaved: null,
lanes: NoLanes,
dispatch: null,
lastRenderedReducer: basicStateReducer,
lastRenderedState: initialState2
};
hook.queue = queue;
var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
return [hook.memoizedState, dispatch];
}
function updateState(initialState2) {
return updateReducer(basicStateReducer);
}
function rerenderState(initialState2) {
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 id2;
if (getIsHydrating()) {
var treeId = getTreeId();
id2 = ":" + identifierPrefix + "R" + treeId;
var localId = localIdCounter++;
if (localId > 0) {
id2 += "H" + localId.toString(32);
}
id2 += ":";
} else {
var globalClientId = globalClientIdCounter++;
id2 = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
}
hook.memoizedState = id2;
return id2;
}
function updateId() {
var hook = updateWorkInProgressHook();
var id2 = hook.memoizedState;
return id2;
}
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, init2) {
currentHookNameInDev = "useReducer";
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
mountHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
mountHookTypesDev();
return mountMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
mountHookTypesDev();
return mountSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
updateHookTypesDev();
return mountMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
updateHookTypesDev();
return mountSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
updateHookTypesDev();
return updateMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
updateHookTypesDev();
return updateSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
try {
return rerenderReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
try {
return rerenderState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
updateHookTypesDev();
return updateMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
updateHookTypesDev();
return updateSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
mountHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
warnInvalidHookAccess();
mountHookTypesDev();
return mountMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
warnInvalidHookAccess();
mountHookTypesDev();
return mountSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
warnInvalidHookAccess();
updateHookTypesDev();
return updateMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
warnInvalidHookAccess();
updateHookTypesDev();
return updateSyncExternalStore(subscribe2, 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, init2) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return rerenderReducer(reducer, initialArg, init2);
} finally {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return rerenderState(initialState2);
} 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, subscribe2) {
currentHookNameInDev = "useMutableSource";
warnInvalidHookAccess();
updateHookTypesDev();
return updateMutableSource();
},
useSyncExternalStore: function(subscribe2, getSnapshot, getServerSnapshot) {
currentHookNameInDev = "useSyncExternalStore";
warnInvalidHookAccess();
updateHookTypesDev();
return updateSyncExternalStore(subscribe2, 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 === ForwardRef || 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 init2 = lazyComponent._init;
try {
outerMemoType = init2(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 init2 = lazyComponent._init;
var Component = init2(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 ForwardRef: {
{
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 ForwardRef: {
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 Fragment2:
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 ForwardRef:
case Fragment2:
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 ForwardRef:
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, id2 = _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(id2, 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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ForwardRef:
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 ceil2 = 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 : ceil2(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 !== ForwardRef && 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 ForwardRef:
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 !== ForwardRef && 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 ForwardRef: {
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 ForwardRef:
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 ForwardRef:
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 ForwardRef;
}
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 ForwardRef:
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 = ForwardRef;
{
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(Fragment2, 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, id2) {
var currentHook2 = fiber.memoizedState;
while (currentHook2 !== null && id2 > 0) {
currentHook2 = currentHook2.next;
id2--;
}
return currentHook2;
};
overrideHookState = function(fiber, id2, path, value) {
var hook = findHook(fiber, id2);
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, id2, path) {
var hook = findHook(fiber, id2);
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, id2, oldPath, newPath) {
var hook = findHook(fiber, id2);
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 createRoot4(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 createRoot4(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/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 React49 = 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 = React49.__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 getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || "";
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
}
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromType(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
}
}
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
}
if (typeof type === "object") {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + ".Consumer";
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + ".Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
if (outerName !== null) {
return outerName;
}
return getComponentNameFromType(type.type) || "Memo";
case REACT_LAZY_TYPE: {
var lazyComponent = type;
var payload = lazyComponent._payload;
var init2 = lazyComponent._init;
try {
return getComponentNameFromType(init2(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 init2 = lazyComponent._init;
try {
return describeUnknownElementTypeFrameInDEV(init2(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, values, 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](values, 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 jsx3 = jsxWithValidationDynamic;
var jsxs2 = jsxWithValidationStatic;
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsx3;
exports.jsxs = jsxs2;
})();
}
}
});
// 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/@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 insert2(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|-ms-expand|-ms-reveal){/.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, r2) {
typeof exports === "object" && typeof module2 !== "undefined" ? r2(exports) : typeof define === "function" && define.amd ? define(["exports"], r2) : (e = e || self, r2(e.stylis = {}));
})(exports, function(e) {
"use strict";
var r2 = "-ms-";
var a2 = "-moz-";
var c2 = "-webkit-";
var n2 = "comm";
var t2 = "rule";
var s2 = "decl";
var i2 = "@page";
var u2 = "@media";
var o2 = "@import";
var f3 = "@charset";
var l2 = "@viewport";
var p2 = "@supports";
var h2 = "@document";
var v2 = "@namespace";
var d2 = "@keyframes";
var b2 = "@font-face";
var w2 = "@counter-style";
var m2 = "@font-feature-values";
var g2 = "@layer";
var k2 = Math.abs;
var $ = String.fromCharCode;
var x2 = Object.assign;
function E2(e2, r3) {
return M2(e2, 0) ^ 45 ? (((r3 << 2 ^ M2(e2, 0)) << 2 ^ M2(e2, 1)) << 2 ^ M2(e2, 2)) << 2 ^ M2(e2, 3) : 0;
}
function y2(e2) {
return e2.trim();
}
function T(e2, r3) {
return (e2 = r3.exec(e2)) ? e2[0] : e2;
}
function A2(e2, r3, a3) {
return e2.replace(r3, a3);
}
function O2(e2, r3) {
return e2.indexOf(r3);
}
function M2(e2, r3) {
return e2.charCodeAt(r3) | 0;
}
function C(e2, r3, a3) {
return e2.slice(r3, a3);
}
function R2(e2) {
return e2.length;
}
function S2(e2) {
return e2.length;
}
function z2(e2, r3) {
return r3.push(e2), e2;
}
function N2(e2, r3) {
return e2.map(r3).join("");
}
e.line = 1;
e.column = 1;
e.length = 0;
e.position = 0;
e.character = 0;
e.characters = "";
function P2(r3, a3, c3, n3, t3, s3, i3) {
return { value: r3, root: a3, parent: c3, type: n3, props: t3, children: s3, line: e.line, column: e.column, length: i3, return: "" };
}
function j2(e2, r3) {
return x2(P2("", null, null, "", null, null, 0), e2, { length: -e2.length }, r3);
}
function U2() {
return e.character;
}
function _3() {
e.character = e.position > 0 ? M2(e.characters, --e.position) : 0;
if (e.column--, e.character === 10)
e.column = 1, e.line--;
return e.character;
}
function F2() {
e.character = e.position < e.length ? M2(e.characters, e.position++) : 0;
if (e.column++, e.character === 10)
e.column = 1, e.line++;
return e.character;
}
function I2() {
return M2(e.characters, e.position);
}
function L2() {
return e.position;
}
function D2(r3, a3) {
return C(e.characters, r3, a3);
}
function Y2(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(r3) {
return e.line = e.column = 1, e.length = R2(e.characters = r3), e.position = 0, [];
}
function V(r3) {
return e.characters = "", r3;
}
function W2(r3) {
return y2(D2(e.position - 1, q2(r3 === 91 ? r3 + 2 : r3 === 40 ? r3 + 1 : r3)));
}
function B2(e2) {
return V(H2(K(e2)));
}
function G2(r3) {
while (e.character = I2())
if (e.character < 33)
F2();
else
break;
return Y2(r3) > 2 || Y2(e.character) > 3 ? "" : " ";
}
function H2(r3) {
while (F2())
switch (Y2(e.character)) {
case 0:
z2(Q2(e.position - 1), r3);
break;
case 2:
z2(W2(e.character), r3);
break;
default:
z2($(e.character), r3);
}
return r3;
}
function Z2(r3, a3) {
while (--a3 && F2())
if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97)
break;
return D2(r3, L2() + (a3 < 6 && I2() == 32 && F2() == 32));
}
function q2(r3) {
while (F2())
switch (e.character) {
case r3:
return e.position;
case 34:
case 39:
if (r3 !== 34 && r3 !== 39)
q2(e.character);
break;
case 40:
if (r3 === 41)
q2(r3);
break;
case 92:
F2();
break;
}
return e.position;
}
function J(r3, a3) {
while (F2())
if (r3 + e.character === 47 + 10)
break;
else if (r3 + e.character === 42 + 42 && I2() === 47)
break;
return "/*" + D2(a3, e.position - 1) + "*" + $(r3 === 47 ? r3 : F2());
}
function Q2(r3) {
while (!Y2(I2()))
F2();
return D2(r3, e.position);
}
function X2(e2) {
return V(ee("", null, null, null, [""], e2 = K(e2), 0, [0], e2));
}
function ee(e2, r3, a3, c3, n3, t3, s3, i3, u3) {
var o3 = 0;
var f4 = 0;
var l3 = s3;
var p3 = 0;
var h3 = 0;
var v3 = 0;
var d3 = 1;
var b3 = 1;
var w3 = 1;
var m3 = 0;
var g3 = "";
var k3 = n3;
var x3 = t3;
var E3 = c3;
var y3 = g3;
while (b3)
switch (v3 = m3, m3 = F2()) {
case 40:
if (v3 != 108 && M2(y3, l3 - 1) == 58) {
if (O2(y3 += A2(W2(m3), "&", "&\f"), "&\f") != -1)
w3 = -1;
break;
}
case 34:
case 39:
case 91:
y3 += W2(m3);
break;
case 9:
case 10:
case 13:
case 32:
y3 += G2(v3);
break;
case 92:
y3 += Z2(L2() - 1, 7);
continue;
case 47:
switch (I2()) {
case 42:
case 47:
z2(ae(J(F2(), L2()), r3, a3), u3);
break;
default:
y3 += "/";
}
break;
case 123 * d3:
i3[o3++] = R2(y3) * w3;
case 125 * d3:
case 59:
case 0:
switch (m3) {
case 0:
case 125:
b3 = 0;
case 59 + f4:
if (w3 == -1)
y3 = A2(y3, /\f/g, "");
if (h3 > 0 && R2(y3) - l3)
z2(h3 > 32 ? ce(y3 + ";", c3, a3, l3 - 1) : ce(A2(y3, " ", "") + ";", c3, a3, l3 - 2), u3);
break;
case 59:
y3 += ";";
default:
z2(E3 = re(y3, r3, a3, o3, f4, n3, i3, g3, k3 = [], x3 = [], l3), t3);
if (m3 === 123)
if (f4 === 0)
ee(y3, r3, E3, E3, k3, t3, l3, i3, x3);
else
switch (p3 === 99 && M2(y3, 3) === 110 ? 100 : p3) {
case 100:
case 108:
case 109:
case 115:
ee(e2, E3, E3, c3 && z2(re(e2, E3, E3, 0, 0, n3, i3, g3, n3, k3 = [], l3), x3), n3, x3, l3, i3, c3 ? k3 : x3);
break;
default:
ee(y3, E3, E3, E3, [""], x3, 0, i3, x3);
}
}
o3 = f4 = h3 = 0, d3 = w3 = 1, g3 = y3 = "", l3 = s3;
break;
case 58:
l3 = 1 + R2(y3), h3 = v3;
default:
if (d3 < 1) {
if (m3 == 123)
--d3;
else if (m3 == 125 && d3++ == 0 && _3() == 125)
continue;
}
switch (y3 += $(m3), m3 * d3) {
case 38:
w3 = f4 > 0 ? 1 : (y3 += "\f", -1);
break;
case 44:
i3[o3++] = (R2(y3) - 1) * w3, w3 = 1;
break;
case 64:
if (I2() === 45)
y3 += W2(F2());
p3 = I2(), f4 = l3 = R2(g3 = y3 += Q2(L2())), m3++;
break;
case 45:
if (v3 === 45 && R2(y3) == 2)
d3 = 0;
}
}
return t3;
}
function re(e2, r3, a3, c3, n3, s3, i3, u3, o3, f4, l3) {
var p3 = n3 - 1;
var h3 = n3 === 0 ? s3 : [""];
var v3 = S2(h3);
for (var d3 = 0, b3 = 0, w3 = 0; d3 < c3; ++d3)
for (var m3 = 0, g3 = C(e2, p3 + 1, p3 = k2(b3 = i3[d3])), $2 = e2; m3 < v3; ++m3)
if ($2 = y2(b3 > 0 ? h3[m3] + " " + g3 : A2(g3, /&\f/g, h3[m3])))
o3[w3++] = $2;
return P2(e2, r3, a3, n3 === 0 ? t2 : u3, o3, f4, l3);
}
function ae(e2, r3, a3) {
return P2(e2, r3, a3, n2, $(U2()), C(e2, 2, -2), 0);
}
function ce(e2, r3, a3, c3) {
return P2(e2, r3, a3, s2, C(e2, 0, c3), C(e2, c3 + 1, -1), c3);
}
function ne(e2, n3, t3) {
switch (E2(e2, n3)) {
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 4789:
return a2 + e2 + e2;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return c2 + e2 + a2 + e2 + r2 + e2 + e2;
case 5936:
switch (M2(e2, n3 + 11)) {
case 114:
return c2 + e2 + r2 + A2(e2, /[svh]\w+-[tblr]{2}/, "tb") + e2;
case 108:
return c2 + e2 + r2 + A2(e2, /[svh]\w+-[tblr]{2}/, "tb-rl") + e2;
case 45:
return c2 + e2 + r2 + A2(e2, /[svh]\w+-[tblr]{2}/, "lr") + e2;
}
case 6828:
case 4268:
case 2903:
return c2 + e2 + r2 + e2 + e2;
case 6165:
return c2 + e2 + r2 + "flex-" + e2 + e2;
case 5187:
return c2 + e2 + A2(e2, /(\w+).+(:[^]+)/, c2 + "box-$1$2" + r2 + "flex-$1$2") + e2;
case 5443:
return c2 + e2 + r2 + "flex-item-" + A2(e2, /flex-|-self/g, "") + (!T(e2, /flex-|baseline/) ? r2 + "grid-row-" + A2(e2, /flex-|-self/g, "") : "") + e2;
case 4675:
return c2 + e2 + r2 + "flex-line-pack" + A2(e2, /align-content|flex-|-self/g, "") + e2;
case 5548:
return c2 + e2 + r2 + A2(e2, "shrink", "negative") + e2;
case 5292:
return c2 + e2 + r2 + A2(e2, "basis", "preferred-size") + e2;
case 6060:
return c2 + "box-" + A2(e2, "-grow", "") + c2 + e2 + r2 + A2(e2, "grow", "positive") + e2;
case 4554:
return c2 + A2(e2, /([^-])(transform)/g, "$1" + c2 + "$2") + e2;
case 6187:
return A2(A2(A2(e2, /(zoom-|grab)/, c2 + "$1"), /(image-set)/, c2 + "$1"), e2, "") + e2;
case 5495:
case 3959:
return A2(e2, /(image-set\([^]*)/, c2 + "$1$`$1");
case 4968:
return A2(A2(e2, /(.+:)(flex-)?(.*)/, c2 + "box-pack:$3" + r2 + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c2 + e2 + e2;
case 4200:
if (!T(e2, /flex-|baseline/))
return r2 + "grid-column-align" + C(e2, n3) + e2;
break;
case 2592:
case 3360:
return r2 + A2(e2, "template-", "") + e2;
case 4384:
case 3616:
if (t3 && t3.some(function(e3, r3) {
return n3 = r3, T(e3.props, /grid-\w+-end/);
})) {
return ~O2(e2 + (t3 = t3[n3].value), "span") ? e2 : r2 + A2(e2, "-start", "") + e2 + r2 + "grid-row-span:" + (~O2(t3, "span") ? T(t3, /\d+/) : +T(t3, /\d+/) - +T(e2, /\d+/)) + ";";
}
return r2 + A2(e2, "-start", "") + e2;
case 4896:
case 4128:
return t3 && t3.some(function(e3) {
return T(e3.props, /grid-\w+-start/);
}) ? e2 : r2 + A2(A2(e2, "-end", "-span"), "span ", "") + e2;
case 4095:
case 3583:
case 4068:
case 2532:
return A2(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 (R2(e2) - 1 - n3 > 6)
switch (M2(e2, n3 + 1)) {
case 109:
if (M2(e2, n3 + 4) !== 45)
break;
case 102:
return A2(e2, /(.+:)(.+)-([^]+)/, "$1" + c2 + "$2-$3$1" + a2 + (M2(e2, n3 + 3) == 108 ? "$3" : "$2-$3")) + e2;
case 115:
return ~O2(e2, "stretch") ? ne(A2(e2, "stretch", "fill-available"), n3, t3) + e2 : e2;
}
break;
case 5152:
case 5920:
return A2(e2, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(a3, c3, n4, t4, s3, i3, u3) {
return r2 + c3 + ":" + n4 + u3 + (t4 ? r2 + c3 + "-span:" + (s3 ? i3 : +i3 - +n4) + u3 : "") + e2;
});
case 4949:
if (M2(e2, n3 + 6) === 121)
return A2(e2, ":", ":" + c2) + e2;
break;
case 6444:
switch (M2(e2, M2(e2, 14) === 45 ? 18 : 11)) {
case 120:
return A2(e2, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + c2 + (M2(e2, 14) === 45 ? "inline-" : "") + "box$3$1" + c2 + "$2$3$1" + r2 + "$2box$3") + e2;
case 100:
return A2(e2, ":", ":" + r2) + e2;
}
break;
case 5719:
case 2647:
case 2135:
case 3927:
case 2391:
return A2(e2, "scroll-", "scroll-snap-") + e2;
}
return e2;
}
function te(e2, r3) {
var a3 = "";
var c3 = S2(e2);
for (var n3 = 0; n3 < c3; n3++)
a3 += r3(e2[n3], n3, e2, r3) || "";
return a3;
}
function se(e2, r3, a3, c3) {
switch (e2.type) {
case g2:
if (e2.children.length)
break;
case o2:
case s2:
return e2.return = e2.return || e2.value;
case n2:
return "";
case d2:
return e2.return = e2.value + "{" + te(e2.children, c3) + "}";
case t2:
e2.value = e2.props.join(",");
}
return R2(a3 = te(e2.children, c3)) ? e2.return = e2.value + "{" + a3 + "}" : "";
}
function ie(e2) {
var r3 = S2(e2);
return function(a3, c3, n3, t3) {
var s3 = "";
for (var i3 = 0; i3 < r3; i3++)
s3 += e2[i3](a3, c3, n3, t3) || "";
return s3;
};
}
function ue(e2) {
return function(r3) {
if (!r3.root) {
if (r3 = r3.return)
e2(r3);
}
};
}
function oe(e2, n3, i3, u3) {
if (e2.length > -1) {
if (!e2.return)
switch (e2.type) {
case s2:
e2.return = ne(e2.value, e2.length, i3);
return;
case d2:
return te([j2(e2, { value: A2(e2.value, "@", "@" + c2) })], u3);
case t2:
if (e2.length)
return N2(e2.props, function(n4) {
switch (T(n4, /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
return te([j2(e2, { props: [A2(n4, /:(read-\w+)/, ":" + a2 + "$1")] })], u3);
case "::placeholder":
return te([j2(e2, { props: [A2(n4, /:(plac\w+)/, ":" + c2 + "input-$1")] }), j2(e2, { props: [A2(n4, /:(plac\w+)/, ":" + a2 + "$1")] }), j2(e2, { props: [A2(n4, /:(plac\w+)/, r2 + "input-$1")] })], u3);
}
return "";
});
}
}
}
function fe(e2) {
switch (e2.type) {
case t2:
e2.props = e2.props.map(function(r3) {
return N2(B2(r3), function(r4, a3, c3) {
switch (M2(r4, 0)) {
case 12:
return C(r4, 1, R2(r4));
case 0:
case 40:
case 43:
case 62:
case 126:
return r4;
case 58:
if (c3[++a3] === "global")
c3[a3] = "", c3[++a3] = "\f" + C(c3[a3], a3 = 1, -1);
case 32:
return a3 === 1 ? "" : r4;
default:
switch (a3) {
case 0:
e2 = r4;
return S2(c3) > 1 ? "" : r4;
case (a3 = S2(c3) - 1):
case 2:
return a3 === 2 ? r4 + e2 + e2 : r4 + e2;
default:
return r4;
}
}
});
});
}
}
e.CHARSET = f3;
e.COMMENT = n2;
e.COUNTER_STYLE = w2;
e.DECLARATION = s2;
e.DOCUMENT = h2;
e.FONT_FACE = b2;
e.FONT_FEATURE_VALUES = m2;
e.IMPORT = o2;
e.KEYFRAMES = d2;
e.LAYER = g2;
e.MEDIA = u2;
e.MOZ = a2;
e.MS = r2;
e.NAMESPACE = v2;
e.PAGE = i2;
e.RULESET = t2;
e.SUPPORTS = p2;
e.VIEWPORT = l2;
e.WEBKIT = c2;
e.abs = k2;
e.alloc = K;
e.append = z2;
e.assign = x2;
e.caret = L2;
e.char = U2;
e.charat = M2;
e.combine = N2;
e.comment = ae;
e.commenter = J;
e.compile = X2;
e.copy = j2;
e.dealloc = V;
e.declaration = ce;
e.delimit = W2;
e.delimiter = q2;
e.escaping = Z2;
e.from = $;
e.hash = E2;
e.identifier = Q2;
e.indexof = O2;
e.match = T;
e.middleware = ie;
e.namespace = fe;
e.next = F2;
e.node = P2;
e.parse = ee;
e.peek = I2;
e.prefix = ne;
e.prefixer = oe;
e.prev = _3;
e.replace = A2;
e.ruleset = re;
e.rulesheet = ue;
e.serialize = te;
e.sizeof = S2;
e.slice = D2;
e.stringify = se;
e.strlen = R2;
e.substr = C;
e.token = Y2;
e.tokenize = B2;
e.tokenizer = H2;
e.trim = y2;
e.whitespace = G2;
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/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js
var require_emotion_memoize_cjs_dev = __commonJS({
"node_modules/@emotion/cache/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function memoize(fn2) {
var cache = /* @__PURE__ */ Object.create(null);
return function(arg) {
if (cache[arg] === void 0)
cache[arg] = fn2(arg);
return cache[arg];
};
}
exports["default"] = memoize;
}
});
// node_modules/@emotion/cache/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.js
var require_emotion_memoize_cjs = __commonJS({
"node_modules/@emotion/cache/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/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 memoize = 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(memoize);
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;
var commentContainer = isNested ? element.parent.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);
}
};
function prefix2(value, length) {
switch (stylis.hash(value, length)) {
case 5103:
return stylis.WEBKIT + "print-" + value + value;
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 stylis.WEBKIT + value + value;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return stylis.WEBKIT + value + stylis.MOZ + value + stylis.MS + value + value;
case 6828:
case 4268:
return stylis.WEBKIT + value + stylis.MS + value + value;
case 6165:
return stylis.WEBKIT + value + stylis.MS + "flex-" + value + value;
case 5187:
return stylis.WEBKIT + value + stylis.replace(value, /(\w+).+(:[^]+)/, stylis.WEBKIT + "box-$1$2" + stylis.MS + "flex-$1$2") + value;
case 5443:
return stylis.WEBKIT + value + stylis.MS + "flex-item-" + stylis.replace(value, /flex-|-self/, "") + value;
case 4675:
return stylis.WEBKIT + value + stylis.MS + "flex-line-pack" + stylis.replace(value, /align-content|flex-|-self/, "") + value;
case 5548:
return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, "shrink", "negative") + value;
case 5292:
return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, "basis", "preferred-size") + value;
case 6060:
return stylis.WEBKIT + "box-" + stylis.replace(value, "-grow", "") + stylis.WEBKIT + value + stylis.MS + stylis.replace(value, "grow", "positive") + value;
case 4554:
return stylis.WEBKIT + stylis.replace(value, /([^-])(transform)/g, "$1" + stylis.WEBKIT + "$2") + value;
case 6187:
return stylis.replace(stylis.replace(stylis.replace(value, /(zoom-|grab)/, stylis.WEBKIT + "$1"), /(image-set)/, stylis.WEBKIT + "$1"), value, "") + value;
case 5495:
case 3959:
return stylis.replace(value, /(image-set\([^]*)/, stylis.WEBKIT + "$1$`$1");
case 4968:
return stylis.replace(stylis.replace(value, /(.+:)(flex-)?(.*)/, stylis.WEBKIT + "box-pack:$3" + stylis.MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + stylis.WEBKIT + value + value;
case 4095:
case 3583:
case 4068:
case 2532:
return stylis.replace(value, /(.+)-inline(.+)/, stylis.WEBKIT + "$1$2") + value;
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 (stylis.strlen(value) - 1 - length > 6)
switch (stylis.charat(value, length + 1)) {
case 109:
if (stylis.charat(value, length + 4) !== 45)
break;
case 102:
return stylis.replace(value, /(.+:)(.+)-([^]+)/, "$1" + stylis.WEBKIT + "$2-$3$1" + stylis.MOZ + (stylis.charat(value, length + 3) == 108 ? "$3" : "$2-$3")) + value;
case 115:
return ~stylis.indexof(value, "stretch") ? prefix2(stylis.replace(value, "stretch", "fill-available"), length) + value : value;
}
break;
case 4949:
if (stylis.charat(value, length + 1) !== 115)
break;
case 6444:
switch (stylis.charat(value, stylis.strlen(value) - 3 - (~stylis.indexof(value, "!important") && 10))) {
case 107:
return stylis.replace(value, ":", ":" + stylis.WEBKIT) + value;
case 101:
return stylis.replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + stylis.WEBKIT + (stylis.charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + stylis.WEBKIT + "$2$3$1" + stylis.MS + "$2box$3") + value;
}
break;
case 5936:
switch (stylis.charat(value, length + 11)) {
case 114:
return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
case 108:
return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
case 45:
return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
}
return stylis.WEBKIT + value + stylis.MS + value + value;
}
return value;
}
var prefixer = function prefixer2(element, index, children, callback) {
if (element.length > -1) {
if (!element["return"])
switch (element.type) {
case stylis.DECLARATION:
element["return"] = prefix2(element.value, element.length);
break;
case stylis.KEYFRAMES:
return stylis.serialize([stylis.copy(element, {
value: stylis.replace(element.value, "@", "@" + stylis.WEBKIT)
})], callback);
case stylis.RULESET:
if (element.length)
return stylis.combine(element.props, function(value) {
switch (stylis.match(value, /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
return stylis.serialize([stylis.copy(element, {
props: [stylis.replace(value, /:(read-\w+)/, ":" + stylis.MOZ + "$1")]
})], callback);
case "::placeholder":
return stylis.serialize([stylis.copy(element, {
props: [stylis.replace(value, /:(plac\w+)/, ":" + stylis.WEBKIT + "input-$1")]
}), stylis.copy(element, {
props: [stylis.replace(value, /:(plac\w+)/, ":" + stylis.MOZ + "$1")]
}), stylis.copy(element, {
props: [stylis.replace(value, /:(plac\w+)/, stylis.MS + "input-$1")]
})], callback);
}
return "";
});
}
}
};
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 = [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 insert2(selector, serialized, sheet2, shouldCache) {
currentSheet = sheet2;
if (serialized.map !== void 0) {
currentSheet = {
insert: function insert3(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/@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/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __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 Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment2 = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = 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 = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment2;
exports.Lazy = Lazy;
exports.Memo = Memo;
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_is = __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_development();
}
}
});
// 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_is();
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, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ((isStringTag === false || isBrowser === false && cache.compat !== void 0) && cache.registered[className] === void 0) {
cache.registered[className] = serialized.styles;
}
};
var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
registerStyles(cache, serialized, isStringTag);
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/react/node_modules/@emotion/hash/dist/emotion-hash.cjs.dev.js
var require_emotion_hash_cjs_dev = __commonJS({
"node_modules/@emotion/react/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/react/node_modules/@emotion/hash/dist/emotion-hash.cjs.js
var require_emotion_hash_cjs = __commonJS({
"node_modules/@emotion/react/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/react/node_modules/@emotion/unitless/dist/emotion-unitless.cjs.dev.js
var require_emotion_unitless_cjs_dev = __commonJS({
"node_modules/@emotion/react/node_modules/@emotion/unitless/dist/emotion-unitless.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var unitlessKeys = {
animationIterationCount: 1,
aspectRatio: 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/react/node_modules/@emotion/unitless/dist/emotion-unitless.cjs.js
var require_emotion_unitless_cjs = __commonJS({
"node_modules/@emotion/react/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/react/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js
var require_emotion_memoize_cjs_dev2 = __commonJS({
"node_modules/@emotion/react/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function memoize(fn2) {
var cache = /* @__PURE__ */ Object.create(null);
return function(arg) {
if (cache[arg] === void 0)
cache[arg] = fn2(arg);
return cache[arg];
};
}
exports["default"] = memoize;
}
});
// node_modules/@emotion/react/node_modules/@emotion/memoize/dist/emotion-memoize.cjs.js
var require_emotion_memoize_cjs2 = __commonJS({
"node_modules/@emotion/react/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_dev2();
}
}
});
// node_modules/@emotion/react/node_modules/@emotion/serialize/dist/emotion-serialize.cjs.dev.js
var require_emotion_serialize_cjs_dev = __commonJS({
"node_modules/@emotion/react/node_modules/@emotion/serialize/dist/emotion-serialize.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var hashString2 = require_emotion_hash_cjs();
var unitless = require_emotion_unitless_cjs();
var memoize = require_emotion_memoize_cjs2();
function _interopDefault(e) {
return e && e.__esModule ? e : { "default": e };
}
var hashString__default = /* @__PURE__ */ _interopDefault(hashString2);
var unitless__default = /* @__PURE__ */ _interopDefault(unitless);
var memoize__default = /* @__PURE__ */ _interopDefault(memoize);
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|element|(((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/react/node_modules/@emotion/serialize/dist/emotion-serialize.cjs.js
var require_emotion_serialize_cjs = __commonJS({
"node_modules/@emotion/react/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/react/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/react/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 React49 = 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(React49);
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 || React__namespace.useLayoutEffect;
exports.useInsertionEffectAlwaysWithSyncFallback = useInsertionEffectAlwaysWithSyncFallback;
exports.useInsertionEffectWithLayoutFallback = useInsertionEffectWithLayoutFallback;
}
});
// node_modules/@emotion/react/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/react/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-48d2c2e4.cjs.dev.js
var require_emotion_element_48d2c2e4_cjs_dev = __commonJS({
"node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js"(exports) {
"use strict";
var React49 = 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 serialize2 = require_emotion_serialize_cjs();
var useInsertionEffectWithFallbacks = require_emotion_use_insertion_effect_with_fallbacks_cjs();
function _interopDefault(e) {
return e && e.__esModule ? e : { "default": e };
}
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(React49);
var createCache__default = /* @__PURE__ */ _interopDefault(createCache);
var weakMemoize__default = /* @__PURE__ */ _interopDefault(weakMemoize);
var isBrowser = typeof document !== "undefined";
var hasOwnProperty = {}.hasOwnProperty;
var EmotionCacheContext = /* @__PURE__ */ React__namespace.createContext(
typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache__default["default"]({
key: "css"
}) : null
);
if (true) {
EmotionCacheContext.displayName = "EmotionCacheContext";
}
var CacheProvider2 = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache2 = function useEmotionCache() {
return React49.useContext(EmotionCacheContext);
};
exports.withEmotionCache = function withEmotionCache2(func) {
return /* @__PURE__ */ React49.forwardRef(function(props, ref) {
var cache = React49.useContext(EmotionCacheContext);
return func(props, cache, ref);
});
};
if (!isBrowser) {
exports.withEmotionCache = function withEmotionCache2(func) {
return function(props) {
var cache = React49.useContext(EmotionCacheContext);
if (cache === null) {
cache = createCache__default["default"]({
key: "css"
});
return /* @__PURE__ */ React__namespace.createElement(EmotionCacheContext.Provider, {
value: cache
}, func(props, cache));
} else {
return func(props, cache);
}
};
};
}
var ThemeContext2 = /* @__PURE__ */ React__namespace.createContext({});
if (true) {
ThemeContext2.displayName = "EmotionThemeContext";
}
var useTheme2 = function useTheme3() {
return React__namespace.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 ThemeProvider2 = function ThemeProvider3(props) {
var theme = React__namespace.useContext(ThemeContext2);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /* @__PURE__ */ React__namespace.createElement(ThemeContext2.Provider, {
value: theme
}, props.children);
};
function withTheme2(Component) {
var componentName = Component.displayName || Component.name || "Component";
var render = function render2(props, ref) {
var theme = React__namespace.useContext(ThemeContext2);
return /* @__PURE__ */ React__namespace.createElement(Component, _extends2({
theme,
ref
}, props));
};
var WithTheme = /* @__PURE__ */ React__namespace.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, isStringTag = _ref.isStringTag;
utils.registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function() {
return utils.insertStyles(cache, serialized, isStringTag);
});
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__ */ React__namespace.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 = serialize2.serializeStyles(registeredStyles, void 0, React__namespace.useContext(ThemeContext2));
if (serialized.name.indexOf("-") === -1) {
var labelFromStack = props[labelPropName];
if (labelFromStack) {
serialized = serialize2.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__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Insertion, {
cache,
serialized,
isStringTag: typeof WrappedComponent === "string"
}), /* @__PURE__ */ React__namespace.createElement(WrappedComponent, newProps));
});
if (true) {
Emotion.displayName = "EmotionCssPropInternal";
}
var Emotion$1 = Emotion;
exports.CacheProvider = CacheProvider2;
exports.Emotion = Emotion$1;
exports.ThemeContext = ThemeContext2;
exports.ThemeProvider = ThemeProvider2;
exports.__unsafe_useEmotionCache = __unsafe_useEmotionCache2;
exports.createEmotionProps = createEmotionProps;
exports.hasOwnProperty = hasOwnProperty;
exports.isBrowser = isBrowser;
exports.useTheme = useTheme2;
exports.withTheme = withTheme2;
}
});
// node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.dev.js
var require_emotion_react_jsx_runtime_cjs_dev = __commonJS({
"node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ReactJSXRuntime = require_jsx_runtime();
var emotionElement = require_emotion_element_48d2c2e4_cjs_dev();
require_react();
require_emotion_cache_cjs();
require_extends();
require_emotion_weak_memoize_cjs();
require_emotion_react_isolated_hnrs_cjs_dev();
require_hoist_non_react_statics_cjs();
require_emotion_utils_cjs();
require_emotion_serialize_cjs();
require_emotion_use_insertion_effect_with_fallbacks_cjs();
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 ReactJSXRuntime__namespace = /* @__PURE__ */ _interopNamespace(ReactJSXRuntime);
var Fragment2 = ReactJSXRuntime__namespace.Fragment;
function jsx3(type, props, key) {
if (!emotionElement.hasOwnProperty.call(props, "css")) {
return ReactJSXRuntime__namespace.jsx(type, props, key);
}
return ReactJSXRuntime__namespace.jsx(emotionElement.Emotion, emotionElement.createEmotionProps(type, props), key);
}
function jsxs2(type, props, key) {
if (!emotionElement.hasOwnProperty.call(props, "css")) {
return ReactJSXRuntime__namespace.jsxs(type, props, key);
}
return ReactJSXRuntime__namespace.jsxs(emotionElement.Emotion, emotionElement.createEmotionProps(type, props), key);
}
exports.Fragment = Fragment2;
exports.jsx = jsx3;
exports.jsxs = jsxs2;
}
});
// node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js
var require_emotion_react_jsx_runtime_cjs = __commonJS({
"node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"(exports, module2) {
"use strict";
if (false) {
module2.exports = null;
} else {
module2.exports = require_emotion_react_jsx_runtime_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 React49 = require_react();
var ReactSharedInternals = React49.__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 useState2 = React49.useState, useEffect2 = React49.useEffect, useLayoutEffect2 = React49.useLayoutEffect, useDebugValue2 = React49.useDebugValue;
var didWarnOld18Alpha = false;
var didWarnUncachedGetSnapshot = false;
function useSyncExternalStore3(subscribe2, getSnapshot, getServerSnapshot) {
{
if (!didWarnOld18Alpha) {
if (React49.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 = useState2({
inst: {
value,
getSnapshot
}
}), inst = _useState[0].inst, forceUpdate = _useState[1];
useLayoutEffect2(function() {
inst.value = value;
inst.getSnapshot = getSnapshot;
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
}, [subscribe2, value, getSnapshot]);
useEffect2(function() {
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
var handleStoreChange = function() {
if (checkIfSnapshotChanged(inst)) {
forceUpdate({
inst
});
}
};
return subscribe2(handleStoreChange);
}, [subscribe2]);
useDebugValue2(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(subscribe2, 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 = React49.useSyncExternalStore !== void 0 ? React49.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 React49 = 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 useRef3 = React49.useRef, useEffect2 = React49.useEffect, useMemo3 = React49.useMemo, useDebugValue2 = React49.useDebugValue;
function useSyncExternalStoreWithSelector3(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual) {
var instRef = useRef3(null);
var inst;
if (instRef.current === null) {
inst = {
hasValue: false,
value: null
};
instRef.current = inst;
} else {
inst = instRef.current;
}
var _useMemo = useMemo3(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(subscribe2, getSelection, getServerSelection);
useEffect2(function() {
inst.hasValue = true;
inst.value = value;
}, [value]);
useDebugValue2(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/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 Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment2 = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = 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 = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment2;
exports.Lazy = Lazy;
exports.Memo = Memo;
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/@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 emotionElement = require_emotion_element_48d2c2e4_cjs_dev();
var React49 = require_react();
var utils = require_emotion_utils_cjs();
var useInsertionEffectWithFallbacks = require_emotion_use_insertion_effect_with_fallbacks_cjs();
var serialize2 = require_emotion_serialize_cjs();
require_emotion_cache_cjs();
require_extends();
require_emotion_weak_memoize_cjs();
require_emotion_react_isolated_hnrs_cjs_dev();
require_hoist_non_react_statics_cjs();
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(React49);
var pkg = {
name: "@emotion/react",
version: "11.11.0",
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"
},
"import": "./dist/emotion-react.cjs.mjs",
"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"
},
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
"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"
},
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
"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"
},
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
"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": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
},
types: "types/index.d.ts",
files: [
"src",
"dist",
"jsx-runtime",
"jsx-dev-runtime",
"_isolated-hnrs",
"types/*.d.ts",
"macro.*"
],
sideEffects: false,
author: "Emotion Contributors",
license: "MIT",
scripts: {
"test:typescript": "dtslint types"
},
dependencies: {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.11.0",
"@emotion/cache": "^11.11.0",
"@emotion/serialize": "^1.1.2",
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
"@emotion/utils": "^1.2.1",
"@emotion/weak-memoize": "^0.3.1",
"hoist-non-react-statics": "^3.3.1"
},
peerDependencies: {
react: ">=16.8.0"
},
peerDependenciesMeta: {
"@types/react": {
optional: true
}
},
devDependencies: {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.11.0",
"@emotion/css-prettifier": "1.1.3",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.11.0",
"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": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
}
}
}
};
var jsx3 = function jsx4(type, props) {
var args = arguments;
if (props == null || !emotionElement.hasOwnProperty.call(props, "css")) {
return React__namespace.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 React__namespace.createElement.apply(null, createElementArgArray);
};
var warnedAboutCssPropForGlobal = false;
var Global2 = /* @__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 = serialize2.serializeStyles([styles], void 0, React__namespace.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__ */ React__namespace.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
__html: rules
}, _ref.nonce = cache.sheet.nonce, _ref));
}
var sheetRef = React__namespace.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) {
Global2.displayName = "EmotionGlobal";
}
function css2() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serialize2.serializeStyles(args);
}
var keyframes2 = function keyframes3() {
var insertable = css2.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, css3, className) {
var registeredStyles = [];
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css3(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__ */ React__namespace.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 ClassNames2 = /* @__PURE__ */ emotionElement.withEmotionCache(function(props, cache) {
var hasRendered = false;
var serializedArr = [];
var css3 = function css4() {
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 = serialize2.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, css3, classnames(args));
};
var content = {
css: css3,
cx,
theme: React__namespace.useContext(emotionElement.ThemeContext)
};
var ele = props.children(content);
hasRendered = true;
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Insertion, {
cache,
serializedArr
}), ele);
});
if (true) {
ClassNames2.displayName = "EmotionClassNames";
}
if (true) {
isBrowser = typeof document !== "undefined";
isTestEnv = typeof jest !== "undefined" || typeof vi !== "undefined";
if (isBrowser && !isTestEnv) {
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 isTestEnv;
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 = ClassNames2;
exports.Global = Global2;
exports.createElement = jsx3;
exports.css = css2;
exports.jsx = jsx3;
exports.keyframes = keyframes2;
}
});
// 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/react-select/node_modules/@babel/runtime/helpers/typeof.js
var require_typeof = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/typeof.js"(exports, module2) {
function _typeof(obj) {
"@babel/helpers - typeof";
return module2.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports, _typeof(obj);
}
module2.exports = _typeof, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/toPrimitive.js
var require_toPrimitive = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/toPrimitive.js"(exports, module2) {
var _typeof = require_typeof()["default"];
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module2.exports = _toPrimitive, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/toPropertyKey.js
var require_toPropertyKey = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports, module2) {
var _typeof = require_typeof()["default"];
var toPrimitive = require_toPrimitive();
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module2.exports = _toPropertyKey, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/defineProperty.js
var require_defineProperty = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module2) {
var toPropertyKey = require_toPropertyKey();
function _defineProperty2(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module2.exports = _defineProperty2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/objectSpread2.js
var require_objectSpread2 = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/objectSpread2.js"(exports, module2) {
var defineProperty = require_defineProperty();
function ownKeys2(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 _objectSpread22(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
defineProperty(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
module2.exports = _objectSpread22, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithHoles.js
var require_arrayWithHoles = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithHoles.js"(exports, module2) {
function _arrayWithHoles(arr) {
if (Array.isArray(arr))
return arr;
}
module2.exports = _arrayWithHoles, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js
var require_iterableToArrayLimit = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"(exports, module2) {
function _iterableToArrayLimit(arr, i2) {
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
if (null != _i) {
var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
try {
if (_x = (_i = _i.call(arr)).next, 0 === i2) {
if (Object(_i) !== _i)
return;
_n = false;
} else
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i2); _n = true)
;
} catch (err) {
_d = true, _e = err;
} finally {
try {
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r))
return;
} finally {
if (_d)
throw _e;
}
}
return _arr;
}
}
module2.exports = _iterableToArrayLimit, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/arrayLikeToArray.js
var require_arrayLikeToArray = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/arrayLikeToArray.js"(exports, module2) {
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;
}
module2.exports = _arrayLikeToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
var require_unsupportedIterableToArray = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"(exports, module2) {
var arrayLikeToArray = require_arrayLikeToArray();
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);
}
module2.exports = _unsupportedIterableToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableRest.js
var require_nonIterableRest = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableRest.js"(exports, module2) {
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.");
}
module2.exports = _nonIterableRest, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/slicedToArray.js
var require_slicedToArray = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/slicedToArray.js"(exports, module2) {
var arrayWithHoles = require_arrayWithHoles();
var iterableToArrayLimit = require_iterableToArrayLimit();
var unsupportedIterableToArray = require_unsupportedIterableToArray();
var nonIterableRest = require_nonIterableRest();
function _slicedToArray(arr, i2) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i2) || unsupportedIterableToArray(arr, i2) || nonIterableRest();
}
module2.exports = _slicedToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
var require_objectWithoutPropertiesLoose = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module2) {
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;
}
module2.exports = _objectWithoutPropertiesLoose2, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutProperties.js
var require_objectWithoutProperties = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"(exports, module2) {
var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose();
function _objectWithoutProperties(source, excluded) {
if (source == null)
return {};
var target = objectWithoutPropertiesLoose(source, excluded);
var key, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key = sourceSymbolKeys[i2];
if (excluded.indexOf(key) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key))
continue;
target[key] = source[key];
}
}
return target;
}
module2.exports = _objectWithoutProperties, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/dist/useStateManager-7748b351.cjs.dev.js
var require_useStateManager_7748b351_cjs_dev = __commonJS({
"node_modules/react-select/dist/useStateManager-7748b351.cjs.dev.js"(exports) {
"use strict";
var _objectSpread = require_objectSpread2();
var _slicedToArray = require_slicedToArray();
var _objectWithoutProperties = require_objectWithoutProperties();
var React49 = require_react();
var _excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
function useStateManager(_ref) {
var _ref$defaultInputValu = _ref.defaultInputValue, defaultInputValue = _ref$defaultInputValu === void 0 ? "" : _ref$defaultInputValu, _ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen, defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe, _ref$defaultValue = _ref.defaultValue, defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue, propsInputValue = _ref.inputValue, propsMenuIsOpen = _ref.menuIsOpen, propsOnChange = _ref.onChange, propsOnInputChange = _ref.onInputChange, propsOnMenuClose = _ref.onMenuClose, propsOnMenuOpen = _ref.onMenuOpen, propsValue = _ref.value, restSelectProps = _objectWithoutProperties(_ref, _excluded);
var _useState = React49.useState(propsInputValue !== void 0 ? propsInputValue : defaultInputValue), _useState2 = _slicedToArray(_useState, 2), stateInputValue = _useState2[0], setStateInputValue = _useState2[1];
var _useState3 = React49.useState(propsMenuIsOpen !== void 0 ? propsMenuIsOpen : defaultMenuIsOpen), _useState4 = _slicedToArray(_useState3, 2), stateMenuIsOpen = _useState4[0], setStateMenuIsOpen = _useState4[1];
var _useState5 = React49.useState(propsValue !== void 0 ? propsValue : defaultValue), _useState6 = _slicedToArray(_useState5, 2), stateValue = _useState6[0], setStateValue = _useState6[1];
var onChange = React49.useCallback(function(value2, actionMeta) {
if (typeof propsOnChange === "function") {
propsOnChange(value2, actionMeta);
}
setStateValue(value2);
}, [propsOnChange]);
var onInputChange = React49.useCallback(function(value2, actionMeta) {
var newValue;
if (typeof propsOnInputChange === "function") {
newValue = propsOnInputChange(value2, actionMeta);
}
setStateInputValue(newValue !== void 0 ? newValue : value2);
}, [propsOnInputChange]);
var onMenuOpen = React49.useCallback(function() {
if (typeof propsOnMenuOpen === "function") {
propsOnMenuOpen();
}
setStateMenuIsOpen(true);
}, [propsOnMenuOpen]);
var onMenuClose = React49.useCallback(function() {
if (typeof propsOnMenuClose === "function") {
propsOnMenuClose();
}
setStateMenuIsOpen(false);
}, [propsOnMenuClose]);
var inputValue = propsInputValue !== void 0 ? propsInputValue : stateInputValue;
var menuIsOpen = propsMenuIsOpen !== void 0 ? propsMenuIsOpen : stateMenuIsOpen;
var value = propsValue !== void 0 ? propsValue : stateValue;
return _objectSpread(_objectSpread({}, restSelectProps), {}, {
inputValue,
menuIsOpen,
onChange,
onInputChange,
onMenuClose,
onMenuOpen,
value
});
}
exports.useStateManager = useStateManager;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/extends.js
var require_extends2 = __commonJS({
"node_modules/react-select/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/react-select/node_modules/@babel/runtime/helpers/classCallCheck.js
var require_classCallCheck = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/classCallCheck.js"(exports, module2) {
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
module2.exports = _classCallCheck, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/createClass.js
var require_createClass = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/createClass.js"(exports, module2) {
var toPropertyKey = require_toPropertyKey();
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, toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
module2.exports = _createClass, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/setPrototypeOf.js
var require_setPrototypeOf = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/setPrototypeOf.js"(exports, module2) {
function _setPrototypeOf(o2, p2) {
module2.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p3) {
o3.__proto__ = p3;
return o3;
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
return _setPrototypeOf(o2, p2);
}
module2.exports = _setPrototypeOf, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/inherits.js
var require_inherits = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/inherits.js"(exports, module2) {
var setPrototypeOf = require_setPrototypeOf();
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
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass)
setPrototypeOf(subClass, superClass);
}
module2.exports = _inherits, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/getPrototypeOf.js
var require_getPrototypeOf = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/getPrototypeOf.js"(exports, module2) {
function _getPrototypeOf(o2) {
module2.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
}, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
return _getPrototypeOf(o2);
}
module2.exports = _getPrototypeOf, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js
var require_isNativeReflectConstruct = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js"(exports, module2) {
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;
}
}
module2.exports = _isNativeReflectConstruct, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/assertThisInitialized.js
var require_assertThisInitialized = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/assertThisInitialized.js"(exports, module2) {
function _assertThisInitialized(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
module2.exports = _assertThisInitialized, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
var require_possibleConstructorReturn = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"(exports, module2) {
var _typeof = require_typeof()["default"];
var assertThisInitialized = require_assertThisInitialized();
function _possibleConstructorReturn(self2, call2) {
if (call2 && (_typeof(call2) === "object" || typeof call2 === "function")) {
return call2;
} else if (call2 !== void 0) {
throw new TypeError("Derived constructors may only return object or undefined");
}
return assertThisInitialized(self2);
}
module2.exports = _possibleConstructorReturn, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/createSuper.js
var require_createSuper = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/createSuper.js"(exports, module2) {
var getPrototypeOf = require_getPrototypeOf();
var isNativeReflectConstruct = require_isNativeReflectConstruct();
var possibleConstructorReturn = require_possibleConstructorReturn();
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);
};
}
module2.exports = _createSuper, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
var require_arrayWithoutHoles = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"(exports, module2) {
var arrayLikeToArray = require_arrayLikeToArray();
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr))
return arrayLikeToArray(arr);
}
module2.exports = _arrayWithoutHoles, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArray.js
var require_iterableToArray = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/iterableToArray.js"(exports, module2) {
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
module2.exports = _iterableToArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableSpread.js
var require_nonIterableSpread = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/nonIterableSpread.js"(exports, module2) {
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module2.exports = _nonIterableSpread, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/toConsumableArray.js
var require_toConsumableArray = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/toConsumableArray.js"(exports, module2) {
var arrayWithoutHoles = require_arrayWithoutHoles();
var iterableToArray = require_iterableToArray();
var unsupportedIterableToArray = require_unsupportedIterableToArray();
var nonIterableSpread = require_nonIterableSpread();
function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
}
module2.exports = _toConsumableArray, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/react-select/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js
var require_taggedTemplateLiteral = __commonJS({
"node_modules/react-select/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js"(exports, module2) {
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
}
module2.exports = _taggedTemplateLiteral, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
}
});
// node_modules/@floating-ui/core/dist/floating-ui.core.umd.js
var require_floating_ui_core_umd = __commonJS({
"node_modules/@floating-ui/core/dist/floating-ui.core.umd.js"(exports, module2) {
(function(global2, factory) {
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.FloatingUICore = {}));
})(exports, function(exports2) {
"use strict";
function getAlignment(placement) {
return placement.split("-")[1];
}
function getLengthFromAxis(axis) {
return axis === "y" ? "height" : "width";
}
function getSide(placement) {
return placement.split("-")[0];
}
function getMainAxisFromPlacement(placement) {
return ["top", "bottom"].includes(getSide(placement)) ? "x" : "y";
}
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height / 2;
const mainAxis = getMainAxisFromPlacement(placement);
const length = getLengthFromAxis(mainAxis);
const commonAlign = reference[length] / 2 - floating[length] / 2;
const side = getSide(placement);
const isVertical = mainAxis === "x";
let coords;
switch (side) {
case "top":
coords = {
x: commonX,
y: reference.y - floating.height
};
break;
case "bottom":
coords = {
x: commonX,
y: reference.y + reference.height
};
break;
case "right":
coords = {
x: reference.x + reference.width,
y: commonY
};
break;
case "left":
coords = {
x: reference.x - floating.width,
y: commonY
};
break;
default:
coords = {
x: reference.x,
y: reference.y
};
}
switch (getAlignment(placement)) {
case "start":
coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
break;
case "end":
coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
break;
}
return coords;
}
const computePosition = (reference, floating, config) => __async(this, null, function* () {
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform
} = config;
const validMiddleware = middleware.filter(Boolean);
const rtl = yield platform.isRTL == null ? void 0 : platform.isRTL(floating);
let rects = yield platform.getElementRects({
reference,
floating,
strategy
});
let {
x: x2,
y: y2
} = computeCoordsFromPlacement(rects, placement, rtl);
let statefulPlacement = placement;
let middlewareData = {};
let resetCount = 0;
for (let i2 = 0; i2 < validMiddleware.length; i2++) {
const {
name,
fn: fn2
} = validMiddleware[i2];
const {
x: nextX,
y: nextY,
data,
reset: reset2
} = yield fn2({
x: x2,
y: y2,
initialPlacement: placement,
placement: statefulPlacement,
strategy,
middlewareData,
rects,
platform,
elements: {
reference,
floating
}
});
x2 = nextX != null ? nextX : x2;
y2 = nextY != null ? nextY : y2;
middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
[name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
});
if (reset2 && resetCount <= 50) {
resetCount++;
if (typeof reset2 === "object") {
if (reset2.placement) {
statefulPlacement = reset2.placement;
}
if (reset2.rects) {
rects = reset2.rects === true ? yield platform.getElementRects({
reference,
floating,
strategy
}) : reset2.rects;
}
({
x: x2,
y: y2
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
}
i2 = -1;
continue;
}
}
return {
x: x2,
y: y2,
placement: statefulPlacement,
strategy,
middlewareData
};
});
function expandPaddingObject(padding) {
return __spreadValues({
top: 0,
right: 0,
bottom: 0,
left: 0
}, padding);
}
function getSideObjectFromPadding(padding) {
return typeof padding !== "number" ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
return __spreadProps(__spreadValues({}, rect), {
top: rect.y,
left: rect.x,
right: rect.x + rect.width,
bottom: rect.y + rect.height
});
}
function detectOverflow(state, options) {
return __async(this, null, function* () {
var _await$platform$isEle;
if (options === void 0) {
options = {};
}
const {
x: x2,
y: y2,
platform,
rects,
elements,
strategy
} = state;
const {
boundary = "clippingAncestors",
rootBoundary = "viewport",
elementContext = "floating",
altBoundary = false,
padding = 0
} = options;
const paddingObject = getSideObjectFromPadding(padding);
const altContext = elementContext === "floating" ? "reference" : "floating";
const element = elements[altBoundary ? altContext : elementContext];
const clippingClientRect = rectToClientRect(yield platform.getClippingRect({
element: ((_await$platform$isEle = yield platform.isElement == null ? void 0 : platform.isElement(element)) != null ? _await$platform$isEle : true) ? element : element.contextElement || (yield platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
boundary,
rootBoundary,
strategy
}));
const rect = elementContext === "floating" ? __spreadProps(__spreadValues({}, rects.floating), {
x: x2,
y: y2
}) : rects.reference;
const offsetParent = yield platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating);
const offsetScale = (yield platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? (yield platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
};
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? yield platform.convertOffsetParentRelativeRectToViewportRelativeRect({
rect,
offsetParent,
strategy
}) : rect);
return {
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
};
});
}
const min2 = Math.min;
const max2 = Math.max;
function within(min$1, value, max$1) {
return max2(min$1, min2(value, max$1));
}
const arrow = (options) => ({
name: "arrow",
options,
fn(state) {
return __async(this, null, function* () {
const {
element,
padding = 0
} = options || {};
const {
x: x2,
y: y2,
placement,
rects,
platform,
elements
} = state;
if (element == null) {
return {};
}
const paddingObject = getSideObjectFromPadding(padding);
const coords = {
x: x2,
y: y2
};
const axis = getMainAxisFromPlacement(placement);
const length = getLengthFromAxis(axis);
const arrowDimensions = yield platform.getDimensions(element);
const isYAxis = axis === "y";
const minProp = isYAxis ? "top" : "left";
const maxProp = isYAxis ? "bottom" : "right";
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
const startDiff = coords[axis] - rects.reference[axis];
const arrowOffsetParent = yield platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element);
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
if (!clientSize || !(yield platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
clientSize = elements.floating[clientProp] || rects.floating[length];
}
const centerToReference = endDiff / 2 - startDiff / 2;
const min3 = paddingObject[minProp];
const max3 = clientSize - arrowDimensions[length] - paddingObject[maxProp];
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
const offset2 = within(min3, center, max3);
const shouldAddOffset = getAlignment(placement) != null && center != offset2 && rects.reference[length] / 2 - (center < min3 ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;
const alignmentOffset = shouldAddOffset ? center < min3 ? min3 - center : max3 - center : 0;
return {
[axis]: coords[axis] - alignmentOffset,
data: {
[axis]: offset2,
centerOffset: center - offset2
}
};
});
}
});
const sides = ["top", "right", "bottom", "left"];
const allPlacements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
const oppositeSideMap = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const mainAxis = getMainAxisFromPlacement(placement);
const length = getLengthFromAxis(mainAxis);
let mainAlignmentSide = mainAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return {
main: mainAlignmentSide,
cross: getOppositePlacement(mainAlignmentSide)
};
}
const oppositeAlignmentMap = {
start: "end",
end: "start"
};
function getOppositeAlignmentPlacement(placement) {
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
}
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement);
return allowedPlacementsSortedByAlignment.filter((placement) => {
if (alignment) {
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
}
return true;
});
}
const autoPlacement = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "autoPlacement",
options,
fn(state) {
return __async(this, null, function* () {
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
const {
rects,
middlewareData,
placement,
platform,
elements
} = state;
const _a2 = options, {
crossAxis = false,
alignment,
allowedPlacements = allPlacements,
autoAlignment = true
} = _a2, detectOverflowOptions = __objRest(_a2, [
"crossAxis",
"alignment",
"allowedPlacements",
"autoAlignment"
]);
const placements = alignment !== void 0 || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
const overflow = yield detectOverflow(state, detectOverflowOptions);
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
const currentPlacement = placements[currentIndex];
if (currentPlacement == null) {
return {};
}
const {
main,
cross
} = getAlignmentSides(currentPlacement, rects, yield platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
if (placement !== currentPlacement) {
return {
reset: {
placement: placements[0]
}
};
}
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];
const allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
placement: currentPlacement,
overflows: currentOverflows
}];
const nextPlacement = placements[currentIndex + 1];
if (nextPlacement) {
return {
data: {
index: currentIndex + 1,
overflows: allOverflows
},
reset: {
placement: nextPlacement
}
};
}
const placementsSortedByMostSpace = allOverflows.map((d2) => {
const alignment2 = getAlignment(d2.placement);
return [d2.placement, alignment2 && crossAxis ? d2.overflows.slice(0, 2).reduce((acc, v2) => acc + v2, 0) : d2.overflows[0], d2.overflows];
}).sort((a2, b2) => a2[1] - b2[1]);
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter((d2) => d2[2].slice(
0,
getAlignment(d2[0]) ? 2 : 3
).every((v2) => v2 <= 0));
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
if (resetPlacement !== placement) {
return {
data: {
index: currentIndex + 1,
overflows: allOverflows
},
reset: {
placement: resetPlacement
}
};
}
return {};
});
}
};
};
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getSideList(side, isStart, rtl) {
const lr = ["left", "right"];
const rl = ["right", "left"];
const tb = ["top", "bottom"];
const bt = ["bottom", "top"];
switch (side) {
case "top":
case "bottom":
if (rtl)
return isStart ? rl : lr;
return isStart ? lr : rl;
case "left":
case "right":
return isStart ? tb : bt;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction === "start", rtl);
if (alignment) {
list = list.map((side) => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
const flip = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "flip",
options,
fn(state) {
return __async(this, null, function* () {
var _middlewareData$flip;
const {
placement,
middlewareData,
rects,
initialPlacement,
platform,
elements
} = state;
const _a2 = options, {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true,
fallbackPlacements: specifiedFallbackPlacements,
fallbackStrategy = "bestFit",
fallbackAxisSideDirection = "none",
flipAlignment = true
} = _a2, detectOverflowOptions = __objRest(_a2, [
"mainAxis",
"crossAxis",
"fallbackPlacements",
"fallbackStrategy",
"fallbackAxisSideDirection",
"flipAlignment"
]);
const side = getSide(placement);
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
const rtl = yield platform.isRTL == null ? void 0 : platform.isRTL(elements.floating);
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
}
const placements = [initialPlacement, ...fallbackPlacements];
const overflow = yield detectOverflow(state, detectOverflowOptions);
const overflows = [];
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
if (checkMainAxis) {
overflows.push(overflow[side]);
}
if (checkCrossAxis) {
const {
main,
cross
} = getAlignmentSides(placement, rects, rtl);
overflows.push(overflow[main], overflow[cross]);
}
overflowsData = [...overflowsData, {
placement,
overflows
}];
if (!overflows.every((side2) => side2 <= 0)) {
var _middlewareData$flip2, _overflowsData$filter;
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
const nextPlacement = placements[nextIndex];
if (nextPlacement) {
return {
data: {
index: nextIndex,
overflows: overflowsData
},
reset: {
placement: nextPlacement
}
};
}
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
if (!resetPlacement) {
switch (fallbackStrategy) {
case "bestFit": {
var _overflowsData$map$so;
const placement2 = (_overflowsData$map$so = overflowsData.map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
if (placement2) {
resetPlacement = placement2;
}
break;
}
case "initialPlacement":
resetPlacement = initialPlacement;
break;
}
}
if (placement !== resetPlacement) {
return {
reset: {
placement: resetPlacement
}
};
}
}
return {};
});
}
};
};
function getSideOffsets(overflow, rect) {
return {
top: overflow.top - rect.height,
right: overflow.right - rect.width,
bottom: overflow.bottom - rect.height,
left: overflow.left - rect.width
};
}
function isAnySideFullyClipped(overflow) {
return sides.some((side) => overflow[side] >= 0);
}
const hide = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "hide",
options,
fn(state) {
return __async(this, null, function* () {
const _a2 = options, {
strategy = "referenceHidden"
} = _a2, detectOverflowOptions = __objRest(_a2, [
"strategy"
]);
const {
rects
} = state;
switch (strategy) {
case "referenceHidden": {
const overflow = yield detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
elementContext: "reference"
}));
const offsets = getSideOffsets(overflow, rects.reference);
return {
data: {
referenceHiddenOffsets: offsets,
referenceHidden: isAnySideFullyClipped(offsets)
}
};
}
case "escaped": {
const overflow = yield detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
altBoundary: true
}));
const offsets = getSideOffsets(overflow, rects.floating);
return {
data: {
escapedOffsets: offsets,
escaped: isAnySideFullyClipped(offsets)
}
};
}
default: {
return {};
}
}
});
}
};
};
function getBoundingRect(rects) {
const minX = min2(...rects.map((rect) => rect.left));
const minY = min2(...rects.map((rect) => rect.top));
const maxX = max2(...rects.map((rect) => rect.right));
const maxY = max2(...rects.map((rect) => rect.bottom));
return {
x: minX,
y: minY,
width: maxX - minX,
height: maxY - minY
};
}
function getRectsByLine(rects) {
const sortedRects = rects.slice().sort((a2, b2) => a2.y - b2.y);
const groups = [];
let prevRect = null;
for (let i2 = 0; i2 < sortedRects.length; i2++) {
const rect = sortedRects[i2];
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
groups.push([rect]);
} else {
groups[groups.length - 1].push(rect);
}
prevRect = rect;
}
return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
}
const inline = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "inline",
options,
fn(state) {
return __async(this, null, function* () {
const {
placement,
elements,
rects,
platform,
strategy
} = state;
const {
padding = 2,
x: x2,
y: y2
} = options;
const nativeClientRects = Array.from((yield platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference)) || []);
const clientRects = getRectsByLine(nativeClientRects);
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
const paddingObject = getSideObjectFromPadding(padding);
function getBoundingClientRect() {
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x2 != null && y2 != null) {
return clientRects.find((rect) => x2 > rect.left - paddingObject.left && x2 < rect.right + paddingObject.right && y2 > rect.top - paddingObject.top && y2 < rect.bottom + paddingObject.bottom) || fallback;
}
if (clientRects.length >= 2) {
if (getMainAxisFromPlacement(placement) === "x") {
const firstRect = clientRects[0];
const lastRect = clientRects[clientRects.length - 1];
const isTop = getSide(placement) === "top";
const top2 = firstRect.top;
const bottom2 = lastRect.bottom;
const left2 = isTop ? firstRect.left : lastRect.left;
const right2 = isTop ? firstRect.right : lastRect.right;
const width2 = right2 - left2;
const height2 = bottom2 - top2;
return {
top: top2,
bottom: bottom2,
left: left2,
right: right2,
width: width2,
height: height2,
x: left2,
y: top2
};
}
const isLeftSide = getSide(placement) === "left";
const maxRight = max2(...clientRects.map((rect) => rect.right));
const minLeft = min2(...clientRects.map((rect) => rect.left));
const measureRects = clientRects.filter((rect) => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
const top = measureRects[0].top;
const bottom = measureRects[measureRects.length - 1].bottom;
const left = minLeft;
const right = maxRight;
const width = right - left;
const height = bottom - top;
return {
top,
bottom,
left,
right,
width,
height,
x: left,
y: top
};
}
return fallback;
}
const resetRects = yield platform.getElementRects({
reference: {
getBoundingClientRect
},
floating: elements.floating,
strategy
});
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
return {
reset: {
rects: resetRects
}
};
}
return {};
});
}
};
};
function convertValueToCoords(state, value) {
return __async(this, null, function* () {
const {
placement,
platform,
elements
} = state;
const rtl = yield platform.isRTL == null ? void 0 : platform.isRTL(elements.floating);
const side = getSide(placement);
const alignment = getAlignment(placement);
const isVertical = getMainAxisFromPlacement(placement) === "x";
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
const crossAxisMulti = rtl && isVertical ? -1 : 1;
const rawValue = typeof value === "function" ? value(state) : value;
let {
mainAxis,
crossAxis,
alignmentAxis
} = typeof rawValue === "number" ? {
mainAxis: rawValue,
crossAxis: 0,
alignmentAxis: null
} : __spreadValues({
mainAxis: 0,
crossAxis: 0,
alignmentAxis: null
}, rawValue);
if (alignment && typeof alignmentAxis === "number") {
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
}
return isVertical ? {
x: crossAxis * crossAxisMulti,
y: mainAxis * mainAxisMulti
} : {
x: mainAxis * mainAxisMulti,
y: crossAxis * crossAxisMulti
};
});
}
const offset = function(value) {
if (value === void 0) {
value = 0;
}
return {
name: "offset",
options: value,
fn(state) {
return __async(this, null, function* () {
const {
x: x2,
y: y2
} = state;
const diffCoords = yield convertValueToCoords(state, value);
return {
x: x2 + diffCoords.x,
y: y2 + diffCoords.y,
data: diffCoords
};
});
}
};
};
function getCrossAxis(axis) {
return axis === "x" ? "y" : "x";
}
const shift = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "shift",
options,
fn(state) {
return __async(this, null, function* () {
const {
x: x2,
y: y2,
placement
} = state;
const _a2 = options, {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = false,
limiter = {
fn: (_ref) => {
let {
x: x3,
y: y3
} = _ref;
return {
x: x3,
y: y3
};
}
}
} = _a2, detectOverflowOptions = __objRest(_a2, [
"mainAxis",
"crossAxis",
"limiter"
]);
const coords = {
x: x2,
y: y2
};
const overflow = yield detectOverflow(state, detectOverflowOptions);
const mainAxis = getMainAxisFromPlacement(getSide(placement));
const crossAxis = getCrossAxis(mainAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
if (checkMainAxis) {
const minSide = mainAxis === "y" ? "top" : "left";
const maxSide = mainAxis === "y" ? "bottom" : "right";
const min3 = mainAxisCoord + overflow[minSide];
const max3 = mainAxisCoord - overflow[maxSide];
mainAxisCoord = within(min3, mainAxisCoord, max3);
}
if (checkCrossAxis) {
const minSide = crossAxis === "y" ? "top" : "left";
const maxSide = crossAxis === "y" ? "bottom" : "right";
const min3 = crossAxisCoord + overflow[minSide];
const max3 = crossAxisCoord - overflow[maxSide];
crossAxisCoord = within(min3, crossAxisCoord, max3);
}
const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), {
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
}));
return __spreadProps(__spreadValues({}, limitedCoords), {
data: {
x: limitedCoords.x - x2,
y: limitedCoords.y - y2
}
});
});
}
};
};
const limitShift = function(options) {
if (options === void 0) {
options = {};
}
return {
options,
fn(state) {
const {
x: x2,
y: y2,
placement,
rects,
middlewareData
} = state;
const {
offset: offset2 = 0,
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true
} = options;
const coords = {
x: x2,
y: y2
};
const mainAxis = getMainAxisFromPlacement(placement);
const crossAxis = getCrossAxis(mainAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const rawOffset = typeof offset2 === "function" ? offset2(state) : offset2;
const computedOffset = typeof rawOffset === "number" ? {
mainAxis: rawOffset,
crossAxis: 0
} : __spreadValues({
mainAxis: 0,
crossAxis: 0
}, rawOffset);
if (checkMainAxis) {
const len = mainAxis === "y" ? "height" : "width";
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
if (mainAxisCoord < limitMin) {
mainAxisCoord = limitMin;
} else if (mainAxisCoord > limitMax) {
mainAxisCoord = limitMax;
}
}
if (checkCrossAxis) {
var _middlewareData$offse, _middlewareData$offse2;
const len = mainAxis === "y" ? "width" : "height";
const isOriginSide = ["top", "left"].includes(getSide(placement));
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
if (crossAxisCoord < limitMin) {
crossAxisCoord = limitMin;
} else if (crossAxisCoord > limitMax) {
crossAxisCoord = limitMax;
}
}
return {
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
};
}
};
};
const size = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "size",
options,
fn(state) {
return __async(this, null, function* () {
const {
placement,
rects,
platform,
elements
} = state;
const _a2 = options, {
apply = () => {
}
} = _a2, detectOverflowOptions = __objRest(_a2, [
"apply"
]);
const overflow = yield detectOverflow(state, detectOverflowOptions);
const side = getSide(placement);
const alignment = getAlignment(placement);
const axis = getMainAxisFromPlacement(placement);
const isXAxis = axis === "x";
const {
width,
height
} = rects.floating;
let heightSide;
let widthSide;
if (side === "top" || side === "bottom") {
heightSide = side;
widthSide = alignment === ((yield platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
} else {
widthSide = side;
heightSide = alignment === "end" ? "top" : "bottom";
}
const overflowAvailableHeight = height - overflow[heightSide];
const overflowAvailableWidth = width - overflow[widthSide];
const noShift = !state.middlewareData.shift;
let availableHeight = overflowAvailableHeight;
let availableWidth = overflowAvailableWidth;
if (isXAxis) {
const maximumClippingWidth = width - overflow.left - overflow.right;
availableWidth = alignment || noShift ? min2(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
} else {
const maximumClippingHeight = height - overflow.top - overflow.bottom;
availableHeight = alignment || noShift ? min2(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
}
if (noShift && !alignment) {
const xMin = max2(overflow.left, 0);
const xMax = max2(overflow.right, 0);
const yMin = max2(overflow.top, 0);
const yMax = max2(overflow.bottom, 0);
if (isXAxis) {
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max2(overflow.left, overflow.right));
} else {
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max2(overflow.top, overflow.bottom));
}
}
yield apply(__spreadProps(__spreadValues({}, state), {
availableWidth,
availableHeight
}));
const nextDimensions = yield platform.getDimensions(elements.floating);
if (width !== nextDimensions.width || height !== nextDimensions.height) {
return {
reset: {
rects: true
}
};
}
return {};
});
}
};
};
exports2.arrow = arrow;
exports2.autoPlacement = autoPlacement;
exports2.computePosition = computePosition;
exports2.detectOverflow = detectOverflow;
exports2.flip = flip;
exports2.hide = hide;
exports2.inline = inline;
exports2.limitShift = limitShift;
exports2.offset = offset;
exports2.rectToClientRect = rectToClientRect;
exports2.shift = shift;
exports2.size = size;
Object.defineProperty(exports2, "__esModule", { value: true });
});
}
});
// node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js
var require_floating_ui_dom_umd = __commonJS({
"node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js"(exports, module2) {
(function(global2, factory) {
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports, require_floating_ui_core_umd()) : typeof define === "function" && define.amd ? define(["exports", "@floating-ui/core"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.FloatingUIDOM = {}, global2.FloatingUICore));
})(exports, function(exports2, core) {
"use strict";
function getWindow(node) {
var _node$ownerDocument;
return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getComputedStyle$1(element) {
return getWindow(element).getComputedStyle(element);
}
function isNode(value) {
return value instanceof getWindow(value).Node;
}
function getNodeName(node) {
return isNode(node) ? (node.nodeName || "").toLowerCase() : "";
}
let uaString;
function getUAString() {
if (uaString) {
return uaString;
}
const uaData = navigator.userAgentData;
if (uaData && Array.isArray(uaData.brands)) {
uaString = uaData.brands.map((item) => item.brand + "/" + item.version).join(" ");
return uaString;
}
return navigator.userAgent;
}
function isHTMLElement(value) {
return value instanceof getWindow(value).HTMLElement;
}
function isElement(value) {
return value instanceof getWindow(value).Element;
}
function isShadowRoot(node) {
if (typeof ShadowRoot === "undefined") {
return false;
}
const OwnElement = getWindow(node).ShadowRoot;
return node instanceof OwnElement || node instanceof ShadowRoot;
}
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = getComputedStyle$1(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
}
function isTableElement(element) {
return ["table", "td", "th"].includes(getNodeName(element));
}
function isContainingBlock(element) {
const isFirefox = /firefox/i.test(getUAString());
const css2 = getComputedStyle$1(element);
const backdropFilter = css2.backdropFilter || css2.WebkitBackdropFilter;
return css2.transform !== "none" || css2.perspective !== "none" || (backdropFilter ? backdropFilter !== "none" : false) || isFirefox && css2.willChange === "filter" || isFirefox && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective"].some((value) => css2.willChange.includes(value)) || ["paint", "layout", "strict", "content"].some((value) => {
const contain = css2.contain;
return contain != null ? contain.includes(value) : false;
});
}
function isClientRectVisualViewportBased() {
return /^((?!chrome|android).)*safari/i.test(getUAString());
}
function isLastTraversableNode(node) {
return ["html", "body", "#document"].includes(getNodeName(node));
}
const min2 = Math.min;
const max2 = Math.max;
const round2 = Math.round;
function getCssDimensions(element) {
const css2 = getComputedStyle$1(element);
let width = parseFloat(css2.width);
let height = parseFloat(css2.height);
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round2(width) !== offsetWidth || round2(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height,
fallback: shouldFallback
};
}
function unwrapElement(element) {
return !isElement(element) ? element.contextElement : element;
}
const FALLBACK_SCALE = {
x: 1,
y: 1
};
function getScale(element) {
const domElement = unwrapElement(element);
if (!isHTMLElement(domElement)) {
return FALLBACK_SCALE;
}
const rect = domElement.getBoundingClientRect();
const {
width,
height,
fallback
} = getCssDimensions(domElement);
let x2 = (fallback ? round2(rect.width) : rect.width) / width;
let y2 = (fallback ? round2(rect.height) : rect.height) / height;
if (!x2 || !Number.isFinite(x2)) {
x2 = 1;
}
if (!y2 || !Number.isFinite(y2)) {
y2 = 1;
}
return {
x: x2,
y: y2
};
}
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
var _win$visualViewport, _win$visualViewport2;
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element.getBoundingClientRect();
const domElement = unwrapElement(element);
let scale = FALLBACK_SCALE;
if (includeScale) {
if (offsetParent) {
if (isElement(offsetParent)) {
scale = getScale(offsetParent);
}
} else {
scale = getScale(element);
}
}
const win = domElement ? getWindow(domElement) : window;
const addVisualOffsets = isClientRectVisualViewportBased() && isFixedStrategy;
let x2 = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;
let y2 = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
let width = clientRect.width / scale.x;
let height = clientRect.height / scale.y;
if (domElement) {
const win2 = getWindow(domElement);
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
let currentIFrame = win2.frameElement;
while (currentIFrame && offsetParent && offsetWin !== win2) {
const iframeScale = getScale(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css2 = getComputedStyle(currentIFrame);
iframeRect.x += (currentIFrame.clientLeft + parseFloat(css2.paddingLeft)) * iframeScale.x;
iframeRect.y += (currentIFrame.clientTop + parseFloat(css2.paddingTop)) * iframeScale.y;
x2 *= iframeScale.x;
y2 *= iframeScale.y;
width *= iframeScale.x;
height *= iframeScale.y;
x2 += iframeRect.x;
y2 += iframeRect.y;
currentIFrame = getWindow(currentIFrame).frameElement;
}
}
return core.rectToClientRect({
width,
height,
x: x2,
y: y2
});
}
function getDocumentElement(node) {
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
}
function getNodeScroll(element) {
if (isElement(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.pageXOffset,
scrollTop: element.pageYOffset
};
}
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
let {
rect,
offsetParent,
strategy
} = _ref;
const isOffsetParentAnElement = isHTMLElement(offsetParent);
const documentElement = getDocumentElement(offsetParent);
if (offsetParent === documentElement) {
return rect;
}
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
let scale = {
x: 1,
y: 1
};
const offsets = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent);
scale = getScale(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
return {
width: rect.width * scale.x,
height: rect.height * scale.y,
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
};
}
function getWindowScrollBarX(element) {
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
}
function getDocumentRect(element) {
const html = getDocumentElement(element);
const scroll = getNodeScroll(element);
const body = element.ownerDocument.body;
const width = max2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
const height = max2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
const y2 = -scroll.scrollTop;
if (getComputedStyle$1(body).direction === "rtl") {
x2 += max2(html.clientWidth, body.clientWidth) - width;
}
return {
width,
height,
x: x2,
y: y2
};
}
function getParentNode(node) {
if (getNodeName(node) === "html") {
return node;
}
const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return parentNode.ownerDocument.body;
}
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list) {
var _node$ownerDocument;
if (list === void 0) {
list = [];
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
const win = getWindow(scrollableAncestor);
if (isBody) {
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
}
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
}
function getViewportRect(element, strategy) {
const win = getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x2 = 0;
let y2 = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
const visualViewportBased = isClientRectVisualViewportBased();
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
x2 = visualViewport.offsetLeft;
y2 = visualViewport.offsetTop;
}
}
return {
width,
height,
x: x2,
y: y2
};
}
function getInnerBoundingClientRect(element, strategy) {
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
const top = clientRect.top + element.clientTop;
const left = clientRect.left + element.clientLeft;
const scale = isHTMLElement(element) ? getScale(element) : {
x: 1,
y: 1
};
const width = element.clientWidth * scale.x;
const height = element.clientHeight * scale.y;
const x2 = left * scale.x;
const y2 = top * scale.y;
return {
width,
height,
x: x2,
y: y2
};
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
let rect;
if (clippingAncestor === "viewport") {
rect = getViewportRect(element, strategy);
} else if (clippingAncestor === "document") {
rect = getDocumentRect(getDocumentElement(element));
} else if (isElement(clippingAncestor)) {
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
} else {
const mutableRect = __spreadValues({}, clippingAncestor);
if (isClientRectVisualViewportBased()) {
var _win$visualViewport, _win$visualViewport2;
const win = getWindow(element);
mutableRect.x -= ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0;
mutableRect.y -= ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0;
}
rect = mutableRect;
}
return core.rectToClientRect(rect);
}
function hasFixedPositionAncestor(element, stopNode) {
const parentNode = getParentNode(element);
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
return false;
}
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
}
function getClippingElementAncestors(element, cache) {
const cachedResult = cache.get(element);
if (cachedResult) {
return cachedResult;
}
let result = getOverflowAncestors(element).filter((el) => isElement(el) && getNodeName(el) !== "body");
let currentContainingBlockComputedStyle = null;
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
let currentNode = elementIsFixed ? getParentNode(element) : element;
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
const computedStyle = getComputedStyle$1(currentNode);
const currentNodeIsContaining = isContainingBlock(currentNode);
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
currentContainingBlockComputedStyle = null;
}
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
if (shouldDropCurrentNode) {
result = result.filter((ancestor) => ancestor !== currentNode);
} else {
currentContainingBlockComputedStyle = computedStyle;
}
currentNode = getParentNode(currentNode);
}
cache.set(element, result);
return result;
}
function getClippingRect(_ref) {
let {
element,
boundary,
rootBoundary,
strategy
} = _ref;
const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
const firstClippingAncestor = clippingAncestors[0];
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
accRect.top = max2(rect.top, accRect.top);
accRect.right = min2(rect.right, accRect.right);
accRect.bottom = min2(rect.bottom, accRect.bottom);
accRect.left = max2(rect.left, accRect.left);
return accRect;
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
return {
width: clippingRect.right - clippingRect.left,
height: clippingRect.bottom - clippingRect.top,
x: clippingRect.left,
y: clippingRect.top
};
}
function getDimensions(element) {
return getCssDimensions(element);
}
function getTrueOffsetParent(element, polyfill) {
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
return null;
}
if (polyfill) {
return polyfill(element);
}
return element.offsetParent;
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else {
currentNode = getParentNode(currentNode);
}
}
return null;
}
function getOffsetParent(element, polyfill) {
const window2 = getWindow(element);
if (!isHTMLElement(element)) {
return window2;
}
let offsetParent = getTrueOffsetParent(element, polyfill);
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
}
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
return window2;
}
return offsetParent || getContainingBlock(element) || window2;
}
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
const isOffsetParentAnElement = isHTMLElement(offsetParent);
const documentElement = getDocumentElement(offsetParent);
const rect = getBoundingClientRect(element, true, strategy === "fixed", offsetParent);
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
const offsets = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement(offsetParent)) {
const offsetRect = getBoundingClientRect(offsetParent, true);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.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
};
}
const platform = {
getClippingRect,
convertOffsetParentRelativeRectToViewportRelativeRect,
isElement,
getDimensions,
getOffsetParent,
getDocumentElement,
getScale,
getElementRects(_ref) {
return __async(this, null, function* () {
let {
reference,
floating,
strategy
} = _ref;
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
const getDimensionsFn = this.getDimensions;
return {
reference: getRectRelativeToOffsetParent(reference, yield getOffsetParentFn(floating), strategy),
floating: __spreadValues({
x: 0,
y: 0
}, yield getDimensionsFn(floating))
};
});
},
getClientRects: (element) => Array.from(element.getClientRects()),
isRTL: (element) => getComputedStyle$1(element).direction === "rtl"
};
function autoUpdate(reference, floating, update, options) {
if (options === void 0) {
options = {};
}
const {
ancestorScroll = true,
ancestorResize = true,
elementResize = true,
animationFrame = false
} = options;
const ancestors = ancestorScroll || ancestorResize ? [...isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : [], ...getOverflowAncestors(floating)] : [];
ancestors.forEach((ancestor) => {
const isVisualViewport = !isElement(ancestor) && ancestor.toString().includes("V");
if (ancestorScroll && (animationFrame ? isVisualViewport : true)) {
ancestor.addEventListener("scroll", update, {
passive: true
});
}
ancestorResize && ancestor.addEventListener("resize", update);
});
let observer = null;
if (elementResize) {
observer = new ResizeObserver(() => {
update();
});
isElement(reference) && !animationFrame && observer.observe(reference);
if (!isElement(reference) && reference.contextElement && !animationFrame) {
observer.observe(reference.contextElement);
}
observer.observe(floating);
}
let frameId;
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
if (animationFrame) {
frameLoop();
}
function frameLoop() {
const nextRefRect = getBoundingClientRect(reference);
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
update();
}
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
}
update();
return () => {
var _observer;
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.removeEventListener("scroll", update);
ancestorResize && ancestor.removeEventListener("resize", update);
});
(_observer = observer) == null ? void 0 : _observer.disconnect();
observer = null;
if (animationFrame) {
cancelAnimationFrame(frameId);
}
};
}
const computePosition = (reference, floating, options) => {
const cache = /* @__PURE__ */ new Map();
const mergedOptions = __spreadValues({
platform
}, options);
const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), {
_c: cache
});
return core.computePosition(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), {
platform: platformWithCache
}));
};
Object.defineProperty(exports2, "arrow", {
enumerable: true,
get: function() {
return core.arrow;
}
});
Object.defineProperty(exports2, "autoPlacement", {
enumerable: true,
get: function() {
return core.autoPlacement;
}
});
Object.defineProperty(exports2, "detectOverflow", {
enumerable: true,
get: function() {
return core.detectOverflow;
}
});
Object.defineProperty(exports2, "flip", {
enumerable: true,
get: function() {
return core.flip;
}
});
Object.defineProperty(exports2, "hide", {
enumerable: true,
get: function() {
return core.hide;
}
});
Object.defineProperty(exports2, "inline", {
enumerable: true,
get: function() {
return core.inline;
}
});
Object.defineProperty(exports2, "limitShift", {
enumerable: true,
get: function() {
return core.limitShift;
}
});
Object.defineProperty(exports2, "offset", {
enumerable: true,
get: function() {
return core.offset;
}
});
Object.defineProperty(exports2, "shift", {
enumerable: true,
get: function() {
return core.shift;
}
});
Object.defineProperty(exports2, "size", {
enumerable: true,
get: function() {
return core.size;
}
});
exports2.autoUpdate = autoUpdate;
exports2.computePosition = computePosition;
exports2.getOverflowAncestors = getOverflowAncestors;
exports2.platform = platform;
Object.defineProperty(exports2, "__esModule", { value: true });
});
}
});
// node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.cjs.js
var require_use_isomorphic_layout_effect_browser_cjs = __commonJS({
"node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.cjs.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var react = require_react();
var index = react.useLayoutEffect;
exports.default = index;
}
});
// node_modules/react-select/dist/index-2fe3dc33.cjs.dev.js
var require_index_2fe3dc33_cjs_dev = __commonJS({
"node_modules/react-select/dist/index-2fe3dc33.cjs.dev.js"(exports) {
"use strict";
var _objectSpread = require_objectSpread2();
var _extends2 = require_extends2();
var react = require_emotion_react_cjs();
var _slicedToArray = require_slicedToArray();
var _objectWithoutProperties = require_objectWithoutProperties();
var _typeof = require_typeof();
var _taggedTemplateLiteral = require_taggedTemplateLiteral();
var _defineProperty2 = require_defineProperty();
var React49 = require_react();
var reactDom = require_react_dom();
var dom = require_floating_ui_dom_umd();
var useLayoutEffect2 = require_use_isomorphic_layout_effect_browser_cjs();
function _interopDefault(e) {
return e && e.__esModule ? e : { "default": e };
}
var useLayoutEffect__default = /* @__PURE__ */ _interopDefault(useLayoutEffect2);
var _excluded$3 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
var noop2 = function noop3() {
};
function applyPrefixToName(prefix2, name) {
if (!name) {
return prefix2;
} else if (name[0] === "-") {
return prefix2 + name;
} else {
return prefix2 + "__" + name;
}
}
function classNames(prefix2, state) {
for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
classNameList[_key - 2] = arguments[_key];
}
var arr = [].concat(classNameList);
if (state && prefix2) {
for (var key in state) {
if (state.hasOwnProperty(key) && state[key]) {
arr.push("".concat(applyPrefixToName(prefix2, key)));
}
}
}
return arr.filter(function(i2) {
return i2;
}).map(function(i2) {
return String(i2).trim();
}).join(" ");
}
var cleanValue = function cleanValue2(value) {
if (isArray(value))
return value.filter(Boolean);
if (_typeof(value) === "object" && value !== null)
return [value];
return [];
};
var cleanCommonProps = function cleanCommonProps2(props) {
props.className;
props.clearValue;
props.cx;
props.getStyles;
props.getClassNames;
props.getValue;
props.hasValue;
props.isMulti;
props.isRtl;
props.options;
props.selectOption;
props.selectProps;
props.setValue;
props.theme;
var innerProps = _objectWithoutProperties(props, _excluded$3);
return _objectSpread({}, innerProps);
};
var getStyleProps = function getStyleProps2(props, name, classNamesState) {
var cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, className = props.className;
return {
css: getStyles(name, props),
className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className)
};
};
function handleInputChange(inputValue, actionMeta, onInputChange) {
if (onInputChange) {
var _newValue = onInputChange(inputValue, actionMeta);
if (typeof _newValue === "string")
return _newValue;
}
return inputValue;
}
function isDocumentElement(el) {
return [document.documentElement, document.body, window].indexOf(el) > -1;
}
function normalizedHeight(el) {
if (isDocumentElement(el)) {
return window.innerHeight;
}
return el.clientHeight;
}
function getScrollTop(el) {
if (isDocumentElement(el)) {
return window.pageYOffset;
}
return el.scrollTop;
}
function scrollTo(el, top) {
if (isDocumentElement(el)) {
window.scrollTo(0, top);
return;
}
el.scrollTop = top;
}
function getScrollParent(element) {
var style = getComputedStyle(element);
var excludeStaticParent = style.position === "absolute";
var overflowRx = /(auto|scroll)/;
if (style.position === "fixed")
return document.documentElement;
for (var parent = element; parent = parent.parentElement; ) {
style = getComputedStyle(parent);
if (excludeStaticParent && style.position === "static") {
continue;
}
if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {
return parent;
}
}
return document.documentElement;
}
function easeOutCubic(t2, b2, c2, d2) {
return c2 * ((t2 = t2 / d2 - 1) * t2 * t2 + 1) + b2;
}
function animatedScrollTo(element, to) {
var duration = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 200;
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : noop2;
var start = getScrollTop(element);
var change = to - start;
var increment = 10;
var currentTime = 0;
function animateScroll() {
currentTime += increment;
var val = easeOutCubic(currentTime, start, change, duration);
scrollTo(element, val);
if (currentTime < duration) {
window.requestAnimationFrame(animateScroll);
} else {
callback(element);
}
}
animateScroll();
}
function scrollIntoView(menuEl, focusedEl) {
var menuRect = menuEl.getBoundingClientRect();
var focusedRect = focusedEl.getBoundingClientRect();
var overScroll = focusedEl.offsetHeight / 3;
if (focusedRect.bottom + overScroll > menuRect.bottom) {
scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));
} else if (focusedRect.top - overScroll < menuRect.top) {
scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));
}
}
function getBoundingClientObj(element) {
var rect = element.getBoundingClientRect();
return {
bottom: rect.bottom,
height: rect.height,
left: rect.left,
right: rect.right,
top: rect.top,
width: rect.width
};
}
function isTouchCapable() {
try {
document.createEvent("TouchEvent");
return true;
} catch (e) {
return false;
}
}
function isMobileDevice() {
try {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
} catch (e) {
return false;
}
}
var passiveOptionAccessed = false;
var options = {
get passive() {
return passiveOptionAccessed = true;
}
};
var w2 = typeof window !== "undefined" ? window : {};
if (w2.addEventListener && w2.removeEventListener) {
w2.addEventListener("p", noop2, options);
w2.removeEventListener("p", noop2, false);
}
var supportsPassiveEvents = passiveOptionAccessed;
function notNullish(item) {
return item != null;
}
function isArray(arg) {
return Array.isArray(arg);
}
function valueTernary(isMulti, multiValue, singleValue) {
return isMulti ? multiValue : singleValue;
}
function singleValueAsValue(singleValue) {
return singleValue;
}
function multiValueAsValue(multiValue) {
return multiValue;
}
var removeProps = function removeProps2(propsObj) {
for (var _len2 = arguments.length, properties = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
properties[_key2 - 1] = arguments[_key2];
}
var propsMap = Object.entries(propsObj).filter(function(_ref) {
var _ref22 = _slicedToArray(_ref, 1), key = _ref22[0];
return !properties.includes(key);
});
return propsMap.reduce(function(newProps, _ref3) {
var _ref4 = _slicedToArray(_ref3, 2), key = _ref4[0], val = _ref4[1];
newProps[key] = val;
return newProps;
}, {});
};
function getMenuPlacement(_ref) {
var preferredMaxHeight = _ref.maxHeight, menuEl = _ref.menuEl, minHeight = _ref.minHeight, preferredPlacement = _ref.placement, shouldScroll = _ref.shouldScroll, isFixedPosition = _ref.isFixedPosition, controlHeight = _ref.controlHeight;
var scrollParent = getScrollParent(menuEl);
var defaultState = {
placement: "bottom",
maxHeight: preferredMaxHeight
};
if (!menuEl || !menuEl.offsetParent)
return defaultState;
var _scrollParent$getBoun = scrollParent.getBoundingClientRect(), scrollHeight = _scrollParent$getBoun.height;
var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(), menuBottom = _menuEl$getBoundingCl.bottom, menuHeight = _menuEl$getBoundingCl.height, menuTop = _menuEl$getBoundingCl.top;
var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(), containerTop = _menuEl$offsetParent$.top;
var viewHeight = isFixedPosition ? window.innerHeight : normalizedHeight(scrollParent);
var scrollTop = getScrollTop(scrollParent);
var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);
var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);
var viewSpaceAbove = containerTop - marginTop;
var viewSpaceBelow = viewHeight - menuTop;
var scrollSpaceAbove = viewSpaceAbove + scrollTop;
var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;
var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;
var scrollUp = scrollTop + menuTop - marginTop;
var scrollDuration = 160;
switch (preferredPlacement) {
case "auto":
case "bottom":
if (viewSpaceBelow >= menuHeight) {
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollDown, scrollDuration);
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollDown, scrollDuration);
}
var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom;
return {
placement: "bottom",
maxHeight: constrainedHeight
};
}
if (preferredPlacement === "auto" || isFixedPosition) {
var _constrainedHeight = preferredMaxHeight;
var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;
if (spaceAbove >= minHeight) {
_constrainedHeight = Math.min(spaceAbove - marginBottom - controlHeight, preferredMaxHeight);
}
return {
placement: "top",
maxHeight: _constrainedHeight
};
}
if (preferredPlacement === "bottom") {
if (shouldScroll) {
scrollTo(scrollParent, scrollDown);
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
}
break;
case "top":
if (viewSpaceAbove >= menuHeight) {
return {
placement: "top",
maxHeight: preferredMaxHeight
};
}
if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollUp, scrollDuration);
}
return {
placement: "top",
maxHeight: preferredMaxHeight
};
}
if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
var _constrainedHeight2 = preferredMaxHeight;
if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
_constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop;
}
if (shouldScroll) {
animatedScrollTo(scrollParent, scrollUp, scrollDuration);
}
return {
placement: "top",
maxHeight: _constrainedHeight2
};
}
return {
placement: "bottom",
maxHeight: preferredMaxHeight
};
default:
throw new Error('Invalid placement provided "'.concat(preferredPlacement, '".'));
}
return defaultState;
}
function alignToControl(placement) {
var placementToCSSProp = {
bottom: "top",
top: "bottom"
};
return placement ? placementToCSSProp[placement] : "bottom";
}
var coercePlacement = function coercePlacement2(p2) {
return p2 === "auto" ? "bottom" : p2;
};
var menuCSS = function menuCSS2(_ref22, unstyled) {
var _objectSpread22;
var placement = _ref22.placement, _ref2$theme = _ref22.theme, borderRadius = _ref2$theme.borderRadius, spacing = _ref2$theme.spacing, colors = _ref2$theme.colors;
return _objectSpread((_objectSpread22 = {
label: "menu"
}, _defineProperty2(_objectSpread22, alignToControl(placement), "100%"), _defineProperty2(_objectSpread22, "position", "absolute"), _defineProperty2(_objectSpread22, "width", "100%"), _defineProperty2(_objectSpread22, "zIndex", 1), _objectSpread22), unstyled ? {} : {
backgroundColor: colors.neutral0,
borderRadius,
boxShadow: "0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",
marginBottom: spacing.menuGutter,
marginTop: spacing.menuGutter
});
};
var PortalPlacementContext = /* @__PURE__ */ React49.createContext(null);
var MenuPlacer = function MenuPlacer2(props) {
var children = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme;
var _ref3 = React49.useContext(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement;
var ref = React49.useRef(null);
var _useState = React49.useState(maxMenuHeight), _useState2 = _slicedToArray(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1];
var _useState3 = React49.useState(null), _useState4 = _slicedToArray(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1];
var controlHeight = theme.spacing.controlHeight;
useLayoutEffect__default["default"](function() {
var menuEl = ref.current;
if (!menuEl)
return;
var isFixedPosition = menuPosition === "fixed";
var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;
var state = getMenuPlacement({
maxHeight: maxMenuHeight,
menuEl,
minHeight: minMenuHeight,
placement: menuPlacement,
shouldScroll,
isFixedPosition,
controlHeight
});
setMaxHeight(state.maxHeight);
setPlacement(state.placement);
setPortalPlacement === null || setPortalPlacement === void 0 ? void 0 : setPortalPlacement(state.placement);
}, [maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, setPortalPlacement, controlHeight]);
return children({
ref,
placerProps: _objectSpread(_objectSpread({}, props), {}, {
placement: placement || coercePlacement(menuPlacement),
maxHeight
})
});
};
var Menu3 = function Menu4(props) {
var children = props.children, innerRef = props.innerRef, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "menu", {
menu: true
}), {
ref: innerRef
}, innerProps), children);
};
var Menu$1 = Menu3;
var menuListCSS = function menuListCSS2(_ref4, unstyled) {
var maxHeight = _ref4.maxHeight, baseUnit = _ref4.theme.spacing.baseUnit;
return _objectSpread({
maxHeight,
overflowY: "auto",
position: "relative",
WebkitOverflowScrolling: "touch"
}, unstyled ? {} : {
paddingBottom: baseUnit,
paddingTop: baseUnit
});
};
var MenuList = function MenuList2(props) {
var children = props.children, innerProps = props.innerProps, innerRef = props.innerRef, isMulti = props.isMulti;
return react.jsx("div", _extends2({}, getStyleProps(props, "menuList", {
"menu-list": true,
"menu-list--is-multi": isMulti
}), {
ref: innerRef
}, innerProps), children);
};
var noticeCSS = function noticeCSS2(_ref5, unstyled) {
var _ref5$theme = _ref5.theme, baseUnit = _ref5$theme.spacing.baseUnit, colors = _ref5$theme.colors;
return _objectSpread({
textAlign: "center"
}, unstyled ? {} : {
color: colors.neutral40,
padding: "".concat(baseUnit * 2, "px ").concat(baseUnit * 3, "px")
});
};
var noOptionsMessageCSS = noticeCSS;
var loadingMessageCSS = noticeCSS;
var NoOptionsMessage = function NoOptionsMessage2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "noOptionsMessage", {
"menu-notice": true,
"menu-notice--no-options": true
}), innerProps), children);
};
NoOptionsMessage.defaultProps = {
children: "No options"
};
var LoadingMessage = function LoadingMessage2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "loadingMessage", {
"menu-notice": true,
"menu-notice--loading": true
}), innerProps), children);
};
LoadingMessage.defaultProps = {
children: "Loading..."
};
var menuPortalCSS = function menuPortalCSS2(_ref6) {
var rect = _ref6.rect, offset = _ref6.offset, position = _ref6.position;
return {
left: rect.left,
position,
top: offset,
width: rect.width,
zIndex: 1
};
};
var MenuPortal = function MenuPortal2(props) {
var appendTo = props.appendTo, children = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition;
var menuPortalRef = React49.useRef(null);
var cleanupRef = React49.useRef(null);
var _useState5 = React49.useState(coercePlacement(menuPlacement)), _useState6 = _slicedToArray(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1];
var portalPlacementContext = React49.useMemo(function() {
return {
setPortalPlacement
};
}, []);
var _useState7 = React49.useState(null), _useState8 = _slicedToArray(_useState7, 2), computedPosition = _useState8[0], setComputedPosition = _useState8[1];
var updateComputedPosition = React49.useCallback(function() {
if (!controlElement)
return;
var rect = getBoundingClientObj(controlElement);
var scrollDistance = menuPosition === "fixed" ? 0 : window.pageYOffset;
var offset = rect[placement] + scrollDistance;
if (offset !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset) || rect.left !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left) || rect.width !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width)) {
setComputedPosition({
offset,
rect
});
}
}, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
useLayoutEffect__default["default"](function() {
updateComputedPosition();
}, [updateComputedPosition]);
var runAutoUpdate = React49.useCallback(function() {
if (typeof cleanupRef.current === "function") {
cleanupRef.current();
cleanupRef.current = null;
}
if (controlElement && menuPortalRef.current) {
cleanupRef.current = dom.autoUpdate(controlElement, menuPortalRef.current, updateComputedPosition, {
elementResize: "ResizeObserver" in window
});
}
}, [controlElement, updateComputedPosition]);
useLayoutEffect__default["default"](function() {
runAutoUpdate();
}, [runAutoUpdate]);
var setMenuPortalElement = React49.useCallback(function(menuPortalElement) {
menuPortalRef.current = menuPortalElement;
runAutoUpdate();
}, [runAutoUpdate]);
if (!appendTo && menuPosition !== "fixed" || !computedPosition)
return null;
var menuWrapper = react.jsx("div", _extends2({
ref: setMenuPortalElement
}, getStyleProps(_objectSpread(_objectSpread({}, props), {}, {
offset: computedPosition.offset,
position: menuPosition,
rect: computedPosition.rect
}), "menuPortal", {
"menu-portal": true
}), innerProps), children);
return react.jsx(PortalPlacementContext.Provider, {
value: portalPlacementContext
}, appendTo ? /* @__PURE__ */ reactDom.createPortal(menuWrapper, appendTo) : menuWrapper);
};
var containerCSS = function containerCSS2(_ref) {
var isDisabled = _ref.isDisabled, isRtl = _ref.isRtl;
return {
label: "container",
direction: isRtl ? "rtl" : void 0,
pointerEvents: isDisabled ? "none" : void 0,
position: "relative"
};
};
var SelectContainer = function SelectContainer2(props) {
var children = props.children, innerProps = props.innerProps, isDisabled = props.isDisabled, isRtl = props.isRtl;
return react.jsx("div", _extends2({}, getStyleProps(props, "container", {
"--is-disabled": isDisabled,
"--is-rtl": isRtl
}), innerProps), children);
};
var valueContainerCSS = function valueContainerCSS2(_ref22, unstyled) {
var spacing = _ref22.theme.spacing, isMulti = _ref22.isMulti, hasValue = _ref22.hasValue, controlShouldRenderValue = _ref22.selectProps.controlShouldRenderValue;
return _objectSpread({
alignItems: "center",
display: isMulti && hasValue && controlShouldRenderValue ? "flex" : "grid",
flex: 1,
flexWrap: "wrap",
WebkitOverflowScrolling: "touch",
position: "relative",
overflow: "hidden"
}, unstyled ? {} : {
padding: "".concat(spacing.baseUnit / 2, "px ").concat(spacing.baseUnit * 2, "px")
});
};
var ValueContainer = function ValueContainer2(props) {
var children = props.children, innerProps = props.innerProps, isMulti = props.isMulti, hasValue = props.hasValue;
return react.jsx("div", _extends2({}, getStyleProps(props, "valueContainer", {
"value-container": true,
"value-container--is-multi": isMulti,
"value-container--has-value": hasValue
}), innerProps), children);
};
var indicatorsContainerCSS = function indicatorsContainerCSS2() {
return {
alignItems: "center",
alignSelf: "stretch",
display: "flex",
flexShrink: 0
};
};
var IndicatorsContainer = function IndicatorsContainer2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "indicatorsContainer", {
indicators: true
}), innerProps), children);
};
var _templateObject;
var _excluded$2 = ["size"];
function _EMOTION_STRINGIFIED_CSS_ERROR__() {
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).";
}
var _ref2 = false ? {
name: "8mmkcg",
styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"
} : {
name: "tj5bde-Svg",
styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var Svg = function Svg2(_ref) {
var size = _ref.size, props = _objectWithoutProperties(_ref, _excluded$2);
return react.jsx("svg", _extends2({
height: size,
width: size,
viewBox: "0 0 20 20",
"aria-hidden": "true",
focusable: "false",
css: _ref2
}, props));
};
var CrossIcon = function CrossIcon2(props) {
return react.jsx(Svg, _extends2({
size: 20
}, props), react.jsx("path", {
d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
}));
};
var DownChevron = function DownChevron2(props) {
return react.jsx(Svg, _extends2({
size: 20
}, props), react.jsx("path", {
d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
}));
};
var baseCSS = function baseCSS2(_ref3, unstyled) {
var isFocused = _ref3.isFocused, _ref3$theme = _ref3.theme, baseUnit = _ref3$theme.spacing.baseUnit, colors = _ref3$theme.colors;
return _objectSpread({
label: "indicatorContainer",
display: "flex",
transition: "color 150ms"
}, unstyled ? {} : {
color: isFocused ? colors.neutral60 : colors.neutral20,
padding: baseUnit * 2,
":hover": {
color: isFocused ? colors.neutral80 : colors.neutral40
}
});
};
var dropdownIndicatorCSS = baseCSS;
var DropdownIndicator = function DropdownIndicator2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "dropdownIndicator", {
indicator: true,
"dropdown-indicator": true
}), innerProps), children || react.jsx(DownChevron, null));
};
var clearIndicatorCSS = baseCSS;
var ClearIndicator = function ClearIndicator2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "clearIndicator", {
indicator: true,
"clear-indicator": true
}), innerProps), children || react.jsx(CrossIcon, null));
};
var indicatorSeparatorCSS = function indicatorSeparatorCSS2(_ref4, unstyled) {
var isDisabled = _ref4.isDisabled, _ref4$theme = _ref4.theme, baseUnit = _ref4$theme.spacing.baseUnit, colors = _ref4$theme.colors;
return _objectSpread({
label: "indicatorSeparator",
alignSelf: "stretch",
width: 1
}, unstyled ? {} : {
backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,
marginBottom: baseUnit * 2,
marginTop: baseUnit * 2
});
};
var IndicatorSeparator = function IndicatorSeparator2(props) {
var innerProps = props.innerProps;
return react.jsx("span", _extends2({}, innerProps, getStyleProps(props, "indicatorSeparator", {
"indicator-separator": true
})));
};
var loadingDotAnimations = react.keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"])));
var loadingIndicatorCSS = function loadingIndicatorCSS2(_ref5, unstyled) {
var isFocused = _ref5.isFocused, size = _ref5.size, _ref5$theme = _ref5.theme, colors = _ref5$theme.colors, baseUnit = _ref5$theme.spacing.baseUnit;
return _objectSpread({
label: "loadingIndicator",
display: "flex",
transition: "color 150ms",
alignSelf: "center",
fontSize: size,
lineHeight: 1,
marginRight: size,
textAlign: "center",
verticalAlign: "middle"
}, unstyled ? {} : {
color: isFocused ? colors.neutral60 : colors.neutral20,
padding: baseUnit * 2
});
};
var LoadingDot = function LoadingDot2(_ref6) {
var delay = _ref6.delay, offset = _ref6.offset;
return react.jsx("span", {
css: /* @__PURE__ */ react.css({
animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"),
backgroundColor: "currentColor",
borderRadius: "1em",
display: "inline-block",
marginLeft: offset ? "1em" : void 0,
height: "1em",
verticalAlign: "top",
width: "1em"
}, false ? "" : ";label:LoadingDot;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+XG4pID0+IHtcbiAgY29uc3QgeyBpbm5lclByb3BzLCBpc1J0bCB9ID0gcHJvcHM7XG5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2xvYWRpbmdJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgICAgey4uLmlubmVyUHJvcHN9XG4gICAgPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezB9IG9mZnNldD17aXNSdGx9IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MTYwfSBvZmZzZXQgLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXszMjB9IG9mZnNldD17IWlzUnRsfSAvPlxuICAgIDwvZGl2PlxuICApO1xufTtcbkxvYWRpbmdJbmRpY2F0b3IuZGVmYXVsdFByb3BzID0geyBzaXplOiA0IH07XG4iXX0= */")
});
};
var LoadingIndicator = function LoadingIndicator2(props) {
var innerProps = props.innerProps, isRtl = props.isRtl;
return react.jsx("div", _extends2({}, getStyleProps(props, "loadingIndicator", {
indicator: true,
"loading-indicator": true
}), innerProps), react.jsx(LoadingDot, {
delay: 0,
offset: isRtl
}), react.jsx(LoadingDot, {
delay: 160,
offset: true
}), react.jsx(LoadingDot, {
delay: 320,
offset: !isRtl
}));
};
LoadingIndicator.defaultProps = {
size: 4
};
var css$1 = function css3(_ref, unstyled) {
var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, _ref$theme = _ref.theme, colors = _ref$theme.colors, borderRadius = _ref$theme.borderRadius, spacing = _ref$theme.spacing;
return _objectSpread({
label: "control",
alignItems: "center",
cursor: "default",
display: "flex",
flexWrap: "wrap",
justifyContent: "space-between",
minHeight: spacing.controlHeight,
outline: "0 !important",
position: "relative",
transition: "all 100ms"
}, unstyled ? {} : {
backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,
borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20,
borderRadius,
borderStyle: "solid",
borderWidth: 1,
boxShadow: isFocused ? "0 0 0 1px ".concat(colors.primary) : void 0,
"&:hover": {
borderColor: isFocused ? colors.primary : colors.neutral30
}
});
};
var Control = function Control2(props) {
var children = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, innerRef = props.innerRef, innerProps = props.innerProps, menuIsOpen = props.menuIsOpen;
return react.jsx("div", _extends2({
ref: innerRef
}, getStyleProps(props, "control", {
control: true,
"control--is-disabled": isDisabled,
"control--is-focused": isFocused,
"control--menu-is-open": menuIsOpen
}), innerProps), children);
};
var Control$1 = Control;
var _excluded$1 = ["data"];
var groupCSS = function groupCSS2(_ref, unstyled) {
var spacing = _ref.theme.spacing;
return unstyled ? {} : {
paddingBottom: spacing.baseUnit * 2,
paddingTop: spacing.baseUnit * 2
};
};
var Group = function Group2(props) {
var children = props.children, cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, Heading = props.Heading, headingProps = props.headingProps, innerProps = props.innerProps, label = props.label, theme = props.theme, selectProps = props.selectProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "group", {
group: true
}), innerProps), react.jsx(Heading, _extends2({}, headingProps, {
selectProps,
theme,
getStyles,
getClassNames,
cx
}), label), react.jsx("div", null, children));
};
var groupHeadingCSS = function groupHeadingCSS2(_ref22, unstyled) {
var _ref2$theme = _ref22.theme, colors = _ref2$theme.colors, spacing = _ref2$theme.spacing;
return _objectSpread({
label: "group",
cursor: "default",
display: "block"
}, unstyled ? {} : {
color: colors.neutral40,
fontSize: "75%",
fontWeight: 500,
marginBottom: "0.25em",
paddingLeft: spacing.baseUnit * 3,
paddingRight: spacing.baseUnit * 3,
textTransform: "uppercase"
});
};
var GroupHeading = function GroupHeading2(props) {
var _cleanCommonProps = cleanCommonProps(props);
_cleanCommonProps.data;
var innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$1);
return react.jsx("div", _extends2({}, getStyleProps(props, "groupHeading", {
"group-heading": true
}), innerProps));
};
var Group$1 = Group;
var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
var inputCSS = function inputCSS2(_ref, unstyled) {
var isDisabled = _ref.isDisabled, value = _ref.value, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors;
return _objectSpread(_objectSpread({
visibility: isDisabled ? "hidden" : "visible",
transform: value ? "translateZ(0)" : ""
}, containerStyle2), unstyled ? {} : {
margin: spacing.baseUnit / 2,
paddingBottom: spacing.baseUnit / 2,
paddingTop: spacing.baseUnit / 2,
color: colors.neutral80
});
};
var spacingStyle = {
gridArea: "1 / 2",
font: "inherit",
minWidth: "2px",
border: 0,
margin: 0,
outline: 0,
padding: 0
};
var containerStyle2 = {
flex: "1 1 auto",
display: "inline-grid",
gridArea: "1 / 1 / 2 / 3",
gridTemplateColumns: "0 min-content",
"&:after": _objectSpread({
content: 'attr(data-value) " "',
visibility: "hidden",
whiteSpace: "pre"
}, spacingStyle)
};
var inputStyle = function inputStyle2(isHidden) {
return _objectSpread({
label: "input",
color: "inherit",
background: 0,
opacity: isHidden ? 0 : 1,
width: "100%"
}, spacingStyle);
};
var Input = function Input2(props) {
var cx = props.cx, value = props.value;
var _cleanCommonProps = cleanCommonProps(props), innerRef = _cleanCommonProps.innerRef, isDisabled = _cleanCommonProps.isDisabled, isHidden = _cleanCommonProps.isHidden, inputClassName = _cleanCommonProps.inputClassName, innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
return react.jsx("div", _extends2({}, getStyleProps(props, "input", {
"input-container": true
}), {
"data-value": value || ""
}), react.jsx("input", _extends2({
className: cx({
input: true
}, inputClassName),
ref: innerRef,
style: inputStyle(isHidden),
disabled: isDisabled
}, innerProps)));
};
var Input$1 = Input;
var multiValueCSS = function multiValueCSS2(_ref, unstyled) {
var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, borderRadius = _ref$theme.borderRadius, colors = _ref$theme.colors;
return _objectSpread({
label: "multiValue",
display: "flex",
minWidth: 0
}, unstyled ? {} : {
backgroundColor: colors.neutral10,
borderRadius: borderRadius / 2,
margin: spacing.baseUnit / 2
});
};
var multiValueLabelCSS = function multiValueLabelCSS2(_ref22, unstyled) {
var _ref2$theme = _ref22.theme, borderRadius = _ref2$theme.borderRadius, colors = _ref2$theme.colors, cropWithEllipsis = _ref22.cropWithEllipsis;
return _objectSpread({
overflow: "hidden",
textOverflow: cropWithEllipsis || cropWithEllipsis === void 0 ? "ellipsis" : void 0,
whiteSpace: "nowrap"
}, unstyled ? {} : {
borderRadius: borderRadius / 2,
color: colors.neutral80,
fontSize: "85%",
padding: 3,
paddingLeft: 6
});
};
var multiValueRemoveCSS = function multiValueRemoveCSS2(_ref3, unstyled) {
var _ref3$theme = _ref3.theme, spacing = _ref3$theme.spacing, borderRadius = _ref3$theme.borderRadius, colors = _ref3$theme.colors, isFocused = _ref3.isFocused;
return _objectSpread({
alignItems: "center",
display: "flex"
}, unstyled ? {} : {
borderRadius: borderRadius / 2,
backgroundColor: isFocused ? colors.dangerLight : void 0,
paddingLeft: spacing.baseUnit,
paddingRight: spacing.baseUnit,
":hover": {
backgroundColor: colors.dangerLight,
color: colors.danger
}
});
};
var MultiValueGeneric = function MultiValueGeneric2(_ref4) {
var children = _ref4.children, innerProps = _ref4.innerProps;
return react.jsx("div", innerProps, children);
};
var MultiValueContainer = MultiValueGeneric;
var MultiValueLabel = MultiValueGeneric;
function MultiValueRemove(_ref5) {
var children = _ref5.children, innerProps = _ref5.innerProps;
return react.jsx("div", _extends2({
role: "button"
}, innerProps), children || react.jsx(CrossIcon, {
size: 14
}));
}
var MultiValue = function MultiValue2(props) {
var children = props.children, components2 = props.components, data = props.data, innerProps = props.innerProps, isDisabled = props.isDisabled, removeProps2 = props.removeProps, selectProps = props.selectProps;
var Container = components2.Container, Label = components2.Label, Remove = components2.Remove;
return react.jsx(Container, {
data,
innerProps: _objectSpread(_objectSpread({}, getStyleProps(props, "multiValue", {
"multi-value": true,
"multi-value--is-disabled": isDisabled
})), innerProps),
selectProps
}, react.jsx(Label, {
data,
innerProps: _objectSpread({}, getStyleProps(props, "multiValueLabel", {
"multi-value__label": true
})),
selectProps
}, children), react.jsx(Remove, {
data,
innerProps: _objectSpread(_objectSpread({}, getStyleProps(props, "multiValueRemove", {
"multi-value__remove": true
})), {}, {
"aria-label": "Remove ".concat(children || "option")
}, removeProps2),
selectProps
}));
};
var MultiValue$1 = MultiValue;
var optionCSS = function optionCSS2(_ref, unstyled) {
var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, isSelected = _ref.isSelected, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors;
return _objectSpread({
label: "option",
cursor: "default",
display: "block",
fontSize: "inherit",
width: "100%",
userSelect: "none",
WebkitTapHighlightColor: "rgba(0, 0, 0, 0)"
}, unstyled ? {} : {
backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : "transparent",
color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : "inherit",
padding: "".concat(spacing.baseUnit * 2, "px ").concat(spacing.baseUnit * 3, "px"),
":active": {
backgroundColor: !isDisabled ? isSelected ? colors.primary : colors.primary50 : void 0
}
});
};
var Option = function Option2(props) {
var children = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, isSelected = props.isSelected, innerRef = props.innerRef, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "option", {
option: true,
"option--is-disabled": isDisabled,
"option--is-focused": isFocused,
"option--is-selected": isSelected
}), {
ref: innerRef,
"aria-disabled": isDisabled
}, innerProps), children);
};
var Option$1 = Option;
var placeholderCSS = function placeholderCSS2(_ref, unstyled) {
var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors;
return _objectSpread({
label: "placeholder",
gridArea: "1 / 1 / 2 / 3"
}, unstyled ? {} : {
color: colors.neutral50,
marginLeft: spacing.baseUnit / 2,
marginRight: spacing.baseUnit / 2
});
};
var Placeholder = function Placeholder2(props) {
var children = props.children, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "placeholder", {
placeholder: true
}), innerProps), children);
};
var Placeholder$1 = Placeholder;
var css2 = function css3(_ref, unstyled) {
var isDisabled = _ref.isDisabled, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors;
return _objectSpread({
label: "singleValue",
gridArea: "1 / 1 / 2 / 3",
maxWidth: "100%",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
}, unstyled ? {} : {
color: isDisabled ? colors.neutral40 : colors.neutral80,
marginLeft: spacing.baseUnit / 2,
marginRight: spacing.baseUnit / 2
});
};
var SingleValue = function SingleValue2(props) {
var children = props.children, isDisabled = props.isDisabled, innerProps = props.innerProps;
return react.jsx("div", _extends2({}, getStyleProps(props, "singleValue", {
"single-value": true,
"single-value--is-disabled": isDisabled
}), innerProps), children);
};
var SingleValue$1 = SingleValue;
var components = {
ClearIndicator,
Control: Control$1,
DropdownIndicator,
DownChevron,
CrossIcon,
Group: Group$1,
GroupHeading,
IndicatorsContainer,
IndicatorSeparator,
Input: Input$1,
LoadingIndicator,
Menu: Menu$1,
MenuList,
MenuPortal,
LoadingMessage,
NoOptionsMessage,
MultiValue: MultiValue$1,
MultiValueContainer,
MultiValueLabel,
MultiValueRemove,
Option: Option$1,
Placeholder: Placeholder$1,
SelectContainer,
SingleValue: SingleValue$1,
ValueContainer
};
var defaultComponents = function defaultComponents2(props) {
return _objectSpread(_objectSpread({}, components), props.components);
};
exports.MenuPlacer = MenuPlacer;
exports.classNames = classNames;
exports.cleanValue = cleanValue;
exports.clearIndicatorCSS = clearIndicatorCSS;
exports.components = components;
exports.containerCSS = containerCSS;
exports.css = css$1;
exports.css$1 = css2;
exports.defaultComponents = defaultComponents;
exports.dropdownIndicatorCSS = dropdownIndicatorCSS;
exports.groupCSS = groupCSS;
exports.groupHeadingCSS = groupHeadingCSS;
exports.handleInputChange = handleInputChange;
exports.indicatorSeparatorCSS = indicatorSeparatorCSS;
exports.indicatorsContainerCSS = indicatorsContainerCSS;
exports.inputCSS = inputCSS;
exports.isDocumentElement = isDocumentElement;
exports.isMobileDevice = isMobileDevice;
exports.isTouchCapable = isTouchCapable;
exports.loadingIndicatorCSS = loadingIndicatorCSS;
exports.loadingMessageCSS = loadingMessageCSS;
exports.menuCSS = menuCSS;
exports.menuListCSS = menuListCSS;
exports.menuPortalCSS = menuPortalCSS;
exports.multiValueAsValue = multiValueAsValue;
exports.multiValueCSS = multiValueCSS;
exports.multiValueLabelCSS = multiValueLabelCSS;
exports.multiValueRemoveCSS = multiValueRemoveCSS;
exports.noOptionsMessageCSS = noOptionsMessageCSS;
exports.noop = noop2;
exports.notNullish = notNullish;
exports.optionCSS = optionCSS;
exports.placeholderCSS = placeholderCSS;
exports.removeProps = removeProps;
exports.scrollIntoView = scrollIntoView;
exports.singleValueAsValue = singleValueAsValue;
exports.supportsPassiveEvents = supportsPassiveEvents;
exports.valueContainerCSS = valueContainerCSS;
exports.valueTernary = valueTernary;
}
});
// node_modules/memoize-one/dist/memoize-one.cjs.js
var require_memoize_one_cjs = __commonJS({
"node_modules/memoize-one/dist/memoize-one.cjs.js"(exports, module2) {
"use strict";
var safeIsNaN = Number.isNaN || function ponyfill(value) {
return typeof value === "number" && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i2 = 0; i2 < newInputs.length; i2++) {
if (!isEqual(newInputs[i2], lastInputs[i2])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual2) {
if (isEqual2 === void 0) {
isEqual2 = areInputsEqual;
}
var cache = null;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (cache && cache.lastThis === this && isEqual2(newArgs, cache.lastArgs)) {
return cache.lastResult;
}
var lastResult = resultFn.apply(this, newArgs);
cache = {
lastResult,
lastArgs: newArgs,
lastThis: this
};
return lastResult;
}
memoized.clear = function clear() {
cache = null;
};
return memoized;
}
module2.exports = memoizeOne;
}
});
// node_modules/react-select/dist/Select-5041a4f3.cjs.dev.js
var require_Select_5041a4f3_cjs_dev = __commonJS({
"node_modules/react-select/dist/Select-5041a4f3.cjs.dev.js"(exports) {
"use strict";
var _extends2 = require_extends2();
var _objectSpread = require_objectSpread2();
var _classCallCheck = require_classCallCheck();
var _createClass = require_createClass();
var _inherits = require_inherits();
var _createSuper = require_createSuper();
var _toConsumableArray = require_toConsumableArray();
var React49 = require_react();
var index = require_index_2fe3dc33_cjs_dev();
var react = require_emotion_react_cjs();
var memoizeOne = require_memoize_one_cjs();
var _objectWithoutProperties = require_objectWithoutProperties();
function _interopDefault(e) {
return e && e.__esModule ? e : { "default": e };
}
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(React49);
var memoizeOne__default = /* @__PURE__ */ _interopDefault(memoizeOne);
function _EMOTION_STRINGIFIED_CSS_ERROR__$2() {
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).";
}
var _ref = false ? {
name: "7pg0cj-a11yText",
styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
} : {
name: "1f43avz-a11yText-A11yText",
styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
};
var A11yText = function A11yText2(props) {
return react.jsx("span", _extends2({
css: _ref
}, props));
};
var A11yText$1 = A11yText;
var defaultAriaLiveMessages = {
guidance: function guidance(props) {
var isSearchable = props.isSearchable, isMulti = props.isMulti, isDisabled = props.isDisabled, tabSelectsValue = props.tabSelectsValue, context = props.context;
switch (context) {
case "menu":
return "Use Up and Down to choose options".concat(isDisabled ? "" : ", press Enter to select the currently focused option", ", press Escape to exit the menu").concat(tabSelectsValue ? ", press Tab to select the option and exit the menu" : "", ".");
case "input":
return "".concat(props["aria-label"] || "Select", " is focused ").concat(isSearchable ? ",type to refine list" : "", ", press Down to open the menu, ").concat(isMulti ? " press left to focus selected values" : "");
case "value":
return "Use left and right to toggle between focused values, press Backspace to remove the currently focused value";
default:
return "";
}
},
onChange: function onChange(props) {
var action = props.action, _props$label = props.label, label = _props$label === void 0 ? "" : _props$label, labels = props.labels, isDisabled = props.isDisabled;
switch (action) {
case "deselect-option":
case "pop-value":
case "remove-value":
return "option ".concat(label, ", deselected.");
case "clear":
return "All selected options have been cleared.";
case "initial-input-focus":
return "option".concat(labels.length > 1 ? "s" : "", " ").concat(labels.join(","), ", selected.");
case "select-option":
return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected.");
default:
return "";
}
},
onFocus: function onFocus(props) {
var context = props.context, focused = props.focused, options = props.options, _props$label2 = props.label, label = _props$label2 === void 0 ? "" : _props$label2, selectValue = props.selectValue, isDisabled = props.isDisabled, isSelected = props.isSelected;
var getArrayIndex = function getArrayIndex2(arr, item) {
return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : "";
};
if (context === "value" && selectValue) {
return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
}
if (context === "menu") {
var disabled = isDisabled ? " disabled" : "";
var status = "".concat(isSelected ? "selected" : "focused").concat(disabled);
return "option ".concat(label, " ").concat(status, ", ").concat(getArrayIndex(options, focused), ".");
}
return "";
},
onFilter: function onFilter(props) {
var inputValue = props.inputValue, resultsMessage = props.resultsMessage;
return "".concat(resultsMessage).concat(inputValue ? " for search term " + inputValue : "", ".");
}
};
var LiveRegion = function LiveRegion2(props) {
var ariaSelection = props.ariaSelection, focusedOption = props.focusedOption, focusedValue = props.focusedValue, focusableOptions = props.focusableOptions, isFocused = props.isFocused, selectValue = props.selectValue, selectProps = props.selectProps, id2 = props.id;
var ariaLiveMessages = selectProps.ariaLiveMessages, getOptionLabel2 = selectProps.getOptionLabel, inputValue = selectProps.inputValue, isMulti = selectProps.isMulti, isOptionDisabled2 = selectProps.isOptionDisabled, isSearchable = selectProps.isSearchable, menuIsOpen = selectProps.menuIsOpen, options = selectProps.options, screenReaderStatus = selectProps.screenReaderStatus, tabSelectsValue = selectProps.tabSelectsValue;
var ariaLabel = selectProps["aria-label"];
var ariaLive = selectProps["aria-live"];
var messages = React49.useMemo(function() {
return _objectSpread(_objectSpread({}, defaultAriaLiveMessages), ariaLiveMessages || {});
}, [ariaLiveMessages]);
var ariaSelected = React49.useMemo(function() {
var message = "";
if (ariaSelection && messages.onChange) {
var option = ariaSelection.option, selectedOptions = ariaSelection.options, removedValue = ariaSelection.removedValue, removedValues = ariaSelection.removedValues, value = ariaSelection.value;
var asOption = function asOption2(val) {
return !Array.isArray(val) ? val : null;
};
var selected = removedValue || option || asOption(value);
var label = selected ? getOptionLabel2(selected) : "";
var multiSelected = selectedOptions || removedValues || void 0;
var labels = multiSelected ? multiSelected.map(getOptionLabel2) : [];
var onChangeProps = _objectSpread({
isDisabled: selected && isOptionDisabled2(selected, selectValue),
label,
labels
}, ariaSelection);
message = messages.onChange(onChangeProps);
}
return message;
}, [ariaSelection, messages, isOptionDisabled2, selectValue, getOptionLabel2]);
var ariaFocused = React49.useMemo(function() {
var focusMsg = "";
var focused = focusedOption || focusedValue;
var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
if (focused && messages.onFocus) {
var onFocusProps = {
focused,
label: getOptionLabel2(focused),
isDisabled: isOptionDisabled2(focused, selectValue),
isSelected,
options: focusableOptions,
context: focused === focusedOption ? "menu" : "value",
selectValue
};
focusMsg = messages.onFocus(onFocusProps);
}
return focusMsg;
}, [focusedOption, focusedValue, getOptionLabel2, isOptionDisabled2, messages, focusableOptions, selectValue]);
var ariaResults = React49.useMemo(function() {
var resultsMsg = "";
if (menuIsOpen && options.length && messages.onFilter) {
var resultsMessage = screenReaderStatus({
count: focusableOptions.length
});
resultsMsg = messages.onFilter({
inputValue,
resultsMessage
});
}
return resultsMsg;
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus]);
var ariaGuidance = React49.useMemo(function() {
var guidanceMsg = "";
if (messages.guidance) {
var context = focusedValue ? "value" : menuIsOpen ? "menu" : "input";
guidanceMsg = messages.guidance({
"aria-label": ariaLabel,
context,
isDisabled: focusedOption && isOptionDisabled2(focusedOption, selectValue),
isMulti,
isSearchable,
tabSelectsValue
});
}
return guidanceMsg;
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled2, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue]);
var ariaContext = "".concat(ariaFocused, " ").concat(ariaResults, " ").concat(ariaGuidance);
var ScreenReaderText = react.jsx(React49.Fragment, null, react.jsx("span", {
id: "aria-selection"
}, ariaSelected), react.jsx("span", {
id: "aria-context"
}, ariaContext));
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus";
return react.jsx(React49.Fragment, null, react.jsx(A11yText$1, {
id: id2
}, isInitialFocus && ScreenReaderText), react.jsx(A11yText$1, {
"aria-live": ariaLive,
"aria-atomic": "false",
"aria-relevant": "additions text"
}, isFocused && !isInitialFocus && ScreenReaderText));
};
var LiveRegion$1 = LiveRegion;
var diacritics = [{
base: "A",
letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
}, {
base: "AA",
letters: "\uA732"
}, {
base: "AE",
letters: "\xC6\u01FC\u01E2"
}, {
base: "AO",
letters: "\uA734"
}, {
base: "AU",
letters: "\uA736"
}, {
base: "AV",
letters: "\uA738\uA73A"
}, {
base: "AY",
letters: "\uA73C"
}, {
base: "B",
letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
}, {
base: "C",
letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
}, {
base: "D",
letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
}, {
base: "DZ",
letters: "\u01F1\u01C4"
}, {
base: "Dz",
letters: "\u01F2\u01C5"
}, {
base: "E",
letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
}, {
base: "F",
letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
}, {
base: "G",
letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
}, {
base: "H",
letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
}, {
base: "I",
letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
}, {
base: "J",
letters: "J\u24BF\uFF2A\u0134\u0248"
}, {
base: "K",
letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
}, {
base: "L",
letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
}, {
base: "LJ",
letters: "\u01C7"
}, {
base: "Lj",
letters: "\u01C8"
}, {
base: "M",
letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
}, {
base: "N",
letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
}, {
base: "NJ",
letters: "\u01CA"
}, {
base: "Nj",
letters: "\u01CB"
}, {
base: "O",
letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
}, {
base: "OI",
letters: "\u01A2"
}, {
base: "OO",
letters: "\uA74E"
}, {
base: "OU",
letters: "\u0222"
}, {
base: "P",
letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
}, {
base: "Q",
letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
}, {
base: "R",
letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
}, {
base: "S",
letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
}, {
base: "T",
letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
}, {
base: "TZ",
letters: "\uA728"
}, {
base: "U",
letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
}, {
base: "V",
letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
}, {
base: "VY",
letters: "\uA760"
}, {
base: "W",
letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
}, {
base: "X",
letters: "X\u24CD\uFF38\u1E8A\u1E8C"
}, {
base: "Y",
letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
}, {
base: "Z",
letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
}, {
base: "a",
letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
}, {
base: "aa",
letters: "\uA733"
}, {
base: "ae",
letters: "\xE6\u01FD\u01E3"
}, {
base: "ao",
letters: "\uA735"
}, {
base: "au",
letters: "\uA737"
}, {
base: "av",
letters: "\uA739\uA73B"
}, {
base: "ay",
letters: "\uA73D"
}, {
base: "b",
letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
}, {
base: "c",
letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
}, {
base: "d",
letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
}, {
base: "dz",
letters: "\u01F3\u01C6"
}, {
base: "e",
letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
}, {
base: "f",
letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
}, {
base: "g",
letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
}, {
base: "h",
letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
}, {
base: "hv",
letters: "\u0195"
}, {
base: "i",
letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
}, {
base: "j",
letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
}, {
base: "k",
letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
}, {
base: "l",
letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
}, {
base: "lj",
letters: "\u01C9"
}, {
base: "m",
letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
}, {
base: "n",
letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
}, {
base: "nj",
letters: "\u01CC"
}, {
base: "o",
letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
}, {
base: "oi",
letters: "\u01A3"
}, {
base: "ou",
letters: "\u0223"
}, {
base: "oo",
letters: "\uA74F"
}, {
base: "p",
letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
}, {
base: "q",
letters: "q\u24E0\uFF51\u024B\uA757\uA759"
}, {
base: "r",
letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
}, {
base: "s",
letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
}, {
base: "t",
letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
}, {
base: "tz",
letters: "\uA729"
}, {
base: "u",
letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
}, {
base: "v",
letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
}, {
base: "vy",
letters: "\uA761"
}, {
base: "w",
letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
}, {
base: "x",
letters: "x\u24E7\uFF58\u1E8B\u1E8D"
}, {
base: "y",
letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
}, {
base: "z",
letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
}];
var anyDiacritic = new RegExp("[" + diacritics.map(function(d2) {
return d2.letters;
}).join("") + "]", "g");
var diacriticToBase = {};
for (i2 = 0; i2 < diacritics.length; i2++) {
diacritic = diacritics[i2];
for (j2 = 0; j2 < diacritic.letters.length; j2++) {
diacriticToBase[diacritic.letters[j2]] = diacritic.base;
}
}
var diacritic;
var j2;
var i2;
var stripDiacritics = function stripDiacritics2(str) {
return str.replace(anyDiacritic, function(match) {
return diacriticToBase[match];
});
};
var memoizedStripDiacriticsForInput = memoizeOne__default["default"](stripDiacritics);
var trimString = function trimString2(str) {
return str.replace(/^\s+|\s+$/g, "");
};
var defaultStringify = function defaultStringify2(option) {
return "".concat(option.label, " ").concat(option.value);
};
var createFilter = function createFilter2(config) {
return function(option, rawInput) {
if (option.data.__isNew__)
return true;
var _ignoreCase$ignoreAcc = _objectSpread({
ignoreCase: true,
ignoreAccents: true,
stringify: defaultStringify,
trim: true,
matchFrom: "any"
}, config), ignoreCase = _ignoreCase$ignoreAcc.ignoreCase, ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents, stringify2 = _ignoreCase$ignoreAcc.stringify, trim = _ignoreCase$ignoreAcc.trim, matchFrom = _ignoreCase$ignoreAcc.matchFrom;
var input = trim ? trimString(rawInput) : rawInput;
var candidate = trim ? trimString(stringify2(option)) : stringify2(option);
if (ignoreCase) {
input = input.toLowerCase();
candidate = candidate.toLowerCase();
}
if (ignoreAccents) {
input = memoizedStripDiacriticsForInput(input);
candidate = stripDiacritics(candidate);
}
return matchFrom === "start" ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
};
};
var _excluded = ["innerRef"];
function DummyInput(_ref3) {
var innerRef = _ref3.innerRef, props = _objectWithoutProperties(_ref3, _excluded);
var filteredProps = index.removeProps(props, "onExited", "in", "enter", "exit", "appear");
return react.jsx("input", _extends2({
ref: innerRef
}, filteredProps, {
css: /* @__PURE__ */ react.css({
label: "dummyInput",
background: 0,
border: 0,
caretColor: "transparent",
fontSize: "inherit",
gridArea: "1 / 1 / 2 / 3",
outline: 0,
padding: 0,
width: 1,
color: "transparent",
left: -100,
opacity: 0,
position: "relative",
transform: "scale(.01)"
}, false ? "" : ";label:DummyInput;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")
}));
}
var cancelScroll = function cancelScroll2(event) {
event.preventDefault();
event.stopPropagation();
};
function useScrollCapture(_ref3) {
var isEnabled = _ref3.isEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
var isBottom = React49.useRef(false);
var isTop = React49.useRef(false);
var touchStart = React49.useRef(0);
var scrollTarget = React49.useRef(null);
var handleEventDelta = React49.useCallback(function(event, delta) {
if (scrollTarget.current === null)
return;
var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight;
var target = scrollTarget.current;
var isDeltaPositive = delta > 0;
var availableScroll = scrollHeight - clientHeight - scrollTop;
var shouldCancelScroll = false;
if (availableScroll > delta && isBottom.current) {
if (onBottomLeave)
onBottomLeave(event);
isBottom.current = false;
}
if (isDeltaPositive && isTop.current) {
if (onTopLeave)
onTopLeave(event);
isTop.current = false;
}
if (isDeltaPositive && delta > availableScroll) {
if (onBottomArrive && !isBottom.current) {
onBottomArrive(event);
}
target.scrollTop = scrollHeight;
shouldCancelScroll = true;
isBottom.current = true;
} else if (!isDeltaPositive && -delta > scrollTop) {
if (onTopArrive && !isTop.current) {
onTopArrive(event);
}
target.scrollTop = 0;
shouldCancelScroll = true;
isTop.current = true;
}
if (shouldCancelScroll) {
cancelScroll(event);
}
}, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
var onWheel = React49.useCallback(function(event) {
handleEventDelta(event, event.deltaY);
}, [handleEventDelta]);
var onTouchStart = React49.useCallback(function(event) {
touchStart.current = event.changedTouches[0].clientY;
}, []);
var onTouchMove = React49.useCallback(function(event) {
var deltaY = touchStart.current - event.changedTouches[0].clientY;
handleEventDelta(event, deltaY);
}, [handleEventDelta]);
var startListening = React49.useCallback(function(el) {
if (!el)
return;
var notPassive = index.supportsPassiveEvents ? {
passive: false
} : false;
el.addEventListener("wheel", onWheel, notPassive);
el.addEventListener("touchstart", onTouchStart, notPassive);
el.addEventListener("touchmove", onTouchMove, notPassive);
}, [onTouchMove, onTouchStart, onWheel]);
var stopListening = React49.useCallback(function(el) {
if (!el)
return;
el.removeEventListener("wheel", onWheel, false);
el.removeEventListener("touchstart", onTouchStart, false);
el.removeEventListener("touchmove", onTouchMove, false);
}, [onTouchMove, onTouchStart, onWheel]);
React49.useEffect(function() {
if (!isEnabled)
return;
var element = scrollTarget.current;
startListening(element);
return function() {
stopListening(element);
};
}, [isEnabled, startListening, stopListening]);
return function(element) {
scrollTarget.current = element;
};
}
var STYLE_KEYS = ["boxSizing", "height", "overflow", "paddingRight", "position"];
var LOCK_STYLES = {
boxSizing: "border-box",
overflow: "hidden",
position: "relative",
height: "100%"
};
function preventTouchMove(e) {
e.preventDefault();
}
function allowTouchMove(e) {
e.stopPropagation();
}
function preventInertiaScroll() {
var top = this.scrollTop;
var totalScroll = this.scrollHeight;
var currentScroll = top + this.offsetHeight;
if (top === 0) {
this.scrollTop = 1;
} else if (currentScroll === totalScroll) {
this.scrollTop = top - 1;
}
}
function isTouchDevice() {
return "ontouchstart" in window || navigator.maxTouchPoints;
}
var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
var activeScrollLocks = 0;
var listenerOptions = {
capture: false,
passive: false
};
function useScrollLock(_ref3) {
var isEnabled = _ref3.isEnabled, _ref$accountForScroll = _ref3.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
var originalStyles = React49.useRef({});
var scrollTarget = React49.useRef(null);
var addScrollLock = React49.useCallback(function(touchScrollTarget) {
if (!canUseDOM2)
return;
var target = document.body;
var targetStyle = target && target.style;
if (accountForScrollbars) {
STYLE_KEYS.forEach(function(key) {
var val = targetStyle && targetStyle[key];
originalStyles.current[key] = val;
});
}
if (accountForScrollbars && activeScrollLocks < 1) {
var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
var clientWidth = document.body ? document.body.clientWidth : 0;
var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
Object.keys(LOCK_STYLES).forEach(function(key) {
var val = LOCK_STYLES[key];
if (targetStyle) {
targetStyle[key] = val;
}
});
if (targetStyle) {
targetStyle.paddingRight = "".concat(adjustedPadding, "px");
}
}
if (target && isTouchDevice()) {
target.addEventListener("touchmove", preventTouchMove, listenerOptions);
if (touchScrollTarget) {
touchScrollTarget.addEventListener("touchstart", preventInertiaScroll, listenerOptions);
touchScrollTarget.addEventListener("touchmove", allowTouchMove, listenerOptions);
}
}
activeScrollLocks += 1;
}, [accountForScrollbars]);
var removeScrollLock = React49.useCallback(function(touchScrollTarget) {
if (!canUseDOM2)
return;
var target = document.body;
var targetStyle = target && target.style;
activeScrollLocks = Math.max(activeScrollLocks - 1, 0);
if (accountForScrollbars && activeScrollLocks < 1) {
STYLE_KEYS.forEach(function(key) {
var val = originalStyles.current[key];
if (targetStyle) {
targetStyle[key] = val;
}
});
}
if (target && isTouchDevice()) {
target.removeEventListener("touchmove", preventTouchMove, listenerOptions);
if (touchScrollTarget) {
touchScrollTarget.removeEventListener("touchstart", preventInertiaScroll, listenerOptions);
touchScrollTarget.removeEventListener("touchmove", allowTouchMove, listenerOptions);
}
}
}, [accountForScrollbars]);
React49.useEffect(function() {
if (!isEnabled)
return;
var element = scrollTarget.current;
addScrollLock(element);
return function() {
removeScrollLock(element);
};
}, [isEnabled, addScrollLock, removeScrollLock]);
return function(element) {
scrollTarget.current = element;
};
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$1() {
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).";
}
var blurSelectInput = function blurSelectInput2() {
return document.activeElement && document.activeElement.blur();
};
var _ref2$1 = false ? {
name: "1kfdb0e",
styles: "position:fixed;left:0;bottom:0;right:0;top:0"
} : {
name: "bp8cua-ScrollManager",
styles: "position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStDVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2sgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9ICgpID0+XG4gIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgJiYgKGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQgYXMgSFRNTEVsZW1lbnQpLmJsdXIoKTtcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gU2Nyb2xsTWFuYWdlcih7XG4gIGNoaWxkcmVuLFxuICBsb2NrRW5hYmxlZCxcbiAgY2FwdHVyZUVuYWJsZWQgPSB0cnVlLFxuICBvbkJvdHRvbUFycml2ZSxcbiAgb25Cb3R0b21MZWF2ZSxcbiAgb25Ub3BBcnJpdmUsXG4gIG9uVG9wTGVhdmUsXG59OiBQcm9wcykge1xuICBjb25zdCBzZXRTY3JvbGxDYXB0dXJlVGFyZ2V0ID0gdXNlU2Nyb2xsQ2FwdHVyZSh7XG4gICAgaXNFbmFibGVkOiBjYXB0dXJlRW5hYmxlZCxcbiAgICBvbkJvdHRvbUFycml2ZSxcbiAgICBvbkJvdHRvbUxlYXZlLFxuICAgIG9uVG9wQXJyaXZlLFxuICAgIG9uVG9wTGVhdmUsXG4gIH0pO1xuICBjb25zdCBzZXRTY3JvbGxMb2NrVGFyZ2V0ID0gdXNlU2Nyb2xsTG9jayh7IGlzRW5hYmxlZDogbG9ja0VuYWJsZWQgfSk7XG5cbiAgY29uc3QgdGFyZ2V0UmVmOiBSZWZDYWxsYmFjazxIVE1MRWxlbWVudD4gPSAoZWxlbWVudCkgPT4ge1xuICAgIHNldFNjcm9sbENhcHR1cmVUYXJnZXQoZWxlbWVudCk7XG4gICAgc2V0U2Nyb2xsTG9ja1RhcmdldChlbGVtZW50KTtcbiAgfTtcblxuICByZXR1cm4gKFxuICAgIDxGcmFnbWVudD5cbiAgICAgIHtsb2NrRW5hYmxlZCAmJiAoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBvbkNsaWNrPXtibHVyU2VsZWN0SW5wdXR9XG4gICAgICAgICAgY3NzPXt7IHBvc2l0aW9uOiAnZml4ZWQnLCBsZWZ0OiAwLCBib3R0b206IDAsIHJpZ2h0OiAwLCB0b3A6IDAgfX1cbiAgICAgICAgLz5cbiAgICAgICl9XG4gICAgICB7Y2hpbGRyZW4odGFyZ2V0UmVmKX1cbiAgICA8L0ZyYWdtZW50PlxuICApO1xufVxuIl19 */",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
};
function ScrollManager(_ref3) {
var children = _ref3.children, lockEnabled = _ref3.lockEnabled, _ref$captureEnabled = _ref3.captureEnabled, captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
var setScrollCaptureTarget = useScrollCapture({
isEnabled: captureEnabled,
onBottomArrive,
onBottomLeave,
onTopArrive,
onTopLeave
});
var setScrollLockTarget = useScrollLock({
isEnabled: lockEnabled
});
var targetRef = function targetRef2(element) {
setScrollCaptureTarget(element);
setScrollLockTarget(element);
};
return react.jsx(React49.Fragment, null, lockEnabled && react.jsx("div", {
onClick: blurSelectInput,
css: _ref2$1
}), children(targetRef));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__() {
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).";
}
var _ref2 = false ? {
name: "1a0ro4n-requiredInput",
styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
} : {
name: "5kkxb2-requiredInput-RequiredInput",
styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var RequiredInput = function RequiredInput2(_ref3) {
var name = _ref3.name, onFocus = _ref3.onFocus;
return react.jsx("input", {
required: true,
name,
tabIndex: -1,
"aria-hidden": "true",
onFocus,
css: _ref2,
value: "",
onChange: function onChange() {
}
});
};
var RequiredInput$1 = RequiredInput;
var formatGroupLabel = function formatGroupLabel2(group) {
return group.label;
};
var getOptionLabel$1 = function getOptionLabel2(option) {
return option.label;
};
var getOptionValue$1 = function getOptionValue2(option) {
return option.value;
};
var isOptionDisabled = function isOptionDisabled2(option) {
return !!option.isDisabled;
};
var defaultStyles = {
clearIndicator: index.clearIndicatorCSS,
container: index.containerCSS,
control: index.css,
dropdownIndicator: index.dropdownIndicatorCSS,
group: index.groupCSS,
groupHeading: index.groupHeadingCSS,
indicatorsContainer: index.indicatorsContainerCSS,
indicatorSeparator: index.indicatorSeparatorCSS,
input: index.inputCSS,
loadingIndicator: index.loadingIndicatorCSS,
loadingMessage: index.loadingMessageCSS,
menu: index.menuCSS,
menuList: index.menuListCSS,
menuPortal: index.menuPortalCSS,
multiValue: index.multiValueCSS,
multiValueLabel: index.multiValueLabelCSS,
multiValueRemove: index.multiValueRemoveCSS,
noOptionsMessage: index.noOptionsMessageCSS,
option: index.optionCSS,
placeholder: index.placeholderCSS,
singleValue: index.css$1,
valueContainer: index.valueContainerCSS
};
function mergeStyles(source) {
var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var styles = _objectSpread({}, source);
Object.keys(target).forEach(function(keyAsString) {
var key = keyAsString;
if (source[key]) {
styles[key] = function(rsCss, props) {
return target[key](source[key](rsCss, props), props);
};
} else {
styles[key] = target[key];
}
});
return styles;
}
var colors = {
primary: "#2684FF",
primary75: "#4C9AFF",
primary50: "#B2D4FF",
primary25: "#DEEBFF",
danger: "#DE350B",
dangerLight: "#FFBDAD",
neutral0: "hsl(0, 0%, 100%)",
neutral5: "hsl(0, 0%, 95%)",
neutral10: "hsl(0, 0%, 90%)",
neutral20: "hsl(0, 0%, 80%)",
neutral30: "hsl(0, 0%, 70%)",
neutral40: "hsl(0, 0%, 60%)",
neutral50: "hsl(0, 0%, 50%)",
neutral60: "hsl(0, 0%, 40%)",
neutral70: "hsl(0, 0%, 30%)",
neutral80: "hsl(0, 0%, 20%)",
neutral90: "hsl(0, 0%, 10%)"
};
var borderRadius = 4;
var baseUnit = 4;
var controlHeight = 38;
var menuGutter = baseUnit * 2;
var spacing = {
baseUnit,
controlHeight,
menuGutter
};
var defaultTheme = {
borderRadius,
colors,
spacing
};
var defaultProps = {
"aria-live": "polite",
backspaceRemovesValue: true,
blurInputOnSelect: index.isTouchCapable(),
captureMenuScroll: !index.isTouchCapable(),
classNames: {},
closeMenuOnSelect: true,
closeMenuOnScroll: false,
components: {},
controlShouldRenderValue: true,
escapeClearsValue: false,
filterOption: createFilter(),
formatGroupLabel,
getOptionLabel: getOptionLabel$1,
getOptionValue: getOptionValue$1,
isDisabled: false,
isLoading: false,
isMulti: false,
isRtl: false,
isSearchable: true,
isOptionDisabled,
loadingMessage: function loadingMessage() {
return "Loading...";
},
maxMenuHeight: 300,
minMenuHeight: 140,
menuIsOpen: false,
menuPlacement: "bottom",
menuPosition: "absolute",
menuShouldBlockScroll: false,
menuShouldScrollIntoView: !index.isMobileDevice(),
noOptionsMessage: function noOptionsMessage() {
return "No options";
},
openMenuOnFocus: false,
openMenuOnClick: true,
options: [],
pageSize: 5,
placeholder: "Select...",
screenReaderStatus: function screenReaderStatus(_ref3) {
var count = _ref3.count;
return "".concat(count, " result").concat(count !== 1 ? "s" : "", " available");
},
styles: {},
tabIndex: 0,
tabSelectsValue: true,
unstyled: false
};
function toCategorizedOption(props, option, selectValue, index2) {
var isDisabled = _isOptionDisabled(props, option, selectValue);
var isSelected = _isOptionSelected(props, option, selectValue);
var label = getOptionLabel(props, option);
var value = getOptionValue(props, option);
return {
type: "option",
data: option,
isDisabled,
isSelected,
label,
value,
index: index2
};
}
function buildCategorizedOptions(props, selectValue) {
return props.options.map(function(groupOrOption, groupOrOptionIndex) {
if ("options" in groupOrOption) {
var categorizedOptions = groupOrOption.options.map(function(option, optionIndex) {
return toCategorizedOption(props, option, selectValue, optionIndex);
}).filter(function(categorizedOption2) {
return isFocusable(props, categorizedOption2);
});
return categorizedOptions.length > 0 ? {
type: "group",
data: groupOrOption,
options: categorizedOptions,
index: groupOrOptionIndex
} : void 0;
}
var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
return isFocusable(props, categorizedOption) ? categorizedOption : void 0;
}).filter(index.notNullish);
}
function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
return categorizedOptions.reduce(function(optionsAccumulator, categorizedOption) {
if (categorizedOption.type === "group") {
optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function(option) {
return option.data;
})));
} else {
optionsAccumulator.push(categorizedOption.data);
}
return optionsAccumulator;
}, []);
}
function buildFocusableOptions(props, selectValue) {
return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
}
function isFocusable(props, categorizedOption) {
var _props$inputValue = props.inputValue, inputValue = _props$inputValue === void 0 ? "" : _props$inputValue;
var data = categorizedOption.data, isSelected = categorizedOption.isSelected, label = categorizedOption.label, value = categorizedOption.value;
return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
label,
value,
data
}, inputValue);
}
function getNextFocusedValue(state, nextSelectValue) {
var focusedValue = state.focusedValue, lastSelectValue = state.selectValue;
var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
if (lastFocusedIndex > -1) {
var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
if (nextFocusedIndex > -1) {
return focusedValue;
} else if (lastFocusedIndex < nextSelectValue.length) {
return nextSelectValue[lastFocusedIndex];
}
}
return null;
}
function getNextFocusedOption(state, options) {
var lastFocusedOption = state.focusedOption;
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
}
var getOptionLabel = function getOptionLabel2(props, data) {
return props.getOptionLabel(data);
};
var getOptionValue = function getOptionValue2(props, data) {
return props.getOptionValue(data);
};
function _isOptionDisabled(props, option, selectValue) {
return typeof props.isOptionDisabled === "function" ? props.isOptionDisabled(option, selectValue) : false;
}
function _isOptionSelected(props, option, selectValue) {
if (selectValue.indexOf(option) > -1)
return true;
if (typeof props.isOptionSelected === "function") {
return props.isOptionSelected(option, selectValue);
}
var candidate = getOptionValue(props, option);
return selectValue.some(function(i3) {
return getOptionValue(props, i3) === candidate;
});
}
function _filterOption(props, option, inputValue) {
return props.filterOption ? props.filterOption(option, inputValue) : true;
}
var shouldHideSelectedOptions = function shouldHideSelectedOptions2(props) {
var hideSelectedOptions = props.hideSelectedOptions, isMulti = props.isMulti;
if (hideSelectedOptions === void 0)
return isMulti;
return hideSelectedOptions;
};
var instanceId = 1;
var Select = /* @__PURE__ */ function(_Component) {
_inherits(Select2, _Component);
var _super = _createSuper(Select2);
function Select2(_props) {
var _this;
_classCallCheck(this, Select2);
_this = _super.call(this, _props);
_this.state = {
ariaSelection: null,
focusedOption: null,
focusedValue: null,
inputIsHidden: false,
isFocused: false,
selectValue: [],
clearFocusValueOnUpdate: false,
prevWasFocused: false,
inputIsHiddenAfterUpdate: void 0,
prevProps: void 0
};
_this.blockOptionHover = false;
_this.isComposing = false;
_this.commonProps = void 0;
_this.initialTouchX = 0;
_this.initialTouchY = 0;
_this.instancePrefix = "";
_this.openAfterFocus = false;
_this.scrollToFocusedOptionOnUpdate = false;
_this.userIsDragging = void 0;
_this.controlRef = null;
_this.getControlRef = function(ref) {
_this.controlRef = ref;
};
_this.focusedOptionRef = null;
_this.getFocusedOptionRef = function(ref) {
_this.focusedOptionRef = ref;
};
_this.menuListRef = null;
_this.getMenuListRef = function(ref) {
_this.menuListRef = ref;
};
_this.inputRef = null;
_this.getInputRef = function(ref) {
_this.inputRef = ref;
};
_this.focus = _this.focusInput;
_this.blur = _this.blurInput;
_this.onChange = function(newValue, actionMeta) {
var _this$props = _this.props, onChange = _this$props.onChange, name = _this$props.name;
actionMeta.name = name;
_this.ariaOnChange(newValue, actionMeta);
onChange(newValue, actionMeta);
};
_this.setValue = function(newValue, action, option) {
var _this$props2 = _this.props, closeMenuOnSelect = _this$props2.closeMenuOnSelect, isMulti = _this$props2.isMulti, inputValue = _this$props2.inputValue;
_this.onInputChange("", {
action: "set-value",
prevInputValue: inputValue
});
if (closeMenuOnSelect) {
_this.setState({
inputIsHiddenAfterUpdate: !isMulti
});
_this.onMenuClose();
}
_this.setState({
clearFocusValueOnUpdate: true
});
_this.onChange(newValue, {
action,
option
});
};
_this.selectOption = function(newValue) {
var _this$props3 = _this.props, blurInputOnSelect = _this$props3.blurInputOnSelect, isMulti = _this$props3.isMulti, name = _this$props3.name;
var selectValue = _this.state.selectValue;
var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
var isDisabled = _this.isOptionDisabled(newValue, selectValue);
if (deselected) {
var candidate = _this.getOptionValue(newValue);
_this.setValue(index.multiValueAsValue(selectValue.filter(function(i3) {
return _this.getOptionValue(i3) !== candidate;
})), "deselect-option", newValue);
} else if (!isDisabled) {
if (isMulti) {
_this.setValue(index.multiValueAsValue([].concat(_toConsumableArray(selectValue), [newValue])), "select-option", newValue);
} else {
_this.setValue(index.singleValueAsValue(newValue), "select-option");
}
} else {
_this.ariaOnChange(index.singleValueAsValue(newValue), {
action: "select-option",
option: newValue,
name
});
return;
}
if (blurInputOnSelect) {
_this.blurInput();
}
};
_this.removeValue = function(removedValue) {
var isMulti = _this.props.isMulti;
var selectValue = _this.state.selectValue;
var candidate = _this.getOptionValue(removedValue);
var newValueArray = selectValue.filter(function(i3) {
return _this.getOptionValue(i3) !== candidate;
});
var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
_this.onChange(newValue, {
action: "remove-value",
removedValue
});
_this.focusInput();
};
_this.clearValue = function() {
var selectValue = _this.state.selectValue;
_this.onChange(index.valueTernary(_this.props.isMulti, [], null), {
action: "clear",
removedValues: selectValue
});
};
_this.popValue = function() {
var isMulti = _this.props.isMulti;
var selectValue = _this.state.selectValue;
var lastSelectedValue = selectValue[selectValue.length - 1];
var newValueArray = selectValue.slice(0, selectValue.length - 1);
var newValue = index.valueTernary(isMulti, newValueArray, newValueArray[0] || null);
_this.onChange(newValue, {
action: "pop-value",
removedValue: lastSelectedValue
});
};
_this.getValue = function() {
return _this.state.selectValue;
};
_this.cx = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return index.classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
};
_this.getOptionLabel = function(data) {
return getOptionLabel(_this.props, data);
};
_this.getOptionValue = function(data) {
return getOptionValue(_this.props, data);
};
_this.getStyles = function(key, props) {
var unstyled = _this.props.unstyled;
var base = defaultStyles[key](props, unstyled);
base.boxSizing = "border-box";
var custom = _this.props.styles[key];
return custom ? custom(base, props) : base;
};
_this.getClassNames = function(key, props) {
var _this$props$className, _this$props$className2;
return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
};
_this.getElementId = function(element) {
return "".concat(_this.instancePrefix, "-").concat(element);
};
_this.getComponents = function() {
return index.defaultComponents(_this.props);
};
_this.buildCategorizedOptions = function() {
return buildCategorizedOptions(_this.props, _this.state.selectValue);
};
_this.getCategorizedOptions = function() {
return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
};
_this.buildFocusableOptions = function() {
return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
};
_this.getFocusableOptions = function() {
return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
};
_this.ariaOnChange = function(value, actionMeta) {
_this.setState({
ariaSelection: _objectSpread({
value
}, actionMeta)
});
};
_this.onMenuMouseDown = function(event) {
if (event.button !== 0) {
return;
}
event.stopPropagation();
event.preventDefault();
_this.focusInput();
};
_this.onMenuMouseMove = function(event) {
_this.blockOptionHover = false;
};
_this.onControlMouseDown = function(event) {
if (event.defaultPrevented) {
return;
}
var openMenuOnClick = _this.props.openMenuOnClick;
if (!_this.state.isFocused) {
if (openMenuOnClick) {
_this.openAfterFocus = true;
}
_this.focusInput();
} else if (!_this.props.menuIsOpen) {
if (openMenuOnClick) {
_this.openMenu("first");
}
} else {
if (event.target.tagName !== "INPUT" && event.target.tagName !== "TEXTAREA") {
_this.onMenuClose();
}
}
if (event.target.tagName !== "INPUT" && event.target.tagName !== "TEXTAREA") {
event.preventDefault();
}
};
_this.onDropdownIndicatorMouseDown = function(event) {
if (event && event.type === "mousedown" && event.button !== 0) {
return;
}
if (_this.props.isDisabled)
return;
var _this$props4 = _this.props, isMulti = _this$props4.isMulti, menuIsOpen = _this$props4.menuIsOpen;
_this.focusInput();
if (menuIsOpen) {
_this.setState({
inputIsHiddenAfterUpdate: !isMulti
});
_this.onMenuClose();
} else {
_this.openMenu("first");
}
event.preventDefault();
};
_this.onClearIndicatorMouseDown = function(event) {
if (event && event.type === "mousedown" && event.button !== 0) {
return;
}
_this.clearValue();
event.preventDefault();
_this.openAfterFocus = false;
if (event.type === "touchend") {
_this.focusInput();
} else {
setTimeout(function() {
return _this.focusInput();
});
}
};
_this.onScroll = function(event) {
if (typeof _this.props.closeMenuOnScroll === "boolean") {
if (event.target instanceof HTMLElement && index.isDocumentElement(event.target)) {
_this.props.onMenuClose();
}
} else if (typeof _this.props.closeMenuOnScroll === "function") {
if (_this.props.closeMenuOnScroll(event)) {
_this.props.onMenuClose();
}
}
};
_this.onCompositionStart = function() {
_this.isComposing = true;
};
_this.onCompositionEnd = function() {
_this.isComposing = false;
};
_this.onTouchStart = function(_ref22) {
var touches = _ref22.touches;
var touch = touches && touches.item(0);
if (!touch) {
return;
}
_this.initialTouchX = touch.clientX;
_this.initialTouchY = touch.clientY;
_this.userIsDragging = false;
};
_this.onTouchMove = function(_ref3) {
var touches = _ref3.touches;
var touch = touches && touches.item(0);
if (!touch) {
return;
}
var deltaX = Math.abs(touch.clientX - _this.initialTouchX);
var deltaY = Math.abs(touch.clientY - _this.initialTouchY);
var moveThreshold = 5;
_this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
};
_this.onTouchEnd = function(event) {
if (_this.userIsDragging)
return;
if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {
_this.blurInput();
}
_this.initialTouchX = 0;
_this.initialTouchY = 0;
};
_this.onControlTouchEnd = function(event) {
if (_this.userIsDragging)
return;
_this.onControlMouseDown(event);
};
_this.onClearIndicatorTouchEnd = function(event) {
if (_this.userIsDragging)
return;
_this.onClearIndicatorMouseDown(event);
};
_this.onDropdownIndicatorTouchEnd = function(event) {
if (_this.userIsDragging)
return;
_this.onDropdownIndicatorMouseDown(event);
};
_this.handleInputChange = function(event) {
var prevInputValue = _this.props.inputValue;
var inputValue = event.currentTarget.value;
_this.setState({
inputIsHiddenAfterUpdate: false
});
_this.onInputChange(inputValue, {
action: "input-change",
prevInputValue
});
if (!_this.props.menuIsOpen) {
_this.onMenuOpen();
}
};
_this.onInputFocus = function(event) {
if (_this.props.onFocus) {
_this.props.onFocus(event);
}
_this.setState({
inputIsHiddenAfterUpdate: false,
isFocused: true
});
if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
_this.openMenu("first");
}
_this.openAfterFocus = false;
};
_this.onInputBlur = function(event) {
var prevInputValue = _this.props.inputValue;
if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
_this.inputRef.focus();
return;
}
if (_this.props.onBlur) {
_this.props.onBlur(event);
}
_this.onInputChange("", {
action: "input-blur",
prevInputValue
});
_this.onMenuClose();
_this.setState({
focusedValue: null,
isFocused: false
});
};
_this.onOptionHover = function(focusedOption) {
if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
return;
}
_this.setState({
focusedOption
});
};
_this.shouldHideSelectedOptions = function() {
return shouldHideSelectedOptions(_this.props);
};
_this.onValueInputFocus = function(e) {
e.preventDefault();
e.stopPropagation();
_this.focus();
};
_this.onKeyDown = function(event) {
var _this$props5 = _this.props, isMulti = _this$props5.isMulti, backspaceRemovesValue = _this$props5.backspaceRemovesValue, escapeClearsValue = _this$props5.escapeClearsValue, inputValue = _this$props5.inputValue, isClearable = _this$props5.isClearable, isDisabled = _this$props5.isDisabled, menuIsOpen = _this$props5.menuIsOpen, onKeyDown = _this$props5.onKeyDown, tabSelectsValue = _this$props5.tabSelectsValue, openMenuOnFocus = _this$props5.openMenuOnFocus;
var _this$state = _this.state, focusedOption = _this$state.focusedOption, focusedValue = _this$state.focusedValue, selectValue = _this$state.selectValue;
if (isDisabled)
return;
if (typeof onKeyDown === "function") {
onKeyDown(event);
if (event.defaultPrevented) {
return;
}
}
_this.blockOptionHover = true;
switch (event.key) {
case "ArrowLeft":
if (!isMulti || inputValue)
return;
_this.focusValue("previous");
break;
case "ArrowRight":
if (!isMulti || inputValue)
return;
_this.focusValue("next");
break;
case "Delete":
case "Backspace":
if (inputValue)
return;
if (focusedValue) {
_this.removeValue(focusedValue);
} else {
if (!backspaceRemovesValue)
return;
if (isMulti) {
_this.popValue();
} else if (isClearable) {
_this.clearValue();
}
}
break;
case "Tab":
if (_this.isComposing)
return;
if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
return;
}
_this.selectOption(focusedOption);
break;
case "Enter":
if (event.keyCode === 229) {
break;
}
if (menuIsOpen) {
if (!focusedOption)
return;
if (_this.isComposing)
return;
_this.selectOption(focusedOption);
break;
}
return;
case "Escape":
if (menuIsOpen) {
_this.setState({
inputIsHiddenAfterUpdate: false
});
_this.onInputChange("", {
action: "menu-close",
prevInputValue: inputValue
});
_this.onMenuClose();
} else if (isClearable && escapeClearsValue) {
_this.clearValue();
}
break;
case " ":
if (inputValue) {
return;
}
if (!menuIsOpen) {
_this.openMenu("first");
break;
}
if (!focusedOption)
return;
_this.selectOption(focusedOption);
break;
case "ArrowUp":
if (menuIsOpen) {
_this.focusOption("up");
} else {
_this.openMenu("last");
}
break;
case "ArrowDown":
if (menuIsOpen) {
_this.focusOption("down");
} else {
_this.openMenu("first");
}
break;
case "PageUp":
if (!menuIsOpen)
return;
_this.focusOption("pageup");
break;
case "PageDown":
if (!menuIsOpen)
return;
_this.focusOption("pagedown");
break;
case "Home":
if (!menuIsOpen)
return;
_this.focusOption("first");
break;
case "End":
if (!menuIsOpen)
return;
_this.focusOption("last");
break;
default:
return;
}
event.preventDefault();
};
_this.instancePrefix = "react-select-" + (_this.props.instanceId || ++instanceId);
_this.state.selectValue = index.cleanValue(_props.value);
if (_props.menuIsOpen && _this.state.selectValue.length) {
var focusableOptions = _this.buildFocusableOptions();
var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
_this.state.focusedOption = focusableOptions[optionIndex];
}
return _this;
}
_createClass(Select2, [{
key: "componentDidMount",
value: function componentDidMount() {
this.startListeningComposition();
this.startListeningToTouch();
if (this.props.closeMenuOnScroll && document && document.addEventListener) {
document.addEventListener("scroll", this.onScroll, true);
}
if (this.props.autoFocus) {
this.focusInput();
}
if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props6 = this.props, isDisabled = _this$props6.isDisabled, menuIsOpen = _this$props6.menuIsOpen;
var isFocused = this.state.isFocused;
if (isFocused && !isDisabled && prevProps.isDisabled || isFocused && menuIsOpen && !prevProps.menuIsOpen) {
this.focusInput();
}
if (isFocused && isDisabled && !prevProps.isDisabled) {
this.setState({
isFocused: false
}, this.onMenuClose);
} else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
this.setState({
isFocused: true
});
}
if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
index.scrollIntoView(this.menuListRef, this.focusedOptionRef);
this.scrollToFocusedOptionOnUpdate = false;
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.stopListeningComposition();
this.stopListeningToTouch();
document.removeEventListener("scroll", this.onScroll, true);
}
}, {
key: "onMenuOpen",
value: function onMenuOpen() {
this.props.onMenuOpen();
}
}, {
key: "onMenuClose",
value: function onMenuClose() {
this.onInputChange("", {
action: "menu-close",
prevInputValue: this.props.inputValue
});
this.props.onMenuClose();
}
}, {
key: "onInputChange",
value: function onInputChange(newValue, actionMeta) {
this.props.onInputChange(newValue, actionMeta);
}
}, {
key: "focusInput",
value: function focusInput() {
if (!this.inputRef)
return;
this.inputRef.focus();
}
}, {
key: "blurInput",
value: function blurInput() {
if (!this.inputRef)
return;
this.inputRef.blur();
}
}, {
key: "openMenu",
value: function openMenu(focusOption) {
var _this2 = this;
var _this$state2 = this.state, selectValue = _this$state2.selectValue, isFocused = _this$state2.isFocused;
var focusableOptions = this.buildFocusableOptions();
var openAtIndex = focusOption === "first" ? 0 : focusableOptions.length - 1;
if (!this.props.isMulti) {
var selectedIndex = focusableOptions.indexOf(selectValue[0]);
if (selectedIndex > -1) {
openAtIndex = selectedIndex;
}
}
this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
this.setState({
inputIsHiddenAfterUpdate: false,
focusedValue: null,
focusedOption: focusableOptions[openAtIndex]
}, function() {
return _this2.onMenuOpen();
});
}
}, {
key: "focusValue",
value: function focusValue(direction) {
var _this$state3 = this.state, selectValue = _this$state3.selectValue, focusedValue = _this$state3.focusedValue;
if (!this.props.isMulti)
return;
this.setState({
focusedOption: null
});
var focusedIndex = selectValue.indexOf(focusedValue);
if (!focusedValue) {
focusedIndex = -1;
}
var lastIndex = selectValue.length - 1;
var nextFocus = -1;
if (!selectValue.length)
return;
switch (direction) {
case "previous":
if (focusedIndex === 0) {
nextFocus = 0;
} else if (focusedIndex === -1) {
nextFocus = lastIndex;
} else {
nextFocus = focusedIndex - 1;
}
break;
case "next":
if (focusedIndex > -1 && focusedIndex < lastIndex) {
nextFocus = focusedIndex + 1;
}
break;
}
this.setState({
inputIsHidden: nextFocus !== -1,
focusedValue: selectValue[nextFocus]
});
}
}, {
key: "focusOption",
value: function focusOption() {
var direction = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "first";
var pageSize = this.props.pageSize;
var focusedOption = this.state.focusedOption;
var options = this.getFocusableOptions();
if (!options.length)
return;
var nextFocus = 0;
var focusedIndex = options.indexOf(focusedOption);
if (!focusedOption) {
focusedIndex = -1;
}
if (direction === "up") {
nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
} else if (direction === "down") {
nextFocus = (focusedIndex + 1) % options.length;
} else if (direction === "pageup") {
nextFocus = focusedIndex - pageSize;
if (nextFocus < 0)
nextFocus = 0;
} else if (direction === "pagedown") {
nextFocus = focusedIndex + pageSize;
if (nextFocus > options.length - 1)
nextFocus = options.length - 1;
} else if (direction === "last") {
nextFocus = options.length - 1;
}
this.scrollToFocusedOptionOnUpdate = true;
this.setState({
focusedOption: options[nextFocus],
focusedValue: null
});
}
}, {
key: "getTheme",
value: function getTheme() {
if (!this.props.theme) {
return defaultTheme;
}
if (typeof this.props.theme === "function") {
return this.props.theme(defaultTheme);
}
return _objectSpread(_objectSpread({}, defaultTheme), this.props.theme);
}
}, {
key: "getCommonProps",
value: function getCommonProps() {
var clearValue = this.clearValue, cx = this.cx, getStyles = this.getStyles, getClassNames = this.getClassNames, getValue2 = this.getValue, selectOption = this.selectOption, setValue = this.setValue, props = this.props;
var isMulti = props.isMulti, isRtl = props.isRtl, options = props.options;
var hasValue = this.hasValue();
return {
clearValue,
cx,
getStyles,
getClassNames,
getValue: getValue2,
hasValue,
isMulti,
isRtl,
options,
selectOption,
selectProps: props,
setValue,
theme: this.getTheme()
};
}
}, {
key: "hasValue",
value: function hasValue() {
var selectValue = this.state.selectValue;
return selectValue.length > 0;
}
}, {
key: "hasOptions",
value: function hasOptions() {
return !!this.getFocusableOptions().length;
}
}, {
key: "isClearable",
value: function isClearable() {
var _this$props7 = this.props, isClearable2 = _this$props7.isClearable, isMulti = _this$props7.isMulti;
if (isClearable2 === void 0)
return isMulti;
return isClearable2;
}
}, {
key: "isOptionDisabled",
value: function isOptionDisabled2(option, selectValue) {
return _isOptionDisabled(this.props, option, selectValue);
}
}, {
key: "isOptionSelected",
value: function isOptionSelected(option, selectValue) {
return _isOptionSelected(this.props, option, selectValue);
}
}, {
key: "filterOption",
value: function filterOption(option, inputValue) {
return _filterOption(this.props, option, inputValue);
}
}, {
key: "formatOptionLabel",
value: function formatOptionLabel(data, context) {
if (typeof this.props.formatOptionLabel === "function") {
var _inputValue = this.props.inputValue;
var _selectValue = this.state.selectValue;
return this.props.formatOptionLabel(data, {
context,
inputValue: _inputValue,
selectValue: _selectValue
});
} else {
return this.getOptionLabel(data);
}
}
}, {
key: "formatGroupLabel",
value: function formatGroupLabel2(data) {
return this.props.formatGroupLabel(data);
}
}, {
key: "startListeningComposition",
value: function startListeningComposition() {
if (document && document.addEventListener) {
document.addEventListener("compositionstart", this.onCompositionStart, false);
document.addEventListener("compositionend", this.onCompositionEnd, false);
}
}
}, {
key: "stopListeningComposition",
value: function stopListeningComposition() {
if (document && document.removeEventListener) {
document.removeEventListener("compositionstart", this.onCompositionStart);
document.removeEventListener("compositionend", this.onCompositionEnd);
}
}
}, {
key: "startListeningToTouch",
value: function startListeningToTouch() {
if (document && document.addEventListener) {
document.addEventListener("touchstart", this.onTouchStart, false);
document.addEventListener("touchmove", this.onTouchMove, false);
document.addEventListener("touchend", this.onTouchEnd, false);
}
}
}, {
key: "stopListeningToTouch",
value: function stopListeningToTouch() {
if (document && document.removeEventListener) {
document.removeEventListener("touchstart", this.onTouchStart);
document.removeEventListener("touchmove", this.onTouchMove);
document.removeEventListener("touchend", this.onTouchEnd);
}
}
}, {
key: "renderInput",
value: function renderInput() {
var _this$props8 = this.props, isDisabled = _this$props8.isDisabled, isSearchable = _this$props8.isSearchable, inputId = _this$props8.inputId, inputValue = _this$props8.inputValue, tabIndex = _this$props8.tabIndex, form = _this$props8.form, menuIsOpen = _this$props8.menuIsOpen, required = _this$props8.required;
var _this$getComponents = this.getComponents(), Input = _this$getComponents.Input;
var _this$state4 = this.state, inputIsHidden = _this$state4.inputIsHidden, ariaSelection = _this$state4.ariaSelection;
var commonProps = this.commonProps;
var id2 = inputId || this.getElementId("input");
var ariaAttributes = _objectSpread(_objectSpread(_objectSpread({
"aria-autocomplete": "list",
"aria-expanded": menuIsOpen,
"aria-haspopup": true,
"aria-errormessage": this.props["aria-errormessage"],
"aria-invalid": this.props["aria-invalid"],
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-required": required,
role: "combobox"
}, menuIsOpen && {
"aria-controls": this.getElementId("listbox"),
"aria-owns": this.getElementId("listbox")
}), !isSearchable && {
"aria-readonly": true
}), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus" && {
"aria-describedby": this.getElementId("live-region")
} : {
"aria-describedby": this.getElementId("placeholder")
});
if (!isSearchable) {
return /* @__PURE__ */ React__namespace.createElement(DummyInput, _extends2({
id: id2,
innerRef: this.getInputRef,
onBlur: this.onInputBlur,
onChange: index.noop,
onFocus: this.onInputFocus,
disabled: isDisabled,
tabIndex,
inputMode: "none",
form,
value: ""
}, ariaAttributes));
}
return /* @__PURE__ */ React__namespace.createElement(Input, _extends2({}, commonProps, {
autoCapitalize: "none",
autoComplete: "off",
autoCorrect: "off",
id: id2,
innerRef: this.getInputRef,
isDisabled,
isHidden: inputIsHidden,
onBlur: this.onInputBlur,
onChange: this.handleInputChange,
onFocus: this.onInputFocus,
spellCheck: "false",
tabIndex,
form,
type: "text",
value: inputValue
}, ariaAttributes));
}
}, {
key: "renderPlaceholderOrValue",
value: function renderPlaceholderOrValue() {
var _this3 = this;
var _this$getComponents2 = this.getComponents(), MultiValue = _this$getComponents2.MultiValue, MultiValueContainer = _this$getComponents2.MultiValueContainer, MultiValueLabel = _this$getComponents2.MultiValueLabel, MultiValueRemove = _this$getComponents2.MultiValueRemove, SingleValue = _this$getComponents2.SingleValue, Placeholder = _this$getComponents2.Placeholder;
var commonProps = this.commonProps;
var _this$props9 = this.props, controlShouldRenderValue = _this$props9.controlShouldRenderValue, isDisabled = _this$props9.isDisabled, isMulti = _this$props9.isMulti, inputValue = _this$props9.inputValue, placeholder = _this$props9.placeholder;
var _this$state5 = this.state, selectValue = _this$state5.selectValue, focusedValue = _this$state5.focusedValue, isFocused = _this$state5.isFocused;
if (!this.hasValue() || !controlShouldRenderValue) {
return inputValue ? null : /* @__PURE__ */ React__namespace.createElement(Placeholder, _extends2({}, commonProps, {
key: "placeholder",
isDisabled,
isFocused,
innerProps: {
id: this.getElementId("placeholder")
}
}), placeholder);
}
if (isMulti) {
return selectValue.map(function(opt, index2) {
var isOptionFocused = opt === focusedValue;
var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
return /* @__PURE__ */ React__namespace.createElement(MultiValue, _extends2({}, commonProps, {
components: {
Container: MultiValueContainer,
Label: MultiValueLabel,
Remove: MultiValueRemove
},
isFocused: isOptionFocused,
isDisabled,
key,
index: index2,
removeProps: {
onClick: function onClick() {
return _this3.removeValue(opt);
},
onTouchEnd: function onTouchEnd() {
return _this3.removeValue(opt);
},
onMouseDown: function onMouseDown(e) {
e.preventDefault();
}
},
data: opt
}), _this3.formatOptionLabel(opt, "value"));
});
}
if (inputValue) {
return null;
}
var singleValue = selectValue[0];
return /* @__PURE__ */ React__namespace.createElement(SingleValue, _extends2({}, commonProps, {
data: singleValue,
isDisabled
}), this.formatOptionLabel(singleValue, "value"));
}
}, {
key: "renderClearIndicator",
value: function renderClearIndicator() {
var _this$getComponents3 = this.getComponents(), ClearIndicator = _this$getComponents3.ClearIndicator;
var commonProps = this.commonProps;
var _this$props10 = this.props, isDisabled = _this$props10.isDisabled, isLoading = _this$props10.isLoading;
var isFocused = this.state.isFocused;
if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
return null;
}
var innerProps = {
onMouseDown: this.onClearIndicatorMouseDown,
onTouchEnd: this.onClearIndicatorTouchEnd,
"aria-hidden": "true"
};
return /* @__PURE__ */ React__namespace.createElement(ClearIndicator, _extends2({}, commonProps, {
innerProps,
isFocused
}));
}
}, {
key: "renderLoadingIndicator",
value: function renderLoadingIndicator() {
var _this$getComponents4 = this.getComponents(), LoadingIndicator = _this$getComponents4.LoadingIndicator;
var commonProps = this.commonProps;
var _this$props11 = this.props, isDisabled = _this$props11.isDisabled, isLoading = _this$props11.isLoading;
var isFocused = this.state.isFocused;
if (!LoadingIndicator || !isLoading)
return null;
var innerProps = {
"aria-hidden": "true"
};
return /* @__PURE__ */ React__namespace.createElement(LoadingIndicator, _extends2({}, commonProps, {
innerProps,
isDisabled,
isFocused
}));
}
}, {
key: "renderIndicatorSeparator",
value: function renderIndicatorSeparator() {
var _this$getComponents5 = this.getComponents(), DropdownIndicator = _this$getComponents5.DropdownIndicator, IndicatorSeparator = _this$getComponents5.IndicatorSeparator;
if (!DropdownIndicator || !IndicatorSeparator)
return null;
var commonProps = this.commonProps;
var isDisabled = this.props.isDisabled;
var isFocused = this.state.isFocused;
return /* @__PURE__ */ React__namespace.createElement(IndicatorSeparator, _extends2({}, commonProps, {
isDisabled,
isFocused
}));
}
}, {
key: "renderDropdownIndicator",
value: function renderDropdownIndicator() {
var _this$getComponents6 = this.getComponents(), DropdownIndicator = _this$getComponents6.DropdownIndicator;
if (!DropdownIndicator)
return null;
var commonProps = this.commonProps;
var isDisabled = this.props.isDisabled;
var isFocused = this.state.isFocused;
var innerProps = {
onMouseDown: this.onDropdownIndicatorMouseDown,
onTouchEnd: this.onDropdownIndicatorTouchEnd,
"aria-hidden": "true"
};
return /* @__PURE__ */ React__namespace.createElement(DropdownIndicator, _extends2({}, commonProps, {
innerProps,
isDisabled,
isFocused
}));
}
}, {
key: "renderMenu",
value: function renderMenu() {
var _this4 = this;
var _this$getComponents7 = this.getComponents(), Group = _this$getComponents7.Group, GroupHeading = _this$getComponents7.GroupHeading, Menu3 = _this$getComponents7.Menu, MenuList = _this$getComponents7.MenuList, MenuPortal = _this$getComponents7.MenuPortal, LoadingMessage = _this$getComponents7.LoadingMessage, NoOptionsMessage = _this$getComponents7.NoOptionsMessage, Option = _this$getComponents7.Option;
var commonProps = this.commonProps;
var focusedOption = this.state.focusedOption;
var _this$props12 = this.props, captureMenuScroll = _this$props12.captureMenuScroll, inputValue = _this$props12.inputValue, isLoading = _this$props12.isLoading, loadingMessage = _this$props12.loadingMessage, minMenuHeight = _this$props12.minMenuHeight, maxMenuHeight = _this$props12.maxMenuHeight, menuIsOpen = _this$props12.menuIsOpen, menuPlacement = _this$props12.menuPlacement, menuPosition = _this$props12.menuPosition, menuPortalTarget = _this$props12.menuPortalTarget, menuShouldBlockScroll = _this$props12.menuShouldBlockScroll, menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView, noOptionsMessage = _this$props12.noOptionsMessage, onMenuScrollToTop = _this$props12.onMenuScrollToTop, onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
if (!menuIsOpen)
return null;
var render = function render2(props, id2) {
var type = props.type, data = props.data, isDisabled = props.isDisabled, isSelected = props.isSelected, label = props.label, value = props.value;
var isFocused = focusedOption === data;
var onHover = isDisabled ? void 0 : function() {
return _this4.onOptionHover(data);
};
var onSelect = isDisabled ? void 0 : function() {
return _this4.selectOption(data);
};
var optionId = "".concat(_this4.getElementId("option"), "-").concat(id2);
var innerProps = {
id: optionId,
onClick: onSelect,
onMouseMove: onHover,
onMouseOver: onHover,
tabIndex: -1
};
return /* @__PURE__ */ React__namespace.createElement(Option, _extends2({}, commonProps, {
innerProps,
data,
isDisabled,
isSelected,
key: optionId,
label,
type,
value,
isFocused,
innerRef: isFocused ? _this4.getFocusedOptionRef : void 0
}), _this4.formatOptionLabel(props.data, "menu"));
};
var menuUI;
if (this.hasOptions()) {
menuUI = this.getCategorizedOptions().map(function(item) {
if (item.type === "group") {
var _data = item.data, options = item.options, groupIndex = item.index;
var groupId = "".concat(_this4.getElementId("group"), "-").concat(groupIndex);
var headingId = "".concat(groupId, "-heading");
return /* @__PURE__ */ React__namespace.createElement(Group, _extends2({}, commonProps, {
key: groupId,
data: _data,
options,
Heading: GroupHeading,
headingProps: {
id: headingId,
data: item.data
},
label: _this4.formatGroupLabel(item.data)
}), item.options.map(function(option) {
return render(option, "".concat(groupIndex, "-").concat(option.index));
}));
} else if (item.type === "option") {
return render(item, "".concat(item.index));
}
});
} else if (isLoading) {
var message = loadingMessage({
inputValue
});
if (message === null)
return null;
menuUI = /* @__PURE__ */ React__namespace.createElement(LoadingMessage, commonProps, message);
} else {
var _message = noOptionsMessage({
inputValue
});
if (_message === null)
return null;
menuUI = /* @__PURE__ */ React__namespace.createElement(NoOptionsMessage, commonProps, _message);
}
var menuPlacementProps = {
minMenuHeight,
maxMenuHeight,
menuPlacement,
menuPosition,
menuShouldScrollIntoView
};
var menuElement = /* @__PURE__ */ React__namespace.createElement(index.MenuPlacer, _extends2({}, commonProps, menuPlacementProps), function(_ref4) {
var ref = _ref4.ref, _ref4$placerProps = _ref4.placerProps, placement = _ref4$placerProps.placement, maxHeight = _ref4$placerProps.maxHeight;
return /* @__PURE__ */ React__namespace.createElement(Menu3, _extends2({}, commonProps, menuPlacementProps, {
innerRef: ref,
innerProps: {
onMouseDown: _this4.onMenuMouseDown,
onMouseMove: _this4.onMenuMouseMove,
id: _this4.getElementId("listbox")
},
isLoading,
placement
}), /* @__PURE__ */ React__namespace.createElement(ScrollManager, {
captureEnabled: captureMenuScroll,
onTopArrive: onMenuScrollToTop,
onBottomArrive: onMenuScrollToBottom,
lockEnabled: menuShouldBlockScroll
}, function(scrollTargetRef) {
return /* @__PURE__ */ React__namespace.createElement(MenuList, _extends2({}, commonProps, {
innerRef: function innerRef(instance) {
_this4.getMenuListRef(instance);
scrollTargetRef(instance);
},
isLoading,
maxHeight,
focusedOption
}), menuUI);
}));
});
return menuPortalTarget || menuPosition === "fixed" ? /* @__PURE__ */ React__namespace.createElement(MenuPortal, _extends2({}, commonProps, {
appendTo: menuPortalTarget,
controlElement: this.controlRef,
menuPlacement,
menuPosition
}), menuElement) : menuElement;
}
}, {
key: "renderFormField",
value: function renderFormField() {
var _this5 = this;
var _this$props13 = this.props, delimiter = _this$props13.delimiter, isDisabled = _this$props13.isDisabled, isMulti = _this$props13.isMulti, name = _this$props13.name, required = _this$props13.required;
var selectValue = this.state.selectValue;
if (required && !this.hasValue() && !isDisabled) {
return /* @__PURE__ */ React__namespace.createElement(RequiredInput$1, {
name,
onFocus: this.onValueInputFocus
});
}
if (!name || isDisabled)
return;
if (isMulti) {
if (delimiter) {
var value = selectValue.map(function(opt) {
return _this5.getOptionValue(opt);
}).join(delimiter);
return /* @__PURE__ */ React__namespace.createElement("input", {
name,
type: "hidden",
value
});
} else {
var input = selectValue.length > 0 ? selectValue.map(function(opt, i3) {
return /* @__PURE__ */ React__namespace.createElement("input", {
key: "i-".concat(i3),
name,
type: "hidden",
value: _this5.getOptionValue(opt)
});
}) : /* @__PURE__ */ React__namespace.createElement("input", {
name,
type: "hidden",
value: ""
});
return /* @__PURE__ */ React__namespace.createElement("div", null, input);
}
} else {
var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : "";
return /* @__PURE__ */ React__namespace.createElement("input", {
name,
type: "hidden",
value: _value
});
}
}
}, {
key: "renderLiveRegion",
value: function renderLiveRegion() {
var commonProps = this.commonProps;
var _this$state6 = this.state, ariaSelection = _this$state6.ariaSelection, focusedOption = _this$state6.focusedOption, focusedValue = _this$state6.focusedValue, isFocused = _this$state6.isFocused, selectValue = _this$state6.selectValue;
var focusableOptions = this.getFocusableOptions();
return /* @__PURE__ */ React__namespace.createElement(LiveRegion$1, _extends2({}, commonProps, {
id: this.getElementId("live-region"),
ariaSelection,
focusedOption,
focusedValue,
isFocused,
selectValue,
focusableOptions
}));
}
}, {
key: "render",
value: function render() {
var _this$getComponents8 = this.getComponents(), Control = _this$getComponents8.Control, IndicatorsContainer = _this$getComponents8.IndicatorsContainer, SelectContainer = _this$getComponents8.SelectContainer, ValueContainer = _this$getComponents8.ValueContainer;
var _this$props14 = this.props, className = _this$props14.className, id2 = _this$props14.id, isDisabled = _this$props14.isDisabled, menuIsOpen = _this$props14.menuIsOpen;
var isFocused = this.state.isFocused;
var commonProps = this.commonProps = this.getCommonProps();
return /* @__PURE__ */ React__namespace.createElement(SelectContainer, _extends2({}, commonProps, {
className,
innerProps: {
id: id2,
onKeyDown: this.onKeyDown
},
isDisabled,
isFocused
}), this.renderLiveRegion(), /* @__PURE__ */ React__namespace.createElement(Control, _extends2({}, commonProps, {
innerRef: this.getControlRef,
innerProps: {
onMouseDown: this.onControlMouseDown,
onTouchEnd: this.onControlTouchEnd
},
isDisabled,
isFocused,
menuIsOpen
}), /* @__PURE__ */ React__namespace.createElement(ValueContainer, _extends2({}, commonProps, {
isDisabled
}), this.renderPlaceholderOrValue(), this.renderInput()), /* @__PURE__ */ React__namespace.createElement(IndicatorsContainer, _extends2({}, commonProps, {
isDisabled
}), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
var prevProps = state.prevProps, clearFocusValueOnUpdate = state.clearFocusValueOnUpdate, inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate, ariaSelection = state.ariaSelection, isFocused = state.isFocused, prevWasFocused = state.prevWasFocused;
var options = props.options, value = props.value, menuIsOpen = props.menuIsOpen, inputValue = props.inputValue, isMulti = props.isMulti;
var selectValue = index.cleanValue(value);
var newMenuOptionsState = {};
if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
var focusedOption = getNextFocusedOption(state, focusableOptions);
newMenuOptionsState = {
selectValue,
focusedOption,
focusedValue,
clearFocusValueOnUpdate: false
};
}
var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
inputIsHidden: inputIsHiddenAfterUpdate,
inputIsHiddenAfterUpdate: void 0
} : {};
var newAriaSelection = ariaSelection;
var hasKeptFocus = isFocused && prevWasFocused;
if (isFocused && !hasKeptFocus) {
newAriaSelection = {
value: index.valueTernary(isMulti, selectValue, selectValue[0] || null),
options: selectValue,
action: "initial-input-focus"
};
hasKeptFocus = !prevWasFocused;
}
if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === "initial-input-focus") {
newAriaSelection = null;
}
return _objectSpread(_objectSpread(_objectSpread({}, newMenuOptionsState), newInputIsHiddenState), {}, {
prevProps: props,
ariaSelection: newAriaSelection,
prevWasFocused: hasKeptFocus
});
}
}]);
return Select2;
}(React49.Component);
Select.defaultProps = defaultProps;
exports.Select = Select;
exports.createFilter = createFilter;
exports.defaultProps = defaultProps;
exports.defaultTheme = defaultTheme;
exports.getOptionLabel = getOptionLabel$1;
exports.getOptionValue = getOptionValue$1;
exports.mergeStyles = mergeStyles;
}
});
// node_modules/react-select/dist/react-select.cjs.dev.js
var require_react_select_cjs_dev = __commonJS({
"node_modules/react-select/dist/react-select.cjs.dev.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var useStateManager = require_useStateManager_7748b351_cjs_dev();
var _extends2 = require_extends2();
var React49 = require_react();
var Select = require_Select_5041a4f3_cjs_dev();
var react = require_emotion_react_cjs();
var createCache = require_emotion_cache_cjs();
var index = require_index_2fe3dc33_cjs_dev();
require_objectSpread2();
require_slicedToArray();
require_objectWithoutProperties();
require_classCallCheck();
require_createClass();
require_inherits();
require_createSuper();
require_toConsumableArray();
require_memoize_one_cjs();
require_typeof();
require_taggedTemplateLiteral();
require_defineProperty();
require_react_dom();
require_floating_ui_dom_umd();
require_use_isomorphic_layout_effect_browser_cjs();
function _interopDefault(e) {
return e && e.__esModule ? e : { "default": e };
}
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(React49);
var createCache__default = /* @__PURE__ */ _interopDefault(createCache);
var StateManagedSelect = /* @__PURE__ */ React49.forwardRef(function(props, ref) {
var baseSelectProps = useStateManager.useStateManager(props);
return /* @__PURE__ */ React__namespace.createElement(Select.Select, _extends2({
ref
}, baseSelectProps));
});
var StateManagedSelect$1 = StateManagedSelect;
var NonceProvider = function(_ref) {
var nonce = _ref.nonce, children = _ref.children, cacheKey = _ref.cacheKey;
var emotionCache = React49.useMemo(function() {
return createCache__default["default"]({
key: cacheKey,
nonce
});
}, [cacheKey, nonce]);
return /* @__PURE__ */ React__namespace.createElement(react.CacheProvider, {
value: emotionCache
}, children);
};
exports.useStateManager = useStateManager.useStateManager;
exports.createFilter = Select.createFilter;
exports.defaultTheme = Select.defaultTheme;
exports.mergeStyles = Select.mergeStyles;
exports.components = index.components;
exports.NonceProvider = NonceProvider;
exports["default"] = StateManagedSelect$1;
}
});
// node_modules/react-select/dist/react-select.cjs.js
var require_react_select_cjs = __commonJS({
"node_modules/react-select/dist/react-select.cjs.js"(exports, module2) {
"use strict";
if (false) {
module2.exports = null;
} else {
module2.exports = require_react_select_cjs_dev();
}
}
});
// node_modules/react-select/dist/react-select.cjs.default.js
var require_react_select_cjs_default = __commonJS({
"node_modules/react-select/dist/react-select.cjs.default.js"(exports) {
exports._default = require_react_select_cjs().default;
}
});
// node_modules/fuzzysort/fuzzysort.js
var require_fuzzysort = __commonJS({
"node_modules/fuzzysort/fuzzysort.js"(exports, module2) {
((root, UMD) => {
if (typeof define === "function" && define.amd)
define([], UMD);
else if (typeof module2 === "object" && module2.exports)
module2.exports = UMD();
else
root["fuzzysort"] = UMD();
})(exports, (_3) => {
"use strict";
var single = (search, target) => {
if (search == "farzher")
return { target: "farzher was here (^-^*)/", score: 0, _indexes: [0] };
if (!search || !target)
return NULL;
var preparedSearch = getPreparedSearch(search);
if (!isObj(target))
target = getPrepared(target);
var searchBitflags = preparedSearch.bitflags;
if ((searchBitflags & target._bitflags) !== searchBitflags)
return NULL;
return algorithm(preparedSearch, target);
};
var go = (search, targets, options) => {
if (search == "farzher")
return [{ target: "farzher was here (^-^*)/", score: 0, _indexes: [0], obj: targets ? targets[0] : NULL }];
if (!search)
return options && options.all ? all(search, targets, options) : noResults;
var preparedSearch = getPreparedSearch(search);
var searchBitflags = preparedSearch.bitflags;
var containsSpace = preparedSearch.containsSpace;
var threshold = options && options.threshold || INT_MIN;
var limit = options && options["limit"] || INT_MAX;
var resultsLen = 0;
var limitedCount = 0;
var targetsLen = targets.length;
if (options && options.key) {
var key = options.key;
for (var i2 = 0; i2 < targetsLen; ++i2) {
var obj = targets[i2];
var target = getValue2(obj, key);
if (!target)
continue;
if (!isObj(target))
target = getPrepared(target);
if ((searchBitflags & target._bitflags) !== searchBitflags)
continue;
var result = algorithm(preparedSearch, target);
if (result === NULL)
continue;
if (result.score < threshold)
continue;
result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: result.score, _indexes: result._indexes, obj };
if (resultsLen < limit) {
q2.add(result);
++resultsLen;
} else {
++limitedCount;
if (result.score > q2.peek().score)
q2.replaceTop(result);
}
}
} else if (options && options.keys) {
var scoreFn = options["scoreFn"] || defaultScoreFn;
var keys = options.keys;
var keysLen = keys.length;
for (var i2 = 0; i2 < targetsLen; ++i2) {
var obj = targets[i2];
var objResults = new Array(keysLen);
for (var keyI = 0; keyI < keysLen; ++keyI) {
var key = keys[keyI];
var target = getValue2(obj, key);
if (!target) {
objResults[keyI] = NULL;
continue;
}
if (!isObj(target))
target = getPrepared(target);
if ((searchBitflags & target._bitflags) !== searchBitflags)
objResults[keyI] = NULL;
else
objResults[keyI] = algorithm(preparedSearch, target);
}
objResults.obj = obj;
var score = scoreFn(objResults);
if (score === NULL)
continue;
if (score < threshold)
continue;
objResults.score = score;
if (resultsLen < limit) {
q2.add(objResults);
++resultsLen;
} else {
++limitedCount;
if (score > q2.peek().score)
q2.replaceTop(objResults);
}
}
} else {
for (var i2 = 0; i2 < targetsLen; ++i2) {
var target = targets[i2];
if (!target)
continue;
if (!isObj(target))
target = getPrepared(target);
if ((searchBitflags & target._bitflags) !== searchBitflags)
continue;
var result = algorithm(preparedSearch, target);
if (result === NULL)
continue;
if (result.score < threshold)
continue;
if (resultsLen < limit) {
q2.add(result);
++resultsLen;
} else {
++limitedCount;
if (result.score > q2.peek().score)
q2.replaceTop(result);
}
}
}
if (resultsLen === 0)
return noResults;
var results = new Array(resultsLen);
for (var i2 = resultsLen - 1; i2 >= 0; --i2)
results[i2] = q2.poll();
results.total = resultsLen + limitedCount;
return results;
};
var highlight = (result, hOpen, hClose) => {
if (typeof hOpen === "function")
return highlightCallback(result, hOpen);
if (result === NULL)
return NULL;
if (hOpen === void 0)
hOpen = "<b>";
if (hClose === void 0)
hClose = "</b>";
var highlighted = "";
var matchesIndex = 0;
var opened = false;
var target = result.target;
var targetLen = target.length;
var indexes2 = result._indexes;
indexes2 = indexes2.slice(0, indexes2.len).sort((a2, b2) => a2 - b2);
for (var i2 = 0; i2 < targetLen; ++i2) {
var char = target[i2];
if (indexes2[matchesIndex] === i2) {
++matchesIndex;
if (!opened) {
opened = true;
highlighted += hOpen;
}
if (matchesIndex === indexes2.length) {
highlighted += char + hClose + target.substr(i2 + 1);
break;
}
} else {
if (opened) {
opened = false;
highlighted += hClose;
}
}
highlighted += char;
}
return highlighted;
};
var highlightCallback = (result, cb) => {
if (result === NULL)
return NULL;
var target = result.target;
var targetLen = target.length;
var indexes2 = result._indexes;
indexes2 = indexes2.slice(0, indexes2.len).sort((a2, b2) => a2 - b2);
var highlighted = "";
var matchI = 0;
var indexesI = 0;
var opened = false;
var result = [];
for (var i2 = 0; i2 < targetLen; ++i2) {
var char = target[i2];
if (indexes2[indexesI] === i2) {
++indexesI;
if (!opened) {
opened = true;
result.push(highlighted);
highlighted = "";
}
if (indexesI === indexes2.length) {
highlighted += char;
result.push(cb(highlighted, matchI++));
highlighted = "";
result.push(target.substr(i2 + 1));
break;
}
} else {
if (opened) {
opened = false;
result.push(cb(highlighted, matchI++));
highlighted = "";
}
}
highlighted += char;
}
return result;
};
var indexes = (result) => result._indexes.slice(0, result._indexes.len).sort((a2, b2) => a2 - b2);
var prepare = (target) => {
if (typeof target !== "string")
target = "";
var info = prepareLowerInfo(target);
return { "target": target, _targetLower: info._lower, _targetLowerCodes: info.lowerCodes, _nextBeginningIndexes: NULL, _bitflags: info.bitflags, "score": NULL, _indexes: [0], "obj": NULL };
};
var prepareSearch = (search) => {
if (typeof search !== "string")
search = "";
search = search.trim();
var info = prepareLowerInfo(search);
var spaceSearches = [];
if (info.containsSpace) {
var searches = search.split(/\s+/);
searches = [...new Set(searches)];
for (var i2 = 0; i2 < searches.length; i2++) {
if (searches[i2] === "")
continue;
var _info = prepareLowerInfo(searches[i2]);
spaceSearches.push({ lowerCodes: _info.lowerCodes, _lower: searches[i2].toLowerCase(), containsSpace: false });
}
}
return { lowerCodes: info.lowerCodes, bitflags: info.bitflags, containsSpace: info.containsSpace, _lower: info._lower, spaceSearches };
};
var getPrepared = (target) => {
if (target.length > 999)
return prepare(target);
var targetPrepared = preparedCache.get(target);
if (targetPrepared !== void 0)
return targetPrepared;
targetPrepared = prepare(target);
preparedCache.set(target, targetPrepared);
return targetPrepared;
};
var getPreparedSearch = (search) => {
if (search.length > 999)
return prepareSearch(search);
var searchPrepared = preparedSearchCache.get(search);
if (searchPrepared !== void 0)
return searchPrepared;
searchPrepared = prepareSearch(search);
preparedSearchCache.set(search, searchPrepared);
return searchPrepared;
};
var all = (search, targets, options) => {
var results = [];
results.total = targets.length;
var limit = options && options.limit || INT_MAX;
if (options && options.key) {
for (var i2 = 0; i2 < targets.length; i2++) {
var obj = targets[i2];
var target = getValue2(obj, options.key);
if (!target)
continue;
if (!isObj(target))
target = getPrepared(target);
target.score = INT_MIN;
target._indexes.len = 0;
var result = target;
result = { target: result.target, _targetLower: "", _targetLowerCodes: NULL, _nextBeginningIndexes: NULL, _bitflags: 0, score: target.score, _indexes: NULL, obj };
results.push(result);
if (results.length >= limit)
return results;
}
} else if (options && options.keys) {
for (var i2 = 0; i2 < targets.length; i2++) {
var obj = targets[i2];
var objResults = new Array(options.keys.length);
for (var keyI = options.keys.length - 1; keyI >= 0; --keyI) {
var target = getValue2(obj, options.keys[keyI]);
if (!target) {
objResults[keyI] = NULL;
continue;
}
if (!isObj(target))
target = getPrepared(target);
target.score = INT_MIN;
target._indexes.len = 0;
objResults[keyI] = target;
}
objResults.obj = obj;
objResults.score = INT_MIN;
results.push(objResults);
if (results.length >= limit)
return results;
}
} else {
for (var i2 = 0; i2 < targets.length; i2++) {
var target = targets[i2];
if (!target)
continue;
if (!isObj(target))
target = getPrepared(target);
target.score = INT_MIN;
target._indexes.len = 0;
results.push(target);
if (results.length >= limit)
return results;
}
}
return results;
};
var algorithm = (preparedSearch, prepared, allowSpaces = false) => {
if (allowSpaces === false && preparedSearch.containsSpace)
return algorithmSpaces(preparedSearch, prepared);
var searchLower = preparedSearch._lower;
var searchLowerCodes = preparedSearch.lowerCodes;
var searchLowerCode = searchLowerCodes[0];
var targetLowerCodes = prepared._targetLowerCodes;
var searchLen = searchLowerCodes.length;
var targetLen = targetLowerCodes.length;
var searchI = 0;
var targetI = 0;
var matchesSimpleLen = 0;
for (; ; ) {
var isMatch = searchLowerCode === targetLowerCodes[targetI];
if (isMatch) {
matchesSimple[matchesSimpleLen++] = targetI;
++searchI;
if (searchI === searchLen)
break;
searchLowerCode = searchLowerCodes[searchI];
}
++targetI;
if (targetI >= targetLen)
return NULL;
}
var searchI = 0;
var successStrict = false;
var matchesStrictLen = 0;
var nextBeginningIndexes = prepared._nextBeginningIndexes;
if (nextBeginningIndexes === NULL)
nextBeginningIndexes = prepared._nextBeginningIndexes = prepareNextBeginningIndexes(prepared.target);
var firstPossibleI = targetI = matchesSimple[0] === 0 ? 0 : nextBeginningIndexes[matchesSimple[0] - 1];
var backtrackCount = 0;
if (targetI !== targetLen)
for (; ; ) {
if (targetI >= targetLen) {
if (searchI <= 0)
break;
++backtrackCount;
if (backtrackCount > 200)
break;
--searchI;
var lastMatch = matchesStrict[--matchesStrictLen];
targetI = nextBeginningIndexes[lastMatch];
} else {
var isMatch = searchLowerCodes[searchI] === targetLowerCodes[targetI];
if (isMatch) {
matchesStrict[matchesStrictLen++] = targetI;
++searchI;
if (searchI === searchLen) {
successStrict = true;
break;
}
++targetI;
} else {
targetI = nextBeginningIndexes[targetI];
}
}
}
var substringIndex = prepared._targetLower.indexOf(searchLower, matchesSimple[0]);
var isSubstring = ~substringIndex;
if (isSubstring && !successStrict) {
for (var i2 = 0; i2 < matchesSimpleLen; ++i2)
matchesSimple[i2] = substringIndex + i2;
}
var isSubstringBeginning = false;
if (isSubstring) {
isSubstringBeginning = prepared._nextBeginningIndexes[substringIndex - 1] === substringIndex;
}
{
if (successStrict) {
var matchesBest = matchesStrict;
var matchesBestLen = matchesStrictLen;
} else {
var matchesBest = matchesSimple;
var matchesBestLen = matchesSimpleLen;
}
var score = 0;
var extraMatchGroupCount = 0;
for (var i2 = 1; i2 < searchLen; ++i2) {
if (matchesBest[i2] - matchesBest[i2 - 1] !== 1) {
score -= matchesBest[i2];
++extraMatchGroupCount;
}
}
var unmatchedDistance = matchesBest[searchLen - 1] - matchesBest[0] - (searchLen - 1);
score -= (12 + unmatchedDistance) * extraMatchGroupCount;
if (matchesBest[0] !== 0)
score -= matchesBest[0] * matchesBest[0] * 0.2;
if (!successStrict) {
score *= 1e3;
} else {
var uniqueBeginningIndexes = 1;
for (var i2 = nextBeginningIndexes[0]; i2 < targetLen; i2 = nextBeginningIndexes[i2])
++uniqueBeginningIndexes;
if (uniqueBeginningIndexes > 24)
score *= (uniqueBeginningIndexes - 24) * 10;
}
if (isSubstring)
score /= 1 + searchLen * searchLen * 1;
if (isSubstringBeginning)
score /= 1 + searchLen * searchLen * 1;
score -= targetLen - searchLen;
prepared.score = score;
for (var i2 = 0; i2 < matchesBestLen; ++i2)
prepared._indexes[i2] = matchesBest[i2];
prepared._indexes.len = matchesBestLen;
return prepared;
}
};
var algorithmSpaces = (preparedSearch, target) => {
var seen_indexes = /* @__PURE__ */ new Set();
var score = 0;
var result = NULL;
var first_seen_index_last_search = 0;
var searches = preparedSearch.spaceSearches;
for (var i2 = 0; i2 < searches.length; ++i2) {
var search = searches[i2];
result = algorithm(search, target);
if (result === NULL)
return NULL;
score += result.score;
if (result._indexes[0] < first_seen_index_last_search) {
score -= first_seen_index_last_search - result._indexes[0];
}
first_seen_index_last_search = result._indexes[0];
for (var j2 = 0; j2 < result._indexes.len; ++j2)
seen_indexes.add(result._indexes[j2]);
}
var allowSpacesResult = algorithm(preparedSearch, target, true);
if (allowSpacesResult !== NULL && allowSpacesResult.score > score) {
return allowSpacesResult;
}
result.score = score;
var i2 = 0;
for (let index of seen_indexes)
result._indexes[i2++] = index;
result._indexes.len = i2;
return result;
};
var prepareLowerInfo = (str) => {
var strLen = str.length;
var lower = str.toLowerCase();
var lowerCodes = [];
var bitflags = 0;
var containsSpace = false;
for (var i2 = 0; i2 < strLen; ++i2) {
var lowerCode = lowerCodes[i2] = lower.charCodeAt(i2);
if (lowerCode === 32) {
containsSpace = true;
continue;
}
var bit = lowerCode >= 97 && lowerCode <= 122 ? lowerCode - 97 : lowerCode >= 48 && lowerCode <= 57 ? 26 : lowerCode <= 127 ? 30 : 31;
bitflags |= 1 << bit;
}
return { lowerCodes, bitflags, containsSpace, _lower: lower };
};
var prepareBeginningIndexes = (target) => {
var targetLen = target.length;
var beginningIndexes = [];
var beginningIndexesLen = 0;
var wasUpper = false;
var wasAlphanum = false;
for (var i2 = 0; i2 < targetLen; ++i2) {
var targetCode = target.charCodeAt(i2);
var isUpper = targetCode >= 65 && targetCode <= 90;
var isAlphanum = isUpper || targetCode >= 97 && targetCode <= 122 || targetCode >= 48 && targetCode <= 57;
var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum;
wasUpper = isUpper;
wasAlphanum = isAlphanum;
if (isBeginning)
beginningIndexes[beginningIndexesLen++] = i2;
}
return beginningIndexes;
};
var prepareNextBeginningIndexes = (target) => {
var targetLen = target.length;
var beginningIndexes = prepareBeginningIndexes(target);
var nextBeginningIndexes = [];
var lastIsBeginning = beginningIndexes[0];
var lastIsBeginningI = 0;
for (var i2 = 0; i2 < targetLen; ++i2) {
if (lastIsBeginning > i2) {
nextBeginningIndexes[i2] = lastIsBeginning;
} else {
lastIsBeginning = beginningIndexes[++lastIsBeginningI];
nextBeginningIndexes[i2] = lastIsBeginning === void 0 ? targetLen : lastIsBeginning;
}
}
return nextBeginningIndexes;
};
var cleanup = () => {
preparedCache.clear();
preparedSearchCache.clear();
matchesSimple = [];
matchesStrict = [];
};
var preparedCache = /* @__PURE__ */ new Map();
var preparedSearchCache = /* @__PURE__ */ new Map();
var matchesSimple = [];
var matchesStrict = [];
var defaultScoreFn = (a2) => {
var max2 = INT_MIN;
var len = a2.length;
for (var i2 = 0; i2 < len; ++i2) {
var result = a2[i2];
if (result === NULL)
continue;
var score = result.score;
if (score > max2)
max2 = score;
}
if (max2 === INT_MIN)
return NULL;
return max2;
};
var getValue2 = (obj, prop) => {
var tmp = obj[prop];
if (tmp !== void 0)
return tmp;
var segs = prop;
if (!Array.isArray(prop))
segs = prop.split(".");
var len = segs.length;
var i2 = -1;
while (obj && ++i2 < len)
obj = obj[segs[i2]];
return obj;
};
var isObj = (x2) => {
return typeof x2 === "object";
};
var INT_MAX = Infinity;
var INT_MIN = -INT_MAX;
var noResults = [];
noResults.total = 0;
var NULL = null;
var fastpriorityqueue = (r2) => {
var e = [], o2 = 0, a2 = {}, v2 = (r3) => {
for (var a3 = 0, v3 = e[a3], c2 = 1; c2 < o2; ) {
var s2 = c2 + 1;
a3 = c2, s2 < o2 && e[s2].score < e[c2].score && (a3 = s2), e[a3 - 1 >> 1] = e[a3], c2 = 1 + (a3 << 1);
}
for (var f3 = a3 - 1 >> 1; a3 > 0 && v3.score < e[f3].score; f3 = (a3 = f3) - 1 >> 1)
e[a3] = e[f3];
e[a3] = v3;
};
return a2.add = (r3) => {
var a3 = o2;
e[o2++] = r3;
for (var v3 = a3 - 1 >> 1; a3 > 0 && r3.score < e[v3].score; v3 = (a3 = v3) - 1 >> 1)
e[a3] = e[v3];
e[a3] = r3;
}, a2.poll = (r3) => {
if (0 !== o2) {
var a3 = e[0];
return e[0] = e[--o2], v2(), a3;
}
}, a2.peek = (r3) => {
if (0 !== o2)
return e[0];
}, a2.replaceTop = (r3) => {
e[0] = r3, v2();
}, a2;
};
var q2 = fastpriorityqueue();
return { "single": single, "go": go, "highlight": highlight, "prepare": prepare, "indexes": indexes, "cleanup": cleanup };
});
}
});
// node_modules/papaparse/papaparse.min.js
var require_papaparse_min = __commonJS({
"node_modules/papaparse/papaparse.min.js"(exports, module2) {
!function(e, t2) {
"function" == typeof define && define.amd ? define([], t2) : "object" == typeof module2 && "undefined" != typeof exports ? module2.exports = t2() : e.Papa = t2();
}(exports, function s2() {
"use strict";
var f3 = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== f3 ? f3 : {};
var n2 = !f3.document && !!f3.postMessage, o2 = f3.IS_PAPA_WORKER || false, a2 = {}, u2 = 0, b2 = { parse: function(e, t2) {
var r3 = (t2 = t2 || {}).dynamicTyping || false;
J(r3) && (t2.dynamicTypingFunction = r3, r3 = {});
if (t2.dynamicTyping = r3, t2.transform = !!J(t2.transform) && t2.transform, t2.worker && b2.WORKERS_SUPPORTED) {
var i2 = function() {
if (!b2.WORKERS_SUPPORTED)
return false;
var e2 = (r4 = f3.URL || f3.webkitURL || null, i3 = s2.toString(), b2.BLOB_URL || (b2.BLOB_URL = r4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", i3, ")();"], { type: "text/javascript" })))), t3 = new f3.Worker(e2);
var r4, i3;
return t3.onmessage = _3, t3.id = u2++, a2[t3.id] = t3;
}();
return i2.userStep = t2.step, i2.userChunk = t2.chunk, i2.userComplete = t2.complete, i2.userError = t2.error, t2.step = J(t2.step), t2.chunk = J(t2.chunk), t2.complete = J(t2.complete), t2.error = J(t2.error), delete t2.worker, void i2.postMessage({ input: e, config: t2, workerId: i2.id });
}
var n3 = null;
b2.NODE_STREAM_INPUT, "string" == typeof e ? (e = function(e2) {
if (65279 === e2.charCodeAt(0))
return e2.slice(1);
return e2;
}(e), n3 = t2.download ? new l2(t2) : new p2(t2)) : true === e.readable && J(e.read) && J(e.on) ? n3 = new g2(t2) : (f3.File && e instanceof File || e instanceof Object) && (n3 = new c2(t2));
return n3.stream(e);
}, unparse: function(e, t2) {
var n3 = false, _4 = true, m3 = ",", y3 = "\r\n", s3 = '"', a3 = s3 + s3, r3 = false, i2 = null, o3 = false;
!function() {
if ("object" != typeof t2)
return;
"string" != typeof t2.delimiter || b2.BAD_DELIMITERS.filter(function(e2) {
return -1 !== t2.delimiter.indexOf(e2);
}).length || (m3 = t2.delimiter);
("boolean" == typeof t2.quotes || "function" == typeof t2.quotes || Array.isArray(t2.quotes)) && (n3 = t2.quotes);
"boolean" != typeof t2.skipEmptyLines && "string" != typeof t2.skipEmptyLines || (r3 = t2.skipEmptyLines);
"string" == typeof t2.newline && (y3 = t2.newline);
"string" == typeof t2.quoteChar && (s3 = t2.quoteChar);
"boolean" == typeof t2.header && (_4 = t2.header);
if (Array.isArray(t2.columns)) {
if (0 === t2.columns.length)
throw new Error("Option columns is empty");
i2 = t2.columns;
}
void 0 !== t2.escapeChar && (a3 = t2.escapeChar + s3);
("boolean" == typeof t2.escapeFormulae || t2.escapeFormulae instanceof RegExp) && (o3 = t2.escapeFormulae instanceof RegExp ? t2.escapeFormulae : /^[=+\-@\t\r].*$/);
}();
var u3 = new RegExp(Q2(s3), "g");
"string" == typeof e && (e = JSON.parse(e));
if (Array.isArray(e)) {
if (!e.length || Array.isArray(e[0]))
return h3(null, e, r3);
if ("object" == typeof e[0])
return h3(i2 || Object.keys(e[0]), e, r3);
} else if ("object" == typeof e)
return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || i2), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : "object" == typeof e.data[0] ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || "object" == typeof e.data[0] || (e.data = [e.data])), h3(e.fields || [], e.data || [], r3);
throw new Error("Unable to serialize unrecognized input");
function h3(e2, t3, r4) {
var i3 = "";
"string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t3 && (t3 = JSON.parse(t3));
var n4 = Array.isArray(e2) && 0 < e2.length, s4 = !Array.isArray(t3[0]);
if (n4 && _4) {
for (var a4 = 0; a4 < e2.length; a4++)
0 < a4 && (i3 += m3), i3 += v3(e2[a4], a4);
0 < t3.length && (i3 += y3);
}
for (var o4 = 0; o4 < t3.length; o4++) {
var u4 = n4 ? e2.length : t3[o4].length, h4 = false, f4 = n4 ? 0 === Object.keys(t3[o4]).length : 0 === t3[o4].length;
if (r4 && !n4 && (h4 = "greedy" === r4 ? "" === t3[o4].join("").trim() : 1 === t3[o4].length && 0 === t3[o4][0].length), "greedy" === r4 && n4) {
for (var d3 = [], l3 = 0; l3 < u4; l3++) {
var c3 = s4 ? e2[l3] : l3;
d3.push(t3[o4][c3]);
}
h4 = "" === d3.join("").trim();
}
if (!h4) {
for (var p3 = 0; p3 < u4; p3++) {
0 < p3 && !f4 && (i3 += m3);
var g3 = n4 && s4 ? e2[p3] : p3;
i3 += v3(t3[o4][g3], p3);
}
o4 < t3.length - 1 && (!r4 || 0 < u4 && !f4) && (i3 += y3);
}
}
return i3;
}
function v3(e2, t3) {
if (null == e2)
return "";
if (e2.constructor === Date)
return JSON.stringify(e2).slice(1, 25);
var r4 = false;
o3 && "string" == typeof e2 && o3.test(e2) && (e2 = "'" + e2, r4 = true);
var i3 = e2.toString().replace(u3, a3);
return (r4 = r4 || true === n3 || "function" == typeof n3 && n3(e2, t3) || Array.isArray(n3) && n3[t3] || function(e3, t4) {
for (var r5 = 0; r5 < t4.length; r5++)
if (-1 < e3.indexOf(t4[r5]))
return true;
return false;
}(i3, b2.BAD_DELIMITERS) || -1 < i3.indexOf(m3) || " " === i3.charAt(0) || " " === i3.charAt(i3.length - 1)) ? s3 + i3 + s3 : i3;
}
} };
if (b2.RECORD_SEP = String.fromCharCode(30), b2.UNIT_SEP = String.fromCharCode(31), b2.BYTE_ORDER_MARK = "\uFEFF", b2.BAD_DELIMITERS = ["\r", "\n", '"', b2.BYTE_ORDER_MARK], b2.WORKERS_SUPPORTED = !n2 && !!f3.Worker, b2.NODE_STREAM_INPUT = 1, b2.LocalChunkSize = 10485760, b2.RemoteChunkSize = 5242880, b2.DefaultDelimiter = ",", b2.Parser = E2, b2.ParserHandle = r2, b2.NetworkStreamer = l2, b2.FileStreamer = c2, b2.StringStreamer = p2, b2.ReadableStreamStreamer = g2, f3.jQuery) {
var d2 = f3.jQuery;
d2.fn.parse = function(o3) {
var r3 = o3.config || {}, u3 = [];
return this.each(function(e2) {
if (!("INPUT" === d2(this).prop("tagName").toUpperCase() && "file" === d2(this).attr("type").toLowerCase() && f3.FileReader) || !this.files || 0 === this.files.length)
return true;
for (var t2 = 0; t2 < this.files.length; t2++)
u3.push({ file: this.files[t2], inputElem: this, instanceConfig: d2.extend({}, r3) });
}), e(), this;
function e() {
if (0 !== u3.length) {
var e2, t2, r4, i2, n3 = u3[0];
if (J(o3.before)) {
var s3 = o3.before(n3.file, n3.inputElem);
if ("object" == typeof s3) {
if ("abort" === s3.action)
return e2 = "AbortError", t2 = n3.file, r4 = n3.inputElem, i2 = s3.reason, void (J(o3.error) && o3.error({ name: e2 }, t2, r4, i2));
if ("skip" === s3.action)
return void h3();
"object" == typeof s3.config && (n3.instanceConfig = d2.extend(n3.instanceConfig, s3.config));
} else if ("skip" === s3)
return void h3();
}
var a3 = n3.instanceConfig.complete;
n3.instanceConfig.complete = function(e3) {
J(a3) && a3(e3, n3.file, n3.inputElem), h3();
}, b2.parse(n3.file, n3.instanceConfig);
} else
J(o3.complete) && o3.complete();
}
function h3() {
u3.splice(0, 1), e();
}
};
}
function h2(e) {
this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e2) {
var t2 = w2(e2);
t2.chunkSize = parseInt(t2.chunkSize), e2.step || e2.chunk || (t2.chunkSize = null);
this._handle = new r2(t2), (this._handle.streamer = this)._config = t2;
}.call(this, e), this.parseChunk = function(e2, t2) {
if (this.isFirstChunk && J(this._config.beforeFirstChunk)) {
var r3 = this._config.beforeFirstChunk(e2);
void 0 !== r3 && (e2 = r3);
}
this.isFirstChunk = false, this._halted = false;
var i2 = this._partialLine + e2;
this._partialLine = "";
var n3 = this._handle.parse(i2, this._baseIndex, !this._finished);
if (!this._handle.paused() && !this._handle.aborted()) {
var s3 = n3.meta.cursor;
this._finished || (this._partialLine = i2.substring(s3 - this._baseIndex), this._baseIndex = s3), n3 && n3.data && (this._rowCount += n3.data.length);
var a3 = this._finished || this._config.preview && this._rowCount >= this._config.preview;
if (o2)
f3.postMessage({ results: n3, workerId: b2.WORKER_ID, finished: a3 });
else if (J(this._config.chunk) && !t2) {
if (this._config.chunk(n3, this._handle), this._handle.paused() || this._handle.aborted())
return void (this._halted = true);
n3 = void 0, this._completeResults = void 0;
}
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(n3.data), this._completeResults.errors = this._completeResults.errors.concat(n3.errors), this._completeResults.meta = n3.meta), this._completed || !a3 || !J(this._config.complete) || n3 && n3.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), a3 || n3 && n3.meta.paused || this._nextChunk(), n3;
}
this._halted = true;
}, this._sendError = function(e2) {
J(this._config.error) ? this._config.error(e2) : o2 && this._config.error && f3.postMessage({ workerId: b2.WORKER_ID, error: e2, finished: false });
};
}
function l2(e) {
var i2;
(e = e || {}).chunkSize || (e.chunkSize = b2.RemoteChunkSize), h2.call(this, e), this._nextChunk = n2 ? function() {
this._readChunk(), this._chunkLoaded();
} : function() {
this._readChunk();
}, this.stream = function(e2) {
this._input = e2, this._nextChunk();
}, this._readChunk = function() {
if (this._finished)
this._chunkLoaded();
else {
if (i2 = new XMLHttpRequest(), this._config.withCredentials && (i2.withCredentials = this._config.withCredentials), n2 || (i2.onload = v2(this._chunkLoaded, this), i2.onerror = v2(this._chunkError, this)), i2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !n2), this._config.downloadRequestHeaders) {
var e2 = this._config.downloadRequestHeaders;
for (var t2 in e2)
i2.setRequestHeader(t2, e2[t2]);
}
if (this._config.chunkSize) {
var r3 = this._start + this._config.chunkSize - 1;
i2.setRequestHeader("Range", "bytes=" + this._start + "-" + r3);
}
try {
i2.send(this._config.downloadRequestBody);
} catch (e3) {
this._chunkError(e3.message);
}
n2 && 0 === i2.status && this._chunkError();
}
}, this._chunkLoaded = function() {
4 === i2.readyState && (i2.status < 200 || 400 <= i2.status ? this._chunkError() : (this._start += this._config.chunkSize ? this._config.chunkSize : i2.responseText.length, this._finished = !this._config.chunkSize || this._start >= function(e2) {
var t2 = e2.getResponseHeader("Content-Range");
if (null === t2)
return -1;
return parseInt(t2.substring(t2.lastIndexOf("/") + 1));
}(i2), this.parseChunk(i2.responseText)));
}, this._chunkError = function(e2) {
var t2 = i2.statusText || e2;
this._sendError(new Error(t2));
};
}
function c2(e) {
var i2, n3;
(e = e || {}).chunkSize || (e.chunkSize = b2.LocalChunkSize), h2.call(this, e);
var s3 = "undefined" != typeof FileReader;
this.stream = function(e2) {
this._input = e2, n3 = e2.slice || e2.webkitSlice || e2.mozSlice, s3 ? ((i2 = new FileReader()).onload = v2(this._chunkLoaded, this), i2.onerror = v2(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
}, this._nextChunk = function() {
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
}, this._readChunk = function() {
var e2 = this._input;
if (this._config.chunkSize) {
var t2 = Math.min(this._start + this._config.chunkSize, this._input.size);
e2 = n3.call(e2, this._start, t2);
}
var r3 = i2.readAsText(e2, this._config.encoding);
s3 || this._chunkLoaded({ target: { result: r3 } });
}, this._chunkLoaded = function(e2) {
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e2.target.result);
}, this._chunkError = function() {
this._sendError(i2.error);
};
}
function p2(e) {
var r3;
h2.call(this, e = e || {}), this.stream = function(e2) {
return r3 = e2, this._nextChunk();
}, this._nextChunk = function() {
if (!this._finished) {
var e2, t2 = this._config.chunkSize;
return t2 ? (e2 = r3.substring(0, t2), r3 = r3.substring(t2)) : (e2 = r3, r3 = ""), this._finished = !r3, this.parseChunk(e2);
}
};
}
function g2(e) {
h2.call(this, e = e || {});
var t2 = [], r3 = true, i2 = false;
this.pause = function() {
h2.prototype.pause.apply(this, arguments), this._input.pause();
}, this.resume = function() {
h2.prototype.resume.apply(this, arguments), this._input.resume();
}, this.stream = function(e2) {
this._input = e2, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
}, this._checkIsFinished = function() {
i2 && 1 === t2.length && (this._finished = true);
}, this._nextChunk = function() {
this._checkIsFinished(), t2.length ? this.parseChunk(t2.shift()) : r3 = true;
}, this._streamData = v2(function(e2) {
try {
t2.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), r3 && (r3 = false, this._checkIsFinished(), this.parseChunk(t2.shift()));
} catch (e3) {
this._streamError(e3);
}
}, this), this._streamError = v2(function(e2) {
this._streamCleanUp(), this._sendError(e2);
}, this), this._streamEnd = v2(function() {
this._streamCleanUp(), i2 = true, this._streamData("");
}, this), this._streamCleanUp = v2(function() {
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
}, this);
}
function r2(m3) {
var a3, o3, u3, i2 = Math.pow(2, 53), n3 = -i2, s3 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, h3 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, t2 = this, r3 = 0, f4 = 0, d3 = false, e = false, l3 = [], c3 = { data: [], errors: [], meta: {} };
if (J(m3.step)) {
var p3 = m3.step;
m3.step = function(e2) {
if (c3 = e2, _4())
g3();
else {
if (g3(), 0 === c3.data.length)
return;
r3 += e2.data.length, m3.preview && r3 > m3.preview ? o3.abort() : (c3.data = c3.data[0], p3(c3, t2));
}
};
}
function y3(e2) {
return "greedy" === m3.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
}
function g3() {
return c3 && u3 && (k2("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + b2.DefaultDelimiter + "'"), u3 = false), m3.skipEmptyLines && (c3.data = c3.data.filter(function(e2) {
return !y3(e2);
})), _4() && function() {
if (!c3)
return;
function e2(e3, t4) {
J(m3.transformHeader) && (e3 = m3.transformHeader(e3, t4)), l3.push(e3);
}
if (Array.isArray(c3.data[0])) {
for (var t3 = 0; _4() && t3 < c3.data.length; t3++)
c3.data[t3].forEach(e2);
c3.data.splice(0, 1);
} else
c3.data.forEach(e2);
}(), function() {
if (!c3 || !m3.header && !m3.dynamicTyping && !m3.transform)
return c3;
function e2(e3, t4) {
var r4, i3 = m3.header ? {} : [];
for (r4 = 0; r4 < e3.length; r4++) {
var n4 = r4, s4 = e3[r4];
m3.header && (n4 = r4 >= l3.length ? "__parsed_extra" : l3[r4]), m3.transform && (s4 = m3.transform(s4, n4)), s4 = v3(n4, s4), "__parsed_extra" === n4 ? (i3[n4] = i3[n4] || [], i3[n4].push(s4)) : i3[n4] = s4;
}
return m3.header && (r4 > l3.length ? k2("FieldMismatch", "TooManyFields", "Too many fields: expected " + l3.length + " fields but parsed " + r4, f4 + t4) : r4 < l3.length && k2("FieldMismatch", "TooFewFields", "Too few fields: expected " + l3.length + " fields but parsed " + r4, f4 + t4)), i3;
}
var t3 = 1;
!c3.data.length || Array.isArray(c3.data[0]) ? (c3.data = c3.data.map(e2), t3 = c3.data.length) : c3.data = e2(c3.data, 0);
m3.header && c3.meta && (c3.meta.fields = l3);
return f4 += t3, c3;
}();
}
function _4() {
return m3.header && 0 === l3.length;
}
function v3(e2, t3) {
return r4 = e2, m3.dynamicTypingFunction && void 0 === m3.dynamicTyping[r4] && (m3.dynamicTyping[r4] = m3.dynamicTypingFunction(r4)), true === (m3.dynamicTyping[r4] || m3.dynamicTyping) ? "true" === t3 || "TRUE" === t3 || "false" !== t3 && "FALSE" !== t3 && (function(e3) {
if (s3.test(e3)) {
var t4 = parseFloat(e3);
if (n3 < t4 && t4 < i2)
return true;
}
return false;
}(t3) ? parseFloat(t3) : h3.test(t3) ? new Date(t3) : "" === t3 ? null : t3) : t3;
var r4;
}
function k2(e2, t3, r4, i3) {
var n4 = { type: e2, code: t3, message: r4 };
void 0 !== i3 && (n4.row = i3), c3.errors.push(n4);
}
this.parse = function(e2, t3, r4) {
var i3 = m3.quoteChar || '"';
if (m3.newline || (m3.newline = function(e3, t4) {
e3 = e3.substring(0, 1048576);
var r5 = new RegExp(Q2(t4) + "([^]*?)" + Q2(t4), "gm"), i4 = (e3 = e3.replace(r5, "")).split("\r"), n5 = e3.split("\n"), s5 = 1 < n5.length && n5[0].length < i4[0].length;
if (1 === i4.length || s5)
return "\n";
for (var a4 = 0, o4 = 0; o4 < i4.length; o4++)
"\n" === i4[o4][0] && a4++;
return a4 >= i4.length / 2 ? "\r\n" : "\r";
}(e2, i3)), u3 = false, m3.delimiter)
J(m3.delimiter) && (m3.delimiter = m3.delimiter(e2), c3.meta.delimiter = m3.delimiter);
else {
var n4 = function(e3, t4, r5, i4, n5) {
var s5, a4, o4, u4;
n5 = n5 || [",", " ", "|", ";", b2.RECORD_SEP, b2.UNIT_SEP];
for (var h4 = 0; h4 < n5.length; h4++) {
var f5 = n5[h4], d4 = 0, l4 = 0, c4 = 0;
o4 = void 0;
for (var p4 = new E2({ comments: i4, delimiter: f5, newline: t4, preview: 10 }).parse(e3), g4 = 0; g4 < p4.data.length; g4++)
if (r5 && y3(p4.data[g4]))
c4++;
else {
var _5 = p4.data[g4].length;
l4 += _5, void 0 !== o4 ? 0 < _5 && (d4 += Math.abs(_5 - o4), o4 = _5) : o4 = _5;
}
0 < p4.data.length && (l4 /= p4.data.length - c4), (void 0 === a4 || d4 <= a4) && (void 0 === u4 || u4 < l4) && 1.99 < l4 && (a4 = d4, s5 = f5, u4 = l4);
}
return { successful: !!(m3.delimiter = s5), bestDelimiter: s5 };
}(e2, m3.newline, m3.skipEmptyLines, m3.comments, m3.delimitersToGuess);
n4.successful ? m3.delimiter = n4.bestDelimiter : (u3 = true, m3.delimiter = b2.DefaultDelimiter), c3.meta.delimiter = m3.delimiter;
}
var s4 = w2(m3);
return m3.preview && m3.header && s4.preview++, a3 = e2, o3 = new E2(s4), c3 = o3.parse(a3, t3, r4), g3(), d3 ? { meta: { paused: true } } : c3 || { meta: { paused: false } };
}, this.paused = function() {
return d3;
}, this.pause = function() {
d3 = true, o3.abort(), a3 = J(m3.chunk) ? "" : a3.substring(o3.getCharIndex());
}, this.resume = function() {
t2.streamer._halted ? (d3 = false, t2.streamer.parseChunk(a3, true)) : setTimeout(t2.resume, 3);
}, this.aborted = function() {
return e;
}, this.abort = function() {
e = true, o3.abort(), c3.meta.aborted = true, J(m3.complete) && m3.complete(c3), a3 = "";
};
}
function Q2(e) {
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function E2(j2) {
var z2, M2 = (j2 = j2 || {}).delimiter, P2 = j2.newline, U2 = j2.comments, q2 = j2.step, N2 = j2.preview, B2 = j2.fastMode, K = z2 = void 0 === j2.quoteChar || null === j2.quoteChar ? '"' : j2.quoteChar;
if (void 0 !== j2.escapeChar && (K = j2.escapeChar), ("string" != typeof M2 || -1 < b2.BAD_DELIMITERS.indexOf(M2)) && (M2 = ","), U2 === M2)
throw new Error("Comment character same as delimiter");
true === U2 ? U2 = "#" : ("string" != typeof U2 || -1 < b2.BAD_DELIMITERS.indexOf(U2)) && (U2 = false), "\n" !== P2 && "\r" !== P2 && "\r\n" !== P2 && (P2 = "\n");
var W2 = 0, H2 = false;
this.parse = function(i2, t2, r3) {
if ("string" != typeof i2)
throw new Error("Input must be a string");
var n3 = i2.length, e = M2.length, s3 = P2.length, a3 = U2.length, o3 = J(q2), u3 = [], h3 = [], f4 = [], d3 = W2 = 0;
if (!i2)
return L2();
if (j2.header && !t2) {
var l3 = i2.split(P2)[0].split(M2), c3 = [], p3 = {}, g3 = false;
for (var _4 in l3) {
var m3 = l3[_4];
J(j2.transformHeader) && (m3 = j2.transformHeader(m3, _4));
var y3 = m3, v3 = p3[m3] || 0;
for (0 < v3 && (g3 = true, y3 = m3 + "_" + v3), p3[m3] = v3 + 1; c3.includes(y3); )
y3 = y3 + "_" + v3;
c3.push(y3);
}
if (g3) {
var k2 = i2.split(P2);
k2[0] = c3.join(M2), i2 = k2.join(P2);
}
}
if (B2 || false !== B2 && -1 === i2.indexOf(z2)) {
for (var b3 = i2.split(P2), E3 = 0; E3 < b3.length; E3++) {
if (f4 = b3[E3], W2 += f4.length, E3 !== b3.length - 1)
W2 += P2.length;
else if (r3)
return L2();
if (!U2 || f4.substring(0, a3) !== U2) {
if (o3) {
if (u3 = [], I2(f4.split(M2)), F2(), H2)
return L2();
} else
I2(f4.split(M2));
if (N2 && N2 <= E3)
return u3 = u3.slice(0, N2), L2(true);
}
}
return L2();
}
for (var w3 = i2.indexOf(M2, W2), R2 = i2.indexOf(P2, W2), C = new RegExp(Q2(K) + Q2(z2), "g"), S2 = i2.indexOf(z2, W2); ; )
if (i2[W2] !== z2)
if (U2 && 0 === f4.length && i2.substring(W2, W2 + a3) === U2) {
if (-1 === R2)
return L2();
W2 = R2 + s3, R2 = i2.indexOf(P2, W2), w3 = i2.indexOf(M2, W2);
} else if (-1 !== w3 && (w3 < R2 || -1 === R2))
f4.push(i2.substring(W2, w3)), W2 = w3 + e, w3 = i2.indexOf(M2, W2);
else {
if (-1 === R2)
break;
if (f4.push(i2.substring(W2, R2)), D2(R2 + s3), o3 && (F2(), H2))
return L2();
if (N2 && u3.length >= N2)
return L2(true);
}
else
for (S2 = W2, W2++; ; ) {
if (-1 === (S2 = i2.indexOf(z2, S2 + 1)))
return r3 || h3.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: u3.length, index: W2 }), T();
if (S2 === n3 - 1)
return T(i2.substring(W2, S2).replace(C, z2));
if (z2 !== K || i2[S2 + 1] !== K) {
if (z2 === K || 0 === S2 || i2[S2 - 1] !== K) {
-1 !== w3 && w3 < S2 + 1 && (w3 = i2.indexOf(M2, S2 + 1)), -1 !== R2 && R2 < S2 + 1 && (R2 = i2.indexOf(P2, S2 + 1));
var O2 = A2(-1 === R2 ? w3 : Math.min(w3, R2));
if (i2.substr(S2 + 1 + O2, e) === M2) {
f4.push(i2.substring(W2, S2).replace(C, z2)), i2[W2 = S2 + 1 + O2 + e] !== z2 && (S2 = i2.indexOf(z2, W2)), w3 = i2.indexOf(M2, W2), R2 = i2.indexOf(P2, W2);
break;
}
var x2 = A2(R2);
if (i2.substring(S2 + 1 + x2, S2 + 1 + x2 + s3) === P2) {
if (f4.push(i2.substring(W2, S2).replace(C, z2)), D2(S2 + 1 + x2 + s3), w3 = i2.indexOf(M2, W2), S2 = i2.indexOf(z2, W2), o3 && (F2(), H2))
return L2();
if (N2 && u3.length >= N2)
return L2(true);
break;
}
h3.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: u3.length, index: W2 }), S2++;
}
} else
S2++;
}
return T();
function I2(e2) {
u3.push(e2), d3 = W2;
}
function A2(e2) {
var t3 = 0;
if (-1 !== e2) {
var r4 = i2.substring(S2 + 1, e2);
r4 && "" === r4.trim() && (t3 = r4.length);
}
return t3;
}
function T(e2) {
return r3 || (void 0 === e2 && (e2 = i2.substring(W2)), f4.push(e2), W2 = n3, I2(f4), o3 && F2()), L2();
}
function D2(e2) {
W2 = e2, I2(f4), f4 = [], R2 = i2.indexOf(P2, W2);
}
function L2(e2) {
return { data: u3, errors: h3, meta: { delimiter: M2, linebreak: P2, aborted: H2, truncated: !!e2, cursor: d3 + (t2 || 0) } };
}
function F2() {
q2(L2()), u3 = [], h3 = [];
}
}, this.abort = function() {
H2 = true;
}, this.getCharIndex = function() {
return W2;
};
}
function _3(e) {
var t2 = e.data, r3 = a2[t2.workerId], i2 = false;
if (t2.error)
r3.userError(t2.error, t2.file);
else if (t2.results && t2.results.data) {
var n3 = { abort: function() {
i2 = true, m2(t2.workerId, { data: [], errors: [], meta: { aborted: true } });
}, pause: y2, resume: y2 };
if (J(r3.userStep)) {
for (var s3 = 0; s3 < t2.results.data.length && (r3.userStep({ data: t2.results.data[s3], errors: t2.results.errors, meta: t2.results.meta }, n3), !i2); s3++)
;
delete t2.results;
} else
J(r3.userChunk) && (r3.userChunk(t2.results, n3, t2.file), delete t2.results);
}
t2.finished && !i2 && m2(t2.workerId, t2.results);
}
function m2(e, t2) {
var r3 = a2[e];
J(r3.userComplete) && r3.userComplete(t2), r3.terminate(), delete a2[e];
}
function y2() {
throw new Error("Not implemented.");
}
function w2(e) {
if ("object" != typeof e || null === e)
return e;
var t2 = Array.isArray(e) ? [] : {};
for (var r3 in e)
t2[r3] = w2(e[r3]);
return t2;
}
function v2(e, t2) {
return function() {
e.apply(t2, arguments);
};
}
function J(e) {
return "function" == typeof e;
}
return o2 && (f3.onmessage = function(e) {
var t2 = e.data;
void 0 === b2.WORKER_ID && t2 && (b2.WORKER_ID = t2.workerId);
if ("string" == typeof t2.input)
f3.postMessage({ workerId: b2.WORKER_ID, results: b2.parse(t2.input, t2.config), finished: true });
else if (f3.File && t2.input instanceof File || t2.input instanceof Object) {
var r3 = b2.parse(t2.input, t2.config);
r3 && f3.postMessage({ workerId: b2.WORKER_ID, results: r3, finished: true });
}
}), (l2.prototype = Object.create(h2.prototype)).constructor = l2, (c2.prototype = Object.create(h2.prototype)).constructor = c2, (p2.prototype = Object.create(p2.prototype)).constructor = p2, (g2.prototype = Object.create(h2.prototype)).constructor = g2, b2;
});
}
});
// 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 = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;"
};
var htmlUnescapes = {
"&amp;": "&",
"&lt;": "<",
"&gt;": ">",
"&quot;": '"',
"&#39;": "'"
};
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, values) {
var index = -1, length = values.length, offset = array.length;
while (++index < length) {
array[offset + index] = values[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 getValue2(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(map2) {
var index = -1, result = Array(map2.size);
map2.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
function overArg(func, transform) {
return function(arg) {
return func(transform(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(values2) {
var index = -1, length = values2 == null ? 0 : values2.length;
this.__data__ = new MapCache();
while (++index < length) {
this.add(values2[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 Stack2(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;
}
Stack2.prototype.clear = stackClear;
Stack2.prototype["delete"] = stackDelete;
Stack2.prototype.get = stackGet;
Stack2.prototype.has = stackHas;
Stack2.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), skip2 = object == null;
while (++index < length) {
result2[index] = skip2 ? 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 Stack2());
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, values2, iteratee2, comparator) {
var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
if (!length) {
return result2;
}
if (iteratee2) {
values2 = arrayMap(values2, baseUnary(iteratee2));
}
if (comparator) {
includes2 = arrayIncludesWith;
isCommon = false;
} else if (values2.length >= LARGE_ARRAY_SIZE) {
includes2 = cacheHas;
isCommon = false;
values2 = new SetCache(values2);
}
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 (values2[valuesIndex] === computed) {
continue outer;
}
}
result2.push(value);
} else if (!includes2(values2, 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(last2(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 Stack2());
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 Stack2());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack2());
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 Stack2();
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 identity2;
}
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 Stack2());
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 (isPlainObject4(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 = [identity2];
}
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, values2, iteratee2, comparator) {
var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
if (array === values2) {
values2 = copyArray(values2);
}
if (iteratee2) {
seen = arrayMap(array, baseUnary(iteratee2));
}
while (++index < length) {
var fromIndex = 0, value = values2[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, identity2), func + "");
}
function baseSample(collection) {
return arraySample(values(collection));
}
function baseSampleSize(collection, n2) {
var array = values(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 ? identity2 : function(func, data) {
metaMap.set(func, data);
return func;
};
var baseSetToString = !defineProperty ? identity2 : function(func, string) {
return defineProperty(func, "toString", {
"configurable": true,
"enumerable": false,
"value": constant(string),
"writable": true
});
};
function baseShuffle(collection) {
return shuffleSelf(values(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, identity2, 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(last2(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, values2, assignFunc) {
var index = -1, length = props.length, valsLength = values2.length, result2 = {};
while (++index < length) {
var value = index < valsLength ? values2[index] : undefined2;
assignFunc(result2, props[index], value);
}
return result2;
}
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
function castFunction(value) {
return typeof value == "function" ? value : identity2;
}
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(id2) {
return root.clearTimeout(id2);
};
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 order = orders[index];
return result2 * (order == "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) ? noop2 : function(values2) {
return new Set2(values2);
};
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 isPlainObject4(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 ? noop2 : 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(map3, key) {
var data = map3.__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 = getValue2(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 = memoize(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, transform2) {
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] = transform2(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, values2) {
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
});
var differenceBy = baseRest(function(array, values2) {
var iteratee2 = last2(values2);
if (isArrayLikeObject(iteratee2)) {
iteratee2 = undefined2;
}
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
});
var differenceWith = baseRest(function(array, values2) {
var comparator = last2(values2);
if (isArrayLikeObject(comparator)) {
comparator = undefined2;
}
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 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 = last2(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee2 === last2(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 = last2(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 last2(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, values2) {
return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
}
function pullAllBy(array, values2, iteratee2) {
return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
}
function pullAllWith(array, values2, comparator) {
return array && array.length && values2 && values2.length ? basePullAll(array, values2, 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 remove2(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 = last2(arrays);
if (isArrayLikeObject(iteratee2)) {
iteratee2 = undefined2;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
});
var unionWith = baseRest(function(arrays) {
var comparator = last2(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, values2) {
return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
});
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
var xorBy = baseRest(function(arrays) {
var iteratee2 = last2(arrays);
if (isArrayLikeObject(iteratee2)) {
iteratee2 = undefined2;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
});
var xorWith = baseRest(function(arrays) {
var comparator = last2(arrays);
comparator = typeof comparator == "function" ? comparator : undefined2;
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator);
});
var zip = baseRest(unzip);
function zipObject(props, values2) {
return baseZipObject(props || [], values2 || [], assignValue);
}
function zipObjectDeep(props, values2) {
return baseZipObject(props || [], values2 || [], 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 tap2(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 clone3 = wrapperClone(parent2);
clone3.__index__ = 0;
clone3.__values__ = undefined2;
if (result2) {
previous.__wrapped__ = clone3;
} else {
result2 = clone3;
}
var previous = clone3;
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 filter2(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, getIteratee(predicate, 3));
}
var find2 = createFind(findIndex);
var findLast = createFind(findLastIndex);
function flatMap(collection, iteratee2) {
return baseFlatten(map2(collection, iteratee2), 1);
}
function flatMapDeep(collection, iteratee2) {
return baseFlatten(map2(collection, iteratee2), INFINITY);
}
function flatMapDepth(collection, iteratee2, depth) {
depth = depth === undefined2 ? 1 : toInteger(depth);
return baseFlatten(map2(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 : values(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 map2(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 memoize(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 (memoize.Cache || MapCache)();
return memoized;
}
memoize.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 clone2(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 isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
function isElement(value) {
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject4(value);
}
function isEmpty(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" && !isPlainObject4(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 isMatch(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 isPlainObject4(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 : values;
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, properties) {
var result2 = baseCreate(prototype);
return properties == null ? result2 : baseAssign(result2, properties);
}
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(identity2));
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 omit2 = 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 transform(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 values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
}
function clamp(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 ? capitalize(word) : word);
});
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
}
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, 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 split2(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, position) {
string = toString(string);
position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + 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 unescape2(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 identity2(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 noop2() {
}
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 id2 = ++idCounter;
return toString(prefix2) + id2;
}
var add = createMathOperation(function(augend, addend) {
return augend + addend;
}, 0);
var ceil2 = createRound("ceil");
var divide = createMathOperation(function(dividend, divisor) {
return dividend / divisor;
}, 1);
var floor2 = createRound("floor");
function max2(array) {
return array && array.length ? baseExtremum(array, identity2, baseGt) : undefined2;
}
function maxBy(array, iteratee2) {
return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2;
}
function mean(array) {
return baseMean(array, identity2);
}
function meanBy(array, iteratee2) {
return baseMean(array, getIteratee(iteratee2, 2));
}
function min2(array) {
return array && array.length ? baseExtremum(array, identity2, 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, identity2) : 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 = filter2;
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 = map2;
lodash.mapKeys = mapKeys;
lodash.mapValues = mapValues;
lodash.matches = matches;
lodash.matchesProperty = matchesProperty;
lodash.memoize = memoize;
lodash.merge = merge2;
lodash.mergeWith = mergeWith;
lodash.method = method;
lodash.methodOf = methodOf;
lodash.mixin = mixin;
lodash.negate = negate;
lodash.nthArg = nthArg;
lodash.omit = omit2;
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 = remove2;
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 = split2;
lodash.spread = spread;
lodash.tail = tail;
lodash.take = take;
lodash.takeRight = takeRight;
lodash.takeRightWhile = takeRightWhile;
lodash.takeWhile = takeWhile;
lodash.tap = tap2;
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.toPairs = toPairs;
lodash.toPairsIn = toPairsIn;
lodash.toPath = toPath;
lodash.toPlainObject = toPlainObject;
lodash.transform = transform;
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 = values;
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 = capitalize;
lodash.ceil = ceil2;
lodash.clamp = clamp;
lodash.clone = clone2;
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 = find2;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.floor = floor2;
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 = identity2;
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 = isDate2;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
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 = isMatch;
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 = isPlainObject4;
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 = last2;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lowerFirst = lowerFirst;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max2;
lodash.maxBy = maxBy;
lodash.mean = mean;
lodash.meanBy = meanBy;
lodash.min = min2;
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 = noop2;
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 = unescape2;
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(identity2);
};
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);
}
});
// src/main.ts
var main_exports = {};
__export(main_exports, {
DEFAULT_SETTINGS: () => DEFAULT_SETTINGS,
default: () => NLTPlugin
});
module.exports = __toCommonJS(main_exports);
var import_obsidian14 = require("obsidian");
// src/obsidian/nlt-settings-tab.ts
var import_obsidian = require("obsidian");
var import_obsidian2 = require("obsidian");
var NLTSettingsTab = class extends import_obsidian.PluginSettingTab {
constructor(app2, plugin) {
super(app2, plugin);
__publicField(this, "plugin");
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: "Notion-Like Tables" });
containerEl.createSpan(
{},
(span) => span.innerHTML = `<strong style="color: var(--text-accent); font-size: 12px;">Please restart Obsidian for these settings to take effect</strong>`
);
new import_obsidian2.Setting(containerEl).setName("File").setHeading();
const attachmentsFolderDesc = new DocumentFragment();
attachmentsFolderDesc.createSpan({}, (span) => {
span.innerHTML = `Create tables in the attachments folder defined in the Obsidian settings.<br><br>This can be changed in <span style="color: var(--text-accent);">Files & Links -> Default location for new attachments</span><br><br>Otherwise, the custom location below will be used.`;
});
new import_obsidian2.Setting(containerEl).setName("Create new tables in the attachments folder").setDesc(attachmentsFolderDesc).addToggle((cb) => {
cb.setValue(
this.plugin.settings.createAtObsidianAttachmentFolder
).onChange((value) => __async(this, null, function* () {
this.plugin.settings.createAtObsidianAttachmentFolder = value;
yield this.plugin.saveSettings();
this.display();
}));
});
const customLocationDesc = new DocumentFragment();
customLocationDesc.createSpan({}, (span) => {
span.innerHTML = `Folder that new tables will be created in. Please don't include a slash at the start or end.<br>e.g. <strong>myfolder/subdirectory</strong><br><br>Default location is the vault root folder, if not specified.`;
});
if (this.plugin.settings.createAtObsidianAttachmentFolder === false) {
new import_obsidian2.Setting(containerEl).setName("Custom location for new tables").setDesc(customLocationDesc).addText((cb) => {
cb.setValue(
this.plugin.settings.customFolderForNewTables
).onChange((value) => __async(this, null, function* () {
this.plugin.settings.customFolderForNewTables = value;
yield this.plugin.saveSettings();
}));
});
}
const activeFileNameTimestampDesc = new DocumentFragment();
activeFileNameTimestampDesc.createSpan({}, (span) => {
span.innerHTML = `If a markdown file is open, the active file name and current timestamp will be used as the table name.<br>e.g. if <strong>Test.md</strong> is open, the table will be named <strong>Test-2023-04-14T13.12.59-06.00.table</strong><br><br>Otherwise, the default table file name will be used.<br>e.g <strong>Untitled.table</strong>`;
});
new import_obsidian2.Setting(containerEl).setName(
"Create table name based on active file name and timestamp"
).setDesc(activeFileNameTimestampDesc).addToggle((cb) => {
cb.setValue(
this.plugin.settings.nameWithActiveFileNameAndTimestamp
).onChange((value) => __async(this, null, function* () {
this.plugin.settings.nameWithActiveFileNameAndTimestamp = value;
yield this.plugin.saveSettings();
}));
});
const exportRenderMarkdownDesc = new DocumentFragment();
exportRenderMarkdownDesc.createSpan({}, (span) => {
span.innerHTML = "This will cause all exported values to be rendered in markdown format. Disable this option if you primarily export in CSV and don't want markdown, like links wrapped in brackets.";
});
new import_obsidian2.Setting(containerEl).setName("Export").setHeading();
new import_obsidian2.Setting(containerEl).setName("Render markdown values").setDesc(exportRenderMarkdownDesc).addToggle((cb) => {
cb.setValue(this.plugin.settings.exportRenderMarkdown).onChange(
(value) => __async(this, null, function* () {
this.plugin.settings.exportRenderMarkdown = value;
yield this.plugin.saveSettings();
})
);
});
new import_obsidian2.Setting(containerEl).setName("Debug").setHeading();
new import_obsidian2.Setting(containerEl).setName("Debug mode").setDesc(
"Turns on console.log for plugin events. This is useful for troubleshooting."
).addToggle((cb) => {
cb.setValue(this.plugin.settings.shouldDebug).onChange(
(value) => __async(this, null, function* () {
this.plugin.settings.shouldDebug = value;
yield this.plugin.saveSettings();
})
);
});
}
};
// node_modules/immer/dist/immer.esm.mjs
function n(n2) {
for (var r2 = arguments.length, t2 = Array(r2 > 1 ? r2 - 1 : 0), e = 1; e < r2; 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 r(n2) {
return !!n2 && !!n2[Q];
}
function t(n2) {
return !!n2 && (function(n3) {
if (!n3 || "object" != typeof n3)
return false;
var r2 = Object.getPrototypeOf(n3);
if (null === r2)
return true;
var t2 = Object.hasOwnProperty.call(r2, "constructor") && r2.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, r2, t2) {
void 0 === t2 && (t2 = false), 0 === o(n2) ? (t2 ? Object.keys : nn)(n2).forEach(function(e) {
t2 && "symbol" == typeof e || r2(e, n2[e], n2);
}) : n2.forEach(function(t3, e) {
return r2(e, t3, n2);
});
}
function o(n2) {
var r2 = n2[Q];
return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v(n2) ? 3 : 0;
}
function u(n2, r2) {
return 2 === o(n2) ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
}
function a(n2, r2) {
return 2 === o(n2) ? n2.get(r2) : n2[r2];
}
function f(n2, r2, t2) {
var e = o(n2);
2 === e ? n2.set(r2, t2) : 3 === e ? (n2.delete(r2), n2.add(t2)) : n2[r2] = t2;
}
function c(n2, r2) {
return n2 === r2 ? 0 !== n2 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
}
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 r2 = rn(n2);
delete r2[Q];
for (var t2 = nn(r2), e = 0; e < t2.length; e++) {
var i2 = t2[e], o2 = r2[i2];
false === o2.writable && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
}
return Object.create(Object.getPrototypeOf(n2), r2);
}
function d(n2, e) {
return void 0 === e && (e = false), y(n2) || r(n2) || !t(n2) ? n2 : (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h), Object.freeze(n2), e && i(n2, function(n3, r2) {
return d(r2, true);
}, true), n2);
}
function h() {
n(2);
}
function y(n2) {
return null == n2 || "object" != typeof n2 || Object.isFrozen(n2);
}
function b(r2) {
var t2 = tn[r2];
return t2 || n(18, r2), t2;
}
function m(n2, r2) {
tn[n2] || (tn[n2] = r2);
}
function _() {
return U || n(0), U;
}
function j(n2, r2) {
r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2);
}
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 r2 = n2[Q];
0 === r2.i || 1 === r2.i ? r2.j() : r2.O = true;
}
function P(r2, e) {
e._ = e.p.length;
var i2 = e.p[0], o2 = void 0 !== r2 && r2 !== i2;
return e.h.g || b("ES5").S(e, r2, o2), o2 ? (i2[Q].P && (O(e), n(4)), t(r2) && (r2 = M(e, r2), e.l || x(e, r2)), e.u && b("Patches").M(i2[Q].t, r2, e.u, e.s)) : r2 = M(e, i2, []), O(e), e.u && e.v(e.u, e.s), r2 !== H ? r2 : void 0;
}
function M(n2, r2, t2) {
if (y(r2))
return r2;
var e = r2[Q];
if (!e)
return i(r2, function(i2, o3) {
return A(n2, e, r2, i2, o3, t2);
}, true), r2;
if (e.A !== n2)
return r2;
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(r3, i2) {
return A(n2, e, o2, r3, 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), r(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), !r(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, r2, t2) {
void 0 === t2 && (t2 = false), n2.h.F && n2.m && d(r2, t2);
}
function z(n2, r2) {
var t2 = n2[Q];
return (t2 ? p(t2) : n2)[r2];
}
function I(n2, r2) {
if (r2 in n2)
for (var t2 = Object.getPrototypeOf(n2); t2; ) {
var e = Object.getOwnPropertyDescriptor(t2, r2);
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, r2, t2) {
var e = s(r2) ? b("MapSet").N(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.g ? function(n3, r3) {
var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, D: {}, l: r3, 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, f3 = u2.proxy;
return e2.k = f3, e2.j = a2, f3;
}(r2, t2) : b("ES5").J(r2, t2);
return (t2 ? t2.A : _()).p.push(e), e;
}
function D(e) {
return r(e) || n(22, e), function n2(r2) {
if (!t(r2))
return r2;
var e2, u2 = r2[Q], c2 = o(r2);
if (u2) {
if (!u2.P && (u2.i < 4 || !b("ES5").K(u2)))
return u2.t;
u2.I = true, e2 = F(r2, c2), u2.I = false;
} else
e2 = F(r2, c2);
return i(e2, function(r3, t2) {
u2 && a(u2.t, r3) === t2 || f(e2, r3, n2(t2));
}), 3 === c2 ? new Set(e2) : e2;
}(e);
}
function F(n2, r2) {
switch (r2) {
case 2:
return new Map(n2);
case 3:
return Array.from(n2);
}
return l(n2);
}
function N() {
function t2(n2, r2) {
var t3 = s2[n2];
return t3 ? t3.enumerable = r2 : s2[n2] = t3 = { configurable: true, enumerable: r2, get: function() {
var r3 = this[Q];
return f3(r3), en.get(r3, n2);
}, set: function(r3) {
var t4 = this[Q];
f3(t4), en.set(t4, n2, r3);
} }, t3;
}
function e(n2) {
for (var r2 = n2.length - 1; r2 >= 0; r2--) {
var t3 = n2[r2][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 r2 = n2.t, t3 = n2.k, e2 = nn(t3), i2 = e2.length - 1; i2 >= 0; i2--) {
var o3 = e2[i2];
if (o3 !== Q) {
var a3 = r2[o3];
if (void 0 === a3 && !u(r2, o3))
return true;
var f4 = t3[o3], s3 = f4 && f4[Q];
if (s3 ? s3.t !== a3 : !c(f4, a3))
return true;
}
}
var v2 = !!r2[Q];
return e2.length !== nn(r2).length + (v2 ? 0 : 1);
}
function a2(n2) {
var r2 = n2.k;
if (r2.length !== n2.t.length)
return true;
var t3 = Object.getOwnPropertyDescriptor(r2, r2.length - 1);
if (t3 && !t3.get)
return true;
for (var e2 = 0; e2 < r2.length; e2++)
if (!r2.hasOwnProperty(e2))
return true;
return false;
}
function f3(r2) {
r2.O && n(3, JSON.stringify(p(r2)));
}
var s2 = {};
m("ES5", { J: function(n2, r2) {
var e2 = Array.isArray(n2), i2 = function(n3, r3) {
if (n3) {
for (var e3 = Array(r3.length), i3 = 0; i3 < r3.length; i3++)
Object.defineProperty(e3, "" + i3, t2(i3, true));
return e3;
}
var o4 = rn(r3);
delete o4[Q];
for (var u2 = nn(o4), a3 = 0; a3 < u2.length; a3++) {
var f4 = u2[a3];
o4[f4] = t2(f4, n3 || !!o4[f4].enumerable);
}
return Object.create(Object.getPrototypeOf(r3), o4);
}(e2, n2), o3 = { i: e2 ? 5 : 4, A: r2 ? r2.A : _(), P: false, I: false, D: {}, l: r2, 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 ? r(t3) && t3[Q].A === n2 && e(n2.p) : (n2.u && function n3(r2) {
if (r2 && "object" == typeof r2) {
var t4 = r2[Q];
if (t4) {
var e2 = t4.t, o4 = t4.k, f4 = t4.D, c2 = t4.i;
if (4 === c2)
i(o4, function(r3) {
r3 !== Q && (void 0 !== e2[r3] || u(e2, r3) ? f4[r3] || n3(o4[r3]) : (f4[r3] = true, k(t4)));
}), i(e2, function(n4) {
void 0 !== o4[n4] || u(o4, n4) || (f4[n4] = false, k(t4));
});
else if (5 === c2) {
if (a2(t4) && (k(t4), f4.length = true), o4.length < e2.length)
for (var s3 = o4.length; s3 < e2.length; s3++)
f4[s3] = false;
else
for (var v2 = e2.length; v2 < o4.length; v2++)
f4[v2] = true;
for (var p2 = Math.min(o4.length, e2.length), l2 = 0; l2 < p2; l2++)
o4.hasOwnProperty(l2) || (f4[l2] = true), void 0 === f4[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 r2 = {};
return nn(n2).forEach(function(t2) {
r2[t2] = Object.getOwnPropertyDescriptor(n2, t2);
}), r2;
};
var tn = {};
var en = { get: function(n2, r2) {
if (r2 === Q)
return n2;
var e = p(n2);
if (!u(e, r2))
return function(n3, r3, t2) {
var e2, i3 = I(r3, 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, r2);
var i2 = e[r2];
return n2.I || !t(i2) ? i2 : i2 === z(n2.t, r2) ? (E(n2), n2.o[r2] = R(n2.A.h, i2, n2)) : i2;
}, has: function(n2, r2) {
return r2 in p(n2);
}, ownKeys: function(n2) {
return Reflect.ownKeys(p(n2));
}, set: function(n2, r2, t2) {
var e = I(p(n2), r2);
if (null == e ? void 0 : e.set)
return e.set.call(n2.k, t2), true;
if (!n2.P) {
var i2 = z(p(n2), r2), o2 = null == i2 ? void 0 : i2[Q];
if (o2 && o2.t === t2)
return n2.o[r2] = t2, n2.D[r2] = false, true;
if (c(t2, i2) && (void 0 !== t2 || u(n2.t, r2)))
return true;
E(n2), k(n2);
}
return n2.o[r2] === t2 && "number" != typeof t2 && (void 0 !== t2 || r2 in n2.o) || (n2.o[r2] = t2, n2.D[r2] = true, true);
}, deleteProperty: function(n2, r2) {
return void 0 !== z(n2.t, r2) || r2 in n2.t ? (n2.D[r2] = false, E(n2), k(n2)) : delete n2.D[r2], n2.o && delete n2.o[r2], true;
}, getOwnPropertyDescriptor: function(n2, r2) {
var t2 = p(n2), e = Reflect.getOwnPropertyDescriptor(t2, r2);
return e ? { writable: true, configurable: 1 !== n2.i || "length" !== r2, enumerable: e.enumerable, value: t2[r2] } : e;
}, defineProperty: function() {
n(11);
}, getPrototypeOf: function(n2) {
return Object.getPrototypeOf(n2.t);
}, setPrototypeOf: function() {
n(12);
} };
var on = {};
i(en, function(n2, r2) {
on[n2] = function() {
return arguments[0] = arguments[0][0], r2.apply(this, arguments);
};
}), on.deleteProperty = function(r2, t2) {
return isNaN(parseInt(t2)) && n(13), on.set.call(this, r2, t2, void 0);
}, on.set = function(r2, t2, e) {
return "length" !== t2 && isNaN(parseInt(t2)) && n(14), en.set.call(this, r2[0], t2, e, r2[0]);
};
var un = function() {
function e(r2) {
var e2 = this;
this.g = B, this.F = true, this.produce = function(r3, i3, o2) {
if ("function" == typeof r3 && "function" != typeof i3) {
var u2 = i3;
i3 = r3;
var a2 = e2;
return function(n2) {
var r4 = 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, [r4, n3].concat(e3));
});
};
}
var f3;
if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
var c2 = w(e2), s2 = R(e2, r3, void 0), v2 = true;
try {
f3 = i3(s2), v2 = false;
} finally {
v2 ? O(c2) : g(c2);
}
return "undefined" != typeof Promise && f3 instanceof Promise ? f3.then(function(n2) {
return j(c2, o2), P(n2, c2);
}, function(n2) {
throw O(c2), n2;
}) : (j(c2, o2), P(f3, c2));
}
if (!r3 || "object" != typeof r3) {
if (void 0 === (f3 = i3(r3)) && (f3 = r3), f3 === H && (f3 = void 0), e2.F && d(f3, true), o2) {
var p2 = [], l2 = [];
b("Patches").M(r3, f3, p2, l2), o2(p2, l2);
}
return f3;
}
n(21, r3);
}, this.produceWithPatches = function(n2, r3) {
if ("function" == typeof n2)
return function(r4) {
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(r4, function(r5) {
return n2.apply(void 0, [r5].concat(i4));
});
};
var t2, i3, o2 = e2.produce(n2, r3, function(n3, r4) {
t2 = n3, i3 = r4;
});
return "undefined" != typeof Promise && o2 instanceof Promise ? o2.then(function(n3) {
return [n3, t2, i3];
}) : [o2, t2, i3];
}, "boolean" == typeof (null == r2 ? void 0 : r2.useProxies) && this.setUseProxies(r2.useProxies), "boolean" == typeof (null == r2 ? void 0 : r2.autoFreeze) && this.setAutoFreeze(r2.autoFreeze);
}
var i2 = e.prototype;
return i2.createDraft = function(e2) {
t(e2) || n(8), r(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(r2, t2) {
var e2 = r2 && r2[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(r2) {
r2 && !B && n(20), this.g = r2;
}, 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 r(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 isPlainObject(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 (isDate(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 isDate(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 subscribe2(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 (!isPlainObject(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 = subscribe2;
return _ref = {
subscribe: function subscribe3(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: subscribe2,
getState,
replaceReducer
}, _ref2[$$observable] = observable, _ref2;
}
function warning(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 (!isPlainObject(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 initialState2 = reducer(void 0, {
type: ActionTypes.INIT
});
if (typeof initialState2 === "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") {
warning('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) {
warning(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 compose() {
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 = compose.apply(void 0, chain)(store2.dispatch);
return _objectSpread2(_objectSpread2({}, store2), {}, {
dispatch: _dispatch
});
};
};
}
function isCrushed() {
}
if (typeof isCrushed.name === "string" && isCrushed.name !== "isCrushed") {
warning('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 compose;
return compose.apply(null, arguments);
};
var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
return function(noop2) {
return noop2;
};
};
function isPlainObject2(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) || isPlainObject2(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 (isPlainObject2(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 = compose;
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(initialState2, 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(initialState2)) {
getInitialState = function() {
return freezeDraftable(initialState2());
};
} else {
var frozenInitialState_1 = freezeDraftable(initialState2);
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 (r(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 initialState2 = 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(initialState2, 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/redux/global/global-slice.ts
var initialState = {
isDarkMode: false,
shouldDebug: false,
exportRenderMarkdown: true
};
var globalSlice = createSlice({
name: "global",
initialState,
reducers: {
setDarkMode(state, action) {
state.isDarkMode = action.payload;
},
setDebugMode(state, action) {
state.shouldDebug = action.payload;
},
setExportRenderMarkdown(state, action) {
state.exportRenderMarkdown = action.payload;
}
}
});
var { setDarkMode, setDebugMode, setExportRenderMarkdown } = globalSlice.actions;
var global_slice_default = globalSlice.reducer;
// src/redux/global/store.ts
var store = configureStore({
reducer: {
global: global_slice_default
}
});
// src/obsidian/nlt-view.tsx
var import_obsidian10 = require("obsidian");
var import_client2 = __toESM(require_client());
// src/obsidian-shim/build/mount-context.tsx
var import_react = __toESM(require_react());
// node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs
var import_emotion_react_jsx_runtime_cjs = __toESM(require_emotion_react_jsx_runtime_cjs(), 1);
// src/obsidian-shim/build/mount-context.tsx
var MountContext = import_react.default.createContext(null);
var useMountState = () => {
const value = import_react.default.useContext(MountContext);
if (value === null) {
throw new Error(
"useMountState() called without a <MountProvider /> in the tree."
);
}
return value;
};
function MountProvider({
appId,
leaf,
filePath,
isMarkdownView,
children
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MountContext.Provider, {
value: { appId, leaf, filePath, isMarkdownView },
children
});
}
// src/react/table-app/table/index.tsx
var import_react15 = __toESM(require_react());
// node_modules/react-virtuoso/dist/index.mjs
var import_react2 = __toESM(require_react(), 1);
var import_react_dom = __toESM(require_react_dom(), 1);
var PUBLISH = 0;
var SUBSCRIBE = 1;
var RESET = 2;
var VALUE = 4;
function compose2(a2, b2) {
return (arg) => a2(b2(arg));
}
function thrush(arg, proc) {
return proc(arg);
}
function curry2to1(proc, arg1) {
return (arg2) => proc(arg1, arg2);
}
function curry1to0(proc, arg) {
return () => proc(arg);
}
function tap(arg, proc) {
proc(arg);
return arg;
}
function tup(...args) {
return args;
}
function call(proc) {
proc();
}
function always(value) {
return () => value;
}
function joinProc(...procs) {
return () => {
procs.map(call);
};
}
function isDefined(arg) {
return arg !== void 0;
}
function noop() {
}
function subscribe(emitter, subscription) {
return emitter(SUBSCRIBE, subscription);
}
function publish(publisher, value) {
publisher(PUBLISH, value);
}
function reset(emitter) {
emitter(RESET);
}
function getValue(depot) {
return depot(VALUE);
}
function connect(emitter, publisher) {
return subscribe(emitter, curry2to1(publisher, PUBLISH));
}
function handleNext(emitter, subscription) {
const unsub = emitter(SUBSCRIBE, (value) => {
unsub();
subscription(value);
});
return unsub;
}
function stream() {
const subscriptions = [];
return (action, arg) => {
switch (action) {
case RESET:
subscriptions.splice(0, subscriptions.length);
return;
case SUBSCRIBE:
subscriptions.push(arg);
return () => {
const indexOf = subscriptions.indexOf(arg);
if (indexOf > -1) {
subscriptions.splice(indexOf, 1);
}
};
case PUBLISH:
subscriptions.slice().forEach((subscription) => {
subscription(arg);
});
return;
default:
throw new Error(`unrecognized action ${action}`);
}
};
}
function statefulStream(initial) {
let value = initial;
const innerSubject = stream();
return (action, arg) => {
switch (action) {
case SUBSCRIBE:
const subscription = arg;
subscription(value);
break;
case PUBLISH:
value = arg;
break;
case VALUE:
return value;
}
return innerSubject(action, arg);
};
}
function eventHandler(emitter) {
let unsub;
let currentSubscription;
const cleanup = () => unsub && unsub();
return function(action, subscription) {
switch (action) {
case SUBSCRIBE:
if (subscription) {
if (currentSubscription === subscription) {
return;
}
cleanup();
currentSubscription = subscription;
unsub = subscribe(emitter, subscription);
return unsub;
} else {
cleanup();
return noop;
}
case RESET:
cleanup();
currentSubscription = null;
return;
default:
throw new Error(`unrecognized action ${action}`);
}
};
}
function streamFromEmitter(emitter) {
return tap(stream(), (stream2) => connect(emitter, stream2));
}
function statefulStreamFromEmitter(emitter, initial) {
return tap(statefulStream(initial), (stream2) => connect(emitter, stream2));
}
function combineOperators(...operators) {
return (subscriber) => {
return operators.reduceRight(thrush, subscriber);
};
}
function pipe(source, ...operators) {
const project = combineOperators(...operators);
return (action, subscription) => {
switch (action) {
case SUBSCRIBE:
return subscribe(source, project(subscription));
case RESET:
reset(source);
return;
}
};
}
function defaultComparator(previous, next) {
return previous === next;
}
function distinctUntilChanged(comparator = defaultComparator) {
let current;
return (done) => (next) => {
if (!comparator(current, next)) {
current = next;
done(next);
}
};
}
function filter(predicate) {
return (done) => (value) => {
predicate(value) && done(value);
};
}
function map(project) {
return (done) => compose2(done, project);
}
function mapTo(value) {
return (done) => () => done(value);
}
function scan(scanner, initial) {
return (done) => (value) => done(initial = scanner(initial, value));
}
function skip(times) {
return (done) => (value) => {
times > 0 ? times-- : done(value);
};
}
function throttleTime(interval) {
let currentValue;
let timeout;
return (done) => (value) => {
currentValue = value;
if (timeout) {
return;
}
timeout = setTimeout(() => {
timeout = void 0;
done(currentValue);
}, interval);
};
}
function debounceTime(interval) {
let currentValue;
let timeout;
return (done) => (value) => {
currentValue = value;
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(() => {
done(currentValue);
}, interval);
};
}
function withLatestFrom(...sources) {
const values = new Array(sources.length);
let called = 0;
let pendingCall = null;
const allCalled = Math.pow(2, sources.length) - 1;
sources.forEach((source, index) => {
const bit = Math.pow(2, index);
subscribe(source, (value) => {
const prevCalled = called;
called = called | bit;
values[index] = value;
if (prevCalled !== allCalled && called === allCalled && pendingCall) {
pendingCall();
pendingCall = null;
}
});
});
return (done) => (value) => {
const call2 = () => done([value].concat(values));
if (called === allCalled) {
call2();
} else {
pendingCall = call2;
}
};
}
function merge(...sources) {
return function(action, subscription) {
switch (action) {
case SUBSCRIBE:
return joinProc(...sources.map((source) => subscribe(source, subscription)));
case RESET:
return;
default:
throw new Error(`unrecognized action ${action}`);
}
};
}
function duc(source, comparator = defaultComparator) {
return pipe(source, distinctUntilChanged(comparator));
}
function combineLatest(...emitters) {
const innerSubject = stream();
const values = new Array(emitters.length);
let called = 0;
const allCalled = Math.pow(2, emitters.length) - 1;
emitters.forEach((source, index) => {
const bit = Math.pow(2, index);
subscribe(source, (value) => {
values[index] = value;
called = called | bit;
if (called === allCalled) {
publish(innerSubject, values);
}
});
});
return function(action, subscription) {
switch (action) {
case SUBSCRIBE:
if (called === allCalled) {
subscription(values);
}
return subscribe(innerSubject, subscription);
case RESET:
return reset(innerSubject);
default:
throw new Error(`unrecognized action ${action}`);
}
};
}
function system(constructor, dependencies = [], { singleton } = { singleton: true }) {
return {
id: id(),
constructor,
dependencies,
singleton
};
}
var id = () => Symbol();
function init(systemSpec) {
const singletons = /* @__PURE__ */ new Map();
const _init = ({ id: id2, constructor, dependencies, singleton }) => {
if (singleton && singletons.has(id2)) {
return singletons.get(id2);
}
const system2 = constructor(dependencies.map((e) => _init(e)));
if (singleton) {
singletons.set(id2, system2);
}
return system2;
};
return _init(systemSpec);
}
function omit(keys, obj) {
const result = {};
const index = {};
let idx = 0;
const len = keys.length;
while (idx < len) {
index[keys[idx]] = 1;
idx += 1;
}
for (const prop in obj) {
if (!index.hasOwnProperty(prop)) {
result[prop] = obj[prop];
}
}
return result;
}
var useIsomorphicLayoutEffect$2 = typeof document !== "undefined" ? import_react2.default.useLayoutEffect : import_react2.default.useEffect;
function systemToComponent(systemSpec, map2, Root4) {
const requiredPropNames = Object.keys(map2.required || {});
const optionalPropNames = Object.keys(map2.optional || {});
const methodNames = Object.keys(map2.methods || {});
const eventNames = Object.keys(map2.events || {});
const Context = import_react2.default.createContext({});
function applyPropsToSystem(system2, props) {
if (system2["propsReady"]) {
publish(system2["propsReady"], false);
}
for (const requiredPropName of requiredPropNames) {
const stream2 = system2[map2.required[requiredPropName]];
publish(stream2, props[requiredPropName]);
}
for (const optionalPropName of optionalPropNames) {
if (optionalPropName in props) {
const stream2 = system2[map2.optional[optionalPropName]];
publish(stream2, props[optionalPropName]);
}
}
if (system2["propsReady"]) {
publish(system2["propsReady"], true);
}
}
function buildMethods(system2) {
return methodNames.reduce((acc, methodName) => {
acc[methodName] = (value) => {
const stream2 = system2[map2.methods[methodName]];
publish(stream2, value);
};
return acc;
}, {});
}
function buildEventHandlers(system2) {
return eventNames.reduce((handlers, eventName) => {
handlers[eventName] = eventHandler(system2[map2.events[eventName]]);
return handlers;
}, {});
}
const Component = import_react2.default.forwardRef((propsWithChildren, ref) => {
const _a = propsWithChildren, { children } = _a, props = __objRest(_a, ["children"]);
const [system2] = import_react2.default.useState(() => {
return tap(init(systemSpec), (system22) => applyPropsToSystem(system22, props));
});
const [handlers] = import_react2.default.useState(curry1to0(buildEventHandlers, system2));
useIsomorphicLayoutEffect$2(() => {
for (const eventName of eventNames) {
if (eventName in props) {
subscribe(handlers[eventName], props[eventName]);
}
}
return () => {
Object.values(handlers).map(reset);
};
}, [props, handlers, system2]);
useIsomorphicLayoutEffect$2(() => {
applyPropsToSystem(system2, props);
});
import_react2.default.useImperativeHandle(ref, always(buildMethods(system2)));
return import_react2.default.createElement(
Context.Provider,
{ value: system2 },
Root4 ? import_react2.default.createElement(
Root4,
omit([...requiredPropNames, ...optionalPropNames, ...eventNames], props),
children
) : children
);
});
const usePublisher2 = (key) => {
return import_react2.default.useCallback(curry2to1(publish, import_react2.default.useContext(Context)[key]), [key]);
};
const useEmitterValue2 = (key) => {
const system2 = import_react2.default.useContext(Context);
const source = system2[key];
const [value, setValue] = import_react2.default.useState(curry1to0(getValue, source));
useIsomorphicLayoutEffect$2(
() => subscribe(source, (next) => {
if (next !== value) {
setValue(always(next));
}
}),
[source, value]
);
return value;
};
const useEmitter2 = (key, callback) => {
const context = import_react2.default.useContext(Context);
const source = context[key];
useIsomorphicLayoutEffect$2(() => subscribe(source, callback), [callback, source]);
};
return {
Component,
usePublisher: usePublisher2,
useEmitterValue: useEmitterValue2,
useEmitter: useEmitter2
};
}
var useIsomorphicLayoutEffect = typeof document !== "undefined" ? import_react2.default.useLayoutEffect : import_react2.default.useEffect;
var useIsomorphicLayoutEffect$1 = useIsomorphicLayoutEffect;
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
return LogLevel2;
})(LogLevel || {});
var CONSOLE_METHOD_MAP = {
[0]: "debug",
[1]: "log",
[2]: "warn",
[3]: "error"
};
var getGlobalThis = () => typeof globalThis === "undefined" ? window : globalThis;
var loggerSystem = system(
() => {
const logLevel = statefulStream(3);
const log2 = statefulStream((label, message, level = 1) => {
var _a;
const currentLevel = (_a = getGlobalThis()["VIRTUOSO_LOG_LEVEL"]) != null ? _a : getValue(logLevel);
if (level >= currentLevel) {
console[CONSOLE_METHOD_MAP[level]](
"%creact-virtuoso: %c%s %o",
"color: #0253b3; font-weight: bold",
"color: initial",
label,
message
);
}
});
return {
log: log2,
logLevel
};
},
[],
{ singleton: true }
);
function useSizeWithElRef(callback, enabled = true) {
const ref = import_react2.default.useRef(null);
let callbackRef = (_el) => {
};
if (typeof ResizeObserver !== "undefined") {
const observer = import_react2.default.useMemo(() => {
return new ResizeObserver((entries) => {
const element = entries[0].target;
if (element.offsetParent !== null) {
callback(element);
}
});
}, [callback]);
callbackRef = (elRef) => {
if (elRef && enabled) {
observer.observe(elRef);
ref.current = elRef;
} else {
if (ref.current) {
observer.unobserve(ref.current);
}
ref.current = null;
}
};
}
return { ref, callbackRef };
}
function useSize(callback, enabled = true) {
return useSizeWithElRef(callback, enabled).callbackRef;
}
function useChangedListContentsSizes(callback, itemSize, enabled, scrollContainerStateCallback, log2, gap, customScrollParent) {
const memoedCallback = import_react2.default.useCallback(
(el) => {
const ranges = getChangedChildSizes(el.children, itemSize, "offsetHeight", log2);
let scrollableElement = el.parentElement;
while (!scrollableElement.dataset["virtuosoScroller"]) {
scrollableElement = scrollableElement.parentElement;
}
const windowScrolling = scrollableElement.lastElementChild.dataset["viewportType"] === "window";
const scrollTop = customScrollParent ? customScrollParent.scrollTop : windowScrolling ? window.pageYOffset || document.documentElement.scrollTop : scrollableElement.scrollTop;
const scrollHeight = customScrollParent ? customScrollParent.scrollHeight : windowScrolling ? document.documentElement.scrollHeight : scrollableElement.scrollHeight;
const viewportHeight = customScrollParent ? customScrollParent.offsetHeight : windowScrolling ? window.innerHeight : scrollableElement.offsetHeight;
scrollContainerStateCallback({
scrollTop: Math.max(scrollTop, 0),
scrollHeight,
viewportHeight
});
gap == null ? void 0 : gap(resolveGapValue$1("row-gap", getComputedStyle(el).rowGap, log2));
if (ranges !== null) {
callback(ranges);
}
},
[callback, itemSize, log2, gap, customScrollParent, scrollContainerStateCallback]
);
return useSizeWithElRef(memoedCallback, enabled);
}
function getChangedChildSizes(children, itemSize, field, log2) {
const length = children.length;
if (length === 0) {
return null;
}
const results = [];
for (let i2 = 0; i2 < length; i2++) {
const child = children.item(i2);
if (!child || child.dataset.index === void 0) {
continue;
}
const index = parseInt(child.dataset.index);
const knownSize = parseFloat(child.dataset.knownSize);
const size = itemSize(child, field);
if (size === 0) {
log2("Zero-sized element, this should not happen", { child }, LogLevel.ERROR);
}
if (size === knownSize) {
continue;
}
const lastResult = results[results.length - 1];
if (results.length === 0 || lastResult.size !== size || lastResult.endIndex !== index - 1) {
results.push({ startIndex: index, endIndex: index, size });
} else {
results[results.length - 1].endIndex++;
}
}
return results;
}
function resolveGapValue$1(property, value, log2) {
if (value !== "normal" && !(value == null ? void 0 : value.endsWith("px"))) {
log2(`${property} was not resolved to pixel value correctly`, value, LogLevel.WARN);
}
if (value === "normal") {
return 0;
}
return parseInt(value != null ? value : "0", 10);
}
function correctItemSize(el, dimension) {
return Math.round(el.getBoundingClientRect()[dimension]);
}
function approximatelyEqual(num1, num2) {
return Math.abs(num1 - num2) < 1.01;
}
function useScrollTop(scrollContainerStateCallback, smoothScrollTargetReached, scrollerElement, scrollerRefCallback = noop, customScrollParent) {
const scrollerRef = import_react2.default.useRef(null);
const scrollTopTarget = import_react2.default.useRef(null);
const timeoutRef = import_react2.default.useRef(null);
const handler = import_react2.default.useCallback(
(ev) => {
const el = ev.target;
const windowScroll = el === window || el === document;
const scrollTop = windowScroll ? window.pageYOffset || document.documentElement.scrollTop : el.scrollTop;
const scrollHeight = windowScroll ? document.documentElement.scrollHeight : el.scrollHeight;
const viewportHeight = windowScroll ? window.innerHeight : el.offsetHeight;
const call2 = () => {
scrollContainerStateCallback({
scrollTop: Math.max(scrollTop, 0),
scrollHeight,
viewportHeight
});
};
if (ev.suppressFlushSync) {
call2();
} else {
import_react_dom.default.flushSync(call2);
}
if (scrollTopTarget.current !== null) {
if (scrollTop === scrollTopTarget.current || scrollTop <= 0 || scrollTop === scrollHeight - viewportHeight) {
scrollTopTarget.current = null;
smoothScrollTargetReached(true);
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
timeoutRef.current = null;
}
}
}
},
[scrollContainerStateCallback, smoothScrollTargetReached]
);
import_react2.default.useEffect(() => {
const localRef = customScrollParent ? customScrollParent : scrollerRef.current;
scrollerRefCallback(customScrollParent ? customScrollParent : scrollerRef.current);
handler({ target: localRef, suppressFlushSync: true });
localRef.addEventListener("scroll", handler, { passive: true });
return () => {
scrollerRefCallback(null);
localRef.removeEventListener("scroll", handler);
};
}, [scrollerRef, handler, scrollerElement, scrollerRefCallback, customScrollParent]);
function scrollToCallback(location) {
const scrollerElement2 = scrollerRef.current;
if (!scrollerElement2 || "offsetHeight" in scrollerElement2 && scrollerElement2.offsetHeight === 0) {
return;
}
const isSmooth = location.behavior === "smooth";
let offsetHeight;
let scrollHeight;
let scrollTop;
if (scrollerElement2 === window) {
scrollHeight = Math.max(correctItemSize(document.documentElement, "height"), document.documentElement.scrollHeight);
offsetHeight = window.innerHeight;
scrollTop = document.documentElement.scrollTop;
} else {
scrollHeight = scrollerElement2.scrollHeight;
offsetHeight = correctItemSize(scrollerElement2, "height");
scrollTop = scrollerElement2.scrollTop;
}
const maxScrollTop = scrollHeight - offsetHeight;
location.top = Math.ceil(Math.max(Math.min(maxScrollTop, location.top), 0));
if (approximatelyEqual(offsetHeight, scrollHeight) || location.top === scrollTop) {
scrollContainerStateCallback({ scrollTop, scrollHeight, viewportHeight: offsetHeight });
if (isSmooth) {
smoothScrollTargetReached(true);
}
return;
}
if (isSmooth) {
scrollTopTarget.current = location.top;
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
timeoutRef.current = setTimeout(() => {
timeoutRef.current = null;
scrollTopTarget.current = null;
smoothScrollTargetReached(true);
}, 1e3);
} else {
scrollTopTarget.current = null;
}
scrollerElement2.scrollTo(location);
}
function scrollByCallback(location) {
scrollerRef.current.scrollBy(location);
}
return { scrollerRef, scrollByCallback, scrollToCallback };
}
var domIOSystem = system(
() => {
const scrollContainerState = stream();
const scrollTop = stream();
const deviation = statefulStream(0);
const smoothScrollTargetReached = stream();
const statefulScrollTop = statefulStream(0);
const viewportHeight = stream();
const scrollHeight = stream();
const headerHeight = statefulStream(0);
const fixedHeaderHeight = statefulStream(0);
const fixedFooterHeight = statefulStream(0);
const footerHeight = statefulStream(0);
const scrollTo = stream();
const scrollBy = stream();
const scrollingInProgress = statefulStream(false);
connect(
pipe(
scrollContainerState,
map(({ scrollTop: scrollTop2 }) => scrollTop2)
),
scrollTop
);
connect(
pipe(
scrollContainerState,
map(({ scrollHeight: scrollHeight2 }) => scrollHeight2)
),
scrollHeight
);
connect(scrollTop, statefulScrollTop);
return {
scrollContainerState,
scrollTop,
viewportHeight,
headerHeight,
fixedHeaderHeight,
fixedFooterHeight,
footerHeight,
scrollHeight,
smoothScrollTargetReached,
scrollTo,
scrollBy,
statefulScrollTop,
deviation,
scrollingInProgress
};
},
[],
{ singleton: true }
);
var NIL_NODE = { lvl: 0 };
function newAANode(k2, v2, lvl, l2 = NIL_NODE, r2 = NIL_NODE) {
return { k: k2, v: v2, lvl, l: l2, r: r2 };
}
function empty(node) {
return node === NIL_NODE;
}
function newTree() {
return NIL_NODE;
}
function remove(node, key) {
if (empty(node))
return NIL_NODE;
const { k: k2, l: l2, r: r2 } = node;
if (key === k2) {
if (empty(l2)) {
return r2;
} else if (empty(r2)) {
return l2;
} else {
const [lastKey, lastValue] = last(l2);
return adjust(clone(node, { k: lastKey, v: lastValue, l: deleteLast(l2) }));
}
} else if (key < k2) {
return adjust(clone(node, { l: remove(l2, key) }));
} else {
return adjust(clone(node, { r: remove(r2, key) }));
}
}
function find(node, key) {
if (empty(node)) {
return;
}
if (key === node.k) {
return node.v;
} else if (key < node.k) {
return find(node.l, key);
} else {
return find(node.r, key);
}
}
function findMaxKeyValue(node, value, field = "k") {
if (empty(node)) {
return [-Infinity, void 0];
}
if (node[field] === value) {
return [node.k, node.v];
}
if (node[field] < value) {
const r2 = findMaxKeyValue(node.r, value, field);
if (r2[0] === -Infinity) {
return [node.k, node.v];
} else {
return r2;
}
}
return findMaxKeyValue(node.l, value, field);
}
function insert(node, k2, v2) {
if (empty(node)) {
return newAANode(k2, v2, 1);
}
if (k2 === node.k) {
return clone(node, { k: k2, v: v2 });
} else if (k2 < node.k) {
return rebalance(clone(node, { l: insert(node.l, k2, v2) }));
} else {
return rebalance(clone(node, { r: insert(node.r, k2, v2) }));
}
}
function walkWithin(node, start, end) {
if (empty(node)) {
return [];
}
const { k: k2, v: v2, l: l2, r: r2 } = node;
let result = [];
if (k2 > start) {
result = result.concat(walkWithin(l2, start, end));
}
if (k2 >= start && k2 <= end) {
result.push({ k: k2, v: v2 });
}
if (k2 <= end) {
result = result.concat(walkWithin(r2, start, end));
}
return result;
}
function walk(node) {
if (empty(node)) {
return [];
}
return [...walk(node.l), { k: node.k, v: node.v }, ...walk(node.r)];
}
function last(node) {
return empty(node.r) ? [node.k, node.v] : last(node.r);
}
function deleteLast(node) {
return empty(node.r) ? node.l : adjust(clone(node, { r: deleteLast(node.r) }));
}
function clone(node, args) {
return newAANode(
args.k !== void 0 ? args.k : node.k,
args.v !== void 0 ? args.v : node.v,
args.lvl !== void 0 ? args.lvl : node.lvl,
args.l !== void 0 ? args.l : node.l,
args.r !== void 0 ? args.r : node.r
);
}
function isSingle(node) {
return empty(node) || node.lvl > node.r.lvl;
}
function rebalance(node) {
return split(skew(node));
}
function adjust(node) {
const { l: l2, r: r2, lvl } = node;
if (r2.lvl >= lvl - 1 && l2.lvl >= lvl - 1) {
return node;
} else if (lvl > r2.lvl + 1) {
if (isSingle(l2)) {
return skew(clone(node, { lvl: lvl - 1 }));
} else {
if (!empty(l2) && !empty(l2.r)) {
return clone(l2.r, {
l: clone(l2, { r: l2.r.l }),
r: clone(node, {
l: l2.r.r,
lvl: lvl - 1
}),
lvl
});
} else {
throw new Error("Unexpected empty nodes");
}
}
} else {
if (isSingle(node)) {
return split(clone(node, { lvl: lvl - 1 }));
} else {
if (!empty(r2) && !empty(r2.l)) {
const rl = r2.l;
const rlvl = isSingle(rl) ? r2.lvl - 1 : r2.lvl;
return clone(rl, {
l: clone(node, {
r: rl.l,
lvl: lvl - 1
}),
r: split(clone(r2, { l: rl.r, lvl: rlvl })),
lvl: rl.lvl + 1
});
} else {
throw new Error("Unexpected empty nodes");
}
}
}
}
function rangesWithin(node, startIndex, endIndex) {
if (empty(node)) {
return [];
}
const adjustedStart = findMaxKeyValue(node, startIndex)[0];
return toRanges(walkWithin(node, adjustedStart, endIndex));
}
function arrayToRanges(items, parser) {
const length = items.length;
if (length === 0) {
return [];
}
let { index: start, value } = parser(items[0]);
const result = [];
for (let i2 = 1; i2 < length; i2++) {
const { index: nextIndex, value: nextValue } = parser(items[i2]);
result.push({ start, end: nextIndex - 1, value });
start = nextIndex;
value = nextValue;
}
result.push({ start, end: Infinity, value });
return result;
}
function toRanges(nodes) {
return arrayToRanges(nodes, ({ k: index, v: value }) => ({ index, value }));
}
function split(node) {
const { r: r2, lvl } = node;
return !empty(r2) && !empty(r2.r) && r2.lvl === lvl && r2.r.lvl === lvl ? clone(r2, { l: clone(node, { r: r2.l }), lvl: lvl + 1 }) : node;
}
function skew(node) {
const { l: l2 } = node;
return !empty(l2) && l2.lvl === node.lvl ? clone(l2, { r: clone(node, { l: l2.r }) }) : node;
}
function findIndexOfClosestSmallerOrEqual(items, value, comparator, start = 0) {
let end = items.length - 1;
while (start <= end) {
const index = Math.floor((start + end) / 2);
const item = items[index];
const match = comparator(item, value);
if (match === 0) {
return index;
}
if (match === -1) {
if (end - start < 2) {
return index - 1;
}
end = index - 1;
} else {
if (end === start) {
return index;
}
start = index + 1;
}
}
throw new Error(`Failed binary finding record in array - ${items.join(",")}, searched for ${value}`);
}
function findClosestSmallerOrEqual(items, value, comparator) {
return items[findIndexOfClosestSmallerOrEqual(items, value, comparator)];
}
function findRange(items, startValue, endValue, comparator) {
const startIndex = findIndexOfClosestSmallerOrEqual(items, startValue, comparator);
const endIndex = findIndexOfClosestSmallerOrEqual(items, endValue, comparator, startIndex);
return items.slice(startIndex, endIndex + 1);
}
var recalcSystem = system(
() => {
const recalcInProgress = statefulStream(false);
return { recalcInProgress };
},
[],
{ singleton: true }
);
function rangeIncludes(refRange) {
const { size, startIndex, endIndex } = refRange;
return (range) => {
return range.start === startIndex && (range.end === endIndex || range.end === Infinity) && range.value === size;
};
}
function affectedGroupCount(offset, groupIndices) {
let recognizedOffsetItems = 0;
let groupIndex = 0;
while (recognizedOffsetItems < offset) {
recognizedOffsetItems += groupIndices[groupIndex + 1] - groupIndices[groupIndex] - 1;
groupIndex++;
}
const offsetIsExact = recognizedOffsetItems === offset;
return groupIndex - (offsetIsExact ? 0 : 1);
}
function insertRanges(sizeTree, ranges) {
let syncStart = empty(sizeTree) ? 0 : Infinity;
for (const range of ranges) {
const { size, startIndex, endIndex } = range;
syncStart = Math.min(syncStart, startIndex);
if (empty(sizeTree)) {
sizeTree = insert(sizeTree, 0, size);
continue;
}
const overlappingRanges = rangesWithin(sizeTree, startIndex - 1, endIndex + 1);
if (overlappingRanges.some(rangeIncludes(range))) {
continue;
}
let firstPassDone = false;
let shouldInsert = false;
for (const { start: rangeStart, end: rangeEnd, value: rangeValue } of overlappingRanges) {
if (!firstPassDone) {
shouldInsert = rangeValue !== size;
firstPassDone = true;
} else {
if (endIndex >= rangeStart || size === rangeValue) {
sizeTree = remove(sizeTree, rangeStart);
}
}
if (rangeEnd > endIndex && endIndex >= rangeStart) {
if (rangeValue !== size) {
sizeTree = insert(sizeTree, endIndex + 1, rangeValue);
}
}
}
if (shouldInsert) {
sizeTree = insert(sizeTree, startIndex, size);
}
}
return [sizeTree, syncStart];
}
function initialSizeState() {
return {
offsetTree: [],
sizeTree: newTree(),
groupOffsetTree: newTree(),
lastIndex: 0,
lastOffset: 0,
lastSize: 0,
groupIndices: []
};
}
function indexComparator({ index: itemIndex }, index) {
return index === itemIndex ? 0 : index < itemIndex ? -1 : 1;
}
function offsetComparator({ offset: itemOffset }, offset) {
return offset === itemOffset ? 0 : offset < itemOffset ? -1 : 1;
}
function offsetPointParser(point) {
return { index: point.index, value: point };
}
function rangesWithinOffsets(tree, startOffset, endOffset, minStartIndex = 0) {
if (minStartIndex > 0) {
startOffset = Math.max(startOffset, findClosestSmallerOrEqual(tree, minStartIndex, indexComparator).offset);
}
return arrayToRanges(findRange(tree, startOffset, endOffset, offsetComparator), offsetPointParser);
}
function createOffsetTree(prevOffsetTree, syncStart, sizeTree, gap) {
let offsetTree = prevOffsetTree;
let prevIndex = 0;
let prevSize = 0;
let prevOffset = 0;
let startIndex = 0;
if (syncStart !== 0) {
startIndex = findIndexOfClosestSmallerOrEqual(offsetTree, syncStart - 1, indexComparator);
const offsetInfo = offsetTree[startIndex];
prevOffset = offsetInfo.offset;
const kv = findMaxKeyValue(sizeTree, syncStart - 1);
prevIndex = kv[0];
prevSize = kv[1];
if (offsetTree.length && offsetTree[startIndex].size === findMaxKeyValue(sizeTree, syncStart)[1]) {
startIndex -= 1;
}
offsetTree = offsetTree.slice(0, startIndex + 1);
} else {
offsetTree = [];
}
for (const { start: startIndex2, value } of rangesWithin(sizeTree, syncStart, Infinity)) {
const indexOffset = startIndex2 - prevIndex;
const aOffset = indexOffset * prevSize + prevOffset + indexOffset * gap;
offsetTree.push({
offset: aOffset,
size: value,
index: startIndex2
});
prevIndex = startIndex2;
prevOffset = aOffset;
prevSize = value;
}
return {
offsetTree,
lastIndex: prevIndex,
lastOffset: prevOffset,
lastSize: prevSize
};
}
function sizeStateReducer(state, [ranges, groupIndices, log2, gap]) {
if (ranges.length > 0) {
log2("received item sizes", ranges, LogLevel.DEBUG);
}
const sizeTree = state.sizeTree;
let newSizeTree = sizeTree;
let syncStart = 0;
if (groupIndices.length > 0 && empty(sizeTree) && ranges.length === 2) {
const groupSize = ranges[0].size;
const itemSize = ranges[1].size;
newSizeTree = groupIndices.reduce((tree, groupIndex) => {
return insert(insert(tree, groupIndex, groupSize), groupIndex + 1, itemSize);
}, newSizeTree);
} else {
[newSizeTree, syncStart] = insertRanges(newSizeTree, ranges);
}
if (newSizeTree === sizeTree) {
return state;
}
const { offsetTree: newOffsetTree, lastIndex, lastSize, lastOffset } = createOffsetTree(state.offsetTree, syncStart, newSizeTree, gap);
return {
sizeTree: newSizeTree,
offsetTree: newOffsetTree,
lastIndex,
lastOffset,
lastSize,
groupOffsetTree: groupIndices.reduce((tree, index) => {
return insert(tree, index, offsetOf(index, newOffsetTree, gap));
}, newTree()),
groupIndices
};
}
function offsetOf(index, tree, gap) {
if (tree.length === 0) {
return 0;
}
const { offset, index: startIndex, size } = findClosestSmallerOrEqual(tree, index, indexComparator);
const itemCount = index - startIndex;
const top = size * itemCount + (itemCount - 1) * gap + offset;
return top > 0 ? top + gap : top;
}
function isGroupLocation(location) {
return typeof location.groupIndex !== "undefined";
}
function originalIndexFromLocation(location, sizes, lastIndex) {
if (isGroupLocation(location)) {
return sizes.groupIndices[location.groupIndex] + 1;
} else {
const numericIndex = location.index === "LAST" ? lastIndex : location.index;
let result = originalIndexFromItemIndex(numericIndex, sizes);
result = Math.max(0, result, Math.min(lastIndex, result));
return result;
}
}
function originalIndexFromItemIndex(itemIndex, sizes) {
if (!hasGroups(sizes)) {
return itemIndex;
}
let groupOffset = 0;
while (sizes.groupIndices[groupOffset] <= itemIndex + groupOffset) {
groupOffset++;
}
return itemIndex + groupOffset;
}
function hasGroups(sizes) {
return !empty(sizes.groupOffsetTree);
}
function sizeTreeToRanges(sizeTree) {
return walk(sizeTree).map(({ k: startIndex, v: size }, index, sizeArray) => {
const nextSize = sizeArray[index + 1];
const endIndex = nextSize ? nextSize.k - 1 : Infinity;
return { startIndex, endIndex, size };
});
}
var SIZE_MAP = {
offsetHeight: "height",
offsetWidth: "width"
};
var sizeSystem = system(
([{ log: log2 }, { recalcInProgress }]) => {
const sizeRanges = stream();
const totalCount = stream();
const statefulTotalCount = statefulStreamFromEmitter(totalCount, 0);
const unshiftWith = stream();
const shiftWith = stream();
const firstItemIndex = statefulStream(0);
const groupIndices = statefulStream([]);
const fixedItemSize = statefulStream(void 0);
const defaultItemSize = statefulStream(void 0);
const itemSize = statefulStream((el, field) => correctItemSize(el, SIZE_MAP[field]));
const data = statefulStream(void 0);
const gap = statefulStream(0);
const initial = initialSizeState();
const sizes = statefulStreamFromEmitter(
pipe(sizeRanges, withLatestFrom(groupIndices, log2, gap), scan(sizeStateReducer, initial), distinctUntilChanged()),
initial
);
const prevGroupIndices = statefulStreamFromEmitter(
pipe(
groupIndices,
distinctUntilChanged(),
scan((prev, curr) => ({ prev: prev.current, current: curr }), {
prev: [],
current: []
}),
map(({ prev }) => prev)
),
[]
);
connect(
pipe(
groupIndices,
filter((indexes) => indexes.length > 0),
withLatestFrom(sizes, gap),
map(([groupIndices2, sizes2, gap2]) => {
const groupOffsetTree = groupIndices2.reduce((tree, index, idx) => {
return insert(tree, index, offsetOf(index, sizes2.offsetTree, gap2) || idx);
}, newTree());
return __spreadProps(__spreadValues({}, sizes2), {
groupIndices: groupIndices2,
groupOffsetTree
});
})
),
sizes
);
connect(
pipe(
totalCount,
withLatestFrom(sizes),
filter(([totalCount2, { lastIndex, groupIndices: groupIndices2 }]) => {
return totalCount2 < lastIndex && groupIndices2.length === 0;
}),
map(([totalCount2, { lastIndex, lastSize }]) => {
return [
{
startIndex: totalCount2,
endIndex: lastIndex,
size: lastSize
}
];
})
),
sizeRanges
);
connect(fixedItemSize, defaultItemSize);
const trackItemSizes = statefulStreamFromEmitter(
pipe(
fixedItemSize,
map((size) => size === void 0)
),
true
);
connect(
pipe(
defaultItemSize,
filter((value) => {
return value !== void 0 && empty(getValue(sizes).sizeTree);
}),
map((size) => [{ startIndex: 0, endIndex: 0, size }])
),
sizeRanges
);
const listRefresh = streamFromEmitter(
pipe(
sizeRanges,
withLatestFrom(sizes),
scan(
({ sizes: oldSizes }, [_3, newSizes]) => {
return {
changed: newSizes !== oldSizes,
sizes: newSizes
};
},
{ changed: false, sizes: initial }
),
map((value) => value.changed)
)
);
subscribe(
pipe(
firstItemIndex,
scan(
(prev, next) => {
return { diff: prev.prev - next, prev: next };
},
{ diff: 0, prev: 0 }
),
map((val) => val.diff)
),
(offset) => {
const { groupIndices: groupIndices2 } = getValue(sizes);
if (offset > 0) {
publish(recalcInProgress, true);
publish(unshiftWith, offset + affectedGroupCount(offset, groupIndices2));
} else if (offset < 0) {
const prevGroupIndicesValue = getValue(prevGroupIndices);
if (prevGroupIndicesValue.length > 0) {
publish(shiftWith, offset - affectedGroupCount(-offset, prevGroupIndicesValue));
}
}
}
);
subscribe(pipe(firstItemIndex, withLatestFrom(log2)), ([index, log22]) => {
if (index < 0) {
log22(
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
{ firstItemIndex },
LogLevel.ERROR
);
}
});
const beforeUnshiftWith = streamFromEmitter(unshiftWith);
connect(
pipe(
unshiftWith,
withLatestFrom(sizes),
map(([unshiftWith2, sizes2]) => {
const groupedMode = sizes2.groupIndices.length > 0;
const initialRanges = [];
const defaultSize = sizes2.lastSize;
if (groupedMode) {
const firstGroupSize = find(sizes2.sizeTree, 0);
let prependedGroupItemsCount = 0;
let groupIndex = 0;
while (prependedGroupItemsCount < unshiftWith2) {
const theGroupIndex = sizes2.groupIndices[groupIndex];
const groupItemCount = sizes2.groupIndices.length === groupIndex + 1 ? Infinity : sizes2.groupIndices[groupIndex + 1] - theGroupIndex - 1;
initialRanges.push({
startIndex: theGroupIndex,
endIndex: theGroupIndex,
size: firstGroupSize
});
initialRanges.push({
startIndex: theGroupIndex + 1,
endIndex: theGroupIndex + 1 + groupItemCount - 1,
size: defaultSize
});
groupIndex++;
prependedGroupItemsCount += groupItemCount + 1;
}
const sizeTreeKV = walk(sizes2.sizeTree);
const firstGroupIsExpanded = prependedGroupItemsCount !== unshiftWith2;
if (firstGroupIsExpanded) {
sizeTreeKV.shift();
}
return sizeTreeKV.reduce(
(acc, { k: index, v: size }) => {
let ranges = acc.ranges;
if (acc.prevSize !== 0) {
ranges = [
...acc.ranges,
{
startIndex: acc.prevIndex,
endIndex: index + unshiftWith2 - 1,
size: acc.prevSize
}
];
}
return {
ranges,
prevIndex: index + unshiftWith2,
prevSize: size
};
},
{
ranges: initialRanges,
prevIndex: unshiftWith2,
prevSize: 0
}
).ranges;
}
return walk(sizes2.sizeTree).reduce(
(acc, { k: index, v: size }) => {
return {
ranges: [...acc.ranges, { startIndex: acc.prevIndex, endIndex: index + unshiftWith2 - 1, size: acc.prevSize }],
prevIndex: index + unshiftWith2,
prevSize: size
};
},
{
ranges: [],
prevIndex: 0,
prevSize: defaultSize
}
).ranges;
})
),
sizeRanges
);
const shiftWithOffset = streamFromEmitter(
pipe(
shiftWith,
withLatestFrom(sizes, gap),
map(([shiftWith2, { offsetTree }, gap2]) => {
const newFirstItemIndex = -shiftWith2;
return offsetOf(newFirstItemIndex, offsetTree, gap2);
})
)
);
connect(
pipe(
shiftWith,
withLatestFrom(sizes, gap),
map(([shiftWith2, sizes2, gap2]) => {
const groupedMode = sizes2.groupIndices.length > 0;
if (groupedMode) {
let newSizeTree = newTree();
const prevGroupIndicesValue = getValue(prevGroupIndices);
let removedItemsCount = 0;
let groupIndex = 0;
let groupOffset = 0;
while (removedItemsCount < -shiftWith2) {
groupOffset = prevGroupIndicesValue[groupIndex];
const groupItemCount = prevGroupIndicesValue[groupIndex + 1] - groupOffset - 1;
groupIndex++;
removedItemsCount += groupItemCount + 1;
}
newSizeTree = walk(sizes2.sizeTree).reduce((acc, { k: k2, v: v2 }) => {
return insert(acc, Math.max(0, k2 + shiftWith2), v2);
}, newSizeTree);
const aGroupIsShrunk = removedItemsCount !== -shiftWith2;
if (aGroupIsShrunk) {
const firstGroupSize = find(sizes2.sizeTree, groupOffset);
newSizeTree = insert(newSizeTree, 0, firstGroupSize);
const nextItemSize = findMaxKeyValue(sizes2.sizeTree, -shiftWith2 + 1)[1];
newSizeTree = insert(newSizeTree, 1, nextItemSize);
}
return __spreadValues(__spreadProps(__spreadValues({}, sizes2), {
sizeTree: newSizeTree
}), createOffsetTree(sizes2.offsetTree, 0, newSizeTree, gap2));
} else {
const newSizeTree = walk(sizes2.sizeTree).reduce((acc, { k: k2, v: v2 }) => {
return insert(acc, Math.max(0, k2 + shiftWith2), v2);
}, newTree());
return __spreadValues(__spreadProps(__spreadValues({}, sizes2), {
sizeTree: newSizeTree
}), createOffsetTree(sizes2.offsetTree, 0, newSizeTree, gap2));
}
})
),
sizes
);
return {
data,
totalCount,
sizeRanges,
groupIndices,
defaultItemSize,
fixedItemSize,
unshiftWith,
shiftWith,
shiftWithOffset,
beforeUnshiftWith,
firstItemIndex,
gap,
sizes,
listRefresh,
statefulTotalCount,
trackItemSizes,
itemSize
};
},
tup(loggerSystem, recalcSystem),
{ singleton: true }
);
var SUPPORTS_SCROLL_TO_OPTIONS = typeof document !== "undefined" && "scrollBehavior" in document.documentElement.style;
function normalizeIndexLocation(location) {
const result = typeof location === "number" ? { index: location } : location;
if (!result.align) {
result.align = "start";
}
if (!result.behavior || !SUPPORTS_SCROLL_TO_OPTIONS) {
result.behavior = "auto";
}
if (!result.offset) {
result.offset = 0;
}
return result;
}
var scrollToIndexSystem = system(
([
{ sizes, totalCount, listRefresh, gap },
{
scrollingInProgress,
viewportHeight,
scrollTo,
smoothScrollTargetReached,
headerHeight,
footerHeight,
fixedHeaderHeight,
fixedFooterHeight
},
{ log: log2 }
]) => {
const scrollToIndex = stream();
const topListHeight = statefulStream(0);
let unsubscribeNextListRefresh = null;
let cleartTimeoutRef = null;
let unsubscribeListRefresh = null;
function cleanup() {
if (unsubscribeNextListRefresh) {
unsubscribeNextListRefresh();
unsubscribeNextListRefresh = null;
}
if (unsubscribeListRefresh) {
unsubscribeListRefresh();
unsubscribeListRefresh = null;
}
if (cleartTimeoutRef) {
clearTimeout(cleartTimeoutRef);
cleartTimeoutRef = null;
}
publish(scrollingInProgress, false);
}
connect(
pipe(
scrollToIndex,
withLatestFrom(sizes, viewportHeight, totalCount, topListHeight, headerHeight, footerHeight, log2),
withLatestFrom(gap, fixedHeaderHeight, fixedFooterHeight),
map(
([
[location, sizes2, viewportHeight2, totalCount2, topListHeight2, headerHeight2, footerHeight2, log22],
gap2,
fixedHeaderHeight2,
fixedFooterHeight2
]) => {
const normalLocation = normalizeIndexLocation(location);
const { align, behavior, offset } = normalLocation;
const lastIndex = totalCount2 - 1;
const index = originalIndexFromLocation(normalLocation, sizes2, lastIndex);
let top = offsetOf(index, sizes2.offsetTree, gap2) + headerHeight2;
if (align === "end") {
top += fixedHeaderHeight2 + findMaxKeyValue(sizes2.sizeTree, index)[1] - viewportHeight2 + fixedFooterHeight2;
if (index === lastIndex) {
top += footerHeight2;
}
} else if (align === "center") {
top += (fixedHeaderHeight2 + findMaxKeyValue(sizes2.sizeTree, index)[1] - viewportHeight2 + fixedFooterHeight2) / 2;
} else {
top -= topListHeight2;
}
if (offset) {
top += offset;
}
const retry = (listChanged) => {
cleanup();
if (listChanged) {
log22("retrying to scroll to", { location }, LogLevel.DEBUG);
publish(scrollToIndex, location);
} else {
log22("list did not change, scroll successful", {}, LogLevel.DEBUG);
}
};
cleanup();
if (behavior === "smooth") {
let listChanged = false;
unsubscribeListRefresh = subscribe(listRefresh, (changed) => {
listChanged = listChanged || changed;
});
unsubscribeNextListRefresh = handleNext(smoothScrollTargetReached, () => {
retry(listChanged);
});
} else {
unsubscribeNextListRefresh = handleNext(pipe(listRefresh, watchChangesFor(150)), retry);
}
cleartTimeoutRef = setTimeout(() => {
cleanup();
}, 1200);
publish(scrollingInProgress, true);
log22("scrolling from index to", { index, top, behavior }, LogLevel.DEBUG);
return { top, behavior };
}
)
),
scrollTo
);
return {
scrollToIndex,
topListHeight
};
},
tup(sizeSystem, domIOSystem, loggerSystem),
{ singleton: true }
);
function watchChangesFor(limit) {
return (done) => {
const timeoutRef = setTimeout(() => {
done(false);
}, limit);
return (value) => {
if (value) {
done(true);
clearTimeout(timeoutRef);
}
};
};
}
var UP = "up";
var DOWN = "down";
var NONE$1 = "none";
var INITIAL_BOTTOM_STATE = {
atBottom: false,
notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
state: {
offsetBottom: 0,
scrollTop: 0,
viewportHeight: 0,
scrollHeight: 0
}
};
var DEFAULT_AT_TOP_THRESHOLD = 0;
var stateFlagsSystem = system(([{ scrollContainerState, scrollTop, viewportHeight, headerHeight, footerHeight, scrollBy }]) => {
const isAtBottom = statefulStream(false);
const isAtTop = statefulStream(true);
const atBottomStateChange = stream();
const atTopStateChange = stream();
const atBottomThreshold = statefulStream(4);
const atTopThreshold = statefulStream(DEFAULT_AT_TOP_THRESHOLD);
const isScrolling = statefulStreamFromEmitter(
pipe(
merge(pipe(duc(scrollTop), skip(1), mapTo(true)), pipe(duc(scrollTop), skip(1), mapTo(false), debounceTime(100))),
distinctUntilChanged()
),
false
);
const isScrollingBy = statefulStreamFromEmitter(
pipe(merge(pipe(scrollBy, mapTo(true)), pipe(scrollBy, mapTo(false), debounceTime(200))), distinctUntilChanged()),
false
);
connect(
pipe(
combineLatest(duc(scrollTop), duc(atTopThreshold)),
map(([top, atTopThreshold2]) => top <= atTopThreshold2),
distinctUntilChanged()
),
isAtTop
);
connect(pipe(isAtTop, throttleTime(50)), atTopStateChange);
const atBottomState = streamFromEmitter(
pipe(
combineLatest(scrollContainerState, duc(viewportHeight), duc(headerHeight), duc(footerHeight), duc(atBottomThreshold)),
scan((current, [{ scrollTop: scrollTop2, scrollHeight }, viewportHeight2, _headerHeight, _footerHeight, atBottomThreshold2]) => {
const isAtBottom2 = scrollTop2 + viewportHeight2 - scrollHeight > -atBottomThreshold2;
const state = {
viewportHeight: viewportHeight2,
scrollTop: scrollTop2,
scrollHeight
};
if (isAtBottom2) {
let atBottomBecause;
let scrollTopDelta;
if (scrollTop2 > current.state.scrollTop) {
atBottomBecause = "SCROLLED_DOWN";
scrollTopDelta = current.state.scrollTop - scrollTop2;
} else {
atBottomBecause = "SIZE_DECREASED";
scrollTopDelta = current.state.scrollTop - scrollTop2 || current.scrollTopDelta;
}
return {
atBottom: true,
state,
atBottomBecause,
scrollTopDelta
};
}
let notAtBottomBecause;
if (state.scrollHeight > current.state.scrollHeight) {
notAtBottomBecause = "SIZE_INCREASED";
} else if (viewportHeight2 < current.state.viewportHeight) {
notAtBottomBecause = "VIEWPORT_HEIGHT_DECREASING";
} else if (scrollTop2 < current.state.scrollTop) {
notAtBottomBecause = "SCROLLING_UPWARDS";
} else {
notAtBottomBecause = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM";
}
return {
atBottom: false,
notAtBottomBecause,
state
};
}, INITIAL_BOTTOM_STATE),
distinctUntilChanged((prev, next) => {
return prev && prev.atBottom === next.atBottom;
})
)
);
const lastJumpDueToItemResize = statefulStreamFromEmitter(
pipe(
scrollContainerState,
scan(
(current, { scrollTop: scrollTop2, scrollHeight, viewportHeight: viewportHeight2 }) => {
if (!approximatelyEqual(current.scrollHeight, scrollHeight)) {
const atBottom = scrollHeight - (scrollTop2 + viewportHeight2) < 1;
if (current.scrollTop !== scrollTop2 && atBottom) {
return {
scrollHeight,
scrollTop: scrollTop2,
jump: current.scrollTop - scrollTop2,
changed: true
};
} else {
return {
scrollHeight,
scrollTop: scrollTop2,
jump: 0,
changed: true
};
}
} else {
return {
scrollTop: scrollTop2,
scrollHeight,
jump: 0,
changed: false
};
}
},
{ scrollHeight: 0, jump: 0, scrollTop: 0, changed: false }
),
filter((value) => value.changed),
map((value) => value.jump)
),
0
);
connect(
pipe(
atBottomState,
map((state) => state.atBottom)
),
isAtBottom
);
connect(pipe(isAtBottom, throttleTime(50)), atBottomStateChange);
const scrollDirection = statefulStream(DOWN);
connect(
pipe(
scrollContainerState,
map(({ scrollTop: scrollTop2 }) => scrollTop2),
distinctUntilChanged(),
scan(
(acc, scrollTop2) => {
if (getValue(isScrollingBy)) {
return { direction: acc.direction, prevScrollTop: scrollTop2 };
}
return { direction: scrollTop2 < acc.prevScrollTop ? UP : DOWN, prevScrollTop: scrollTop2 };
},
{ direction: DOWN, prevScrollTop: 0 }
),
map((value) => value.direction)
),
scrollDirection
);
connect(pipe(scrollContainerState, throttleTime(50), mapTo(NONE$1)), scrollDirection);
const scrollVelocity = statefulStream(0);
connect(
pipe(
isScrolling,
filter((value) => !value),
mapTo(0)
),
scrollVelocity
);
connect(
pipe(
scrollTop,
throttleTime(100),
withLatestFrom(isScrolling),
filter(([_3, isScrolling2]) => !!isScrolling2),
scan(([_3, prev], [next]) => [prev, next], [0, 0]),
map(([prev, next]) => next - prev)
),
scrollVelocity
);
return {
isScrolling,
isAtTop,
isAtBottom,
atBottomState,
atTopStateChange,
atBottomStateChange,
scrollDirection,
atBottomThreshold,
atTopThreshold,
scrollVelocity,
lastJumpDueToItemResize
};
}, tup(domIOSystem));
var propsReadySystem = system(
([{ log: log2 }]) => {
const propsReady = statefulStream(false);
const didMount = streamFromEmitter(
pipe(
propsReady,
filter((ready) => ready),
distinctUntilChanged()
)
);
subscribe(propsReady, (value) => {
value && getValue(log2)("props updated", {}, LogLevel.DEBUG);
});
return { propsReady, didMount };
},
tup(loggerSystem),
{ singleton: true }
);
function getInitialTopMostItemIndexNumber(location, totalCount) {
const lastIndex = totalCount - 1;
const index = typeof location === "number" ? location : location.index === "LAST" ? lastIndex : location.index;
return index;
}
function skipFrames(frameCount, callback) {
if (frameCount == 0) {
callback();
} else {
requestAnimationFrame(() => skipFrames(frameCount - 1, callback));
}
}
var initialTopMostItemIndexSystem = system(
([{ sizes, listRefresh, defaultItemSize }, { scrollTop }, { scrollToIndex }, { didMount }]) => {
const scrolledToInitialItem = statefulStream(true);
const initialTopMostItemIndex = statefulStream(0);
const scrollScheduled = statefulStream(false);
connect(
pipe(
didMount,
withLatestFrom(initialTopMostItemIndex),
filter(([_3, location]) => !!location),
mapTo(false)
),
scrolledToInitialItem
);
subscribe(
pipe(
combineLatest(listRefresh, didMount),
withLatestFrom(scrolledToInitialItem, sizes, defaultItemSize, scrollScheduled),
filter(([[, didMount2], scrolledToInitialItem2, { sizeTree }, defaultItemSize2, scrollScheduled2]) => {
return didMount2 && (!empty(sizeTree) || isDefined(defaultItemSize2)) && !scrolledToInitialItem2 && !scrollScheduled2;
}),
withLatestFrom(initialTopMostItemIndex)
),
([, initialTopMostItemIndex2]) => {
publish(scrollScheduled, true);
skipFrames(2, () => {
handleNext(scrollTop, () => publish(scrolledToInitialItem, true));
publish(scrollToIndex, initialTopMostItemIndex2);
});
}
);
return {
scrolledToInitialItem,
initialTopMostItemIndex
};
},
tup(sizeSystem, domIOSystem, scrollToIndexSystem, propsReadySystem),
{ singleton: true }
);
function normalizeFollowOutput(follow) {
if (!follow) {
return false;
}
return follow === "smooth" ? "smooth" : "auto";
}
var behaviorFromFollowOutput = (follow, isAtBottom) => {
if (typeof follow === "function") {
return normalizeFollowOutput(follow(isAtBottom));
}
return isAtBottom && normalizeFollowOutput(follow);
};
var followOutputSystem = system(
([
{ totalCount, listRefresh },
{ isAtBottom, atBottomState },
{ scrollToIndex },
{ scrolledToInitialItem },
{ propsReady, didMount },
{ log: log2 },
{ scrollingInProgress }
]) => {
const followOutput = statefulStream(false);
const autoscrollToBottom = stream();
let pendingScrollHandle = null;
function scrollToBottom(followOutputBehavior) {
publish(scrollToIndex, {
index: "LAST",
align: "end",
behavior: followOutputBehavior
});
}
subscribe(
pipe(
combineLatest(pipe(duc(totalCount), skip(1)), didMount),
withLatestFrom(duc(followOutput), isAtBottom, scrolledToInitialItem, scrollingInProgress),
map(([[totalCount2, didMount2], followOutput2, isAtBottom2, scrolledToInitialItem2, scrollingInProgress2]) => {
let shouldFollow = didMount2 && scrolledToInitialItem2;
let followOutputBehavior = "auto";
if (shouldFollow) {
followOutputBehavior = behaviorFromFollowOutput(followOutput2, isAtBottom2 || scrollingInProgress2);
shouldFollow = shouldFollow && !!followOutputBehavior;
}
return { totalCount: totalCount2, shouldFollow, followOutputBehavior };
}),
filter(({ shouldFollow }) => shouldFollow)
),
({ totalCount: totalCount2, followOutputBehavior }) => {
if (pendingScrollHandle) {
pendingScrollHandle();
pendingScrollHandle = null;
}
pendingScrollHandle = handleNext(listRefresh, () => {
getValue(log2)("following output to ", { totalCount: totalCount2 }, LogLevel.DEBUG);
scrollToBottom(followOutputBehavior);
pendingScrollHandle = null;
});
}
);
function trapNextSizeIncrease(followOutput2) {
const cancel = handleNext(atBottomState, (state) => {
if (followOutput2 && !state.atBottom && state.notAtBottomBecause === "SIZE_INCREASED" && !pendingScrollHandle) {
getValue(log2)("scrolling to bottom due to increased size", {}, LogLevel.DEBUG);
scrollToBottom("auto");
}
});
setTimeout(cancel, 100);
}
subscribe(
pipe(
combineLatest(duc(followOutput), totalCount, propsReady),
filter(([follow, , ready]) => follow && ready),
scan(
({ value }, [, next]) => {
return { refreshed: value === next, value: next };
},
{ refreshed: false, value: 0 }
),
filter(({ refreshed }) => refreshed),
withLatestFrom(followOutput, totalCount)
),
([, followOutput2]) => {
trapNextSizeIncrease(followOutput2 !== false);
}
);
subscribe(autoscrollToBottom, () => {
trapNextSizeIncrease(getValue(followOutput) !== false);
});
subscribe(combineLatest(duc(followOutput), atBottomState), ([followOutput2, state]) => {
if (followOutput2 && !state.atBottom && state.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING") {
scrollToBottom("auto");
}
});
return { followOutput, autoscrollToBottom };
},
tup(sizeSystem, stateFlagsSystem, scrollToIndexSystem, initialTopMostItemIndexSystem, propsReadySystem, loggerSystem, domIOSystem)
);
function groupCountsToIndicesAndCount(counts) {
return counts.reduce(
(acc, groupCount) => {
acc.groupIndices.push(acc.totalCount);
acc.totalCount += groupCount + 1;
return acc;
},
{
totalCount: 0,
groupIndices: []
}
);
}
var groupedListSystem = system(([{ totalCount, groupIndices, sizes }, { scrollTop, headerHeight }]) => {
const groupCounts = stream();
const topItemsIndexes = stream();
const groupIndicesAndCount = streamFromEmitter(pipe(groupCounts, map(groupCountsToIndicesAndCount)));
connect(
pipe(
groupIndicesAndCount,
map((value) => value.totalCount)
),
totalCount
);
connect(
pipe(
groupIndicesAndCount,
map((value) => value.groupIndices)
),
groupIndices
);
connect(
pipe(
combineLatest(scrollTop, sizes, headerHeight),
filter(([_3, sizes2]) => hasGroups(sizes2)),
map(([scrollTop2, state, headerHeight2]) => findMaxKeyValue(state.groupOffsetTree, Math.max(scrollTop2 - headerHeight2, 0), "v")[0]),
distinctUntilChanged(),
map((index) => [index])
),
topItemsIndexes
);
return { groupCounts, topItemsIndexes };
}, tup(sizeSystem, domIOSystem));
function tupleComparator(prev, current) {
return !!(prev && prev[0] === current[0] && prev[1] === current[1]);
}
function rangeComparator(prev, next) {
return !!(prev && prev.startIndex === next.startIndex && prev.endIndex === next.endIndex);
}
var TOP = "top";
var BOTTOM = "bottom";
var NONE = "none";
function getOverscan(overscan, end, direction) {
if (typeof overscan === "number") {
return direction === UP && end === TOP || direction === DOWN && end === BOTTOM ? overscan : 0;
} else {
if (direction === UP) {
return end === TOP ? overscan.main : overscan.reverse;
} else {
return end === BOTTOM ? overscan.main : overscan.reverse;
}
}
}
function getViewportIncrease(value, end) {
return typeof value === "number" ? value : value[end] || 0;
}
var sizeRangeSystem = system(
([{ scrollTop, viewportHeight, deviation, headerHeight, fixedHeaderHeight }]) => {
const listBoundary = stream();
const topListHeight = statefulStream(0);
const increaseViewportBy = statefulStream(0);
const overscan = statefulStream(0);
const visibleRange = statefulStreamFromEmitter(
pipe(
combineLatest(
duc(scrollTop),
duc(viewportHeight),
duc(headerHeight),
duc(listBoundary, tupleComparator),
duc(overscan),
duc(topListHeight),
duc(fixedHeaderHeight),
duc(deviation),
duc(increaseViewportBy)
),
map(
([
scrollTop2,
viewportHeight2,
headerHeight2,
[listTop, listBottom],
overscan2,
topListHeight2,
fixedHeaderHeight2,
deviation2,
increaseViewportBy2
]) => {
const top = scrollTop2 - deviation2;
const stickyHeaderHeight = topListHeight2 + fixedHeaderHeight2;
const headerVisible = Math.max(headerHeight2 - top, 0);
let direction = NONE;
const topViewportAddition = getViewportIncrease(increaseViewportBy2, TOP);
const bottomViewportAddition = getViewportIncrease(increaseViewportBy2, BOTTOM);
listTop -= deviation2;
listTop += headerHeight2 + fixedHeaderHeight2;
listBottom += headerHeight2 + fixedHeaderHeight2;
listBottom -= deviation2;
if (listTop > scrollTop2 + stickyHeaderHeight - topViewportAddition) {
direction = UP;
}
if (listBottom < scrollTop2 - headerVisible + viewportHeight2 + bottomViewportAddition) {
direction = DOWN;
}
if (direction !== NONE) {
return [
Math.max(top - headerHeight2 - getOverscan(overscan2, TOP, direction) - topViewportAddition, 0),
top - headerVisible - fixedHeaderHeight2 + viewportHeight2 + getOverscan(overscan2, BOTTOM, direction) + bottomViewportAddition
];
}
return null;
}
),
filter((value) => value != null),
distinctUntilChanged(tupleComparator)
),
[0, 0]
);
return {
listBoundary,
overscan,
topListHeight,
increaseViewportBy,
visibleRange
};
},
tup(domIOSystem),
{ singleton: true }
);
function probeItemSet(index, sizes, data) {
if (hasGroups(sizes)) {
const itemIndex = originalIndexFromItemIndex(index, sizes);
const groupIndex = findMaxKeyValue(sizes.groupOffsetTree, itemIndex)[0];
return [
{ index: groupIndex, size: 0, offset: 0 },
{ index: itemIndex, size: 0, offset: 0, data: data && data[0] }
];
}
return [{ index, size: 0, offset: 0, data: data && data[0] }];
}
var EMPTY_LIST_STATE = {
items: [],
topItems: [],
offsetTop: 0,
offsetBottom: 0,
top: 0,
bottom: 0,
topListHeight: 0,
totalCount: 0,
firstItemIndex: 0
};
function transposeItems(items, sizes, firstItemIndex) {
if (items.length === 0) {
return [];
}
if (!hasGroups(sizes)) {
return items.map((item) => __spreadProps(__spreadValues({}, item), { index: item.index + firstItemIndex, originalIndex: item.index }));
}
const startIndex = items[0].index;
const endIndex = items[items.length - 1].index;
const transposedItems = [];
const groupRanges = rangesWithin(sizes.groupOffsetTree, startIndex, endIndex);
let currentRange = void 0;
let currentGroupIndex = 0;
for (const item of items) {
if (!currentRange || currentRange.end < item.index) {
currentRange = groupRanges.shift();
currentGroupIndex = sizes.groupIndices.indexOf(currentRange.start);
}
let transposedItem;
if (item.index === currentRange.start) {
transposedItem = {
type: "group",
index: currentGroupIndex
};
} else {
transposedItem = {
index: item.index - (currentGroupIndex + 1) + firstItemIndex,
groupIndex: currentGroupIndex
};
}
transposedItems.push(__spreadProps(__spreadValues({}, transposedItem), {
size: item.size,
offset: item.offset,
originalIndex: item.index,
data: item.data
}));
}
return transposedItems;
}
function buildListState(items, topItems, totalCount, gap, sizes, firstItemIndex) {
const { lastSize, lastOffset, lastIndex } = sizes;
let offsetTop = 0;
let bottom = 0;
if (items.length > 0) {
offsetTop = items[0].offset;
const lastItem = items[items.length - 1];
bottom = lastItem.offset + lastItem.size;
}
const itemCount = totalCount - lastIndex;
const total = lastOffset + itemCount * lastSize + (itemCount - 1) * gap;
const top = offsetTop;
const offsetBottom = total - bottom;
return {
items: transposeItems(items, sizes, firstItemIndex),
topItems: transposeItems(topItems, sizes, firstItemIndex),
topListHeight: topItems.reduce((height, item) => item.size + height, 0),
offsetTop,
offsetBottom,
top,
bottom,
totalCount,
firstItemIndex
};
}
var listStateSystem = system(
([
{ sizes, totalCount, data, firstItemIndex, gap },
groupedListSystem2,
{ visibleRange, listBoundary, topListHeight: rangeTopListHeight },
{ scrolledToInitialItem, initialTopMostItemIndex },
{ topListHeight },
stateFlags,
{ didMount },
{ recalcInProgress }
]) => {
const topItemsIndexes = statefulStream([]);
const itemsRendered = stream();
connect(groupedListSystem2.topItemsIndexes, topItemsIndexes);
const listState = statefulStreamFromEmitter(
pipe(
combineLatest(
didMount,
recalcInProgress,
duc(visibleRange, tupleComparator),
duc(totalCount),
duc(sizes),
duc(initialTopMostItemIndex),
scrolledToInitialItem,
duc(topItemsIndexes),
duc(firstItemIndex),
duc(gap),
data
),
filter(([mount, recalcInProgress2, , totalCount2, , , , , , , data2]) => {
const dataChangeInProgress = data2 && data2.length !== totalCount2;
return mount && !recalcInProgress2 && !dataChangeInProgress;
}),
map(
([
,
,
[startOffset, endOffset],
totalCount2,
sizes2,
initialTopMostItemIndex2,
scrolledToInitialItem2,
topItemsIndexes2,
firstItemIndex2,
gap2,
data2
]) => {
const sizesValue = sizes2;
const { sizeTree, offsetTree } = sizesValue;
if (totalCount2 === 0 || startOffset === 0 && endOffset === 0) {
return __spreadProps(__spreadValues({}, EMPTY_LIST_STATE), { totalCount: totalCount2 });
}
if (empty(sizeTree)) {
return buildListState(
probeItemSet(getInitialTopMostItemIndexNumber(initialTopMostItemIndex2, totalCount2), sizesValue, data2),
[],
totalCount2,
gap2,
sizesValue,
firstItemIndex2
);
}
const topItems = [];
if (topItemsIndexes2.length > 0) {
const startIndex = topItemsIndexes2[0];
const endIndex = topItemsIndexes2[topItemsIndexes2.length - 1];
let offset = 0;
for (const range of rangesWithin(sizeTree, startIndex, endIndex)) {
const size = range.value;
const rangeStartIndex = Math.max(range.start, startIndex);
const rangeEndIndex = Math.min(range.end, endIndex);
for (let i2 = rangeStartIndex; i2 <= rangeEndIndex; i2++) {
topItems.push({ index: i2, size, offset, data: data2 && data2[i2] });
offset += size;
}
}
}
if (!scrolledToInitialItem2) {
return buildListState([], topItems, totalCount2, gap2, sizesValue, firstItemIndex2);
}
const minStartIndex = topItemsIndexes2.length > 0 ? topItemsIndexes2[topItemsIndexes2.length - 1] + 1 : 0;
const offsetPointRanges = rangesWithinOffsets(offsetTree, startOffset, endOffset, minStartIndex);
if (offsetPointRanges.length === 0) {
return null;
}
const maxIndex = totalCount2 - 1;
const items = tap([], (result) => {
for (const range of offsetPointRanges) {
const point = range.value;
let offset = point.offset;
let rangeStartIndex = range.start;
const size = point.size;
if (point.offset < startOffset) {
rangeStartIndex += Math.floor((startOffset - point.offset + gap2) / (size + gap2));
const itemCount = rangeStartIndex - range.start;
offset += itemCount * size + itemCount * gap2;
}
if (rangeStartIndex < minStartIndex) {
offset += (minStartIndex - rangeStartIndex) * size;
rangeStartIndex = minStartIndex;
}
const endIndex = Math.min(range.end, maxIndex);
for (let i2 = rangeStartIndex; i2 <= endIndex; i2++) {
if (offset >= endOffset) {
break;
}
result.push({ index: i2, size, offset, data: data2 && data2[i2] });
offset += size + gap2;
}
}
});
return buildListState(items, topItems, totalCount2, gap2, sizesValue, firstItemIndex2);
}
),
filter((value) => value !== null),
distinctUntilChanged()
),
EMPTY_LIST_STATE
);
connect(
pipe(
data,
filter(isDefined),
map((data2) => data2 == null ? void 0 : data2.length)
),
totalCount
);
connect(
pipe(
listState,
map((value) => value.topListHeight)
),
topListHeight
);
connect(topListHeight, rangeTopListHeight);
connect(
pipe(
listState,
map((state) => [state.top, state.bottom])
),
listBoundary
);
connect(
pipe(
listState,
map((state) => state.items)
),
itemsRendered
);
const endReached = streamFromEmitter(
pipe(
listState,
filter(({ items }) => items.length > 0),
withLatestFrom(totalCount, data),
filter(([{ items }, totalCount2]) => items[items.length - 1].originalIndex === totalCount2 - 1),
map(([, totalCount2, data2]) => [totalCount2 - 1, data2]),
distinctUntilChanged(tupleComparator),
map(([count]) => count)
)
);
const startReached = streamFromEmitter(
pipe(
listState,
throttleTime(200),
filter(({ items, topItems }) => {
return items.length > 0 && items[0].originalIndex === topItems.length;
}),
map(({ items }) => items[0].index),
distinctUntilChanged()
)
);
const rangeChanged = streamFromEmitter(
pipe(
listState,
filter(({ items }) => items.length > 0),
map(({ items }) => {
let startIndex = 0;
let endIndex = items.length - 1;
while (items[startIndex].type === "group" && startIndex < endIndex) {
startIndex++;
}
while (items[endIndex].type === "group" && endIndex > startIndex) {
endIndex--;
}
return {
startIndex: items[startIndex].index,
endIndex: items[endIndex].index
};
}),
distinctUntilChanged(rangeComparator)
)
);
return __spreadValues({ listState, topItemsIndexes, endReached, startReached, rangeChanged, itemsRendered }, stateFlags);
},
tup(
sizeSystem,
groupedListSystem,
sizeRangeSystem,
initialTopMostItemIndexSystem,
scrollToIndexSystem,
stateFlagsSystem,
propsReadySystem,
recalcSystem
),
{ singleton: true }
);
var initialItemCountSystem = system(
([{ sizes, firstItemIndex, data, gap }, { listState }, { didMount }]) => {
const initialItemCount = statefulStream(0);
connect(
pipe(
didMount,
withLatestFrom(initialItemCount),
filter(([, count]) => count !== 0),
withLatestFrom(sizes, firstItemIndex, gap, data),
map(([[, count], sizes2, firstItemIndex2, gap2, data2 = []]) => {
let includedGroupsCount = 0;
if (sizes2.groupIndices.length > 0) {
for (const index of sizes2.groupIndices) {
if (index - includedGroupsCount >= count) {
break;
}
includedGroupsCount++;
}
}
const adjustedCount = count + includedGroupsCount;
const items = Array.from({ length: adjustedCount }).map((_3, index) => ({ index, size: 0, offset: 0, data: data2[index] }));
return buildListState(items, [], adjustedCount, gap2, sizes2, firstItemIndex2);
})
),
listState
);
return { initialItemCount };
},
tup(sizeSystem, listStateSystem, propsReadySystem),
{ singleton: true }
);
var scrollSeekSystem = system(
([{ scrollVelocity }]) => {
const isSeeking = statefulStream(false);
const rangeChanged = stream();
const scrollSeekConfiguration = statefulStream(false);
connect(
pipe(
scrollVelocity,
withLatestFrom(scrollSeekConfiguration, isSeeking, rangeChanged),
filter(([_3, config]) => !!config),
map(([speed, config, isSeeking2, range]) => {
const { exit, enter } = config;
if (isSeeking2) {
if (exit(speed, range)) {
return false;
}
} else {
if (enter(speed, range)) {
return true;
}
}
return isSeeking2;
}),
distinctUntilChanged()
),
isSeeking
);
subscribe(
pipe(combineLatest(isSeeking, scrollVelocity, rangeChanged), withLatestFrom(scrollSeekConfiguration)),
([[isSeeking2, velocity, range], config]) => isSeeking2 && config && config.change && config.change(velocity, range)
);
return { isSeeking, scrollSeekConfiguration, scrollVelocity, scrollSeekRangeChanged: rangeChanged };
},
tup(stateFlagsSystem),
{ singleton: true }
);
var topItemCountSystem = system(([{ topItemsIndexes }]) => {
const topItemCount = statefulStream(0);
connect(
pipe(
topItemCount,
filter((length) => length > 0),
map((length) => Array.from({ length }).map((_3, index) => index))
),
topItemsIndexes
);
return { topItemCount };
}, tup(listStateSystem));
var totalListHeightSystem = system(
([{ footerHeight, headerHeight, fixedHeaderHeight, fixedFooterHeight }, { listState }]) => {
const totalListHeightChanged = stream();
const totalListHeight = statefulStreamFromEmitter(
pipe(
combineLatest(footerHeight, fixedFooterHeight, headerHeight, fixedHeaderHeight, listState),
map(([footerHeight2, fixedFooterHeight2, headerHeight2, fixedHeaderHeight2, listState2]) => {
return footerHeight2 + fixedFooterHeight2 + headerHeight2 + fixedHeaderHeight2 + listState2.offsetBottom + listState2.bottom;
})
),
0
);
connect(duc(totalListHeight), totalListHeightChanged);
return { totalListHeight, totalListHeightChanged };
},
tup(domIOSystem, listStateSystem),
{ singleton: true }
);
function simpleMemoize(func) {
let called = false;
let result;
return () => {
if (!called) {
called = true;
result = func();
}
return result;
};
}
var isMobileSafari = simpleMemoize(() => {
return /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent);
});
var upwardScrollFixSystem = system(
([
{ scrollBy, scrollTop, deviation, scrollingInProgress },
{ isScrolling, isAtBottom, scrollDirection, lastJumpDueToItemResize },
{ listState },
{ beforeUnshiftWith, shiftWithOffset, sizes, gap },
{ log: log2 },
{ recalcInProgress }
]) => {
const deviationOffset = streamFromEmitter(
pipe(
listState,
withLatestFrom(lastJumpDueToItemResize),
scan(
([, prevItems, prevTotalCount, prevTotalHeight], [{ items, totalCount, bottom, offsetBottom }, lastJumpDueToItemResize2]) => {
const totalHeight = bottom + offsetBottom;
let newDev = 0;
if (prevTotalCount === totalCount) {
if (prevItems.length > 0 && items.length > 0) {
const atStart = items[0].originalIndex === 0 && prevItems[0].originalIndex === 0;
if (!atStart) {
newDev = totalHeight - prevTotalHeight;
if (newDev !== 0) {
newDev += lastJumpDueToItemResize2;
}
}
}
}
return [newDev, items, totalCount, totalHeight];
},
[0, [], 0, 0]
),
filter(([amount]) => amount !== 0),
withLatestFrom(scrollTop, scrollDirection, scrollingInProgress, isAtBottom, log2, recalcInProgress),
filter(([, scrollTop2, scrollDirection2, scrollingInProgress2, , , recalcInProgress2]) => {
return !recalcInProgress2 && !scrollingInProgress2 && scrollTop2 !== 0 && scrollDirection2 === UP;
}),
map(([[amount], , , , , log22]) => {
log22("Upward scrolling compensation", { amount }, LogLevel.DEBUG);
return amount;
})
)
);
function scrollByWith(offset) {
if (offset > 0) {
publish(scrollBy, { top: -offset, behavior: "auto" });
publish(deviation, 0);
} else {
publish(deviation, 0);
publish(scrollBy, { top: -offset, behavior: "auto" });
}
}
subscribe(pipe(deviationOffset, withLatestFrom(deviation, isScrolling)), ([offset, deviationAmount, isScrolling2]) => {
if (isScrolling2 && isMobileSafari()) {
publish(deviation, deviationAmount - offset);
} else {
scrollByWith(-offset);
}
});
subscribe(
pipe(
combineLatest(statefulStreamFromEmitter(isScrolling, false), deviation, recalcInProgress),
filter(([is, deviation2, recalc]) => !is && !recalc && deviation2 !== 0),
map(([_3, deviation2]) => deviation2),
throttleTime(1)
),
scrollByWith
);
connect(
pipe(
shiftWithOffset,
map((offset) => {
return { top: -offset };
})
),
scrollBy
);
subscribe(
pipe(
beforeUnshiftWith,
withLatestFrom(sizes, gap),
map(([offset, { lastSize: defaultItemSize, groupIndices, sizeTree }, gap2]) => {
function getItemOffset(itemCount) {
return itemCount * (defaultItemSize + gap2);
}
if (groupIndices.length === 0) {
return getItemOffset(offset);
} else {
let amount = 0;
const defaultGroupSize = find(sizeTree, 0);
let recognizedOffsetItems = 0;
let groupIndex = 0;
while (recognizedOffsetItems < offset) {
recognizedOffsetItems++;
amount += defaultGroupSize;
let groupItemCount = groupIndices.length === groupIndex + 1 ? Infinity : groupIndices[groupIndex + 1] - groupIndices[groupIndex] - 1;
if (recognizedOffsetItems + groupItemCount > offset) {
amount -= defaultGroupSize;
groupItemCount = offset - recognizedOffsetItems + 1;
}
recognizedOffsetItems += groupItemCount;
amount += getItemOffset(groupItemCount);
groupIndex++;
}
return amount;
}
})
),
(offset) => {
publish(deviation, offset);
requestAnimationFrame(() => {
publish(scrollBy, { top: offset });
requestAnimationFrame(() => {
publish(deviation, 0);
publish(recalcInProgress, false);
});
});
}
);
return { deviation };
},
tup(domIOSystem, stateFlagsSystem, listStateSystem, sizeSystem, loggerSystem, recalcSystem)
);
var initialScrollTopSystem = system(
([{ didMount }, { scrollTo }, { listState }]) => {
const initialScrollTop = statefulStream(0);
subscribe(
pipe(
didMount,
withLatestFrom(initialScrollTop),
filter(([, offset]) => offset !== 0),
map(([, offset]) => ({ top: offset }))
),
(location) => {
handleNext(
pipe(
listState,
skip(1),
filter((state) => state.items.length > 1)
),
() => {
requestAnimationFrame(() => {
publish(scrollTo, location);
});
}
);
}
);
return {
initialScrollTop
};
},
tup(propsReadySystem, domIOSystem, listStateSystem),
{ singleton: true }
);
var alignToBottomSystem = system(
([{ viewportHeight }, { totalListHeight }]) => {
const alignToBottom = statefulStream(false);
const paddingTopAddition = statefulStreamFromEmitter(
pipe(
combineLatest(alignToBottom, viewportHeight, totalListHeight),
filter(([enabled]) => enabled),
map(([, viewportHeight2, totalListHeight2]) => {
return Math.max(0, viewportHeight2 - totalListHeight2);
}),
throttleTime(0),
distinctUntilChanged()
),
0
);
return { alignToBottom, paddingTopAddition };
},
tup(domIOSystem, totalListHeightSystem),
{ singleton: true }
);
var windowScrollerSystem = system(([{ scrollTo, scrollContainerState }]) => {
const windowScrollContainerState = stream();
const windowViewportRect = stream();
const windowScrollTo = stream();
const useWindowScroll = statefulStream(false);
const customScrollParent = statefulStream(void 0);
connect(
pipe(
combineLatest(windowScrollContainerState, windowViewportRect),
map(([{ viewportHeight, scrollTop: windowScrollTop, scrollHeight }, { offsetTop }]) => {
return {
scrollTop: Math.max(0, windowScrollTop - offsetTop),
scrollHeight,
viewportHeight
};
})
),
scrollContainerState
);
connect(
pipe(
scrollTo,
withLatestFrom(windowViewportRect),
map(([scrollTo2, { offsetTop }]) => {
return __spreadProps(__spreadValues({}, scrollTo2), {
top: scrollTo2.top + offsetTop
});
})
),
windowScrollTo
);
return {
useWindowScroll,
customScrollParent,
windowScrollContainerState,
windowViewportRect,
windowScrollTo
};
}, tup(domIOSystem));
var defaultCalculateViewLocation = (_a) => {
var {
itemTop: itemTop2,
itemBottom,
viewportTop,
viewportBottom,
locationParams: _b
} = _a, _c = _b, { behavior, align } = _c, rest = __objRest(_c, ["behavior", "align"]);
if (itemTop2 < viewportTop) {
return __spreadProps(__spreadValues({}, rest), { behavior, align: align != null ? align : "start" });
}
if (itemBottom > viewportBottom) {
return __spreadProps(__spreadValues({}, rest), { behavior, align: align != null ? align : "end" });
}
return null;
};
var scrollIntoViewSystem = system(
([
{ sizes, totalCount, gap },
{ scrollTop, viewportHeight, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollingInProgress },
{ scrollToIndex }
]) => {
const scrollIntoView = stream();
connect(
pipe(
scrollIntoView,
withLatestFrom(sizes, viewportHeight, totalCount, headerHeight, fixedHeaderHeight, fixedFooterHeight, scrollTop),
withLatestFrom(gap),
map(([[viewLocation, sizes2, viewportHeight2, totalCount2, headerHeight2, fixedHeaderHeight2, fixedFooterHeight2, scrollTop2], gap2]) => {
const _a = viewLocation, { done, behavior, align, calculateViewLocation = defaultCalculateViewLocation } = _a, rest = __objRest(_a, ["done", "behavior", "align", "calculateViewLocation"]);
const actualIndex = originalIndexFromLocation(viewLocation, sizes2, totalCount2 - 1);
const itemTop2 = offsetOf(actualIndex, sizes2.offsetTree, gap2) + headerHeight2 + fixedHeaderHeight2;
const itemBottom = itemTop2 + findMaxKeyValue(sizes2.sizeTree, actualIndex)[1];
const viewportTop = scrollTop2 + fixedHeaderHeight2;
const viewportBottom = scrollTop2 + viewportHeight2 - fixedFooterHeight2;
const location = calculateViewLocation({
itemTop: itemTop2,
itemBottom,
viewportTop,
viewportBottom,
locationParams: __spreadValues({ behavior, align }, rest)
});
if (location) {
done && handleNext(
pipe(
scrollingInProgress,
filter((value) => value === false),
skip(getValue(scrollingInProgress) ? 1 : 2)
),
done
);
} else {
done && done();
}
return location;
}),
filter((value) => value !== null)
),
scrollToIndex
);
return {
scrollIntoView
};
},
tup(sizeSystem, domIOSystem, scrollToIndexSystem, listStateSystem, loggerSystem),
{ singleton: true }
);
var stateLoadSystem = system(([{ sizes, sizeRanges }, { scrollTop }, { initialTopMostItemIndex }, { didMount }]) => {
const getState = stream();
const restoreStateFrom = statefulStream(void 0);
subscribe(pipe(getState, withLatestFrom(sizes, scrollTop)), ([callback, sizes2, scrollTop2]) => {
const ranges = sizeTreeToRanges(sizes2.sizeTree);
callback({ ranges, scrollTop: scrollTop2 });
});
connect(pipe(restoreStateFrom, filter(isDefined), map(locationFromSnapshot)), initialTopMostItemIndex);
connect(
pipe(
didMount,
withLatestFrom(restoreStateFrom),
filter(([, state]) => state !== void 0),
distinctUntilChanged(),
map(([, snapshot]) => {
return snapshot.ranges;
})
),
sizeRanges
);
return {
getState,
restoreStateFrom
};
}, tup(sizeSystem, domIOSystem, initialTopMostItemIndexSystem, propsReadySystem));
function locationFromSnapshot(snapshot) {
return { offset: snapshot.scrollTop, index: 0, align: "start" };
}
var featureGroup1System = system(
([
sizeRange,
initialItemCount,
propsReady,
scrollSeek,
totalListHeight,
initialScrollTopSystem2,
alignToBottom,
windowScroller,
scrollIntoView,
logger
]) => {
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, sizeRange), initialItemCount), propsReady), scrollSeek), totalListHeight), initialScrollTopSystem2), alignToBottom), windowScroller), scrollIntoView), logger);
},
tup(
sizeRangeSystem,
initialItemCountSystem,
propsReadySystem,
scrollSeekSystem,
totalListHeightSystem,
initialScrollTopSystem,
alignToBottomSystem,
windowScrollerSystem,
scrollIntoViewSystem,
loggerSystem
)
);
var listSystem = system(
(_a) => {
var [
{
totalCount,
sizeRanges,
fixedItemSize,
defaultItemSize,
trackItemSizes,
itemSize,
data,
firstItemIndex,
groupIndices,
statefulTotalCount,
gap,
sizes
},
{ initialTopMostItemIndex, scrolledToInitialItem },
domIO,
stateLoad,
followOutput,
_b,
..._c
] = _a, _d = _b, { listState, topItemsIndexes } = _d, flags = __objRest(_d, ["listState", "topItemsIndexes"]), [
{ scrollToIndex },
_3,
{ topItemCount },
{ groupCounts },
featureGroup1
] = _c;
connect(flags.rangeChanged, featureGroup1.scrollSeekRangeChanged);
connect(
pipe(
featureGroup1.windowViewportRect,
map((value) => value.visibleHeight)
),
domIO.viewportHeight
);
return __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
totalCount,
data,
firstItemIndex,
sizeRanges,
initialTopMostItemIndex,
scrolledToInitialItem,
topItemsIndexes,
topItemCount,
groupCounts,
fixedItemHeight: fixedItemSize,
defaultItemHeight: defaultItemSize,
gap
}, followOutput), {
statefulTotalCount,
listState,
scrollToIndex,
trackItemSizes,
itemSize,
groupIndices
}), flags), featureGroup1), domIO), {
sizes
}), stateLoad);
},
tup(
sizeSystem,
initialTopMostItemIndexSystem,
domIOSystem,
stateLoadSystem,
followOutputSystem,
listStateSystem,
scrollToIndexSystem,
upwardScrollFixSystem,
topItemCountSystem,
groupedListSystem,
featureGroup1System
)
);
var WEBKIT_STICKY = "-webkit-sticky";
var STICKY = "sticky";
var positionStickyCssValue = simpleMemoize(() => {
if (typeof document === "undefined") {
return STICKY;
}
const node = document.createElement("div");
node.style.position = WEBKIT_STICKY;
return node.style.position === WEBKIT_STICKY ? WEBKIT_STICKY : STICKY;
});
function useWindowViewportRectRef(callback, customScrollParent) {
const viewportInfo = import_react2.default.useRef(null);
const calculateInfo = import_react2.default.useCallback(
(element) => {
if (element === null || !element.offsetParent) {
return;
}
const rect = element.getBoundingClientRect();
const visibleWidth = rect.width;
let visibleHeight, offsetTop;
if (customScrollParent) {
const customScrollParentRect = customScrollParent.getBoundingClientRect();
const deltaTop = rect.top - customScrollParentRect.top;
visibleHeight = customScrollParentRect.height - Math.max(0, deltaTop);
offsetTop = deltaTop + customScrollParent.scrollTop;
} else {
visibleHeight = window.innerHeight - Math.max(0, rect.top);
offsetTop = rect.top + window.pageYOffset;
}
viewportInfo.current = {
offsetTop,
visibleHeight,
visibleWidth
};
callback(viewportInfo.current);
},
[callback, customScrollParent]
);
const { callbackRef, ref } = useSizeWithElRef(calculateInfo);
const scrollAndResizeEventHandler = import_react2.default.useCallback(() => {
calculateInfo(ref.current);
}, [calculateInfo, ref]);
import_react2.default.useEffect(() => {
if (customScrollParent) {
customScrollParent.addEventListener("scroll", scrollAndResizeEventHandler);
const observer = new ResizeObserver(scrollAndResizeEventHandler);
observer.observe(customScrollParent);
return () => {
customScrollParent.removeEventListener("scroll", scrollAndResizeEventHandler);
observer.unobserve(customScrollParent);
};
} else {
window.addEventListener("scroll", scrollAndResizeEventHandler);
window.addEventListener("resize", scrollAndResizeEventHandler);
return () => {
window.removeEventListener("scroll", scrollAndResizeEventHandler);
window.removeEventListener("resize", scrollAndResizeEventHandler);
};
}
}, [scrollAndResizeEventHandler, customScrollParent]);
return callbackRef;
}
var VirtuosoMockContext = import_react2.default.createContext(void 0);
var VirtuosoGridMockContext = import_react2.default.createContext(void 0);
function identity(value) {
return value;
}
var listComponentPropsSystem = /* @__PURE__ */ system(() => {
const itemContent = statefulStream((index) => `Item ${index}`);
const context = statefulStream(null);
const groupContent = statefulStream((index) => `Group ${index}`);
const components = statefulStream({});
const computeItemKey = statefulStream(identity);
const headerFooterTag = statefulStream("div");
const scrollerRef = statefulStream(noop);
const distinctProp = (propName, defaultValue = null) => {
return statefulStreamFromEmitter(
pipe(
components,
map((components2) => components2[propName]),
distinctUntilChanged()
),
defaultValue
);
};
return {
context,
itemContent,
groupContent,
components,
computeItemKey,
headerFooterTag,
scrollerRef,
FooterComponent: distinctProp("Footer"),
HeaderComponent: distinctProp("Header"),
TopItemListComponent: distinctProp("TopItemList"),
ListComponent: distinctProp("List", "div"),
ItemComponent: distinctProp("Item", "div"),
GroupComponent: distinctProp("Group", "div"),
ScrollerComponent: distinctProp("Scroller", "div"),
EmptyPlaceholder: distinctProp("EmptyPlaceholder"),
ScrollSeekPlaceholder: distinctProp("ScrollSeekPlaceholder")
};
});
var combinedSystem$2 = /* @__PURE__ */ system(([listSystem2, propsSystem]) => {
return __spreadValues(__spreadValues({}, listSystem2), propsSystem);
}, tup(listSystem, listComponentPropsSystem));
var DefaultScrollSeekPlaceholder$1 = ({ height }) => /* @__PURE__ */ import_react2.default.createElement("div", { style: { height } });
var GROUP_STYLE = { position: positionStickyCssValue(), zIndex: 1, overflowAnchor: "none" };
var ITEM_STYLE = { overflowAnchor: "none" };
var Items$1 = /* @__PURE__ */ import_react2.default.memo(function VirtuosoItems({ showTopList = false }) {
const listState = useEmitterValue$2("listState");
const sizeRanges = usePublisher$2("sizeRanges");
const useWindowScroll = useEmitterValue$2("useWindowScroll");
const customScrollParent = useEmitterValue$2("customScrollParent");
const windowScrollContainerStateCallback = usePublisher$2("windowScrollContainerState");
const _scrollContainerStateCallback = usePublisher$2("scrollContainerState");
const scrollContainerStateCallback = customScrollParent || useWindowScroll ? windowScrollContainerStateCallback : _scrollContainerStateCallback;
const itemContent = useEmitterValue$2("itemContent");
const context = useEmitterValue$2("context");
const groupContent = useEmitterValue$2("groupContent");
const trackItemSizes = useEmitterValue$2("trackItemSizes");
const itemSize = useEmitterValue$2("itemSize");
const log2 = useEmitterValue$2("log");
const listGap = usePublisher$2("gap");
const { callbackRef } = useChangedListContentsSizes(
sizeRanges,
itemSize,
trackItemSizes,
showTopList ? noop : scrollContainerStateCallback,
log2,
listGap,
customScrollParent
);
const [deviation, setDeviation] = import_react2.default.useState(0);
useEmitter$2("deviation", (value) => {
if (deviation !== value) {
setDeviation(value);
}
});
const EmptyPlaceholder = useEmitterValue$2("EmptyPlaceholder");
const ScrollSeekPlaceholder = useEmitterValue$2("ScrollSeekPlaceholder") || DefaultScrollSeekPlaceholder$1;
const ListComponent = useEmitterValue$2("ListComponent");
const ItemComponent = useEmitterValue$2("ItemComponent");
const GroupComponent = useEmitterValue$2("GroupComponent");
const computeItemKey = useEmitterValue$2("computeItemKey");
const isSeeking = useEmitterValue$2("isSeeking");
const hasGroups2 = useEmitterValue$2("groupIndices").length > 0;
const paddingTopAddition = useEmitterValue$2("paddingTopAddition");
const scrolledToInitialItem = useEmitterValue$2("scrolledToInitialItem");
const containerStyle2 = showTopList ? {} : __spreadValues({
boxSizing: "border-box",
paddingTop: listState.offsetTop + paddingTopAddition,
paddingBottom: listState.offsetBottom,
marginTop: deviation
}, scrolledToInitialItem ? {} : { visibility: "hidden" });
if (!showTopList && listState.totalCount === 0 && EmptyPlaceholder) {
return import_react2.default.createElement(EmptyPlaceholder, contextPropIfNotDomElement(EmptyPlaceholder, context));
}
return import_react2.default.createElement(
ListComponent,
__spreadProps(__spreadValues({}, contextPropIfNotDomElement(ListComponent, context)), {
ref: callbackRef,
style: containerStyle2,
"data-test-id": showTopList ? "virtuoso-top-item-list" : "virtuoso-item-list"
}),
(showTopList ? listState.topItems : listState.items).map((item) => {
const index = item.originalIndex;
const key = computeItemKey(index + listState.firstItemIndex, item.data, context);
if (isSeeking) {
return import_react2.default.createElement(ScrollSeekPlaceholder, __spreadValues(__spreadProps(__spreadValues({}, contextPropIfNotDomElement(ScrollSeekPlaceholder, context)), {
key,
index: item.index,
height: item.size,
type: item.type || "item"
}), item.type === "group" ? {} : { groupIndex: item.groupIndex }));
}
if (item.type === "group") {
return import_react2.default.createElement(
GroupComponent,
__spreadProps(__spreadValues({}, contextPropIfNotDomElement(GroupComponent, context)), {
key,
"data-index": index,
"data-known-size": item.size,
"data-item-index": item.index,
style: GROUP_STYLE
}),
groupContent(item.index, context)
);
} else {
return import_react2.default.createElement(
ItemComponent,
__spreadProps(__spreadValues({}, contextPropIfNotDomElement(ItemComponent, context)), {
key,
"data-index": index,
"data-known-size": item.size,
"data-item-index": item.index,
"data-item-group-index": item.groupIndex,
item: item.data,
style: ITEM_STYLE
}),
hasGroups2 ? itemContent(item.index, item.groupIndex, item.data, context) : itemContent(item.index, item.data, context)
);
}
})
);
});
var scrollerStyle = {
height: "100%",
outline: "none",
overflowY: "auto",
position: "relative",
WebkitOverflowScrolling: "touch"
};
var viewportStyle = {
width: "100%",
height: "100%",
position: "absolute",
top: 0
};
var topItemListStyle = {
width: "100%",
position: positionStickyCssValue(),
top: 0,
zIndex: 1
};
function contextPropIfNotDomElement(element, context) {
if (typeof element === "string") {
return void 0;
}
return { context };
}
var Header$1 = /* @__PURE__ */ import_react2.default.memo(function VirtuosoHeader() {
const Header2 = useEmitterValue$2("HeaderComponent");
const headerHeight = usePublisher$2("headerHeight");
const headerFooterTag = useEmitterValue$2("headerFooterTag");
const ref = useSize((el) => headerHeight(correctItemSize(el, "height")));
const context = useEmitterValue$2("context");
return Header2 ? import_react2.default.createElement(headerFooterTag, { ref }, import_react2.default.createElement(Header2, contextPropIfNotDomElement(Header2, context))) : null;
});
var Footer$1 = /* @__PURE__ */ import_react2.default.memo(function VirtuosoFooter() {
const Footer2 = useEmitterValue$2("FooterComponent");
const footerHeight = usePublisher$2("footerHeight");
const headerFooterTag = useEmitterValue$2("headerFooterTag");
const ref = useSize((el) => footerHeight(correctItemSize(el, "height")));
const context = useEmitterValue$2("context");
return Footer2 ? import_react2.default.createElement(headerFooterTag, { ref }, import_react2.default.createElement(Footer2, contextPropIfNotDomElement(Footer2, context))) : null;
});
function buildScroller({ usePublisher: usePublisher2, useEmitter: useEmitter2, useEmitterValue: useEmitterValue2 }) {
const Scroller2 = import_react2.default.memo(function VirtuosoScroller(_a) {
var _b = _a, { style, children } = _b, props = __objRest(_b, ["style", "children"]);
const scrollContainerStateCallback = usePublisher2("scrollContainerState");
const ScrollerComponent = useEmitterValue2("ScrollerComponent");
const smoothScrollTargetReached = usePublisher2("smoothScrollTargetReached");
const scrollerRefCallback = useEmitterValue2("scrollerRef");
const context = useEmitterValue2("context");
const { scrollerRef, scrollByCallback, scrollToCallback } = useScrollTop(
scrollContainerStateCallback,
smoothScrollTargetReached,
ScrollerComponent,
scrollerRefCallback
);
useEmitter2("scrollTo", scrollToCallback);
useEmitter2("scrollBy", scrollByCallback);
return import_react2.default.createElement(
ScrollerComponent,
__spreadValues(__spreadValues({
ref: scrollerRef,
style: __spreadValues(__spreadValues({}, scrollerStyle), style),
"data-test-id": "virtuoso-scroller",
"data-virtuoso-scroller": true,
tabIndex: 0
}, props), contextPropIfNotDomElement(ScrollerComponent, context)),
children
);
});
return Scroller2;
}
function buildWindowScroller({ usePublisher: usePublisher2, useEmitter: useEmitter2, useEmitterValue: useEmitterValue2 }) {
const Scroller2 = import_react2.default.memo(function VirtuosoWindowScroller(_a) {
var _b = _a, { style, children } = _b, props = __objRest(_b, ["style", "children"]);
const scrollContainerStateCallback = usePublisher2("windowScrollContainerState");
const ScrollerComponent = useEmitterValue2("ScrollerComponent");
const smoothScrollTargetReached = usePublisher2("smoothScrollTargetReached");
const totalListHeight = useEmitterValue2("totalListHeight");
const deviation = useEmitterValue2("deviation");
const customScrollParent = useEmitterValue2("customScrollParent");
const context = useEmitterValue2("context");
const { scrollerRef, scrollByCallback, scrollToCallback } = useScrollTop(
scrollContainerStateCallback,
smoothScrollTargetReached,
ScrollerComponent,
noop,
customScrollParent
);
useIsomorphicLayoutEffect$1(() => {
scrollerRef.current = customScrollParent ? customScrollParent : window;
return () => {
scrollerRef.current = null;
};
}, [scrollerRef, customScrollParent]);
useEmitter2("windowScrollTo", scrollToCallback);
useEmitter2("scrollBy", scrollByCallback);
return import_react2.default.createElement(
ScrollerComponent,
__spreadValues(__spreadValues({
style: __spreadValues(__spreadValues({ position: "relative" }, style), totalListHeight !== 0 ? { height: totalListHeight + deviation } : {}),
"data-virtuoso-scroller": true
}, props), contextPropIfNotDomElement(ScrollerComponent, context)),
children
);
});
return Scroller2;
}
var Viewport$2 = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoMockContext);
const viewportHeight = usePublisher$2("viewportHeight");
const fixedItemHeight = usePublisher$2("fixedItemHeight");
const viewportRef = useSize(compose2(viewportHeight, (el) => correctItemSize(el, "height")));
import_react2.default.useEffect(() => {
if (ctx) {
viewportHeight(ctx.viewportHeight);
fixedItemHeight(ctx.itemHeight);
}
}, [ctx, viewportHeight, fixedItemHeight]);
return /* @__PURE__ */ import_react2.default.createElement("div", { style: viewportStyle, ref: viewportRef, "data-viewport-type": "element" }, children);
};
var WindowViewport$2 = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoMockContext);
const windowViewportRect = usePublisher$2("windowViewportRect");
const fixedItemHeight = usePublisher$2("fixedItemHeight");
const customScrollParent = useEmitterValue$2("customScrollParent");
const viewportRef = useWindowViewportRectRef(windowViewportRect, customScrollParent);
import_react2.default.useEffect(() => {
if (ctx) {
fixedItemHeight(ctx.itemHeight);
windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: 100 });
}
}, [ctx, windowViewportRect, fixedItemHeight]);
return /* @__PURE__ */ import_react2.default.createElement("div", { ref: viewportRef, style: viewportStyle, "data-viewport-type": "window" }, children);
};
var TopItemListContainer = ({ children }) => {
const TopItemList = useEmitterValue$2("TopItemListComponent");
const headerHeight = useEmitterValue$2("headerHeight");
const style = __spreadProps(__spreadValues({}, topItemListStyle), { marginTop: `${headerHeight}px` });
const context = useEmitterValue$2("context");
return import_react2.default.createElement(TopItemList || "div", { style, context }, children);
};
var ListRoot = /* @__PURE__ */ import_react2.default.memo(function VirtuosoRoot(props) {
const useWindowScroll = useEmitterValue$2("useWindowScroll");
const showTopList = useEmitterValue$2("topItemsIndexes").length > 0;
const customScrollParent = useEmitterValue$2("customScrollParent");
const TheScroller = customScrollParent || useWindowScroll ? WindowScroller$2 : Scroller$2;
const TheViewport = customScrollParent || useWindowScroll ? WindowViewport$2 : Viewport$2;
return /* @__PURE__ */ import_react2.default.createElement(TheScroller, __spreadValues({}, props), showTopList && /* @__PURE__ */ import_react2.default.createElement(TopItemListContainer, null, /* @__PURE__ */ import_react2.default.createElement(Items$1, { showTopList: true })), /* @__PURE__ */ import_react2.default.createElement(TheViewport, null, /* @__PURE__ */ import_react2.default.createElement(Header$1, null), /* @__PURE__ */ import_react2.default.createElement(Items$1, null), /* @__PURE__ */ import_react2.default.createElement(Footer$1, null)));
});
var {
Component: List,
usePublisher: usePublisher$2,
useEmitterValue: useEmitterValue$2,
useEmitter: useEmitter$2
} = /* @__PURE__ */ systemToComponent(
combinedSystem$2,
{
required: {},
optional: {
restoreStateFrom: "restoreStateFrom",
context: "context",
followOutput: "followOutput",
itemContent: "itemContent",
groupContent: "groupContent",
overscan: "overscan",
increaseViewportBy: "increaseViewportBy",
totalCount: "totalCount",
groupCounts: "groupCounts",
topItemCount: "topItemCount",
firstItemIndex: "firstItemIndex",
initialTopMostItemIndex: "initialTopMostItemIndex",
components: "components",
atBottomThreshold: "atBottomThreshold",
atTopThreshold: "atTopThreshold",
computeItemKey: "computeItemKey",
defaultItemHeight: "defaultItemHeight",
fixedItemHeight: "fixedItemHeight",
itemSize: "itemSize",
scrollSeekConfiguration: "scrollSeekConfiguration",
headerFooterTag: "headerFooterTag",
data: "data",
initialItemCount: "initialItemCount",
initialScrollTop: "initialScrollTop",
alignToBottom: "alignToBottom",
useWindowScroll: "useWindowScroll",
customScrollParent: "customScrollParent",
scrollerRef: "scrollerRef",
logLevel: "logLevel"
},
methods: {
scrollToIndex: "scrollToIndex",
scrollIntoView: "scrollIntoView",
scrollTo: "scrollTo",
scrollBy: "scrollBy",
autoscrollToBottom: "autoscrollToBottom",
getState: "getState"
},
events: {
isScrolling: "isScrolling",
endReached: "endReached",
startReached: "startReached",
rangeChanged: "rangeChanged",
atBottomStateChange: "atBottomStateChange",
atTopStateChange: "atTopStateChange",
totalListHeightChanged: "totalListHeightChanged",
itemsRendered: "itemsRendered",
groupIndices: "groupIndices"
}
},
ListRoot
);
var Scroller$2 = /* @__PURE__ */ buildScroller({ usePublisher: usePublisher$2, useEmitterValue: useEmitterValue$2, useEmitter: useEmitter$2 });
var WindowScroller$2 = /* @__PURE__ */ buildWindowScroller({ usePublisher: usePublisher$2, useEmitterValue: useEmitterValue$2, useEmitter: useEmitter$2 });
var INITIAL_GRID_STATE = {
items: [],
offsetBottom: 0,
offsetTop: 0,
top: 0,
bottom: 0,
itemHeight: 0,
itemWidth: 0
};
var PROBE_GRID_STATE = {
items: [{ index: 0 }],
offsetBottom: 0,
offsetTop: 0,
top: 0,
bottom: 0,
itemHeight: 0,
itemWidth: 0
};
var { round, ceil, floor, min, max } = Math;
function buildProbeGridState(items) {
return __spreadProps(__spreadValues({}, PROBE_GRID_STATE), {
items
});
}
function buildItems(startIndex, endIndex, data) {
return Array.from({ length: endIndex - startIndex + 1 }).map(
(_3, i2) => ({ index: i2 + startIndex, data: data == null ? void 0 : data[i2 + startIndex] })
);
}
function gapComparator(prev, next) {
return prev && prev.column === next.column && prev.row === next.row;
}
function dimensionComparator(prev, next) {
return prev && prev.width === next.width && prev.height === next.height;
}
var gridSystem = /* @__PURE__ */ system(
([
{ overscan, visibleRange, listBoundary },
{ scrollTop, viewportHeight, scrollBy, scrollTo, smoothScrollTargetReached, scrollContainerState, footerHeight, headerHeight },
stateFlags,
scrollSeek,
{ propsReady, didMount },
{ windowViewportRect, windowScrollTo, useWindowScroll, customScrollParent, windowScrollContainerState },
log2
]) => {
const totalCount = statefulStream(0);
const initialItemCount = statefulStream(0);
const gridState = statefulStream(INITIAL_GRID_STATE);
const viewportDimensions = statefulStream({ height: 0, width: 0 });
const itemDimensions = statefulStream({ height: 0, width: 0 });
const scrollToIndex = stream();
const scrollHeight = stream();
const deviation = statefulStream(0);
const data = statefulStream(void 0);
const gap = statefulStream({ row: 0, column: 0 });
connect(
pipe(
didMount,
withLatestFrom(initialItemCount, data),
filter(([didMount2, count]) => didMount2 && count !== 0),
map(([, count, data2]) => {
return {
items: buildItems(0, count - 1, data2),
top: 0,
bottom: 0,
offsetBottom: 0,
offsetTop: 0,
itemHeight: 0,
itemWidth: 0
};
})
),
gridState
);
connect(
pipe(
combineLatest(
duc(totalCount),
visibleRange,
duc(gap, gapComparator),
duc(itemDimensions, dimensionComparator),
duc(viewportDimensions, dimensionComparator),
data
),
map(([totalCount2, [startOffset, endOffset], gap2, item, viewport, data2]) => {
const { row: rowGap, column: columnGap } = gap2;
const { height: itemHeight, width: itemWidth } = item;
const { width: viewportWidth } = viewport;
if (totalCount2 === 0 || viewportWidth === 0) {
return INITIAL_GRID_STATE;
}
if (itemWidth === 0) {
return buildProbeGridState(buildItems(0, 0, data2));
}
const perRow = itemsPerRow(viewportWidth, itemWidth, columnGap);
let startIndex = perRow * floor((startOffset + rowGap) / (itemHeight + rowGap));
let endIndex = perRow * ceil((endOffset + rowGap) / (itemHeight + rowGap)) - 1;
endIndex = min(totalCount2 - 1, max(endIndex, perRow - 1));
startIndex = min(endIndex, max(0, startIndex));
const items = buildItems(startIndex, endIndex, data2);
const { top, bottom } = gridLayout(viewport, gap2, item, items);
const rowCount = ceil(totalCount2 / perRow);
const totalHeight = rowCount * itemHeight + (rowCount - 1) * rowGap;
const offsetBottom = totalHeight - bottom;
return { items, offsetTop: top, offsetBottom, top, bottom, itemHeight, itemWidth };
})
),
gridState
);
connect(
pipe(
data,
filter(isDefined),
map((data2) => data2.length)
),
totalCount
);
connect(
pipe(
viewportDimensions,
map(({ height }) => height)
),
viewportHeight
);
connect(
pipe(
combineLatest(viewportDimensions, itemDimensions, gridState, gap),
map(([viewportDimensions2, item, { items }, gap2]) => {
const { top, bottom } = gridLayout(viewportDimensions2, gap2, item, items);
return [top, bottom];
}),
distinctUntilChanged(tupleComparator)
),
listBoundary
);
const hasScrolled = statefulStream(false);
connect(
pipe(
scrollTop,
withLatestFrom(hasScrolled),
map(([scrollTop2, hasScrolled2]) => {
return hasScrolled2 || scrollTop2 !== 0;
})
),
hasScrolled
);
const endReached = streamFromEmitter(
pipe(
duc(gridState),
filter(({ items }) => items.length > 0),
withLatestFrom(totalCount, hasScrolled),
filter(([{ items }, totalCount2, hasScrolled2]) => hasScrolled2 && items[items.length - 1].index === totalCount2 - 1),
map(([, totalCount2]) => totalCount2 - 1),
distinctUntilChanged()
)
);
const startReached = streamFromEmitter(
pipe(
duc(gridState),
filter(({ items }) => {
return items.length > 0 && items[0].index === 0;
}),
mapTo(0),
distinctUntilChanged()
)
);
const rangeChanged = streamFromEmitter(
pipe(
duc(gridState),
filter(({ items }) => items.length > 0),
map(({ items }) => {
return {
startIndex: items[0].index,
endIndex: items[items.length - 1].index
};
}),
distinctUntilChanged(rangeComparator)
)
);
connect(rangeChanged, scrollSeek.scrollSeekRangeChanged);
connect(
pipe(
scrollToIndex,
withLatestFrom(viewportDimensions, itemDimensions, totalCount, gap),
map(([location, viewport, item, totalCount2, gap2]) => {
const normalLocation = normalizeIndexLocation(location);
const { align, behavior, offset } = normalLocation;
let index = normalLocation.index;
if (index === "LAST") {
index = totalCount2 - 1;
}
index = max(0, index, min(totalCount2 - 1, index));
let top = itemTop(viewport, gap2, item, index);
if (align === "end") {
top = round(top - viewport.height + item.height);
} else if (align === "center") {
top = round(top - viewport.height / 2 + item.height / 2);
}
if (offset) {
top += offset;
}
return { top, behavior };
})
),
scrollTo
);
const totalListHeight = statefulStreamFromEmitter(
pipe(
gridState,
map((gridState2) => {
return gridState2.offsetBottom + gridState2.bottom;
})
),
0
);
connect(
pipe(
windowViewportRect,
map((viewportInfo) => ({ width: viewportInfo.visibleWidth, height: viewportInfo.visibleHeight }))
),
viewportDimensions
);
return __spreadValues(__spreadProps(__spreadValues(__spreadProps(__spreadValues({
data,
totalCount,
viewportDimensions,
itemDimensions,
scrollTop,
scrollHeight,
overscan,
scrollBy,
scrollTo,
scrollToIndex,
smoothScrollTargetReached,
windowViewportRect,
windowScrollTo,
useWindowScroll,
customScrollParent,
windowScrollContainerState,
deviation,
scrollContainerState,
footerHeight,
headerHeight,
initialItemCount,
gap
}, scrollSeek), {
gridState,
totalListHeight
}), stateFlags), {
startReached,
endReached,
rangeChanged,
propsReady
}), log2);
},
tup(sizeRangeSystem, domIOSystem, stateFlagsSystem, scrollSeekSystem, propsReadySystem, windowScrollerSystem, loggerSystem)
);
function gridLayout(viewport, gap, item, items) {
const { height: itemHeight } = item;
if (itemHeight === void 0 || items.length === 0) {
return { top: 0, bottom: 0 };
}
const top = itemTop(viewport, gap, item, items[0].index);
const bottom = itemTop(viewport, gap, item, items[items.length - 1].index) + itemHeight;
return { top, bottom };
}
function itemTop(viewport, gap, item, index) {
const perRow = itemsPerRow(viewport.width, item.width, gap.column);
const rowCount = floor(index / perRow);
const top = rowCount * item.height + max(0, rowCount - 1) * gap.row;
return top > 0 ? top + gap.row : top;
}
function itemsPerRow(viewportWidth, itemWidth, gap) {
return max(1, floor((viewportWidth + gap) / (floor(itemWidth) + gap)));
}
var gridComponentPropsSystem = /* @__PURE__ */ system(() => {
const itemContent = statefulStream((index) => `Item ${index}`);
const components = statefulStream({});
const context = statefulStream(null);
const itemClassName = statefulStream("virtuoso-grid-item");
const listClassName = statefulStream("virtuoso-grid-list");
const computeItemKey = statefulStream(identity);
const headerFooterTag = statefulStream("div");
const scrollerRef = statefulStream(noop);
const distinctProp = (propName, defaultValue = null) => {
return statefulStreamFromEmitter(
pipe(
components,
map((components2) => components2[propName]),
distinctUntilChanged()
),
defaultValue
);
};
return {
context,
itemContent,
components,
computeItemKey,
itemClassName,
listClassName,
headerFooterTag,
scrollerRef,
FooterComponent: distinctProp("Footer"),
HeaderComponent: distinctProp("Header"),
ListComponent: distinctProp("List", "div"),
ItemComponent: distinctProp("Item", "div"),
ScrollerComponent: distinctProp("Scroller", "div"),
ScrollSeekPlaceholder: distinctProp("ScrollSeekPlaceholder", "div")
};
});
var combinedSystem$1 = /* @__PURE__ */ system(([gridSystem2, gridComponentPropsSystem2]) => {
return __spreadValues(__spreadValues({}, gridSystem2), gridComponentPropsSystem2);
}, tup(gridSystem, gridComponentPropsSystem));
var GridItems = /* @__PURE__ */ import_react2.default.memo(function GridItems2() {
const gridState = useEmitterValue$1("gridState");
const listClassName = useEmitterValue$1("listClassName");
const itemClassName = useEmitterValue$1("itemClassName");
const itemContent = useEmitterValue$1("itemContent");
const computeItemKey = useEmitterValue$1("computeItemKey");
const isSeeking = useEmitterValue$1("isSeeking");
const scrollHeightCallback = usePublisher$1("scrollHeight");
const ItemComponent = useEmitterValue$1("ItemComponent");
const ListComponent = useEmitterValue$1("ListComponent");
const ScrollSeekPlaceholder = useEmitterValue$1("ScrollSeekPlaceholder");
const context = useEmitterValue$1("context");
const itemDimensions = usePublisher$1("itemDimensions");
const gridGap = usePublisher$1("gap");
const log2 = useEmitterValue$1("log");
const listRef = useSize((el) => {
const scrollHeight = el.parentElement.parentElement.scrollHeight;
scrollHeightCallback(scrollHeight);
const firstItem = el.firstChild;
if (firstItem) {
itemDimensions(firstItem.getBoundingClientRect());
}
gridGap({
row: resolveGapValue("row-gap", getComputedStyle(el).rowGap, log2),
column: resolveGapValue("column-gap", getComputedStyle(el).columnGap, log2)
});
});
return import_react2.default.createElement(
ListComponent,
__spreadProps(__spreadValues({
ref: listRef,
className: listClassName
}, contextPropIfNotDomElement(ListComponent, context)), {
style: { paddingTop: gridState.offsetTop, paddingBottom: gridState.offsetBottom },
"data-test-id": "virtuoso-item-list"
}),
gridState.items.map((item) => {
const key = computeItemKey(item.index, item.data, context);
return isSeeking ? import_react2.default.createElement(ScrollSeekPlaceholder, __spreadProps(__spreadValues({
key
}, contextPropIfNotDomElement(ScrollSeekPlaceholder, context)), {
index: item.index,
height: gridState.itemHeight,
width: gridState.itemWidth
})) : import_react2.default.createElement(
ItemComponent,
__spreadProps(__spreadValues({}, contextPropIfNotDomElement(ItemComponent, context)), { className: itemClassName, "data-index": item.index, key }),
itemContent(item.index, item.data, context)
);
})
);
});
var Header = import_react2.default.memo(function VirtuosoHeader2() {
const Header2 = useEmitterValue$1("HeaderComponent");
const headerHeight = usePublisher$1("headerHeight");
const headerFooterTag = useEmitterValue$1("headerFooterTag");
const ref = useSize((el) => headerHeight(correctItemSize(el, "height")));
const context = useEmitterValue$1("context");
return Header2 ? import_react2.default.createElement(headerFooterTag, { ref }, import_react2.default.createElement(Header2, contextPropIfNotDomElement(Header2, context))) : null;
});
var Footer = import_react2.default.memo(function VirtuosoGridFooter() {
const Footer2 = useEmitterValue$1("FooterComponent");
const footerHeight = usePublisher$1("footerHeight");
const headerFooterTag = useEmitterValue$1("headerFooterTag");
const ref = useSize((el) => footerHeight(correctItemSize(el, "height")));
const context = useEmitterValue$1("context");
return Footer2 ? import_react2.default.createElement(headerFooterTag, { ref }, import_react2.default.createElement(Footer2, contextPropIfNotDomElement(Footer2, context))) : null;
});
var Viewport$1 = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoGridMockContext);
const itemDimensions = usePublisher$1("itemDimensions");
const viewportDimensions = usePublisher$1("viewportDimensions");
const viewportRef = useSize((el) => {
viewportDimensions(el.getBoundingClientRect());
});
import_react2.default.useEffect(() => {
if (ctx) {
viewportDimensions({ height: ctx.viewportHeight, width: ctx.viewportWidth });
itemDimensions({ height: ctx.itemHeight, width: ctx.itemWidth });
}
}, [ctx, viewportDimensions, itemDimensions]);
return /* @__PURE__ */ import_react2.default.createElement("div", { style: viewportStyle, ref: viewportRef }, children);
};
var WindowViewport$1 = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoGridMockContext);
const windowViewportRect = usePublisher$1("windowViewportRect");
const itemDimensions = usePublisher$1("itemDimensions");
const customScrollParent = useEmitterValue$1("customScrollParent");
const viewportRef = useWindowViewportRectRef(windowViewportRect, customScrollParent);
import_react2.default.useEffect(() => {
if (ctx) {
itemDimensions({ height: ctx.itemHeight, width: ctx.itemWidth });
windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: ctx.viewportWidth });
}
}, [ctx, windowViewportRect, itemDimensions]);
return /* @__PURE__ */ import_react2.default.createElement("div", { ref: viewportRef, style: viewportStyle }, children);
};
var GridRoot = /* @__PURE__ */ import_react2.default.memo(function GridRoot2(_a) {
var props = __objRest(_a, []);
const useWindowScroll = useEmitterValue$1("useWindowScroll");
const customScrollParent = useEmitterValue$1("customScrollParent");
const TheScroller = customScrollParent || useWindowScroll ? WindowScroller$1 : Scroller$1;
const TheViewport = customScrollParent || useWindowScroll ? WindowViewport$1 : Viewport$1;
return /* @__PURE__ */ import_react2.default.createElement(TheScroller, __spreadValues({}, props), /* @__PURE__ */ import_react2.default.createElement(TheViewport, null, /* @__PURE__ */ import_react2.default.createElement(Header, null), /* @__PURE__ */ import_react2.default.createElement(GridItems, null), /* @__PURE__ */ import_react2.default.createElement(Footer, null)));
});
var {
Component: Grid,
usePublisher: usePublisher$1,
useEmitterValue: useEmitterValue$1,
useEmitter: useEmitter$1
} = /* @__PURE__ */ systemToComponent(
combinedSystem$1,
{
optional: {
context: "context",
totalCount: "totalCount",
overscan: "overscan",
itemContent: "itemContent",
components: "components",
computeItemKey: "computeItemKey",
data: "data",
initialItemCount: "initialItemCount",
scrollSeekConfiguration: "scrollSeekConfiguration",
headerFooterTag: "headerFooterTag",
listClassName: "listClassName",
itemClassName: "itemClassName",
useWindowScroll: "useWindowScroll",
customScrollParent: "customScrollParent",
scrollerRef: "scrollerRef"
},
methods: {
scrollTo: "scrollTo",
scrollBy: "scrollBy",
scrollToIndex: "scrollToIndex"
},
events: {
isScrolling: "isScrolling",
endReached: "endReached",
startReached: "startReached",
rangeChanged: "rangeChanged",
atBottomStateChange: "atBottomStateChange",
atTopStateChange: "atTopStateChange"
}
},
GridRoot
);
var Scroller$1 = /* @__PURE__ */ buildScroller({ usePublisher: usePublisher$1, useEmitterValue: useEmitterValue$1, useEmitter: useEmitter$1 });
var WindowScroller$1 = /* @__PURE__ */ buildWindowScroller({ usePublisher: usePublisher$1, useEmitterValue: useEmitterValue$1, useEmitter: useEmitter$1 });
function resolveGapValue(property, value, log2) {
if (value !== "normal" && !(value == null ? void 0 : value.endsWith("px"))) {
log2(`${property} was not resolved to pixel value correctly`, value, LogLevel.WARN);
}
if (value === "normal") {
return 0;
}
return parseInt(value != null ? value : "0", 10);
}
var tableComponentPropsSystem = /* @__PURE__ */ system(() => {
const itemContent = statefulStream((index) => /* @__PURE__ */ import_react2.default.createElement("td", null, "Item $", index));
const context = statefulStream(null);
const fixedHeaderContent = statefulStream(null);
const fixedFooterContent = statefulStream(null);
const components = statefulStream({});
const computeItemKey = statefulStream(identity);
const scrollerRef = statefulStream(noop);
const distinctProp = (propName, defaultValue = null) => {
return statefulStreamFromEmitter(
pipe(
components,
map((components2) => components2[propName]),
distinctUntilChanged()
),
defaultValue
);
};
return {
context,
itemContent,
fixedHeaderContent,
fixedFooterContent,
components,
computeItemKey,
scrollerRef,
TableComponent: distinctProp("Table", "table"),
TableHeadComponent: distinctProp("TableHead", "thead"),
TableFooterComponent: distinctProp("TableFoot", "tfoot"),
TableBodyComponent: distinctProp("TableBody", "tbody"),
TableRowComponent: distinctProp("TableRow", "tr"),
ScrollerComponent: distinctProp("Scroller", "div"),
EmptyPlaceholder: distinctProp("EmptyPlaceholder"),
ScrollSeekPlaceholder: distinctProp("ScrollSeekPlaceholder"),
FillerRow: distinctProp("FillerRow")
};
});
var combinedSystem = /* @__PURE__ */ system(([listSystem2, propsSystem]) => {
return __spreadValues(__spreadValues({}, listSystem2), propsSystem);
}, tup(listSystem, tableComponentPropsSystem));
var DefaultScrollSeekPlaceholder = ({ height }) => /* @__PURE__ */ import_react2.default.createElement("tr", null, /* @__PURE__ */ import_react2.default.createElement("td", { style: { height } }));
var DefaultFillerRow = ({ height }) => /* @__PURE__ */ import_react2.default.createElement("tr", null, /* @__PURE__ */ import_react2.default.createElement("td", { style: { height, padding: 0, border: 0 } }));
var Items = /* @__PURE__ */ import_react2.default.memo(function VirtuosoItems2() {
const listState = useEmitterValue("listState");
const sizeRanges = usePublisher("sizeRanges");
const useWindowScroll = useEmitterValue("useWindowScroll");
const customScrollParent = useEmitterValue("customScrollParent");
const windowScrollContainerStateCallback = usePublisher("windowScrollContainerState");
const _scrollContainerStateCallback = usePublisher("scrollContainerState");
const scrollContainerStateCallback = customScrollParent || useWindowScroll ? windowScrollContainerStateCallback : _scrollContainerStateCallback;
const itemContent = useEmitterValue("itemContent");
const trackItemSizes = useEmitterValue("trackItemSizes");
const itemSize = useEmitterValue("itemSize");
const log2 = useEmitterValue("log");
const { callbackRef, ref } = useChangedListContentsSizes(
sizeRanges,
itemSize,
trackItemSizes,
scrollContainerStateCallback,
log2,
void 0,
customScrollParent
);
const [deviation, setDeviation] = import_react2.default.useState(0);
useEmitter("deviation", (value) => {
if (deviation !== value) {
ref.current.style.marginTop = `${value}px`;
setDeviation(value);
}
});
const EmptyPlaceholder = useEmitterValue("EmptyPlaceholder");
const ScrollSeekPlaceholder = useEmitterValue("ScrollSeekPlaceholder") || DefaultScrollSeekPlaceholder;
const FillerRow = useEmitterValue("FillerRow") || DefaultFillerRow;
const TableBodyComponent = useEmitterValue("TableBodyComponent");
const TableRowComponent = useEmitterValue("TableRowComponent");
const computeItemKey = useEmitterValue("computeItemKey");
const isSeeking = useEmitterValue("isSeeking");
const paddingTopAddition = useEmitterValue("paddingTopAddition");
const firstItemIndex = useEmitterValue("firstItemIndex");
const statefulTotalCount = useEmitterValue("statefulTotalCount");
const context = useEmitterValue("context");
if (statefulTotalCount === 0 && EmptyPlaceholder) {
return import_react2.default.createElement(EmptyPlaceholder, contextPropIfNotDomElement(EmptyPlaceholder, context));
}
const paddingTop = listState.offsetTop + paddingTopAddition + deviation;
const paddingBottom = listState.offsetBottom;
const paddingTopEl = paddingTop > 0 ? /* @__PURE__ */ import_react2.default.createElement(FillerRow, { height: paddingTop, key: "padding-top", context }) : null;
const paddingBottomEl = paddingBottom > 0 ? /* @__PURE__ */ import_react2.default.createElement(FillerRow, { height: paddingBottom, key: "padding-bottom", context }) : null;
const items = listState.items.map((item) => {
const index = item.originalIndex;
const key = computeItemKey(index + firstItemIndex, item.data, context);
if (isSeeking) {
return import_react2.default.createElement(ScrollSeekPlaceholder, __spreadProps(__spreadValues({}, contextPropIfNotDomElement(ScrollSeekPlaceholder, context)), {
key,
index: item.index,
height: item.size,
type: item.type || "item"
}));
}
return import_react2.default.createElement(
TableRowComponent,
__spreadProps(__spreadValues({}, contextPropIfNotDomElement(TableRowComponent, context)), {
key,
"data-index": index,
"data-known-size": item.size,
"data-item-index": item.index,
item: item.data,
style: { overflowAnchor: "none" }
}),
itemContent(item.index, item.data, context)
);
});
return import_react2.default.createElement(
TableBodyComponent,
__spreadValues({ ref: callbackRef, "data-test-id": "virtuoso-item-list" }, contextPropIfNotDomElement(TableBodyComponent, context)),
[paddingTopEl, ...items, paddingBottomEl]
);
});
var Viewport = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoMockContext);
const viewportHeight = usePublisher("viewportHeight");
const fixedItemHeight = usePublisher("fixedItemHeight");
const viewportRef = useSize(compose2(viewportHeight, (el) => correctItemSize(el, "height")));
import_react2.default.useEffect(() => {
if (ctx) {
viewportHeight(ctx.viewportHeight);
fixedItemHeight(ctx.itemHeight);
}
}, [ctx, viewportHeight, fixedItemHeight]);
return /* @__PURE__ */ import_react2.default.createElement("div", { style: viewportStyle, ref: viewportRef, "data-viewport-type": "element" }, children);
};
var WindowViewport = ({ children }) => {
const ctx = import_react2.default.useContext(VirtuosoMockContext);
const windowViewportRect = usePublisher("windowViewportRect");
const fixedItemHeight = usePublisher("fixedItemHeight");
const customScrollParent = useEmitterValue("customScrollParent");
const viewportRef = useWindowViewportRectRef(windowViewportRect, customScrollParent);
import_react2.default.useEffect(() => {
if (ctx) {
fixedItemHeight(ctx.itemHeight);
windowViewportRect({ offsetTop: 0, visibleHeight: ctx.viewportHeight, visibleWidth: 100 });
}
}, [ctx, windowViewportRect, fixedItemHeight]);
return /* @__PURE__ */ import_react2.default.createElement("div", { ref: viewportRef, style: viewportStyle, "data-viewport-type": "window" }, children);
};
var TableRoot = /* @__PURE__ */ import_react2.default.memo(function TableVirtuosoRoot(props) {
const useWindowScroll = useEmitterValue("useWindowScroll");
const customScrollParent = useEmitterValue("customScrollParent");
const fixedHeaderHeight = usePublisher("fixedHeaderHeight");
const fixedFooterHeight = usePublisher("fixedFooterHeight");
const fixedHeaderContent = useEmitterValue("fixedHeaderContent");
const fixedFooterContent = useEmitterValue("fixedFooterContent");
const context = useEmitterValue("context");
const theadRef = useSize(compose2(fixedHeaderHeight, (el) => correctItemSize(el, "height")));
const tfootRef = useSize(compose2(fixedFooterHeight, (el) => correctItemSize(el, "height")));
const TheScroller = customScrollParent || useWindowScroll ? WindowScroller : Scroller;
const TheViewport = customScrollParent || useWindowScroll ? WindowViewport : Viewport;
const TheTable = useEmitterValue("TableComponent");
const TheTHead = useEmitterValue("TableHeadComponent");
const TheTFoot = useEmitterValue("TableFooterComponent");
const theHead = fixedHeaderContent ? import_react2.default.createElement(
TheTHead,
__spreadValues({
key: "TableHead",
style: { zIndex: 1, position: "sticky", top: 0 },
ref: theadRef
}, contextPropIfNotDomElement(TheTHead, context)),
fixedHeaderContent()
) : null;
const theFoot = fixedFooterContent ? import_react2.default.createElement(
TheTFoot,
__spreadValues({
key: "TableFoot",
style: { zIndex: 1, position: "sticky", bottom: 0 },
ref: tfootRef
}, contextPropIfNotDomElement(TheTFoot, context)),
fixedFooterContent()
) : null;
return /* @__PURE__ */ import_react2.default.createElement(TheScroller, __spreadValues({}, props), /* @__PURE__ */ import_react2.default.createElement(TheViewport, null, import_react2.default.createElement(TheTable, __spreadValues({ style: { borderSpacing: 0 } }, contextPropIfNotDomElement(TheTable, context)), [
theHead,
/* @__PURE__ */ import_react2.default.createElement(Items, { key: "TableBody" }),
theFoot
])));
});
var {
Component: Table,
usePublisher,
useEmitterValue,
useEmitter
} = /* @__PURE__ */ systemToComponent(
combinedSystem,
{
required: {},
optional: {
context: "context",
followOutput: "followOutput",
firstItemIndex: "firstItemIndex",
itemContent: "itemContent",
fixedHeaderContent: "fixedHeaderContent",
fixedFooterContent: "fixedFooterContent",
overscan: "overscan",
increaseViewportBy: "increaseViewportBy",
totalCount: "totalCount",
topItemCount: "topItemCount",
initialTopMostItemIndex: "initialTopMostItemIndex",
components: "components",
groupCounts: "groupCounts",
atBottomThreshold: "atBottomThreshold",
atTopThreshold: "atTopThreshold",
computeItemKey: "computeItemKey",
defaultItemHeight: "defaultItemHeight",
fixedItemHeight: "fixedItemHeight",
itemSize: "itemSize",
scrollSeekConfiguration: "scrollSeekConfiguration",
data: "data",
initialItemCount: "initialItemCount",
initialScrollTop: "initialScrollTop",
alignToBottom: "alignToBottom",
useWindowScroll: "useWindowScroll",
customScrollParent: "customScrollParent",
scrollerRef: "scrollerRef",
logLevel: "logLevel"
},
methods: {
scrollToIndex: "scrollToIndex",
scrollIntoView: "scrollIntoView",
scrollTo: "scrollTo",
scrollBy: "scrollBy"
},
events: {
isScrolling: "isScrolling",
endReached: "endReached",
startReached: "startReached",
rangeChanged: "rangeChanged",
atBottomStateChange: "atBottomStateChange",
atTopStateChange: "atTopStateChange",
totalListHeightChanged: "totalListHeightChanged",
itemsRendered: "itemsRendered",
groupIndices: "groupIndices"
}
},
TableRoot
);
var Scroller = /* @__PURE__ */ buildScroller({ usePublisher, useEmitterValue, useEmitter });
var WindowScroller = /* @__PURE__ */ buildWindowScroller({ usePublisher, useEmitterValue, useEmitter });
var TableVirtuoso = Table;
// src/shared/table-state/table-state-context.tsx
var import_react11 = __toESM(require_react());
// src/shared/logger.ts
var import_react10 = __toESM(require_react());
// 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_is = __toESM(require_react_is2());
// node_modules/react-redux/es/utils/Subscription.js
function createListenerCollection() {
const batch2 = getBatch();
let first = null;
let last2 = null;
return {
clear() {
first = null;
last2 = 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 = last2 = {
callback,
next: null,
prev: last2
};
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 {
last2 = 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 useIsomorphicLayoutEffect2 = 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]);
useIsomorphicLayoutEffect2(() => {
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());
// node_modules/react-redux/es/index.js
initializeUseSelector(import_with_selector.useSyncExternalStoreWithSelector);
initializeConnect(import_shim.useSyncExternalStore);
setBatch(import_react_dom2.unstable_batchedUpdates);
// src/redux/global/hooks.ts
var useAppSelector = useSelector;
// src/shared/logger.ts
var log = (shouldDebug) => (message, args = {}) => {
if (shouldDebug) {
console.log(message);
if (Object.keys(args).length !== 0)
console.log(args);
}
};
var useLogger = () => {
const { shouldDebug } = useAppSelector((state) => state.global);
const logger = import_react10.default.useCallback(
(message, args) => log(shouldDebug)(message, args),
[shouldDebug]
);
return logger;
};
// src/shared/table-state/table-error.ts
var ColumNotFoundError = class extends Error {
constructor(id2) {
super(`Column ${id2} was not found`);
this.name = "ColumNotFoundError";
}
};
var TagNotFoundError = class extends Error {
constructor(id2) {
super(`Tag ${id2} was not found`);
this.name = "TagNotFoundError";
}
};
var RowNotFoundError = class extends Error {
constructor(id2) {
super(`Row ${id2} was not found`);
this.name = "RowNotFoundError";
}
};
var CellNotFoundError = class extends Error {
constructor(options) {
const { id: id2, rowId, columnId } = options || {};
if (rowId || columnId)
super(`Cell ${rowId}:${columnId} was not found`);
super(`Cell ${id2} was not found`);
this.name = "CellNotFoundError";
}
};
// src/shared/commands/command-errors.ts
var CommandUndoError = class extends Error {
constructor() {
super(`execute() must be called before undo() is available`);
this.name = "CommandUndoError";
}
};
var CommandRedoError = class extends Error {
constructor() {
super(`undo() must be called before redo() is available`);
this.name = "CommandRedoError";
}
};
var DeleteCommandArgumentsError = class extends Error {
constructor() {
super(`Either 'id' or 'last' must be defined`);
this.name = "DeleteCommandArgumentsError";
}
};
// src/shared/table-state/table-state-command.ts
var TableStateCommand = class {
constructor(shouldSortRows = false) {
__publicField(this, "shouldSortRows");
__publicField(this, "hasExecuteBeenCalled");
__publicField(this, "hasUndoBeenCalled");
this.hasExecuteBeenCalled = false;
this.hasUndoBeenCalled = false;
this.shouldSortRows = shouldSortRows;
}
onExecute() {
this.hasExecuteBeenCalled = true;
}
onRedo() {
if (!this.hasUndoBeenCalled)
throw new CommandRedoError();
this.hasUndoBeenCalled = false;
}
onUndo() {
if (!this.hasExecuteBeenCalled)
throw new CommandUndoError();
this.hasUndoBeenCalled = true;
}
};
// src/shared/types/index.ts
var Color = /* @__PURE__ */ ((Color2) => {
Color2["LIGHT_GRAY"] = "light gray";
Color2["GRAY"] = "gray";
Color2["BROWN"] = "brown";
Color2["ORANGE"] = "orange";
Color2["YELLOW"] = "yellow";
Color2["GREEN"] = "green";
Color2["BLUE"] = "blue";
Color2["PURPLE"] = "purple";
Color2["PINK"] = "pink";
Color2["RED"] = "red";
return Color2;
})(Color || {});
var PaddingSize = /* @__PURE__ */ ((PaddingSize5) => {
PaddingSize5["SM"] = "sm";
PaddingSize5["MD"] = "md";
PaddingSize5["LG"] = "lg";
PaddingSize5["XL"] = "xl";
PaddingSize5["XXL"] = "2xl";
PaddingSize5["XXXL"] = "3xl";
PaddingSize5["XXXXL"] = "4xl";
PaddingSize5["UNSET"] = "unset";
return PaddingSize5;
})(PaddingSize || {});
var CellType = /* @__PURE__ */ ((CellType5) => {
CellType5["TEXT"] = "text";
CellType5["EMBED"] = "embed";
CellType5["FILE"] = "file";
CellType5["NUMBER"] = "number";
CellType5["CURRENCY"] = "currency";
CellType5["TAG"] = "tag";
CellType5["MULTI_TAG"] = "multi-tag";
CellType5["DATE"] = "date";
CellType5["CHECKBOX"] = "checkbox";
CellType5["CREATION_TIME"] = "creation-time";
CellType5["LAST_EDITED_TIME"] = "last-edited-time";
return CellType5;
})(CellType || {});
var DateFormat = /* @__PURE__ */ ((DateFormat9) => {
DateFormat9["MM_DD_YYYY"] = "mm/dd/yyyy";
DateFormat9["DD_MM_YYYY"] = "dd/mm/yyyy";
DateFormat9["YYYY_MM_DD"] = "yyyy/mm/dd";
DateFormat9["FULL"] = "full";
DateFormat9["RELATIVE"] = "relative";
return DateFormat9;
})(DateFormat || {});
var CurrencyType = /* @__PURE__ */ ((CurrencyType9) => {
CurrencyType9["UNITED_STATES"] = "USD";
CurrencyType9["CANADA"] = "CAD";
CurrencyType9["SINGAPORE"] = "SGB";
CurrencyType9["EUROPE"] = "EUR";
CurrencyType9["SWEDEN"] = "SEK";
CurrencyType9["DENMARK"] = "DKK";
CurrencyType9["NORWAY"] = "NOK";
CurrencyType9["ICELAND"] = "ISK";
CurrencyType9["POUND"] = "GBP";
CurrencyType9["RUSSIA"] = "RUB";
CurrencyType9["AUSTRALIA"] = "AUD";
CurrencyType9["JAPAN"] = "JPY";
CurrencyType9["INDIA"] = "INR";
CurrencyType9["CHINA"] = "CNY";
CurrencyType9["BRAZIL"] = "BRL";
CurrencyType9["COLOMBIA"] = "COP";
CurrencyType9["MEXICO"] = "MXN";
CurrencyType9["ARGENTINA"] = "ARS";
return CurrencyType9;
})(CurrencyType || {});
var GeneralFunction = /* @__PURE__ */ ((GeneralFunction3) => {
GeneralFunction3["NONE"] = "none";
GeneralFunction3["COUNT_ALL"] = "count-all";
GeneralFunction3["COUNT_VALUES"] = "count-values";
GeneralFunction3["COUNT_UNIQUE"] = "count-unique";
GeneralFunction3["COUNT_EMPTY"] = "count-empty";
GeneralFunction3["COUNT_NOT_EMPTY"] = "count-not-empty";
GeneralFunction3["PERCENT_EMPTY"] = "percent-empty";
GeneralFunction3["PERCENT_NOT_EMPTY"] = "percent-not-empty";
return GeneralFunction3;
})(GeneralFunction || {});
var NumberFunction = /* @__PURE__ */ ((NumberFunction2) => {
NumberFunction2["SUM"] = "sum";
NumberFunction2["AVG"] = "avg";
NumberFunction2["MIN"] = "min";
NumberFunction2["MAX"] = "max";
NumberFunction2["MEDIAN"] = "median";
NumberFunction2["RANGE"] = "range";
return NumberFunction2;
})(NumberFunction || {});
var AspectRatio = /* @__PURE__ */ ((AspectRatio5) => {
AspectRatio5["ONE_BY_ONE"] = "1/1";
AspectRatio5["NINE_BY_SIXTEEN"] = "9/16";
AspectRatio5["FOUR_BY_THREE"] = "4/3";
AspectRatio5["SIXTEEN_BY_NINE"] = "16/9";
return AspectRatio5;
})(AspectRatio || {});
// src/shared/regex.ts
var NUMBER_REGEX = new RegExp(/^-?\d+\.?\d*$/);
var NUMBER_INPUT_REGEX = new RegExp(/(^$)|(^-$)|(^-?\d+\.?\d*$)/);
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 URL_REGEX = new RegExp(
/^https?:\/\/(www\.)?[\w.-]+\.[\w.-]+(\/[\w.-]+)*(\/?(\?[\w.-]+=[\w.-]+(&[\w.-]+=[\w.-]+)*)?)?$/i
);
// src/shared/validators.ts
var isNumber = (input) => {
return input.match(NUMBER_REGEX) !== null;
};
var isValidNumberInput = (input) => {
return input.match(NUMBER_INPUT_REGEX) !== null;
};
var isCheckbox = (input) => {
return input.match(CHECKBOX_REGEX) !== null;
};
var isCheckboxChecked = (input) => {
return input.match(CHECKBOX_CHECKED_REGEX) !== null;
};
var isURL = (input) => {
return input.match(URL_REGEX) !== null;
};
var isGeneralFunction = (value) => {
return Object.values(GeneralFunction).includes(value);
};
var isNumberFunction = (value) => {
return Object.values(NumberFunction).includes(value);
};
// src/shared/commands/row-sort-command.ts
var RowSortCommand = class extends TableStateCommand {
constructor() {
super(...arguments);
__publicField(this, "previousRowSort", []);
}
sortByTag(columnId, columns, rows, cells, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
const cellA = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === a2.id
);
if (!cellA)
throw new CellNotFoundError({ rowId: a2.id, columnId });
const cellB = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === b2.id
);
if (!cellB)
throw new CellNotFoundError({ rowId: b2.id, columnId });
const column = columns.find((c2) => c2.id === columnId);
if (!column)
throw new ColumNotFoundError(columnId);
if (cellA.tagIds.length === 0 && cellB.tagIds.length > 0)
return 1;
if (cellA.tagIds.length > 0 && cellB.tagIds.length === 0)
return -1;
if (cellA.tagIds.length === 0 && cellB.tagIds.length === 0)
return 0;
let tagLength = cellA.tagIds.length;
if (cellB.tagIds.length > cellA.tagIds.length) {
tagLength = cellB.tagIds.length;
}
for (let i2 = 0; i2 < tagLength; i2++) {
const tagIdA = cellA.tagIds[i2];
if (tagIdA === void 0)
return -1;
const tagA = column.tags.find((t2) => t2.id === tagIdA);
if (!tagA)
throw new TagNotFoundError(tagIdA);
const tagIdB = cellB.tagIds[i2];
if (tagIdB === void 0)
return 1;
const tagB = column.tags.find((t2) => t2.id === tagIdB);
if (!tagB)
throw new TagNotFoundError(tagIdA);
if (sortDir === "asc" /* ASC */) {
const result = tagA.markdown.localeCompare(tagB.markdown);
if (result !== 0)
return result;
} else if (sortDir === "desc" /* DESC */) {
const result = tagB.markdown.localeCompare(tagA.markdown);
if (result !== 0)
return result;
}
}
return 0;
});
return newRows;
}
sortByMarkdown(columnId, rows, cells, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
const cellA = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === a2.id
);
if (!cellA)
throw new CellNotFoundError({
rowId: a2.id,
columnId
});
const cellB = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === b2.id
);
if (!cellB)
throw new CellNotFoundError({
rowId: b2.id,
columnId
});
const markdownA = cellA.markdown;
const markdownB = cellB.markdown;
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);
} else {
return 0;
}
});
return newRows;
}
sortByNumber(columnId, rows, cells, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
const cellA = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === a2.id
);
if (!cellA)
throw new CellNotFoundError({
rowId: a2.id,
columnId
});
const cellB = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === b2.id
);
if (!cellB)
throw new CellNotFoundError({
rowId: b2.id,
columnId
});
const markdownA = cellA.markdown;
const markdownB = cellB.markdown;
if (markdownA === "" && markdownB !== "")
return 1;
if (markdownA !== "" && markdownB === "")
return -1;
if (markdownA === "" && markdownB === "")
return 0;
if (sortDir === "asc" /* ASC */) {
return parseFloat(markdownA) - parseFloat(markdownB);
} else if (sortDir === "desc" /* DESC */) {
return parseFloat(markdownB) - parseFloat(markdownA);
} else {
return 0;
}
});
return newRows;
}
sortByCheckbox(columnId, rows, cells, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
const cellA = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === a2.id
);
if (!cellA)
throw new CellNotFoundError({
rowId: a2.id,
columnId
});
const cellB = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === b2.id
);
if (!cellB)
throw new CellNotFoundError({
rowId: b2.id,
columnId
});
const isCheckedA = isCheckboxChecked(cellA.markdown);
const isCheckedB = isCheckboxChecked(cellB.markdown);
if (sortDir === "asc" /* ASC */) {
if (isCheckedA && !isCheckedB)
return 1;
if (!isCheckedA && isCheckedB)
return -1;
return 0;
} else if (sortDir === "desc" /* DESC */) {
if (!isCheckedA && isCheckedB)
return 1;
if (isCheckedA && !isCheckedB)
return -1;
return 0;
} else {
return 0;
}
});
return newRows;
}
sortByDate(columnId, rows, cells, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
const cellA = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === a2.id
);
if (!cellA)
throw new CellNotFoundError({
rowId: a2.id,
columnId
});
const cellB = cells.find(
(c2) => c2.columnId === columnId && c2.rowId === b2.id
);
if (!cellB)
throw new CellNotFoundError({
rowId: b2.id,
columnId
});
const dateTimeA = cellA.dateTime || 0;
const dateTimeB = cellB.dateTime || 0;
if (sortDir === "asc" /* ASC */) {
return dateTimeA - dateTimeB;
} else if (sortDir === "desc" /* DESC */) {
return dateTimeB - dateTimeA;
} else {
return 0;
}
});
return newRows;
}
sortByCreationTime(rows, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
if (sortDir === "asc" /* ASC */) {
return a2.creationTime - b2.creationTime;
} else if (sortDir === "desc" /* DESC */) {
return b2.creationTime - a2.creationTime;
} else {
return 0;
}
});
return newRows;
}
sortByLastEditedTime(rows, sortDir) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
if (sortDir === "asc" /* ASC */) {
return a2.lastEditedTime - b2.lastEditedTime;
} else if (sortDir === "desc" /* DESC */) {
return b2.lastEditedTime - a2.lastEditedTime;
} else {
return 0;
}
});
return newRows;
}
sortByDir(columnId, columnType, sortDir, columns, rows, cells) {
if (columnType === "number" /* NUMBER */ || columnType === "currency" /* CURRENCY */) {
return this.sortByNumber(columnId, rows, cells, sortDir);
} else if (columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */) {
return this.sortByTag(columnId, columns, rows, cells, sortDir);
} else if (columnType === "date" /* DATE */) {
return this.sortByDate(columnId, rows, cells, sortDir);
} else if (columnType === "last-edited-time" /* LAST_EDITED_TIME */) {
return this.sortByLastEditedTime(rows, sortDir);
} else if (columnType === "creation-time" /* CREATION_TIME */) {
return this.sortByCreationTime(rows, sortDir);
} else if (columnType === "checkbox" /* CHECKBOX */) {
return this.sortByCheckbox(columnId, rows, cells, sortDir);
} else {
return this.sortByMarkdown(columnId, rows, cells, sortDir);
}
}
sortByIndex(rows) {
const newRows = [...rows];
newRows.sort((a2, b2) => {
return a2.index - b2.index;
});
return newRows;
}
execute(prevState) {
super.onExecute();
const { columns, bodyRows, bodyCells } = prevState.model;
const sortedColumn = columns.find(
(columns2) => columns2.sortDir !== "default" /* NONE */
);
this.previousRowSort = bodyRows.map((row) => ({
id: row.id,
index: row.index
}));
let newBodyRows = [...bodyRows];
if (sortedColumn) {
newBodyRows = this.sortByDir(
sortedColumn.id,
sortedColumn.type,
sortedColumn.sortDir,
columns,
bodyRows,
bodyCells
);
} else {
newBodyRows = this.sortByIndex(bodyRows);
}
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: newBodyRows
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyRows } = prevState.model;
const newBodyRows = this.previousRowSort.map((prev) => {
const row = bodyRows.find((row2) => row2.id === prev.id);
if (!row)
throw new RowNotFoundError(prev.id);
return __spreadProps(__spreadValues({}, row), {
index: prev.index
});
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: newBodyRows
})
});
}
};
// src/shared/table-state/table-state-context.tsx
var TableStateContext = import_react11.default.createContext(null);
var useTableState = () => {
const value = import_react11.default.useContext(TableStateContext);
if (value === null) {
throw new Error(
"useTableState() called without a <TableStateProvider /> in the tree."
);
}
return value;
};
function TableStateProvider({
initialState: initialState2,
onSaveState,
children
}) {
const [tableState, setTableState] = import_react11.default.useState(initialState2);
const [searchText, setSearchText] = import_react11.default.useState("");
const [isSearchBarVisible, setSearchBarVisible] = import_react11.default.useState(false);
const [resizingColumnId, setResizingColumnId] = import_react11.default.useState(null);
const [history, setHistory] = import_react11.default.useState([
null
]);
const [position, setPosition] = import_react11.default.useState(0);
const logger = useLogger();
const { appId } = useMountState();
const isMountedRef = import_react11.default.useRef(false);
import_react11.default.useEffect(() => {
if (!isMountedRef.current) {
isMountedRef.current = true;
return;
}
onSaveState(appId, tableState);
}, [appId, tableState, onSaveState]);
function handleToggleSearchBar() {
setSearchBarVisible((prevState) => !prevState);
}
const undo = import_react11.default.useCallback(() => {
if (position > 0) {
logger("handleUndoEvent");
const currentPosition = position - 1;
setPosition(currentPosition);
const command = history[position];
if (command !== null) {
logger(command.constructor.name + ".undo");
let newState = command.undo(tableState);
if (command.shouldSortRows) {
newState = new RowSortCommand().execute(newState);
}
setTableState(newState);
}
}
}, [position, history, tableState, logger]);
const redo = import_react11.default.useCallback(() => {
if (position < history.length - 1) {
logger("handleRedoEvent");
const currentPosition = position + 1;
setPosition(currentPosition);
const command = history[currentPosition];
if (command !== null) {
logger(command.constructor.name + ".redo");
let newState = command.redo(tableState);
if (command.shouldSortRows) {
newState = new RowSortCommand().execute(newState);
}
setTableState(newState);
}
}
}, [position, history, tableState, logger]);
const doCommand = import_react11.default.useCallback(
(command) => {
setHistory((prevState) => {
if (position < history.length - 1) {
const newState2 = prevState.slice(0, position + 1);
return [...newState2, command];
} else {
return [...prevState, command];
}
});
setPosition((prevState) => prevState + 1);
let newState = command.execute(tableState);
if (command.shouldSortRows) {
newState = new RowSortCommand().execute(newState);
}
setTableState(newState);
},
[position, history, tableState]
);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableStateContext.Provider, {
value: {
tableState,
setTableState,
doCommand,
commandRedo: redo,
commandUndo: undo,
isSearchBarVisible,
searchText,
resizingColumnId,
setResizingColumnId,
toggleSearchBar: handleToggleSearchBar,
setSearchText
},
children
});
}
// src/shared/dragging/drag-context.tsx
var import_react12 = __toESM(require_react());
var DragContext = import_react12.default.createContext(null);
var useDragContext = () => {
const value = import_react12.default.useContext(DragContext);
if (value === null) {
throw new Error(
"useDragContext() called without a <DragProvider /> in the tree."
);
}
return value;
};
function DragProvider({ children }) {
const [dragData, setDragData] = import_react12.default.useState(null);
const [touchDropZone, setTouchDropZone] = import_react12.default.useState(
null
);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(DragContext.Provider, {
value: { dragData, touchDropZone, setDragData, setTouchDropZone },
children
});
}
// src/shared/dragging/utils.ts
var getRowId = (rowEl) => {
const td = rowEl.firstChild;
if (!td)
return null;
const id2 = td.getAttribute("data-row-id");
return id2 != null ? id2 : null;
};
var dropDrag = (targetRowId, dragData, tableState, onTableStateChange) => {
if (dragData === null)
throw Error("No drag data found");
if (dragData.type !== "row")
return;
const { columns } = tableState.model;
const isSorted = columns.find((column) => column.sortDir !== "default" /* NONE */);
if (isSorted) {
if (!window.confirm(
"This will set your default sorting to the current sort filter. Do you wish to continue?\n\nIf not, please remove your sort filter before dragging a row."
))
return;
}
onTableStateChange((prevState) => {
const { bodyRows, columns: columns2 } = prevState.model;
const draggedElIndex = bodyRows.findIndex(
(row) => row.id === dragData.id
);
const targetElIndex = bodyRows.findIndex(
(row) => row.id === targetRowId
);
const newRows = structuredClone(bodyRows);
const draggedEl = newRows[draggedElIndex];
newRows.splice(draggedElIndex, 1);
newRows.splice(targetElIndex, 0, draggedEl);
newRows.forEach((row, index) => {
row.index = index;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: newRows,
columns: columns2.map((column) => {
return __spreadProps(__spreadValues({}, column), {
sortDir: "default" /* NONE */
});
})
})
});
});
};
// src/react/table-app/table/table-body-row.tsx
function TableBodyRow(_a) {
var _b = _a, {
style,
children
} = _b, props = __objRest(_b, [
"style",
"children"
]);
const { tableState, setTableState } = useTableState();
const { dragData, setDragData } = useDragContext();
function handleDragStart(e) {
const el = e.target;
const rowId = getRowId(el);
if (!rowId)
return;
setDragData({
type: "row",
id: rowId
});
}
function handleDragEnd(e) {
const el = e.target;
el.draggable = false;
setDragData(null);
}
function handleDrop(e) {
e.preventDefault();
const target = e.currentTarget;
const targetId = getRowId(target);
if (!targetId)
return;
dropDrag(targetId, dragData, tableState, setTableState);
}
function handleDragOver(e) {
e.preventDefault();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("tr", __spreadProps(__spreadValues({
onDrop: handleDrop,
onDragStart: handleDragStart,
onDragEnd: handleDragEnd,
onDragOver: handleDragOver
}, props), {
style,
children
}));
}
// node_modules/@emotion/react/dist/emotion-react.cjs.mjs
var import_emotion_react_cjs = __toESM(require_emotion_react_cjs(), 1);
// src/react/table-app/table/table-header-cell.tsx
var cellStyle = import_emotion_react_cjs.css`
position: sticky;
top: 0;
z-index: 1;
background-color: var(--table-header-background);
border-bottom: 1px solid var(--table-border-color);
border-left: 1px solid var(--table-border-color);
border-right: 0;
padding: 0;
font-weight: 400;
overflow: visible;
text-align: start;
color: var(--text-normal); //Prevents dimming on hover in embedded table
&:first-of-type {
border-top: 0;
border-left: 0;
border-bottom: 0;
background-color: var(--background-primary);
}
&:last-of-type {
border-top: 0;
border-bottom: 0;
background-color: var(--background-primary);
}
`;
function TableHeaderCell({
columnId,
content,
isDraggable
}) {
const { setTableState } = useTableState();
const { dragData, touchDropZone, setDragData, setTouchDropZone } = useDragContext();
function startDrag(el) {
const columnId2 = getColumnId(el);
if (!columnId2)
return;
setDragData({
type: "column",
id: columnId2
});
}
function dropDrag2(targetRowId) {
if (dragData == null)
throw new Error("No drag data found");
if (dragData.type !== "column")
return;
setTableState((prevState) => {
const { columns } = prevState.model;
const draggedElIndex = columns.findIndex(
(column) => column.id === dragData.id
);
const targetElIndex = columns.findIndex(
(column) => column.id === targetRowId
);
const newColumns = structuredClone(columns);
const draggedEl = newColumns[draggedElIndex];
newColumns.splice(draggedElIndex, 1);
newColumns.splice(targetElIndex, 0, draggedEl);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns
})
});
});
}
function addDragHover(thEl) {
const child = thEl.firstChild;
if (!child)
return;
if (child.classList.contains("NLT__focusable"))
thEl.classList.add("NLT__th--drag-over");
}
function removeDragHover() {
const el = document.querySelector(".NLT__th--drag-over");
if (el)
el.classList.remove("NLT__th--drag-over");
}
function getColumnId(columnEl) {
const id2 = columnEl.getAttribute("data-column-id");
if (!id2)
return null;
return id2;
}
function handleDragStart(e) {
const el = e.target;
startDrag(el);
}
function handleDrop(e) {
e.preventDefault();
const target = e.currentTarget;
const targetId = getColumnId(target);
if (!targetId)
return;
dropDrag2(targetId);
}
function handleDragEnd() {
setDragData(null);
}
function handleDragOver(e) {
e.preventDefault();
}
function handleTouchStart(e) {
e.stopPropagation();
const el = e.currentTarget;
startDrag(el);
}
const handleTouchMove = (e) => {
e.stopPropagation();
if (dragData == null)
return;
const { clientX, clientY } = e.touches[0];
const elementUnderneath = document.elementFromPoint(clientX, clientY);
if (!elementUnderneath)
return;
const thEl = elementUnderneath.closest("th");
if (!thEl)
return;
const targetId = getColumnId(thEl);
if (!targetId)
return;
if (targetId === dragData.id)
return;
const { top, left, bottom, right } = thEl.getBoundingClientRect();
setTouchDropZone({
id: targetId,
top,
left,
bottom,
right
});
removeDragHover();
if (thEl.lastChild)
addDragHover(thEl);
};
function handleTouchEnd(e) {
if (touchDropZone) {
const touchX = e.changedTouches[0].clientX;
const touchY = e.changedTouches[0].clientY;
const isInsideDropZone = touchX >= touchDropZone.left && touchX <= touchDropZone.right && touchY >= touchDropZone.top && touchY <= touchDropZone.bottom;
if (isInsideDropZone) {
dropDrag2(touchDropZone.id);
}
}
setDragData(null);
setTouchDropZone(null);
removeDragHover();
}
function handleTouchCancel() {
setDragData(null);
setTouchDropZone(null);
removeDragHover();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("th", __spreadProps(__spreadValues({
"data-column-id": columnId,
css: cellStyle
}, isDraggable && {
draggable: true,
onDrop: handleDrop,
onDragStart: handleDragStart,
onDragOver: handleDragOver,
onDragEnd: handleDragEnd,
onTouchStart: handleTouchStart,
onTouchMove: handleTouchMove,
onTouchEnd: handleTouchEnd,
onTouchCancel: handleTouchCancel
}), {
children: content
}));
}
// src/shared/hooks.ts
var import_react14 = __toESM(require_react());
// node_modules/uuid/dist/esm-browser/rng.js
var getRandomValues;
var rnds8 = new Uint8Array(16);
function rng() {
if (!getRandomValues) {
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
}
}
return getRandomValues(rnds8);
}
// node_modules/uuid/dist/esm-browser/regex.js
var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
// node_modules/uuid/dist/esm-browser/validate.js
function validate(uuid) {
return typeof uuid === "string" && regex_default.test(uuid);
}
var validate_default = validate;
// node_modules/uuid/dist/esm-browser/stringify.js
var byteToHex = [];
for (let i2 = 0; i2 < 256; ++i2) {
byteToHex.push((i2 + 256).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
// node_modules/uuid/dist/esm-browser/parse.js
function parse(uuid) {
if (!validate_default(uuid)) {
throw TypeError("Invalid UUID");
}
let v2;
const arr = new Uint8Array(16);
arr[0] = (v2 = parseInt(uuid.slice(0, 8), 16)) >>> 24;
arr[1] = v2 >>> 16 & 255;
arr[2] = v2 >>> 8 & 255;
arr[3] = v2 & 255;
arr[4] = (v2 = parseInt(uuid.slice(9, 13), 16)) >>> 8;
arr[5] = v2 & 255;
arr[6] = (v2 = parseInt(uuid.slice(14, 18), 16)) >>> 8;
arr[7] = v2 & 255;
arr[8] = (v2 = parseInt(uuid.slice(19, 23), 16)) >>> 8;
arr[9] = v2 & 255;
arr[10] = (v2 = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
arr[11] = v2 / 4294967296 & 255;
arr[12] = v2 >>> 24 & 255;
arr[13] = v2 >>> 16 & 255;
arr[14] = v2 >>> 8 & 255;
arr[15] = v2 & 255;
return arr;
}
var parse_default = parse;
// node_modules/uuid/dist/esm-browser/v35.js
function stringToBytes(str) {
str = unescape(encodeURIComponent(str));
const bytes = [];
for (let i2 = 0; i2 < str.length; ++i2) {
bytes.push(str.charCodeAt(i2));
}
return bytes;
}
var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
var URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
function v35(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
var _namespace;
if (typeof value === "string") {
value = stringToBytes(value);
}
if (typeof namespace === "string") {
namespace = parse_default(namespace);
}
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
}
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 15 | version;
bytes[8] = bytes[8] & 63 | 128;
if (buf) {
offset = offset || 0;
for (let i2 = 0; i2 < 16; ++i2) {
buf[offset + i2] = bytes[i2];
}
return buf;
}
return unsafeStringify(bytes);
}
try {
generateUUID.name = name;
} catch (err) {
}
generateUUID.DNS = DNS;
generateUUID.URL = URL;
return generateUUID;
}
// node_modules/uuid/dist/esm-browser/native.js
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
var native_default = {
randomUUID
};
// node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
if (native_default.randomUUID && !buf && !options) {
return native_default.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || rng)();
rnds[6] = rnds[6] & 15 | 64;
rnds[8] = rnds[8] & 63 | 128;
if (buf) {
offset = offset || 0;
for (let i2 = 0; i2 < 16; ++i2) {
buf[offset + i2] = rnds[i2];
}
return buf;
}
return unsafeStringify(rnds);
}
var v4_default = v4;
// node_modules/uuid/dist/esm-browser/sha1.js
function f2(s2, x2, y2, z2) {
switch (s2) {
case 0:
return x2 & y2 ^ ~x2 & z2;
case 1:
return x2 ^ y2 ^ z2;
case 2:
return x2 & y2 ^ x2 & z2 ^ y2 & z2;
case 3:
return x2 ^ y2 ^ z2;
}
}
function ROTL(x2, n2) {
return x2 << n2 | x2 >>> 32 - n2;
}
function sha1(bytes) {
const K = [1518500249, 1859775393, 2400959708, 3395469782];
const H2 = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
if (typeof bytes === "string") {
const msg = unescape(encodeURIComponent(bytes));
bytes = [];
for (let i2 = 0; i2 < msg.length; ++i2) {
bytes.push(msg.charCodeAt(i2));
}
} else if (!Array.isArray(bytes)) {
bytes = Array.prototype.slice.call(bytes);
}
bytes.push(128);
const l2 = bytes.length / 4 + 2;
const N2 = Math.ceil(l2 / 16);
const M2 = new Array(N2);
for (let i2 = 0; i2 < N2; ++i2) {
const arr = new Uint32Array(16);
for (let j2 = 0; j2 < 16; ++j2) {
arr[j2] = bytes[i2 * 64 + j2 * 4] << 24 | bytes[i2 * 64 + j2 * 4 + 1] << 16 | bytes[i2 * 64 + j2 * 4 + 2] << 8 | bytes[i2 * 64 + j2 * 4 + 3];
}
M2[i2] = arr;
}
M2[N2 - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
M2[N2 - 1][14] = Math.floor(M2[N2 - 1][14]);
M2[N2 - 1][15] = (bytes.length - 1) * 8 & 4294967295;
for (let i2 = 0; i2 < N2; ++i2) {
const W2 = new Uint32Array(80);
for (let t2 = 0; t2 < 16; ++t2) {
W2[t2] = M2[i2][t2];
}
for (let t2 = 16; t2 < 80; ++t2) {
W2[t2] = ROTL(W2[t2 - 3] ^ W2[t2 - 8] ^ W2[t2 - 14] ^ W2[t2 - 16], 1);
}
let a2 = H2[0];
let b2 = H2[1];
let c2 = H2[2];
let d2 = H2[3];
let e = H2[4];
for (let t2 = 0; t2 < 80; ++t2) {
const s2 = Math.floor(t2 / 20);
const T = ROTL(a2, 5) + f2(s2, b2, c2, d2) + e + K[s2] + W2[t2] >>> 0;
e = d2;
d2 = c2;
c2 = ROTL(b2, 30) >>> 0;
b2 = a2;
a2 = T;
}
H2[0] = H2[0] + a2 >>> 0;
H2[1] = H2[1] + b2 >>> 0;
H2[2] = H2[2] + c2 >>> 0;
H2[3] = H2[3] + d2 >>> 0;
H2[4] = H2[4] + e >>> 0;
}
return [H2[0] >> 24 & 255, H2[0] >> 16 & 255, H2[0] >> 8 & 255, H2[0] & 255, H2[1] >> 24 & 255, H2[1] >> 16 & 255, H2[1] >> 8 & 255, H2[1] & 255, H2[2] >> 24 & 255, H2[2] >> 16 & 255, H2[2] >> 8 & 255, H2[2] & 255, H2[3] >> 24 & 255, H2[3] >> 16 & 255, H2[3] >> 8 & 255, H2[3] & 255, H2[4] >> 24 & 255, H2[4] >> 16 & 255, H2[4] >> 8 & 255, H2[4] & 255];
}
var sha1_default = sha1;
// node_modules/uuid/dist/esm-browser/v5.js
var v5 = v35("v5", 80, sha1_default);
var v5_default = v5;
// src/shared/hooks.ts
var useForceUpdate = () => {
const [time, setTime] = import_react14.default.useState(0);
return [time, import_react14.default.useCallback(() => setTime(Date.now()), [])];
};
var useCompare = (value, runOnMount = true) => {
const prevValue = usePrevious(value);
if (prevValue === void 0)
return runOnMount;
return prevValue !== value;
};
var usePrevious = (value) => {
const ref = import_react14.default.useRef();
import_react14.default.useEffect(() => {
ref.current = value;
});
return ref.current;
};
var useInputSelection = (inputRef, value) => {
import_react14.default.useEffect(() => {
function setSelection() {
if (inputRef.current) {
inputRef.current.selectionStart = value.length;
inputRef.current.selectionEnd = value.length;
}
}
setSelection();
}, [inputRef]);
};
var useUUID = () => {
const [uuid] = import_react14.default.useState(v4_default());
return uuid;
};
// src/react/table-app/table/index.tsx
function Table2({ headerRows, bodyRows, footerRows }) {
const tableRef = import_react15.default.useRef(null);
const previousRowLength = usePrevious(bodyRows.length);
import_react15.default.useEffect(() => {
var _a;
if (previousRowLength === void 0)
return;
if (previousRowLength < bodyRows.length)
(_a = tableRef.current) == null ? void 0 : _a.scrollToIndex(bodyRows.length - 1);
}, [previousRowLength, bodyRows.length]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableVirtuoso, {
tabIndex: -1,
ref: tableRef,
overscan: 10,
style: {
width: "100%",
height: "100%"
},
totalCount: bodyRows.length,
components: Components,
fixedHeaderContent: () => headerRows.map((row) => {
const { id: rowId, cells } = row;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("tr", {
css: import_emotion_react_cjs.css`
background-color: var(--background-secondary);
`,
children: cells.map((cell, i2) => {
const { id: cellId, columnId, content } = cell;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableHeaderCell, {
columnId,
content,
isDraggable: i2 < cells.length - 1
}, cellId);
})
}, rowId);
}),
fixedFooterContent: () => footerRows.map((row) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("tr", {
children: row.cells.map((cell) => {
const { id: id2, content } = cell;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("td", {
className: "NLT__footer-td",
css: import_emotion_react_cjs.css`
padding: 0px;
`,
children: content
}, id2);
})
}, row.id)),
itemContent: (index) => {
const row = bodyRows[index];
const { id: rowId, cells } = row;
return cells.map((cell, i2) => {
const { id: cellId, content } = cell;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("td", {
"data-row-id": i2 === 0 ? rowId : void 0,
css: import_emotion_react_cjs.css`
border-top: 0;
border-bottom: 1px solid
var(--table-border-color);
border-left: 1px solid var(--table-border-color);
border-right: 0;
padding: 0;
overflow: visible;
vertical-align: top;
color: var(
--text-normal
); //Prevents hover style in embedded table
color: var(--text-normal);
/**
* This is a hack to make the children have something to calculate their height percentage from.
* i.e. if you have a child with height: 100%, it will be 100% of the height of the td, only
* if the td has a set height value.
* This doesn't represent the actual height of the td, as that is set by HTML
*/
height: 1px;
&:first-of-type {
border-left: 0;
border-bottom: 0;
}
&:last-child {
border-bottom: 0;
}
`,
className: "NLT__body-td",
children: content
}, cellId);
});
}
});
}
var Components = {
Table: (_a) => {
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("table", __spreadProps(__spreadValues({
css: import_emotion_react_cjs.css`
table-layout: fixed;
border-collapse: separate;
`
}, props), {
style,
className: "NLT__table"
}));
},
TableRow: (_c) => {
var _d = _c, { style } = _d, props = __objRest(_d, ["style"]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableBodyRow, __spreadProps(__spreadValues({}, props), {
style
}));
},
TableBody: import_react15.default.forwardRef((_e, ref) => {
var _f = _e, { style } = _f, props = __objRest(_f, ["style"]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("tbody", __spreadProps(__spreadValues({}, props), {
style,
ref
}));
}),
TableFoot: import_react15.default.forwardRef((_g, ref) => {
var _h = _g, { style } = _h, props = __objRest(_h, ["style"]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("tfoot", __spreadProps(__spreadValues({
css: import_emotion_react_cjs.css`
position: sticky;
bottom: 0;
background-color: var(--background-primary);
& > tr:first-of-type > td {
border-bottom: 1px solid var(--table-border-color);
}
& > tr:first-of-type > td:nth-of-type(1) {
border-bottom: 0;
}
& > tr:first-of-type > td:nth-of-type(2) {
border-left: 1px solid var(--table-border-color);
}
& > tr:first-of-type > td:last-child {
border-left: 1px solid var(--table-border-color);
border-bottom: 0;
}
`
}, props), {
style,
ref
}));
})
};
// src/react/shared/icon/index.tsx
var import_react17 = __toESM(require_react());
// src/obsidian-shim/build/set-icon.ts
var import_obsidian3 = require("obsidian");
var setIcon = (div, name) => {
(0, import_obsidian3.setIcon)(div, name);
};
// src/shared/render/utils.ts
var replaceNewLinesWithBr = (markdown) => {
const lines = markdown.split("\n");
let updated = "";
lines.forEach((line) => {
if (line === "") {
updated += "<br>";
} else {
updated += line + "\n";
}
});
return updated;
};
var appendOrReplaceFirstChild = (container, child) => {
if (container == null || child === null)
return;
if (container && !container.firstChild) {
container.appendChild(child);
} else if (container.firstChild && container.firstChild !== child) {
container.replaceChild(child, container.firstChild);
}
};
var getDynamicSize = (defaultValue, value) => {
if (value === void 0)
return defaultValue;
if (typeof value === "string")
return value;
const { base, mobile } = value;
if (isMobileSize()) {
return mobile != null ? mobile : base;
} else {
return base;
}
};
var isMobileSize = () => {
return window.innerWidth <= 480;
};
var hasDarkTheme = () => {
var _a;
const el = document.querySelector("body");
return (_a = el == null ? void 0 : el.className.includes("theme-dark")) != null ? _a : false;
};
// src/react/shared/icon/index.tsx
function Icon({
lucideId,
size = "md",
color = "unset"
}) {
const ref = import_react17.default.useRef(null);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref: (node) => {
ref.current = node;
const div = document.createElement("div");
div.style.display = "flex";
div.style.color = color;
div.style.pointerEvents = "none";
if (size === "sm") {
div.style.width = "0.9rem";
div.style.height = "0.9rem";
} else if (size === "md") {
div.style.width = "1rem";
div.style.height = "1rem";
} else if (size === "lg") {
div.style.width = "1.1rem";
div.style.height = "1.1rem";
}
setIcon(div, lucideId);
appendOrReplaceFirstChild(node, div);
}
});
}
// src/react/shared/menu-trigger/index.tsx
var import_react20 = __toESM(require_react());
// src/shared/menu/menu-context.tsx
var import_react18 = __toESM(require_react());
// src/shared/menu/focus-visible.ts
var focusMenuElement = (menuId) => {
const el = document.querySelector(
`[data-menu-id="${menuId}"]`
);
if (el) {
el.focus();
addFocusVisibleClass(el);
}
};
var addFocusVisibleClass = (el) => {
if (el)
el.classList.add("NLT__focus-visible");
};
var removeFocusVisibleClass = () => {
const el = document.querySelector(".NLT__focus-visible");
if (el)
el.classList.remove("NLT__focus-visible");
};
var getFocusableLayerEl = (appId, topMenu) => {
const appEl = document.querySelector(`.NLT__app[data-id="${appId}"]`);
if (!appEl)
return null;
let layerEl = appEl;
if (topMenu) {
const { id: id2 } = topMenu;
const menuEl = document.querySelector(`.NLT__menu[data-id="${id2}"]`);
if (menuEl)
layerEl = menuEl;
}
return layerEl;
};
var focusNextElement = (layerEl, focusableEls) => {
const focusedEl = document.activeElement;
if (focusedEl) {
const currentIndex = Array.from(focusableEls).indexOf(focusedEl);
if (currentIndex !== -1) {
let index = currentIndex + 1;
if (index > focusableEls.length - 1)
index = 0;
focusableEls[index].focus();
return;
}
}
const selectedEl = layerEl.querySelector(".NLT__selected");
if (selectedEl) {
selectedEl.focus();
} else {
focusableEls[0].focus();
}
};
// src/shared/menu/menu-context.tsx
var MenuContext = import_react18.default.createContext(null);
var useMenuState = () => {
const value = import_react18.default.useContext(MenuContext);
if (value === null) {
throw new Error(
"useMenu() called without a <MenuProvider /> in the tree."
);
}
return value;
};
function MenuProvider({ children }) {
const [currentMenus, setCurrentMenus] = import_react18.default.useState([]);
const logger = useLogger();
const [menuCloseRequest, setMenuCloseRequest] = import_react18.default.useState(null);
const isMenuOpen = import_react18.default.useCallback(
(menu) => {
return currentMenus.find((m2) => m2.id === menu.id) !== void 0;
},
[currentMenus]
);
const hasOpenMenu = import_react18.default.useCallback(() => {
return currentMenus.length !== 0;
}, [currentMenus]);
const getTopMenu = import_react18.default.useCallback(() => {
if (currentMenus.length === 0)
return null;
return currentMenus[currentMenus.length - 1];
}, [currentMenus]);
const canOpenMenu = import_react18.default.useCallback(
(menu) => {
return currentMenus.find((m2) => m2.level === menu.level) === void 0 || currentMenus.length === 0;
},
[currentMenus]
);
const openMenu = import_react18.default.useCallback(
(menu) => {
if (!canOpenMenu(menu))
return;
setCurrentMenus((prev) => [...prev, menu]);
removeFocusVisibleClass();
},
[canOpenMenu]
);
function closeAllMenus(shouldFocusTrigger = true) {
logger("MenuProvider closeAllMenus");
if (currentMenus.length === 0)
return;
const menu = currentMenus[0];
if (shouldFocusTrigger) {
const { id: id2 } = menu;
focusMenuElement(id2);
}
setCurrentMenus([]);
setMenuCloseRequest(null);
}
const closeTopMenu = import_react18.default.useCallback(
(options) => {
logger("MenuProvider closeTopMenu");
const { shouldFocusTrigger = true } = options || {};
const menu = getTopMenu();
if (!menu)
return;
if (shouldFocusTrigger) {
const { id: id2 } = menu;
focusMenuElement(id2);
}
setCurrentMenus((prev) => prev.slice(0, prev.length - 1));
setMenuCloseRequest(null);
},
[getTopMenu, logger]
);
const requestCloseTopMenu = import_react18.default.useCallback(
(type) => {
const menu = getTopMenu();
if (!menu)
return;
if (menu.shouldRequestOnClose) {
setMenuCloseRequest({
id: menu.id,
requestTime: Date.now(),
type
});
return;
}
closeTopMenu();
},
[closeTopMenu, getTopMenu]
);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuContext.Provider, {
value: {
topMenu: getTopMenu(),
hasOpenMenu,
isMenuOpen,
openMenu,
canOpenMenu,
menuCloseRequest,
requestCloseTopMenu,
closeTopMenu,
closeAllMenus
},
children
});
}
// src/shared/keyboard-event.ts
var isWindowsUndoDown = (e) => e.ctrlKey && e.key === "z";
var isWindowsRedoDown = (e) => e.ctrlKey && e.key === "y";
var isMacUndoDown = (e) => e.metaKey && e.key === "z";
var isMacRedoDown = (e) => e.metaKey && e.shiftKey && e.key === "z";
// src/react/shared/menu-trigger/index.tsx
var MenuTrigger = ({
isButton = false,
isCell = false,
shouldRun = true,
menu,
children,
onEnterDown,
onBackspaceDown,
onClick,
onMouseDown
}) => {
const {
openMenu,
closeTopMenu,
requestCloseTopMenu,
canOpenMenu,
hasOpenMenu
} = useMenuState();
const ref = import_react20.default.useRef(null);
const logger = useLogger();
function handleKeyDown(e) {
logger("MenuTrigger handleKeyDown");
if (e.key === "Enter") {
e.stopPropagation();
onEnterDown == null ? void 0 : onEnterDown();
e.preventDefault();
if (!shouldRun)
return;
const tag = e.target.tagName;
if (tag === "A")
return;
if (canOpenMenu(menu)) {
openMenu(menu);
return;
}
closeTopMenu();
} else if (e.key === "Backspace") {
onBackspaceDown == null ? void 0 : onBackspaceDown();
}
if (e.key.length === 1) {
if (isWindowsRedoDown(e) || isWindowsUndoDown(e) || isMacRedoDown(e) || isMacUndoDown(e))
return;
if (!isCell)
return;
openMenu(menu);
}
}
function handleClick(e) {
logger("MenuTrigger handleClick");
e.stopPropagation();
onClick == null ? void 0 : onClick(e);
if (!shouldRun) {
if (hasOpenMenu()) {
requestCloseTopMenu("click");
} else {
if (!ref.current)
return;
removeFocusVisibleClass();
addFocusVisibleClass(ref.current);
}
return;
}
if (canOpenMenu(menu)) {
const tag = e.target.tagName;
if (tag === "A")
return;
openMenu(menu);
return;
}
requestCloseTopMenu("click");
}
const { id: id2 } = menu;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__menu-trigger NLT__focusable",
ref,
css: import_emotion_react_cjs.css`
width: ${isCell ? "100%" : "unset"};
height: ${isCell ? "100%" : "unset"};
border-radius: ${isButton ? "var(--button-radius)" : "unset"};
`,
tabIndex: 0,
"data-menu-id": shouldRun ? id2 : void 0,
onKeyDown: handleKeyDown,
onClick: handleClick,
onMouseDown,
children
});
};
var menu_trigger_default = MenuTrigger;
// src/react/shared/button/index.tsx
var buttonStyle = import_emotion_react_cjs.css`
display: flex;
align-items: center;
width: max-content !important;
height: max-content;
padding: 10px !important; /* Prevent tablet styles */
white-space: nowrap;
color: var(--text-normal);
margin-right: 0;
cursor: pointer;
&:focus-visible {
box-shadow: none !important;
}
`;
var linkStyle = import_emotion_react_cjs.css`
color: var(--link-color);
text-decoration-line: var(--link-decoration);
cursor: var(--cursor-link);
background-color: transparent !important;
box-shadow: none !important;
border: none !important;
&:hover {
box-shadow: var(--input-shadow) !important;
}
`;
var iconStyle = import_emotion_react_cjs.css`
background-color: transparent !important;
box-shadow: none !important;
padding: 6px !important;
&: hover {
box-shadow: var(--input-shadow) !important;
}
`;
var smallStyle = import_emotion_react_cjs.css`
padding: 2px !important;
`;
function Button({
isFocusable = true,
isLink,
isSmall,
invertFocusColor,
children,
ariaLabel = "",
icon,
onClick,
onMouseDown
}) {
const logger = useLogger();
function handleClick() {
onClick == null ? void 0 : onClick();
}
function handleKeyDown(e) {
logger("Button handleKeyDown");
if (e.key === "Enter") {
e.preventDefault();
e.stopPropagation();
onClick == null ? void 0 : onClick();
}
}
let className = "NLT__button";
if (isFocusable) {
className += " NLT__focusable";
if (invertFocusColor)
className += " NLT__focusable--inverted";
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("button", {
tabIndex: isFocusable ? 0 : -1,
className,
css: import_emotion_react_cjs.css`
${buttonStyle}
${isLink ? linkStyle : void 0}
${icon !== void 0 ? iconStyle : void 0}
${isSmall ? smallStyle : void 0}
`,
"aria-label": ariaLabel,
onKeyDown: handleKeyDown,
onMouseDown,
onClick: handleClick,
children: icon !== void 0 ? icon : children
});
}
// src/react/shared/menu-button/index.tsx
function MenuButton({
menu,
isLink = false,
ariaLabel,
icon,
children,
onClick,
onMouseDown
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_trigger_default, {
isButton: true,
menu,
onClick,
onMouseDown,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
isFocusable: false,
isLink,
icon,
ariaLabel,
children
})
});
}
// src/react/table-app/row-options/components/RowMenu/index.tsx
var import_react34 = __toESM(require_react());
// src/react/shared/menu/index.tsx
var import_react25 = __toESM(require_react());
var import_react_dom3 = __toESM(require_react_dom());
// src/shared/conversion.ts
var pxToNum = (value) => {
return parseFloat(value.split("px")[0]);
};
var numToPx = (value) => {
return `${value}px`;
};
var stringToCurrencyString = (value, type) => {
return new Intl.NumberFormat("en-US", {
style: "currency",
currency: type
}).format(parseFloat(value));
};
// src/shared/menu/utils.ts
var import_react23 = __toESM(require_react());
// src/shared/menu/constants.ts
var MENU_SHIFT_PADDING = 5;
// src/obsidian-shim/build/render-utils.ts
var import_react22 = __toESM(require_react());
// src/shared/render/embed.ts
var import_obsidian4 = require("obsidian");
var handleLinkClick = (event) => {
const targetEl = event.target;
const closestAnchor = targetEl.tagName === "A" ? targetEl : targetEl.closest("a");
if (!closestAnchor) {
return;
}
if (closestAnchor.hasClass("internal-link")) {
event.preventDefault();
const href = closestAnchor.getAttr("href");
const newLeaf = event.ctrlKey || event.metaKey;
if (href)
app.workspace.openLinkText(href, "", newLeaf);
}
};
var renderEmbedMarkdown = (leaf, markdown) => __async(void 0, null, function* () {
try {
const view = leaf.view;
if (view instanceof import_obsidian4.MarkdownView || view instanceof NLTView) {
const div = document.body.createDiv();
div.style.height = "100%";
div.style.width = "100%";
yield import_obsidian4.MarkdownRenderer.renderMarkdown(
markdown,
div,
view.file.path,
view
);
return div;
}
} catch (e) {
console.error(e);
}
return null;
});
var renderMarkdown = (leaf, markdown) => __async(void 0, null, function* () {
const div = document.createElement("div");
div.style.height = "100%";
div.style.width = "100%";
const view = leaf == null ? void 0 : leaf.view;
if (view instanceof NLTView)
div.classList.add("markdown-rendered");
try {
const updated = replaceNewLinesWithBr(markdown);
const view2 = leaf == null ? void 0 : leaf.view;
if (view2 instanceof import_obsidian4.MarkdownView || view2 instanceof NLTView) {
yield import_obsidian4.MarkdownRenderer.renderMarkdown(
updated,
div,
view2.file.path,
view2
);
const embeds = div.querySelectorAll(".internal-link");
embeds.forEach((embed) => {
const el = embed;
const href = el.getAttribute("data-href");
if (!href)
return;
const destination = app.metadataCache.getFirstLinkpathDest(
href,
view2.file.path
);
if (!destination)
embed.classList.add("is-unresolved");
el.addEventListener("mouseover", (e) => {
e.stopPropagation();
app.workspace.trigger("hover-link", {
event: e,
source: NOTION_LIKE_TABLES_VIEW,
hoverParent: view2.containerEl,
targetEl: el,
linktext: href,
sourcePath: el.href
});
});
el.addEventListener("click", handleLinkClick);
});
}
} catch (e) {
console.error(e);
}
return div;
});
// src/obsidian-shim/build/render-utils.ts
var import_obsidian5 = require("obsidian");
var useLeafContainer = () => {
const { leaf } = useMountState();
return leaf.view.containerEl;
};
var isOnMobile = () => {
return import_obsidian5.Platform.isMobile;
};
var useRenderMarkdown = (markdown, isEmbed) => {
const containerRef = import_react22.default.useRef(null);
const renderRef = import_react22.default.useRef(null);
const { leaf } = useMountState();
import_react22.default.useEffect(() => {
function updateContainerRef() {
return __async(this, null, function* () {
let el = null;
if (isEmbed) {
el = yield renderEmbedMarkdown(leaf, markdown);
} else {
el = yield renderMarkdown(leaf, markdown);
}
if (el) {
renderRef.current = el;
if (containerRef.current)
appendOrReplaceFirstChild(containerRef.current, el);
}
});
}
updateContainerRef();
}, [markdown, leaf, isEmbed]);
return {
containerRef,
renderRef
};
};
// src/shared/menu/utils.ts
var isTextSelected = () => {
const selection = window.getSelection();
return (selection == null ? void 0 : selection.type) === "Range";
};
var getElementPosition = (el) => {
if (el)
return el.getBoundingClientRect();
return {
top: 0,
left: 0,
width: 0,
height: 0
};
};
var useShiftMenu = (triggerRef, menuRef, isOpen, options) => {
const viewContentEl = useLeafContainer();
import_react23.default.useEffect(() => {
function shiftMenuIntoView() {
if (menuRef.current === null)
return;
if (triggerRef.current === null)
return;
const {
openDirection = "normal",
topOffset = 0,
leftOffset = 0
} = options || {};
const viewContentRect = viewContentEl.getBoundingClientRect();
const triggerRefRect = triggerRef.current.getBoundingClientRect();
const menuRect = menuRef.current.getBoundingClientRect();
const top = triggerRefRect.top + topOffset;
let left = triggerRefRect.left + leftOffset;
if (openDirection === "left") {
left = left - menuRect.width;
} else if (openDirection === "right") {
left = left + triggerRefRect.width;
}
const isMobile = isOnMobile();
let viewContentHeight = viewContentRect.height;
if (isMobile)
viewContentHeight -= 48;
const position = shiftElementIntoContainer(
{
top: viewContentRect.top,
left: viewContentRect.left,
width: viewContentRect.width,
height: viewContentHeight
},
{
top,
left,
width: menuRect.width,
height: menuRect.height
}
);
menuRef.current.style.top = numToPx(position.top);
menuRef.current.style.left = numToPx(position.left);
}
if (isOpen)
shiftMenuIntoView();
});
};
var useMenuTriggerPosition = () => {
const ref = import_react23.default.useRef(null);
const position = getElementPosition(ref.current);
return { triggerRef: ref, triggerPosition: position };
};
var shiftElementIntoContainer = (container, element) => {
let newTop = element.top;
let newLeft = element.left;
if (element.top + element.height > container.top + container.height) {
newTop = container.top + container.height - element.height - MENU_SHIFT_PADDING;
}
if (element.left + element.width > container.left + container.width) {
newLeft = container.left + container.width - element.width - MENU_SHIFT_PADDING;
}
if (element.top < container.top) {
newTop = container.top + MENU_SHIFT_PADDING;
}
if (element.left < container.left) {
newLeft = container.left + MENU_SHIFT_PADDING;
}
return {
top: newTop,
left: newLeft
};
};
// src/obsidian-shim/build/menu-events.ts
var import_react24 = __toESM(require_react());
// src/shared/events.ts
var obsidianEvent = (name) => {
return "notion-like-tables-" + name;
};
var EVENT_COLUMN_ADD = obsidianEvent("add-column");
var EVENT_COLUMN_DELETE = obsidianEvent("delete-column");
var EVENT_ROW_ADD = obsidianEvent("add-row");
var EVENT_ROW_DELETE = obsidianEvent("delete-row");
var EVENT_REFRESH_TABLES = obsidianEvent("refresh-tables");
var EVENT_OUTSIDE_CLICK = obsidianEvent("outside-click");
var EVENT_OUTSIDE_KEYDOWN = obsidianEvent("outside-keydown");
var EVENT_DOWNLOAD_CSV = obsidianEvent("download-csv");
var EVENT_DOWNLOAD_MARKDOWN = obsidianEvent("download-markdown");
// src/obsidian-shim/build/menu-events.ts
var useMenuEvents = (id2, isOpen, isTextHighlighted) => {
const logger = useLogger();
const { requestCloseTopMenu, closeTopMenu, topMenu } = useMenuState();
import_react24.default.useEffect(() => {
function handleOutsideKeyDown(e) {
logger("Menu handleOutsideKeyDown");
if ((topMenu == null ? void 0 : topMenu.id) !== id2)
return;
if (e.key === "Enter") {
requestCloseTopMenu("enter");
} else if (e.key === "Escape") {
closeTopMenu();
}
}
if (isOpen) {
app.workspace.on(EVENT_OUTSIDE_KEYDOWN, handleOutsideKeyDown);
}
return () => app.workspace.off(EVENT_OUTSIDE_CLICK, handleOutsideKeyDown);
}, [isOpen, logger, closeTopMenu, requestCloseTopMenu, id2, topMenu]);
import_react24.default.useEffect(() => {
function handleOutsideClick() {
logger("Menu handleOutsideClick");
if ((topMenu == null ? void 0 : topMenu.id) !== id2)
return;
if (isTextHighlighted) {
return;
}
requestCloseTopMenu("click");
}
if (isOpen) {
app.workspace.on(EVENT_OUTSIDE_CLICK, handleOutsideClick);
}
return () => app.workspace.off(EVENT_OUTSIDE_CLICK, handleOutsideClick);
}, [isOpen, logger, requestCloseTopMenu, id2, topMenu, isTextHighlighted]);
};
// src/react/shared/menu/index.tsx
var Menu = import_react25.default.forwardRef(function Menu2({
id: id2,
isOpen,
hideBorder = false,
top = 0,
left = 0,
width = 0,
height = 0,
maxHeight = 0,
maxWidth = 0,
children
}, ref) {
const { topMenu, closeTopMenu, requestCloseTopMenu } = useMenuState();
const isTextHighlighted = import_react25.default.useRef(false);
const logger = useLogger();
useMenuEvents(id2, isOpen, isTextHighlighted.current);
function handleMouseDown() {
isTextHighlighted.current = false;
}
function handleSelect() {
isTextHighlighted.current = isTextSelected();
}
function handleKeyDown(e) {
logger("Menu handleKeyDown");
if (e.key === "Enter") {
requestCloseTopMenu("enter");
} else if (e.key === "Escape") {
closeTopMenu();
}
}
function handleClick(e) {
logger("Menu handleClick");
e.stopPropagation();
if ((topMenu == null ? void 0 : topMenu.id) === id2) {
if (topMenu.level === 0)
removeFocusVisibleClass();
return;
}
requestCloseTopMenu("click");
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: isOpen && import_react_dom3.default.createPortal(
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__menu",
"data-id": id2,
css: import_emotion_react_cjs.css`
width: 0;
height: 0;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref,
css: import_emotion_react_cjs.css`
position: absolute;
z-index: var(--layer-menu);
top: ${numToPx(top)};
left: ${numToPx(left)};
width: ${width !== 0 ? numToPx(width) : "max-content"};
height: ${height !== 0 ? numToPx(height) : "max-content"};
max-width: ${maxWidth !== 0 ? numToPx(maxWidth) : "unset"};
max-height: ${maxHeight !== 0 ? numToPx(maxHeight) : "unset"};
overflow-y: ${maxHeight !== 0 ? "scroll" : "unset"};
background-color: var(--background-primary);
box-shadow: ${hideBorder ? "unset" : "0px 0px 0px 2px var(--background-modifier-border);"}
font-weight: 400;
`,
onClick: handleClick,
onKeyDown: handleKeyDown,
onMouseDown: handleMouseDown,
onSelect: handleSelect,
children
})
}),
document.body
)
});
});
var menu_default = Menu;
// src/shared/spacing/index.ts
var getSpacing = (size) => {
let spacing = "";
if (size === "sm") {
spacing = "var(--nlt-spacing--sm)";
} else if (size === "md") {
spacing = "var(--nlt-spacing--md)";
} else if (size === "lg") {
spacing = "var(--nlt-spacing--lg)";
} else if (size === "xl") {
spacing = "var(--nlt-spacing--xl)";
} else if (size === "2xl") {
spacing = "var(--nlt-spacing--2xl)";
} else if (size === "3xl") {
spacing = "var(--nlt-spacing--3xl)";
} else if (size === "4xl") {
spacing = "var(--nlt-spacing--4xl)";
}
return spacing;
};
// src/react/shared/stack/index.tsx
function Stack({
spacing = "md",
justify,
align,
grow,
children,
width = "unset",
height = "unset",
minHeight = "unset",
isVertical
}) {
let justifyContent = justify;
if (justifyContent === void 0) {
if (isVertical)
justifyContent = "center";
else
justifyContent = "flex-start";
}
let alignItems = align;
if (alignItems === void 0) {
if (!isVertical)
alignItems = "center";
else
alignItems = "flex-start";
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
display: flex;
flex-direction: ${isVertical ? "column" : "row"};
flex-grow: ${grow ? 1 : 0};
justify-content: ${justifyContent};
align-items: ${alignItems};
${isVertical ? "row-gap" : "column-gap"}: ${getSpacing(
spacing
)};
width: ${width};
height: ${height};
min-height: ${minHeight};
`,
children
});
}
// src/react/shared/flex/index.tsx
function Flex({
flexDir = "row",
justify = "flex-start",
align = "flex-start",
children
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
width: 100%;
display: flex;
flex-direction: ${flexDir};
justify-content: ${justify};
align-items: ${align};
flex-wrap: wrap;
`,
children
});
}
// src/shared/spacing/hooks.ts
var wrapOverflow = import_emotion_react_cjs.css`
overflow-wrap: break-word;
overflow: hidden;
white-space: normal;
`;
var hideOverflow = import_emotion_react_cjs.css`
overflow: hidden;
overflow-wrap: normal;
white-space: nowrap;
`;
var useOverflow = (shouldWrapOverflow) => {
if (shouldWrapOverflow)
return wrapOverflow;
return hideOverflow;
};
// src/react/shared/text/index.tsx
function Text({ value, variant, size = "sm", maxWidth }) {
let className = "NLT__p";
if (variant === "faint")
className += " NLT__text-faint";
if (variant === "muted")
className += " NLT__text-muted";
if (variant === "semibold")
className += " NLT__text-semibold";
let fontSize = "";
if (size === "xs") {
fontSize = "var(--nlt-font-size--xs)";
} else if (size === "sm") {
fontSize = "var(--nlt-font-size--sm)";
} else if (size === "md") {
fontSize = "var(--nlt-font-size--md)";
} else if (size === "lg") {
fontSize = "var(--nlt-font-size--lg)";
}
const overflowStyle = useOverflow(maxWidth !== void 0);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("p", {
className,
css: import_emotion_react_cjs.css`
font-size: ${fontSize};
max-width: ${maxWidth === void 0 ? "unset" : maxWidth};
${overflowStyle}
`,
children: value
});
}
// src/react/shared/padding/index.tsx
function Padding({
width = "100%",
px,
py,
pt,
pb,
pl,
pr,
p: p2,
children
}) {
let renderPt = "";
let renderPb = "";
let renderPl = "";
let renderPr = "";
if (p2) {
renderPt = getSpacing(p2);
renderPb = getSpacing(p2);
renderPl = getSpacing(p2);
renderPr = getSpacing(p2);
} else if (px || py) {
if (px) {
const spacing = getSpacing(px);
renderPl = spacing;
renderPr = spacing;
}
if (py) {
const spacing = getSpacing(py);
renderPt = spacing;
renderPb = spacing;
}
} else if (pb || pt || pl || pr) {
if (pb) {
const spacing = getSpacing(pb);
renderPb = spacing;
}
if (pt) {
const spacing = getSpacing(pt);
renderPt = spacing;
}
if (pl) {
const spacing = getSpacing(pl);
renderPl = spacing;
}
if (pr) {
const spacing = getSpacing(pr);
renderPr = spacing;
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
width: ${width};
padding-top: ${renderPt};
padding-bottom: ${renderPb};
padding-left: ${renderPl};
padding-right: ${renderPr};
`,
children
});
}
// src/react/shared/menu-item/index.tsx
var import_react33 = __toESM(require_react());
function MenuItem({
isFocusable = true,
lucideId,
ariaLabel,
name,
value,
onClick,
isSelected = false
}) {
const ref = import_react33.default.useRef(null);
import_react33.default.useEffect(() => {
if (!ref.current)
return;
if (isSelected) {
ref.current.focus();
}
}, [isSelected]);
function handleClick(e) {
if (!onClick)
return;
e.stopPropagation();
onClick();
}
function handleKeyDown(e) {
if (e.key === "Enter") {
e.stopPropagation();
if (!onClick)
return;
onClick();
}
}
let className = "NLT__menu-item NLT__selectable";
if (isSelected)
className += " NLT__selected";
if (isFocusable)
className += " NLT__focusable";
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref,
tabIndex: 0,
className,
css: import_emotion_react_cjs.css`
display: flex;
align-items: center;
padding: var(--nlt-spacing--sm) var(--nlt-spacing--lg);
width: 100%;
`,
"aria-label": ariaLabel,
onClick: handleClick,
onKeyDown: handleKeyDown,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Flex, {
justify: "space-between",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
children: [
lucideId !== void 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
width: "unset",
pb: "sm",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: name
})
]
}),
value !== void 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
variant: "faint",
value
})
]
})
});
}
// src/react/table-app/row-options/components/RowMenu/index.tsx
var RowMenu = import_react34.default.forwardRef(function RowMenu2({ id: id2, rowId, isOpen, top, left, onDeleteClick }, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
id: id2,
isOpen,
top,
left,
ref,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__row-menu",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "trash-2",
name: "Delete",
onClick: () => onDeleteClick(rowId)
})
})
});
});
var RowMenu_default = RowMenu;
// src/shared/menu/hooks.ts
var import_react35 = __toESM(require_react());
var useMenu = (level, options) => {
const { shouldRequestOnClose = false } = options || {};
const [menu] = import_react35.default.useState({
id: "m" + v4_default(),
level,
shouldRequestOnClose
});
const menuRef = import_react35.default.useRef(null);
const {
isMenuOpen,
openMenu,
closeTopMenu,
menuCloseRequest,
closeAllMenus
} = useMenuState();
return {
menu,
menuRef,
isMenuOpen: isMenuOpen(menu),
menuCloseRequest: (menuCloseRequest == null ? void 0 : menuCloseRequest.id) === menu.id ? menuCloseRequest : null,
openMenu,
closeTopMenu,
closeAllMenus
};
};
// src/react/table-app/row-options/index.tsx
function RowOptions({ rowId, onDeleteClick }) {
const { menu, isMenuOpen, menuRef, closeTopMenu } = useMenu(0 /* ONE */);
const { triggerRef, triggerPosition } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
openDirection: "right"
});
const { dragData, touchDropZone, setDragData, setTouchDropZone } = useDragContext();
const { tableState, setTableState } = useTableState();
function handleDeleteClick(rowId2) {
onDeleteClick(rowId2);
closeTopMenu();
}
function handleMouseDown(e) {
const el = e.target;
const row = el.closest("tr");
if (row) {
row.setAttr("draggable", true);
const dragStartEvent = new DragEvent("dragstart");
Object.defineProperty(dragStartEvent, "target", {
value: row
});
row.dispatchEvent(dragStartEvent);
}
}
function handleTouchStart(e) {
e.stopPropagation();
const targetEl = e.currentTarget;
const rowEl = targetEl.closest("tr");
if (!rowEl)
throw new Error("Row not found");
const rowId2 = getRowId(rowEl);
if (!rowId2)
return;
setDragData({
type: "row",
id: rowId2
});
}
const handleTouchMove = (e) => {
e.stopPropagation();
if (dragData == null)
return;
const { clientX, clientY } = e.touches[0];
const elementUnderneath = document.elementFromPoint(clientX, clientY);
if (!elementUnderneath)
return;
const rowEl = elementUnderneath.closest("tr");
if (!rowEl)
return;
const targetId = getRowId(rowEl);
if (!targetId)
return;
if (targetId === dragData.id)
return;
const { top, left, bottom, right } = rowEl.getBoundingClientRect();
setTouchDropZone({
id: targetId,
top,
left,
bottom,
right
});
removeDragHover();
addDragHover(rowEl);
};
function handleTouchCancel() {
endDrag();
}
function handleTouchEnd(e) {
if (touchDropZone) {
const touchX = e.changedTouches[0].clientX;
const touchY = e.changedTouches[0].clientY;
const isInsideDropZone = touchX >= touchDropZone.left && touchX <= touchDropZone.right && touchY >= touchDropZone.top && touchY <= touchDropZone.bottom;
if (isInsideDropZone) {
dropDrag(touchDropZone.id, dragData, tableState, setTableState);
}
}
endDrag();
}
function endDrag() {
setDragData(null);
setTouchDropZone(null);
removeDragHover();
}
function addDragHover(rowEl) {
const children = rowEl.querySelectorAll("td:not(:last-child)");
for (let i2 = 0; i2 < children.length; i2++) {
children[i2].classList.add("NLT__tr--drag-over");
}
}
function removeDragHover() {
const children = document.querySelectorAll(".NLT__tr--drag-over");
for (let i2 = 0; i2 < children.length; i2++) {
children[i2].classList.remove("NLT__tr--drag-over");
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__row-options",
css: import_emotion_react_cjs.css`
width: 100%;
height: 100%;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref: triggerRef,
css: import_emotion_react_cjs.css`
width: 100%;
height: 100%;
padding-left: 5px;
`,
onTouchStart: handleTouchStart,
onTouchMove: handleTouchMove,
onTouchEnd: handleTouchEnd,
onTouchCancel: handleTouchCancel,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuButton, {
menu,
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "grip-vertical"
}),
ariaLabel: "Drag to move or click to open",
onMouseDown: handleMouseDown
})
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(RowMenu_default, {
id: menu.id,
rowId,
ref: menuRef,
isOpen: isMenuOpen,
top: triggerPosition.top,
left: triggerPosition.left,
onDeleteClick: handleDeleteClick
})
]
});
}
// src/react/table-app/option-bar/sort-button.tsx
function SortBubble({
sortDir,
markdown,
onRemoveClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
border-radius: 8px;
padding: 2px 6px;
user-select: none;
color: var(--text-on-accent);
border: 1px solid var(--background-modifier-border);
background-color: var(--color-accent);
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "lg",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
children: [
sortDir === "asc" /* ASC */ ? /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "arrow-up"
}) : /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "arrow-down"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("span", {
css: import_emotion_react_cjs.css`
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`,
children: markdown
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
isSmall: true,
invertFocusColor: true,
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "x",
color: "var(--text-on-accent)"
}),
ariaLabel: "Remove sort",
onClick: onRemoveClick
})
]
})
});
}
// src/react/shared/switch/index.tsx
function Switch({ isChecked, ariaLabel, onToggle }) {
const { isDarkMode } = useAppSelector((state) => state.global);
function handleKeyDown(e) {
if (e.key === "Enter") {
e.stopPropagation();
onToggle(!isChecked);
}
}
let className = "checkbox-container NLT__switch NLT__focusable";
if (isChecked)
className += " is-enabled";
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
tabIndex: 0,
className,
css: import_emotion_react_cjs.css`
transition: none !important;
&:focus-visible {
outline: 2px solid ${isDarkMode ? "var(--text-on-accent);" : "var(--text-on-accent-inverted);"}
outline-offset: 0px;
}
`,
"aria-label": ariaLabel,
onClick: () => onToggle(!isChecked),
onKeyDown: handleKeyDown,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
type: "checkbox"
})
});
}
// src/react/shared/wrap/index.tsx
function Wrap({
justify,
align = "center",
spacingX = "md",
spacingY = "md",
width,
children
}) {
const justifyContent = getDynamicSize("flex-start", justify);
const renderWidth = getDynamicSize("100%", width);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
width: ${renderWidth};
display: flex;
flex-wrap: wrap;
row-gap: ${getSpacing(spacingX)};
column-gap: ${getSpacing(spacingY)};
justify-content: ${justifyContent};
align-items: ${align};
`,
children
});
}
// src/react/table-app/option-bar/toggle-column-menu.tsx
var import_react40 = __toESM(require_react());
var ToggleColumnMenu = import_react40.default.forwardRef(
function ToggleColumnMenu2({ id: id2, top, left, isOpen, columns, onToggle }, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
isOpen,
id: id2,
top,
left,
ref,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__toggle-column-menu",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
p: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Stack, {
spacing: "md",
isVertical: true,
children: columns.map((column) => {
const { id: id3, markdown, isVisible } = column;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Wrap, {
justify: "space-between",
spacingX: "4xl",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: markdown,
maxWidth: "250px"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Switch, {
isChecked: isVisible,
onToggle: () => onToggle(id3)
})
]
}, id3);
})
})
})
})
});
}
);
var toggle_column_menu_default = ToggleColumnMenu;
// src/react/table-app/option-bar/toggle-column.tsx
var import_react41 = __toESM(require_react());
var areEqual = (prevProps, nextProps) => {
const toggleMatches = prevProps.onToggle == nextProps.onToggle;
const columnsMatch = JSON.stringify(prevProps.columns) === JSON.stringify(nextProps.columns);
return toggleMatches && columnsMatch;
};
var ToggleColumn = ({ columns, onToggle }) => {
const { menu, isMenuOpen, menuRef } = useMenu(0 /* ONE */);
const { triggerPosition, triggerRef } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
openDirection: "left"
});
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref: triggerRef,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuButton, {
isLink: true,
menu,
children: "Toggle"
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(toggle_column_menu_default, {
id: menu.id,
ref: menuRef,
top: triggerPosition.top,
left: triggerPosition.left,
isOpen: isMenuOpen,
columns,
onToggle
})
]
});
};
var toggle_column_default = import_react41.default.memo(ToggleColumn, areEqual);
// src/react/table-app/option-bar/filter/filter.tsx
var import_react48 = __toESM(require_react());
// src/react/table-app/shared-styles.ts
var selectStyle = import_emotion_react_cjs.css`
&:focus {
box-shadow: none !important;
transition: none !important;
}
`;
var baseInputStyle = import_emotion_react_cjs.css`
width: 100%;
height: 100%;
transition: none !important;
font-size: var(--font-ui-medium) !important;
box-shadow: none !important;
`;
var borderlessStyle = import_emotion_react_cjs.css`
${baseInputStyle}
border: 0 !important;
border-radius: 0 !important;
`;
var textAreaStyle = import_emotion_react_cjs.css`
${borderlessStyle}
overflow: hidden;
padding: var(--nlt-cell-spacing-x) var(--nlt-cell-spacing-y);
resize: none;
&:focus {
outline: 2px solid var(--background-modifier-border-focus);
outline-offset: -2px;
}
`;
var numberInputStyle = import_emotion_react_cjs.css`
${borderlessStyle}
text-align: right;
&:focus {
outline: 2px solid var(--background-modifier-border-focus);
outline-offset: -2px;
}
`;
var transparentInputStyle = import_emotion_react_cjs.css`
${baseInputStyle}
background-color: transparent !important;
border: 0px !important;
padding: 5px 0px;
`;
var borderInputStyle = import_emotion_react_cjs.css`
${baseInputStyle}
border: 1px solid var(--table-border-color) !important;
padding: 5px 10px;
background-color: var(--background-secondary);
`;
// src/react/table-app/option-bar/filter/filter-type-select.tsx
function FilterRowDropdown({
id: id2,
cellType,
value,
onChange
}) {
function handleKeyDown(e) {
if (e.key === "Enter") {
e.stopPropagation();
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("select", {
tabIndex: 0,
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${selectStyle}
`,
value,
onChange: (e) => onChange(id2, e.target.value),
onKeyDown: handleKeyDown,
children: [
cellType === "checkbox" /* CHECKBOX */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is" /* IS */,
children: "Is"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not" /* IS_NOT */,
children: "Is not"
})
]
}),
cellType === "tag" /* TAG */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is" /* IS */,
children: "Is"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not" /* IS_NOT */,
children: "Is not"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-empty" /* IS_EMPTY */,
children: "Is empty"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not-empty" /* IS_NOT_EMPTY */,
children: "Is not empty"
})
]
}),
cellType === "multi-tag" /* MULTI_TAG */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "contains" /* CONTAINS */,
children: "Contains"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "does-not-contain" /* DOES_NOT_CONTAIN */,
children: "Does not contain"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-empty" /* IS_EMPTY */,
children: "Is empty"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not-empty" /* IS_NOT_EMPTY */,
children: "Is not empty"
})
]
}),
(cellType === "text" /* TEXT */ || cellType === "file" /* FILE */) && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is" /* IS */,
children: "Is"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not" /* IS_NOT */,
children: "Is not"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "contains" /* CONTAINS */,
children: "Contains"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "does-not-contain" /* DOES_NOT_CONTAIN */,
children: "Does not contain"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "starts-with" /* STARTS_WITH */,
children: "Starts with"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "ends-with" /* ENDS_WITH */,
children: "Ends with"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-empty" /* IS_EMPTY */,
children: "Is empty"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "is-not-empty" /* IS_NOT_EMPTY */,
children: "Is not empty"
})
]
})
]
});
}
// src/react/table-app/option-bar/filter/filter-column-select.tsx
function FilterColumnDropdown({
id: id2,
columns,
value,
onChange
}) {
function handleKeyDown(e) {
if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter") {
e.stopPropagation();
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("select", {
tabIndex: 0,
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${selectStyle}
max-width: 175px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`,
value,
onChange: (e) => onChange(id2, e.target.value),
onKeyDown: handleKeyDown,
children: columns.map((column) => {
const { id: id3, markdown } = column;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: id3,
children: markdown
}, id3);
})
});
}
// node_modules/react-select/dist/react-select.cjs.mjs
var import_react_select_cjs_default = __toESM(require_react_select_cjs_default(), 1);
// src/shared/table-state/constants.ts
var MIN_COLUMN_WIDTH = 40;
var CHECKBOX_MARKDOWN_CHECKED = "[x]";
var CHECKBOX_MARKDOWN_UNCHECKED = "[ ]";
// src/react/table-app/option-bar/filter/filter-text-input.tsx
function FilterTextInput({
id: id2,
text,
tagIds,
columnTags,
cellType,
onTextChange,
onTagsChange
}) {
function handleKeyDown(e) {
if (e.key === "Enter") {
e.stopPropagation();
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
cellType !== "checkbox" /* CHECKBOX */ && cellType !== "tag" /* TAG */ && cellType !== "multi-tag" /* MULTI_TAG */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${baseInputStyle}
width: 150px !important;
`,
value: text,
type: "text",
onChange: (e) => onTextChange(id2, e.target.value)
}),
cellType === "checkbox" /* CHECKBOX */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("select", {
tabIndex: 0,
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${selectStyle}
`,
value: text,
onChange: (e) => onTextChange(id2, e.target.value),
onKeyDown: handleKeyDown,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: "",
children: "Select an option"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: CHECKBOX_MARKDOWN_CHECKED,
children: "Checked"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: CHECKBOX_MARKDOWN_UNCHECKED,
children: "Unchecked"
})
]
}),
(cellType === "tag" /* TAG */ || cellType === "multi-tag" /* MULTI_TAG */) && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_react_select_cjs_default._default, {
className: "react-select NLT__focusable",
styles: {
placeholder: (baseStyles) => __spreadProps(__spreadValues({}, baseStyles), {
fontSize: "var(--font-ui-small)"
}),
control: (base) => __spreadProps(__spreadValues({}, base), {
border: 0,
backgroundColor: "var(--interactive-normal)",
boxShadow: "var(--input-shadow)",
borderRadius: "var(--input-radius)",
"&:focus-within": {
boxShadow: "0 0 0px 3px var(--background-modifier-border-focus)"
},
"&:hover": {
boxShadow: "var(--input-shadow-hover)",
backgroundColor: "var(--interactive-hover)"
}
}),
option: (base, state) => __spreadProps(__spreadValues({}, base), {
fontSize: "var(--font-ui-small)",
backgroundColor: state.isSelected ? "var(--background-secondary)" : "var(--background-primary)",
"&:hover": {
backgroundColor: "var(--interactive-hover)"
}
}),
input: (base) => __spreadProps(__spreadValues({}, base), {
color: "var(--text-on-accent)",
fontSize: "var(--font-ui-small)"
}),
menu: (base) => __spreadProps(__spreadValues({}, base), {
backgroundColor: "var(--background-primary)"
}),
menuList: (base) => __spreadProps(__spreadValues({}, base), {
backgroundColor: "var(--background-primary)",
height: "50px",
overflowY: "scroll"
}),
singleValue: (base) => __spreadProps(__spreadValues({}, base), {
borderRadius: "8px",
color: "var(--text-on-accent)",
backgroundColor: "var(--color-accent)",
fontSize: "var(--font-ui-smaller)",
padding: "3px",
paddingLeft: "6px"
}),
multiValue: (base) => __spreadProps(__spreadValues({}, base), {
backgroundColor: "var(--color-accent)",
borderRadius: "8px"
}),
multiValueLabel: (base) => __spreadProps(__spreadValues({}, base), {
fontSize: "var(--font-ui-smaller)",
color: "var(--text-on-accent)"
}),
multiValueRemove: (base) => __spreadProps(__spreadValues({}, base), {
"&:hover": {
backgroundColor: "var(--background-modifier-hover)",
color: "var(--text-on-accent)"
}
})
},
getOptionLabel: (tag) => tag.markdown,
getOptionValue: (tag) => tag.id,
options: columnTags,
isClearable: false,
isMulti: cellType === "multi-tag" /* MULTI_TAG */,
backspaceRemovesValue: true,
value: columnTags.filter((tag) => tagIds.includes(tag.id)),
onChange: (value) => {
if (cellType === "multi-tag" /* MULTI_TAG */) {
onTagsChange(
id2,
value == null ? void 0 : value.map((tag) => tag.id)
);
} else {
onTagsChange(
id2,
[value == null ? void 0 : value.id]
);
}
}
})
]
});
}
// src/react/table-app/option-bar/filter/filter-row.tsx
function FilterRow({
id: id2,
columns,
isEnabled,
columnId,
filterType,
columnTags,
tagIds,
cellType,
text,
onToggle,
onColumnChange,
onFilterTypeChange,
onTextChange,
onDeleteClick,
onTagsChange
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Wrap, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FilterColumnDropdown, {
id: id2,
columns,
value: columnId,
onChange: onColumnChange
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FilterRowDropdown, {
id: id2,
cellType,
value: filterType,
onChange: onFilterTypeChange
}),
filterType !== "is-empty" /* IS_EMPTY */ && filterType !== "is-not-empty" /* IS_NOT_EMPTY */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FilterTextInput, {
id: id2,
tagIds,
columnTags,
cellType,
text,
onTextChange,
onTagsChange
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
grow: true,
justify: "flex-end",
align: "center",
spacing: "lg",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "trash-2"
}),
ariaLabel: "Delete filter rule",
onClick: () => onDeleteClick(id2)
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Switch, {
isChecked: isEnabled,
ariaLabel: isEnabled ? "Disable filter rule" : "Enable filter rule",
onToggle: () => onToggle(id2)
})
]
})
]
});
}
// src/react/table-app/option-bar/filter/filter-menu.tsx
var import_react46 = __toESM(require_react());
var FilterMenu = import_react46.default.forwardRef(function FilterMenu2({
id: id2,
top,
left,
isOpen,
columns,
filterRules,
onAddClick,
onToggle,
onColumnChange,
onFilterTypeChange,
onTextChange,
onDeleteClick,
onTagsChange
}, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
isOpen,
id: id2,
top,
left,
maxHeight: 255,
ref,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__filter-menu",
css: import_emotion_react_cjs.css`
width: ${isMobileSize() ? "calc(100vw - 30px)" : "unset"};
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
p: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "lg",
isVertical: true,
children: [
filterRules.map((rule) => {
const {
id: id3,
text,
columnId,
isEnabled,
type: filterType,
tagIds
} = rule;
const column = columns.find(
(column2) => column2.id === columnId
);
if (!column)
throw new ColumNotFoundError(columnId);
const { tags, type: cellType } = column;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FilterRow, {
id: id3,
columns,
text,
columnTags: tags,
cellType,
tagIds,
filterType,
columnId,
isEnabled,
onTextChange,
onColumnChange,
onFilterTypeChange,
onToggle,
onDeleteClick,
onTagsChange
}, id3);
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "plus"
}),
ariaLabel: "Add filter rule",
onClick: () => onAddClick(columns[0].id)
}),
filterRules.length === 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "No rules to display"
})
]
})
]
})
})
})
});
});
var filter_menu_default = FilterMenu;
// src/react/table-app/option-bar/filter/filter.tsx
var areEqual2 = (prevProps, nextProps) => {
const columnsMatch = JSON.stringify(prevProps.columns) === JSON.stringify(nextProps.columns);
const filterRulesMatch = JSON.stringify(prevProps.filterRules) === JSON.stringify(nextProps.filterRules);
return columnsMatch && filterRulesMatch;
};
var Filter = ({
columns,
filterRules,
onAddClick,
onColumnChange,
onDeleteClick,
onFilterTypeChange,
onToggle,
onTextChange,
onTagsChange
}) => {
const { menu, menuRef, isMenuOpen } = useMenu(0 /* ONE */);
const { triggerRef, triggerPosition } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
openDirection: "left"
});
const previousLength = usePrevious(filterRules.length);
import_react48.default.useEffect(() => {
if (previousLength !== void 0) {
if (previousLength < filterRules.length) {
if (menuRef.current) {
menuRef.current.scrollTop = menuRef.current.scrollHeight;
}
}
}
}, [previousLength, filterRules.length, menuRef]);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref: triggerRef,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuButton, {
isLink: true,
menu,
children: "Filter"
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(filter_menu_default, {
id: menu.id,
ref: menuRef,
top: triggerPosition.top,
left: triggerPosition.left,
isOpen: isMenuOpen,
columns,
filterRules,
onTextChange,
onColumnChange,
onFilterTypeChange,
onDeleteClick,
onAddClick,
onToggle,
onTagsChange
})
]
});
};
var filter_default = import_react48.default.memo(Filter, areEqual2);
// src/react/table-app/option-bar/search-bar.tsx
function SearchBar() {
const { searchText, setSearchText, isSearchBarVisible, toggleSearchBar } = useTableState();
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "lg",
children: [
isSearchBarVisible && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${baseInputStyle}
max-width: 200px;
`,
autoFocus: true,
type: "text",
placeholder: "Type to search...",
value: searchText,
onChange: (e) => setSearchText(e.target.value)
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "search"
}),
ariaLabel: "Search",
onClick: () => toggleSearchBar()
})
]
});
}
// src/react/shared/divider/index.tsx
function Divider({
isVertical = false,
width = "100%",
height = "100%"
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("hr", {
css: import_emotion_react_cjs.css`
margin: 0;
width: ${!isVertical ? width : "unset"};
height: ${isVertical === true ? height : "unset"};
border-top: ${isVertical === false ? "1px solid var(--hr-color)" : "unset"};
border-left: ${isVertical === true ? "1px var(--hr-color) solid" : "unset"};
`
});
}
// src/react/table-app/option-bar/active-filter-bubble.tsx
function ActiveFilterBubble({ numActive }) {
if (numActive === 0)
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {});
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
css: import_emotion_react_cjs.css`
border-radius: 8px;
padding: 2px 6px;
color: var(--text-on-accent);
border: 1px solid var(--background-modifier-border);
background-color: var(--color-accent);
`,
children: [
numActive,
" active filter",
numActive > 1 ? "s" : ""
]
});
}
// src/shared/table-state/filter-by-rules.ts
var isCellTypeFilterable = (cellType) => {
switch (cellType) {
case "text" /* TEXT */:
case "file" /* FILE */:
case "tag" /* TAG */:
case "multi-tag" /* MULTI_TAG */:
case "checkbox" /* CHECKBOX */:
return true;
default:
return false;
}
};
var filterBodyRowsByRules = (prevState) => {
const { columns, bodyCells, bodyRows, filterRules } = prevState.model;
const columnMap = /* @__PURE__ */ new Map();
columns.forEach((column) => columnMap.set(column.id, column));
const cellMatches = /* @__PURE__ */ new Map();
bodyCells.forEach((cell) => {
const column = columnMap.get(cell.columnId);
if (!column)
throw new ColumNotFoundError(cell.columnId);
const { tags } = column;
const doesMatch = doesCellMatchRules(
cell,
column.type,
tags,
filterRules
);
cellMatches.set(cell.id, doesMatch);
});
return bodyRows.filter((row) => {
const filteredCells = bodyCells.filter((cell) => cell.rowId === row.id);
return filteredCells.every((cell) => cellMatches.get(cell.id) === true);
});
};
var doesCellMatchRules = (cell, cellType, tags, rules) => {
return rules.every((rule) => doesCellMatchRule(cell, cellType, tags, rule));
};
var doesCellMatchRule = (cell, cellType, tags, rule) => {
if (rule.columnId !== cell.columnId)
return true;
if (!isCellTypeFilterable(cellType))
return true;
if (rule.isEnabled) {
if (cellType === "text" /* TEXT */ || cellType === "file" /* FILE */) {
return doesTextMatch(cell.markdown, rule.text, rule.type);
} else if (cellType === "tag" /* TAG */ || cellType === "multi-tag" /* MULTI_TAG */) {
const cellTags = tags.filter((tag) => cell.tagIds.includes(tag.id)).map((tag) => tag.markdown);
const ruleTags = tags.filter((tag) => rule.tagIds.includes(tag.id));
if (cellTags.length === 0) {
return doesTextMatch("", "", rule.type);
}
return ruleTags.every(
(ruleTag) => doesTagMatch(cellTags, ruleTag.markdown, rule.type)
);
} else if (cellType === "checkbox" /* CHECKBOX */) {
return doesTextMatch(cell.markdown, rule.text, rule.type);
}
}
return true;
};
var doesTagMatch = (markdown, ruleText, filterType) => {
switch (filterType) {
case "is" /* IS */:
return markdown[0] === ruleText;
case "is-not" /* IS_NOT */:
return markdown[0] !== ruleText;
case "contains" /* CONTAINS */:
return markdown.some((tag) => ruleText.includes(tag));
case "does-not-contain" /* DOES_NOT_CONTAIN */:
return markdown.every((tag) => !ruleText.includes(tag));
case "is-empty" /* IS_EMPTY */:
return markdown.length === 0;
case "is-not-empty" /* IS_NOT_EMPTY */:
return markdown.length !== 0;
}
};
var doesTextMatch = (markdown, ruleText, filterType) => {
const compareMarkdown = markdown.toLowerCase().trim();
const compareRuleText = ruleText.toLowerCase().trim();
if (filterType !== "is-not-empty" /* IS_NOT_EMPTY */ && filterType !== "is-empty" /* IS_EMPTY */) {
if (compareRuleText === "")
return true;
if (markdown === "")
return true;
}
switch (filterType) {
case "is" /* IS */:
return compareMarkdown === compareRuleText;
case "is-not" /* IS_NOT */:
return compareMarkdown !== compareRuleText;
case "contains" /* CONTAINS */:
return compareMarkdown.includes(compareRuleText);
case "does-not-contain" /* DOES_NOT_CONTAIN */:
return !compareMarkdown.includes(compareRuleText);
case "starts-with" /* STARTS_WITH */:
return compareMarkdown.startsWith(compareRuleText);
case "ends-with" /* ENDS_WITH */:
return compareMarkdown.endsWith(compareRuleText);
case "is-empty" /* IS_EMPTY */:
return compareMarkdown === "";
case "is-not-empty" /* IS_NOT_EMPTY */:
return compareMarkdown !== "";
default:
throw new Error("Filter type not yet supported");
}
};
// src/react/table-app/option-bar/index.tsx
var SortBubbleList = ({
headerCells,
columns,
onRemoveClick
}) => {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Stack, {
spacing: "sm",
children: headerCells.map((cell, i2) => {
const column = columns.find((c2) => c2.id === cell.columnId);
if (!column)
throw new ColumNotFoundError(cell.columnId);
const { markdown, columnId } = cell;
const { sortDir } = column;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SortBubble, {
sortDir,
markdown,
onRemoveClick: () => onRemoveClick(columnId)
}, i2);
})
});
};
function OptionBar({
headerCells,
columns,
filterRules,
onSortRemoveClick,
onColumnToggle,
onRuleToggle,
onRuleColumnChange,
onRuleFilterTypeChange,
onRuleTextChange,
onRuleDeleteClick,
onRuleAddClick,
onRuleTagsChange
}) {
const sortedCells = headerCells.filter((cell) => {
const columnId = cell.columnId;
const column = columns.find((c2) => c2.id === columnId);
if (!column)
throw new ColumNotFoundError(columnId);
return column.sortDir !== "default" /* NONE */;
});
const activeRules = filterRules.filter((rule) => rule.isEnabled);
const columnsWithMarkdown = columns.map((column) => {
const headerCell = headerCells.find(
(cell) => cell.columnId === column.id
);
if (!headerCell)
throw new CellNotFoundError({
columnId: column.id
});
return __spreadProps(__spreadValues({}, column), {
markdown: headerCell.markdown
});
});
const filterableColumns = columnsWithMarkdown.filter(
(column) => {
const { type } = column;
return isCellTypeFilterable(type);
}
);
const sortedColumn = columns.find((c2) => c2.sortDir !== "default" /* NONE */);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__option-bar",
css: import_emotion_react_cjs.css`
width: 100%;
padding-left: var(--nlt-spacing--lg);
padding-bottom: var(--nlt-spacing--md);
padding-top: var(--nlt-spacing--md);
border-bottom: 1px solid var(--background-modifier-border);
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "xl",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Stack, {
spacing: "lg",
isVertical: true,
align: "center",
minHeight: "40px",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Wrap, {
justify: { base: "space-between", mobile: "flex-end" },
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "md",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SortBubbleList, {
headerCells: sortedCells,
columns,
onRemoveClick: onSortRemoveClick
}),
activeRules.length !== 0 && sortedColumn !== void 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {
isVertical: true,
height: "1.5rem"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ActiveFilterBubble, {
numActive: activeRules.length
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
justify: "flex-end",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SearchBar, {}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(filter_default, {
columns: filterableColumns,
filterRules,
onAddClick: onRuleAddClick,
onToggle: onRuleToggle,
onColumnChange: onRuleColumnChange,
onFilterTypeChange: onRuleFilterTypeChange,
onTextChange: onRuleTextChange,
onDeleteClick: onRuleDeleteClick,
onTagsChange: onRuleTagsChange
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(toggle_column_default, {
columns: columnsWithMarkdown,
onToggle: onColumnToggle
})
]
})
]
})
})
})
});
}
// src/react/table-app/function-cell/function-menu.tsx
var import_react53 = __toESM(require_react());
// src/shared/table-state/display-name.ts
var getShortDisplayNameForGeneralFunction = (value) => {
switch (value) {
case "count-all" /* COUNT_ALL */:
return "Count";
case "count-not-empty" /* COUNT_NOT_EMPTY */:
return "Not empty";
case "count-values" /* COUNT_VALUES */:
return "Values";
case "count-empty" /* COUNT_EMPTY */:
return "Empty";
case "count-unique" /* COUNT_UNIQUE */:
return "Unique";
case "none" /* NONE */:
return "None";
case "percent-empty" /* PERCENT_EMPTY */:
return "Empty";
case "percent-not-empty" /* PERCENT_NOT_EMPTY */:
return "Not empty";
default:
return "";
}
};
var getShortDisplayNameForFunctionType = (value) => {
if (isGeneralFunction(value))
return getShortDisplayNameForGeneralFunction(value);
return getDisplayNameForNumberFunction(value);
};
var getAriaLabelForGeneralFunction = (value) => {
switch (value) {
case "count-all" /* COUNT_ALL */:
return "Counts the total number of rows";
case "count-empty" /* COUNT_EMPTY */:
return "Counts the number of rows with an empty cell value";
case "count-not-empty" /* COUNT_NOT_EMPTY */:
return "Counts the number of rows with a non-empty cell value";
case "count-unique" /* COUNT_UNIQUE */:
return "Counts the number of unique values in the column";
case "count-values" /* COUNT_VALUES */:
return "Counts the number of values in the column";
case "percent-empty" /* PERCENT_EMPTY */:
return "Displays the percentage of rows with an empty cell value";
case "percent-not-empty" /* PERCENT_NOT_EMPTY */:
return "Displays the percentage of rows with a non-empty cell value";
default:
return "";
}
};
var getAriaLabelForNumberFunction = (value) => {
switch (value) {
case "sum" /* SUM */:
return "Computes the sum of the cells in the column";
case "avg" /* AVG */:
return "Computes the average of the cells in the column";
case "min" /* MIN */:
return "Computes the minimum of the cells in the column";
case "max" /* MAX */:
return "Computes the maximum of the cells in the column";
case "median" /* MEDIAN */:
return "Computes the median of the cells in the column";
case "range" /* RANGE */:
return "Computes the range (max - min) of the cells in the column";
default:
return "";
}
};
var getDisplayNameForGeneralFunction = (value) => {
switch (value) {
case "count-all" /* COUNT_ALL */:
return "Count all";
case "count-not-empty" /* COUNT_NOT_EMPTY */:
return "Count not empty";
case "count-values" /* COUNT_VALUES */:
return "Count values";
case "count-empty" /* COUNT_EMPTY */:
return "Count empty";
case "count-unique" /* COUNT_UNIQUE */:
return "Count unique";
case "none" /* NONE */:
return "None";
case "percent-empty" /* PERCENT_EMPTY */:
return "Percent empty";
case "percent-not-empty" /* PERCENT_NOT_EMPTY */:
return "Percent not empty";
default:
return "";
}
};
var getDisplayNameForNumberFunction = (value) => {
switch (value) {
case "sum" /* SUM */:
return "Sum";
case "avg" /* AVG */:
return "Average";
case "min" /* MIN */:
return "Min";
case "max" /* MAX */:
return "Max";
case "median" /* MEDIAN */:
return "Median";
case "range" /* RANGE */:
return "Range";
default:
return "";
}
};
var getDisplayNameForDateFormat = (format) => {
switch (format) {
case "dd/mm/yyyy" /* DD_MM_YYYY */:
return "Day/Month/Year";
case "mm/dd/yyyy" /* MM_DD_YYYY */:
return "Month/Day/Year";
case "yyyy/mm/dd" /* YYYY_MM_DD */:
return "Year/Month/Day";
case "full" /* FULL */:
return "Full";
case "relative" /* RELATIVE */:
return "Relative";
default:
return "";
}
};
var getDisplayNameForCurrencyType = (type) => {
switch (type) {
case "USD" /* UNITED_STATES */:
return "United States Dollar";
case "CAD" /* CANADA */:
return "Canadian Dollar";
case "AUD" /* AUSTRALIA */:
return "Australian Dollar";
case "SGB" /* SINGAPORE */:
return "Singapore Dollar";
case "CNY" /* CHINA */:
return "Yuan";
case "JPY" /* JAPAN */:
return "Yen";
case "COP" /* COLOMBIA */:
return "Colombian Peso";
case "EUR" /* EUROPE */:
return "Euro";
case "SEK" /* SWEDEN */:
return "Swedish Krona";
case "DKK" /* DENMARK */:
return "Danish Krone";
case "NOK" /* NORWAY */:
return "Norwegian Krone";
case "ISK" /* ICELAND */:
return "Icelandic Kr\xF3na";
case "BRL" /* BRAZIL */:
return "Real";
case "GBP" /* POUND */:
return "Pound";
case "INR" /* INDIA */:
return "Rupee";
case "ARS" /* ARGENTINA */:
return "Argentine Peso";
case "MXN" /* MEXICO */:
return "Mexican Peso";
case "RUB" /* RUSSIA */:
return "Ruble";
default:
return "";
}
};
var getDisplayNameForCellType = (type) => {
switch (type) {
case "text" /* TEXT */:
return "Text";
case "embed" /* EMBED */:
return "Embed";
case "file" /* FILE */:
return "File";
case "number" /* NUMBER */:
return "Number";
case "checkbox" /* CHECKBOX */:
return "Checkbox";
case "date" /* DATE */:
return "Date";
case "last-edited-time" /* LAST_EDITED_TIME */:
return "Last edited";
case "creation-time" /* CREATION_TIME */:
return "Creation";
case "tag" /* TAG */:
return "Tag";
case "multi-tag" /* MULTI_TAG */:
return "Multi-tag";
case "currency" /* CURRENCY */:
return "Currency";
default:
return "";
}
};
// src/react/table-app/function-cell/function-menu.tsx
var FunctionMenu = import_react53.default.forwardRef(
function FunctionMenu2({ id: id2, value, cellType, isOpen, top, left, onClick }, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
ref,
id: id2,
isOpen,
top,
left,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__function-menu",
children: [
Object.values(GeneralFunction).map((type) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: getDisplayNameForGeneralFunction(type),
ariaLabel: getAriaLabelForGeneralFunction(type),
onClick: () => onClick(type),
isSelected: type === value
}, type)),
(cellType === "number" /* NUMBER */ || cellType === "currency" /* CURRENCY */) && Object.values(NumberFunction).map((type) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
ariaLabel: getAriaLabelForNumberFunction(type),
name: getDisplayNameForNumberFunction(type),
onClick: () => onClick(type),
isSelected: type === value
}, type))
]
})
});
}
);
var function_menu_default = FunctionMenu;
// src/react/table-app/function-cell/arithmetic.ts
var getAverage = (values) => {
return getSum(values) / values.length;
};
var getSum = (values) => {
return values.reduce((sum, a2) => sum + a2, 0);
};
var getMaximum = (values) => {
return Math.max(...values);
};
var getMinimum = (values) => {
return Math.min(...values);
};
var getMedian = (values) => {
const sortedValues = values.sort((a2, b2) => a2 - b2);
const middle = Math.floor(values.length / 2);
if (values.length % 2 === 0) {
return (sortedValues[middle - 1] + sortedValues[middle]) / 2;
} else {
return sortedValues[middle];
}
};
var getRange = (values) => {
return getMaximum(values) - getMinimum(values);
};
// src/react/table-app/function-cell/utils.ts
var NAMESPACE = "fa23ee5e-43ae-45e0-83ed-97c577913416";
var hashString = (value) => {
return v5_default(value, NAMESPACE);
};
var round2Digits = (value) => {
if (value.toString().includes("."))
return parseFloat(value.toFixed(2));
return value;
};
// src/shared/cell-content/currency-cell-content.ts
var getCurrencyCellContent = (value, currencyType) => {
if (isNumber(value))
return stringToCurrencyString(value, currencyType);
return "";
};
// src/react/table-app/function-cell/number-function.ts
var getNumberFunctionContent = (values, cellType, currencyType, functionType) => {
const value = getNumberFunctionValue(values, functionType).toString();
if (cellType === "currency" /* CURRENCY */)
return getCurrencyCellContent(value, currencyType);
return value;
};
var getNumberFunctionValue = (values, type) => {
if (type === "avg" /* AVG */) {
return round2Digits(getAverage(values));
} else if (type === "max" /* MAX */) {
return getMaximum(values);
} else if (type === "min" /* MIN */) {
return getMinimum(values);
} else if (type === "range" /* RANGE */) {
return round2Digits(getRange(values));
} else if (type === "sum" /* SUM */) {
return round2Digits(getSum(values));
} else if (type === "median" /* MEDIAN */) {
return round2Digits(getMedian(values));
} else {
throw new Error("Unhandled number function");
}
};
// src/shared/date/constants.ts
var MILLIS_IN_DAY = 1e3 * 60 * 60 * 24;
var MILLIS_IN_MINUTE = 1e3 * 60;
// src/shared/date/regex.ts
var YYYY_MM_DD_REGEX = new RegExp(
/^(\d{4})\/(0[1-9]|1[0-2])\/(0[1-9]|[1-2]\d|3[0-1])$/
);
var MM_DD_YYYY_REGEX = new RegExp(
/^(0[1-9]|1[0-2])\/(0[1-9]|[1-2]\d|3[0-1])\/(\d{4})$/
);
var DD_MM_YYYY_REGEX = new RegExp(
/^(0[1-9]|[1-2]\d|3[0-1])\/(0[1-9]|1[0-2])\/(\d{4})$/
);
// src/shared/date/utils.ts
var getDateParts = (date) => {
const year = date.getFullYear().toString();
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
const time = date.toLocaleString("en-US", {
hour: "numeric",
minute: "numeric",
hour12: true
});
return { year, month, day, time };
};
var getUTCTimeFromDateParts = (year, month, day) => {
return new Date(`${year}-${month}-${day}T00:00:00`).getTime();
};
var removeLastComma = (value) => {
const commaIndex = value.lastIndexOf(",");
return value.substring(0, commaIndex) + value.substring(commaIndex + 1);
};
// src/shared/date/date-conversion.ts
var dateStringToUnixTime = (value, dateFormat) => {
const parts = value.split("/");
switch (dateFormat) {
case "mm/dd/yyyy" /* MM_DD_YYYY */:
return getUTCTimeFromDateParts(parts[2], parts[0], parts[1]);
case "dd/mm/yyyy" /* DD_MM_YYYY */:
return getUTCTimeFromDateParts(parts[2], parts[1], parts[0]);
case "yyyy/mm/dd" /* YYYY_MM_DD */:
return getUTCTimeFromDateParts(parts[0], parts[1], parts[2]);
default:
throw new Error("Date format not supported.");
}
};
var unixTimeToDateString = (unixTime, format) => {
const date = new Date(unixTime);
const { year, month, day } = getDateParts(date);
switch (format) {
case "mm/dd/yyyy" /* MM_DD_YYYY */:
return `${month}/${day}/${year}`;
case "dd/mm/yyyy" /* DD_MM_YYYY */:
return `${day}/${month}/${year}`;
case "yyyy/mm/dd" /* YYYY_MM_DD */:
return `${year}/${month}/${day}`;
case "full" /* FULL */:
return date.toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric"
});
case "relative" /* RELATIVE */: {
const diff = Date.now() - date.getTime();
if (diff < MILLIS_IN_DAY) {
return "Today";
} else if (diff < MILLIS_IN_DAY * 2) {
return "Yesterday";
} else if (diff < MILLIS_IN_DAY * 7) {
return date.toLocaleString("en-US", { weekday: "long" });
} else {
return date.toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric"
});
}
}
default:
return "";
}
};
var unixTimeToDateTimeString = (unixTime, format) => {
const date = new Date(unixTime);
const { year, month, day, time } = getDateParts(date);
switch (format) {
case "mm/dd/yyyy" /* MM_DD_YYYY */:
return `${month}/${day}/${year} ${time}`;
case "dd/mm/yyyy" /* DD_MM_YYYY */:
return `${day}/${month}/${year} ${time}`;
case "yyyy/mm/dd" /* YYYY_MM_DD */:
return `${year}/${month}/${day} ${time}`;
case "full" /* FULL */: {
const value = date.toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true
});
return removeLastComma(value);
}
case "relative" /* RELATIVE */: {
const diff = Date.now() - date.getTime();
const time2 = date.toLocaleString("en-US", {
hour: "numeric",
minute: "numeric",
hour12: true
});
if (diff < MILLIS_IN_DAY) {
return "Today " + time2;
} else if (diff < MILLIS_IN_DAY * 2) {
return "Yesterday " + time2;
} else if (diff < MILLIS_IN_DAY * 7) {
return date.toLocaleString("en-US", { weekday: "long" }) + " " + time2;
} else {
const value = date.toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true
});
return removeLastComma(value);
}
}
default:
return "";
}
};
var isValidDateFormat = (value, dateFormat) => {
switch (dateFormat) {
case "mm/dd/yyyy" /* MM_DD_YYYY */:
return value.match(MM_DD_YYYY_REGEX) !== null;
case "dd/mm/yyyy" /* DD_MM_YYYY */:
return value.match(DD_MM_YYYY_REGEX) !== null;
case "yyyy/mm/dd" /* YYYY_MM_DD */:
return value.match(YYYY_MM_DD_REGEX) !== null;
default:
return false;
}
};
// src/react/table-app/function-cell/general-function.ts
var getGeneralFunctionContent = (bodyRows, columnCells, columnTags, cellType, functionType, dateFormat) => {
return getGeneralFunctionValue(
bodyRows,
columnCells,
columnTags,
cellType,
functionType,
dateFormat
).toString();
};
var getGeneralFunctionValue = (bodyRows, columnCells, columnTags, cellType, functionType, dateFormat) => {
if (functionType === "count-all" /* COUNT_ALL */) {
return countAll(bodyRows);
} else if (functionType === "count-empty" /* COUNT_EMPTY */) {
return countEmpty(columnCells, cellType);
} else if (functionType === "count-not-empty" /* COUNT_NOT_EMPTY */) {
return countNotEmpty(columnCells, cellType);
} else if (functionType === "count-unique" /* COUNT_UNIQUE */) {
return countUnique(
bodyRows,
columnCells,
columnTags,
cellType,
dateFormat
);
} else if (functionType === "count-values" /* COUNT_VALUES */) {
return countValues(columnCells, cellType);
} else if (functionType === "percent-empty" /* PERCENT_EMPTY */) {
return percentEmpty(columnCells, cellType);
} else if (functionType === "percent-not-empty" /* PERCENT_NOT_EMPTY */) {
return percentNotEmpty(columnCells, cellType);
} else if (functionType === "none" /* NONE */) {
return "";
} else {
throw new Error("Unhandled general function");
}
};
var countAll = (bodyRows) => {
return bodyRows.length;
};
var countEmpty = (columnCells, cellType) => {
return columnCells.map((cell) => isCellContentEmpty(cell, cellType)).reduce((accum, value) => {
if (value === true)
return accum + 1;
return accum;
}, 0);
};
var countNotEmpty = (columnCells, cellType) => {
return columnCells.map((cell) => isCellContentEmpty(cell, cellType)).reduce((accum, value) => {
if (value === false)
return accum + 1;
return accum;
}, 0);
};
var countUnique = (bodyRows, columnCells, columnTags, cellType, dateFormat) => {
const hashes = columnCells.map((cell) => {
const row = bodyRows.find((row2) => row2.id === cell.rowId);
if (!row)
throw new RowNotFoundError(cell.rowId);
const cellValues = getCellValues(
row,
cell,
columnTags,
cellType,
dateFormat
);
return cellValues.filter((value) => value !== "").map((value) => hashString(value));
}).flat(1);
const uniqueHashes = new Set(hashes);
return uniqueHashes.size;
};
var countValues = (columnCells, cellType) => {
return columnCells.map((cell) => countCellValues(cell, cellType)).reduce((accum, value) => accum + value, 0);
};
var percentEmpty = (columnCells, cellType) => {
const percent = countEmpty(columnCells, cellType) / columnCells.length * 100;
const normalized = round2Digits(percent);
return normalized + "%";
};
var percentNotEmpty = (columnCells, cellType) => {
const percent = countNotEmpty(columnCells, cellType) / columnCells.length * 100;
const normalized = round2Digits(percent);
return normalized + "%";
};
var getCellValues = (bodyRow, cell, columnTags, cellType, dateFormat) => {
if (cellType === "text" /* TEXT */ || cellType === "embed" /* EMBED */ || cellType === "number" /* NUMBER */ || cellType === "currency" /* CURRENCY */ || cellType === "checkbox" /* CHECKBOX */ || cellType === "file" /* FILE */) {
return [cell.markdown];
} else if (cellType === "date" /* DATE */) {
if (cell.dateTime)
return [cell.dateTime.toString()];
return [];
} else if (cellType === "tag" /* TAG */ || cellType === "multi-tag" /* MULTI_TAG */) {
return cell.tagIds.map((tagId) => {
const tag = columnTags.find((tag2) => tag2.id === tagId);
if (!tag)
throw new TagNotFoundError(tagId);
return tag.markdown;
});
} else if (cellType === "last-edited-time" /* LAST_EDITED_TIME */) {
return [unixTimeToDateTimeString(bodyRow.lastEditedTime, dateFormat)];
} else if (cellType === "creation-time" /* CREATION_TIME */) {
return [unixTimeToDateTimeString(bodyRow.creationTime, dateFormat)];
} else {
throw new Error("Unhandled cell type");
}
};
var countCellValues = (cell, cellType) => {
if (cellType === "text" /* TEXT */ || cellType === "embed" /* EMBED */ || cellType === "number" /* NUMBER */ || cellType === "currency" /* CURRENCY */ || cellType === "file" /* FILE */) {
return cell.markdown === "" ? 0 : 1;
} else if (cellType === "date" /* DATE */) {
return cell.dateTime == null ? 0 : 1;
} else if (cellType === "tag" /* TAG */ || cellType === "multi-tag" /* MULTI_TAG */) {
return cell.tagIds.length;
} else if (cellType === "checkbox" /* CHECKBOX */) {
return isCheckboxChecked(cell.markdown) ? 1 : 0;
} else if (cellType === "last-edited-time" /* LAST_EDITED_TIME */ || cellType === "creation-time" /* CREATION_TIME */) {
return 1;
} else {
throw new Error("Unhandled cell type");
}
};
var isCellContentEmpty = (cell, cellType) => {
if (cellType === "text" /* TEXT */ || cellType === "embed" /* EMBED */ || cellType === "number" /* NUMBER */ || cellType === "currency" /* CURRENCY */ || cellType === "file" /* FILE */) {
return cell.markdown === "";
} else if (cellType === "date" /* DATE */) {
return cell.dateTime == null;
} else if (cellType === "tag" /* TAG */ || cellType === "multi-tag" /* MULTI_TAG */) {
return cell.tagIds.length === 0;
} else if (cellType === "checkbox" /* CHECKBOX */) {
return !isCheckboxChecked(cell.markdown);
} else if (cellType === "last-edited-time" /* LAST_EDITED_TIME */ || cellType === "creation-time" /* CREATION_TIME */) {
return true;
} else {
throw new Error("Unhandled cell type");
}
};
// src/react/table-app/function-cell/index.tsx
function FunctionCell({
columnId,
columnTags,
bodyCells,
dateFormat,
bodyRows,
functionType,
currencyType,
cellType,
onFunctionTypeChange
}) {
const { menu, isMenuOpen, menuRef, closeTopMenu } = useMenu(0 /* ONE */);
const { triggerPosition, triggerRef } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen);
function handleFunctionTypeClick(value) {
onFunctionTypeChange(columnId, value);
closeTopMenu();
}
const columnCells = bodyCells.filter((cell) => cell.columnId === columnId);
let content = "";
if (isGeneralFunction(functionType)) {
content = getGeneralFunctionContent(
bodyRows,
columnCells,
columnTags,
cellType,
functionType,
dateFormat
);
} else {
const cellValues = columnCells.filter((cell) => isNumber(cell.markdown)).map((cell) => parseFloat(cell.markdown));
if (cellValues.length !== 0)
content = getNumberFunctionContent(
cellValues,
cellType,
currencyType,
functionType
);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_trigger_default, {
isCell: true,
menu,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__function-cell NLT__selectable",
ref: triggerRef,
children: [
functionType === "none" /* NONE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "Calculate",
variant: "faint"
}),
functionType !== "none" /* NONE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: getShortDisplayNameForFunctionType(
functionType
),
variant: "muted"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: content,
variant: "semibold"
})
]
})
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(function_menu_default, {
id: menu.id,
top: triggerPosition.top,
ref: menuRef,
cellType,
left: triggerPosition.left,
isOpen: isMenuOpen,
value: functionType,
onClick: handleFunctionTypeClick
})
]
});
}
// src/react/table-app/body-cell/index.tsx
var import_react81 = __toESM(require_react());
// src/react/table-app/text-cell/index.tsx
function TextCell({ markdown, shouldWrapOverflow }) {
const { containerRef, renderRef } = useRenderMarkdown(markdown, false);
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__text-cell",
css: overflowStyle,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
p {
margin: 0;
text-align: left;
}
ul {
padding-left: var(--nlt-spacing--xl);
padding-right: 0;
margin: 0;
}
`,
ref: (node) => {
containerRef.current = node;
appendOrReplaceFirstChild(node, renderRef.current);
}
})
});
}
// src/shared/color.ts
var findColorClassName = (isDarkMode, color) => {
switch (color) {
case "light gray" /* LIGHT_GRAY */:
return isDarkMode ? "NLT__light-gray--dark" : "NLT__light-gray--light";
case "gray" /* GRAY */:
return isDarkMode ? "NLT__gray--dark" : "NLT__gray--light";
case "brown" /* BROWN */:
return isDarkMode ? "NLT__brown--dark" : "NLT__brown--light";
case "orange" /* ORANGE */:
return isDarkMode ? "NLT__orange--dark" : "NLT__orange--light";
case "yellow" /* YELLOW */:
return isDarkMode ? "NLT__yellow--dark" : "NLT__yellow--light";
case "green" /* GREEN */:
return isDarkMode ? "NLT__green--dark" : "NLT__green--light";
case "blue" /* BLUE */:
return isDarkMode ? "NLT__blue--dark" : "NLT__blue--light";
case "purple" /* PURPLE */:
return isDarkMode ? "NLT__purple--dark" : "NLT__purple--light";
case "pink" /* PINK */:
return isDarkMode ? "NLT__pink--dark" : "NLT__pink--light";
case "red" /* RED */:
return isDarkMode ? "NLT__red--dark" : "NLT__red--light";
default:
return "";
}
};
var randomColor = () => {
const index = Math.floor(Math.random() * Object.values(Color).length);
return Object.values(Color)[index];
};
// src/react/shared/tag/index.tsx
function Tag6({
id: id2,
color,
maxWidth,
markdown,
showRemove,
onRemoveClick
}) {
const { isDarkMode } = useAppSelector((state) => state.global);
let tagClass = "NLT__tag";
tagClass += " " + findColorClassName(isDarkMode, color);
if (onRemoveClick !== void 0 && id2 === void 0) {
throw new Error(
"An id must defined when the onRemoveClick handler is present."
);
}
let contentClassName = "NLT__tag-content";
if (maxWidth !== void 0) {
contentClassName += " NLT__hide-overflow-ellipsis";
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: tagClass,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
justify: "center",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", __spreadProps(__spreadValues({
className: contentClassName
}, maxWidth !== void 0 && { style: { maxWidth } }), {
children: markdown
})),
showRemove && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
width: "max-content",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
isSmall: true,
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "x"
}),
onClick: () => {
onRemoveClick !== void 0 && onRemoveClick(id2);
}
})
})
]
})
});
}
// src/react/table-app/tag-cell/index.tsx
function TagCell({
markdown,
color,
shouldWrapOverflow
}) {
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__tag-cell",
css: overflowStyle,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Tag6, {
markdown,
color
})
});
}
// src/react/table-app/checkbox-cell/index.tsx
function CheckboxCell({ value }) {
const isChecked = isCheckboxChecked(value);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__checkbox-cell",
css: import_emotion_react_cjs.css`
width: 100%;
padding: var(--nlt-cell-spacing);
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
className: "task-list-item-checkbox",
css: import_emotion_react_cjs.css`
cursor: pointer;
`,
type: "checkbox",
checked: isChecked,
onChange: () => {
}
})
});
}
// src/shared/cell-content/date-cell-content.ts
var getDateCellContent = (dateTime, format) => {
if (dateTime !== null)
return unixTimeToDateString(dateTime, format);
return "";
};
// src/react/table-app/date-cell/index.tsx
function DateCell({ value, format }) {
const content = getDateCellContent(value, format);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__date-cell",
css: import_emotion_react_cjs.css`
width: 100%;
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding: var(--nlt-cell-spacing);
`,
children: content
});
}
// src/react/table-app/number-cell/index.tsx
function NumberCell({ value, shouldWrapOverflow }) {
const overflowStyle = useOverflow(shouldWrapOverflow);
let valueString = "";
if (isNumber(value))
valueString = value;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__number-cell",
css: overflowStyle,
children: valueString
});
}
// src/react/table-app/number-cell-edit/index.tsx
var import_react57 = __toESM(require_react());
function NumberCellEdit({
menuCloseRequest,
value,
onChange,
onMenuClose
}) {
const initialValue = isNumber(value) ? value : "";
const [localValue, setLocalValue] = import_react57.default.useState(initialValue);
const inputRef = import_react57.default.useRef(null);
useInputSelection(inputRef, localValue);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react57.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (localValue !== value)
onChange(localValue);
onMenuClose();
}
}, [
value,
localValue,
hasCloseRequestTimeChanged,
menuCloseRequest,
onMenuClose,
onChange
]);
function handleChange(inputValue) {
if (!isValidNumberInput(inputValue))
return;
setLocalValue(inputValue);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__number-cell-edit",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
autoFocus: true,
css: numberInputStyle,
type: "text",
ref: inputRef,
inputMode: "numeric",
value: localValue,
onChange: (e) => handleChange(e.target.value),
onBlur: (e) => {
e.target.classList.add("NLT__blur--cell");
}
})
});
}
// src/react/table-app/text-cell-edit/index.tsx
var import_react63 = __toESM(require_react());
// src/react/shared/suggest-menu/suggest-menu.tsx
var import_react62 = __toESM(require_react());
// src/react/shared/suggest-menu/suggest-menu-content.tsx
var import_react60 = __toESM(require_react());
var import_fuzzysort = __toESM(require_fuzzysort());
// src/react/shared/suggest-menu/suggest-item.tsx
var import_react58 = __toESM(require_react());
// src/shared/event-system/event-system.ts
var EventSystem = class {
constructor() {
__publicField(this, "eventListeners");
this.eventListeners = [];
}
addEventListener(name, callback, priority = 0) {
this.eventListeners.push({
name,
callback,
priority
});
this.eventListeners.sort((a2, b2) => b2.priority - a2.priority);
}
removeEventListener(name, callback) {
this.eventListeners = this.eventListeners.filter(
(l2) => l2.name !== name || l2.callback !== callback
);
}
dispatchEvent(name, event, ...data) {
const listeners = this.eventListeners.filter((l2) => l2.name === name);
listeners.forEach((listener2) => {
listener2.callback(event, data);
});
}
};
var nltEventSystem = new EventSystem();
// src/react/shared/suggest-menu/suggest-item.tsx
var SuggestItem = import_react58.default.forwardRef(
function SuggestItem2({ file, isHighlighted, isFileNameUnique, onItemClick }, ref) {
const handleClick = import_react58.default.useCallback(
(e) => {
e.stopPropagation();
onItemClick(file, isFileNameUnique);
},
[file, isFileNameUnique, onItemClick]
);
import_react58.default.useEffect(() => {
function handleKeyDown(e) {
if (e.key === "Enter")
onItemClick(file, isFileNameUnique);
}
if (isHighlighted)
nltEventSystem.addEventListener("keydown", handleKeyDown, 1);
return () => nltEventSystem.removeEventListener("keydown", handleKeyDown);
}, [isHighlighted, onItemClick, file, isFileNameUnique]);
let name = "No match found";
if (file) {
if (file.extension === "md") {
name = file.basename;
} else {
name = file.name;
}
}
let path = null;
if (file) {
if (file.parent && file.parent.path !== "/") {
path = file.parent.path + "/";
}
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
tabIndex: 0,
className: "NLT__suggest-item NLT__focusable",
ref,
css: import_emotion_react_cjs.css`
padding: 4px 6px;
margin: 2px 0;
background-color: ${isHighlighted ? "var(--background-modifier-hover)" : "var(--background-primary)"};
&:hover {
background-color: var(--background-modifier-hover);
}
`,
onClick: handleClick,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
variant: "semibold",
size: "xs",
value: name,
maxWidth: "275px"
}),
path && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: path,
size: "xs"
})
]
});
}
);
var suggest_item_default = SuggestItem;
// src/react/shared/suggest-menu/constants.ts
var DOUBLE_BRACKET_REGEX = new RegExp(/\[\[(.*?)]]/g);
// src/react/shared/suggest-menu/utils.ts
var isSurroundedByDoubleBrackets = (inputValue, selectionStart) => {
let match;
const regex = structuredClone(DOUBLE_BRACKET_REGEX);
while ((match = regex.exec(inputValue)) !== null) {
const innerText = match[1];
const startIndex = match.index + 2;
const endIndex = startIndex + innerText.length - 1;
const index = selectionStart - 1;
if (innerText === "" && index === startIndex - 1)
return true;
if (index >= startIndex && index <= endIndex)
return true;
}
return false;
};
var doubleBracketsInnerReplace = (inputValue, selectionStart, replacement) => {
let match;
const regex = structuredClone(DOUBLE_BRACKET_REGEX);
while ((match = regex.exec(inputValue)) !== null) {
const innerText = match[1];
const startIndex = match.index + 2;
const endIndex = startIndex + innerText.length - 1;
const index = selectionStart - 1;
if (innerText === "" && index === startIndex - 1) {
return inputValue.slice(0, startIndex) + replacement + inputValue.slice(endIndex + 1);
}
if (index >= startIndex && index <= endIndex) {
return inputValue.slice(0, startIndex) + replacement + inputValue.slice(endIndex + 1);
}
}
return inputValue;
};
var getFilterValue = (inputValue, selectionStart) => {
let match;
const regex = structuredClone(DOUBLE_BRACKET_REGEX);
while ((match = regex.exec(inputValue)) !== null) {
const innerText = match[1];
const startIndex = match.index + 2;
const endIndex = startIndex + innerText.length - 1;
const index = selectionStart - 1;
if (innerText === "" && index === startIndex - 1) {
return innerText;
}
if (index >= startIndex && index <= endIndex) {
return innerText;
}
}
return null;
};
var addClosingBracket = (value, selectionStart) => {
const char = value[selectionStart - 1];
if (char === "[")
value = value + "]";
return value;
};
var removeClosingBracket = (previousValue, value, selectionStart) => {
const previousChar = previousValue[selectionStart];
const nextChar = value[selectionStart];
if (previousChar === "[" && nextChar === "]") {
const updatedValue = value.slice(0, selectionStart) + value.slice(selectionStart + 1);
value = updatedValue;
}
return value;
};
var filterUniqueStrings = (arr) => {
const frequencyMap = /* @__PURE__ */ new Map();
arr.forEach((string) => {
frequencyMap.set(string, (frequencyMap.get(string) || 0) + 1);
});
const uniqueStrings = [];
for (const string of frequencyMap.keys()) {
if (frequencyMap.get(string) === 1) {
uniqueStrings.push(string);
}
}
return uniqueStrings;
};
// src/obsidian-shim/build/vault-file.ts
var getVaultFiles = () => {
return app.vault.getFiles();
};
// src/react/shared/suggest-menu/suggest-menu-content.tsx
function SuggestMenuContent({
showInput,
filterValue,
onItemClick
}) {
const logger = useLogger();
const [localFilterValue, setLocalFilterValue] = import_react60.default.useState(
filterValue != null ? filterValue : ""
);
const highlightItemRef = import_react60.default.useRef(null);
const [highlightIndex, setHighlightIndex] = import_react60.default.useState(-1);
const files = getVaultFiles();
let filteredFiles = [];
if (localFilterValue !== "") {
const results = import_fuzzysort.default.go(localFilterValue, files, {
key: "path",
limit: 20
});
filteredFiles = results.map((result) => result.obj);
} else {
filteredFiles = files;
filteredFiles.sort((a2, b2) => b2.modifiedTime - a2.modifiedTime);
filteredFiles = filteredFiles.slice(0, 20);
}
import_react60.default.useEffect(() => {
setLocalFilterValue(filterValue != null ? filterValue : "");
}, [filterValue]);
import_react60.default.useEffect(() => {
if (highlightItemRef.current) {
highlightItemRef.current.scrollIntoView({
behavior: "auto",
block: "nearest"
});
}
}, [highlightIndex]);
import_react60.default.useEffect(() => {
function handleKeyDown(e) {
logger("SuggestMenuContent handleKeyDown");
if (e.key === "ArrowUp") {
e.preventDefault();
setHighlightIndex((prevIndex) => {
let index = prevIndex - 1;
if (index < 0)
index = filteredFiles.length - 1;
return index;
});
} else if (e.key === "ArrowDown") {
e.preventDefault();
setHighlightIndex((prevIndex) => {
let index = prevIndex + 1;
if (index > filteredFiles.length - 1)
index = 0;
return index;
});
} else if (e.key === "Tab") {
setHighlightIndex((prevIndex) => {
let index = prevIndex + 1;
if (index > filteredFiles.length - 1)
index = 0;
return index;
});
}
}
nltEventSystem.addEventListener("keydown", handleKeyDown);
return () => nltEventSystem.removeEventListener("keydown", handleKeyDown);
}, [filteredFiles.length, logger, highlightIndex]);
const fileNames = filteredFiles.map((file) => file.name);
const uniqueFileNames = filterUniqueStrings(fileNames);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__suggest-menu",
children: [
showInput && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
background-color: var(--background-secondary);
border-bottom: 1px solid var(--table-border-color);
padding: 4px 10px;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
css: transparentInputStyle,
autoFocus: true,
value: localFilterValue,
onChange: (e) => setLocalFilterValue(e.target.value)
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
css: import_emotion_react_cjs.css`
max-height: 175px;
overflow-y: auto;
`,
children: [
filteredFiles.length === 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(suggest_item_default, {
file: null,
ref: null,
isHighlighted: true,
isFileNameUnique: false,
onItemClick
}),
filteredFiles.length > 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: filteredFiles.map((file, index) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(suggest_item_default, {
ref: highlightIndex === index ? highlightItemRef : null,
file,
isHighlighted: index === highlightIndex,
isFileNameUnique: uniqueFileNames.includes(
file.name
),
onItemClick
}, file.path))
})
]
})
]
});
}
// src/react/shared/suggest-menu/suggest-menu.tsx
var SuggestMenu = import_react62.default.forwardRef(
function SuggestMenu2({ id: id2, isOpen, top, left, filterValue, onItemClick }, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
id: id2,
isOpen,
top,
left,
ref,
width: 275,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SuggestMenuContent, {
filterValue,
onItemClick
})
});
}
);
var suggest_menu_default = SuggestMenu;
// src/shared/link/link-utils.ts
var getBasename = (filePath) => {
const fileName = stripDirectory(filePath);
return stripFileExtension(fileName);
};
var stripFileExtension = (filePath) => {
return filePath.substring(0, filePath.lastIndexOf("."));
};
var stripDirectory = (filePath) => {
return filePath.substring(filePath.lastIndexOf("/") + 1);
};
var isMarkdownFile = (extension) => {
return extension === "md";
};
var getWikiLinkText = (fileInfo, isFileNameUnique) => {
const { basename, name, path, extension } = fileInfo;
let text = basename;
if (!isMarkdownFile(extension)) {
text = name;
if (!isFileNameUnique)
text = `${path}|${basename}`;
} else {
const pathWithoutExtension = stripFileExtension(path);
if (!isFileNameUnique)
text = `${pathWithoutExtension}|${basename}`;
}
return text;
};
// src/react/table-app/text-cell-edit/index.tsx
function TextCellEdit({
shouldWrapOverflow,
menuCloseRequest,
value,
onChange,
onMenuClose
}) {
var _a, _b, _c;
const { menu, isMenuOpen, menuRef, openMenu, closeAllMenus, closeTopMenu } = useMenu(1 /* TWO */);
const { triggerRef, triggerPosition } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
topOffset: 35
});
const [localValue, setLocalValue] = import_react63.default.useState(value);
const inputRef = import_react63.default.useRef(null);
import_react63.default.useEffect(() => {
if (inputRef.current) {
const selectionIndex = inputRef.current.selectionStart;
if (localValue[selectionIndex - 1] === "]" && localValue[selectionIndex - 2] === "[") {
inputRef.current.selectionStart = selectionIndex - 1;
inputRef.current.selectionEnd = selectionIndex - 1;
} else if (localValue[selectionIndex - 1] === "]" && localValue[selectionIndex - 2] === "]" && localValue[selectionIndex - 3] === "[") {
inputRef.current.selectionStart = selectionIndex - 2;
inputRef.current.selectionEnd = selectionIndex - 2;
}
}
}, [inputRef, localValue]);
useInputSelection(inputRef, localValue);
const logger = useLogger();
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react63.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (localValue !== value)
onChange(localValue);
onMenuClose();
}
}, [
value,
localValue,
hasCloseRequestTimeChanged,
menuCloseRequest,
onMenuClose,
onChange
]);
function handleKeyDown(e) {
const el = e.target;
logger("TextCellEdit handleKeyDown");
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
const cursorPosition = el.selectionStart;
if (isMenuOpen) {
if (!isSurroundedByDoubleBrackets(value, cursorPosition))
closeTopMenu();
}
if (inputRef.current) {
const inputEl = inputRef.current;
inputEl.selectionStart = cursorPosition;
inputEl.selectionEnd = cursorPosition;
}
} else if (e.key === "Enter") {
if (e.shiftKey && !isMenuOpen) {
e.stopPropagation();
return;
}
e.preventDefault();
}
}
function handleTextareaChange(e) {
const inputValue = e.target.value;
let newValue = inputValue;
if (inputRef.current) {
const inputEl = inputRef.current;
if (inputValue.length > localValue.length) {
newValue = addClosingBracket(newValue, inputEl.selectionStart);
} else {
newValue = removeClosingBracket(
localValue,
inputValue,
inputEl.selectionStart
);
}
if (isSurroundedByDoubleBrackets(newValue, inputEl.selectionStart)) {
if (!isMenuOpen)
openMenu(menu);
}
}
setLocalValue(newValue);
}
function handleSuggestItemClick(file, isFileNameUnique) {
var _a2, _b2;
if (file) {
const fileName = getWikiLinkText(file, isFileNameUnique);
const newValue = doubleBracketsInnerReplace(
localValue,
(_b2 = (_a2 = inputRef.current) == null ? void 0 : _a2.selectionStart) != null ? _b2 : 0,
fileName
);
onChange(newValue);
}
closeAllMenus();
}
const overflowStyle = useOverflow(shouldWrapOverflow);
const filterValue = (_c = getFilterValue(localValue, (_b = (_a = inputRef.current) == null ? void 0 : _a.selectionStart) != null ? _b : 0)) != null ? _c : "";
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__text-cell-edit",
ref: triggerRef,
css: import_emotion_react_cjs.css`
width: 100%;
height: 100%;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("textarea", {
autoFocus: true,
css: import_emotion_react_cjs.css`
${textAreaStyle}
${overflowStyle}
`,
ref: inputRef,
value: localValue,
onKeyDown: handleKeyDown,
onChange: handleTextareaChange,
onBlur: (e) => {
e.target.classList.add("NLT__blur--cell");
}
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(suggest_menu_default, {
id: menu.id,
ref: menuRef,
isOpen: isMenuOpen,
top: triggerPosition.top,
left: triggerPosition.left,
filterValue,
onItemClick: handleSuggestItemClick
})
]
});
}
// src/react/table-app/tag-cell-edit/index.tsx
var import_react72 = __toESM(require_react());
// src/react/table-app/tag-cell-edit/menu-header.tsx
var import_react66 = __toESM(require_react());
function MenuHeader({
cellTags,
inputValue,
onInputValueChange,
onRemoveTag
}) {
const inputRef = import_react66.default.useRef(null);
function handleInputChange(value) {
if (value.match(/^\s/))
return;
onInputValueChange(value);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
background-color: var(--background-secondary);
border-bottom: 1px solid var(--table-border-color);
padding: 4px 10px;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Wrap, {
spacingX: "sm",
children: [
cellTags.map((tag) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Tag6, {
id: tag.id,
color: tag.color,
markdown: tag.markdown,
maxWidth: "150px",
showRemove: true,
onRemoveClick: onRemoveTag
}, tag.id)),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
className: "NLT__focusable",
css: transparentInputStyle,
autoFocus: true,
ref: inputRef,
type: "text",
value: inputValue,
onChange: (e) => handleInputChange(e.target.value)
})
]
})
});
}
// src/react/table-app/tag-cell-edit/create-tag.tsx
function CreateTag({ markdown, color, onTagAdd }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
tabIndex: 0,
css: import_emotion_react_cjs.css`
display: flex;
align-items: center;
padding: 4px 6px;
width: 100%;
overflow: hidden;
`,
className: "NLT__focusable NLT__selectable",
onClick: () => {
onTagAdd(markdown, color);
},
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
children: "Create"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Tag6, {
markdown,
color,
maxWidth: "120px"
})
]
})
});
}
// src/react/table-app/tag-color-menu/index.tsx
var import_react69 = __toESM(require_react());
// src/shared/stringUtils.ts
var uppercaseFirst = (input) => {
return input.charAt(0).toUpperCase() + input.slice(1);
};
// src/react/table-app/tag-color-menu/components/color-item/index.tsx
var import_react68 = __toESM(require_react());
function ColorItem({
isDarkMode,
color,
isSelected,
onColorClick
}) {
const ref = import_react68.default.useRef(null);
import_react68.default.useEffect(() => {
if (!ref.current)
return;
if (isSelected) {
ref.current.focus();
}
}, [isSelected]);
function handleKeyDown(e) {
if (e.key === "Enter") {
e.stopPropagation();
onColorClick(color);
}
}
let containerClass = "NLT__color-item NLT__focusable NLT__selectable";
if (isSelected)
containerClass += " NLT__selected";
const colorClass = findColorClassName(isDarkMode, color);
let squareClass = "NLT__color-item-square";
squareClass += " " + colorClass;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
ref,
tabIndex: 0,
className: containerClass,
onKeyDown: handleKeyDown,
onClick: () => {
onColorClick(color);
},
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: squareClass
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
children: uppercaseFirst(color)
})
]
});
}
// src/react/table-app/tag-color-menu/index.tsx
var TagColorMenu = import_react69.default.forwardRef(
function TagColorMenu2({
menuId,
isOpen,
top,
left,
selectedColor,
onColorClick,
onDeleteClick
}, ref) {
const { isDarkMode } = useAppSelector((state) => state.global);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
ref,
id: menuId,
isOpen,
top,
left,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__tag-color-menu",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
isVertical: true,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "lg",
py: "sm",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "Color"
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
children: Object.values(Color).map((color) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ColorItem, {
isDarkMode,
color,
onColorClick,
isSelected: selectedColor === color
}, color))
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "trash-2",
name: "Delete",
onClick: onDeleteClick
})
]
})
})
});
}
);
var tag_color_menu_default = TagColorMenu;
// src/react/table-app/tag-cell-edit/selectable-tag.tsx
function SelectableTag({
id: id2,
markdown,
color,
onClick,
onColorChange,
onDeleteClick
}) {
const { menu, isMenuOpen, menuRef, closeTopMenu } = useMenu(1 /* TWO */);
const { triggerRef, triggerPosition } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
openDirection: "right",
leftOffset: -55,
topOffset: -100
});
function handleColorChange(color2) {
onColorChange(id2, color2);
closeTopMenu();
}
function handleDeleteClick() {
onDeleteClick(id2);
closeTopMenu();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
tabIndex: 0,
ref: triggerRef,
css: import_emotion_react_cjs.css`
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--nlt-spacing--sm) var(--nlt-spacing--md);
overflow: hidden;
`,
className: "NLT__focusable NLT__selectable",
onClick: (e) => {
const target = e.target;
if (target.classList.contains("NLT__menu-trigger"))
return;
e.stopPropagation();
onClick(id2);
},
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Tag6, {
markdown,
color,
maxWidth: "150px"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuButton, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "more-horizontal"
}),
menu
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(tag_color_menu_default, {
isOpen: isMenuOpen,
ref: menuRef,
menuId: menu.id,
top: triggerPosition.top,
left: triggerPosition.left,
selectedColor: color,
onColorClick: (color2) => handleColorChange(color2),
onDeleteClick: handleDeleteClick
})
]
});
}
// src/react/table-app/tag-cell-edit/menu-body.tsx
function MenuBody({
columnTags,
inputValue,
newTagColor,
onTagAdd,
onTagClick,
onTagColorChange,
onTagDelete
}) {
const tagWithSameCase = columnTags.find(
(tag) => tag.markdown === inputValue
);
const filteredTags = columnTags.filter(
(tag) => tag.markdown.toLowerCase().includes(inputValue.toLowerCase())
);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
css: import_emotion_react_cjs.css`
max-height: 140px;
overflow-y: scroll;
`,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "lg",
py: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "Select an option or create one"
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
css: import_emotion_react_cjs.css`
width: 100%;
`,
children: [
tagWithSameCase === void 0 && inputValue !== "" && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CreateTag, {
markdown: inputValue,
color: newTagColor,
onTagAdd
}),
filteredTags.map((tag) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SelectableTag, {
id: tag.id,
color: tag.color,
markdown: tag.markdown,
onColorChange: onTagColorChange,
onClick: onTagClick,
onDeleteClick: onTagDelete
}, tag.id))
]
})
]
});
}
// src/react/table-app/tag-cell-edit/index.tsx
function TagCellEdit({
columnTags,
cellTags,
menuCloseRequest,
onTagClick,
onTagAdd,
onTagColorChange,
onTagDelete,
onRemoveTag,
onMenuClose
}) {
const [inputValue, setInputValue] = import_react72.default.useState("");
const [newTagColor, setNewTagColor] = import_react72.default.useState(randomColor());
const handleTagAdd = import_react72.default.useCallback(
(markdown, color) => {
onTagAdd(markdown, color);
setInputValue("");
setNewTagColor(randomColor());
onMenuClose();
},
[onTagAdd, onMenuClose]
);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react72.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (menuCloseRequest.type === "enter") {
const shouldAddTag = columnTags.find((tag) => tag.markdown === inputValue) === void 0;
if (shouldAddTag)
handleTagAdd(inputValue, newTagColor);
}
onMenuClose();
}
}, [
handleTagAdd,
columnTags,
inputValue,
newTagColor,
hasCloseRequestTimeChanged,
menuCloseRequest,
onMenuClose
]);
function handleTagClick(id2) {
onTagClick(id2);
onMenuClose();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__tag-cell-edit",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuHeader, {
inputValue,
cellTags,
onInputValueChange: setInputValue,
onRemoveTag
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuBody, {
inputValue,
columnTags,
newTagColor,
onTagAdd: handleTagAdd,
onTagClick: handleTagClick,
onTagDelete,
onTagColorChange
})
]
});
}
// src/react/table-app/date-cell-edit/index.tsx
var import_react74 = __toESM(require_react());
// src/react/table-app/date-cell-edit/date-format-menu.tsx
var import_react73 = __toESM(require_react());
var DateFormatMenu = import_react73.default.forwardRef(
function DateFormatMenu2({ id: id2, top, left, isOpen, value, onChange }, ref) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
ref,
isOpen,
id: id2,
top,
left,
width: 175,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__date-format-menu",
children: Object.values([
"dd/mm/yyyy" /* DD_MM_YYYY */,
"mm/dd/yyyy" /* MM_DD_YYYY */,
"yyyy/mm/dd" /* YYYY_MM_DD */
]).map((format) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: getDisplayNameForDateFormat(format),
isSelected: value === format,
onClick: () => {
onChange(format);
}
}, format))
})
});
}
);
var date_format_menu_default = DateFormatMenu;
// src/react/table-app/date-cell-edit/index.tsx
function DateCellEdit({
value,
menuCloseRequest,
dateFormat,
onDateTimeChange,
onMenuClose,
onDateFormatChange
}) {
const { menu, isMenuOpen, menuRef, closeTopMenu } = useMenu(1 /* TWO */);
const { triggerRef, triggerPosition } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen, {
openDirection: "right",
topOffset: 35,
leftOffset: -50
});
const [localValue, setLocalValue] = import_react74.default.useState(
value === null ? "" : unixTimeToDateString(value, dateFormat)
);
const [isInputInvalid, setInputInvalid] = import_react74.default.useState(false);
const [closeTime, setCloseTime] = import_react74.default.useState(0);
const inputRef = import_react74.default.useRef(null);
import_react74.default.useEffect(() => {
setLocalValue(
value === null ? "" : unixTimeToDateString(value, dateFormat)
);
}, [value, dateFormat]);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react74.default.useEffect(() => {
function validateInput() {
let newValue = null;
if (localValue !== "") {
if (isValidDateFormat(localValue, dateFormat)) {
newValue = dateStringToUnixTime(localValue, dateFormat);
} else {
if ((menuCloseRequest == null ? void 0 : menuCloseRequest.type) === "enter") {
setInputInvalid(true);
return;
}
newValue = value;
}
}
if (newValue !== value) {
setInputInvalid(false);
onDateTimeChange(newValue);
}
setCloseTime(Date.now());
}
if (hasCloseRequestTimeChanged && menuCloseRequest !== null)
validateInput();
}, [
value,
hasCloseRequestTimeChanged,
localValue,
menuCloseRequest,
dateFormat,
onDateTimeChange,
onMenuClose
]);
import_react74.default.useEffect(() => {
if (closeTime !== 0) {
onMenuClose();
}
}, [closeTime, onMenuClose]);
function handleDateFormatChange(value2) {
onDateFormatChange(value2);
closeTopMenu();
}
function handleClearClick() {
onDateTimeChange(null);
onMenuClose();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
ref: triggerRef,
className: "NLT__date-cell-edit",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "md",
isVertical: true,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "md",
py: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
tabIndex: 0,
className: "NLT__focusable",
css: import_emotion_react_cjs.css`
${borderInputStyle}
${isInputInvalid ? "&:focus-visible { outline: 2px solid var(--background-modifier-error) !important; }" : ""}
`,
ref: inputRef,
autoFocus: true,
value: localValue,
onChange: (e) => setLocalValue(e.target.value)
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_trigger_default, {
menu,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
isFocusable: false,
name: "Date format",
value: getDisplayNameForDateFormat(dateFormat)
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Clear",
onClick: handleClearClick
})
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(date_format_menu_default, {
id: menu.id,
isOpen: isMenuOpen,
ref: menuRef,
top: triggerPosition.top,
left: triggerPosition.left,
value: dateFormat,
onChange: handleDateFormatChange
})
]
});
}
// src/react/table-app/multi-tag-cell/index.tsx
function MultiTagCell({ cellTags, shouldWrapOverflow }) {
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__multi-tag-cell",
css: overflowStyle,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Wrap, {
children: cellTags.map((tag) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Tag6, {
markdown: tag.markdown,
color: tag.color
}, tag.id))
})
});
}
// src/react/table-app/last-edited-time-cell/index.tsx
function LastEditedTimeCell({
value,
format,
shouldWrapOverflow
}) {
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__last-edited-time-cell",
css: overflowStyle,
children: unixTimeToDateTimeString(value, format)
});
}
// src/react/table-app/creation-time-cell/index.tsx
function CreationTimeCell({
value,
format,
shouldWrapOverflow
}) {
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__creation-time-cell",
css: overflowStyle,
children: unixTimeToDateTimeString(value, format)
});
}
// src/react/table-app/currency-cell/index.tsx
function CurrencyCell({
value,
currencyType,
shouldWrapOverflow
}) {
const content = getCurrencyCellContent(value, currencyType);
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__currency-cell",
css: overflowStyle,
children: content
});
}
// src/react/table-app/currency-cell-edit/index.tsx
var import_react76 = __toESM(require_react());
function CurrencyCellEdit({
value,
menuCloseRequest,
onChange,
onMenuClose
}) {
const initialValue = isNumber(value) ? value : "";
const [localValue, setLocalValue] = import_react76.default.useState(initialValue);
const inputRef = import_react76.default.useRef(null);
useInputSelection(inputRef, localValue);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react76.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (localValue !== value)
onChange(localValue);
onMenuClose();
}
}, [
value,
localValue,
hasCloseRequestTimeChanged,
menuCloseRequest,
onMenuClose,
onChange
]);
function handleChange(inputValue) {
if (!isValidNumberInput(inputValue))
return;
setLocalValue(inputValue);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__currency-cell-edit",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
autoFocus: true,
css: numberInputStyle,
ref: inputRef,
type: "text",
inputMode: "numeric",
value: localValue,
onChange: (e) => handleChange(e.target.value),
onBlur: (e) => {
e.target.classList.add("NLT__blur--cell");
}
})
});
}
// src/shared/cell-content/file-cell-content.ts
var getFileCellContent = (markdown) => {
if (markdown === "")
return markdown;
const linkRegex = new RegExp(/\[\[([^[\]]+)\]\]/);
const matches = markdown.match(linkRegex);
let matchStartIndex = -1;
let matchEndIndex = -1;
if (matches) {
matchStartIndex = markdown.indexOf(matches[0]);
matchEndIndex = matchStartIndex + matches[0].length;
}
if (matches === null) {
return `[[${markdown}]]`;
} else if (matchStartIndex === 0) {
return `${markdown.slice(0, matchEndIndex + 1).trim()}`;
} else {
return `[[${markdown.slice(0, matchStartIndex).trim()}]]`;
}
};
// src/react/table-app/file-cell/index.tsx
function FileCell({ markdown, shouldWrapOverflow }) {
const content = getFileCellContent(markdown);
const { containerRef, renderRef } = useRenderMarkdown(content, false);
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__file-cell",
css: overflowStyle,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
p {
margin: 0;
text-align: left;
}
`,
ref: (node) => {
containerRef.current = node;
appendOrReplaceFirstChild(node, renderRef.current);
}
})
});
}
// src/react/table-app/file-cell-edit/index.tsx
function FileCellEdit({ onChange, onMenuClose }) {
function handleSuggestItemClick(file, isFileNameUnique) {
if (file) {
let fileName = file.basename;
if (file.extension !== "md")
fileName = file.name;
if (!isFileNameUnique)
fileName = `${file.path}|${fileName}`;
onChange(`[[${fileName}]]`);
}
onMenuClose();
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__file-cell-edit",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(SuggestMenuContent, {
showInput: true,
onItemClick: handleSuggestItemClick
})
});
}
// src/shared/cell-content/embed-cell-content.ts
var getEmbedCellContent = (markdown, renderMarkdown2) => {
if (isURL(markdown)) {
if (renderMarkdown2)
return `![](${markdown})`;
return markdown;
}
return "";
};
// src/react/table-app/embed-cell/index.tsx
var EmbeddedLink = ({
markdown,
aspectRatio,
horizontalPadding,
verticalPadding
}) => {
const { containerRef, renderRef } = useRenderMarkdown(markdown, true);
const paddingX = getSpacing(horizontalPadding);
const paddingY = getSpacing(verticalPadding);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
width: 100%;
aspect-ratio: ${aspectRatio};
padding-left: ${paddingX};
padding-right: ${paddingX};
padding-top: ${paddingY};
padding-bottom: ${paddingY};
iframe {
width: 100%;
height: 100%;
}
p {
width: 100%;
height: 100%;
margin: 0px;
}
`,
ref: (node) => {
containerRef.current = node;
appendOrReplaceFirstChild(node, renderRef.current);
}
});
};
function EmbedCell({
markdown,
aspectRatio,
horizontalPadding,
verticalPadding
}) {
let isValidURL = true;
const content = getEmbedCellContent(markdown, true);
if (content === "")
isValidURL = false;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__embed-cell",
css: import_emotion_react_cjs.css`
width: 100%;
height: 100%;
`,
children: [
isValidURL && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(EmbeddedLink, {
markdown: content,
aspectRatio,
horizontalPadding,
verticalPadding
}),
!isValidURL && markdown !== "" && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "Invalid URL"
})
]
});
}
// src/react/table-app/embed-cell-edit/index.tsx
var import_react79 = __toESM(require_react());
function EmbedCellEdit({
shouldWrapOverflow,
menuCloseRequest,
value,
onChange,
onMenuClose
}) {
const [localValue, setLocalValue] = import_react79.default.useState(value);
const inputRef = import_react79.default.useRef(null);
useInputSelection(inputRef, localValue);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react79.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (localValue !== value)
onChange(localValue);
onMenuClose();
}
}, [
value,
localValue,
hasCloseRequestTimeChanged,
menuCloseRequest,
onMenuClose,
onChange
]);
function handleTextareaChange(e) {
const inputValue = e.target.value;
setLocalValue(inputValue);
}
const overflowStyle = useOverflow(shouldWrapOverflow);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__embed-cell-edit",
css: import_emotion_react_cjs.css`
width: 100%;
height: 100%;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("textarea", {
autoFocus: true,
css: import_emotion_react_cjs.css`
${textAreaStyle}
${overflowStyle}
`,
ref: inputRef,
value: localValue,
onChange: handleTextareaChange,
onBlur: (e) => {
e.target.classList.add("NLT__blur--cell");
}
})
});
}
// src/obsidian-shim/build/notification.ts
var import_obsidian6 = require("obsidian");
var Notification = class {
constructor(message) {
new import_obsidian6.Notice(message);
}
};
// src/react/table-app/body-cell/index.tsx
function BodyCell5({
cellId,
columnId,
rowId,
markdown,
aspectRatio,
verticalPadding,
horizontalPadding,
dateFormat,
dateTime,
columnCurrencyType,
columnType,
rowCreationTime,
rowLastEditedTime: rowLastEditedTime2,
columnTags,
cellTagIds,
width,
shouldWrapOverflow,
onTagRemoveClick,
onTagMultipleRemove,
onTagColorChange,
onTagDelete,
onTagClick,
onContentChange,
onDateFormatChange,
onDateTimeChange,
onTagAdd
}) {
const shouldRequestOnClose = columnType === "text" /* TEXT */ || columnType === "embed" /* EMBED */ || columnType === "number" /* NUMBER */ || columnType === "currency" /* CURRENCY */ || columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */ || columnType === "date" /* DATE */;
const { menu, isMenuOpen, menuCloseRequest, menuRef, closeTopMenu } = useMenu(0 /* ONE */, {
shouldRequestOnClose
});
const { triggerPosition, triggerRef } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen);
function handleCellContextClick() {
return __async(this, null, function* () {
try {
yield navigator.clipboard.writeText(markdown);
new Notification("Copied text to clipboard");
} catch (err) {
console.log(err);
}
});
}
function toggleCheckbox() {
const isChecked = isCheckboxChecked(markdown);
if (isChecked) {
handleCheckboxChange(CHECKBOX_MARKDOWN_UNCHECKED);
} else {
handleCheckboxChange(CHECKBOX_MARKDOWN_CHECKED);
}
}
function handleMenuTriggerBackspaceDown() {
if (columnType === "text" /* TEXT */ || columnType === "embed" /* EMBED */ || columnType === "number" /* NUMBER */ || columnType === "currency" /* CURRENCY */ || columnType === "file" /* FILE */) {
onContentChange(cellId, rowId, "");
} else if (columnType === "date" /* DATE */) {
onDateTimeChange(cellId, rowId, null);
} else if (columnType === "checkbox" /* CHECKBOX */) {
onContentChange(cellId, rowId, CHECKBOX_MARKDOWN_UNCHECKED);
} else if (columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */) {
onTagMultipleRemove(cellId, rowId, cellTagIds);
}
}
function handleMenuTriggerEnterDown() {
if (columnType === "checkbox" /* CHECKBOX */)
toggleCheckbox();
}
function handleMenuTriggerClick() {
if (columnType === "checkbox" /* CHECKBOX */) {
toggleCheckbox();
}
}
function handleTagAdd(markdown2, color) {
if (markdown2 === "")
return;
onTagAdd(
cellId,
columnId,
rowId,
markdown2.trim(),
color,
columnType === "multi-tag" /* MULTI_TAG */
);
}
function handleRemoveTagClick(tagId) {
onTagRemoveClick(cellId, rowId, tagId);
}
function handleTagColorChange(tagId, color) {
onTagColorChange(columnId, tagId, color);
}
function handleTagDeleteClick(tagId) {
onTagDelete(columnId, tagId);
}
function handleTagClick(tagId) {
onTagClick(cellId, rowId, tagId, columnType === "multi-tag" /* MULTI_TAG */);
}
const handleInputChange = import_react81.default.useCallback(
(value) => {
onContentChange(cellId, rowId, value);
},
[cellId, rowId, onContentChange]
);
function handleCheckboxChange(value) {
onContentChange(cellId, rowId, value);
}
function handleDateFormatChange(value) {
onDateFormatChange(columnId, value);
}
const handleDateTimeChange = import_react81.default.useCallback(
(value) => {
onDateTimeChange(cellId, rowId, value);
},
[cellId, rowId, onDateTimeChange]
);
const handleMenuClose = import_react81.default.useCallback(() => {
closeTopMenu();
}, [closeTopMenu]);
const { width: measuredWidth, height: measuredHeight } = triggerPosition;
let menuHeight = measuredHeight;
if (columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */ || columnType === "date" /* DATE */ || columnType === "number" /* NUMBER */ || columnType === "currency" /* CURRENCY */ || columnType === "file" /* FILE */) {
menuHeight = 0;
}
let menuWidth = measuredWidth;
if (columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */) {
menuWidth = 250;
} else if (columnType === "file" /* FILE */) {
menuWidth = 275;
} else if (columnType === "date" /* DATE */) {
menuWidth = 175;
}
let className = "NLT__body-td-container";
if (columnType === "last-edited-time" /* LAST_EDITED_TIME */ || columnType === "creation-time" /* CREATION_TIME */) {
className += " NLT__default-cursor";
}
const cellTags = columnTags.filter((tag) => cellTagIds.includes(tag.id));
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_trigger_default, {
isCell: true,
menu,
onClick: handleMenuTriggerClick,
onEnterDown: handleMenuTriggerEnterDown,
onBackspaceDown: handleMenuTriggerBackspaceDown,
shouldRun: columnType !== "checkbox" /* CHECKBOX */ && columnType !== "creation-time" /* CREATION_TIME */ && columnType !== "last-edited-time" /* LAST_EDITED_TIME */,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
ref: triggerRef,
onContextMenu: handleCellContextClick,
css: import_emotion_react_cjs.css`
display: flex;
width: 100%;
height: 100%;
min-height: var(--nlt-cell-min-height);
padding: var(--nlt-cell-spacing-x)
var(--nlt-cell-spacing-y);
cursor: pointer;
`,
className,
style: {
width
},
children: [
columnType === "text" /* TEXT */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TextCell, {
markdown,
shouldWrapOverflow
}),
columnType === "embed" /* EMBED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(EmbedCell, {
markdown,
verticalPadding,
horizontalPadding,
aspectRatio
}),
columnType === "file" /* FILE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FileCell, {
markdown,
shouldWrapOverflow
}),
columnType === "number" /* NUMBER */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NumberCell, {
value: markdown,
shouldWrapOverflow
}),
columnType === "currency" /* CURRENCY */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CurrencyCell, {
value: markdown,
currencyType: columnCurrencyType,
shouldWrapOverflow
}),
columnType === "tag" /* TAG */ && cellTags.length === 1 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TagCell, {
markdown: cellTags[0].markdown,
color: cellTags[0].color,
shouldWrapOverflow
}),
columnType === "multi-tag" /* MULTI_TAG */ && cellTags.length !== 0 && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MultiTagCell, {
cellTags,
shouldWrapOverflow
}),
columnType === "date" /* DATE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(DateCell, {
value: dateTime,
format: dateFormat
}),
columnType === "checkbox" /* CHECKBOX */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CheckboxCell, {
value: markdown
}),
columnType === "creation-time" /* CREATION_TIME */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CreationTimeCell, {
value: rowCreationTime,
format: dateFormat,
shouldWrapOverflow
}),
columnType === "last-edited-time" /* LAST_EDITED_TIME */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(LastEditedTimeCell, {
value: rowLastEditedTime2,
format: dateFormat,
shouldWrapOverflow
})
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(menu_default, {
ref: menuRef,
id: menu.id,
hideBorder: columnType === "text" /* TEXT */ || columnType === "embed" /* EMBED */ || columnType === "currency" /* CURRENCY */ || columnType === "number" /* NUMBER */,
isOpen: isMenuOpen,
top: triggerPosition.top,
left: triggerPosition.left,
width: menuWidth,
height: menuHeight,
children: [
columnType === "text" /* TEXT */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TextCellEdit, {
menuCloseRequest,
shouldWrapOverflow,
value: markdown,
onChange: handleInputChange,
onMenuClose: handleMenuClose
}),
columnType === "embed" /* EMBED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(EmbedCellEdit, {
menuCloseRequest,
shouldWrapOverflow,
value: markdown,
onChange: handleInputChange,
onMenuClose: handleMenuClose
}),
columnType === "file" /* FILE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FileCellEdit, {
onChange: handleInputChange,
onMenuClose: handleMenuClose
}),
columnType === "number" /* NUMBER */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NumberCellEdit, {
menuCloseRequest,
value: markdown,
onChange: handleInputChange,
onMenuClose: handleMenuClose
}),
(columnType === "tag" /* TAG */ || columnType === "multi-tag" /* MULTI_TAG */) && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TagCellEdit, {
menuCloseRequest,
columnTags,
cellTags,
onTagColorChange: handleTagColorChange,
onTagAdd: handleTagAdd,
onRemoveTag: handleRemoveTagClick,
onTagClick: handleTagClick,
onTagDelete: handleTagDeleteClick,
onMenuClose: handleMenuClose
}),
columnType === "date" /* DATE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(DateCellEdit, {
value: dateTime,
menuCloseRequest,
dateFormat,
onDateTimeChange: handleDateTimeChange,
onDateFormatChange: handleDateFormatChange,
onMenuClose: handleMenuClose
}),
columnType === "currency" /* CURRENCY */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CurrencyCellEdit, {
menuCloseRequest,
value: markdown,
onChange: handleInputChange,
onMenuClose: handleMenuClose
})
]
})
]
});
}
// src/react/table-app/new-row-button/index.tsx
function NewRowButton({ onClick }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__new-row",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
onClick: () => onClick(),
children: "New row"
})
});
}
// src/react/table-app/new-column-button/index.tsx
function NewColumnButton({ onClick }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__new-column",
css: import_emotion_react_cjs.css`
width: 50px;
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "plus"
}),
ariaLabel: "New column",
onClick: () => onClick()
})
});
}
// src/react/table-app/header-cell/index.tsx
var import_react89 = __toESM(require_react());
// src/react/shared/icon/utils.tsx
var getIconIdForCellType = (type) => {
switch (type) {
case "text" /* TEXT */:
return "text";
case "embed" /* EMBED */:
return "link";
case "file" /* FILE */:
return "file";
case "number" /* NUMBER */:
return "hash";
case "checkbox" /* CHECKBOX */:
return "check-square";
case "creation-time" /* CREATION_TIME */:
case "last-edited-time" /* LAST_EDITED_TIME */:
return "clock-2";
case "tag" /* TAG */:
return "tag";
case "multi-tag" /* MULTI_TAG */:
return "tags";
case "date" /* DATE */:
return "calendar";
case "currency" /* CURRENCY */:
return "banknote";
default:
return "text";
}
};
// src/react/table-app/header-cell/use-column-resize.ts
var import_react84 = __toESM(require_react());
var useColumnResize = (columnId, onMove) => {
const { setResizingColumnId } = useTableState();
const mouseDownX = (0, import_react84.useRef)(0);
function handleMouseMove(e) {
const dist = e.pageX - mouseDownX.current;
onMove(dist);
}
function handleTouchMove(e) {
e.stopPropagation();
const dist = e.touches[0].pageX - mouseDownX.current;
onMove(dist);
}
function handleMouseUp() {
document.removeEventListener("mousemove", handleMouseMove);
document.removeEventListener("mouseup", handleMouseUp);
setTimeout(() => {
setResizingColumnId(null);
}, 100);
}
function handleTouchEnd() {
document.removeEventListener("touchmove", handleTouchMove);
document.removeEventListener("touchend", handleTouchEnd);
setTimeout(() => {
setResizingColumnId(null);
}, 100);
}
function handleTouchStart(e) {
if (e.detail >= 2)
return;
document.addEventListener("touchmove", handleTouchMove);
document.addEventListener("touchend", handleTouchEnd);
mouseDownX.current = e.touches[0].pageX;
setResizingColumnId(columnId);
}
function handleMouseDown(e) {
if (e.detail >= 2)
return;
e.preventDefault();
document.addEventListener("mousemove", handleMouseMove);
document.addEventListener("mouseup", handleMouseUp);
mouseDownX.current = e.pageX;
setResizingColumnId(columnId);
}
return { handleMouseDown, handleTouchStart };
};
// src/react/table-app/header-cell/resize-container.tsx
var containerStyle = import_emotion_react_cjs.css`
position: relative;
`;
var innerStyle = import_emotion_react_cjs.css`
position: absolute;
left: -5px;
cursor: col-resize;
width: 8px;
height: 100%;
&:hover {
background-color: var(--interactive-accent);
}
&:active {
background-color: var(--interactive-accent);
}
`;
var dragStyle = import_emotion_react_cjs.css`
background-color: var(--interactive-accent);
`;
function ResizeContainer({
currentResizingId,
columnId,
width,
onWidthChange,
onMenuClose
}) {
const { handleMouseDown, handleTouchStart } = useColumnResize(
columnId,
(dist) => {
const oldWidth = pxToNum(width);
const newWidth = oldWidth + dist;
if (newWidth < MIN_COLUMN_WIDTH)
return;
onWidthChange(columnId, numToPx(newWidth));
}
);
const isDragging = columnId === currentResizingId;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: containerStyle,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__resize-handle",
css: [innerStyle, isDragging && dragStyle],
onMouseDown: (e) => {
onMenuClose();
handleMouseDown(e);
},
onTouchStart: handleTouchStart,
onClick: (e) => {
e.stopPropagation();
if (e.detail === 2)
onWidthChange(columnId, "unset");
}
})
});
}
// src/react/table-app/header-cell-edit/index.tsx
var import_react87 = __toESM(require_react());
// src/react/table-app/header-cell-edit/submenu.tsx
function Submenu({ title, children, onBackClick }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
p: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "md",
isVertical: true,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Button, {
icon: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId: "arrow-left"
}),
onClick: () => {
onBackClick();
}
}),
title
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {})
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
children
})
]
});
}
// src/react/table-app/header-cell-edit/option-submenu.tsx
function OptionSubmenu({
type,
currencyType,
aspectRatio,
verticalPadding,
horizontalPadding,
title,
dateFormat,
onBackClick,
onSubmenuChange
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
pt: "sm",
pb: "lg",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "lg",
isVertical: true,
children: [
type === "embed" /* EMBED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Aspect Ratio",
value: aspectRatio,
onClick: () => onSubmenuChange(6 /* ASPECT_RATIO */)
}),
type === "embed" /* EMBED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Horizontal Padding",
value: horizontalPadding,
onClick: () => onSubmenuChange(4 /* HORIZONTAL_PADDING */)
}),
type === "embed" /* EMBED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Vertical Padding",
value: verticalPadding,
onClick: () => onSubmenuChange(5 /* VERTICAL_PADDING */)
}),
type === "currency" /* CURRENCY */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Currency",
value: getDisplayNameForCurrencyType(currencyType),
onClick: () => onSubmenuChange(2 /* CURRENCY */)
}),
(type === "creation-time" /* CREATION_TIME */ || type === "last-edited-time" /* LAST_EDITED_TIME */ || type === "date" /* DATE */) && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: "Date format",
value: getDisplayNameForDateFormat(dateFormat),
onClick: () => onSubmenuChange(3 /* DATE_FORMAT */)
})
]
})
})
});
}
// src/react/table-app/header-cell-edit/type-submenu.tsx
function TypeSubmenu({
title,
value,
onValueClick,
onBackClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: Object.values(CellType).map((type) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: getDisplayNameForCellType(type),
lucideId: getIconIdForCellType(type),
onClick: () => onValueClick(type),
isSelected: type === value
}, type))
});
}
// src/react/table-app/header-cell-edit/base-menu.tsx
var import_react86 = __toESM(require_react());
function BaseMenu({
shouldWrapOverflow,
columnName,
columnId,
columnType,
columnSortDir,
canDeleteColumn,
onSortClick,
onSubmenuChange,
onWrapOverflowToggle,
onDeleteClick,
onColumnNameChange
}) {
const lastKeyPressed = import_react86.default.useRef(null);
const inputRef = import_react86.default.useRef(null);
useInputSelection(inputRef, columnName);
function handleInputChange(inputValue) {
onColumnNameChange(inputValue);
}
function handleKeyDown(e) {
lastKeyPressed.current = e.key;
}
const hasOptions = columnType === "embed" /* EMBED */ || columnType === "date" /* DATE */ || columnType === "currency" /* CURRENCY */ || columnType === "last-edited-time" /* LAST_EDITED_TIME */ || columnType === "creation-time" /* CREATION_TIME */;
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
isVertical: true,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "sm",
isVertical: true,
width: "100%",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "md",
py: "sm",
width: "100%",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
className: "NLT__focusable",
autoFocus: true,
css: borderInputStyle,
ref: inputRef,
value: columnName,
onChange: (e) => handleInputChange(e.target.value),
onKeyDown: handleKeyDown
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "list",
name: "Type",
value: getDisplayNameForCellType(columnType),
onClick: () => {
onSubmenuChange(0 /* TYPE */);
}
}),
hasOptions && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "settings",
name: "Options",
onClick: () => {
onSubmenuChange(1 /* OPTIONS */);
}
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "arrow-up",
name: "Ascending",
onClick: () => onSortClick("asc" /* ASC */),
isSelected: columnSortDir === "asc" /* ASC */
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "arrow-down",
name: "Descending",
onClick: () => onSortClick("desc" /* DESC */),
isSelected: columnSortDir === "desc" /* DESC */
}),
canDeleteColumn && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
lucideId: "trash",
name: "Delete",
onClick: () => onDeleteClick()
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Divider, {}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Padding, {
px: "lg",
py: "md",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Flex, {
justify: "space-between",
align: "center",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Text, {
value: "Wrap overflow"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Switch, {
isChecked: shouldWrapOverflow,
onToggle: (value) => onWrapOverflowToggle(columnId, value)
})
]
})
})
]
});
}
// src/react/table-app/header-cell-edit/currency-submenu.tsx
function CurrencySubmenu({
title,
value,
onValueClick,
onBackClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: Object.values(CurrencyType).map((type) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: getDisplayNameForCurrencyType(type),
onClick: () => onValueClick(type),
isSelected: type === value
}, type))
});
}
// src/react/table-app/header-cell-edit/date-format-submenu.tsx
function DateFormatSubmenu({
title,
value,
onValueClick,
onBackClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: Object.values(DateFormat).map((format) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: getDisplayNameForDateFormat(format),
onClick: () => onValueClick(format),
isSelected: format === value
}, format))
});
}
// src/react/table-app/header-cell-edit/aspect-ratio-submenu.tsx
function AspectRatioSubmenu({
title,
value,
onValueClick,
onBackClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: Object.values(AspectRatio).map((ratio) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: ratio,
onClick: () => onValueClick(ratio),
isSelected: ratio === value
}, ratio))
});
}
// src/react/table-app/header-cell-edit/padding-submenu.tsx
function PaddingSubmenu({
title,
value,
onValueClick,
onBackClick
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Submenu, {
title,
onBackClick,
children: Object.values(PaddingSize).map((size) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuItem, {
name: size,
onClick: () => onValueClick(size),
isSelected: size === value
}, size))
});
}
// src/react/table-app/header-cell-edit/index.tsx
var HeaderMenu = import_react87.default.forwardRef(function HeaderMenu2({
isOpen,
id: id2,
top,
left,
cellId,
markdown,
dateFormat,
currencyType,
horizontalPadding,
verticalPadding,
aspectRatio,
canDeleteColumn,
columnType,
columnSortDir,
columnId,
menuCloseRequest,
shouldWrapOverflow,
onTypeSelect,
onVerticalPaddingClick,
onHorizontalPaddingClick,
onAspectRatioClick,
onSortClick,
onDeleteClick,
onMenuClose,
onWrapOverflowToggle,
onNameChange,
onCurrencyChange,
onDateFormatChange
}, ref) {
const [submenu, setSubmenu] = (0, import_react87.useState)(null);
const [localValue, setLocalValue] = (0, import_react87.useState)(markdown);
const hasCloseRequestTimeChanged = useCompare(
menuCloseRequest == null ? void 0 : menuCloseRequest.requestTime
);
import_react87.default.useEffect(() => {
if (hasCloseRequestTimeChanged && menuCloseRequest !== null) {
if (submenu === null) {
if (localValue !== markdown)
onNameChange(cellId, localValue);
}
onMenuClose();
}
}, [
markdown,
cellId,
hasCloseRequestTimeChanged,
menuCloseRequest,
submenu,
localValue,
onNameChange,
onMenuClose
]);
function handleSortClick(sortDir) {
onSortClick(columnId, sortDir);
onMenuClose();
}
function handleAspectRatioClick(value) {
onAspectRatioClick(columnId, value);
onMenuClose();
setSubmenu(1 /* OPTIONS */);
}
function handleHorizontalPaddingClick(value) {
onHorizontalPaddingClick(columnId, value);
onMenuClose();
setSubmenu(1 /* OPTIONS */);
}
function handleVerticalPaddingClick(value) {
onVerticalPaddingClick(columnId, value);
onMenuClose();
setSubmenu(1 /* OPTIONS */);
}
function handleTypeClick(type) {
onTypeSelect(columnId, type);
onMenuClose();
setSubmenu(null);
}
function handleDeleteClick() {
onDeleteClick(columnId);
onMenuClose();
setSubmenu(null);
}
function handleCurrencyClick(value) {
onCurrencyChange(columnId, value);
setSubmenu(1 /* OPTIONS */);
}
function handleDateFormatClick(value) {
onDateFormatChange(columnId, value);
setSubmenu(1 /* OPTIONS */);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_default, {
isOpen,
id: id2,
top,
left,
ref,
width: 175,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__header-menu",
css: import_emotion_react_cjs.css`
color: var(--text-normal);
`,
children: [
submenu === null && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(BaseMenu, {
canDeleteColumn,
cellId,
shouldWrapOverflow,
columnId,
columnName: localValue,
columnType,
menuCloseRequest,
columnSortDir,
onColumnNameChange: setLocalValue,
onSortClick: handleSortClick,
onSubmenuChange: setSubmenu,
onWrapOverflowToggle,
onDeleteClick: handleDeleteClick
}),
submenu === 1 /* OPTIONS */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(OptionSubmenu, {
title: "Options",
type: columnType,
horizontalPadding,
verticalPadding,
aspectRatio,
dateFormat,
currencyType,
onBackClick: () => setSubmenu(null),
onSubmenuChange: setSubmenu
}),
submenu === 6 /* ASPECT_RATIO */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(AspectRatioSubmenu, {
title: "Aspect Ratio",
value: aspectRatio,
onValueClick: handleAspectRatioClick,
onBackClick: () => setSubmenu(null)
}),
submenu === 4 /* HORIZONTAL_PADDING */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(PaddingSubmenu, {
title: "Horizontal Padding",
value: horizontalPadding,
onValueClick: handleHorizontalPaddingClick,
onBackClick: () => setSubmenu(null)
}),
submenu === 5 /* VERTICAL_PADDING */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(PaddingSubmenu, {
title: "Vertical Padding",
value: verticalPadding,
onValueClick: handleVerticalPaddingClick,
onBackClick: () => setSubmenu(null)
}),
submenu === 0 /* TYPE */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TypeSubmenu, {
title: "Type",
value: columnType,
onValueClick: handleTypeClick,
onBackClick: () => setSubmenu(null)
}),
submenu === 3 /* DATE_FORMAT */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(DateFormatSubmenu, {
title: "Date Format",
value: dateFormat,
onValueClick: handleDateFormatClick,
onBackClick: () => setSubmenu(1 /* OPTIONS */)
}),
submenu === 2 /* CURRENCY */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(CurrencySubmenu, {
title: "Currency",
value: currencyType,
onValueClick: handleCurrencyClick,
onBackClick: () => setSubmenu(1 /* OPTIONS */)
})
]
})
});
});
var header_cell_edit_default = HeaderMenu;
// src/react/table-app/header-cell/index.tsx
function HeaderCell2({
cellId,
rowId,
columnId,
currencyType,
width,
dateFormat,
horizontalPadding,
verticalPadding,
aspectRatio,
markdown,
shouldWrapOverflow,
resizingColumnId,
type,
sortDir,
numColumns,
onWidthChange,
onSortClick,
onTypeSelect,
onVerticalPaddingClick,
onHorizontalPaddingClick,
onAspectRatioClick,
onDeleteClick,
onWrapOverflowToggle,
onNameChange,
onCurrencyChange,
onDateFormatChange
}) {
const { menu, isMenuOpen, closeTopMenu, menuRef, menuCloseRequest } = useMenu(0 /* ONE */, { shouldRequestOnClose: true });
const { triggerPosition, triggerRef } = useMenuTriggerPosition();
useShiftMenu(triggerRef, menuRef, isMenuOpen);
const [forceUpdateTime, forceUpdate] = useForceUpdate();
import_react89.default.useEffect(() => {
if (width === "unset")
forceUpdate();
}, [width, forceUpdate]);
const shouldUpdateWidth = useCompare(forceUpdateTime, false);
import_react89.default.useEffect(() => {
if (shouldUpdateWidth) {
const newWidth = numToPx(triggerPosition.width);
onWidthChange(columnId, newWidth);
}
}, [columnId, shouldUpdateWidth, triggerPosition]);
function handleMenuClose() {
closeTopMenu();
}
const lucideId = getIconIdForCellType(type);
let contentClassName = "NLT__th-content";
if (resizingColumnId == null)
contentClassName += " NLT__selectable";
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(menu_trigger_default, {
isCell: true,
menu,
shouldRun: resizingColumnId === null,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
className: "NLT__th-container",
ref: triggerRef,
css: import_emotion_react_cjs.css`
display: flex;
justify-content: space-between;
min-height: var(--nlt-cell-min-height);
width: ${width};
`,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: contentClassName,
css: import_emotion_react_cjs.css`
display: flex;
align-items: center;
/* Use 100% so that the resize indicator appears at the end */
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
user-select: none;
padding: var(--nlt-cell-spacing-x)
var(--nlt-cell-spacing-y);
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "md",
align: "flex-start",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Icon, {
lucideId,
size: "md"
}),
markdown
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ResizeContainer, {
currentResizingId: resizingColumnId,
columnId,
width,
onWidthChange,
onMenuClose: () => closeTopMenu({ shouldFocusTrigger: false })
})
]
})
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(header_cell_edit_default, {
isOpen: isMenuOpen,
menuCloseRequest,
top: triggerPosition.top,
left: triggerPosition.left,
id: menu.id,
ref: menuRef,
aspectRatio,
horizontalPadding,
verticalPadding,
rowId,
currencyType,
dateFormat,
canDeleteColumn: numColumns > 1,
columnId,
cellId,
shouldWrapOverflow,
markdown,
columnSortDir: sortDir,
columnType: type,
numColumns,
onSortClick,
onTypeSelect,
onDeleteClick,
onMenuClose: handleMenuClose,
onWrapOverflowToggle,
onNameChange,
onCurrencyChange,
onDateFormatChange,
onVerticalPaddingClick,
onHorizontalPaddingClick,
onAspectRatioClick
})
]
});
}
// src/data/constants.ts
var CURRENT_PLUGIN_VERSION = "6.18.6";
var DEFAULT_TABLE_NAME = "Untitled";
var TABLE_EXTENSION = "table";
var EXTENSION_REGEX = new RegExp(/\.[a-z]*$/);
var WIKI_LINK_REGEX = new RegExp(/\[\[([^|\]]+)(?:\|([\w-]+))?\]\]/g);
// src/data/table-state-factory.ts
var createColumn = (options) => {
const { cellType = "text" /* TEXT */ } = options || {};
return {
id: v4_default(),
sortDir: "default" /* NONE */,
isVisible: true,
width: "140px",
type: cellType,
currencyType: "USD" /* UNITED_STATES */,
dateFormat: "mm/dd/yyyy" /* MM_DD_YYYY */,
shouldWrapOverflow: false,
tags: [],
functionType: "none" /* NONE */,
aspectRatio: "16/9" /* SIXTEEN_BY_NINE */,
horizontalPadding: "unset" /* UNSET */,
verticalPadding: "unset" /* UNSET */
};
};
var createHeaderRow = () => {
return {
id: v4_default()
};
};
var createFooterRow = () => {
return {
id: v4_default()
};
};
var createBodyRow = (index) => {
const currentTime = Date.now();
return {
id: v4_default(),
index,
creationTime: currentTime,
lastEditedTime: currentTime
};
};
var createHeaderCell = (columnId, rowId) => {
return {
id: v4_default(),
columnId,
rowId,
markdown: "New Column"
};
};
var createBodyCell = (columnId, rowId, options = {}) => {
const { cellType, tagIds = [] } = options || {};
return {
id: v4_default(),
columnId,
rowId,
dateTime: null,
markdown: cellType === "checkbox" /* CHECKBOX */ ? CHECKBOX_MARKDOWN_UNCHECKED : "",
tagIds
};
};
var createFilterRule = (columnId) => {
return {
id: v4_default(),
columnId,
type: "is" /* IS */,
text: "",
tagIds: [],
isEnabled: true
};
};
var createFooterCell = (columnId, rowId) => {
return {
id: v4_default(),
columnId,
rowId
};
};
var createTag = (markdown, options) => {
const { color = randomColor() } = options || {};
return {
id: v4_default(),
markdown,
color
};
};
var createTableState = (numColumns, numRows, options) => {
const { cellType } = options || {};
const columns = [];
for (let i2 = 0; i2 < numColumns; i2++)
columns.push(createColumn({ cellType }));
const headerRows = [];
headerRows.push(createHeaderRow());
const headerCells = [];
for (let x2 = 0; x2 < numColumns; x2++) {
headerCells.push(createHeaderCell(columns[x2].id, headerRows[0].id));
}
const bodyRows = [];
for (let i2 = 0; i2 < numRows; i2++)
bodyRows.push(createBodyRow(i2));
const bodyCells = [];
for (let y2 = 0; y2 < numRows; y2++) {
for (let x2 = 0; x2 < numColumns; x2++) {
bodyCells.push(createBodyCell(columns[x2].id, bodyRows[y2].id));
}
}
const footerRows = [];
footerRows.push(createFooterRow());
footerRows.push(createFooterRow());
const footerCells = [];
for (let y2 = 0; y2 < 2; y2++) {
for (let x2 = 0; x2 < numColumns; x2++) {
footerCells.push(createFooterCell(columns[x2].id, footerRows[y2].id));
}
}
const filterRules = [];
return {
model: {
columns,
headerRows,
bodyRows,
footerRows,
headerCells,
bodyCells,
footerCells,
filterRules
},
pluginVersion: CURRENT_PLUGIN_VERSION
};
};
// src/shared/table-state/filter-state-operations.ts
var addRule = (prevState, columnId) => {
const { model } = prevState;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, model), {
filterRules: [...model.filterRules, createFilterRule(columnId)]
})
});
};
var deleteRule = (prevState, id2) => {
const { model } = prevState;
const { filterRules } = model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, model), {
filterRules: filterRules.filter((rule) => rule.id !== id2)
})
});
};
var updateRule = (prevState, id2, key, value) => {
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
filterRules: prevState.model.filterRules.map((rule) => {
const isBoolean2 = typeof rule[key] === "boolean";
if (!isBoolean2 && value === void 0)
throw new Error(
"If the key type is not a boolean, a value must be provided"
);
if (rule.id === id2) {
return __spreadProps(__spreadValues({}, rule), {
[key]: isBoolean2 ? !rule[key] : value
});
}
return rule;
})
})
});
};
// src/shared/table-state/use-filter-rules.ts
var useFilterRules = (onChange) => {
const logger = useLogger();
function handleRuleColumnChange(id2, columnId) {
logger("handleRuleColumnChange", { id: id2, columnId });
onChange(
(prevState) => updateRule(prevState, id2, "columnId", columnId)
);
}
function handleRuleFilterTypeChange(id2, type) {
logger("handleRuleFilterTypeChange", {
id: id2,
type
});
onChange((prevState) => updateRule(prevState, id2, "type", type));
}
function handleRuleTextChange(id2, text) {
logger("handleRuleTextChange", { id: id2, text });
onChange((prevState) => updateRule(prevState, id2, "text", text));
}
function handleRuleToggle(id2) {
logger("handleRuleToggle", { id: id2 });
onChange((prevState) => updateRule(prevState, id2, "isEnabled"));
}
function handleRuleAddClick(columnId) {
logger("handleRuleAddClick", { columnId });
onChange((prevState) => addRule(prevState, columnId));
}
function handleRuleDeleteClick(id2) {
logger("handleRuleDeleteClick", {
id: id2
});
onChange((prevState) => deleteRule(prevState, id2));
}
function handleRuleTagsChange(id2, tagIds) {
logger("handleRuleTagsChange", {
id: id2,
tagIds
});
onChange((prevState) => updateRule(prevState, id2, "tagIds", tagIds));
}
return {
handleRuleAddClick,
handleRuleColumnChange,
handleRuleDeleteClick,
handleRuleFilterTypeChange,
handleRuleTextChange,
handleRuleToggle,
handleRuleTagsChange,
filterBodyRowsByRules
};
};
// src/shared/cell-content/time-content.ts
var getTimeCellContent = (dateTime, format) => {
if (dateTime !== null)
return unixTimeToDateTimeString(dateTime, format);
return "";
};
// src/shared/table-state/filter-by-search.ts
var filterBodyRowsBySearch = (tableState, filteredBodyRows, searchText) => {
const { columns, bodyCells, bodyRows } = tableState.model;
const columnMap = /* @__PURE__ */ new Map();
columns.forEach((column) => columnMap.set(column.id, column));
const rowMap = /* @__PURE__ */ new Map();
bodyRows.forEach((row) => rowMap.set(row.id, row));
const cellToTagMap = /* @__PURE__ */ new Map();
bodyCells.forEach((cell) => {
const column = columnMap.get(cell.columnId);
if (!column)
throw new ColumNotFoundError(cell.columnId);
const cellTags = column.tags.filter(
(tag) => cell.tagIds.includes(tag.id)
);
cellToTagMap.set(cell.id, cellTags);
});
return filteredBodyRows.filter((row) => {
const rowCells = bodyCells.filter((cell) => cell.rowId === row.id);
return rowCells.some((cell) => {
const cellTags = cellToTagMap.get(cell.id);
if (!cellTags)
throw new Error(`Tags not found for cell ${cell.id}`);
return doesCellMatch(
cell,
columnMap,
rowMap,
cellTags,
searchText.toLowerCase()
);
});
});
};
var doesCellMatch = (cell, columnMap, rowMap, cellTags, searchText) => {
const column = columnMap.get(cell.columnId);
if (!column)
throw new ColumNotFoundError(cell.columnId);
const row = rowMap.get(cell.rowId);
if (!row)
throw new RowNotFoundError(cell.rowId);
const { dateTime, markdown } = cell;
const { currencyType, type, dateFormat } = column;
const { lastEditedTime, creationTime } = row;
switch (type) {
case "text" /* TEXT */:
case "embed" /* EMBED */:
case "file" /* FILE */:
case "number" /* NUMBER */:
case "checkbox" /* CHECKBOX */:
return matchCell(markdown, searchText);
case "currency" /* CURRENCY */:
return matchCurrencyCell(markdown, currencyType, searchText);
case "date" /* DATE */:
return matchDateCell(dateFormat, dateTime, searchText);
case "creation-time" /* CREATION_TIME */:
return matchCreationTimeCell(creationTime, dateFormat, searchText);
case "last-edited-time" /* LAST_EDITED_TIME */:
return matchLastEditedTimeCell(
lastEditedTime,
dateFormat,
searchText
);
case "tag" /* TAG */:
case "multi-tag" /* MULTI_TAG */:
return matchTags(cellTags, searchText);
default:
throw new Error("Unsupported cell type");
}
};
var matchCell = (markdown, searchText) => {
return markdown.toLowerCase().includes(searchText);
};
var matchCurrencyCell = (markdown, currencyType, searchText) => {
const content = getCurrencyCellContent(markdown, currencyType);
if (content.toLowerCase().includes(searchText.toLowerCase()))
return true;
};
var matchTags = (cellTags, searchText) => {
return cellTags.some(
(tag) => tag.markdown.toLowerCase().includes(searchText)
);
};
var matchDateCell = (dateFormat, dateTime, searchText) => {
const content = getDateCellContent(dateTime, dateFormat);
return content.toLowerCase().includes(searchText);
};
var matchCreationTimeCell = (creationTime, dateFormat, searchText) => {
const content = getTimeCellContent(creationTime, dateFormat);
return content.toLowerCase().includes(searchText);
};
var matchLastEditedTimeCell = (lastEditedTime, dateFormat, searchText) => {
const content = getTimeCellContent(lastEditedTime, dateFormat);
return content.toLowerCase().includes(searchText);
};
// src/shared/table-state/use-column.ts
var import_react91 = __toESM(require_react());
// src/shared/commands/column-add-command.ts
var ColumnAddCommand = class extends TableStateCommand {
constructor() {
super(...arguments);
__publicField(this, "addedColumn");
__publicField(this, "addedHeaderCells");
__publicField(this, "addedBodyCells");
__publicField(this, "addedFooterCells");
}
execute(prevState) {
super.onExecute();
const {
headerCells,
bodyCells,
footerCells,
columns,
headerRows,
bodyRows,
footerRows
} = prevState.model;
this.addedColumn = createColumn();
this.addedHeaderCells = headerRows.map(
(row) => createHeaderCell(this.addedColumn.id, row.id)
);
this.addedBodyCells = bodyRows.map(
(row) => createBodyCell(this.addedColumn.id, row.id)
);
this.addedFooterCells = footerRows.map(
(row) => createFooterCell(this.addedColumn.id, row.id)
);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: [...columns, this.addedColumn],
headerCells: [...headerCells, ...this.addedHeaderCells],
bodyCells: [...bodyCells, ...this.addedBodyCells],
footerCells: [...footerCells, ...this.addedFooterCells]
})
});
}
redo(prevState) {
super.onRedo();
const { headerCells, bodyCells, footerCells, columns } = prevState.model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: [...columns, this.addedColumn],
headerCells: [...headerCells, ...this.addedHeaderCells],
bodyCells: [...bodyCells, ...this.addedBodyCells],
footerCells: [...footerCells, ...this.addedFooterCells]
})
});
}
undo(prevState) {
super.onUndo();
const { columns, headerCells, bodyCells, footerCells } = prevState.model;
const { id: id2 } = this.addedColumn;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: columns.filter((column) => column.id !== id2),
headerCells: headerCells.filter((cell) => cell.columnId !== id2),
bodyCells: bodyCells.filter((cell) => cell.columnId !== id2),
footerCells: footerCells.filter((cell) => cell.columnId !== id2)
})
});
}
};
// src/shared/commands/column-delete-command.ts
var ColumnDeleteCommand = class extends TableStateCommand {
constructor(options) {
super();
__publicField(this, "columnId");
__publicField(this, "last");
__publicField(this, "deletedColumn");
__publicField(this, "deletedHeaderCells");
__publicField(this, "deletedBodyCells");
__publicField(this, "deletedFooterCells");
__publicField(this, "deletedFilterRules");
const { id: id2, last: last2 } = options;
if (id2 === void 0 && last2 === void 0)
throw new DeleteCommandArgumentsError();
this.columnId = id2;
this.last = last2;
}
execute(prevState) {
super.onExecute();
const { columns, headerCells, bodyCells, footerCells, filterRules } = prevState.model;
if (columns.length === 1)
return prevState;
let id2 = this.columnId;
if (this.last)
id2 = columns[columns.length - 1].id;
const columnToDelete = columns.find((column) => column.id === id2);
if (!columnToDelete)
throw new ColumNotFoundError(id2);
this.deletedColumn = {
arrIndex: columns.indexOf(columnToDelete),
column: structuredClone(columnToDelete)
};
const headerCellsToDelete = headerCells.filter(
(cell) => cell.columnId === id2
);
this.deletedHeaderCells = headerCellsToDelete.map((cell) => ({
arrIndex: headerCells.indexOf(cell),
cell: structuredClone(cell)
}));
const bodyCellsToDelete = bodyCells.filter(
(cell) => cell.columnId === id2
);
this.deletedBodyCells = bodyCellsToDelete.map((cell) => ({
arrIndex: bodyCells.indexOf(cell),
cell: structuredClone(cell)
}));
const footerCellsToDelete = footerCells.filter(
(cell) => cell.columnId === id2
);
this.deletedFooterCells = footerCellsToDelete.map((cell) => ({
arrIndex: footerCells.indexOf(cell),
cell: structuredClone(cell)
}));
const rulesToDelete = filterRules.filter(
(rule) => rule.columnId === id2
);
this.deletedFilterRules = rulesToDelete.map((rule) => ({
arrIndex: filterRules.indexOf(rule),
rule: structuredClone(rule)
}));
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: columns.filter((column) => column.id !== id2),
headerCells: headerCells.filter((cell) => cell.columnId !== id2),
bodyCells: bodyCells.filter((cell) => cell.columnId !== id2),
footerCells: footerCells.filter((cell) => cell.columnId !== id2),
filterRules: filterRules.filter((rule) => rule.columnId !== id2)
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { columns, headerCells, bodyCells, footerCells, filterRules } = prevState.model;
const updatedColumns = [...columns];
updatedColumns.splice(
this.deletedColumn.arrIndex,
0,
this.deletedColumn.column
);
const updatedHeaderCells = [...headerCells];
this.deletedHeaderCells.forEach((cell) => {
updatedHeaderCells.splice(cell.arrIndex, 0, cell.cell);
});
const updatedBodyCells = [...bodyCells];
this.deletedBodyCells.forEach((cell) => {
updatedBodyCells.splice(cell.arrIndex, 0, cell.cell);
});
const updatedFooterCells = [...footerCells];
this.deletedFooterCells.forEach((cell) => {
updatedFooterCells.splice(cell.arrIndex, 0, cell.cell);
});
const updatedFilterRules = [...filterRules];
this.deletedFilterRules.forEach((rule) => {
updatedFilterRules.splice(rule.arrIndex, 0, rule.rule);
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: updatedColumns,
headerCells: updatedHeaderCells,
bodyCells: updatedBodyCells,
footerCells: updatedFooterCells,
filterRules: updatedFilterRules
})
});
}
};
// src/shared/commands/column-update-command.ts
var ColumnUpdateCommand = class extends TableStateCommand {
constructor(columnId, key, options) {
const { shouldSortRows = false, value } = options || {};
super(shouldSortRows);
__publicField(this, "columnId");
__publicField(this, "key");
__publicField(this, "value");
__publicField(this, "previousValue");
this.columnId = columnId;
this.key = key;
this.value = value;
}
execute(prevState) {
super.onExecute();
const { columns } = prevState.model;
const column = columns.find((column2) => column2.id === this.columnId);
if (!column)
throw new ColumNotFoundError(this.columnId);
this.previousValue = column[this.key];
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: prevState.model.columns.map((column2) => {
const isBoolean2 = typeof column2[this.key] === "boolean";
if (!isBoolean2 && this.value === void 0)
throw new Error(
"a value must be provided when the column expects a non-boolean value"
);
if (column2.id === this.columnId) {
return __spreadProps(__spreadValues({}, column2), {
[this.key]: isBoolean2 ? !column2[this.key] : this.value
});
}
return column2;
})
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: prevState.model.columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
[this.key]: this.previousValue
});
}
return column;
})
})
});
}
};
// src/shared/commands/column-type-update-command.ts
var ColumnTypeUpdateCommand = class extends TableStateCommand {
constructor(id2, type) {
super();
__publicField(this, "columnId");
__publicField(this, "type");
__publicField(this, "previousType");
__publicField(this, "deletedFilterRules", []);
__publicField(this, "previousFunctionType");
__publicField(this, "newFunctionType");
__publicField(this, "updatedBodyCellTagIds", {
current: [],
previous: []
});
__publicField(this, "updatedBodyCellMarkdown", {
current: [],
previous: []
});
__publicField(this, "addedTags", []);
this.columnId = id2;
this.type = type;
}
fromNumberOrCurrency(columns) {
return columns.map((column) => {
if (column.id === this.columnId) {
if (isNumberFunction(column.functionType)) {
this.previousFunctionType = column.functionType;
this.newFunctionType = "none" /* NONE */;
return __spreadProps(__spreadValues({}, column), {
functionType: "none" /* NONE */
});
}
}
return column;
});
}
fromTagOrMultiTag(bodyCells) {
return bodyCells.map((cell) => {
if (cell.columnId === this.columnId) {
if (cell.tagIds.length > 0) {
this.updatedBodyCellTagIds.previous.push({
cellId: cell.id,
tagIds: [...cell.tagIds]
});
this.updatedBodyCellTagIds.current.push({
cellId: cell.id,
tagIds: []
});
return __spreadProps(__spreadValues({}, cell), {
tagIds: []
});
}
}
return cell;
});
}
fromDateToText(column, bodyCells) {
return bodyCells.map((cell) => {
const { dateTime } = cell;
if (cell.columnId === column.id) {
if (dateTime !== null) {
const dateString = unixTimeToDateString(
dateTime,
column.dateFormat
);
this.updatedBodyCellMarkdown.previous.push({
cellId: cell.id,
markdown: cell.markdown
});
this.updatedBodyCellMarkdown.current.push({
cellId: cell.id,
markdown: dateString
});
return __spreadProps(__spreadValues({}, cell), {
markdown: dateString
});
}
}
return cell;
});
}
toTag(columns, bodyCells) {
const newColumns = structuredClone(columns);
let newBodyCells = structuredClone(bodyCells);
newBodyCells = newBodyCells.map((cell) => {
if (cell.columnId === this.columnId) {
if (cell.markdown !== "") {
const tagIds = [];
cell.markdown.split(",").forEach((markdown) => {
const column = newColumns.find(
(column2) => column2.id === this.columnId
);
if (!column)
throw new ColumNotFoundError(this.columnId);
const existingTag = column.tags.find(
(tag) => tag.markdown === markdown
);
if (tagIds.length === 0) {
if (existingTag) {
tagIds.push(existingTag.id);
} else {
const tag = createTag(markdown);
this.addedTags.push(structuredClone(tag));
column.tags.push(tag);
tagIds.push(tag.id);
}
} else {
if (!existingTag) {
const tag = createTag(markdown);
this.addedTags.push(structuredClone(tag));
column.tags.push(tag);
}
}
});
this.updatedBodyCellTagIds.previous.push({
cellId: cell.id,
tagIds: []
});
this.updatedBodyCellTagIds.current.push({
cellId: cell.id,
tagIds
});
return __spreadProps(__spreadValues({}, cell), {
tagIds
});
}
}
return cell;
});
return {
columnsResult: newColumns,
bodyCellsResult: newBodyCells
};
}
toMultiTag(columns, bodyCells) {
const newColumns = structuredClone(columns);
let newBodyCells = structuredClone(bodyCells);
newBodyCells = newBodyCells.map((cell) => {
if (cell.columnId === this.columnId) {
if (cell.markdown !== "") {
const tagIds = [];
cell.markdown.split(",").forEach((markdown) => {
const column = newColumns.find(
(column2) => column2.id === this.columnId
);
if (!column)
throw new ColumNotFoundError(this.columnId);
const existingTag = column.tags.find(
(tag) => tag.markdown === markdown
);
if (existingTag) {
tagIds.push(existingTag.id);
} else {
const tag = createTag(markdown);
this.addedTags.push(structuredClone(tag));
column.tags.push(tag);
tagIds.push(tag.id);
}
});
this.updatedBodyCellTagIds.previous.push({
cellId: cell.id,
tagIds: []
});
this.updatedBodyCellTagIds.current.push({
cellId: cell.id,
tagIds
});
return __spreadProps(__spreadValues({}, cell), {
tagIds
});
}
}
return cell;
});
return { columnsResult: newColumns, bodyCellsResult: newBodyCells };
}
fromMultiTagToTag(bodyCells) {
return bodyCells.map((cell) => {
if (cell.columnId === this.columnId) {
if (cell.tagIds.length > 0) {
this.updatedBodyCellTagIds.previous.push({
cellId: cell.id,
tagIds: [...cell.tagIds]
});
this.updatedBodyCellTagIds.current.push({
cellId: cell.id,
tagIds: [cell.tagIds[0]]
});
return __spreadProps(__spreadValues({}, cell), {
tagIds: [cell.tagIds[0]]
});
}
}
return cell;
});
}
toCheckbox(bodyCells) {
return bodyCells.map((cell) => {
if (cell.columnId === this.columnId) {
if (!isCheckbox(cell.markdown)) {
this.updatedBodyCellMarkdown.previous.push({
cellId: cell.id,
markdown: cell.markdown
});
this.updatedBodyCellMarkdown.current.push({
cellId: cell.id,
markdown: CHECKBOX_MARKDOWN_UNCHECKED
});
return __spreadProps(__spreadValues({}, cell), {
markdown: CHECKBOX_MARKDOWN_UNCHECKED
});
}
}
return cell;
});
}
execute(prevState) {
super.onExecute();
const { columns, bodyCells, filterRules } = prevState.model;
const column = columns.find((column2) => column2.id === this.columnId);
if (!column)
throw new ColumNotFoundError(this.columnId);
this.previousType = column.type;
if (this.previousType === this.type)
return prevState;
let newColumns = structuredClone(columns);
let newBodyCells = structuredClone(bodyCells);
if (this.previousType === "multi-tag" /* MULTI_TAG */ && this.type !== "tag" /* TAG */ || this.previousType === "tag" /* TAG */ && this.type !== "multi-tag" /* MULTI_TAG */) {
newBodyCells = this.fromTagOrMultiTag(newBodyCells);
} else if (this.previousType !== "multi-tag" /* MULTI_TAG */ && this.type === "tag" /* TAG */) {
const { columnsResult, bodyCellsResult } = this.toTag(
newColumns,
newBodyCells
);
newColumns = columnsResult;
newBodyCells = bodyCellsResult;
} else if (this.previousType !== "tag" /* TAG */ && this.type === "multi-tag" /* MULTI_TAG */) {
const { columnsResult, bodyCellsResult } = this.toMultiTag(
newColumns,
newBodyCells
);
newColumns = columnsResult;
newBodyCells = bodyCellsResult;
} else if (this.previousType === "multi-tag" /* MULTI_TAG */ && this.type === "tag" /* TAG */) {
newBodyCells = this.fromMultiTagToTag(newBodyCells);
} else if (this.type === "checkbox" /* CHECKBOX */) {
newBodyCells = this.toCheckbox(newBodyCells);
} else if (this.previousType === "date" /* DATE */ && this.type === "text" /* TEXT */) {
newBodyCells = this.fromDateToText(column, newBodyCells);
}
if (this.previousType === "number" /* NUMBER */ || this.previousType === "currency" /* CURRENCY */) {
newColumns = this.fromNumberOrCurrency(newColumns);
}
newColumns = newColumns.map((column2) => {
if (column2.id === this.columnId) {
return __spreadProps(__spreadValues({}, column2), {
type: this.type
});
}
return column2;
});
const shouldFilterRule = (rule) => rule.columnId !== this.columnId;
const filterRulesToDelete = filterRules.filter(
(rule) => !shouldFilterRule(rule)
);
this.deletedFilterRules = filterRulesToDelete.map((rule) => ({
arrIndex: filterRules.indexOf(rule),
rule: structuredClone(rule)
}));
const newFilterRules = filterRules.filter(shouldFilterRule);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
filterRules: newFilterRules
})
});
}
redo(prevState) {
super.onRedo();
const { columns, bodyCells, filterRules } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
const updatedCellTagIds = this.updatedBodyCellTagIds.current.find(
(c2) => c2.cellId === cell.id
);
if (updatedCellTagIds) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: updatedCellTagIds.tagIds
});
}
const updatedCellMarkdown = this.updatedBodyCellMarkdown.current.find(
(c2) => c2.cellId === cell.id
);
if (updatedCellMarkdown) {
return __spreadProps(__spreadValues({}, cell), {
markdown: updatedCellMarkdown.markdown
});
}
return cell;
});
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
type: this.type,
functionType: this.newFunctionType ? this.newFunctionType : column.functionType,
tags: [...column.tags, ...this.addedTags]
});
}
return column;
});
const newFilterRules = filterRules.filter(
(rule) => !this.deletedFilterRules.find((r2) => r2.rule.id === rule.id)
);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
filterRules: newFilterRules
})
});
}
undo(prevState) {
super.onUndo();
const { columns, bodyCells, filterRules } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
const updatedCellTagIds = this.updatedBodyCellTagIds.previous.find(
(c2) => c2.cellId === cell.id
);
if (updatedCellTagIds) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: updatedCellTagIds.tagIds
});
}
const updatedCellMarkdown = this.updatedBodyCellMarkdown.previous.find(
(c2) => c2.cellId === cell.id
);
if (updatedCellMarkdown) {
return __spreadProps(__spreadValues({}, cell), {
markdown: updatedCellMarkdown.markdown
});
}
return cell;
});
const newFilterRules = structuredClone(filterRules);
this.deletedFilterRules.forEach((r2) => {
const { arrIndex, rule } = r2;
newFilterRules.splice(arrIndex, 0, rule);
});
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
functionType: this.previousFunctionType ? this.previousFunctionType : column.functionType,
type: this.previousType,
tags: column.tags.filter(
(t2) => this.addedTags.find(
(added) => added.id === t2.id
) === void 0
)
});
}
return column;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
filterRules: newFilterRules
})
});
}
};
// src/shared/table-state/use-column.ts
var useColumn = () => {
const logger = useLogger();
const { doCommand } = useTableState();
function handleNewColumnClick() {
logger("handleNewColumnClick");
doCommand(new ColumnAddCommand());
}
function handleColumnTypeClick(columnId, type) {
logger("handleColumnTypeClick", {
columnId,
type
});
doCommand(new ColumnTypeUpdateCommand(columnId, type));
}
function handleColumnSortClick(columnId, sortDir) {
logger("handleColumnSortClick", {
columnId,
sortDir
});
doCommand(
new ColumnUpdateCommand(columnId, "sortDir", {
value: sortDir,
shouldSortRows: true
})
);
}
function handleHorizontalPaddingClick(columnId, padding) {
logger("handleHorziontalPaddingClick", {
columnId,
padding
});
doCommand(
new ColumnUpdateCommand(columnId, "horizontalPadding", {
value: padding
})
);
}
function handleVerticalPaddingClick(columnId, padding) {
logger("handleVerticalPaddingClick", {
columnId,
padding
});
doCommand(
new ColumnUpdateCommand(columnId, "verticalPadding", {
value: padding
})
);
}
function handleAspectRatioClick(columnId, aspectRatio) {
logger("handleVerticalPaddingClick", {
columnId,
aspectRatio
});
doCommand(
new ColumnUpdateCommand(columnId, "aspectRatio", {
value: aspectRatio
})
);
}
const handleColumnToggle = import_react91.default.useCallback(
(columnId) => {
logger("handleColumnToggle", {
columnId
});
doCommand(new ColumnUpdateCommand(columnId, "isVisible"));
},
[doCommand, logger]
);
function handleColumnDeleteClick(columnId) {
logger("handleColumnDeleteClick", {
columnId
});
doCommand(new ColumnDeleteCommand({ id: columnId }));
}
function handleFunctionTypeChange(columnId, functionType) {
logger("handleFunctionTypeChange", {
columnId,
functionType
});
doCommand(
new ColumnUpdateCommand(columnId, "functionType", {
value: functionType
})
);
}
function handleCurrencyChange(columnId, currencyType) {
logger("handleCurrencyChange", {
columnId,
currencyType
});
doCommand(
new ColumnUpdateCommand(columnId, "currencyType", {
value: currencyType,
shouldSortRows: true
})
);
}
function handleDateFormatChange(columnId, dateFormat) {
logger("handleDateFormatChange", {
columnId,
dateFormat
});
doCommand(
new ColumnUpdateCommand(columnId, "dateFormat", {
value: dateFormat,
shouldSortRows: true
})
);
}
function handleSortRemoveClick(columnId) {
logger("handleSortRemoveClick", {
columnId
});
doCommand(
new ColumnUpdateCommand(columnId, "sortDir", {
value: "default" /* NONE */,
shouldSortRows: true
})
);
}
function handleColumnWidthChange(columnId, width) {
logger("handleColumnWidthChange", {
columnId,
width
});
doCommand(
new ColumnUpdateCommand(columnId, "width", {
value: width,
shouldSortRows: true
})
);
}
function handleWrapContentToggle(columnId, shouldWrap) {
logger("handleWrapContentToggle", {
columnId,
shouldWrap
});
doCommand(
new ColumnUpdateCommand(columnId, "shouldWrapOverflow", {
value: shouldWrap,
shouldSortRows: true
})
);
}
return {
handleNewColumnClick,
handleColumnTypeClick,
handleColumnSortClick,
handleColumnToggle,
handleColumnDeleteClick,
handleCurrencyChange,
handleDateFormatChange,
handleSortRemoveClick,
handleColumnWidthChange,
handleWrapContentToggle,
handleFunctionTypeChange,
handleHorizontalPaddingClick,
handleVerticalPaddingClick,
handleAspectRatioClick
};
};
// src/shared/commands/row-add-command.ts
var RowAddCommand = class extends TableStateCommand {
constructor() {
super(true);
__publicField(this, "addedRow");
__publicField(this, "addedBodyCells");
}
execute(prevState) {
super.onExecute();
const { bodyRows, bodyCells, columns } = prevState.model;
this.addedRow = createBodyRow(bodyRows.length);
this.addedBodyCells = columns.map((column) => {
const { id: id2, type } = column;
return createBodyCell(id2, this.addedRow.id, {
cellType: type
});
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: [...bodyCells, ...this.addedBodyCells],
bodyRows: [...bodyRows, this.addedRow]
})
});
}
redo(prevState) {
super.onRedo();
const { bodyRows, bodyCells } = prevState.model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: [...bodyCells, ...this.addedBodyCells],
bodyRows: [...bodyRows, this.addedRow]
})
});
}
undo(prevState) {
super.onUndo();
const { bodyRows, bodyCells } = prevState.model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: bodyRows.filter((row) => row.id !== this.addedRow.id),
bodyCells: bodyCells.filter(
(cell) => cell.rowId !== this.addedRow.id
)
})
});
}
};
// src/shared/commands/row-delete-command.ts
var RowDeleteCommand = class extends TableStateCommand {
constructor(options) {
super();
__publicField(this, "rowId");
__publicField(this, "last");
__publicField(this, "deletedRow");
__publicField(this, "deletedCells");
__publicField(this, "previousBodyRows");
const { id: id2, last: last2 } = options;
if (id2 === void 0 && last2 === void 0)
throw new DeleteCommandArgumentsError();
this.rowId = id2;
this.last = last2;
}
execute(prevState) {
super.onExecute();
const { bodyRows, bodyCells } = prevState.model;
if (bodyRows.length === 0)
return prevState;
let id2 = this.rowId;
if (this.last)
id2 = bodyRows[bodyRows.length - 1].id;
const rowToDelete = bodyRows.find((row) => row.id === id2);
if (!rowToDelete)
throw new RowNotFoundError(id2);
this.deletedRow = {
arrIndex: bodyRows.indexOf(rowToDelete),
row: structuredClone(rowToDelete)
};
let newBodyRows = bodyRows.filter((row) => row.id !== id2);
this.previousBodyRows = newBodyRows.filter((row) => row.index > this.deletedRow.row.index).map((row) => {
return {
id: row.id,
index: row.index
};
});
newBodyRows = newBodyRows.map((row) => {
if (row.index > this.deletedRow.row.index) {
return __spreadProps(__spreadValues({}, row), {
index: row.index - 1
});
}
return row;
});
const cellsToDelete = bodyCells.filter((cell) => cell.rowId === id2);
this.deletedCells = cellsToDelete.map((cell) => ({
arrIndex: bodyCells.indexOf(cell),
cell: structuredClone(cell)
}));
const newBodyCells = bodyCells.filter((cell) => cell.rowId !== id2);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: newBodyRows,
bodyCells: newBodyCells
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyRows, bodyCells } = prevState.model;
const updatedBodyRows = [...bodyRows].map((row) => {
const wasUpdated = this.previousBodyRows.find(
(r2) => r2.id === row.id
);
if (wasUpdated) {
return __spreadProps(__spreadValues({}, row), {
index: wasUpdated.index
});
}
return row;
});
updatedBodyRows.splice(
this.deletedRow.arrIndex,
0,
this.deletedRow.row
);
const updatedBodyCells = [...bodyCells];
this.deletedCells.forEach((cell) => {
updatedBodyCells.splice(cell.arrIndex, 0, cell.cell);
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyRows: updatedBodyRows,
bodyCells: updatedBodyCells
})
});
}
};
// src/shared/table-state/use-row.ts
var import_react92 = __toESM(require_react());
var useRow = () => {
const logger = useLogger();
const { doCommand } = useTableState();
const handleRowDeleteClick = import_react92.default.useCallback(
(rowId) => {
logger("handleRowDeleteClick", {
rowId
});
doCommand(new RowDeleteCommand({ id: rowId }));
},
[doCommand, logger]
);
function handleNewRowClick() {
logger("handleNewRowClick");
doCommand(new RowAddCommand());
}
return {
handleNewRowClick,
handleRowDeleteClick
};
};
// src/shared/table-state/row-state-operations.ts
var rowLastEditedTime = (rows, rowId) => {
const row = rows.find((row2) => row2.id === rowId);
if (!row)
throw new RowNotFoundError(rowId);
return row.lastEditedTime;
};
var rowLastEditedTimeUpdate = (rows, rowId, time = Date.now()) => {
return rows.map((row) => {
if (row.id === rowId) {
return __spreadProps(__spreadValues({}, row), {
lastEditedTime: time
});
}
return row;
});
};
// src/shared/commands/cell-body-update-command.ts
var CellBodyUpdateCommand = class extends TableStateCommand {
constructor(cellId, rowId, key, value) {
super(true);
__publicField(this, "cellId");
__publicField(this, "rowId");
__publicField(this, "key");
__publicField(this, "value");
__publicField(this, "previousValue");
__publicField(this, "previousEditedTime");
this.cellId = cellId;
this.rowId = rowId;
this.key = key;
this.value = value;
}
execute(prevState) {
super.onExecute();
const { bodyCells, bodyRows } = prevState.model;
const cell = bodyCells.find((cell2) => cell2.id === this.cellId);
if (!cell)
throw new CellNotFoundError({
id: this.cellId
});
this.previousValue = cell[this.key];
this.previousEditedTime = rowLastEditedTime(bodyRows, this.rowId);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: bodyCells.map((cell2) => {
if (cell2.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell2), {
[this.key]: this.value
});
}
return cell2;
}),
bodyRows: rowLastEditedTimeUpdate(bodyRows, this.rowId)
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyCells, bodyRows } = prevState.model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: bodyCells.map((cell) => {
if (cell.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell), {
[this.key]: this.previousValue
});
}
return cell;
}),
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.previousEditedTime
)
})
});
}
};
// src/shared/commands/cell-header-update-command.ts
var CellHeaderUpdateCommand = class extends TableStateCommand {
constructor(cellId, key, value) {
super();
__publicField(this, "cellId");
__publicField(this, "key");
__publicField(this, "value");
__publicField(this, "previousValue");
this.cellId = cellId;
this.key = key;
this.value = value;
}
execute(prevState) {
super.onExecute();
const { headerCells } = prevState.model;
const cell = headerCells.find((cell2) => cell2.id === this.cellId);
if (!cell)
throw new CellNotFoundError({
id: this.cellId
});
this.previousValue = cell[this.key];
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
headerCells: headerCells.map((cell2) => {
if (cell2.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell2), {
[this.key]: this.value
});
}
return cell2;
})
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { headerCells } = prevState.model;
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
headerCells: headerCells.map((cell) => {
if (cell.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell), {
[this.key]: this.previousValue
});
}
return cell;
})
})
});
}
};
// src/shared/table-state/use-cell.ts
var import_react93 = __toESM(require_react());
var useCell = () => {
const logger = useLogger();
const { doCommand } = useTableState();
function handleHeaderCellContentChange(cellId, value) {
logger("handleCellContentChange", {
cellId,
markdown: value
});
doCommand(new CellHeaderUpdateCommand(cellId, "markdown", value));
}
const handleBodyCellContentChange = import_react93.default.useCallback(
(cellId, rowId, value) => {
logger("handleCellContentChange", {
cellId,
rowId,
markdown: value
});
doCommand(
new CellBodyUpdateCommand(cellId, rowId, "markdown", value)
);
},
[logger, doCommand]
);
const handleCellDateTimeChange = import_react93.default.useCallback(
(cellId, rowId, value) => {
logger("handleCellContentChange", {
cellId,
rowId,
dateTime: value
});
doCommand(
new CellBodyUpdateCommand(cellId, rowId, "dateTime", value)
);
},
[logger, doCommand]
);
return {
handleHeaderCellContentChange,
handleBodyCellContentChange,
handleCellDateTimeChange
};
};
// src/shared/commands/tag-delete-command.ts
var TagDeleteCommand = class extends TableStateCommand {
constructor(columnId, tagId) {
super();
__publicField(this, "columnId");
__publicField(this, "tagId");
__publicField(this, "deletedTag");
__publicField(this, "previousCellTagIds", []);
this.columnId = columnId;
this.tagId = tagId;
}
execute(prevState) {
super.onExecute();
const { bodyCells, columns } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
const tag = column.tags.find((tag2) => tag2.id === this.tagId);
if (!tag)
throw new TagNotFoundError(this.tagId);
this.deletedTag = {
arrIndex: column.tags.indexOf(tag),
tag
};
return __spreadProps(__spreadValues({}, column), {
tags: column.tags.filter((tag2) => tag2.id !== this.tagId)
});
}
return column;
});
const newBodyCells = bodyCells.map((cell) => {
if (cell.tagIds.includes(this.tagId)) {
this.previousCellTagIds.push({
cellId: cell.id,
tagIds: [...cell.tagIds]
});
return __spreadProps(__spreadValues({}, cell), {
tagIds: cell.tagIds.filter((tagId) => tagId !== this.tagId)
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { columns, bodyCells } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
const updatedTags = [...column.tags];
updatedTags.splice(
this.deletedTag.arrIndex,
0,
this.deletedTag.tag
);
return __spreadProps(__spreadValues({}, column), {
tags: updatedTags
});
}
return column;
});
const newBodyCells = bodyCells.map((cell) => {
const previousTagIds = this.previousCellTagIds.find(
(previousCellTagId) => previousCellTagId.cellId === cell.id
);
if (previousTagIds) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: previousTagIds.tagIds
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells
})
});
}
};
// src/shared/commands/tag-update-command.ts
var TagUpdateCommand = class extends TableStateCommand {
constructor(columnId, tagId, key, value) {
super();
__publicField(this, "columnId");
__publicField(this, "tagId");
__publicField(this, "key");
__publicField(this, "value");
__publicField(this, "previousValue");
this.columnId = columnId;
this.tagId = tagId;
this.key = key;
this.value = value;
}
execute(prevState) {
super.onExecute();
const { columns } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
const tag = column.tags.find((tag2) => tag2.id === this.tagId);
if (!tag)
throw new TagNotFoundError(this.tagId);
this.previousValue = tag[this.key];
return __spreadProps(__spreadValues({}, column), {
tags: column.tags.map((tag2) => {
if (tag2.id === this.tagId) {
return __spreadProps(__spreadValues({}, tag2), {
[this.key]: this.value
});
}
return tag2;
})
});
}
return column;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { columns } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
tags: column.tags.map((tag) => {
if (tag.id === this.tagId) {
return __spreadProps(__spreadValues({}, tag), {
[this.key]: this.previousValue
});
}
return tag;
})
});
}
return column;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns
})
});
}
};
// src/shared/commands/tag-add-command.ts
var TagAddCommand = class extends TableStateCommand {
constructor(cellId, columnId, rowId, markdown, color, isMultiTag) {
super();
__publicField(this, "cellId");
__publicField(this, "columnId");
__publicField(this, "rowId");
__publicField(this, "markdown");
__publicField(this, "color");
__publicField(this, "isMultiTag");
__publicField(this, "previousEditedTime");
__publicField(this, "newEditedTime");
__publicField(this, "addedTag");
__publicField(this, "previousCellTagIds");
__publicField(this, "newCellTagIds");
this.cellId = cellId;
this.columnId = columnId;
this.rowId = rowId;
this.markdown = markdown;
this.color = color;
this.isMultiTag = isMultiTag;
}
execute(prevState) {
super.onExecute();
const { bodyRows, bodyCells, columns } = prevState.model;
this.addedTag = createTag(this.markdown, {
color: this.color
});
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
tags: [...column.tags, this.addedTag]
});
}
return column;
});
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
this.previousCellTagIds = [...cell.tagIds];
if (this.isMultiTag === false) {
if (cell.tagIds.length > 0) {
this.newCellTagIds = [this.addedTag.id];
return __spreadProps(__spreadValues({}, cell), {
tagIds: this.newCellTagIds
});
}
}
this.newCellTagIds = [...cell.tagIds, this.addedTag.id];
return __spreadProps(__spreadValues({}, cell), {
tagIds: [...cell.tagIds, this.addedTag.id]
});
}
return cell;
});
this.previousEditedTime = rowLastEditedTime(bodyRows, this.rowId);
this.newEditedTime = Date.now();
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.newEditedTime
)
})
});
}
redo(prevState) {
super.onRedo();
const { bodyRows, columns, bodyCells } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId)
return __spreadProps(__spreadValues({}, column), {
tags: [...column.tags, this.addedTag]
});
return column;
});
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId)
return __spreadProps(__spreadValues({}, cell), {
tagIds: this.newCellTagIds
});
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.newEditedTime
)
})
});
}
undo(prevState) {
super.onUndo();
const { bodyRows, columns } = prevState.model;
const newColumns = columns.map((column) => {
if (column.id === this.columnId) {
return __spreadProps(__spreadValues({}, column), {
tags: column.tags.filter(
(tag) => tag.id !== this.addedTag.id
)
});
}
return column;
});
const newBodyCells = prevState.model.bodyCells.map((cell) => {
if (cell.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: this.previousCellTagIds
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
columns: newColumns,
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.previousEditedTime
)
})
});
}
};
// src/shared/commands/tag-cell-remove-command.ts
var TagCellRemoveCommand = class extends TableStateCommand {
constructor(cellId, rowId, tagId) {
super();
__publicField(this, "cellId");
__publicField(this, "rowId");
__publicField(this, "tagId");
__publicField(this, "previousEditedTime");
__publicField(this, "previousTagIdIndex");
this.cellId = cellId;
this.rowId = rowId;
this.tagId = tagId;
}
execute(prevState) {
super.onExecute();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
this.previousTagIdIndex = cell.tagIds.indexOf(this.tagId);
const { tagIds } = cell;
return __spreadProps(__spreadValues({}, cell), {
tagIds: tagIds.filter((id2) => id2 !== this.tagId)
});
}
return cell;
});
this.previousEditedTime = rowLastEditedTime(bodyRows, this.rowId);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(bodyRows, this.rowId)
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
const newTagIds = [...cell.tagIds];
newTagIds.splice(this.previousTagIdIndex, 0, this.tagId);
return __spreadProps(__spreadValues({}, cell), {
tagIds: newTagIds
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.previousEditedTime
)
})
});
}
};
// src/shared/commands/tag-cell-add-command.ts
var TagCellAddCommand = class extends TableStateCommand {
constructor(cellId, rowId, tagId, isMultiTag) {
super();
__publicField(this, "cellId");
__publicField(this, "rowId");
__publicField(this, "tagId");
__publicField(this, "isMultiTag");
__publicField(this, "previousCellTagIds");
__publicField(this, "previousEditedTime");
this.cellId = cellId;
this.rowId = rowId;
this.tagId = tagId;
this.isMultiTag = isMultiTag;
}
execute(prevState) {
super.onExecute();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
this.previousCellTagIds = [...cell.tagIds];
if (this.isMultiTag === false) {
if (cell.tagIds.length > 0) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: [this.tagId]
});
}
}
return __spreadProps(__spreadValues({}, cell), {
tagIds: [...cell.tagIds, this.tagId]
});
}
return cell;
});
this.previousEditedTime = rowLastEditedTime(bodyRows, this.rowId);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(bodyRows, this.rowId)
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: this.previousCellTagIds
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.previousEditedTime
)
})
});
}
};
// src/shared/commands/tag-cell-multiple-remove-command.ts
var TagCellMultipleRemoveCommand = class extends TableStateCommand {
constructor(cellId, rowId, tagIds) {
super();
__publicField(this, "cellId");
__publicField(this, "rowId");
__publicField(this, "tagIds");
__publicField(this, "previousEditedTime");
__publicField(this, "previousTagIds");
this.cellId = cellId;
this.rowId = rowId;
this.tagIds = tagIds;
}
execute(prevState) {
super.onExecute();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
this.previousTagIds = [...cell.tagIds];
return __spreadProps(__spreadValues({}, cell), {
tagIds: cell.tagIds.filter(
(id2) => !this.tagIds.includes(id2)
)
});
}
return cell;
});
this.previousEditedTime = rowLastEditedTime(bodyRows, this.rowId);
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(bodyRows, this.rowId)
})
});
}
redo(prevState) {
super.onRedo();
return this.execute(prevState);
}
undo(prevState) {
super.onUndo();
const { bodyCells, bodyRows } = prevState.model;
const newBodyCells = bodyCells.map((cell) => {
if (cell.id === this.cellId) {
return __spreadProps(__spreadValues({}, cell), {
tagIds: this.previousTagIds
});
}
return cell;
});
return __spreadProps(__spreadValues({}, prevState), {
model: __spreadProps(__spreadValues({}, prevState.model), {
bodyCells: newBodyCells,
bodyRows: rowLastEditedTimeUpdate(
bodyRows,
this.rowId,
this.previousEditedTime
)
})
});
}
};
// src/shared/table-state/use-tag.ts
var useTag = () => {
const { doCommand } = useTableState();
const logFunc = useLogger();
function handleTagAdd(cellId, columnId, rowId, markdown, color, isMultiTag) {
logFunc("handleTagAdd", {
cellId,
columnId,
rowId,
markdown,
color,
isMultiTag
});
doCommand(
new TagAddCommand(
cellId,
columnId,
rowId,
markdown,
color,
isMultiTag
)
);
}
function handleTagCellAdd(cellId, rowId, tagId, isMultiTag) {
logFunc("handleTagCellAdd", {
cellId,
rowId,
tagId,
isMultiTag
});
doCommand(new TagCellAddCommand(cellId, rowId, tagId, isMultiTag));
}
function handleTagCellRemove(cellId, rowId, tagId) {
logFunc("handleTagCellRemove", {
cellId,
rowId,
tagId
});
doCommand(new TagCellRemoveCommand(cellId, rowId, tagId));
}
function handleTagCellMultipleRemove(cellId, rowId, tagIds) {
logFunc("handleTagCellMultipleRemove", {
cellId,
rowId,
tagIds
});
doCommand(new TagCellMultipleRemoveCommand(cellId, rowId, tagIds));
}
function handleTagDeleteClick(columnId, tagId) {
logFunc("handleTagDeleteClick", {
columnId,
tagId
});
doCommand(new TagDeleteCommand(columnId, tagId));
}
function handleTagColorChange(columnId, tagId, color) {
logFunc("handleTagColorChange", {
columnId,
tagId,
color
});
doCommand(new TagUpdateCommand(columnId, tagId, "color", color));
}
return {
handleTagCellAdd,
handleTagAdd,
handleTagCellRemove,
handleTagColorChange,
handleTagCellMultipleRemove,
handleTagDeleteClick
};
};
// src/shared/menu/arrow-move-focus.ts
var moveMenuFocusUp = (focusableEls, currentIndex) => {
let index = currentIndex - 1;
if (index < 0)
index = focusableEls.length - 1;
return focusableEls[index];
};
var moveMenuFocusDown = (focusableEls, currentIndex) => {
let index = currentIndex + 1;
if (index > focusableEls.length - 1)
index = 0;
return focusableEls[index];
};
var moveFocusLeft = (focusableEls, currentIndex) => {
let index = currentIndex - 1;
if (index < 0)
index = focusableEls.length - 1;
return focusableEls[index];
};
var moveFocusRight = (focusableEls, currentIndex) => {
let index = currentIndex + 1;
if (index > focusableEls.length - 1)
index = 0;
return focusableEls[index];
};
var moveFocusUp = (focusableEls, numColumns, numBodyRows, numSortedColumns, currentIndex) => {
const searchInputIndex = numSortedColumns;
const optionBarIndexEnd = numSortedColumns + 2;
const newRowButtonIndex = focusableEls.length - 1;
if (currentIndex <= optionBarIndexEnd)
return focusableEls[currentIndex];
if (currentIndex > optionBarIndexEnd && currentIndex <= optionBarIndexEnd + numColumns) {
return focusableEls[searchInputIndex];
}
if (currentIndex >= newRowButtonIndex - numColumns && currentIndex < newRowButtonIndex) {
if (numBodyRows === 0)
return focusableEls[currentIndex - numColumns - 1];
return focusableEls[currentIndex - numColumns];
}
if (currentIndex === newRowButtonIndex)
return focusableEls[newRowButtonIndex - numColumns];
if (currentIndex > optionBarIndexEnd && currentIndex <= optionBarIndexEnd + numColumns)
return focusableEls[0];
if (currentIndex === optionBarIndexEnd + numColumns + 2)
return focusableEls[currentIndex - 1 - numColumns];
if (currentIndex > optionBarIndexEnd + numColumns + 2 && currentIndex <= optionBarIndexEnd + numColumns + 2 + numColumns)
return focusableEls[currentIndex - 2 - numColumns];
return focusableEls[currentIndex - 1 - numColumns];
};
var moveFocusDown = (focusableEls, numColumns, numBodyRows, numSortedColumns, currentIndex) => {
const firstColumnIndex = numSortedColumns + 3;
const optionBarIndexEnd = numSortedColumns + 2;
const newRowButtonIndex = focusableEls.length - 1;
if (currentIndex === newRowButtonIndex)
return focusableEls[currentIndex];
if (currentIndex >= 0 && currentIndex <= optionBarIndexEnd)
return focusableEls[firstColumnIndex];
if (currentIndex >= newRowButtonIndex - numColumns && currentIndex < newRowButtonIndex)
return focusableEls[newRowButtonIndex];
if (currentIndex > optionBarIndexEnd && currentIndex <= optionBarIndexEnd + numColumns) {
if (numBodyRows === 0)
return focusableEls[currentIndex + numColumns + 1];
return focusableEls[currentIndex + numColumns + 2];
}
if (currentIndex >= newRowButtonIndex - numColumns - numColumns && currentIndex < newRowButtonIndex - numColumns)
return focusableEls[currentIndex + numColumns];
if (currentIndex === optionBarIndexEnd + numColumns + 1)
return focusableEls[currentIndex + numColumns + 1];
return focusableEls[currentIndex + numColumns + 1];
};
// src/obsidian-shim/build/export-events.ts
var import_react94 = __toESM(require_react());
// src/shared/event-system/utils.ts
var isEventForThisApp = (appId, allowOutsideEvents = false) => {
const activeEl = document.activeElement;
if (!activeEl)
return false;
const appEl = activeEl.closest(".NLT__app");
if (appEl)
return appEl.getAttribute("data-id") === appId;
if (allowOutsideEvents)
return true;
const menuEl = activeEl.closest(".NLT__menu");
if (menuEl) {
const menuId = menuEl.getAttribute("data-id");
const menuTrigger = document.querySelector(
`[data-menu-id="${menuId}"]`
);
if (!menuTrigger)
return false;
const appEl2 = menuTrigger.closest(".NLT__app");
if (appEl2)
return appEl2.getAttribute("data-id") === appId;
}
return false;
};
// src/shared/export/download-utils.ts
var import_obsidian7 = require("obsidian");
// src/shared/export/types.ts
var ExportType = /* @__PURE__ */ ((ExportType2) => {
ExportType2["UNSELECTED"] = "Select an option";
ExportType2["MARKDOWN"] = "Markdown";
ExportType2["CSV"] = "CSV";
return ExportType2;
})(ExportType || {});
// src/shared/export/download-utils.ts
var getBlobTypeForExportType = (type) => {
switch (type) {
case "CSV" /* CSV */:
return "text/csv";
case "Markdown" /* MARKDOWN */:
return "text/markdown";
default:
throw new Error(`Unknown export type: ${type}`);
}
};
var getExportFileName = (filePath) => {
const replaceExtension = filePath.replace(`.${TABLE_EXTENSION}`, "");
const replaceSlash = replaceExtension.replace(/\//g, "-");
const replaceSpaces = replaceSlash.replace(/ /g, "_");
const timestamp = (0, import_obsidian7.moment)().format("YYYY_MM_DD-HH_mm_ss");
return replaceSpaces + "-" + timestamp;
};
var downloadFile = (fileName, blobType, data) => {
const blob = new Blob([data], { type: blobType });
const url = window.URL.createObjectURL(blob);
const el = document.createElement("a");
el.setAttribute("href", url);
el.setAttribute("download", fileName);
el.style.display = "none";
document.body.appendChild(el);
el.click();
document.body.removeChild(el);
};
// src/shared/export/export-to-csv.tsx
var import_papaparse = __toESM(require_papaparse_min());
// src/shared/cell-content/checkbox-cell-content.ts
var getCheckboxCellContent = (markdown, renderMarkdown2) => {
if (renderMarkdown2)
return markdown;
if (isCheckboxChecked(markdown))
return "true";
return "false";
};
// src/shared/cell-content/number-cell-content.ts
var getNumberCellContent = (value) => {
if (isNumber(value))
return value;
return "";
};
// src/shared/cell-content/text-cell-content.ts
var getTextCellContent = (markdown, renderMarkdown2) => {
if (!renderMarkdown2)
return markdown.replace(WIKI_LINK_REGEX, (_match, path) => {
return path;
});
return markdown;
};
// src/shared/cell-content/index.ts
var getTagCellContent = (column, cell) => {
return column.tags.filter((tag) => cell.tagIds.includes(tag.id)).map((tag) => tag.markdown).join(",");
};
var getCellContent = (column, row, cell, renderMarkdown2) => {
switch (column.type) {
case "text" /* TEXT */:
case "file" /* FILE */:
return getTextCellContent(cell.markdown, renderMarkdown2);
case "number" /* NUMBER */:
return getNumberCellContent(cell.markdown);
case "embed" /* EMBED */:
return getEmbedCellContent(cell.markdown, renderMarkdown2);
case "checkbox" /* CHECKBOX */:
return getCheckboxCellContent(cell.markdown, renderMarkdown2);
case "currency" /* CURRENCY */:
return getCurrencyCellContent(cell.markdown, column.currencyType);
case "tag" /* TAG */:
case "multi-tag" /* MULTI_TAG */:
return getTagCellContent(column, cell);
case "date" /* DATE */:
return getDateCellContent(cell.dateTime, column.dateFormat);
case "creation-time" /* CREATION_TIME */:
return getTimeCellContent(row.creationTime, column.dateFormat);
case "last-edited-time" /* LAST_EDITED_TIME */:
return getTimeCellContent(row.lastEditedTime, column.dateFormat);
default:
throw new Error("Unsupported cell type");
}
};
// src/shared/export/table-state-to-array.tsx
var serializeHeaderCells = (cells) => {
return cells.map((cell) => cell.markdown);
};
var serializeBodyCells = (columns, rows, cells, renderMarkdown2) => {
return rows.map((row) => {
const rowCells = cells.filter((cell) => cell.rowId === row.id);
return rowCells.map((cell) => {
const column = columns.find(
(column2) => column2.id === cell.columnId
);
if (!column)
throw new ColumNotFoundError(cell.columnId);
return getCellContent(column, row, cell, renderMarkdown2);
});
});
};
var tableStateToArray = (tableState, renderMarkdown2) => {
const { headerCells, bodyCells, bodyRows, columns } = tableState.model;
const serializedHeaderCells = serializeHeaderCells(headerCells);
const serializedBodyCells = serializeBodyCells(
columns,
bodyRows,
bodyCells,
renderMarkdown2
);
return [serializedHeaderCells, ...serializedBodyCells];
};
// src/shared/export/export-to-csv.tsx
var exportToCSV = (tableState, renderMarkdown2) => {
const arr = tableStateToArray(tableState, renderMarkdown2);
return import_papaparse.default.unparse(arr);
};
// node_modules/markdown-table/index.js
function markdownTable(table, options = {}) {
const align = (options.align || []).concat();
const stringLength = options.stringLength || defaultStringLength;
const alignments = [];
const cellMatrix = [];
const sizeMatrix = [];
const longestCellByColumn = [];
let mostCellsPerRow = 0;
let rowIndex = -1;
while (++rowIndex < table.length) {
const row2 = [];
const sizes2 = [];
let columnIndex2 = -1;
if (table[rowIndex].length > mostCellsPerRow) {
mostCellsPerRow = table[rowIndex].length;
}
while (++columnIndex2 < table[rowIndex].length) {
const cell = serialize(table[rowIndex][columnIndex2]);
if (options.alignDelimiters !== false) {
const size = stringLength(cell);
sizes2[columnIndex2] = size;
if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
longestCellByColumn[columnIndex2] = size;
}
}
row2.push(cell);
}
cellMatrix[rowIndex] = row2;
sizeMatrix[rowIndex] = sizes2;
}
let columnIndex = -1;
if (typeof align === "object" && "length" in align) {
while (++columnIndex < mostCellsPerRow) {
alignments[columnIndex] = toAlignment(align[columnIndex]);
}
} else {
const code = toAlignment(align);
while (++columnIndex < mostCellsPerRow) {
alignments[columnIndex] = code;
}
}
columnIndex = -1;
const row = [];
const sizes = [];
while (++columnIndex < mostCellsPerRow) {
const code = alignments[columnIndex];
let before = "";
let after = "";
if (code === 99) {
before = ":";
after = ":";
} else if (code === 108) {
before = ":";
} else if (code === 114) {
after = ":";
}
let size = options.alignDelimiters === false ? 1 : Math.max(
1,
longestCellByColumn[columnIndex] - before.length - after.length
);
const cell = before + "-".repeat(size) + after;
if (options.alignDelimiters !== false) {
size = before.length + size + after.length;
if (size > longestCellByColumn[columnIndex]) {
longestCellByColumn[columnIndex] = size;
}
sizes[columnIndex] = size;
}
row[columnIndex] = cell;
}
cellMatrix.splice(1, 0, row);
sizeMatrix.splice(1, 0, sizes);
rowIndex = -1;
const lines = [];
while (++rowIndex < cellMatrix.length) {
const row2 = cellMatrix[rowIndex];
const sizes2 = sizeMatrix[rowIndex];
columnIndex = -1;
const line = [];
while (++columnIndex < mostCellsPerRow) {
const cell = row2[columnIndex] || "";
let before = "";
let after = "";
if (options.alignDelimiters !== false) {
const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
const code = alignments[columnIndex];
if (code === 114) {
before = " ".repeat(size);
} else if (code === 99) {
if (size % 2) {
before = " ".repeat(size / 2 + 0.5);
after = " ".repeat(size / 2 - 0.5);
} else {
before = " ".repeat(size / 2);
after = before;
}
} else {
after = " ".repeat(size);
}
}
if (options.delimiterStart !== false && !columnIndex) {
line.push("|");
}
if (options.padding !== false && !(options.alignDelimiters === false && cell === "") && (options.delimiterStart !== false || columnIndex)) {
line.push(" ");
}
if (options.alignDelimiters !== false) {
line.push(before);
}
line.push(cell);
if (options.alignDelimiters !== false) {
line.push(after);
}
if (options.padding !== false) {
line.push(" ");
}
if (options.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
line.push("|");
}
}
lines.push(
options.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("")
);
}
return lines.join("\n");
}
function serialize(value) {
return value === null || value === void 0 ? "" : String(value);
}
function defaultStringLength(value) {
return value.length;
}
function toAlignment(value) {
const code = typeof value === "string" ? value.codePointAt(0) : 0;
return code === 67 || code === 99 ? 99 : code === 76 || code === 108 ? 108 : code === 82 || code === 114 ? 114 : 0;
}
// src/shared/export/export-to-markdown.tsx
var exportToMarkdown = (tableState, renderMarkdown2) => {
const arr = tableStateToArray(tableState, renderMarkdown2);
return markdownTable(arr);
};
// src/obsidian-shim/build/export-events.ts
var useExportEvents = (state) => {
const { filePath } = useMountState();
const { appId } = useMountState();
const { exportRenderMarkdown } = useAppSelector((state2) => state2.global);
import_react94.default.useEffect(() => {
function handleDownloadCSV() {
if (isEventForThisApp(appId)) {
setTimeout(() => {
const data = exportToCSV(state, exportRenderMarkdown);
const exportFileName = getExportFileName(filePath);
const blobType = getBlobTypeForExportType(
"Markdown" /* MARKDOWN */
);
downloadFile(exportFileName, blobType, data);
}, 100);
}
}
function handleDownloadMarkdown() {
if (isEventForThisApp(appId)) {
setTimeout(() => {
const data = exportToMarkdown(state, exportRenderMarkdown);
const exportFileName = getExportFileName(filePath);
const blobType = getBlobTypeForExportType(
"Markdown" /* MARKDOWN */
);
downloadFile(exportFileName, blobType, data);
}, 100);
}
}
app.workspace.on(EVENT_DOWNLOAD_CSV, handleDownloadCSV);
app.workspace.on(EVENT_DOWNLOAD_MARKDOWN, handleDownloadMarkdown);
return () => {
app.workspace.off(EVENT_DOWNLOAD_CSV, handleDownloadCSV);
app.workspace.off(EVENT_DOWNLOAD_MARKDOWN, handleDownloadMarkdown);
};
}, [filePath, state, appId, exportRenderMarkdown]);
};
// src/obsidian-shim/build/row-events.ts
var import_react95 = __toESM(require_react());
var useRowEvents = () => {
const { appId } = useMountState();
const { doCommand } = useTableState();
import_react95.default.useEffect(() => {
function handleRowAddEvent() {
if (isEventForThisApp(appId))
doCommand(new RowAddCommand());
}
function handleRowDeleteEvent() {
if (isEventForThisApp(appId))
doCommand(new RowDeleteCommand({ last: true }));
}
app.workspace.on(EVENT_ROW_ADD, handleRowAddEvent);
app.workspace.on(EVENT_ROW_DELETE, handleRowDeleteEvent);
return () => {
app.workspace.off(EVENT_ROW_ADD, handleRowAddEvent);
app.workspace.off(EVENT_ROW_DELETE, handleRowDeleteEvent);
};
}, [doCommand, appId]);
};
// src/obsidian-shim/build/column-events.ts
var import_react96 = __toESM(require_react());
var useColumnEvents = () => {
const { appId } = useMountState();
const { doCommand } = useTableState();
const logger = useLogger();
import_react96.default.useEffect(() => {
function handleColumnAddEvent() {
if (isEventForThisApp(appId)) {
logger("handleColumnAddEvent");
doCommand(new ColumnAddCommand());
}
}
function handleColumnDeleteEvent() {
if (isEventForThisApp(appId)) {
logger("handleColumnDeleteEvent");
doCommand(new ColumnDeleteCommand({ last: true }));
}
}
app.workspace.on(EVENT_COLUMN_ADD, handleColumnAddEvent);
app.workspace.on(EVENT_COLUMN_DELETE, handleColumnDeleteEvent);
return () => {
app.workspace.off(EVENT_COLUMN_ADD, handleColumnAddEvent);
app.workspace.off(EVENT_COLUMN_DELETE, handleColumnDeleteEvent);
};
}, [doCommand, logger, appId]);
};
// src/react/table-app/index.tsx
var TableApp = () => {
const { appId, isMarkdownView } = useMountState();
const { topMenu, hasOpenMenu, requestCloseTopMenu } = useMenuState();
const logger = useLogger();
const {
tableState,
resizingColumnId,
searchText,
commandRedo,
commandUndo,
setTableState
} = useTableState();
useExportEvents(tableState);
useRowEvents();
useColumnEvents();
const {
handleRuleAddClick,
handleRuleColumnChange,
handleRuleDeleteClick,
handleRuleFilterTypeChange,
handleRuleTextChange,
handleRuleToggle,
handleRuleTagsChange,
filterBodyRowsByRules: filterBodyRowsByRules2
} = useFilterRules(setTableState);
const {
handleNewColumnClick,
handleColumnToggle,
handleCurrencyChange,
handleDateFormatChange,
handleColumnDeleteClick,
handleColumnSortClick,
handleColumnTypeClick,
handleColumnWidthChange,
handleSortRemoveClick,
handleFunctionTypeChange,
handleWrapContentToggle,
handleAspectRatioClick,
handleHorizontalPaddingClick,
handleVerticalPaddingClick
} = useColumn();
const { handleNewRowClick, handleRowDeleteClick } = useRow();
const {
handleBodyCellContentChange,
handleCellDateTimeChange,
handleHeaderCellContentChange
} = useCell();
const {
handleTagCellAdd,
handleTagAdd,
handleTagCellRemove,
handleTagCellMultipleRemove,
handleTagColorChange,
handleTagDeleteClick
} = useTag();
const firstColumnId = useUUID();
const lastColumnId = useUUID();
function handleClick(e) {
logger("TableApp handleClick");
e.stopPropagation();
if (hasOpenMenu()) {
requestCloseTopMenu("click");
} else {
removeFocusVisibleClass();
}
}
function handleKeyDown(e) {
logger("TableApp handleKeyDown");
e.stopPropagation();
if (e.key === "Tab") {
removeFocusVisibleClass();
e.preventDefault();
const layerEl = getFocusableLayerEl(appId, topMenu);
if (!layerEl)
return;
const focusableEls = layerEl.querySelectorAll(".NLT__focusable");
if (focusableEls.length === 0)
return;
focusNextElement(layerEl, focusableEls);
} else if (isWindowsRedoDown(e) || isMacRedoDown(e)) {
e.preventDefault();
commandRedo();
} else if (isWindowsUndoDown(e) || isMacUndoDown(e)) {
e.preventDefault();
commandUndo();
} else if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "ArrowLeft" || e.key === "ArrowRight") {
const layerEl = getFocusableLayerEl(appId, topMenu);
if (!layerEl)
return;
const focusableEls = layerEl.querySelectorAll(".NLT__focusable");
if (focusableEls.length === 0)
return;
e.preventDefault();
const focusedEl = document.activeElement;
let index = -1;
if (focusedEl)
index = Array.from(focusableEls).indexOf(focusedEl);
const numVisibleColumns = tableState.model.columns.filter(
(column) => column.isVisible
).length;
const numBodyRows = tableState.model.bodyRows.length;
const numSortedColumns = tableState.model.columns.filter(
(column) => column.sortDir !== "default" /* NONE */
).length;
let elementToFocus = null;
switch (e.key) {
case "ArrowLeft":
elementToFocus = moveFocusLeft(focusableEls, index);
break;
case "ArrowRight":
elementToFocus = moveFocusRight(focusableEls, index);
break;
case "ArrowUp":
if (hasOpenMenu()) {
elementToFocus = moveMenuFocusUp(focusableEls, index);
} else {
elementToFocus = moveFocusUp(
focusableEls,
numVisibleColumns,
numBodyRows,
numSortedColumns,
index
);
}
break;
case "ArrowDown":
if (hasOpenMenu()) {
elementToFocus = moveMenuFocusDown(focusableEls, index);
} else {
elementToFocus = moveFocusDown(
focusableEls,
numVisibleColumns,
numBodyRows,
numSortedColumns,
index
);
break;
}
}
if (elementToFocus !== null) {
removeFocusVisibleClass();
elementToFocus.focus();
}
}
nltEventSystem.dispatchEvent("keydown", e);
}
const {
headerRows,
footerRows,
columns,
headerCells,
bodyCells,
footerCells,
filterRules
} = tableState.model;
let filteredBodyRows = filterBodyRowsByRules2(tableState);
filteredBodyRows = filterBodyRowsBySearch(
tableState,
filteredBodyRows,
searchText
);
const visibleColumns = columns.filter((column) => column.isVisible);
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)("div", {
"data-id": appId,
className: "NLT__app",
css: import_emotion_react_cjs.css`
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 10px 0px;
border-top: 1px solid var(--background-modifier-border);
border-bottom: ${isMarkdownView ? "1px solid var(--background-modifier-border)" : "unset"};
`,
onKeyDown: handleKeyDown,
onClick: handleClick,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(OptionBar, {
headerCells,
columns,
filterRules,
onColumnToggle: handleColumnToggle,
onSortRemoveClick: handleSortRemoveClick,
onRuleAddClick: handleRuleAddClick,
onRuleDeleteClick: handleRuleDeleteClick,
onRuleFilterTypeChange: handleRuleFilterTypeChange,
onRuleColumnChange: handleRuleColumnChange,
onRuleTextChange: handleRuleTextChange,
onRuleToggle: handleRuleToggle,
onRuleTagsChange: handleRuleTagsChange
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Table2, {
headerRows: headerRows.map((row) => {
return {
id: row.id,
cells: [
{
id: firstColumnId,
columnId: firstColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
css: import_emotion_react_cjs.css`
width: 35px;
`
})
},
...visibleColumns.map((column) => {
const {
id: columnId,
width,
type,
sortDir,
shouldWrapOverflow,
currencyType,
dateFormat,
verticalPadding,
horizontalPadding,
aspectRatio
} = column;
const cell = headerCells.find(
(cell2) => cell2.columnId === columnId
);
if (!cell)
throw new CellNotFoundError({
columnId
});
const { id: cellId, markdown, rowId } = cell;
return {
id: cellId,
columnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(HeaderCell2, {
cellId,
rowId,
dateFormat,
currencyType,
verticalPadding,
horizontalPadding,
aspectRatio,
numColumns: columns.length,
columnId: cell.columnId,
resizingColumnId,
width,
shouldWrapOverflow,
markdown,
type,
sortDir,
onSortClick: handleColumnSortClick,
onWidthChange: handleColumnWidthChange,
onDeleteClick: handleColumnDeleteClick,
onTypeSelect: handleColumnTypeClick,
onDateFormatChange: handleDateFormatChange,
onWrapOverflowToggle: handleWrapContentToggle,
onNameChange: handleHeaderCellContentChange,
onCurrencyChange: handleCurrencyChange,
onVerticalPaddingClick: handleVerticalPaddingClick,
onHorizontalPaddingClick: handleHorizontalPaddingClick,
onAspectRatioClick: handleAspectRatioClick
}, columnId)
};
}),
{
id: lastColumnId,
columnId: lastColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NewColumnButton, {
onClick: handleNewColumnClick
})
}
]
};
}),
bodyRows: filteredBodyRows.map((row) => {
const { id: rowId, lastEditedTime, creationTime } = row;
return {
id: rowId,
cells: [
{
id: firstColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(RowOptions, {
rowId,
onDeleteClick: handleRowDeleteClick
})
},
...visibleColumns.map((column) => {
const {
id: columnId,
width,
type,
shouldWrapOverflow,
currencyType,
dateFormat,
tags,
verticalPadding,
horizontalPadding,
aspectRatio
} = column;
const cell = bodyCells.find(
(cell2) => cell2.columnId === columnId && cell2.rowId === row.id
);
if (!cell)
throw new CellNotFoundError({
columnId,
rowId
});
const {
id: cellId,
markdown,
dateTime,
tagIds
} = cell;
return {
id: cellId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(BodyCell5, {
cellId,
verticalPadding,
horizontalPadding,
aspectRatio,
rowId,
columnTags: tags,
cellTagIds: tagIds,
columnId,
rowCreationTime: creationTime,
dateFormat,
columnCurrencyType: currencyType,
rowLastEditedTime: lastEditedTime,
dateTime,
markdown,
columnType: type,
shouldWrapOverflow,
width,
onTagClick: handleTagCellAdd,
onTagRemoveClick: handleTagCellRemove,
onTagMultipleRemove: handleTagCellMultipleRemove,
onContentChange: handleBodyCellContentChange,
onTagColorChange: handleTagColorChange,
onTagDelete: handleTagDeleteClick,
onDateTimeChange: handleCellDateTimeChange,
onDateFormatChange: handleDateFormatChange,
onTagAdd: handleTagAdd
}, cellId)
};
}),
{
id: lastColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
}
]
};
}),
footerRows: footerRows.map((row, i2) => {
if (i2 === 0) {
return {
id: row.id,
cells: [
{
id: firstColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
},
...visibleColumns.map((column) => {
const {
id: columnId,
type,
currencyType,
dateFormat,
width,
tags,
functionType
} = column;
const cell = footerCells.find(
(cell2) => cell2.rowId === row.id && cell2.columnId === column.id
);
if (!cell)
throw new CellNotFoundError({
rowId: row.id,
columnId: column.id
});
const { id: cellId } = cell;
const columnBodyCells = bodyCells.filter(
(cell2) => filteredBodyRows.find(
(row2) => row2.id === cell2.rowId
) !== void 0
);
return {
id: cell.id,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__footer-td-container",
css: import_emotion_react_cjs.css`
width: ${width};
`,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(FunctionCell, {
columnId,
columnTags: tags,
cellId,
currencyType,
dateFormat,
bodyCells: columnBodyCells,
bodyRows: filteredBodyRows,
functionType,
cellType: type,
onFunctionTypeChange: handleFunctionTypeChange
})
})
};
}),
{
id: lastColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
}
]
};
}
return {
id: row.id,
cells: [
{
id: firstColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
},
...visibleColumns.map((column, i3) => {
const cell = footerCells.find(
(cell2) => cell2.rowId === row.id && cell2.columnId === column.id
);
if (!cell)
throw new CellNotFoundError({
rowId: row.id,
columnId: column.id
});
if (i3 === 0) {
return {
id: cell.id,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
style: { width: column.width },
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NewRowButton, {
onClick: handleNewRowClick
})
})
};
}
return {
id: cell.id,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
};
}),
{
id: lastColumnId,
content: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(import_emotion_react_jsx_runtime_cjs.Fragment, {})
}
]
};
})
})
]
});
};
function AppWrapper({ store: store2, tableState, onSaveState }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Provider_default, {
store: store2,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableStateProvider, {
initialState: tableState,
onSaveState,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MenuProvider, {
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(DragProvider, {
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(TableApp, {})
})
})
})
});
}
// src/obsidian-shim/build/notion-like-table.tsx
function NotionLikeTable({
appId,
leaf,
isMarkdownView,
store: store2,
filePath,
tableState,
onSaveState
}) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(MountProvider, {
leaf,
appId,
isMarkdownView,
filePath,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(AppWrapper, {
store: store2,
tableState,
onSaveState
})
});
}
// src/shared/types/types-6.7.0.ts
var GeneralFunction2 = /* @__PURE__ */ ((GeneralFunction3) => {
GeneralFunction3["NONE"] = "none";
GeneralFunction3["COUNT_ALL"] = "count_all";
GeneralFunction3["COUNT_VALUES"] = "count_values";
GeneralFunction3["COUNT_UNIQUE"] = "count_unique";
GeneralFunction3["COUNT_EMPTY"] = "count_empty";
GeneralFunction3["COUNT_NOT_EMPTY"] = "count_not_empty";
GeneralFunction3["PERCENT_EMPTY"] = "percent_empty";
GeneralFunction3["PERCENT_NOT_EMPTY"] = "percent_not_empty";
return GeneralFunction3;
})(GeneralFunction2 || {});
var GeneralFunction670 = GeneralFunction2;
// src/shared/types/types-6.1.0.ts
var CurrencyType8 = /* @__PURE__ */ ((CurrencyType9) => {
CurrencyType9["UNITED_STATES"] = "USD";
CurrencyType9["CANADA"] = "CAD";
CurrencyType9["SINGAPORE"] = "SGB";
CurrencyType9["EUROPE"] = "EUR";
CurrencyType9["POUND"] = "GBP";
CurrencyType9["RUSSIA"] = "RUB";
CurrencyType9["AUSTRALIA"] = "AUD";
CurrencyType9["JAPAN"] = "JPY";
CurrencyType9["INDIA"] = "INR";
CurrencyType9["CHINA"] = "CNY";
CurrencyType9["BRAZIL"] = "BRL";
CurrencyType9["COLOMBIA"] = "COP";
CurrencyType9["MEXICO"] = "MXN";
CurrencyType9["ARGENTINA"] = "ARS";
return CurrencyType9;
})(CurrencyType8 || {});
var CurrencyType610 = CurrencyType8;
// src/shared/types/types-6.2.0.ts
var DateFormat8 = /* @__PURE__ */ ((DateFormat9) => {
DateFormat9["MM_DD_YYYY"] = "mm/dd/yyyy";
DateFormat9["DD_MM_YYYY"] = "dd/mm/yyyy";
DateFormat9["YYYY_MM_DD"] = "yyyy/mm/dd";
DateFormat9["FULL"] = "full";
DateFormat9["RELATIVE"] = "relative";
return DateFormat9;
})(DateFormat8 || {});
var DateFormat620 = DateFormat8;
// src/shared/versioning.ts
var legacyVersionToString = (version) => {
return version.toString().split("").join(".");
};
var isVersionLessThan = (oldVersion, newVersion) => {
const oldVersionArray = oldVersion.split(".");
const newVersionArray = newVersion.split(".");
for (let i2 = 0; i2 < oldVersionArray.length; i2++) {
const oldVersionNumber = parseInt(oldVersionArray[i2]);
const newVersionNumber = parseInt(newVersionArray[i2]);
if (oldVersionNumber < newVersionNumber) {
return true;
}
if (oldVersionNumber > newVersionNumber) {
return false;
}
}
return false;
};
// src/data/serialize-table-state.ts
var serializeTableState = (tableState) => {
return JSON.stringify(tableState, null, 2);
};
var deserializeTableState = (data) => {
const parsedState = JSON.parse(data);
const untypedVersion = parsedState["pluginVersion"];
let pluginVersion = "";
if (typeof untypedVersion === "number") {
pluginVersion = legacyVersionToString(untypedVersion);
} else if (typeof untypedVersion === "string") {
pluginVersion = untypedVersion;
}
let currentState = parsedState;
if (isVersionLessThan(pluginVersion, "6.1.0")) {
const tableState2 = currentState;
const { columns } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
typedColumn.currencyType = CurrencyType610.UNITED_STATES;
});
}
if (isVersionLessThan(pluginVersion, "6.2.0")) {
const tableState2 = currentState;
const { columns } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
typedColumn.dateFormat = DateFormat620.YYYY_MM_DD;
});
}
if (isVersionLessThan(pluginVersion, "6.3.0")) {
const tableState2 = currentState;
const { columns, rows, cells } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
if (typedColumn["hasAutoWidth"]) {
delete typedColumn.hasAutoWidth;
}
});
rows.forEach((row, i2) => {
const typedRow = row;
typedRow.index = i2;
});
columns.forEach((column) => {
const typedColumn = column;
typedColumn.isVisible = true;
});
cells.forEach((cell) => {
const typedCell = cell;
typedCell.dateTime = null;
});
}
if (isVersionLessThan(pluginVersion, "6.4.0")) {
const tableState2 = parsedState;
const { columns, tags, rows, cells } = tableState2.model;
const newState = __spreadProps(__spreadValues({}, tableState2), {
model: {
columns: [],
headerRows: [],
bodyRows: [],
footerRows: [],
headerCells: [],
bodyCells: [],
footerCells: [],
tags: []
}
});
newState.model.headerRows = [];
newState.model.headerRows.push(createHeaderRow());
newState.model.bodyRows = rows.filter((_row, i2) => i2 !== 0).map((row) => {
return {
id: row.id,
index: row.index - 1,
creationTime: row.creationTime,
lastEditedTime: row.lastEditedTime,
menuCellId: row.menuCellId
};
});
newState.model.footerRows = [];
newState.model.footerRows.push(createFooterRow());
newState.model.footerRows.push(createFooterRow());
newState.model.columns = columns.map((column) => {
return {
id: column.id,
sortDir: column.sortDir,
width: column.width,
type: column.type,
isVisible: column.isVisible,
dateFormat: column.dateFormat,
currencyType: column.currencyType,
shouldWrapOverflow: column.shouldWrapOverflow
};
});
newState.model.headerCells = cells.filter((cell) => cell.isHeader).map((cell) => {
return {
id: cell.id,
columnId: cell.columnId,
rowId: newState.model.headerRows[0].id,
markdown: cell.markdown
};
});
newState.model.bodyCells = cells.filter((cell) => !cell.isHeader).map((cell) => {
return {
id: cell.id,
columnId: cell.columnId,
rowId: cell.rowId,
dateTime: cell.dateTime,
markdown: cell.markdown
};
});
for (let i2 = 0; i2 < 2; i2++) {
columns.forEach((column) => {
newState.model.footerCells.push({
id: v4_default(),
columnId: column.id,
rowId: newState.model.footerRows[i2].id,
functionType: GeneralFunction670.NONE
});
});
}
newState.model.tags = tags;
currentState = newState;
}
if (isVersionLessThan(pluginVersion, "6.8.0")) {
const tableState2 = currentState;
const { model } = tableState2;
const { bodyCells, columns } = model;
const invalidState = currentState;
if (invalidState["bodyRows"]) {
delete invalidState.bodyRows;
}
const unknownModel = model;
const typedModal = unknownModel;
typedModal.filterRules = [];
bodyCells.forEach((cell) => {
const column = columns.find(
(column2) => column2.id === cell.columnId
);
if (!column)
throw new ColumNotFoundError(cell.columnId);
if (column.type === "checkbox" /* CHECKBOX */) {
if (cell.markdown === "") {
cell.markdown = CHECKBOX_MARKDOWN_UNCHECKED;
}
}
});
}
if (isVersionLessThan(pluginVersion, "6.9.1")) {
const tableState2 = currentState;
const { footerCells } = tableState2.model;
footerCells.forEach((cell) => {
const typedCell = cell;
if (typedCell["functionType"]) {
typedCell.functionType = typedCell.functionType.replace(/_/g, "-");
}
});
}
if (isVersionLessThan(pluginVersion, "6.10.0")) {
const tableState2 = currentState;
const { columns, tags, bodyCells, bodyRows } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
typedColumn.tags = [];
});
bodyCells.forEach((cell) => {
const typedCell = cell;
typedCell.tagIds = [];
});
tags.forEach((tag) => {
const { id: id2, columnId, markdown, color } = tag;
const column = columns.find(
(column2) => column2.id === columnId
);
if (!column)
throw new ColumNotFoundError(columnId);
const typedColumn = column;
typedColumn.tags.push({
id: id2,
markdown,
color
});
tag.cellIds.forEach((cellId) => {
const cell = bodyCells.find(
(cell2) => cell2.id === cellId
);
if (!cell)
return;
const typedCell = cell;
typedCell.tagIds.push(id2);
});
});
const unknownModel = tableState2.model;
const typedModel = unknownModel;
delete typedModel.tags;
bodyRows.forEach((row) => {
const typedRow = row;
if (typedRow["menuCellId"]) {
delete typedRow.menuCellId;
}
});
}
if (isVersionLessThan(pluginVersion, "6.12.3")) {
const tableState2 = currentState;
const { columns, footerCells } = tableState2.model;
footerCells.forEach((cell) => {
const column = columns.find(
(column2) => column2.id === cell.columnId
);
if (!column)
throw new ColumNotFoundError(cell.columnId);
const unknownColumn = column;
const typedColumn = unknownColumn;
typedColumn.functionType = cell.functionType;
const unknownCell = cell;
const typedCell = unknownCell;
if (typedCell["functionType"]) {
delete typedCell.functionType;
}
});
}
if (isVersionLessThan(pluginVersion, "6.17.0")) {
const tableState2 = currentState;
const { columns } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
typedColumn.isLocked = false;
typedColumn.aspectRatio = "16/9" /* SIXTEEN_BY_NINE */;
typedColumn.horizontalPadding = "unset";
typedColumn.verticalPadding = "unset";
});
}
if (isVersionLessThan(pluginVersion, "6.18.6")) {
const tableState2 = currentState;
const { columns, bodyRows } = tableState2.model;
columns.forEach((column) => {
const typedColumn = column;
typedColumn.sortDir = "default" /* NONE */;
});
bodyRows.sort((a2, b2) => a2.index - b2.index);
bodyRows.forEach((row, i2) => {
const typedRow = row;
typedRow.index = i2;
});
}
const tableState = currentState;
tableState.pluginVersion = CURRENT_PLUGIN_VERSION;
return tableState;
};
// src/obsidian/nlt-export-modal.tsx
var import_obsidian9 = require("obsidian");
var import_client = __toESM(require_client());
// src/react/export-app/index.tsx
var import_react100 = __toESM(require_react());
// src/react/export-app/export-type-select.tsx
function ExportTypeSelect({ value, onChange }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
isVertical: true,
spacing: "xl",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("label", {
htmlFor: "type-select",
children: "File Type"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("select", {
id: "type-select",
css: import_emotion_react_cjs.css`
background-color: var(
--background-secondary-alt
) !important;
`,
value,
onChange: (e) => onChange(e.target.value),
children: Object.values(ExportType).map((type) => /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("option", {
value: type,
children: type
}, type))
})
]
});
}
// src/react/export-app/content-textarea.tsx
function ContentTextArea({ value }) {
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("textarea", {
readOnly: true,
css: import_emotion_react_cjs.css`
width: 100%;
height: 200px;
resize: vertical;
`,
value
});
}
// src/react/export-app/index.tsx
var import_obsidian8 = require("obsidian");
function ExportApp({ tableState, filePath }) {
const [exportType, setExportType] = import_react100.default.useState(
"Select an option" /* UNSELECTED */
);
const { exportRenderMarkdown } = useAppSelector((state) => state.global);
const [renderMarkdown2, setRenderMarkdown] = import_react100.default.useState(exportRenderMarkdown);
function handleCopyClick(value) {
return __async(this, null, function* () {
yield navigator.clipboard.writeText(value);
new import_obsidian8.Notice("Copied to clipboard");
});
}
function handleDownloadClick() {
const fileName = getExportFileName(filePath);
const blobType = getBlobTypeForExportType(exportType);
downloadFile(fileName, blobType, content);
}
let content = "";
if (exportType === "Markdown" /* MARKDOWN */) {
content = exportToMarkdown(tableState, renderMarkdown2);
} else if (exportType === "CSV" /* CSV */) {
content = exportToCSV(tableState, renderMarkdown2);
}
return /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("div", {
className: "NLT__export-app",
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Padding, {
p: "xl",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("h5", {
css: import_emotion_react_cjs.css`
margin-top: 0px;
margin-bottom: 0px;
`,
children: "Notion-Like Tables Export"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("hr", {
css: import_emotion_react_cjs.css`
margin: 1rem 0;
`
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
spacing: "xl",
isVertical: true,
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ExportTypeSelect, {
value: exportType,
onChange: setExportType
}),
exportType !== "Select an option" /* UNSELECTED */ && /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(import_emotion_react_jsx_runtime_cjs.Fragment, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ContentTextArea, {
value: content
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
isVertical: true,
spacing: "sm",
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("label", {
htmlFor: "render-markdown",
children: "Render markdown"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("input", {
id: "render-markdown",
type: "checkbox",
checked: renderMarkdown2,
onChange: () => setRenderMarkdown(!renderMarkdown2)
})
]
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsxs)(Stack, {
children: [
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("button", {
className: "mod-cta",
onClick: handleDownloadClick,
children: "Download"
}),
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)("button", {
css: import_emotion_react_cjs.css`
background-color: var(
--background-secondary-alt
) !important;
`,
onClick: () => handleCopyClick(content),
children: "Copy to clipboard"
})
]
})
]
})
]
})
]
})
});
}
// src/obsidian/nlt-export-modal.tsx
var NLTExportModal = class extends import_obsidian9.Modal {
constructor(app2, filePath) {
super(app2);
__publicField(this, "root");
__publicField(this, "filePath");
this.app = app2;
this.filePath = filePath;
}
onOpen() {
const container = this.containerEl.children[1];
const view = app.workspace.getActiveViewOfType(NLTView);
if (view) {
const data = view.getViewData();
const state = deserializeTableState(data);
this.root = (0, import_client.createRoot)(container);
this.root.render(
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(Provider_default, {
store,
children: /* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(ExportApp, {
tableState: state,
filePath: this.filePath
})
})
);
}
}
onClose() {
if (this.root)
this.root.unmount();
}
};
// src/obsidian/nlt-view.tsx
var NOTION_LIKE_TABLES_VIEW = "notion-like-tables";
var NLTView = class extends import_obsidian10.TextFileView {
constructor(leaf) {
super(leaf);
__publicField(this, "root");
__publicField(this, "appId");
__publicField(this, "data");
__publicField(this, "handleRefreshEvent", (filePath, sourceAppId, state) => {
if (this.appId !== sourceAppId && filePath === this.file.path) {
const serialized = serializeTableState(state);
this.setViewData(serialized, true);
}
});
__publicField(this, "handleSaveTableState", (appId, state) => {
const serialized = serializeTableState(state);
this.data = serialized;
this.requestSave();
this.app.workspace.trigger(
EVENT_REFRESH_TABLES,
this.file.path,
appId,
state
);
});
this.root = null;
this.data = "";
this.appId = v4_default();
}
onOpen() {
return __async(this, null, function* () {
this.containerEl.style.paddingBottom = "48px";
const container = this.containerEl.children[1];
this.root = (0, import_client2.createRoot)(container);
this.addAction("settings", "Settings", () => {
this.app.setting.open();
this.app.setting.openTabById("notion-like-tables");
});
this.addAction("download", "Export", () => {
new NLTExportModal(this.app, this.file.path).open();
});
this.app.workspace.on(
EVENT_REFRESH_TABLES,
this.handleRefreshEvent
);
});
}
onClose() {
return __async(this, null, function* () {
this.app.workspace.off(EVENT_REFRESH_TABLES, this.handleRefreshEvent);
if (this.root) {
this.root.unmount();
this.root = null;
}
});
}
setViewData(data, clear) {
this.data = data;
const state = deserializeTableState(data);
if (clear) {
setTimeout(() => {
if (this.root) {
this.root.unmount();
const container = this.containerEl.children[1];
this.root = (0, import_client2.createRoot)(container);
this.renderApp(this.appId, state);
}
}, 0);
} else {
this.renderApp(this.appId, state);
}
}
clear() {
this.data = "{}";
}
getViewData() {
return this.data;
}
getViewType() {
return NOTION_LIKE_TABLES_VIEW;
}
getDisplayText() {
var _a;
const fileName = (_a = this.file) == null ? void 0 : _a.name;
if (fileName) {
const extensionIndex = fileName.lastIndexOf(".");
return fileName.substring(0, extensionIndex);
}
return "";
}
renderApp(appId, state) {
if (this.root) {
this.root.render(
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NotionLikeTable, {
leaf: this.leaf,
appId,
filePath: this.file.path,
isMarkdownView: false,
store,
tableState: state,
onSaveState: this.handleSaveTableState
})
);
}
}
};
// src/data/table-file.ts
var import_obsidian11 = require("obsidian");
var import_obsidian12 = require("obsidian");
// src/data/utils.ts
var splitFileExtension = (filePath) => {
if (filePath.match(EXTENSION_REGEX)) {
const periodIndex = filePath.lastIndexOf(".");
return [
filePath.substring(0, periodIndex),
filePath.substring(periodIndex)
];
}
return null;
};
var updateLinkReferences = (markdown, updatedFileInfo, oldPath, isFileNameUnique) => {
return markdown.replace(WIKI_LINK_REGEX, (match, path) => {
let comparePath = oldPath;
if (!path.includes("/"))
comparePath = stripDirectory(comparePath);
if (!path.match(EXTENSION_REGEX))
comparePath = stripFileExtension(comparePath);
if (comparePath === path) {
const linkText = getWikiLinkText(updatedFileInfo, isFileNameUnique);
return `[[${linkText}]]`;
}
return match;
});
};
// src/data/file-operations.ts
var createFolder = (folderPath) => __async(void 0, null, function* () {
return yield app.vault.createFolder(folderPath);
});
var createFile = (filePath, data, numExisting = 0) => __async(void 0, null, function* () {
try {
const filePathExtension = splitFileExtension(filePath);
if (filePathExtension == null)
throw new SyntaxError("File must include an extension");
const numIterations = numExisting > 0 ? " " + numExisting : "";
const filePathWithIteration = filePathExtension[0] + numIterations + filePathExtension[1];
yield app.vault.create(filePathWithIteration, data);
return filePathWithIteration;
} catch (err) {
const error = err;
if (error.message.includes("File already exists")) {
return createFile(filePath, data, numExisting + 1);
} else {
throw err;
}
}
});
// src/data/table-file.ts
var getActiveFileNameAndTimestamp = () => {
const activeView = app.workspace.getActiveViewOfType(import_obsidian11.MarkdownView);
if (!activeView)
return null;
const file = activeView.file;
if (!file)
return null;
return `${file.basename}-${(0, import_obsidian12.moment)().format().replaceAll(":", ".")}`;
};
var getFileName = (useActiveFileNameAndTimestamp) => {
let fileName = DEFAULT_TABLE_NAME;
if (useActiveFileNameAndTimestamp) {
const name = getActiveFileNameAndTimestamp();
if (name)
fileName = name;
}
return `${fileName}.${TABLE_EXTENSION}`;
};
var getFilePath = (folderPath, fileName) => {
if (folderPath === "")
return fileName;
return folderPath + "/" + fileName;
};
var createTableFile = (options) => __async(void 0, null, function* () {
try {
if (options.folderPath !== "") {
if (app.vault.getAbstractFileByPath(options.folderPath) == null)
yield createFolder(options.folderPath);
}
const fileName = getFileName(options.useActiveFileNameAndTimestamp);
const tableState = createTableState(1, 1);
const serialized = serializeTableState(tableState);
const filePath = getFilePath(options.folderPath, fileName);
return yield createFile(filePath, serialized);
} catch (err) {
new import_obsidian11.Notice("Could not create Notion-Like table");
throw err;
}
});
// src/obsidian/nlt-embedded-plugin.tsx
var import_view = require("@codemirror/view");
var import_obsidian13 = require("obsidian");
var import_client3 = __toESM(require_client());
var import_lodash = __toESM(require_lodash());
// src/obsidian/utils.ts
var getEmbeddedTableLinkEls = (el) => {
const embeddedLinkEls = el.querySelectorAll(".internal-embed");
const tableLinkEls = [];
for (let i2 = 0; i2 < embeddedLinkEls.length; i2++) {
const linkEl = embeddedLinkEls[i2];
const src = linkEl.getAttribute("src");
if (src == null ? void 0 : src.endsWith(TABLE_EXTENSION))
tableLinkEls.push(linkEl);
}
return tableLinkEls;
};
var removeEmbeddedLinkChildren = (embeddedLinkEl) => {
if (embeddedLinkEl.children.length > 0) {
const firstChildEl = embeddedLinkEl.children[0];
if (firstChildEl.classList.contains("NLT__embedded-container"))
return;
for (let i2 = 0; i2 < embeddedLinkEl.children.length; i2++) {
embeddedLinkEl.removeChild(embeddedLinkEl.children[i2]);
}
}
};
var findEmbeddedTableFile = (embeddedLinkEl) => {
var _a;
const src = embeddedLinkEl.getAttribute("src");
const tableFile = app.vault.getFiles().find((file) => file.path === src);
if (tableFile === void 0)
return (_a = app.vault.getFiles().find((file) => file.name === src)) != null ? _a : null;
return tableFile != null ? tableFile : null;
};
var getEmbeddedTableWidth = (embeddedLinkEl) => {
const width = embeddedLinkEl.getAttribute("width");
if (width === null || width === "1")
return "100%";
return numToPx(width);
};
var getEmbeddedTableHeight = (embeddedLinkEl) => {
const height = embeddedLinkEl.getAttribute("height");
if (height === null || height === "1")
return "340px";
return numToPx(height);
};
// src/obsidian/nlt-embedded-plugin.tsx
var NLTEmbeddedPlugin = class {
constructor() {
__publicField(this, "tableApps");
__publicField(this, "handleRefreshEvent", (filePath, sourceAppId, state) => {
const app2 = this.tableApps.find(
(app3) => app3.id !== sourceAppId && app3.file.path === filePath
);
if (!app2)
return;
const { id: id2, parentEl, leaf, file } = app2;
if (!app2.root)
return;
setTimeout(() => {
var _a;
(_a = app2.root) == null ? void 0 : _a.unmount();
app2.root = (0, import_client3.createRoot)(parentEl);
this.renderApp(id2, leaf, file, app2.root, state);
}, 0);
});
this.tableApps = [];
this.setupEventListeners();
}
update() {
const activeView = app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView);
if (!activeView)
return;
const embeddedTableLinkEls = getEmbeddedTableLinkEls(
activeView.containerEl
);
for (let i2 = 0; i2 < embeddedTableLinkEls.length; i2++) {
const linkEl = embeddedTableLinkEls[i2];
removeEmbeddedLinkChildren(linkEl);
const file = findEmbeddedTableFile(linkEl);
if (!file)
return;
const width = getEmbeddedTableWidth(linkEl);
const height = getEmbeddedTableHeight(linkEl);
linkEl.style.width = width;
linkEl.style.height = height;
if (this.tableApps.find((app2) => app2.file.path === file.path))
return;
linkEl.style.backgroundColor = "var(--color-primary)";
linkEl.style.cursor = "unset";
linkEl.style.margin = "0px";
linkEl.style.padding = "0px";
const tableContainerEl = linkEl.createDiv();
tableContainerEl.className = "NLT__embedded-container";
tableContainerEl.style.height = "100%";
tableContainerEl.style.width = "100%";
const appId = v4_default();
this.tableApps.push({
id: appId,
leaf: activeView.leaf,
parentEl: tableContainerEl,
file
});
this.setupTable(activeView, tableContainerEl, file, appId);
}
}
setupTable(activeView, tableContainerEl, file, appId) {
return __async(this, null, function* () {
tableContainerEl.addEventListener("click", (e) => {
e.stopPropagation();
});
const data = yield app.vault.read(file);
const tableState = deserializeTableState(data);
const table = this.tableApps.find((app2) => app2.id === appId);
if (!table)
return;
table.root = (0, import_client3.createRoot)(tableContainerEl);
this.renderApp(appId, activeView.leaf, file, table.root, tableState);
});
}
handleSave(tableFile, appId, state) {
return __async(this, null, function* () {
const serialized = serializeTableState(state);
yield app.vault.modify(tableFile, serialized);
app.workspace.trigger(
EVENT_REFRESH_TABLES,
tableFile.path,
appId,
state
);
});
}
renderApp(id2, leaf, tableFile, root, tableState) {
const throttleHandleSave = import_lodash.default.throttle(this.handleSave, 2e3);
root.render(
/* @__PURE__ */ (0, import_emotion_react_jsx_runtime_cjs.jsx)(NotionLikeTable, {
appId: id2,
isMarkdownView: true,
filePath: tableFile.path,
leaf,
store,
tableState,
onSaveState: (appId, state) => throttleHandleSave(tableFile, appId, state)
})
);
}
setupEventListeners() {
app.workspace.on(EVENT_REFRESH_TABLES, this.handleRefreshEvent);
}
destroy() {
this.tableApps.forEach((app2) => {
var _a;
return (_a = app2.root) == null ? void 0 : _a.unmount();
});
this.tableApps = [];
app.workspace.off(EVENT_REFRESH_TABLES, this.handleRefreshEvent);
}
};
var nltEmbeddedPlugin = import_view.ViewPlugin.fromClass(NLTEmbeddedPlugin);
// src/main.ts
var DEFAULT_SETTINGS = {
shouldDebug: false,
createAtObsidianAttachmentFolder: false,
customFolderForNewTables: "",
nameWithActiveFileNameAndTimestamp: false,
exportRenderMarkdown: true
};
var NLTPlugin = class extends import_obsidian14.Plugin {
constructor() {
super(...arguments);
__publicField(this, "settings");
}
onload() {
return __async(this, null, function* () {
yield this.loadSettings();
this.registerView(NOTION_LIKE_TABLES_VIEW, (leaf) => new NLTView(leaf));
this.registerExtensions([TABLE_EXTENSION], NOTION_LIKE_TABLES_VIEW);
this.addRibbonIcon("table", "Create Notion-Like table", () => __async(this, null, function* () {
yield this.newTableFile(null);
}));
this.addSettingTab(new NLTSettingsTab(this.app, this));
this.registerEmbeddedView();
this.registerCommands();
this.registerEvents();
this.registerDOMEvents();
});
}
registerEmbeddedView() {
this.registerEditorExtension(nltEmbeddedPlugin);
}
newTableFile(contextMenuFolderPath, embedded) {
return __async(this, null, function* () {
let folderPath = "";
if (contextMenuFolderPath) {
folderPath = contextMenuFolderPath;
} else if (this.settings.createAtObsidianAttachmentFolder) {
folderPath = this.app.vault.getConfig(
"attachmentFolderPath"
);
} else {
folderPath = this.settings.customFolderForNewTables;
}
const filePath = yield createTableFile({
folderPath,
useActiveFileNameAndTimestamp: this.settings.nameWithActiveFileNameAndTimestamp
});
if (embedded)
return filePath;
yield app.workspace.getLeaf(true).setViewState({
type: NOTION_LIKE_TABLES_VIEW,
active: true,
state: { file: filePath }
});
});
}
registerDOMEvents() {
this.registerDomEvent(document, "click", () => {
if (this.settings.shouldDebug)
console.log("main handleClick");
removeFocusVisibleClass();
this.app.workspace.trigger(EVENT_OUTSIDE_CLICK);
});
this.registerDomEvent(document, "keydown", (e) => {
if (this.settings.shouldDebug)
console.log("main handleKeyDown");
this.app.workspace.trigger(EVENT_OUTSIDE_KEYDOWN, e);
});
}
registerEvents() {
this.registerEvent(
this.app.workspace.on("css-change", () => {
const isDark = hasDarkTheme();
store.dispatch(setDarkMode(isDark));
})
);
this.registerEvent(
this.app.workspace.on("file-menu", (menu, file) => {
if (file instanceof import_obsidian14.TFolder) {
menu.addItem((item) => {
item.setTitle("New Notion-Like table").setIcon("document").onClick(() => __async(this, null, function* () {
yield this.newTableFile(file.path);
}));
});
}
})
);
this.app.vault.on(
"rename",
(file, oldPath) => __async(this, null, function* () {
if (file instanceof import_obsidian14.TFile) {
const files = this.app.vault.getFiles();
const uniqueFileNames = filterUniqueStrings(
files.map((file2) => file2.name)
);
const isUniqueFileName = uniqueFileNames.includes(
file.name
);
const tableFiles = files.filter(
(file2) => file2.extension === TABLE_EXTENSION
);
for (let i2 = 0; i2 < tableFiles.length; i2++) {
const tableFile = tableFiles[i2];
const content = yield tableFile.vault.read(
tableFiles[i2]
);
const deserializedState = deserializeTableState(content);
const newState = structuredClone(deserializedState);
newState.model.bodyCells.forEach((cell) => {
const updatedMarkdown = updateLinkReferences(
cell.markdown,
file,
oldPath,
isUniqueFileName
);
cell.markdown = updatedMarkdown;
});
if (JSON.stringify(deserializedState) !== JSON.stringify(newState)) {
const serializedState = serializeTableState(newState);
yield tableFile.vault.modify(
tableFile,
serializedState
);
app.workspace.trigger(
EVENT_REFRESH_TABLES,
tableFile.path,
-1,
newState
);
}
}
}
})
);
this.app.workspace.onLayoutReady(() => {
const isDark = hasDarkTheme();
store.dispatch(setDarkMode(isDark));
store.dispatch(setDebugMode(this.settings.shouldDebug));
});
}
registerCommands() {
this.addCommand({
id: "nlt-create-table",
name: "Create table",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "=" }],
callback: () => __async(this, null, function* () {
yield this.newTableFile(null);
})
});
this.addCommand({
id: "nlt-create-table-and-embed",
name: "Create table and embed it into current file",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "+" }],
editorCallback: (editor) => __async(this, null, function* () {
const filePath = yield this.newTableFile(null, true);
if (!filePath)
return;
const useMarkdownLinks = this.app.vault.getConfig(
"useMarkdownLinks"
);
const linkText = useMarkdownLinks ? `![${getBasename(filePath)}](${encodeURI(filePath)})` : `![[${filePath}]]`;
editor.replaceRange(linkText, editor.getCursor());
editor.setCursor(
editor.getCursor().line,
editor.getCursor().ch + linkText.length
);
})
});
this.addCommand({
id: "nlt-add-column",
name: "Add column",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "\\" }],
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking) {
this.app.workspace.trigger(EVENT_COLUMN_ADD);
}
return true;
}
return false;
}
});
this.addCommand({
id: "nlt-delete-column",
name: "Delete column",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "Backspace" }],
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking) {
this.app.workspace.trigger(EVENT_COLUMN_DELETE);
}
return true;
}
return false;
}
});
this.addCommand({
id: "nlt-add-row",
name: "Add row",
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "Enter" }],
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking)
this.app.workspace.trigger(EVENT_ROW_ADD);
return true;
}
return false;
}
});
this.addCommand({
id: "nlt-row-column",
name: "Delete row",
hotkeys: [{ modifiers: ["Alt", "Shift"], key: "Backspace" }],
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking) {
this.app.workspace.trigger(EVENT_ROW_DELETE);
}
return true;
}
return false;
}
});
this.addCommand({
id: "nlt-export-markdown",
name: "Export as markdown",
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking) {
this.app.workspace.trigger(EVENT_DOWNLOAD_MARKDOWN);
}
return true;
}
return false;
}
});
this.addCommand({
id: "nlt-export-csv",
name: "Export as CSV",
checkCallback: (checking) => {
const nltView = this.app.workspace.getActiveViewOfType(NLTView);
const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView);
if (nltView || markdownView) {
if (!checking) {
this.app.workspace.trigger(EVENT_DOWNLOAD_CSV);
}
return true;
}
return false;
}
});
}
loadSettings() {
return __async(this, null, function* () {
this.settings = Object.assign(
{},
DEFAULT_SETTINGS,
yield this.loadData()
);
store.dispatch(
setExportRenderMarkdown(this.settings.exportRenderMarkdown)
);
});
}
saveSettings() {
return __async(this, null, function* () {
yield this.saveData(this.settings);
});
}
onunload() {
return __async(this, null, function* () {
this.app.workspace.detachLeavesOfType(NOTION_LIKE_TABLES_VIEW);
});
}
};
/* @license
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/
/**
* @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 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.
*/