From 77f843c55100a59a03b580b9684e490ace084336 Mon Sep 17 00:00:00 2001 From: poop Date: Sun, 28 May 2023 23:29:27 -0500 Subject: [PATCH] Chore(dist): dont ignore dist dir --- .gitignore | 1 - dist/index.js | 9855 +++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 9856 insertions(+), 2 deletions(-) create mode 100644 dist/index.js diff --git a/.gitignore b/.gitignore index 31ac94f..653ac92 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ node_modules # builds build -dist # misc .DS_Store diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..f4dcbff --- /dev/null +++ b/dist/index.js @@ -0,0 +1,9855 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getProtoOf = Object.getPrototypeOf; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __toESM = (mod, isNodeMode, target) => { + target = mod != null ? __create(__getProtoOf(mod)) : {}; + const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target; + for (let key of __getOwnPropNames(mod)) + if (!__hasOwnProp.call(to, key)) + __defProp(to, key, { + get: () => mod[key], + enumerable: true + }); + return to; +}; +var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { + get: all[name], + enumerable: true, + configurable: true, + set: (newValue) => all[name] = () => newValue + }); +}; +var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res); + +// node_modules/react/cjs/react.development.js +var exports_react_development = {}; +__export(exports_react_development, { + version: () => { + { + return $version; + } + }, + useTransition: () => { + { + return $useTransition; + } + }, + useSyncExternalStore: () => { + { + return $useSyncExternalStore; + } + }, + useState: () => { + { + return $useState; + } + }, + useRef: () => { + { + return $useRef; + } + }, + useReducer: () => { + { + return $useReducer; + } + }, + useMemo: () => { + { + return $useMemo; + } + }, + useLayoutEffect: () => { + { + return $useLayoutEffect; + } + }, + useInsertionEffect: () => { + { + return $useInsertionEffect; + } + }, + useImperativeHandle: () => { + { + return $useImperativeHandle; + } + }, + useId: () => { + { + return $useId; + } + }, + useEffect: () => { + { + return $useEffect; + } + }, + useDeferredValue: () => { + { + return $useDeferredValue; + } + }, + useDebugValue: () => { + { + return $useDebugValue; + } + }, + useContext: () => { + { + return $useContext; + } + }, + useCallback: () => { + { + return $useCallback; + } + }, + unstable_act: () => { + { + return $unstable_act; + } + }, + startTransition: () => { + { + return $startTransition; + } + }, + memo: () => { + { + return $memo; + } + }, + lazy: () => { + { + return $lazy; + } + }, + isValidElement: () => { + { + return $isValidElement; + } + }, + forwardRef: () => { + { + return $forwardRef; + } + }, + createRef: () => { + { + return $createRef; + } + }, + createFactory: () => { + { + return $createFactory; + } + }, + createElement: () => { + { + return $createElement; + } + }, + createContext: () => { + { + return $createContext; + } + }, + cloneElement: () => { + { + return $cloneElement; + } + }, + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: () => { + { + return $__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + } + }, + Suspense: () => { + { + return $Suspense; + } + }, + StrictMode: () => { + { + return $StrictMode; + } + }, + PureComponent: () => { + { + return $PureComponent; + } + }, + Profiler: () => { + { + return $Profiler; + } + }, + Fragment: () => { + { + return $Fragment; + } + }, + Component: () => { + { + return $Component; + } + }, + Children: () => { + { + return $Children; + } + } +}); +var $Children, $Component, $Fragment, $Profiler, $PureComponent, $StrictMode, $Suspense, $__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, $cloneElement, $createContext, $createElement, $createFactory, $createRef, $forwardRef, $isValidElement, $lazy, $memo, $startTransition, $unstable_act, $useCallback, $useContext, $useDebugValue, $useDeferredValue, $useEffect, $useId, $useImperativeHandle, $useInsertionEffect, $useLayoutEffect, $useMemo, $useReducer, $useRef, $useState, $useSyncExternalStore, $useTransition, $version; +var init_react_development = __esm(() => { + if (true) { + (function() { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error); + } + var ReactVersion = "18.2.0"; + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === "function") { + return maybeIterator; + } + return null; + } + var ReactCurrentDispatcher = { + current: null + }; + var ReactCurrentBatchConfig = { + transition: null + }; + var ReactCurrentActQueue = { + current: null, + isBatchingLegacy: false, + didScheduleLegacyUpdate: false + }; + var ReactCurrentOwner = { + current: null + }; + var ReactDebugCurrentFrame = {}; + var currentExtraStackFrame = null; + function setExtraStackFrame(stack) { + { + currentExtraStackFrame = stack; + } + } + { + ReactDebugCurrentFrame.setExtraStackFrame = function(stack) { + { + currentExtraStackFrame = stack; + } + }; + ReactDebugCurrentFrame.getCurrentStack = null; + ReactDebugCurrentFrame.getStackAddendum = function() { + var stack = ""; + if (currentExtraStackFrame) { + stack += currentExtraStackFrame; + } + var impl = ReactDebugCurrentFrame.getCurrentStack; + if (impl) { + stack += impl() || ""; + } + return stack; + }; + } + var enableScopeAPI = false; + var enableCacheElement = false; + var enableTransitionTracing = false; + var enableLegacyHidden = false; + var enableDebugTracing = false; + var ReactSharedInternals = { + ReactCurrentDispatcher, + ReactCurrentBatchConfig, + ReactCurrentOwner + }; + { + ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; + ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; + } + function warn(format) { + { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + printWarning("warn", format, args); + } + } + } + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning("error", format, args); + } + } + } + function printWarning(level, format, args) { + { + var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame2.getStackAddendum(); + if (stack !== "") { + format += "%s"; + args = args.concat([stack]); + } + var argsWithFormat = args.map(function(item) { + return String(item); + }); + argsWithFormat.unshift("Warning: " + format); + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + var didWarnStateUpdateForUnmountedComponent = {}; + function warnNoop(publicInstance, callerName) { + { + var _constructor = publicInstance.constructor; + var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass"; + var warningKey = componentName + "." + callerName; + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { + return; + } + error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName); + didWarnStateUpdateForUnmountedComponent[warningKey] = true; + } + } + var ReactNoopUpdateQueue = { + isMounted: function(publicInstance) { + return false; + }, + enqueueForceUpdate: function(publicInstance, callback, callerName) { + warnNoop(publicInstance, "forceUpdate"); + }, + enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { + warnNoop(publicInstance, "replaceState"); + }, + enqueueSetState: function(publicInstance, partialState, callback, callerName) { + warnNoop(publicInstance, "setState"); + } + }; + var assign = Object.assign; + var emptyObject = {}; + { + Object.freeze(emptyObject); + } + function Component(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + Component.prototype.isReactComponent = {}; + Component.prototype.setState = function(partialState, callback) { + if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) { + throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); + } + this.updater.enqueueSetState(this, partialState, callback, "setState"); + }; + Component.prototype.forceUpdate = function(callback) { + this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); + }; + { + var deprecatedAPIs = { + isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."], + replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] + }; + var defineDeprecationWarning = function(methodName, info) { + Object.defineProperty(Component.prototype, methodName, { + get: function() { + warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]); + return; + } + }); + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } + } + function ComponentDummy() { + } + ComponentDummy.prototype = Component.prototype; + function PureComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + } + var pureComponentPrototype = PureComponent.prototype = new ComponentDummy; + pureComponentPrototype.constructor = PureComponent; + assign(pureComponentPrototype, Component.prototype); + pureComponentPrototype.isPureReactComponent = true; + function createRef() { + var refObject = { + current: null + }; + { + Object.seal(refObject); + } + return refObject; + } + var isArrayImpl = Array.isArray; + function isArray(a) { + return isArrayImpl(a); + } + function typeName(value) { + { + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; + return type; + } + } + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value) { + return "" + value; + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); + return testStringCoercion(value); + } + } + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; + } + function getContextName(type) { + return type.displayName || "Context"; + } + function getComponentNameFromType(type) { + if (type == null) { + return null; + } + { + if (typeof type.tag === "number") { + error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); + } + } + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + return type; + } + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + ".Consumer"; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + ".Provider"; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, "ForwardRef"); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + } + } + return null; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, "ref")) { + var getter = Object.getOwnPropertyDescriptor(config, "ref").get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; + } + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; + } + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function() { + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); + } + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: true + }); + } + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function() { + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); + } + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, "ref", { + get: warnAboutAccessingRef, + configurable: true + }); + } + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + var ReactElement = function(type, key, ref, self, source, owner, props) { + var element = { + $$typeof: REACT_ELEMENT_TYPE, + type, + key, + ref, + props, + _owner: owner + }; + { + element._store = {}; + Object.defineProperty(element._store, "validated", { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + Object.defineProperty(element, "_self", { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + Object.defineProperty(element, "_source", { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + return element; + }; + function createElement(type, config, children) { + var propName; + var props = {}; + var key = null; + var ref = null; + var self = null; + var source = null; + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = "" + config.key; + } + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0;i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + { + if (Object.freeze) { + Object.freeze(childArray); + } + } + props.children = childArray; + } + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + { + if (key || ref) { + var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + function cloneAndReplaceKey(oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + return newElement; + } + function cloneElement(element, config, children) { + if (element === null || element === undefined) { + throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); + } + var propName; + var props = assign({}, element.props); + var key = element.key; + var ref = element.ref; + var self = element._self; + var source = element._source; + var owner = element._owner; + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = "" + config.key; + } + var defaultProps; + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0;i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + return ReactElement(element.type, key, ref, self, source, owner, props); + } + function isValidElement(object) { + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + var SEPARATOR = "."; + var SUBSEPARATOR = ":"; + function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + "=": "=0", + ":": "=2" + }; + var escapedString = key.replace(escapeRegex, function(match) { + return escaperLookup[match]; + }); + return "$" + escapedString; + } + var didWarnAboutMaps = false; + var userProvidedKeyEscapeRegex = /\/+/g; + function escapeUserProvidedKey(text) { + return text.replace(userProvidedKeyEscapeRegex, "$&/"); + } + function getElementKey(element, index) { + if (typeof element === "object" && element !== null && element.key != null) { + { + checkKeyStringCoercion(element.key); + } + return escape("" + element.key); + } + return index.toString(36); + } + function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { + var type = typeof children; + if (type === "undefined" || type === "boolean") { + children = null; + } + var invokeCallback = false; + if (children === null) { + invokeCallback = true; + } else { + switch (type) { + case "string": + case "number": + invokeCallback = true; + break; + case "object": + switch (children.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + invokeCallback = true; + } + } + } + if (invokeCallback) { + var _child = children; + var mappedChild = callback(_child); + var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; + if (isArray(mappedChild)) { + var escapedChildKey = ""; + if (childKey != null) { + escapedChildKey = escapeUserProvidedKey(childKey) + "/"; + } + mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) { + return c; + }); + } else if (mappedChild != null) { + if (isValidElement(mappedChild)) { + { + if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { + checkKeyStringCoercion(mappedChild.key); + } + } + mappedChild = cloneAndReplaceKey(mappedChild, escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey); + } + array.push(mappedChild); + } + return 1; + } + var child; + var nextName; + var subtreeCount = 0; + var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR; + if (isArray(children)) { + for (var i = 0;i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getElementKey(child, i); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else { + var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === "function") { + var iterableChildren = children; + { + if (iteratorFn === iterableChildren.entries) { + if (!didWarnAboutMaps) { + warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); + } + didWarnAboutMaps = true; + } + } + var iterator = iteratorFn.call(iterableChildren); + var step; + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getElementKey(child, ii++); + subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + } + } else if (type === "object") { + var childrenString = String(children); + throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead."); + } + } + return subtreeCount; + } + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + var count = 0; + mapIntoArray(children, result, "", "", function(child) { + return func.call(context, child, count++); + }); + return result; + } + function countChildren(children) { + var n = 0; + mapChildren(children, function() { + n++; + }); + return n; + } + function forEachChildren(children, forEachFunc, forEachContext) { + mapChildren(children, function() { + forEachFunc.apply(this, arguments); + }, forEachContext); + } + function toArray(children) { + return mapChildren(children, function(child) { + return child; + }) || []; + } + function onlyChild(children) { + if (!isValidElement(children)) { + throw new Error("React.Children.only expected to receive a single React element child."); + } + return children; + } + function createContext(defaultValue) { + var context = { + $$typeof: REACT_CONTEXT_TYPE, + _currentValue: defaultValue, + _currentValue2: defaultValue, + _threadCount: 0, + Provider: null, + Consumer: null, + _defaultValue: null, + _globalName: null + }; + context.Provider = { + $$typeof: REACT_PROVIDER_TYPE, + _context: context + }; + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + var hasWarnedAboutDisplayNameOnConsumer = false; + { + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context + }; + Object.defineProperties(Consumer, { + Provider: { + get: function() { + if (!hasWarnedAboutUsingConsumerProvider) { + hasWarnedAboutUsingConsumerProvider = true; + error("Rendering is not supported and will be removed in a future major release. Did you mean to render 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 is not supported and will be removed in a future major release. Did you mean to render instead?"); + } + return context.Consumer; + } + }, + displayName: { + get: function() { + return context.displayName; + }, + set: function(displayName) { + if (!hasWarnedAboutDisplayNameOnConsumer) { + warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName); + hasWarnedAboutDisplayNameOnConsumer = true; + } + } + } + }); + context.Consumer = Consumer; + } + { + context._currentRenderer = null; + context._currentRenderer2 = null; + } + return context; + } + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + function lazyInitializer(payload) { + if (payload._status === Uninitialized) { + var ctor = payload._result; + var thenable = ctor(); + thenable.then(function(moduleObject2) { + if (payload._status === Pending || payload._status === Uninitialized) { + var resolved = payload; + resolved._status = Resolved; + resolved._result = moduleObject2; + } + }, function(error2) { + if (payload._status === Pending || payload._status === Uninitialized) { + var rejected = payload; + rejected._status = Rejected; + rejected._result = error2; + } + }); + if (payload._status === Uninitialized) { + var pending = payload; + pending._status = Pending; + pending._result = thenable; + } + } + if (payload._status === Resolved) { + var moduleObject = payload._result; + { + if (moduleObject === undefined) { + error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject); + } + } + { + if (!("default" in moduleObject)) { + error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + return moduleObject.default; + } else { + throw payload._result; + } + } + function lazy(ctor) { + var payload = { + _status: Uninitialized, + _result: ctor + }; + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _payload: payload, + _init: lazyInitializer + }; + { + var defaultProps; + var propTypes; + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function() { + return defaultProps; + }, + set: function(newDefaultProps) { + error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); + defaultProps = newDefaultProps; + Object.defineProperty(lazyType, "defaultProps", { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function() { + return propTypes; + }, + set: function(newPropTypes) { + error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."); + propTypes = newPropTypes; + Object.defineProperty(lazyType, "propTypes", { + enumerable: true + }); + } + } + }); + } + return lazyType; + } + function forwardRef(render) { + { + if (render != null && render.$$typeof === REACT_MEMO_TYPE) { + error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."); + } else if (typeof render !== "function") { + error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."); + } + } + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"); + } + } + } + var elementType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render + }; + { + var ownName; + Object.defineProperty(elementType, "displayName", { + enumerable: false, + configurable: true, + get: function() { + return ownName; + }, + set: function(name) { + ownName = name; + if (!render.name && !render.displayName) { + render.displayName = name; + } + } + }); + } + return elementType; + } + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); + } + function isValidElementType(type) { + if (typeof type === "string" || typeof type === "function") { + return true; + } + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { + return true; + } + if (typeof type === "object" && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + return true; + } + } + return false; + } + function memo(type, compare) { + { + if (!isValidElementType(type)) { + error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type); + } + } + var elementType = { + $$typeof: REACT_MEMO_TYPE, + type, + compare: compare === undefined ? null : compare + }; + { + var ownName; + Object.defineProperty(elementType, "displayName", { + enumerable: false, + configurable: true, + get: function() { + return ownName; + }, + set: function(name) { + ownName = name; + if (!type.name && !type.displayName) { + type.displayName = name; + } + } + }); + } + return elementType; + } + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + { + if (dispatcher === null) { + error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + } + return dispatcher; + } + function useContext(Context) { + var dispatcher = resolveDispatcher(); + { + if (Context._context !== undefined) { + var realContext = Context._context; + if (realContext.Consumer === Context) { + error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"); + } else if (realContext.Provider === Context) { + error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); + } + } + } + return dispatcher.useContext(Context); + } + function useState(initialState) { + var dispatcher = resolveDispatcher(); + return dispatcher.useState(initialState); + } + function useReducer(reducer, initialArg, init) { + var dispatcher = resolveDispatcher(); + return dispatcher.useReducer(reducer, initialArg, init); + } + function useRef(initialValue) { + var dispatcher = resolveDispatcher(); + return dispatcher.useRef(initialValue); + } + function useEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); + } + function useInsertionEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useInsertionEffect(create, deps); + } + function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); + } + function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); + } + function useMemo(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); + } + } + function useTransition() { + var dispatcher = resolveDispatcher(); + return dispatcher.useTransition(); + } + function useDeferredValue(value) { + var dispatcher = resolveDispatcher(); + return dispatcher.useDeferredValue(value); + } + function useId() { + var dispatcher = resolveDispatcher(); + return dispatcher.useId(); + } + function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var dispatcher = resolveDispatcher(); + return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); + } + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() { + } + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + } + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + var props = { + configurable: true, + enumerable: true, + writable: true + }; + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + } + if (disabledDepth < 0) { + error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + } + } + } + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ""; + } + } + return "\n" + prefix + name; + } + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap; + } + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) { + return ""; + } + { + var frame = componentFrameCache.get(fn); + if (frame !== undefined) { + return frame; + } + } + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = null; + disableLogs(); + } + try { + if (construct) { + var Fake = function() { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function() { + throw Error(); + } + }); + if (typeof Reflect === "object" && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + fn(); + } + } catch (sample) { + if (sample && control && typeof sample.stack === "string") { + var sampleLines = sample.stack.split("\n"); + var controlLines = control.stack.split("\n"); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + c--; + } + for (;s >= 1 && c >= 0; s--, c--) { + if (sampleLines[s] !== controlLines[c]) { + if (s !== 1 || c !== 1) { + do { + s--; + c--; + if (c < 0 || sampleLines[s] !== controlLines[c]) { + var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + { + ReactCurrentDispatcher$1.current = previousDispatcher; + reenableLogs(); + } + Error.prepareStackTrace = previousPrepareStackTrace; + } + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + function shouldConstruct(Component2) { + var prototype = Component2.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ""; + } + if (typeof type === "function") { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + if (typeof type === "string") { + return describeBuiltInComponentFrame(type); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame("Suspense"); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame("SuspenseList"); + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) { + } + } + } + } + return ""; + } + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = undefined; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + err.name = "Invariant Violation"; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error("Failed %s type: %s", location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + setExtraStackFrame(stack); + } else { + setExtraStackFrame(null); + } + } + } + var propTypesMisspellWarningShown; + { + propTypesMisspellWarningShown = false; + } + function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = getComponentNameFromType(ReactCurrentOwner.current.type); + if (name) { + return "\n\nCheck the render method of `" + name + "`."; + } + } + return ""; + } + function getSourceInfoErrorAddendum(source) { + if (source !== undefined) { + 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 !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + return ""; + } + var ownerHasKeyUseWarning = {}; + function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + if (!info) { + var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + return info; + } + function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + var childOwner = ""; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; + } + { + setCurrentlyValidatingElement$1(element); + error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + setCurrentlyValidatingElement$1(null); + } + } + function validateChildKeys(node, parentType) { + if (typeof node !== "object") { + return; + } + if (isArray(node)) { + for (var i = 0;i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === "function") { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + function validatePropTypes(element) { + { + var type = element.type; + if (type === null || type === undefined || typeof type === "string") { + return; + } + var propTypes; + if (typeof type === "function") { + propTypes = type.propTypes; + } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + if (propTypes) { + var name = getComponentNameFromType(type); + checkPropTypes(propTypes, element.props, "prop", name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + var _name = getComponentNameFromType(type); + error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); + } + if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { + error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); + } + } + } + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + for (var i = 0;i < keys.length; i++) { + var key = keys[i]; + if (key !== "children" && key !== "key") { + setCurrentlyValidatingElement$1(fragment); + error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); + setCurrentlyValidatingElement$1(null); + break; + } + } + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + error("Invalid attribute `ref` supplied to `React.Fragment`."); + setCurrentlyValidatingElement$1(null); + } + } + } + function createElementWithValidation(type, props, children) { + var validType = isValidElementType(type); + if (!validType) { + var info = ""; + if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; + } + var sourceInfo = getSourceInfoErrorAddendumForProps(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + var typeString; + if (type === null) { + typeString = "null"; + } else if (isArray(type)) { + typeString = "array"; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; + info = " Did you accidentally export a JSX literal instead of a component?"; + } else { + typeString = typeof type; + } + { + error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); + } + } + var element = createElement.apply(this, arguments); + if (element == null) { + return element; + } + if (validType) { + for (var 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, props, children) { + var newElement = cloneElement.apply(this, arguments); + for (var i = 2;i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } + function startTransition(scope, options) { + var prevTransition = ReactCurrentBatchConfig.transition; + ReactCurrentBatchConfig.transition = {}; + var currentTransition = ReactCurrentBatchConfig.transition; + { + ReactCurrentBatchConfig.transition._updatedFibers = new Set; + } + try { + scope(); + } finally { + ReactCurrentBatchConfig.transition = prevTransition; + { + if (prevTransition === null && currentTransition._updatedFibers) { + var updatedFibersCount = currentTransition._updatedFibers.size; + if (updatedFibersCount > 10) { + warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."); + } + currentTransition._updatedFibers.clear(); + } + } + } + } + var didWarnAboutMessageChannel = false; + var enqueueTaskImpl = null; + function enqueueTask(task) { + if (enqueueTaskImpl === null) { + try { + var requireString = ("require" + Math.random()).slice(0, 7); + var nodeRequire = module_react_development && module_react_development[requireString]; + enqueueTaskImpl = nodeRequire.call(module_react_development, "timers").setImmediate; + } catch (_err) { + enqueueTaskImpl = function(callback) { + { + if (didWarnAboutMessageChannel === false) { + didWarnAboutMessageChannel = true; + if (typeof MessageChannel === "undefined") { + error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."); + } + } + } + var channel = new MessageChannel; + channel.port1.onmessage = callback; + channel.port2.postMessage(undefined); + }; + } + } + return enqueueTaskImpl(task); + } + var actScopeDepth = 0; + var didWarnNoAwaitAct = false; + function act(callback) { + { + var prevActScopeDepth = actScopeDepth; + actScopeDepth++; + if (ReactCurrentActQueue.current === null) { + ReactCurrentActQueue.current = []; + } + var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; + var result; + try { + ReactCurrentActQueue.isBatchingLegacy = true; + result = callback(); + if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { + var queue = ReactCurrentActQueue.current; + if (queue !== null) { + ReactCurrentActQueue.didScheduleLegacyUpdate = false; + flushActQueue(queue); + } + } + } catch (error2) { + popActScope(prevActScopeDepth); + throw error2; + } finally { + ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; + } + if (result !== null && typeof result === "object" && typeof result.then === "function") { + var thenableResult = result; + var wasAwaited = false; + var thenable = { + then: function(resolve, reject) { + wasAwaited = true; + thenableResult.then(function(returnValue2) { + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + recursivelyFlushAsyncActWork(returnValue2, resolve, reject); + } else { + resolve(returnValue2); + } + }, function(error2) { + popActScope(prevActScopeDepth); + reject(error2); + }); + } + }; + { + if (!didWarnNoAwaitAct && typeof Promise !== "undefined") { + Promise.resolve().then(function() { + }).then(function() { + if (!wasAwaited) { + didWarnNoAwaitAct = true; + error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"); + } + }); + } + } + return thenable; + } else { + var returnValue = result; + popActScope(prevActScopeDepth); + if (actScopeDepth === 0) { + var _queue = ReactCurrentActQueue.current; + if (_queue !== null) { + flushActQueue(_queue); + ReactCurrentActQueue.current = null; + } + var _thenable = { + then: function(resolve, reject) { + if (ReactCurrentActQueue.current === null) { + ReactCurrentActQueue.current = []; + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } else { + resolve(returnValue); + } + } + }; + return _thenable; + } else { + var _thenable2 = { + then: function(resolve, reject) { + resolve(returnValue); + } + }; + return _thenable2; + } + } + } + } + function popActScope(prevActScopeDepth) { + { + if (prevActScopeDepth !== actScopeDepth - 1) { + error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "); + } + actScopeDepth = prevActScopeDepth; + } + } + function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { + { + var queue = ReactCurrentActQueue.current; + if (queue !== null) { + try { + flushActQueue(queue); + enqueueTask(function() { + if (queue.length === 0) { + ReactCurrentActQueue.current = null; + resolve(returnValue); + } else { + recursivelyFlushAsyncActWork(returnValue, resolve, reject); + } + }); + } catch (error2) { + reject(error2); + } + } else { + resolve(returnValue); + } + } + } + var isFlushing = false; + function flushActQueue(queue) { + { + if (!isFlushing) { + isFlushing = true; + var i = 0; + try { + for (;i < queue.length; i++) { + var callback = queue[i]; + do { + callback = callback(true); + } while (callback !== null); + } + queue.length = 0; + } catch (error2) { + queue = queue.slice(i + 1); + throw error2; + } finally { + isFlushing = false; + } + } + } + } + var createElement$1 = createElementWithValidation; + var cloneElement$1 = cloneElementWithValidation; + var createFactory = createFactoryWithValidation; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray, + only: onlyChild + }; + $Children = Children; + $Component = Component; + $Fragment = REACT_FRAGMENT_TYPE; + $Profiler = REACT_PROFILER_TYPE; + $PureComponent = PureComponent; + $StrictMode = REACT_STRICT_MODE_TYPE; + $Suspense = REACT_SUSPENSE_TYPE; + $__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + $cloneElement = cloneElement$1; + $createContext = createContext; + $createElement = createElement$1; + $createFactory = createFactory; + $createRef = createRef; + $forwardRef = forwardRef; + $isValidElement = isValidElement; + $lazy = lazy; + $memo = memo; + $startTransition = startTransition; + $unstable_act = act; + $useCallback = useCallback; + $useContext = useContext; + $useDebugValue = useDebugValue; + $useDeferredValue = useDeferredValue; + $useEffect = useEffect; + $useId = useId; + $useImperativeHandle = useImperativeHandle; + $useInsertionEffect = useInsertionEffect; + $useLayoutEffect = useLayoutEffect; + $useMemo = useMemo; + $useReducer = useReducer; + $useRef = useRef; + $useState = useState; + $useSyncExternalStore = useSyncExternalStore; + $useTransition = useTransition; + $version = ReactVersion; + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error); + } + })(); + } +}); + +// node_modules/react/index.js +var require_react = __commonJS((exports, module) => { + init_react_development(); + if (false) { + } else { + module.exports = (exports_react_development); + } +}); + +// node_modules/@emotion/memoize/dist/memoize.browser.cjs.js +var require_memoize_browser_cjs = __commonJS((exports) => { + var memoize = function(fn) { + var cache = {}; + return function(arg) { + if (cache[arg] === undefined) + cache[arg] = fn(arg); + return cache[arg]; + }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = memoize; +}); + +// node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.cjs.js +var require_is_prop_valid_browser_cjs = __commonJS((exports) => { + var _interopDefault = function(ex) { + return ex && typeof ex === "object" && ("default" in ex) ? ex["default"] : ex; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + var memoize = _interopDefault(require_memoize_browser_cjs()); + 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(function(prop) { + return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91; + }); + exports.default = index; +}); + +// node_modules/react/cjs/react-jsx-runtime.development.js +var exports_react_jsx_runtime_development = {}; +__export(exports_react_jsx_runtime_development, { + jsxs: () => { + { + return $jsxs; + } + }, + jsx: () => { + { + return $jsx; + } + }, + Fragment: () => { + { + return $Fragment2; + } + } +}); +var $Fragment2, $jsx, $jsxs; +var init_react_jsx_runtime_development = __esm(() => { + var React2 = __toESM(require_react()); + if (true) { + (function() { + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === "function") { + return maybeIterator; + } + return null; + } + var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function error(format) { + { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1;_key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + printWarning("error", format, args); + } + } + } + function printWarning(level, format, args) { + { + var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; + var stack2 = ReactDebugCurrentFrame2.getStackAddendum(); + if (stack2 !== "") { + format += "%s"; + args = args.concat([stack2]); + } + var argsWithFormat = args.map(function(item) { + return String(item); + }); + argsWithFormat.unshift("Warning: " + format); + Function.prototype.apply.call(console[level], console, argsWithFormat); + } + } + var enableScopeAPI = false; + var enableCacheElement = false; + var enableTransitionTracing = false; + var enableLegacyHidden = false; + var enableDebugTracing = false; + var REACT_MODULE_REFERENCE; + { + REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); + } + function isValidElementType(type) { + if (typeof type === "string" || typeof type === "function") { + return true; + } + if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { + return true; + } + if (typeof type === "object" && type !== null) { + if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { + return true; + } + } + return false; + } + function getWrappedName(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + if (displayName) { + return displayName; + } + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; + } + function getContextName(type) { + return type.displayName || "Context"; + } + function getComponentNameFromType(type) { + if (type == null) { + return null; + } + { + if (typeof type.tag === "number") { + error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); + } + } + if (typeof type === "function") { + return type.displayName || type.name || null; + } + if (typeof type === "string") { + return type; + } + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + var context = type; + return getContextName(context) + ".Consumer"; + case REACT_PROVIDER_TYPE: + var provider = type; + return getContextName(provider._context) + ".Provider"; + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, "ForwardRef"); + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + if (outerName !== null) { + return outerName; + } + return getComponentNameFromType(type.type) || "Memo"; + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + } + } + return null; + } + var assign = Object.assign; + var disabledDepth = 0; + var prevLog; + var prevInfo; + var prevWarn; + var prevError; + var prevGroup; + var prevGroupCollapsed; + var prevGroupEnd; + function disabledLog() { + } + disabledLog.__reactDisabledLog = true; + function disableLogs() { + { + if (disabledDepth === 0) { + prevLog = console.log; + prevInfo = console.info; + prevWarn = console.warn; + prevError = console.error; + prevGroup = console.group; + prevGroupCollapsed = console.groupCollapsed; + prevGroupEnd = console.groupEnd; + var props = { + configurable: true, + enumerable: true, + value: disabledLog, + writable: true + }; + Object.defineProperties(console, { + info: props, + log: props, + warn: props, + error: props, + group: props, + groupCollapsed: props, + groupEnd: props + }); + } + disabledDepth++; + } + } + function reenableLogs() { + { + disabledDepth--; + if (disabledDepth === 0) { + var props = { + configurable: true, + enumerable: true, + writable: true + }; + Object.defineProperties(console, { + log: assign({}, props, { + value: prevLog + }), + info: assign({}, props, { + value: prevInfo + }), + warn: assign({}, props, { + value: prevWarn + }), + error: assign({}, props, { + value: prevError + }), + group: assign({}, props, { + value: prevGroup + }), + groupCollapsed: assign({}, props, { + value: prevGroupCollapsed + }), + groupEnd: assign({}, props, { + value: prevGroupEnd + }) + }); + } + if (disabledDepth < 0) { + error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + } + } + } + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + var prefix; + function describeBuiltInComponentFrame(name, source, ownerFn) { + { + if (prefix === undefined) { + try { + throw Error(); + } catch (x) { + var match = x.stack.trim().match(/\n( *(at )?)/); + prefix = match && match[1] || ""; + } + } + return "\n" + prefix + name; + } + } + var reentry = false; + var componentFrameCache; + { + var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; + componentFrameCache = new PossiblyWeakMap; + } + function describeNativeComponentFrame(fn, construct) { + if (!fn || reentry) { + return ""; + } + { + var frame2 = componentFrameCache.get(fn); + if (frame2 !== undefined) { + return frame2; + } + } + var control; + reentry = true; + var previousPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = undefined; + var previousDispatcher; + { + previousDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = null; + disableLogs(); + } + try { + if (construct) { + var Fake = function() { + throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function() { + throw Error(); + } + }); + if (typeof Reflect === "object" && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x) { + control = x; + } + fn.call(Fake.prototype); + } + } else { + try { + throw Error(); + } catch (x) { + control = x; + } + fn(); + } + } catch (sample) { + if (sample && control && typeof sample.stack === "string") { + var sampleLines = sample.stack.split("\n"); + var controlLines = control.stack.split("\n"); + var s = sampleLines.length - 1; + var c = controlLines.length - 1; + while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { + c--; + } + for (;s >= 1 && c >= 0; s--, c--) { + if (sampleLines[s] !== controlLines[c]) { + if (s !== 1 || c !== 1) { + do { + s--; + c--; + if (c < 0 || sampleLines[s] !== controlLines[c]) { + var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); + if (fn.displayName && _frame.includes("")) { + _frame = _frame.replace("", fn.displayName); + } + { + if (typeof fn === "function") { + componentFrameCache.set(fn, _frame); + } + } + return _frame; + } + } while (s >= 1 && c >= 0); + } + break; + } + } + } + } finally { + reentry = false; + { + ReactCurrentDispatcher.current = previousDispatcher; + reenableLogs(); + } + Error.prepareStackTrace = previousPrepareStackTrace; + } + var name = fn ? fn.displayName || fn.name : ""; + var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; + { + if (typeof fn === "function") { + componentFrameCache.set(fn, syntheticFrame); + } + } + return syntheticFrame; + } + function describeFunctionComponentFrame(fn, source, ownerFn) { + { + return describeNativeComponentFrame(fn, false); + } + } + function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); + } + function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { + if (type == null) { + return ""; + } + if (typeof type === "function") { + { + return describeNativeComponentFrame(type, shouldConstruct(type)); + } + } + if (typeof type === "string") { + return describeBuiltInComponentFrame(type); + } + switch (type) { + case REACT_SUSPENSE_TYPE: + return describeBuiltInComponentFrame("Suspense"); + case REACT_SUSPENSE_LIST_TYPE: + return describeBuiltInComponentFrame("SuspenseList"); + } + if (typeof type === "object") { + switch (type.$$typeof) { + case REACT_FORWARD_REF_TYPE: + return describeFunctionComponentFrame(type.render); + case REACT_MEMO_TYPE: + return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + try { + return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); + } catch (x) { + } + } + } + } + return ""; + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + var loggedTypeFailures = {}; + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement(element) { + { + if (element) { + var owner = element._owner; + var stack2 = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame.setExtraStackFrame(stack2); + } else { + ReactDebugCurrentFrame.setExtraStackFrame(null); + } + } + } + function checkPropTypes(typeSpecs, values, location, componentName, element) { + { + var has = Function.call.bind(hasOwnProperty); + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error$1 = undefined; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); + err.name = "Invariant Violation"; + throw err; + } + error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); + } catch (ex) { + error$1 = ex; + } + if (error$1 && !(error$1 instanceof Error)) { + setCurrentlyValidatingElement(element); + error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); + setCurrentlyValidatingElement(null); + } + if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { + loggedTypeFailures[error$1.message] = true; + setCurrentlyValidatingElement(element); + error("Failed %s type: %s", location, error$1.message); + setCurrentlyValidatingElement(null); + } + } + } + } + } + var isArrayImpl = Array.isArray; + function isArray(a) { + return isArrayImpl(a); + } + function typeName(value5) { + { + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = hasToStringTag && value5[Symbol.toStringTag] || value5.constructor.name || "Object"; + return type; + } + } + function willCoercionThrow(value5) { + { + try { + testStringCoercion(value5); + return false; + } catch (e) { + return true; + } + } + } + function testStringCoercion(value5) { + return "" + value5; + } + function checkKeyStringCoercion(value5) { + { + if (willCoercionThrow(value5)) { + error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value5)); + return testStringCoercion(value5); + } + } + } + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + var specialPropKeyWarningShown; + var specialPropRefWarningShown; + var didWarnAboutStringRefs; + { + didWarnAboutStringRefs = {}; + } + function hasValidRef(config) { + { + if (hasOwnProperty.call(config, "ref")) { + var getter = Object.getOwnPropertyDescriptor(config, "ref").get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; + } + function hasValidKey(config) { + { + if (hasOwnProperty.call(config, "key")) { + var getter = Object.getOwnPropertyDescriptor(config, "key").get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; + } + function warnIfStringRefCannotBeAutoConverted(config, self) { + { + if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { + var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); + didWarnAboutStringRefs[componentName] = true; + } + } + } + } + function defineKeyPropWarningGetter(props, displayName) { + { + var warnAboutAccessingKey = function() { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, "key", { + get: warnAboutAccessingKey, + configurable: true + }); + } + } + function defineRefPropWarningGetter(props, displayName) { + { + var warnAboutAccessingRef = function() { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, "ref", { + get: warnAboutAccessingRef, + configurable: true + }); + } + } + var ReactElement = function(type, key, ref, self, source, owner, props) { + var element = { + $$typeof: REACT_ELEMENT_TYPE, + type, + key, + ref, + props, + _owner: owner + }; + { + element._store = {}; + Object.defineProperty(element._store, "validated", { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + Object.defineProperty(element, "_self", { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + Object.defineProperty(element, "_source", { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + return element; + }; + function jsxDEV(type, config, maybeKey, source, self) { + { + var propName; + var props = {}; + var key = null; + var ref = null; + if (maybeKey !== undefined) { + { + checkKeyStringCoercion(maybeKey); + } + key = "" + maybeKey; + } + if (hasValidKey(config)) { + { + checkKeyStringCoercion(config.key); + } + key = "" + config.key; + } + if (hasValidRef(config)) { + ref = config.ref; + warnIfStringRefCannotBeAutoConverted(config, self); + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + if (key || ref) { + var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + } + } + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; + var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + function setCurrentlyValidatingElement$1(element) { + { + if (element) { + var owner = element._owner; + var stack2 = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); + ReactDebugCurrentFrame$1.setExtraStackFrame(stack2); + } else { + ReactDebugCurrentFrame$1.setExtraStackFrame(null); + } + } + } + var propTypesMisspellWarningShown; + { + propTypesMisspellWarningShown = false; + } + function isValidElement(object) { + { + return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + } + function getDeclarationErrorAddendum() { + { + if (ReactCurrentOwner$1.current) { + var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); + if (name) { + return "\n\nCheck the render method of `" + name + "`."; + } + } + return ""; + } + } + function getSourceInfoErrorAddendum(source) { + { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ""); + var lineNumber = source.lineNumber; + return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; + } + return ""; + } + } + var ownerHasKeyUseWarning = {}; + function getCurrentComponentErrorInfo(parentType) { + { + var info = getDeclarationErrorAddendum(); + if (!info) { + var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = "\n\nCheck the top-level render call using <" + parentName + ">."; + } + } + return info; + } + } + function validateExplicitKey(element, parentType) { + { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + var childOwner = ""; + if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { + childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; + } + setCurrentlyValidatingElement$1(element); + error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); + setCurrentlyValidatingElement$1(null); + } + } + function validateChildKeys(node, parentType) { + { + if (typeof node !== "object") { + return; + } + if (isArray(node)) { + for (var i = 0;i < node.length; i++) { + var child = node[i]; + if (isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (isValidElement(node)) { + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === "function") { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } + } + } + function validatePropTypes(element) { + { + var type = element.type; + if (type === null || type === undefined || typeof type === "string") { + return; + } + var propTypes; + if (typeof type === "function") { + propTypes = type.propTypes; + } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; + } else { + return; + } + if (propTypes) { + var name = getComponentNameFromType(type); + checkPropTypes(propTypes, element.props, "prop", name, element); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + var _name = getComponentNameFromType(type); + error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); + } + if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { + error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); + } + } + } + function validateFragmentProps(fragment) { + { + var keys = Object.keys(fragment.props); + for (var i = 0;i < keys.length; i++) { + var key = keys[i]; + if (key !== "children" && key !== "key") { + setCurrentlyValidatingElement$1(fragment); + error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); + setCurrentlyValidatingElement$1(null); + break; + } + } + if (fragment.ref !== null) { + setCurrentlyValidatingElement$1(fragment); + error("Invalid attribute `ref` supplied to `React.Fragment`."); + setCurrentlyValidatingElement$1(null); + } + } + } + function jsxWithValidation(type, props, key, isStaticChildren, source, self) { + { + var validType = isValidElementType(type); + if (!validType) { + var info = ""; + if (type === undefined || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; + } + var sourceInfo = getSourceInfoErrorAddendum(source); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + var typeString; + if (type === null) { + typeString = "null"; + } else if (isArray(type)) { + typeString = "array"; + } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; + info = " Did you accidentally export a JSX literal instead of a component?"; + } else { + typeString = typeof type; + } + error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); + } + var element = jsxDEV(type, props, key, source, self); + if (element == null) { + return element; + } + if (validType) { + var children = props.children; + if (children !== undefined) { + if (isStaticChildren) { + if (isArray(children)) { + for (var i = 0;i < children.length; i++) { + validateChildKeys(children[i], type); + } + if (Object.freeze) { + Object.freeze(children); + } + } else { + error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); + } + } else { + validateChildKeys(children, type); + } + } + } + if (type === REACT_FRAGMENT_TYPE) { + validateFragmentProps(element); + } else { + validatePropTypes(element); + } + return element; + } + } + function jsxWithValidationStatic(type, props, key) { + { + return jsxWithValidation(type, props, key, true); + } + } + function jsxWithValidationDynamic(type, props, key) { + { + return jsxWithValidation(type, props, key, false); + } + } + var jsx = jsxWithValidationDynamic; + var jsxs = jsxWithValidationStatic; + $Fragment2 = REACT_FRAGMENT_TYPE; + $jsx = jsx; + $jsxs = jsxs; + })(); + } +}); + +// node_modules/react/jsx-runtime.js +var require_jsx_runtime = __commonJS((exports, module) => { + init_react_jsx_runtime_development(); + if (false) { + } else { + module.exports = (exports_react_jsx_runtime_development); + } +}); + +// src/FPContainer.tsx +var import_react19 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/motion/index.mjs +var React = __toESM(require_react()); +var import_react11 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs +var import_react = __toESM(require_react()); +var MotionConfigContext = import_react.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never" +}); + +// node_modules/framer-motion/dist/es/context/MotionContext/index.mjs +var import_react2 = __toESM(require_react()); +var MotionContext = import_react2.createContext({}); + +// node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs +var import_react6 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/context/PresenceContext.mjs +var import_react3 = __toESM(require_react()); +var PresenceContext = import_react3.createContext(null); + +// node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +var import_react4 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/utils/is-browser.mjs +var isBrowser = typeof document !== "undefined"; + +// node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs +var useIsomorphicLayoutEffect = isBrowser ? import_react4.useLayoutEffect : import_react4.useEffect; + +// node_modules/framer-motion/dist/es/context/LazyContext.mjs +var import_react5 = __toESM(require_react()); +var LazyContext = import_react5.createContext({ strict: false }); + +// node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs +var useVisualElement = function(Component, visualState, props, createVisualElement) { + const { visualElement: parent } = import_react6.useContext(MotionContext); + const lazyContext = import_react6.useContext(LazyContext); + const presenceContext = import_react6.useContext(PresenceContext); + const reducedMotionConfig = import_react6.useContext(MotionConfigContext).reducedMotion; + const visualElementRef = import_react6.useRef(); + createVisualElement = createVisualElement || lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext ? presenceContext.initial === false : false, + reducedMotionConfig + }); + } + const visualElement = visualElementRef.current; + import_react6.useInsertionEffect(() => { + visualElement && visualElement.update(props, presenceContext); + }); + useIsomorphicLayoutEffect(() => { + visualElement && visualElement.render(); + }); + import_react6.useEffect(() => { + visualElement && visualElement.updateFeatures(); + }); + const useAnimateChangesEffect = window.HandoffAppearAnimations ? useIsomorphicLayoutEffect : import_react6.useEffect; + useAnimateChangesEffect(() => { + if (visualElement && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + return visualElement; +}; + +// node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +var import_react7 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/utils/is-ref-object.mjs +var isRefObject = function(ref) { + return typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); +}; + +// node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +var useMotionRef = function(visualState, visualElement, externalRef) { + return import_react7.useCallback((instance) => { + instance && visualState.mount && visualState.mount(instance); + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + if (externalRef) { + if (typeof externalRef === "function") { + externalRef(instance); + } else if (isRefObject(externalRef)) { + externalRef.current = instance; + } + } + }, [visualElement]); +}; + +// node_modules/framer-motion/dist/es/context/MotionContext/create.mjs +var import_react8 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs +var isVariantLabel = function(v) { + return typeof v === "string" || Array.isArray(v); +}; + +// node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs +var isAnimationControls = function(v) { + return typeof v === "object" && typeof v.start === "function"; +}; + +// node_modules/framer-motion/dist/es/render/utils/variant-props.mjs +var variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit" +]; +var variantProps = ["initial", ...variantPriorityOrder]; + +// node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs +var isControllingVariants = function(props) { + return isAnimationControls(props.animate) || variantProps.some((name) => isVariantLabel(props[name])); +}; +var isVariantNode = function(props) { + return Boolean(isControllingVariants(props) || props.variants); +}; + +// node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs +var getCurrentTreeVariants = function(props, context) { + if (isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || isVariantLabel(initial) ? initial : undefined, + animate: isVariantLabel(animate) ? animate : undefined + }; + } + return props.inherit !== false ? context : {}; +}; + +// node_modules/framer-motion/dist/es/context/MotionContext/create.mjs +var useCreateMotionContext = function(props) { + const { initial, animate } = getCurrentTreeVariants(props, import_react8.useContext(MotionContext)); + return import_react8.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +}; +var variantLabelsAsDependency = function(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +}; + +// node_modules/framer-motion/dist/es/motion/features/definitions.mjs +var featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag" + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"] +}; +var featureDefinitions = {}; +for (const key in featureProps) { + featureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]) + }; +} + +// node_modules/framer-motion/dist/es/motion/features/load-features.mjs +var loadFeatures = function(features) { + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key] + }; + } +}; + +// node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs +var import_react9 = __toESM(require_react()); +var LayoutGroupContext = import_react9.createContext({}); + +// node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs +var import_react10 = __toESM(require_react()); +var SwitchLayoutGroupContext = import_react10.createContext({}); + +// node_modules/framer-motion/dist/es/motion/utils/symbol.mjs +var motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +// node_modules/framer-motion/dist/es/motion/index.mjs +var createMotionComponent = function({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component }) { + preloadedFeatures && loadFeatures(preloadedFeatures); + function MotionComponent(props, externalRef) { + let MeasureLayout; + const configAndProps = { + ...import_react11.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props) + }; + const { isStatic } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && isBrowser) { + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement); + const initialLayoutGroupConfig = import_react11.useContext(SwitchLayoutGroupContext); + const isStrict = import_react11.useContext(LazyContext).strict; + if (context.visualElement) { + MeasureLayout = context.visualElement.loadFeatures(configAndProps, isStrict, preloadedFeatures, initialLayoutGroupConfig); + } + } + return React.createElement(MotionContext.Provider, { value: context }, MeasureLayout && context.visualElement ? React.createElement(MeasureLayout, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)); + } + const ForwardRefComponent = import_react11.forwardRef(MotionComponent); + ForwardRefComponent[motionComponentSymbol] = Component; + return ForwardRefComponent; +}; +var useLayoutId = function({ layoutId }) { + const layoutGroupId = import_react11.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId; +}; + +// node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs +var createMotionProxy = function(createConfig) { + function custom(Component, customMotionComponentConfig = {}) { + return createMotionComponent(createConfig(Component, customMotionComponentConfig)); + } + if (typeof Proxy === "undefined") { + return custom; + } + const componentCache = new Map; + return new Proxy(custom, { + get: (_target, key) => { + if (!componentCache.has(key)) { + componentCache.set(key, custom(key)); + } + return componentCache.get(key); + } + }); +}; + +// node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs +var lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view" +]; + +// node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs +var isSVGComponent = function(Component) { + if (typeof Component !== "string" || Component.includes("-")) { + return false; + } else if (lowercaseSVGElements.indexOf(Component) > -1 || /[A-Z]/.test(Component)) { + return true; + } + return false; +}; + +// node_modules/framer-motion/dist/es/render/dom/use-render.mjs +var import_react14 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/render/html/use-props.mjs +var import_react12 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs +var addScaleCorrector = function(correctors) { + Object.assign(scaleCorrectors, correctors); +}; +var scaleCorrectors = {}; + +// node_modules/framer-motion/dist/es/render/html/utils/transform.mjs +var transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY" +]; +var transformProps = new Set(transformPropOrder); + +// node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs +var isForcedMotionValue = function(key, { layout, layoutId }) { + return transformProps.has(key) || key.startsWith("origin") || (layout || layoutId !== undefined) && (!!scaleCorrectors[key] || key === "opacity"); +}; + +// node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs +var isMotionValue = (value) => Boolean(value && value.getVelocity); + +// node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs +var buildTransform = function(transform3, { enableHardwareAcceleration = true, allowTransformNone = true }, transformIsDefault, transformTemplate) { + let transformString = ""; + for (let i = 0;i < numTransforms; i++) { + const key = transformPropOrder[i]; + if (transform3[key] !== undefined) { + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${transform3[key]}) `; + } + } + if (enableHardwareAcceleration && !transform3.z) { + transformString += "translateZ(0)"; + } + transformString = transformString.trim(); + if (transformTemplate) { + transformString = transformTemplate(transform3, transformIsDefault ? "" : transformString); + } else if (allowTransformNone && transformIsDefault) { + transformString = "none"; + } + return transformString; +}; +var translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective" +}; +var numTransforms = transformPropOrder.length; + +// node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs +var checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); +var isCSSVariableName = checkStringStartsWith("--"); +var isCSSVariableToken = checkStringStartsWith("var(--"); +var cssVariableRegex = /var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g; + +// node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs +var getValueAsType = (value, type) => { + return type && typeof value === "number" ? type.transform(value) : value; +}; + +// node_modules/framer-motion/dist/es/utils/clamp.mjs +var clamp = (min, max, v) => Math.min(Math.max(v, min), max); + +// node_modules/framer-motion/dist/es/value/types/numbers/index.mjs +var number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v +}; +var alpha = { + ...number, + transform: (v) => clamp(0, 1, v) +}; +var scale = { + ...number, + default: 1 +}; + +// node_modules/framer-motion/dist/es/value/types/utils.mjs +var isString = function(v) { + return typeof v === "string"; +}; +var sanitize = (v) => Math.round(v * 1e5) / 1e5; +var floatRegex = /(-)?([\d]*\.?[\d])+/g; +var colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi; +var singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i; + +// node_modules/framer-motion/dist/es/value/types/numbers/units.mjs +var createUnitType = (unit) => ({ + test: (v) => isString(v) && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}` +}); +var degrees = createUnitType("deg"); +var percent = createUnitType("%"); +var px = createUnitType("px"); +var vh = createUnitType("vh"); +var vw = createUnitType("vw"); +var progressPercentage = { + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100) +}; + +// node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs +var int = { + ...number, + transform: Math.round +}; + +// node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs +var numberValueTypes = { + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + radius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + width: px, + maxWidth: px, + height: px, + maxHeight: px, + size: px, + top: px, + right: px, + bottom: px, + left: px, + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + rotate: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + zIndex: int, + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int +}; + +// node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs +var buildHTMLStyles = function(state, latestValues, options, transformTemplate) { + const { style, vars, transform: transform4, transformOrigin } = state; + let hasTransform = false; + let hasTransformOrigin = false; + let transformIsNone = true; + for (const key in latestValues) { + const value = latestValues[key]; + if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + const valueType = numberValueTypes[key]; + const valueAsType = getValueAsType(value, valueType); + if (transformProps.has(key)) { + hasTransform = true; + transform4[key] = valueAsType; + if (!transformIsNone) + continue; + if (value !== (valueType.default || 0)) + transformIsNone = false; + } else if (key.startsWith("origin")) { + hasTransformOrigin = true; + transformOrigin[key] = valueAsType; + } else { + style[key] = valueAsType; + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(state.transform, options, transformIsNone, transformTemplate); + } else if (style.transform) { + style.transform = "none"; + } + } + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0 } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } +}; + +// node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs +var createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {} +}); + +// node_modules/framer-motion/dist/es/render/html/use-props.mjs +var copyRawValuesOnly = function(target, source, props) { + for (const key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +}; +var useInitialMotionValues = function({ transformTemplate }, visualState, isStatic) { + return import_react12.useMemo(() => { + const state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +}; +var useStyle = function(props, visualState, isStatic) { + const styleProp = props.style || {}; + const style = {}; + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); + return props.transformValues ? props.transformValues(style) : style; +}; +var useHTMLProps = function(props, visualState, isStatic) { + const htmlProps = {}; + const style = useStyle(props, visualState, isStatic); + if (props.drag && props.dragListener !== false) { + htmlProps.draggable = false; + style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; + style.touchAction = props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +}; + +// node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs +var isValidMotionProp = function(key) { + return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || validMotionProps.has(key); +}; +var validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "transformValues", + "custom", + "inherit", + "onLayoutAnimationStart", + "onLayoutAnimationComplete", + "onLayoutMeasure", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "ignoreStrict", + "viewport" +]); + +// node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs +var loadExternalIsValidProp = function(isValidProp) { + if (!isValidProp) + return; + shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); +}; +var filterProps = function(props, isDom, forwardMotionProps) { + const filteredProps = {}; + for (const key in props) { + if (key === "values" && typeof props.values === "object") + continue; + if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || props["draggable"] && key.startsWith("onDrag")) { + filteredProps[key] = props[key]; + } + } + return filteredProps; +}; +var shouldForward = (key) => !isValidMotionProp(key); +try { + loadExternalIsValidProp(require_is_prop_valid_browser_cjs().default); +} catch (_a) { +} + +// node_modules/framer-motion/dist/es/render/svg/use-props.mjs +var import_react13 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs +var calcOrigin = function(origin, offset, size) { + return typeof origin === "string" ? origin : px.transform(offset + size * origin); +}; +var calcSVGTransformOrigin = function(dimensions, originX, originY) { + const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width); + const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height); + return `${pxOriginX} ${pxOriginY}`; +}; + +// node_modules/framer-motion/dist/es/render/svg/utils/path.mjs +var buildSVGPath = function(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + attrs.pathLength = 1; + const keys = useDashCase ? dashKeys : camelKeys; + attrs[keys.offset] = px.transform(-offset); + const pathLength = px.transform(length); + const pathSpacing = px.transform(spacing); + attrs[keys.array] = `${pathLength} ${pathSpacing}`; +}; +var dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray" +}; +var camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray" +}; + +// node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs +var buildSVGAttrs = function(state, { + attrX, + attrY, + attrScale, + originX, + originY, + pathLength, + pathSpacing = 1, + pathOffset = 0, + ...latest +}, options, isSVGTag, transformTemplate) { + buildHTMLStyles(state, latest, options, transformTemplate); + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style, dimensions } = state; + if (attrs.transform) { + if (dimensions) + style.transform = attrs.transform; + delete attrs.transform; + } + if (dimensions && (originX !== undefined || originY !== undefined || style.transform)) { + style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); + } + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +}; + +// node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs +var createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {} +}); + +// node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs +var isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + +// node_modules/framer-motion/dist/es/render/svg/use-props.mjs +var useSVGProps = function(props, visualState, _isStatic, Component) { + const visualProps = import_react13.useMemo(() => { + const state = createSvgRenderState(); + buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component), props.transformTemplate); + return { + ...state.attrs, + style: { ...state.style } + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +}; + +// node_modules/framer-motion/dist/es/render/dom/use-render.mjs +var createUseRender = function(forwardMotionProps = false) { + const useRender = (Component, props, ref, { latestValues }, isStatic) => { + const useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + const elementProps = { + ...filteredProps, + ...visualProps, + ref + }; + const { children } = props; + const renderedChildren = import_react14.useMemo(() => isMotionValue(children) ? children.get() : children, [children]); + return import_react14.createElement(Component, { + ...elementProps, + children: renderedChildren + }); + }; + return useRender; +}; + +// node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs +var camelToDash = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); + +// node_modules/framer-motion/dist/es/render/html/utils/render.mjs +var renderHTML = function(element, { style, vars }, styleProp, projection) { + Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); + for (const key in vars) { + element.style.setProperty(key, vars[key]); + } +}; + +// node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs +var camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust" +]); + +// node_modules/framer-motion/dist/es/render/svg/utils/render.mjs +var renderSVG = function(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +}; + +// node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs +var scrapeMotionValuesFromProps = function(props, prevProps) { + const { style } = props; + const newValues = {}; + for (const key in style) { + if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props)) { + newValues[key] = style[key]; + } + } + return newValues; +}; + +// node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs +var scrapeMotionValuesFromProps2 = function(props, prevProps) { + const newValues = scrapeMotionValuesFromProps(props, prevProps); + for (const key in props) { + if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +}; + +// node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs +var import_react16 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs +var resolveVariantFromProps = function(props, definition, custom, currentValues = {}, currentVelocity = {}) { + if (typeof definition === "function") { + definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity); + } + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + if (typeof definition === "function") { + definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity); + } + return definition; +}; + +// node_modules/framer-motion/dist/es/utils/use-constant.mjs +var import_react15 = __toESM(require_react()); +var useConstant = function(init) { + const ref = import_react15.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +}; + +// node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs +var isKeyframesTarget = (v) => { + return Array.isArray(v); +}; + +// node_modules/framer-motion/dist/es/utils/resolve-value.mjs +var isCustomValue = (v) => { + return Boolean(v && typeof v === "object" && v.mix && v.toValue); +}; +var resolveFinalValueInKeyframes = (v) => { + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +}; + +// node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs +var resolveMotionValue = function(value) { + const unwrappedValue = isMotionValue(value) ? value.get() : value; + return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; +}; + +// node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs +var makeState = function({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps3, createRenderState, onMount }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps3), + renderState: createRenderState() + }; + if (onMount) { + state.mount = (instance) => onMount(props, instance, state); + } + return state; +}; +var makeLatestValues = function(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants$1 = isControllingVariants(props); + const isVariantNode$1 = isVariantNode(props); + if (context && isVariantNode$1 && !isControllingVariants$1 && props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === false : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + list.forEach((definition) => { + const resolved = resolveVariantFromProps(props, definition); + if (!resolved) + return; + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + const index = isInitialAnimationBlocked ? valueTarget.length - 1 : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) + values[key] = transitionEnd[key]; + }); + } + return values; +}; +var makeUseVisualState = (config) => (props, isStatic) => { + const context = import_react16.useContext(MotionContext); + const presenceContext = import_react16.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +// node_modules/framer-motion/dist/es/render/svg/config-motion.mjs +var svgMotionConfig = { + useVisualState: makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, + createRenderState: createSvgRenderState, + onMount: (props, instance, { renderState, latestValues }) => { + try { + renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect(); + } catch (e) { + renderState.dimensions = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, isSVGTag(instance.tagName), props.transformTemplate); + renderSVG(instance, renderState); + } + }) +}; + +// node_modules/framer-motion/dist/es/render/html/config-motion.mjs +var htmlMotionConfig = { + useVisualState: makeUseVisualState({ + scrapeMotionValuesFromProps, + createRenderState: createHtmlRenderState + }) +}; + +// node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs +var createDomMotionConfig = function(Component, { forwardMotionProps = false }, preloadedFeatures, createVisualElement) { + const baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; + return { + ...baseConfig, + preloadedFeatures, + useRender: createUseRender(forwardMotionProps), + createVisualElement, + Component + }; +}; + +// node_modules/framer-motion/dist/es/events/add-dom-event.mjs +var addDomEvent = function(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler); +}; + +// node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs +var isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } else { + return event.isPrimary !== false; + } +}; + +// node_modules/framer-motion/dist/es/events/event-info.mjs +var extractEventInfo = function(event, pointType = "page") { + return { + point: { + x: event[pointType + "X"], + y: event[pointType + "Y"] + } + }; +}; +var addPointerInfo = (handler) => { + return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); +}; + +// node_modules/framer-motion/dist/es/events/add-pointer-event.mjs +var addPointerEvent = function(target, eventName, handler, options) { + return addDomEvent(target, eventName, addPointerInfo(handler), options); +}; + +// node_modules/framer-motion/dist/es/utils/pipe.mjs +var combineFunctions = (a, b) => (v) => b(a(v)); +var pipe = (...transformers) => transformers.reduce(combineFunctions); + +// node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs +var createLock = function(name) { + let lock = null; + return () => { + const openLock = () => { + lock = null; + }; + if (lock === null) { + lock = name; + return openLock; + } + return false; + }; +}; +var getGlobalLock = function(drag) { + let lock = false; + if (drag === "y") { + lock = globalVerticalLock(); + } else if (drag === "x") { + lock = globalHorizontalLock(); + } else { + const openHorizontal = globalHorizontalLock(); + const openVertical = globalVerticalLock(); + if (openHorizontal && openVertical) { + lock = () => { + openHorizontal(); + openVertical(); + }; + } else { + if (openHorizontal) + openHorizontal(); + if (openVertical) + openVertical(); + } + } + return lock; +}; +var isDragActive = function() { + const openGestureLock = getGlobalLock(true); + if (!openGestureLock) + return true; + openGestureLock(); + return false; +}; +var globalHorizontalLock = createLock("dragHorizontal"); +var globalVerticalLock = createLock("dragVertical"); + +// node_modules/framer-motion/dist/es/motion/features/Feature.mjs +class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { + } +} + +// node_modules/framer-motion/dist/es/frameloop/create-render-step.mjs +var createRenderStep = function(runNextFrame) { + let toRun = []; + let toRunNextFrame = []; + let numToRun = 0; + let isProcessing = false; + let flushNextFrame = false; + const toKeepAlive = new WeakSet; + const step = { + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const buffer = addToCurrentFrame ? toRun : toRunNextFrame; + if (keepAlive) + toKeepAlive.add(callback); + if (buffer.indexOf(callback) === -1) { + buffer.push(callback); + if (addToCurrentFrame && isProcessing) + numToRun = toRun.length; + } + return callback; + }, + cancel: (callback) => { + const index = toRunNextFrame.indexOf(callback); + if (index !== -1) + toRunNextFrame.splice(index, 1); + toKeepAlive.delete(callback); + }, + process: (frameData) => { + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [toRun, toRunNextFrame] = [toRunNextFrame, toRun]; + toRunNextFrame.length = 0; + numToRun = toRun.length; + if (numToRun) { + for (let i = 0;i < numToRun; i++) { + const callback = toRun[i]; + callback(frameData); + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + } + } + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + } + }; + return step; +}; + +// node_modules/framer-motion/dist/es/frameloop/data.mjs +var frameData = { + delta: 0, + timestamp: 0, + isProcessing: false +}; + +// node_modules/framer-motion/dist/es/frameloop/index.mjs +var cancelFrame = function(process) { + stepsOrder.forEach((key) => steps[key].cancel(process)); +}; +var maxElapsed = 40; +var useDefaultElapsed = true; +var runNextFrame = false; +var stepsOrder = [ + "read", + "update", + "preRender", + "render", + "postRender" +]; +var steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(() => runNextFrame = true); + return acc; +}, {}); +var processStep = (stepId) => steps[stepId].process(frameData); +var processFrame = (timestamp) => { + runNextFrame = false; + frameData.delta = useDefaultElapsed ? 1000 / 60 : Math.max(Math.min(timestamp - frameData.timestamp, maxElapsed), 1); + frameData.timestamp = timestamp; + frameData.isProcessing = true; + stepsOrder.forEach(processStep); + frameData.isProcessing = false; + if (runNextFrame) { + useDefaultElapsed = false; + requestAnimationFrame(processFrame); + } +}; +var startLoop = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!frameData.isProcessing) + requestAnimationFrame(processFrame); +}; +var frame = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + startLoop(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; +}, {}); + +// node_modules/framer-motion/dist/es/gestures/hover.mjs +var addHoverEvent = function(node, isActive) { + const eventName = "pointer" + (isActive ? "enter" : "leave"); + const callbackName = "onHover" + (isActive ? "Start" : "End"); + const handleEvent = (event, info) => { + if (event.type === "touch" || isDragActive()) + return; + const props = node.getProps(); + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", isActive); + } + if (props[callbackName]) { + frame.update(() => props[callbackName](event, info)); + } + }; + return addPointerEvent(node.current, eventName, handleEvent, { + passive: !node.getProps()[callbackName] + }); +}; + +class HoverGesture extends Feature { + mount() { + this.unmount = pipe(addHoverEvent(this.node, true), addHoverEvent(this.node, false)); + } + unmount() { + } +} + +// node_modules/framer-motion/dist/es/gestures/focus.mjs +class FocusGesture extends Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { + } +} + +// node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs +var isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } else if (parent === child) { + return true; + } else { + return isNodeOrChild(parent, child.parentElement); + } +}; + +// node_modules/framer-motion/dist/es/utils/noop.mjs +var noop = (any) => any; + +// node_modules/framer-motion/dist/es/gestures/press.mjs +var fireSyntheticPointerEvent = function(name, handler) { + if (!handler) + return; + const syntheticPointerEvent = new PointerEvent("pointer" + name); + handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent)); +}; + +class PressGesture extends Feature { + constructor() { + super(...arguments); + this.removeStartListeners = noop; + this.removeEndListeners = noop; + this.removeAccessibleListeners = noop; + this.startPointerPress = (startEvent, startInfo) => { + this.removeEndListeners(); + if (this.isPressing) + return; + const props = this.node.getProps(); + const endPointerPress = (endEvent, endInfo) => { + if (!this.checkPressEnd()) + return; + const { onTap, onTapCancel } = this.node.getProps(); + frame.update(() => { + !isNodeOrChild(this.node.current, endEvent.target) ? onTapCancel && onTapCancel(endEvent, endInfo) : onTap && onTap(endEvent, endInfo); + }); + }; + const removePointerUpListener = addPointerEvent(window, "pointerup", endPointerPress, { passive: !(props.onTap || props["onPointerUp"]) }); + const removePointerCancelListener = addPointerEvent(window, "pointercancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), { passive: !(props.onTapCancel || props["onPointerCancel"]) }); + this.removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener); + this.startPress(startEvent, startInfo); + }; + this.startAccessiblePress = () => { + const handleKeydown = (keydownEvent) => { + if (keydownEvent.key !== "Enter" || this.isPressing) + return; + const handleKeyup = (keyupEvent) => { + if (keyupEvent.key !== "Enter" || !this.checkPressEnd()) + return; + fireSyntheticPointerEvent("up", (event, info) => { + const { onTap } = this.node.getProps(); + if (onTap) { + frame.update(() => onTap(event, info)); + } + }); + }; + this.removeEndListeners(); + this.removeEndListeners = addDomEvent(this.node.current, "keyup", handleKeyup); + fireSyntheticPointerEvent("down", (event, info) => { + this.startPress(event, info); + }); + }; + const removeKeydownListener = addDomEvent(this.node.current, "keydown", handleKeydown); + const handleBlur = () => { + if (!this.isPressing) + return; + fireSyntheticPointerEvent("cancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo)); + }; + const removeBlurListener = addDomEvent(this.node.current, "blur", handleBlur); + this.removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener); + }; + } + startPress(event, info) { + this.isPressing = true; + const { onTapStart, whileTap } = this.node.getProps(); + if (whileTap && this.node.animationState) { + this.node.animationState.setActive("whileTap", true); + } + if (onTapStart) { + frame.update(() => onTapStart(event, info)); + } + } + checkPressEnd() { + this.removeEndListeners(); + this.isPressing = false; + const props = this.node.getProps(); + if (props.whileTap && this.node.animationState) { + this.node.animationState.setActive("whileTap", false); + } + return !isDragActive(); + } + cancelPress(event, info) { + if (!this.checkPressEnd()) + return; + const { onTapCancel } = this.node.getProps(); + if (onTapCancel) { + frame.update(() => onTapCancel(event, info)); + } + } + mount() { + const props = this.node.getProps(); + const removePointerListener = addPointerEvent(this.node.current, "pointerdown", this.startPointerPress, { passive: !(props.onTapStart || props["onPointerStart"]) }); + const removeFocusListener = addDomEvent(this.node.current, "focus", this.startAccessiblePress); + this.removeStartListeners = pipe(removePointerListener, removeFocusListener); + } + unmount() { + this.removeStartListeners(); + this.removeEndListeners(); + this.removeAccessibleListeners(); + } +} + +// node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs +var initIntersectionObserver = function({ root, ...options }) { + const lookupRoot = root || document; + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; +}; +var observeIntersection = function(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +}; +var observerCallbacks = new WeakMap; +var observers = new WeakMap; +var fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); +}; +var fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); +}; + +// node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs +var hasViewportOptionChanged = function({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; +}; +var thresholdNames = { + some: 0, + all: 1 +}; + +class InViewFeature extends Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.unmount(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount] + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + if (once && !isIntersecting && this.hasEnteredView) { + return; + } else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + return observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { + } +} + +// node_modules/framer-motion/dist/es/motion/features/gestures.mjs +var gestureAnimations = { + inView: { + Feature: InViewFeature + }, + tap: { + Feature: PressGesture + }, + focus: { + Feature: FocusGesture + }, + hover: { + Feature: HoverGesture + } +}; + +// node_modules/framer-motion/dist/es/utils/shallow-compare.mjs +var shallowCompare = function(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0;i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; +}; + +// node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs +var getCurrent = function(visualElement) { + const current = {}; + visualElement.values.forEach((value, key) => current[key] = value.get()); + return current; +}; +var getVelocity = function(visualElement) { + const velocity = {}; + visualElement.values.forEach((value, key) => velocity[key] = value.getVelocity()); + return velocity; +}; +var resolveVariant = function(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement)); +}; + +// node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs +var optimizedAppearDataId = "framerAppearId"; +var optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + +// node_modules/framer-motion/dist/es/utils/errors.mjs +var warning = noop; +var invariant = noop; +if (true) { + warning = (check, message) => { + if (!check && typeof console !== "undefined") { + console.warn(message); + } + }; + invariant = (check, message) => { + if (!check) { + throw new Error(message); + } + }; +} + +// node_modules/framer-motion/dist/es/utils/time-conversion.mjs +var secondsToMilliseconds = (seconds) => seconds * 1000; +var millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + +// node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs +var instantAnimationState = { + current: false +}; + +// node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs +var isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + +// node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs +var isWaapiSupportedEasing = function(easing) { + return Boolean(!easing || typeof easing === "string" && supportedWaapiEasing[easing] || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing)); +}; +var mapEasingToNativeEasing = function(easing) { + if (!easing) + return; + return isBezierDefinition(easing) ? cubicBezierAsString(easing) : Array.isArray(easing) ? easing.map(mapEasingToNativeEasing) : supportedWaapiEasing[easing]; +}; +var cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; +var supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]) +}; + +// node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs +var animateStyle = function(element, valueName, keyframes, { delay = 0, duration, repeat = 0, repeatType = "loop", ease, times } = {}) { + const keyframeOptions = { [valueName]: keyframes }; + if (times) + keyframeOptions.offset = times; + const easing2 = mapEasingToNativeEasing(ease); + if (Array.isArray(easing2)) + keyframeOptions.easing = easing2; + return element.animate(keyframeOptions, { + delay, + duration, + easing: !Array.isArray(easing2) ? easing2 : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal" + }); +}; + +// node_modules/framer-motion/dist/es/animation/animators/waapi/supports.mjs +var featureTests = { + waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate") +}; +var results = {}; +var supports = {}; +for (const key in featureTests) { + supports[key] = () => { + if (results[key] === undefined) + results[key] = featureTests[key](); + return results[key]; + }; +} + +// node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs +var getFinalKeyframe = function(keyframes, { repeat, repeatType = "loop" }) { + const index = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : keyframes.length - 1; + return keyframes[index]; +}; + +// node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs +var binarySubdivide = function(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0) { + upperBound = currentT; + } else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); + return currentT; +}; +var cubicBezier = function(mX1, mY1, mX2, mY2) { + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +}; +var calcBezier = (t, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t + (3 * a2 - 6 * a1)) * t + 3 * a1) * t; +var subdivisionPrecision = 0.0000001; +var subdivisionMaxIterations = 12; + +// node_modules/framer-motion/dist/es/easing/ease.mjs +var easeIn = cubicBezier(0.42, 0, 1, 1); +var easeOut = cubicBezier(0, 0, 0.58, 1); +var easeInOut = cubicBezier(0.42, 0, 0.58, 1); + +// node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs +var isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +// node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs +var mirrorEasing = (easing2) => (p) => p <= 0.5 ? easing2(2 * p) / 2 : (2 - easing2(2 * (1 - p))) / 2; + +// node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs +var reverseEasing = (easing2) => (p) => 1 - easing2(1 - p); + +// node_modules/framer-motion/dist/es/easing/circ.mjs +var circIn = (p) => 1 - Math.sin(Math.acos(p)); +var circOut = reverseEasing(circIn); +var circInOut = mirrorEasing(circOut); + +// node_modules/framer-motion/dist/es/easing/back.mjs +var backOut = cubicBezier(0.33, 1.53, 0.69, 0.99); +var backIn = reverseEasing(backOut); +var backInOut = mirrorEasing(backIn); + +// node_modules/framer-motion/dist/es/easing/anticipate.mjs +var anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + +// node_modules/framer-motion/dist/es/easing/utils/map.mjs +var easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate +}; +var easingDefinitionToFunction = (definition) => { + if (Array.isArray(definition)) { + invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } else if (typeof definition === "string") { + invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`); + return easingLookup[definition]; + } + return definition; +}; + +// node_modules/framer-motion/dist/es/value/types/color/utils.mjs +var isColorString = (type, testProp) => (v) => { + return Boolean(isString(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && Object.prototype.hasOwnProperty.call(v, testProp)); +}; +var splitColor = (aName, bName, cName) => (v) => { + if (!isString(v)) + return v; + const [a, b, c, alpha2] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha2 !== undefined ? parseFloat(alpha2) : 1 + }; +}; + +// node_modules/framer-motion/dist/es/value/types/color/rgba.mjs +var clampRgbUnit = (v) => clamp(0, 255, v); +var rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)) +}; +var rgba = { + test: isColorString("rgb", "red"), + parse: splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")" +}; + +// node_modules/framer-motion/dist/es/value/types/color/hex.mjs +var parseHex = function(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + } else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1 + }; +}; +var hex = { + test: isColorString("#"), + parse: parseHex, + transform: rgba.transform +}; + +// node_modules/framer-motion/dist/es/value/types/color/hsla.mjs +var hsla = { + test: isColorString("hsl", "hue"), + parse: splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")"; + } +}; + +// node_modules/framer-motion/dist/es/value/types/color/index.mjs +var color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } else if (hsla.test(v)) { + return hsla.parse(v); + } else { + return hex.parse(v); + } + }, + transform: (v) => { + return isString(v) ? v : v.hasOwnProperty("red") ? rgba.transform(v) : hsla.transform(v); + } +}; + +// node_modules/framer-motion/dist/es/utils/mix.mjs +var mix = (from, to, progress) => -progress * from + progress * to + from; + +// node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs +var hueToRgb = function(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; +}; +var hslaToRgba = function({ hue, saturation, lightness, alpha: alpha2 }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } else { + const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha: alpha2 + }; +}; + +// node_modules/framer-motion/dist/es/utils/mix-color.mjs +var asRGBA = function(color2) { + const type = getColorType(color2); + invariant(Boolean(type), `'${color2}' is not an animatable color. Use the equivalent color code instead.`); + let model = type.parse(color2); + if (type === hsla) { + model = hslaToRgba(model); + } + return model; +}; +var mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + return Math.sqrt(Math.max(0, v * (to * to - fromExpo) + fromExpo)); +}; +var colorTypes = [hex, rgba, hsla]; +var getColorType = (v) => colorTypes.find((type) => type.test(v)); +var mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mix(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; +}; + +// node_modules/framer-motion/dist/es/value/types/complex/index.mjs +var test = function(v) { + var _a, _b; + return isNaN(v) && isString(v) && (((_a = v.match(floatRegex)) === null || _a === undefined ? undefined : _a.length) || 0) + (((_b = v.match(colorRegex)) === null || _b === undefined ? undefined : _b.length) || 0) > 0; +}; +var tokenise = function(info, { regex, countKey, token, parse }) { + const matches = info.tokenised.match(regex); + if (!matches) + return; + info["num" + countKey] = matches.length; + info.tokenised = info.tokenised.replace(regex, token); + info.values.push(...matches.map(parse)); +}; +var analyseComplexValue = function(value) { + const originalValue = value.toString(); + const info = { + value: originalValue, + tokenised: originalValue, + values: [], + numVars: 0, + numColors: 0, + numNumbers: 0 + }; + if (info.value.includes("var(--")) + tokenise(info, cssVarTokeniser); + tokenise(info, colorTokeniser); + tokenise(info, numberTokeniser); + return info; +}; +var parseComplexValue = function(v) { + return analyseComplexValue(v).values; +}; +var createTransformer = function(source) { + const { values, numColors, numVars, tokenised } = analyseComplexValue(source); + const numValues = values.length; + return (v) => { + let output = tokenised; + for (let i = 0;i < numValues; i++) { + if (i < numVars) { + output = output.replace(cssVarTokeniser.token, v[i]); + } else if (i < numVars + numColors) { + output = output.replace(colorTokeniser.token, color.transform(v[i])); + } else { + output = output.replace(numberTokeniser.token, sanitize(v[i])); + } + } + return output; + }; +}; +var getAnimatableNone = function(v) { + const parsed = parseComplexValue(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); +}; +var cssVarTokeniser = { + regex: cssVariableRegex, + countKey: "Vars", + token: "${v}", + parse: noop +}; +var colorTokeniser = { + regex: colorRegex, + countKey: "Colors", + token: "${c}", + parse: color.parse +}; +var numberTokeniser = { + regex: floatRegex, + countKey: "Numbers", + token: "${n}", + parse: number.parse +}; +var convertNumbersToZero = (v) => typeof v === "number" ? 0 : v; +var complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone +}; + +// node_modules/framer-motion/dist/es/utils/mix-complex.mjs +var getMixer = function(origin, target) { + if (typeof origin === "number") { + return (v) => mix(origin, target, v); + } else if (color.test(origin)) { + return mixColor(origin, target); + } else { + return origin.startsWith("var(") ? mixImmediate(origin, target) : mixComplex(origin, target); + } +}; +var mixImmediate = (origin, target) => (p) => `${p > 0 ? target : origin}`; +var mixArray = (from, to) => { + const output = [...from]; + const numValues = output.length; + const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i])); + return (v) => { + for (let i = 0;i < numValues; i++) { + output[i] = blendValue[i](v); + } + return output; + }; +}; +var mixObject = (origin, target) => { + const output = { ...origin, ...target }; + const blendValue = {}; + for (const key in output) { + if (origin[key] !== undefined && target[key] !== undefined) { + blendValue[key] = getMixer(origin[key], target[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +}; +var mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.numVars === targetStats.numVars && originStats.numColors === targetStats.numColors && originStats.numNumbers >= targetStats.numNumbers; + if (canInterpolate) { + return pipe(mixArray(originStats.values, targetStats.values), template); + } else { + warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`); + return mixImmediate(origin, target); + } +}; + +// node_modules/framer-motion/dist/es/utils/progress.mjs +var progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; +}; + +// node_modules/framer-motion/dist/es/utils/interpolate.mjs +var detectMixerFactory = function(v) { + if (typeof v === "number") { + return mixNumber; + } else if (typeof v === "string") { + return color.test(v) ? mixColor : mixComplex; + } else if (Array.isArray(v)) { + return mixArray; + } else if (typeof v === "object") { + return mixObject; + } + return mixNumber; +}; +var createMixers = function(output, ease2, customMixer) { + const mixers = []; + const mixerFactory = customMixer || detectMixerFactory(output[0]); + const numMixers = output.length - 1; + for (let i = 0;i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease2) { + const easingFunction = Array.isArray(ease2) ? ease2[i] || noop : ease2; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +}; +var interpolate = function(input, output, { clamp: isClamp = true, ease: ease2, mixer } = {}) { + const inputLength = input.length; + invariant(inputLength === output.length, "Both input and output ranges must be the same length"); + if (inputLength === 1) + return () => output[0]; + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease2, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + let i = 0; + if (numMixers > 1) { + for (;i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator; +}; +var mixNumber = (from, to) => (p) => mix(from, to, p); + +// node_modules/framer-motion/dist/es/utils/offsets/fill.mjs +var fillOffset = function(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1;i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mix(min, 1, offsetProgress)); + } +}; + +// node_modules/framer-motion/dist/es/utils/offsets/default.mjs +var defaultOffset = function(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; +}; + +// node_modules/framer-motion/dist/es/utils/offsets/time.mjs +var convertOffsetToTimes = function(offset, duration) { + return offset.map((o) => o * duration); +}; + +// node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs +var defaultEasing = function(values, easing2) { + return values.map(() => easing2 || easeInOut).splice(0, values.length - 1); +}; +var keyframes = function({ duration = 300, keyframes: keyframeValues, times, ease: ease3 = "easeInOut" }) { + const easingFunctions = isEasingArray(ease3) ? ease3.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease3); + const state = { + done: false, + value: keyframeValues[0] + }; + const absoluteTimes = convertOffsetToTimes(times && times.length === keyframeValues.length ? times : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) ? easingFunctions : defaultEasing(keyframeValues, easingFunctions) + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + } + }; +}; + +// node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs +var velocityPerSecond = function(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; +}; + +// node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs +var calcGeneratorVelocity = function(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); +}; +var velocitySampleDuration = 5; + +// node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs +var findSpring = function({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) { + let envelope; + let derivative; + warning(duration <= secondsToMilliseconds(maxDuration), "Spring duration must be 10 seconds or less"); + let dampingRatio = 1 - bounce; + dampingRatio = clamp(minDamping, maxDamping, dampingRatio); + duration = clamp(minDuration, maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + envelope = (undampedFreq2) => { + const exponentialDecay = undampedFreq2 * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq2, dampingRatio); + const c = Math.exp(-delta); + return safeMin - a / b * c; + }; + derivative = (undampedFreq2) => { + const exponentialDecay = undampedFreq2 * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio); + const factor = -envelope(undampedFreq2) + safeMin > 0 ? -1 : 1; + return factor * ((d - e) * f) / g; + }; + } else { + envelope = (undampedFreq2) => { + const a = Math.exp(-undampedFreq2 * duration); + const b = (undampedFreq2 - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq2) => { + const a = Math.exp(-undampedFreq2 * duration); + const b = (velocity - undampedFreq2) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: 100, + damping: 10, + duration + }; + } else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration + }; + } +}; +var approximateRoot = function(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1;i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +}; +var calcAngularFreq = function(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +}; +var safeMin = 0.001; +var minDuration = 0.01; +var maxDuration = 10; +var minDamping = 0.05; +var maxDamping = 1; +var rootIterations = 12; + +// node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs +var isSpringType = function(options, keys) { + return keys.some((key) => options[key] !== undefined); +}; +var getSpringOptions = function(options) { + let springOptions = { + velocity: 0, + stiffness: 100, + damping: 10, + mass: 1, + isResolvedFromDuration: false, + ...options + }; + if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) { + const derived = findSpring(options); + springOptions = { + ...springOptions, + ...derived, + velocity: 0, + mass: 1 + }; + springOptions.isResolvedFromDuration = true; + } + return springOptions; +}; +var spring = function({ keyframes: keyframes2, restDelta, restSpeed, ...options }) { + const origin = keyframes2[0]; + const target = keyframes2[keyframes2.length - 1]; + const state = { done: false, value: origin }; + const { stiffness, damping, mass, velocity: velocity2, duration, isResolvedFromDuration } = getSpringOptions(options); + const initialVelocity = velocity2 ? -millisecondsToSeconds(velocity2) : 0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale ? 0.01 : 2); + restDelta || (restDelta = isGranularScale ? 0.005 : 0.5); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t)); + }; + } else if (dampingRatio === 1) { + resolveSpring = (t) => target - Math.exp(-undampedAngularFreq * t) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } else { + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + const freqForT = Math.min(dampedAngularFreq * t, 300); + return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq; + }; + } + return { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + next: (t) => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + let currentVelocity = initialVelocity; + if (t !== 0) { + if (dampingRatio < 1) { + currentVelocity = calcGeneratorVelocity(resolveSpring, t, current); + } else { + currentVelocity = 0; + } + } + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; + state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; + } else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + } + }; +}; +var durationKeys = ["duration", "bounce"]; +var physicsKeys = ["stiffness", "damping", "mass"]; + +// node_modules/framer-motion/dist/es/animation/generators/inertia.mjs +var inertia = function({ keyframes: keyframes2, velocity: velocity3 = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed }) { + const origin = keyframes2[0]; + const state = { + done: false, + value: origin + }; + const isOutOfBounds = (v) => min !== undefined && v < min || max !== undefined && v > max; + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity3; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: calcGeneratorVelocity(calcLatest, t, state.value), + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + if (timeReachedBoundary !== undefined && t > timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + } + }; +}; + +// node_modules/framer-motion/dist/es/animation/animators/js/driver-frameloop.mjs +var frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: () => frame.update(passTimestamp, true), + stop: () => cancelFrame(passTimestamp), + now: () => frameData.isProcessing ? frameData.timestamp : performance.now() + }; +}; + +// node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs +var calcGeneratorDuration = function(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; +}; +var maxGeneratorDuration = 20000; + +// node_modules/framer-motion/dist/es/animation/animators/js/index.mjs +var animateValue = function({ autoplay = true, delay = 0, driver = frameloopDriver, keyframes: keyframes$1, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", onPlay, onStop, onComplete, onUpdate, ...options }) { + let speed = 1; + let hasStopped = false; + let resolveFinishedPromise; + let currentFinishedPromise; + const updateFinishedPromise = () => { + resolveFinishedPromise && resolveFinishedPromise(); + currentFinishedPromise = new Promise((resolve) => { + resolveFinishedPromise = resolve; + }); + }; + updateFinishedPromise(); + let animationDriver; + const generatorFactory = types[type] || keyframes; + let mapNumbersToKeyframes; + if (generatorFactory !== keyframes && typeof keyframes$1[0] !== "number") { + mapNumbersToKeyframes = interpolate([0, 100], keyframes$1, { + clamp: false + }); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + let mirroredGenerator; + if (repeatType === "mirror") { + mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -(options.velocity || 0) + }); + } + let playState = "idle"; + let holdTime = null; + let startTime = null; + let cancelTime = null; + if (generator.calculatedDuration === null && repeat) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + let resolvedDuration = Infinity; + let totalDuration = Infinity; + if (calculatedDuration !== null) { + resolvedDuration = calculatedDuration + repeatDelay; + totalDuration = resolvedDuration * (repeat + 1) - repeatDelay; + } + let currentTime = 0; + const tick = (timestamp) => { + if (startTime === null) + return; + if (speed > 0) + startTime = Math.min(startTime, timestamp); + if (holdTime !== null) { + currentTime = holdTime; + } else { + currentTime = (timestamp - startTime) * speed; + } + const timeWithoutDelay = currentTime - delay; + const isInDelayPhase = timeWithoutDelay < 0; + currentTime = Math.max(timeWithoutDelay, 0); + if (playState === "finished" && holdTime === null) { + currentTime = totalDuration; + } + let elapsed = currentTime; + let frameGenerator = generator; + if (repeat) { + const progress4 = currentTime / resolvedDuration; + let currentIteration = Math.floor(progress4); + let iterationProgress = progress4 % 1; + if (!iterationProgress && progress4 >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + const iterationIsOdd = Boolean(currentIteration % 2); + if (iterationIsOdd) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + let p = clamp(0, 1, iterationProgress); + if (currentTime > totalDuration) { + p = repeatType === "reverse" && iterationIsOdd ? 1 : 0; + } + elapsed = p * resolvedDuration; + } + const state = isInDelayPhase ? { done: false, value: keyframes$1[0] } : frameGenerator.next(elapsed); + if (mapNumbersToKeyframes) { + state.value = mapNumbersToKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = currentTime >= totalDuration; + } + const isAnimationFinished = holdTime === null && (playState === "finished" || playState === "running" && done || speed < 0 && currentTime <= 0); + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + finish(); + } + return state; + }; + const stopAnimationDriver = () => { + animationDriver && animationDriver.stop(); + animationDriver = undefined; + }; + const cancel = () => { + playState = "idle"; + stopAnimationDriver(); + updateFinishedPromise(); + startTime = cancelTime = null; + }; + const finish = () => { + playState = "finished"; + onComplete && onComplete(); + stopAnimationDriver(); + updateFinishedPromise(); + }; + const play = () => { + if (hasStopped) + return; + if (!animationDriver) + animationDriver = driver(tick); + const now = animationDriver.now(); + onPlay && onPlay(); + if (holdTime !== null) { + startTime = now - holdTime; + } else if (!startTime || playState === "finished") { + startTime = now; + } + cancelTime = startTime; + holdTime = null; + playState = "running"; + animationDriver.start(); + }; + if (autoplay) { + play(); + } + const controls = { + then(resolve, reject) { + return currentFinishedPromise.then(resolve, reject); + }, + get time() { + return millisecondsToSeconds(currentTime); + }, + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + currentTime = newTime; + if (holdTime !== null || !animationDriver || speed === 0) { + holdTime = newTime; + } else { + startTime = animationDriver.now() - newTime / speed; + } + }, + get duration() { + const duration = generator.calculatedDuration === null ? calcGeneratorDuration(generator) : generator.calculatedDuration; + return millisecondsToSeconds(duration); + }, + get speed() { + return speed; + }, + set speed(newSpeed) { + if (newSpeed === speed || !animationDriver) + return; + speed = newSpeed; + controls.time = millisecondsToSeconds(currentTime); + }, + get state() { + return playState; + }, + play, + pause: () => { + playState = "paused"; + holdTime = currentTime; + }, + stop: () => { + hasStopped = true; + if (playState === "idle") + return; + playState = "idle"; + onStop && onStop(); + cancel(); + }, + cancel: () => { + if (cancelTime !== null) + tick(cancelTime); + cancel(); + }, + complete: () => { + playState = "finished"; + }, + sample: (elapsed) => { + startTime = 0; + return tick(elapsed); + } + }; + return controls; +}; +var types = { + decay: inertia, + inertia, + tween: keyframes, + keyframes, + spring +}; + +// node_modules/framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.mjs +var createAcceleratedAnimation = function(value, valueName, { onUpdate, onComplete, ...options }) { + const canAccelerateAnimation = supports.waapi() && acceleratedValues.has(valueName) && !options.repeatDelay && options.repeatType !== "mirror" && options.damping !== 0 && options.type !== "inertia"; + if (!canAccelerateAnimation) + return false; + let hasStopped = false; + let resolveFinishedPromise; + let currentFinishedPromise; + const updateFinishedPromise = () => { + currentFinishedPromise = new Promise((resolve) => { + resolveFinishedPromise = resolve; + }); + }; + updateFinishedPromise(); + let { keyframes: keyframes3, duration = 300, ease: ease3, times } = options; + if (requiresPregeneratedKeyframes(valueName, options)) { + const sampleAnimation = animateValue({ + ...options, + repeat: 0, + delay: 0 + }); + let state = { done: false, value: keyframes3[0] }; + const pregeneratedKeyframes = []; + let t = 0; + while (!state.done && t < maxDuration2) { + state = sampleAnimation.sample(t); + pregeneratedKeyframes.push(state.value); + t += sampleDelta; + } + times = undefined; + keyframes3 = pregeneratedKeyframes; + duration = t - sampleDelta; + ease3 = "linear"; + } + const animation = animateStyle(value.owner.current, valueName, keyframes3, { + ...options, + duration, + ease: ease3, + times + }); + const cancelAnimation = () => animation.cancel(); + const safeCancel = () => { + frame.update(cancelAnimation); + resolveFinishedPromise(); + updateFinishedPromise(); + }; + animation.onfinish = () => { + value.set(getFinalKeyframe(keyframes3, options)); + onComplete && onComplete(); + safeCancel(); + }; + return { + then(resolve, reject) { + return currentFinishedPromise.then(resolve, reject); + }, + get time() { + return millisecondsToSeconds(animation.currentTime || 0); + }, + set time(newTime) { + animation.currentTime = secondsToMilliseconds(newTime); + }, + get speed() { + return animation.playbackRate; + }, + set speed(newSpeed) { + animation.playbackRate = newSpeed; + }, + get duration() { + return millisecondsToSeconds(duration); + }, + play: () => { + if (hasStopped) + return; + animation.play(); + cancelFrame(cancelAnimation); + }, + pause: () => animation.pause(), + stop: () => { + hasStopped = true; + if (animation.playState === "idle") + return; + const { currentTime } = animation; + if (currentTime) { + const sampleAnimation = animateValue({ + ...options, + autoplay: false + }); + value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta).value, sampleAnimation.sample(currentTime).value, sampleDelta); + } + safeCancel(); + }, + complete: () => animation.finish(), + cancel: safeCancel + }; +}; +var acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + "backgroundColor" +]); +var sampleDelta = 10; +var maxDuration2 = 20000; +var requiresPregeneratedKeyframes = (valueName, options) => options.type === "spring" || valueName === "backgroundColor" || !isWaapiSupportedEasing(options.ease); + +// node_modules/framer-motion/dist/es/animation/animators/instant.mjs +var createInstantAnimation = function({ keyframes: keyframes3, delay, onUpdate, onComplete }) { + const setValue = () => { + onUpdate && onUpdate(keyframes3[keyframes3.length - 1]); + onComplete && onComplete(); + return { + time: 0, + speed: 1, + duration: 0, + play: noop, + pause: noop, + stop: noop, + then: (resolve) => { + resolve(); + return Promise.resolve(); + }, + cancel: noop, + complete: noop + }; + }; + return delay ? animateValue({ + keyframes: [0, 1], + duration: 0, + delay, + onComplete: setValue + }) : setValue(); +}; + +// node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs +var underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10 +}; +var criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10 +}); +var keyframesTransition = { + type: "keyframes", + duration: 0.8 +}; +var ease3 = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3 +}; +var getDefaultTransition = (valueKey, { keyframes: keyframes3 }) => { + if (keyframes3.length > 2) { + return keyframesTransition; + } else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") ? criticallyDampedSpring(keyframes3[1]) : underDampedSpring; + } + return ease3; +}; + +// node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs +var isAnimatable = (key, value) => { + if (key === "zIndex") + return false; + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && (complex.test(value) || value === "0") && !value.startsWith("url(")) { + return true; + } + return false; +}; + +// node_modules/framer-motion/dist/es/value/types/complex/filter.mjs +var applyDefaultFilter = function(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number3] = value.match(floatRegex) || []; + if (!number3) + return v; + const unit = value.replace(number3, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number3 !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; +}; +var maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); +var functionRegex = /([a-z-]*)\(.*?\)/g; +var filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + } +}; + +// node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs +var defaultValueTypes = { + ...numberValueTypes, + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter +}; +var getDefaultValueType = (key) => defaultValueTypes[key]; + +// node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs +var getAnimatableNone2 = function(key, value) { + let defaultValueType = getDefaultValueType(key); + if (defaultValueType !== filter) + defaultValueType = complex; + return defaultValueType.getAnimatableNone ? defaultValueType.getAnimatableNone(value) : undefined; +}; + +// node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs +var isZeroValueString = (v) => /^0[^.\s]+$/.test(v); + +// node_modules/framer-motion/dist/es/animation/utils/is-none.mjs +var isNone = function(value) { + if (typeof value === "number") { + return value === 0; + } else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } +}; + +// node_modules/framer-motion/dist/es/animation/utils/keyframes.mjs +var getKeyframes = function(value, valueName, target, transition) { + const isTargetAnimatable = isAnimatable(valueName, target); + let keyframes3; + if (Array.isArray(target)) { + keyframes3 = [...target]; + } else { + keyframes3 = [null, target]; + } + const defaultOrigin = transition.from !== undefined ? transition.from : value.get(); + let animatableTemplateValue = undefined; + const noneKeyframeIndexes = []; + for (let i = 0;i < keyframes3.length; i++) { + if (keyframes3[i] === null) { + keyframes3[i] = i === 0 ? defaultOrigin : keyframes3[i - 1]; + } + if (isNone(keyframes3[i])) { + noneKeyframeIndexes.push(i); + } + if (typeof keyframes3[i] === "string" && keyframes3[i] !== "none" && keyframes3[i] !== "0") { + animatableTemplateValue = keyframes3[i]; + } + } + if (isTargetAnimatable && noneKeyframeIndexes.length && animatableTemplateValue) { + for (let i = 0;i < noneKeyframeIndexes.length; i++) { + const index = noneKeyframeIndexes[i]; + keyframes3[index] = getAnimatableNone2(valueName, animatableTemplateValue); + } + } + return keyframes3; +}; + +// node_modules/framer-motion/dist/es/animation/utils/transitions.mjs +var isTransitionDefined = function({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { + return !!Object.keys(transition).length; +}; +var getValueTransition = function(transition, key) { + return transition[key] || transition["default"] || transition; +}; + +// node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs +var animateMotionValue = (valueName, value, target, transition = {}) => { + return (onComplete) => { + const valueTransition = getValueTransition(transition, valueName) || {}; + const delay = valueTransition.delay || transition.delay || 0; + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const keyframes4 = getKeyframes(value, valueName, target, valueTransition); + const originKeyframe = keyframes4[0]; + const targetKeyframe = keyframes4[keyframes4.length - 1]; + const isOriginAnimatable = isAnimatable(valueName, originKeyframe); + const isTargetAnimatable = isAnimatable(valueName, targetKeyframe); + warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${valueName} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`); + let options = { + keyframes: keyframes4, + velocity: value.getVelocity(), + ease: "easeOut", + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + } + }; + if (!isTransitionDefined(valueTransition)) { + options = { + ...options, + ...getDefaultTransition(valueName, options) + }; + } + if (options.duration) { + options.duration = secondsToMilliseconds(options.duration); + } + if (options.repeatDelay) { + options.repeatDelay = secondsToMilliseconds(options.repeatDelay); + } + if (!isOriginAnimatable || !isTargetAnimatable || instantAnimationState.current || valueTransition.type === false) { + return createInstantAnimation(options); + } + if (value.owner && value.owner.current instanceof HTMLElement && !value.owner.getProps().onUpdate) { + const acceleratedAnimation = createAcceleratedAnimation(value, valueName, options); + if (acceleratedAnimation) + return acceleratedAnimation; + } + return animateValue(options); + }; +}; + +// node_modules/framer-motion/dist/es/value/use-will-change/is.mjs +var isWillChangeMotionValue = function(value) { + return Boolean(isMotionValue(value) && value.add); +}; + +// node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs +var isNumericalString = (v) => /^\-?\d*\.?\d+$/.test(v); + +// node_modules/framer-motion/dist/es/utils/array.mjs +var addUniqueItem = function(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); +}; +var removeItem = function(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); +}; + +// node_modules/framer-motion/dist/es/utils/subscription-manager.mjs +class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + this.subscriptions[0](a, b, c); + } else { + for (let i = 0;i < numSubscriptions; i++) { + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } +} + +// node_modules/framer-motion/dist/es/utils/warn-once.mjs +var warnOnce = function(condition, message, element) { + if (condition || warned.has(message)) + return; + console.warn(message); + if (element) + console.warn(element); + warned.add(message); +}; +var warned = new Set; + +// node_modules/framer-motion/dist/es/value/index.mjs +var motionValue = function(init, options) { + return new MotionValue(init, options); +}; +var isFloat = (value) => { + return !isNaN(parseFloat(value)); +}; + +class MotionValue { + constructor(init, options = {}) { + this.version = "10.12.16"; + this.timeDelta = 0; + this.lastUpdated = 0; + this.canTrackVelocity = false; + this.events = {}; + this.updateAndNotify = (v, render3 = true) => { + this.prev = this.current; + this.current = v; + const { delta, timestamp } = frameData; + if (this.lastUpdated !== timestamp) { + this.timeDelta = delta; + this.lastUpdated = timestamp; + frame.postRender(this.scheduleVelocityCheck); + } + if (this.prev !== this.current && this.events.change) { + this.events.change.notify(this.current); + } + if (this.events.velocityChange) { + this.events.velocityChange.notify(this.getVelocity()); + } + if (render3 && this.events.renderRequest) { + this.events.renderRequest.notify(this.current); + } + }; + this.scheduleVelocityCheck = () => frame.postRender(this.velocityCheck); + this.velocityCheck = ({ timestamp }) => { + if (timestamp !== this.lastUpdated) { + this.prev = this.current; + if (this.events.velocityChange) { + this.events.velocityChange.notify(this.getVelocity()); + } + } + }; + this.hasAnimated = false; + this.prev = this.current = init; + this.canTrackVelocity = isFloat(this.current); + this.owner = options.owner; + } + onChange(subscription) { + if (true) { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager; + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + set(v, render3 = true) { + if (!render3 || !this.passiveEffect) { + this.updateAndNotify(v, render3); + } else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = prev; + this.timeDelta = delta; + } + jump(v) { + this.updateAndNotify(v); + this.prev = v; + this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + get() { + return this.current; + } + getPrevious() { + return this.prev; + } + getVelocity() { + return this.canTrackVelocity ? velocityPerSecond(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta) : 0; + } + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + destroy() { + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } +} + +// node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs +var testValueType = (v) => (type) => type.test(v); + +// node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs +var auto = { + test: (v) => v === "auto", + parse: (v) => v +}; + +// node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs +var dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; +var findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + +// node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs +var valueTypes = [...dimensionValueTypes, color, complex]; +var findValueType = (v) => valueTypes.find(testValueType(v)); + +// node_modules/framer-motion/dist/es/render/utils/setters.mjs +var setMotionValue = function(visualElement, key, value2) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value2); + } else { + visualElement.addValue(key, motionValue(value2)); + } +}; +var setTarget = function(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value2 = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value2); + } +}; +var checkTargetForNewValues = function(visualElement, target, origin) { + var _a, _b; + const newValueKeys = Object.keys(target).filter((key) => !visualElement.hasValue(key)); + const numNewValues = newValueKeys.length; + if (!numNewValues) + return; + for (let i = 0;i < numNewValues; i++) { + const key = newValueKeys[i]; + const targetValue = target[key]; + let value2 = null; + if (Array.isArray(targetValue)) { + value2 = targetValue[0]; + } + if (value2 === null) { + value2 = (_b = (_a = origin[key]) !== null && _a !== undefined ? _a : visualElement.readValue(key)) !== null && _b !== undefined ? _b : target[key]; + } + if (value2 === undefined || value2 === null) + continue; + if (typeof value2 === "string" && (isNumericalString(value2) || isZeroValueString(value2))) { + value2 = parseFloat(value2); + } else if (!findValueType(value2) && complex.test(targetValue)) { + value2 = getAnimatableNone2(key, targetValue); + } + visualElement.addValue(key, motionValue(value2, { owner: visualElement })); + if (origin[key] === undefined) { + origin[key] = value2; + } + if (value2 !== null) + visualElement.setBaseTarget(key, value2); + } +}; +var getOriginFromTransition = function(key, transition) { + if (!transition) + return; + const valueTransition = transition[key] || transition["default"] || transition; + return valueTransition.from; +}; +var getOrigin = function(target, transition, visualElement) { + const origin = {}; + for (const key in target) { + const transitionOrigin = getOriginFromTransition(key, transition); + if (transitionOrigin !== undefined) { + origin[key] = transitionOrigin; + } else { + const value2 = visualElement.getValue(key); + if (value2) { + origin[key] = value2.get(); + } + } + } + return origin; +}; + +// node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs +var shouldBlockAnimation = function({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +}; +var animateTarget = function(visualElement, definition, { delay = 0, transitionOverride, type } = {}) { + let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = visualElement.makeTargetAnimatable(definition); + const willChange = visualElement.getValue("willChange"); + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && visualElement.animationState && visualElement.animationState.getState()[type]; + for (const key in target) { + const value2 = visualElement.getValue(key); + const valueTarget = target[key]; + if (!value2 || valueTarget === undefined || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { + continue; + } + const valueTransition = { delay, elapsed: 0, ...transition }; + if (window.HandoffAppearAnimations && !value2.hasAnimated) { + const appearId = visualElement.getProps()[optimizedAppearDataAttribute]; + if (appearId) { + valueTransition.elapsed = window.HandoffAppearAnimations(appearId, key, value2, frame); + } + } + value2.start(animateMotionValue(key, value2, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key) ? { type: false } : valueTransition)); + const animation = value2.animation; + if (isWillChangeMotionValue(willChange)) { + willChange.add(key); + animation.then(() => willChange.remove(key)); + } + animations.push(animation); + } + if (transitionEnd) { + Promise.all(animations).then(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + } + return animations; +}; + +// node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs +var animateVariant = function(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.custom); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + const getAnimation = resolved ? () => Promise.all(animateTarget(visualElement, resolved, options)) : () => Promise.resolve(); + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection } = transition; + return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); + } : () => Promise.resolve(); + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +}; +var animateChildren = function(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; + const generateStaggerDuration = staggerDirection === 1 ? (i = 0) => i * staggerChildren : (i = 0) => maxStaggerDuration - i * staggerChildren; + Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i) => { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delayChildren + generateStaggerDuration(i) + }).then(() => child.notify("AnimationComplete", variant))); + }); + return Promise.all(animations); +}; +var sortByTreeOrder = function(a, b) { + return a.sortNodePosition(b); +}; + +// node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs +var animateVisualElement = function(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } else { + const resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => visualElement.notify("AnimationComplete", definition)); +}; + +// node_modules/framer-motion/dist/es/render/utils/animation-state.mjs +var animateList = function(visualElement) { + return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); +}; +var createAnimationState = function(visualElement) { + let animate = animateList(visualElement); + const state = createState(); + let isInitialRender = true; + const buildResolvedTypeValues = (acc, definition) => { + const resolved = resolveVariant(visualElement, definition); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + function animateChanges(options, changedActiveType) { + const props = visualElement.getProps(); + const context = visualElement.getVariantContext(true) || {}; + const animations = []; + const removedKeys = new Set; + let encounteredKeys = {}; + let removedVariantIndex = Infinity; + for (let i = 0;i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined ? props[type] : context[type]; + const propIsVariant = isVariantLabel(prop); + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + let isInherited = prop === context[type] && prop !== props[type] && propIsVariant; + if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + typeState.protectedKeys = { ...encounteredKeys }; + if (!typeState.isActive && activeDelta === null || !prop && !typeState.prevProp || isAnimationControls(prop) || typeof prop === "boolean") { + continue; + } + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || i > removedVariantIndex && propIsVariant; + const definitionList = Array.isArray(prop) ? prop : [prop]; + let resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); + if (activeDelta === false) + resolvedValues = {}; + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + removedKeys.delete(key); + typeState.needsAnimating[key] = true; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + if (encounteredKeys.hasOwnProperty(key)) + continue; + if (next !== prev) { + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + if (!shallowCompare(next, prev) || variantDidChange) { + markToAnimate(key); + } else { + typeState.protectedKeys[key] = true; + } + } else if (next !== undefined) { + markToAnimate(key); + } else { + removedKeys.add(key); + } + } else if (next !== undefined && removedKeys.has(key)) { + markToAnimate(key); + } else { + typeState.protectedKeys[key] = true; + } + } + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + if (shouldAnimateType && !isInherited) { + animations.push(...definitionList.map((animation) => ({ + animation, + options: { type, ...options } + }))); + } + } + if (removedKeys.size) { + const fallbackAnimation = {}; + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + if (fallbackTarget !== undefined) { + fallbackAnimation[key] = fallbackTarget; + } + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && props.initial === false && !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + function setActive(type, isActive, options) { + var _a; + if (state[type].isActive === isActive) + return Promise.resolve(); + (_a = visualElement.variantChildren) === null || _a === undefined || _a.forEach((child) => { + var _a2; + return (_a2 = child.animationState) === null || _a2 === undefined ? undefined : _a2.setActive(type, isActive); + }); + state[type].isActive = isActive; + const animations = animateChanges(options, type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state + }; +}; +var checkVariantsDidChange = function(prev, next) { + if (typeof next === "string") { + return next !== prev; + } else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; +}; +var createTypeState = function(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {} + }; +}; +var createState = function() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState() + }; +}; +var reversePriorityOrder = [...variantPriorityOrder].reverse(); +var numAnimationTypes = variantPriorityOrder.length; + +// node_modules/framer-motion/dist/es/motion/features/animation/index.mjs +class AnimationFeature extends Feature { + constructor(node) { + super(node); + node.animationState || (node.animationState = createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + this.unmount(); + if (isAnimationControls(animate)) { + this.unmount = animate.subscribe(this.node); + } + } + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + } +} + +// node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs +var id = 0; + +class ExitAnimationFeature extends Feature { + constructor() { + super(...arguments); + this.id = id++; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete, custom } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent, { custom: custom !== null && custom !== undefined ? custom : this.node.getProps().custom }); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => onExitComplete(this.id)); + } + } + mount() { + const { register } = this.node.presenceContext || {}; + if (register) { + this.unmount = register(this.id); + } + } + unmount() { + } +} + +// node_modules/framer-motion/dist/es/motion/features/animations.mjs +var animations = { + animation: { + Feature: AnimationFeature + }, + exit: { + Feature: ExitAnimationFeature + } +}; + +// node_modules/framer-motion/dist/es/utils/distance.mjs +var distance2D = function(a, b) { + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +}; +var distance = (a, b) => Math.abs(a - b); + +// node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs +var transformPoint = function(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; +}; +var subtractPoint = function(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; +}; +var getPanInfo = function({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity2(history, 0.1) + }; +}; +var startDevicePoint = function(history) { + return history[0]; +}; +var lastDevicePoint = function(history) { + return history[history.length - 1]; +}; +var getVelocity2 = function(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + const time2 = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time2 === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time2, + y: (lastPoint.y - timestampedPoint.y) / time2 + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; +}; + +class PanSession { + constructor(event, handlers, { transformPagePoint } = {}) { + this.startEvent = null; + this.lastMoveEvent = null; + this.lastMoveEventInfo = null; + this.handlers = {}; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const info2 = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point: point2 } = info2; + const { timestamp: timestamp2 } = frameData; + this.history.push({ ...point2, timestamp: timestamp2 }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info2); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info2); + }; + this.handlePointerMove = (event2, info2) => { + this.lastMoveEvent = event2; + this.lastMoveEventInfo = transformPoint(info2, this.transformPagePoint); + frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event2, info2) => { + this.end(); + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const { onEnd, onSessionEnd } = this.handlers; + const panInfo = getPanInfo(event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event2, panInfo); + } + onSessionEnd && onSessionEnd(event2, panInfo); + }; + if (!isPrimaryPointer(event)) + return; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history)); + this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp)); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + cancelFrame(this.updatePoint); + } +} + +// node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs +var calcLength = function(axis) { + return axis.max - axis.min; +}; +var isNear = function(value2, target = 0, maxDistance = 0.01) { + return Math.abs(value2 - target) <= maxDistance; +}; +var calcAxisDelta = function(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mix(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale)) + delta.scale = 1; + delta.translate = mix(target.min, target.max, delta.origin) - delta.originPoint; + if (isNear(delta.translate) || isNaN(delta.translate)) + delta.translate = 0; +}; +var calcBoxDelta = function(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); +}; +var calcRelativeAxis = function(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); +}; +var calcRelativeBox = function(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); +}; +var calcRelativeAxisPosition = function(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); +}; +var calcRelativePosition = function(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); +}; + +// node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs +var applyConstraints = function(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + point = elastic ? mix(min, point, elastic.min) : Math.max(point, min); + } else if (max !== undefined && point > max) { + point = elastic ? mix(max, point, elastic.max) : Math.min(point, max); + } + return point; +}; +var calcRelativeAxisConstraints = function(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined ? axis.max + max - (axis.max - axis.min) : undefined + }; +}; +var calcRelativeConstraints = function(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom) + }; +}; +var calcViewportAxisConstraints = function(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; +}; +var calcViewportConstraints = function(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y) + }; +}; +var calcOrigin2 = function(source, target) { + let origin = 0.5; + const sourceLength = calcLength(source); + const targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = progress(target.min, target.max - sourceLength, source.min); + } else if (sourceLength > targetLength) { + origin = progress(source.min, source.max - targetLength, target.min); + } + return clamp(0, 1, origin); +}; +var rebaseAxisConstraints = function(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; +}; +var resolveDragElastic = function(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom") + }; +}; +var resolveAxisElastic = function(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel) + }; +}; +var resolvePointElastic = function(dragElastic, label) { + return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0; +}; +var defaultElastic = 0.35; + +// node_modules/framer-motion/dist/es/projection/geometry/models.mjs +var createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0 +}); +var createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta() +}); +var createAxis = () => ({ min: 0, max: 0 }); +var createBox = () => ({ + x: createAxis(), + y: createAxis() +}); + +// node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs +var eachAxis = function(callback) { + return [callback("x"), callback("y")]; +}; + +// node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs +var convertBoundingBoxToBox = function({ top, left, right, bottom }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom } + }; +}; +var convertBoxToBoundingBox = function({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; +}; +var transformBoxPoints = function(point, transformPoint2) { + if (!transformPoint2) + return point; + const topLeft = transformPoint2({ x: point.left, y: point.top }); + const bottomRight = transformPoint2({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x + }; +}; + +// node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs +var isIdentityScale = function(scale2) { + return scale2 === undefined || scale2 === 1; +}; +var hasScale = function({ scale: scale2, scaleX, scaleY }) { + return !isIdentityScale(scale2) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY); +}; +var hasTransform = function(values) { + return hasScale(values) || has2DTranslate(values) || values.z || values.rotate || values.rotateX || values.rotateY; +}; +var has2DTranslate = function(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); +}; +var is2DTranslate = function(value2) { + return value2 && value2 !== "0%"; +}; + +// node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs +var scalePoint = function(point, scale2, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale2 * distanceFromOrigin; + return originPoint + scaled; +}; +var applyPointDelta = function(point, translate, scale2, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale2, originPoint) + translate; +}; +var applyAxisDelta = function(axis, translate = 0, scale2 = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale2, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale2, originPoint, boxScale); +}; +var applyBoxDelta = function(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +}; +var applyTreeDeltas = function(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0;i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + const instance = node.instance; + if (instance && instance.style && instance.style.display === "contents") { + continue; + } + if (isSharedTransition && node.options.layoutScroll && node.scroll && node !== node.root) { + transformBox(box, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y + }); + } + if (delta) { + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } + } + treeScale.x = snapToDefault(treeScale.x); + treeScale.y = snapToDefault(treeScale.y); +}; +var snapToDefault = function(scale2) { + if (Number.isInteger(scale2)) + return scale2; + return scale2 > 1.0000000000001 || scale2 < 0.999999999999 ? scale2 : 1; +}; +var translateAxis = function(axis, distance3) { + axis.min = axis.min + distance3; + axis.max = axis.max + distance3; +}; +var transformAxis = function(axis, transforms, [key, scaleKey, originKey]) { + const axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5; + const originPoint = mix(axis.min, axis.max, axisOrigin); + applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale); +}; +var transformBox = function(box, transform7) { + transformAxis(box.x, transform7, xKeys); + transformAxis(box.y, transform7, yKeys); +}; +var xKeys = ["x", "scaleX", "originX"]; +var yKeys = ["y", "scaleY", "originY"]; + +// node_modules/framer-motion/dist/es/projection/utils/measure.mjs +var measureViewportBox = function(instance, transformPoint2) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint2)); +}; +var measurePageBox = function(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; +}; + +// node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +var shouldDrag = function(direction, drag, currentDirection) { + return (drag === true || drag === direction) && (currentDirection === null || currentDirection === direction); +}; +var getCurrentDirection = function(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; +}; +var elementDragControls = new WeakMap; + +class VisualElementDragControls { + constructor(visualElement) { + this.openGlobalLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + this.constraints = false; + this.hasMutatedConstraints = false; + this.elastic = createBox(); + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false } = {}) { + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + this.stopAnimation(); + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event, "page").point); + } + }; + const onStart = (event, info) => { + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openGlobalLock) + this.openGlobalLock(); + this.openGlobalLock = getGlobalLock(drag); + if (!this.openGlobalLock) + return; + } + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + if (percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + if (onDragStart) { + frame.update(() => onDragStart(event, info), false, true); + } + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps(); + if (!dragPropagation && !this.openGlobalLock) + return; + const { offset } = info; + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + this.visualElement.render(); + onDrag && onDrag(event, info); + }; + const onSessionEnd = (event, info) => this.stop(event, info); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd + }, { transformPagePoint: this.visualElement.getTransformPagePoint() }); + } + stop(event, info) { + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging) + return; + const { velocity: velocity3 } = info; + this.startAnimation(velocity3); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + frame.update(() => onDragEnd(event, info)); + } + } + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.panSession && this.panSession.end(); + this.panSession = undefined; + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openGlobalLock) { + this.openGlobalLock(); + this.openGlobalLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const { layout } = this.visualElement.projection || {}; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + if (prevConstraints !== this.constraints && layout && this.constraints && !this.hasMutatedConstraints) { + eachAxis((axis) => { + if (this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints2, onMeasureDragConstraints } = this.getProps(); + if (!constraints2 || !isRefObject(constraints2)) + return false; + const constraintsElement = constraints2.current; + invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop."); + const { projection } = this.visualElement; + if (!projection || !projection.layout) + return false; + const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity3) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd } = this.getProps(); + const constraints2 = this.constraints || {}; + const momentumAnimations = eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = constraints2 && constraints2[axis] || {}; + if (dragSnapToOrigin) + transition = { min: 0, max: 0 }; + const bounceStiffness = dragElastic ? 200 : 1e6; + const bounceDamping = dragElastic ? 40 : 1e7; + const inertia3 = { + type: "inertia", + velocity: dragMomentum ? velocity3[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition + }; + return this.startAxisValueAnimation(axis, inertia3); + }); + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + return axisValue.start(animateMotionValue(axis, axisValue, 0, transition)); + } + stopAnimation() { + eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + getAxisMotionValue(axis) { + const dragKey = "_drag" + axis.toUpperCase(); + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0); + } + snapToCursor(point) { + eachAxis((axis) => { + const { drag } = this.getProps(); + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + axisValue.set(point[axis] - mix(min, max, 0.5)); + } + }); + } + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + this.stopAnimation(); + const boxProgress = { x: 0, y: 0 }; + eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin2({ min: latest, max: latest }, this.constraints[axis]); + } + }); + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate ? transformTemplate({}, "") : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + this.resolveConstraints(); + eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(mix(min, max, boxProgress[axis])); + }); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + drag && dragListener && this.start(event); + }); + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints)) { + this.constraints = this.resolveRefConstraints(); + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + measureDragConstraints(); + const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", ({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + eachAxis((axis) => { + const motionValue2 = this.getAxisMotionValue(axis); + if (!motionValue2) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue2.set(motionValue2.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + }); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum + }; + } +} + +// node_modules/framer-motion/dist/es/gestures/drag/index.mjs +class DragGesture extends Feature { + constructor(node) { + super(node); + this.removeGroupControls = noop; + this.removeListeners = noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || noop; + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + } +} + +// node_modules/framer-motion/dist/es/gestures/pan/index.mjs +var asyncHandler = (handler) => (event, info) => { + if (handler) { + frame.update(() => handler(event, info)); + } +}; + +class PanGesture extends Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { transformPagePoint: this.node.getTransformPagePoint() }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: onPan, + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + frame.update(() => onPanEnd(event, info)); + } + } + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } +} + +// node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +var import_react18 = __toESM(require_react()); + +// node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs +var import_react17 = __toESM(require_react()); +var usePresence = function() { + const context = import_react17.useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + const id2 = import_react17.useId(); + import_react17.useEffect(() => register(id2), []); + const safeToRemove = () => onExitComplete && onExitComplete(id2); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +}; + +// node_modules/framer-motion/dist/es/projection/node/state.mjs +var globalProjectionState = { + hasAnimatedSinceResize: true, + hasEverUpdated: false +}; + +// node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs +var pixelsToPercent = function(pixels, axis) { + if (axis.max === axis.min) + return 0; + return pixels / (axis.max - axis.min) * 100; +}; +var correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } else { + return latest; + } + } + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + } +}; + +// node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs +var correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + const averageScale = mix(xScale, yScale, 0.5); + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + } +}; + +// node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs +var MeasureLayout = function(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = import_react18.useContext(LayoutGroupContext); + return import_react18.default.createElement(MeasureLayoutWithContext, { ...props, layoutGroup, switchLayoutGroup: import_react18.useContext(SwitchLayoutGroupContext), isPresent, safeToRemove }); +}; + +class MeasureLayoutWithContext extends import_react18.default.Component { + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + addScaleCorrector(defaultScaleCorrectors); + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + projection.root.didUpdate(); + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + onExitComplete: () => this.safeToRemove() + }); + } + globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const projection = visualElement.projection; + if (!projection) + return null; + projection.isPresent = isPresent; + if (drag || prevProps.layoutDependency !== layoutDependency || layoutDependency === undefined) { + projection.willUpdate(); + } else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } else if (!projection.relegate()) { + frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { projection } = this.props.visualElement; + if (projection) { + projection.root.didUpdate(); + queueMicrotask(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext } = this.props; + const { projection } = visualElement; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } +} +var defaultScaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomLeftRadius", + "borderBottomRightRadius" + ] + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow +}; + +// node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs +var mixValues = function(target, follow, lead, progress6, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mix(0, lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress6)); + target.opacityExit = mix(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress6)); + } else if (isOnlyMember) { + target.opacity = mix(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress6); + } + for (let i = 0;i < numBorders; i++) { + const borderLabel = `border${borders[i]}Radius`; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mix(asNumber(followRadius), asNumber(leadRadius), progress6), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } else { + target[borderLabel] = leadRadius; + } + } + if (follow.rotate || lead.rotate) { + target.rotate = mix(follow.rotate || 0, lead.rotate || 0, progress6); + } +}; +var getRadius = function(values, radiusName) { + return values[radiusName] !== undefined ? values[radiusName] : values.borderRadius; +}; +var compress = function(min, max, easing3) { + return (p) => { + if (p < min) + return 0; + if (p > max) + return 1; + return easing3(progress(min, max, p)); + }; +}; +var borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; +var numBorders = borders.length; +var asNumber = (value2) => typeof value2 === "string" ? parseFloat(value2) : value2; +var isPx = (value2) => typeof value2 === "number" || px.test(value2); +var easeCrossfadeIn = compress(0, 0.5, circOut); +var easeCrossfadeOut = compress(0.5, 0.95, noop); + +// node_modules/framer-motion/dist/es/projection/geometry/copy.mjs +var copyAxisInto = function(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; +}; +var copyBoxInto = function(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); +}; + +// node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs +var removePointDelta = function(point, translate, scale2, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale2, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; +}; +var removeAxisDelta = function(axis, translate = 0, scale2 = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mix(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mix(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale2, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale2, originPoint, boxScale); +}; +var removeAxisTransforms = function(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); +}; +var removeBoxTransforms = function(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys2, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys2, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); +}; +var xKeys2 = ["x", "scaleX", "originX"]; +var yKeys2 = ["y", "scaleY", "originY"]; + +// node_modules/framer-motion/dist/es/projection/geometry/utils.mjs +var isAxisDeltaZero = function(delta) { + return delta.translate === 0 && delta.scale === 1; +}; +var isDeltaZero = function(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +}; +var boxEquals = function(a, b) { + return a.x.min === b.x.min && a.x.max === b.x.max && a.y.min === b.y.min && a.y.max === b.y.max; +}; +var aspectRatio = function(box) { + return calcLength(box.x) / calcLength(box.y); +}; + +// node_modules/framer-motion/dist/es/projection/shared/stack.mjs +class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + } + relegate(node) { + const indexOfNode = this.members.findIndex((member) => node === member); + if (indexOfNode === 0) + return false; + let prevLead; + for (let i = indexOfNode;i >= 0; i--) { + const member = this.members[i]; + if (member.isPresent !== false) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } else { + return false; + } + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues; + } + if (node.root && node.root.isUpdating) { + node.isLayoutDirty = true; + } + const { crossfade } = node.options; + if (crossfade === false) { + prevLead.hide(); + } + } + } + exitAnimationComplete() { + this.members.forEach((node) => { + const { options, resumingFrom } = node; + options.onExitComplete && options.onExitComplete(); + if (resumingFrom) { + resumingFrom.options.onExitComplete && resumingFrom.options.onExitComplete(); + } + }); + } + scheduleRender() { + this.members.forEach((node) => { + node.instance && node.scheduleRender(false); + }); + } + removeLeadSnapshot() { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + } +} + +// node_modules/framer-motion/dist/es/projection/styles/transform.mjs +var buildProjectionTransform = function(delta, treeScale, latestTransform) { + let transform7 = ""; + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + if (xTranslate || yTranslate) { + transform7 = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `; + } + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform7 += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { rotate, rotateX, rotateY } = latestTransform; + if (rotate) + transform7 += `rotate(${rotate}deg) `; + if (rotateX) + transform7 += `rotateX(${rotateX}deg) `; + if (rotateY) + transform7 += `rotateY(${rotateY}deg) `; + } + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform7 += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform7 || "none"; +}; + +// node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs +var compareByDepth = (a, b) => a.depth - b.depth; + +// node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs +class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } +} + +// node_modules/framer-motion/dist/es/utils/delay.mjs +var delay = function(callback, timeout) { + const start = performance.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.read(checkElapsed, true); + return () => cancelFrame(checkElapsed); +}; + +// node_modules/framer-motion/dist/es/debug/record.mjs +var record = function(data5) { + if (window.MotionDebug) { + window.MotionDebug.record(data5); + } +}; + +// node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs +var isSVGElement = function(element) { + return element instanceof SVGElement && element.tagName !== "svg"; +}; + +// node_modules/framer-motion/dist/es/animation/interfaces/single-value.mjs +var animateSingleValue = function(value3, keyframes4, options) { + const motionValue$1 = isMotionValue(value3) ? value3 : motionValue(value3); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes4, options)); + return motionValue$1.animation; +}; + +// node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs +var createProjectionNode = function({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent === null || defaultParent === undefined ? undefined : defaultParent()) { + this.id = id2++; + this.animationId = 0; + this.children = new Set; + this.options = {}; + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + this.isLayoutDirty = false; + this.isProjectionDirty = false; + this.isSharedProjectionDirty = false; + this.isTransformDirty = false; + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + this.isUpdating = false; + this.isSVG = false; + this.needsReset = false; + this.shouldResetTransform = false; + this.treeScale = { x: 1, y: 1 }; + this.eventHandlers = new Map; + this.hasTreeAnimated = false; + this.updateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + this.updateProjection = () => { + projectionFrameData.totalNodes = projectionFrameData.resolvedTargetDeltas = projectionFrameData.recalculatedProjection = 0; + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + record(projectionFrameData); + }; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + this.sharedNodes = new Map; + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0;i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree; + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + mount(instance, isLayoutDirty = this.root.hasTreeAnimated) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (isLayoutDirty && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + const resizeUnblockUpdate = () => this.root.updateBlockedByResize = false; + attachResizeListener(instance, () => { + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + if (this.options.animate !== false && visualElement && (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + const layoutTransition = this.options.transition || visualElement.getDefaultTransition() || defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete } = visualElement.getProps(); + const targetChanged = !this.targetLayout || !boxEquals(this.targetLayout, newLayout) || hasRelativeTargetChanged; + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; + if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || hasOnlyRelativeTargetChanged || hasLayoutChanged && (targetChanged || !this.currentAnimation)) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete + }; + if (visualElement.shouldReduceMotion || this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + } else { + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack2 = this.getStack(); + stack2 && stack2.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + cancelFrame(this.updateProjection); + } + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || false; + } + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0;i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + this.isUpdating = false; + this.nodes.forEach(resetTransformStyle); + this.nodes.forEach(updateLayout); + this.nodes.forEach(notifyLayoutUpdate); + this.clearAllSnapshots(); + const now = performance.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + steps.update.process(frameData); + steps.preRender.process(frameData); + steps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + queueMicrotask(() => this.update()); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + frame.preRender(this.updateProjection, false, true); + } + scheduleCheckAfterUnmount() { + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } else { + this.root.checkUpdateFailed(); + } + }); + } + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) { + return; + } + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0;i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement) { + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot: checkIsScrollRoot(this.instance), + offset: measureScroll(this.instance) + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || this.shouldResetTransform; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + for (let i = 0;i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + if (scroll.isRoot) { + copyBoxInto(boxWithoutScroll, box); + const { scroll: rootScroll } = this.root; + if (rootScroll) { + translateAxis(boxWithoutScroll.x, -rootScroll.offset.x); + translateAxis(boxWithoutScroll.y, -rootScroll.offset.y); + } + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false) { + const withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0;i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && node.options.layoutScroll && node.scroll && node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y + }); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0;i < this.path.length; i++) { + const node = this.path[i]; + if (!node.instance) + continue; + if (!hasTransform(node.latestValues)) + continue; + hasScale(node.latestValues) && node.updateSnapshot(); + const sourceBox = createBox(); + const nodeBox = node.measurePageBox(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + if (this.relativeParent.resolvedRelativeTargetAt !== frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + var _a; + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a = this.parent) === null || _a === undefined ? undefined : _a.isProjectionDirty) || this.attemptToResolveRelativeTarget); + if (canSkip) + return; + const { layout, layoutId } = this.options; + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + if (!this.targetDelta && !this.relativeTarget) { + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && relativeParent.layout && this.animationProgress !== 1) { + this.relativeParent = relativeParent; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } else { + this.relativeParent = this.relativeTarget = undefined; + } + } + if (!this.relativeTarget && !this.targetDelta) + return; + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + if (this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + } else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + this.target = this.applyTransform(this.layout.layoutBox); + } else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } else { + copyBoxInto(this.target, this.layout.layoutBox); + } + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) { + this.relativeParent = relativeParent; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } else { + this.relativeParent = this.relativeTarget = undefined; + } + } + projectionFrameData.resolvedTargetDeltas++; + } + getClosestProjectingParent() { + if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) { + return; + } + if (this.parent.isProjecting()) { + return this.parent; + } else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout); + } + calcProjection() { + var _a; + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + if (this.isProjectionDirty || ((_a = this.parent) === null || _a === undefined ? undefined : _a.isProjectionDirty)) { + canSkip = false; + } + if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + this.isTreeAnimating = Boolean(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + if (lead.layout && !lead.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + } + const { target } = lead; + if (!target) { + if (this.projectionTransform) { + this.projectionDelta = createDelta(); + this.projectionTransform = "none"; + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta) { + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + const prevProjectionTransform = this.projectionTransform; + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale); + if (this.projectionTransform !== prevProjectionTransform || this.treeScale.x !== prevTreeScaleX || this.treeScale.y !== prevTreeScaleY) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + projectionFrameData.recalculatedProjection++; + } + hide() { + this.isVisible = false; + } + show() { + this.isVisible = true; + } + scheduleRender(notifyAll = true) { + this.options.scheduleRender && this.options.scheduleRender(); + if (notifyAll) { + const stack2 = this.getStack(); + stack2 && stack2.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack2 = this.getStack(); + const isOnlyMember = !stack2 || stack2.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + this.mixTargetDelta = (latest) => { + const progress6 = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress6); + mixAxisDelta(targetDelta.y, delta.y, progress6); + this.setTargetDelta(targetDelta); + if (this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress6); + if (prevRelativeTarget && boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress6, shouldCrossfadeOpacity, isOnlyMember); + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress6; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation && this.currentAnimation.stop(); + if (this.resumingFrom && this.resumingFrom.currentAnimation) { + this.resumingFrom.currentAnimation.stop(); + } + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + this.currentAnimation = animateSingleValue(0, animationTarget, { + ...options, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onComplete: () => { + options.onComplete && options.onComplete(); + this.completeAnimation(); + } + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack2 = this.getStack(); + stack2 && stack2.exitAnimationComplete(); + this.resumingFrom = this.currentAnimation = this.animationValues = undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + if (this !== lead && this.layout && layout && shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + transformBox(targetWithTransforms, latestValues); + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack); + } + const stack2 = this.sharedNodes.get(layoutId); + stack2.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity ? config.shouldPreserveFollowOpacity(node) : undefined + }); + } + isLead() { + const stack2 = this.getStack(); + return stack2 ? stack2.lead === this : true; + } + getLead() { + var _a; + const { layoutId } = this.options; + return layoutId ? ((_a = this.getStack()) === null || _a === undefined ? undefined : _a.lead) || this : this; + } + getPrevLead() { + var _a; + const { layoutId } = this.options; + return layoutId ? (_a = this.getStack()) === null || _a === undefined ? undefined : _a.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity } = {}) { + const stack2 = this.getStack(); + if (stack2) + stack2.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack2 = this.getStack(); + if (stack2) { + return stack2.relegate(this); + } else { + return false; + } + } + resetRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + let hasRotate = false; + const { latestValues } = visualElement; + if (latestValues.rotate || latestValues.rotateX || latestValues.rotateY || latestValues.rotateZ) { + hasRotate = true; + } + if (!hasRotate) + return; + const resetValues = {}; + for (let i = 0;i < transformAxes.length; i++) { + const key = "rotate" + transformAxes[i]; + if (latestValues[key]) { + resetValues[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + } + } + visualElement.render(); + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + } + visualElement.scheduleRender(); + } + getProjectionStyles(styleProp = {}) { + var _a, _b; + const styles = {}; + if (!this.instance || this.isSVG) + return styles; + if (!this.isVisible) { + return { visibility: "hidden" }; + } else { + styles.visibility = ""; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + styles.opacity = ""; + styles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; + styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none"; + return styles; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + const emptyStyles = {}; + if (this.options.layoutId) { + emptyStyles.opacity = this.latestValues.opacity !== undefined ? this.latestValues.opacity : 1; + emptyStyles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none"; + this.hasProjected = false; + } + return emptyStyles; + } + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + styles.transform = transformTemplate(valuesToRender, styles.transform); + } + const { x, y } = this.projectionDelta; + styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + styles.opacity = lead === this ? (_b = (_a = valuesToRender.opacity) !== null && _a !== undefined ? _a : this.latestValues.opacity) !== null && _b !== undefined ? _b : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit; + } else { + styles.opacity = lead === this ? valuesToRender.opacity !== undefined ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== undefined ? valuesToRender.opacityExit : 0; + } + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo } = scaleCorrectors[key]; + const corrected = styles.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0;i < num; i++) { + styles[applyTo[i]] = corrected; + } + } else { + styles[key] = corrected; + } + } + if (this.options.layoutId) { + styles.pointerEvents = lead === this ? resolveMotionValue(styleProp.pointerEvents) || "" : "none"; + } + return styles; + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + resetTree() { + this.root.nodes.forEach((node) => { + var _a; + return (_a = node.currentAnimation) === null || _a === undefined ? undefined : _a.stop(); + }); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; +}; +var updateLayout = function(node) { + node.updateLayout(); +}; +var notifyLayoutUpdate = function(node) { + var _a; + const snapshot = ((_a = node.resumeFrom) === null || _a === undefined ? undefined : _a.snapshot) || node.snapshot; + if (node.isLead() && node.layout && snapshot && node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeTargetChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); + if (!boxEquals(relativeSnapshot, relativeLayout)) { + hasRelativeTargetChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeTargetChanged + }); + } else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + node.options.transition = undefined; +}; +var propagateDirtyNodes = function(node) { + projectionFrameData.totalNodes++; + if (!node.parent) + return; + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || node.parent.isProjectionDirty || node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); +}; +var cleanDirtyNodes = function(node) { + node.isProjectionDirty = node.isSharedProjectionDirty = node.isTransformDirty = false; +}; +var clearSnapshot = function(node) { + node.clearSnapshot(); +}; +var clearMeasurements = function(node) { + node.clearMeasurements(); +}; +var clearIsLayoutDirty = function(node) { + node.isLayoutDirty = false; +}; +var resetTransformStyle = function(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); +}; +var finishAnimation = function(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; +}; +var resolveTargetDelta = function(node) { + node.resolveTargetDelta(); +}; +var calcProjection = function(node) { + node.calcProjection(); +}; +var resetRotation = function(node) { + node.resetRotation(); +}; +var removeLeadSnapshots = function(stack2) { + stack2.removeLeadSnapshot(); +}; +var mixAxisDelta = function(output, delta, p) { + output.translate = mix(delta.translate, 0, p); + output.scale = mix(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; +}; +var mixAxis = function(output, from, to, p) { + output.min = mix(from.min, to.min, p); + output.max = mix(from.max, to.max, p); +}; +var mixBox = function(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); +}; +var hasOpacityCrossfade = function(node) { + return node.animationValues && node.animationValues.opacityExit !== undefined; +}; +var roundAxis = function(axis) { + axis.min = Math.round(axis.min); + axis.max = Math.round(axis.max); +}; +var roundBox = function(box) { + roundAxis(box.x); + roundAxis(box.y); +}; +var shouldAnimatePositionOnly = function(animationType, snapshot, layout) { + return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2); +}; +var transformAxes = ["", "X", "Y", "Z"]; +var animationTarget = 1000; +var id2 = 0; +var projectionFrameData = { + type: "projectionFrame", + totalNodes: 0, + resolvedTargetDeltas: 0, + recalculatedProjection: 0 +}; +var defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1] +}; + +// node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs +var DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body.scrollLeft, + y: document.documentElement.scrollTop || document.body.scrollTop + }), + checkIsScrollRoot: () => true +}); + +// node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs +var rootProjectionNode = { + current: undefined +}; +var HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value3) => { + instance.style.transform = value3 !== undefined ? value3 : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed") +}); + +// node_modules/framer-motion/dist/es/motion/features/drag.mjs +var drag2 = { + pan: { + Feature: PanGesture + }, + drag: { + Feature: DragGesture, + ProjectionNode: HTMLProjectionNode, + MeasureLayout + } +}; + +// node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs +var parseCSSVariable = function(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token, fallback] = match; + return [token, fallback]; +}; +var getVariableValue = function(current, element, depth = 1) { + invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`); + const [token, fallback] = parseCSSVariable(current); + if (!token) + return; + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + return resolved.trim(); + } else if (isCSSVariableToken(fallback)) { + return getVariableValue(fallback, element, depth + 1); + } else { + return fallback; + } +}; +var resolveCSSVariables = function(visualElement, { ...target }, transitionEnd) { + const element = visualElement.current; + if (!(element instanceof Element)) + return { target, transitionEnd }; + if (transitionEnd) { + transitionEnd = { ...transitionEnd }; + } + visualElement.values.forEach((value3) => { + const current = value3.get(); + if (!isCSSVariableToken(current)) + return; + const resolved = getVariableValue(current, element); + if (resolved) + value3.set(resolved); + }); + for (const key in target) { + const current = target[key]; + if (!isCSSVariableToken(current)) + continue; + const resolved = getVariableValue(current, element); + if (!resolved) + continue; + target[key] = resolved; + if (!transitionEnd) + transitionEnd = {}; + if (transitionEnd[key] === undefined) { + transitionEnd[key] = current; + } + } + return { target, transitionEnd }; +}; +var splitCSSVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; +var maxDepth = 4; + +// node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs +var removeNonTranslationalTransform = function(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value3 = visualElement.getValue(key); + if (value3 !== undefined) { + removedTransforms.push([key, value3.get()]); + value3.set(key.startsWith("scale") ? 1 : 0); + } + }); + if (removedTransforms.length) + visualElement.render(); + return removedTransforms; +}; +var unitConversion = function(visualElement, target, origin, transitionEnd) { + return hasPositionalKey(target) ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) : { target, transitionEnd }; +}; +var positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + "x", + "y", + "translateX", + "translateY" +]); +var isPositionalKey = (key) => positionalKeys.has(key); +var hasPositionalKey = (target) => { + return Object.keys(target).some(isPositionalKey); +}; +var isNumOrPxType = (v) => v === number || v === px; +var getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]); +var getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform9 }) => { + if (transform9 === "none" || !transform9) + return 0; + const matrix3d = transform9.match(/^matrix3d\((.+)\)$/); + if (matrix3d) { + return getPosFromMatrix(matrix3d[1], pos3); + } else { + const matrix = transform9.match(/^matrix\((.+)\)$/); + if (matrix) { + return getPosFromMatrix(matrix[1], pos2); + } else { + return 0; + } + } +}; +var transformKeys = new Set(["x", "y", "z"]); +var nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); +var positionalValues = { + width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), + height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + x: getTranslateFromMatrix(4, 13), + y: getTranslateFromMatrix(5, 14) +}; +var convertChangedValueTypes = (target, visualElement, changedKeys) => { + const originBbox = visualElement.measureViewportBox(); + const element = visualElement.current; + const elementComputedStyle = getComputedStyle(element); + const { display } = elementComputedStyle; + const origin = {}; + if (display === "none") { + visualElement.setStaticValue("display", target.display || "block"); + } + changedKeys.forEach((key) => { + origin[key] = positionalValues[key](originBbox, elementComputedStyle); + }); + visualElement.render(); + const targetBbox = visualElement.measureViewportBox(); + changedKeys.forEach((key) => { + const value3 = visualElement.getValue(key); + value3 && value3.jump(origin[key]); + target[key] = positionalValues[key](targetBbox, elementComputedStyle); + }); + return target; +}; +var checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, transitionEnd = {}) => { + target = { ...target }; + transitionEnd = { ...transitionEnd }; + const targetPositionalKeys = Object.keys(target).filter(isPositionalKey); + let removedTransformValues = []; + let hasAttemptedToRemoveTransformValues = false; + const changedValueTypeKeys = []; + targetPositionalKeys.forEach((key) => { + const value3 = visualElement.getValue(key); + if (!visualElement.hasValue(key)) + return; + let from = origin[key]; + let fromType = findDimensionValueType(from); + const to = target[key]; + let toType; + if (isKeyframesTarget(to)) { + const numKeyframes = to.length; + const fromIndex = to[0] === null ? 1 : 0; + from = to[fromIndex]; + fromType = findDimensionValueType(from); + for (let i = fromIndex;i < numKeyframes; i++) { + if (to[i] === null) + break; + if (!toType) { + toType = findDimensionValueType(to[i]); + invariant(toType === fromType || isNumOrPxType(fromType) && isNumOrPxType(toType), "Keyframes must be of the same dimension as the current value"); + } else { + invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type"); + } + } + } else { + toType = findDimensionValueType(to); + } + if (fromType !== toType) { + if (isNumOrPxType(fromType) && isNumOrPxType(toType)) { + const current = value3.get(); + if (typeof current === "string") { + value3.set(parseFloat(current)); + } + if (typeof to === "string") { + target[key] = parseFloat(to); + } else if (Array.isArray(to) && toType === px) { + target[key] = to.map(parseFloat); + } + } else if ((fromType === null || fromType === undefined ? undefined : fromType.transform) && (toType === null || toType === undefined ? undefined : toType.transform) && (from === 0 || to === 0)) { + if (from === 0) { + value3.set(toType.transform(from)); + } else { + target[key] = fromType.transform(to); + } + } else { + if (!hasAttemptedToRemoveTransformValues) { + removedTransformValues = removeNonTranslationalTransform(visualElement); + hasAttemptedToRemoveTransformValues = true; + } + changedValueTypeKeys.push(key); + transitionEnd[key] = transitionEnd[key] !== undefined ? transitionEnd[key] : target[key]; + value3.jump(to); + } + } + }); + if (changedValueTypeKeys.length) { + const scrollY = changedValueTypeKeys.indexOf("height") >= 0 ? window.pageYOffset : null; + const convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys); + if (removedTransformValues.length) { + removedTransformValues.forEach(([key, value3]) => { + visualElement.getValue(key).set(value3); + }); + } + visualElement.render(); + if (isBrowser && scrollY !== null) { + window.scrollTo({ top: scrollY }); + } + return { target: convertedTarget, transitionEnd }; + } else { + return { target, transitionEnd }; + } +}; + +// node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs +var parseDomVariant = (visualElement, target, origin, transitionEnd) => { + const resolved = resolveCSSVariables(visualElement, target, transitionEnd); + target = resolved.target; + transitionEnd = resolved.transitionEnd; + return unitConversion(visualElement, target, origin, transitionEnd); +}; + +// node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs +var prefersReducedMotion = { current: null }; +var hasReducedMotionListener = { current: false }; + +// node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs +var initPrefersReducedMotion = function() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches; + motionMediaQuery.addListener(setReducedMotionPreferences); + setReducedMotionPreferences(); + } else { + prefersReducedMotion.current = false; + } +}; + +// node_modules/framer-motion/dist/es/render/utils/motion-values.mjs +var updateMotionValuesFromProps = function(element, next, prev) { + const { willChange } = next; + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + element.addValue(key, nextValue); + if (isWillChangeMotionValue(willChange)) { + willChange.add(key); + } + if (true) { + warnOnce(nextValue.version === "10.12.16", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.12.16 may not work as expected.`); + } + } else if (isMotionValue(prevValue)) { + element.addValue(key, motionValue(nextValue, { owner: element })); + if (isWillChangeMotionValue(willChange)) { + willChange.remove(key); + } + } else if (prevValue !== nextValue) { + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + !existingValue.hasAnimated && existingValue.set(nextValue); + } else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; +}; + +// node_modules/framer-motion/dist/es/render/store.mjs +var visualElementStore = new WeakMap; + +// node_modules/framer-motion/dist/es/render/VisualElement.mjs +var featureNames = Object.keys(featureDefinitions); +var numFeatures = featureNames.length; +var propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete" +]; +var numVariantProps = variantProps.length; + +class VisualElement { + constructor({ parent, props, presenceContext, reducedMotionConfig, visualState }, options = {}) { + this.current = null; + this.children = new Set; + this.isVariantNode = false; + this.isControllingVariants = false; + this.shouldReduceMotion = null; + this.values = new Map; + this.features = {}; + this.valueSubscriptions = new Map; + this.prevMotionValues = {}; + this.events = {}; + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.scheduleRender = () => frame.render(this.render, false, true); + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.options = options; + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set; + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}); + for (const key in initialMotionValues) { + const value5 = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value5)) { + value5.set(latestValues[key], false); + if (isWillChangeMotionValue(willChange)) { + willChange.add(key); + } + } + } + } + scrapeMotionValuesFromProps(_props, _prevProps) { + return {}; + } + mount(instance) { + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value5, key) => this.bindToMotionValue(key, value5)); + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current; + if (true) { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected."); + } + if (this.parent) + this.parent.children.add(this); + this.update(this.props, this.presenceContext); + } + unmount() { + visualElementStore.delete(this.current); + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent && this.parent.children.delete(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + this.features[key].unmount(); + } + this.current = null; + } + bindToMotionValue(key, value5) { + const valueIsTransform = transformProps.has(key); + const removeOnChange = value5.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.update(this.notifyUpdate, false, true); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + }); + const removeOnRenderRequest = value5.on("renderRequest", this.scheduleRender); + this.valueSubscriptions.set(key, () => { + removeOnChange(); + removeOnRenderRequest(); + }); + } + sortNodePosition(other) { + if (!this.current || !this.sortInstanceNodePosition || this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + loadFeatures({ children, ...renderedProps }, isStrict, preloadedFeatures, initialLayoutGroupConfig) { + let ProjectionNodeConstructor; + let MeasureLayout3; + if (preloadedFeatures && isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + renderedProps.ignoreStrict ? warning(false, strictMessage) : invariant(false, strictMessage); + } + for (let i = 0;i < numFeatures; i++) { + const name = featureNames[i]; + const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent } = featureDefinitions[name]; + if (ProjectionNode) + ProjectionNodeConstructor = ProjectionNode; + if (isEnabled(renderedProps)) { + if (!this.features[name] && FeatureConstructor) { + this.features[name] = new FeatureConstructor(this); + } + if (MeasureLayoutComponent) { + MeasureLayout3 = MeasureLayoutComponent; + } + } + } + if (!this.projection && ProjectionNodeConstructor) { + this.projection = new ProjectionNodeConstructor(this.latestValues, this.parent && this.parent.projection); + const { layoutId, layout, drag: drag3, dragConstraints, layoutScroll, layoutRoot } = renderedProps; + this.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag3) || dragConstraints && isRefObject(dragConstraints), + visualElement: this, + scheduleRender: () => this.scheduleRender(), + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig: initialLayoutGroupConfig, + layoutScroll, + layoutRoot + }); + } + return MeasureLayout3; + } + updateFeatures() { + for (const key in this.features) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } else { + feature.mount(); + feature.isMounted = true; + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.options, this.props); + } + measureViewportBox() { + return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value5) { + this.latestValues[key] = value5; + } + makeTargetAnimatable(target, canMutate = true) { + return this.makeTargetAnimatableFromInstance(target, this.props, canMutate); + } + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + for (let i = 0;i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listener = props["on" + key]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : undefined; + } + getVariantContext(startAtParent = false) { + if (startAtParent) { + return this.parent ? this.parent.getVariantContext() : undefined; + } + if (!this.isControllingVariants) { + const context2 = this.parent ? this.parent.getVariantContext() || {} : {}; + if (this.props.initial !== undefined) { + context2.initial = this.props.initial; + } + return context2; + } + const context = {}; + for (let i = 0;i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = this.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + addValue(key, value5) { + if (value5 !== this.values.get(key)) { + this.removeValue(key); + this.bindToMotionValue(key, value5); + } + this.values.set(key, value5); + this.latestValues[key] = value5.get(); + } + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value5 = this.values.get(key); + if (value5 === undefined && defaultValue !== undefined) { + value5 = motionValue(defaultValue, { owner: this }); + this.addValue(key, value5); + } + return value5; + } + readValue(key) { + return this.latestValues[key] !== undefined || !this.current ? this.latestValues[key] : this.readValueFromInstance(this.current, key, this.options); + } + setBaseTarget(key, value5) { + this.baseTarget[key] = value5; + } + getBaseTarget(key) { + var _a; + const { initial } = this.props; + const valueFromInitial = typeof initial === "string" || typeof initial === "object" ? (_a = resolveVariantFromProps(this.props, initial)) === null || _a === undefined ? undefined : _a[key] : undefined; + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + return this.initialValues[key] !== undefined && valueFromInitial === undefined ? undefined : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager; + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } +} + +// node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs +class DOMVisualElement extends VisualElement { + sortInstanceNodePosition(a, b) { + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + return props.style ? props.style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + makeTargetAnimatableFromInstance({ transition, transitionEnd, ...target }, { transformValues }, isMounted) { + let origin = getOrigin(target, transition || {}, this); + if (transformValues) { + if (transitionEnd) + transitionEnd = transformValues(transitionEnd); + if (target) + target = transformValues(target); + if (origin) + origin = transformValues(origin); + } + if (isMounted) { + checkTargetForNewValues(this, target, origin); + const parsed = parseDomVariant(this, target, origin, transitionEnd); + transitionEnd = parsed.transitionEnd; + target = parsed.target; + } + return { + transition, + transitionEnd, + ...target + }; + } +} + +// node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs +var getComputedStyle2 = function(element) { + return window.getComputedStyle(element); +}; + +class HTMLVisualElement extends DOMVisualElement { + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } else { + const computedStyle = getComputedStyle2(instance); + const value5 = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0; + return typeof value5 === "string" ? value5.trim() : value5; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, options, props) { + buildHTMLStyles(renderState, latestValues, options, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps) { + return scrapeMotionValuesFromProps(props, prevProps); + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) + this.current.textContent = `${latest}`; + }); + } + } + renderInstance(instance, renderState, styleProp, projection) { + renderHTML(instance, renderState, styleProp, projection); + } +} + +// node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs +class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.isSVGTag = false; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + measureInstanceViewportBox() { + return createBox(); + } + scrapeMotionValuesFromProps(props, prevProps) { + return scrapeMotionValuesFromProps2(props, prevProps); + } + build(renderState, latestValues, options, props) { + buildSVGAttrs(renderState, latestValues, options, this.isSVGTag, props.transformTemplate); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } +} + +// node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs +var createDomVisualElement = (Component, options) => { + return isSVGComponent(Component) ? new SVGVisualElement(options, { enableHardwareAcceleration: false }) : new HTMLVisualElement(options, { enableHardwareAcceleration: true }); +}; + +// node_modules/framer-motion/dist/es/motion/features/layout.mjs +var layout = { + layout: { + ProjectionNode: HTMLProjectionNode, + MeasureLayout + } +}; + +// node_modules/framer-motion/dist/es/render/dom/motion.mjs +var preloadedFeatures = { + ...animations, + ...gestureAnimations, + ...drag2, + ...layout +}; +var motion2 = createMotionProxy((Component, config) => createDomMotionConfig(Component, config, preloadedFeatures, createDomVisualElement)); +// src/FPContainer.tsx +var jsx_runtime = __toESM(require_jsx_runtime()); +var isSsr = typeof window === "undefined" || typeof document === "undefined"; +var FPContainer = ({ + children, + className = "", + keyboardShortcut = true, + motionProps = {}, + onChange, + onHide, + onShow, + outerStyle = {}, + style = {}, + transitionTiming = 700 +}) => { + const throttled = import_react19.useRef(false); + const ticking = import_react19.useRef(false); + const scrollY = import_react19.useRef(isSsr ? 0 : window.scrollY); + const useOuterStyle = import_react19.useMemo(() => ({ + left: 0, + position: "fixed", + right: 0, + top: 0, + ...outerStyle + }), [outerStyle]); + const useStyle2 = import_react19.useMemo(() => ({ + position: "absolute", + left: 0, + right: 0, + ...style + }), [style]); + const FPContainerInnerRef = import_react19.useRef(null); + const { ReactFPRef, slides } = import_react19.useContext(FPContext); + const [pageState, setPageState] = import_react19.useState({ + fullpageHeight: 0, + offsetHeight: 0, + resetScroll: false, + slideIndex: 0, + transitionTiming, + translateY: 0, + viewportHeight: 0 + }); + const handleScroll = (e) => { + if (throttled.current || isSsr) + return; + throttled.current = true; + e.stopPropagation(); + setTimeout(() => { + throttled.current = false; + }, transitionTiming); + if (!ticking.current) { + window.requestAnimationFrame(() => { + const newScrollY = window.scrollY; + const prevScrollY = scrollY.current; + if (prevScrollY < newScrollY) + forward(); + else if (prevScrollY > newScrollY) + back3(); + if (pageState.resetScroll || transitionTiming !== pageState.transitionTiming) + setPageState((prevState) => ({ + ...prevState, + resetScroll: false, + transitionTiming + })); + ticking.current = false; + }); + ticking.current = true; + } + }; + const handleResize = () => { + if (!FPContainerInnerRef.current || isSsr) + return; + const curHeight = Math.max(document.documentElement.clientHeight, window.innerHeight); + if (pageState.fullpageHeight === FPContainerInnerRef.current.clientHeight && pageState.viewportHeight === curHeight) + return; + if (!ticking.current) { + requestAnimationFrame(() => { + const fullpageHeight = FPContainerInnerRef.current.clientHeight; + setPageState((prevState) => ({ + ...prevState, + fullpageHeight, + viewportHeight: Math.max(document.documentElement.clientHeight, window.innerHeight) + })); + ReactFPRef.current.style.height = `${fullpageHeight}px`; + ticking.current = false; + }); + ticking.current = true; + } + }; + const handleKeys = (event) => { + if (!keyboardShortcut) + return; + switch (event.code) { + case "PageDown": + case "ArrowRight": + case "ArrowDown": { + event.stopPropagation(); + return forward(); + } + case "PageUp": + case "ArrowLeft": + case "ArrowUp": { + event.stopPropagation(); + return back3(); + } + case "End": { + event.stopPropagation(); + return last(); + } + case "Home": { + event.stopPropagation(); + return first(); + } + } + }; + const goto = (slideIndex, resetScroll = false) => { + if (!slides[slideIndex] || pageState.slideIndex === slideIndex || isSsr) + return; + const { transitionTiming: transitionTiming2, fullpageHeight, viewportHeight } = pageState; + const newSlide = slides[slideIndex]; + const translateY = Math.max((fullpageHeight - viewportHeight) * -1, newSlide.current.offsetTop * -1); + if (typeof onHide === "function") { + setTimeout(() => onHide(translateY, transitionTiming2)); + } + throttled.current = true; + const newPageState = { + offsetHeight: newSlide.current.offsetHeight, + resetScroll, + slideIndex, + translateY + }; + setPageState((prevState) => ({ ...prevState, ...newPageState })); + setTimeout(() => { + throttled.current = false; + scrollY.current = window.scrollY; + }, transitionTiming2); + if (typeof onShow === "function") { + onShow(newPageState); + } + if (typeof onChange === "function") { + onChange({ ...newPageState, slideIndex, slides }); + } + }; + const last = () => { + if (slides.length <= 1) + return; + goto(slides.length - 1, true); + }; + const back3 = () => { + if (slides.length <= 1) + return; + switch (pageState.slideIndex) { + case 0: + return last(); + default: + return goto(pageState.slideIndex - 1, true); + } + }; + const first = () => { + if (slides.length <= 1) + return; + goto(0, true); + }; + const forward = () => { + if (slides.length <= 1) + return; + switch (pageState.slideIndex) { + case slides.length - 1: + return first(); + default: + return goto(pageState.slideIndex + 1, true); + } + }; + import_react19.useEffect(() => { + if (isSsr) + return; + window.addEventListener("scroll", handleScroll, { passive: true }); + window.addEventListener("resize", handleResize, { passive: true }); + document.addEventListener("keydown", handleKeys, { passive: true }); + return () => { + window.removeEventListener("scroll", handleScroll); + window.removeEventListener("resize", handleResize); + document.removeEventListener("keydown", handleKeys); + }; + }); + import_react19.useEffect(() => { + handleResize(); + }); + return jsx_runtime.jsx("div", { + style: useOuterStyle, + children: jsx_runtime.jsx(motion2.div, { + ref: FPContainerInnerRef, + className, + style: { + transition: `transform ${pageState.transitionTiming}ms cubic-bezier(0.645, 0.045, 0.355, 1.000)`, + transform: `translate3D(0, ${pageState.translateY}px, 0)`, + ...useStyle2 + }, + ...motionProps, + children + }) + }); +}; +// src/FPContext.tsx +var import_react20 = __toESM(require_react()); +var observeFn = (el) => el; +var FPContext = import_react20.createContext({ + getIndex: (el) => 0, + ReactFPRef: null, + slides: [], + subscribe: observeFn, + unsubscribe: observeFn +}); +// src/FPItem.tsx +var import_react21 = __toESM(require_react()); +var jsx_runtime2 = __toESM(require_jsx_runtime()); +var FPItem = ({ + children, + className = "", + height = "100vh", + style = {}, + motionProps = {} +}) => { + const { subscribe, unsubscribe, getIndex } = import_react21.useContext(FPContext); + const FPItemRef2 = import_react21.useRef(null); + import_react21.useEffect(() => { + subscribe(FPItemRef2); + return () => { + unsubscribe(FPItemRef2); + }; + }, []); + return jsx_runtime2.jsx(motion2.div, { + className, + style: { + height, + ...style + }, + ref: FPItemRef2, + ...motionProps, + children + }); +}; +// src/FSButton.tsx +var jsx_runtime3 = __toESM(require_jsx_runtime()); +var FSButton = ({ onClick, style }) => { + const motionProps = { + initial: { + scale: 0 + }, + animate: { + rotate: 180, + scale: 1 + }, + transition: { + type: "spring", + stiffness: 260, + damping: 20 + } + }; + return jsx_runtime3.jsx(motion2.button, { + onClick, + style, + ...motionProps, + children: "\u2725" + }); +}; +// src/ReactFP.tsx +var import_react23 = __toESM(require_react()); + +// node_modules/react-full-screen/dist/index.modern.js +var import_react22 = __toESM(require_react()); + +// node_modules/fscreen/dist/fscreen.esm.js +var key = { + fullscreenEnabled: 0, + fullscreenElement: 1, + requestFullscreen: 2, + exitFullscreen: 3, + fullscreenchange: 4, + fullscreenerror: 5, + fullscreen: 6 +}; +var webkit = [ + "webkitFullscreenEnabled", + "webkitFullscreenElement", + "webkitRequestFullscreen", + "webkitExitFullscreen", + "webkitfullscreenchange", + "webkitfullscreenerror", + "-webkit-full-screen" +]; +var moz = [ + "mozFullScreenEnabled", + "mozFullScreenElement", + "mozRequestFullScreen", + "mozCancelFullScreen", + "mozfullscreenchange", + "mozfullscreenerror", + "-moz-full-screen" +]; +var ms = [ + "msFullscreenEnabled", + "msFullscreenElement", + "msRequestFullscreen", + "msExitFullscreen", + "MSFullscreenChange", + "MSFullscreenError", + "-ms-fullscreen" +]; +var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {}; +var vendor = ("fullscreenEnabled" in document2) && Object.keys(key) || (webkit[0] in document2) && webkit || (moz[0] in document2) && moz || (ms[0] in document2) && ms || []; +var fscreen = { + requestFullscreen: function(element) { + return element[vendor[key.requestFullscreen]](); + }, + requestFullscreenFunction: function(element) { + return element[vendor[key.requestFullscreen]]; + }, + get exitFullscreen() { + return document2[vendor[key.exitFullscreen]].bind(document2); + }, + get fullscreenPseudoClass() { + return ":" + vendor[key.fullscreen]; + }, + addEventListener: function(type, handler, options) { + return document2.addEventListener(vendor[key[type]], handler, options); + }, + removeEventListener: function(type, handler, options) { + return document2.removeEventListener(vendor[key[type]], handler, options); + }, + get fullscreenEnabled() { + return Boolean(document2[vendor[key.fullscreenEnabled]]); + }, + set fullscreenEnabled(val) { + }, + get fullscreenElement() { + return document2[vendor[key.fullscreenElement]]; + }, + set fullscreenElement(val) { + }, + get onfullscreenchange() { + return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()]; + }, + set onfullscreenchange(handler) { + return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()] = handler; + }, + get onfullscreenerror() { + return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()]; + }, + set onfullscreenerror(handler) { + return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()] = handler; + } +}; +var fscreen_esm_default = fscreen; + +// node_modules/react-full-screen/dist/index.modern.js +var useFullScreenHandle = function() { + var _useState = import_react22.useState(false), active = _useState[0], setActive = _useState[1]; + var node = import_react22.useRef(null); + import_react22.useEffect(function() { + var handleChange = function handleChange() { + setActive(fscreen_esm_default.fullscreenElement === node.current); + }; + fscreen_esm_default.addEventListener("fullscreenchange", handleChange); + return function() { + return fscreen_esm_default.removeEventListener("fullscreenchange", handleChange); + }; + }, []); + var enter = import_react22.useCallback(function() { + if (fscreen_esm_default.fullscreenElement) { + return fscreen_esm_default.exitFullscreen().then(function() { + return fscreen_esm_default.requestFullscreen(node.current); + }); + } else if (node.current) { + return fscreen_esm_default.requestFullscreen(node.current); + } + }, []); + var exit2 = import_react22.useCallback(function() { + if (fscreen_esm_default.fullscreenElement === node.current) { + return fscreen_esm_default.exitFullscreen(); + } + return Promise.resolve(); + }, []); + return import_react22.useMemo(function() { + return { + active, + enter, + exit: exit2, + node + }; + }, [active, enter, exit2]); +}; +var FullScreen = function FullScreen2(_ref) { + var { handle, onChange, children, className } = _ref; + var classNames = []; + if (className) { + classNames.push(className); + } + classNames.push("fullscreen"); + if (handle.active) { + classNames.push("fullscreen-enabled"); + } + import_react22.useEffect(function() { + if (onChange) { + onChange(handle.active, handle); + } + }, [handle.active]); + return import_react22.default.createElement("div", { + className: classNames.join(" "), + ref: handle.node, + style: handle.active ? { + height: "100%", + width: "100%" + } : undefined + }, children); +}; + +// src/ReactFP.tsx +var jsx_runtime4 = __toESM(require_jsx_runtime()); +var ReactFP = ({ + children, + Button = FSButton, + buttonStyle = {}, + className = "", + motionProps = {}, + style = {} +}) => { + const useStyle2 = import_react23.useMemo(() => ({ + position: "relative", + ...style + }), [style]); + const [slides, setSlides] = import_react23.useState([]); + const fullscreen = import_react23.useRef(false); + const ReactFPRef = import_react23.useRef(null); + const getIndex = (slide) => { + return slides.indexOf(slide); + }; + const subscribe = (slide) => setSlides((prevSlides) => [...prevSlides, slide].sort(({ current: a }, { current: b }) => { + const aTop = a.offsetTop; + const bTop = b.offsetTop; + return aTop - bTop; + })); + const unsubscribe = (slide) => setSlides((prevSlides) => prevSlides.filter((s) => s !== slide)); + const handle = useFullScreenHandle(); + return jsx_runtime4.jsx(FullScreen, { + handle, + children: [ + jsx_runtime4.jsx(Button, { + onClick: () => { + { + fullscreen.current ? handle.exit() : handle.enter(); + } + return void (fullscreen.current = !fullscreen.current); + }, + style: { + position: "fixed", + left: 10, + top: 10, + zIndex: 9999, + ...buttonStyle + } + }), + jsx_runtime4.jsx(FPContext.Provider, { + value: { + getIndex, + ReactFPRef, + slides, + subscribe, + unsubscribe + }, + children: jsx_runtime4.jsx(motion2.div, { + style: useStyle2, + ref: ReactFPRef, + className, + ...motionProps, + children + }) + }) + ] + }); +}; +export { + ReactFP, + FSButton, + FPItem, + FPContext, + FPContainer +}; diff --git a/package.json b/package.json index 77cbd82..0507b97 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "module": "src/index.ts", "scripts": { "barrels": "bunx barrelsby --config ./barrels.json", - "build": "rm -rf ./dist/* && bun build src/index.tsx --outdir ./dist", + "build": "rm -rf ./dist/* && bun build src/index.ts --outdir ./dist", "lint": "bunx eslint src -- --fix", "pretty": "bunx prettier --write 'src/**/*.(ts|tsx)'", "upgrade:deps": "bunx ncu -u && bun install"