var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// http-url:https://unpkg.com/react@19.2.6/cjs/react.production.js
var require_react_production = __commonJS({
  "http-url:https://unpkg.com/react@19.2.6/cjs/react.production.js"(exports) {
    "use strict";
    var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
    var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
    var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
    var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
    var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
    var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
    var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
    var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
    var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
    var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
    var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
    var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
    var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
    function getIteratorFn(maybeIterable) {
      if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
      maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
      return "function" === typeof maybeIterable ? maybeIterable : null;
    }
    var ReactNoopUpdateQueue = {
      isMounted: function() {
        return false;
      },
      enqueueForceUpdate: function() {
      },
      enqueueReplaceState: function() {
      },
      enqueueSetState: function() {
      }
    };
    var assign = Object.assign;
    var 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 ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
        throw Error(
          "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");
    };
    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;
    var isArrayImpl = Array.isArray;
    function noop() {
    }
    var ReactSharedInternals = { H: null, A: null, T: null, S: null };
    var hasOwnProperty = Object.prototype.hasOwnProperty;
    function ReactElement(type, key, props) {
      var refProp = props.ref;
      return {
        $$typeof: REACT_ELEMENT_TYPE,
        type,
        key,
        ref: void 0 !== refProp ? refProp : null,
        props
      };
    }
    function cloneAndReplaceKey(oldElement, newKey) {
      return ReactElement(oldElement.type, newKey, oldElement.props);
    }
    function isValidElement(object) {
      return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
    }
    function escape(key) {
      var escaperLookup = { "=": "=0", ":": "=2" };
      return "$" + key.replace(/[=:]/g, function(match) {
        return escaperLookup[match];
      });
    }
    var userProvidedKeyEscapeRegex = /\/+/g;
    function getElementKey(element, index) {
      return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
    }
    function resolveThenable(thenable) {
      switch (thenable.status) {
        case "fulfilled":
          return thenable.value;
        case "rejected":
          throw thenable.reason;
        default:
          switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
            function(fulfilledValue) {
              "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
            },
            function(error) {
              "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
            }
          )), thenable.status) {
            case "fulfilled":
              return thenable.value;
            case "rejected":
              throw thenable.reason;
          }
      }
      throw thenable;
    }
    function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
      var type = typeof children;
      if ("undefined" === type || "boolean" === type) children = null;
      var invokeCallback = false;
      if (null === children) invokeCallback = true;
      else
        switch (type) {
          case "bigint":
          case "string":
          case "number":
            invokeCallback = true;
            break;
          case "object":
            switch (children.$$typeof) {
              case REACT_ELEMENT_TYPE:
              case REACT_PORTAL_TYPE:
                invokeCallback = true;
                break;
              case REACT_LAZY_TYPE:
                return invokeCallback = children._init, mapIntoArray(
                  invokeCallback(children._payload),
                  array,
                  escapedPrefix,
                  nameSoFar,
                  callback
                );
            }
        }
      if (invokeCallback)
        return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
          return c;
        })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
          callback,
          escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
            userProvidedKeyEscapeRegex,
            "$&/"
          ) + "/") + invokeCallback
        )), array.push(callback)), 1;
      invokeCallback = 0;
      var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
      if (isArrayImpl(children))
        for (var i = 0; i < children.length; i++)
          nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
            nameSoFar,
            array,
            escapedPrefix,
            type,
            callback
          );
      else if (i = getIteratorFn(children), "function" === typeof i)
        for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
          nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
            nameSoFar,
            array,
            escapedPrefix,
            type,
            callback
          );
      else if ("object" === type) {
        if ("function" === typeof children.then)
          return mapIntoArray(
            resolveThenable(children),
            array,
            escapedPrefix,
            nameSoFar,
            callback
          );
        array = String(children);
        throw Error(
          "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
        );
      }
      return invokeCallback;
    }
    function mapChildren(children, func, context) {
      if (null == children) return children;
      var result = [], count = 0;
      mapIntoArray(children, result, "", "", function(child) {
        return func.call(context, child, count++);
      });
      return result;
    }
    function lazyInitializer(payload) {
      if (-1 === payload._status) {
        var ctor = payload._result;
        ctor = ctor();
        ctor.then(
          function(moduleObject) {
            if (0 === payload._status || -1 === payload._status)
              payload._status = 1, payload._result = moduleObject;
          },
          function(error) {
            if (0 === payload._status || -1 === payload._status)
              payload._status = 2, payload._result = error;
          }
        );
        -1 === payload._status && (payload._status = 0, payload._result = ctor);
      }
      if (1 === payload._status) return payload._result.default;
      throw payload._result;
    }
    var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
      if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
        var event = new window.ErrorEvent("error", {
          bubbles: true,
          cancelable: true,
          message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
          error
        });
        if (!window.dispatchEvent(event)) return;
      } else if ("object" === typeof process && "function" === typeof process.emit) {
        process.emit("uncaughtException", error);
        return;
      }
      console.error(error);
    };
    var Children = {
      map: mapChildren,
      forEach: function(children, forEachFunc, forEachContext) {
        mapChildren(
          children,
          function() {
            forEachFunc.apply(this, arguments);
          },
          forEachContext
        );
      },
      count: function(children) {
        var n = 0;
        mapChildren(children, function() {
          n++;
        });
        return n;
      },
      toArray: function(children) {
        return mapChildren(children, function(child) {
          return child;
        }) || [];
      },
      only: function(children) {
        if (!isValidElement(children))
          throw Error(
            "React.Children.only expected to receive a single React element child."
          );
        return children;
      }
    };
    exports.Activity = REACT_ACTIVITY_TYPE;
    exports.Children = Children;
    exports.Component = Component;
    exports.Fragment = REACT_FRAGMENT_TYPE;
    exports.Profiler = REACT_PROFILER_TYPE;
    exports.PureComponent = PureComponent;
    exports.StrictMode = REACT_STRICT_MODE_TYPE;
    exports.Suspense = REACT_SUSPENSE_TYPE;
    exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
    exports.__COMPILER_RUNTIME = {
      __proto__: null,
      c: function(size) {
        return ReactSharedInternals.H.useMemoCache(size);
      }
    };
    exports.cache = function(fn) {
      return function() {
        return fn.apply(null, arguments);
      };
    };
    exports.cacheSignal = function() {
      return null;
    };
    exports.cloneElement = function(element, config, children) {
      if (null === element || void 0 === element)
        throw Error(
          "The argument must be a React element, but you passed " + element + "."
        );
      var props = assign({}, element.props), key = element.key;
      if (null != config)
        for (propName in void 0 !== config.key && (key = "" + config.key), config)
          !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
      var propName = arguments.length - 2;
      if (1 === propName) props.children = children;
      else if (1 < propName) {
        for (var childArray = Array(propName), i = 0; i < propName; i++)
          childArray[i] = arguments[i + 2];
        props.children = childArray;
      }
      return ReactElement(element.type, key, props);
    };
    exports.createContext = function(defaultValue) {
      defaultValue = {
        $$typeof: REACT_CONTEXT_TYPE,
        _currentValue: defaultValue,
        _currentValue2: defaultValue,
        _threadCount: 0,
        Provider: null,
        Consumer: null
      };
      defaultValue.Provider = defaultValue;
      defaultValue.Consumer = {
        $$typeof: REACT_CONSUMER_TYPE,
        _context: defaultValue
      };
      return defaultValue;
    };
    exports.createElement = function(type, config, children) {
      var propName, props = {}, key = null;
      if (null != config)
        for (propName in void 0 !== config.key && (key = "" + config.key), config)
          hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
      var childrenLength = arguments.length - 2;
      if (1 === childrenLength) props.children = children;
      else if (1 < childrenLength) {
        for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
          childArray[i] = arguments[i + 2];
        props.children = childArray;
      }
      if (type && type.defaultProps)
        for (propName in childrenLength = type.defaultProps, childrenLength)
          void 0 === props[propName] && (props[propName] = childrenLength[propName]);
      return ReactElement(type, key, props);
    };
    exports.createRef = function() {
      return { current: null };
    };
    exports.forwardRef = function(render) {
      return { $$typeof: REACT_FORWARD_REF_TYPE, render };
    };
    exports.isValidElement = isValidElement;
    exports.lazy = function(ctor) {
      return {
        $$typeof: REACT_LAZY_TYPE,
        _payload: { _status: -1, _result: ctor },
        _init: lazyInitializer
      };
    };
    exports.memo = function(type, compare) {
      return {
        $$typeof: REACT_MEMO_TYPE,
        type,
        compare: void 0 === compare ? null : compare
      };
    };
    exports.startTransition = function(scope) {
      var prevTransition = ReactSharedInternals.T, currentTransition = {};
      ReactSharedInternals.T = currentTransition;
      try {
        var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
        null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
        "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
      } catch (error) {
        reportGlobalError(error);
      } finally {
        null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
      }
    };
    exports.unstable_useCacheRefresh = function() {
      return ReactSharedInternals.H.useCacheRefresh();
    };
    exports.use = function(usable) {
      return ReactSharedInternals.H.use(usable);
    };
    exports.useActionState = function(action, initialState, permalink) {
      return ReactSharedInternals.H.useActionState(action, initialState, permalink);
    };
    exports.useCallback = function(callback, deps) {
      return ReactSharedInternals.H.useCallback(callback, deps);
    };
    exports.useContext = function(Context) {
      return ReactSharedInternals.H.useContext(Context);
    };
    exports.useDebugValue = function() {
    };
    exports.useDeferredValue = function(value, initialValue) {
      return ReactSharedInternals.H.useDeferredValue(value, initialValue);
    };
    exports.useEffect = function(create, deps) {
      return ReactSharedInternals.H.useEffect(create, deps);
    };
    exports.useEffectEvent = function(callback) {
      return ReactSharedInternals.H.useEffectEvent(callback);
    };
    exports.useId = function() {
      return ReactSharedInternals.H.useId();
    };
    exports.useImperativeHandle = function(ref, create, deps) {
      return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
    };
    exports.useInsertionEffect = function(create, deps) {
      return ReactSharedInternals.H.useInsertionEffect(create, deps);
    };
    exports.useLayoutEffect = function(create, deps) {
      return ReactSharedInternals.H.useLayoutEffect(create, deps);
    };
    exports.useMemo = function(create, deps) {
      return ReactSharedInternals.H.useMemo(create, deps);
    };
    exports.useOptimistic = function(passthrough, reducer) {
      return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
    };
    exports.useReducer = function(reducer, initialArg, init) {
      return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
    };
    exports.useRef = function(initialValue) {
      return ReactSharedInternals.H.useRef(initialValue);
    };
    exports.useState = function(initialState) {
      return ReactSharedInternals.H.useState(initialState);
    };
    exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
      return ReactSharedInternals.H.useSyncExternalStore(
        subscribe,
        getSnapshot,
        getServerSnapshot
      );
    };
    exports.useTransition = function() {
      return ReactSharedInternals.H.useTransition();
    };
    exports.version = "19.2.6";
  }
});

