studiox-mixer/frontend/build/bundle.js

29224 lines
1.2 MiB

var global = window;
window.process = {
title: "browser",
env: {},
nextTick: function (cb, ...args) {
Promise.resolve().then(() => cb(...args))
}
};
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
var __commonJS = (callback, module) => () => {
if (!module) {
module = {exports: {}};
callback(module.exports, module);
}
return module.exports;
};
var __exportStar = (target, module, desc) => {
if (module && typeof module === "object" || typeof module === "function") {
for (let key of __getOwnPropNames(module))
if (!__hasOwnProp.call(target, key) && key !== "default")
__defProp(target, key, {get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
}
return target;
};
var __toModule = (module) => {
if (module && module.__esModule)
return module;
return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", {value: module, enumerable: true})), module);
};
// node_modules/object-assign/index.js
var require_object_assign = __commonJS((exports, module) => {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
"use strict";
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === void 0) {
throw new TypeError("Object.assign cannot be called with null or undefined");
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
var test1 = new String("abc");
test1[5] = "de";
if (Object.getOwnPropertyNames(test1)[0] === "5") {
return false;
}
var test2 = {};
for (var i = 0; i < 10; i++) {
test2["_" + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function(n4) {
return test2[n4];
});
if (order2.join("") !== "0123456789") {
return false;
}
var test3 = {};
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
return false;
}
return true;
} catch (err) {
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty2.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
});
// node_modules/prop-types/lib/ReactPropTypesSecret.js
var require_ReactPropTypesSecret = __commonJS((exports, module) => {
"use strict";
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
module.exports = ReactPropTypesSecret;
});
// node_modules/prop-types/checkPropTypes.js
var require_checkPropTypes = __commonJS((exports, module) => {
"use strict";
var printWarning = function() {
};
if (true) {
ReactPropTypesSecret = require_ReactPropTypesSecret();
loggedTypeFailures = {};
has = Function.call.bind(Object.prototype.hasOwnProperty);
printWarning = function(text) {
var message = "Warning: " + text;
if (typeof console !== "undefined") {
console.error(message);
}
try {
throw new Error(message);
} catch (x) {
}
};
}
var ReactPropTypesSecret;
var loggedTypeFailures;
var has;
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (true) {
for (var typeSpecName in typeSpecs) {
if (has(typeSpecs, typeSpecName)) {
var error;
try {
if (typeof typeSpecs[typeSpecName] !== "function") {
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.");
err.name = "Invariant Violation";
throw err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error)) {
printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : "";
printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : ""));
}
}
}
}
}
checkPropTypes.resetWarningCache = function() {
if (true) {
loggedTypeFailures = {};
}
};
module.exports = checkPropTypes;
});
// node_modules/react/cjs/react.development.js
var require_react_development = __commonJS((exports) => {
/** @license React v16.14.0
* 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.
*/
"use strict";
if (true) {
(function() {
"use strict";
var _assign = require_object_assign();
var checkPropTypes = require_checkPropTypes();
var ReactVersion = "16.14.0";
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_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;
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && 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 = {
suspense: null
};
var ReactCurrentOwner = {
current: null
};
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
function describeComponentFrame(name, source, ownerName) {
var sourceInfo = "";
if (source) {
var path = source.fileName;
var fileName = path.replace(BEFORE_SLASH_RE, "");
{
if (/^index\./.test(fileName)) {
var match = path.match(BEFORE_SLASH_RE);
if (match) {
var pathBeforeSlash = match[1];
if (pathBeforeSlash) {
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
fileName = folderName + "/" + fileName;
}
}
}
}
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
} else if (ownerName) {
sourceInfo = " (created by " + ownerName + ")";
}
return "\n in " + (name || "Unknown") + sourceInfo;
}
var Resolved = 1;
function refineResolvedLazyComponent(lazyComponent) {
return lazyComponent._status === Resolved ? lazyComponent._result : null;
}
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || "";
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
}
function getComponentName(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentName(). 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:
return "Context.Consumer";
case REACT_PROVIDER_TYPE:
return "Context.Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
return getComponentName(type.type);
case REACT_BLOCK_TYPE:
return getComponentName(type.render);
case REACT_LAZY_TYPE: {
var thenable = type;
var resolvedThenable = refineResolvedLazyComponent(thenable);
if (resolvedThenable) {
return getComponentName(resolvedThenable);
}
break;
}
}
}
return null;
}
var ReactDebugCurrentFrame = {};
var currentlyValidatingElement = null;
function setCurrentlyValidatingElement(element) {
{
currentlyValidatingElement = element;
}
}
{
ReactDebugCurrentFrame.getCurrentStack = null;
ReactDebugCurrentFrame.getStackAddendum = function() {
var stack = "";
if (currentlyValidatingElement) {
var name = getComponentName(currentlyValidatingElement.type);
var owner = currentlyValidatingElement._owner;
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
}
var impl = ReactDebugCurrentFrame.getCurrentStack;
if (impl) {
stack += impl() || "";
}
return stack;
};
}
var IsSomeRendererActing = {
current: false
};
var ReactSharedInternals = {
ReactCurrentDispatcher,
ReactCurrentBatchConfig,
ReactCurrentOwner,
IsSomeRendererActing,
assign: _assign
};
{
_assign(ReactSharedInternals, {
ReactDebugCurrentFrame,
ReactComponentTreeHook: {}
});
}
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 hasExistingStack = args.length > 0 && typeof args[args.length - 1] === "string" && args[args.length - 1].indexOf("\n in") === 0;
if (!hasExistingStack) {
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame2.getStackAddendum();
if (stack !== "") {
format += "%s";
args = args.concat([stack]);
}
}
var argsWithFormat = args.map(function(item) {
return "" + item;
});
argsWithFormat.unshift("Warning: " + format);
Function.prototype.apply.call(console[level], console, argsWithFormat);
try {
var argIndex = 0;
var message = "Warning: " + format.replace(/%s/g, function() {
return args[argIndex++];
});
throw new Error(message);
} catch (x) {
}
}
}
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 emptyObject = {};
{
Object.freeze(emptyObject);
}
function Component2(props2, context, updater) {
this.props = props2;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
Component2.prototype.isReactComponent = {};
Component2.prototype.setState = function(partialState, callback) {
if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) {
{
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
}
}
this.updater.enqueueSetState(this, partialState, callback, "setState");
};
Component2.prototype.forceUpdate = function(callback) {
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
};
{
var deprecatedAPIs = {
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
};
var defineDeprecationWarning = function(methodName, info) {
Object.defineProperty(Component2.prototype, methodName, {
get: function() {
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
return void 0;
}
});
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
function ComponentDummy() {
}
ComponentDummy.prototype = Component2.prototype;
function PureComponent(props2, context, updater) {
this.props = props2;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
_assign(pureComponentPrototype, Component2.prototype);
pureComponentPrototype.isPureReactComponent = true;
function createRef() {
var refObject = {
current: null
};
{
Object.seal(refObject);
}
return refObject;
}
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
{
didWarnAboutStringRefs = {};
}
function hasValidRef(config10) {
{
if (hasOwnProperty2.call(config10, "ref")) {
var getter = Object.getOwnPropertyDescriptor(config10, "ref").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config10.ref !== void 0;
}
function hasValidKey(config10) {
{
if (hasOwnProperty2.call(config10, "key")) {
var getter = Object.getOwnPropertyDescriptor(config10, "key").get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config10.key !== void 0;
}
function defineKeyPropWarningGetter(props2, 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://fb.me/react-special-props)", displayName);
}
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props2, "key", {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props2, 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://fb.me/react-special-props)", displayName);
}
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props2, "ref", {
get: warnAboutAccessingRef,
configurable: true
});
}
function warnIfStringRefCannotBeAutoConverted(config10) {
{
if (typeof config10.ref === "string" && ReactCurrentOwner.current && config10.__self && ReactCurrentOwner.current.stateNode !== config10.__self) {
var componentName = getComponentName(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://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config10.ref);
didWarnAboutStringRefs[componentName] = true;
}
}
}
}
var ReactElement = function(type, key, ref, self2, source, owner, props2) {
var element = {
$$typeof: REACT_ELEMENT_TYPE,
type,
key,
ref,
props: props2,
_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 createElement6(type, config10, children) {
var propName;
var props2 = {};
var key = null;
var ref = null;
var self2 = null;
var source = null;
if (config10 != null) {
if (hasValidRef(config10)) {
ref = config10.ref;
{
warnIfStringRefCannotBeAutoConverted(config10);
}
}
if (hasValidKey(config10)) {
key = "" + config10.key;
}
self2 = config10.__self === void 0 ? null : config10.__self;
source = config10.__source === void 0 ? null : config10.__source;
for (propName in config10) {
if (hasOwnProperty2.call(config10, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props2[propName] = config10[propName];
}
}
}
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props2.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
{
if (Object.freeze) {
Object.freeze(childArray);
}
}
props2.children = childArray;
}
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props2[propName] === void 0) {
props2[propName] = defaultProps[propName];
}
}
}
{
if (key || ref) {
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
if (key) {
defineKeyPropWarningGetter(props2, displayName);
}
if (ref) {
defineRefPropWarningGetter(props2, displayName);
}
}
}
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props2);
}
function cloneAndReplaceKey(oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
}
function cloneElement3(element, config10, children) {
if (!!(element === null || element === void 0)) {
{
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
}
}
var propName;
var props2 = _assign({}, element.props);
var key = element.key;
var ref = element.ref;
var self2 = element._self;
var source = element._source;
var owner = element._owner;
if (config10 != null) {
if (hasValidRef(config10)) {
ref = config10.ref;
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config10)) {
key = "" + config10.key;
}
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config10) {
if (hasOwnProperty2.call(config10, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
if (config10[propName] === void 0 && defaultProps !== void 0) {
props2[propName] = defaultProps[propName];
} else {
props2[propName] = config10[propName];
}
}
}
}
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props2.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props2.children = childArray;
}
return ReactElement(element.type, key, ref, self2, source, owner, props2);
}
function isValidElement4(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, "$&/");
}
var POOL_SIZE = 10;
var traverseContextPool = [];
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
if (traverseContextPool.length) {
var traverseContext = traverseContextPool.pop();
traverseContext.result = mapResult;
traverseContext.keyPrefix = keyPrefix;
traverseContext.func = mapFunction;
traverseContext.context = mapContext;
traverseContext.count = 0;
return traverseContext;
} else {
return {
result: mapResult,
keyPrefix,
func: mapFunction,
context: mapContext,
count: 0
};
}
}
function releaseTraverseContext(traverseContext) {
traverseContext.result = null;
traverseContext.keyPrefix = null;
traverseContext.func = null;
traverseContext.context = null;
traverseContext.count = 0;
if (traverseContextPool.length < POOL_SIZE) {
traverseContextPool.push(traverseContext);
}
}
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
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) {
callback(traverseContext, children, nameSoFar === "" ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0;
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (typeof iteratorFn === "function") {
{
if (iteratorFn === children.entries) {
if (!didWarnAboutMaps) {
warn("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead.");
}
didWarnAboutMaps = true;
}
}
var iterator = iteratorFn.call(children);
var step;
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else if (type === "object") {
var addendum = "";
{
addendum = " If you meant to render a collection of children, use an array instead." + ReactDebugCurrentFrame.getStackAddendum();
}
var childrenString = "" + children;
{
{
throw Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + ")." + addendum);
}
}
}
}
return subtreeCount;
}
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, "", callback, traverseContext);
}
function getComponentKey(component, index2) {
if (typeof component === "object" && component !== null && component.key != null) {
return escape(component.key);
}
return index2.toString(36);
}
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func, context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
releaseTraverseContext(traverseContext);
}
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result, keyPrefix = bookKeeping.keyPrefix, func = bookKeeping.func, context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function(c) {
return c;
});
} else if (mappedChild != null) {
if (isValidElement4(mappedChild)) {
mappedChild = cloneAndReplaceKey(mappedChild, keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + "/" : "") + childKey);
}
result.push(mappedChild);
}
}
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = "";
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + "/";
}
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
releaseTraverseContext(traverseContext);
}
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
}
function countChildren(children) {
return traverseAllChildren(children, function() {
return null;
}, null);
}
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, function(child) {
return child;
});
return result;
}
function onlyChild(children) {
if (!isValidElement4(children)) {
{
throw Error("React.Children.only expected to receive a single React element child.");
}
}
return children;
}
function createContext6(defaultValue, calculateChangedBits) {
if (calculateChangedBits === void 0) {
calculateChangedBits = null;
} else {
{
if (calculateChangedBits !== null && typeof calculateChangedBits !== "function") {
error("createContext: Expected the optional second argument to be a function. Instead received: %s", calculateChangedBits);
}
}
}
var context = {
$$typeof: REACT_CONTEXT_TYPE,
_calculateChangedBits: calculateChangedBits,
_currentValue: defaultValue,
_currentValue2: defaultValue,
_threadCount: 0,
Provider: null,
Consumer: null
};
context.Provider = {
$$typeof: REACT_PROVIDER_TYPE,
_context: context
};
var hasWarnedAboutUsingNestedContextConsumers = false;
var hasWarnedAboutUsingConsumerProvider = false;
{
var Consumer = {
$$typeof: REACT_CONTEXT_TYPE,
_context: context,
_calculateChangedBits: context._calculateChangedBits
};
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;
}
}
});
context.Consumer = Consumer;
}
{
context._currentRenderer = null;
context._currentRenderer2 = null;
}
return context;
}
function lazy(ctor) {
var lazyType = {
$$typeof: REACT_LAZY_TYPE,
_ctor: ctor,
_status: -1,
_result: null
};
{
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 forwardRef8(render3) {
{
if (render3 != null && render3.$$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 render3 !== "function") {
error("forwardRef requires a render function but was given %s.", render3 === null ? "null" : typeof render3);
} else {
if (render3.length !== 0 && render3.length !== 2) {
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render3.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
}
}
if (render3 != null) {
if (render3.defaultProps != null || render3.propTypes != null) {
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
}
}
}
return {
$$typeof: REACT_FORWARD_REF_TYPE,
render: render3
};
}
function isValidElementType(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 memo(type, compare) {
{
if (!isValidElementType(type)) {
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
}
}
return {
$$typeof: REACT_MEMO_TYPE,
type,
compare: compare === void 0 ? null : compare
};
}
function resolveDispatcher() {
var dispatcher = ReactCurrentDispatcher.current;
if (!(dispatcher !== null)) {
{
throw 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://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
}
}
return dispatcher;
}
function useContext6(Context, unstable_observedBits) {
var dispatcher = resolveDispatcher();
{
if (unstable_observedBits !== void 0) {
error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks" : "");
}
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, unstable_observedBits);
}
function useState12(initialState2) {
var dispatcher = resolveDispatcher();
return dispatcher.useState(initialState2);
}
function useReducer4(reducer2, initialArg, init) {
var dispatcher = resolveDispatcher();
return dispatcher.useReducer(reducer2, initialArg, init);
}
function useRef5(initialValue) {
var dispatcher = resolveDispatcher();
return dispatcher.useRef(initialValue);
}
function useEffect8(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useEffect(create, deps);
}
function useLayoutEffect3(create, deps) {
var dispatcher = resolveDispatcher();
return dispatcher.useLayoutEffect(create, deps);
}
function useCallback3(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 useDebugValue(value, formatterFn) {
{
var dispatcher = resolveDispatcher();
return dispatcher.useDebugValue(value, formatterFn);
}
}
var propTypesMisspellWarningShown;
{
propTypesMisspellWarningShown = false;
}
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = getComponentName(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 " + getComponentName(element._owner.type) + ".";
}
setCurrentlyValidatingElement(element);
{
error('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
}
setCurrentlyValidatingElement(null);
}
function validateChildKeys(node, parentType) {
if (typeof node !== "object") {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (isValidElement4(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (isValidElement4(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 (isValidElement4(step.value)) {
validateExplicitKey(step.value, parentType);
}
}
}
}
}
}
function validatePropTypes(element) {
{
var type = element.type;
if (type === null || type === void 0 || typeof type === "string") {
return;
}
var name = getComponentName(type);
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) {
setCurrentlyValidatingElement(element);
checkPropTypes(propTypes, element.props, "prop", name, ReactDebugCurrentFrame.getStackAddendum);
setCurrentlyValidatingElement(null);
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
propTypesMisspellWarningShown = true;
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) {
{
setCurrentlyValidatingElement(fragment);
var keys = Object.keys(fragment.props);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key !== "children" && key !== "key") {
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
break;
}
}
if (fragment.ref !== null) {
error("Invalid attribute `ref` supplied to `React.Fragment`.");
}
setCurrentlyValidatingElement(null);
}
}
function createElementWithValidation(type, props2, children) {
var validType = isValidElementType(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(props2);
if (sourceInfo) {
info += sourceInfo;
} else {
info += getDeclarationErrorAddendum();
}
var typeString;
if (type === null) {
typeString = "null";
} else if (Array.isArray(type)) {
typeString = "array";
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
typeString = "<" + (getComponentName(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 = createElement6.apply(this, arguments);
if (element == null) {
return element;
}
if (validType) {
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], 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, props2, children) {
var newElement = cloneElement3.apply(this, arguments);
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], newElement.type);
}
validatePropTypes(newElement);
return newElement;
}
{
try {
var frozenObject = Object.freeze({});
var testMap = new Map([[frozenObject, null]]);
var testSet = new Set([frozenObject]);
testMap.set(0, 0);
testSet.add(0);
} catch (e3) {
}
}
var createElement$1 = createElementWithValidation;
var cloneElement$1 = cloneElementWithValidation;
var createFactory = createFactoryWithValidation;
var Children3 = {
map: mapChildren,
forEach: forEachChildren,
count: countChildren,
toArray,
only: onlyChild
};
exports.Children = Children3;
exports.Component = Component2;
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 = createContext6;
exports.createElement = createElement$1;
exports.createFactory = createFactory;
exports.createRef = createRef;
exports.forwardRef = forwardRef8;
exports.isValidElement = isValidElement4;
exports.lazy = lazy;
exports.memo = memo;
exports.useCallback = useCallback3;
exports.useContext = useContext6;
exports.useDebugValue = useDebugValue;
exports.useEffect = useEffect8;
exports.useImperativeHandle = useImperativeHandle;
exports.useLayoutEffect = useLayoutEffect3;
exports.useMemo = useMemo3;
exports.useReducer = useReducer4;
exports.useRef = useRef5;
exports.useState = useState12;
exports.version = ReactVersion;
})();
}
});
// node_modules/react/index.js
var require_react = __commonJS((exports, module) => {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_react_development();
}
});
// node_modules/scheduler/cjs/scheduler.development.js
var require_scheduler_development = __commonJS((exports) => {
/** @license React v0.19.1
* 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.
*/
"use strict";
if (true) {
(function() {
"use strict";
var enableSchedulerDebugging = false;
var enableProfiling = true;
var requestHostCallback;
var requestHostTimeout;
var cancelHostTimeout;
var shouldYieldToHost;
var requestPaint;
if (typeof window === "undefined" || typeof MessageChannel !== "function") {
var _callback = null;
var _timeoutID = null;
var _flushCallback = function() {
if (_callback !== null) {
try {
var currentTime = exports.unstable_now();
var hasRemainingTime = true;
_callback(hasRemainingTime, currentTime);
_callback = null;
} catch (e3) {
setTimeout(_flushCallback, 0);
throw e3;
}
}
};
var initialTime = Date.now();
exports.unstable_now = function() {
return Date.now() - initialTime;
};
requestHostCallback = function(cb) {
if (_callback !== null) {
setTimeout(requestHostCallback, 0, cb);
} else {
_callback = cb;
setTimeout(_flushCallback, 0);
}
};
requestHostTimeout = function(cb, ms) {
_timeoutID = setTimeout(cb, ms);
};
cancelHostTimeout = function() {
clearTimeout(_timeoutID);
};
shouldYieldToHost = function() {
return false;
};
requestPaint = exports.unstable_forceFrameRate = function() {
};
} else {
var performance2 = window.performance;
var _Date = window.Date;
var _setTimeout = window.setTimeout;
var _clearTimeout = window.clearTimeout;
if (typeof console !== "undefined") {
var requestAnimationFrame = window.requestAnimationFrame;
var cancelAnimationFrame = window.cancelAnimationFrame;
if (typeof requestAnimationFrame !== "function") {
console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
}
if (typeof cancelAnimationFrame !== "function") {
console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");
}
}
if (typeof performance2 === "object" && typeof performance2.now === "function") {
exports.unstable_now = function() {
return performance2.now();
};
} else {
var _initialTime = _Date.now();
exports.unstable_now = function() {
return _Date.now() - _initialTime;
};
}
var isMessageLoopRunning = false;
var scheduledHostCallback = null;
var taskTimeoutID = -1;
var yieldInterval = 5;
var deadline = 0;
{
shouldYieldToHost = function() {
return exports.unstable_now() >= deadline;
};
requestPaint = function() {
};
}
exports.unstable_forceFrameRate = function(fps) {
if (fps < 0 || fps > 125) {
console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported");
return;
}
if (fps > 0) {
yieldInterval = Math.floor(1e3 / fps);
} else {
yieldInterval = 5;
}
};
var performWorkUntilDeadline = function() {
if (scheduledHostCallback !== null) {
var currentTime = exports.unstable_now();
deadline = currentTime + yieldInterval;
var hasTimeRemaining = true;
try {
var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
if (!hasMoreWork) {
isMessageLoopRunning = false;
scheduledHostCallback = null;
} else {
port.postMessage(null);
}
} catch (error) {
port.postMessage(null);
throw error;
}
} else {
isMessageLoopRunning = false;
}
};
var channel = new MessageChannel();
var port = channel.port2;
channel.port1.onmessage = performWorkUntilDeadline;
requestHostCallback = function(callback) {
scheduledHostCallback = callback;
if (!isMessageLoopRunning) {
isMessageLoopRunning = true;
port.postMessage(null);
}
};
requestHostTimeout = function(callback, ms) {
taskTimeoutID = _setTimeout(function() {
callback(exports.unstable_now());
}, ms);
};
cancelHostTimeout = function() {
_clearTimeout(taskTimeoutID);
taskTimeoutID = -1;
};
}
function push(heap, node) {
var index2 = heap.length;
heap.push(node);
siftUp(heap, node, index2);
}
function peek(heap) {
var first2 = heap[0];
return first2 === void 0 ? null : first2;
}
function pop(heap) {
var first2 = heap[0];
if (first2 !== void 0) {
var last2 = heap.pop();
if (last2 !== first2) {
heap[0] = last2;
siftDown(heap, last2, 0);
}
return first2;
} else {
return null;
}
}
function siftUp(heap, node, i) {
var index2 = i;
while (true) {
var parentIndex = index2 - 1 >>> 1;
var parent2 = heap[parentIndex];
if (parent2 !== void 0 && compare(parent2, node) > 0) {
heap[parentIndex] = node;
heap[index2] = parent2;
index2 = parentIndex;
} else {
return;
}
}
}
function siftDown(heap, node, i) {
var index2 = i;
var length = heap.length;
while (index2 < length) {
var leftIndex = (index2 + 1) * 2 - 1;
var left2 = heap[leftIndex];
var rightIndex = leftIndex + 1;
var right2 = heap[rightIndex];
if (left2 !== void 0 && compare(left2, node) < 0) {
if (right2 !== void 0 && compare(right2, left2) < 0) {
heap[index2] = right2;
heap[rightIndex] = node;
index2 = rightIndex;
} else {
heap[index2] = left2;
heap[leftIndex] = node;
index2 = leftIndex;
}
} else if (right2 !== void 0 && compare(right2, node) < 0) {
heap[index2] = right2;
heap[rightIndex] = node;
index2 = rightIndex;
} else {
return;
}
}
}
function compare(a2, b) {
var diff = a2.sortIndex - b.sortIndex;
return diff !== 0 ? diff : a2.id - b.id;
}
var NoPriority = 0;
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;
var runIdCounter = 0;
var mainThreadIdCounter = 0;
var profilingStateSize = 4;
var sharedProfilingBuffer = typeof SharedArrayBuffer === "function" ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : typeof ArrayBuffer === "function" ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null;
var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : [];
var PRIORITY = 0;
var CURRENT_TASK_ID = 1;
var CURRENT_RUN_ID = 2;
var QUEUE_SIZE = 3;
{
profilingState[PRIORITY] = NoPriority;
profilingState[QUEUE_SIZE] = 0;
profilingState[CURRENT_TASK_ID] = 0;
}
var INITIAL_EVENT_LOG_SIZE = 131072;
var MAX_EVENT_LOG_SIZE = 524288;
var eventLogSize = 0;
var eventLogBuffer = null;
var eventLog = null;
var eventLogIndex = 0;
var TaskStartEvent = 1;
var TaskCompleteEvent = 2;
var TaskErrorEvent = 3;
var TaskCancelEvent = 4;
var TaskRunEvent = 5;
var TaskYieldEvent = 6;
var SchedulerSuspendEvent = 7;
var SchedulerResumeEvent = 8;
function logEvent(entries) {
if (eventLog !== null) {
var offset = eventLogIndex;
eventLogIndex += entries.length;
if (eventLogIndex + 1 > eventLogSize) {
eventLogSize *= 2;
if (eventLogSize > MAX_EVENT_LOG_SIZE) {
console["error"]("Scheduler Profiling: Event log exceeded maximum size. Don't forget to call `stopLoggingProfilingEvents()`.");
stopLoggingProfilingEvents();
return;
}
var newEventLog = new Int32Array(eventLogSize * 4);
newEventLog.set(eventLog);
eventLogBuffer = newEventLog.buffer;
eventLog = newEventLog;
}
eventLog.set(entries, offset);
}
}
function startLoggingProfilingEvents() {
eventLogSize = INITIAL_EVENT_LOG_SIZE;
eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
eventLog = new Int32Array(eventLogBuffer);
eventLogIndex = 0;
}
function stopLoggingProfilingEvents() {
var buffer = eventLogBuffer;
eventLogSize = 0;
eventLogBuffer = null;
eventLog = null;
eventLogIndex = 0;
return buffer;
}
function markTaskStart(task, ms) {
{
profilingState[QUEUE_SIZE]++;
if (eventLog !== null) {
logEvent([TaskStartEvent, ms * 1e3, task.id, task.priorityLevel]);
}
}
}
function markTaskCompleted(task, ms) {
{
profilingState[PRIORITY] = NoPriority;
profilingState[CURRENT_TASK_ID] = 0;
profilingState[QUEUE_SIZE]--;
if (eventLog !== null) {
logEvent([TaskCompleteEvent, ms * 1e3, task.id]);
}
}
}
function markTaskCanceled(task, ms) {
{
profilingState[QUEUE_SIZE]--;
if (eventLog !== null) {
logEvent([TaskCancelEvent, ms * 1e3, task.id]);
}
}
}
function markTaskErrored(task, ms) {
{
profilingState[PRIORITY] = NoPriority;
profilingState[CURRENT_TASK_ID] = 0;
profilingState[QUEUE_SIZE]--;
if (eventLog !== null) {
logEvent([TaskErrorEvent, ms * 1e3, task.id]);
}
}
}
function markTaskRun(task, ms) {
{
runIdCounter++;
profilingState[PRIORITY] = task.priorityLevel;
profilingState[CURRENT_TASK_ID] = task.id;
profilingState[CURRENT_RUN_ID] = runIdCounter;
if (eventLog !== null) {
logEvent([TaskRunEvent, ms * 1e3, task.id, runIdCounter]);
}
}
}
function markTaskYield(task, ms) {
{
profilingState[PRIORITY] = NoPriority;
profilingState[CURRENT_TASK_ID] = 0;
profilingState[CURRENT_RUN_ID] = 0;
if (eventLog !== null) {
logEvent([TaskYieldEvent, ms * 1e3, task.id, runIdCounter]);
}
}
}
function markSchedulerSuspended(ms) {
{
mainThreadIdCounter++;
if (eventLog !== null) {
logEvent([SchedulerSuspendEvent, ms * 1e3, mainThreadIdCounter]);
}
}
}
function markSchedulerUnsuspended(ms) {
{
if (eventLog !== null) {
logEvent([SchedulerResumeEvent, ms * 1e3, mainThreadIdCounter]);
}
}
}
var maxSigned31BitInt = 1073741823;
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
var USER_BLOCKING_PRIORITY = 250;
var NORMAL_PRIORITY_TIMEOUT = 5e3;
var LOW_PRIORITY_TIMEOUT = 1e4;
var IDLE_PRIORITY = maxSigned31BitInt;
var taskQueue = [];
var timerQueue = [];
var taskIdCounter = 1;
var currentTask = null;
var currentPriorityLevel = NormalPriority;
var isPerformingWork = false;
var isHostCallbackScheduled = false;
var isHostTimeoutScheduled = false;
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);
{
markTaskStart(timer, currentTime);
timer.isQueued = true;
}
} 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) {
{
markSchedulerUnsuspended(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;
{
var _currentTime = exports.unstable_now();
markSchedulerSuspended(_currentTime);
}
}
}
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 (callback !== null) {
currentTask.callback = null;
currentPriorityLevel = currentTask.priorityLevel;
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
markTaskRun(currentTask, currentTime);
var continuationCallback = callback(didUserCallbackTimeout);
currentTime = exports.unstable_now();
if (typeof continuationCallback === "function") {
currentTask.callback = continuationCallback;
markTaskYield(currentTask, currentTime);
} else {
{
markTaskCompleted(currentTask, currentTime);
currentTask.isQueued = false;
}
if (currentTask === peek(taskQueue)) {
pop(taskQueue);
}
}
advanceTimers(currentTime);
} else {
pop(taskQueue);
}
currentTask = peek(taskQueue);
}
if (currentTask !== null) {
return true;
} else {
var firstTimer = peek(timerQueue);
if (firstTimer !== null) {
requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
}
return false;
}
}
function unstable_runWithPriority(priorityLevel, eventHandler) {
switch (priorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
case LowPriority:
case IdlePriority:
break;
default:
priorityLevel = NormalPriority;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
}
function unstable_next(eventHandler) {
var priorityLevel;
switch (currentPriorityLevel) {
case ImmediatePriority:
case UserBlockingPriority:
case NormalPriority:
priorityLevel = NormalPriority;
break;
default:
priorityLevel = currentPriorityLevel;
break;
}
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = priorityLevel;
try {
return eventHandler();
} finally {
currentPriorityLevel = previousPriorityLevel;
}
}
function unstable_wrapCallback(callback) {
var parentPriorityLevel = currentPriorityLevel;
return function() {
var previousPriorityLevel = currentPriorityLevel;
currentPriorityLevel = parentPriorityLevel;
try {
return callback.apply(this, arguments);
} finally {
currentPriorityLevel = previousPriorityLevel;
}
};
}
function timeoutForPriorityLevel(priorityLevel) {
switch (priorityLevel) {
case ImmediatePriority:
return IMMEDIATE_PRIORITY_TIMEOUT;
case UserBlockingPriority:
return USER_BLOCKING_PRIORITY;
case IdlePriority:
return IDLE_PRIORITY;
case LowPriority:
return LOW_PRIORITY_TIMEOUT;
case NormalPriority:
default:
return NORMAL_PRIORITY_TIMEOUT;
}
}
function unstable_scheduleCallback(priorityLevel, callback, options) {
var currentTime = exports.unstable_now();
var startTime;
var timeout;
if (typeof options === "object" && options !== null) {
var delay = options.delay;
if (typeof delay === "number" && delay > 0) {
startTime = currentTime + delay;
} else {
startTime = currentTime;
}
timeout = typeof options.timeout === "number" ? options.timeout : timeoutForPriorityLevel(priorityLevel);
} else {
timeout = timeoutForPriorityLevel(priorityLevel);
startTime = currentTime;
}
var expirationTime = startTime + timeout;
var newTask = {
id: taskIdCounter++,
callback,
priorityLevel,
startTime,
expirationTime,
sortIndex: -1
};
{
newTask.isQueued = false;
}
if (startTime > currentTime) {
newTask.sortIndex = startTime;
push(timerQueue, newTask);
if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
if (isHostTimeoutScheduled) {
cancelHostTimeout();
} else {
isHostTimeoutScheduled = true;
}
requestHostTimeout(handleTimeout, startTime - currentTime);
}
} else {
newTask.sortIndex = expirationTime;
push(taskQueue, newTask);
{
markTaskStart(newTask, currentTime);
newTask.isQueued = true;
}
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(task) {
{
if (task.isQueued) {
var currentTime = exports.unstable_now();
markTaskCanceled(task, currentTime);
task.isQueued = false;
}
}
task.callback = null;
}
function unstable_getCurrentPriorityLevel() {
return currentPriorityLevel;
}
function unstable_shouldYield() {
var currentTime = exports.unstable_now();
advanceTimers(currentTime);
var firstTask = peek(taskQueue);
return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
}
var unstable_requestPaint = requestPaint;
var unstable_Profiling = {
startLoggingProfilingEvents,
stopLoggingProfilingEvents,
sharedProfilingBuffer
};
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_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 = unstable_shouldYield;
exports.unstable_wrapCallback = unstable_wrapCallback;
})();
}
});
// node_modules/scheduler/index.js
var require_scheduler = __commonJS((exports, module) => {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_scheduler_development();
}
});
// node_modules/scheduler/cjs/scheduler-tracing.development.js
var require_scheduler_tracing_development = __commonJS((exports) => {
/** @license React v0.19.1
* scheduler-tracing.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.
*/
"use strict";
if (true) {
(function() {
"use strict";
var DEFAULT_THREAD_ID = 0;
var interactionIDCounter = 0;
var threadIDCounter = 0;
exports.__interactionsRef = null;
exports.__subscriberRef = null;
{
exports.__interactionsRef = {
current: new Set()
};
exports.__subscriberRef = {
current: null
};
}
function unstable_clear(callback) {
var prevInteractions = exports.__interactionsRef.current;
exports.__interactionsRef.current = new Set();
try {
return callback();
} finally {
exports.__interactionsRef.current = prevInteractions;
}
}
function unstable_getCurrent() {
{
return exports.__interactionsRef.current;
}
}
function unstable_getThreadID() {
return ++threadIDCounter;
}
function unstable_trace(name, timestamp, callback) {
var threadID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : DEFAULT_THREAD_ID;
var interaction = {
__count: 1,
id: interactionIDCounter++,
name,
timestamp
};
var prevInteractions = exports.__interactionsRef.current;
var interactions = new Set(prevInteractions);
interactions.add(interaction);
exports.__interactionsRef.current = interactions;
var subscriber = exports.__subscriberRef.current;
var returnValue;
try {
if (subscriber !== null) {
subscriber.onInteractionTraced(interaction);
}
} finally {
try {
if (subscriber !== null) {
subscriber.onWorkStarted(interactions, threadID);
}
} finally {
try {
returnValue = callback();
} finally {
exports.__interactionsRef.current = prevInteractions;
try {
if (subscriber !== null) {
subscriber.onWorkStopped(interactions, threadID);
}
} finally {
interaction.__count--;
if (subscriber !== null && interaction.__count === 0) {
subscriber.onInteractionScheduledWorkCompleted(interaction);
}
}
}
}
}
return returnValue;
}
function unstable_wrap(callback) {
var threadID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_THREAD_ID;
var wrappedInteractions = exports.__interactionsRef.current;
var subscriber = exports.__subscriberRef.current;
if (subscriber !== null) {
subscriber.onWorkScheduled(wrappedInteractions, threadID);
}
wrappedInteractions.forEach(function(interaction) {
interaction.__count++;
});
var hasRun = false;
function wrapped() {
var prevInteractions = exports.__interactionsRef.current;
exports.__interactionsRef.current = wrappedInteractions;
subscriber = exports.__subscriberRef.current;
try {
var returnValue;
try {
if (subscriber !== null) {
subscriber.onWorkStarted(wrappedInteractions, threadID);
}
} finally {
try {
returnValue = callback.apply(void 0, arguments);
} finally {
exports.__interactionsRef.current = prevInteractions;
if (subscriber !== null) {
subscriber.onWorkStopped(wrappedInteractions, threadID);
}
}
}
return returnValue;
} finally {
if (!hasRun) {
hasRun = true;
wrappedInteractions.forEach(function(interaction) {
interaction.__count--;
if (subscriber !== null && interaction.__count === 0) {
subscriber.onInteractionScheduledWorkCompleted(interaction);
}
});
}
}
}
wrapped.cancel = function cancel() {
subscriber = exports.__subscriberRef.current;
try {
if (subscriber !== null) {
subscriber.onWorkCanceled(wrappedInteractions, threadID);
}
} finally {
wrappedInteractions.forEach(function(interaction) {
interaction.__count--;
if (subscriber && interaction.__count === 0) {
subscriber.onInteractionScheduledWorkCompleted(interaction);
}
});
}
};
return wrapped;
}
var subscribers = null;
{
subscribers = new Set();
}
function unstable_subscribe(subscriber) {
{
subscribers.add(subscriber);
if (subscribers.size === 1) {
exports.__subscriberRef.current = {
onInteractionScheduledWorkCompleted,
onInteractionTraced,
onWorkCanceled,
onWorkScheduled,
onWorkStarted,
onWorkStopped
};
}
}
}
function unstable_unsubscribe(subscriber) {
{
subscribers.delete(subscriber);
if (subscribers.size === 0) {
exports.__subscriberRef.current = null;
}
}
}
function onInteractionTraced(interaction) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onInteractionTraced(interaction);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
function onInteractionScheduledWorkCompleted(interaction) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onInteractionScheduledWorkCompleted(interaction);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
function onWorkScheduled(interactions, threadID) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onWorkScheduled(interactions, threadID);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
function onWorkStarted(interactions, threadID) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onWorkStarted(interactions, threadID);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
function onWorkStopped(interactions, threadID) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onWorkStopped(interactions, threadID);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
function onWorkCanceled(interactions, threadID) {
var didCatchError = false;
var caughtError = null;
subscribers.forEach(function(subscriber) {
try {
subscriber.onWorkCanceled(interactions, threadID);
} catch (error) {
if (!didCatchError) {
didCatchError = true;
caughtError = error;
}
}
});
if (didCatchError) {
throw caughtError;
}
}
exports.unstable_clear = unstable_clear;
exports.unstable_getCurrent = unstable_getCurrent;
exports.unstable_getThreadID = unstable_getThreadID;
exports.unstable_subscribe = unstable_subscribe;
exports.unstable_trace = unstable_trace;
exports.unstable_unsubscribe = unstable_unsubscribe;
exports.unstable_wrap = unstable_wrap;
})();
}
});
// node_modules/scheduler/tracing.js
var require_tracing = __commonJS((exports, module) => {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_scheduler_tracing_development();
}
});
// node_modules/react-dom/cjs/react-dom.development.js
var require_react_dom_development = __commonJS((exports) => {
/** @license React v16.14.0
* 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.
*/
"use strict";
if (true) {
(function() {
"use strict";
var React13 = require_react();
var _assign = require_object_assign();
var Scheduler = require_scheduler();
var checkPropTypes = require_checkPropTypes();
var tracing = require_tracing();
var ReactSharedInternals = React13.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
if (!ReactSharedInternals.hasOwnProperty("ReactCurrentDispatcher")) {
ReactSharedInternals.ReactCurrentDispatcher = {
current: null
};
}
if (!ReactSharedInternals.hasOwnProperty("ReactCurrentBatchConfig")) {
ReactSharedInternals.ReactCurrentBatchConfig = {
suspense: null
};
}
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 hasExistingStack = args.length > 0 && typeof args[args.length - 1] === "string" && args[args.length - 1].indexOf("\n in") === 0;
if (!hasExistingStack) {
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame2.getStackAddendum();
if (stack !== "") {
format += "%s";
args = args.concat([stack]);
}
}
var argsWithFormat = args.map(function(item) {
return "" + item;
});
argsWithFormat.unshift("Warning: " + format);
Function.prototype.apply.call(console[level], console, argsWithFormat);
try {
var argIndex = 0;
var message = "Warning: " + format.replace(/%s/g, function() {
return args[argIndex++];
});
throw new Error(message);
} catch (x) {
}
}
}
if (!React13) {
{
throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
}
}
var invokeGuardedCallbackImpl = function(name, func, context, a2, b, c, d, e3, f) {
var funcArgs = Array.prototype.slice.call(arguments, 3);
try {
func.apply(context, funcArgs);
} catch (error2) {
this.onError(error2);
}
};
{
if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
var fakeNode = document.createElement("react");
var invokeGuardedCallbackDev = function(name, func, context, a2, b, c, d, e3, f) {
if (!(typeof document !== "undefined")) {
{
throw 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 didError = true;
var windowEvent = window.event;
var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
var funcArgs = Array.prototype.slice.call(arguments, 3);
function callCallback2() {
fakeNode.removeEventListener(evtType, callCallback2, false);
if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
window.event = windowEvent;
}
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 (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://fb.me/react-crossorigin-error for more information.");
}
this.onError(error2);
}
window.removeEventListener("error", handleWindowError);
};
invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
}
}
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, b, c, d, e3, f) {
hasError = false;
caughtError = null;
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a2, b, c, d, e3, f) {
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 Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
}
}
}
}
var getFiberCurrentPropsFromNode = null;
var getInstanceFromNode = null;
var getNodeFromInstance = null;
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
getInstanceFromNode = getInstanceFromNodeImpl;
getNodeFromInstance = getNodeFromInstanceImpl;
{
if (!getNodeFromInstance || !getInstanceFromNode) {
error("EventPluginUtils.setComponentTree(...): Injected module is missing getNodeFromInstance or getInstanceFromNode.");
}
}
}
var validateEventDispatches;
{
validateEventDispatches = function(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
var listenersIsArr = Array.isArray(dispatchListeners);
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
var instancesIsArr = Array.isArray(dispatchInstances);
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
error("EventPluginUtils: Invalid `event`.");
}
};
}
function executeDispatch(event, listener, inst) {
var type = event.type || "unknown-event";
event.currentTarget = getNodeFromInstance(inst);
invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
event.currentTarget = null;
}
function executeDispatchesInOrder(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
{
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, dispatchListeners, dispatchInstances);
}
event._dispatchListeners = null;
event._dispatchInstances = null;
}
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 FundamentalComponent = 20;
var ScopeComponent = 21;
var Block = 22;
var eventPluginOrder = null;
var namesToPlugins = {};
function recomputePluginOrdering() {
if (!eventPluginOrder) {
return;
}
for (var pluginName in namesToPlugins) {
var pluginModule = namesToPlugins[pluginName];
var pluginIndex = eventPluginOrder.indexOf(pluginName);
if (!(pluginIndex > -1)) {
{
throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.");
}
}
if (plugins[pluginIndex]) {
continue;
}
if (!pluginModule.extractEvents) {
{
throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.");
}
}
plugins[pluginIndex] = pluginModule;
var publishedEvents = pluginModule.eventTypes;
for (var eventName in publishedEvents) {
if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
{
throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.");
}
}
}
}
}
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
{
throw Error("EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`.");
}
}
eventNameDispatchConfigs[eventName] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
return true;
}
return false;
}
function publishRegistrationName(registrationName, pluginModule, eventName) {
if (!!registrationNameModules[registrationName]) {
{
throw Error("EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.");
}
}
registrationNameModules[registrationName] = pluginModule;
registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
{
var lowerCasedName = registrationName.toLowerCase();
possibleRegistrationNames[lowerCasedName] = registrationName;
if (registrationName === "onDoubleClick") {
possibleRegistrationNames.ondblclick = registrationName;
}
}
}
var plugins = [];
var eventNameDispatchConfigs = {};
var registrationNameModules = {};
var registrationNameDependencies = {};
var possibleRegistrationNames = {};
function injectEventPluginOrder(injectedEventPluginOrder) {
if (!!eventPluginOrder) {
{
throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.");
}
}
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
recomputePluginOrdering();
}
function injectEventPluginsByName(injectedNamesToPlugins) {
var isOrderingDirty = false;
for (var pluginName in injectedNamesToPlugins) {
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
continue;
}
var pluginModule = injectedNamesToPlugins[pluginName];
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
if (!!namesToPlugins[pluginName]) {
{
throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.");
}
}
namesToPlugins[pluginName] = pluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
}
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
var PLUGIN_EVENT_SYSTEM = 1;
var IS_REPLAYED = 1 << 5;
var IS_FIRST_ANCESTOR = 1 << 6;
var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;
function restoreStateOfTarget(target) {
var internalInstance = getInstanceFromNode(target);
if (!internalInstance) {
return;
}
if (!(typeof restoreImpl === "function")) {
{
throw 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 i = 0; i < queuedTargets.length; i++) {
restoreStateOfTarget(queuedTargets[i]);
}
}
}
var enableProfilerTimer = true;
var enableDeprecatedFlareAPI = false;
var enableFundamentalAPI = false;
var warnAboutStringRefs = false;
var batchedUpdatesImpl = function(fn, bookkeeping) {
return fn(bookkeeping);
};
var discreteUpdatesImpl = function(fn, a2, b, c, d) {
return fn(a2, b, c, d);
};
var flushDiscreteUpdatesImpl = function() {
};
var batchedEventUpdatesImpl = batchedUpdatesImpl;
var isInsideEventHandler = false;
var isBatchingEventUpdates = false;
function finishEventHandler() {
var controlledComponentsHavePendingUpdates = needsStateRestore();
if (controlledComponentsHavePendingUpdates) {
flushDiscreteUpdatesImpl();
restoreStateIfNeeded();
}
}
function batchedUpdates(fn, bookkeeping) {
if (isInsideEventHandler) {
return fn(bookkeeping);
}
isInsideEventHandler = true;
try {
return batchedUpdatesImpl(fn, bookkeeping);
} finally {
isInsideEventHandler = false;
finishEventHandler();
}
}
function batchedEventUpdates(fn, a2, b) {
if (isBatchingEventUpdates) {
return fn(a2, b);
}
isBatchingEventUpdates = true;
try {
return batchedEventUpdatesImpl(fn, a2, b);
} finally {
isBatchingEventUpdates = false;
finishEventHandler();
}
}
function discreteUpdates(fn, a2, b, c, d) {
var prevIsInsideEventHandler = isInsideEventHandler;
isInsideEventHandler = true;
try {
return discreteUpdatesImpl(fn, a2, b, c, d);
} finally {
isInsideEventHandler = prevIsInsideEventHandler;
if (!isInsideEventHandler) {
finishEventHandler();
}
}
}
function flushDiscreteUpdatesIfNeeded(timeStamp) {
if (!isInsideEventHandler && !enableDeprecatedFlareAPI) {
flushDiscreteUpdatesImpl();
}
}
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
batchedUpdatesImpl = _batchedUpdatesImpl;
discreteUpdatesImpl = _discreteUpdatesImpl;
flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
}
var DiscreteEvent = 0;
var UserBlockingEvent = 1;
var ContinuousEvent = 2;
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 ROOT_ATTRIBUTE_NAME = "data-reactroot";
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (hasOwnProperty2.call(validatedAttributeNameCache, attributeName)) {
return true;
}
if (hasOwnProperty2.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 prefix = name.toLowerCase().slice(0, 5);
return prefix !== "data-" && prefix !== "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) {
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;
}
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);
});
[["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);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null, false);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null, false);
});
[
"allowFullScreen",
"async",
"autoFocus",
"autoPlay",
"controls",
"default",
"defer",
"disabled",
"disablePictureInPicture",
"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);
});
[
"checked",
"multiple",
"muted",
"selected"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name, null, false);
});
[
"capture",
"download"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name, null, false);
});
[
"cols",
"rows",
"size",
"span"
].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name, null, false);
});
["rowSpan", "start"].forEach(function(name) {
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null, 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);
});
[
"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);
});
[
"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);
});
["tabIndex", "crossOrigin"].forEach(function(attributeName) {
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false);
});
var xlinkHref = "xlinkHref";
properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true);
["src", "href", "action", "formAction"].forEach(function(attributeName) {
properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true);
});
var ReactDebugCurrentFrame = null;
{
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
}
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 {
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) {
{
if (!isAttributeNameSafe(name)) {
return;
}
if (!node.hasAttribute(name)) {
return expected === void 0 ? void 0 : null;
}
var value = node.getAttribute(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 {
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 {
{
attributeValue = "" + value;
}
if (propertyInfo.sanitizeURL) {
sanitizeURL(attributeValue.toString());
}
}
if (attributeNamespace) {
node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
} else {
node.setAttribute(attributeName, attributeValue);
}
}
}
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
function describeComponentFrame(name, source, ownerName) {
var sourceInfo = "";
if (source) {
var path = source.fileName;
var fileName = path.replace(BEFORE_SLASH_RE, "");
{
if (/^index\./.test(fileName)) {
var match = path.match(BEFORE_SLASH_RE);
if (match) {
var pathBeforeSlash = match[1];
if (pathBeforeSlash) {
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, "");
fileName = folderName + "/" + fileName;
}
}
}
}
sourceInfo = " (at " + fileName + ":" + source.lineNumber + ")";
} else if (ownerName) {
sourceInfo = " (created by " + ownerName + ")";
}
return "\n in " + (name || "Unknown") + sourceInfo;
}
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_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 MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && 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 Uninitialized = -1;
var Pending = 0;
var Resolved = 1;
var Rejected = 2;
function refineResolvedLazyComponent(lazyComponent) {
return lazyComponent._status === Resolved ? lazyComponent._result : null;
}
function initializeLazyComponentType(lazyComponent) {
if (lazyComponent._status === Uninitialized) {
lazyComponent._status = Pending;
var ctor = lazyComponent._ctor;
var thenable = ctor();
lazyComponent._result = thenable;
thenable.then(function(moduleObject) {
if (lazyComponent._status === Pending) {
var defaultExport = moduleObject.default;
{
if (defaultExport === 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'))", moduleObject);
}
}
lazyComponent._status = Resolved;
lazyComponent._result = defaultExport;
}
}, function(error2) {
if (lazyComponent._status === Pending) {
lazyComponent._status = Rejected;
lazyComponent._result = error2;
}
});
}
}
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || "";
return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
}
function getComponentName(type) {
if (type == null) {
return null;
}
{
if (typeof type.tag === "number") {
error("Received an unexpected object in getComponentName(). 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:
return "Context.Consumer";
case REACT_PROVIDER_TYPE:
return "Context.Provider";
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
return getComponentName(type.type);
case REACT_BLOCK_TYPE:
return getComponentName(type.render);
case REACT_LAZY_TYPE: {
var thenable = type;
var resolvedThenable = refineResolvedLazyComponent(thenable);
if (resolvedThenable) {
return getComponentName(resolvedThenable);
}
break;
}
}
}
return null;
}
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
function describeFiber(fiber) {
switch (fiber.tag) {
case HostRoot:
case HostPortal:
case HostText:
case Fragment2:
case ContextProvider:
case ContextConsumer:
return "";
default:
var owner = fiber._debugOwner;
var source = fiber._debugSource;
var name = getComponentName(fiber.type);
var ownerName = null;
if (owner) {
ownerName = getComponentName(owner.type);
}
return describeComponentFrame(name, source, ownerName);
}
}
function getStackByFiberInDevAndProd(workInProgress2) {
var info = "";
var node = workInProgress2;
do {
info += describeFiber(node);
node = node.return;
} while (node);
return info;
}
var current = null;
var isRendering = false;
function getCurrentFiberOwnerNameInDevOrNull() {
{
if (current === null) {
return null;
}
var owner = current._debugOwner;
if (owner !== null && typeof owner !== "undefined") {
return getComponentName(owner.type);
}
}
return null;
}
function getCurrentFiberStackInDev() {
{
if (current === null) {
return "";
}
return getStackByFiberInDevAndProd(current);
}
}
function resetCurrentFiber() {
{
ReactDebugCurrentFrame$1.getCurrentStack = null;
current = null;
isRendering = false;
}
}
function setCurrentFiber(fiber) {
{
ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;
current = fiber;
isRendering = false;
}
}
function setIsRendering(rendering) {
{
isRendering = rendering;
}
}
function toString(value) {
return "" + value;
}
function getToStringValue(value) {
switch (typeof value) {
case "boolean":
case "number":
case "object":
case "string":
case "undefined":
return value;
default:
return "";
}
}
var ReactDebugCurrentFrame$2 = null;
var ReactControlledValuePropTypes = {
checkPropTypes: null
};
{
ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
var hasReadOnlyValue = {
button: true,
checkbox: true,
image: true,
hidden: true,
radio: true,
reset: true,
submit: true
};
var propTypes = {
value: function(props2, propName, componentName) {
if (hasReadOnlyValue[props2.type] || props2.onChange || props2.readOnly || props2.disabled || props2[propName] == null || enableDeprecatedFlareAPI) {
return null;
}
return new 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`.");
},
checked: function(props2, propName, componentName) {
if (props2.onChange || props2.readOnly || props2.disabled || props2[propName] == null || enableDeprecatedFlareAPI) {
return null;
}
return new 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`.");
}
};
ReactControlledValuePropTypes.checkPropTypes = function(tagName, props2) {
checkPropTypes(propTypes, props2, "prop", tagName, ReactDebugCurrentFrame$2.getStackAddendum);
};
}
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);
var currentValue = "" + node[valueField];
if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
return;
}
var get9 = descriptor.get, set3 = descriptor.set;
Object.defineProperty(node, valueField, {
configurable: true,
get: function() {
return get9.call(this);
},
set: function(value) {
currentValue = "" + value;
set3.call(this, value);
}
});
Object.defineProperty(node, valueField, {
enumerable: descriptor.enumerable
});
var tracker = {
getValue: function() {
return currentValue;
},
setValue: function(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;
}
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;
function isControlled(props2) {
var usesChecked = props2.type === "checkbox" || props2.type === "radio";
return usesChecked ? props2.checked != null : props2.value != null;
}
function getHostProps(element, props2) {
var node = element;
var checked2 = props2.checked;
var hostProps = _assign({}, props2, {
defaultChecked: void 0,
defaultValue: void 0,
value: void 0,
checked: checked2 != null ? checked2 : node._wrapperState.initialChecked
});
return hostProps;
}
function initWrapperState(element, props2) {
{
ReactControlledValuePropTypes.checkPropTypes("input", props2);
if (props2.checked !== void 0 && props2.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://fb.me/react-controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props2.type);
didWarnCheckedDefaultChecked = true;
}
if (props2.value !== void 0 && props2.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://fb.me/react-controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props2.type);
didWarnValueDefaultValue = true;
}
}
var node = element;
var defaultValue = props2.defaultValue == null ? "" : props2.defaultValue;
node._wrapperState = {
initialChecked: props2.checked != null ? props2.checked : props2.defaultChecked,
initialValue: getToStringValue(props2.value != null ? props2.value : defaultValue),
controlled: isControlled(props2)
};
}
function updateChecked(element, props2) {
var node = element;
var checked2 = props2.checked;
if (checked2 != null) {
setValueForProperty(node, "checked", checked2, false);
}
}
function updateWrapper(element, props2) {
var node = element;
{
var controlled = isControlled(props2);
if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
error("A component is changing an uncontrolled input of type %s to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components", props2.type);
didWarnUncontrolledToControlled = true;
}
if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
error("A component is changing a controlled input of type %s to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components", props2.type);
didWarnControlledToUncontrolled = true;
}
}
updateChecked(element, props2);
var value = getToStringValue(props2.value);
var type = props2.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 (props2.hasOwnProperty("value")) {
setDefaultValue(node, props2.type, value);
} else if (props2.hasOwnProperty("defaultValue")) {
setDefaultValue(node, props2.type, getToStringValue(props2.defaultValue));
}
}
{
if (props2.checked == null && props2.defaultChecked != null) {
node.defaultChecked = !!props2.defaultChecked;
}
}
}
function postMountWrapper(element, props2, isHydrating2) {
var node = element;
if (props2.hasOwnProperty("value") || props2.hasOwnProperty("defaultValue")) {
var type = props2.type;
var isButton = type === "submit" || type === "reset";
if (isButton && (props2.value === void 0 || props2.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, props2) {
var node = element;
updateWrapper(node, props2);
updateNamedCousins(node, props2);
}
function updateNamedCousins(rootNode, props2) {
var name = props2.name;
if (props2.type === "radio" && name != null) {
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
for (var i = 0; i < group.length; i++) {
var otherNode = group[i];
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
continue;
}
var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
if (!otherProps) {
{
throw 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" || node.ownerDocument.activeElement !== 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;
function flattenChildren(children) {
var content = "";
React13.Children.forEach(children, function(child) {
if (child == null) {
return;
}
content += child;
});
return content;
}
function validateProps(element, props2) {
{
if (typeof props2.children === "object" && props2.children !== null) {
React13.Children.forEach(props2.children, function(child) {
if (child == null) {
return;
}
if (typeof child === "string" || typeof child === "number") {
return;
}
if (typeof child.type !== "string") {
return;
}
if (!didWarnInvalidChild) {
didWarnInvalidChild = true;
error("Only strings and numbers are supported as <option> children.");
}
});
}
if (props2.selected != null && !didWarnSelectedSetOnOption) {
error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
didWarnSelectedSetOnOption = true;
}
}
}
function postMountWrapper$1(element, props2) {
if (props2.value != null) {
element.setAttribute("value", toString(getToStringValue(props2.value)));
}
}
function getHostProps$1(element, props2) {
var hostProps = _assign({
children: void 0
}, props2);
var content = flattenChildren(props2.children);
if (content) {
hostProps.children = content;
}
return hostProps;
}
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(props2) {
{
ReactControlledValuePropTypes.checkPropTypes("select", props2);
for (var i = 0; i < valuePropNames.length; i++) {
var propName = valuePropNames[i];
if (props2[propName] == null) {
continue;
}
var isArray3 = Array.isArray(props2[propName]);
if (props2.multiple && !isArray3) {
error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
} else if (!props2.multiple && isArray3) {
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 options = node.options;
if (multiple) {
var selectedValues = propValue;
var selectedValue = {};
for (var i = 0; i < selectedValues.length; i++) {
selectedValue["$" + selectedValues[i]] = true;
}
for (var _i = 0; _i < options.length; _i++) {
var selected2 = selectedValue.hasOwnProperty("$" + options[_i].value);
if (options[_i].selected !== selected2) {
options[_i].selected = selected2;
}
if (selected2 && setDefaultSelected) {
options[_i].defaultSelected = true;
}
}
} else {
var _selectedValue = toString(getToStringValue(propValue));
var defaultSelected = null;
for (var _i2 = 0; _i2 < options.length; _i2++) {
if (options[_i2].value === _selectedValue) {
options[_i2].selected = true;
if (setDefaultSelected) {
options[_i2].defaultSelected = true;
}
return;
}
if (defaultSelected === null && !options[_i2].disabled) {
defaultSelected = options[_i2];
}
}
if (defaultSelected !== null) {
defaultSelected.selected = true;
}
}
}
function getHostProps$2(element, props2) {
return _assign({}, props2, {
value: void 0
});
}
function initWrapperState$1(element, props2) {
var node = element;
{
checkSelectPropTypes(props2);
}
node._wrapperState = {
wasMultiple: !!props2.multiple
};
{
if (props2.value !== void 0 && props2.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://fb.me/react-controlled-components");
didWarnValueDefaultValue$1 = true;
}
}
}
function postMountWrapper$2(element, props2) {
var node = element;
node.multiple = !!props2.multiple;
var value = props2.value;
if (value != null) {
updateOptions(node, !!props2.multiple, value, false);
} else if (props2.defaultValue != null) {
updateOptions(node, !!props2.multiple, props2.defaultValue, true);
}
}
function postUpdateWrapper(element, props2) {
var node = element;
var wasMultiple = node._wrapperState.wasMultiple;
node._wrapperState.wasMultiple = !!props2.multiple;
var value = props2.value;
if (value != null) {
updateOptions(node, !!props2.multiple, value, false);
} else if (wasMultiple !== !!props2.multiple) {
if (props2.defaultValue != null) {
updateOptions(node, !!props2.multiple, props2.defaultValue, true);
} else {
updateOptions(node, !!props2.multiple, props2.multiple ? [] : "", false);
}
}
}
function restoreControlledState$1(element, props2) {
var node = element;
var value = props2.value;
if (value != null) {
updateOptions(node, !!props2.multiple, value, false);
}
}
var didWarnValDefaultVal = false;
function getHostProps$3(element, props2) {
var node = element;
if (!(props2.dangerouslySetInnerHTML == null)) {
{
throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
}
}
var hostProps = _assign({}, props2, {
value: void 0,
defaultValue: void 0,
children: toString(node._wrapperState.initialValue)
});
return hostProps;
}
function initWrapperState$2(element, props2) {
var node = element;
{
ReactControlledValuePropTypes.checkPropTypes("textarea", props2);
if (props2.value !== void 0 && props2.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://fb.me/react-controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
didWarnValDefaultVal = true;
}
}
var initialValue = props2.value;
if (initialValue == null) {
var children = props2.children, defaultValue = props2.defaultValue;
if (children != null) {
{
error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
}
{
if (!(defaultValue == null)) {
{
throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
}
}
if (Array.isArray(children)) {
if (!(children.length <= 1)) {
{
throw 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, props2) {
var node = element;
var value = getToStringValue(props2.value);
var defaultValue = getToStringValue(props2.defaultValue);
if (value != null) {
var newValue = toString(value);
if (newValue !== node.value) {
node.value = newValue;
}
if (props2.defaultValue == null && node.defaultValue !== newValue) {
node.defaultValue = newValue;
}
}
if (defaultValue != null) {
node.defaultValue = toString(defaultValue);
}
}
function postMountWrapper$3(element, props2) {
var node = element;
var textContent = node.textContent;
if (textContent === node._wrapperState.initialValue) {
if (textContent !== "" && textContent !== null) {
node.value = textContent;
}
}
}
function restoreControlledState$2(element, props2) {
updateWrapper$1(element, props2);
}
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";
var Namespaces = {
html: HTML_NAMESPACE,
mathml: MATH_NAMESPACE,
svg: SVG_NAMESPACE
};
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 === Namespaces.svg) {
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;
};
function unsafeCastStringToDOMTopLevelType(topLevelType) {
return topLevelType;
}
function unsafeCastDOMTopLevelTypeToString(topLevelType) {
return topLevelType;
}
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 (canUseDOM) {
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 TOP_ABORT = unsafeCastStringToDOMTopLevelType("abort");
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName("animationend"));
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName("animationiteration"));
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName("animationstart"));
var TOP_BLUR = unsafeCastStringToDOMTopLevelType("blur");
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType("canplay");
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType("canplaythrough");
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType("cancel");
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType("change");
var TOP_CLICK = unsafeCastStringToDOMTopLevelType("click");
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType("close");
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType("compositionend");
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType("compositionstart");
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType("compositionupdate");
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType("contextmenu");
var TOP_COPY = unsafeCastStringToDOMTopLevelType("copy");
var TOP_CUT = unsafeCastStringToDOMTopLevelType("cut");
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType("dblclick");
var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType("auxclick");
var TOP_DRAG = unsafeCastStringToDOMTopLevelType("drag");
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType("dragend");
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType("dragenter");
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType("dragexit");
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType("dragleave");
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType("dragover");
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType("dragstart");
var TOP_DROP = unsafeCastStringToDOMTopLevelType("drop");
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType("durationchange");
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType("emptied");
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType("encrypted");
var TOP_ENDED = unsafeCastStringToDOMTopLevelType("ended");
var TOP_ERROR = unsafeCastStringToDOMTopLevelType("error");
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType("focus");
var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType("gotpointercapture");
var TOP_INPUT = unsafeCastStringToDOMTopLevelType("input");
var TOP_INVALID = unsafeCastStringToDOMTopLevelType("invalid");
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType("keydown");
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType("keypress");
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType("keyup");
var TOP_LOAD = unsafeCastStringToDOMTopLevelType("load");
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType("loadstart");
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType("loadeddata");
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType("loadedmetadata");
var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType("lostpointercapture");
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType("mousedown");
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType("mousemove");
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType("mouseout");
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType("mouseover");
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType("mouseup");
var TOP_PASTE = unsafeCastStringToDOMTopLevelType("paste");
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType("pause");
var TOP_PLAY = unsafeCastStringToDOMTopLevelType("play");
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType("playing");
var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType("pointercancel");
var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType("pointerdown");
var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType("pointermove");
var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType("pointerout");
var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType("pointerover");
var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType("pointerup");
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType("progress");
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType("ratechange");
var TOP_RESET = unsafeCastStringToDOMTopLevelType("reset");
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType("scroll");
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType("seeked");
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType("seeking");
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType("selectionchange");
var TOP_STALLED = unsafeCastStringToDOMTopLevelType("stalled");
var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType("submit");
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType("suspend");
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType("textInput");
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType("timeupdate");
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType("toggle");
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType("touchcancel");
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType("touchend");
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType("touchmove");
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType("touchstart");
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName("transitionend"));
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType("volumechange");
var TOP_WAITING = unsafeCastStringToDOMTopLevelType("waiting");
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType("wheel");
var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
function getRawEventName(topLevelType) {
return unsafeCastDOMTopLevelTypeToString(topLevelType);
}
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var elementListenerMap = new PossiblyWeakMap();
function getListenerMapForElement(element) {
var listenerMap = elementListenerMap.get(element);
if (listenerMap === void 0) {
listenerMap = new Map();
elementListenerMap.set(element, listenerMap);
}
return listenerMap;
}
function get8(key) {
return key._reactInternalFiber;
}
function has(key) {
return key._reactInternalFiber !== void 0;
}
function set2(key, value) {
key._reactInternalFiber = value;
}
var NoEffect = 0;
var PerformedWork = 1;
var Placement = 2;
var Update = 4;
var PlacementAndUpdate = 6;
var Deletion = 8;
var ContentReset = 16;
var Callback = 32;
var DidCapture = 64;
var Ref = 128;
var Snapshot = 256;
var Passive = 512;
var Hydrating = 1024;
var HydratingAndUpdate = 1028;
var LifecycleEffectMask = 932;
var HostEffectMask = 2047;
var Incomplete = 2048;
var ShouldCapture = 4096;
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function getNearestMountedFiber(fiber) {
var node = fiber;
var nearestMounted = fiber;
if (!fiber.alternate) {
var nextNode = node;
do {
node = nextNode;
if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
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.", getComponentName(ownerFiber.type) || "A component");
}
instance._warnedAboutRefsInRender = true;
}
}
var fiber = get8(component);
if (!fiber) {
return false;
}
return getNearestMountedFiber(fiber) === fiber;
}
function assertIsMounted(fiber) {
if (!(getNearestMountedFiber(fiber) === fiber)) {
{
throw 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 Error("Unable to find node on an unmounted component.");
}
}
if (nearestMounted !== fiber) {
return null;
}
return fiber;
}
var a2 = fiber;
var b = 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 = b = nextParent;
continue;
}
break;
}
if (parentA.child === parentB.child) {
var child = parentA.child;
while (child) {
if (child === a2) {
assertIsMounted(parentA);
return fiber;
}
if (child === b) {
assertIsMounted(parentA);
return alternate;
}
child = child.sibling;
}
{
{
throw Error("Unable to find node on an unmounted component.");
}
}
}
if (a2.return !== b.return) {
a2 = parentA;
b = parentB;
} else {
var didFindChild = false;
var _child = parentA.child;
while (_child) {
if (_child === a2) {
didFindChild = true;
a2 = parentA;
b = parentB;
break;
}
if (_child === b) {
didFindChild = true;
b = parentA;
a2 = parentB;
break;
}
_child = _child.sibling;
}
if (!didFindChild) {
_child = parentB.child;
while (_child) {
if (_child === a2) {
didFindChild = true;
a2 = parentB;
b = parentA;
break;
}
if (_child === b) {
didFindChild = true;
b = parentB;
a2 = parentA;
break;
}
_child = _child.sibling;
}
if (!didFindChild) {
{
throw 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 === b)) {
{
throw 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 Error("Unable to find node on an unmounted component.");
}
}
if (a2.stateNode.current === a2) {
return fiber;
}
return alternate;
}
function findCurrentHostFiber(parent2) {
var currentParent = findCurrentFiberUsingSlowPath(parent2);
if (!currentParent) {
return null;
}
var node = currentParent;
while (true) {
if (node.tag === HostComponent || node.tag === HostText) {
return node;
} else if (node.child) {
node.child.return = node;
node = node.child;
continue;
}
if (node === currentParent) {
return null;
}
while (!node.sibling) {
if (!node.return || node.return === currentParent) {
return null;
}
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
return null;
}
function findCurrentHostFiberWithNoPortals(parent2) {
var currentParent = findCurrentFiberUsingSlowPath(parent2);
if (!currentParent) {
return null;
}
var node = currentParent;
while (true) {
if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI) {
return node;
} else if (node.child && node.tag !== HostPortal) {
node.child.return = node;
node = node.child;
continue;
}
if (node === currentParent) {
return null;
}
while (!node.sibling) {
if (!node.return || node.return === currentParent) {
return null;
}
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
return null;
}
function accumulateInto(current2, next) {
if (!(next != null)) {
{
throw Error("accumulateInto(...): Accumulated items must not be null or undefined.");
}
}
if (current2 == null) {
return next;
}
if (Array.isArray(current2)) {
if (Array.isArray(next)) {
current2.push.apply(current2, next);
return current2;
}
current2.push(next);
return current2;
}
if (Array.isArray(next)) {
return [current2].concat(next);
}
return [current2, next];
}
function forEachAccumulated(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
}
var eventQueue = null;
var executeDispatchesAndRelease = function(event) {
if (event) {
executeDispatchesInOrder(event);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
var executeDispatchesAndReleaseTopLevel = function(e3) {
return executeDispatchesAndRelease(e3);
};
function runEventsInBatch(events) {
if (events !== null) {
eventQueue = accumulateInto(eventQueue, events);
}
var processingEventQueue = eventQueue;
eventQueue = null;
if (!processingEventQueue) {
return;
}
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
if (!!eventQueue) {
{
throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.");
}
}
rethrowCaughtError();
}
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;
if (target.correspondingUseElement) {
target = target.correspondingUseElement;
}
return target.nodeType === TEXT_NODE ? target.parentNode : target;
}
/**
* 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
*/
function isEventSupported(eventNameSuffix) {
if (!canUseDOM) {
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;
}
var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
var callbackBookkeepingPool = [];
function releaseTopLevelCallbackBookKeeping(instance) {
instance.topLevelType = null;
instance.nativeEvent = null;
instance.targetInst = null;
instance.ancestors.length = 0;
if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
callbackBookkeepingPool.push(instance);
}
}
function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
if (callbackBookkeepingPool.length) {
var instance = callbackBookkeepingPool.pop();
instance.topLevelType = topLevelType;
instance.eventSystemFlags = eventSystemFlags;
instance.nativeEvent = nativeEvent;
instance.targetInst = targetInst;
return instance;
}
return {
topLevelType,
eventSystemFlags,
nativeEvent,
targetInst,
ancestors: []
};
}
function findRootContainerNode(inst) {
if (inst.tag === HostRoot) {
return inst.stateNode.containerInfo;
}
while (inst.return) {
inst = inst.return;
}
if (inst.tag !== HostRoot) {
return null;
}
return inst.stateNode.containerInfo;
}
function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var events = null;
for (var i = 0; i < plugins.length; i++) {
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
}
function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
runEventsInBatch(events);
}
function handleTopLevel(bookKeeping) {
var targetInst = bookKeeping.targetInst;
var ancestor = targetInst;
do {
if (!ancestor) {
var ancestors = bookKeeping.ancestors;
ancestors.push(ancestor);
break;
}
var root2 = findRootContainerNode(ancestor);
if (!root2) {
break;
}
var tag = ancestor.tag;
if (tag === HostComponent || tag === HostText) {
bookKeeping.ancestors.push(ancestor);
}
ancestor = getClosestInstanceFromNode(root2);
} while (ancestor);
for (var i = 0; i < bookKeeping.ancestors.length; i++) {
targetInst = bookKeeping.ancestors[i];
var eventTarget = getEventTarget(bookKeeping.nativeEvent);
var topLevelType = bookKeeping.topLevelType;
var nativeEvent = bookKeeping.nativeEvent;
var eventSystemFlags = bookKeeping.eventSystemFlags;
if (i === 0) {
eventSystemFlags |= IS_FIRST_ANCESTOR;
}
runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);
}
}
function dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
try {
batchedEventUpdates(handleTopLevel, bookKeeping);
} finally {
releaseTopLevelCallbackBookKeeping(bookKeeping);
}
}
function legacyListenToEvent(registrationName, mountAt) {
var listenerMap = getListenerMapForElement(mountAt);
var dependencies = registrationNameDependencies[registrationName];
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);
}
}
function legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {
if (!listenerMap.has(topLevelType)) {
switch (topLevelType) {
case TOP_SCROLL:
trapCapturedEvent(TOP_SCROLL, mountAt);
break;
case TOP_FOCUS:
case TOP_BLUR:
trapCapturedEvent(TOP_FOCUS, mountAt);
trapCapturedEvent(TOP_BLUR, mountAt);
listenerMap.set(TOP_BLUR, null);
listenerMap.set(TOP_FOCUS, null);
break;
case TOP_CANCEL:
case TOP_CLOSE:
if (isEventSupported(getRawEventName(topLevelType))) {
trapCapturedEvent(topLevelType, mountAt);
}
break;
case TOP_INVALID:
case TOP_SUBMIT:
case TOP_RESET:
break;
default:
var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
if (!isMediaEvent) {
trapBubbledEvent(topLevelType, mountAt);
}
break;
}
listenerMap.set(topLevelType, null);
}
}
function isListeningToAllDependencies(registrationName, mountAt) {
var listenerMap = getListenerMapForElement(mountAt);
var dependencies = registrationNameDependencies[registrationName];
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
if (!listenerMap.has(dependency)) {
return false;
}
}
return true;
}
var attemptUserBlockingHydration;
function setAttemptUserBlockingHydration(fn) {
attemptUserBlockingHydration = fn;
}
var attemptContinuousHydration;
function setAttemptContinuousHydration(fn) {
attemptContinuousHydration = fn;
}
var attemptHydrationAtCurrentPriority;
function setAttemptHydrationAtCurrentPriority(fn) {
attemptHydrationAtCurrentPriority = fn;
}
var hasScheduledReplayAttempt = false;
var queuedDiscreteEvents = [];
var queuedFocus = null;
var queuedDrag = null;
var queuedMouse = null;
var queuedPointers = new Map();
var queuedPointerCaptures = new Map();
var queuedExplicitHydrationTargets = [];
function hasQueuedDiscreteEvents() {
return queuedDiscreteEvents.length > 0;
}
var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
function isReplayableDiscreteEvent(eventType) {
return discreteReplayableEvents.indexOf(eventType) > -1;
}
function trapReplayableEventForDocument(topLevelType, document2, listenerMap) {
legacyListenToTopLevelEvent(topLevelType, document2, listenerMap);
}
function eagerlyTrapReplayableEvents(container, document2) {
var listenerMapForDoc = getListenerMapForElement(document2);
discreteReplayableEvents.forEach(function(topLevelType) {
trapReplayableEventForDocument(topLevelType, document2, listenerMapForDoc);
});
continuousReplayableEvents.forEach(function(topLevelType) {
trapReplayableEventForDocument(topLevelType, document2, listenerMapForDoc);
});
}
function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
return {
blockedOn,
topLevelType,
eventSystemFlags: eventSystemFlags | IS_REPLAYED,
nativeEvent,
container
};
}
function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
queuedDiscreteEvents.push(queuedEvent);
}
function clearIfContinuousEvent(topLevelType, nativeEvent) {
switch (topLevelType) {
case TOP_FOCUS:
case TOP_BLUR:
queuedFocus = null;
break;
case TOP_DRAG_ENTER:
case TOP_DRAG_LEAVE:
queuedDrag = null;
break;
case TOP_MOUSE_OVER:
case TOP_MOUSE_OUT:
queuedMouse = null;
break;
case TOP_POINTER_OVER:
case TOP_POINTER_OUT: {
var pointerId = nativeEvent.pointerId;
queuedPointers.delete(pointerId);
break;
}
case TOP_GOT_POINTER_CAPTURE:
case TOP_LOST_POINTER_CAPTURE: {
var _pointerId = nativeEvent.pointerId;
queuedPointerCaptures.delete(_pointerId);
break;
}
}
}
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
if (blockedOn !== null) {
var _fiber2 = getInstanceFromNode$1(blockedOn);
if (_fiber2 !== null) {
attemptContinuousHydration(_fiber2);
}
}
return queuedEvent;
}
existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
return existingQueuedEvent;
}
function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
switch (topLevelType) {
case TOP_FOCUS: {
var focusEvent = nativeEvent;
queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);
return true;
}
case TOP_DRAG_ENTER: {
var dragEvent = nativeEvent;
queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);
return true;
}
case TOP_MOUSE_OVER: {
var mouseEvent = nativeEvent;
queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);
return true;
}
case TOP_POINTER_OVER: {
var pointerEvent = nativeEvent;
var pointerId = pointerEvent.pointerId;
queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));
return true;
}
case TOP_GOT_POINTER_CAPTURE: {
var _pointerEvent = nativeEvent;
var _pointerId2 = _pointerEvent.pointerId;
queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _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;
Scheduler.unstable_runWithPriority(queuedTarget.priority, function() {
attemptHydrationAtCurrentPriority(nearestMounted);
});
return;
}
} else if (tag === HostRoot) {
var root2 = nearestMounted.stateNode;
if (root2.hydrate) {
queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
return;
}
}
}
}
queuedTarget.blockedOn = null;
}
function attemptReplayContinuousQueuedEvent(queuedEvent) {
if (queuedEvent.blockedOn !== null) {
return false;
}
var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);
if (nextBlockedOn !== null) {
var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
if (_fiber3 !== null) {
attemptContinuousHydration(_fiber3);
}
queuedEvent.blockedOn = nextBlockedOn;
return false;
}
return true;
}
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
map.delete(key);
}
}
function replayUnblockedEvents() {
hasScheduledReplayAttempt = false;
while (queuedDiscreteEvents.length > 0) {
var nextDiscreteEvent = queuedDiscreteEvents[0];
if (nextDiscreteEvent.blockedOn !== null) {
var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
if (_fiber4 !== null) {
attemptUserBlockingHydration(_fiber4);
}
break;
}
var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);
if (nextBlockedOn !== null) {
nextDiscreteEvent.blockedOn = nextBlockedOn;
} else {
queuedDiscreteEvents.shift();
}
}
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 i = 1; i < queuedDiscreteEvents.length; i++) {
var queuedEvent = queuedDiscreteEvents[i];
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();
}
}
}
}
function addEventBubbleListener(element, eventType, listener) {
element.addEventListener(eventType, listener, false);
}
function addEventCaptureListener(element, eventType, listener) {
element.addEventListener(eventType, listener, true);
}
var simpleEventPluginEventTypes = {};
var topLevelEventsToDispatchConfig = new Map();
var eventPriorities = new Map();
var discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, "blur", TOP_CANCEL, "cancel", TOP_CLICK, "click", TOP_CLOSE, "close", TOP_CONTEXT_MENU, "contextMenu", TOP_COPY, "copy", TOP_CUT, "cut", TOP_AUX_CLICK, "auxClick", TOP_DOUBLE_CLICK, "doubleClick", TOP_DRAG_END, "dragEnd", TOP_DRAG_START, "dragStart", TOP_DROP, "drop", TOP_FOCUS, "focus", TOP_INPUT, "input", TOP_INVALID, "invalid", TOP_KEY_DOWN, "keyDown", TOP_KEY_PRESS, "keyPress", TOP_KEY_UP, "keyUp", TOP_MOUSE_DOWN, "mouseDown", TOP_MOUSE_UP, "mouseUp", TOP_PASTE, "paste", TOP_PAUSE, "pause", TOP_PLAY, "play", TOP_POINTER_CANCEL, "pointerCancel", TOP_POINTER_DOWN, "pointerDown", TOP_POINTER_UP, "pointerUp", TOP_RATE_CHANGE, "rateChange", TOP_RESET, "reset", TOP_SEEKED, "seeked", TOP_SUBMIT, "submit", TOP_TOUCH_CANCEL, "touchCancel", TOP_TOUCH_END, "touchEnd", TOP_TOUCH_START, "touchStart", TOP_VOLUME_CHANGE, "volumeChange"];
var otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE];
var userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, "drag", TOP_DRAG_ENTER, "dragEnter", TOP_DRAG_EXIT, "dragExit", TOP_DRAG_LEAVE, "dragLeave", TOP_DRAG_OVER, "dragOver", TOP_MOUSE_MOVE, "mouseMove", TOP_MOUSE_OUT, "mouseOut", TOP_MOUSE_OVER, "mouseOver", TOP_POINTER_MOVE, "pointerMove", TOP_POINTER_OUT, "pointerOut", TOP_POINTER_OVER, "pointerOver", TOP_SCROLL, "scroll", TOP_TOGGLE, "toggle", TOP_TOUCH_MOVE, "touchMove", TOP_WHEEL, "wheel"];
var continuousPairsForSimpleEventPlugin = [TOP_ABORT, "abort", TOP_ANIMATION_END, "animationEnd", TOP_ANIMATION_ITERATION, "animationIteration", TOP_ANIMATION_START, "animationStart", TOP_CAN_PLAY, "canPlay", TOP_CAN_PLAY_THROUGH, "canPlayThrough", TOP_DURATION_CHANGE, "durationChange", TOP_EMPTIED, "emptied", TOP_ENCRYPTED, "encrypted", TOP_ENDED, "ended", TOP_ERROR, "error", TOP_GOT_POINTER_CAPTURE, "gotPointerCapture", TOP_LOAD, "load", TOP_LOADED_DATA, "loadedData", TOP_LOADED_METADATA, "loadedMetadata", TOP_LOAD_START, "loadStart", TOP_LOST_POINTER_CAPTURE, "lostPointerCapture", TOP_PLAYING, "playing", TOP_PROGRESS, "progress", TOP_SEEKING, "seeking", TOP_STALLED, "stalled", TOP_SUSPEND, "suspend", TOP_TIME_UPDATE, "timeUpdate", TOP_TRANSITION_END, "transitionEnd", TOP_WAITING, "waiting"];
function processSimpleEventPluginPairsByPriority(eventTypes2, priority) {
for (var i = 0; i < eventTypes2.length; i += 2) {
var topEvent = eventTypes2[i];
var event = eventTypes2[i + 1];
var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
var onEvent = "on" + capitalizedEvent;
var config10 = {
phasedRegistrationNames: {
bubbled: onEvent,
captured: onEvent + "Capture"
},
dependencies: [topEvent],
eventPriority: priority
};
eventPriorities.set(topEvent, priority);
topLevelEventsToDispatchConfig.set(topEvent, config10);
simpleEventPluginEventTypes[event] = config10;
}
}
function processTopEventPairsByPriority(eventTypes2, priority) {
for (var i = 0; i < eventTypes2.length; i++) {
eventPriorities.set(eventTypes2[i], priority);
}
}
processSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
processSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
processSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent);
processTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);
function getEventPriorityForPluginSystem(topLevelType) {
var priority = eventPriorities.get(topLevelType);
return priority === void 0 ? ContinuousEvent : priority;
}
var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, runWithPriority = Scheduler.unstable_runWithPriority;
var _enabled = true;
function setEnabled(enabled) {
_enabled = !!enabled;
}
function isEnabled() {
return _enabled;
}
function trapBubbledEvent(topLevelType, element) {
trapEventForPluginEventSystem(element, topLevelType, false);
}
function trapCapturedEvent(topLevelType, element) {
trapEventForPluginEventSystem(element, topLevelType, true);
}
function trapEventForPluginEventSystem(container, topLevelType, capture) {
var listener;
switch (getEventPriorityForPluginSystem(topLevelType)) {
case DiscreteEvent:
listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
break;
case UserBlockingEvent:
listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
break;
case ContinuousEvent:
default:
listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
break;
}
var rawEventName = getRawEventName(topLevelType);
if (capture) {
addEventCaptureListener(container, rawEventName, listener);
} else {
addEventBubbleListener(container, rawEventName, listener);
}
}
function dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);
}
function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {
runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));
}
function dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
if (!_enabled) {
return;
}
if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
queueDiscreteEvent(null, topLevelType, eventSystemFlags, container, nativeEvent);
return;
}
var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);
if (blockedOn === null) {
clearIfContinuousEvent(topLevelType, nativeEvent);
return;
}
if (isReplayableDiscreteEvent(topLevelType)) {
queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
return;
}
if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {
return;
}
clearIfContinuousEvent(topLevelType, nativeEvent);
{
dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
}
}
function attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
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 (root2.hydrate) {
return getContainerFromFiber(nearestMounted);
}
targetInst = null;
} else if (nearestMounted !== targetInst) {
targetInst = null;
}
}
}
{
dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
}
return null;
}
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,
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(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
var prefixes = ["Webkit", "ms", "Moz", "O"];
Object.keys(isUnitlessNumber).forEach(function(prop) {
prefixes.forEach(function(prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
function dangerousStyleValue(name, value, isCustomProperty3) {
var isEmpty = value == null || typeof value === "boolean" || value === "";
if (isEmpty) {
return "";
}
if (!isCustomProperty3 && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
return value + "px";
}
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(_, 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 delimiter2 = "";
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var styleValue = styles[styleName];
if (styleValue != null) {
var isCustomProperty3 = styleName.indexOf("--") === 0;
serialized += delimiter2 + (isCustomProperty3 ? styleName : hyphenateStyleName(styleName)) + ":";
serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty3);
delimiter2 = ";";
}
}
return serialized || null;
}
}
function setValueForStyles(node, styles) {
var style2 = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var isCustomProperty3 = styleName.indexOf("--") === 0;
{
if (!isCustomProperty3) {
warnValidStyle$1(styleName, styles[styleName]);
}
}
var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty3);
if (styleName === "float") {
styleName = "cssFloat";
}
if (isCustomProperty3) {
style2.setProperty(styleName, styleValue);
} else {
style2[styleName] = styleValue;
}
}
}
function isValueEmpty(value) {
return value == null || typeof value === "boolean" || value === "";
}
function expandShorthandMap(styles) {
var expanded2 = {};
for (var key in styles) {
var longhands = shorthandToLonghand[key] || [key];
for (var i = 0; i < longhands.length; i++) {
expanded2[longhands[i]] = key;
}
}
return expanded2;
}
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";
var ReactDebugCurrentFrame$3 = null;
{
ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
}
function assertValidProps(tag, props2) {
if (!props2) {
return;
}
if (voidElementTags[tag]) {
if (!(props2.children == null && props2.dangerouslySetInnerHTML == null)) {
{
throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ReactDebugCurrentFrame$3.getStackAddendum());
}
}
}
if (props2.dangerouslySetInnerHTML != null) {
if (!(props2.children == null)) {
{
throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
}
}
if (!(typeof props2.dangerouslySetInnerHTML === "object" && HTML in props2.dangerouslySetInnerHTML)) {
{
throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
}
}
}
{
if (!props2.suppressContentEditableWarning && props2.contentEditable && props2.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 (!(props2.style == null || typeof props2.style === "object")) {
{
throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ReactDebugCurrentFrame$3.getStackAddendum());
}
}
}
function isCustomComponent(tagName, props2) {
if (tagName.indexOf("-") === -1) {
return typeof props2.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",
download: "download",
draggable: "draggable",
enctype: "encType",
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",
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-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 + "]*$");
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
function validateProperty(tagName, name) {
{
if (hasOwnProperty$1.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, props2) {
{
var invalidProps = [];
for (var key in props2) {
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://fb.me/invalid-aria-prop", unknownPropString, type);
} else if (invalidProps.length > 1) {
error("Invalid aria props %s on <%s> tag. For details, see https://fb.me/invalid-aria-prop", unknownPropString, type);
}
}
}
function validateProperties(type, props2) {
if (isCustomComponent(type, props2)) {
return;
}
warnInvalidARIAProps(type, props2);
}
var didWarnValueNull = false;
function validateProperties$1(type, props2) {
{
if (type !== "input" && type !== "textarea" && type !== "select") {
return;
}
if (props2 != null && props2.value === null && !didWarnValueNull) {
didWarnValueNull = true;
if (type === "select" && props2.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 _hasOwnProperty = Object.prototype.hasOwnProperty;
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, canUseEventSystem) {
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 (canUseEventSystem) {
if (registrationNameModules.hasOwnProperty(name)) {
return true;
}
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[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, props2, canUseEventSystem) {
{
var unknownProps = [];
for (var key in props2) {
var isValid = validateProperty$1(type, key, props2[key], canUseEventSystem);
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://fb.me/react-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://fb.me/react-attribute-behavior", unknownPropString, type);
}
}
};
function validateProperties$2(type, props2, canUseEventSystem) {
if (isCustomComponent(type, props2)) {
return;
}
warnUnknownProperties(type, props2, canUseEventSystem);
}
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 HTML_NAMESPACE$1 = Namespaces.html;
var warnedUnknownTags;
var suppressHydrationWarning;
var validatePropertiesInDevelopment;
var warnForTextDifference;
var warnForPropDifference;
var warnForExtraAttributes;
var warnForInvalidEventListener;
var canDiffStyleForHydrationWarning;
var normalizeMarkupForTextOrAttribute;
var normalizeHTML;
{
warnedUnknownTags = {
time: true,
dialog: true,
webview: true
};
validatePropertiesInDevelopment = function(type, props2) {
validateProperties(type, props2);
validateProperties$1(type, props2);
validateProperties$2(type, props2, true);
};
canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
normalizeMarkupForTextOrAttribute = function(markup) {
var markupString = typeof markup === "string" ? markup : "" + markup;
return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
};
warnForTextDifference = function(serverText, clientText) {
if (didWarnInvalidHydration) {
return;
}
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
if (normalizedServerText === normalizedClientText) {
return;
}
didWarnInvalidHydration = true;
error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
};
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, listener) {
if (listener === 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 listener);
}
};
normalizeHTML = function(parent2, html) {
var testElement = parent2.namespaceURI === HTML_NAMESPACE$1 ? parent2.ownerDocument.createElement(parent2.tagName) : parent2.ownerDocument.createElementNS(parent2.namespaceURI, parent2.tagName);
testElement.innerHTML = html;
return testElement.innerHTML;
};
}
function ensureListeningTo(rootContainerElement, registrationName) {
var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
legacyListenToEvent(registrationName, doc);
}
function getOwnerDocumentFromRootContainer(rootContainerElement) {
return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
}
function noop() {
}
function trapClickOnNonInteractiveElement(node) {
node.onclick = noop;
}
function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
for (var propKey in nextProps) {
if (!nextProps.hasOwnProperty(propKey)) {
continue;
}
var nextProp = nextProps[propKey];
if (propKey === STYLE) {
{
if (nextProp) {
Object.freeze(nextProp);
}
}
setValueForStyles(domElement, nextProp);
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
if (nextHtml != null) {
setInnerHTML(domElement, nextHtml);
}
} else if (propKey === CHILDREN) {
if (typeof nextProp === "string") {
var canSetTextContent = tag !== "textarea" || nextProp !== "";
if (canSetTextContent) {
setTextContent(domElement, nextProp);
}
} else if (typeof nextProp === "number") {
setTextContent(domElement, "" + nextProp);
}
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
;
else if (propKey === AUTOFOCUS)
;
else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp != null) {
if (typeof nextProp !== "function") {
warnForInvalidEventListener(propKey, nextProp);
}
ensureListeningTo(rootContainerElement, propKey);
}
} else if (nextProp != null) {
setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
}
}
}
function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
for (var i = 0; i < updatePayload.length; i += 2) {
var propKey = updatePayload[i];
var propValue = updatePayload[i + 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 createElement6(type, props2, rootContainerElement, parentNamespace) {
var isCustomComponentTag;
var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
var domElement;
var namespaceURI = parentNamespace;
if (namespaceURI === HTML_NAMESPACE$1) {
namespaceURI = getIntrinsicNamespace(type);
}
if (namespaceURI === HTML_NAMESPACE$1) {
{
isCustomComponentTag = isCustomComponent(type, props2);
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 props2.is === "string") {
domElement = ownerDocument.createElement(type, {
is: props2.is
});
} else {
domElement = ownerDocument.createElement(type);
if (type === "select") {
var node = domElement;
if (props2.multiple) {
node.multiple = true;
} else if (props2.size) {
node.size = props2.size;
}
}
}
} else {
domElement = ownerDocument.createElementNS(namespaceURI, type);
}
{
if (namespaceURI === HTML_NAMESPACE$1) {
if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.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 props2;
switch (tag) {
case "iframe":
case "object":
case "embed":
trapBubbledEvent(TOP_LOAD, domElement);
props2 = rawProps;
break;
case "video":
case "audio":
for (var i = 0; i < mediaEventTypes.length; i++) {
trapBubbledEvent(mediaEventTypes[i], domElement);
}
props2 = rawProps;
break;
case "source":
trapBubbledEvent(TOP_ERROR, domElement);
props2 = rawProps;
break;
case "img":
case "image":
case "link":
trapBubbledEvent(TOP_ERROR, domElement);
trapBubbledEvent(TOP_LOAD, domElement);
props2 = rawProps;
break;
case "form":
trapBubbledEvent(TOP_RESET, domElement);
trapBubbledEvent(TOP_SUBMIT, domElement);
props2 = rawProps;
break;
case "details":
trapBubbledEvent(TOP_TOGGLE, domElement);
props2 = rawProps;
break;
case "input":
initWrapperState(domElement, rawProps);
props2 = getHostProps(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
case "option":
validateProps(domElement, rawProps);
props2 = getHostProps$1(domElement, rawProps);
break;
case "select":
initWrapperState$1(domElement, rawProps);
props2 = getHostProps$2(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
case "textarea":
initWrapperState$2(domElement, rawProps);
props2 = getHostProps$3(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
default:
props2 = rawProps;
}
assertValidProps(tag, props2);
setInitialDOMProperties(tag, domElement, rootContainerElement, props2, 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 props2.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 "option":
lastProps = getHostProps$1(domElement, lastRawProps);
nextProps = getHostProps$1(domElement, nextRawProps);
updatePayload = [];
break;
case "select":
lastProps = getHostProps$2(domElement, lastRawProps);
nextProps = getHostProps$2(domElement, nextRawProps);
updatePayload = [];
break;
case "textarea":
lastProps = getHostProps$3(domElement, lastRawProps);
nextProps = getHostProps$3(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 (registrationNameModules.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 (lastProp !== nextProp && (typeof nextProp === "string" || typeof nextProp === "number")) {
(updatePayload = updatePayload || []).push(propKey, "" + nextProp);
}
} else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
;
else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp != null) {
if (typeof nextProp !== "function") {
warnForInvalidEventListener(propKey, nextProp);
}
ensureListeningTo(rootContainerElement, propKey);
}
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) {
var isCustomComponentTag;
var extraAttributeNames;
{
suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
isCustomComponentTag = isCustomComponent(tag, rawProps);
validatePropertiesInDevelopment(tag, rawProps);
}
switch (tag) {
case "iframe":
case "object":
case "embed":
trapBubbledEvent(TOP_LOAD, domElement);
break;
case "video":
case "audio":
for (var i = 0; i < mediaEventTypes.length; i++) {
trapBubbledEvent(mediaEventTypes[i], domElement);
}
break;
case "source":
trapBubbledEvent(TOP_ERROR, domElement);
break;
case "img":
case "image":
case "link":
trapBubbledEvent(TOP_ERROR, domElement);
trapBubbledEvent(TOP_LOAD, domElement);
break;
case "form":
trapBubbledEvent(TOP_RESET, domElement);
trapBubbledEvent(TOP_SUBMIT, domElement);
break;
case "details":
trapBubbledEvent(TOP_TOGGLE, domElement);
break;
case "input":
initWrapperState(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
case "option":
validateProps(domElement, rawProps);
break;
case "select":
initWrapperState$1(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
case "textarea":
initWrapperState$2(domElement, rawProps);
trapBubbledEvent(TOP_INVALID, domElement);
ensureListeningTo(rootContainerElement, "onChange");
break;
}
assertValidProps(tag, rawProps);
{
extraAttributeNames = new Set();
var attributes = domElement.attributes;
for (var _i = 0; _i < attributes.length; _i++) {
var name = attributes[_i].name.toLowerCase();
switch (name) {
case "data-reactroot":
break;
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 (!suppressHydrationWarning) {
warnForTextDifference(domElement.textContent, nextProp);
}
updatePayload = [CHILDREN, nextProp];
}
} else if (typeof nextProp === "number") {
if (domElement.textContent !== "" + nextProp) {
if (!suppressHydrationWarning) {
warnForTextDifference(domElement.textContent, nextProp);
}
updatePayload = [CHILDREN, "" + nextProp];
}
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp != null) {
if (typeof nextProp !== "function") {
warnForInvalidEventListener(propKey, nextProp);
}
ensureListeningTo(rootContainerElement, propKey);
}
} else if (typeof isCustomComponentTag === "boolean") {
var serverValue = void 0;
var propertyInfo = getPropertyInfo(propKey);
if (suppressHydrationWarning)
;
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;
var expectedHTML = normalizeHTML(domElement, nextHtml != null ? 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) {
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$1) {
ownNamespace = getIntrinsicNamespace(tag);
}
if (ownNamespace === HTML_NAMESPACE$1) {
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);
}
if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
warnForPropDifference(propKey, serverValue, nextProp);
}
}
}
}
{
if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
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) {
var isDifferent = textNode.nodeValue !== text;
return isDifferent;
}
function warnForUnmatchedText(textNode, text) {
{
warnForTextDifference(textNode.nodeValue, text);
}
}
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, props2) {
{
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, props2) {
switch (tag) {
case "input":
restoreControlledState(domElement, props2);
return;
case "textarea":
restoreControlledState$2(domElement, props2);
return;
case "select":
restoreControlledState$1(domElement, props2);
return;
}
}
function getActiveElement(doc) {
doc = doc || (typeof document !== "undefined" ? document : void 0);
if (typeof doc === "undefined") {
return null;
}
try {
return doc.activeElement || doc.body;
} catch (e3) {
return doc.body;
}
}
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 (e3) {
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 {
activeElementDetached: null,
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 i = 0; i < ancestors.length; i++) {
var info = ancestors[i];
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, 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 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 addendum = getCurrentFiberStackInDev();
var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag + "|" + addendum;
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;
{
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 shouldAutoFocusHostComponent(type, props2) {
switch (type) {
case "button":
case "input":
case "select":
case "textarea":
return !!props2.autoFocus;
}
return false;
}
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();
setEnabled(false);
}
function resetAfterCommit(containerInfo) {
restoreSelection(selectionInformation);
setEnabled(eventsEnabled);
eventsEnabled = null;
selectionInformation = null;
}
function createInstance(type, props2, rootContainerInstance, hostContext, internalInstanceHandle) {
var parentNamespace;
{
var hostContextDev = hostContext;
validateDOMNesting(type, null, hostContextDev.ancestorInfo);
if (typeof props2.children === "string" || typeof props2.children === "number") {
var string = "" + props2.children;
var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
validateDOMNesting(null, string, ownAncestorInfo);
}
parentNamespace = hostContextDev.namespace;
}
var domElement = createElement6(type, props2, rootContainerInstance, parentNamespace);
precacheFiberNode(internalInstanceHandle, domElement);
updateFiberProps(domElement, props2);
return domElement;
}
function appendInitialChild(parentInstance, child) {
parentInstance.appendChild(child);
}
function finalizeInitialChildren(domElement, type, props2, rootContainerInstance, hostContext) {
setInitialProperties(domElement, type, props2, rootContainerInstance);
return shouldAutoFocusHostComponent(type, props2);
}
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, rootContainerInstance);
}
function shouldSetTextContent(type, props2) {
return type === "textarea" || type === "option" || type === "noscript" || typeof props2.children === "string" || typeof props2.children === "number" || typeof props2.dangerouslySetInnerHTML === "object" && props2.dangerouslySetInnerHTML !== null && props2.dangerouslySetInnerHTML.__html != null;
}
function shouldDeprioritizeSubtree(type, props2) {
return !!props2.hidden;
}
function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
{
var hostContextDev = hostContext;
validateDOMNesting(null, text, hostContextDev.ancestorInfo);
}
var textNode = createTextNode(text, rootContainerInstance);
precacheFiberNode(internalInstanceHandle, textNode);
return textNode;
}
var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
var noTimeout = -1;
function commitMount(domElement, type, newProps, internalInstanceHandle) {
if (shouldAutoFocusHostComponent(type, newProps)) {
domElement.focus();
}
}
function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
updateFiberProps(domElement, newProps);
updateProperties(domElement, updatePayload, type, oldProps, 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 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, props2) {
instance = instance;
var styleProp = props2[STYLE$1];
var display2 = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
instance.style.display = dangerousStyleValue("display", display2);
}
function unhideTextInstance(textInstance, text) {
textInstance.nodeValue = text;
}
function canHydrateInstance(instance, type, props2) {
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 isSuspenseInstancePending(instance) {
return instance.data === SUSPENSE_PENDING_START_DATA;
}
function isSuspenseInstanceFallback(instance) {
return instance.data === SUSPENSE_FALLBACK_START_DATA;
}
function getNextHydratable(node) {
for (; node != null; node = node.nextSibling) {
var nodeType = node.nodeType;
if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
break;
}
}
return node;
}
function getNextHydratableSibling(instance) {
return getNextHydratable(instance.nextSibling);
}
function getFirstHydratableChild(parentInstance) {
return getNextHydratable(parentInstance.firstChild);
}
function hydrateInstance(instance, type, props2, rootContainerInstance, hostContext, internalInstanceHandle) {
precacheFiberNode(internalInstanceHandle, instance);
updateFiberProps(instance, props2);
var parentNamespace;
{
var hostContextDev = hostContext;
parentNamespace = hostContextDev.namespace;
}
return diffHydratedProperties(instance, type, props2, parentNamespace, rootContainerInstance);
}
function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
precacheFiberNode(internalInstanceHandle, textInstance);
return diffHydratedText(textInstance, text);
}
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 didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
{
warnForUnmatchedText(textInstance, text);
}
}
function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
warnForUnmatchedText(textInstance, text);
}
}
function didNotHydrateContainerInstance(parentContainer, instance) {
{
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentContainer, instance);
} else if (instance.nodeType === COMMENT_NODE)
;
else {
warnForDeletedHydratableText(parentContainer, instance);
}
}
}
function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
if (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 didNotFindHydratableContainerInstance(parentContainer, type, props2) {
{
warnForInsertedHydratedElement(parentContainer, type);
}
}
function didNotFindHydratableContainerTextInstance(parentContainer, text) {
{
warnForInsertedHydratedText(parentContainer, text);
}
}
function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props2) {
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
warnForInsertedHydratedElement(parentInstance, type);
}
}
function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
warnForInsertedHydratedText(parentInstance, text);
}
}
function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true)
;
}
var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = "__reactInternalInstance$" + randomKey;
var internalEventHandlersKey = "__reactEventHandlers$" + randomKey;
var internalContainerInstanceKey = "__reactContainere$" + randomKey;
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$1(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$1(inst) {
if (inst.tag === HostComponent || inst.tag === HostText) {
return inst.stateNode;
}
{
{
throw Error("getNodeFromInstance: Invalid argument.");
}
}
}
function getFiberCurrentPropsFromNode$1(node) {
return node[internalEventHandlersKey] || null;
}
function updateFiberProps(node, props2) {
node[internalEventHandlersKey] = props2;
}
function getParent(inst) {
do {
inst = inst.return;
} while (inst && inst.tag !== HostComponent);
if (inst) {
return inst;
}
return null;
}
function getLowestCommonAncestor(instA, instB) {
var depthA = 0;
for (var tempA = instA; tempA; tempA = getParent(tempA)) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = getParent(tempB)) {
depthB++;
}
while (depthA - depthB > 0) {
instA = getParent(instA);
depthA--;
}
while (depthB - depthA > 0) {
instB = getParent(instB);
depthB--;
}
var depth = depthA;
while (depth--) {
if (instA === instB || instA === instB.alternate) {
return instA;
}
instA = getParent(instA);
instB = getParent(instB);
}
return null;
}
function traverseTwoPhase(inst, fn, arg) {
var path = [];
while (inst) {
path.push(inst);
inst = getParent(inst);
}
var i;
for (i = path.length; i-- > 0; ) {
fn(path[i], "captured", arg);
}
for (i = 0; i < path.length; i++) {
fn(path[i], "bubbled", arg);
}
}
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
var common = from && to ? getLowestCommonAncestor(from, to) : null;
var pathFrom = [];
while (true) {
if (!from) {
break;
}
if (from === common) {
break;
}
var alternate = from.alternate;
if (alternate !== null && alternate === common) {
break;
}
pathFrom.push(from);
from = getParent(from);
}
var pathTo = [];
while (true) {
if (!to) {
break;
}
if (to === common) {
break;
}
var _alternate = to.alternate;
if (_alternate !== null && _alternate === common) {
break;
}
pathTo.push(to);
to = getParent(to);
}
for (var i = 0; i < pathFrom.length; i++) {
fn(pathFrom[i], "bubbled", argFrom);
}
for (var _i = pathTo.length; _i-- > 0; ) {
fn(pathTo[_i], "captured", argTo);
}
}
function isInteractive(tag) {
return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
}
function shouldPreventMouseEvent(name, type, props2) {
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 !!(props2.disabled && isInteractive(type));
default:
return false;
}
}
function getListener(inst, registrationName) {
var listener;
var stateNode = inst.stateNode;
if (!stateNode) {
return null;
}
var props2 = getFiberCurrentPropsFromNode(stateNode);
if (!props2) {
return null;
}
listener = props2[registrationName];
if (shouldPreventMouseEvent(registrationName, inst.type, props2)) {
return null;
}
if (!(!listener || typeof listener === "function")) {
{
throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
}
}
return listener;
}
function listenerAtPhase(inst, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(inst, registrationName);
}
function accumulateDirectionalDispatches(inst, phase, event) {
{
if (!inst) {
error("Dispatching inst must not be null");
}
}
var listener = listenerAtPhase(inst, event, phase);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
}
}
function accumulateDispatches(inst, ignoredDirection, event) {
if (inst && event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(inst, registrationName);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
}
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event._targetInst, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateEnterLeaveDispatches(leave, enter, from, to) {
traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
var root = null;
var startText = null;
var fallbackText = null;
function initialize(nativeEventTarget) {
root = nativeEventTarget;
startText = getText();
return true;
}
function reset() {
root = null;
startText = null;
fallbackText = null;
}
function getData() {
if (fallbackText) {
return fallbackText;
}
var start;
var startValue = startText;
var startLength = startValue.length;
var end;
var endValue = getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue[start] !== endValue[start]) {
break;
}
}
var minEnd = startLength - start;
for (end = 1; end <= minEnd; end++) {
if (startValue[startLength - end] !== endValue[endLength - end]) {
break;
}
}
var sliceTail = end > 1 ? 1 - end : void 0;
fallbackText = endValue.slice(start, sliceTail);
return fallbackText;
}
function getText() {
if ("value" in root) {
return root.value;
}
return root.textContent;
}
var EVENT_POOL_SIZE = 10;
var EventInterface = {
type: null,
target: null,
currentTarget: function() {
return null;
},
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function(event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
function functionThatReturnsTrue() {
return true;
}
function functionThatReturnsFalse() {
return false;
}
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
{
delete this.nativeEvent;
delete this.preventDefault;
delete this.stopPropagation;
delete this.isDefaultPrevented;
delete this.isPropagationStopped;
}
this.dispatchConfig = dispatchConfig;
this._targetInst = targetInst;
this.nativeEvent = nativeEvent;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
{
delete this[propName];
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
if (propName === "target") {
this.target = nativeEventTarget;
} 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(SyntheticEvent.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() {
this.isPersistent = functionThatReturnsTrue;
},
isPersistent: functionThatReturnsFalse,
destructor: function() {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
{
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
}
}
this.dispatchConfig = null;
this._targetInst = null;
this.nativeEvent = null;
this.isDefaultPrevented = functionThatReturnsFalse;
this.isPropagationStopped = functionThatReturnsFalse;
this._dispatchListeners = null;
this._dispatchInstances = null;
{
Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null));
Object.defineProperty(this, "isDefaultPrevented", getPooledWarningPropertyDefinition("isDefaultPrevented", functionThatReturnsFalse));
Object.defineProperty(this, "isPropagationStopped", getPooledWarningPropertyDefinition("isPropagationStopped", functionThatReturnsFalse));
Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", function() {
}));
Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", function() {
}));
}
}
});
SyntheticEvent.Interface = EventInterface;
SyntheticEvent.extend = function(Interface) {
var Super = this;
var E = function() {
};
E.prototype = Super.prototype;
var prototype = new E();
function Class() {
return Super.apply(this, arguments);
}
_assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = _assign({}, Super.Interface, Interface);
Class.extend = Super.extend;
addEventPoolingTo(Class);
return Class;
};
addEventPoolingTo(SyntheticEvent);
function getPooledWarningPropertyDefinition(propName, getVal) {
var isFunction2 = typeof getVal === "function";
return {
configurable: true,
set: set3,
get: get9
};
function set3(val) {
var action = isFunction2 ? "setting the method" : "setting the property";
warn2(action, "This is effectively a no-op");
return val;
}
function get9() {
var action = isFunction2 ? "accessing the method" : "accessing the property";
var result = isFunction2 ? "This is a no-op function" : "This is set to null";
warn2(action, result);
return getVal;
}
function warn2(action, result) {
{
error("This synthetic event is reused for performance reasons. If you're seeing this, you're %s `%s` on a released/nullified synthetic event. %s. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-pooling for more information.", action, propName, result);
}
}
}
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
var EventConstructor = this;
if (EventConstructor.eventPool.length) {
var instance = EventConstructor.eventPool.pop();
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
return instance;
}
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
}
function releasePooledEvent(event) {
var EventConstructor = this;
if (!(event instanceof EventConstructor)) {
{
throw Error("Trying to release an event instance into a pool of a different type.");
}
}
event.destructor();
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
EventConstructor.eventPool.push(event);
}
}
function addEventPoolingTo(EventConstructor) {
EventConstructor.eventPool = [];
EventConstructor.getPooled = getPooledEvent;
EventConstructor.release = releasePooledEvent;
}
var SyntheticCompositionEvent = SyntheticEvent.extend({
data: null
});
var SyntheticInputEvent = SyntheticEvent.extend({
data: null
});
var END_KEYCODES = [9, 13, 27, 32];
var START_KEYCODE = 229;
var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
var documentMode = null;
if (canUseDOM && "documentMode" in document) {
documentMode = document.documentMode;
}
var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: "onBeforeInput",
captured: "onBeforeInputCapture"
},
dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: "onCompositionEnd",
captured: "onCompositionEndCapture"
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
},
compositionStart: {
phasedRegistrationNames: {
bubbled: "onCompositionStart",
captured: "onCompositionStartCapture"
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: "onCompositionUpdate",
captured: "onCompositionUpdateCapture"
},
dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
}
};
var hasSpaceKeypress = false;
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);
}
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case TOP_COMPOSITION_START:
return eventTypes.compositionStart;
case TOP_COMPOSITION_END:
return eventTypes.compositionEnd;
case TOP_COMPOSITION_UPDATE:
return eventTypes.compositionUpdate;
}
}
function isFallbackCompositionStart(topLevelType, nativeEvent) {
return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
}
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case TOP_KEY_UP:
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case TOP_KEY_DOWN:
return nativeEvent.keyCode !== START_KEYCODE;
case TOP_KEY_PRESS:
case TOP_MOUSE_DOWN:
case TOP_BLUR:
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(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var eventType;
var fallbackData;
if (canUseCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!isComposing) {
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (!eventType) {
return null;
}
if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
if (!isComposing && eventType === eventTypes.compositionStart) {
isComposing = initialize(nativeEventTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (isComposing) {
fallbackData = getData();
}
}
}
var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
if (fallbackData) {
event.data = fallbackData;
} else {
var customData = getDataFromCustomEvent(nativeEvent);
if (customData !== null) {
event.data = customData;
}
}
accumulateTwoPhaseDispatches(event);
return event;
}
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case TOP_COMPOSITION_END:
return getDataFromCustomEvent(nativeEvent);
case TOP_KEY_PRESS:
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case TOP_TEXT_INPUT:
var chars = nativeEvent.data;
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return null;
}
return chars;
default:
return null;
}
}
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
if (isComposing) {
if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
var chars = getData();
reset();
isComposing = false;
return chars;
}
return null;
}
switch (topLevelType) {
case TOP_PASTE:
return null;
case TOP_KEY_PRESS:
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 TOP_COMPOSITION_END:
return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
default:
return null;
}
}
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var chars;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
}
if (!chars) {
return null;
}
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
event.data = chars;
accumulateTwoPhaseDispatches(event);
return event;
}
var BeforeInputEventPlugin = {
eventTypes,
extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
if (composition === null) {
return beforeInput;
}
if (beforeInput === null) {
return composition;
}
return [composition, beforeInput];
}
};
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;
}
var eventTypes$1 = {
change: {
phasedRegistrationNames: {
bubbled: "onChange",
captured: "onChangeCapture"
},
dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
}
};
function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
event.type = "change";
enqueueStateRestore(target);
accumulateTwoPhaseDispatches(event);
return event;
}
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 event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
runEventsInBatch(event);
}
function getInstIfValueChanged(targetInst) {
var targetNode = getNodeFromInstance$1(targetInst);
if (updateValueIfChanged(targetNode)) {
return targetInst;
}
}
function getTargetInstForChangeEvent(topLevelType, targetInst) {
if (topLevelType === TOP_CHANGE) {
return targetInst;
}
}
var isInputEventSupported = false;
if (canUseDOM) {
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(topLevelType, target, targetInst) {
if (topLevelType === TOP_FOCUS) {
stopWatchingForValueChange();
startWatchingForValueChange(target, targetInst);
} else if (topLevelType === TOP_BLUR) {
stopWatchingForValueChange();
}
}
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
return getInstIfValueChanged(activeElementInst);
}
}
function shouldUseClickEvent(elem) {
var nodeName = elem.nodeName;
return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === TOP_CLICK) {
return getInstIfValueChanged(targetInst);
}
}
function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
return getInstIfValueChanged(targetInst);
}
}
function handleControlledInputBlur(node) {
var state = node._wrapperState;
if (!state || !state.controlled || node.type !== "number") {
return;
}
{
setDefaultValue(node, "number", node.value);
}
}
var ChangeEventPlugin = {
eventTypes: eventTypes$1,
_isInputEventSupported: isInputEventSupported,
extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var targetNode = targetInst ? getNodeFromInstance$1(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(topLevelType, targetInst);
if (inst) {
var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
if (topLevelType === TOP_BLUR) {
handleControlledInputBlur(targetNode);
}
}
};
var SyntheticUIEvent = SyntheticEvent.extend({
view: null,
detail: null
});
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 previousScreenX = 0;
var previousScreenY = 0;
var isMovementXSet = false;
var isMovementYSet = false;
var SyntheticMouseEvent = SyntheticUIEvent.extend({
screenX: null,
screenY: null,
clientX: null,
clientY: null,
pageX: null,
pageY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: null,
buttons: null,
relatedTarget: function(event) {
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
},
movementX: function(event) {
if ("movementX" in event) {
return event.movementX;
}
var screenX = previousScreenX;
previousScreenX = event.screenX;
if (!isMovementXSet) {
isMovementXSet = true;
return 0;
}
return event.type === "mousemove" ? event.screenX - screenX : 0;
},
movementY: function(event) {
if ("movementY" in event) {
return event.movementY;
}
var screenY = previousScreenY;
previousScreenY = event.screenY;
if (!isMovementYSet) {
isMovementYSet = true;
return 0;
}
return event.type === "mousemove" ? event.screenY - screenY : 0;
}
});
var SyntheticPointerEvent = SyntheticMouseEvent.extend({
pointerId: null,
width: null,
height: null,
pressure: null,
tangentialPressure: null,
tiltX: null,
tiltY: null,
twist: null,
pointerType: null,
isPrimary: null
});
var eventTypes$2 = {
mouseEnter: {
registrationName: "onMouseEnter",
dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
},
mouseLeave: {
registrationName: "onMouseLeave",
dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
},
pointerEnter: {
registrationName: "onPointerEnter",
dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
},
pointerLeave: {
registrationName: "onPointerLeave",
dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
}
};
var EnterLeaveEventPlugin = {
eventTypes: eventTypes$2,
extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (!isOutEvent && !isOverEvent) {
return null;
}
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) {
from = targetInst;
var related = nativeEvent.relatedTarget || nativeEvent.toElement;
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 null;
}
var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
eventInterface = SyntheticMouseEvent;
leaveEventType = eventTypes$2.mouseLeave;
enterEventType = eventTypes$2.mouseEnter;
eventTypePrefix = "mouse";
} else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
eventInterface = SyntheticPointerEvent;
leaveEventType = eventTypes$2.pointerLeave;
enterEventType = eventTypes$2.pointerEnter;
eventTypePrefix = "pointer";
}
var fromNode = from == null ? win : getNodeFromInstance$1(from);
var toNode = to == null ? win : getNodeFromInstance$1(to);
var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
leave.type = eventTypePrefix + "leave";
leave.target = fromNode;
leave.relatedTarget = toNode;
var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
enter.type = eventTypePrefix + "enter";
enter.target = toNode;
enter.relatedTarget = fromNode;
accumulateEnterLeaveDispatches(leave, enter, from, to);
if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {
return [leave];
}
return [leave, enter];
}
};
function is(x, y) {
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
}
var objectIs = typeof Object.is === "function" ? Object.is : is;
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function shallowEqual(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 i = 0; i < keysA.length; i++) {
if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
var eventTypes$3 = {
select: {
phasedRegistrationNames: {
bubbled: "onSelect",
captured: "onSelectCapture"
},
dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
}
};
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(nativeEvent, nativeEventTarget) {
var doc = getEventTargetDocument(nativeEventTarget);
if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
return null;
}
var currentSelection = getSelection$1(activeElement$1);
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
lastSelection = currentSelection;
var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
syntheticEvent.type = "select";
syntheticEvent.target = activeElement$1;
accumulateTwoPhaseDispatches(syntheticEvent);
return syntheticEvent;
}
return null;
}
var SelectEventPlugin = {
eventTypes: eventTypes$3,
extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {
var containerOrDoc = container || getEventTargetDocument(nativeEventTarget);
if (!containerOrDoc || !isListeningToAllDependencies("onSelect", containerOrDoc)) {
return null;
}
var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
switch (topLevelType) {
case TOP_FOCUS:
if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
activeElement$1 = targetNode;
activeElementInst$1 = targetInst;
lastSelection = null;
}
break;
case TOP_BLUR:
activeElement$1 = null;
activeElementInst$1 = null;
lastSelection = null;
break;
case TOP_MOUSE_DOWN:
mouseDown = true;
break;
case TOP_CONTEXT_MENU:
case TOP_MOUSE_UP:
case TOP_DRAG_END:
mouseDown = false;
return constructSelectEvent(nativeEvent, nativeEventTarget);
case TOP_SELECTION_CHANGE:
if (skipSelectionChangeEvent) {
break;
}
case TOP_KEY_DOWN:
case TOP_KEY_UP:
return constructSelectEvent(nativeEvent, nativeEventTarget);
}
return null;
}
};
var SyntheticAnimationEvent = SyntheticEvent.extend({
animationName: null,
elapsedTime: null,
pseudoElement: null
});
var SyntheticClipboardEvent = SyntheticEvent.extend({
clipboardData: function(event) {
return "clipboardData" in event ? event.clipboardData : window.clipboardData;
}
});
var SyntheticFocusEvent = SyntheticUIEvent.extend({
relatedTarget: null
});
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;
}
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 SyntheticKeyboardEvent = SyntheticUIEvent.extend({
key: getEventKey,
location: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
repeat: null,
locale: null,
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 SyntheticDragEvent = SyntheticMouseEvent.extend({
dataTransfer: null
});
var SyntheticTouchEvent = SyntheticUIEvent.extend({
touches: null,
targetTouches: null,
changedTouches: null,
altKey: null,
metaKey: null,
ctrlKey: null,
shiftKey: null,
getModifierState: getEventModifierState
});
var SyntheticTransitionEvent = SyntheticEvent.extend({
propertyName: null,
elapsedTime: null,
pseudoElement: null
});
var SyntheticWheelEvent = SyntheticMouseEvent.extend({
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: null,
deltaMode: null
});
var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
var SimpleEventPlugin = {
eventTypes: simpleEventPluginEventTypes,
extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case TOP_KEY_PRESS:
if (getEventCharCode(nativeEvent) === 0) {
return null;
}
case TOP_KEY_DOWN:
case TOP_KEY_UP:
EventConstructor = SyntheticKeyboardEvent;
break;
case TOP_BLUR:
case TOP_FOCUS:
EventConstructor = SyntheticFocusEvent;
break;
case TOP_CLICK:
if (nativeEvent.button === 2) {
return null;
}
case TOP_AUX_CLICK:
case TOP_DOUBLE_CLICK:
case TOP_MOUSE_DOWN:
case TOP_MOUSE_MOVE:
case TOP_MOUSE_UP:
case TOP_MOUSE_OUT:
case TOP_MOUSE_OVER:
case TOP_CONTEXT_MENU:
EventConstructor = SyntheticMouseEvent;
break;
case TOP_DRAG:
case TOP_DRAG_END:
case TOP_DRAG_ENTER:
case TOP_DRAG_EXIT:
case TOP_DRAG_LEAVE:
case TOP_DRAG_OVER:
case TOP_DRAG_START:
case TOP_DROP:
EventConstructor = SyntheticDragEvent;
break;
case TOP_TOUCH_CANCEL:
case TOP_TOUCH_END:
case TOP_TOUCH_MOVE:
case TOP_TOUCH_START:
EventConstructor = SyntheticTouchEvent;
break;
case TOP_ANIMATION_END:
case TOP_ANIMATION_ITERATION:
case TOP_ANIMATION_START:
EventConstructor = SyntheticAnimationEvent;
break;
case TOP_TRANSITION_END:
EventConstructor = SyntheticTransitionEvent;
break;
case TOP_SCROLL:
EventConstructor = SyntheticUIEvent;
break;
case TOP_WHEEL:
EventConstructor = SyntheticWheelEvent;
break;
case TOP_COPY:
case TOP_CUT:
case TOP_PASTE:
EventConstructor = SyntheticClipboardEvent;
break;
case TOP_GOT_POINTER_CAPTURE:
case TOP_LOST_POINTER_CAPTURE:
case TOP_POINTER_CANCEL:
case TOP_POINTER_DOWN:
case TOP_POINTER_MOVE:
case TOP_POINTER_OUT:
case TOP_POINTER_OVER:
case TOP_POINTER_UP:
EventConstructor = SyntheticPointerEvent;
break;
default:
{
if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
error("SimpleEventPlugin: Unhandled event type, `%s`. This warning is likely caused by a bug in React. Please file an issue.", topLevelType);
}
}
EventConstructor = SyntheticEvent;
break;
}
var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
accumulateTwoPhaseDispatches(event);
return event;
}
};
var DOMEventPluginOrder = ["ResponderEventPlugin", "SimpleEventPlugin", "EnterLeaveEventPlugin", "ChangeEventPlugin", "SelectEventPlugin", "BeforeInputEventPlugin"];
injectEventPluginOrder(DOMEventPluginOrder);
setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
injectEventPluginsByName({
SimpleEventPlugin,
EnterLeaveEventPlugin,
ChangeEventPlugin,
SelectEventPlugin,
BeforeInputEventPlugin
});
var reactEmoji = "\u269B";
var warningEmoji = "\u26D4";
var supportsUserTiming = typeof performance !== "undefined" && typeof performance.mark === "function" && typeof performance.clearMarks === "function" && typeof performance.measure === "function" && typeof performance.clearMeasures === "function";
var currentFiber = null;
var currentPhase = null;
var currentPhaseFiber = null;
var isCommitting = false;
var hasScheduledUpdateInCurrentCommit = false;
var hasScheduledUpdateInCurrentPhase = false;
var commitCountInCurrentWorkLoop = 0;
var effectCountInCurrentCommit = 0;
var labelsInCurrentCommit = new Set();
var formatMarkName = function(markName) {
return reactEmoji + " " + markName;
};
var formatLabel = function(label, warning) {
var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
var suffix = warning ? " Warning: " + warning : "";
return "" + prefix + label + suffix;
};
var beginMark = function(markName) {
performance.mark(formatMarkName(markName));
};
var clearMark = function(markName) {
performance.clearMarks(formatMarkName(markName));
};
var endMark = function(label, markName, warning) {
var formattedMarkName = formatMarkName(markName);
var formattedLabel = formatLabel(label, warning);
try {
performance.measure(formattedLabel, formattedMarkName);
} catch (err) {
}
performance.clearMarks(formattedMarkName);
performance.clearMeasures(formattedLabel);
};
var getFiberMarkName = function(label, debugID) {
return label + " (#" + debugID + ")";
};
var getFiberLabel = function(componentName, isMounted2, phase) {
if (phase === null) {
return componentName + " [" + (isMounted2 ? "update" : "mount") + "]";
} else {
return componentName + "." + phase;
}
};
var beginFiberMark = function(fiber, phase) {
var componentName = getComponentName(fiber.type) || "Unknown";
var debugID = fiber._debugID;
var isMounted2 = fiber.alternate !== null;
var label = getFiberLabel(componentName, isMounted2, phase);
if (isCommitting && labelsInCurrentCommit.has(label)) {
return false;
}
labelsInCurrentCommit.add(label);
var markName = getFiberMarkName(label, debugID);
beginMark(markName);
return true;
};
var clearFiberMark = function(fiber, phase) {
var componentName = getComponentName(fiber.type) || "Unknown";
var debugID = fiber._debugID;
var isMounted2 = fiber.alternate !== null;
var label = getFiberLabel(componentName, isMounted2, phase);
var markName = getFiberMarkName(label, debugID);
clearMark(markName);
};
var endFiberMark = function(fiber, phase, warning) {
var componentName = getComponentName(fiber.type) || "Unknown";
var debugID = fiber._debugID;
var isMounted2 = fiber.alternate !== null;
var label = getFiberLabel(componentName, isMounted2, phase);
var markName = getFiberMarkName(label, debugID);
endMark(label, markName, warning);
};
var shouldIgnoreFiber = function(fiber) {
switch (fiber.tag) {
case HostRoot:
case HostComponent:
case HostText:
case HostPortal:
case Fragment2:
case ContextProvider:
case ContextConsumer:
case Mode:
return true;
default:
return false;
}
};
var clearPendingPhaseMeasurement = function() {
if (currentPhase !== null && currentPhaseFiber !== null) {
clearFiberMark(currentPhaseFiber, currentPhase);
}
currentPhaseFiber = null;
currentPhase = null;
hasScheduledUpdateInCurrentPhase = false;
};
var pauseTimers = function() {
var fiber = currentFiber;
while (fiber) {
if (fiber._debugIsCurrentlyTiming) {
endFiberMark(fiber, null, null);
}
fiber = fiber.return;
}
};
var resumeTimersRecursively = function(fiber) {
if (fiber.return !== null) {
resumeTimersRecursively(fiber.return);
}
if (fiber._debugIsCurrentlyTiming) {
beginFiberMark(fiber, null);
}
};
var resumeTimers = function() {
if (currentFiber !== null) {
resumeTimersRecursively(currentFiber);
}
};
function recordEffect() {
{
effectCountInCurrentCommit++;
}
}
function recordScheduleUpdate() {
{
if (isCommitting) {
hasScheduledUpdateInCurrentCommit = true;
}
if (currentPhase !== null && currentPhase !== "componentWillMount" && currentPhase !== "componentWillReceiveProps") {
hasScheduledUpdateInCurrentPhase = true;
}
}
}
function startWorkTimer(fiber) {
{
if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
return;
}
currentFiber = fiber;
if (!beginFiberMark(fiber, null)) {
return;
}
fiber._debugIsCurrentlyTiming = true;
}
}
function cancelWorkTimer(fiber) {
{
if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
return;
}
fiber._debugIsCurrentlyTiming = false;
clearFiberMark(fiber, null);
}
}
function stopWorkTimer(fiber) {
{
if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
return;
}
currentFiber = fiber.return;
if (!fiber._debugIsCurrentlyTiming) {
return;
}
fiber._debugIsCurrentlyTiming = false;
endFiberMark(fiber, null, null);
}
}
function stopFailedWorkTimer(fiber) {
{
if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
return;
}
currentFiber = fiber.return;
if (!fiber._debugIsCurrentlyTiming) {
return;
}
fiber._debugIsCurrentlyTiming = false;
var warning = fiber.tag === SuspenseComponent ? "Rendering was suspended" : "An error was thrown inside this error boundary";
endFiberMark(fiber, null, warning);
}
}
function startPhaseTimer(fiber, phase) {
{
if (!supportsUserTiming) {
return;
}
clearPendingPhaseMeasurement();
if (!beginFiberMark(fiber, phase)) {
return;
}
currentPhaseFiber = fiber;
currentPhase = phase;
}
}
function stopPhaseTimer() {
{
if (!supportsUserTiming) {
return;
}
if (currentPhase !== null && currentPhaseFiber !== null) {
var warning = hasScheduledUpdateInCurrentPhase ? "Scheduled a cascading update" : null;
endFiberMark(currentPhaseFiber, currentPhase, warning);
}
currentPhase = null;
currentPhaseFiber = null;
}
}
function startWorkLoopTimer(nextUnitOfWork) {
{
currentFiber = nextUnitOfWork;
if (!supportsUserTiming) {
return;
}
commitCountInCurrentWorkLoop = 0;
beginMark("(React Tree Reconciliation)");
resumeTimers();
}
}
function stopWorkLoopTimer(interruptedBy2, didCompleteRoot) {
{
if (!supportsUserTiming) {
return;
}
var warning = null;
if (interruptedBy2 !== null) {
if (interruptedBy2.tag === HostRoot) {
warning = "A top-level update interrupted the previous render";
} else {
var componentName = getComponentName(interruptedBy2.type) || "Unknown";
warning = "An update to " + componentName + " interrupted the previous render";
}
} else if (commitCountInCurrentWorkLoop > 1) {
warning = "There were cascading updates";
}
commitCountInCurrentWorkLoop = 0;
var label = didCompleteRoot ? "(React Tree Reconciliation: Completed Root)" : "(React Tree Reconciliation: Yielded)";
pauseTimers();
endMark(label, "(React Tree Reconciliation)", warning);
}
}
function startCommitTimer() {
{
if (!supportsUserTiming) {
return;
}
isCommitting = true;
hasScheduledUpdateInCurrentCommit = false;
labelsInCurrentCommit.clear();
beginMark("(Committing Changes)");
}
}
function stopCommitTimer() {
{
if (!supportsUserTiming) {
return;
}
var warning = null;
if (hasScheduledUpdateInCurrentCommit) {
warning = "Lifecycle hook scheduled a cascading update";
} else if (commitCountInCurrentWorkLoop > 0) {
warning = "Caused by a cascading update in earlier commit";
}
hasScheduledUpdateInCurrentCommit = false;
commitCountInCurrentWorkLoop++;
isCommitting = false;
labelsInCurrentCommit.clear();
endMark("(Committing Changes)", "(Committing Changes)", warning);
}
}
function startCommitSnapshotEffectsTimer() {
{
if (!supportsUserTiming) {
return;
}
effectCountInCurrentCommit = 0;
beginMark("(Committing Snapshot Effects)");
}
}
function stopCommitSnapshotEffectsTimer() {
{
if (!supportsUserTiming) {
return;
}
var count = effectCountInCurrentCommit;
effectCountInCurrentCommit = 0;
endMark("(Committing Snapshot Effects: " + count + " Total)", "(Committing Snapshot Effects)", null);
}
}
function startCommitHostEffectsTimer() {
{
if (!supportsUserTiming) {
return;
}
effectCountInCurrentCommit = 0;
beginMark("(Committing Host Effects)");
}
}
function stopCommitHostEffectsTimer() {
{
if (!supportsUserTiming) {
return;
}
var count = effectCountInCurrentCommit;
effectCountInCurrentCommit = 0;
endMark("(Committing Host Effects: " + count + " Total)", "(Committing Host Effects)", null);
}
}
function startCommitLifeCyclesTimer() {
{
if (!supportsUserTiming) {
return;
}
effectCountInCurrentCommit = 0;
beginMark("(Calling Lifecycle Methods)");
}
}
function stopCommitLifeCyclesTimer() {
{
if (!supportsUserTiming) {
return;
}
var count = effectCountInCurrentCommit;
effectCountInCurrentCommit = 0;
endMark("(Calling Lifecycle Methods: " + count + " Total)", "(Calling Lifecycle Methods)", null);
}
}
var valueStack = [];
var fiberStack;
{
fiberStack = [];
}
var index2 = -1;
function createCursor(defaultValue) {
return {
current: defaultValue
};
}
function pop(cursor2, fiber) {
if (index2 < 0) {
{
error("Unexpected pop.");
}
return;
}
{
if (fiber !== fiberStack[index2]) {
error("Unexpected Fiber popped.");
}
}
cursor2.current = valueStack[index2];
valueStack[index2] = null;
{
fiberStack[index2] = null;
}
index2--;
}
function push(cursor2, value, fiber) {
index2++;
valueStack[index2] = cursor2.current;
{
fiberStack[index2] = fiber;
}
cursor2.current = value;
}
var warnedAboutMissingGetChildContext;
{
warnedAboutMissingGetChildContext = {};
}
var emptyContextObject = {};
{
Object.freeze(emptyContextObject);
}
var contextStackCursor = createCursor(emptyContextObject);
var didPerformWorkStackCursor = createCursor(false);
var previousContext = emptyContextObject;
function getUnmaskedContext(workInProgress2, Component2, didPushOwnContextIfProvider) {
{
if (didPushOwnContextIfProvider && isContextProvider(Component2)) {
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 = getComponentName(type) || "Unknown";
checkPropTypes(contextTypes, context, "context", name, getCurrentFiberStackInDev);
}
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 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 = getComponentName(type) || "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;
startPhaseTimer(fiber, "getChildContext");
childContext = instance.getChildContext();
stopPhaseTimer();
for (var contextKey in childContext) {
if (!(contextKey in childContextTypes)) {
{
throw Error((getComponentName(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
}
}
}
{
var name = getComponentName(type) || "Unknown";
checkPropTypes(childContextTypes, childContext, "child context", name, getCurrentFiberStackInDev);
}
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 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 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 Component2 = node.type;
if (isContextProvider(Component2)) {
return node.stateNode.__reactInternalMemoizedMergedChildContext;
}
break;
}
}
node = node.return;
} while (node !== null);
{
{
throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
}
}
}
}
var LegacyRoot = 0;
var BlockingRoot = 1;
var ConcurrentRoot = 2;
var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority, Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback, Scheduler_cancelCallback = Scheduler.unstable_cancelCallback, Scheduler_shouldYield = Scheduler.unstable_shouldYield, Scheduler_requestPaint = Scheduler.unstable_requestPaint, Scheduler_now = Scheduler.unstable_now, Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority, Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, Scheduler_NormalPriority = Scheduler.unstable_NormalPriority, Scheduler_LowPriority = Scheduler.unstable_LowPriority, Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
{
if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
{
throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling");
}
}
}
var fakeCallbackNode = {};
var ImmediatePriority = 99;
var UserBlockingPriority$1 = 98;
var NormalPriority = 97;
var LowPriority = 96;
var IdlePriority = 95;
var NoPriority = 90;
var shouldYield = Scheduler_shouldYield;
var requestPaint = Scheduler_requestPaint !== void 0 ? Scheduler_requestPaint : function() {
};
var syncQueue = null;
var immediateQueueCallbackNode = null;
var isFlushingSyncQueue = false;
var initialTimeMs = Scheduler_now();
var now = initialTimeMs < 1e4 ? Scheduler_now : function() {
return Scheduler_now() - initialTimeMs;
};
function getCurrentPriorityLevel() {
switch (Scheduler_getCurrentPriorityLevel()) {
case Scheduler_ImmediatePriority:
return ImmediatePriority;
case Scheduler_UserBlockingPriority:
return UserBlockingPriority$1;
case Scheduler_NormalPriority:
return NormalPriority;
case Scheduler_LowPriority:
return LowPriority;
case Scheduler_IdlePriority:
return IdlePriority;
default: {
{
throw Error("Unknown priority level.");
}
}
}
}
function reactPriorityToSchedulerPriority(reactPriorityLevel) {
switch (reactPriorityLevel) {
case ImmediatePriority:
return Scheduler_ImmediatePriority;
case UserBlockingPriority$1:
return Scheduler_UserBlockingPriority;
case NormalPriority:
return Scheduler_NormalPriority;
case LowPriority:
return Scheduler_LowPriority;
case IdlePriority:
return Scheduler_IdlePriority;
default: {
{
throw Error("Unknown priority level.");
}
}
}
}
function runWithPriority$1(reactPriorityLevel, fn) {
var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
return Scheduler_runWithPriority(priorityLevel, fn);
}
function scheduleCallback(reactPriorityLevel, callback, options) {
var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
return Scheduler_scheduleCallback(priorityLevel, callback, options);
}
function scheduleSyncCallback(callback) {
if (syncQueue === null) {
syncQueue = [callback];
immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
} else {
syncQueue.push(callback);
}
return fakeCallbackNode;
}
function cancelCallback(callbackNode) {
if (callbackNode !== fakeCallbackNode) {
Scheduler_cancelCallback(callbackNode);
}
}
function flushSyncCallbackQueue() {
if (immediateQueueCallbackNode !== null) {
var node = immediateQueueCallbackNode;
immediateQueueCallbackNode = null;
Scheduler_cancelCallback(node);
}
flushSyncCallbackQueueImpl();
}
function flushSyncCallbackQueueImpl() {
if (!isFlushingSyncQueue && syncQueue !== null) {
isFlushingSyncQueue = true;
var i = 0;
try {
var _isSync = true;
var queue = syncQueue;
runWithPriority$1(ImmediatePriority, function() {
for (; i < queue.length; i++) {
var callback = queue[i];
do {
callback = callback(_isSync);
} while (callback !== null);
}
});
syncQueue = null;
} catch (error2) {
if (syncQueue !== null) {
syncQueue = syncQueue.slice(i + 1);
}
Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
throw error2;
} finally {
isFlushingSyncQueue = false;
}
}
}
var NoMode = 0;
var StrictMode = 1;
var BlockingMode = 2;
var ConcurrentMode = 4;
var ProfileMode = 8;
var MAX_SIGNED_31_BIT_INT = 1073741823;
var NoWork = 0;
var Never = 1;
var Idle = 2;
var ContinuousHydration = 3;
var Sync = MAX_SIGNED_31_BIT_INT;
var Batched = Sync - 1;
var UNIT_SIZE = 10;
var MAGIC_NUMBER_OFFSET = Batched - 1;
function msToExpirationTime(ms) {
return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
}
function expirationTimeToMs(expirationTime) {
return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
}
function ceiling(num, precision) {
return ((num / precision | 0) + 1) * precision;
}
function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
}
var LOW_PRIORITY_EXPIRATION = 5e3;
var LOW_PRIORITY_BATCH_SIZE = 250;
function computeAsyncExpiration(currentTime) {
return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
}
function computeSuspenseExpiration(currentTime, timeoutMs) {
return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
}
var HIGH_PRIORITY_EXPIRATION = 500;
var HIGH_PRIORITY_BATCH_SIZE = 100;
function computeInteractiveExpiration(currentTime) {
return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
}
function inferPriorityFromExpirationTime(currentTime, expirationTime) {
if (expirationTime === Sync) {
return ImmediatePriority;
}
if (expirationTime === Never || expirationTime === Idle) {
return IdlePriority;
}
var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
if (msUntil <= 0) {
return ImmediatePriority;
}
if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
return UserBlockingPriority$1;
}
if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
return NormalPriority;
}
return IdlePriority;
}
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 & StrictMode) {
maybeStrictRoot = node;
}
node = node.return;
}
return maybeStrictRoot;
};
var setToSortedString = function(set3) {
var array = [];
set3.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 = 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 & StrictMode && typeof instance.UNSAFE_componentWillMount === "function") {
pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
}
if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
pendingComponentWillReceivePropsWarnings.push(fiber);
}
if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
}
if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
pendingComponentWillUpdateWarnings.push(fiber);
}
if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
}
};
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
var componentWillMountUniqueNames = new Set();
if (pendingComponentWillMountWarnings.length > 0) {
pendingComponentWillMountWarnings.forEach(function(fiber) {
componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutUnsafeLifecycles.add(fiber.type);
});
pendingComponentWillMountWarnings = [];
}
var UNSAFE_componentWillMountUniqueNames = new Set();
if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutUnsafeLifecycles.add(fiber.type);
});
pendingUNSAFE_ComponentWillMountWarnings = [];
}
var componentWillReceivePropsUniqueNames = new Set();
if (pendingComponentWillReceivePropsWarnings.length > 0) {
pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutUnsafeLifecycles.add(fiber.type);
});
pendingComponentWillReceivePropsWarnings = [];
}
var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutUnsafeLifecycles.add(fiber.type);
});
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
}
var componentWillUpdateUniqueNames = new Set();
if (pendingComponentWillUpdateWarnings.length > 0) {
pendingComponentWillUpdateWarnings.forEach(function(fiber) {
componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutUnsafeLifecycles.add(fiber.type);
});
pendingComponentWillUpdateWarnings = [];
}
var UNSAFE_componentWillUpdateUniqueNames = new Set();
if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "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://fb.me/react-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://fb.me/react-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://fb.me/react-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://fb.me/react-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://fb.me/react-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 17.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://fb.me/react-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://fb.me/react-derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.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://fb.me/react-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 17.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 = new Map();
var didWarnAboutLegacyContext = 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 = new Set();
fiberArray.forEach(function(fiber) {
uniqueNames.add(getComponentName(fiber.type) || "Component");
didWarnAboutLegacyContext.add(fiber.type);
});
var sortedNames = setToSortedString(uniqueNames);
var firstComponentStack = getStackByFiberInDevAndProd(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://fb.me/react-legacy-context%s", sortedNames, firstComponentStack);
});
};
ReactStrictModeWarnings.discardPendingWarnings = function() {
pendingComponentWillMountWarnings = [];
pendingUNSAFE_ComponentWillMountWarnings = [];
pendingComponentWillReceivePropsWarnings = [];
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
pendingComponentWillUpdateWarnings = [];
pendingUNSAFE_ComponentWillUpdateWarnings = [];
pendingLegacyContextWarning = new Map();
};
}
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 = 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();
syncUpdates(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) {
scheduleWork(fiber, Sync);
}
if (child !== null && !needsRemount) {
scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
}
if (sibling !== null) {
scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
}
}
}
var findHostInstancesForRefresh = function(root2, families) {
{
var hostInstances = 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;
}
function resolveDefaultProps(Component2, baseProps2) {
if (Component2 && Component2.defaultProps) {
var props2 = _assign({}, baseProps2);
var defaultProps = Component2.defaultProps;
for (var propName in defaultProps) {
if (props2[propName] === void 0) {
props2[propName] = defaultProps[propName];
}
}
return props2;
}
return baseProps2;
}
function readLazyComponentType(lazyComponent) {
initializeLazyComponentType(lazyComponent);
if (lazyComponent._status !== Resolved) {
throw lazyComponent._result;
}
return lazyComponent._result;
}
var valueCursor = createCursor(null);
var rendererSigil;
{
rendererSigil = {};
}
var currentlyRenderingFiber = null;
var lastContextDependency = null;
var lastContextWithAllBitsObserved = null;
var isDisallowedContextReadInDEV = false;
function resetContextDependencies() {
currentlyRenderingFiber = null;
lastContextDependency = null;
lastContextWithAllBitsObserved = null;
{
isDisallowedContextReadInDEV = false;
}
}
function enterDisallowedContextReadInDEV() {
{
isDisallowedContextReadInDEV = true;
}
}
function exitDisallowedContextReadInDEV() {
{
isDisallowedContextReadInDEV = false;
}
}
function pushProvider(providerFiber, nextValue) {
var context = providerFiber.type._context;
{
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(providerFiber) {
var currentValue = valueCursor.current;
pop(valueCursor, providerFiber);
var context = providerFiber.type._context;
{
context._currentValue = currentValue;
}
}
function calculateChangedBits(context, newValue, oldValue) {
if (objectIs(oldValue, newValue)) {
return 0;
} else {
var changedBits = typeof context._calculateChangedBits === "function" ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
{
if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
error("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", changedBits);
}
}
return changedBits | 0;
}
}
function scheduleWorkOnParentPath(parent2, renderExpirationTime2) {
var node = parent2;
while (node !== null) {
var alternate = node.alternate;
if (node.childExpirationTime < renderExpirationTime2) {
node.childExpirationTime = renderExpirationTime2;
if (alternate !== null && alternate.childExpirationTime < renderExpirationTime2) {
alternate.childExpirationTime = renderExpirationTime2;
}
} else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime2) {
alternate.childExpirationTime = renderExpirationTime2;
} else {
break;
}
node = node.return;
}
}
function propagateContextChange(workInProgress2, context, changedBits, renderExpirationTime2) {
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 && (dependency.observedBits & changedBits) !== 0) {
if (fiber.tag === ClassComponent) {
var update = createUpdate(renderExpirationTime2, null);
update.tag = ForceUpdate;
enqueueUpdate(fiber, update);
}
if (fiber.expirationTime < renderExpirationTime2) {
fiber.expirationTime = renderExpirationTime2;
}
var alternate = fiber.alternate;
if (alternate !== null && alternate.expirationTime < renderExpirationTime2) {
alternate.expirationTime = renderExpirationTime2;
}
scheduleWorkOnParentPath(fiber.return, renderExpirationTime2);
if (list.expirationTime < renderExpirationTime2) {
list.expirationTime = renderExpirationTime2;
}
break;
}
dependency = dependency.next;
}
} else if (fiber.tag === ContextProvider) {
nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
} 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, renderExpirationTime2) {
currentlyRenderingFiber = workInProgress2;
lastContextDependency = null;
lastContextWithAllBitsObserved = null;
var dependencies = workInProgress2.dependencies;
if (dependencies !== null) {
var firstContext = dependencies.firstContext;
if (firstContext !== null) {
if (dependencies.expirationTime >= renderExpirationTime2) {
markWorkInProgressReceivedUpdate();
}
dependencies.firstContext = null;
}
}
}
function readContext(context, observedBits) {
{
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().");
}
}
if (lastContextWithAllBitsObserved === context)
;
else if (observedBits === false || observedBits === 0)
;
else {
var resolvedObservedBits;
if (typeof observedBits !== "number" || observedBits === MAX_SIGNED_31_BIT_INT) {
lastContextWithAllBitsObserved = context;
resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
} else {
resolvedObservedBits = observedBits;
}
var contextItem = {
context,
observedBits: resolvedObservedBits,
next: null
};
if (lastContextDependency === null) {
if (!(currentlyRenderingFiber !== null)) {
{
throw 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 = {
expirationTime: NoWork,
firstContext: contextItem,
responders: null
};
} else {
lastContextDependency = lastContextDependency.next = contextItem;
}
}
return context._currentValue;
}
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,
baseQueue: null,
shared: {
pending: null
},
effects: null
};
fiber.updateQueue = queue;
}
function cloneUpdateQueue(current2, workInProgress2) {
var queue = workInProgress2.updateQueue;
var currentQueue = current2.updateQueue;
if (queue === currentQueue) {
var clone = {
baseState: currentQueue.baseState,
baseQueue: currentQueue.baseQueue,
shared: currentQueue.shared,
effects: currentQueue.effects
};
workInProgress2.updateQueue = clone;
}
}
function createUpdate(expirationTime, suspenseConfig) {
var update = {
expirationTime,
suspenseConfig,
tag: UpdateState,
payload: null,
callback: null,
next: null
};
update.next = update;
{
update.priority = getCurrentPriorityLevel();
}
return update;
}
function enqueueUpdate(fiber, update) {
var updateQueue = fiber.updateQueue;
if (updateQueue === null) {
return;
}
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;
{
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;
}
}
}
function enqueueCapturedUpdate(workInProgress2, update) {
var current2 = workInProgress2.alternate;
if (current2 !== null) {
cloneUpdateQueue(current2, workInProgress2);
}
var queue = workInProgress2.updateQueue;
var last2 = queue.baseQueue;
if (last2 === null) {
queue.baseQueue = update.next = update;
update.next = update;
} else {
update.next = last2.next;
last2.next = update;
}
}
function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
switch (update.tag) {
case ReplaceState: {
var payload = update.payload;
if (typeof payload === "function") {
{
enterDisallowedContextReadInDEV();
if (workInProgress2.mode & StrictMode) {
payload.call(instance, prevState, nextProps);
}
}
var nextState = payload.call(instance, prevState, nextProps);
{
exitDisallowedContextReadInDEV();
}
return nextState;
}
return payload;
}
case CaptureUpdate: {
workInProgress2.effectTag = workInProgress2.effectTag & ~ShouldCapture | DidCapture;
}
case UpdateState: {
var _payload = update.payload;
var partialState;
if (typeof _payload === "function") {
{
enterDisallowedContextReadInDEV();
if (workInProgress2.mode & StrictMode) {
_payload.call(instance, prevState, nextProps);
}
}
partialState = _payload.call(instance, prevState, nextProps);
{
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, props2, instance, renderExpirationTime2) {
var queue = workInProgress2.updateQueue;
hasForceUpdate = false;
{
currentlyProcessingQueue = queue.shared;
}
var baseQueue = queue.baseQueue;
var pendingQueue = queue.shared.pending;
if (pendingQueue !== null) {
if (baseQueue !== null) {
var baseFirst = baseQueue.next;
var pendingFirst = pendingQueue.next;
baseQueue.next = pendingFirst;
pendingQueue.next = baseFirst;
}
baseQueue = pendingQueue;
queue.shared.pending = null;
var current2 = workInProgress2.alternate;
if (current2 !== null) {
var currentQueue = current2.updateQueue;
if (currentQueue !== null) {
currentQueue.baseQueue = pendingQueue;
}
}
}
if (baseQueue !== null) {
var first2 = baseQueue.next;
var newState = queue.baseState;
var newExpirationTime = NoWork;
var newBaseState = null;
var newBaseQueueFirst = null;
var newBaseQueueLast = null;
if (first2 !== null) {
var update = first2;
do {
var updateExpirationTime = update.expirationTime;
if (updateExpirationTime < renderExpirationTime2) {
var clone = {
expirationTime: update.expirationTime,
suspenseConfig: update.suspenseConfig,
tag: update.tag,
payload: update.payload,
callback: update.callback,
next: null
};
if (newBaseQueueLast === null) {
newBaseQueueFirst = newBaseQueueLast = clone;
newBaseState = newState;
} else {
newBaseQueueLast = newBaseQueueLast.next = clone;
}
if (updateExpirationTime > newExpirationTime) {
newExpirationTime = updateExpirationTime;
}
} else {
if (newBaseQueueLast !== null) {
var _clone = {
expirationTime: Sync,
suspenseConfig: update.suspenseConfig,
tag: update.tag,
payload: update.payload,
callback: update.callback,
next: null
};
newBaseQueueLast = newBaseQueueLast.next = _clone;
}
markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);
newState = getStateFromUpdate(workInProgress2, queue, update, newState, props2, instance);
var callback = update.callback;
if (callback !== null) {
workInProgress2.effectTag |= Callback;
var effects = queue.effects;
if (effects === null) {
queue.effects = [update];
} else {
effects.push(update);
}
}
}
update = update.next;
if (update === null || update === first2) {
pendingQueue = queue.shared.pending;
if (pendingQueue === null) {
break;
} else {
update = baseQueue.next = pendingQueue.next;
pendingQueue.next = first2;
queue.baseQueue = baseQueue = pendingQueue;
queue.shared.pending = null;
}
}
} while (true);
}
if (newBaseQueueLast === null) {
newBaseState = newState;
} else {
newBaseQueueLast.next = newBaseQueueFirst;
}
queue.baseState = newBaseState;
queue.baseQueue = newBaseQueueLast;
markUnprocessedUpdateTime(newExpirationTime);
workInProgress2.expirationTime = newExpirationTime;
workInProgress2.memoizedState = newState;
}
{
currentlyProcessingQueue = null;
}
}
function callCallback(callback, context) {
if (!(typeof callback === "function")) {
{
throw 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 i = 0; i < effects.length; i++) {
var effect = effects[i];
var callback = effect.callback;
if (callback !== null) {
effect.callback = null;
callCallback(callback, instance);
}
}
}
}
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
function requestCurrentSuspenseConfig() {
return ReactCurrentBatchConfig.suspense;
}
var fakeInternalInstance = {};
var isArray2 = Array.isArray;
var emptyRefsObject = new React13.Component().refs;
var didWarnAboutStateAssignmentForComponent;
var didWarnAboutUninitializedState;
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
var didWarnAboutLegacyLifecyclesAndDerivedState;
var didWarnAboutUndefinedDerivedState;
var warnOnUndefinedDerivedState;
var warnOnInvalidCallback;
var didWarnAboutDirectlyAssigningPropsToState;
var didWarnAboutContextTypeAndContextTypes;
var didWarnAboutInvalidateContextType;
{
didWarnAboutStateAssignmentForComponent = new Set();
didWarnAboutUninitializedState = new Set();
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
didWarnAboutDirectlyAssigningPropsToState = new Set();
didWarnAboutUndefinedDerivedState = new Set();
didWarnAboutContextTypeAndContextTypes = new Set();
didWarnAboutInvalidateContextType = new Set();
var didWarnOnInvalidCallback = 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 = getComponentName(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 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;
{
if (workInProgress2.mode & StrictMode) {
getDerivedStateFromProps(nextProps, prevState);
}
}
var partialState = getDerivedStateFromProps(nextProps, prevState);
{
warnOnUndefinedDerivedState(ctor, partialState);
}
var memoizedState = partialState === null || partialState === void 0 ? prevState : _assign({}, prevState, partialState);
workInProgress2.memoizedState = memoizedState;
if (workInProgress2.expirationTime === NoWork) {
var updateQueue = workInProgress2.updateQueue;
updateQueue.baseState = memoizedState;
}
}
var classComponentUpdater = {
isMounted,
enqueueSetState: function(inst, payload, callback) {
var fiber = get8(inst);
var currentTime = requestCurrentTimeForUpdate();
var suspenseConfig = requestCurrentSuspenseConfig();
var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
var update = createUpdate(expirationTime, suspenseConfig);
update.payload = payload;
if (callback !== void 0 && callback !== null) {
{
warnOnInvalidCallback(callback, "setState");
}
update.callback = callback;
}
enqueueUpdate(fiber, update);
scheduleWork(fiber, expirationTime);
},
enqueueReplaceState: function(inst, payload, callback) {
var fiber = get8(inst);
var currentTime = requestCurrentTimeForUpdate();
var suspenseConfig = requestCurrentSuspenseConfig();
var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
var update = createUpdate(expirationTime, suspenseConfig);
update.tag = ReplaceState;
update.payload = payload;
if (callback !== void 0 && callback !== null) {
{
warnOnInvalidCallback(callback, "replaceState");
}
update.callback = callback;
}
enqueueUpdate(fiber, update);
scheduleWork(fiber, expirationTime);
},
enqueueForceUpdate: function(inst, callback) {
var fiber = get8(inst);
var currentTime = requestCurrentTimeForUpdate();
var suspenseConfig = requestCurrentSuspenseConfig();
var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
var update = createUpdate(expirationTime, suspenseConfig);
update.tag = ForceUpdate;
if (callback !== void 0 && callback !== null) {
{
warnOnInvalidCallback(callback, "forceUpdate");
}
update.callback = callback;
}
enqueueUpdate(fiber, update);
scheduleWork(fiber, expirationTime);
}
};
function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
var instance = workInProgress2.stateNode;
if (typeof instance.shouldComponentUpdate === "function") {
{
if (workInProgress2.mode & StrictMode) {
instance.shouldComponentUpdate(newProps, newState, nextContext);
}
}
startPhaseTimer(workInProgress2, "shouldComponentUpdate");
var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
stopPhaseTimer();
{
if (shouldUpdate === void 0) {
error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentName(ctor) || "Component");
}
}
return shouldUpdate;
}
if (ctor.prototype && ctor.prototype.isPureReactComponent) {
return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
}
return true;
}
function checkClassInstance(workInProgress2, ctor, newProps) {
var instance = workInProgress2.stateNode;
{
var name = getComponentName(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.", getComponentName(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.", getComponentName(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" || isArray2(_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;
set2(instance, workInProgress2);
{
instance._reactInternalInstance = fakeInternalInstance;
}
}
function constructClassInstance(workInProgress2, ctor, props2) {
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", getComponentName(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;
}
{
if (workInProgress2.mode & StrictMode) {
new ctor(props2, context);
}
}
var instance = new ctor(props2, context);
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 = getComponentName(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 = getComponentName(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://fb.me/react-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) {
startPhaseTimer(workInProgress2, "componentWillMount");
var oldState = instance.state;
if (typeof instance.componentWillMount === "function") {
instance.componentWillMount();
}
if (typeof instance.UNSAFE_componentWillMount === "function") {
instance.UNSAFE_componentWillMount();
}
stopPhaseTimer();
if (oldState !== instance.state) {
{
error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentName(workInProgress2.type) || "Component");
}
classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
}
}
function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
var oldState = instance.state;
startPhaseTimer(workInProgress2, "componentWillReceiveProps");
if (typeof instance.componentWillReceiveProps === "function") {
instance.componentWillReceiveProps(newProps, nextContext);
}
if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
}
stopPhaseTimer();
if (instance.state !== oldState) {
{
var componentName = getComponentName(workInProgress2.type) || "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, renderExpirationTime2) {
{
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 = getComponentName(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 & StrictMode) {
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
}
{
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
}
}
processUpdateQueue(workInProgress2, newProps, instance, renderExpirationTime2);
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, renderExpirationTime2);
instance.state = workInProgress2.memoizedState;
}
if (typeof instance.componentDidMount === "function") {
workInProgress2.effectTag |= Update;
}
}
function resumeMountClassInstance(workInProgress2, ctor, newProps, renderExpirationTime2) {
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, renderExpirationTime2);
newState = workInProgress2.memoizedState;
if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
if (typeof instance.componentDidMount === "function") {
workInProgress2.effectTag |= Update;
}
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")) {
startPhaseTimer(workInProgress2, "componentWillMount");
if (typeof instance.componentWillMount === "function") {
instance.componentWillMount();
}
if (typeof instance.UNSAFE_componentWillMount === "function") {
instance.UNSAFE_componentWillMount();
}
stopPhaseTimer();
}
if (typeof instance.componentDidMount === "function") {
workInProgress2.effectTag |= Update;
}
} else {
if (typeof instance.componentDidMount === "function") {
workInProgress2.effectTag |= Update;
}
workInProgress2.memoizedProps = newProps;
workInProgress2.memoizedState = newState;
}
instance.props = newProps;
instance.state = newState;
instance.context = nextContext;
return shouldUpdate;
}
function updateClassInstance(current2, workInProgress2, ctor, newProps, renderExpirationTime2) {
var instance = workInProgress2.stateNode;
cloneUpdateQueue(current2, workInProgress2);
var oldProps = workInProgress2.memoizedProps;
instance.props = workInProgress2.type === workInProgress2.elementType ? oldProps : resolveDefaultProps(workInProgress2.type, oldProps);
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 (oldProps !== newProps || oldContext !== nextContext) {
callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
}
}
resetHasForceUpdateBeforeProcessing();
var oldState = workInProgress2.memoizedState;
var newState = instance.state = oldState;
processUpdateQueue(workInProgress2, newProps, instance, renderExpirationTime2);
newState = workInProgress2.memoizedState;
if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
if (typeof instance.componentDidUpdate === "function") {
if (oldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
workInProgress2.effectTag |= Update;
}
}
if (typeof instance.getSnapshotBeforeUpdate === "function") {
if (oldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
workInProgress2.effectTag |= 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);
if (shouldUpdate) {
if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
startPhaseTimer(workInProgress2, "componentWillUpdate");
if (typeof instance.componentWillUpdate === "function") {
instance.componentWillUpdate(newProps, newState, nextContext);
}
if (typeof instance.UNSAFE_componentWillUpdate === "function") {
instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
}
stopPhaseTimer();
}
if (typeof instance.componentDidUpdate === "function") {
workInProgress2.effectTag |= Update;
}
if (typeof instance.getSnapshotBeforeUpdate === "function") {
workInProgress2.effectTag |= Snapshot;
}
} else {
if (typeof instance.componentDidUpdate === "function") {
if (oldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
workInProgress2.effectTag |= Update;
}
}
if (typeof instance.getSnapshotBeforeUpdate === "function") {
if (oldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
workInProgress2.effectTag |= 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) {
};
{
didWarnAboutMaps = false;
didWarnAboutGenerators = false;
didWarnAboutStringRefs = {};
ownerHasKeyUseWarning = {};
ownerHasFunctionTypeWarning = {};
warnForMissingKey = function(child) {
if (child === null || typeof child !== "object") {
return;
}
if (!child._store || child._store.validated || child.key != null) {
return;
}
if (!(typeof child._store === "object")) {
{
throw 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 currentComponentErrorInfo = 'Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.' + getCurrentFiberStackInDev();
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
return;
}
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
error('Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.');
};
}
var isArray$1 = Array.isArray;
function coerceRef(returnFiber, current2, element) {
var mixedRef = element.ref;
if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
{
if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self)) {
var componentName = getComponentName(returnFiber.type) || "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://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
}
didWarnAboutStringRefs[componentName] = true;
}
}
}
if (element._owner) {
var owner = element._owner;
var inst;
if (owner) {
var ownerFiber = owner;
if (!(ownerFiber.tag === ClassComponent)) {
{
throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref");
}
}
inst = ownerFiber.stateNode;
}
if (!inst) {
{
throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
}
}
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 = inst.refs;
if (refs === emptyRefsObject) {
refs = inst.refs = {};
}
if (value === null) {
delete refs[stringRef];
} else {
refs[stringRef] = value;
}
};
ref._stringRef = stringRef;
return ref;
} else {
if (!(typeof mixedRef === "string")) {
{
throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
}
}
if (!element._owner) {
{
throw 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://fb.me/react-refs-must-have-owner for more information.");
}
}
}
}
return mixedRef;
}
function throwOnInvalidObjectType(returnFiber, newChild) {
if (returnFiber.type !== "textarea") {
var addendum = "";
{
addendum = " If you meant to render a collection of children, use an array instead." + getCurrentFiberStackInDev();
}
{
{
throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild) + ")." + addendum);
}
}
}
}
function warnOnFunctionType() {
{
var currentComponentErrorInfo = "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." + getCurrentFiberStackInDev();
if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
return;
}
ownerHasFunctionTypeWarning[currentComponentErrorInfo] = 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 ChildReconciler(shouldTrackSideEffects) {
function deleteChild(returnFiber, childToDelete) {
if (!shouldTrackSideEffects) {
return;
}
var last2 = returnFiber.lastEffect;
if (last2 !== null) {
last2.nextEffect = childToDelete;
returnFiber.lastEffect = childToDelete;
} else {
returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
}
childToDelete.nextEffect = null;
childToDelete.effectTag = Deletion;
}
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 = new Map();
var existingChild = currentFirstChild;
while (existingChild !== null) {
if (existingChild.key !== null) {
existingChildren.set(existingChild.key, existingChild);
} else {
existingChildren.set(existingChild.index, existingChild);
}
existingChild = existingChild.sibling;
}
return existingChildren;
}
function useFiber(fiber, pendingProps) {
var clone = createWorkInProgress(fiber, pendingProps);
clone.index = 0;
clone.sibling = null;
return clone;
}
function placeChild(newFiber, lastPlacedIndex, newIndex) {
newFiber.index = newIndex;
if (!shouldTrackSideEffects) {
return lastPlacedIndex;
}
var current2 = newFiber.alternate;
if (current2 !== null) {
var oldIndex = current2.index;
if (oldIndex < lastPlacedIndex) {
newFiber.effectTag = Placement;
return lastPlacedIndex;
} else {
return oldIndex;
}
} else {
newFiber.effectTag = Placement;
return lastPlacedIndex;
}
}
function placeSingleChild(newFiber) {
if (shouldTrackSideEffects && newFiber.alternate === null) {
newFiber.effectTag = Placement;
}
return newFiber;
}
function updateTextNode(returnFiber, current2, textContent, expirationTime) {
if (current2 === null || current2.tag !== HostText) {
var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
created.return = returnFiber;
return created;
} else {
var existing = useFiber(current2, textContent);
existing.return = returnFiber;
return existing;
}
}
function updateElement(returnFiber, current2, element, expirationTime) {
if (current2 !== null) {
if (current2.elementType === element.type || isCompatibleFamilyForHotReloading(current2, element)) {
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, expirationTime);
created.ref = coerceRef(returnFiber, current2, element);
created.return = returnFiber;
return created;
}
function updatePortal(returnFiber, current2, portal, expirationTime) {
if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
created.return = returnFiber;
return created;
} else {
var existing = useFiber(current2, portal.children || []);
existing.return = returnFiber;
return existing;
}
}
function updateFragment2(returnFiber, current2, fragment, expirationTime, key) {
if (current2 === null || current2.tag !== Fragment2) {
var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
created.return = returnFiber;
return created;
} else {
var existing = useFiber(current2, fragment);
existing.return = returnFiber;
return existing;
}
}
function createChild(returnFiber, newChild, expirationTime) {
if (typeof newChild === "string" || typeof newChild === "number") {
var created = createFiberFromText("" + newChild, returnFiber.mode, expirationTime);
created.return = returnFiber;
return created;
}
if (typeof newChild === "object" && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE: {
var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
_created.ref = coerceRef(returnFiber, null, newChild);
_created.return = returnFiber;
return _created;
}
case REACT_PORTAL_TYPE: {
var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
_created2.return = returnFiber;
return _created2;
}
}
if (isArray$1(newChild) || getIteratorFn(newChild)) {
var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
_created3.return = returnFiber;
return _created3;
}
throwOnInvalidObjectType(returnFiber, newChild);
}
{
if (typeof newChild === "function") {
warnOnFunctionType();
}
}
return null;
}
function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
var key = oldFiber !== null ? oldFiber.key : null;
if (typeof newChild === "string" || typeof newChild === "number") {
if (key !== null) {
return null;
}
return updateTextNode(returnFiber, oldFiber, "" + newChild, expirationTime);
}
if (typeof newChild === "object" && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE: {
if (newChild.key === key) {
if (newChild.type === REACT_FRAGMENT_TYPE) {
return updateFragment2(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
}
return updateElement(returnFiber, oldFiber, newChild, expirationTime);
} else {
return null;
}
}
case REACT_PORTAL_TYPE: {
if (newChild.key === key) {
return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
} else {
return null;
}
}
}
if (isArray$1(newChild) || getIteratorFn(newChild)) {
if (key !== null) {
return null;
}
return updateFragment2(returnFiber, oldFiber, newChild, expirationTime, null);
}
throwOnInvalidObjectType(returnFiber, newChild);
}
{
if (typeof newChild === "function") {
warnOnFunctionType();
}
}
return null;
}
function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
if (typeof newChild === "string" || typeof newChild === "number") {
var matchedFiber = existingChildren.get(newIdx) || null;
return updateTextNode(returnFiber, matchedFiber, "" + newChild, expirationTime);
}
if (typeof newChild === "object" && newChild !== null) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE: {
var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
if (newChild.type === REACT_FRAGMENT_TYPE) {
return updateFragment2(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
}
return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
}
case REACT_PORTAL_TYPE: {
var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
}
}
if (isArray$1(newChild) || getIteratorFn(newChild)) {
var _matchedFiber3 = existingChildren.get(newIdx) || null;
return updateFragment2(returnFiber, _matchedFiber3, newChild, expirationTime, null);
}
throwOnInvalidObjectType(returnFiber, newChild);
}
{
if (typeof newChild === "function") {
warnOnFunctionType();
}
}
return null;
}
function warnOnInvalidKey(child, knownKeys) {
{
if (typeof child !== "object" || child === null) {
return knownKeys;
}
switch (child.$$typeof) {
case REACT_ELEMENT_TYPE:
case REACT_PORTAL_TYPE:
warnForMissingKey(child);
var key = child.key;
if (typeof key !== "string") {
break;
}
if (knownKeys === null) {
knownKeys = 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;
}
}
return knownKeys;
}
function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
{
var knownKeys = null;
for (var i = 0; i < newChildren.length; i++) {
var child = newChildren[i];
knownKeys = warnOnInvalidKey(child, knownKeys);
}
}
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], expirationTime);
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);
return resultingFirstChild;
}
if (oldFiber === null) {
for (; newIdx < newChildren.length; newIdx++) {
var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
if (_newFiber === null) {
continue;
}
lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
resultingFirstChild = _newFiber;
} else {
previousNewFiber.sibling = _newFiber;
}
previousNewFiber = _newFiber;
}
return resultingFirstChild;
}
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
for (; newIdx < newChildren.length; newIdx++) {
var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
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);
});
}
return resultingFirstChild;
}
function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
var iteratorFn = getIteratorFn(newChildrenIterable);
if (!(typeof iteratorFn === "function")) {
{
throw 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 unsupported and will likely yield unexpected results. Convert it to a sequence/iterable 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);
}
}
}
var newChildren = iteratorFn.call(newChildrenIterable);
if (!(newChildren != null)) {
{
throw 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, expirationTime);
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);
return resultingFirstChild;
}
if (oldFiber === null) {
for (; !step.done; newIdx++, step = newChildren.next()) {
var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
if (_newFiber3 === null) {
continue;
}
lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
if (previousNewFiber === null) {
resultingFirstChild = _newFiber3;
} else {
previousNewFiber.sibling = _newFiber3;
}
previousNewFiber = _newFiber3;
}
return resultingFirstChild;
}
var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
for (; !step.done; newIdx++, step = newChildren.next()) {
var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
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);
});
}
return resultingFirstChild;
}
function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
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, expirationTime);
created.return = returnFiber;
return created;
}
function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
var key = element.key;
var child = currentFirstChild;
while (child !== null) {
if (child.key === key) {
switch (child.tag) {
case Fragment2: {
if (element.type === REACT_FRAGMENT_TYPE) {
deleteRemainingChildren(returnFiber, child.sibling);
var existing = useFiber(child, element.props.children);
existing.return = returnFiber;
{
existing._debugSource = element._source;
existing._debugOwner = element._owner;
}
return existing;
}
break;
}
case Block:
default: {
if (child.elementType === element.type || isCompatibleFamilyForHotReloading(child, element)) {
deleteRemainingChildren(returnFiber, child.sibling);
var _existing3 = useFiber(child, element.props);
_existing3.ref = coerceRef(returnFiber, child, element);
_existing3.return = returnFiber;
{
_existing3._debugSource = element._source;
_existing3._debugOwner = element._owner;
}
return _existing3;
}
break;
}
}
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, expirationTime, element.key);
created.return = returnFiber;
return created;
} else {
var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
_created4.ref = coerceRef(returnFiber, currentFirstChild, element);
_created4.return = returnFiber;
return _created4;
}
}
function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
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, expirationTime);
created.return = returnFiber;
return created;
}
function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, expirationTime) {
var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
if (isUnkeyedTopLevelFragment) {
newChild = newChild.props.children;
}
var isObject2 = typeof newChild === "object" && newChild !== null;
if (isObject2) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
case REACT_PORTAL_TYPE:
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
}
}
if (typeof newChild === "string" || typeof newChild === "number") {
return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, expirationTime));
}
if (isArray$1(newChild)) {
return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
}
if (getIteratorFn(newChild)) {
return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
}
if (isObject2) {
throwOnInvalidObjectType(returnFiber, newChild);
}
{
if (typeof newChild === "function") {
warnOnFunctionType();
}
}
if (typeof newChild === "undefined" && !isUnkeyedTopLevelFragment) {
switch (returnFiber.tag) {
case ClassComponent: {
{
var instance = returnFiber.stateNode;
if (instance.render._isMockFunction) {
break;
}
}
}
case FunctionComponent: {
var Component2 = returnFiber.type;
{
{
throw Error((Component2.displayName || Component2.name || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
}
}
}
}
}
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 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, renderExpirationTime2) {
var child = workInProgress2.child;
while (child !== null) {
resetWorkInProgress(child, renderExpirationTime2);
child = child.sibling;
}
}
var NO_CONTEXT = {};
var contextStackCursor$1 = createCursor(NO_CONTEXT);
var contextFiberStackCursor = createCursor(NO_CONTEXT);
var rootInstanceStackCursor = createCursor(NO_CONTEXT);
function requiredContext(c) {
if (!(c !== NO_CONTEXT)) {
{
throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
}
}
return c;
}
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 props2 = workInProgress2.memoizedProps;
if (props2.fallback === void 0) {
return false;
}
if (props2.unstable_avoidThisFallback !== true) {
return true;
}
if (hasInvisibleParent) {
return false;
}
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.effectTag & DidCapture) !== NoEffect;
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;
}
function createDeprecatedResponderListener(responder, props2) {
var eventResponderListener = {
responder,
props: props2
};
{
Object.freeze(eventResponderListener);
}
return eventResponderListener;
}
var HasEffect = 1;
var Layout = 2;
var Passive$1 = 4;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
var didWarnAboutMismatchedHooksForComponent;
{
didWarnAboutMismatchedHooksForComponent = new Set();
}
var renderExpirationTime = NoWork;
var currentlyRenderingFiber$1 = null;
var currentHook = null;
var workInProgressHook = null;
var didScheduleRenderPhaseUpdate = false;
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 && !Array.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 = getComponentName(currentlyRenderingFiber$1.type);
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
didWarnAboutMismatchedHooksForComponent.add(componentName);
if (hookTypesDev !== null) {
var table = "";
var secondColumnStart = 30;
for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
var oldHookName = hookTypesDev[i];
var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
var row = i + 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://fb.me/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
}
}
}
}
function throwInvalidHookError() {
{
{
throw 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://fb.me/react-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 i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
if (objectIs(nextDeps[i], prevDeps[i])) {
continue;
}
return false;
}
return true;
}
function renderWithHooks(current2, workInProgress2, Component2, props2, secondArg, nextRenderExpirationTime) {
renderExpirationTime = nextRenderExpirationTime;
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.expirationTime = NoWork;
{
if (current2 !== null && current2.memoizedState !== null) {
ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;
} else if (hookTypesDev !== null) {
ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;
} else {
ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;
}
}
var children = Component2(props2, secondArg);
if (workInProgress2.expirationTime === renderExpirationTime) {
var numberOfReRenders = 0;
do {
workInProgress2.expirationTime = NoWork;
if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
{
throw 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.current = HooksDispatcherOnRerenderInDEV;
children = Component2(props2, secondArg);
} while (workInProgress2.expirationTime === renderExpirationTime);
}
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
{
workInProgress2._debugHookTypes = hookTypesDev;
}
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
currentHook = null;
workInProgressHook = null;
{
currentHookNameInDev = null;
hookTypesDev = null;
hookTypesUpdateIndexDev = -1;
}
didScheduleRenderPhaseUpdate = false;
if (!!didRenderTooFewHooks) {
{
throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
}
}
return children;
}
function bailoutHooks(current2, workInProgress2, expirationTime) {
workInProgress2.updateQueue = current2.updateQueue;
workInProgress2.effectTag &= ~(Passive | Update);
if (current2.expirationTime <= expirationTime) {
current2.expirationTime = NoWork;
}
}
function resetHooksAfterThrow() {
ReactCurrentDispatcher.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;
}
}
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
currentHook = null;
workInProgressHook = null;
{
hookTypesDev = null;
hookTypesUpdateIndexDev = -1;
currentHookNameInDev = null;
}
didScheduleRenderPhaseUpdate = false;
}
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 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
};
}
function basicStateReducer(state, action) {
return typeof action === "function" ? action(state) : action;
}
function mountReducer(reducer2, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState2;
if (init !== void 0) {
initialState2 = init(initialArg);
} else {
initialState2 = initialArg;
}
hook.memoizedState = hook.baseState = initialState2;
var queue = hook.queue = {
pending: null,
dispatch: null,
lastRenderedReducer: reducer2,
lastRenderedState: initialState2
};
var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
return [hook.memoizedState, dispatch];
}
function updateReducer(reducer2, initialArg, init) {
var hook = updateWorkInProgressHook();
var queue = hook.queue;
if (!(queue !== null)) {
{
throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
}
}
queue.lastRenderedReducer = reducer2;
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;
}
current2.baseQueue = baseQueue = pendingQueue;
queue.pending = null;
}
if (baseQueue !== null) {
var first2 = baseQueue.next;
var newState = current2.baseState;
var newBaseState = null;
var newBaseQueueFirst = null;
var newBaseQueueLast = null;
var update = first2;
do {
var updateExpirationTime = update.expirationTime;
if (updateExpirationTime < renderExpirationTime) {
var clone = {
expirationTime: update.expirationTime,
suspenseConfig: update.suspenseConfig,
action: update.action,
eagerReducer: update.eagerReducer,
eagerState: update.eagerState,
next: null
};
if (newBaseQueueLast === null) {
newBaseQueueFirst = newBaseQueueLast = clone;
newBaseState = newState;
} else {
newBaseQueueLast = newBaseQueueLast.next = clone;
}
if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {
currentlyRenderingFiber$1.expirationTime = updateExpirationTime;
markUnprocessedUpdateTime(updateExpirationTime);
}
} else {
if (newBaseQueueLast !== null) {
var _clone = {
expirationTime: Sync,
suspenseConfig: update.suspenseConfig,
action: update.action,
eagerReducer: update.eagerReducer,
eagerState: update.eagerState,
next: null
};
newBaseQueueLast = newBaseQueueLast.next = _clone;
}
markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);
if (update.eagerReducer === reducer2) {
newState = update.eagerState;
} else {
var action = update.action;
newState = reducer2(newState, action);
}
}
update = update.next;
} while (update !== null && update !== first2);
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 dispatch = queue.dispatch;
return [hook.memoizedState, dispatch];
}
function rerenderReducer(reducer2, initialArg, init) {
var hook = updateWorkInProgressHook();
var queue = hook.queue;
if (!(queue !== null)) {
{
throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
}
}
queue.lastRenderedReducer = reducer2;
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 = reducer2(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 mountState(initialState2) {
var hook = mountWorkInProgressHook();
if (typeof initialState2 === "function") {
initialState2 = initialState2();
}
hook.memoizedState = hook.baseState = initialState2;
var queue = hook.queue = {
pending: null,
dispatch: null,
lastRenderedReducer: basicStateReducer,
lastRenderedState: initialState2
};
var dispatch = queue.dispatch = dispatchAction.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 ref = {
current: initialValue
};
{
Object.seal(ref);
}
hook.memoizedState = ref;
return ref;
}
function updateRef(initialValue) {
var hook = updateWorkInProgressHook();
return hook.memoizedState;
}
function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
var hook = mountWorkInProgressHook();
var nextDeps = deps === void 0 ? null : deps;
currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, void 0, nextDeps);
}
function updateEffectImpl(fiberEffectTag, hookEffectTag, 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)) {
pushEffect(hookEffectTag, create, destroy, nextDeps);
return;
}
}
}
currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);
}
function mountEffect(create, deps) {
{
if (typeof jest !== "undefined") {
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
}
}
return mountEffectImpl(Update | Passive, Passive$1, create, deps);
}
function updateEffect(create, deps) {
{
if (typeof jest !== "undefined") {
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
}
}
return updateEffectImpl(Update | Passive, Passive$1, create, deps);
}
function mountLayoutEffect(create, deps) {
return mountEffectImpl(Update, 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;
return mountEffectImpl(Update, 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, config10) {
var _mountState = mountState(value), prevValue = _mountState[0], setValue = _mountState[1];
mountEffect(function() {
var previousConfig = ReactCurrentBatchConfig$1.suspense;
ReactCurrentBatchConfig$1.suspense = config10 === void 0 ? null : config10;
try {
setValue(value);
} finally {
ReactCurrentBatchConfig$1.suspense = previousConfig;
}
}, [value, config10]);
return prevValue;
}
function updateDeferredValue(value, config10) {
var _updateState = updateState(), prevValue = _updateState[0], setValue = _updateState[1];
updateEffect(function() {
var previousConfig = ReactCurrentBatchConfig$1.suspense;
ReactCurrentBatchConfig$1.suspense = config10 === void 0 ? null : config10;
try {
setValue(value);
} finally {
ReactCurrentBatchConfig$1.suspense = previousConfig;
}
}, [value, config10]);
return prevValue;
}
function rerenderDeferredValue(value, config10) {
var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue = _rerenderState[1];
updateEffect(function() {
var previousConfig = ReactCurrentBatchConfig$1.suspense;
ReactCurrentBatchConfig$1.suspense = config10 === void 0 ? null : config10;
try {
setValue(value);
} finally {
ReactCurrentBatchConfig$1.suspense = previousConfig;
}
}, [value, config10]);
return prevValue;
}
function startTransition(setPending, config10, callback) {
var priorityLevel = getCurrentPriorityLevel();
runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function() {
setPending(true);
});
runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function() {
var previousConfig = ReactCurrentBatchConfig$1.suspense;
ReactCurrentBatchConfig$1.suspense = config10 === void 0 ? null : config10;
try {
setPending(false);
callback();
} finally {
ReactCurrentBatchConfig$1.suspense = previousConfig;
}
});
}
function mountTransition(config10) {
var _mountState2 = mountState(false), isPending = _mountState2[0], setPending = _mountState2[1];
var start = mountCallback(startTransition.bind(null, setPending, config10), [setPending, config10]);
return [start, isPending];
}
function updateTransition(config10) {
var _updateState2 = updateState(), isPending = _updateState2[0], setPending = _updateState2[1];
var start = updateCallback(startTransition.bind(null, setPending, config10), [setPending, config10]);
return [start, isPending];
}
function rerenderTransition(config10) {
var _rerenderState2 = rerenderState(), isPending = _rerenderState2[0], setPending = _rerenderState2[1];
var start = updateCallback(startTransition.bind(null, setPending, config10), [setPending, config10]);
return [start, isPending];
}
function dispatchAction(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 currentTime = requestCurrentTimeForUpdate();
var suspenseConfig = requestCurrentSuspenseConfig();
var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
var update = {
expirationTime,
suspenseConfig,
action,
eagerReducer: null,
eagerState: null,
next: null
};
{
update.priority = getCurrentPriorityLevel();
}
var pending = queue.pending;
if (pending === null) {
update.next = update;
} else {
update.next = pending.next;
pending.next = update;
}
queue.pending = update;
var alternate = fiber.alternate;
if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
didScheduleRenderPhaseUpdate = true;
update.expirationTime = renderExpirationTime;
currentlyRenderingFiber$1.expirationTime = renderExpirationTime;
} else {
if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
var lastRenderedReducer = queue.lastRenderedReducer;
if (lastRenderedReducer !== null) {
var prevDispatcher;
{
prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
}
try {
var currentState = queue.lastRenderedState;
var eagerState = lastRenderedReducer(currentState, action);
update.eagerReducer = lastRenderedReducer;
update.eagerState = eagerState;
if (objectIs(eagerState, currentState)) {
return;
}
} catch (error2) {
} finally {
{
ReactCurrentDispatcher.current = prevDispatcher;
}
}
}
}
{
if (typeof jest !== "undefined") {
warnIfNotScopedWithMatchingAct(fiber);
warnIfNotCurrentlyActingUpdatesInDev(fiber);
}
}
scheduleWork(fiber, expirationTime);
}
}
var ContextOnlyDispatcher = {
readContext,
useCallback: throwInvalidHookError,
useContext: throwInvalidHookError,
useEffect: throwInvalidHookError,
useImperativeHandle: throwInvalidHookError,
useLayoutEffect: throwInvalidHookError,
useMemo: throwInvalidHookError,
useReducer: throwInvalidHookError,
useRef: throwInvalidHookError,
useState: throwInvalidHookError,
useDebugValue: throwInvalidHookError,
useResponder: throwInvalidHookError,
useDeferredValue: throwInvalidHookError,
useTransition: throwInvalidHookError
};
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://fb.me/rules-of-hooks");
};
HooksDispatcherOnMountInDEV = {
readContext: function(context, observedBits) {
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
mountHookTypesDev();
checkDepsAreArrayDev(deps);
return mountCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
mountHookTypesDev();
return readContext(context, observedBits);
},
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);
},
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.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
mountHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
mountHookTypesDev();
return mountDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
mountHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
mountHookTypesDev();
return mountDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
mountHookTypesDev();
return mountTransition(config10);
}
};
HooksDispatcherOnMountWithHookTypesInDEV = {
readContext: function(context, observedBits) {
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
updateHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return readContext(context, observedBits);
},
useEffect: function(create, deps) {
currentHookNameInDev = "useEffect";
updateHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function(ref, create, deps) {
currentHookNameInDev = "useImperativeHandle";
updateHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
updateHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
return mountDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
updateHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return mountDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
updateHookTypesDev();
return mountTransition(config10);
}
};
HooksDispatcherOnUpdateInDEV = {
readContext: function(context, observedBits) {
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return readContext(context, observedBits);
},
useEffect: function(create, deps) {
currentHookNameInDev = "useEffect";
updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function(ref, create, deps) {
currentHookNameInDev = "useImperativeHandle";
updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
return updateDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
updateHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return updateDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
updateHookTypesDev();
return updateTransition(config10);
}
};
HooksDispatcherOnRerenderInDEV = {
readContext: function(context, observedBits) {
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return readContext(context, observedBits);
},
useEffect: function(create, deps) {
currentHookNameInDev = "useEffect";
updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function(ref, create, deps) {
currentHookNameInDev = "useImperativeHandle";
updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
try {
return updateMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
try {
return rerenderReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
try {
return rerenderState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
updateHookTypesDev();
return updateDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
updateHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return rerenderDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
updateHookTypesDev();
return rerenderTransition(config10);
}
};
InvalidNestedHooksDispatcherOnMountInDEV = {
readContext: function(context, observedBits) {
warnInvalidContextAccess();
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
warnInvalidHookAccess();
mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
mountHookTypesDev();
return readContext(context, observedBits);
},
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);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
warnInvalidHookAccess();
mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
warnInvalidHookAccess();
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
mountHookTypesDev();
return mountRef(initialValue);
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
return mountState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
warnInvalidHookAccess();
mountHookTypesDev();
return mountDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
warnInvalidHookAccess();
mountHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
mountHookTypesDev();
return mountDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
warnInvalidHookAccess();
mountHookTypesDev();
return mountTransition(config10);
}
};
InvalidNestedHooksDispatcherOnUpdateInDEV = {
readContext: function(context, observedBits) {
warnInvalidContextAccess();
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
warnInvalidHookAccess();
updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
updateHookTypesDev();
return readContext(context, observedBits);
},
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);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
warnInvalidHookAccess();
updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
warnInvalidHookAccess();
updateHookTypesDev();
return updateDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
warnInvalidHookAccess();
updateHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return updateDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
warnInvalidHookAccess();
updateHookTypesDev();
return updateTransition(config10);
}
};
InvalidNestedHooksDispatcherOnRerenderInDEV = {
readContext: function(context, observedBits) {
warnInvalidContextAccess();
return readContext(context, observedBits);
},
useCallback: function(callback, deps) {
currentHookNameInDev = "useCallback";
warnInvalidHookAccess();
updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function(context, observedBits) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
updateHookTypesDev();
return readContext(context, observedBits);
},
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);
},
useLayoutEffect: function(create, deps) {
currentHookNameInDev = "useLayoutEffect";
warnInvalidHookAccess();
updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function(create, deps) {
currentHookNameInDev = "useMemo";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return updateMemo(create, deps);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useReducer: function(reducer2, initialArg, init) {
currentHookNameInDev = "useReducer";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return rerenderReducer(reducer2, initialArg, init);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useRef: function(initialValue) {
currentHookNameInDev = "useRef";
warnInvalidHookAccess();
updateHookTypesDev();
return updateRef();
},
useState: function(initialState2) {
currentHookNameInDev = "useState";
warnInvalidHookAccess();
updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
return rerenderState(initialState2);
} finally {
ReactCurrentDispatcher.current = prevDispatcher;
}
},
useDebugValue: function(value, formatterFn) {
currentHookNameInDev = "useDebugValue";
warnInvalidHookAccess();
updateHookTypesDev();
return updateDebugValue();
},
useResponder: function(responder, props2) {
currentHookNameInDev = "useResponder";
warnInvalidHookAccess();
updateHookTypesDev();
return createDeprecatedResponderListener(responder, props2);
},
useDeferredValue: function(value, config10) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderDeferredValue(value, config10);
},
useTransition: function(config10) {
currentHookNameInDev = "useTransition";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderTransition(config10);
}
};
}
var now$1 = Scheduler.unstable_now;
var commitTime = 0;
var profilerStartTime = -1;
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;
}
}
var hydrationParentFiber = null;
var nextHydratableInstance = null;
var isHydrating = false;
function enterHydrationState(fiber) {
var parentInstance = fiber.stateNode.containerInfo;
nextHydratableInstance = getFirstHydratableChild(parentInstance);
hydrationParentFiber = fiber;
isHydrating = true;
return true;
}
function deleteHydratableInstance(returnFiber, instance) {
{
switch (returnFiber.tag) {
case HostRoot:
didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
break;
case HostComponent:
didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
break;
}
}
var childToDelete = createFiberFromHostInstanceForDeletion();
childToDelete.stateNode = instance;
childToDelete.return = returnFiber;
childToDelete.effectTag = Deletion;
if (returnFiber.lastEffect !== null) {
returnFiber.lastEffect.nextEffect = childToDelete;
returnFiber.lastEffect = childToDelete;
} else {
returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
}
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;
{
switch (returnFiber.tag) {
case HostRoot: {
var parentContainer = returnFiber.stateNode.containerInfo;
switch (fiber.tag) {
case HostComponent:
var type = fiber.type;
var props2 = fiber.pendingProps;
didNotFindHydratableContainerInstance(parentContainer, type);
break;
case HostText:
var text = fiber.pendingProps;
didNotFindHydratableContainerTextInstance(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;
didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
break;
case HostText:
var _text = fiber.pendingProps;
didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
break;
case SuspenseComponent:
didNotFindHydratableSuspenseInstance(parentType, parentProps);
break;
}
break;
}
default:
return;
}
}
}
function tryHydrate(fiber, nextInstance) {
switch (fiber.tag) {
case HostComponent: {
var type = fiber.type;
var props2 = fiber.pendingProps;
var instance = canHydrateInstance(nextInstance, type);
if (instance !== null) {
fiber.stateNode = instance;
return true;
}
return false;
}
case HostText: {
var text = fiber.pendingProps;
var textInstance = canHydrateTextInstance(nextInstance, text);
if (textInstance !== null) {
fiber.stateNode = textInstance;
return true;
}
return false;
}
case SuspenseComponent: {
return false;
}
default:
return false;
}
}
function tryToClaimNextHydratableInstance(fiber) {
if (!isHydrating) {
return;
}
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
insertNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrate(fiber, nextInstance)) {
nextInstance = getNextHydratableSibling(firstAttemptedInstance);
if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
insertNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
return;
}
deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
}
hydrationParentFiber = fiber;
nextHydratableInstance = getFirstHydratableChild(nextInstance);
}
function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
var instance = fiber.stateNode;
var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
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;
didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
break;
}
case HostComponent: {
var parentType = returnFiber.type;
var parentProps = returnFiber.memoizedProps;
var parentInstance = returnFiber.stateNode;
didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
break;
}
}
}
}
}
return shouldUpdate;
}
function skipPastDehydratedSuspenseInstance(fiber) {
var suspenseState = fiber.memoizedState;
var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
if (!suspenseInstance) {
{
throw 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 parent2 = fiber.return;
while (parent2 !== null && parent2.tag !== HostComponent && parent2.tag !== HostRoot && parent2.tag !== SuspenseComponent) {
parent2 = parent2.return;
}
hydrationParentFiber = parent2;
}
function popHydrationState(fiber) {
if (fiber !== hydrationParentFiber) {
return false;
}
if (!isHydrating) {
popToNextHostParent(fiber);
isHydrating = true;
return false;
}
var type = fiber.type;
if (fiber.tag !== HostComponent || type !== "head" && type !== "body" && !shouldSetTextContent(type, fiber.memoizedProps)) {
var nextInstance = nextHydratableInstance;
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 resetHydrationState() {
hydrationParentFiber = null;
nextHydratableInstance = null;
isHydrating = false;
}
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, renderExpirationTime2) {
if (current2 === null) {
workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderExpirationTime2);
} else {
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderExpirationTime2);
}
}
function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderExpirationTime2) {
workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderExpirationTime2);
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderExpirationTime2);
}
function updateForwardRef(current2, workInProgress2, Component2, nextProps, renderExpirationTime2) {
{
if (workInProgress2.type !== workInProgress2.elementType) {
var innerPropTypes = Component2.propTypes;
if (innerPropTypes) {
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component2), getCurrentFiberStackInDev);
}
}
}
var render4 = Component2.render;
var ref = workInProgress2.ref;
var nextChildren;
prepareToReadContext(workInProgress2, renderExpirationTime2);
{
ReactCurrentOwner$1.current = workInProgress2;
setIsRendering(true);
nextChildren = renderWithHooks(current2, workInProgress2, render4, nextProps, ref, renderExpirationTime2);
if (workInProgress2.mode & StrictMode) {
if (workInProgress2.memoizedState !== null) {
nextChildren = renderWithHooks(current2, workInProgress2, render4, nextProps, ref, renderExpirationTime2);
}
}
setIsRendering(false);
}
if (current2 !== null && !didReceiveUpdate) {
bailoutHooks(current2, workInProgress2, renderExpirationTime2);
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
workInProgress2.effectTag |= PerformedWork;
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function updateMemoComponent(current2, workInProgress2, Component2, nextProps, updateExpirationTime, renderExpirationTime2) {
if (current2 === null) {
var type = Component2.type;
if (isSimpleFunctionComponent(type) && Component2.compare === null && Component2.defaultProps === void 0) {
var resolvedType = type;
{
resolvedType = resolveFunctionForHotReloading(type);
}
workInProgress2.tag = SimpleMemoComponent;
workInProgress2.type = resolvedType;
{
validateFunctionComponentInDev(workInProgress2, type);
}
return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, updateExpirationTime, renderExpirationTime2);
}
{
var innerPropTypes = type.propTypes;
if (innerPropTypes) {
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(type), getCurrentFiberStackInDev);
}
}
var child = createFiberFromTypeAndProps(Component2.type, null, nextProps, null, workInProgress2.mode, renderExpirationTime2);
child.ref = workInProgress2.ref;
child.return = workInProgress2;
workInProgress2.child = child;
return child;
}
{
var _type = Component2.type;
var _innerPropTypes = _type.propTypes;
if (_innerPropTypes) {
checkPropTypes(_innerPropTypes, nextProps, "prop", getComponentName(_type), getCurrentFiberStackInDev);
}
}
var currentChild = current2.child;
if (updateExpirationTime < renderExpirationTime2) {
var prevProps = currentChild.memoizedProps;
var compare = Component2.compare;
compare = compare !== null ? compare : shallowEqual;
if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
}
workInProgress2.effectTag |= PerformedWork;
var newChild = createWorkInProgress(currentChild, nextProps);
newChild.ref = workInProgress2.ref;
newChild.return = workInProgress2;
workInProgress2.child = newChild;
return newChild;
}
function updateSimpleMemoComponent(current2, workInProgress2, Component2, nextProps, updateExpirationTime, renderExpirationTime2) {
{
if (workInProgress2.type !== workInProgress2.elementType) {
var outerMemoType = workInProgress2.elementType;
if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
outerMemoType = refineResolvedLazyComponent(outerMemoType);
}
var outerPropTypes = outerMemoType && outerMemoType.propTypes;
if (outerPropTypes) {
checkPropTypes(outerPropTypes, nextProps, "prop", getComponentName(outerMemoType), getCurrentFiberStackInDev);
}
}
}
if (current2 !== null) {
var prevProps = current2.memoizedProps;
if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) {
didReceiveUpdate = false;
if (updateExpirationTime < renderExpirationTime2) {
workInProgress2.expirationTime = current2.expirationTime;
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
}
}
return updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderExpirationTime2);
}
function updateFragment(current2, workInProgress2, renderExpirationTime2) {
var nextChildren = workInProgress2.pendingProps;
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function updateMode(current2, workInProgress2, renderExpirationTime2) {
var nextChildren = workInProgress2.pendingProps.children;
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function updateProfiler(current2, workInProgress2, renderExpirationTime2) {
{
workInProgress2.effectTag |= Update;
}
var nextProps = workInProgress2.pendingProps;
var nextChildren = nextProps.children;
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function markRef(current2, workInProgress2) {
var ref = workInProgress2.ref;
if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
workInProgress2.effectTag |= Ref;
}
}
function updateFunctionComponent(current2, workInProgress2, Component2, nextProps, renderExpirationTime2) {
{
if (workInProgress2.type !== workInProgress2.elementType) {
var innerPropTypes = Component2.propTypes;
if (innerPropTypes) {
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component2), getCurrentFiberStackInDev);
}
}
}
var context;
{
var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, true);
context = getMaskedContext(workInProgress2, unmaskedContext);
}
var nextChildren;
prepareToReadContext(workInProgress2, renderExpirationTime2);
{
ReactCurrentOwner$1.current = workInProgress2;
setIsRendering(true);
nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderExpirationTime2);
if (workInProgress2.mode & StrictMode) {
if (workInProgress2.memoizedState !== null) {
nextChildren = renderWithHooks(current2, workInProgress2, Component2, nextProps, context, renderExpirationTime2);
}
}
setIsRendering(false);
}
if (current2 !== null && !didReceiveUpdate) {
bailoutHooks(current2, workInProgress2, renderExpirationTime2);
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
workInProgress2.effectTag |= PerformedWork;
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function updateClassComponent(current2, workInProgress2, Component2, nextProps, renderExpirationTime2) {
{
if (workInProgress2.type !== workInProgress2.elementType) {
var innerPropTypes = Component2.propTypes;
if (innerPropTypes) {
checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component2), getCurrentFiberStackInDev);
}
}
}
var hasContext;
if (isContextProvider(Component2)) {
hasContext = true;
pushContextProvider(workInProgress2);
} else {
hasContext = false;
}
prepareToReadContext(workInProgress2, renderExpirationTime2);
var instance = workInProgress2.stateNode;
var shouldUpdate;
if (instance === null) {
if (current2 !== null) {
current2.alternate = null;
workInProgress2.alternate = null;
workInProgress2.effectTag |= Placement;
}
constructClassInstance(workInProgress2, Component2, nextProps);
mountClassInstance(workInProgress2, Component2, nextProps, renderExpirationTime2);
shouldUpdate = true;
} else if (current2 === null) {
shouldUpdate = resumeMountClassInstance(workInProgress2, Component2, nextProps, renderExpirationTime2);
} else {
shouldUpdate = updateClassInstance(current2, workInProgress2, Component2, nextProps, renderExpirationTime2);
}
var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderExpirationTime2);
{
var inst = workInProgress2.stateNode;
if (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.", getComponentName(workInProgress2.type) || "a component");
}
didWarnAboutReassigningProps = true;
}
}
return nextUnitOfWork;
}
function finishClassComponent(current2, workInProgress2, Component2, shouldUpdate, hasContext, renderExpirationTime2) {
markRef(current2, workInProgress2);
var didCaptureError = (workInProgress2.effectTag & DidCapture) !== NoEffect;
if (!shouldUpdate && !didCaptureError) {
if (hasContext) {
invalidateContextProvider(workInProgress2, Component2, false);
}
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
var instance = workInProgress2.stateNode;
ReactCurrentOwner$1.current = workInProgress2;
var nextChildren;
if (didCaptureError && typeof Component2.getDerivedStateFromError !== "function") {
nextChildren = null;
{
stopProfilerTimerIfRunning();
}
} else {
{
setIsRendering(true);
nextChildren = instance.render();
if (workInProgress2.mode & StrictMode) {
instance.render();
}
setIsRendering(false);
}
}
workInProgress2.effectTag |= PerformedWork;
if (current2 !== null && didCaptureError) {
forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderExpirationTime2);
} else {
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
}
workInProgress2.memoizedState = instance.state;
if (hasContext) {
invalidateContextProvider(workInProgress2, Component2, 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, renderExpirationTime2) {
pushHostRootContext(workInProgress2);
var updateQueue = workInProgress2.updateQueue;
if (!(current2 !== null && updateQueue !== null)) {
{
throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
}
}
var nextProps = workInProgress2.pendingProps;
var prevState = workInProgress2.memoizedState;
var prevChildren = prevState !== null ? prevState.element : null;
cloneUpdateQueue(current2, workInProgress2);
processUpdateQueue(workInProgress2, nextProps, null, renderExpirationTime2);
var nextState = workInProgress2.memoizedState;
var nextChildren = nextState.element;
if (nextChildren === prevChildren) {
resetHydrationState();
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
var root2 = workInProgress2.stateNode;
if (root2.hydrate && enterHydrationState(workInProgress2)) {
var child = mountChildFibers(workInProgress2, null, nextChildren, renderExpirationTime2);
workInProgress2.child = child;
var node = child;
while (node) {
node.effectTag = node.effectTag & ~Placement | Hydrating;
node = node.sibling;
}
} else {
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
resetHydrationState();
}
return workInProgress2.child;
}
function updateHostComponent(current2, workInProgress2, renderExpirationTime2) {
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.effectTag |= ContentReset;
}
markRef(current2, workInProgress2);
if (workInProgress2.mode & ConcurrentMode && renderExpirationTime2 !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
{
markSpawnedWork(Never);
}
workInProgress2.expirationTime = workInProgress2.childExpirationTime = Never;
return null;
}
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
return workInProgress2.child;
}
function updateHostText(current2, workInProgress2) {
if (current2 === null) {
tryToClaimNextHydratableInstance(workInProgress2);
}
return null;
}
function mountLazyComponent(_current, workInProgress2, elementType, updateExpirationTime, renderExpirationTime2) {
if (_current !== null) {
_current.alternate = null;
workInProgress2.alternate = null;
workInProgress2.effectTag |= Placement;
}
var props2 = workInProgress2.pendingProps;
cancelWorkTimer(workInProgress2);
var Component2 = readLazyComponentType(elementType);
workInProgress2.type = Component2;
var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component2);
startWorkTimer(workInProgress2);
var resolvedProps = resolveDefaultProps(Component2, props2);
var child;
switch (resolvedTag) {
case FunctionComponent: {
{
validateFunctionComponentInDev(workInProgress2, Component2);
workInProgress2.type = Component2 = resolveFunctionForHotReloading(Component2);
}
child = updateFunctionComponent(null, workInProgress2, Component2, resolvedProps, renderExpirationTime2);
return child;
}
case ClassComponent: {
{
workInProgress2.type = Component2 = resolveClassForHotReloading(Component2);
}
child = updateClassComponent(null, workInProgress2, Component2, resolvedProps, renderExpirationTime2);
return child;
}
case ForwardRef: {
{
workInProgress2.type = Component2 = resolveForwardRefForHotReloading(Component2);
}
child = updateForwardRef(null, workInProgress2, Component2, resolvedProps, renderExpirationTime2);
return child;
}
case MemoComponent: {
{
if (workInProgress2.type !== workInProgress2.elementType) {
var outerPropTypes = Component2.propTypes;
if (outerPropTypes) {
checkPropTypes(outerPropTypes, resolvedProps, "prop", getComponentName(Component2), getCurrentFiberStackInDev);
}
}
}
child = updateMemoComponent(null, workInProgress2, Component2, resolveDefaultProps(Component2.type, resolvedProps), updateExpirationTime, renderExpirationTime2);
return child;
}
}
var hint = "";
{
if (Component2 !== null && typeof Component2 === "object" && Component2.$$typeof === REACT_LAZY_TYPE) {
hint = " Did you wrap a component in React.lazy() more than once?";
}
}
{
{
throw Error("Element type is invalid. Received a promise that resolves to: " + Component2 + ". Lazy element type must resolve to a class or function." + hint);
}
}
}
function mountIncompleteClassComponent(_current, workInProgress2, Component2, nextProps, renderExpirationTime2) {
if (_current !== null) {
_current.alternate = null;
workInProgress2.alternate = null;
workInProgress2.effectTag |= Placement;
}
workInProgress2.tag = ClassComponent;
var hasContext;
if (isContextProvider(Component2)) {
hasContext = true;
pushContextProvider(workInProgress2);
} else {
hasContext = false;
}
prepareToReadContext(workInProgress2, renderExpirationTime2);
constructClassInstance(workInProgress2, Component2, nextProps);
mountClassInstance(workInProgress2, Component2, nextProps, renderExpirationTime2);
return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderExpirationTime2);
}
function mountIndeterminateComponent(_current, workInProgress2, Component2, renderExpirationTime2) {
if (_current !== null) {
_current.alternate = null;
workInProgress2.alternate = null;
workInProgress2.effectTag |= Placement;
}
var props2 = workInProgress2.pendingProps;
var context;
{
var unmaskedContext = getUnmaskedContext(workInProgress2, Component2, false);
context = getMaskedContext(workInProgress2, unmaskedContext);
}
prepareToReadContext(workInProgress2, renderExpirationTime2);
var value;
{
if (Component2.prototype && typeof Component2.prototype.render === "function") {
var componentName = getComponentName(Component2) || "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 & StrictMode) {
ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
}
setIsRendering(true);
ReactCurrentOwner$1.current = workInProgress2;
value = renderWithHooks(null, workInProgress2, Component2, props2, context, renderExpirationTime2);
setIsRendering(false);
}
workInProgress2.effectTag |= PerformedWork;
if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
{
var _componentName = getComponentName(Component2) || "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;
}
}
workInProgress2.tag = ClassComponent;
workInProgress2.memoizedState = null;
workInProgress2.updateQueue = null;
var hasContext = false;
if (isContextProvider(Component2)) {
hasContext = true;
pushContextProvider(workInProgress2);
} else {
hasContext = false;
}
workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
initializeUpdateQueue(workInProgress2);
var getDerivedStateFromProps = Component2.getDerivedStateFromProps;
if (typeof getDerivedStateFromProps === "function") {
applyDerivedStateFromProps(workInProgress2, Component2, getDerivedStateFromProps, props2);
}
adoptClassInstance(workInProgress2, value);
mountClassInstance(workInProgress2, Component2, props2, renderExpirationTime2);
return finishClassComponent(null, workInProgress2, Component2, true, hasContext, renderExpirationTime2);
} else {
workInProgress2.tag = FunctionComponent;
{
if (workInProgress2.mode & StrictMode) {
if (workInProgress2.memoizedState !== null) {
value = renderWithHooks(null, workInProgress2, Component2, props2, context, renderExpirationTime2);
}
}
}
reconcileChildren(null, workInProgress2, value, renderExpirationTime2);
{
validateFunctionComponentInDev(workInProgress2, Component2);
}
return workInProgress2.child;
}
}
function validateFunctionComponentInDev(workInProgress2, Component2) {
{
if (Component2) {
if (Component2.childContextTypes) {
error("%s(...): childContextTypes cannot be defined on a function component.", Component2.displayName || Component2.name || "Component");
}
}
if (workInProgress2.ref !== null) {
var info = "";
var ownerName = getCurrentFiberOwnerNameInDevOrNull();
if (ownerName) {
info += "\n\nCheck the render method of `" + ownerName + "`.";
}
var warningKey = ownerName || workInProgress2._debugID || "";
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 Component2.getDerivedStateFromProps === "function") {
var _componentName2 = getComponentName(Component2) || "Unknown";
if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
error("%s: Function components do not support getDerivedStateFromProps.", _componentName2);
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
}
}
if (typeof Component2.contextType === "object" && Component2.contextType !== null) {
var _componentName3 = getComponentName(Component2) || "Unknown";
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
error("%s: Function components do not support contextType.", _componentName3);
didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
}
}
}
}
var SUSPENDED_MARKER = {
dehydrated: null,
retryTime: NoWork
};
function shouldRemainOnFallback(suspenseContext, current2, workInProgress2) {
return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current2 === null || current2.memoizedState !== null);
}
function updateSuspenseComponent(current2, workInProgress2, renderExpirationTime2) {
var mode = workInProgress2.mode;
var nextProps = workInProgress2.pendingProps;
{
if (shouldSuspend(workInProgress2)) {
workInProgress2.effectTag |= DidCapture;
}
}
var suspenseContext = suspenseStackCursor.current;
var nextDidTimeout = false;
var didSuspend = (workInProgress2.effectTag & DidCapture) !== NoEffect;
if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
nextDidTimeout = true;
workInProgress2.effectTag &= ~DidCapture;
} else {
if (current2 === null || current2.memoizedState !== null) {
if (nextProps.fallback !== void 0 && nextProps.unstable_avoidThisFallback !== true) {
suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
}
}
}
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
pushSuspenseContext(workInProgress2, suspenseContext);
if (current2 === null) {
if (nextProps.fallback !== void 0) {
tryToClaimNextHydratableInstance(workInProgress2);
}
if (nextDidTimeout) {
var nextFallbackChildren = nextProps.fallback;
var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
primaryChildFragment.return = workInProgress2;
if ((workInProgress2.mode & BlockingMode) === NoMode) {
var progressedState = workInProgress2.memoizedState;
var progressedPrimaryChild = progressedState !== null ? workInProgress2.child.child : workInProgress2.child;
primaryChildFragment.child = progressedPrimaryChild;
var progressedChild = progressedPrimaryChild;
while (progressedChild !== null) {
progressedChild.return = primaryChildFragment;
progressedChild = progressedChild.sibling;
}
}
var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime2, null);
fallbackChildFragment.return = workInProgress2;
primaryChildFragment.sibling = fallbackChildFragment;
workInProgress2.memoizedState = SUSPENDED_MARKER;
workInProgress2.child = primaryChildFragment;
return fallbackChildFragment;
} else {
var nextPrimaryChildren = nextProps.children;
workInProgress2.memoizedState = null;
return workInProgress2.child = mountChildFibers(workInProgress2, null, nextPrimaryChildren, renderExpirationTime2);
}
} else {
var prevState = current2.memoizedState;
if (prevState !== null) {
var currentPrimaryChildFragment = current2.child;
var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
if (nextDidTimeout) {
var _nextFallbackChildren2 = nextProps.fallback;
var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);
_primaryChildFragment2.return = workInProgress2;
if ((workInProgress2.mode & BlockingMode) === NoMode) {
var _progressedState = workInProgress2.memoizedState;
var _progressedPrimaryChild = _progressedState !== null ? workInProgress2.child.child : workInProgress2.child;
if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
_primaryChildFragment2.child = _progressedPrimaryChild;
var _progressedChild2 = _progressedPrimaryChild;
while (_progressedChild2 !== null) {
_progressedChild2.return = _primaryChildFragment2;
_progressedChild2 = _progressedChild2.sibling;
}
}
}
if (workInProgress2.mode & ProfileMode) {
var _treeBaseDuration = 0;
var _hiddenChild = _primaryChildFragment2.child;
while (_hiddenChild !== null) {
_treeBaseDuration += _hiddenChild.treeBaseDuration;
_hiddenChild = _hiddenChild.sibling;
}
_primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
}
var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);
_fallbackChildFragment2.return = workInProgress2;
_primaryChildFragment2.sibling = _fallbackChildFragment2;
_primaryChildFragment2.childExpirationTime = NoWork;
workInProgress2.memoizedState = SUSPENDED_MARKER;
workInProgress2.child = _primaryChildFragment2;
return _fallbackChildFragment2;
} else {
var _nextPrimaryChildren = nextProps.children;
var currentPrimaryChild = currentPrimaryChildFragment.child;
var primaryChild = reconcileChildFibers(workInProgress2, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime2);
workInProgress2.memoizedState = null;
return workInProgress2.child = primaryChild;
}
} else {
var _currentPrimaryChild = current2.child;
if (nextDidTimeout) {
var _nextFallbackChildren3 = nextProps.fallback;
var _primaryChildFragment3 = createFiberFromFragment(null, mode, NoWork, null);
_primaryChildFragment3.return = workInProgress2;
_primaryChildFragment3.child = _currentPrimaryChild;
if (_currentPrimaryChild !== null) {
_currentPrimaryChild.return = _primaryChildFragment3;
}
if ((workInProgress2.mode & BlockingMode) === NoMode) {
var _progressedState2 = workInProgress2.memoizedState;
var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress2.child.child : workInProgress2.child;
_primaryChildFragment3.child = _progressedPrimaryChild2;
var _progressedChild3 = _progressedPrimaryChild2;
while (_progressedChild3 !== null) {
_progressedChild3.return = _primaryChildFragment3;
_progressedChild3 = _progressedChild3.sibling;
}
}
if (workInProgress2.mode & ProfileMode) {
var _treeBaseDuration2 = 0;
var _hiddenChild2 = _primaryChildFragment3.child;
while (_hiddenChild2 !== null) {
_treeBaseDuration2 += _hiddenChild2.treeBaseDuration;
_hiddenChild2 = _hiddenChild2.sibling;
}
_primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;
}
var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime2, null);
_fallbackChildFragment3.return = workInProgress2;
_primaryChildFragment3.sibling = _fallbackChildFragment3;
_fallbackChildFragment3.effectTag |= Placement;
_primaryChildFragment3.childExpirationTime = NoWork;
workInProgress2.memoizedState = SUSPENDED_MARKER;
workInProgress2.child = _primaryChildFragment3;
return _fallbackChildFragment3;
} else {
workInProgress2.memoizedState = null;
var _nextPrimaryChildren2 = nextProps.children;
return workInProgress2.child = reconcileChildFibers(workInProgress2, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime2);
}
}
}
}
function scheduleWorkOnFiber(fiber, renderExpirationTime2) {
if (fiber.expirationTime < renderExpirationTime2) {
fiber.expirationTime = renderExpirationTime2;
}
var alternate = fiber.alternate;
if (alternate !== null && alternate.expirationTime < renderExpirationTime2) {
alternate.expirationTime = renderExpirationTime2;
}
scheduleWorkOnParentPath(fiber.return, renderExpirationTime2);
}
function propagateSuspenseContextChange(workInProgress2, firstChild, renderExpirationTime2) {
var node = firstChild;
while (node !== null) {
if (node.tag === SuspenseComponent) {
var state = node.memoizedState;
if (state !== null) {
scheduleWorkOnFiber(node, renderExpirationTime2);
}
} else if (node.tag === SuspenseListComponent) {
scheduleWorkOnFiber(node, renderExpirationTime2);
} 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, index3) {
{
var isArray3 = Array.isArray(childSlot);
var isIterable = !isArray3 && typeof getIteratorFn(childSlot) === "function";
if (isArray3 || isIterable) {
var type = isArray3 ? "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, index3, type);
return false;
}
}
return true;
}
function validateSuspenseListChildren(children, revealOrder) {
{
if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
if (!validateSuspenseListNestedChild(children[i], i)) {
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, lastEffectBeforeRendering) {
var renderState = workInProgress2.memoizedState;
if (renderState === null) {
workInProgress2.memoizedState = {
isBackwards,
rendering: null,
renderingStartTime: 0,
last: lastContentRow,
tail,
tailExpiration: 0,
tailMode,
lastEffect: lastEffectBeforeRendering
};
} else {
renderState.isBackwards = isBackwards;
renderState.rendering = null;
renderState.renderingStartTime = 0;
renderState.last = lastContentRow;
renderState.tail = tail;
renderState.tailExpiration = 0;
renderState.tailMode = tailMode;
renderState.lastEffect = lastEffectBeforeRendering;
}
}
function updateSuspenseListComponent(current2, workInProgress2, renderExpirationTime2) {
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, renderExpirationTime2);
var suspenseContext = suspenseStackCursor.current;
var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
if (shouldForceFallback) {
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
workInProgress2.effectTag |= DidCapture;
} else {
var didSuspendBefore = current2 !== null && (current2.effectTag & DidCapture) !== NoEffect;
if (didSuspendBefore) {
propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderExpirationTime2);
}
suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
}
pushSuspenseContext(workInProgress2, suspenseContext);
if ((workInProgress2.mode & BlockingMode) === 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, workInProgress2.lastEffect);
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, workInProgress2.lastEffect);
break;
}
case "together": {
initSuspenseListRenderState(workInProgress2, false, null, null, void 0, workInProgress2.lastEffect);
break;
}
default: {
workInProgress2.memoizedState = null;
}
}
}
return workInProgress2.child;
}
function updatePortalComponent(current2, workInProgress2, renderExpirationTime2) {
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
var nextChildren = workInProgress2.pendingProps;
if (current2 === null) {
workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderExpirationTime2);
} else {
reconcileChildren(current2, workInProgress2, nextChildren, renderExpirationTime2);
}
return workInProgress2.child;
}
function updateContextProvider(current2, workInProgress2, renderExpirationTime2) {
var providerType = workInProgress2.type;
var context = providerType._context;
var newProps = workInProgress2.pendingProps;
var oldProps = workInProgress2.memoizedProps;
var newValue = newProps.value;
{
var providerPropTypes = workInProgress2.type.propTypes;
if (providerPropTypes) {
checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider", getCurrentFiberStackInDev);
}
}
pushProvider(workInProgress2, newValue);
if (oldProps !== null) {
var oldValue = oldProps.value;
var changedBits = calculateChangedBits(context, newValue, oldValue);
if (changedBits === 0) {
if (oldProps.children === newProps.children && !hasContextChanged()) {
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
}
} else {
propagateContextChange(workInProgress2, context, changedBits, renderExpirationTime2);
}
}
var newChildren = newProps.children;
reconcileChildren(current2, workInProgress2, newChildren, renderExpirationTime2);
return workInProgress2.child;
}
var hasWarnedAboutUsingContextAsConsumer = false;
function updateContextConsumer(current2, workInProgress2, renderExpirationTime2) {
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 render4 = newProps.children;
{
if (typeof render4 !== "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, renderExpirationTime2);
var newValue = readContext(context, newProps.unstable_observedBits);
var newChildren;
{
ReactCurrentOwner$1.current = workInProgress2;
setIsRendering(true);
newChildren = render4(newValue);
setIsRendering(false);
}
workInProgress2.effectTag |= PerformedWork;
reconcileChildren(current2, workInProgress2, newChildren, renderExpirationTime2);
return workInProgress2.child;
}
function markWorkInProgressReceivedUpdate() {
didReceiveUpdate = true;
}
function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2) {
cancelWorkTimer(workInProgress2);
if (current2 !== null) {
workInProgress2.dependencies = current2.dependencies;
}
{
stopProfilerTimerIfRunning();
}
var updateExpirationTime = workInProgress2.expirationTime;
if (updateExpirationTime !== NoWork) {
markUnprocessedUpdateTime(updateExpirationTime);
}
var childExpirationTime = workInProgress2.childExpirationTime;
if (childExpirationTime < renderExpirationTime2) {
return null;
} else {
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 last2 = returnFiber.lastEffect;
if (last2 !== null) {
last2.nextEffect = current2;
returnFiber.lastEffect = current2;
} else {
returnFiber.firstEffect = returnFiber.lastEffect = current2;
}
current2.nextEffect = null;
current2.effectTag = Deletion;
newWorkInProgress.effectTag |= Placement;
return newWorkInProgress;
}
}
function beginWork(current2, workInProgress2, renderExpirationTime2) {
var updateExpirationTime = workInProgress2.expirationTime;
{
if (workInProgress2._debugNeedsRemount && current2 !== null) {
return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.expirationTime));
}
}
if (current2 !== null) {
var oldProps = current2.memoizedProps;
var newProps = workInProgress2.pendingProps;
if (oldProps !== newProps || hasContextChanged() || workInProgress2.type !== current2.type) {
didReceiveUpdate = true;
} else if (updateExpirationTime < renderExpirationTime2) {
didReceiveUpdate = false;
switch (workInProgress2.tag) {
case HostRoot:
pushHostRootContext(workInProgress2);
resetHydrationState();
break;
case HostComponent:
pushHostContext(workInProgress2);
if (workInProgress2.mode & ConcurrentMode && renderExpirationTime2 !== Never && shouldDeprioritizeSubtree(workInProgress2.type, newProps)) {
{
markSpawnedWork(Never);
}
workInProgress2.expirationTime = workInProgress2.childExpirationTime = Never;
return null;
}
break;
case ClassComponent: {
var Component2 = workInProgress2.type;
if (isContextProvider(Component2)) {
pushContextProvider(workInProgress2);
}
break;
}
case HostPortal:
pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
break;
case ContextProvider: {
var newValue = workInProgress2.memoizedProps.value;
pushProvider(workInProgress2, newValue);
break;
}
case Profiler:
{
var hasChildWork = workInProgress2.childExpirationTime >= renderExpirationTime2;
if (hasChildWork) {
workInProgress2.effectTag |= Update;
}
}
break;
case SuspenseComponent: {
var state = workInProgress2.memoizedState;
if (state !== null) {
var primaryChildFragment = workInProgress2.child;
var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime2) {
return updateSuspenseComponent(current2, workInProgress2, renderExpirationTime2);
} else {
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
if (child !== null) {
return child.sibling;
} else {
return null;
}
}
} else {
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
}
break;
}
case SuspenseListComponent: {
var didSuspendBefore = (current2.effectTag & DidCapture) !== NoEffect;
var _hasChildWork = workInProgress2.childExpirationTime >= renderExpirationTime2;
if (didSuspendBefore) {
if (_hasChildWork) {
return updateSuspenseListComponent(current2, workInProgress2, renderExpirationTime2);
}
workInProgress2.effectTag |= DidCapture;
}
var renderState = workInProgress2.memoizedState;
if (renderState !== null) {
renderState.rendering = null;
renderState.tail = null;
}
pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
if (_hasChildWork) {
break;
} else {
return null;
}
}
}
return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderExpirationTime2);
} else {
didReceiveUpdate = false;
}
} else {
didReceiveUpdate = false;
}
workInProgress2.expirationTime = NoWork;
switch (workInProgress2.tag) {
case IndeterminateComponent: {
return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderExpirationTime2);
}
case LazyComponent: {
var elementType = workInProgress2.elementType;
return mountLazyComponent(current2, workInProgress2, elementType, updateExpirationTime, renderExpirationTime2);
}
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, renderExpirationTime2);
}
case ClassComponent: {
var _Component2 = workInProgress2.type;
var _unresolvedProps = workInProgress2.pendingProps;
var _resolvedProps = workInProgress2.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
return updateClassComponent(current2, workInProgress2, _Component2, _resolvedProps, renderExpirationTime2);
}
case HostRoot:
return updateHostRoot(current2, workInProgress2, renderExpirationTime2);
case HostComponent:
return updateHostComponent(current2, workInProgress2, renderExpirationTime2);
case HostText:
return updateHostText(current2, workInProgress2);
case SuspenseComponent:
return updateSuspenseComponent(current2, workInProgress2, renderExpirationTime2);
case HostPortal:
return updatePortalComponent(current2, workInProgress2, renderExpirationTime2);
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, renderExpirationTime2);
}
case Fragment2:
return updateFragment(current2, workInProgress2, renderExpirationTime2);
case Mode:
return updateMode(current2, workInProgress2, renderExpirationTime2);
case Profiler:
return updateProfiler(current2, workInProgress2, renderExpirationTime2);
case ContextProvider:
return updateContextProvider(current2, workInProgress2, renderExpirationTime2);
case ContextConsumer:
return updateContextConsumer(current2, workInProgress2, renderExpirationTime2);
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", getComponentName(_type2), getCurrentFiberStackInDev);
}
}
}
_resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime2);
}
case SimpleMemoComponent: {
return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, updateExpirationTime, renderExpirationTime2);
}
case IncompleteClassComponent: {
var _Component3 = workInProgress2.type;
var _unresolvedProps4 = workInProgress2.pendingProps;
var _resolvedProps4 = workInProgress2.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
return mountIncompleteClassComponent(current2, workInProgress2, _Component3, _resolvedProps4, renderExpirationTime2);
}
case SuspenseListComponent: {
return updateSuspenseListComponent(current2, workInProgress2, renderExpirationTime2);
}
}
{
{
throw 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.effectTag |= Update;
}
function markRef$1(workInProgress2) {
workInProgress2.effectTag |= Ref;
}
var appendAllChildren;
var updateHostContainer;
var updateHostComponent$1;
var updateHostText$1;
{
appendAllChildren = function(parent2, workInProgress2, needsVisibilityToggle, isHidden) {
var node = workInProgress2.child;
while (node !== null) {
if (node.tag === HostComponent || node.tag === HostText) {
appendInitialChild(parent2, 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(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) {
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 completeWork(current2, workInProgress2, renderExpirationTime2) {
var newProps = workInProgress2.pendingProps;
switch (workInProgress2.tag) {
case IndeterminateComponent:
case LazyComponent:
case SimpleMemoComponent:
case FunctionComponent:
case ForwardRef:
case Fragment2:
case Mode:
case Profiler:
case ContextConsumer:
case MemoComponent:
return null;
case ClassComponent: {
var Component2 = workInProgress2.type;
if (isContextProvider(Component2)) {
popContext(workInProgress2);
}
return null;
}
case HostRoot: {
popHostContainer(workInProgress2);
popTopLevelContextObject(workInProgress2);
var fiberRoot = workInProgress2.stateNode;
if (fiberRoot.pendingContext) {
fiberRoot.context = fiberRoot.pendingContext;
fiberRoot.pendingContext = null;
}
if (current2 === null || current2.child === null) {
var wasHydrated = popHydrationState(workInProgress2);
if (wasHydrated) {
markUpdate(workInProgress2);
}
}
updateHostContainer(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 Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
}
}
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);
}
}
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 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);
}
}
return null;
}
case SuspenseComponent: {
popSuspenseContext(workInProgress2);
var nextState = workInProgress2.memoizedState;
if ((workInProgress2.effectTag & DidCapture) !== NoEffect) {
workInProgress2.expirationTime = renderExpirationTime2;
return workInProgress2;
}
var nextDidTimeout = nextState !== null;
var prevDidTimeout = false;
if (current2 === null) {
if (workInProgress2.memoizedProps.fallback !== void 0) {
popHydrationState(workInProgress2);
}
} else {
var prevState = current2.memoizedState;
prevDidTimeout = prevState !== null;
if (!nextDidTimeout && prevState !== null) {
var currentFallbackChild = current2.child.sibling;
if (currentFallbackChild !== null) {
var first2 = workInProgress2.firstEffect;
if (first2 !== null) {
workInProgress2.firstEffect = currentFallbackChild;
currentFallbackChild.nextEffect = first2;
} else {
workInProgress2.firstEffect = workInProgress2.lastEffect = currentFallbackChild;
currentFallbackChild.nextEffect = null;
}
currentFallbackChild.effectTag = Deletion;
}
}
}
if (nextDidTimeout && !prevDidTimeout) {
if ((workInProgress2.mode & BlockingMode) !== NoMode) {
var hasInvisibleChildContext = current2 === null && workInProgress2.memoizedProps.unstable_avoidThisFallback !== true;
if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
renderDidSuspend();
} else {
renderDidSuspendDelayIfPossible();
}
}
}
{
if (nextDidTimeout || prevDidTimeout) {
workInProgress2.effectTag |= Update;
}
}
return null;
}
case HostPortal:
popHostContainer(workInProgress2);
updateHostContainer(workInProgress2);
return null;
case ContextProvider:
popProvider(workInProgress2);
return null;
case IncompleteClassComponent: {
var _Component = workInProgress2.type;
if (isContextProvider(_Component)) {
popContext(workInProgress2);
}
return null;
}
case SuspenseListComponent: {
popSuspenseContext(workInProgress2);
var renderState = workInProgress2.memoizedState;
if (renderState === null) {
return null;
}
var didSuspendAlready = (workInProgress2.effectTag & DidCapture) !== NoEffect;
var renderedTail = renderState.rendering;
if (renderedTail === null) {
if (!didSuspendAlready) {
var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.effectTag & DidCapture) === NoEffect);
if (!cannotBeSuspended) {
var row = workInProgress2.child;
while (row !== null) {
var suspended = findFirstSuspended(row);
if (suspended !== null) {
didSuspendAlready = true;
workInProgress2.effectTag |= DidCapture;
cutOffTailIfNeeded(renderState, false);
var newThennables = suspended.updateQueue;
if (newThennables !== null) {
workInProgress2.updateQueue = newThennables;
workInProgress2.effectTag |= Update;
}
if (renderState.lastEffect === null) {
workInProgress2.firstEffect = null;
}
workInProgress2.lastEffect = renderState.lastEffect;
resetChildFibers(workInProgress2, renderExpirationTime2);
pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
return workInProgress2.child;
}
row = row.sibling;
}
}
} else {
cutOffTailIfNeeded(renderState, false);
}
} else {
if (!didSuspendAlready) {
var _suspended = findFirstSuspended(renderedTail);
if (_suspended !== null) {
workInProgress2.effectTag |= DidCapture;
didSuspendAlready = true;
var _newThennables = _suspended.updateQueue;
if (_newThennables !== null) {
workInProgress2.updateQueue = _newThennables;
workInProgress2.effectTag |= Update;
}
cutOffTailIfNeeded(renderState, true);
if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate) {
var lastEffect = workInProgress2.lastEffect = renderState.lastEffect;
if (lastEffect !== null) {
lastEffect.nextEffect = null;
}
return null;
}
} else if (now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime2 > Never) {
workInProgress2.effectTag |= DidCapture;
didSuspendAlready = true;
cutOffTailIfNeeded(renderState, false);
var nextPriority = renderExpirationTime2 - 1;
workInProgress2.expirationTime = workInProgress2.childExpirationTime = nextPriority;
{
markSpawnedWork(nextPriority);
}
}
}
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) {
if (renderState.tailExpiration === 0) {
var TAIL_EXPIRATION_TIMEOUT_MS = 500;
renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS;
}
var next = renderState.tail;
renderState.rendering = next;
renderState.tail = next.sibling;
renderState.lastEffect = workInProgress2.lastEffect;
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;
}
return null;
}
}
{
{
throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
}
}
}
function unwindWork(workInProgress2, renderExpirationTime2) {
switch (workInProgress2.tag) {
case ClassComponent: {
var Component2 = workInProgress2.type;
if (isContextProvider(Component2)) {
popContext(workInProgress2);
}
var effectTag = workInProgress2.effectTag;
if (effectTag & ShouldCapture) {
workInProgress2.effectTag = effectTag & ~ShouldCapture | DidCapture;
return workInProgress2;
}
return null;
}
case HostRoot: {
popHostContainer(workInProgress2);
popTopLevelContextObject(workInProgress2);
var _effectTag = workInProgress2.effectTag;
if (!((_effectTag & DidCapture) === NoEffect)) {
{
throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
}
}
workInProgress2.effectTag = _effectTag & ~ShouldCapture | DidCapture;
return workInProgress2;
}
case HostComponent: {
popHostContext(workInProgress2);
return null;
}
case SuspenseComponent: {
popSuspenseContext(workInProgress2);
var _effectTag2 = workInProgress2.effectTag;
if (_effectTag2 & ShouldCapture) {
workInProgress2.effectTag = _effectTag2 & ~ShouldCapture | DidCapture;
return workInProgress2;
}
return null;
}
case SuspenseListComponent: {
popSuspenseContext(workInProgress2);
return null;
}
case HostPortal:
popHostContainer(workInProgress2);
return null;
case ContextProvider:
popProvider(workInProgress2);
return null;
default:
return null;
}
}
function unwindInterruptedWork(interruptedWork) {
switch (interruptedWork.tag) {
case ClassComponent: {
var childContextTypes = interruptedWork.type.childContextTypes;
if (childContextTypes !== null && childContextTypes !== void 0) {
popContext(interruptedWork);
}
break;
}
case HostRoot: {
popHostContainer(interruptedWork);
popTopLevelContextObject(interruptedWork);
break;
}
case HostComponent: {
popHostContext(interruptedWork);
break;
}
case HostPortal:
popHostContainer(interruptedWork);
break;
case SuspenseComponent:
popSuspenseContext(interruptedWork);
break;
case SuspenseListComponent:
popSuspenseContext(interruptedWork);
break;
case ContextProvider:
popProvider(interruptedWork);
break;
}
}
function createCapturedValue(value, source) {
return {
value,
source,
stack: getStackByFiberInDevAndProd(source)
};
}
function logCapturedError(capturedError) {
var error2 = capturedError.error;
{
var componentName = capturedError.componentName, componentStack = capturedError.componentStack, errorBoundaryName = capturedError.errorBoundaryName, errorBoundaryFound = capturedError.errorBoundaryFound, willRetry = capturedError.willRetry;
if (error2 != null && error2._suppressLogging) {
if (errorBoundaryFound && willRetry) {
return;
}
console["error"](error2);
}
var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
var errorBoundaryMessage;
if (errorBoundaryFound && errorBoundaryName) {
if (willRetry) {
errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
} else {
errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\nRecreating the tree from scratch failed so React will unmount the tree.";
}
} else {
errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://fb.me/react-error-boundaries to learn more about error boundaries.";
}
var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage);
console["error"](combinedMessage);
}
}
var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
{
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
}
var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
function logError(boundary, errorInfo) {
var source = errorInfo.source;
var stack = errorInfo.stack;
if (stack === null && source !== null) {
stack = getStackByFiberInDevAndProd(source);
}
var capturedError = {
componentName: source !== null ? getComponentName(source.type) : null,
componentStack: stack !== null ? stack : "",
error: errorInfo.value,
errorBoundary: null,
errorBoundaryName: null,
errorBoundaryFound: false,
willRetry: false
};
if (boundary !== null && boundary.tag === ClassComponent) {
capturedError.errorBoundary = boundary.stateNode;
capturedError.errorBoundaryName = getComponentName(boundary.type);
capturedError.errorBoundaryFound = true;
capturedError.willRetry = true;
}
try {
logCapturedError(capturedError);
} catch (e3) {
setTimeout(function() {
throw e3;
});
}
}
var callComponentWillUnmountWithTimer = function(current2, instance) {
startPhaseTimer(current2, "componentWillUnmount");
instance.props = current2.memoizedProps;
instance.state = current2.memoizedState;
instance.componentWillUnmount();
stopPhaseTimer();
};
function safelyCallComponentWillUnmount(current2, instance) {
{
invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current2, instance);
if (hasCaughtError()) {
var unmountError = clearCaughtError();
captureCommitPhaseError(current2, unmountError);
}
}
}
function safelyDetachRef(current2) {
var ref = current2.ref;
if (ref !== null) {
if (typeof ref === "function") {
{
invokeGuardedCallback(null, ref, null, null);
if (hasCaughtError()) {
var refError = clearCaughtError();
captureCommitPhaseError(current2, refError);
}
}
} else {
ref.current = null;
}
}
}
function safelyCallDestroy(current2, destroy) {
{
invokeGuardedCallback(null, destroy, null);
if (hasCaughtError()) {
var error2 = clearCaughtError();
captureCommitPhaseError(current2, error2);
}
}
}
function commitBeforeMutationLifeCycles(current2, finishedWork) {
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent:
case Block: {
return;
}
case ClassComponent: {
if (finishedWork.effectTag & Snapshot) {
if (current2 !== null) {
var prevProps = current2.memoizedProps;
var prevState = current2.memoizedState;
startPhaseTimer(finishedWork, "getSnapshotBeforeUpdate");
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.", getComponentName(finishedWork.type) || "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.props`. Please file an issue.", getComponentName(finishedWork.type) || "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.", getComponentName(finishedWork.type));
}
}
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
stopPhaseTimer();
}
}
return;
}
case HostRoot:
case HostComponent:
case HostText:
case HostPortal:
case IncompleteClassComponent:
return;
}
{
{
throw 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.");
}
}
}
function commitHookEffectListUnmount(tag, 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 & tag) === tag) {
var destroy = effect.destroy;
effect.destroy = void 0;
if (destroy !== void 0) {
destroy();
}
}
effect = effect.next;
} while (effect !== firstEffect);
}
}
function commitHookEffectListMount(tag, 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 & tag) === tag) {
var create = effect.create;
effect.destroy = create();
{
var destroy = effect.destroy;
if (destroy !== void 0 && typeof destroy !== "function") {
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 useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\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://fb.me/react-hooks-data-fetching";
} else {
addendum = " You returned: " + destroy;
}
error("An effect function must not return anything besides a function, which is used for clean-up.%s%s", addendum, getStackByFiberInDevAndProd(finishedWork));
}
}
}
effect = effect.next;
} while (effect !== firstEffect);
}
}
function commitPassiveHookEffects(finishedWork) {
if ((finishedWork.effectTag & Passive) !== NoEffect) {
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent:
case Block: {
commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);
commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
break;
}
}
}
}
function commitLifeCycles(finishedRoot, current2, finishedWork, committedExpirationTime) {
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent:
case Block: {
commitHookEffectListMount(Layout | HasEffect, finishedWork);
return;
}
case ClassComponent: {
var instance = finishedWork.stateNode;
if (finishedWork.effectTag & Update) {
if (current2 === null) {
startPhaseTimer(finishedWork, "componentDidMount");
{
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.", getComponentName(finishedWork.type) || "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.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
}
}
}
instance.componentDidMount();
stopPhaseTimer();
} else {
var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
var prevState = current2.memoizedState;
startPhaseTimer(finishedWork, "componentDidUpdate");
{
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.", getComponentName(finishedWork.type) || "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.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
}
}
}
instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
stopPhaseTimer();
}
}
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.", getComponentName(finishedWork.type) || "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.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
}
}
}
commitUpdateQueue(finishedWork, updateQueue, instance);
}
return;
}
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);
}
return;
}
case HostComponent: {
var _instance2 = finishedWork.stateNode;
if (current2 === null && finishedWork.effectTag & Update) {
var type = finishedWork.type;
var props2 = finishedWork.memoizedProps;
commitMount(_instance2, type, props2);
}
return;
}
case HostText: {
return;
}
case HostPortal: {
return;
}
case Profiler: {
{
var onRender = finishedWork.memoizedProps.onRender;
if (typeof onRender === "function") {
{
onRender(finishedWork.memoizedProps.id, current2 === null ? "mount" : "update", finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
}
}
}
return;
}
case SuspenseComponent: {
commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
return;
}
case SuspenseListComponent:
case IncompleteClassComponent:
case FundamentalComponent:
case ScopeComponent:
return;
}
{
{
throw 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.");
}
}
}
function hideOrUnhideAllChildren(finishedWork, isHidden) {
{
var node = finishedWork;
while (true) {
if (node.tag === HostComponent) {
var instance = node.stateNode;
if (isHidden) {
hideInstance(instance);
} else {
unhideInstance(node.stateNode, node.memoizedProps);
}
} else if (node.tag === HostText) {
var _instance3 = node.stateNode;
if (isHidden) {
hideTextInstance(_instance3);
} else {
unhideTextInstance(_instance3, node.memoizedProps);
}
} else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {
var fallbackChildFragment = node.child.sibling;
fallbackChildFragment.return = node;
node = fallbackChildFragment;
continue;
} 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;
}
node = node.return;
}
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") {
ref(instanceToUse);
} else {
{
if (!ref.hasOwnProperty("current")) {
error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().%s", getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
}
}
ref.current = instanceToUse;
}
}
}
function commitDetachRef(current2) {
var currentRef = current2.ref;
if (currentRef !== null) {
if (typeof currentRef === "function") {
currentRef(null);
} else {
currentRef.current = null;
}
}
}
function commitUnmount(finishedRoot, current2, renderPriorityLevel) {
onCommitUnmount(current2);
switch (current2.tag) {
case FunctionComponent:
case ForwardRef:
case MemoComponent:
case SimpleMemoComponent:
case Block: {
var updateQueue = current2.updateQueue;
if (updateQueue !== null) {
var lastEffect = updateQueue.lastEffect;
if (lastEffect !== null) {
var firstEffect = lastEffect.next;
{
var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
runWithPriority$1(priorityLevel, function() {
var effect = firstEffect;
do {
var _destroy = effect.destroy;
if (_destroy !== void 0) {
safelyCallDestroy(current2, _destroy);
}
effect = effect.next;
} while (effect !== firstEffect);
});
}
}
}
return;
}
case ClassComponent: {
safelyDetachRef(current2);
var instance = current2.stateNode;
if (typeof instance.componentWillUnmount === "function") {
safelyCallComponentWillUnmount(current2, instance);
}
return;
}
case HostComponent: {
safelyDetachRef(current2);
return;
}
case HostPortal: {
{
unmountHostComponents(finishedRoot, current2, renderPriorityLevel);
}
return;
}
case FundamentalComponent: {
return;
}
case DehydratedFragment: {
return;
}
case ScopeComponent: {
return;
}
}
}
function commitNestedUnmounts(finishedRoot, root2, renderPriorityLevel) {
var node = root2;
while (true) {
commitUnmount(finishedRoot, node, renderPriorityLevel);
if (node.child !== null && node.tag !== HostPortal) {
node.child.return = node;
node = node.child;
continue;
}
if (node === root2) {
return;
}
while (node.sibling === null) {
if (node.return === null || node.return === root2) {
return;
}
node = node.return;
}
node.sibling.return = node.return;
node = node.sibling;
}
}
function detachFiber(current2) {
var alternate = current2.alternate;
current2.return = null;
current2.child = null;
current2.memoizedState = null;
current2.updateQueue = null;
current2.dependencies = null;
current2.alternate = null;
current2.firstEffect = null;
current2.lastEffect = null;
current2.pendingProps = null;
current2.memoizedProps = null;
current2.stateNode = null;
if (alternate !== null) {
detachFiber(alternate);
}
}
function getHostParentFiber(fiber) {
var parent2 = fiber.return;
while (parent2 !== null) {
if (isHostParent(parent2)) {
return parent2;
}
parent2 = parent2.return;
}
{
{
throw 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.effectTag & Placement) {
continue siblings;
}
if (node.child === null || node.tag === HostPortal) {
continue siblings;
} else {
node.child.return = node;
node = node.child;
}
}
if (!(node.effectTag & Placement)) {
return node.stateNode;
}
}
}
function commitPlacement(finishedWork) {
var parentFiber = getHostParentFiber(finishedWork);
var parent2;
var isContainer;
var parentStateNode = parentFiber.stateNode;
switch (parentFiber.tag) {
case HostComponent:
parent2 = parentStateNode;
isContainer = false;
break;
case HostRoot:
parent2 = parentStateNode.containerInfo;
isContainer = true;
break;
case HostPortal:
parent2 = parentStateNode.containerInfo;
isContainer = true;
break;
case FundamentalComponent:
default: {
{
throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
}
}
}
if (parentFiber.effectTag & ContentReset) {
resetTextContent(parent2);
parentFiber.effectTag &= ~ContentReset;
}
var before = getHostSibling(finishedWork);
if (isContainer) {
insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent2);
} else {
insertOrAppendPlacementNode(finishedWork, before, parent2);
}
}
function insertOrAppendPlacementNodeIntoContainer(node, before, parent2) {
var tag = node.tag;
var isHost = tag === HostComponent || tag === HostText;
if (isHost || enableFundamentalAPI) {
var stateNode = isHost ? node.stateNode : node.stateNode.instance;
if (before) {
insertInContainerBefore(parent2, stateNode, before);
} else {
appendChildToContainer(parent2, stateNode);
}
} else if (tag === HostPortal)
;
else {
var child = node.child;
if (child !== null) {
insertOrAppendPlacementNodeIntoContainer(child, before, parent2);
var sibling = child.sibling;
while (sibling !== null) {
insertOrAppendPlacementNodeIntoContainer(sibling, before, parent2);
sibling = sibling.sibling;
}
}
}
}
function insertOrAppendPlacementNode(node, before, parent2) {
var tag = node.tag;
var isHost = tag === HostComponent || tag === HostText;
if (isHost || enableFundamentalAPI) {
var stateNode = isHost ? node.stateNode : node.stateNode.instance;
if (before) {
insertBefore(parent2, stateNode, before);
} else {
appendChild(parent2, stateNode);
}
} else if (tag === HostPortal)
;
else {
var child = node.child;
if (child !== null) {
insertOrAppendPlacementNode(child, before, parent2);
var sibling = child.sibling;
while (sibling !== null) {
insertOrAppendPlacementNode(sibling, before, parent2);
sibling = sibling.sibling;
}
}
}
}
function unmountHostComponents(finishedRoot, current2, renderPriorityLevel) {
var node = current2;
var currentParentIsValid = false;
var currentParent;
var currentParentIsContainer;
while (true) {
if (!currentParentIsValid) {
var parent2 = node.return;
findParent:
while (true) {
if (!(parent2 !== null)) {
{
throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
}
}
var parentStateNode = parent2.stateNode;
switch (parent2.tag) {
case HostComponent:
currentParent = parentStateNode;
currentParentIsContainer = false;
break findParent;
case HostRoot:
currentParent = parentStateNode.containerInfo;
currentParentIsContainer = true;
break findParent;
case HostPortal:
currentParent = parentStateNode.containerInfo;
currentParentIsContainer = true;
break findParent;
}
parent2 = parent2.return;
}
currentParentIsValid = true;
}
if (node.tag === HostComponent || node.tag === HostText) {
commitNestedUnmounts(finishedRoot, node, renderPriorityLevel);
if (currentParentIsContainer) {
removeChildFromContainer(currentParent, node.stateNode);
} else {
removeChild(currentParent, node.stateNode);
}
} else if (node.tag === HostPortal) {
if (node.child !== null) {
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = true;
node.child.return = node;
node = node.child;
continue;
}
} else {
commitUnmount(finishedRoot, node, renderPriorityLevel);
if (node.child !== null) {
node.child.return = node;
node = node.child;
continue;
}
}
if (node === current2) {
return;
}
while (node.sibling === null) {
if (node.return === null || node.return === current2) {
return;
}
node = node.return;
if (node.tag === HostPortal) {
currentParentIsValid = false;
}
}
node.sibling.return = node.return;
node = node.sibling;
}
}
function commitDeletion(finishedRoot, current2, renderPriorityLevel) {
{
unmountHostComponents(finishedRoot, current2, renderPriorityLevel);
}
detachFiber(current2);
}
function commitWork(current2, finishedWork) {
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case MemoComponent:
case SimpleMemoComponent:
case Block: {
commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
return;
}
case ClassComponent: {
return;
}
case HostComponent: {
var instance = finishedWork.stateNode;
if (instance != 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) {
commitUpdate(instance, updatePayload, type, oldProps, newProps);
}
}
return;
}
case HostText: {
if (!(finishedWork.stateNode !== null)) {
{
throw 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;
commitTextUpdate(textInstance, oldText, newText);
return;
}
case HostRoot: {
{
var _root = finishedWork.stateNode;
if (_root.hydrate) {
_root.hydrate = false;
commitHydratedContainer(_root.containerInfo);
}
}
return;
}
case Profiler: {
return;
}
case SuspenseComponent: {
commitSuspenseComponent(finishedWork);
attachSuspenseRetryListeners(finishedWork);
return;
}
case SuspenseListComponent: {
attachSuspenseRetryListeners(finishedWork);
return;
}
case IncompleteClassComponent: {
return;
}
}
{
{
throw 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.");
}
}
}
function commitSuspenseComponent(finishedWork) {
var newState = finishedWork.memoizedState;
var newDidTimeout;
var primaryChildParent = finishedWork;
if (newState === null) {
newDidTimeout = false;
} else {
newDidTimeout = true;
primaryChildParent = finishedWork.child;
markCommitTimeOfFallback();
}
if (primaryChildParent !== null) {
hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
}
}
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 thenables = finishedWork.updateQueue;
if (thenables !== null) {
finishedWork.updateQueue = null;
var retryCache = finishedWork.stateNode;
if (retryCache === null) {
retryCache = finishedWork.stateNode = new PossiblyWeakSet();
}
thenables.forEach(function(thenable) {
var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
if (!retryCache.has(thenable)) {
{
if (thenable.__reactDoNotTraceInteractions !== true) {
retry = tracing.unstable_wrap(retry);
}
}
retryCache.add(thenable);
thenable.then(retry, retry);
}
});
}
}
function commitResetTextContent(current2) {
resetTextContent(current2.stateNode);
}
var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
var update = createUpdate(expirationTime, null);
update.tag = CaptureUpdate;
update.payload = {
element: null
};
var error2 = errorInfo.value;
update.callback = function() {
onUncaughtError(error2);
logError(fiber, errorInfo);
};
return update;
}
function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
var update = createUpdate(expirationTime, null);
update.tag = CaptureUpdate;
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
if (typeof getDerivedStateFromError === "function") {
var error$1 = errorInfo.value;
update.payload = function() {
logError(fiber, errorInfo);
return getDerivedStateFromError(error$1);
};
}
var inst = fiber.stateNode;
if (inst !== null && typeof inst.componentDidCatch === "function") {
update.callback = function callback() {
{
markFailedErrorBoundaryForHotReloading(fiber);
}
if (typeof getDerivedStateFromError !== "function") {
markLegacyErrorBoundaryAsFailed(this);
logError(fiber, errorInfo);
}
var error$12 = errorInfo.value;
var stack = errorInfo.stack;
this.componentDidCatch(error$12, {
componentStack: stack !== null ? stack : ""
});
{
if (typeof getDerivedStateFromError !== "function") {
if (fiber.expirationTime !== Sync) {
error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentName(fiber.type) || "Unknown");
}
}
}
};
} else {
update.callback = function() {
markFailedErrorBoundaryForHotReloading(fiber);
};
}
return update;
}
function attachPingListener(root2, renderExpirationTime2, thenable) {
var pingCache = root2.pingCache;
var threadIDs;
if (pingCache === null) {
pingCache = root2.pingCache = new PossiblyWeakMap$1();
threadIDs = new Set();
pingCache.set(thenable, threadIDs);
} else {
threadIDs = pingCache.get(thenable);
if (threadIDs === void 0) {
threadIDs = new Set();
pingCache.set(thenable, threadIDs);
}
}
if (!threadIDs.has(renderExpirationTime2)) {
threadIDs.add(renderExpirationTime2);
var ping = pingSuspendedRoot.bind(null, root2, thenable, renderExpirationTime2);
thenable.then(ping, ping);
}
}
function throwException(root2, returnFiber, sourceFiber, value, renderExpirationTime2) {
sourceFiber.effectTag |= Incomplete;
sourceFiber.firstEffect = sourceFiber.lastEffect = null;
if (value !== null && typeof value === "object" && typeof value.then === "function") {
var thenable = value;
if ((sourceFiber.mode & BlockingMode) === NoMode) {
var currentSource = sourceFiber.alternate;
if (currentSource) {
sourceFiber.updateQueue = currentSource.updateQueue;
sourceFiber.memoizedState = currentSource.memoizedState;
sourceFiber.expirationTime = currentSource.expirationTime;
} else {
sourceFiber.updateQueue = null;
sourceFiber.memoizedState = null;
}
}
var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);
var _workInProgress = returnFiber;
do {
if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
var thenables = _workInProgress.updateQueue;
if (thenables === null) {
var updateQueue = new Set();
updateQueue.add(thenable);
_workInProgress.updateQueue = updateQueue;
} else {
thenables.add(thenable);
}
if ((_workInProgress.mode & BlockingMode) === NoMode) {
_workInProgress.effectTag |= DidCapture;
sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
if (sourceFiber.tag === ClassComponent) {
var currentSourceFiber = sourceFiber.alternate;
if (currentSourceFiber === null) {
sourceFiber.tag = IncompleteClassComponent;
} else {
var update = createUpdate(Sync, null);
update.tag = ForceUpdate;
enqueueUpdate(sourceFiber, update);
}
}
sourceFiber.expirationTime = Sync;
return;
}
attachPingListener(root2, renderExpirationTime2, thenable);
_workInProgress.effectTag |= ShouldCapture;
_workInProgress.expirationTime = renderExpirationTime2;
return;
}
_workInProgress = _workInProgress.return;
} while (_workInProgress !== null);
value = new Error((getComponentName(sourceFiber.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." + getStackByFiberInDevAndProd(sourceFiber));
}
renderDidError();
value = createCapturedValue(value, sourceFiber);
var workInProgress2 = returnFiber;
do {
switch (workInProgress2.tag) {
case HostRoot: {
var _errorInfo = value;
workInProgress2.effectTag |= ShouldCapture;
workInProgress2.expirationTime = renderExpirationTime2;
var _update = createRootErrorUpdate(workInProgress2, _errorInfo, renderExpirationTime2);
enqueueCapturedUpdate(workInProgress2, _update);
return;
}
case ClassComponent:
var errorInfo = value;
var ctor = workInProgress2.type;
var instance = workInProgress2.stateNode;
if ((workInProgress2.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
workInProgress2.effectTag |= ShouldCapture;
workInProgress2.expirationTime = renderExpirationTime2;
var _update2 = createClassErrorUpdate(workInProgress2, errorInfo, renderExpirationTime2);
enqueueCapturedUpdate(workInProgress2, _update2);
return;
}
break;
}
workInProgress2 = workInProgress2.return;
} while (workInProgress2 !== null);
}
var ceil = Math.ceil;
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
var NoContext = 0;
var BatchedContext = 1;
var EventContext = 2;
var DiscreteEventContext = 4;
var LegacyUnbatchedContext = 8;
var RenderContext = 16;
var CommitContext = 32;
var RootIncomplete = 0;
var RootFatalErrored = 1;
var RootErrored = 2;
var RootSuspended = 3;
var RootSuspendedWithDelay = 4;
var RootCompleted = 5;
var executionContext = NoContext;
var workInProgressRoot = null;
var workInProgress = null;
var renderExpirationTime$1 = NoWork;
var workInProgressRootExitStatus = RootIncomplete;
var workInProgressRootFatalError = null;
var workInProgressRootLatestProcessedExpirationTime = Sync;
var workInProgressRootLatestSuspenseTimeout = Sync;
var workInProgressRootCanSuspendUsingConfig = null;
var workInProgressRootNextUnprocessedUpdateTime = NoWork;
var workInProgressRootHasPendingPing = false;
var globalMostRecentFallbackTime = 0;
var FALLBACK_THROTTLE_MS = 500;
var nextEffect = null;
var hasUncaughtError = false;
var firstUncaughtError = null;
var legacyErrorBoundariesThatAlreadyFailed = null;
var rootDoesHavePassiveEffects = false;
var rootWithPendingPassiveEffects = null;
var pendingPassiveEffectsRenderPriority = NoPriority;
var pendingPassiveEffectsExpirationTime = NoWork;
var rootsWithPendingDiscreteUpdates = null;
var NESTED_UPDATE_LIMIT = 50;
var nestedUpdateCount = 0;
var rootWithNestedUpdates = null;
var NESTED_PASSIVE_UPDATE_LIMIT = 50;
var nestedPassiveUpdateCount = 0;
var interruptedBy = null;
var spawnedWorkDuringRender = null;
var currentEventTime = NoWork;
function requestCurrentTimeForUpdate() {
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
return msToExpirationTime(now());
}
if (currentEventTime !== NoWork) {
return currentEventTime;
}
currentEventTime = msToExpirationTime(now());
return currentEventTime;
}
function getCurrentTime() {
return msToExpirationTime(now());
}
function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
var mode = fiber.mode;
if ((mode & BlockingMode) === NoMode) {
return Sync;
}
var priorityLevel = getCurrentPriorityLevel();
if ((mode & ConcurrentMode) === NoMode) {
return priorityLevel === ImmediatePriority ? Sync : Batched;
}
if ((executionContext & RenderContext) !== NoContext) {
return renderExpirationTime$1;
}
var expirationTime;
if (suspenseConfig !== null) {
expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
} else {
switch (priorityLevel) {
case ImmediatePriority:
expirationTime = Sync;
break;
case UserBlockingPriority$1:
expirationTime = computeInteractiveExpiration(currentTime);
break;
case NormalPriority:
case LowPriority:
expirationTime = computeAsyncExpiration(currentTime);
break;
case IdlePriority:
expirationTime = Idle;
break;
default: {
{
throw Error("Expected a valid priority level");
}
}
}
}
if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {
expirationTime -= 1;
}
return expirationTime;
}
function scheduleUpdateOnFiber(fiber, expirationTime) {
checkForNestedUpdates();
warnAboutRenderPhaseUpdatesInDEV(fiber);
var root2 = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
if (root2 === null) {
warnAboutUpdateOnUnmountedFiberInDEV(fiber);
return;
}
checkForInterruption(fiber, expirationTime);
recordScheduleUpdate();
var priorityLevel = getCurrentPriorityLevel();
if (expirationTime === Sync) {
if ((executionContext & LegacyUnbatchedContext) !== NoContext && (executionContext & (RenderContext | CommitContext)) === NoContext) {
schedulePendingInteractions(root2, expirationTime);
performSyncWorkOnRoot(root2);
} else {
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, expirationTime);
if (executionContext === NoContext) {
flushSyncCallbackQueue();
}
}
} else {
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, expirationTime);
}
if ((executionContext & DiscreteEventContext) !== NoContext && (priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {
if (rootsWithPendingDiscreteUpdates === null) {
rootsWithPendingDiscreteUpdates = new Map([[root2, expirationTime]]);
} else {
var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root2);
if (lastDiscreteTime === void 0 || lastDiscreteTime > expirationTime) {
rootsWithPendingDiscreteUpdates.set(root2, expirationTime);
}
}
}
}
var scheduleWork = scheduleUpdateOnFiber;
function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
if (fiber.expirationTime < expirationTime) {
fiber.expirationTime = expirationTime;
}
var alternate = fiber.alternate;
if (alternate !== null && alternate.expirationTime < expirationTime) {
alternate.expirationTime = expirationTime;
}
var node = fiber.return;
var root2 = null;
if (node === null && fiber.tag === HostRoot) {
root2 = fiber.stateNode;
} else {
while (node !== null) {
alternate = node.alternate;
if (node.childExpirationTime < expirationTime) {
node.childExpirationTime = expirationTime;
if (alternate !== null && alternate.childExpirationTime < expirationTime) {
alternate.childExpirationTime = expirationTime;
}
} else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
alternate.childExpirationTime = expirationTime;
}
if (node.return === null && node.tag === HostRoot) {
root2 = node.stateNode;
break;
}
node = node.return;
}
}
if (root2 !== null) {
if (workInProgressRoot === root2) {
markUnprocessedUpdateTime(expirationTime);
if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
markRootSuspendedAtTime(root2, renderExpirationTime$1);
}
}
markRootUpdatedAtTime(root2, expirationTime);
}
return root2;
}
function getNextRootExpirationTimeToWorkOn(root2) {
var lastExpiredTime = root2.lastExpiredTime;
if (lastExpiredTime !== NoWork) {
return lastExpiredTime;
}
var firstPendingTime = root2.firstPendingTime;
if (!isRootSuspendedAtTime(root2, firstPendingTime)) {
return firstPendingTime;
}
var lastPingedTime = root2.lastPingedTime;
var nextKnownPendingLevel = root2.nextKnownPendingLevel;
var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;
if (nextLevel <= Idle && firstPendingTime !== nextLevel) {
return NoWork;
}
return nextLevel;
}
function ensureRootIsScheduled(root2) {
var lastExpiredTime = root2.lastExpiredTime;
if (lastExpiredTime !== NoWork) {
root2.callbackExpirationTime = Sync;
root2.callbackPriority = ImmediatePriority;
root2.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
return;
}
var expirationTime = getNextRootExpirationTimeToWorkOn(root2);
var existingCallbackNode = root2.callbackNode;
if (expirationTime === NoWork) {
if (existingCallbackNode !== null) {
root2.callbackNode = null;
root2.callbackExpirationTime = NoWork;
root2.callbackPriority = NoPriority;
}
return;
}
var currentTime = requestCurrentTimeForUpdate();
var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
if (existingCallbackNode !== null) {
var existingCallbackPriority = root2.callbackPriority;
var existingCallbackExpirationTime = root2.callbackExpirationTime;
if (existingCallbackExpirationTime === expirationTime && existingCallbackPriority >= priorityLevel) {
return;
}
cancelCallback(existingCallbackNode);
}
root2.callbackExpirationTime = expirationTime;
root2.callbackPriority = priorityLevel;
var callbackNode;
if (expirationTime === Sync) {
callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
} else {
callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root2), {
timeout: expirationTimeToMs(expirationTime) - now()
});
}
root2.callbackNode = callbackNode;
}
function performConcurrentWorkOnRoot(root2, didTimeout) {
currentEventTime = NoWork;
if (didTimeout) {
var currentTime = requestCurrentTimeForUpdate();
markRootExpiredAtTime(root2, currentTime);
ensureRootIsScheduled(root2);
return null;
}
var expirationTime = getNextRootExpirationTimeToWorkOn(root2);
if (expirationTime !== NoWork) {
var originalCallbackNode = root2.callbackNode;
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
{
throw Error("Should not already be working.");
}
}
flushPassiveEffects();
if (root2 !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
prepareFreshStack(root2, expirationTime);
startWorkOnPendingInteractions(root2, expirationTime);
}
if (workInProgress !== null) {
var prevExecutionContext = executionContext;
executionContext |= RenderContext;
var prevDispatcher = pushDispatcher();
var prevInteractions = pushInteractions(root2);
startWorkLoopTimer(workInProgress);
do {
try {
workLoopConcurrent();
break;
} catch (thrownValue) {
handleError(root2, thrownValue);
}
} while (true);
resetContextDependencies();
executionContext = prevExecutionContext;
popDispatcher(prevDispatcher);
{
popInteractions(prevInteractions);
}
if (workInProgressRootExitStatus === RootFatalErrored) {
var fatalError = workInProgressRootFatalError;
stopInterruptedWorkLoopTimer();
prepareFreshStack(root2, expirationTime);
markRootSuspendedAtTime(root2, expirationTime);
ensureRootIsScheduled(root2);
throw fatalError;
}
if (workInProgress !== null) {
stopInterruptedWorkLoopTimer();
} else {
stopFinishedWorkLoopTimer();
var finishedWork = root2.finishedWork = root2.current.alternate;
root2.finishedExpirationTime = expirationTime;
finishConcurrentRender(root2, finishedWork, workInProgressRootExitStatus, expirationTime);
}
ensureRootIsScheduled(root2);
if (root2.callbackNode === originalCallbackNode) {
return performConcurrentWorkOnRoot.bind(null, root2);
}
}
}
return null;
}
function finishConcurrentRender(root2, finishedWork, exitStatus, expirationTime) {
workInProgressRoot = null;
switch (exitStatus) {
case RootIncomplete:
case RootFatalErrored: {
{
{
throw Error("Root did not complete. This is a bug in React.");
}
}
}
case RootErrored: {
markRootExpiredAtTime(root2, expirationTime > Idle ? Idle : expirationTime);
break;
}
case RootSuspended: {
markRootSuspendedAtTime(root2, expirationTime);
var lastSuspendedTime = root2.lastSuspendedTime;
if (expirationTime === lastSuspendedTime) {
root2.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
}
var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
if (hasNotProcessedNewUpdates && !IsThisRendererActing.current) {
var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
if (msUntilTimeout > 10) {
if (workInProgressRootHasPendingPing) {
var lastPingedTime = root2.lastPingedTime;
if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {
root2.lastPingedTime = expirationTime;
prepareFreshStack(root2, expirationTime);
break;
}
}
var nextTime = getNextRootExpirationTimeToWorkOn(root2);
if (nextTime !== NoWork && nextTime !== expirationTime) {
break;
}
if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {
root2.lastPingedTime = lastSuspendedTime;
break;
}
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), msUntilTimeout);
break;
}
}
commitRoot(root2);
break;
}
case RootSuspendedWithDelay: {
markRootSuspendedAtTime(root2, expirationTime);
var _lastSuspendedTime = root2.lastSuspendedTime;
if (expirationTime === _lastSuspendedTime) {
root2.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
}
if (!IsThisRendererActing.current) {
if (workInProgressRootHasPendingPing) {
var _lastPingedTime = root2.lastPingedTime;
if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {
root2.lastPingedTime = expirationTime;
prepareFreshStack(root2, expirationTime);
break;
}
}
var _nextTime = getNextRootExpirationTimeToWorkOn(root2);
if (_nextTime !== NoWork && _nextTime !== expirationTime) {
break;
}
if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {
root2.lastPingedTime = _lastSuspendedTime;
break;
}
var _msUntilTimeout;
if (workInProgressRootLatestSuspenseTimeout !== Sync) {
_msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
} else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
_msUntilTimeout = 0;
} else {
var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
var currentTimeMs = now();
var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
var timeElapsed = currentTimeMs - eventTimeMs;
if (timeElapsed < 0) {
timeElapsed = 0;
}
_msUntilTimeout = jnd(timeElapsed) - timeElapsed;
if (timeUntilExpirationMs < _msUntilTimeout) {
_msUntilTimeout = timeUntilExpirationMs;
}
}
if (_msUntilTimeout > 10) {
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout);
break;
}
}
commitRoot(root2);
break;
}
case RootCompleted: {
if (!IsThisRendererActing.current && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
if (_msUntilTimeout2 > 10) {
markRootSuspendedAtTime(root2, expirationTime);
root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout2);
break;
}
}
commitRoot(root2);
break;
}
default: {
{
{
throw Error("Unknown root exit status.");
}
}
}
}
}
function performSyncWorkOnRoot(root2) {
var lastExpiredTime = root2.lastExpiredTime;
var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
{
throw Error("Should not already be working.");
}
}
flushPassiveEffects();
if (root2 !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
prepareFreshStack(root2, expirationTime);
startWorkOnPendingInteractions(root2, expirationTime);
}
if (workInProgress !== null) {
var prevExecutionContext = executionContext;
executionContext |= RenderContext;
var prevDispatcher = pushDispatcher();
var prevInteractions = pushInteractions(root2);
startWorkLoopTimer(workInProgress);
do {
try {
workLoopSync();
break;
} catch (thrownValue) {
handleError(root2, thrownValue);
}
} while (true);
resetContextDependencies();
executionContext = prevExecutionContext;
popDispatcher(prevDispatcher);
{
popInteractions(prevInteractions);
}
if (workInProgressRootExitStatus === RootFatalErrored) {
var fatalError = workInProgressRootFatalError;
stopInterruptedWorkLoopTimer();
prepareFreshStack(root2, expirationTime);
markRootSuspendedAtTime(root2, expirationTime);
ensureRootIsScheduled(root2);
throw fatalError;
}
if (workInProgress !== null) {
{
{
throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
}
}
} else {
stopFinishedWorkLoopTimer();
root2.finishedWork = root2.current.alternate;
root2.finishedExpirationTime = expirationTime;
finishSyncRender(root2);
}
ensureRootIsScheduled(root2);
}
return null;
}
function finishSyncRender(root2) {
workInProgressRoot = null;
commitRoot(root2);
}
function flushDiscreteUpdates() {
if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
{
if ((executionContext & RenderContext) !== NoContext) {
error("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
}
}
return;
}
flushPendingDiscreteUpdates();
flushPassiveEffects();
}
function syncUpdates(fn, a2, b, c) {
return runWithPriority$1(ImmediatePriority, fn.bind(null, a2, b, c));
}
function flushPendingDiscreteUpdates() {
if (rootsWithPendingDiscreteUpdates !== null) {
var roots = rootsWithPendingDiscreteUpdates;
rootsWithPendingDiscreteUpdates = null;
roots.forEach(function(expirationTime, root2) {
markRootExpiredAtTime(root2, expirationTime);
ensureRootIsScheduled(root2);
});
flushSyncCallbackQueue();
}
}
function batchedUpdates$1(fn, a2) {
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
try {
return fn(a2);
} finally {
executionContext = prevExecutionContext;
if (executionContext === NoContext) {
flushSyncCallbackQueue();
}
}
}
function batchedEventUpdates$1(fn, a2) {
var prevExecutionContext = executionContext;
executionContext |= EventContext;
try {
return fn(a2);
} finally {
executionContext = prevExecutionContext;
if (executionContext === NoContext) {
flushSyncCallbackQueue();
}
}
}
function discreteUpdates$1(fn, a2, b, c, d) {
var prevExecutionContext = executionContext;
executionContext |= DiscreteEventContext;
try {
return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a2, b, c, d));
} finally {
executionContext = prevExecutionContext;
if (executionContext === NoContext) {
flushSyncCallbackQueue();
}
}
}
function unbatchedUpdates(fn, a2) {
var prevExecutionContext = executionContext;
executionContext &= ~BatchedContext;
executionContext |= LegacyUnbatchedContext;
try {
return fn(a2);
} finally {
executionContext = prevExecutionContext;
if (executionContext === NoContext) {
flushSyncCallbackQueue();
}
}
}
function flushSync(fn, a2) {
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
{
{
throw Error("flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.");
}
}
}
var prevExecutionContext = executionContext;
executionContext |= BatchedContext;
try {
return runWithPriority$1(ImmediatePriority, fn.bind(null, a2));
} finally {
executionContext = prevExecutionContext;
flushSyncCallbackQueue();
}
}
function prepareFreshStack(root2, expirationTime) {
root2.finishedWork = null;
root2.finishedExpirationTime = NoWork;
var timeoutHandle = root2.timeoutHandle;
if (timeoutHandle !== noTimeout) {
root2.timeoutHandle = noTimeout;
cancelTimeout(timeoutHandle);
}
if (workInProgress !== null) {
var interruptedWork = workInProgress.return;
while (interruptedWork !== null) {
unwindInterruptedWork(interruptedWork);
interruptedWork = interruptedWork.return;
}
}
workInProgressRoot = root2;
workInProgress = createWorkInProgress(root2.current, null);
renderExpirationTime$1 = expirationTime;
workInProgressRootExitStatus = RootIncomplete;
workInProgressRootFatalError = null;
workInProgressRootLatestProcessedExpirationTime = Sync;
workInProgressRootLatestSuspenseTimeout = Sync;
workInProgressRootCanSuspendUsingConfig = null;
workInProgressRootNextUnprocessedUpdateTime = NoWork;
workInProgressRootHasPendingPing = false;
{
spawnedWorkDuringRender = null;
}
{
ReactStrictModeWarnings.discardPendingWarnings();
}
}
function handleError(root2, thrownValue) {
do {
try {
resetContextDependencies();
resetHooksAfterThrow();
resetCurrentFiber();
if (workInProgress === null || workInProgress.return === null) {
workInProgressRootExitStatus = RootFatalErrored;
workInProgressRootFatalError = thrownValue;
workInProgress = null;
return null;
}
if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
}
throwException(root2, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);
workInProgress = completeUnitOfWork(workInProgress);
} catch (yetAnotherThrownValue) {
thrownValue = yetAnotherThrownValue;
continue;
}
return;
} while (true);
}
function pushDispatcher(root2) {
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
if (prevDispatcher === null) {
return ContextOnlyDispatcher;
} else {
return prevDispatcher;
}
}
function popDispatcher(prevDispatcher) {
ReactCurrentDispatcher$1.current = prevDispatcher;
}
function pushInteractions(root2) {
{
var prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root2.memoizedInteractions;
return prevInteractions;
}
}
function popInteractions(prevInteractions) {
{
tracing.__interactionsRef.current = prevInteractions;
}
}
function markCommitTimeOfFallback() {
globalMostRecentFallbackTime = now();
}
function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {
workInProgressRootLatestProcessedExpirationTime = expirationTime;
}
if (suspenseConfig !== null) {
if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {
workInProgressRootLatestSuspenseTimeout = expirationTime;
workInProgressRootCanSuspendUsingConfig = suspenseConfig;
}
}
}
function markUnprocessedUpdateTime(expirationTime) {
if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {
workInProgressRootNextUnprocessedUpdateTime = expirationTime;
}
}
function renderDidSuspend() {
if (workInProgressRootExitStatus === RootIncomplete) {
workInProgressRootExitStatus = RootSuspended;
}
}
function renderDidSuspendDelayIfPossible() {
if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
workInProgressRootExitStatus = RootSuspendedWithDelay;
}
if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {
markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);
markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);
}
}
function renderDidError() {
if (workInProgressRootExitStatus !== RootCompleted) {
workInProgressRootExitStatus = RootErrored;
}
}
function renderHasNotSuspendedYet() {
return workInProgressRootExitStatus === RootIncomplete;
}
function inferTimeFromExpirationTime(expirationTime) {
var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
}
function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
}
function workLoopSync() {
while (workInProgress !== null) {
workInProgress = performUnitOfWork(workInProgress);
}
}
function workLoopConcurrent() {
while (workInProgress !== null && !shouldYield()) {
workInProgress = performUnitOfWork(workInProgress);
}
}
function performUnitOfWork(unitOfWork) {
var current2 = unitOfWork.alternate;
startWorkTimer(unitOfWork);
setCurrentFiber(unitOfWork);
var next;
if ((unitOfWork.mode & ProfileMode) !== NoMode) {
startProfilerTimer(unitOfWork);
next = beginWork$1(current2, unitOfWork, renderExpirationTime$1);
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
} else {
next = beginWork$1(current2, unitOfWork, renderExpirationTime$1);
}
resetCurrentFiber();
unitOfWork.memoizedProps = unitOfWork.pendingProps;
if (next === null) {
next = completeUnitOfWork(unitOfWork);
}
ReactCurrentOwner$2.current = null;
return next;
}
function completeUnitOfWork(unitOfWork) {
workInProgress = unitOfWork;
do {
var current2 = workInProgress.alternate;
var returnFiber = workInProgress.return;
if ((workInProgress.effectTag & Incomplete) === NoEffect) {
setCurrentFiber(workInProgress);
var next = void 0;
if ((workInProgress.mode & ProfileMode) === NoMode) {
next = completeWork(current2, workInProgress, renderExpirationTime$1);
} else {
startProfilerTimer(workInProgress);
next = completeWork(current2, workInProgress, renderExpirationTime$1);
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
}
stopWorkTimer(workInProgress);
resetCurrentFiber();
resetChildExpirationTime(workInProgress);
if (next !== null) {
return next;
}
if (returnFiber !== null && (returnFiber.effectTag & Incomplete) === NoEffect) {
if (returnFiber.firstEffect === null) {
returnFiber.firstEffect = workInProgress.firstEffect;
}
if (workInProgress.lastEffect !== null) {
if (returnFiber.lastEffect !== null) {
returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
}
returnFiber.lastEffect = workInProgress.lastEffect;
}
var effectTag = workInProgress.effectTag;
if (effectTag > PerformedWork) {
if (returnFiber.lastEffect !== null) {
returnFiber.lastEffect.nextEffect = workInProgress;
} else {
returnFiber.firstEffect = workInProgress;
}
returnFiber.lastEffect = workInProgress;
}
}
} else {
var _next = unwindWork(workInProgress);
if ((workInProgress.mode & ProfileMode) !== NoMode) {
stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
var actualDuration = workInProgress.actualDuration;
var child = workInProgress.child;
while (child !== null) {
actualDuration += child.actualDuration;
child = child.sibling;
}
workInProgress.actualDuration = actualDuration;
}
if (_next !== null) {
stopFailedWorkTimer(workInProgress);
_next.effectTag &= HostEffectMask;
return _next;
}
stopWorkTimer(workInProgress);
if (returnFiber !== null) {
returnFiber.firstEffect = returnFiber.lastEffect = null;
returnFiber.effectTag |= Incomplete;
}
}
var siblingFiber = workInProgress.sibling;
if (siblingFiber !== null) {
return siblingFiber;
}
workInProgress = returnFiber;
} while (workInProgress !== null);
if (workInProgressRootExitStatus === RootIncomplete) {
workInProgressRootExitStatus = RootCompleted;
}
return null;
}
function getRemainingExpirationTime(fiber) {
var updateExpirationTime = fiber.expirationTime;
var childExpirationTime = fiber.childExpirationTime;
return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;
}
function resetChildExpirationTime(completedWork) {
if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {
return;
}
var newChildExpirationTime = NoWork;
if ((completedWork.mode & ProfileMode) !== NoMode) {
var actualDuration = completedWork.actualDuration;
var treeBaseDuration = completedWork.selfBaseDuration;
var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
var child = completedWork.child;
while (child !== null) {
var childUpdateExpirationTime = child.expirationTime;
var childChildExpirationTime = child.childExpirationTime;
if (childUpdateExpirationTime > newChildExpirationTime) {
newChildExpirationTime = childUpdateExpirationTime;
}
if (childChildExpirationTime > newChildExpirationTime) {
newChildExpirationTime = childChildExpirationTime;
}
if (shouldBubbleActualDurations) {
actualDuration += child.actualDuration;
}
treeBaseDuration += child.treeBaseDuration;
child = child.sibling;
}
completedWork.actualDuration = actualDuration;
completedWork.treeBaseDuration = treeBaseDuration;
} else {
var _child = completedWork.child;
while (_child !== null) {
var _childUpdateExpirationTime = _child.expirationTime;
var _childChildExpirationTime = _child.childExpirationTime;
if (_childUpdateExpirationTime > newChildExpirationTime) {
newChildExpirationTime = _childUpdateExpirationTime;
}
if (_childChildExpirationTime > newChildExpirationTime) {
newChildExpirationTime = _childChildExpirationTime;
}
_child = _child.sibling;
}
}
completedWork.childExpirationTime = newChildExpirationTime;
}
function commitRoot(root2) {
var renderPriorityLevel = getCurrentPriorityLevel();
runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root2, renderPriorityLevel));
return null;
}
function commitRootImpl(root2, renderPriorityLevel) {
do {
flushPassiveEffects();
} while (rootWithPendingPassiveEffects !== null);
flushRenderPhaseStrictModeWarningsInDEV();
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
{
throw Error("Should not already be working.");
}
}
var finishedWork = root2.finishedWork;
var expirationTime = root2.finishedExpirationTime;
if (finishedWork === null) {
return null;
}
root2.finishedWork = null;
root2.finishedExpirationTime = NoWork;
if (!(finishedWork !== root2.current)) {
{
throw 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.callbackExpirationTime = NoWork;
root2.callbackPriority = NoPriority;
root2.nextKnownPendingLevel = NoWork;
startCommitTimer();
var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);
markRootFinishedAtTime(root2, expirationTime, remainingExpirationTimeBeforeCommit);
if (root2 === workInProgressRoot) {
workInProgressRoot = null;
workInProgress = null;
renderExpirationTime$1 = NoWork;
}
var firstEffect;
if (finishedWork.effectTag > PerformedWork) {
if (finishedWork.lastEffect !== null) {
finishedWork.lastEffect.nextEffect = finishedWork;
firstEffect = finishedWork.firstEffect;
} else {
firstEffect = finishedWork;
}
} else {
firstEffect = finishedWork.firstEffect;
}
if (firstEffect !== null) {
var prevExecutionContext = executionContext;
executionContext |= CommitContext;
var prevInteractions = pushInteractions(root2);
ReactCurrentOwner$2.current = null;
startCommitSnapshotEffectsTimer();
prepareForCommit(root2.containerInfo);
nextEffect = firstEffect;
do {
{
invokeGuardedCallback(null, commitBeforeMutationEffects, null);
if (hasCaughtError()) {
if (!(nextEffect !== null)) {
{
throw Error("Should be working on an effect.");
}
}
var error2 = clearCaughtError();
captureCommitPhaseError(nextEffect, error2);
nextEffect = nextEffect.nextEffect;
}
}
} while (nextEffect !== null);
stopCommitSnapshotEffectsTimer();
{
recordCommitTime();
}
startCommitHostEffectsTimer();
nextEffect = firstEffect;
do {
{
invokeGuardedCallback(null, commitMutationEffects, null, root2, renderPriorityLevel);
if (hasCaughtError()) {
if (!(nextEffect !== null)) {
{
throw Error("Should be working on an effect.");
}
}
var _error = clearCaughtError();
captureCommitPhaseError(nextEffect, _error);
nextEffect = nextEffect.nextEffect;
}
}
} while (nextEffect !== null);
stopCommitHostEffectsTimer();
resetAfterCommit(root2.containerInfo);
root2.current = finishedWork;
startCommitLifeCyclesTimer();
nextEffect = firstEffect;
do {
{
invokeGuardedCallback(null, commitLayoutEffects, null, root2, expirationTime);
if (hasCaughtError()) {
if (!(nextEffect !== null)) {
{
throw Error("Should be working on an effect.");
}
}
var _error2 = clearCaughtError();
captureCommitPhaseError(nextEffect, _error2);
nextEffect = nextEffect.nextEffect;
}
}
} while (nextEffect !== null);
stopCommitLifeCyclesTimer();
nextEffect = null;
requestPaint();
{
popInteractions(prevInteractions);
}
executionContext = prevExecutionContext;
} else {
root2.current = finishedWork;
startCommitSnapshotEffectsTimer();
stopCommitSnapshotEffectsTimer();
{
recordCommitTime();
}
startCommitHostEffectsTimer();
stopCommitHostEffectsTimer();
startCommitLifeCyclesTimer();
stopCommitLifeCyclesTimer();
}
stopCommitTimer();
var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
if (rootDoesHavePassiveEffects) {
rootDoesHavePassiveEffects = false;
rootWithPendingPassiveEffects = root2;
pendingPassiveEffectsExpirationTime = expirationTime;
pendingPassiveEffectsRenderPriority = renderPriorityLevel;
} else {
nextEffect = firstEffect;
while (nextEffect !== null) {
var nextNextEffect = nextEffect.nextEffect;
nextEffect.nextEffect = null;
nextEffect = nextNextEffect;
}
}
var remainingExpirationTime = root2.firstPendingTime;
if (remainingExpirationTime !== NoWork) {
{
if (spawnedWorkDuringRender !== null) {
var expirationTimes = spawnedWorkDuringRender;
spawnedWorkDuringRender = null;
for (var i = 0; i < expirationTimes.length; i++) {
scheduleInteractions(root2, expirationTimes[i], root2.memoizedInteractions);
}
}
schedulePendingInteractions(root2, remainingExpirationTime);
}
} else {
legacyErrorBoundariesThatAlreadyFailed = null;
}
{
if (!rootDidHavePassiveEffects) {
finishPendingInteractions(root2, expirationTime);
}
}
if (remainingExpirationTime === Sync) {
if (root2 === rootWithNestedUpdates) {
nestedUpdateCount++;
} else {
nestedUpdateCount = 0;
rootWithNestedUpdates = root2;
}
} else {
nestedUpdateCount = 0;
}
onCommitRoot(finishedWork.stateNode, expirationTime);
ensureRootIsScheduled(root2);
if (hasUncaughtError) {
hasUncaughtError = false;
var _error3 = firstUncaughtError;
firstUncaughtError = null;
throw _error3;
}
if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
return null;
}
flushSyncCallbackQueue();
return null;
}
function commitBeforeMutationEffects() {
while (nextEffect !== null) {
var effectTag = nextEffect.effectTag;
if ((effectTag & Snapshot) !== NoEffect) {
setCurrentFiber(nextEffect);
recordEffect();
var current2 = nextEffect.alternate;
commitBeforeMutationLifeCycles(current2, nextEffect);
resetCurrentFiber();
}
if ((effectTag & Passive) !== NoEffect) {
if (!rootDoesHavePassiveEffects) {
rootDoesHavePassiveEffects = true;
scheduleCallback(NormalPriority, function() {
flushPassiveEffects();
return null;
});
}
}
nextEffect = nextEffect.nextEffect;
}
}
function commitMutationEffects(root2, renderPriorityLevel) {
while (nextEffect !== null) {
setCurrentFiber(nextEffect);
var effectTag = nextEffect.effectTag;
if (effectTag & ContentReset) {
commitResetTextContent(nextEffect);
}
if (effectTag & Ref) {
var current2 = nextEffect.alternate;
if (current2 !== null) {
commitDetachRef(current2);
}
}
var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
switch (primaryEffectTag) {
case Placement: {
commitPlacement(nextEffect);
nextEffect.effectTag &= ~Placement;
break;
}
case PlacementAndUpdate: {
commitPlacement(nextEffect);
nextEffect.effectTag &= ~Placement;
var _current = nextEffect.alternate;
commitWork(_current, nextEffect);
break;
}
case Hydrating: {
nextEffect.effectTag &= ~Hydrating;
break;
}
case HydratingAndUpdate: {
nextEffect.effectTag &= ~Hydrating;
var _current2 = nextEffect.alternate;
commitWork(_current2, nextEffect);
break;
}
case Update: {
var _current3 = nextEffect.alternate;
commitWork(_current3, nextEffect);
break;
}
case Deletion: {
commitDeletion(root2, nextEffect, renderPriorityLevel);
break;
}
}
recordEffect();
resetCurrentFiber();
nextEffect = nextEffect.nextEffect;
}
}
function commitLayoutEffects(root2, committedExpirationTime) {
while (nextEffect !== null) {
setCurrentFiber(nextEffect);
var effectTag = nextEffect.effectTag;
if (effectTag & (Update | Callback)) {
recordEffect();
var current2 = nextEffect.alternate;
commitLifeCycles(root2, current2, nextEffect);
}
if (effectTag & Ref) {
recordEffect();
commitAttachRef(nextEffect);
}
resetCurrentFiber();
nextEffect = nextEffect.nextEffect;
}
}
function flushPassiveEffects() {
if (pendingPassiveEffectsRenderPriority !== NoPriority) {
var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;
pendingPassiveEffectsRenderPriority = NoPriority;
return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
}
}
function flushPassiveEffectsImpl() {
if (rootWithPendingPassiveEffects === null) {
return false;
}
var root2 = rootWithPendingPassiveEffects;
var expirationTime = pendingPassiveEffectsExpirationTime;
rootWithPendingPassiveEffects = null;
pendingPassiveEffectsExpirationTime = NoWork;
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
{
throw Error("Cannot flush passive effects while already rendering.");
}
}
var prevExecutionContext = executionContext;
executionContext |= CommitContext;
var prevInteractions = pushInteractions(root2);
{
var _effect2 = root2.current.firstEffect;
while (_effect2 !== null) {
{
setCurrentFiber(_effect2);
invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);
if (hasCaughtError()) {
if (!(_effect2 !== null)) {
{
throw Error("Should be working on an effect.");
}
}
var _error5 = clearCaughtError();
captureCommitPhaseError(_effect2, _error5);
}
resetCurrentFiber();
}
var nextNextEffect = _effect2.nextEffect;
_effect2.nextEffect = null;
_effect2 = nextNextEffect;
}
}
{
popInteractions(prevInteractions);
finishPendingInteractions(root2, expirationTime);
}
executionContext = prevExecutionContext;
flushSyncCallbackQueue();
nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
return true;
}
function isAlreadyFailedLegacyErrorBoundary(instance) {
return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
}
function markLegacyErrorBoundaryAsFailed(instance) {
if (legacyErrorBoundariesThatAlreadyFailed === null) {
legacyErrorBoundariesThatAlreadyFailed = 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 = createCapturedValue(error2, sourceFiber);
var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
enqueueUpdate(rootFiber, update);
var root2 = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
if (root2 !== null) {
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, Sync);
}
}
function captureCommitPhaseError(sourceFiber, error2) {
if (sourceFiber.tag === HostRoot) {
captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
return;
}
var fiber = sourceFiber.return;
while (fiber !== null) {
if (fiber.tag === HostRoot) {
captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error2);
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 = createCapturedValue(error2, sourceFiber);
var update = createClassErrorUpdate(fiber, errorInfo, Sync);
enqueueUpdate(fiber, update);
var root2 = markUpdateTimeFromFiberToRoot(fiber, Sync);
if (root2 !== null) {
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, Sync);
}
return;
}
}
fiber = fiber.return;
}
}
function pingSuspendedRoot(root2, thenable, suspendedTime) {
var pingCache = root2.pingCache;
if (pingCache !== null) {
pingCache.delete(thenable);
}
if (workInProgressRoot === root2 && renderExpirationTime$1 === suspendedTime) {
if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
prepareFreshStack(root2, renderExpirationTime$1);
} else {
workInProgressRootHasPendingPing = true;
}
return;
}
if (!isRootSuspendedAtTime(root2, suspendedTime)) {
return;
}
var lastPingedTime = root2.lastPingedTime;
if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {
return;
}
root2.lastPingedTime = suspendedTime;
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, suspendedTime);
}
function retryTimedOutBoundary(boundaryFiber, retryTime) {
if (retryTime === NoWork) {
var suspenseConfig = null;
var currentTime = requestCurrentTimeForUpdate();
retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
}
var root2 = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
if (root2 !== null) {
ensureRootIsScheduled(root2);
schedulePendingInteractions(root2, retryTime);
}
}
function resolveRetryThenable(boundaryFiber, thenable) {
var retryTime = NoWork;
var retryCache;
{
retryCache = boundaryFiber.stateNode;
}
if (retryCache !== null) {
retryCache.delete(thenable);
}
retryTimedOutBoundary(boundaryFiber, retryTime);
}
function jnd(timeElapsed) {
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
}
function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
if (busyMinDurationMs <= 0) {
return 0;
}
var busyDelayMs = suspenseConfig.busyDelayMs | 0;
var currentTimeMs = now();
var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
var timeElapsed = currentTimeMs - eventTimeMs;
if (timeElapsed <= busyDelayMs) {
return 0;
}
var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed;
return msUntilTimeout;
}
function checkForNestedUpdates() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
rootWithNestedUpdates = null;
{
{
throw 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;
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 stopFinishedWorkLoopTimer() {
var didCompleteRoot = true;
stopWorkLoopTimer(interruptedBy, didCompleteRoot);
interruptedBy = null;
}
function stopInterruptedWorkLoopTimer() {
var didCompleteRoot = false;
stopWorkLoopTimer(interruptedBy, didCompleteRoot);
interruptedBy = null;
}
function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
if (workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {
interruptedBy = fiberThatReceivedUpdate;
}
}
var didWarnStateUpdateForUnmountedComponent = null;
function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
{
var tag = fiber.tag;
if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
return;
}
var componentName = getComponentName(fiber.type) || "ReactComponent";
if (didWarnStateUpdateForUnmountedComponent !== null) {
if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
return;
}
didWarnStateUpdateForUnmountedComponent.add(componentName);
} else {
didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
}
error("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.%s", tag === ClassComponent ? "the componentWillUnmount method" : "a useEffect cleanup function", getStackByFiberInDevAndProd(fiber));
}
}
var beginWork$1;
{
var dummyFiber = null;
beginWork$1 = function(current2, unitOfWork, expirationTime) {
var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
try {
return beginWork(current2, unitOfWork, expirationTime);
} catch (originalError) {
if (originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
throw originalError;
}
resetContextDependencies();
resetHooksAfterThrow();
unwindInterruptedWork(unitOfWork);
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
if (unitOfWork.mode & ProfileMode) {
startProfilerTimer(unitOfWork);
}
invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, expirationTime);
if (hasCaughtError()) {
var replayError = clearCaughtError();
throw replayError;
} else {
throw originalError;
}
}
};
}
var didWarnAboutUpdateInRender = false;
var didWarnAboutUpdateInRenderForAnotherComponent;
{
didWarnAboutUpdateInRenderForAnotherComponent = new Set();
}
function warnAboutRenderPhaseUpdatesInDEV(fiber) {
{
if (isRendering && (executionContext & RenderContext) !== NoContext) {
switch (fiber.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent: {
var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || "Unknown";
var dedupeKey = renderingComponentName;
if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
var setStateComponentName = getComponentName(fiber.type) || "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://fb.me/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;
}
}
}
}
}
var IsThisRendererActing = {
current: false
};
function warnIfNotScopedWithMatchingAct(fiber) {
{
if (IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
error("It looks like you're using the wrong act() around your test interactions.\nBe sure to use the matching version of act() corresponding to your renderer:\n\n// for react-dom:\nimport {act} from 'react-dom/test-utils';\n// ...\nact(() => ...);\n\n// for react-test-renderer:\nimport TestRenderer from 'react-test-renderer';\nconst {act} = TestRenderer;\n// ...\nact(() => ...);%s", getStackByFiberInDevAndProd(fiber));
}
}
}
function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
{
if ((fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
error("An update to %s ran an effect, but 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://fb.me/react-wrap-tests-with-act%s", getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
}
}
}
function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
{
if (executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
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://fb.me/react-wrap-tests-with-act%s", getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
}
}
}
var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
var didWarnAboutUnmockedScheduler = false;
function warnIfUnmockedScheduler(fiber) {
{
if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === void 0) {
if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
didWarnAboutUnmockedScheduler = true;
error(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest:
jest.mock('scheduler', () => require('scheduler/unstable_mock'));
For more info, visit https://fb.me/react-mock-scheduler`);
}
}
}
}
function computeThreadID(root2, expirationTime) {
return expirationTime * 1e3 + root2.interactionThreadID;
}
function markSpawnedWork(expirationTime) {
if (spawnedWorkDuringRender === null) {
spawnedWorkDuringRender = [expirationTime];
} else {
spawnedWorkDuringRender.push(expirationTime);
}
}
function scheduleInteractions(root2, expirationTime, interactions) {
if (interactions.size > 0) {
var pendingInteractionMap = root2.pendingInteractionMap;
var pendingInteractions = pendingInteractionMap.get(expirationTime);
if (pendingInteractions != null) {
interactions.forEach(function(interaction) {
if (!pendingInteractions.has(interaction)) {
interaction.__count++;
}
pendingInteractions.add(interaction);
});
} else {
pendingInteractionMap.set(expirationTime, new Set(interactions));
interactions.forEach(function(interaction) {
interaction.__count++;
});
}
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(root2, expirationTime);
subscriber.onWorkScheduled(interactions, threadID);
}
}
}
function schedulePendingInteractions(root2, expirationTime) {
scheduleInteractions(root2, expirationTime, tracing.__interactionsRef.current);
}
function startWorkOnPendingInteractions(root2, expirationTime) {
var interactions = new Set();
root2.pendingInteractionMap.forEach(function(scheduledInteractions, scheduledExpirationTime) {
if (scheduledExpirationTime >= expirationTime) {
scheduledInteractions.forEach(function(interaction) {
return interactions.add(interaction);
});
}
});
root2.memoizedInteractions = interactions;
if (interactions.size > 0) {
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(root2, expirationTime);
try {
subscriber.onWorkStarted(interactions, threadID);
} catch (error2) {
scheduleCallback(ImmediatePriority, function() {
throw error2;
});
}
}
}
}
function finishPendingInteractions(root2, committedExpirationTime) {
var earliestRemainingTimeAfterCommit = root2.firstPendingTime;
var subscriber;
try {
subscriber = tracing.__subscriberRef.current;
if (subscriber !== null && root2.memoizedInteractions.size > 0) {
var threadID = computeThreadID(root2, committedExpirationTime);
subscriber.onWorkStopped(root2.memoizedInteractions, threadID);
}
} catch (error2) {
scheduleCallback(ImmediatePriority, function() {
throw error2;
});
} finally {
var pendingInteractionMap = root2.pendingInteractionMap;
pendingInteractionMap.forEach(function(scheduledInteractions, scheduledExpirationTime) {
if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
pendingInteractionMap.delete(scheduledExpirationTime);
scheduledInteractions.forEach(function(interaction) {
interaction.__count--;
if (subscriber !== null && interaction.__count === 0) {
try {
subscriber.onInteractionScheduledWorkCompleted(interaction);
} catch (error2) {
scheduleCallback(ImmediatePriority, function() {
throw error2;
});
}
}
});
}
});
}
}
var onScheduleFiberRoot = null;
var onCommitFiberRoot = null;
var onCommitFiberUnmount = 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://fb.me/react-devtools");
}
return true;
}
try {
var rendererID = hook.inject(internals);
if (true) {
if (typeof hook.onScheduleFiberRoot === "function") {
onScheduleFiberRoot = function(root2, children) {
try {
hook.onScheduleFiberRoot(rendererID, root2, children);
} catch (err) {
if (!hasLoggedError) {
hasLoggedError = true;
error("React instrumentation encountered an error: %s", err);
}
}
};
}
}
onCommitFiberRoot = function(root2, expirationTime) {
try {
var didError = (root2.current.effectTag & DidCapture) === DidCapture;
if (enableProfilerTimer) {
var currentTime = getCurrentTime();
var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
hook.onCommitFiberRoot(rendererID, root2, priorityLevel, didError);
} else {
hook.onCommitFiberRoot(rendererID, root2, void 0, didError);
}
} catch (err) {
if (true) {
if (!hasLoggedError) {
hasLoggedError = true;
error("React instrumentation encountered an error: %s", err);
}
}
}
};
onCommitFiberUnmount = function(fiber) {
try {
hook.onCommitFiberUnmount(rendererID, fiber);
} catch (err) {
if (true) {
if (!hasLoggedError) {
hasLoggedError = true;
error("React instrumentation encountered an error: %s", err);
}
}
}
};
} catch (err) {
{
error("React instrumentation encountered an error: %s.", err);
}
}
return true;
}
function onScheduleRoot(root2, children) {
if (typeof onScheduleFiberRoot === "function") {
onScheduleFiberRoot(root2, children);
}
}
function onCommitRoot(root2, expirationTime) {
if (typeof onCommitFiberRoot === "function") {
onCommitFiberRoot(root2, expirationTime);
}
}
function onCommitUnmount(fiber) {
if (typeof onCommitFiberUnmount === "function") {
onCommitFiberUnmount(fiber);
}
}
var hasBadMapPolyfill;
{
hasBadMapPolyfill = false;
try {
var nonExtensibleObject = Object.preventExtensions({});
var testMap = new Map([[nonExtensibleObject, null]]);
var testSet = new Set([nonExtensibleObject]);
testMap.set(0, 0);
testSet.add(0);
} catch (e3) {
hasBadMapPolyfill = true;
}
}
var debugCounter = 1;
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.effectTag = NoEffect;
this.nextEffect = null;
this.firstEffect = null;
this.lastEffect = null;
this.expirationTime = NoWork;
this.childExpirationTime = NoWork;
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._debugID = debugCounter++;
this._debugIsCurrentlyTiming = false;
}
{
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(Component2) {
var prototype = Component2.prototype;
return !!(prototype && prototype.isReactComponent);
}
function isSimpleFunctionComponent(type) {
return typeof type === "function" && !shouldConstruct(type) && type.defaultProps === void 0;
}
function resolveLazyComponentTag(Component2) {
if (typeof Component2 === "function") {
return shouldConstruct(Component2) ? ClassComponent : FunctionComponent;
} else if (Component2 !== void 0 && Component2 !== null) {
var $$typeof = Component2.$$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._debugID = current2._debugID;
}
workInProgress2._debugSource = current2._debugSource;
workInProgress2._debugOwner = current2._debugOwner;
workInProgress2._debugHookTypes = current2._debugHookTypes;
}
workInProgress2.alternate = current2;
current2.alternate = workInProgress2;
} else {
workInProgress2.pendingProps = pendingProps;
workInProgress2.effectTag = NoEffect;
workInProgress2.nextEffect = null;
workInProgress2.firstEffect = null;
workInProgress2.lastEffect = null;
{
workInProgress2.actualDuration = 0;
workInProgress2.actualStartTime = -1;
}
}
workInProgress2.childExpirationTime = current2.childExpirationTime;
workInProgress2.expirationTime = current2.expirationTime;
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 : {
expirationTime: currentDependencies.expirationTime,
firstContext: currentDependencies.firstContext,
responders: currentDependencies.responders
};
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, renderExpirationTime2) {
workInProgress2.effectTag &= Placement;
workInProgress2.nextEffect = null;
workInProgress2.firstEffect = null;
workInProgress2.lastEffect = null;
var current2 = workInProgress2.alternate;
if (current2 === null) {
workInProgress2.childExpirationTime = NoWork;
workInProgress2.expirationTime = renderExpirationTime2;
workInProgress2.child = null;
workInProgress2.memoizedProps = null;
workInProgress2.memoizedState = null;
workInProgress2.updateQueue = null;
workInProgress2.dependencies = null;
{
workInProgress2.selfBaseDuration = 0;
workInProgress2.treeBaseDuration = 0;
}
} else {
workInProgress2.childExpirationTime = current2.childExpirationTime;
workInProgress2.expirationTime = current2.expirationTime;
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 : {
expirationTime: currentDependencies.expirationTime,
firstContext: currentDependencies.firstContext,
responders: currentDependencies.responders
};
{
workInProgress2.selfBaseDuration = current2.selfBaseDuration;
workInProgress2.treeBaseDuration = current2.treeBaseDuration;
}
}
return workInProgress2;
}
function createHostRootFiber(tag) {
var mode;
if (tag === ConcurrentRoot) {
mode = ConcurrentMode | BlockingMode | StrictMode;
} else if (tag === BlockingRoot) {
mode = BlockingMode | StrictMode;
} else {
mode = NoMode;
}
if (isDevToolsPresent) {
mode |= ProfileMode;
}
return createFiber(HostRoot, null, null, mode);
}
function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime) {
var fiber;
var fiberTag = IndeterminateComponent;
var resolvedType = type;
if (typeof type === "function") {
if (shouldConstruct(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, expirationTime, key);
case REACT_CONCURRENT_MODE_TYPE:
fiberTag = Mode;
mode |= ConcurrentMode | BlockingMode | StrictMode;
break;
case REACT_STRICT_MODE_TYPE:
fiberTag = Mode;
mode |= StrictMode;
break;
case REACT_PROFILER_TYPE:
return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
case REACT_SUSPENSE_TYPE:
return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
case REACT_SUSPENSE_LIST_TYPE:
return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
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;
case REACT_BLOCK_TYPE:
fiberTag = Block;
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 ? getComponentName(owner.type) : null;
if (ownerName) {
info += "\n\nCheck the render method of `" + ownerName + "`.";
}
}
{
{
throw 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);
}
}
}
}
}
fiber = createFiber(fiberTag, pendingProps, key, mode);
fiber.elementType = type;
fiber.type = resolvedType;
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromElement(element, mode, expirationTime) {
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, expirationTime);
{
fiber._debugSource = element._source;
fiber._debugOwner = element._owner;
}
return fiber;
}
function createFiberFromFragment(elements, mode, expirationTime, key) {
var fiber = createFiber(Fragment2, elements, key, mode);
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
{
if (typeof pendingProps.id !== "string" || typeof pendingProps.onRender !== "function") {
error('Profiler must specify an "id" string and "onRender" function as props');
}
}
var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
fiber.elementType = REACT_PROFILER_TYPE;
fiber.type = REACT_PROFILER_TYPE;
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
fiber.type = REACT_SUSPENSE_TYPE;
fiber.elementType = REACT_SUSPENSE_TYPE;
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
{
fiber.type = REACT_SUSPENSE_LIST_TYPE;
}
fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromText(content, mode, expirationTime) {
var fiber = createFiber(HostText, content, null, mode);
fiber.expirationTime = expirationTime;
return fiber;
}
function createFiberFromHostInstanceForDeletion() {
var fiber = createFiber(HostComponent, null, null, NoMode);
fiber.elementType = "DELETED";
fiber.type = "DELETED";
return fiber;
}
function createFiberFromPortal(portal, mode, expirationTime) {
var pendingProps = portal.children !== null ? portal.children : [];
var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
fiber.expirationTime = expirationTime;
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.effectTag = source.effectTag;
target.nextEffect = source.nextEffect;
target.firstEffect = source.firstEffect;
target.lastEffect = source.lastEffect;
target.expirationTime = source.expirationTime;
target.childExpirationTime = source.childExpirationTime;
target.alternate = source.alternate;
{
target.actualDuration = source.actualDuration;
target.actualStartTime = source.actualStartTime;
target.selfBaseDuration = source.selfBaseDuration;
target.treeBaseDuration = source.treeBaseDuration;
}
{
target._debugID = source._debugID;
}
target._debugSource = source._debugSource;
target._debugOwner = source._debugOwner;
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
target._debugNeedsRemount = source._debugNeedsRemount;
target._debugHookTypes = source._debugHookTypes;
return target;
}
function FiberRootNode(containerInfo, tag, hydrate2) {
this.tag = tag;
this.current = null;
this.containerInfo = containerInfo;
this.pendingChildren = null;
this.pingCache = null;
this.finishedExpirationTime = NoWork;
this.finishedWork = null;
this.timeoutHandle = noTimeout;
this.context = null;
this.pendingContext = null;
this.hydrate = hydrate2;
this.callbackNode = null;
this.callbackPriority = NoPriority;
this.firstPendingTime = NoWork;
this.firstSuspendedTime = NoWork;
this.lastSuspendedTime = NoWork;
this.nextKnownPendingLevel = NoWork;
this.lastPingedTime = NoWork;
this.lastExpiredTime = NoWork;
{
this.interactionThreadID = tracing.unstable_getThreadID();
this.memoizedInteractions = new Set();
this.pendingInteractionMap = new Map();
}
}
function createFiberRoot(containerInfo, tag, hydrate2, hydrationCallbacks) {
var root2 = new FiberRootNode(containerInfo, tag, hydrate2);
var uninitializedFiber = createHostRootFiber(tag);
root2.current = uninitializedFiber;
uninitializedFiber.stateNode = root2;
initializeUpdateQueue(uninitializedFiber);
return root2;
}
function isRootSuspendedAtTime(root2, expirationTime) {
var firstSuspendedTime = root2.firstSuspendedTime;
var lastSuspendedTime = root2.lastSuspendedTime;
return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;
}
function markRootSuspendedAtTime(root2, expirationTime) {
var firstSuspendedTime = root2.firstSuspendedTime;
var lastSuspendedTime = root2.lastSuspendedTime;
if (firstSuspendedTime < expirationTime) {
root2.firstSuspendedTime = expirationTime;
}
if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {
root2.lastSuspendedTime = expirationTime;
}
if (expirationTime <= root2.lastPingedTime) {
root2.lastPingedTime = NoWork;
}
if (expirationTime <= root2.lastExpiredTime) {
root2.lastExpiredTime = NoWork;
}
}
function markRootUpdatedAtTime(root2, expirationTime) {
var firstPendingTime = root2.firstPendingTime;
if (expirationTime > firstPendingTime) {
root2.firstPendingTime = expirationTime;
}
var firstSuspendedTime = root2.firstSuspendedTime;
if (firstSuspendedTime !== NoWork) {
if (expirationTime >= firstSuspendedTime) {
root2.firstSuspendedTime = root2.lastSuspendedTime = root2.nextKnownPendingLevel = NoWork;
} else if (expirationTime >= root2.lastSuspendedTime) {
root2.lastSuspendedTime = expirationTime + 1;
}
if (expirationTime > root2.nextKnownPendingLevel) {
root2.nextKnownPendingLevel = expirationTime;
}
}
}
function markRootFinishedAtTime(root2, finishedExpirationTime, remainingExpirationTime) {
root2.firstPendingTime = remainingExpirationTime;
if (finishedExpirationTime <= root2.lastSuspendedTime) {
root2.firstSuspendedTime = root2.lastSuspendedTime = root2.nextKnownPendingLevel = NoWork;
} else if (finishedExpirationTime <= root2.firstSuspendedTime) {
root2.firstSuspendedTime = finishedExpirationTime - 1;
}
if (finishedExpirationTime <= root2.lastPingedTime) {
root2.lastPingedTime = NoWork;
}
if (finishedExpirationTime <= root2.lastExpiredTime) {
root2.lastExpiredTime = NoWork;
}
}
function markRootExpiredAtTime(root2, expirationTime) {
var lastExpiredTime = root2.lastExpiredTime;
if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {
root2.lastExpiredTime = expirationTime;
}
}
var didWarnAboutNestedUpdates;
var didWarnAboutFindNodeInStrictMode;
{
didWarnAboutNestedUpdates = false;
didWarnAboutFindNodeInStrictMode = {};
}
function getContextForSubtree(parentComponent) {
if (!parentComponent) {
return emptyContextObject;
}
var fiber = get8(parentComponent);
var parentContext = findCurrentUnmaskedContext(fiber);
if (fiber.tag === ClassComponent) {
var Component2 = fiber.type;
if (isContextProvider(Component2)) {
return processChildContext(fiber, Component2, parentContext);
}
}
return parentContext;
}
function findHostInstanceWithWarning(component, methodName) {
{
var fiber = get8(component);
if (fiber === void 0) {
if (typeof component.render === "function") {
{
{
throw Error("Unable to find node on an unmounted component.");
}
}
} else {
{
{
throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
}
}
}
}
var hostFiber = findCurrentHostFiber(fiber);
if (hostFiber === null) {
return null;
}
if (hostFiber.mode & StrictMode) {
var componentName = getComponentName(fiber.type) || "Component";
if (!didWarnAboutFindNodeInStrictMode[componentName]) {
didWarnAboutFindNodeInStrictMode[componentName] = true;
if (fiber.mode & StrictMode) {
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://fb.me/react-strict-mode-find-node%s", methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
} 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://fb.me/react-strict-mode-find-node%s", methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
}
}
}
return hostFiber.stateNode;
}
}
function createContainer(containerInfo, tag, hydrate2, hydrationCallbacks) {
return createFiberRoot(containerInfo, tag, hydrate2);
}
function updateContainer(element, container, parentComponent, callback) {
{
onScheduleRoot(container, element);
}
var current$1 = container.current;
var currentTime = requestCurrentTimeForUpdate();
{
if (typeof jest !== "undefined") {
warnIfUnmockedScheduler(current$1);
warnIfNotScopedWithMatchingAct(current$1);
}
}
var suspenseConfig = requestCurrentSuspenseConfig();
var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);
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.", getComponentName(current.type) || "Unknown");
}
}
var update = createUpdate(expirationTime, suspenseConfig);
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;
}
enqueueUpdate(current$1, update);
scheduleWork(current$1, expirationTime);
return expirationTime;
}
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 markRetryTimeImpl(fiber, retryTime) {
var suspenseState = fiber.memoizedState;
if (suspenseState !== null && suspenseState.dehydrated !== null) {
if (suspenseState.retryTime < retryTime) {
suspenseState.retryTime = retryTime;
}
}
}
function markRetryTimeIfNotHydrated(fiber, retryTime) {
markRetryTimeImpl(fiber, retryTime);
var alternate = fiber.alternate;
if (alternate) {
markRetryTimeImpl(alternate, retryTime);
}
}
function attemptUserBlockingHydration$1(fiber) {
if (fiber.tag !== SuspenseComponent) {
return;
}
var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
scheduleWork(fiber, expTime);
markRetryTimeIfNotHydrated(fiber, expTime);
}
function attemptContinuousHydration$1(fiber) {
if (fiber.tag !== SuspenseComponent) {
return;
}
scheduleWork(fiber, ContinuousHydration);
markRetryTimeIfNotHydrated(fiber, ContinuousHydration);
}
function attemptHydrationAtCurrentPriority$1(fiber) {
if (fiber.tag !== SuspenseComponent) {
return;
}
var currentTime = requestCurrentTimeForUpdate();
var expTime = computeExpirationForFiber(currentTime, fiber, null);
scheduleWork(fiber, expTime);
markRetryTimeIfNotHydrated(fiber, expTime);
}
function findHostInstanceWithNoPortals(fiber) {
var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
if (hostFiber === null) {
return null;
}
if (hostFiber.tag === FundamentalComponent) {
return hostFiber.stateNode.instance;
}
return hostFiber.stateNode;
}
var shouldSuspendImpl = function(fiber) {
return false;
};
function shouldSuspend(fiber) {
return shouldSuspendImpl(fiber);
}
var overrideHookState = null;
var overrideProps = null;
var scheduleUpdate = null;
var setSuspenseHandler = null;
{
var copyWithSetImpl = function(obj, path, idx, value) {
if (idx >= path.length) {
return value;
}
var key = path[idx];
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
return updated;
};
var copyWithSet = function(obj, path, value) {
return copyWithSetImpl(obj, path, 0, value);
};
overrideHookState = function(fiber, id, path, value) {
var currentHook2 = fiber.memoizedState;
while (currentHook2 !== null && id > 0) {
currentHook2 = currentHook2.next;
id--;
}
if (currentHook2 !== null) {
var newState = copyWithSet(currentHook2.memoizedState, path, value);
currentHook2.memoizedState = newState;
currentHook2.baseState = newState;
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
scheduleWork(fiber, Sync);
}
};
overrideProps = function(fiber, path, value) {
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
if (fiber.alternate) {
fiber.alternate.pendingProps = fiber.pendingProps;
}
scheduleWork(fiber, Sync);
};
scheduleUpdate = function(fiber) {
scheduleWork(fiber, Sync);
};
setSuspenseHandler = function(newShouldSuspendImpl) {
shouldSuspendImpl = newShouldSuspendImpl;
};
}
function injectIntoDevTools(devToolsConfig) {
var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
return injectInternals(_assign({}, devToolsConfig, {
overrideHookState,
overrideProps,
setSuspenseHandler,
scheduleUpdate,
currentDispatcherRef: ReactCurrentDispatcher2,
findHostInstanceByFiber: function(fiber) {
var hostFiber = findCurrentHostFiber(fiber);
if (hostFiber === null) {
return null;
}
return hostFiber.stateNode;
},
findFiberByHostInstance: function(instance) {
if (!findFiberByHostInstance) {
return null;
}
return findFiberByHostInstance(instance);
},
findHostInstancesForRefresh,
scheduleRefresh,
scheduleRoot,
setRefreshHandler,
getCurrentFiber: function() {
return current;
}
}));
}
var IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;
function ReactDOMRoot(container, options) {
this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
}
function ReactDOMBlockingRoot(container, tag, options) {
this._internalRoot = createRootImpl(container, tag, options);
}
ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function(children) {
var root2 = this._internalRoot;
{
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().");
}
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);
};
ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.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;
var container = root2.containerInfo;
updateContainer(null, root2, null, function() {
unmarkContainerAsRoot(container);
});
};
function createRootImpl(container, tag, options) {
var hydrate2 = options != null && options.hydrate === true;
var hydrationCallbacks = options != null && options.hydrationOptions || null;
var root2 = createContainer(container, tag, hydrate2);
markContainerAsRoot(root2.current, container);
if (hydrate2 && tag !== LegacyRoot) {
var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
eagerlyTrapReplayableEvents(container, doc);
}
return root2;
}
function createLegacyRoot(container, options) {
return new ReactDOMBlockingRoot(container, LegacyRoot, options);
}
function isValidContainer(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 "));
}
var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
var topLevelUpdateWarnings;
var warnedAboutHydrateAPI = false;
{
topLevelUpdateWarnings = function(container) {
if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.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$1(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 shouldHydrateDueToLegacyHeuristic(container) {
var rootElement = getReactRootElementInContainer(container);
return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
}
function legacyCreateRootFromDOMContainer(container, forceHydrate) {
var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
if (!shouldHydrate) {
var warned = false;
var rootSibling;
while (rootSibling = container.lastChild) {
{
if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
warned = true;
error("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.");
}
}
container.removeChild(rootSibling);
}
}
{
if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
warnedAboutHydrateAPI = true;
warn("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v17. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.");
}
}
return createLegacyRoot(container, shouldHydrate ? {
hydrate: true
} : void 0);
}
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 root2 = container._reactRootContainer;
var fiberRoot;
if (!root2) {
root2 = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
fiberRoot = root2._internalRoot;
if (typeof callback === "function") {
var originalCallback = callback;
callback = function() {
var instance = getPublicRootInstance(fiberRoot);
originalCallback.call(instance);
};
}
unbatchedUpdates(function() {
updateContainer(children, fiberRoot, parentComponent, callback);
});
} else {
fiberRoot = root2._internalRoot;
if (typeof callback === "function") {
var _originalCallback = callback;
callback = function() {
var instance = getPublicRootInstance(fiberRoot);
_originalCallback.call(instance);
};
}
updateContainer(children, fiberRoot, parentComponent, callback);
}
return getPublicRootInstance(fiberRoot);
}
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.", getComponentName(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) {
if (!isValidContainer(container)) {
{
throw 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 ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
}
}
return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
}
function render3(element, container, callback) {
if (!isValidContainer(container)) {
{
throw 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 ReactDOM.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) {
if (!isValidContainer(containerNode)) {
{
throw Error("Target container is not a DOM element.");
}
}
if (!(parentComponent != null && has(parentComponent))) {
{
throw Error("parentComponent must be a valid React Component");
}
}
return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
}
function unmountComponentAtNode(container) {
if (!isValidContainer(container)) {
{
throw 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 ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
}
}
if (container._reactRootContainer) {
{
var rootEl = getReactRootElementInContainer(container);
var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
if (renderedByDifferentReact) {
error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
}
}
unbatchedUpdates(function() {
legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
container._reactRootContainer = null;
unmarkContainerAsRoot(container);
});
});
return true;
} else {
{
var _rootEl = getReactRootElementInContainer(container);
var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));
var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(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;
}
}
function createPortal(children, containerInfo, implementation) {
var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
return {
$$typeof: REACT_PORTAL_TYPE,
key: key == null ? null : "" + key,
children,
containerInfo,
implementation
};
}
var ReactVersion = "16.14.0";
setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
setAttemptContinuousHydration(attemptContinuousHydration$1);
setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
var didWarnAboutUnstableCreatePortal = false;
{
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://fb.me/react-polyfills");
}
}
setRestoreImplementation(restoreControlledState$3);
setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
function createPortal$1(children, container) {
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
if (!isValidContainer(container)) {
{
throw 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);
}
function unstable_createPortal(children, container) {
var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
{
if (!didWarnAboutUnstableCreatePortal) {
didWarnAboutUnstableCreatePortal = true;
warn('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.');
}
}
return createPortal$1(children, container, key);
}
var Internals = {
Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
};
var foundDevTools = injectIntoDevTools({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: ReactVersion,
rendererPackageName: "react-dom"
});
{
if (!foundDevTools && canUseDOM && 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://fb.me/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://fb.me/react-devtools-faq" : ""), "font-weight:bold");
}
}
}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal$1;
exports.findDOMNode = findDOMNode;
exports.flushSync = flushSync;
exports.hydrate = hydrate;
exports.render = render3;
exports.unmountComponentAtNode = unmountComponentAtNode;
exports.unstable_batchedUpdates = batchedUpdates$1;
exports.unstable_createPortal = unstable_createPortal;
exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
exports.version = ReactVersion;
})();
}
});
// node_modules/react-dom/index.js
var require_react_dom = __commonJS((exports, module) => {
"use strict";
if (false) {
checkDCE();
module.exports = null;
} else {
module.exports = require_react_dom_development();
}
});
// node_modules/@babel/runtime/helpers/extends.js
var require_extends = __commonJS((exports, module) => {
function _extends12() {
module.exports = _extends12 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends12.apply(this, arguments);
}
module.exports = _extends12;
});
// node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
var require_objectWithoutPropertiesLoose = __commonJS((exports, module) => {
function _objectWithoutPropertiesLoose7(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
module.exports = _objectWithoutPropertiesLoose7;
});
// node_modules/@babel/runtime/helpers/setPrototypeOf.js
var require_setPrototypeOf = __commonJS((exports, module) => {
function _setPrototypeOf2(o2, p) {
module.exports = _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p2) {
o3.__proto__ = p2;
return o3;
};
return _setPrototypeOf2(o2, p);
}
module.exports = _setPrototypeOf2;
});
// node_modules/@babel/runtime/helpers/inheritsLoose.js
var require_inheritsLoose = __commonJS((exports, module) => {
var setPrototypeOf = require_setPrototypeOf();
function _inheritsLoose2(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
setPrototypeOf(subClass, superClass);
}
module.exports = _inheritsLoose2;
});
// node_modules/@babel/runtime/helpers/defineProperty.js
var require_defineProperty = __commonJS((exports, module) => {
function _defineProperty8(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty8;
});
// node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js
var require_taggedTemplateLiteralLoose = __commonJS((exports, module) => {
function _taggedTemplateLiteralLoose3(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
strings.raw = raw;
return strings;
}
module.exports = _taggedTemplateLiteralLoose3;
});
// node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS((exports) => {
/** @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.
*/
"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 isValidElementType(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 Element2 = 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 isContextConsumer(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 = Element2;
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 = isContextConsumer;
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 = isValidElementType;
exports.typeOf = typeOf;
})();
}
});
// node_modules/react-is/index.js
var require_react_is = __commonJS((exports, module) => {
"use strict";
if (false) {
module.exports = null;
} else {
module.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((exports, module) => {
"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 hoistNonReactStatics2(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== "string") {
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics2(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
defineProperty(targetComponent, key, descriptor);
} catch (e3) {
}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics2;
});
// node_modules/isomorphic-ws/browser.js
var require_browser = __commonJS((exports, module) => {
var ws = null;
if (typeof WebSocket !== "undefined") {
ws = WebSocket;
} else if (typeof MozWebSocket !== "undefined") {
ws = MozWebSocket;
} else if (typeof global !== "undefined") {
ws = global.WebSocket || global.MozWebSocket;
} else if (typeof window !== "undefined") {
ws = window.WebSocket || window.MozWebSocket;
} else if (typeof self !== "undefined") {
ws = self.WebSocket || self.MozWebSocket;
}
module.exports = ws;
});
// node_modules/osc-js/lib/osc.js
var require_osc = __commonJS((exports, module) => {
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.OSC = factory());
})(exports, function() {
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props2) {
for (var i = 0; i < props2.length; i++) {
var descriptor = props2[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty8(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function ownKeys8(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread22(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys8(Object(source), true).forEach(function(key) {
_defineProperty8(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys8(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass)
_setPrototypeOf2(subClass, superClass);
}
function _getPrototypeOf(o2) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf(o2);
}
function _setPrototypeOf2(o2, p) {
_setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p2) {
o3.__proto__ = p2;
return o3;
};
return _setPrototypeOf2(o2, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
}));
return true;
} catch (e3) {
return false;
}
}
function _assertThisInitialized(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _possibleConstructorReturn(self2, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return _assertThisInitialized(self2);
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function _createSuperInternal() {
var Super = _getPrototypeOf(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _getPrototypeOf(object);
if (object === null)
break;
}
return object;
}
function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get2(target2, property2, receiver2) {
var base = _superPropBase(target2, property2);
if (!base)
return;
var desc = Object.getOwnPropertyDescriptor(base, property2);
if (desc.get) {
return desc.get.call(receiver2);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
function isInt(n4) {
return Number(n4) === n4 && n4 % 1 === 0;
}
function isFloat(n4) {
return Number(n4) === n4 && n4 % 1 !== 0;
}
function isString2(n4) {
return typeof n4 === "string";
}
function isArray2(n4) {
return Object.prototype.toString.call(n4) === "[object Array]";
}
function isObject2(n4) {
return Object.prototype.toString.call(n4) === "[object Object]";
}
function isFunction2(n4) {
return typeof n4 === "function";
}
function isBlob(n4) {
return n4 instanceof Uint8Array;
}
function isDate(n4) {
return n4 instanceof Date;
}
function isUndefined2(n4) {
return typeof n4 === "undefined";
}
function pad(n4) {
return n4 + 3 & ~3;
}
function hasProperty(name) {
return Object.prototype.hasOwnProperty.call(typeof global !== "undefined" ? global : window, name);
}
function dataView(obj) {
if (obj.buffer) {
return new DataView(obj.buffer);
} else if (obj instanceof ArrayBuffer) {
return new DataView(obj);
}
return new DataView(new Uint8Array(obj));
}
function typeTag(item) {
if (isInt(item)) {
return "i";
} else if (isFloat(item)) {
return "f";
} else if (isString2(item)) {
return "s";
} else if (isBlob(item)) {
return "b";
}
throw new Error("OSC typeTag() found unknown value type");
}
function prepareAddress(obj) {
var address = "";
if (isArray2(obj)) {
return "/".concat(obj.join("/"));
} else if (isString2(obj)) {
address = obj;
if (address.length > 1 && address[address.length - 1] === "/") {
address = address.slice(0, address.length - 1);
}
if (address.length > 1 && address[0] !== "/") {
address = "/".concat(address);
}
return address;
}
throw new Error("OSC prepareAddress() needs addresses of type array or string");
}
function prepareRegExPattern(str) {
var pattern;
if (!isString2(str)) {
throw new Error("OSC prepareRegExPattern() needs strings");
}
pattern = str.replace(/\./g, "\\.");
pattern = pattern.replace(/\(/g, "\\(");
pattern = pattern.replace(/\)/g, "\\)");
pattern = pattern.replace(/\{/g, "(");
pattern = pattern.replace(/\}/g, ")");
pattern = pattern.replace(/,/g, "|");
pattern = pattern.replace(/\[!/g, "[^");
pattern = pattern.replace(/\?/g, ".");
pattern = pattern.replace(/\*/g, ".*");
return pattern;
}
var EncodeHelper = function() {
function EncodeHelper2() {
_classCallCheck(this, EncodeHelper2);
this.data = [];
this.byteLength = 0;
}
_createClass(EncodeHelper2, [{
key: "add",
value: function add(item) {
var buffer = item.pack();
this.byteLength += buffer.byteLength;
this.data.push(buffer);
return this;
}
}, {
key: "merge",
value: function merge4() {
var result = new Uint8Array(this.byteLength);
var offset = 0;
this.data.forEach(function(data) {
result.set(data, offset);
offset += data.byteLength;
});
return result;
}
}]);
return EncodeHelper2;
}();
var Atomic = function() {
function Atomic2(value) {
_classCallCheck(this, Atomic2);
this.value = value;
this.offset = 0;
}
_createClass(Atomic2, [{
key: "pack",
value: function pack(method, byteLength) {
if (!(method && byteLength)) {
throw new Error("OSC Atomic cant't be packed without given method or byteLength");
}
var data = new Uint8Array(byteLength);
var dataView2 = new DataView(data.buffer);
if (isUndefined2(this.value)) {
throw new Error("OSC Atomic cant't be encoded with empty value");
}
dataView2[method](this.offset, this.value, false);
return data;
}
}, {
key: "unpack",
value: function unpack(dataView2, method, byteLength) {
var initialOffset = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
if (!(dataView2 && method && byteLength)) {
throw new Error("OSC Atomic cant't be unpacked without given dataView, method or byteLength");
}
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC Atomic expects an instance of type DataView");
}
this.value = dataView2[method](initialOffset, false);
this.offset = initialOffset + byteLength;
return this.offset;
}
}]);
return Atomic2;
}();
var AtomicInt32 = function(_Atomic) {
_inherits(AtomicInt322, _Atomic);
var _super = _createSuper(AtomicInt322);
function AtomicInt322(value) {
_classCallCheck(this, AtomicInt322);
if (value && !isInt(value)) {
throw new Error("OSC AtomicInt32 constructor expects value of type number");
}
return _super.call(this, value);
}
_createClass(AtomicInt322, [{
key: "pack",
value: function pack() {
return _get(_getPrototypeOf(AtomicInt322.prototype), "pack", this).call(this, "setInt32", 4);
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
return _get(_getPrototypeOf(AtomicInt322.prototype), "unpack", this).call(this, dataView2, "getInt32", 4, initialOffset);
}
}]);
return AtomicInt322;
}(Atomic);
var STR_SLICE_SIZE = 65537;
var STR_ENCODING = "utf-8";
function charCodesToString(charCodes) {
if (hasProperty("Buffer")) {
return Buffer.from(charCodes).toString(STR_ENCODING);
} else if (hasProperty("TextDecoder")) {
return new TextDecoder(STR_ENCODING).decode(new Int8Array(charCodes));
}
var str = "";
for (var i = 0; i < charCodes.length; i += STR_SLICE_SIZE) {
str += String.fromCharCode.apply(null, charCodes.slice(i, i + STR_SLICE_SIZE));
}
return str;
}
var AtomicString = function(_Atomic) {
_inherits(AtomicString2, _Atomic);
var _super = _createSuper(AtomicString2);
function AtomicString2(value) {
_classCallCheck(this, AtomicString2);
if (value && !isString2(value)) {
throw new Error("OSC AtomicString constructor expects value of type string");
}
return _super.call(this, value);
}
_createClass(AtomicString2, [{
key: "pack",
value: function pack() {
if (isUndefined2(this.value)) {
throw new Error("OSC AtomicString can not be encoded with empty value");
}
var terminated = "".concat(this.value, "\0");
var byteLength = pad(terminated.length);
var buffer = new Uint8Array(byteLength);
for (var i = 0; i < terminated.length; i += 1) {
buffer[i] = terminated.charCodeAt(i);
}
return buffer;
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC AtomicString expects an instance of type DataView");
}
var offset = initialOffset;
var charcode;
var charCodes = [];
for (; offset < dataView2.byteLength; offset += 1) {
charcode = dataView2.getUint8(offset);
if (charcode !== 0) {
charCodes.push(charcode);
} else {
offset += 1;
break;
}
}
if (offset === dataView2.length) {
throw new Error("OSC AtomicString found a malformed OSC string");
}
this.offset = pad(offset);
this.value = charCodesToString(charCodes);
return this.offset;
}
}]);
return AtomicString2;
}(Atomic);
var SECONDS_70_YEARS = 2208988800;
var TWO_POWER_32 = 4294967296;
var Timetag = function() {
function Timetag2() {
var seconds = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
var fractions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
_classCallCheck(this, Timetag2);
if (!(isInt(seconds) && isInt(fractions))) {
throw new Error("OSC Timetag constructor expects values of type integer number");
}
this.seconds = seconds;
this.fractions = fractions;
}
_createClass(Timetag2, [{
key: "timestamp",
value: function timestamp(milliseconds) {
var seconds;
if (typeof milliseconds === "number") {
seconds = milliseconds / 1e3;
var rounded = Math.floor(seconds);
this.seconds = rounded + SECONDS_70_YEARS;
this.fractions = Math.round(TWO_POWER_32 * (seconds - rounded));
return milliseconds;
}
seconds = this.seconds - SECONDS_70_YEARS;
return (seconds + Math.round(this.fractions / TWO_POWER_32)) * 1e3;
}
}]);
return Timetag2;
}();
var AtomicTimetag = function(_Atomic) {
_inherits(AtomicTimetag2, _Atomic);
var _super = _createSuper(AtomicTimetag2);
function AtomicTimetag2() {
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Date.now();
_classCallCheck(this, AtomicTimetag2);
var timetag = new Timetag();
if (value instanceof Timetag) {
timetag = value;
} else if (isInt(value)) {
timetag.timestamp(value);
} else if (isDate(value)) {
timetag.timestamp(value.getTime());
}
return _super.call(this, timetag);
}
_createClass(AtomicTimetag2, [{
key: "pack",
value: function pack() {
if (isUndefined2(this.value)) {
throw new Error("OSC AtomicTimetag can not be encoded with empty value");
}
var _this$value = this.value, seconds = _this$value.seconds, fractions = _this$value.fractions;
var data = new Uint8Array(8);
var dataView2 = new DataView(data.buffer);
dataView2.setInt32(0, seconds, false);
dataView2.setInt32(4, fractions, false);
return data;
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC AtomicTimetag expects an instance of type DataView");
}
var seconds = dataView2.getUint32(initialOffset, false);
var fractions = dataView2.getUint32(initialOffset + 4, false);
this.value = new Timetag(seconds, fractions);
this.offset = initialOffset + 8;
return this.offset;
}
}]);
return AtomicTimetag2;
}(Atomic);
var AtomicBlob = function(_Atomic) {
_inherits(AtomicBlob2, _Atomic);
var _super = _createSuper(AtomicBlob2);
function AtomicBlob2(value) {
_classCallCheck(this, AtomicBlob2);
if (value && !isBlob(value)) {
throw new Error("OSC AtomicBlob constructor expects value of type Uint8Array");
}
return _super.call(this, value);
}
_createClass(AtomicBlob2, [{
key: "pack",
value: function pack() {
if (isUndefined2(this.value)) {
throw new Error("OSC AtomicBlob can not be encoded with empty value");
}
var byteLength = pad(this.value.byteLength);
var data = new Uint8Array(byteLength + 4);
var dataView2 = new DataView(data.buffer);
dataView2.setInt32(0, this.value.byteLength, false);
data.set(this.value, 4);
return data;
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC AtomicBlob expects an instance of type DataView");
}
var byteLength = dataView2.getInt32(initialOffset, false);
this.value = new Uint8Array(dataView2.buffer, initialOffset + 4, byteLength);
this.offset = pad(initialOffset + 4 + byteLength);
return this.offset;
}
}]);
return AtomicBlob2;
}(Atomic);
var AtomicFloat32 = function(_Atomic) {
_inherits(AtomicFloat322, _Atomic);
var _super = _createSuper(AtomicFloat322);
function AtomicFloat322(value) {
_classCallCheck(this, AtomicFloat322);
if (value && !isFloat(value)) {
throw new Error("OSC AtomicFloat32 constructor expects value of type float");
}
return _super.call(this, value);
}
_createClass(AtomicFloat322, [{
key: "pack",
value: function pack() {
return _get(_getPrototypeOf(AtomicFloat322.prototype), "pack", this).call(this, "setFloat32", 4);
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
return _get(_getPrototypeOf(AtomicFloat322.prototype), "unpack", this).call(this, dataView2, "getFloat32", 4, initialOffset);
}
}]);
return AtomicFloat322;
}(Atomic);
var Message2 = function() {
function Message3() {
_classCallCheck(this, Message3);
this.offset = 0;
this.address = "";
this.types = "";
this.args = [];
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length > 0) {
if (!(isString2(args[0]) || isArray2(args[0]))) {
throw new Error("OSC Message constructor first argument (address) must be a string or array");
}
this.address = prepareAddress(args.shift());
this.types = args.map(function(item) {
return typeTag(item);
}).join("");
this.args = args;
}
}
_createClass(Message3, [{
key: "add",
value: function add(item) {
if (isUndefined2(item)) {
throw new Error("OSC Message needs a valid OSC Atomic Data Type");
}
this.args.push(item);
this.types += typeTag(item);
}
}, {
key: "pack",
value: function pack() {
if (this.address.length === 0 || this.address[0] !== "/") {
throw new Error("OSC Message has an invalid address");
}
var encoder = new EncodeHelper();
encoder.add(new AtomicString(this.address));
encoder.add(new AtomicString(",".concat(this.types)));
if (this.args.length > 0) {
var argument;
this.args.forEach(function(value) {
if (isInt(value)) {
argument = new AtomicInt32(value);
} else if (isFloat(value)) {
argument = new AtomicFloat32(value);
} else if (isString2(value)) {
argument = new AtomicString(value);
} else if (isBlob(value)) {
argument = new AtomicBlob(value);
} else {
throw new Error("OSC Message found unknown argument type");
}
encoder.add(argument);
});
}
return encoder.merge();
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC Message expects an instance of type DataView.");
}
var address = new AtomicString();
address.unpack(dataView2, initialOffset);
var types = new AtomicString();
types.unpack(dataView2, address.offset);
if (address.value.length === 0 || address.value[0] !== "/") {
throw new Error("OSC Message found malformed or missing address string");
}
if (types.value.length === 0 && types.value[0] !== ",") {
throw new Error("OSC Message found malformed or missing type string");
}
var offset = types.offset;
var next;
var type;
var args = [];
for (var i = 1; i < types.value.length; i += 1) {
type = types.value[i];
if (type === "i") {
next = new AtomicInt32();
} else if (type === "f") {
next = new AtomicFloat32();
} else if (type === "s") {
next = new AtomicString();
} else if (type === "b") {
next = new AtomicBlob();
} else {
throw new Error("OSC Message found non-standard argument type");
}
offset = next.unpack(dataView2, offset);
args.push(next.value);
}
this.offset = offset;
this.address = address.value;
this.types = types.value;
this.args = args;
return this.offset;
}
}]);
return Message3;
}();
var BUNDLE_TAG = "#bundle";
var Bundle = function() {
function Bundle2() {
var _this = this;
_classCallCheck(this, Bundle2);
this.offset = 0;
this.timetag = new AtomicTimetag();
this.bundleElements = [];
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length > 0) {
if (args[0] instanceof Date || isInt(args[0])) {
this.timetag = new AtomicTimetag(args[0]);
} else if (isArray2(args[0])) {
args[0].forEach(function(item) {
_this.add(item);
});
if (args.length > 1 && (args[1] instanceof Date || isInt(args[0]))) {
this.timetag = new AtomicTimetag(args[1]);
}
} else {
args.forEach(function(item) {
_this.add(item);
});
}
}
}
_createClass(Bundle2, [{
key: "timestamp",
value: function timestamp(ms) {
if (!isInt(ms)) {
throw new Error("OSC Bundle needs an integer for setting the timestamp");
}
this.timetag = new AtomicTimetag(ms);
}
}, {
key: "add",
value: function add(item) {
if (!(item instanceof Message2 || item instanceof Bundle2)) {
throw new Error("OSC Bundle contains only Messages and Bundles");
}
this.bundleElements.push(item);
}
}, {
key: "pack",
value: function pack() {
var encoder = new EncodeHelper();
encoder.add(new AtomicString(BUNDLE_TAG));
if (!this.timetag) {
this.timetag = new AtomicTimetag();
}
encoder.add(this.timetag);
this.bundleElements.forEach(function(item) {
encoder.add(new AtomicInt32(item.pack().byteLength));
encoder.add(item);
});
return encoder.merge();
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC Bundle expects an instance of type DataView");
}
var parentHead = new AtomicString();
parentHead.unpack(dataView2, initialOffset);
if (parentHead.value !== BUNDLE_TAG) {
throw new Error("OSC Bundle does not contain a valid #bundle head");
}
var timetag = new AtomicTimetag();
var offset = timetag.unpack(dataView2, parentHead.offset);
this.bundleElements = [];
while (offset < dataView2.byteLength) {
var head = new AtomicString();
var size2 = new AtomicInt32();
offset = size2.unpack(dataView2, offset);
var item = void 0;
head.unpack(dataView2, offset);
if (head.value === BUNDLE_TAG) {
item = new Bundle2();
} else {
item = new Message2();
}
offset = item.unpack(dataView2, offset);
this.bundleElements.push(item);
}
this.offset = offset;
this.timetag = timetag;
return this.offset;
}
}]);
return Bundle2;
}();
var Packet = function() {
function Packet2(value) {
_classCallCheck(this, Packet2);
if (value && !(value instanceof Message2 || value instanceof Bundle)) {
throw new Error("OSC Packet value has to be Message or Bundle");
}
this.value = value;
this.offset = 0;
}
_createClass(Packet2, [{
key: "pack",
value: function pack() {
if (!this.value) {
throw new Error("OSC Packet can not be encoded with empty body");
}
return this.value.pack();
}
}, {
key: "unpack",
value: function unpack(dataView2) {
var initialOffset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
if (!(dataView2 instanceof DataView)) {
throw new Error("OSC Packet expects an instance of type DataView");
}
if (dataView2.byteLength % 4 !== 0) {
throw new Error("OSC Packet byteLength has to be a multiple of four");
}
var head = new AtomicString();
head.unpack(dataView2, initialOffset);
var item;
if (head.value === BUNDLE_TAG) {
item = new Bundle();
} else {
item = new Message2();
}
item.unpack(dataView2, initialOffset);
this.offset = item.offset;
this.value = item;
return this.offset;
}
}]);
return Packet2;
}();
var defaultOptions2 = {
discardLateMessages: false
};
var EventHandler = function() {
function EventHandler2(options) {
_classCallCheck(this, EventHandler2);
this.options = _objectSpread22(_objectSpread22({}, defaultOptions2), options);
this.addressHandlers = [];
this.eventHandlers = {
open: [],
error: [],
close: []
};
this.uuid = 0;
}
_createClass(EventHandler2, [{
key: "dispatch",
value: function dispatch(packet, rinfo) {
var _this = this;
if (!(packet instanceof Packet)) {
throw new Error("OSC EventHander dispatch() accepts only arguments of type Packet");
}
if (!packet.value) {
throw new Error("OSC EventHander dispatch() can't read empty Packets");
}
if (packet.value instanceof Bundle) {
var bundle = packet.value;
return bundle.bundleElements.forEach(function(bundleItem) {
if (bundleItem instanceof Bundle) {
if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) {
throw new Error("OSC Bundle timestamp is older than the timestamp of enclosed Bundles");
}
return _this.dispatch(bundleItem);
} else if (bundleItem instanceof Message2) {
var message2 = bundleItem;
return _this.notify(message2.address, message2, bundle.timetag.value.timestamp(), rinfo);
}
throw new Error("OSC EventHander dispatch() can't dispatch unknown Packet value");
});
} else if (packet.value instanceof Message2) {
var message = packet.value;
return this.notify(message.address, message, 0, rinfo);
}
throw new Error("OSC EventHander dispatch() can't dispatch unknown Packet value");
}
}, {
key: "call",
value: function call(name, data, rinfo) {
var success = false;
if (isString2(name) && name in this.eventHandlers) {
this.eventHandlers[name].forEach(function(handler) {
handler.callback(data, rinfo);
success = true;
});
return success;
}
var handlerKeys = Object.keys(this.addressHandlers);
var handlers = this.addressHandlers;
handlerKeys.forEach(function(key) {
var foundMatch = false;
var regex = new RegExp(prepareRegExPattern(prepareAddress(name)), "g");
var test = regex.test(key);
if (test && key.length === regex.lastIndex) {
foundMatch = true;
}
if (!foundMatch) {
var reverseRegex = new RegExp(prepareRegExPattern(prepareAddress(key)), "g");
var reverseTest = reverseRegex.test(name);
if (reverseTest && name.length === reverseRegex.lastIndex) {
foundMatch = true;
}
}
if (foundMatch) {
handlers[key].forEach(function(handler) {
handler.callback(data, rinfo);
success = true;
});
}
});
return success;
}
}, {
key: "notify",
value: function notify() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args.length === 0) {
throw new Error("OSC EventHandler can not be called without any argument");
}
if (args[0] instanceof Packet) {
return this.dispatch(args[0], args[1]);
} else if (args[0] instanceof Bundle || args[0] instanceof Message2) {
return this.dispatch(new Packet(args[0]), args[1]);
} else if (!isString2(args[0])) {
var packet = new Packet();
packet.unpack(dataView(args[0]));
return this.dispatch(packet, args[1]);
}
var name = args[0];
var data = null;
if (args.length > 1) {
data = args[1];
}
var timestamp = null;
if (args.length > 2) {
if (isInt(args[2])) {
timestamp = args[2];
} else if (args[2] instanceof Date) {
timestamp = args[2].getTime();
} else {
throw new Error("OSC EventHandler timestamp has to be a number or Date");
}
}
var rinfo = null;
if (args.length >= 3) {
rinfo = args[3];
}
if (timestamp) {
var now = Date.now();
if (now > timestamp) {
if (!this.options.discardLateMessages) {
return this.call(name, data, rinfo);
}
}
var that = this;
setTimeout(function() {
that.call(name, data, rinfo);
}, timestamp - now);
return true;
}
return this.call(name, data, rinfo);
}
}, {
key: "on",
value: function on(name, callback) {
if (!(isString2(name) || isArray2(name))) {
throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");
}
if (!isFunction2(callback)) {
throw new Error("OSC EventHandler callback has to be a function");
}
this.uuid += 1;
var handler = {
id: this.uuid,
callback
};
if (isString2(name) && name in this.eventHandlers) {
this.eventHandlers[name].push(handler);
return this.uuid;
}
var address = prepareAddress(name);
if (!(address in this.addressHandlers)) {
this.addressHandlers[address] = [];
}
this.addressHandlers[address].push(handler);
return this.uuid;
}
}, {
key: "off",
value: function off(name, subscriptionId) {
if (!(isString2(name) || isArray2(name))) {
throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");
}
if (!isInt(subscriptionId)) {
throw new Error("OSC EventHandler subscription id has to be a number");
}
var key;
var haystack;
if (isString2(name) && name in this.eventHandlers) {
key = name;
haystack = this.eventHandlers;
} else {
key = prepareAddress(name);
haystack = this.addressHandlers;
}
if (key in haystack) {
return haystack[key].some(function(item, index2) {
if (item.id === subscriptionId) {
haystack[key].splice(index2, 1);
return true;
}
return false;
});
}
return false;
}
}]);
return EventHandler2;
}();
var dgram = typeof __dirname !== "undefined" ? require("dgram") : void 0;
var STATUS2 = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var defaultOpenOptions = {
host: "localhost",
port: 41234,
exclusive: false
};
var defaultSendOptions = {
host: "localhost",
port: 41235
};
var defaultOptions$1 = {
type: "udp4",
open: defaultOpenOptions,
send: defaultSendOptions
};
function mergeOptions(base, custom) {
return _objectSpread22(_objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$1), base), custom), {}, {
open: _objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$1.open), base.open), custom.open),
send: _objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$1.send), base.send), custom.send)
});
}
var DatagramPlugin = function() {
function DatagramPlugin2() {
var _this = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
_classCallCheck(this, DatagramPlugin2);
if (!dgram) {
throw new Error("DatagramPlugin can not be used in browser context");
}
this.options = mergeOptions({}, customOptions);
this.socket = dgram.createSocket(this.options.type);
this.socketStatus = STATUS2.IS_NOT_INITIALIZED;
this.socket.on("message", function(message, rinfo) {
_this.notify(message, rinfo);
});
this.socket.on("error", function(error) {
_this.notify("error", error);
});
this.notify = function() {
};
}
_createClass(DatagramPlugin2, [{
key: "registerNotify",
value: function registerNotify(fn) {
this.notify = fn;
}
}, {
key: "status",
value: function status() {
return this.socketStatus;
}
}, {
key: "open",
value: function open() {
var _this2 = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var options = _objectSpread22(_objectSpread22({}, this.options.open), customOptions);
var port = options.port, exclusive = options.exclusive;
this.socketStatus = STATUS2.IS_CONNECTING;
this.socket.bind({
address: options.host,
port,
exclusive
}, function() {
_this2.socketStatus = STATUS2.IS_OPEN;
_this2.notify("open");
});
}
}, {
key: "close",
value: function close() {
var _this3 = this;
this.socketStatus = STATUS2.IS_CLOSING;
this.socket.close(function() {
_this3.socketStatus = STATUS2.IS_CLOSED;
_this3.notify("close");
});
}
}, {
key: "send",
value: function send(binary) {
var customOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var options = _objectSpread22(_objectSpread22({}, this.options.send), customOptions);
var port = options.port, host = options.host;
this.socket.send(Buffer.from(binary), 0, binary.byteLength, port, host);
}
}]);
return DatagramPlugin2;
}();
var dgram$1 = typeof __dirname !== "undefined" ? require("dgram") : void 0;
var WebSocketServer = typeof __dirname !== "undefined" ? require_browser().Server : void 0;
var STATUS$1 = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var defaultOptions$2 = {
udpServer: {
host: "localhost",
port: 41234,
exclusive: false
},
udpClient: {
host: "localhost",
port: 41235
},
wsServer: {
host: "localhost",
port: 8080
},
receiver: "ws"
};
function mergeOptions$1(base, custom) {
return _objectSpread22(_objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$2), base), custom), {}, {
udpServer: _objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$2.udpServer), base.udpServer), custom.udpServer),
udpClient: _objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$2.udpClient), base.udpClient), custom.udpClient),
wsServer: _objectSpread22(_objectSpread22(_objectSpread22({}, defaultOptions$2.wsServer), base.wsServer), custom.wsServer)
});
}
var BridgePlugin = function() {
function BridgePlugin2() {
var _this = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
_classCallCheck(this, BridgePlugin2);
if (!dgram$1 || !WebSocketServer) {
throw new Error("BridgePlugin can not be used in browser context");
}
this.options = mergeOptions$1({}, customOptions);
this.websocket = null;
this.socket = dgram$1.createSocket("udp4");
this.socketStatus = STATUS$1.IS_NOT_INITIALIZED;
this.socket.on("message", function(message) {
_this.send(message, {
receiver: "ws"
});
_this.notify(message.buffer);
});
this.socket.on("error", function(error) {
_this.notify("error", error);
});
this.notify = function() {
};
}
_createClass(BridgePlugin2, [{
key: "registerNotify",
value: function registerNotify(fn) {
this.notify = fn;
}
}, {
key: "status",
value: function status() {
return this.socketStatus;
}
}, {
key: "open",
value: function open() {
var _this2 = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var options = mergeOptions$1(this.options, customOptions);
this.socketStatus = STATUS$1.IS_CONNECTING;
this.socket.bind({
address: options.udpServer.host,
port: options.udpServer.port,
exclusive: options.udpServer.exclusive
}, function() {
_this2.websocket = new WebSocketServer({
host: options.wsServer.host,
port: options.wsServer.port
});
_this2.websocket.binaryType = "arraybuffer";
_this2.websocket.on("listening", function() {
_this2.socketStatus = STATUS$1.IS_OPEN;
_this2.notify("open");
});
_this2.websocket.on("error", function(error) {
_this2.notify("error", error);
});
_this2.websocket.on("connection", function(client) {
client.on("message", function(message, rinfo) {
_this2.send(message, {
receiver: "udp"
});
_this2.notify(new Uint8Array(message), rinfo);
});
});
});
}
}, {
key: "close",
value: function close() {
var _this3 = this;
this.socketStatus = STATUS$1.IS_CLOSING;
this.socket.close(function() {
_this3.websocket.close(function() {
_this3.socketStatus = STATUS$1.IS_CLOSED;
_this3.notify("close");
});
});
}
}, {
key: "send",
value: function send(binary) {
var customOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var options = mergeOptions$1(this.options, customOptions);
var receiver = options.receiver;
if (receiver === "udp") {
var data = binary instanceof Buffer ? binary : Buffer.from(binary);
this.socket.send(data, 0, data.byteLength, options.udpClient.port, options.udpClient.host);
} else if (receiver === "ws") {
this.websocket.clients.forEach(function(client) {
client.send(binary, {
binary: true
});
});
} else {
throw new Error("BridgePlugin can not send message to unknown receiver");
}
}
}]);
return BridgePlugin2;
}();
var scope = typeof global === "undefined" ? window : global;
var WebSocket2 = typeof __dirname === "undefined" ? scope.WebSocket : require_browser();
var STATUS$2 = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var defaultOptions$3 = {
host: "localhost",
port: 8080,
secure: false
};
var WebsocketClientPlugin2 = function() {
function WebsocketClientPlugin3(customOptions) {
_classCallCheck(this, WebsocketClientPlugin3);
if (!WebSocket2) {
throw new Error("WebsocketClientPlugin can't find a WebSocket class");
}
this.options = _objectSpread22(_objectSpread22({}, defaultOptions$3), customOptions);
this.socket = null;
this.socketStatus = STATUS$2.IS_NOT_INITIALIZED;
this.notify = function() {
};
}
_createClass(WebsocketClientPlugin3, [{
key: "registerNotify",
value: function registerNotify(fn) {
this.notify = fn;
}
}, {
key: "status",
value: function status() {
return this.socketStatus;
}
}, {
key: "open",
value: function open() {
var _this = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var options = _objectSpread22(_objectSpread22({}, this.options), customOptions);
var port = options.port, host = options.host, secure = options.secure;
if (this.socket) {
this.close();
}
var protocol = secure ? "wss" : "ws";
var rinfo = {
address: host,
family: protocol,
port,
size: 0
};
this.socket = new WebSocket2("".concat(protocol, "://").concat(host, ":").concat(port));
this.socket.binaryType = "arraybuffer";
this.socketStatus = STATUS$2.IS_CONNECTING;
this.socket.onopen = function() {
_this.socketStatus = STATUS$2.IS_OPEN;
_this.notify("open");
};
this.socket.onclose = function() {
_this.socketStatus = STATUS$2.IS_CLOSED;
_this.notify("close");
};
this.socket.onerror = function(error) {
_this.notify("error", error);
};
this.socket.onmessage = function(message) {
_this.notify(message.data, rinfo);
};
}
}, {
key: "close",
value: function close() {
this.socketStatus = STATUS$2.IS_CLOSING;
this.socket.close();
}
}, {
key: "send",
value: function send(binary) {
this.socket.send(binary);
}
}]);
return WebsocketClientPlugin3;
}();
var WebSocketServer$1 = typeof __dirname !== "undefined" ? require_browser().Server : void 0;
var STATUS$3 = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var defaultOptions$4 = {
host: "localhost",
port: 8080
};
var WebsocketServerPlugin = function() {
function WebsocketServerPlugin2(customOptions) {
_classCallCheck(this, WebsocketServerPlugin2);
if (!WebSocketServer$1) {
throw new Error("WebsocketServerPlugin can not be used in browser context");
}
this.options = _objectSpread22(_objectSpread22({}, defaultOptions$4), customOptions);
this.socket = null;
this.socketStatus = STATUS$3.IS_NOT_INITIALIZED;
this.notify = function() {
};
}
_createClass(WebsocketServerPlugin2, [{
key: "registerNotify",
value: function registerNotify(fn) {
this.notify = fn;
}
}, {
key: "status",
value: function status() {
return this.socketStatus;
}
}, {
key: "open",
value: function open() {
var _this = this;
var customOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var options = _objectSpread22(_objectSpread22({}, this.options), customOptions);
var port = options.port, host = options.host;
var rinfo = {
address: host,
family: "wsserver",
port,
size: 0
};
if (this.socket) {
this.close();
}
this.socket = new WebSocketServer$1({
host,
port
});
this.socket.binaryType = "arraybuffer";
this.socketStatus = STATUS$3.IS_CONNECTING;
this.socket.on("listening", function() {
_this.socketStatus = STATUS$3.IS_OPEN;
_this.notify("open");
});
this.socket.on("error", function(error) {
_this.notify("error", error);
});
this.socket.on("connection", function(client) {
client.on("message", function(message) {
_this.notify(new Uint8Array(message), rinfo);
});
});
}
}, {
key: "close",
value: function close() {
var _this2 = this;
this.socketStatus = STATUS$3.IS_CLOSING;
this.socket.close(function() {
_this2.socketStatus = STATUS$3.IS_CLOSED;
_this2.notify("close");
});
}
}, {
key: "send",
value: function send(binary) {
this.socket.clients.forEach(function(client) {
client.send(binary, {
binary: true
});
});
}
}]);
return WebsocketServerPlugin2;
}();
var defaultOptions$5 = {
discardLateMessages: false,
plugin: new WebsocketClientPlugin2()
};
var STATUS$4 = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var OSC2 = function() {
function OSC3(options) {
_classCallCheck(this, OSC3);
if (options && !isObject2(options)) {
throw new Error("OSC options argument has to be an object.");
}
this.options = _objectSpread22(_objectSpread22({}, defaultOptions$5), options);
this.eventHandler = new EventHandler({
discardLateMessages: this.options.discardLateMessages
});
var eventHandler = this.eventHandler;
if (this.options.plugin && this.options.plugin.registerNotify) {
this.options.plugin.registerNotify(function() {
return eventHandler.notify.apply(eventHandler, arguments);
});
}
}
_createClass(OSC3, [{
key: "on",
value: function on(eventName, callback) {
if (!(isString2(eventName) && isFunction2(callback))) {
throw new Error("OSC on() needs event- or address string and callback function");
}
return this.eventHandler.on(eventName, callback);
}
}, {
key: "off",
value: function off(eventName, subscriptionId) {
if (!(isString2(eventName) && isInt(subscriptionId))) {
throw new Error("OSC off() needs string and number (subscriptionId) to unsubscribe");
}
return this.eventHandler.off(eventName, subscriptionId);
}
}, {
key: "open",
value: function open(options) {
if (options && !isObject2(options)) {
throw new Error("OSC open() options argument needs to be an object");
}
if (!(this.options.plugin && isFunction2(this.options.plugin.open))) {
throw new Error("OSC Plugin API #open is not implemented!");
}
return this.options.plugin.open(options);
}
}, {
key: "status",
value: function status() {
if (!(this.options.plugin && isFunction2(this.options.plugin.status))) {
throw new Error("OSC Plugin API #status is not implemented!");
}
return this.options.plugin.status();
}
}, {
key: "close",
value: function close() {
if (!(this.options.plugin && isFunction2(this.options.plugin.close))) {
throw new Error("OSC Plugin API #close is not implemented!");
}
return this.options.plugin.close();
}
}, {
key: "send",
value: function send(packet, options) {
if (!(this.options.plugin && isFunction2(this.options.plugin.send))) {
throw new Error("OSC Plugin API #send is not implemented!");
}
if (!(packet instanceof Message2 || packet instanceof Bundle || packet instanceof Packet)) {
throw new Error("OSC send() needs Messages, Bundles or Packets");
}
if (options && !isObject2(options)) {
throw new Error("OSC send() options argument has to be an object");
}
return this.options.plugin.send(packet.pack(), options);
}
}]);
return OSC3;
}();
OSC2.STATUS = STATUS$4;
OSC2.Packet = Packet;
OSC2.Bundle = Bundle;
OSC2.Message = Message2;
OSC2.DatagramPlugin = DatagramPlugin;
OSC2.WebsocketClientPlugin = WebsocketClientPlugin2;
OSC2.WebsocketServerPlugin = WebsocketServerPlugin;
OSC2.BridgePlugin = BridgePlugin;
return OSC2;
});
});
// node_modules/ms/index.js
var require_ms = __commonJS((exports, module) => {
var s = 1e3;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === "string" && val.length > 0) {
return parse(val);
} else if (type === "number" && isFinite(val)) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
};
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
if (!match) {
return;
}
var n4 = parseFloat(match[1]);
var type = (match[2] || "ms").toLowerCase();
switch (type) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return n4 * y;
case "weeks":
case "week":
case "w":
return n4 * w;
case "days":
case "day":
case "d":
return n4 * d;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return n4 * h;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return n4 * m;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return n4 * s;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return n4;
default:
return void 0;
}
}
function fmtShort(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return Math.round(ms / d) + "d";
}
if (msAbs >= h) {
return Math.round(ms / h) + "h";
}
if (msAbs >= m) {
return Math.round(ms / m) + "m";
}
if (msAbs >= s) {
return Math.round(ms / s) + "s";
}
return ms + "ms";
}
function fmtLong(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return plural(ms, msAbs, d, "day");
}
if (msAbs >= h) {
return plural(ms, msAbs, h, "hour");
}
if (msAbs >= m) {
return plural(ms, msAbs, m, "minute");
}
if (msAbs >= s) {
return plural(ms, msAbs, s, "second");
}
return ms + " ms";
}
function plural(ms, msAbs, n4, name) {
var isPlural = msAbs >= n4 * 1.5;
return Math.round(ms / n4) + " " + name + (isPlural ? "s" : "");
}
});
// node_modules/debug/src/common.js
var require_common = __commonJS((exports, module) => {
function setup(env) {
createDebug.debug = createDebug;
createDebug.default = createDebug;
createDebug.coerce = coerce;
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
createDebug.humanize = require_ms();
createDebug.destroy = destroy;
Object.keys(env).forEach((key) => {
createDebug[key] = env[key];
});
createDebug.names = [];
createDebug.skips = [];
createDebug.formatters = {};
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = (hash << 5) - hash + namespace.charCodeAt(i);
hash |= 0;
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
createDebug.selectColor = selectColor;
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
function debug3(...args) {
if (!debug3.enabled) {
return;
}
const self2 = debug3;
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self2.diff = ms;
self2.prev = prevTime;
self2.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== "string") {
args.unshift("%O");
}
let index2 = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
if (match === "%%") {
return "%";
}
index2++;
const formatter = createDebug.formatters[format];
if (typeof formatter === "function") {
const val = args[index2];
match = formatter.call(self2, val);
args.splice(index2, 1);
index2--;
}
return match;
});
createDebug.formatArgs.call(self2, args);
const logFn = self2.log || createDebug.log;
logFn.apply(self2, args);
}
debug3.namespace = namespace;
debug3.useColors = createDebug.useColors();
debug3.color = createDebug.selectColor(namespace);
debug3.extend = extend;
debug3.destroy = createDebug.destroy;
Object.defineProperty(debug3, "enabled", {
enumerable: true,
configurable: false,
get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
set: (v) => {
enableOverride = v;
}
});
if (typeof createDebug.init === "function") {
createDebug.init(debug3);
}
return debug3;
}
function extend(namespace, delimiter2) {
const newDebug = createDebug(this.namespace + (typeof delimiter2 === "undefined" ? ":" : delimiter2) + namespace);
newDebug.log = this.log;
return newDebug;
}
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.names = [];
createDebug.skips = [];
let i;
const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
const len = split.length;
for (i = 0; i < len; i++) {
if (!split[i]) {
continue;
}
namespaces = split[i].replace(/\*/g, ".*?");
if (namespaces[0] === "-") {
createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
} else {
createDebug.names.push(new RegExp("^" + namespaces + "$"));
}
}
}
function disable() {
const namespaces = [
...createDebug.names.map(toNamespace),
...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
].join(",");
createDebug.enable("");
return namespaces;
}
function enabled(name) {
if (name[name.length - 1] === "*") {
return true;
}
let i;
let len;
for (i = 0, len = createDebug.skips.length; i < len; i++) {
if (createDebug.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = createDebug.names.length; i < len; i++) {
if (createDebug.names[i].test(name)) {
return true;
}
}
return false;
}
function toNamespace(regexp) {
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
}
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
function destroy() {
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
createDebug.enable(createDebug.load());
return createDebug;
}
module.exports = setup;
});
// node_modules/debug/src/browser.js
var require_browser2 = __commonJS((exports, module) => {
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
exports.destroy = (() => {
let warned = false;
return () => {
if (!warned) {
warned = true;
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
};
})();
exports.colors = [
"#0000CC",
"#0000FF",
"#0033CC",
"#0033FF",
"#0066CC",
"#0066FF",
"#0099CC",
"#0099FF",
"#00CC00",
"#00CC33",
"#00CC66",
"#00CC99",
"#00CCCC",
"#00CCFF",
"#3300CC",
"#3300FF",
"#3333CC",
"#3333FF",
"#3366CC",
"#3366FF",
"#3399CC",
"#3399FF",
"#33CC00",
"#33CC33",
"#33CC66",
"#33CC99",
"#33CCCC",
"#33CCFF",
"#6600CC",
"#6600FF",
"#6633CC",
"#6633FF",
"#66CC00",
"#66CC33",
"#9900CC",
"#9900FF",
"#9933CC",
"#9933FF",
"#99CC00",
"#99CC33",
"#CC0000",
"#CC0033",
"#CC0066",
"#CC0099",
"#CC00CC",
"#CC00FF",
"#CC3300",
"#CC3333",
"#CC3366",
"#CC3399",
"#CC33CC",
"#CC33FF",
"#CC6600",
"#CC6633",
"#CC9900",
"#CC9933",
"#CCCC00",
"#CCCC33",
"#FF0000",
"#FF0033",
"#FF0066",
"#FF0099",
"#FF00CC",
"#FF00FF",
"#FF3300",
"#FF3333",
"#FF3366",
"#FF3399",
"#FF33CC",
"#FF33FF",
"#FF6600",
"#FF6633",
"#FF9900",
"#FF9933",
"#FFCC00",
"#FFCC33"
];
function useColors() {
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
return true;
}
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function formatArgs(args) {
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const c = "color: " + this.color;
args.splice(1, 0, c, "color: inherit");
let index2 = 0;
let lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, (match) => {
if (match === "%%") {
return;
}
index2++;
if (match === "%c") {
lastC = index2;
}
});
args.splice(lastC, 0, c);
}
exports.log = console.debug || console.log || (() => {
});
function save(namespaces) {
try {
if (namespaces) {
exports.storage.setItem("debug", namespaces);
} else {
exports.storage.removeItem("debug");
}
} catch (error) {
}
}
function load() {
let r2;
try {
r2 = exports.storage.getItem("debug");
} catch (error) {
}
if (!r2 && typeof process !== "undefined" && "env" in process) {
r2 = process.env.DEBUG;
}
return r2;
}
function localstorage() {
try {
return localStorage;
} catch (error) {
}
}
module.exports = require_common()(exports);
var {formatters} = module.exports;
formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (error) {
return "[UnexpectedJSONParseError]: " + error.message;
}
};
});
// src/index.js
var import_react30 = __toModule(require_react());
var import_react_dom = __toModule(require_react_dom());
// src/App.js
var import_react29 = __toModule(require_react());
// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(o2, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o3, p2) {
o3.__proto__ = p2;
return o3;
};
return _setPrototypeOf(o2, p);
}
// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
// node_modules/@emotion/core/dist/core.browser.esm.js
var import_react2 = __toModule(require_react());
// node_modules/@emotion/sheet/dist/sheet.browser.esm.js
function sheetForTag(tag) {
if (tag.sheet) {
return tag.sheet;
}
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
return document.styleSheets[i];
}
}
}
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(""));
return tag;
}
var StyleSheet = /* @__PURE__ */ function() {
function StyleSheet2(options) {
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.before = null;
}
var _proto = StyleSheet2.prototype;
_proto.insert = function insert(rule) {
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
var _tag = createStyleElement(this);
var before;
if (this.tags.length === 0) {
before = this.before;
} else {
before = this.tags[this.tags.length - 1].nextSibling;
}
this.container.insertBefore(_tag, before);
this.tags.push(_tag);
}
var tag = this.tags[this.tags.length - 1];
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64;
sheet.insertRule(rule, isImportRule ? 0 : sheet.cssRules.length);
} catch (e3) {
if (true) {
console.warn('There was a problem inserting the following rule: "' + rule + '"', e3);
}
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
this.tags.forEach(function(tag) {
return tag.parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
};
return StyleSheet2;
}();
// node_modules/@emotion/stylis/dist/stylis.browser.esm.js
function stylis_min(W) {
function M(d, c, e3, h, a2) {
for (var m = 0, b = 0, v = 0, n4 = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r2 = 0, I = 0, t3 = 0, B2 = e3.length, J = B2 - 1, y, f = "", p = "", F2 = "", G2 = "", C; l < B2; ) {
g = e3.charCodeAt(l);
l === J && b + n4 + v + m !== 0 && (b !== 0 && (g = b === 47 ? 10 : 47), n4 = v = m = 0, B2++, J++);
if (b + n4 + v + m === 0) {
if (l === J && (0 < r2 && (f = f.replace(N, "")), 0 < f.trim().length)) {
switch (g) {
case 32:
case 9:
case 59:
case 13:
case 10:
break;
default:
f += e3.charAt(l);
}
g = 59;
}
switch (g) {
case 123:
f = f.trim();
q = f.charCodeAt(0);
k = 1;
for (t3 = ++l; l < B2; ) {
switch (g = e3.charCodeAt(l)) {
case 123:
k++;
break;
case 125:
k--;
break;
case 47:
switch (g = e3.charCodeAt(l + 1)) {
case 42:
case 47:
a: {
for (u = l + 1; u < J; ++u) {
switch (e3.charCodeAt(u)) {
case 47:
if (g === 42 && e3.charCodeAt(u - 1) === 42 && l + 2 !== u) {
l = u + 1;
break a;
}
break;
case 10:
if (g === 47) {
l = u + 1;
break a;
}
}
}
l = u;
}
}
break;
case 91:
g++;
case 40:
g++;
case 34:
case 39:
for (; l++ < J && e3.charCodeAt(l) !== g; ) {
}
}
if (k === 0)
break;
l++;
}
k = e3.substring(t3, l);
q === 0 && (q = (f = f.replace(ca, "").trim()).charCodeAt(0));
switch (q) {
case 64:
0 < r2 && (f = f.replace(N, ""));
g = f.charCodeAt(1);
switch (g) {
case 100:
case 109:
case 115:
case 45:
r2 = c;
break;
default:
r2 = O;
}
k = M(c, r2, k, g, a2 + 1);
t3 = k.length;
0 < A && (r2 = X(O, f, I), C = H(3, k, r2, c, D, z, t3, g, a2, h), f = r2.join(""), C !== void 0 && (t3 = (k = C.trim()).length) === 0 && (g = 0, k = ""));
if (0 < t3)
switch (g) {
case 115:
f = f.replace(da, ea);
case 100:
case 109:
case 45:
k = f + "{" + k + "}";
break;
case 107:
f = f.replace(fa, "$1 $2");
k = f + "{" + k + "}";
k = w === 1 || w === 2 && L("@" + k, 3) ? "@-webkit-" + k + "@" + k : "@" + k;
break;
default:
k = f + k, h === 112 && (k = (p += k, ""));
}
else
k = "";
break;
default:
k = M(c, X(c, f, I), k, h, a2 + 1);
}
F2 += k;
k = I = r2 = u = q = 0;
f = "";
g = e3.charCodeAt(++l);
break;
case 125:
case 59:
f = (0 < r2 ? f.replace(N, "") : f).trim();
if (1 < (t3 = f.length))
switch (u === 0 && (q = f.charCodeAt(0), q === 45 || 96 < q && 123 > q) && (t3 = (f = f.replace(" ", ":")).length), 0 < A && (C = H(1, f, c, d, D, z, p.length, h, a2, h)) !== void 0 && (t3 = (f = C.trim()).length) === 0 && (f = "\0\0"), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
case 0:
break;
case 64:
if (g === 105 || g === 99) {
G2 += f + e3.charAt(l);
break;
}
default:
f.charCodeAt(t3 - 1) !== 58 && (p += P(f, q, g, f.charCodeAt(2)));
}
I = r2 = u = q = 0;
f = "";
g = e3.charCodeAt(++l);
}
}
switch (g) {
case 13:
case 10:
b === 47 ? b = 0 : 1 + q === 0 && h !== 107 && 0 < f.length && (r2 = 1, f += "\0");
0 < A * Y && H(0, f, c, d, D, z, p.length, h, a2, h);
z = 1;
D++;
break;
case 59:
case 125:
if (b + n4 + v + m === 0) {
z++;
break;
}
default:
z++;
y = e3.charAt(l);
switch (g) {
case 9:
case 32:
if (n4 + m + b === 0)
switch (x) {
case 44:
case 58:
case 9:
case 32:
y = "";
break;
default:
g !== 32 && (y = " ");
}
break;
case 0:
y = "\\0";
break;
case 12:
y = "\\f";
break;
case 11:
y = "\\v";
break;
case 38:
n4 + b + m === 0 && (r2 = I = 1, y = "\f" + y);
break;
case 108:
if (n4 + b + m + E === 0 && 0 < u)
switch (l - u) {
case 2:
x === 112 && e3.charCodeAt(l - 3) === 58 && (E = x);
case 8:
K === 111 && (E = K);
}
break;
case 58:
n4 + b + m === 0 && (u = l);
break;
case 44:
b + v + n4 + m === 0 && (r2 = 1, y += "\r");
break;
case 34:
case 39:
b === 0 && (n4 = n4 === g ? 0 : n4 === 0 ? g : n4);
break;
case 91:
n4 + b + v === 0 && m++;
break;
case 93:
n4 + b + v === 0 && m--;
break;
case 41:
n4 + b + m === 0 && v--;
break;
case 40:
if (n4 + b + m === 0) {
if (q === 0)
switch (2 * x + 3 * K) {
case 533:
break;
default:
q = 1;
}
v++;
}
break;
case 64:
b + v + n4 + m + u + k === 0 && (k = 1);
break;
case 42:
case 47:
if (!(0 < n4 + m + v))
switch (b) {
case 0:
switch (2 * g + 3 * e3.charCodeAt(l + 1)) {
case 235:
b = 47;
break;
case 220:
t3 = l, b = 42;
}
break;
case 42:
g === 47 && x === 42 && t3 + 2 !== l && (e3.charCodeAt(t3 + 2) === 33 && (p += e3.substring(t3, l + 1)), y = "", b = 0);
}
}
b === 0 && (f += y);
}
K = x;
x = g;
l++;
}
t3 = p.length;
if (0 < t3) {
r2 = c;
if (0 < A && (C = H(2, p, r2, d, D, z, t3, h, a2, h), C !== void 0 && (p = C).length === 0))
return G2 + p + F2;
p = r2.join(",") + "{" + p + "}";
if (w * E !== 0) {
w !== 2 || L(p, 2) || (E = 0);
switch (E) {
case 111:
p = p.replace(ha, ":-moz-$1") + p;
break;
case 112:
p = p.replace(Q, "::-webkit-input-$1") + p.replace(Q, "::-moz-$1") + p.replace(Q, ":-ms-input-$1") + p;
}
E = 0;
}
}
return G2 + p + F2;
}
function X(d, c, e3) {
var h = c.trim().split(ia);
c = h;
var a2 = h.length, m = d.length;
switch (m) {
case 0:
case 1:
var b = 0;
for (d = m === 0 ? "" : d[0] + " "; b < a2; ++b) {
c[b] = Z(d, c[b], e3).trim();
}
break;
default:
var v = b = 0;
for (c = []; b < a2; ++b) {
for (var n4 = 0; n4 < m; ++n4) {
c[v++] = Z(d[n4] + " ", h[b], e3).trim();
}
}
}
return c;
}
function Z(d, c, e3) {
var h = c.charCodeAt(0);
33 > h && (h = (c = c.trim()).charCodeAt(0));
switch (h) {
case 38:
return c.replace(F, "$1" + d.trim());
case 58:
return d.trim() + c.replace(F, "$1" + d.trim());
default:
if (0 < 1 * e3 && 0 < c.indexOf("\f"))
return c.replace(F, (d.charCodeAt(0) === 58 ? "" : "$1") + d.trim());
}
return d + c;
}
function P(d, c, e3, h) {
var a2 = d + ";", m = 2 * c + 3 * e3 + 4 * h;
if (m === 944) {
d = a2.indexOf(":", 9) + 1;
var b = a2.substring(d, a2.length - 1).trim();
b = a2.substring(0, d).trim() + b + ";";
return w === 1 || w === 2 && L(b, 1) ? "-webkit-" + b + b : b;
}
if (w === 0 || w === 2 && !L(a2, 1))
return a2;
switch (m) {
case 1015:
return a2.charCodeAt(10) === 97 ? "-webkit-" + a2 + a2 : a2;
case 951:
return a2.charCodeAt(3) === 116 ? "-webkit-" + a2 + a2 : a2;
case 963:
return a2.charCodeAt(5) === 110 ? "-webkit-" + a2 + a2 : a2;
case 1009:
if (a2.charCodeAt(4) !== 100)
break;
case 969:
case 942:
return "-webkit-" + a2 + a2;
case 978:
return "-webkit-" + a2 + "-moz-" + a2 + a2;
case 1019:
case 983:
return "-webkit-" + a2 + "-moz-" + a2 + "-ms-" + a2 + a2;
case 883:
if (a2.charCodeAt(8) === 45)
return "-webkit-" + a2 + a2;
if (0 < a2.indexOf("image-set(", 11))
return a2.replace(ja, "$1-webkit-$2") + a2;
break;
case 932:
if (a2.charCodeAt(4) === 45)
switch (a2.charCodeAt(5)) {
case 103:
return "-webkit-box-" + a2.replace("-grow", "") + "-webkit-" + a2 + "-ms-" + a2.replace("grow", "positive") + a2;
case 115:
return "-webkit-" + a2 + "-ms-" + a2.replace("shrink", "negative") + a2;
case 98:
return "-webkit-" + a2 + "-ms-" + a2.replace("basis", "preferred-size") + a2;
}
return "-webkit-" + a2 + "-ms-" + a2 + a2;
case 964:
return "-webkit-" + a2 + "-ms-flex-" + a2 + a2;
case 1023:
if (a2.charCodeAt(8) !== 99)
break;
b = a2.substring(a2.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify");
return "-webkit-box-pack" + b + "-webkit-" + a2 + "-ms-flex-pack" + b + a2;
case 1005:
return ka.test(a2) ? a2.replace(aa, ":-webkit-") + a2.replace(aa, ":-moz-") + a2 : a2;
case 1e3:
b = a2.substring(13).trim();
c = b.indexOf("-") + 1;
switch (b.charCodeAt(0) + b.charCodeAt(c)) {
case 226:
b = a2.replace(G, "tb");
break;
case 232:
b = a2.replace(G, "tb-rl");
break;
case 220:
b = a2.replace(G, "lr");
break;
default:
return a2;
}
return "-webkit-" + a2 + "-ms-" + b + a2;
case 1017:
if (a2.indexOf("sticky", 9) === -1)
break;
case 975:
c = (a2 = d).length - 10;
b = (a2.charCodeAt(c) === 33 ? a2.substring(0, c) : a2).substring(d.indexOf(":", 7) + 1).trim();
switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
case 203:
if (111 > b.charCodeAt(8))
break;
case 115:
a2 = a2.replace(b, "-webkit-" + b) + ";" + a2;
break;
case 207:
case 102:
a2 = a2.replace(b, "-webkit-" + (102 < m ? "inline-" : "") + "box") + ";" + a2.replace(b, "-webkit-" + b) + ";" + a2.replace(b, "-ms-" + b + "box") + ";" + a2;
}
return a2 + ";";
case 938:
if (a2.charCodeAt(5) === 45)
switch (a2.charCodeAt(6)) {
case 105:
return b = a2.replace("-items", ""), "-webkit-" + a2 + "-webkit-box-" + b + "-ms-flex-" + b + a2;
case 115:
return "-webkit-" + a2 + "-ms-flex-item-" + a2.replace(ba, "") + a2;
default:
return "-webkit-" + a2 + "-ms-flex-line-pack" + a2.replace("align-content", "").replace(ba, "") + a2;
}
break;
case 973:
case 989:
if (a2.charCodeAt(3) !== 45 || a2.charCodeAt(4) === 122)
break;
case 931:
case 953:
if (la.test(d) === true)
return (b = d.substring(d.indexOf(":") + 1)).charCodeAt(0) === 115 ? P(d.replace("stretch", "fill-available"), c, e3, h).replace(":fill-available", ":stretch") : a2.replace(b, "-webkit-" + b) + a2.replace(b, "-moz-" + b.replace("fill-", "")) + a2;
break;
case 962:
if (a2 = "-webkit-" + a2 + (a2.charCodeAt(5) === 102 ? "-ms-" + a2 : "") + a2, e3 + h === 211 && a2.charCodeAt(13) === 105 && 0 < a2.indexOf("transform", 10))
return a2.substring(0, a2.indexOf(";", 27) + 1).replace(ma, "$1-webkit-$2") + a2;
}
return a2;
}
function L(d, c) {
var e3 = d.indexOf(c === 1 ? ":" : "{"), h = d.substring(0, c !== 3 ? e3 : 10);
e3 = d.substring(e3 + 1, d.length - 1);
return R(c !== 2 ? h : h.replace(na, "$1"), e3, c);
}
function ea(d, c) {
var e3 = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
return e3 !== c + ";" ? e3.replace(oa, " or ($1)").substring(4) : "(" + c + ")";
}
function H(d, c, e3, h, a2, m, b, v, n4, q) {
for (var g = 0, x = c, w2; g < A; ++g) {
switch (w2 = S[g].call(B, d, x, e3, h, a2, m, b, v, n4, q)) {
case void 0:
case false:
case true:
case null:
break;
default:
x = w2;
}
}
if (x !== c)
return x;
}
function T(d) {
switch (d) {
case void 0:
case null:
A = S.length = 0;
break;
default:
if (typeof d === "function")
S[A++] = d;
else if (typeof d === "object")
for (var c = 0, e3 = d.length; c < e3; ++c) {
T(d[c]);
}
else
Y = !!d | 0;
}
return T;
}
function U(d) {
d = d.prefix;
d !== void 0 && (R = null, d ? typeof d !== "function" ? w = 1 : (w = 2, R = d) : w = 0);
return U;
}
function B(d, c) {
var e3 = d;
33 > e3.charCodeAt(0) && (e3 = e3.trim());
V = e3;
e3 = [V];
if (0 < A) {
var h = H(-1, c, e3, e3, D, z, 0, 0, 0, 0);
h !== void 0 && typeof h === "string" && (c = h);
}
var a2 = M(O, e3, c, 0, 0);
0 < A && (h = H(-2, a2, e3, e3, D, z, a2.length, 0, 0, 0), h !== void 0 && (a2 = h));
V = "";
E = 0;
z = D = 1;
return a2;
}
var ca = /^\0+/g, N = /[\0\r\f]/g, aa = /: */g, ka = /zoo|gra/, ma = /([,: ])(transform)/g, ia = /,\r+?/g, F = /([\t\r\n ])*\f?&/g, fa = /@(k\w+)\s*(\S*)\s*/, Q = /::(place)/g, ha = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, da = /\(\s*(.*)\s*\)/g, oa = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la = /stretch|:\s*\w+\-(?:conte|avail)/, ja = /([^-])(image-set\()/, z = 1, D = 1, E = 0, w = 1, O = [], S = [], A = 0, R = null, Y = 0, V = "";
B.use = T;
B.set = U;
W !== void 0 && U(W);
return B;
}
var stylis_browser_esm_default = stylis_min;
// node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js
var weakMemoize = function weakMemoize2(func) {
var cache = new WeakMap();
return function(arg) {
if (cache.has(arg)) {
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
var weak_memoize_browser_esm_default = weakMemoize;
// node_modules/@emotion/cache/dist/cache.browser.esm.js
var delimiter = "/*|*/";
var needle = delimiter + "}";
function toSheet(block) {
if (block) {
Sheet.current.insert(block + "}");
}
}
var Sheet = {
current: null
};
var ruleSheet = function ruleSheet2(context, content, selectors, parents, line, column, length, ns, depth, at) {
switch (context) {
case 1: {
switch (content.charCodeAt(0)) {
case 64: {
Sheet.current.insert(content + ";");
return "";
}
case 108: {
if (content.charCodeAt(2) === 98) {
return "";
}
}
}
break;
}
case 2: {
if (ns === 0)
return content + delimiter;
break;
}
case 3: {
switch (ns) {
case 102:
case 112: {
Sheet.current.insert(selectors[0] + content);
return "";
}
default: {
return content + (at === 0 ? delimiter : "");
}
}
}
case -2: {
content.split(needle).forEach(toSheet);
}
}
};
var createCache = function createCache2(options) {
if (options === void 0)
options = {};
var key = options.key || "css";
var stylisOptions;
if (options.prefix !== void 0) {
stylisOptions = {
prefix: options.prefix
};
}
var stylis = new stylis_browser_esm_default(stylisOptions);
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;
{
container = options.container || document.head;
var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
Array.prototype.forEach.call(nodes, function(node) {
var attrib = node.getAttribute("data-emotion-" + key);
attrib.split(" ").forEach(function(id) {
inserted[id] = true;
});
if (node.parentNode !== container) {
container.appendChild(node);
}
});
}
var _insert;
{
stylis.use(options.stylisPlugins)(ruleSheet);
_insert = function insert(selector, serialized, sheet, shouldCache) {
var name = serialized.name;
Sheet.current = sheet;
if (serialized.map !== void 0) {
var map = serialized.map;
Sheet.current = {
insert: function insert2(rule) {
sheet.insert(rule + map);
}
};
}
stylis(selector, serialized.styles);
if (shouldCache) {
cache.inserted[name] = true;
}
};
}
if (true) {
var commentStart = /\/\*/g;
var commentEnd = /\*\//g;
stylis.use(function(context, content) {
switch (context) {
case -1: {
while (commentStart.test(content)) {
commentEnd.lastIndex = commentStart.lastIndex;
if (commentEnd.test(content)) {
commentStart.lastIndex = commentEnd.lastIndex;
continue;
}
throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');
}
commentStart.lastIndex = 0;
break;
}
}
});
stylis.use(function(context, content, selectors) {
switch (context) {
case -1: {
var flag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
var unsafePseudoClasses = content.match(/(:first|:nth|:nth-last)-child/g);
if (unsafePseudoClasses && cache.compat !== true) {
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
var ignoreRegExp = new RegExp(unsafePseudoClass + ".*\\/\\* " + flag + " \\*\\/");
var ignore = ignoreRegExp.test(content);
if (unsafePseudoClass && !ignore) {
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
}
});
}
break;
}
}
});
}
var cache = {
key,
sheet: new StyleSheet({
key,
container,
nonce: options.nonce,
speedy: options.speedy
}),
nonce: options.nonce,
inserted,
registered: {},
insert: _insert
};
return cache;
};
var cache_browser_esm_default = createCache;
// node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js
var import_inheritsLoose = __toModule(require_inheritsLoose());
var import_react = __toModule(require_react());
// node_modules/@emotion/utils/dist/utils.browser.esm.js
var isBrowser = true;
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 insertStyles = function insertStyles2(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;
}
if (cache.inserted[serialized.name] === void 0) {
var current = serialized;
do {
var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
current = current.next;
} while (current !== void 0);
}
};
// node_modules/@emotion/hash/dist/hash.browser.esm.js
function murmur2(str) {
var h = 0;
var k, i = 0, len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
k ^= k >>> 24;
h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 255) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 255) << 8;
case 1:
h ^= str.charCodeAt(i) & 255;
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
h ^= h >>> 13;
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
var hash_browser_esm_default = murmur2;
// node_modules/@emotion/unitless/dist/unitless.browser.esm.js
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
var unitless_browser_esm_default = unitlessKeys;
// node_modules/@emotion/memoize/dist/memoize.browser.esm.js
function memoize(fn) {
var cache = {};
return function(arg) {
if (cache[arg] === void 0)
cache[arg] = fn(arg);
return cache[arg];
};
}
var memoize_browser_esm_default = memoize;
// node_modules/@emotion/serialize/dist/serialize.browser.esm.js
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 = memoize_browser_esm_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_browser_esm_default[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
return value + "px";
}
return value;
};
if (true) {
contentValuePattern = /(attr|calc|counters?|url)\(/;
contentValues = ["normal", "none", "counter", "open-quote", "close-quote", "no-open-quote", "no-close-quote", "initial", "inherit", "unset"];
oldProcessStyleValue = processStyleValue;
msPattern = /^-ms-/;
hyphenPattern = /-(.)/g;
hyphenatedCache = {};
processStyleValue = function processStyleValue3(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) !== "'")) {
console.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 shouldWarnAboutInterpolatingClassNameFromCss = true;
function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
if (interpolation == null) {
return "";
}
if (interpolation.__emotion_styles !== void 0) {
if (interpolation.toString() === "NO_COMPONENT_SELECTOR") {
throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");
}
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, couldBeSelectorInterpolation);
} 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];
if (couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== void 0) {
console.error("Interpolating a className from css`` is not recommended and will cause problems with composition.\nInterpolating a className from css`` will be completely unsupported in a future major version of Emotion");
shouldWarnAboutInterpolatingClassNameFromCss = false;
}
return cached !== void 0 && !couldBeSelectorInterpolation ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
var string = "";
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string += handleInterpolation(mergedProps, registered, obj[i], false);
}
} 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("Component selectors can only be used in conjunction with babel-plugin-emotion.");
}
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, false);
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+\*\//;
}
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, false);
} else {
if (strings[0] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles += strings[0];
}
for (var i = 1; i < args.length; i++) {
styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
if (stringMode) {
if (strings[i] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles += strings[i];
}
}
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 = hash_browser_esm_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
};
};
// node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js
var hasOwnProperty = Object.prototype.hasOwnProperty;
var EmotionCacheContext = /* @__PURE__ */ import_react.createContext(typeof HTMLElement !== "undefined" ? cache_browser_esm_default() : null);
var ThemeContext = /* @__PURE__ */ import_react.createContext({});
var CacheProvider = EmotionCacheContext.Provider;
var withEmotionCache = function withEmotionCache2(func) {
var render3 = function render4(props2, ref) {
return /* @__PURE__ */ import_react.createElement(EmotionCacheContext.Consumer, null, function(cache) {
return func(props2, cache, ref);
});
};
return /* @__PURE__ */ import_react.forwardRef(render3);
};
var sanitizeIdentifier = function sanitizeIdentifier2(identifier) {
return identifier.replace(/\$/g, "-");
};
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
var createEmotionProps = function createEmotionProps2(type, props2) {
if (typeof props2.css === "string" && props2.css.indexOf(":") !== -1) {
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/css' like this: css`" + props2.css + "`");
}
var newProps = {};
for (var key in props2) {
if (hasOwnProperty.call(props2, key)) {
newProps[key] = props2[key];
}
}
newProps[typePropName] = type;
if (true) {
var error = new Error();
if (error.stack) {
var match = error.stack.match(/at (?:Object\.|Module\.|)(?:jsx|createEmotionProps).*\n\s+at (?:Object\.|)([A-Z][A-Za-z$]+) /);
if (!match) {
match = error.stack.match(/.*\n([A-Z][A-Za-z$]+)@/);
}
if (match) {
newProps[labelPropName] = sanitizeIdentifier(match[1]);
}
}
}
return newProps;
};
var render = function render2(cache, props2, theme2, ref) {
var cssProp = theme2 === null ? props2.css : props2.css(theme2);
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
cssProp = cache.registered[cssProp];
}
var type = props2[typePropName];
var registeredStyles = [cssProp];
var className = "";
if (typeof props2.className === "string") {
className = getRegisteredStyles(cache.registered, registeredStyles, props2.className);
} else if (props2.className != null) {
className = props2.className + " ";
}
var serialized = serializeStyles(registeredStyles);
if (serialized.name.indexOf("-") === -1) {
var labelFromStack = props2[labelPropName];
if (labelFromStack) {
serialized = serializeStyles([serialized, "label:" + labelFromStack + ";"]);
}
}
var rules = insertStyles(cache, serialized, typeof type === "string");
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var key in props2) {
if (hasOwnProperty.call(props2, key) && key !== "css" && key !== typePropName && key !== labelPropName) {
newProps[key] = props2[key];
}
}
newProps.ref = ref;
newProps.className = className;
var ele = /* @__PURE__ */ import_react.createElement(type, newProps);
return ele;
};
var Emotion = /* @__PURE__ */ withEmotionCache(function(props2, cache, ref) {
if (typeof props2.css === "function") {
return /* @__PURE__ */ import_react.createElement(ThemeContext.Consumer, null, function(theme2) {
return render(cache, props2, theme2, ref);
});
}
return render(cache, props2, null, ref);
});
if (true) {
Emotion.displayName = "EmotionCssPropInternal";
}
// node_modules/@emotion/css/dist/css.browser.esm.js
function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serializeStyles(args);
}
var css_browser_esm_default = css;
// node_modules/@emotion/core/dist/core.browser.esm.js
var jsx = function jsx2(type, props2) {
var args = arguments;
if (props2 == null || !hasOwnProperty.call(props2, "css")) {
return import_react2.createElement.apply(void 0, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion;
createElementArgArray[1] = createEmotionProps(type, props2);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
}
return import_react2.createElement.apply(null, createElementArgArray);
};
var warnedAboutCssPropForGlobal = false;
var Global = /* @__PURE__ */ withEmotionCache(function(props2, cache) {
if (!warnedAboutCssPropForGlobal && (props2.className || props2.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 = props2.styles;
if (typeof styles === "function") {
return /* @__PURE__ */ import_react2.createElement(ThemeContext.Consumer, null, function(theme2) {
var serialized2 = serializeStyles([styles(theme2)]);
return /* @__PURE__ */ import_react2.createElement(InnerGlobal, {
serialized: serialized2,
cache
});
});
}
var serialized = serializeStyles([styles]);
return /* @__PURE__ */ import_react2.createElement(InnerGlobal, {
serialized,
cache
});
});
var InnerGlobal = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose(InnerGlobal2, _React$Component);
function InnerGlobal2(props2, context, updater) {
return _React$Component.call(this, props2, context, updater) || this;
}
var _proto = InnerGlobal2.prototype;
_proto.componentDidMount = function componentDidMount() {
this.sheet = new StyleSheet({
key: this.props.cache.key + "-global",
nonce: this.props.cache.sheet.nonce,
container: this.props.cache.sheet.container
});
var node = document.querySelector("style[data-emotion-" + this.props.cache.key + '="' + this.props.serialized.name + '"]');
if (node !== null) {
this.sheet.tags.push(node);
}
if (this.props.cache.sheet.tags.length) {
this.sheet.before = this.props.cache.sheet.tags[0];
}
this.insertStyles();
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
if (prevProps.serialized.name !== this.props.serialized.name) {
this.insertStyles();
}
};
_proto.insertStyles = function insertStyles$1() {
if (this.props.serialized.next !== void 0) {
insertStyles(this.props.cache, this.props.serialized.next, true);
}
if (this.sheet.tags.length) {
var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling;
this.sheet.before = element;
this.sheet.flush();
}
this.props.cache.insert("", this.props.serialized, this.sheet, false);
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.sheet.flush();
};
_proto.render = function render3() {
return null;
};
return InnerGlobal2;
}(import_react2.Component);
var classnames = function classnames2(args) {
var len = args.length;
var i = 0;
var cls = "";
for (; i < len; i++) {
var arg = args[i];
if (arg == null)
continue;
var toAdd = void 0;
switch (typeof arg) {
case "boolean":
break;
case "object": {
if (Array.isArray(arg)) {
toAdd = classnames2(arg);
} else {
toAdd = "";
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += " ");
toAdd += k;
}
}
}
break;
}
default: {
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += " ");
cls += toAdd;
}
}
return cls;
};
function merge(registered, css6, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css6(registeredStyles);
}
var ClassNames = withEmotionCache(function(props2, context) {
return /* @__PURE__ */ import_react2.createElement(ThemeContext.Consumer, null, function(theme2) {
var hasRendered = false;
var css6 = function css7() {
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 = serializeStyles(args, context.registered);
{
insertStyles(context, serialized, false);
}
return context.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 merge(context.registered, css6, classnames(args));
};
var content = {
css: css6,
cx,
theme: theme2
};
var ele = props2.children(content);
hasRendered = true;
return ele;
});
});
// node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js
var import_defineProperty = __toModule(require_defineProperty());
var import_react3 = __toModule(require_react());
// node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
var index = memoize_browser_esm_default(function(prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
});
var is_prop_valid_browser_esm_default = index;
// node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js
var testOmitPropsOnStringTag = is_prop_valid_browser_esm_default;
var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
return key !== "theme" && key !== "innerRef";
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
return typeof tag === "string" && tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(source, true).forEach(function(key) {
import_defineProperty.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var ILLEGAL_ESCAPE_SEQUENCE_ERROR2 = `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 createStyled = function createStyled2(tag, options) {
if (true) {
if (tag === void 0) {
throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");
}
}
var identifierName;
var shouldForwardProp2;
var targetClassName;
if (options !== void 0) {
identifierName = options.label;
targetClassName = options.target;
shouldForwardProp2 = tag.__emotion_forwardProp && options.shouldForwardProp ? function(propName) {
return tag.__emotion_forwardProp(propName) && options.shouldForwardProp(propName);
} : options.shouldForwardProp;
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
if (typeof shouldForwardProp2 !== "function" && isReal) {
shouldForwardProp2 = tag.__emotion_forwardProp;
}
var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp("as");
return function() {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== void 0) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === void 0) {
styles.push.apply(styles, args);
} else {
if (args[0][0] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR2);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (args[0][i] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR2);
}
styles.push(args[i], args[0][i]);
}
}
var Styled = withEmotionCache(function(props2, context, ref) {
return import_react3.createElement(ThemeContext.Consumer, null, function(theme2) {
var finalTag = shouldUseAs && props2.as || baseTag;
var className = "";
var classInterpolations = [];
var mergedProps = props2;
if (props2.theme == null) {
mergedProps = {};
for (var key in props2) {
mergedProps[key] = props2[key];
}
mergedProps.theme = theme2;
}
if (typeof props2.className === "string") {
className = getRegisteredStyles(context.registered, classInterpolations, props2.className);
} else if (props2.className != null) {
className = props2.className + " ";
}
var serialized = serializeStyles(styles.concat(classInterpolations), context.registered, mergedProps);
var rules = insertStyles(context, serialized, typeof finalTag === "string");
className += context.key + "-" + serialized.name;
if (targetClassName !== void 0) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props2) {
if (shouldUseAs && _key === "as")
continue;
if (finalShouldForwardProp(_key)) {
newProps[_key] = props2[_key];
}
}
newProps.className = className;
newProps.ref = ref || props2.innerRef;
if (props2.innerRef) {
console.error("`innerRef` is deprecated and will be removed in a future major version of Emotion, please use the `ref` prop instead" + (identifierName === void 0 ? "" : " in the usage of `" + identifierName + "`"));
}
var ele = import_react3.createElement(finalTag, newProps);
return ele;
});
});
Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp2;
Object.defineProperty(Styled, "toString", {
value: function value() {
if (targetClassName === void 0 && true) {
return "NO_COMPONENT_SELECTOR";
}
return "." + targetClassName;
}
});
Styled.withComponent = function(nextTag, nextOptions) {
return createStyled2(nextTag, nextOptions !== void 0 ? _objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles);
};
return Styled;
};
};
var styled_base_browser_esm_default = createStyled;
// node_modules/@emotion/styled/dist/styled.browser.esm.js
var tags = [
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"big",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"marquee",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr",
"circle",
"clipPath",
"defs",
"ellipse",
"foreignObject",
"g",
"image",
"line",
"linearGradient",
"mask",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"stop",
"svg",
"text",
"tspan"
];
var newStyled = styled_base_browser_esm_default.bind();
tags.forEach(function(tagName) {
newStyled[tagName] = newStyled(tagName);
});
var styled_browser_esm_default = newStyled;
// node_modules/@styled-system/should-forward-prop/node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js
function memoize2(fn) {
var cache = Object.create(null);
return function(arg) {
if (cache[arg] === void 0)
cache[arg] = fn(arg);
return cache[arg];
};
}
var emotion_memoize_browser_esm_default = memoize2;
// node_modules/@styled-system/core/dist/index.esm.js
var import_object_assign = __toModule(require_object_assign());
var merge2 = function merge3(a2, b) {
var result = import_object_assign.default({}, a2, b);
for (var key in a2) {
var _assign;
if (!a2[key] || typeof b[key] !== "object")
continue;
import_object_assign.default(result, (_assign = {}, _assign[key] = import_object_assign.default(a2[key], b[key]), _assign));
}
return result;
};
var sort = function sort2(obj) {
var next = {};
Object.keys(obj).sort(function(a2, b) {
return a2.localeCompare(b, void 0, {
numeric: true,
sensitivity: "base"
});
}).forEach(function(key) {
next[key] = obj[key];
});
return next;
};
var defaults = {
breakpoints: [40, 52, 64].map(function(n4) {
return n4 + "em";
})
};
var createMediaQuery = function createMediaQuery2(n4) {
return "@media screen and (min-width: " + n4 + ")";
};
var getValue = function getValue2(n4, scale) {
return get(scale, n4, n4);
};
var get = function get2(obj, key, def, p, undef) {
key = key && key.split ? key.split(".") : [key];
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
};
var createParser = function createParser2(config10) {
var cache = {};
var parse = function parse2(props2) {
var styles = {};
var shouldSort = false;
var isCacheDisabled = props2.theme && props2.theme.disableStyledSystemCache;
for (var key in props2) {
if (!config10[key])
continue;
var sx = config10[key];
var raw = props2[key];
var scale = get(props2.theme, sx.scale, sx.defaults);
if (typeof raw === "object") {
cache.breakpoints = !isCacheDisabled && cache.breakpoints || get(props2.theme, "breakpoints", defaults.breakpoints);
if (Array.isArray(raw)) {
cache.media = !isCacheDisabled && cache.media || [null].concat(cache.breakpoints.map(createMediaQuery));
styles = merge2(styles, parseResponsiveStyle(cache.media, sx, scale, raw, props2));
continue;
}
if (raw !== null) {
styles = merge2(styles, parseResponsiveObject(cache.breakpoints, sx, scale, raw, props2));
shouldSort = true;
}
continue;
}
import_object_assign.default(styles, sx(raw, scale, props2));
}
if (shouldSort) {
styles = sort(styles);
}
return styles;
};
parse.config = config10;
parse.propNames = Object.keys(config10);
parse.cache = cache;
var keys = Object.keys(config10).filter(function(k) {
return k !== "config";
});
if (keys.length > 1) {
keys.forEach(function(key) {
var _createParser;
parse[key] = createParser2((_createParser = {}, _createParser[key] = config10[key], _createParser));
});
}
return parse;
};
var parseResponsiveStyle = function parseResponsiveStyle2(mediaQueries, sx, scale, raw, _props) {
var styles = {};
raw.slice(0, mediaQueries.length).forEach(function(value, i) {
var media = mediaQueries[i];
var style = sx(value, scale, _props);
if (!media) {
import_object_assign.default(styles, style);
} else {
var _assign2;
import_object_assign.default(styles, (_assign2 = {}, _assign2[media] = import_object_assign.default({}, styles[media], style), _assign2));
}
});
return styles;
};
var parseResponsiveObject = function parseResponsiveObject2(breakpoints2, sx, scale, raw, _props) {
var styles = {};
for (var key in raw) {
var breakpoint = breakpoints2[key];
var value = raw[key];
var style = sx(value, scale, _props);
if (!breakpoint) {
import_object_assign.default(styles, style);
} else {
var _assign3;
var media = createMediaQuery(breakpoint);
import_object_assign.default(styles, (_assign3 = {}, _assign3[media] = import_object_assign.default({}, styles[media], style), _assign3));
}
}
return styles;
};
var createStyleFunction = function createStyleFunction2(_ref) {
var properties = _ref.properties, property = _ref.property, scale = _ref.scale, _ref$transform = _ref.transform, transform = _ref$transform === void 0 ? getValue : _ref$transform, defaultScale = _ref.defaultScale;
properties = properties || [property];
var sx = function sx2(value, scale2, _props) {
var result = {};
var n4 = transform(value, scale2, _props);
if (n4 === null)
return;
properties.forEach(function(prop) {
result[prop] = n4;
});
return result;
};
sx.scale = scale;
sx.defaults = defaultScale;
return sx;
};
var system = function system2(args) {
if (args === void 0) {
args = {};
}
var config10 = {};
Object.keys(args).forEach(function(key) {
var conf = args[key];
if (conf === true) {
config10[key] = createStyleFunction({
property: key,
scale: key
});
return;
}
if (typeof conf === "function") {
config10[key] = conf;
return;
}
config10[key] = createStyleFunction(conf);
});
var parser = createParser(config10);
return parser;
};
var compose = function compose2() {
var config10 = {};
for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {
parsers[_key] = arguments[_key];
}
parsers.forEach(function(parser2) {
if (!parser2 || !parser2.config)
return;
import_object_assign.default(config10, parser2.config);
});
var parser = createParser(config10);
return parser;
};
// node_modules/@styled-system/layout/dist/index.esm.js
var isNumber = function isNumber2(n4) {
return typeof n4 === "number" && !isNaN(n4);
};
var getWidth = function getWidth2(n4, scale) {
return get(scale, n4, !isNumber(n4) || n4 > 1 ? n4 : n4 * 100 + "%");
};
var config = {
width: {
property: "width",
scale: "sizes",
transform: getWidth
},
height: {
property: "height",
scale: "sizes"
},
minWidth: {
property: "minWidth",
scale: "sizes"
},
minHeight: {
property: "minHeight",
scale: "sizes"
},
maxWidth: {
property: "maxWidth",
scale: "sizes"
},
maxHeight: {
property: "maxHeight",
scale: "sizes"
},
size: {
properties: ["width", "height"],
scale: "sizes"
},
overflow: true,
overflowX: true,
overflowY: true,
display: true,
verticalAlign: true
};
var layout = system(config);
var index_esm_default = layout;
// node_modules/@styled-system/color/dist/index.esm.js
var config2 = {
color: {
property: "color",
scale: "colors"
},
backgroundColor: {
property: "backgroundColor",
scale: "colors"
},
opacity: true
};
config2.bg = config2.backgroundColor;
var color = system(config2);
var index_esm_default2 = color;
// node_modules/@styled-system/typography/dist/index.esm.js
var defaults2 = {
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
};
var config3 = {
fontFamily: {
property: "fontFamily",
scale: "fonts"
},
fontSize: {
property: "fontSize",
scale: "fontSizes",
defaultScale: defaults2.fontSizes
},
fontWeight: {
property: "fontWeight",
scale: "fontWeights"
},
lineHeight: {
property: "lineHeight",
scale: "lineHeights"
},
letterSpacing: {
property: "letterSpacing",
scale: "letterSpacings"
},
textAlign: true,
fontStyle: true
};
var typography = system(config3);
var index_esm_default3 = typography;
// node_modules/@styled-system/flexbox/dist/index.esm.js
var config4 = {
alignItems: true,
alignContent: true,
justifyItems: true,
justifyContent: true,
flexWrap: true,
flexDirection: true,
flex: true,
flexGrow: true,
flexShrink: true,
flexBasis: true,
justifySelf: true,
alignSelf: true,
order: true
};
var flexbox = system(config4);
var index_esm_default4 = flexbox;
// node_modules/@styled-system/grid/dist/index.esm.js
var defaults3 = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var config5 = {
gridGap: {
property: "gridGap",
scale: "space",
defaultScale: defaults3.space
},
gridColumnGap: {
property: "gridColumnGap",
scale: "space",
defaultScale: defaults3.space
},
gridRowGap: {
property: "gridRowGap",
scale: "space",
defaultScale: defaults3.space
},
gridColumn: true,
gridRow: true,
gridAutoFlow: true,
gridAutoColumns: true,
gridAutoRows: true,
gridTemplateColumns: true,
gridTemplateRows: true,
gridTemplateAreas: true,
gridArea: true
};
var grid = system(config5);
var index_esm_default5 = grid;
// node_modules/@styled-system/border/dist/index.esm.js
var config6 = {
border: {
property: "border",
scale: "borders"
},
borderWidth: {
property: "borderWidth",
scale: "borderWidths"
},
borderStyle: {
property: "borderStyle",
scale: "borderStyles"
},
borderColor: {
property: "borderColor",
scale: "colors"
},
borderRadius: {
property: "borderRadius",
scale: "radii"
},
borderTop: {
property: "borderTop",
scale: "borders"
},
borderTopLeftRadius: {
property: "borderTopLeftRadius",
scale: "radii"
},
borderTopRightRadius: {
property: "borderTopRightRadius",
scale: "radii"
},
borderRight: {
property: "borderRight",
scale: "borders"
},
borderBottom: {
property: "borderBottom",
scale: "borders"
},
borderBottomLeftRadius: {
property: "borderBottomLeftRadius",
scale: "radii"
},
borderBottomRightRadius: {
property: "borderBottomRightRadius",
scale: "radii"
},
borderLeft: {
property: "borderLeft",
scale: "borders"
},
borderX: {
properties: ["borderLeft", "borderRight"],
scale: "borders"
},
borderY: {
properties: ["borderTop", "borderBottom"],
scale: "borders"
}
};
config6.borderTopWidth = {
property: "borderTopWidth",
scale: "borderWidths"
};
config6.borderTopColor = {
property: "borderTopColor",
scale: "colors"
};
config6.borderTopStyle = {
property: "borderTopStyle",
scale: "borderStyles"
};
config6.borderTopLeftRadius = {
property: "borderTopLeftRadius",
scale: "radii"
};
config6.borderTopRightRadius = {
property: "borderTopRightRadius",
scale: "radii"
};
config6.borderBottomWidth = {
property: "borderBottomWidth",
scale: "borderWidths"
};
config6.borderBottomColor = {
property: "borderBottomColor",
scale: "colors"
};
config6.borderBottomStyle = {
property: "borderBottomStyle",
scale: "borderStyles"
};
config6.borderBottomLeftRadius = {
property: "borderBottomLeftRadius",
scale: "radii"
};
config6.borderBottomRightRadius = {
property: "borderBottomRightRadius",
scale: "radii"
};
config6.borderLeftWidth = {
property: "borderLeftWidth",
scale: "borderWidths"
};
config6.borderLeftColor = {
property: "borderLeftColor",
scale: "colors"
};
config6.borderLeftStyle = {
property: "borderLeftStyle",
scale: "borderStyles"
};
config6.borderRightWidth = {
property: "borderRightWidth",
scale: "borderWidths"
};
config6.borderRightColor = {
property: "borderRightColor",
scale: "colors"
};
config6.borderRightStyle = {
property: "borderRightStyle",
scale: "borderStyles"
};
var border = system(config6);
var index_esm_default6 = border;
// node_modules/@styled-system/background/dist/index.esm.js
var config7 = {
background: true,
backgroundImage: true,
backgroundSize: true,
backgroundPosition: true,
backgroundRepeat: true
};
config7.bgImage = config7.backgroundImage;
config7.bgSize = config7.backgroundSize;
config7.bgPosition = config7.backgroundPosition;
config7.bgRepeat = config7.backgroundRepeat;
var background = system(config7);
var index_esm_default7 = background;
// node_modules/@styled-system/position/dist/index.esm.js
var defaults4 = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var config8 = {
position: true,
zIndex: {
property: "zIndex",
scale: "zIndices"
},
top: {
property: "top",
scale: "space",
defaultScale: defaults4.space
},
right: {
property: "right",
scale: "space",
defaultScale: defaults4.space
},
bottom: {
property: "bottom",
scale: "space",
defaultScale: defaults4.space
},
left: {
property: "left",
scale: "space",
defaultScale: defaults4.space
}
};
var position = system(config8);
var index_esm_default8 = position;
// node_modules/@styled-system/space/dist/index.esm.js
var defaults5 = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
};
var isNumber3 = function isNumber4(n4) {
return typeof n4 === "number" && !isNaN(n4);
};
var getMargin = function getMargin2(n4, scale) {
if (!isNumber3(n4)) {
return get(scale, n4, n4);
}
var isNegative = n4 < 0;
var absolute = Math.abs(n4);
var value = get(scale, absolute, absolute);
if (!isNumber3(value)) {
return isNegative ? "-" + value : value;
}
return value * (isNegative ? -1 : 1);
};
var configs = {};
configs.margin = {
margin: {
property: "margin",
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginTop: {
property: "marginTop",
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginRight: {
property: "marginRight",
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginBottom: {
property: "marginBottom",
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginLeft: {
property: "marginLeft",
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginX: {
properties: ["marginLeft", "marginRight"],
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
},
marginY: {
properties: ["marginTop", "marginBottom"],
scale: "space",
transform: getMargin,
defaultScale: defaults5.space
}
};
configs.margin.m = configs.margin.margin;
configs.margin.mt = configs.margin.marginTop;
configs.margin.mr = configs.margin.marginRight;
configs.margin.mb = configs.margin.marginBottom;
configs.margin.ml = configs.margin.marginLeft;
configs.margin.mx = configs.margin.marginX;
configs.margin.my = configs.margin.marginY;
configs.padding = {
padding: {
property: "padding",
scale: "space",
defaultScale: defaults5.space
},
paddingTop: {
property: "paddingTop",
scale: "space",
defaultScale: defaults5.space
},
paddingRight: {
property: "paddingRight",
scale: "space",
defaultScale: defaults5.space
},
paddingBottom: {
property: "paddingBottom",
scale: "space",
defaultScale: defaults5.space
},
paddingLeft: {
property: "paddingLeft",
scale: "space",
defaultScale: defaults5.space
},
paddingX: {
properties: ["paddingLeft", "paddingRight"],
scale: "space",
defaultScale: defaults5.space
},
paddingY: {
properties: ["paddingTop", "paddingBottom"],
scale: "space",
defaultScale: defaults5.space
}
};
configs.padding.p = configs.padding.padding;
configs.padding.pt = configs.padding.paddingTop;
configs.padding.pr = configs.padding.paddingRight;
configs.padding.pb = configs.padding.paddingBottom;
configs.padding.pl = configs.padding.paddingLeft;
configs.padding.px = configs.padding.paddingX;
configs.padding.py = configs.padding.paddingY;
var margin = system(configs.margin);
var padding = system(configs.padding);
var space = compose(margin, padding);
// node_modules/@styled-system/shadow/dist/index.esm.js
var shadow = system({
boxShadow: {
property: "boxShadow",
scale: "shadows"
},
textShadow: {
property: "textShadow",
scale: "shadows"
}
});
// node_modules/@styled-system/variant/node_modules/@styled-system/css/dist/index.esm.js
function _extends() {
_extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var get3 = function get4(obj, key, def, p, undef) {
key = key && key.split ? key.split(".") : [key];
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
};
var defaultBreakpoints = [40, 52, 64].map(function(n4) {
return n4 + "em";
});
var defaultTheme = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
};
var aliases = {
bg: "backgroundColor",
m: "margin",
mt: "marginTop",
mr: "marginRight",
mb: "marginBottom",
ml: "marginLeft",
mx: "marginX",
my: "marginY",
p: "padding",
pt: "paddingTop",
pr: "paddingRight",
pb: "paddingBottom",
pl: "paddingLeft",
px: "paddingX",
py: "paddingY"
};
var multiples = {
marginX: ["marginLeft", "marginRight"],
marginY: ["marginTop", "marginBottom"],
paddingX: ["paddingLeft", "paddingRight"],
paddingY: ["paddingTop", "paddingBottom"],
size: ["width", "height"]
};
var scales = {
color: "colors",
backgroundColor: "colors",
borderColor: "colors",
margin: "space",
marginTop: "space",
marginRight: "space",
marginBottom: "space",
marginLeft: "space",
marginX: "space",
marginY: "space",
padding: "space",
paddingTop: "space",
paddingRight: "space",
paddingBottom: "space",
paddingLeft: "space",
paddingX: "space",
paddingY: "space",
top: "space",
right: "space",
bottom: "space",
left: "space",
gridGap: "space",
gridColumnGap: "space",
gridRowGap: "space",
gap: "space",
columnGap: "space",
rowGap: "space",
fontFamily: "fonts",
fontSize: "fontSizes",
fontWeight: "fontWeights",
lineHeight: "lineHeights",
letterSpacing: "letterSpacings",
border: "borders",
borderTop: "borders",
borderRight: "borders",
borderBottom: "borders",
borderLeft: "borders",
borderWidth: "borderWidths",
borderStyle: "borderStyles",
borderRadius: "radii",
borderTopRightRadius: "radii",
borderTopLeftRadius: "radii",
borderBottomRightRadius: "radii",
borderBottomLeftRadius: "radii",
borderTopWidth: "borderWidths",
borderTopColor: "colors",
borderTopStyle: "borderStyles",
borderBottomWidth: "borderWidths",
borderBottomColor: "colors",
borderBottomStyle: "borderStyles",
borderLeftWidth: "borderWidths",
borderLeftColor: "colors",
borderLeftStyle: "borderStyles",
borderRightWidth: "borderWidths",
borderRightColor: "colors",
borderRightStyle: "borderStyles",
outlineColor: "colors",
boxShadow: "shadows",
textShadow: "shadows",
zIndex: "zIndices",
width: "sizes",
minWidth: "sizes",
maxWidth: "sizes",
height: "sizes",
minHeight: "sizes",
maxHeight: "sizes",
flexBasis: "sizes",
size: "sizes",
fill: "colors",
stroke: "colors"
};
var positiveOrNegative = function positiveOrNegative2(scale, value) {
if (typeof value !== "number" || value >= 0) {
return get3(scale, value, value);
}
var absolute = Math.abs(value);
var n4 = get3(scale, absolute, absolute);
if (typeof n4 === "string")
return "-" + n4;
return n4 * -1;
};
var transforms = ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "top", "bottom", "left", "right"].reduce(function(acc, curr) {
var _extends22;
return _extends({}, acc, (_extends22 = {}, _extends22[curr] = positiveOrNegative, _extends22));
}, {});
var responsive = function responsive2(styles) {
return function(theme2) {
var next = {};
var breakpoints2 = get3(theme2, "breakpoints", defaultBreakpoints);
var mediaQueries = [null].concat(breakpoints2.map(function(n4) {
return "@media screen and (min-width: " + n4 + ")";
}));
for (var key in styles) {
var value = typeof styles[key] === "function" ? styles[key](theme2) : styles[key];
if (value == null)
continue;
if (!Array.isArray(value)) {
next[key] = value;
continue;
}
for (var i = 0; i < value.slice(0, mediaQueries.length).length; i++) {
var media = mediaQueries[i];
if (!media) {
next[key] = value[i];
continue;
}
next[media] = next[media] || {};
if (value[i] == null)
continue;
next[media][key] = value[i];
}
}
return next;
};
};
var css2 = function css3(args) {
return function(props2) {
if (props2 === void 0) {
props2 = {};
}
var theme2 = _extends({}, defaultTheme, {}, props2.theme || props2);
var result = {};
var obj = typeof args === "function" ? args(theme2) : args;
var styles = responsive(obj)(theme2);
for (var key in styles) {
var x = styles[key];
var val = typeof x === "function" ? x(theme2) : x;
if (key === "variant") {
var variant3 = css3(get3(theme2, val))(theme2);
result = _extends({}, result, {}, variant3);
continue;
}
if (val && typeof val === "object") {
result[key] = css3(val)(theme2);
continue;
}
var prop = get3(aliases, key, key);
var scaleName = get3(scales, prop);
var scale = get3(theme2, scaleName, get3(theme2, prop, {}));
var transform = get3(transforms, prop, get3);
var value = transform(scale, val, val);
if (multiples[prop]) {
var dirs = multiples[prop];
for (var i = 0; i < dirs.length; i++) {
result[dirs[i]] = value;
}
} else {
result[prop] = value;
}
}
return result;
};
};
var index_esm_default9 = css2;
// node_modules/@styled-system/variant/dist/index.esm.js
var variant = function variant2(_ref) {
var _config;
var scale = _ref.scale, _ref$prop = _ref.prop, prop = _ref$prop === void 0 ? "variant" : _ref$prop, _ref$variants = _ref.variants, variants = _ref$variants === void 0 ? {} : _ref$variants, key = _ref.key;
var sx;
if (Object.keys(variants).length) {
sx = function sx2(value, scale2, props2) {
return index_esm_default9(get(scale2, value, null))(props2.theme);
};
} else {
sx = function sx2(value, scale2) {
return get(scale2, value, null);
};
}
sx.scale = scale || key;
sx.defaults = variants;
var config10 = (_config = {}, _config[prop] = sx, _config);
var parser = createParser(config10);
return parser;
};
var buttonStyle = variant({
key: "buttons"
});
var textStyle = variant({
key: "textStyles",
prop: "textStyle"
});
var colorStyle = variant({
key: "colorStyles",
prop: "colors"
});
// node_modules/@styled-system/should-forward-prop/node_modules/styled-system/dist/index.esm.js
var width = index_esm_default.width;
var height = index_esm_default.height;
var minWidth = index_esm_default.minWidth;
var minHeight = index_esm_default.minHeight;
var maxWidth = index_esm_default.maxWidth;
var maxHeight = index_esm_default.maxHeight;
var size = index_esm_default.size;
var verticalAlign = index_esm_default.verticalAlign;
var display = index_esm_default.display;
var overflow = index_esm_default.overflow;
var overflowX = index_esm_default.overflowX;
var overflowY = index_esm_default.overflowY;
var opacity = index_esm_default2.opacity;
var fontSize = index_esm_default3.fontSize;
var fontFamily = index_esm_default3.fontFamily;
var fontWeight = index_esm_default3.fontWeight;
var lineHeight = index_esm_default3.lineHeight;
var textAlign = index_esm_default3.textAlign;
var fontStyle = index_esm_default3.fontStyle;
var letterSpacing = index_esm_default3.letterSpacing;
var alignItems = index_esm_default4.alignItems;
var alignContent = index_esm_default4.alignContent;
var justifyItems = index_esm_default4.justifyItems;
var justifyContent = index_esm_default4.justifyContent;
var flexWrap = index_esm_default4.flexWrap;
var flexDirection = index_esm_default4.flexDirection;
var flex = index_esm_default4.flex;
var flexGrow = index_esm_default4.flexGrow;
var flexShrink = index_esm_default4.flexShrink;
var flexBasis = index_esm_default4.flexBasis;
var justifySelf = index_esm_default4.justifySelf;
var alignSelf = index_esm_default4.alignSelf;
var order = index_esm_default4.order;
var gridGap = index_esm_default5.gridGap;
var gridColumnGap = index_esm_default5.gridColumnGap;
var gridRowGap = index_esm_default5.gridRowGap;
var gridColumn = index_esm_default5.gridColumn;
var gridRow = index_esm_default5.gridRow;
var gridAutoFlow = index_esm_default5.gridAutoFlow;
var gridAutoColumns = index_esm_default5.gridAutoColumns;
var gridAutoRows = index_esm_default5.gridAutoRows;
var gridTemplateColumns = index_esm_default5.gridTemplateColumns;
var gridTemplateRows = index_esm_default5.gridTemplateRows;
var gridTemplateAreas = index_esm_default5.gridTemplateAreas;
var gridArea = index_esm_default5.gridArea;
var borderWidth = index_esm_default6.borderWidth;
var borderStyle = index_esm_default6.borderStyle;
var borderColor = index_esm_default6.borderColor;
var borderTop = index_esm_default6.borderTop;
var borderRight = index_esm_default6.borderRight;
var borderBottom = index_esm_default6.borderBottom;
var borderLeft = index_esm_default6.borderLeft;
var borderRadius = index_esm_default6.borderRadius;
var backgroundImage = index_esm_default7.backgroundImage;
var backgroundSize = index_esm_default7.backgroundSize;
var backgroundPosition = index_esm_default7.backgroundPosition;
var backgroundRepeat = index_esm_default7.backgroundRepeat;
var zIndex = index_esm_default8.zIndex;
var top = index_esm_default8.top;
var right = index_esm_default8.right;
var bottom = index_esm_default8.bottom;
var left = index_esm_default8.left;
// node_modules/@styled-system/should-forward-prop/dist/index.esm.js
var all = compose(space, typography, color, layout, flexbox, border, background, position, grid, shadow, buttonStyle, textStyle, colorStyle);
var props = all.propNames;
var createShouldForwardProp = function createShouldForwardProp2(props2) {
var regex = new RegExp("^(" + props2.join("|") + ")$");
return emotion_memoize_browser_esm_default(function(prop) {
return is_prop_valid_browser_esm_default(prop) && !regex.test(prop);
});
};
var index_esm_default11 = createShouldForwardProp(props);
// node_modules/@chakra-ui/core/dist/es/Box/config.js
var import_defineProperty2 = __toModule(require_defineProperty());
function ownKeys2(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys2(source, true).forEach(function(key) {
import_defineProperty2.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys2(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var isNumber5 = function isNumber6(n4) {
return typeof n4 === "number" && !isNaN(n4);
};
var getWidth3 = function getWidth4(n4, scale) {
return get(scale, n4, !isNumber5(n4) || n4 > 1 ? n4 : n4 * 100 + "%");
};
var config9 = {
roundedTop: {
properties: ["borderTopLeftRadius", "borderTopRightRadius"],
scale: "radii"
},
roundedBottom: {
properties: ["borderBottomLeftRadius", "borderBottomRightRadius"],
scale: "radii"
},
roundedLeft: {
properties: ["borderTopLeftRadius", "borderBottomLeftRadius"],
scale: "radii"
},
roundedRight: {
properties: ["borderTopRightRadius", "borderBottomRightRadius"],
scale: "radii"
},
roundedTopRight: {
property: "borderTopRightRadius",
scale: "radii"
},
roundedTopLeft: {
property: "borderTopLeftRadius",
scale: "radii"
},
roundedBottomRight: {
property: "borderBottomRightRadius",
scale: "radii"
},
roundedBottomLeft: {
property: "borderBottomLeftRadius",
scale: "radii"
},
rounded: {
property: "borderRadius",
scale: "radii"
},
d: {
property: "display"
},
w: {
property: "width",
scale: "sizes",
transform: getWidth3
},
minW: {
property: "minWidth",
scale: "sizes"
},
maxW: {
property: "maxWidth",
scale: "sizes"
},
h: {
property: "height",
scale: "sizes"
},
minH: {
property: "minHeight",
scale: "sizes"
},
maxH: {
property: "maxHeight",
scale: "sizes"
},
bgImg: {
property: "backgroundImage"
},
bgImage: {
property: "backgroundImage"
},
bgSize: {
property: "backgroundSize"
},
bgPos: {
property: "backgroundPosition"
},
bgRepeat: {
property: "backgroundRepeat"
},
pos: {
property: "position"
},
flexDir: {
property: "flexDirection"
},
shadow: {
property: "boxShadow",
scale: "shadows"
},
textDecoration: {
property: "textDecoration"
},
overflowX: true,
overflowY: true,
textTransform: true,
animation: true,
appearance: true,
transform: true,
transformOrigin: true,
visibility: true,
whiteSpace: true,
userSelect: true,
pointerEvents: true,
wordBreak: true,
overflowWrap: true,
textOverflow: true,
boxSizing: true,
cursor: true,
resize: true,
transition: true,
listStyleType: true,
listStylePosition: true,
listStyleImage: true,
fill: {
property: "fill",
scale: "colors"
},
stroke: {
property: "stroke",
scale: "colors"
},
objectFit: true,
objectPosition: true,
backgroundAttachment: {
property: "backgroundAttachment"
},
outline: true,
float: true,
willChange: true
};
config9.bgAttachment = config9.backgroundAttachment;
config9.textDecor = config9.textDecoration;
config9.listStylePos = config9.listStylePosition;
config9.listStyleImg = config9.listStyleImage;
var extraConfig = system(config9);
var config_default = extraConfig;
var transformAlias = function transformAlias2(prop, propValue) {
var configKeys = Object.keys(config9);
var result = {};
if (configKeys.includes(prop)) {
var _config$prop = config9[prop], properties = _config$prop.properties, property = _config$prop.property;
if (properties) {
properties.forEach(function(_cssProp) {
return result[_cssProp] = propValue;
});
}
if (property) {
result[property] = propValue;
}
if (config9[prop] === true) {
result[prop] = propValue;
}
} else {
result[prop] = propValue;
}
return result;
};
var transformAliasProps = function transformAliasProps2(props2) {
var result = {};
for (var prop in props2) {
if (typeof props2[prop] === "object" && !Array.isArray(props2[prop])) {
var _objectSpread22;
result = _objectSpread2({}, result, (_objectSpread22 = {}, _objectSpread22[prop] = transformAliasProps2(props2[prop]), _objectSpread22));
} else {
result = _objectSpread2({}, result, {}, transformAlias(prop, props2[prop]));
}
}
return result;
};
// node_modules/@chakra-ui/core/dist/es/Box/index.js
var truncate = function truncate2(props2) {
if (props2.isTruncated) {
return {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
};
}
};
var systemProps = compose(layout, color, space, background, border, grid, position, shadow, typography, flexbox, config_default);
var _shouldForwardProp = createShouldForwardProp([].concat(props, ["d", "textDecoration", "pointerEvents", "visibility", "transform", "cursor", "fill", "stroke"]));
var nativeHTMLPropAlias = ["htmlWidth", "htmlHeight"];
var Box = styled_browser_esm_default("div", {
shouldForwardProp: function shouldForwardProp(prop) {
if (nativeHTMLPropAlias.includes(prop)) {
return true;
} else {
return _shouldForwardProp(prop);
}
}
})(truncate, systemProps);
Box.displayName = "Box";
var Box_default = Box;
// node_modules/@styled-system/css/dist/index.esm.js
function _extends2() {
_extends2 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends2.apply(this, arguments);
}
var get5 = function get6(obj, key, def, p, undef) {
key = key && key.split ? key.split(".") : [key];
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
};
var defaultBreakpoints2 = [40, 52, 64].map(function(n4) {
return n4 + "em";
});
var defaultTheme2 = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
};
var aliases2 = {
bg: "backgroundColor",
m: "margin",
mt: "marginTop",
mr: "marginRight",
mb: "marginBottom",
ml: "marginLeft",
mx: "marginX",
my: "marginY",
p: "padding",
pt: "paddingTop",
pr: "paddingRight",
pb: "paddingBottom",
pl: "paddingLeft",
px: "paddingX",
py: "paddingY"
};
var directions = {
marginX: ["marginLeft", "marginRight"],
marginY: ["marginTop", "marginBottom"],
paddingX: ["paddingLeft", "paddingRight"],
paddingY: ["paddingTop", "paddingBottom"]
};
var scales2 = {
color: "colors",
backgroundColor: "colors",
borderColor: "colors",
margin: "space",
marginTop: "space",
marginRight: "space",
marginBottom: "space",
marginLeft: "space",
marginX: "space",
marginY: "space",
padding: "space",
paddingTop: "space",
paddingRight: "space",
paddingBottom: "space",
paddingLeft: "space",
paddingX: "space",
paddingY: "space",
top: "space",
right: "space",
bottom: "space",
left: "space",
gridGap: "space",
gridColumnGap: "space",
gridRowGap: "space",
gap: "space",
columnGap: "space",
rowGap: "space",
fontFamily: "fonts",
fontSize: "fontSizes",
fontWeight: "fontWeights",
lineHeight: "lineHeights",
letterSpacing: "letterSpacings",
border: "borders",
borderTop: "borders",
borderRight: "borders",
borderBottom: "borders",
borderLeft: "borders",
borderWidth: "borderWidths",
borderStyle: "borderStyles",
borderRadius: "radii",
borderTopRightRadius: "radii",
borderTopLeftRadius: "radii",
borderBottomRightRadius: "radii",
borderBottomLeftRadius: "radii",
boxShadow: "shadows",
textShadow: "shadows",
zIndex: "zIndices",
width: "sizes",
minWidth: "sizes",
maxWidth: "sizes",
height: "sizes",
minHeight: "sizes",
maxHeight: "sizes"
};
var positiveOrNegative3 = function positiveOrNegative4(scale, value) {
if (typeof value !== "number" || value >= 0) {
return get5(scale, value, value);
}
var absolute = Math.abs(value);
var n4 = get5(scale, absolute, absolute);
if (typeof n4 === "string")
return "-" + n4;
return n4 * -1;
};
var transforms2 = ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "top", "bottom", "left", "right"].reduce(function(acc, curr) {
var _extends22;
return _extends2({}, acc, (_extends22 = {}, _extends22[curr] = positiveOrNegative3, _extends22));
}, {});
var responsive3 = function responsive4(styles) {
return function(theme2) {
var next = {};
var breakpoints2 = get5(theme2, "breakpoints", defaultBreakpoints2);
var mediaQueries = [null].concat(breakpoints2.map(function(n4) {
return "@media screen and (min-width: " + n4 + ")";
}));
for (var key in styles) {
var value = styles[key];
if (value == null)
continue;
if (!Array.isArray(value)) {
next[key] = value;
continue;
}
for (var i = 0; i < value.length; i++) {
var media = mediaQueries[i];
if (value[i] == null)
continue;
if (!media) {
next[key] = value[i];
continue;
}
next[media] = next[media] || {};
next[media][key] = value[i];
}
}
return next;
};
};
var css4 = function css5(args) {
return function(props2) {
if (props2 === void 0) {
props2 = {};
}
var theme2 = _extends2({}, defaultTheme2, props2.theme || props2);
var result = {};
var obj = typeof args === "function" ? args(theme2) : args;
var styles = responsive3(obj)(theme2);
for (var key in styles) {
var prop = get5(aliases2, key, key);
var scaleName = get5(scales2, prop);
var scale = get5(theme2, scaleName, get5(theme2, prop, {}));
var x = styles[key];
var val = typeof x === "function" ? x(theme2) : x;
if (key === "variant") {
var variant3 = css5(get5(theme2, val))(theme2);
result = _extends2({}, result, variant3);
continue;
}
if (val && typeof val === "object") {
result[prop] = css5(val)(theme2);
continue;
}
var transform = get5(transforms2, prop, get5);
var value = transform(scale, val, val);
if (directions[prop]) {
var dirs = directions[prop];
for (var i = 0; i < dirs.length; i++) {
result[dirs[i]] = value;
}
} else {
result[prop] = value;
}
}
return result;
};
};
var index_esm_default12 = css4;
// node_modules/@chakra-ui/core/dist/es/PseudoBox/index.js
var hover = "&:hover";
var active = "&:active, &[data-active=true]";
var focus = "&:focus";
var visited = "&:visited";
var even = "&:nth-of-type(even)";
var odd = "&:nth-of-type(odd)";
var disabled = "&:disabled, &:disabled:focus, &:disabled:hover, &[aria-disabled=true], &[aria-disabled=true]:focus, &[aria-disabled=true]:hover";
var checked = "&[aria-checked=true]";
var mixed = "&[aria-checked=mixed]";
var selected = "&[aria-selected=true]";
var invalid = "&[aria-invalid=true]";
var pressed = "&[aria-pressed=true]";
var readOnly = "&[aria-readonly=true], &[readonly]";
var first = "&:first-of-type";
var last = "&:last-of-type";
var expanded = "&[aria-expanded=true]";
var grabbed = "&[aria-grabbed=true]";
var notFirst = "&:not(:first-of-type)";
var notLast = "&:not(:last-of-type)";
var groupHover = "[role=group]:hover &";
var PseudoBox = styled_browser_esm_default(Box_default)(function(_ref) {
var _css;
var _after = _ref._after, _focus = _ref._focus, _selected = _ref._selected, _focusWithin = _ref._focusWithin, _hover = _ref._hover, _invalid = _ref._invalid, _active = _ref._active, _disabled = _ref._disabled, _grabbed = _ref._grabbed, _pressed = _ref._pressed, _expanded = _ref._expanded, _visited = _ref._visited, _before = _ref._before, _readOnly = _ref._readOnly, _first = _ref._first, _notFirst = _ref._notFirst, _notLast = _ref._notLast, _last = _ref._last, _placeholder = _ref._placeholder, _checked = _ref._checked, _groupHover = _ref._groupHover, _mixed = _ref._mixed, _odd = _ref._odd, _even = _ref._even;
return index_esm_default12((_css = {}, _css[hover] = transformAliasProps(_hover), _css[focus] = transformAliasProps(_focus), _css[active] = transformAliasProps(_active), _css[visited] = transformAliasProps(_visited), _css[disabled] = transformAliasProps(_disabled), _css[selected] = transformAliasProps(_selected), _css[invalid] = transformAliasProps(_invalid), _css[expanded] = transformAliasProps(_expanded), _css[grabbed] = transformAliasProps(_grabbed), _css[readOnly] = transformAliasProps(_readOnly), _css[first] = transformAliasProps(_first), _css[notFirst] = transformAliasProps(_notFirst), _css[notLast] = transformAliasProps(_notLast), _css[last] = transformAliasProps(_last), _css[odd] = transformAliasProps(_odd), _css[even] = transformAliasProps(_even), _css[mixed] = transformAliasProps(_mixed), _css[checked] = transformAliasProps(_checked), _css[pressed] = transformAliasProps(_pressed), _css[groupHover] = transformAliasProps(_groupHover), _css["&:before"] = transformAliasProps(_before), _css["&:after"] = transformAliasProps(_after), _css["&:focus-within"] = transformAliasProps(_focusWithin), _css["&::placeholder"] = _placeholder, _css));
});
PseudoBox.displayName = "PseudoBox";
var PseudoBox_default = PseudoBox;
// node_modules/@chakra-ui/core/dist/es/utils/index.js
var import_react7 = __toModule(require_react());
// node_modules/emotion-theming/dist/emotion-theming.browser.esm.js
var import_defineProperty3 = __toModule(require_defineProperty());
var import_react4 = __toModule(require_react());
var import_extends = __toModule(require_extends());
var import_hoist_non_react_statics = __toModule(require_hoist_non_react_statics_cjs());
function ownKeys3(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread3(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys3(source, true).forEach(function(key) {
import_defineProperty3.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys3(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var getTheme = function getTheme2(outerTheme, theme2) {
if (typeof theme2 === "function") {
var mergedTheme = theme2(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 (theme2 == null || typeof theme2 !== "object" || Array.isArray(theme2)) {
throw new Error("[ThemeProvider] Please make your theme prop a plain object");
}
return _objectSpread3({}, outerTheme, {}, theme2);
};
var createCacheWithTheme = weak_memoize_browser_esm_default(function(outerTheme) {
return weak_memoize_browser_esm_default(function(theme2) {
return getTheme(outerTheme, theme2);
});
});
var ThemeProvider = function ThemeProvider2(props2) {
return import_react4.createElement(ThemeContext.Consumer, null, function(theme2) {
if (props2.theme !== theme2) {
theme2 = createCacheWithTheme(theme2)(props2.theme);
}
return import_react4.createElement(ThemeContext.Provider, {
value: theme2
}, props2.children);
});
};
// node_modules/@chakra-ui/core/dist/es/ThemeProvider/index.js
var import_react6 = __toModule(require_react());
// node_modules/@chakra-ui/core/dist/es/theme/theme.js
var import_defineProperty5 = __toModule(require_defineProperty());
// node_modules/@chakra-ui/core/dist/es/IconPaths.js
var import_react5 = __toModule(require_react());
var iconPaths = {
copy: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"
})
},
search: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z"
})
},
"search-2": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z"
})
},
moon: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z"
})
},
sun: {
path: import_react5.default.createElement("g", {
strokeLinejoin: "full",
strokeLinecap: "full",
strokeWidth: "2",
fill: "none",
stroke: "currentColor"
}, import_react5.default.createElement("circle", {
cx: "12",
cy: "12",
r: "5"
}), import_react5.default.createElement("path", {
d: "M12 1v2"
}), import_react5.default.createElement("path", {
d: "M12 21v2"
}), import_react5.default.createElement("path", {
d: "M4.22 4.22l1.42 1.42"
}), import_react5.default.createElement("path", {
d: "M18.36 18.36l1.42 1.42"
}), import_react5.default.createElement("path", {
d: "M1 12h2"
}), import_react5.default.createElement("path", {
d: "M21 12h2"
}), import_react5.default.createElement("path", {
d: "M4.22 19.78l1.42-1.42"
}), import_react5.default.createElement("path", {
d: "M18.36 5.64l1.42-1.42"
}))
},
add: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z"
})
},
"small-add": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",
fillRule: "evenodd"
}),
viewBox: "0 0 20 20"
},
settings: {
viewBox: "0 0 14 14",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z"
})
},
"check-circle": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"
})
},
lock: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z"
})
},
unlock: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z"
})
},
view: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"
}), import_react5.default.createElement("circle", {
cx: "12",
cy: "12",
r: "2"
}))
},
"view-off": {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"
}), import_react5.default.createElement("path", {
d: "M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"
}))
},
download: {
viewBox: "0 0 14 14",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z"
})
},
delete: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M19.452,7.5H4.547a.5.5,0,0,0-.5.545L5.334,22.181A2,2,0,0,0,7.326,24h9.347a2,2,0,0,0,1.992-1.819L19.95,8.045a.5.5,0,0,0-.129-.382A.5.5,0,0,0,19.452,7.5Zm-9.2,13a.75.75,0,0,1-1.5,0v-9a.75.75,0,0,1,1.5,0Zm5,0a.75.75,0,0,1-1.5,0v-9a.75.75,0,0,1,1.5,0Z"
}), import_react5.default.createElement("path", {
d: "M22,4H17.25A.25.25,0,0,1,17,3.75V2.5A2.5,2.5,0,0,0,14.5,0h-5A2.5,2.5,0,0,0,7,2.5V3.75A.25.25,0,0,1,6.75,4H2A1,1,0,0,0,2,6H22a1,1,0,0,0,0-2ZM9,3.75V2.5A.5.5,0,0,1,9.5,2h5a.5.5,0,0,1,.5.5V3.75a.25.25,0,0,1-.25.25H9.25A.25.25,0,0,1,9,3.75Z"
}))
},
repeat: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"
}), import_react5.default.createElement("path", {
d: "M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"
}))
},
"repeat-clock": {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"
}), import_react5.default.createElement("path", {
d: "M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"
}))
},
edit: {
path: import_react5.default.createElement("g", {
fill: "none",
stroke: "currentColor",
strokeLinecap: "full",
strokeWidth: "2"
}, import_react5.default.createElement("path", {
d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
}), import_react5.default.createElement("path", {
d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"
}))
},
"chevron-right": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
})
},
"chevron-left": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"
})
},
"chevron-down": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
})
},
"chevron-up": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
})
},
"arrow-forward": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"
})
},
"arrow-up": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
})
},
"arrow-down": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
})
},
"arrow-back": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
})
},
"external-link": {
path: import_react5.default.createElement("g", {
fill: "none",
stroke: "currentColor",
strokeLinecap: "full",
strokeWidth: "2"
}, import_react5.default.createElement("path", {
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
}), import_react5.default.createElement("path", {
d: "M15 3h6v6"
}), import_react5.default.createElement("path", {
d: "M10 14L21 3"
}))
},
link: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"
}), import_react5.default.createElement("path", {
d: "M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"
}))
},
"plus-square": {
path: import_react5.default.createElement("g", {
fill: "none",
stroke: "currentColor",
strokeLinecap: "full",
strokeWidth: "2"
}, import_react5.default.createElement("rect", {
height: "18",
width: "18",
rx: "2",
ry: "2",
x: "3",
y: "3"
}), import_react5.default.createElement("path", {
d: "M12 8v8"
}), import_react5.default.createElement("path", {
d: "M8 12h8"
}))
},
chat: {
viewBox: "0 0 14 14",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z"
})
},
calendar: {
viewBox: "0 0 14 14",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"
})
},
time: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"
}), import_react5.default.createElement("path", {
d: "M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"
}))
},
attachment: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"
})
},
"up-down": {
viewBox: "-1 -1 9 11",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"
})
},
"at-sign": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"
})
},
"arrow-left": {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"
}), import_react5.default.createElement("path", {
d: "M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"
}))
},
"arrow-right": {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"
}), import_react5.default.createElement("path", {
d: "M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"
}))
},
star: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z"
})
},
email: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("path", {
d: "M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"
}), import_react5.default.createElement("path", {
d: "M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"
}))
},
phone: {
viewBox: "0 0 14 14",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z"
})
},
spinner: {
path: import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("defs", null, import_react5.default.createElement("linearGradient", {
x1: "28.154%",
y1: "63.74%",
x2: "74.629%",
y2: "17.783%",
id: "a"
}, import_react5.default.createElement("stop", {
stopColor: "currentColor",
offset: "0%"
}), import_react5.default.createElement("stop", {
stopColor: "#fff",
stopOpacity: "0",
offset: "100%"
}))), import_react5.default.createElement("g", {
transform: "translate(2)",
fill: "none"
}, import_react5.default.createElement("circle", {
stroke: "url(#a)",
strokeWidth: "4",
cx: "10",
cy: "12",
r: "10"
}), import_react5.default.createElement("path", {
d: "M10 2C4.477 2 0 6.477 0 12",
stroke: "currentColor",
strokeWidth: "4"
}), import_react5.default.createElement("rect", {
fill: "currentColor",
x: "8",
width: "4",
height: "4",
rx: "8"
})))
},
"drag-handle": {
viewBox: "0 0 10 10",
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z"
})
},
close: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"
})
},
"small-close": {
path: import_react5.default.createElement("path", {
d: "M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",
fillRule: "evenodd",
fill: "currentColor"
}),
viewBox: "0 0 16 16"
},
"not-allowed": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"
})
},
"triangle-down": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"
})
},
"triangle-up": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"
})
},
bell: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"
})
},
"info-outline": {
path: import_react5.default.createElement("g", {
fill: "currentColor",
stroke: "currentColor",
strokeLinecap: "square",
strokeWidth: "2"
}, import_react5.default.createElement("circle", {
cx: "12",
cy: "12",
fill: "none",
r: "11",
stroke: "currentColor"
}), import_react5.default.createElement("line", {
fill: "none",
x1: "11.959",
x2: "11.959",
y1: "11",
y2: "17"
}), import_react5.default.createElement("circle", {
cx: "11.959",
cy: "7",
r: "1",
stroke: "none"
}))
},
info: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"
})
},
question: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z"
})
},
"question-outline": {
path: import_react5.default.createElement("g", {
stroke: "currentColor",
strokeWidth: "1.5"
}, import_react5.default.createElement("path", {
strokeLinecap: "full",
fill: "none",
d: "M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
}), import_react5.default.createElement("path", {
fill: "none",
strokeLinecap: "full",
d: "M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
}), import_react5.default.createElement("circle", {
fill: "none",
strokeMiterlimit: "10",
cx: "12",
cy: "12",
r: "11.25"
}))
},
warning: {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
})
},
"warning-2": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"
})
},
"arrow-up-down": {
path: import_react5.default.createElement("path", {
fill: "currentColor",
d: "M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z"
}),
viewBox: "0 0 16 16"
},
check: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("polygon", {
points: "5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"
})),
viewBox: "0 0 14 14"
},
minus: {
path: import_react5.default.createElement("g", {
fill: "currentColor"
}, import_react5.default.createElement("rect", {
height: "4",
width: "20",
x: "2",
y: "10"
}))
}
};
var IconPaths_default = iconPaths;
// node_modules/@chakra-ui/core/dist/es/theme/colors.js
var colors = {
transparent: "transparent",
current: "currentColor",
black: "#000",
white: "#fff",
whiteAlpha: {
50: "rgba(255, 255, 255, 0.04)",
100: "rgba(255, 255, 255, 0.06)",
200: "rgba(255, 255, 255, 0.08)",
300: "rgba(255, 255, 255, 0.16)",
400: "rgba(255, 255, 255, 0.24)",
500: "rgba(255, 255, 255, 0.36)",
600: "rgba(255, 255, 255, 0.48)",
700: "rgba(255, 255, 255, 0.64)",
800: "rgba(255, 255, 255, 0.80)",
900: "rgba(255, 255, 255, 0.92)"
},
blackAlpha: {
50: "rgba(0, 0, 0, 0.04)",
100: "rgba(0, 0, 0, 0.06)",
200: "rgba(0, 0, 0, 0.08)",
300: "rgba(0, 0, 0, 0.16)",
400: "rgba(0, 0, 0, 0.24)",
500: "rgba(0, 0, 0, 0.36)",
600: "rgba(0, 0, 0, 0.48)",
700: "rgba(0, 0, 0, 0.64)",
800: "rgba(0, 0, 0, 0.80)",
900: "rgba(0, 0, 0, 0.92)"
},
gray: {
50: "#F7FAFC",
100: "#EDF2F7",
200: "#E2E8F0",
300: "#CBD5E0",
400: "#A0AEC0",
500: "#718096",
600: "#4A5568",
700: "#2D3748",
800: "#1A202C",
900: "#171923"
},
red: {
50: "#fff5f5",
100: "#fed7d7",
200: "#feb2b2",
300: "#fc8181",
400: "#f56565",
500: "#e53e3e",
600: "#c53030",
700: "#9b2c2c",
800: "#822727",
900: "#63171b"
},
orange: {
50: "#FFFAF0",
100: "#FEEBC8",
200: "#FBD38D",
300: "#F6AD55",
400: "#ED8936",
500: "#DD6B20",
600: "#C05621",
700: "#9C4221",
800: "#7B341E",
900: "#652B19"
},
yellow: {
50: "#fffff0",
100: "#fefcbf",
200: "#faf089",
300: "#f6e05e",
400: "#ecc94b",
500: "#d69e2e",
600: "#b7791f",
700: "#975a16",
800: "#744210",
900: "#5F370E"
},
green: {
50: "#f0fff4",
100: "#c6f6d5",
200: "#9ae6b4",
300: "#68d391",
400: "#48bb78",
500: "#38a169",
600: "#2f855a",
700: "#276749",
800: "#22543d",
900: "#1C4532"
},
teal: {
50: "#E6FFFA",
100: "#B2F5EA",
200: "#81E6D9",
300: "#4FD1C5",
400: "#38B2AC",
500: "#319795",
600: "#2C7A7B",
700: "#285E61",
800: "#234E52",
900: "#1D4044"
},
blue: {
50: "#ebf8ff",
100: "#ceedff",
200: "#90cdf4",
300: "#63b3ed",
400: "#4299e1",
500: "#3182ce",
600: "#2a69ac",
700: "#1e4e8c",
800: "#153e75",
900: "#1a365d"
},
cyan: {
50: "#EDFDFD",
100: "#C4F1F9",
200: "#9DECF9",
300: "#76E4F7",
400: "#0BC5EA",
500: "#00B5D8",
600: "#00A3C4",
700: "#0987A0",
800: "#086F83",
900: "#065666"
},
purple: {
50: "#faf5ff",
100: "#e9d8fd",
200: "#d6bcfa",
300: "#b794f4",
400: "#9f7aea",
500: "#805ad5",
600: "#6b46c1",
700: "#553c9a",
800: "#44337a",
900: "#322659"
},
pink: {
50: "#fff5f7",
100: "#fed7e2",
200: "#fbb6ce",
300: "#f687b3",
400: "#ed64a6",
500: "#d53f8c",
600: "#b83280",
700: "#97266d",
800: "#702459",
900: "#521B41"
},
linkedin: {
50: "#E8F4F9",
100: "#CFEDFB",
200: "#9BDAF3",
300: "#68C7EC",
400: "#34B3E4",
500: "#00A0DC",
600: "#008CC9",
700: "#0077B5",
800: "#005E93",
900: "#004471"
},
facebook: {
50: "#E8F4F9",
100: "#D9DEE9",
200: "#B7C2DA",
300: "#6482C0",
400: "#4267B2",
500: "#385898",
600: "#314E89",
700: "#29487D",
800: "#223B67",
900: "#1E355B"
},
messenger: {
50: "#D0E6FF",
100: "#B9DAFF",
200: "#A2CDFF",
300: "#7AB8FF",
400: "#2E90FF",
500: "#0078FF",
600: "#0063D1",
700: "#0052AC",
800: "#003C7E",
900: "#002C5C"
},
whatsapp: {
50: "#e2f7f4",
100: "#c3f0e9",
200: "#a0e7dc",
300: "#76dccd",
400: "#43cfba",
500: "#00BFA5",
600: "#00ac92",
700: "#009780",
800: "#007d6a",
900: "#005a4c"
},
twitter: {
50: "#e5f4fd",
100: "#c8e9fb",
200: "#a8dcfa",
300: "#83cdf7",
400: "#57bbf5",
500: "#1DA1F2",
600: "#1a94da",
700: "#1681bf",
800: "#136b9e",
900: "#0d4d71"
},
telegram: {
50: "#e3f2f9",
100: "#c5e4f3",
200: "#a2d4ec",
300: "#7ac1e4",
400: "#47a9da",
500: "#0088CC",
600: "#007ab8",
700: "#006ba1",
800: "#005885",
900: "#003f5e"
}
};
var colors_default = colors;
// node_modules/@chakra-ui/core/dist/es/theme/sizes.js
var import_defineProperty4 = __toModule(require_defineProperty());
function ownKeys4(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread4(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys4(source, true).forEach(function(key) {
import_defineProperty4.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys4(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var baseSizes = {
px: "1px",
"0": "0",
"1": "0.25rem",
"2": "0.5rem",
"3": "0.75rem",
"4": "1rem",
"5": "1.25rem",
"6": "1.5rem",
"8": "2rem",
"10": "2.5rem",
"12": "3rem",
"16": "4rem",
"20": "5rem",
"24": "6rem",
"32": "8rem",
"40": "10rem",
"48": "12rem",
"56": "14rem",
"64": "16rem"
};
var largeSizes = {
full: "100%",
"3xs": "14rem",
"2xs": "16rem",
xs: "20rem",
sm: "24rem",
md: "28rem",
lg: "32rem",
xl: "36rem",
"2xl": "42rem",
"3xl": "48rem",
"4xl": "56rem",
"5xl": "64rem",
"6xl": "72rem"
};
var containers = {
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1280px"
};
var sizes = _objectSpread4({}, baseSizes, {}, largeSizes, {
containers
});
var sizes_default = sizes;
// node_modules/@chakra-ui/core/dist/es/theme/typography.js
var typography2 = {
letterSpacings: {
tighter: "-0.05em",
tight: "-0.025em",
normal: "0",
wide: "0.025em",
wider: "0.05em",
widest: "0.1em"
},
lineHeights: {
normal: "normal",
none: "1",
shorter: "1.25",
short: "1.375",
base: "1.5",
tall: "1.625",
taller: "2"
},
fontWeights: {
hairline: 100,
thin: 200,
light: 300,
normal: 400,
medium: 500,
semibold: 600,
bold: 700,
extrabold: 800,
black: 900
},
fonts: {
heading: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
body: '-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
mono: 'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'
},
fontSizes: {
xs: "0.75rem",
sm: "0.875rem",
md: "1rem",
lg: "1.125rem",
xl: "1.25rem",
"2xl": "1.5rem",
"3xl": "1.875rem",
"4xl": "2.25rem",
"5xl": "3rem",
"6xl": "4rem"
}
};
var typography_default = typography2;
// node_modules/@chakra-ui/core/dist/es/theme/theme.js
function ownKeys5(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread5(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys5(source, true).forEach(function(key) {
import_defineProperty5.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys5(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var space2 = baseSizes;
var shadows = {
sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
outline: "0 0 0 3px rgba(66, 153, 225, 0.6)",
inner: "inset 0 2px 4px 0 rgba(0,0,0,0.06)",
none: "none"
};
var breakpoints = ["30em", "48em", "62em", "80em"];
breakpoints.sm = breakpoints[0];
breakpoints.md = breakpoints[1];
breakpoints.lg = breakpoints[2];
breakpoints.xl = breakpoints[3];
var zIndices = {
hide: -1,
auto: "auto",
base: 0,
docked: 10,
dropdown: 1e3,
sticky: 1100,
banner: 1200,
overlay: 1300,
modal: 1400,
popover: 1500,
skipLink: 1600,
toast: 1700,
tooltip: 1800
};
var radii = {
none: "0",
sm: "0.125rem",
md: "0.25rem",
lg: "0.5rem",
full: "9999px"
};
var opacity2 = {
"0": "0",
"20%": "0.2",
"40%": "0.4",
"60%": "0.6",
"80%": "0.8",
"100%": "1"
};
var borders = {
none: 0,
"1px": "1px solid",
"2px": "2px solid",
"4px": "4px solid"
};
var theme = _objectSpread5({
breakpoints,
zIndices,
radii,
opacity: opacity2,
borders,
colors: colors_default
}, typography_default, {
sizes: sizes_default,
shadows,
space: space2,
icons: IconPaths_default
});
var theme_default = theme;
// node_modules/@chakra-ui/core/dist/es/ThemeProvider/index.js
var ThemeProvider3 = function ThemeProvider4(_ref) {
var theme2 = _ref.theme, children = _ref.children;
return jsx(ThemeProvider, {
theme: theme2
}, children);
};
ThemeProvider3.defaultProps = {
theme: theme_default
};
var useTheme = function useTheme2() {
var theme2 = import_react6.useContext(ThemeContext);
if (theme2 === void 0) {
throw new Error("useTheme must be used within a ThemeProvider");
}
return theme2;
};
var ThemeProvider_default = ThemeProvider3;
// node_modules/@chakra-ui/core/dist/es/utils/index.js
var focusableElList = ["a[href]", "area[href]", "button:not([disabled])", "embed", "iframe", "input:not([disabled])", "object", "select:not([disabled])", "textarea:not([disabled])", "*[tabindex]:not([aria-disabled])", "*[contenteditable]"];
var focusableElSelector = focusableElList.join();
function setRef(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref) {
ref.current = value;
}
}
function useForkRef(refA, refB) {
return import_react7.useMemo(function() {
if (refA == null && refB == null) {
return null;
}
return function(refValue) {
setRef(refA, refValue);
setRef(refB, refValue);
};
}, [refA, refB]);
}
// node_modules/@chakra-ui/core/dist/es/ColorModeProvider/index.js
var import_extends2 = __toModule(require_extends());
var import_react11 = __toModule(require_react());
// node_modules/@use-it/event-listener/dist/event-listener.m.js
var import_react8 = __toModule(require_react());
// node_modules/use-dark-mode/dist/use-dark-mode.m.js
var import_react10 = __toModule(require_react());
// node_modules/use-persisted-state/dist/use-persisted-state.m.js
var import_react9 = __toModule(require_react());
// node_modules/@chakra-ui/core/dist/es/ColorModeProvider/index.js
var ColorModeContext = import_react11.createContext({
colorMode: "light",
toggleColorMode: function toggleColorMode() {
}
});
var useColorMode = function useColorMode2() {
var context = import_react11.useContext(ColorModeContext);
if (context === void 0) {
throw new Error("useColorMode must be used within a ColorModeProvider");
}
return context;
};
// node_modules/@chakra-ui/core/dist/es/Flex/index.js
var import_extends3 = __toModule(require_extends());
var import_objectWithoutPropertiesLoose = __toModule(require_objectWithoutPropertiesLoose());
var import_react12 = __toModule(require_react());
var Flex = import_react12.forwardRef(function(_ref, ref) {
var align = _ref.align, justify = _ref.justify, wrap = _ref.wrap, direction = _ref.direction, rest = import_objectWithoutPropertiesLoose.default(_ref, ["align", "justify", "wrap", "direction"]);
return import_react12.default.createElement(Box_default, import_extends3.default({
ref,
display: "flex",
flexDirection: direction,
alignItems: align,
justifyContent: justify,
flexWrap: wrap
}, rest));
});
Flex.displayName = "Flex";
var Flex_default = Flex;
// node_modules/@chakra-ui/core/dist/es/CSSReset/index.js
var import_taggedTemplateLiteralLoose2 = __toModule(require_taggedTemplateLiteralLoose());
// node_modules/@chakra-ui/core/dist/es/CSSReset/preflight.js
var import_taggedTemplateLiteralLoose = __toModule(require_taggedTemplateLiteralLoose());
function _templateObject() {
var data = import_taggedTemplateLiteralLoose.default(['\n html {\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n }\n\n body {\n margin: 0;\n }\n\n main {\n display: block;\n }\n\n h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n\n hr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n\n pre {\n font-family: monospace, monospace;\n font-size: 1em;\n }\n\n a {\n background-color: transparent;\n }\n\n abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n b,\n strong {\n font-weight: bolder;\n }\n\n code,\n kbd,\n samp {\n font-family: monospace, monospace;\n font-size: 1em;\n }\n\n small {\n font-size: 80%;\n }\n\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n sup {\n top: -0.5em;\n }\n\n img {\n border-style: none;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n button,\n input {\n overflow: visible;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n textarea {\n overflow: auto;\n }\n\n [type="checkbox"],\n [type="radio"] {\n box-sizing: border-box;\n padding: 0;\n }\n\n [type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n\n input[type="number"] {\n -moz-appearance: textfield;\n }\n\n [type="search"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n [type="search"]::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n details {\n display: block;\n }\n\n summary {\n display: list-item;\n }\n\n template {\n display: none;\n }\n\n [hidden] {\n display: none !important;\n }\n\n html {\n box-sizing: border-box;\n font-family: sans-serif;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n\n button {\n background: transparent;\n padding: 0;\n }\n\n fieldset {\n margin: 0;\n padding: 0;\n }\n\n ol,\n ul {\n margin: 0;\n padding: 0;\n }\n\n html {\n font-family: ', ';\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -webkit-text-size-adjust: 100%;\n text-rendering: optimizelegibility;\n }\n\n hr {\n border-top-width: 1px;\n }\n\n img {\n border-style: solid;\n }\n\n textarea {\n resize: vertical;\n }\n\n button,\n [role="button"] {\n cursor: pointer;\n }\n\n button::-moz-focus-inner {\n border: 0 !important;\n }\n\n table {\n border-collapse: collapse;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n\n a {\n color: inherit;\n text-decoration: inherit;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n\n pre,\n code,\n kbd,\n samp {\n font-family: ', ";\n }\n\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n"]);
_templateObject = function _templateObject3() {
return data;
};
return data;
}
var tailwindPreflight = function tailwindPreflight2(theme2) {
return css_browser_esm_default(_templateObject(), theme2.fonts.body, theme2.fonts.mono);
};
var preflight_default = tailwindPreflight;
// node_modules/@chakra-ui/core/dist/es/CSSReset/index.js
function _templateObject2() {
var data = import_taggedTemplateLiteralLoose2.default(["\n html {\n line-height: 1.5;\n color: ", ";\n background-color: ", ";\n }\n\n /**\n * Allow adding a border to an element by just adding a border-width.\n */\n\n *,\n *::before,\n *::after {\n border-width: 0;\n border-style: solid;\n border-color: ", ";\n }\n\n input:-ms-input-placeholder,\n textarea:-ms-input-placeholder {\n color: ", ";\n }\n\n input::-ms-input-placeholder,\n textarea::-ms-input-placeholder {\n color: ", ";\n }\n\n input::placeholder,\n textarea::placeholder {\n color: ", ";\n }\n "]);
_templateObject2 = function _templateObject3() {
return data;
};
return data;
}
var defaultConfig = function defaultConfig2(theme2) {
return {
light: {
color: theme2.colors.gray[800],
bg: void 0,
borderColor: theme2.colors.gray[200],
placeholderColor: theme2.colors.gray[400]
},
dark: {
color: theme2.colors.whiteAlpha[900],
bg: theme2.colors.gray[800],
borderColor: theme2.colors.whiteAlpha[300],
placeholderColor: theme2.colors.whiteAlpha[400]
}
};
};
var CSSReset = function CSSReset2(_ref) {
var config10 = _ref.config;
var _useColorMode = useColorMode(), colorMode = _useColorMode.colorMode;
var configCSS = function configCSS2(theme2) {
var _defaultConfig = defaultConfig(theme2);
var _config = config10 ? config10(theme2, _defaultConfig) : defaultConfig(theme2);
var _config$colorMode = _config[colorMode], color2 = _config$colorMode.color, bg = _config$colorMode.bg, borderColor2 = _config$colorMode.borderColor, placeholderColor = _config$colorMode.placeholderColor;
return css_browser_esm_default(_templateObject2(), color2, bg, borderColor2, placeholderColor, placeholderColor, placeholderColor);
};
return jsx(Global, {
styles: function styles(theme2) {
return css_browser_esm_default([preflight_default(theme2), configCSS(theme2)]);
}
});
};
var CSSReset_default = CSSReset;
// node_modules/@chakra-ui/core/dist/es/FormControl/index.js
var import_extends4 = __toModule(require_extends());
var import_objectWithoutPropertiesLoose2 = __toModule(require_objectWithoutPropertiesLoose());
var import_react13 = __toModule(require_react());
var useFormControl = function useFormControl2(props2) {
var context = useFormControlContext();
if (!context) {
return props2;
}
var keys = Object.keys(context);
return keys.reduce(function(acc, prop) {
acc[prop] = props2[prop];
if (context) {
if (props2[prop] == null) {
acc[prop] = context[prop];
}
}
return acc;
}, {});
};
var FormControlContext = import_react13.createContext();
var useFormControlContext = function useFormControlContext2() {
var context = import_react13.useContext(FormControlContext);
return context;
};
var FormControl = import_react13.forwardRef(function(_ref, ref) {
var isInvalid = _ref.isInvalid, isRequired = _ref.isRequired, isDisabled = _ref.isDisabled, isReadOnly = _ref.isReadOnly, rest = import_objectWithoutPropertiesLoose2.default(_ref, ["isInvalid", "isRequired", "isDisabled", "isReadOnly"]);
var context = {
isRequired,
isDisabled,
isInvalid,
isReadOnly
};
return jsx(FormControlContext.Provider, {
value: context
}, jsx(Box_default, import_extends4.default({
role: "group",
ref
}, rest)));
});
FormControl.displayName = "FormControl";
// node_modules/@chakra-ui/core/dist/es/Text/index.js
var import_extends5 = __toModule(require_extends());
var import_react14 = __toModule(require_react());
var Text = import_react14.default.forwardRef(function(props2, ref) {
return import_react14.default.createElement(Box_default, import_extends5.default({
ref,
as: "p",
fontFamily: "body"
}, props2));
});
Text.displayName = "Text";
var Text_default = Text;
// node_modules/@chakra-ui/core/dist/es/Input/index.js
var import_extends6 = __toModule(require_extends());
var import_objectWithoutPropertiesLoose3 = __toModule(require_objectWithoutPropertiesLoose());
var import_react15 = __toModule(require_react());
// node_modules/@chakra-ui/core/dist/es/Input/styles.js
var import_defineProperty6 = __toModule(require_defineProperty());
function ownKeys6(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread6(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys6(source, true).forEach(function(key) {
import_defineProperty6.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys6(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var outlinedStyle = function outlinedStyle2(_ref) {
var theme2 = _ref.theme, colorMode = _ref.colorMode, focusBorderColor = _ref.focusBorderColor, errorBorderColor = _ref.errorBorderColor;
var bg = {
light: "white",
dark: "whiteAlpha.100"
};
var borderColor2 = {
light: "inherit",
dark: "whiteAlpha.50"
};
var hoverColor = {
light: "gray.300",
dark: "whiteAlpha.200"
};
var _focusBorderColor = get(theme2.colors, focusBorderColor, focusBorderColor);
var _errorBorderColor = get(theme2.colors, errorBorderColor, errorBorderColor);
return _objectSpread6({}, readOnly2, {
border: "1px",
borderColor: borderColor2[colorMode],
bg: bg[colorMode],
_hover: {
borderColor: hoverColor[colorMode]
},
_disabled: {
opacity: "0.4",
cursor: "not-allowed"
},
_focus: {
zIndex: 1,
borderColor: _focusBorderColor,
boxShadow: "0 0 0 1px " + _focusBorderColor
},
_invalid: {
borderColor: _errorBorderColor,
boxShadow: "0 0 0 1px " + _errorBorderColor
}
});
};
var readOnly2 = {
_readOnly: {
bg: "transparent",
boxShadow: "none !important",
userSelect: "all"
}
};
var filledStyle = function filledStyle2(_ref2) {
var theme2 = _ref2.theme, focusBorderColor = _ref2.focusBorderColor, errorBorderColor = _ref2.errorBorderColor, colorMode = _ref2.colorMode;
var bg = {
light: "gray.100",
dark: "whiteAlpha.50"
};
var hoverColor = {
light: "gray.200",
dark: "whiteAlpha.100"
};
var _focusBorderColor = get(theme2.colors, focusBorderColor, focusBorderColor);
var _errorBorderColor = get(theme2.colors, errorBorderColor, errorBorderColor);
return _objectSpread6({}, readOnly2, {
border: "2px",
borderColor: "transparent",
bg: bg[colorMode],
_hover: {
bg: hoverColor[colorMode]
},
_disabled: {
opacity: "0.4",
cursor: "not-allowed"
},
_focus: {
zIndex: 1,
bg: "transparent",
borderColor: _focusBorderColor
},
_invalid: {
borderColor: _errorBorderColor
}
});
};
var flushedStyle = function flushedStyle2(_ref3) {
var theme2 = _ref3.theme, focusBorderColor = _ref3.focusBorderColor, errorBorderColor = _ref3.errorBorderColor;
var _focusBorderColor = get(theme2.colors, focusBorderColor, focusBorderColor);
var _errorBorderColor = get(theme2.colors, errorBorderColor, errorBorderColor);
return _objectSpread6({}, readOnly2, {
borderBottom: "2px",
borderColor: "inherit",
rounded: 0,
px: void 0,
bg: "transparent",
_focus: {
zIndex: 1,
borderColor: _focusBorderColor
},
_invalid: {
borderColor: _errorBorderColor
}
});
};
var unstyledStyle = {
bg: "transparent",
px: void 0,
height: void 0
};
var variantProps = function variantProps2(props2) {
switch (props2.variant) {
case "flushed":
return flushedStyle(props2);
case "unstyled":
return unstyledStyle;
case "filled":
return filledStyle(props2);
case "outline":
return outlinedStyle(props2);
default:
return {};
}
};
var baseProps = {
display: "flex",
alignItems: "center",
position: "relative",
transition: "all 0.2s",
outline: "none",
appearance: "none"
};
var inputSizes = {
lg: {
fontSize: "lg",
px: 4,
height: 12,
rounded: "md"
},
md: {
fontSize: "md",
px: 4,
height: 10,
rounded: "md"
},
sm: {
fontSize: "sm",
px: 3,
height: 8,
rounded: "sm"
}
};
var sizeProps = function sizeProps2(props2) {
return inputSizes[props2.size];
};
var useInputStyle = function useInputStyle2(props2) {
var theme2 = useTheme();
var _useColorMode = useColorMode(), colorMode = _useColorMode.colorMode;
var _props = _objectSpread6({}, props2, {
theme: theme2,
colorMode
});
return _objectSpread6({
width: props2.isFullWidth ? "100%" : void 0
}, baseProps, {}, sizeProps(_props), {}, variantProps(_props));
};
var styles_default = useInputStyle;
// node_modules/@chakra-ui/core/dist/es/Input/index.js
var Input = import_react15.forwardRef(function(props2, ref) {
var size2 = props2.size, variant3 = props2.variant, as = props2.as, ariaLabel = props2["aria-label"], ariaDescribedby = props2["aria-describedby"], isReadOnly = props2.isReadOnly, isFullWidth = props2.isFullWidth, isDisabled = props2.isDisabled, isInvalid = props2.isInvalid, isRequired = props2.isRequired, focusBorderColor = props2.focusBorderColor, errorBorderColor = props2.errorBorderColor, rest = import_objectWithoutPropertiesLoose3.default(props2, ["size", "variant", "as", "aria-label", "aria-describedby", "isReadOnly", "isFullWidth", "isDisabled", "isInvalid", "isRequired", "focusBorderColor", "errorBorderColor"]);
var inputStyleProps = styles_default(props2);
var formControl = useFormControl(props2);
return jsx(PseudoBox_default, import_extends6.default({
ref,
as,
readOnly: formControl.isReadOnly,
"aria-readonly": isReadOnly,
disabled: formControl.isDisabled,
"aria-label": ariaLabel,
"aria-invalid": formControl.isInvalid,
required: formControl.isRequired,
"aria-required": formControl.isRequired,
"aria-disabled": formControl.isDisabled,
"aria-describedby": ariaDescribedby
}, inputStyleProps, rest));
});
Input.displayName = "Input";
Input.defaultProps = {
size: "md",
as: "input",
variant: "outline",
isFullWidth: true,
focusBorderColor: "blue.500",
errorBorderColor: "red.500"
};
var Input_default = Input;
// node_modules/@chakra-ui/core/dist/es/Stack/index.js
var import_extends7 = __toModule(require_extends());
var import_objectWithoutPropertiesLoose4 = __toModule(require_objectWithoutPropertiesLoose());
var import_react16 = __toModule(require_react());
var Stack = function Stack2(_ref) {
var direction = _ref.direction, _ref$isInline = _ref.isInline, isInline = _ref$isInline === void 0 ? false : _ref$isInline, _ref$isReversed = _ref.isReversed, isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed, children = _ref.children, align = _ref.align, justify = _ref.justify, _ref$spacing = _ref.spacing, spacing = _ref$spacing === void 0 ? 2 : _ref$spacing, shouldWrapChildren = _ref.shouldWrapChildren, rest = import_objectWithoutPropertiesLoose4.default(_ref, ["direction", "isInline", "isReversed", "children", "align", "justify", "spacing", "shouldWrapChildren"]);
var _isReversed = isReversed || direction && direction.endsWith("reverse");
var _isInline = isInline || direction && direction.startsWith("row");
var _direction;
if (_isInline) {
_direction = "row";
}
if (_isReversed) {
_direction = isInline ? "row-reverse" : "column-reverse";
}
if (direction) {
_direction = direction;
}
if (!_isInline && !_isReversed && !direction) {
_direction = "column";
}
var validChildrenArray = import_react16.Children.toArray(children).filter(import_react16.isValidElement);
return jsx(Flex_default, import_extends7.default({
align,
justify,
direction: _direction
}, rest), validChildrenArray.map(function(child, index2) {
var _ref2, _ref3;
var isLastChild = validChildrenArray.length === index2 + 1;
var spacingProps = _isInline ? (_ref2 = {}, _ref2[_isReversed ? "ml" : "mr"] = isLastChild ? null : spacing, _ref2) : (_ref3 = {}, _ref3[_isReversed ? "mt" : "mb"] = isLastChild ? null : spacing, _ref3);
if (shouldWrapChildren) {
return jsx(Box_default, import_extends7.default({
d: "inline-block"
}, spacingProps, {
key: "stack-box-wrapper-" + index2
}), child);
}
return import_react16.cloneElement(child, spacingProps);
}));
};
var Stack_default = Stack;
// node_modules/@chakra-ui/core/dist/es/Slider/index.js
var import_objectWithoutPropertiesLoose5 = __toModule(require_objectWithoutPropertiesLoose());
var import_extends8 = __toModule(require_extends());
var import_react17 = __toModule(require_react());
// node_modules/@chakra-ui/core/dist/es/Slider/styles.js
var import_defineProperty7 = __toModule(require_defineProperty());
function ownKeys7(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread7(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys7(source, true).forEach(function(key) {
import_defineProperty7.default(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys7(source).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
var centeredProps = {
position: "absolute",
top: "50%",
transform: "translateY(-50%)"
};
var thumbStyle = function thumbStyle2(_ref) {
var thumbSize = _ref.thumbSize, trackPercent = _ref.trackPercent, theme2 = _ref.theme;
return _objectSpread7({}, centeredProps, {
zIndex: 1,
size: thumbSize,
rounded: "full",
bg: "#fff",
boxShadow: "sm",
left: "calc(" + trackPercent + "% - " + thumbSize + " / 2)",
border: "1px",
borderColor: "transparent",
transition: "transform 0.2s",
_focus: {
boxShadow: "outline"
},
_disabled: {
backgroundColor: "gray.300"
},
_active: {
transform: "translateY(-50%) scale(1.15)"
}
});
};
var filledTrackStyle = function filledTrackStyle2(_ref2) {
var trackHeight = _ref2.trackHeight, trackPercent = _ref2.trackPercent, color2 = _ref2.color, colorMode = _ref2.colorMode;
return _objectSpread7({}, centeredProps, {
height: trackHeight,
bg: colorMode === "light" ? color2 + ".500" : color2 + ".200",
width: trackPercent + "%",
rounded: "sm"
});
};
var themedTrackStyle = {
light: {
bg: "gray.200",
_disabled: {
bg: "gray.300"
}
},
dark: {
bg: "whiteAlpha.200",
_disabled: {
bg: "whiteAlpha.300"
}
}
};
var trackStyle = function trackStyle2(_ref3) {
var trackHeight = _ref3.trackHeight, theme2 = _ref3.theme, colorMode = _ref3.colorMode;
return _objectSpread7({
height: trackHeight,
borderRadius: "sm",
width: "100%"
}, centeredProps, {}, themedTrackStyle[colorMode]);
};
var rootStyle = {
width: "full",
display: "inline-block",
position: "relative",
cursor: "pointer",
_disabled: {
opacity: 0.6,
cursor: "default",
pointerEvents: "none"
}
};
var sizes2 = {
lg: {
thumb: "16px",
trackHeight: "4px"
},
md: {
thumb: "14px",
trackHeight: "4px"
},
sm: {
thumb: "10px",
trackHeight: "2px"
}
};
var useSliderStyle = function useSliderStyle2(props2) {
var theme2 = useTheme();
var _useColorMode = useColorMode(), colorMode = _useColorMode.colorMode;
var trackPercent = props2.trackPercent, size2 = props2.size, color2 = props2.color;
var _sizes$size = sizes2[size2], trackHeight = _sizes$size.trackHeight, thumbSize = _sizes$size.thumb;
var _props = {
trackHeight,
thumbSize,
theme: theme2,
trackPercent,
color: color2,
colorMode
};
return {
rootStyle,
trackStyle: trackStyle(_props),
filledTrackStyle: filledTrackStyle(_props),
thumbStyle: thumbStyle(_props)
};
};
var styles_default2 = useSliderStyle;
// node_modules/@chakra-ui/core/dist/es/Slider/index.js
function valueToPercent(value, min, max) {
return (value - min) * 100 / (max - min);
}
function percentToValue(percent, min, max) {
return (max - min) * percent + min;
}
function makeValuePrecise(value, step) {
var stepDecimalPart = step.toString().split(".")[1];
var stepPrecision = stepDecimalPart ? stepDecimalPart.length : 0;
return Number(value.toFixed(stepPrecision));
}
function roundValueToStep(value, step) {
return makeValuePrecise(Math.round(value / step) * step, step);
}
function clampValue(val, min, max) {
if (val > max) {
return max;
}
if (val < min) {
return min;
}
return val;
}
var SliderThumb = import_react17.forwardRef(function(props2, ref) {
var _useSliderContext = useSliderContext(), thumbRef = _useSliderContext.thumbRef, isDisabled = _useSliderContext.isDisabled, onFocus = _useSliderContext.onFocus, onKeyDown = _useSliderContext.onThumbKeyDown, min = _useSliderContext.min, max = _useSliderContext.max, valueText = _useSliderContext.valueText, orientation = _useSliderContext.orientation, trackPercent = _useSliderContext.trackPercent, size2 = _useSliderContext.size, color2 = _useSliderContext.color, value = _useSliderContext.value, ariaLabelledBy = _useSliderContext.ariaLabelledBy;
var _useSliderStyle = styles_default2({
trackPercent,
orientation,
size: size2,
color: color2
}), thumbStyle3 = _useSliderStyle.thumbStyle;
var sliderThumbRef = useForkRef(thumbRef, ref);
return jsx(PseudoBox_default, import_extends8.default({
"data-slider-thumb": "",
d: "flex",
alignItems: "center",
outline: "none",
justifyContent: "center",
onFocus,
ref: sliderThumbRef,
role: "slider",
tabIndex: isDisabled ? void 0 : 0,
"aria-disabled": isDisabled,
"aria-valuemin": min,
"aria-valuetext": valueText,
"aria-orientation": orientation,
"aria-valuenow": value,
"aria-valuemax": max,
"aria-labelledby": ariaLabelledBy,
onKeyDown
}, thumbStyle3, props2));
});
SliderThumb.displayName = "SliderThumb";
var SliderTrack = function SliderTrack2(props2) {
var _useSliderContext2 = useSliderContext(), trackRef = _useSliderContext2.trackRef, isDisabled = _useSliderContext2.isDisabled, context = import_objectWithoutPropertiesLoose5.default(_useSliderContext2, ["trackRef", "isDisabled"]);
var _useSliderStyle2 = styles_default2(context), trackStyle3 = _useSliderStyle2.trackStyle;
return jsx(Box_default, import_extends8.default({
"data-slider-track": "",
"aria-disabled": isDisabled,
ref: trackRef
}, trackStyle3, props2));
};
var SliderFilledTrack = function SliderFilledTrack2(props2) {
var _useSliderContext3 = useSliderContext(), isDisabled = _useSliderContext3.isDisabled, context = import_objectWithoutPropertiesLoose5.default(_useSliderContext3, ["isDisabled"]);
var _useSliderStyle3 = styles_default2(context), filledTrackStyle3 = _useSliderStyle3.filledTrackStyle;
return jsx(PseudoBox_default, import_extends8.default({
"aria-disabled": isDisabled,
"data-slider-filled-track": ""
}, filledTrackStyle3, props2));
};
var SliderContext = import_react17.createContext();
var useSliderContext = function useSliderContext2() {
return import_react17.useContext(SliderContext);
};
var Slider = import_react17.forwardRef(function(_ref, ref) {
var controlledValue = _ref.value, defaultValue = _ref.defaultValue, onChange = _ref.onChange, onKeyDown = _ref.onKeyDown, onFocus = _ref.onFocus, _onBlur = _ref.onBlur, onMouseDown = _ref.onMouseDown, isDisabled = _ref.isDisabled, _ref$max = _ref.max, max = _ref$max === void 0 ? 100 : _ref$max, _ref$min = _ref.min, min = _ref$min === void 0 ? 0 : _ref$min, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step, ariaLabelledBy = _ref["aria-labelledby"], ariaLabel = _ref["aria-label"], ariaValueText = _ref["aria-valuetext"], _ref$orientation = _ref.orientation, orientation = _ref$orientation === void 0 ? "horizontal" : _ref$orientation, getAriaValueText = _ref.getAriaValueText, _ref$size = _ref.size, size2 = _ref$size === void 0 ? "md" : _ref$size, _ref$color = _ref.color, color2 = _ref$color === void 0 ? "blue" : _ref$color, name = _ref.name, id = _ref.id, children = _ref.children, rest = import_objectWithoutPropertiesLoose5.default(_ref, ["value", "defaultValue", "onChange", "onKeyDown", "onFocus", "onBlur", "onMouseDown", "isDisabled", "max", "min", "step", "aria-labelledby", "aria-label", "aria-valuetext", "orientation", "getAriaValueText", "size", "color", "name", "id", "children"]);
var _useRef = import_react17.useRef(controlledValue != null), isControlled = _useRef.current;
var _useState = import_react17.useState(defaultValue || 0), value = _useState[0], setValue = _useState[1];
var _value = isControlled ? controlledValue : value;
var actualValue = clampValue(_value, min, max);
var trackPercent = valueToPercent(actualValue, min, max);
var _useSliderStyle4 = styles_default2({
trackPercent,
orientation,
size: size2,
color: color2
}), rootStyle2 = _useSliderStyle4.rootStyle;
var trackRef = import_react17.useRef();
var thumbRef = import_react17.useRef();
var getNewValue = function getNewValue2(event) {
if (trackRef.current) {
var _trackRef$current$get = trackRef.current.getBoundingClientRect(), left2 = _trackRef$current$get.left, width2 = _trackRef$current$get.width;
var _ref2 = event.touches ? event.touches[0] : event, clientX = _ref2.clientX;
var diffX = clientX - left2;
var percent = diffX / width2;
var newValue = percentToValue(percent, min, max);
if (step) {
newValue = roundValueToStep(newValue, step);
}
newValue = clampValue(newValue, min, max);
return newValue;
}
};
var updateValue = import_react17.useCallback(function(newValue) {
if (!isControlled) {
setValue(newValue);
}
if (onChange) {
onChange(newValue);
}
}, [isControlled, onChange]);
var handleThumbKeyDown = function handleThumbKeyDown2(event) {
var flag = false;
var newValue;
var tenSteps = (max - min) / 10;
switch (event.key) {
case "ArrowLeft":
case "ArrowDown":
newValue = actualValue - step;
flag = true;
break;
case "ArrowRight":
case "ArrowUp":
newValue = actualValue + step;
flag = true;
break;
case "PageDown":
newValue = actualValue - tenSteps;
flag = true;
break;
case "PageUp":
newValue = actualValue + tenSteps;
flag = true;
break;
case "Home":
newValue = min;
flag = true;
break;
case "End":
newValue = max;
flag = true;
break;
default:
return;
}
if (flag) {
event.preventDefault();
event.stopPropagation();
}
if (step) {
newValue = roundValueToStep(newValue, step);
}
newValue = clampValue(newValue, min, max);
updateValue(newValue);
onKeyDown && onKeyDown(event);
};
var handleMouseUp = function handleMouseUp2() {
document.body.removeEventListener("mousemove", handleMouseMove);
document.body.removeEventListener("touchmove", handleMouseMove);
document.body.removeEventListener("mouseup", handleMouseUp2);
document.body.removeEventListener("touchend", handleMouseUp2);
};
var handleMouseMove = function handleMouseMove2(event) {
var newValue = getNewValue(event);
updateValue(newValue);
};
var handleMouseDown = function handleMouseDown2(event) {
if (isDisabled)
return;
onMouseDown && onMouseDown(event);
event.preventDefault();
var newValue = getNewValue(event);
if (newValue !== actualValue) {
updateValue(newValue);
}
document.body.addEventListener("mousemove", handleMouseMove);
document.body.addEventListener("touchmove", handleMouseMove);
document.body.addEventListener("mouseup", handleMouseUp);
document.body.addEventListener("touchend", handleMouseUp);
thumbRef.current && thumbRef.current.focus();
};
var valueText = getAriaValueText ? getAriaValueText(actualValue) : ariaValueText;
var context = {
trackRef,
thumbRef,
onThumbKeyDown: handleThumbKeyDown,
onFocus,
trackPercent,
ariaLabelledBy,
orientation,
isDisabled,
size: size2,
color: color2,
min,
max,
valueText,
value: actualValue
};
return jsx(SliderContext.Provider, {
value: context
}, jsx(Box_default, import_extends8.default({
role: "presentation",
tabIndex: "-1",
onMouseDown: handleMouseDown,
onTouchStart: handleMouseDown,
onMouseLeave: handleMouseUp,
onTouchEnd: handleMouseUp,
onBlur: function onBlur(event) {
handleMouseUp();
_onBlur && _onBlur(event);
},
py: 3,
"aria-disabled": isDisabled,
ref,
css: {
touchAction: "none"
}
}, rootStyle2, rest), children, jsx("input", {
type: "hidden",
value: actualValue,
name,
id
})));
});
Slider.displayName = "Slider";
var Slider_default = Slider;
// node_modules/@chakra-ui/core/dist/es/Textarea/index.js
var import_objectWithoutPropertiesLoose6 = __toModule(require_objectWithoutPropertiesLoose());
var import_extends9 = __toModule(require_extends());
var import_react18 = __toModule(require_react());
var Textarea = import_react18.forwardRef(function(props2, ref) {
return jsx(Input_default, import_extends9.default({
py: "8px",
minHeight: "80px",
lineHeight: "short",
ref,
as: "textarea"
}, props2));
});
Textarea.displayName = "Textarea";
var Textarea_default = Textarea;
var ExpandingTextarea = import_react18.forwardRef(function(_ref, ref) {
var _ref$minHeight = _ref.minHeight, minHeight2 = _ref$minHeight === void 0 ? "39px" : _ref$minHeight, onInput = _ref.onInput, props2 = import_objectWithoutPropertiesLoose6.default(_ref, ["minHeight", "onInput"]);
var _useState = import_react18.useState(0), height2 = _useState[0], setHeight = _useState[1];
var ownRef = import_react18.useRef();
var textareaRef = ref || ownRef;
import_react18.useLayoutEffect(function() {
if (textareaRef.current) {
setHeight(textareaRef.current.scrollHeight);
}
}, [textareaRef]);
var handleInput = function handleInput2(event) {
if (textareaRef.current) {
setTimeout(function() {
setHeight("auto");
setHeight(textareaRef.current.scrollHeight);
}, 0);
}
onInput && onInput(event);
};
return jsx(Textarea, import_extends9.default({
rows: "1",
onInput: handleInput,
css: {
height: height2,
resize: "none",
overflow: "hidden",
minHeight: minHeight2
},
ref: textareaRef
}, props2));
});
ExpandingTextarea.displayName = "ExpandingTextarea";
// src/theme.js
Input_default.defaultProps = {
...Input_default.defaultProps,
borderRadius: 0,
bg: "#444",
color: "#eee",
border: "paneBorder",
borderColor: "inputBorder",
borderWidth: "2px",
_hover: {
borderColor: "inputBorderHover"
},
_focus: {
boxShadow: "inputFocus",
border: "inputFocus"
},
h: 12
};
function studioxtheme(props2 = {}) {
const theme2 = {
...theme_default,
shadows: {
inputFocus: "0 0 10px 4px rgba(255, 50, 200, 0.7)"
},
colors: {
...theme_default.colors,
textBar: "#add",
inputBorder: "rgba(70, 100, 100, 0.5)",
inputBorderHover: "rgba(70, 100, 100, 1)",
button: {
redgreen: {
on: theme_default.colors.green["400"],
off: theme_default.colors.red["600"]
},
blue: {
on: "#00aaff",
off: "#333"
},
green: {
on: "#00cc44",
off: "#333"
},
red: {
on: "#cc3300",
off: "#333"
},
yellow: {
on: "#eedd00",
off: "#333"
}
}
},
borders: {
...theme_default.borders,
paneBorder: "4px solid rgba(0, 150, 150, 0.4)",
paneBorderFocus: "4px solid rgba(0, 200, 200, 0.5)",
barSeperator: "4px solid rgba(0, 150, 150, 0.4)",
inputFocus: "2px solid magenta",
inputHover: "2px solid rgba(255,255,255,0.3)"
}
};
console.log(theme2);
return theme2;
}
// src/comp/Player.js
var import_react23 = __toModule(require_react());
// node_modules/react-hook-form/dist/react-hook-form.es.js
var import_react19 = __toModule(require_react());
var isNullOrUndefined = (value) => value == null;
var isArray = (value) => Array.isArray(value);
var isObjectType = (value) => typeof value === "object";
var isObject = (value) => !isNullOrUndefined(value) && !isArray(value) && isObjectType(value);
var isHTMLElement = (value) => isObject(value) && value.nodeType === Node.ELEMENT_NODE;
var VALIDATION_MODE = {
onBlur: "onBlur",
onChange: "onChange",
onSubmit: "onSubmit"
};
var UNDEFINED = "undefined";
var EVENTS = {
BLUR: "blur",
CHANGE: "change",
INPUT: "input"
};
var SELECT = "select";
var INPUT_VALIDATION_RULES = {
max: "max",
min: "min",
maxLength: "maxLength",
minLength: "minLength",
pattern: "pattern",
required: "required",
validate: "validate"
};
var REGEX_IS_DEEP_PROP = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
var REGEX_IS_PLAIN_PROP = /^\w*$/;
var REGEX_PROP_NAME = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var REGEX_ESCAPE_CHAR = /\\(\\)?/g;
function attachEventListeners({field: {ref}, handleChange, isRadioOrCheckbox}) {
if (isHTMLElement(ref) && handleChange) {
ref.addEventListener(isRadioOrCheckbox ? EVENTS.CHANGE : EVENTS.INPUT, handleChange);
ref.addEventListener(EVENTS.BLUR, handleChange);
}
}
var isKey = (value) => !isArray(value) && (REGEX_IS_PLAIN_PROP.test(value) || !REGEX_IS_DEEP_PROP.test(value));
var stringToPath = (string) => {
const result = [];
string.replace(REGEX_PROP_NAME, (match, number, quote, string2) => {
result.push(quote ? string2.replace(REGEX_ESCAPE_CHAR, "$1") : number || match);
});
return result;
};
function set(object, path, value) {
let index2 = -1;
const tempPath = isKey(path) ? [path] : stringToPath(path);
const length = tempPath.length;
const lastIndex = length - 1;
while (++index2 < length) {
const key = tempPath[index2];
let newValue = value;
if (index2 !== lastIndex) {
const objValue = object[key];
newValue = isObject(objValue) || isArray(objValue) ? objValue : !isNaN(+tempPath[index2 + 1]) ? [] : {};
}
object[key] = newValue;
object = object[key];
}
return object;
}
var transformToNestObject = (data) => Object.entries(data).reduce((previous, [key, value]) => {
if (!isKey(key)) {
set(previous, key, value);
return previous;
}
return Object.assign(Object.assign({}, previous), {[key]: value});
}, {});
var isUndefined = (val) => val === void 0;
var get7 = (obj, path, defaultValue) => {
const result = path.split(/[,[\].]+?/).filter(Boolean).reduce((result2, key) => isNullOrUndefined(result2) ? result2 : result2[key], obj);
return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
};
var focusOnErrorField = (fields, fieldErrors) => {
for (const key in fields) {
if (get7(fieldErrors, key)) {
const field = fields[key];
if (field) {
if (field.ref.focus) {
field.ref.focus();
break;
} else if (field.options) {
field.options[0].ref.focus();
break;
}
}
}
}
};
var removeAllEventListeners = (ref, validateWithStateUpdate) => {
if (isHTMLElement(ref) && ref.removeEventListener) {
ref.removeEventListener(EVENTS.INPUT, validateWithStateUpdate);
ref.removeEventListener(EVENTS.CHANGE, validateWithStateUpdate);
ref.removeEventListener(EVENTS.BLUR, validateWithStateUpdate);
}
};
var isRadioInput = (element) => element.type === "radio";
var isCheckBoxInput = (element) => element.type === "checkbox";
function isDetached(element) {
if (!element) {
return true;
}
if (!(element instanceof HTMLElement) || element.nodeType === Node.DOCUMENT_NODE) {
return false;
}
return isDetached(element.parentNode);
}
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
function baseGet(object, path) {
const updatePath = isKey(path) ? [path] : castPath(path);
const length = path.length;
let index2 = 0;
while (index2 < length) {
object = isUndefined(object) ? index2++ : object[updatePath[index2++]];
}
return index2 == length ? object : void 0;
}
function baseSlice(array, start, end) {
let index2 = -1;
let 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;
const result = Array(length);
while (++index2 < length) {
result[index2] = array[index2 + start];
}
return result;
}
function parent(object, path) {
return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
}
function baseUnset(object, path) {
const updatePath = isKey(path) ? [path] : castPath(path);
const childObject = parent(object, updatePath);
const key = updatePath[updatePath.length - 1];
const result = !(childObject != null) || delete childObject[key];
let previousObjRef = void 0;
for (let k = 0; k < updatePath.slice(0, -1).length; k++) {
let index2 = -1;
let objectRef = void 0;
const currentPaths = updatePath.slice(0, -(k + 1));
const currentPathsLength = currentPaths.length - 1;
if (k > 0) {
previousObjRef = object;
}
while (++index2 < currentPaths.length) {
const item = currentPaths[index2];
objectRef = objectRef ? objectRef[item] : object[item];
if (currentPathsLength === index2) {
if (isObject(objectRef) && isEmptyObject(objectRef) || isArray(objectRef) && !objectRef.filter((data) => isObject(data) && !isEmptyObject(data)).length) {
previousObjRef ? delete previousObjRef[item] : delete object[item];
}
}
previousObjRef = objectRef;
}
}
return result;
}
function unset(object, paths) {
paths.forEach((path) => {
baseUnset(object, path);
});
return object;
}
var isSameRef = (fieldValue, ref) => fieldValue && fieldValue.ref === ref;
function findRemovedFieldAndRemoveListener(fields, handleChange, field, forceDelete) {
const {ref, ref: {name, type}, mutationWatcher} = field;
const fieldValue = fields[name];
if (!type) {
delete fields[name];
return;
}
if ((isRadioInput(ref) || isCheckBoxInput(ref)) && fieldValue) {
const {options} = fieldValue;
if (isArray(options) && options.length) {
options.filter(Boolean).forEach((option, index2) => {
const {ref: ref2, mutationWatcher: mutationWatcher2} = option;
if (ref2 && isDetached(ref2) && isSameRef(option, ref2) || forceDelete) {
removeAllEventListeners(ref2, handleChange);
if (mutationWatcher2) {
mutationWatcher2.disconnect();
}
unset(options, [`[${index2}]`]);
}
});
if (options && !options.filter(Boolean).length) {
delete fields[name];
}
} else {
delete fields[name];
}
} else if (isDetached(ref) && isSameRef(fieldValue, ref) || forceDelete) {
removeAllEventListeners(ref, handleChange);
if (mutationWatcher) {
mutationWatcher.disconnect();
}
delete fields[name];
}
}
var defaultReturn = {
isValid: false,
value: ""
};
var getRadioValue = (options) => isArray(options) ? options.reduce((previous, option) => option && option.ref.checked ? {
isValid: true,
value: option.ref.value
} : previous, defaultReturn) : defaultReturn;
var getMultipleSelectValue = (options) => [...options].filter(({selected: selected2}) => selected2).map(({value}) => value);
var isFileInput = (element) => element.type === "file";
var isMultipleSelect = (element) => element.type === `${SELECT}-multiple`;
var isEmptyString = (value) => value === "";
var defaultResult = {
value: false,
isValid: false
};
var validResult = {value: true, isValid: true};
var getCheckboxValue = (options) => {
if (isArray(options)) {
if (options.length > 1) {
const values = options.filter((option) => option && option.ref.checked).map(({ref: {value: value2}}) => value2);
return {value: values, isValid: !!values.length};
}
const {checked: checked2, value, attributes} = options[0].ref;
return checked2 ? attributes && !isUndefined(attributes.value) ? isUndefined(value) || isEmptyString(value) ? validResult : {value, isValid: true} : validResult : defaultResult;
}
return defaultResult;
};
function getFieldValue(fields, ref) {
const {name, value} = ref;
const field = fields[name];
if (isFileInput(ref)) {
return ref.files;
}
if (isRadioInput(ref)) {
return field ? getRadioValue(field.options).value : "";
}
if (isMultipleSelect(ref)) {
return getMultipleSelectValue(ref.options);
}
if (isCheckBoxInput(ref)) {
return field ? getCheckboxValue(field.options).value : false;
}
return value;
}
var isString = (value) => typeof value === "string";
var getFieldsValues = (fields, search) => {
const output = {};
for (const name in fields) {
if (isUndefined(search) || (isString(search) ? name.startsWith(search) : isArray(search) ? search.find((data) => name.startsWith(data)) : search && search.nest)) {
output[name] = getFieldValue(fields, fields[name].ref);
}
}
return output;
};
var compareObject = (objectA = {}, objectB = {}) => {
const objectAKeys = Object.keys(objectA);
const objectBKeys = Object.keys(objectB);
return objectAKeys.length === objectBKeys.length && objectAKeys.every((key) => objectB[key] && objectB[key] === objectA[key]);
};
var isSameError = (error, {type, types, message}) => isObject(error) && error.type === type && error.message === message && compareObject(error.types, types);
function shouldRenderBasedOnError({errors, name, error, validFields, fieldsWithValidation}) {
const isFieldValid = isEmptyObject(error);
const isFormValid = isEmptyObject(errors);
const currentFieldError = get7(error, name);
const existFieldError = get7(errors, name);
if (isFieldValid && validFields.has(name) || existFieldError && existFieldError.isManual) {
return false;
}
if (isFormValid !== isFieldValid || !isFormValid && !existFieldError || isFieldValid && fieldsWithValidation.has(name) && !validFields.has(name)) {
return true;
}
return currentFieldError && !isSameError(existFieldError, currentFieldError);
}
var isRegex = (value) => value instanceof RegExp;
var getValueAndMessage = (validationData) => {
const isValueMessage = (value) => isObject(value) && !isRegex(value);
return isValueMessage(validationData) ? validationData : {
value: validationData,
message: ""
};
};
var isFunction = (value) => typeof value === "function";
var isBoolean = (value) => typeof value === "boolean";
var isMessage = (value) => isString(value) || isObject(value) && import_react19.isValidElement(value);
function getValidateError(result, ref, type = "validate") {
if (isMessage(result) || isBoolean(result) && !result) {
return {
type,
message: isMessage(result) ? result : "",
ref
};
}
}
var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => {
if (validateAllFieldCriteria) {
const error = errors[name];
return Object.assign(Object.assign({}, error), {types: Object.assign(Object.assign({}, error && error.types ? error.types : {}), {[type]: message || true})});
}
return {};
};
var validateField = async (fieldsRef, validateAllFieldCriteria, {ref, ref: {type, value, name}, options, required, maxLength, minLength, min, max, pattern, validate}) => {
var _a;
const fields = fieldsRef.current;
const error = {};
const isRadio = isRadioInput(ref);
const isCheckBox = isCheckBoxInput(ref);
const isRadioOrCheckbox = isRadio || isCheckBox;
const isEmpty = isEmptyString(value);
const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
const message = exceedMax ? maxLengthMessage : minLengthMessage;
error[name] = Object.assign({
type: exceedMax ? maxType : minType,
message,
ref
}, exceedMax ? appendErrorsCurry(maxType, message) : appendErrorsCurry(minType, message));
if (!validateAllFieldCriteria) {
return error;
}
};
if (required && (!isRadio && !isCheckBox && (isEmpty || isNullOrUndefined(value)) || isBoolean(value) && !value || isCheckBox && !getCheckboxValue(options).isValid || isRadio && !getRadioValue(options).isValid)) {
const {value: requiredValue, message: requiredMessage} = isMessage(required) ? {value: !!required, message: required} : getValueAndMessage(required);
if (requiredValue) {
error[name] = Object.assign({type: INPUT_VALIDATION_RULES.required, message: requiredMessage, ref: isRadioOrCheckbox ? (_a = fields[name].options) === null || _a === void 0 ? void 0 : _a[0].ref : ref}, appendErrorsCurry(INPUT_VALIDATION_RULES.required, requiredMessage));
if (!validateAllFieldCriteria) {
return error;
}
}
}
if (!isNullOrUndefined(min) || !isNullOrUndefined(max)) {
let exceedMax;
let exceedMin;
const {value: maxValue, message: maxMessage} = getValueAndMessage(max);
const {value: minValue, message: minMessage} = getValueAndMessage(min);
if (type === "number" || !type && !isNaN(value)) {
const valueNumber = ref.valueAsNumber || parseFloat(value);
if (!isNullOrUndefined(maxValue)) {
exceedMax = valueNumber > maxValue;
}
if (!isNullOrUndefined(minValue)) {
exceedMin = valueNumber < minValue;
}
} else {
const valueDate = ref.valueAsDate || new Date(value);
if (isString(maxValue)) {
exceedMax = valueDate > new Date(maxValue);
}
if (isString(minValue)) {
exceedMin = valueDate < new Date(minValue);
}
}
if (exceedMax || exceedMin) {
getMinMaxMessage(!!exceedMax, maxMessage, minMessage, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
if (!validateAllFieldCriteria) {
return error;
}
}
}
if (isString(value) && !isEmpty && (maxLength || minLength)) {
const {value: maxLengthValue, message: maxLengthMessage} = getValueAndMessage(maxLength);
const {value: minLengthValue, message: minLengthMessage} = getValueAndMessage(minLength);
const inputLength = value.toString().length;
const exceedMax = !isNullOrUndefined(maxLengthValue) && inputLength > maxLengthValue;
const exceedMin = !isNullOrUndefined(minLengthValue) && inputLength < minLengthValue;
if (exceedMax || exceedMin) {
getMinMaxMessage(!!exceedMax, maxLengthMessage, minLengthMessage);
if (!validateAllFieldCriteria) {
return error;
}
}
}
if (pattern && !isEmpty) {
const {value: patternValue, message: patternMessage} = getValueAndMessage(pattern);
if (isRegex(patternValue) && !patternValue.test(value)) {
error[name] = Object.assign({type: INPUT_VALIDATION_RULES.pattern, message: patternMessage, ref}, appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, patternMessage));
if (!validateAllFieldCriteria) {
return error;
}
}
}
if (validate) {
const fieldValue = getFieldValue(fields, ref);
const validateRef = isRadioOrCheckbox && options ? options[0].ref : ref;
if (isFunction(validate)) {
const result = await validate(fieldValue);
const validateError = getValidateError(result, validateRef);
if (validateError) {
error[name] = Object.assign(Object.assign({}, validateError), appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message));
if (!validateAllFieldCriteria) {
return error;
}
}
} else if (isObject(validate)) {
let validationResult = {};
for (const [key, validateFunction] of Object.entries(validate)) {
if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
break;
}
const validateResult = await validateFunction(fieldValue);
const validateError = getValidateError(validateResult, validateRef, key);
if (validateError) {
validationResult = Object.assign(Object.assign({}, validateError), appendErrorsCurry(key, validateError.message));
if (validateAllFieldCriteria) {
error[name] = validationResult;
}
}
}
if (!isEmptyObject(validationResult)) {
error[name] = Object.assign({ref: validateRef}, validationResult);
if (!validateAllFieldCriteria) {
return error;
}
}
}
}
return error;
};
var parseErrorSchema = (error, validateAllFieldCriteria) => isArray(error.inner) ? error.inner.reduce((previous, {path, message, type}) => Object.assign(Object.assign({}, previous), path ? previous[path] && validateAllFieldCriteria ? {
[path]: appendErrors(path, validateAllFieldCriteria, previous, type, message)
} : {
[path]: previous[path] || Object.assign({
message,
type
}, validateAllFieldCriteria ? {
types: {[type]: message || true}
} : {})
} : {}), {}) : {
[error.path]: {message: error.message, type: error.type}
};
async function validateWithSchema(validationSchema, validateAllFieldCriteria, data, validationResolver, context) {
if (validationResolver) {
return validationResolver(data, context);
}
try {
return {
values: await validationSchema.validate(data, {
abortEarly: false,
context
}),
errors: {}
};
} catch (e3) {
return {
values: {},
errors: transformToNestObject(parseErrorSchema(e3, validateAllFieldCriteria))
};
}
}
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
var getPath = (path, values) => {
const getInnerPath = (value, key, isObject2) => {
const pathWithIndex = isObject2 ? `${path}.${key}` : `${path}[${key}]`;
return isPrimitive(value) ? pathWithIndex : getPath(pathWithIndex, value);
};
return isArray(values) ? values.map((value, key) => getInnerPath(value, key)) : Object.entries(values).map(([key, value]) => getInnerPath(value, key, true));
};
var getPath$1 = (parentPath, value) => getPath(parentPath, value).flat(Infinity);
var assignWatchFields = (fieldValues, fieldName, watchFields, inputValue, isSingleField) => {
let value;
watchFields.add(fieldName);
if (isEmptyObject(fieldValues)) {
value = void 0;
} else if (!isUndefined(fieldValues[fieldName])) {
value = fieldValues[fieldName];
watchFields.add(fieldName);
} else {
value = get7(transformToNestObject(fieldValues), fieldName);
if (!isUndefined(value)) {
getPath$1(fieldName, value).forEach((name) => watchFields.add(name));
}
}
return isUndefined(value) ? isSingleField ? inputValue : get7(inputValue, fieldName) : value;
};
var skipValidation = ({isOnChange, hasError, isBlurEvent, isOnSubmit, isReValidateOnSubmit, isOnBlur, isReValidateOnBlur, isSubmitted}) => isOnChange && isBlurEvent || isOnSubmit && isReValidateOnSubmit || isOnSubmit && !isSubmitted || isOnBlur && !isBlurEvent && !hasError || isReValidateOnBlur && !isBlurEvent && hasError || isReValidateOnSubmit && isSubmitted;
var getFieldArrayParentName = (name) => name.substring(0, name.indexOf("["));
var getFieldValueByName = (fields, name) => {
const results = transformToNestObject(getFieldsValues(fields));
return name ? get7(results, name, results) : results;
};
function getIsFieldsDifferent(referenceArray, differenceArray) {
let isMatch = false;
if (!isArray(referenceArray) || !isArray(differenceArray) || referenceArray.length !== differenceArray.length) {
return true;
}
for (let i = 0; i < referenceArray.length; i++) {
if (isMatch) {
break;
}
const dataA = referenceArray[i];
const dataB = differenceArray[i];
if (isUndefined(dataB) || Object.keys(dataA).length !== Object.keys(dataB).length) {
isMatch = true;
break;
}
for (const key in dataA) {
if (dataA[key] !== dataB[key]) {
isMatch = true;
break;
}
}
}
return isMatch;
}
var isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}[\\d+]`.replace(/\[/g, "\\[").replace(/\]/g, "\\]")).test(name);
var isNameInFieldArray = (names, name) => [...names].some((current) => isMatchFieldArrayName(name, current));
var isSelectInput = (element) => element.type === `${SELECT}-one`;
function onDomRemove(element, onDetachCallback) {
const observer = new MutationObserver(() => {
if (isDetached(element)) {
observer.disconnect();
onDetachCallback();
}
});
observer.observe(window.document, {
childList: true,
subtree: true
});
return observer;
}
var modeChecker = (mode) => ({
isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
isOnBlur: mode === VALIDATION_MODE.onBlur,
isOnChange: mode === VALIDATION_MODE.onChange
});
var isRadioOrCheckboxFunction = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
function useForm({mode = VALIDATION_MODE.onSubmit, reValidateMode = VALIDATION_MODE.onChange, validationSchema, validationResolver, validationContext, defaultValues = {}, submitFocusError = true, validateCriteriaMode} = {}) {
const fieldsRef = import_react19.useRef({});
const errorsRef = import_react19.useRef({});
const touchedFieldsRef = import_react19.useRef({});
const fieldArrayDefaultValues = import_react19.useRef({});
const watchFieldsRef = import_react19.useRef(new Set());
const dirtyFieldsRef = import_react19.useRef(new Set());
const fieldsWithValidationRef = import_react19.useRef(new Set());
const validFieldsRef = import_react19.useRef(new Set());
const isValidRef = import_react19.useRef(true);
const defaultValuesRef = import_react19.useRef(defaultValues);
const defaultValuesAtRenderRef = import_react19.useRef({});
const isUnMount = import_react19.useRef(false);
const isWatchAllRef = import_react19.useRef(false);
const isSubmittedRef = import_react19.useRef(false);
const isDirtyRef = import_react19.useRef(false);
const submitCountRef = import_react19.useRef(0);
const isSubmittingRef = import_react19.useRef(false);
const handleChangeRef = import_react19.useRef();
const resetFieldArrayFunctionRef = import_react19.useRef({});
const validationContextRef = import_react19.useRef(validationContext);
const fieldArrayNamesRef = import_react19.useRef(new Set());
const [, render3] = import_react19.useState();
const {isOnBlur, isOnSubmit, isOnChange} = import_react19.useRef(modeChecker(mode)).current;
const validateAllFieldCriteria = validateCriteriaMode === "all";
const isWindowUndefined = typeof window === UNDEFINED;
const shouldValidateSchemaOrResolver = !!(validationSchema || validationResolver);
const isWeb = typeof document !== UNDEFINED && !isWindowUndefined && !isUndefined(window.HTMLElement);
const isProxyEnabled = isWeb ? "Proxy" in window : typeof Proxy !== UNDEFINED;
const readFormStateRef = import_react19.useRef({
dirty: !isProxyEnabled,
dirtyFields: !isProxyEnabled,
isSubmitted: isOnSubmit,
submitCount: !isProxyEnabled,
touched: !isProxyEnabled,
isSubmitting: !isProxyEnabled,
isValid: !isProxyEnabled
});
const {isOnBlur: isReValidateOnBlur, isOnSubmit: isReValidateOnSubmit} = import_react19.useRef(modeChecker(reValidateMode)).current;
validationContextRef.current = validationContext;
const reRender = import_react19.useCallback(() => {
if (!isUnMount.current) {
render3({});
}
}, []);
const shouldRenderBaseOnError = import_react19.useCallback((name, error, shouldRender = false) => {
let shouldReRender = shouldRender || shouldRenderBasedOnError({
errors: errorsRef.current,
error,
name,
validFields: validFieldsRef.current,
fieldsWithValidation: fieldsWithValidationRef.current
});
if (isEmptyObject(error)) {
if (fieldsWithValidationRef.current.has(name) || shouldValidateSchemaOrResolver) {
validFieldsRef.current.add(name);
shouldReRender = shouldReRender || get7(errorsRef.current, name);
}
errorsRef.current = unset(errorsRef.current, [name]);
} else {
const previousError = get7(errorsRef.current, name);
validFieldsRef.current.delete(name);
shouldReRender = shouldReRender || (previousError ? !isSameError(previousError, error[name]) : true);
set(errorsRef.current, name, error[name]);
}
if (shouldReRender && !isNullOrUndefined(shouldRender)) {
reRender();
return true;
}
}, [reRender, shouldValidateSchemaOrResolver]);
const setFieldValue = import_react19.useCallback((field, rawValue) => {
const {ref, options} = field;
const value = isWeb && isHTMLElement(ref) && isNullOrUndefined(rawValue) ? "" : rawValue;
if (isRadioInput(ref) && options) {
options.forEach(({ref: radioRef}) => radioRef.checked = radioRef.value === value);
} else if (isFileInput(ref)) {
if (isString(value)) {
ref.value = value;
} else {
ref.files = value;
}
} else if (isMultipleSelect(ref)) {
[...ref.options].forEach((selectRef) => selectRef.selected = value.includes(selectRef.value));
} else if (isCheckBoxInput(ref) && options) {
options.length > 1 ? options.forEach(({ref: checkboxRef}) => checkboxRef.checked = value.includes(checkboxRef.value)) : options[0].ref.checked = !!value;
} else {
ref.value = value;
}
}, [isWeb]);
const setDirty = import_react19.useCallback((name) => {
if (!fieldsRef.current[name] || !readFormStateRef.current.dirty && !readFormStateRef.current.dirtyFields) {
return false;
}
let isFieldDirty = defaultValuesAtRenderRef.current[name] !== getFieldValue(fieldsRef.current, fieldsRef.current[name].ref);
const isFieldArray = isNameInFieldArray(fieldArrayNamesRef.current, name);
const previousDirtyFieldsLength = dirtyFieldsRef.current.size;
if (isFieldArray) {
const fieldArrayName = getFieldArrayParentName(name);
isFieldDirty = getIsFieldsDifferent(getFieldValueByName(fieldsRef.current, fieldArrayName), get7(defaultValuesRef.current, fieldArrayName));
}
const isDirtyChanged = (isFieldArray ? isDirtyRef.current : dirtyFieldsRef.current.has(name)) !== isFieldDirty;
if (isFieldDirty) {
dirtyFieldsRef.current.add(name);
} else {
dirtyFieldsRef.current.delete(name);
}
isDirtyRef.current = isFieldArray ? isFieldDirty : !!dirtyFieldsRef.current.size;
return readFormStateRef.current.dirty ? isDirtyChanged : previousDirtyFieldsLength !== dirtyFieldsRef.current.size;
}, []);
const setInternalValues = import_react19.useCallback((name, value, parentFieldName) => {
const isValueArray = isArray(value);
for (const key in value) {
const fieldName = `${parentFieldName || name}${isValueArray ? `[${key}]` : `.${key}`}`;
const field = fieldsRef.current[fieldName];
if (isObject(value[key])) {
setInternalValues(name, value[key], fieldName);
}
if (field) {
setFieldValue(field, value[key]);
setDirty(fieldName);
}
}
}, [setFieldValue, setDirty]);
const setInternalValue = import_react19.useCallback((name, value) => {
const field = fieldsRef.current[name];
if (field) {
setFieldValue(field, value);
const output = setDirty(name);
if (isBoolean(output)) {
return output;
}
} else if (!isPrimitive(value)) {
setInternalValues(name, value);
}
}, [setDirty, setFieldValue, setInternalValues]);
const executeValidation = import_react19.useCallback(async (name, skipReRender) => {
const field = fieldsRef.current[name];
if (field) {
const error = await validateField(fieldsRef, validateAllFieldCriteria, field);
shouldRenderBaseOnError(name, error, skipReRender ? null : false);
return isEmptyObject(error);
}
return false;
}, [shouldRenderBaseOnError, validateAllFieldCriteria]);
const executeSchemaOrResolverValidation = import_react19.useCallback(async (payload) => {
const {errors} = await validateWithSchema(validationSchema, validateAllFieldCriteria, getFieldValueByName(fieldsRef.current), validationResolver, validationContextRef.current);
const previousFormIsValid = isValidRef.current;
isValidRef.current = isEmptyObject(errors);
if (isArray(payload)) {
payload.forEach((name) => {
const error = get7(errors, name);
if (error) {
set(errorsRef.current, name, error);
} else {
unset(errorsRef.current, [name]);
}
});
reRender();
} else {
const error = get7(errors, payload);
shouldRenderBaseOnError(payload, error ? {[payload]: error} : {}, previousFormIsValid !== isValidRef.current);
}
return isEmptyObject(errorsRef.current);
}, [
reRender,
shouldRenderBaseOnError,
validateAllFieldCriteria,
validationResolver,
validationSchema
]);
const triggerValidation = import_react19.useCallback(async (payload) => {
const fields = payload || Object.keys(fieldsRef.current);
if (shouldValidateSchemaOrResolver) {
return executeSchemaOrResolverValidation(fields);
}
if (isArray(fields)) {
const result = await Promise.all(fields.map(async (data) => await executeValidation(data, true)));
reRender();
return result.every(Boolean);
}
return await executeValidation(fields);
}, [
executeSchemaOrResolverValidation,
executeValidation,
reRender,
shouldValidateSchemaOrResolver
]);
const isFieldWatched = (name) => isWatchAllRef.current || watchFieldsRef.current.has(name) || watchFieldsRef.current.has((name.match(/\w+/) || [])[0]);
function setValue(names, valueOrShouldValidate, shouldValidate) {
let shouldRender = false;
const isArrayValue = isArray(names);
(isArrayValue ? names : [names]).forEach((name) => {
const isStringFieldName = isString(name);
shouldRender = setInternalValue(isStringFieldName ? name : Object.keys(name)[0], isStringFieldName ? valueOrShouldValidate : Object.values(name)[0]) || isArrayValue ? true : isFieldWatched(name);
});
if (shouldRender || isArrayValue) {
reRender();
}
if (shouldValidate || isArrayValue && valueOrShouldValidate) {
triggerValidation(isArrayValue ? void 0 : names);
}
}
handleChangeRef.current = handleChangeRef.current ? handleChangeRef.current : async ({type, target}) => {
const name = target ? target.name : "";
const fields = fieldsRef.current;
const errors = errorsRef.current;
const field = fields[name];
const currentError = get7(errors, name);
let error;
if (!field) {
return;
}
const isBlurEvent = type === EVENTS.BLUR;
const shouldSkipValidation = skipValidation({
hasError: !!currentError,
isOnChange,
isBlurEvent,
isOnSubmit,
isReValidateOnSubmit,
isOnBlur,
isReValidateOnBlur,
isSubmitted: isSubmittedRef.current
});
const shouldUpdateDirty = setDirty(name);
let shouldRender = isFieldWatched(name) || shouldUpdateDirty;
if (isBlurEvent && !get7(touchedFieldsRef.current, name) && readFormStateRef.current.touched) {
set(touchedFieldsRef.current, name, true);
shouldRender = true;
}
if (shouldSkipValidation) {
return shouldRender && reRender();
}
if (shouldValidateSchemaOrResolver) {
const {errors: errors2} = await validateWithSchema(validationSchema, validateAllFieldCriteria, getFieldValueByName(fields), validationResolver, validationContextRef.current);
const previousFormIsValid = isValidRef.current;
isValidRef.current = isEmptyObject(errors2);
error = get7(errors2, name) ? {[name]: get7(errors2, name)} : {};
if (previousFormIsValid !== isValidRef.current) {
shouldRender = true;
}
} else {
error = await validateField(fieldsRef, validateAllFieldCriteria, field);
}
if (!shouldRenderBaseOnError(name, error) && shouldRender) {
reRender();
}
};
const validateSchemaOrResolver = import_react19.useCallback((values = {}) => {
const fieldValues = isEmptyObject(defaultValuesRef.current) ? getFieldsValues(fieldsRef.current) : defaultValuesRef.current;
validateWithSchema(validationSchema, validateAllFieldCriteria, transformToNestObject(Object.assign(Object.assign({}, fieldValues), values)), validationResolver, validationContextRef.current).then(({errors}) => {
const previousFormIsValid = isValidRef.current;
isValidRef.current = isEmptyObject(errors);
if (previousFormIsValid !== isValidRef.current) {
reRender();
}
});
}, [reRender, validateAllFieldCriteria, validationResolver]);
const removeFieldEventListener = import_react19.useCallback((field, forceDelete) => {
if (handleChangeRef.current && field) {
findRemovedFieldAndRemoveListener(fieldsRef.current, handleChangeRef.current, field, forceDelete);
}
}, []);
const removeFieldEventListenerAndRef = import_react19.useCallback((field, forceDelete) => {
if (!field || field && isNameInFieldArray(fieldArrayNamesRef.current, field.ref.name) && !forceDelete) {
return;
}
removeFieldEventListener(field, forceDelete);
const {name} = field.ref;
errorsRef.current = unset(errorsRef.current, [name]);
touchedFieldsRef.current = unset(touchedFieldsRef.current, [name]);
defaultValuesAtRenderRef.current = unset(defaultValuesAtRenderRef.current, [name]);
[
dirtyFieldsRef,
fieldsWithValidationRef,
validFieldsRef,
watchFieldsRef
].forEach((data) => data.current.delete(name));
if (readFormStateRef.current.isValid || readFormStateRef.current.touched) {
reRender();
if (shouldValidateSchemaOrResolver) {
validateSchemaOrResolver();
}
}
}, [
reRender,
shouldValidateSchemaOrResolver,
validateSchemaOrResolver,
removeFieldEventListener
]);
function clearError(name) {
if (name) {
unset(errorsRef.current, isArray(name) ? name : [name]);
} else {
errorsRef.current = {};
}
reRender();
}
const setInternalError = ({name, type, types, message, shouldRender}) => {
const field = fieldsRef.current[name];
if (!isSameError(get7(errorsRef.current, name), {
type,
message,
types
})) {
set(errorsRef.current, name, {
type,
types,
message,
ref: field ? field.ref : {},
isManual: true
});
if (shouldRender) {
reRender();
}
}
};
function setError(name, type = "", message) {
if (isString(name)) {
setInternalError(Object.assign(Object.assign({name}, isObject(type) ? {
types: type,
type: ""
} : {
type,
message
}), {shouldRender: true}));
} else if (isArray(name)) {
name.forEach((error) => setInternalError(Object.assign({}, error)));
reRender();
}
}
function watch(fieldNames, defaultValue) {
const watchFields = watchFieldsRef.current;
const isDefaultValueUndefined = isUndefined(defaultValue);
const combinedDefaultValues = isDefaultValueUndefined ? defaultValuesRef.current : defaultValue;
const fieldValues = getFieldsValues(fieldsRef.current, fieldNames);
if (isString(fieldNames)) {
return assignWatchFields(fieldValues, fieldNames, watchFields, isDefaultValueUndefined ? get7(combinedDefaultValues, fieldNames) : defaultValue, true);
}
if (isArray(fieldNames)) {
return fieldNames.reduce((previous, name) => Object.assign(Object.assign({}, previous), {[name]: assignWatchFields(fieldValues, name, watchFields, combinedDefaultValues)}), {});
}
isWatchAllRef.current = true;
const result = !isEmptyObject(fieldValues) && fieldValues || combinedDefaultValues;
return fieldNames && fieldNames.nest ? transformToNestObject(result) : result;
}
function unregister(name) {
if (fieldsRef.current) {
(isArray(name) ? name : [name]).forEach((fieldName) => removeFieldEventListenerAndRef(fieldsRef.current[fieldName], true));
}
}
function registerFieldsRef(ref, validateOptions = {}) {
if (!ref.name) {
return console.warn("Missing name @", ref);
}
const {name, type, value} = ref;
const fieldRefAndValidationOptions = Object.assign({ref}, validateOptions);
const fields = fieldsRef.current;
const isRadioOrCheckbox = isRadioOrCheckboxFunction(ref);
let field = fields[name];
let isEmptyDefaultValue = true;
let isFieldArray;
let defaultValue;
if (isRadioOrCheckbox ? field && isArray(field.options) && field.options.filter(Boolean).find((option) => {
return value === option.ref.value && option.ref === ref;
}) : field && ref === field.ref) {
fields[name] = Object.assign(Object.assign({}, field), validateOptions);
return;
}
if (type) {
const mutationWatcher = onDomRemove(ref, () => removeFieldEventListenerAndRef(field));
field = isRadioOrCheckbox ? Object.assign({options: [
...field && field.options || [],
{
ref,
mutationWatcher
}
], ref: {type, name}}, validateOptions) : Object.assign(Object.assign({}, fieldRefAndValidationOptions), {mutationWatcher});
} else {
field = fieldRefAndValidationOptions;
}
fields[name] = field;
if (!isEmptyObject(defaultValuesRef.current)) {
defaultValue = get7(defaultValuesRef.current, name);
isEmptyDefaultValue = isUndefined(defaultValue);
isFieldArray = isNameInFieldArray(fieldArrayNamesRef.current, name);
if (!isEmptyDefaultValue && !isFieldArray) {
setFieldValue(field, defaultValue);
}
}
if (shouldValidateSchemaOrResolver && !isFieldArray && readFormStateRef.current.isValid) {
validateSchemaOrResolver();
} else if (!isEmptyObject(validateOptions)) {
fieldsWithValidationRef.current.add(name);
if (!isOnSubmit && readFormStateRef.current.isValid) {
validateField(fieldsRef, validateAllFieldCriteria, field).then((error) => {
const previousFormIsValid = isValidRef.current;
isEmptyObject(error) ? validFieldsRef.current.add(name) : isValidRef.current = false;
if (previousFormIsValid !== isValidRef.current) {
reRender();
}
});
}
}
if (!defaultValuesAtRenderRef.current[name] && !(isFieldArray && isEmptyDefaultValue)) {
defaultValuesAtRenderRef.current[name] = isEmptyDefaultValue ? getFieldValue(fields, field.ref) : defaultValue;
}
if (type) {
attachEventListeners({
field: isRadioOrCheckbox && field.options ? field.options[field.options.length - 1] : field,
isRadioOrCheckbox: isRadioOrCheckbox || isSelectInput(ref),
handleChange: handleChangeRef.current
});
}
}
function register(refOrValidationOptions, validationOptions) {
if (isWindowUndefined) {
return;
}
if (isString(refOrValidationOptions)) {
registerFieldsRef({name: refOrValidationOptions}, validationOptions);
return;
}
if (isObject(refOrValidationOptions) && "name" in refOrValidationOptions) {
registerFieldsRef(refOrValidationOptions, validationOptions);
return;
}
return (ref) => ref && registerFieldsRef(ref, refOrValidationOptions);
}
const handleSubmit = import_react19.useCallback((callback) => async (e3) => {
if (e3) {
e3.preventDefault();
e3.persist();
}
let fieldErrors = {};
const fields = fieldsRef.current;
let fieldValues = getFieldsValues(fields);
if (readFormStateRef.current.isSubmitting) {
isSubmittingRef.current = true;
reRender();
}
try {
if (shouldValidateSchemaOrResolver) {
const {errors, values} = await validateWithSchema(validationSchema, validateAllFieldCriteria, transformToNestObject(fieldValues), validationResolver, validationContextRef.current);
errorsRef.current = errors;
fieldErrors = errors;
fieldValues = values;
} else {
for (const field of Object.values(fields)) {
if (field) {
const {ref: {name}} = field;
const fieldError = await validateField(fieldsRef, validateAllFieldCriteria, field);
if (fieldError[name]) {
set(fieldErrors, name, fieldError[name]);
validFieldsRef.current.delete(name);
} else {
if (fieldsWithValidationRef.current.has(name)) {
validFieldsRef.current.add(name);
}
}
}
}
}
if (isEmptyObject(fieldErrors)) {
errorsRef.current = {};
reRender();
await callback(transformToNestObject(fieldValues), e3);
} else {
errorsRef.current = fieldErrors;
if (submitFocusError && isWeb) {
focusOnErrorField(fields, fieldErrors);
}
}
} finally {
isSubmittedRef.current = true;
isSubmittingRef.current = false;
submitCountRef.current = submitCountRef.current + 1;
reRender();
}
}, [
isWeb,
reRender,
shouldValidateSchemaOrResolver,
submitFocusError,
validateAllFieldCriteria,
validationResolver,
validationSchema
]);
const resetRefs = ({errors, dirty, isSubmitted, touched, isValid, submitCount, dirtyFields}) => {
fieldsRef.current = {};
if (!errors) {
errorsRef.current = {};
}
if (!touched) {
touchedFieldsRef.current = {};
}
if (!isValid) {
validFieldsRef.current = new Set();
fieldsWithValidationRef.current = new Set();
isValidRef.current = true;
}
if (!dirty) {
isDirtyRef.current = false;
}
if (!dirtyFields) {
dirtyFieldsRef.current = new Set();
}
if (!isSubmitted) {
isSubmittedRef.current = false;
}
if (!submitCount) {
submitCountRef.current = 0;
}
defaultValuesAtRenderRef.current = {};
fieldArrayDefaultValues.current = {};
watchFieldsRef.current = new Set();
isWatchAllRef.current = false;
};
const reset = (values, omitResetState = {}) => {
if (isWeb) {
for (const field of Object.values(fieldsRef.current)) {
if (field) {
const {ref, options} = field;
const inputRef = isRadioOrCheckboxFunction(ref) && isArray(options) ? options[0].ref : ref;
if (isHTMLElement(inputRef)) {
try {
inputRef.closest("form").reset();
break;
} catch (_a) {
}
}
}
}
}
if (values) {
defaultValuesRef.current = values;
}
Object.values(resetFieldArrayFunctionRef.current).forEach((resetFieldArray) => isFunction(resetFieldArray) && resetFieldArray());
resetRefs(omitResetState);
reRender();
};
function getValues(payload) {
if (isString(payload)) {
return fieldsRef.current[payload] ? getFieldValue(fieldsRef.current, fieldsRef.current[payload].ref) : get7(defaultValuesRef.current, payload);
}
const fieldValues = getFieldsValues(fieldsRef.current);
const outputValues = isEmptyObject(fieldValues) ? defaultValuesRef.current : fieldValues;
return payload && payload.nest ? transformToNestObject(outputValues) : outputValues;
}
import_react19.useEffect(() => () => {
isUnMount.current = true;
fieldsRef.current && false;
}, [removeFieldEventListenerAndRef]);
if (!shouldValidateSchemaOrResolver) {
isValidRef.current = validFieldsRef.current.size >= fieldsWithValidationRef.current.size && isEmptyObject(errorsRef.current);
}
const formState = {
dirty: isDirtyRef.current,
dirtyFields: dirtyFieldsRef.current,
isSubmitted: isSubmittedRef.current,
submitCount: submitCountRef.current,
touched: touchedFieldsRef.current,
isSubmitting: isSubmittingRef.current,
isValid: isOnSubmit ? isSubmittedRef.current && isEmptyObject(errorsRef.current) : isValidRef.current
};
const commonProps = {
triggerValidation,
setValue: import_react19.useCallback(setValue, [
reRender,
setInternalValue,
triggerValidation
]),
register: import_react19.useCallback(register, [
defaultValuesRef.current,
defaultValuesAtRenderRef.current
]),
unregister: import_react19.useCallback(unregister, []),
getValues: import_react19.useCallback(getValues, []),
formState: isProxyEnabled ? new Proxy(formState, {
get: (obj, prop) => {
if (prop in obj) {
readFormStateRef.current[prop] = true;
return obj[prop];
}
return void 0;
}
}) : formState
};
const control = Object.assign(Object.assign(Object.assign({
removeFieldEventListener,
reRender
}, shouldValidateSchemaOrResolver ? {validateSchemaIsValid: validateSchemaOrResolver} : {}), {
mode: {
isOnBlur,
isOnSubmit,
isOnChange
},
reValidateMode: {
isReValidateOnBlur,
isReValidateOnSubmit
},
errorsRef,
touchedFieldsRef,
fieldsRef,
isWatchAllRef,
watchFieldsRef,
resetFieldArrayFunctionRef,
fieldArrayDefaultValues,
validFieldsRef,
dirtyFieldsRef,
fieldsWithValidationRef,
fieldArrayNamesRef,
isDirtyRef,
readFormStateRef,
defaultValuesRef
}), commonProps);
return Object.assign({
watch,
control,
handleSubmit,
reset: import_react19.useCallback(reset, []),
clearError: import_react19.useCallback(clearError, []),
setError: import_react19.useCallback(setError, []),
errors: errorsRef.current
}, commonProps);
}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var FormGlobalContext = import_react19.createContext(null);
// src/comp/Button.js
var import_react20 = __toModule(require_react());
function Button(props2) {
const {
children,
active: active2,
size: size2 = 12,
square,
variant: variant3 = "redgreen",
...other
} = props2;
const bg = "button." + variant3 + (active2 ? ".on" : ".off");
const width2 = square ? size2 : void 0;
const color2 = active2 ? "black" : "#eee";
return /* @__PURE__ */ import_react20.default.createElement(PseudoBox_default, {
as: "button",
w: width2,
h: size2,
px: 2,
bg,
borderWidth: "2px",
borderStyle: "solid",
borderColor: bg,
fontWeight: "600",
color: color2,
_focus: {
border: "inputFocus",
boxShadow: "inputFocus"
},
_hover: {
border: "inputHover"
},
...other
}, children);
}
function ToggleButton({
defaultValue,
onChange,
...props2
}) {
const [state, setState] = import_react20.useState(defaultValue || false);
return /* @__PURE__ */ import_react20.default.createElement(Button, {
active: state,
onClick,
...props2
});
function onClick(_e) {
setState((state2) => {
if (onChange)
onChange(!state2);
return !state2;
});
}
}
Button.Toggle = ToggleButton;
// src/comp/Bar.js
var import_react21 = __toModule(require_react());
function Bar(props2) {
return /* @__PURE__ */ import_react21.default.createElement(Flex_default, {
borderBottom: "barSeperator",
...props2
});
}
function Element(props2) {
return /* @__PURE__ */ import_react21.default.createElement(Box_default, {
px: 2,
py: 1,
borderRight: "barSeperator",
fontFamily: "mono",
color: "textBar",
...props2
});
}
Bar.Element = Element;
// src/hooks/use-osc-reducer.js
var import_react22 = __toModule(require_react());
// src/lib/osc.js
var import_osc_js = __toModule(require_osc());
var import_debug = __toModule(require_browser2());
// node_modules/reconnecting-websocket/dist/reconnecting-websocket-mjs.js
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
d2.__proto__ = b2;
} || function(d2, b2) {
for (var p in b2)
if (b2.hasOwnProperty(p))
d2[p] = b2[p];
};
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __values(o2) {
var m = typeof Symbol === "function" && o2[Symbol.iterator], i = 0;
if (m)
return m.call(o2);
return {
next: function() {
if (o2 && i >= o2.length)
o2 = void 0;
return {value: o2 && o2[i++], done: !o2};
}
};
}
function __read(o2, n4) {
var m = typeof Symbol === "function" && o2[Symbol.iterator];
if (!m)
return o2;
var i = m.call(o2), r2, ar = [], e3;
try {
while ((n4 === void 0 || n4-- > 0) && !(r2 = i.next()).done)
ar.push(r2.value);
} catch (error) {
e3 = {error};
} finally {
try {
if (r2 && !r2.done && (m = i["return"]))
m.call(i);
} finally {
if (e3)
throw e3.error;
}
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
var Event = function() {
function Event2(type, target) {
this.target = target;
this.type = type;
}
return Event2;
}();
var ErrorEvent = function(_super) {
__extends(ErrorEvent2, _super);
function ErrorEvent2(error, target) {
var _this = _super.call(this, "error", target) || this;
_this.message = error.message;
_this.error = error;
return _this;
}
return ErrorEvent2;
}(Event);
var CloseEvent = function(_super) {
__extends(CloseEvent2, _super);
function CloseEvent2(code, reason, target) {
if (code === void 0) {
code = 1e3;
}
if (reason === void 0) {
reason = "";
}
var _this = _super.call(this, "close", target) || this;
_this.wasClean = true;
_this.code = code;
_this.reason = reason;
return _this;
}
return CloseEvent2;
}(Event);
/*!
* Reconnecting WebSocket
* by Pedro Ladaria <pedro.ladaria@gmail.com>
* https://github.com/pladaria/reconnecting-websocket
* License MIT
*/
var getGlobalWebSocket = function() {
if (typeof WebSocket !== "undefined") {
return WebSocket;
}
};
var isWebSocket = function(w) {
return typeof w !== "undefined" && !!w && w.CLOSING === 2;
};
var DEFAULT = {
maxReconnectionDelay: 1e4,
minReconnectionDelay: 1e3 + Math.random() * 4e3,
minUptime: 5e3,
reconnectionDelayGrowFactor: 1.3,
connectionTimeout: 4e3,
maxRetries: Infinity,
maxEnqueuedMessages: Infinity,
startClosed: false,
debug: false
};
var ReconnectingWebSocket = function() {
function ReconnectingWebSocket2(url, protocols, options) {
var _this = this;
if (options === void 0) {
options = {};
}
this._listeners = {
error: [],
message: [],
open: [],
close: []
};
this._retryCount = -1;
this._shouldReconnect = true;
this._connectLock = false;
this._binaryType = "blob";
this._closeCalled = false;
this._messageQueue = [];
this.onclose = null;
this.onerror = null;
this.onmessage = null;
this.onopen = null;
this._handleOpen = function(event) {
_this._debug("open event");
var _a = _this._options.minUptime, minUptime = _a === void 0 ? DEFAULT.minUptime : _a;
clearTimeout(_this._connectTimeout);
_this._uptimeTimeout = setTimeout(function() {
return _this._acceptOpen();
}, minUptime);
_this._ws.binaryType = _this._binaryType;
_this._messageQueue.forEach(function(message) {
return _this._ws.send(message);
});
_this._messageQueue = [];
if (_this.onopen) {
_this.onopen(event);
}
_this._listeners.open.forEach(function(listener) {
return _this._callEventListener(event, listener);
});
};
this._handleMessage = function(event) {
_this._debug("message event");
if (_this.onmessage) {
_this.onmessage(event);
}
_this._listeners.message.forEach(function(listener) {
return _this._callEventListener(event, listener);
});
};
this._handleError = function(event) {
_this._debug("error event", event.message);
_this._disconnect(void 0, event.message === "TIMEOUT" ? "timeout" : void 0);
if (_this.onerror) {
_this.onerror(event);
}
_this._debug("exec error listeners");
_this._listeners.error.forEach(function(listener) {
return _this._callEventListener(event, listener);
});
_this._connect();
};
this._handleClose = function(event) {
_this._debug("close event");
_this._clearTimeouts();
if (_this._shouldReconnect) {
_this._connect();
}
if (_this.onclose) {
_this.onclose(event);
}
_this._listeners.close.forEach(function(listener) {
return _this._callEventListener(event, listener);
});
};
this._url = url;
this._protocols = protocols;
this._options = options;
if (this._options.startClosed) {
this._shouldReconnect = false;
}
this._connect();
}
Object.defineProperty(ReconnectingWebSocket2, "CONNECTING", {
get: function() {
return 0;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2, "OPEN", {
get: function() {
return 1;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2, "CLOSING", {
get: function() {
return 2;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2, "CLOSED", {
get: function() {
return 3;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "CONNECTING", {
get: function() {
return ReconnectingWebSocket2.CONNECTING;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "OPEN", {
get: function() {
return ReconnectingWebSocket2.OPEN;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "CLOSING", {
get: function() {
return ReconnectingWebSocket2.CLOSING;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "CLOSED", {
get: function() {
return ReconnectingWebSocket2.CLOSED;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "binaryType", {
get: function() {
return this._ws ? this._ws.binaryType : this._binaryType;
},
set: function(value) {
this._binaryType = value;
if (this._ws) {
this._ws.binaryType = value;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "retryCount", {
get: function() {
return Math.max(this._retryCount, 0);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "bufferedAmount", {
get: function() {
var bytes = this._messageQueue.reduce(function(acc, message) {
if (typeof message === "string") {
acc += message.length;
} else if (message instanceof Blob) {
acc += message.size;
} else {
acc += message.byteLength;
}
return acc;
}, 0);
return bytes + (this._ws ? this._ws.bufferedAmount : 0);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "extensions", {
get: function() {
return this._ws ? this._ws.extensions : "";
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "protocol", {
get: function() {
return this._ws ? this._ws.protocol : "";
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "readyState", {
get: function() {
if (this._ws) {
return this._ws.readyState;
}
return this._options.startClosed ? ReconnectingWebSocket2.CLOSED : ReconnectingWebSocket2.CONNECTING;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ReconnectingWebSocket2.prototype, "url", {
get: function() {
return this._ws ? this._ws.url : "";
},
enumerable: true,
configurable: true
});
ReconnectingWebSocket2.prototype.close = function(code, reason) {
if (code === void 0) {
code = 1e3;
}
this._closeCalled = true;
this._shouldReconnect = false;
this._clearTimeouts();
if (!this._ws) {
this._debug("close enqueued: no ws instance");
return;
}
if (this._ws.readyState === this.CLOSED) {
this._debug("close: already closed");
return;
}
this._ws.close(code, reason);
};
ReconnectingWebSocket2.prototype.reconnect = function(code, reason) {
this._shouldReconnect = true;
this._closeCalled = false;
this._retryCount = -1;
if (!this._ws || this._ws.readyState === this.CLOSED) {
this._connect();
} else {
this._disconnect(code, reason);
this._connect();
}
};
ReconnectingWebSocket2.prototype.send = function(data) {
if (this._ws && this._ws.readyState === this.OPEN) {
this._debug("send", data);
this._ws.send(data);
} else {
var _a = this._options.maxEnqueuedMessages, maxEnqueuedMessages = _a === void 0 ? DEFAULT.maxEnqueuedMessages : _a;
if (this._messageQueue.length < maxEnqueuedMessages) {
this._debug("enqueue", data);
this._messageQueue.push(data);
}
}
};
ReconnectingWebSocket2.prototype.addEventListener = function(type, listener) {
if (this._listeners[type]) {
this._listeners[type].push(listener);
}
};
ReconnectingWebSocket2.prototype.dispatchEvent = function(event) {
var e_1, _a;
var listeners = this._listeners[event.type];
if (listeners) {
try {
for (var listeners_1 = __values(listeners), listeners_1_1 = listeners_1.next(); !listeners_1_1.done; listeners_1_1 = listeners_1.next()) {
var listener = listeners_1_1.value;
this._callEventListener(event, listener);
}
} catch (e_1_1) {
e_1 = {error: e_1_1};
} finally {
try {
if (listeners_1_1 && !listeners_1_1.done && (_a = listeners_1.return))
_a.call(listeners_1);
} finally {
if (e_1)
throw e_1.error;
}
}
}
return true;
};
ReconnectingWebSocket2.prototype.removeEventListener = function(type, listener) {
if (this._listeners[type]) {
this._listeners[type] = this._listeners[type].filter(function(l) {
return l !== listener;
});
}
};
ReconnectingWebSocket2.prototype._debug = function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._options.debug) {
console.log.apply(console, __spread(["RWS>"], args));
}
};
ReconnectingWebSocket2.prototype._getNextDelay = function() {
var _a = this._options, _b = _a.reconnectionDelayGrowFactor, reconnectionDelayGrowFactor = _b === void 0 ? DEFAULT.reconnectionDelayGrowFactor : _b, _c = _a.minReconnectionDelay, minReconnectionDelay = _c === void 0 ? DEFAULT.minReconnectionDelay : _c, _d = _a.maxReconnectionDelay, maxReconnectionDelay = _d === void 0 ? DEFAULT.maxReconnectionDelay : _d;
var delay = 0;
if (this._retryCount > 0) {
delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);
if (delay > maxReconnectionDelay) {
delay = maxReconnectionDelay;
}
}
this._debug("next delay", delay);
return delay;
};
ReconnectingWebSocket2.prototype._wait = function() {
var _this = this;
return new Promise(function(resolve) {
setTimeout(resolve, _this._getNextDelay());
});
};
ReconnectingWebSocket2.prototype._getNextUrl = function(urlProvider) {
if (typeof urlProvider === "string") {
return Promise.resolve(urlProvider);
}
if (typeof urlProvider === "function") {
var url = urlProvider();
if (typeof url === "string") {
return Promise.resolve(url);
}
if (!!url.then) {
return url;
}
}
throw Error("Invalid URL");
};
ReconnectingWebSocket2.prototype._connect = function() {
var _this = this;
if (this._connectLock || !this._shouldReconnect) {
return;
}
this._connectLock = true;
var _a = this._options, _b = _a.maxRetries, maxRetries = _b === void 0 ? DEFAULT.maxRetries : _b, _c = _a.connectionTimeout, connectionTimeout = _c === void 0 ? DEFAULT.connectionTimeout : _c, _d = _a.WebSocket, WebSocket2 = _d === void 0 ? getGlobalWebSocket() : _d;
if (this._retryCount >= maxRetries) {
this._debug("max retries reached", this._retryCount, ">=", maxRetries);
return;
}
this._retryCount++;
this._debug("connect", this._retryCount);
this._removeListeners();
if (!isWebSocket(WebSocket2)) {
throw Error("No valid WebSocket class provided");
}
this._wait().then(function() {
return _this._getNextUrl(_this._url);
}).then(function(url) {
if (_this._closeCalled) {
return;
}
_this._debug("connect", {url, protocols: _this._protocols});
_this._ws = _this._protocols ? new WebSocket2(url, _this._protocols) : new WebSocket2(url);
_this._ws.binaryType = _this._binaryType;
_this._connectLock = false;
_this._addListeners();
_this._connectTimeout = setTimeout(function() {
return _this._handleTimeout();
}, connectionTimeout);
});
};
ReconnectingWebSocket2.prototype._handleTimeout = function() {
this._debug("timeout event");
this._handleError(new ErrorEvent(Error("TIMEOUT"), this));
};
ReconnectingWebSocket2.prototype._disconnect = function(code, reason) {
if (code === void 0) {
code = 1e3;
}
this._clearTimeouts();
if (!this._ws) {
return;
}
this._removeListeners();
try {
this._ws.close(code, reason);
this._handleClose(new CloseEvent(code, reason, this));
} catch (error) {
}
};
ReconnectingWebSocket2.prototype._acceptOpen = function() {
this._debug("accept open");
this._retryCount = 0;
};
ReconnectingWebSocket2.prototype._callEventListener = function(event, listener) {
if ("handleEvent" in listener) {
listener.handleEvent(event);
} else {
listener(event);
}
};
ReconnectingWebSocket2.prototype._removeListeners = function() {
if (!this._ws) {
return;
}
this._debug("removeListeners");
this._ws.removeEventListener("open", this._handleOpen);
this._ws.removeEventListener("close", this._handleClose);
this._ws.removeEventListener("message", this._handleMessage);
this._ws.removeEventListener("error", this._handleError);
};
ReconnectingWebSocket2.prototype._addListeners = function() {
if (!this._ws) {
return;
}
this._debug("addListeners");
this._ws.addEventListener("open", this._handleOpen);
this._ws.addEventListener("close", this._handleClose);
this._ws.addEventListener("message", this._handleMessage);
this._ws.addEventListener("error", this._handleError);
};
ReconnectingWebSocket2.prototype._clearTimeouts = function() {
clearTimeout(this._connectTimeout);
clearTimeout(this._uptimeTimeout);
};
return ReconnectingWebSocket2;
}();
var reconnecting_websocket_mjs_default = ReconnectingWebSocket;
// src/lib/osc-client-plugin.js
var STATUS = {
IS_NOT_INITIALIZED: -1,
IS_CONNECTING: 0,
IS_OPEN: 1,
IS_CLOSING: 2,
IS_CLOSED: 3
};
var DEFAULT_URL = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}`;
var defaultOptions = {
url: DEFAULT_URL,
path: null
};
var WebsocketClientPlugin = class {
constructor(customOptions) {
this.opts = {...defaultOptions, ...customOptions};
this.socket = null;
this.socketStatus = STATUS.IS_NOT_INITIALIZED;
this.notify = () => {
};
}
registerNotify(fn) {
this.notify = fn;
}
status() {
return this.socketStatus;
}
open(customOptions = {}) {
const options = {...this.opts, ...customOptions};
let {url, path} = options;
if (path)
url = url + path;
console.log("WS CONNECT", url);
this.socket = new reconnecting_websocket_mjs_default(url, null, {debug: true, reconnectInterval: 1e3, autoOpen: true, binaryType: "arraybuffer"});
this.socket.binaryType = "arraybuffer";
this.socket.onopen = () => {
console.log("WS OPEN");
this.socketStatus = STATUS.IS_OPEN;
this.notify("open");
};
this.socket.onclose = () => {
this.socketStatus = STATUS.IS_CLOSED;
this.notify("close");
};
this.socket.onerror = (error) => {
this.notify("error", error);
};
this.socket.onmessage = (message) => {
this.notify(message.data, {url: this.opts.url});
};
}
close() {
this.socketStatus = STATUS.IS_CLOSING;
this.socket.close();
}
send(binary) {
console.log("!! SEND", binary);
this.socket.send(binary);
}
};
var osc_client_plugin_default = WebsocketClientPlugin;
// src/lib/osc.js
var debug = import_debug.default("osc");
var DEFAULT_OPTS = {
plugin: new osc_client_plugin_default(),
url: "ws://localhost:8080/ws"
};
var OSCHandler = class {
constructor(opts = {}) {
this.opts = {...DEFAULT_OPTS, ...opts};
this.osc = new import_osc_js.default({plugin: this.opts.plugin});
this.osc.on("*", (message) => {
const {address, args} = message;
debug("RECV %s %o", address, args);
});
this.osc.on("error", (err) => {
console.error("OSC error", err);
});
}
open() {
this.osc.open(this.opts);
}
on(address, fn) {
const id = this.osc.on(address, fn);
return () => this.osc.off(address, id);
}
send(address, args = [], opts) {
if (address instanceof import_osc_js.default.Message || address instanceof import_osc_js.default.Bundle || address instanceof import_osc_js.default.Packet) {
debug("SEND", address);
return this.osc.send(address, args);
} else if (typeof address === "string") {
debug("SEND", address, args);
if (!Array.isArray(args))
args = [args];
const message = new import_osc_js.default.Message(address, ...args);
return this.osc.send(message, opts);
} else {
throw new Error("Invalid arguments to osc.send()", address);
}
}
};
var osc = new OSCHandler();
osc.open();
var osc_default = osc;
// src/hooks/use-osc-reducer.js
var import_debug2 = __toModule(require_browser2());
var debug2 = import_debug2.default("ui:osc:reducer");
function useOscValue(address, defaultValue, opts = {}) {
const [state, setState] = import_react22.useState(defaultValue);
import_react22.useEffect(() => {
const unwatch = osc_default.on(address, (message) => {
const {address: address2, args} = message;
if (opts.single)
setState(args[0]);
else
setState(args);
});
return unwatch;
}, [address]);
return state;
}
function useOscWritable(address, defaultValue, opts = {}) {
const state = useOscValue(address, defaultValue, opts);
return [state, setState];
function setState(nextValue) {
if (typeof nextValue === "function")
nextValue = nextValue(state);
console.log("useOscWritable write", address, nextValue);
osc_default.send(address, nextValue);
}
}
function useOscReducer(reducer2, initialState2, prefix = "") {
const [state, localDispatch] = import_react22.useReducer(reducer2, initialState2);
const prefixLen = prefix.split("/").length;
import_react22.useEffect(() => {
const wildcardAddress = prefix + "/*";
const unwatch = osc_default.on(wildcardAddress, (message) => {
const {address, args} = message;
const key = address.split("/").slice(prefixLen + 1).join("/");
localDispatch({cmd: "set", address: key, args});
});
return unwatch;
});
return [state, dispatch];
function dispatch(action) {
console.log("useOscReducer dispatch", action);
send(action);
}
function send(action) {
const {address, args} = action;
const fullAddress = COMMAND + prefix + address;
osc_default.send(fullAddress, args);
}
}
// src/comp/Player.js
var initialState = {play: "stop"};
function reducer(state, action) {
const x = (s) => ({...state, ...s});
const {cmd, args, key} = action;
if (cmd === "set") {
return x({[key]: args[0]});
}
if (cmd === "play") {
return x({play: "play"});
}
if (cmd === "pause") {
if (state.play === "stop")
return state;
return x({play: "pause"});
}
if (cmd === "playpause") {
if (state.play === "stop")
return x({play: "play"});
if (state.play === "pause")
return x({play: "play"});
return x({play: "pause"});
}
if (cmd === "stop") {
return x({play: "stop"});
}
if (cmd === "fullscreen") {
return x({fullscreen: !state.fullscreen});
}
return state;
}
function Player(props2) {
const {label = "Player", name = "/player/default"} = props2;
const [state, dispatch] = useOscReducer(reducer, initialState, name);
const {handleSubmit, register, errors} = useForm();
let style = {};
if (state.fullscreen) {
style = {
position: "fixed",
left: 0,
top: 0,
bottom: 0,
right: 0,
zIndex: 1e3
};
}
return /* @__PURE__ */ import_react23.default.createElement(Flex_default, {
height: "100%",
direction: "column",
bg: "black",
contentAlign: "stretch",
style
}, /* @__PURE__ */ import_react23.default.createElement(Bar, null, /* @__PURE__ */ import_react23.default.createElement(Bar.Element, null, label), /* @__PURE__ */ import_react23.default.createElement(Bar.Element, null, state.play)), /* @__PURE__ */ import_react23.default.createElement(Box_default, {
flex: 1
}), /* @__PURE__ */ import_react23.default.createElement(Flex_default, {
as: "form",
onSubmit: handleSubmit(onAdd),
p: 2
}, /* @__PURE__ */ import_react23.default.createElement(Input_default, {
name: "url",
placeholder: "Enter URL to play",
ref: register()
}), /* @__PURE__ */ import_react23.default.createElement(Button, null, "Add")), /* @__PURE__ */ import_react23.default.createElement(Flex_default, {
p: 2
}, /* @__PURE__ */ import_react23.default.createElement(PlayerButton, {
state: state.play,
dispatch,
action: "play",
active: "play"
}, "Play"), /* @__PURE__ */ import_react23.default.createElement(PlayerButton, {
variant: "yellow",
state: state.play,
dispatch,
action: "pause",
active: "pause"
}, "Pause"), /* @__PURE__ */ import_react23.default.createElement(PlayerButton, {
variant: "red",
state: state.play,
dispatch,
action: "stop",
active: "stop"
}, "Stop")));
function onAdd(values) {
console.log("add", values);
dispatch({cmd: "load", args: [values.url]});
}
}
function PlayerButton(props2) {
let {action, dispatch, active: active2, state, ...other} = props2;
if (action && dispatch && !other.onClick) {
other.onClick = (_e) => dispatch({cmd: action});
}
if (typeof active2 !== "boolean" && active2) {
active2 = state === active2;
}
return /* @__PURE__ */ import_react23.default.createElement(Button, {
square: true,
variant: "green",
mr: 2,
size: 16,
active: active2,
...other
});
}
// src/comp/Mixer.js
var import_react26 = __toModule(require_react());
// src/hooks/use-peak.js
var import_react24 = __toModule(require_react());
var PeakStore = class {
constructor() {
this.watchers = [];
}
watch(fn) {
this.watchers.push(fn);
return () => this.watchers = this.watchers.filter((w) => w !== fn);
}
set(val) {
this.val = val;
for (const watcher of this.watchers) {
watcher(val);
}
}
get() {
return this.val;
}
};
var peaks = new PeakStore();
osc_default.on("/peaks", (message) => {
const {args} = message;
const buf = args[0];
const nextPeaks = {};
for (let offset = 0; offset < 48; offset++) {
let pos = offset * 2;
let val = buf[pos] * 256 + buf[pos + 1];
val = val / 800 - 70;
nextPeaks[offset] = val;
}
console.log("RECV PEAKS", nextPeaks);
peaks.set(nextPeaks);
});
function usePeak(offset) {
const [peak, setPeak] = import_react24.useState(-70);
import_react24.useEffect(() => {
const unwatch = peaks.watch((peaks2) => {
setPeak(peaks2[offset]);
});
});
return peak;
}
// src/comp/Meter.js
var import_react25 = __toModule(require_react());
function Meter(props2) {
const style = {
minWidth: 0,
position: "absolute",
height: "100%",
width: "100%"
};
return /* @__PURE__ */ import_react25.default.createElement(Box_default, {
position: "relative",
width: "100%",
height: "100%"
}, /* @__PURE__ */ import_react25.default.createElement(SvgMeter, {
style,
...props2
}));
}
function SvgMeter(props2) {
const {min, max, value, style, redPeak = 80, width: width2 = 10, name} = props2;
let peak = value2px(value, min, max, 0, 100);
if (peak > 100)
peak = 100;
const [peakDrop, updatePeakDrop] = usePeakDrop();
import_react25.useEffect(() => {
updatePeakDrop(peak);
}, [peak, min, max]);
const maskid = import_react25.useMemo(() => "svg-meter-mask-" + (name || Date.now()), [name]);
const peakRed = value2px(redPeak, min, max, 0, 100);
const meter = import_react25.useMemo(() => /* @__PURE__ */ import_react25.default.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: `0 0 ${width2} 100`,
preserveAspectRatio: "none",
style
}, /* @__PURE__ */ import_react25.default.createElement("defs", null, /* @__PURE__ */ import_react25.default.createElement("mask", {
id: maskid
}, /* @__PURE__ */ import_react25.default.createElement("rect", {
x: "0",
y: 100 - peak,
width: width2,
height: peak,
fill: "white"
}))), /* @__PURE__ */ import_react25.default.createElement("g", {
mask: `url(#${maskid})`,
style: {opacity: 0.9}
}, /* @__PURE__ */ import_react25.default.createElement("rect", {
y: "0",
x: "0",
height: 100 - peakRed,
width: width2,
style: {fill: "#dd1100"}
}), /* @__PURE__ */ import_react25.default.createElement("rect", {
y: 100 - peakRed,
x: "0",
height: peakRed,
width: width2,
style: {fill: "#00dd00"}
}), "/>"), /* @__PURE__ */ import_react25.default.createElement("rect", {
y: 100 - peakDrop,
x: "0",
width: width2,
height: "0.5",
fill: "#00f"
}), /* @__PURE__ */ import_react25.default.createElement("rect", {
x: "0",
width: width2,
height: "0.2",
fill: "#ff0",
y: 100 - peakRed
})), [peak, peakDrop]);
return meter;
}
function usePeakDrop() {
const tickDown = 1;
const tickTime = 50;
const [state, setState] = import_react25.useState({max: 0, peak: 0});
import_react25.useEffect(() => {
const interval = setInterval(() => {
setState((state2) => update(state2, state2.peak));
}, tickTime);
return () => clearInterval(interval);
}, []);
return [state.max, updatePeak];
function update(state2, peak) {
const now = Date.now();
const nextState = {...state2};
if (peak !== state2.peak) {
nextState.peak = peak;
nextState.lastPeak = Date.now();
}
if (state2.max < peak) {
nextState.max = peak;
} else if (now - state2.lastPeak > 1e3) {
if (now - state2.lastPeak > 3e3) {
nextState.max = state2.peak;
} else {
nextState.max = Math.max(state2.max - tickDown, state2.peak);
}
}
return nextState;
}
function updatePeak(peak) {
setState((state2) => update(state2, peak));
}
}
function value2px(value, valueMin, valueMax, pxMin, pxMax) {
if (value < valueMin)
value = valueMin;
if (value > valueMax)
value = valueMax;
if (isNaN(value) || value === null)
value = valueMin;
const valueWidth = valueMax - valueMin;
const pixelWidth = pxMax - pxMin;
const ratio = pixelWidth / valueWidth;
return ratio * (value - valueMin) + pxMin;
}
// src/comp/Mixer.js
function Mixer() {
return /* @__PURE__ */ import_react26.default.createElement(Flex_default, {
flex: 1,
h: "100%",
p: "2"
}, /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 0
}), /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 1
}), /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 2
}), /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 3
}), /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 4
}), /* @__PURE__ */ import_react26.default.createElement(FaderChannel, {
channel: 5
}));
}
function OscMeter(props2) {
const {offset} = props2;
const peak = usePeak(offset);
console.log("USE PEAK", offset, peak);
const peaks2 = [peak, peak];
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, peaks2.map((peak2, i) => /* @__PURE__ */ import_react26.default.createElement(Box_default, {
w: 2,
key: i
}, /* @__PURE__ */ import_react26.default.createElement(Meter, {
key: i,
min: -60,
max: 0,
value: peak2
}))));
}
function FaderChannel(props2) {
const {channel, label} = props2;
const bus = 1;
const peakOffset = (bus + 2) * 8 + channel;
const volumeAddress = "/mixer/bus/1/ch/" + channel + "/volume";
const [volume, setVolume] = useOscWritable(volumeAddress, 0, {single: true});
const [pgm, setPgm] = useOscWritable("/mixer/bus/1/ch/" + channel + "/on", 0, {single: true});
const [pfl, setPfl] = useOscWritable("/mixer/bus/2/ch/" + channel + "/on", 0, {single: true});
console.log("render fc", {volume, pgm, pfl});
const peakAddress = "/mixer/bus/1/ch/" + channel + "/level";
return /* @__PURE__ */ import_react26.default.createElement(Flex_default, {
direction: "column",
w: 16,
pr: 2,
mr: 2,
overflow: "hidden"
}, /* @__PURE__ */ import_react26.default.createElement(Text_default, {
display: "block",
fontSize: "xs",
fontWeight: "bold",
color: "#ddd"
}, label), /* @__PURE__ */ import_react26.default.createElement(Flex_default, {
flex: 1
}, "// ", /* @__PURE__ */ import_react26.default.createElement(OscMeter, {
address: peakAddress,
channel: 0
}), /* @__PURE__ */ import_react26.default.createElement(OscMeter, {
offset: peakOffset
})), /* @__PURE__ */ import_react26.default.createElement(Button, {
onClick: (e3) => setPgm((pgm2) => pgm2 ? 0 : 1),
active: !!pgm,
mx: "auto",
mt: 1,
square: true,
size: 12,
variant: "green"
}, "ON"), /* @__PURE__ */ import_react26.default.createElement(Button, {
onClick: (e3) => setPfl((pfl2) => pfl2 ? 0 : 1),
active: !!pfl,
mx: "auto",
mt: 1,
square: true,
size: 12,
variant: "blue"
}, "PFL"), /* @__PURE__ */ import_react26.default.createElement(Fader, {
onChange: setVolume,
value: volume
}), /* @__PURE__ */ import_react26.default.createElement(Text_default, {
textAlign: "center",
display: "block",
fontSize: "xs",
fontWeight: "bold",
color: "#ddd"
}, label));
}
function Fader(props2) {
return /* @__PURE__ */ import_react26.default.createElement(Slider_default, {
color: "pink",
defaultValue: 0,
min: -70,
max: 4,
step: 0.2,
orientation: "vertical",
...props2
}, /* @__PURE__ */ import_react26.default.createElement(SliderTrack, null), /* @__PURE__ */ import_react26.default.createElement(SliderFilledTrack, null), /* @__PURE__ */ import_react26.default.createElement(SliderThumb, null));
}
// src/comp/Chat.js
var import_react27 = __toModule(require_react());
function useMessages() {
const [messages, setMessages] = import_react27.useState([]);
return [messages, postMessage];
function postMessage(message) {
console.log("post", message);
message = {value: message};
setMessages((messages2) => [...messages2, message]);
}
}
function Chat(props2) {
const [messages, postMessage] = useMessages();
console.log("messages", messages);
return /* @__PURE__ */ import_react27.default.createElement(Flex_default, {
height: "100%",
direction: "column",
bg: "black"
}, /* @__PURE__ */ import_react27.default.createElement(Messages, {
messages
}), /* @__PURE__ */ import_react27.default.createElement(MessageBox, {
onSubmit: postMessage
}));
}
function Messages(props2) {
const {messages} = props2;
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
flex: 1,
p: 2,
overflow: "auto"
}, messages.map((message, i) => /* @__PURE__ */ import_react27.default.createElement(Message, {
key: i,
message
})), "list");
}
function Message(props2) {
const {message} = props2;
const text = message.value.message;
return /* @__PURE__ */ import_react27.default.createElement(Box_default, {
p: 2,
fontSize: "lg",
fontFamily: "mono",
color: "white"
}, text);
}
function MessageBox(props2) {
const {onSubmit} = props2;
const {handleSubmit, register, setError} = useForm();
return /* @__PURE__ */ import_react27.default.createElement("form", {
onSubmit: handleSubmit(onSubmit)
}, /* @__PURE__ */ import_react27.default.createElement(Flex_default, {
margin: 2
}, /* @__PURE__ */ import_react27.default.createElement(Textarea_default, {
w: "full",
h: "12",
resize: "none",
borderRadius: 0,
fontSize: "lg",
bg: "black",
color: "white",
fontFamily: "mono",
fontWeight: "600",
flex: 1,
p: "2",
m: "0",
border: "4px solid black",
borderColor: "black",
_focus: {
border: "4px solid magenta"
},
_hover: {
border: "4px solid #440077"
},
placeholder: "type here to chat",
ref: register(),
name: "message"
}), /* @__PURE__ */ import_react27.default.createElement(Button, {
square: true,
onSubmit: handleSubmit(onSubmit)
}, "Send")));
}
// src/comp/Pane.js
var import_react28 = __toModule(require_react());
function Pane(props2) {
const {children, ...rest} = props2;
return /* @__PURE__ */ import_react28.default.createElement(PseudoBox_default, {
bg: "black",
display: "flex",
alignItems: "stretch",
flex: 1,
position: "relative",
border: "paneBorder",
_focusWithin: {
border: "paneBorderFocus"
},
p: 2,
...rest
}, /* @__PURE__ */ import_react28.default.createElement(Box_default, {
position: "absolute",
left: "0",
right: "0",
top: "0",
bottom: "0",
overflow: "auto"
}, children));
}
function Container(props2) {
return /* @__PURE__ */ import_react28.default.createElement(Stack_default, {
flex: 1,
...props2,
alignItems: "stretch"
});
}
// src/App.js
function App(props2) {
return /* @__PURE__ */ import_react29.default.createElement(Wrapper, null, /* @__PURE__ */ import_react29.default.createElement(Container, {
direction: "row",
minHeight: "100vh",
bg: "#222",
p: 2
}, /* @__PURE__ */ import_react29.default.createElement(Pane, {
flex: 1
}, /* @__PURE__ */ import_react29.default.createElement(Mixer, null)), /* @__PURE__ */ import_react29.default.createElement(Container, {
direction: "column"
}, /* @__PURE__ */ import_react29.default.createElement(Pane, null, /* @__PURE__ */ import_react29.default.createElement(Player, {
label: "DeckA",
address: "/player/decka"
})), /* @__PURE__ */ import_react29.default.createElement(Pane, null, /* @__PURE__ */ import_react29.default.createElement(Player, {
label: "DeckB",
address: "/player/deckb"
}))), /* @__PURE__ */ import_react29.default.createElement(Pane, {
maxWidth: "sm"
}, /* @__PURE__ */ import_react29.default.createElement(Chat, null))));
}
var App_default = App;
function Wrapper(props2) {
const {children} = props2;
const theme2 = studioxtheme();
return /* @__PURE__ */ import_react29.default.createElement(ThemeProvider_default, {
theme: theme2
}, /* @__PURE__ */ import_react29.default.createElement(CSSReset_default, null), children);
}
// src/index.js
var el = document.createElement("div");
document.body.appendChild(el);
import_react_dom.default.render(/* @__PURE__ */ import_react30.default.createElement(App_default, null), el);
})();
//# sourceMappingURL=bundle.js.map