// http-url:https://unpkg.com/react@19.2.6/index.js
var require_react_19_2 = __commonJS({
  "http-url:https://unpkg.com/react@19.2.6/index.js"(exports, module) {
    "use strict";
    if (true) {
      module.exports = require_react_production();
    } else {
      module.exports = null;
    }
  }
});

// virtual-filesystem:/index.3cb78b42bda9e145227e08f75af97c9eed7f7bb7850ed9821706b9f3d6c393b2.ts
var index_3cb78b42bda9e145227e08f75af97c9eed7f7bb7850ed9821706b9f3d6c393b2_exports = {};
__export(index_3cb78b42bda9e145227e08f75af97c9eed7f7bb7850ed9821706b9f3d6c393b2_exports, {
  BatchSpringEasing: () => BatchSpringEasing,
  CSSSpringEasing: () => CSSSpringEasing,
  EaseInOut: () => EaseInOut,
  EaseOut: () => EaseOut,
  EaseOutIn: () => EaseOutIn,
  EasingDurationCache: () => EasingDurationCache,
  EasingFunctionKeys: () => EasingFunctionKeys,
  EasingFunctions: () => EasingFunctions,
  EasingOptions: () => EasingOptions,
  FramePtsCache: () => FramePtsCache,
  GenerateSpringFrames: () => GenerateSpringFrames,
  INFINITE_LOOP_LIMIT: () => INFINITE_LOOP_LIMIT,
  SpringEasing: () => SpringEasing,
  SpringFrame: () => SpringFrame,
  SpringInFrame: () => SpringInFrame,
  SpringInOutFrame: () => SpringInOutFrame,
  SpringOutFrame: () => SpringOutFrame,
  SpringOutInFrame: () => SpringOutInFrame,
  batchInterpolateComplex: () => batchInterpolateComplex,
  batchInterpolateNumber: () => batchInterpolateNumber,
  batchInterpolateSequence: () => batchInterpolateSequence,
  batchInterpolateString: () => batchInterpolateString,
  batchInterpolateUsingIndex: () => batchInterpolateUsingIndex,
  getLinearSyntax: () => getLinearSyntax,
  getOptimizedPoints: () => getOptimizedPoints,
  getSpringDuration: () => getSpringDuration,
  getUnit: () => getUnit,
  interpolateComplex: () => interpolateComplex,
  interpolateNumber: () => interpolateNumber,
  interpolateSequence: () => interpolateSequence,
  interpolateString: () => interpolateString,
  interpolateUsingIndex: () => interpolateUsingIndex,
  isNumberLike: () => isNumberLike,
  limit: () => limit,
  parseEasingParameters: () => parseEasingParameters,
  ramerDouglasPeucker: () => ramerDouglasPeucker,
  registerEasingFunction: () => registerEasingFunction,
  registerEasingFunctions: () => registerEasingFunctions,
  scale: () => scale,
  squaredSegmentDistance: () => squaredSegmentDistance,
  toAnimationFrames: () => toAnimationFrames,
  toFixed: () => toFixed
});

// http-url:https://unpkg.com/spring-easing@2.3.3/lib/index.mjs
function isNumberLike(num) {
  const value = parseFloat(num);
  return typeof value == "number" && !Number.isNaN(value);
}
function limit(value, min, max) {
  return Math.min(Math.max(value, min), max);
}
function scale(t, start, end) {
  return start + (end - start) * t;
}
function toFixed(value, decimal) {
  return Math.round(value * 10 ** decimal) / 10 ** decimal;
}
function getUnit(str) {
  const num = parseFloat(str);
  return str.toString().replace(num.toString(), "");
}
function batchInterpolateNumber(arr_t, values, decimal = 3) {
  const n = values.length - 1;
  const results = [];
  let t = 0;
  let t_index = 0;
  let len = arr_t.length;
  for (; t_index < len; t_index++) {
    t = arr_t[t_index];
    const i = limit(Math.floor(t * n), 0, n - 1);
    const start = values[i];
    const end = values[i + 1];
    const progress = (t - i / n) * n;
    results.push(toFixed(scale(progress, start, end), decimal));
  }
  return results;
}
function batchInterpolateSequence(arr_t, values) {
  const n = values.length - 1;
  const results = [];
  let t = 0;
  let t_index = 0;
  let len = arr_t.length;
  for (; t_index < len; t_index++) {
    t = limit(arr_t[t_index], 0, 1);
    const i = Math.round(t * n);
    results.push(values[i]);
  }
  return results;
}
var batchInterpolateUsingIndex = batchInterpolateSequence;
function batchInterpolateString(arr_t, values, decimal = 3) {
  let units = "";
  if (isNumberLike(values[0]))
    units = getUnit(values[0]);
  return batchInterpolateNumber(
    arr_t,
    values.map((v) => typeof v === "number" ? v : parseFloat(v)),
    decimal
  ).map((value) => value + units);
}
function batchInterpolateComplex(arr_t, values, decimal = 3) {
  let isNumber = true;
  let isLikeNumber = true;
  let i = 0;
  let v;
  const len = values.length;
  for (; i < len; i++) {
    v = values[i];
    if (isNumber)
      isNumber = typeof v === "number";
    if (isLikeNumber)
      isLikeNumber = isNumberLike(v);
  }
  if (isNumber)
    return batchInterpolateNumber(arr_t, values, decimal);
  if (isLikeNumber)
    return batchInterpolateString(arr_t, values, decimal);
  return batchInterpolateSequence(arr_t, values);
}
function BatchSpringEasing(values, options = {}, customInterpolate = batchInterpolateComplex) {
  const optionsObj = EasingOptions(options);
  const [frames, duration] = GenerateSpringFrames(optionsObj);
  return [
    customInterpolate == null ? void 0 : customInterpolate(frames, values, optionsObj.decimal),
    duration
  ];
}
function toAnimationFrames(customInterpolate) {
  return (arr_t, values, decimal) => {
    return arr_t.map((t) => customInterpolate(t, values, decimal));
  };
}
function squaredSegmentDistance(point, lineStart, lineEnd) {
  let [x, y] = lineStart;
  let dx = lineEnd[0] - x;
  let dy = lineEnd[1] - y;
  if (dx !== 0 || dy !== 0) {
    let t = ((point[0] - x) * dx + (point[1] - y) * dy) / (dx * dx + dy * dy);
    if (t > 1) {
      x = lineEnd[0];
      y = lineEnd[1];
    } else if (t > 0) {
      x += dx * t;
      y += dy * t;
    }
  }
  dx = point[0] - x;
  dy = point[1] - y;
  return dx * dx + dy * dy;
}
function ramerDouglasPeucker(points, tolerance) {
  const sqTolerance = tolerance * tolerance;
  if (points.length < 3)
    return points;
  let result = [points[0]];
  let stack = [[0, points.length - 1]];
  while (stack.length > 0) {
    let [start, end] = stack.pop();
    let maxSqDist = 0;
    let index = 0;
    for (let i = start + 1; i < end; i++) {
      const sqDist = squaredSegmentDistance(points[i], points[start], points[end]);
      if (sqDist > maxSqDist) {
        index = i;
        maxSqDist = sqDist;
      }
    }
    if (maxSqDist > sqTolerance) {
      stack.push([start, index]);
      stack.push([index, end]);
    } else {
      result.push(points[end]);
    }
  }
  return result.sort((a, b) => a[0] - b[0]);
}
function getOptimizedPoints(fullPoints, simplify, round) {
  if (!fullPoints)
    return null;
  const xRounding = Math.max(round, 2);
  return ramerDouglasPeucker(fullPoints, simplify).map(
    ([x, y]) => [
      toFixed(x, xRounding),
      // Round x values
      toFixed(y, round)
      // Round y values
    ]
  );
}
function getLinearSyntax(points, round) {
  if (!points)
    return [];
  const xFormat = new Intl.NumberFormat("en-US", {
    maximumFractionDigits: Math.max(round - 2, 0)
  });
  const yFormat = new Intl.NumberFormat("en-US", {
    maximumFractionDigits: round
  });
  const pointsValue = points;
  const valuesWithRedundantX = /* @__PURE__ */ new Set();
  const maxDelta = 1 / 10 ** round;
  for (const [i, value] of pointsValue.entries()) {
    const [x] = value;
    if (i === 0) {
      if (x === 0)
        valuesWithRedundantX.add(value);
      continue;
    }
    if (i === pointsValue.length - 1) {
      const previous2 = pointsValue[i - 1][0];
      if (x === 1 && previous2 <= 1)
        valuesWithRedundantX.add(value);
      continue;
    }
    const previous = pointsValue[i - 1][0];
    const next = pointsValue[i + 1][0];
    const averagePos = (next - previous) / 2 + previous;
    const delta = Math.abs(x - averagePos);
    if (delta < maxDelta)
      valuesWithRedundantX.add(value);
  }
  const groupedValues = [[pointsValue[0]]];
  for (const value of pointsValue.slice(1)) {
    if (value[1] === groupedValues.at(-1)[0][1]) {
      groupedValues.at(-1).push(value);
    } else {
      groupedValues.push([value]);
    }
  }
  const outputValues = groupedValues.map((group) => {
    const yValue = yFormat.format(group[0][1]);
    const regularValue = group.map((value) => {
      const [x] = value;
      let output = yValue;
      if (!valuesWithRedundantX.has(value)) {
        output += " " + xFormat.format(x * 100) + "%";
      }
      return output;
    }).join(", ");
    if (group.length === 1)
      return regularValue;
    const xVals = [group[0][0], group.at(-1)[0]];
    const positionalValues = xVals.map((x) => xFormat.format(x * 100) + "%").join(" ");
    const skipValue = `${yValue} ${positionalValues}`;
    return skipValue.length > regularValue.length ? regularValue : skipValue;
  });
  return outputValues;
}
function CSSSpringEasing(options = {}) {
  const optionsObj = EasingOptions(options);
  const [frames, duration] = GenerateSpringFrames(optionsObj);
  const quality = limit(optionsObj.quality ?? 0.85, 0, 1);
  const simplify = scale(1 - quality, 0, 0.025);
  const len = frames.length;
  const pts = frames.map((x, i) => [i / (len - 1), x]);
  const optimizedPoints = getOptimizedPoints(pts, simplify, optionsObj.decimal);
  return [
    getLinearSyntax(optimizedPoints, optionsObj.decimal).join(", "),
    duration
  ];
}
var SpringFrame = (t, [mass = 1, stiffness = 100, damping = 10, velocity = 0] = [], duration) => {
  mass = limit(mass, 1e-4, 1e3);
  stiffness = limit(stiffness, 1e-4, 1e3);
  damping = limit(damping, 1e-4, 1e3);
  velocity = limit(velocity, 1e-4, 1e3);
  const w0 = Math.sqrt(stiffness / mass);
  const zeta = damping / (2 * Math.sqrt(stiffness * mass));
  const wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
  const b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
  let position = duration ? duration * t / 1e3 : t;
  if (zeta < 1) {
    position = Math.exp(-position * zeta * w0) * (Math.cos(wd * position) + b * Math.sin(wd * position));
  } else {
    position = (1 + b * position) * Math.exp(-position * w0);
  }
  return 1 - position;
};
var EasingDurationCache = /* @__PURE__ */ new Map();
var INFINITE_LOOP_LIMIT = 1e5;
function getSpringDuration([mass, stiffness, damping, velocity] = []) {
  let params = [mass, stiffness, damping, velocity];
  let easing = `${params}`;
  if (EasingDurationCache.has(easing))
    return EasingDurationCache.get(easing);
  const step = 1 / 6;
  let time = 0;
  let numPoints = 0;
  while (++numPoints < INFINITE_LOOP_LIMIT) {
    if (Math.abs(1 - SpringFrame(time, params)) < 1e-3) {
      let restStart = time;
      let restSteps = 1;
      while (++numPoints < INFINITE_LOOP_LIMIT) {
        time += step;
        if (Math.abs(1 - SpringFrame(time, params)) >= 1e-3)
          break;
        restSteps++;
        if (restSteps === 16) {
          const duration2 = restStart * 1e3;
          EasingDurationCache.set(easing, [duration2, numPoints]);
          return [duration2, numPoints];
        }
      }
    }
    time += step;
  }
  const duration = time * 1e3;
  EasingDurationCache.set(easing, [duration, numPoints]);
  return [duration, numPoints];
}
function EaseOut(frame) {
  return (t, params = [], duration) => 1 - frame(1 - t, params, duration);
}
function EaseInOut(frame) {
  return function(t, params = [], duration) {
    return t < 0.5 ? frame(t * 2, params, duration) / 2 : 1 - frame(t * -2 + 2, params, duration) / 2;
  };
}
function EaseOutIn(frame) {
  return function(t, params = [], duration) {
    return t < 0.5 ? (1 - frame(1 - t * 2, params, duration)) / 2 : (frame(t * 2 - 1, params, duration) + 1) / 2;
  };
}
var SpringInFrame = SpringFrame;
var SpringOutFrame = EaseOut(SpringFrame);
var SpringInOutFrame = EaseInOut(SpringFrame);
var SpringOutInFrame = EaseOutIn(SpringFrame);
function interpolateNumber(t, values, decimal = 3) {
  const n = values.length - 1;
  const i = limit(Math.floor(t * n), 0, n - 1);
  const start = values[i];
  const end = values[i + 1];
  const progress = (t - i / n) * n;
  return toFixed(scale(progress, start, end), decimal);
}
function interpolateSequence(t, values) {
  const n = values.length - 1;
  t = limit(t, 0, 1);
  const i = Math.round(t * n);
  return values[i];
}
var interpolateUsingIndex = interpolateSequence;
function interpolateString(t, values, decimal = 3) {
  let units = "";
  if (isNumberLike(values[0]))
    units = getUnit(values[0]);
  return interpolateNumber(
    t,
    values.map((v) => typeof v === "number" ? v : parseFloat(v)),
    decimal
  ) + units;
}
function interpolateComplex(t, values, decimal = 3) {
  const isNumber = values.every((v) => typeof v === "number");
  if (isNumber)
    return interpolateNumber(t, values, decimal);
  const isLikeNumber = values.every((v) => isNumberLike(v));
  if (isLikeNumber)
    return interpolateString(t, values, decimal);
  return interpolateSequence(t, values);
}
var EasingFunctions = {
  spring: SpringFrame,
  "spring-in": SpringInFrame,
  "spring-out": SpringOutFrame,
  "spring-in-out": SpringInOutFrame,
  "spring-out-in": SpringOutInFrame
};
var EasingFunctionKeys = Object.keys(EasingFunctions);
function registerEasingFunction(key, fn) {
  EasingFunctions = { ...EasingFunctions, [key]: fn };
  EasingFunctionKeys = Object.keys(EasingFunctions);
}
function registerEasingFunctions(obj) {
  EasingFunctions = { ...EasingFunctions, ...obj };
  EasingFunctionKeys = Object.keys(EasingFunctions);
}
function parseEasingParameters(str) {
  const match = /(\(|\s)([^)]+)\)?/.exec(str.toString());
  return match ? match[2].split(",").map((value) => {
    let num = parseFloat(value);
    return !Number.isNaN(num) ? num : value.trim();
  }) : [];
}
function EasingOptions(options = {}) {
  const isEasing = typeof options === "string" || Array.isArray(options) && typeof options[0] === "function";
  let {
    easing = [SpringFrame, 1, 100, 10, 0],
    numPoints = 38,
    decimal = 3,
    ...rest
  } = isEasing ? { easing: options } : options;
  if (typeof easing === "string") {
    const frameFunction = EasingFunctions[easing.replace(/(\(|\s).+/, "").toLowerCase().trim()];
    const params = parseEasingParameters(easing);
    easing = [frameFunction, ...params];
  }
  return { easing, numPoints, decimal, ...rest };
}
var FramePtsCache = /* @__PURE__ */ new Map();
function GenerateSpringFrames(options = {}) {
  let {
    easing,
    numPoints
  } = EasingOptions(options);
  if (Array.isArray(easing)) {
    if (typeof easing[0] != "function") {
      throw new Error(
        "[spring-easing] A frame function is required as the first element in the easing array, e.g. [SpringFrame, ...]"
      );
    }
  } else {
    throw new Error(
      `[spring-easing] The easing needs to be in the format:  
* "spring-out(mass, stiffness, damping, velocity)" or 
* [SpringOutFrame, mass, stiffness, damping, velocity], the easing recieved is "${easing}", [spring-easing] doesn't really know what to do with that.`
    );
  }
  let [frameFunction, ...params] = easing;
  const [idealDuration, idealNumPoints = 38] = getSpringDuration(params);
  if (!numPoints)
    numPoints = idealNumPoints;
  const key = `${params},${numPoints}`;
  if (FramePtsCache.has(key)) {
    let tempObj2 = FramePtsCache.get(key);
    if (tempObj2.has(frameFunction))
      return tempObj2.get(frameFunction);
  }
  const points = [];
  for (let i = 0; i < numPoints; i++) {
    points[i] = frameFunction(i / (numPoints - 1), params, idealDuration);
  }
  const tempObj = FramePtsCache.has(key) ? FramePtsCache.get(key) : /* @__PURE__ */ new WeakMap();
  tempObj.set(frameFunction, [points, idealDuration]);
  FramePtsCache.set(key, tempObj);
  return [points, idealDuration];
}
function SpringEasing(values, options = {}, customInterpolate = interpolateComplex) {
  const optionsObj = EasingOptions(options);
  const [frames, duration] = GenerateSpringFrames(optionsObj);
  return [
    frames.map((t) => customInterpolate(t, values, optionsObj.decimal)),
    duration
  ];
}

// virtual-filesystem:/index.3cb78b42bda9e145227e08f75af97c9eed7f7bb7850ed9821706b9f3d6c393b2.ts
__reExport(index_3cb78b42bda9e145227e08f75af97c9eed7f7bb7850ed9821706b9f3d6c393b2_exports, __toESM(require_react_19_2()));
export {
  BatchSpringEasing,
  CSSSpringEasing,
  EaseInOut,
  EaseOut,
  EaseOutIn,
  EasingDurationCache,
  EasingFunctionKeys,
  EasingFunctions,
  EasingOptions,
  FramePtsCache,
  GenerateSpringFrames,
  INFINITE_LOOP_LIMIT,
  SpringEasing,
  SpringFrame,
  SpringInFrame,
  SpringInOutFrame,
  SpringOutFrame,
  SpringOutInFrame,
  batchInterpolateComplex,
  batchInterpolateNumber,
  batchInterpolateSequence,
  batchInterpolateString,
  batchInterpolateUsingIndex,
  getLinearSyntax,
  getOptimizedPoints,
  getSpringDuration,
  getUnit,
  interpolateComplex,
  interpolateNumber,
  interpolateSequence,
  interpolateString,
  interpolateUsingIndex,
  isNumberLike,
  limit,
  parseEasingParameters,
  ramerDouglasPeucker,
  registerEasingFunction,
  registerEasingFunctions,
  scale,
  squaredSegmentDistance,
  toAnimationFrames,
  toFixed
};
/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/*!
 * Based off of https://github.com/jakearchibald/linear-easing-generator
 * 
 * Changes:
 * - Added comments and docs top explain logic
 * - Switched to iterative approach for the `ramerDouglasPeucker` algorithim
 * - Renamed functions, parameters and variables to improve readability and to better match a library usecase 
 * 
 * Copyright 2023 Jake Archibald [@jakearchibald](https://github.com/jakearchibald)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*!
 * Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
*/
