@acrool/react-jackpot
Version:
Jackpot list with React Component
1,525 lines (1,521 loc) • 187 kB
JavaScript
import _i, { createContext as Bt, useContext as z, useId as qo, useEffect as It, useCallback as we, Component as Zo, useLayoutEffect as Jo, useRef as qt, useInsertionEffect as Qo, useMemo as Ae, forwardRef as ta, Fragment as Bi, createElement as ea, useState as wn } from "react";
var rn = { exports: {} }, Gt = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ps;
function na() {
if (Ps)
return Gt;
Ps = 1;
var t = _i, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
function r(a, l, u) {
var c, h = {}, d = null, p = null;
u !== void 0 && (d = "" + u), l.key !== void 0 && (d = "" + l.key), l.ref !== void 0 && (p = l.ref);
for (c in l)
s.call(l, c) && !o.hasOwnProperty(c) && (h[c] = l[c]);
if (a && a.defaultProps)
for (c in l = a.defaultProps, l)
h[c] === void 0 && (h[c] = l[c]);
return { $$typeof: e, type: a, key: d, ref: p, props: h, _owner: i.current };
}
return Gt.Fragment = n, Gt.jsx = r, Gt.jsxs = r, Gt;
}
var Yt = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var bs;
function sa() {
return bs || (bs = 1, process.env.NODE_ENV !== "production" && function() {
var t = _i, e = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), r = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), g = Symbol.iterator, y = "@@iterator";
function x(f) {
if (f === null || typeof f != "object")
return null;
var m = g && f[g] || f[y];
return typeof m == "function" ? m : null;
}
var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function T(f) {
{
for (var m = arguments.length, P = new Array(m > 1 ? m - 1 : 0), w = 1; w < m; w++)
P[w - 1] = arguments[w];
b("error", f, P);
}
}
function b(f, m, P) {
{
var w = v.ReactDebugCurrentFrame, D = w.getStackAddendum();
D !== "" && (m += "%s", P = P.concat([D]));
var L = P.map(function(R) {
return String(R);
});
L.unshift("Warning: " + m), Function.prototype.apply.call(console[f], console, L);
}
}
var A = !1, E = !1, F = !1, q = !1, C = !1, W;
W = Symbol.for("react.module.reference");
function G(f) {
return !!(typeof f == "string" || typeof f == "function" || f === s || f === o || C || f === i || f === u || f === c || q || f === p || A || E || F || typeof f == "object" && f !== null && (f.$$typeof === d || f.$$typeof === h || f.$$typeof === r || f.$$typeof === a || f.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
f.$$typeof === W || f.getModuleId !== void 0));
}
function ft(f, m, P) {
var w = f.displayName;
if (w)
return w;
var D = m.displayName || m.name || "";
return D !== "" ? P + "(" + D + ")" : P;
}
function $t(f) {
return f.displayName || "Context";
}
function Z(f) {
if (f == null)
return null;
if (typeof f.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof f == "function")
return f.displayName || f.name || null;
if (typeof f == "string")
return f;
switch (f) {
case s:
return "Fragment";
case n:
return "Portal";
case o:
return "Profiler";
case i:
return "StrictMode";
case u:
return "Suspense";
case c:
return "SuspenseList";
}
if (typeof f == "object")
switch (f.$$typeof) {
case a:
var m = f;
return $t(m) + ".Consumer";
case r:
var P = f;
return $t(P._context) + ".Provider";
case l:
return ft(f, f.render, "ForwardRef");
case h:
var w = f.displayName || null;
return w !== null ? w : Z(f.type) || "Memo";
case d: {
var D = f, L = D._payload, R = D._init;
try {
return Z(R(L));
} catch {
return null;
}
}
}
return null;
}
var nt = Object.assign, wt = 0, Oe, B, J, At, Vt, ss, is;
function rs() {
}
rs.__reactDisabledLog = !0;
function So() {
{
if (wt === 0) {
Oe = console.log, B = console.info, J = console.warn, At = console.error, Vt = console.group, ss = console.groupCollapsed, is = console.groupEnd;
var f = {
configurable: !0,
enumerable: !0,
value: rs,
writable: !0
};
Object.defineProperties(console, {
info: f,
log: f,
warn: f,
error: f,
group: f,
groupCollapsed: f,
groupEnd: f
});
}
wt++;
}
}
function wo() {
{
if (wt--, wt === 0) {
var f = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: nt({}, f, {
value: Oe
}),
info: nt({}, f, {
value: B
}),
warn: nt({}, f, {
value: J
}),
error: nt({}, f, {
value: At
}),
group: nt({}, f, {
value: Vt
}),
groupCollapsed: nt({}, f, {
value: ss
}),
groupEnd: nt({}, f, {
value: is
})
});
}
wt < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var ke = v.ReactCurrentDispatcher, je;
function ae(f, m, P) {
{
if (je === void 0)
try {
throw Error();
} catch (D) {
var w = D.stack.trim().match(/\n( *(at )?)/);
je = w && w[1] || "";
}
return `
` + je + f;
}
}
var Fe = !1, le;
{
var Ao = typeof WeakMap == "function" ? WeakMap : Map;
le = new Ao();
}
function os(f, m) {
if (!f || Fe)
return "";
{
var P = le.get(f);
if (P !== void 0)
return P;
}
var w;
Fe = !0;
var D = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var L;
L = ke.current, ke.current = null, So();
try {
if (m) {
var R = function() {
throw Error();
};
if (Object.defineProperty(R.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(R, []);
} catch (Y) {
w = Y;
}
Reflect.construct(f, [], R);
} else {
try {
R.call();
} catch (Y) {
w = Y;
}
f.call(R.prototype);
}
} else {
try {
throw Error();
} catch (Y) {
w = Y;
}
f();
}
} catch (Y) {
if (Y && w && typeof Y.stack == "string") {
for (var V = Y.stack.split(`
`), K = w.stack.split(`
`), k = V.length - 1, _ = K.length - 1; k >= 1 && _ >= 0 && V[k] !== K[_]; )
_--;
for (; k >= 1 && _ >= 0; k--, _--)
if (V[k] !== K[_]) {
if (k !== 1 || _ !== 1)
do
if (k--, _--, _ < 0 || V[k] !== K[_]) {
var Q = `
` + V[k].replace(" at new ", " at ");
return f.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", f.displayName)), typeof f == "function" && le.set(f, Q), Q;
}
while (k >= 1 && _ >= 0);
break;
}
}
} finally {
Fe = !1, ke.current = L, wo(), Error.prepareStackTrace = D;
}
var Rt = f ? f.displayName || f.name : "", yt = Rt ? ae(Rt) : "";
return typeof f == "function" && le.set(f, yt), yt;
}
function Vo(f, m, P) {
return os(f, !1);
}
function Co(f) {
var m = f.prototype;
return !!(m && m.isReactComponent);
}
function ue(f, m, P) {
if (f == null)
return "";
if (typeof f == "function")
return os(f, Co(f));
if (typeof f == "string")
return ae(f);
switch (f) {
case u:
return ae("Suspense");
case c:
return ae("SuspenseList");
}
if (typeof f == "object")
switch (f.$$typeof) {
case l:
return Vo(f.render);
case h:
return ue(f.type, m, P);
case d: {
var w = f, D = w._payload, L = w._init;
try {
return ue(L(D), m, P);
} catch {
}
}
}
return "";
}
var Wt = Object.prototype.hasOwnProperty, as = {}, ls = v.ReactDebugCurrentFrame;
function ce(f) {
if (f) {
var m = f._owner, P = ue(f.type, f._source, m ? m.type : null);
ls.setExtraStackFrame(P);
} else
ls.setExtraStackFrame(null);
}
function Ro(f, m, P, w, D) {
{
var L = Function.call.bind(Wt);
for (var R in f)
if (L(f, R)) {
var V = void 0;
try {
if (typeof f[R] != "function") {
var K = Error((w || "React class") + ": " + P + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof f[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw K.name = "Invariant Violation", K;
}
V = f[R](m, R, w, P, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (k) {
V = k;
}
V && !(V instanceof Error) && (ce(D), T("%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).", w || "React class", P, R, typeof V), ce(null)), V instanceof Error && !(V.message in as) && (as[V.message] = !0, ce(D), T("Failed %s type: %s", P, V.message), ce(null));
}
}
}
var Eo = Array.isArray;
function _e(f) {
return Eo(f);
}
function Do(f) {
{
var m = typeof Symbol == "function" && Symbol.toStringTag, P = m && f[Symbol.toStringTag] || f.constructor.name || "Object";
return P;
}
}
function Mo(f) {
try {
return us(f), !1;
} catch {
return !0;
}
}
function us(f) {
return "" + f;
}
function cs(f) {
if (Mo(f))
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Do(f)), us(f);
}
var Kt = v.ReactCurrentOwner, Lo = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, fs, hs, Be;
Be = {};
function Oo(f) {
if (Wt.call(f, "ref")) {
var m = Object.getOwnPropertyDescriptor(f, "ref").get;
if (m && m.isReactWarning)
return !1;
}
return f.ref !== void 0;
}
function ko(f) {
if (Wt.call(f, "key")) {
var m = Object.getOwnPropertyDescriptor(f, "key").get;
if (m && m.isReactWarning)
return !1;
}
return f.key !== void 0;
}
function jo(f, m) {
if (typeof f.ref == "string" && Kt.current && m && Kt.current.stateNode !== m) {
var P = Z(Kt.current.type);
Be[P] || (T('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', Z(Kt.current.type), f.ref), Be[P] = !0);
}
}
function Fo(f, m) {
{
var P = function() {
fs || (fs = !0, T("%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)", m));
};
P.isReactWarning = !0, Object.defineProperty(f, "key", {
get: P,
configurable: !0
});
}
}
function _o(f, m) {
{
var P = function() {
hs || (hs = !0, T("%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)", m));
};
P.isReactWarning = !0, Object.defineProperty(f, "ref", {
get: P,
configurable: !0
});
}
}
var Bo = function(f, m, P, w, D, L, R) {
var V = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: e,
// Built-in properties that belong on the element
type: f,
key: m,
ref: P,
props: R,
// Record the component responsible for creating this element.
_owner: L
};
return V._store = {}, Object.defineProperty(V._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(V, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: w
}), Object.defineProperty(V, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: D
}), Object.freeze && (Object.freeze(V.props), Object.freeze(V)), V;
};
function Io(f, m, P, w, D) {
{
var L, R = {}, V = null, K = null;
P !== void 0 && (cs(P), V = "" + P), ko(m) && (cs(m.key), V = "" + m.key), Oo(m) && (K = m.ref, jo(m, D));
for (L in m)
Wt.call(m, L) && !Lo.hasOwnProperty(L) && (R[L] = m[L]);
if (f && f.defaultProps) {
var k = f.defaultProps;
for (L in k)
R[L] === void 0 && (R[L] = k[L]);
}
if (V || K) {
var _ = typeof f == "function" ? f.displayName || f.name || "Unknown" : f;
V && Fo(R, _), K && _o(R, _);
}
return Bo(f, V, K, D, w, Kt.current, R);
}
}
var Ie = v.ReactCurrentOwner, ds = v.ReactDebugCurrentFrame;
function Ct(f) {
if (f) {
var m = f._owner, P = ue(f.type, f._source, m ? m.type : null);
ds.setExtraStackFrame(P);
} else
ds.setExtraStackFrame(null);
}
var Ne;
Ne = !1;
function Ue(f) {
return typeof f == "object" && f !== null && f.$$typeof === e;
}
function ps() {
{
if (Ie.current) {
var f = Z(Ie.current.type);
if (f)
return `
Check the render method of \`` + f + "`.";
}
return "";
}
}
function No(f) {
{
if (f !== void 0) {
var m = f.fileName.replace(/^.*[\\\/]/, ""), P = f.lineNumber;
return `
Check your code at ` + m + ":" + P + ".";
}
return "";
}
}
var ms = {};
function Uo(f) {
{
var m = ps();
if (!m) {
var P = typeof f == "string" ? f : f.displayName || f.name;
P && (m = `
Check the top-level render call using <` + P + ">.");
}
return m;
}
}
function gs(f, m) {
{
if (!f._store || f._store.validated || f.key != null)
return;
f._store.validated = !0;
var P = Uo(m);
if (ms[P])
return;
ms[P] = !0;
var w = "";
f && f._owner && f._owner !== Ie.current && (w = " It was passed a child from " + Z(f._owner.type) + "."), Ct(f), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', P, w), Ct(null);
}
}
function ys(f, m) {
{
if (typeof f != "object")
return;
if (_e(f))
for (var P = 0; P < f.length; P++) {
var w = f[P];
Ue(w) && gs(w, m);
}
else if (Ue(f))
f._store && (f._store.validated = !0);
else if (f) {
var D = x(f);
if (typeof D == "function" && D !== f.entries)
for (var L = D.call(f), R; !(R = L.next()).done; )
Ue(R.value) && gs(R.value, m);
}
}
}
function $o(f) {
{
var m = f.type;
if (m == null || typeof m == "string")
return;
var P;
if (typeof m == "function")
P = m.propTypes;
else if (typeof m == "object" && (m.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
m.$$typeof === h))
P = m.propTypes;
else
return;
if (P) {
var w = Z(m);
Ro(P, f.props, "prop", w, f);
} else if (m.PropTypes !== void 0 && !Ne) {
Ne = !0;
var D = Z(m);
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
}
typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Wo(f) {
{
for (var m = Object.keys(f.props), P = 0; P < m.length; P++) {
var w = m[P];
if (w !== "children" && w !== "key") {
Ct(f), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), Ct(null);
break;
}
}
f.ref !== null && (Ct(f), T("Invalid attribute `ref` supplied to `React.Fragment`."), Ct(null));
}
}
var vs = {};
function Ts(f, m, P, w, D, L) {
{
var R = G(f);
if (!R) {
var V = "";
(f === void 0 || typeof f == "object" && f !== null && Object.keys(f).length === 0) && (V += " 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 K = No(D);
K ? V += K : V += ps();
var k;
f === null ? k = "null" : _e(f) ? k = "array" : f !== void 0 && f.$$typeof === e ? (k = "<" + (Z(f.type) || "Unknown") + " />", V = " Did you accidentally export a JSX literal instead of a component?") : k = typeof f, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, V);
}
var _ = Io(f, m, P, D, L);
if (_ == null)
return _;
if (R) {
var Q = m.children;
if (Q !== void 0)
if (w)
if (_e(Q)) {
for (var Rt = 0; Rt < Q.length; Rt++)
ys(Q[Rt], f);
Object.freeze && Object.freeze(Q);
} else
T("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
ys(Q, f);
}
if (Wt.call(m, "key")) {
var yt = Z(f), Y = Object.keys(m).filter(function(Xo) {
return Xo !== "key";
}), $e = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!vs[yt + $e]) {
var Ho = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
T(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, $e, yt, Ho, yt), vs[yt + $e] = !0;
}
}
return f === s ? Wo(_) : $o(_), _;
}
}
function Ko(f, m, P) {
return Ts(f, m, P, !0);
}
function Go(f, m, P) {
return Ts(f, m, P, !1);
}
var Yo = Go, zo = Ko;
Yt.Fragment = s, Yt.jsx = Yo, Yt.jsxs = zo;
}()), Yt;
}
process.env.NODE_ENV === "production" ? rn.exports = na() : rn.exports = sa();
var H = rn.exports;
function Ii(t) {
var e, n, s = "";
if (typeof t == "string" || typeof t == "number")
s += t;
else if (typeof t == "object")
if (Array.isArray(t)) {
var i = t.length;
for (e = 0; e < i; e++)
t[e] && (n = Ii(t[e])) && (s && (s += " "), s += n);
} else
for (n in t)
t[n] && (s && (s += " "), s += n);
return s;
}
function Ni() {
for (var t, e, n = 0, s = "", i = arguments.length; n < i; n++)
(t = arguments[n]) && (e = Ii(t)) && (s && (s += " "), s += e);
return s;
}
const ia = "acrool-react-jackpot__root", ra = "acrool-react-jackpot__motion", oa = "acrool-react-jackpot__num", kt = {
root: ia,
motion: ra,
num: oa
}, xs = /* @__PURE__ */ new Set();
function Ve(t, e, n) {
t || xs.has(e) || (console.warn(e), n && console.warn(n), xs.add(e));
}
function aa(t) {
if (typeof Proxy > "u")
return t;
const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && Ve(!1, "motion() is deprecated. Use motion.create() instead."), t(...s));
return new Proxy(n, {
/**
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
* The prop name is passed through as `key` and we can use that to generate a `motion`
* DOM component with that name.
*/
get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i))
});
}
function Ce(t) {
return t !== null && typeof t == "object" && typeof t.start == "function";
}
const on = (t) => Array.isArray(t);
function Ui(t, e) {
if (!Array.isArray(e))
return !1;
const n = e.length;
if (n !== t.length)
return !1;
for (let s = 0; s < n; s++)
if (e[s] !== t[s])
return !1;
return !0;
}
function te(t) {
return typeof t == "string" || Array.isArray(t);
}
function Ss(t) {
const e = [{}, {}];
return t == null || t.values.forEach((n, s) => {
e[0][s] = n.get(), e[1][s] = n.getVelocity();
}), e;
}
function An(t, e, n, s) {
if (typeof e == "function") {
const [i, o] = Ss(s);
e = e(n !== void 0 ? n : t.custom, i, o);
}
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
const [i, o] = Ss(s);
e = e(n !== void 0 ? n : t.custom, i, o);
}
return e;
}
function Re(t, e, n) {
const s = t.getProps();
return An(s, e, n !== void 0 ? n : s.custom, t);
}
const Vn = [
"animate",
"whileInView",
"whileFocus",
"whileHover",
"whileTap",
"whileDrag",
"exit"
], Cn = ["initial", ...Vn], ie = [
"transformPerspective",
"x",
"y",
"z",
"translateX",
"translateY",
"translateZ",
"scale",
"scaleX",
"scaleY",
"rotate",
"rotateX",
"rotateY",
"rotateZ",
"skew",
"skewX",
"skewY"
], St = new Set(ie), st = (t) => t * 1e3, lt = (t) => t / 1e3, la = {
type: "spring",
stiffness: 500,
damping: 25,
restSpeed: 10
}, ua = (t) => ({
type: "spring",
stiffness: 550,
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
restSpeed: 10
}), ca = {
type: "keyframes",
duration: 0.8
}, fa = {
type: "keyframes",
ease: [0.25, 0.1, 0.35, 1],
duration: 0.3
}, ha = (t, { keyframes: e }) => e.length > 2 ? ca : St.has(t) ? t.startsWith("scale") ? ua(e[1]) : la : fa;
function Rn(t, e) {
return t ? t[e] || t.default || t : void 0;
}
const da = {
skipAnimations: !1,
useManualTiming: !1
}, pa = (t) => t !== null;
function Ee(t, { repeat: e, repeatType: n = "loop" }, s) {
const i = t.filter(pa), o = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
return !o || s === void 0 ? i[o] : s;
}
const N = (t) => t;
function ma(t) {
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
const o = /* @__PURE__ */ new WeakSet();
let r = {
delta: 0,
timestamp: 0,
isProcessing: !1
};
function a(u) {
o.has(u) && (l.schedule(u), t()), u(r);
}
const l = {
/**
* Schedule a process to run on the next frame.
*/
schedule: (u, c = !1, h = !1) => {
const p = h && s ? e : n;
return c && o.add(u), p.has(u) || p.add(u), u;
},
/**
* Cancel the provided callback from running on the next frame.
*/
cancel: (u) => {
n.delete(u), o.delete(u);
},
/**
* Execute all schedule callbacks.
*/
process: (u) => {
if (r = u, s) {
i = !0;
return;
}
s = !0, [e, n] = [n, e], n.clear(), e.forEach(a), s = !1, i && (i = !1, l.process(u));
}
};
return l;
}
const fe = [
"read",
// Read
"resolveKeyframes",
// Write/Read/Write/Read
"update",
// Compute
"preRender",
// Compute
"render",
// Write
"postRender"
// Compute
], ga = 40;
function $i(t, e) {
let n = !1, s = !0;
const i = {
delta: 0,
timestamp: 0,
isProcessing: !1
}, o = () => n = !0, r = fe.reduce((v, T) => (v[T] = ma(o), v), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: h, postRender: d } = r, p = () => {
const v = performance.now();
n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(v - i.timestamp, ga), 1), i.timestamp = v, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), h.process(i), d.process(i), i.isProcessing = !1, n && e && (s = !1, t(p));
}, g = () => {
n = !0, s = !0, i.isProcessing || t(p);
};
return { schedule: fe.reduce((v, T) => {
const b = r[T];
return v[T] = (A, E = !1, F = !1) => (n || g(), b.schedule(A, E, F)), v;
}, {}), cancel: (v) => {
for (let T = 0; T < fe.length; T++)
r[fe[T]].cancel(v);
}, state: i, steps: r };
}
const { schedule: M, cancel: dt, state: I, steps: We } = $i(typeof requestAnimationFrame < "u" ? requestAnimationFrame : N, !0), Wi = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, ya = 1e-7, va = 12;
function Ta(t, e, n, s, i) {
let o, r, a = 0;
do
r = e + (n - e) / 2, o = Wi(r, s, i) - t, o > 0 ? n = r : e = r;
while (Math.abs(o) > ya && ++a < va);
return r;
}
function re(t, e, n, s) {
if (t === e && n === s)
return N;
const i = (o) => Ta(o, 0, 1, t, n);
return (o) => o === 0 || o === 1 ? o : Wi(i(o), e, s);
}
const Ki = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Gi = (t) => (e) => 1 - t(1 - e), Yi = /* @__PURE__ */ re(0.33, 1.53, 0.69, 0.99), En = /* @__PURE__ */ Gi(Yi), zi = /* @__PURE__ */ Ki(En), Hi = (t) => (t *= 2) < 1 ? 0.5 * En(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), Dn = (t) => 1 - Math.sin(Math.acos(t)), Xi = Gi(Dn), qi = Ki(Dn), Zi = (t) => /^0[^.\s]+$/u.test(t);
function Pa(t) {
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Zi(t) : !0;
}
let Nt = N, ot = N;
process.env.NODE_ENV !== "production" && (Nt = (t, e) => {
!t && typeof console < "u" && console.warn(e);
}, ot = (t, e) => {
if (!t)
throw new Error(e);
});
const Ji = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Qi = (t) => (e) => typeof e == "string" && e.startsWith(t), tr = /* @__PURE__ */ Qi("--"), ba = /* @__PURE__ */ Qi("var(--"), Mn = (t) => ba(t) ? xa.test(t.split("/*")[0].trim()) : !1, xa = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Sa = (
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
);
function wa(t) {
const e = Sa.exec(t);
if (!e)
return [,];
const [, n, s, i] = e;
return [`--${n ?? s}`, i];
}
const Aa = 4;
function er(t, e, n = 1) {
ot(n <= Aa, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
const [s, i] = wa(t);
if (!s)
return;
const o = window.getComputedStyle(e).getPropertyValue(s);
if (o) {
const r = o.trim();
return Ji(r) ? parseFloat(r) : r;
}
return Mn(i) ? er(i, e, n + 1) : i;
}
const pt = (t, e, n) => n > e ? e : n < t ? t : n, Ut = {
test: (t) => typeof t == "number",
parse: parseFloat,
transform: (t) => t
}, ee = {
...Ut,
transform: (t) => pt(0, 1, t)
}, he = {
...Ut,
default: 1
}, oe = (t) => ({
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
parse: parseFloat,
transform: (e) => `${e}${t}`
}), ht = /* @__PURE__ */ oe("deg"), it = /* @__PURE__ */ oe("%"), S = /* @__PURE__ */ oe("px"), Va = /* @__PURE__ */ oe("vh"), Ca = /* @__PURE__ */ oe("vw"), ws = {
...it,
parse: (t) => it.parse(t) / 100,
transform: (t) => it.transform(t * 100)
}, Ra = /* @__PURE__ */ new Set([
"width",
"height",
"top",
"left",
"right",
"bottom",
"x",
"y",
"translateX",
"translateY"
]), As = (t) => t === Ut || t === S, Vs = (t, e) => parseFloat(t.split(", ")[e]), Cs = (t, e) => (n, { transform: s }) => {
if (s === "none" || !s)
return 0;
const i = s.match(/^matrix3d\((.+)\)$/u);
if (i)
return Vs(i[1], e);
{
const o = s.match(/^matrix\((.+)\)$/u);
return o ? Vs(o[1], t) : 0;
}
}, Ea = /* @__PURE__ */ new Set(["x", "y", "z"]), Da = ie.filter((t) => !Ea.has(t));
function Ma(t) {
const e = [];
return Da.forEach((n) => {
const s = t.getValue(n);
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
}), e;
}
const jt = {
// Dimensions
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
top: (t, { top: e }) => parseFloat(e),
left: (t, { left: e }) => parseFloat(e),
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
// Transform
x: Cs(4, 13),
y: Cs(5, 14)
};
jt.translateX = jt.x;
jt.translateY = jt.y;
const nr = (t) => (e) => e.test(t), La = {
test: (t) => t === "auto",
parse: (t) => t
}, sr = [Ut, S, it, ht, Ca, Va, La], Rs = (t) => sr.find(nr(t)), xt = /* @__PURE__ */ new Set();
let an = !1, ln = !1;
function ir() {
if (ln) {
const t = Array.from(xt).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
e.forEach((s) => {
const i = Ma(s);
i.length && (n.set(s, i), s.render());
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
s.render();
const i = n.get(s);
i && i.forEach(([o, r]) => {
var a;
(a = s.getValue(o)) === null || a === void 0 || a.set(r);
});
}), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
});
}
ln = !1, an = !1, xt.forEach((t) => t.complete()), xt.clear();
}
function rr() {
xt.forEach((t) => {
t.readKeyframes(), t.needsMeasurement && (ln = !0);
});
}
function Oa() {
rr(), ir();
}
class Ln {
constructor(e, n, s, i, o, r = !1) {
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = o, this.isAsync = r;
}
scheduleResolve() {
this.isScheduled = !0, this.isAsync ? (xt.add(this), an || (an = !0, M.read(rr), M.resolveKeyframes(ir))) : (this.readKeyframes(), this.complete());
}
readKeyframes() {
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
for (let o = 0; o < e.length; o++)
if (e[o] === null)
if (o === 0) {
const r = i == null ? void 0 : i.get(), a = e[e.length - 1];
if (r !== void 0)
e[0] = r;
else if (s && n) {
const l = s.readValue(n, a);
l != null && (e[0] = l);
}
e[0] === void 0 && (e[0] = a), i && r === void 0 && i.set(e[0]);
} else
e[o] = e[o - 1];
}
setFinalKeyframe() {
}
measureInitialState() {
}
renderEndStyles() {
}
measureEndState() {
}
complete() {
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), xt.delete(this);
}
cancel() {
this.isComplete || (this.isScheduled = !1, xt.delete(this));
}
resume() {
this.isComplete || this.scheduleResolve();
}
}
const Zt = (t) => Math.round(t * 1e5) / 1e5, On = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
function ka(t) {
return t == null;
}
const ja = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, kn = (t, e) => (n) => !!(typeof n == "string" && ja.test(n) && n.startsWith(t) || e && !ka(n) && Object.prototype.hasOwnProperty.call(n, e)), or = (t, e, n) => (s) => {
if (typeof s != "string")
return s;
const [i, o, r, a] = s.match(On);
return {
[t]: parseFloat(i),
[e]: parseFloat(o),
[n]: parseFloat(r),
alpha: a !== void 0 ? parseFloat(a) : 1
};
}, Fa = (t) => pt(0, 255, t), Ke = {
...Ut,
transform: (t) => Math.round(Fa(t))
}, bt = {
test: /* @__PURE__ */ kn("rgb", "red"),
parse: /* @__PURE__ */ or("red", "green", "blue"),
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Ke.transform(t) + ", " + Ke.transform(e) + ", " + Ke.transform(n) + ", " + Zt(ee.transform(s)) + ")"
};
function _a(t) {
let e = "", n = "", s = "", i = "";
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
red: parseInt(e, 16),
green: parseInt(n, 16),
blue: parseInt(s, 16),
alpha: i ? parseInt(i, 16) / 255 : 1
};
}
const un = {
test: /* @__PURE__ */ kn("#"),
parse: _a,
transform: bt.transform
}, Et = {
test: /* @__PURE__ */ kn("hsl", "hue"),
parse: /* @__PURE__ */ or("hue", "saturation", "lightness"),
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + it.transform(Zt(e)) + ", " + it.transform(Zt(n)) + ", " + Zt(ee.transform(s)) + ")"
}, U = {
test: (t) => bt.test(t) || un.test(t) || Et.test(t),
parse: (t) => bt.test(t) ? bt.parse(t) : Et.test(t) ? Et.parse(t) : un.parse(t),
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? bt.transform(t) : Et.transform(t)
}, Ba = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
function Ia(t) {
var e, n;
return isNaN(t) && typeof t == "string" && (((e = t.match(On)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(Ba)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
}
const ar = "number", lr = "color", Na = "var", Ua = "var(", Es = "${}", $a = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
function ne(t) {
const e = t.toString(), n = [], s = {
color: [],
number: [],
var: []
}, i = [];
let o = 0;
const a = e.replace($a, (l) => (U.test(l) ? (s.color.push(o), i.push(lr), n.push(U.parse(l))) : l.startsWith(Ua) ? (s.var.push(o), i.push(Na), n.push(l)) : (s.number.push(o), i.push(ar), n.push(parseFloat(l))), ++o, Es)).split(Es);
return { values: n, split: a, indexes: s, types: i };
}
function ur(t) {
return ne(t).values;
}
function cr(t) {
const { split: e, types: n } = ne(t), s = e.length;
return (i) => {
let o = "";
for (let r = 0; r < s; r++)
if (o += e[r], i[r] !== void 0) {
const a = n[r];
a === ar ? o += Zt(i[r]) : a === lr ? o += U.transform(i[r]) : o += i[r];
}
return o;
};
}
const Wa = (t) => typeof t == "number" ? 0 : t;
function Ka(t) {
const e = ur(t);
return cr(t)(e.map(Wa));
}
const mt = {
test: Ia,
parse: ur,
createTransformer: cr,
getAnimatableNone: Ka
}, Ga = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
function Ya(t) {
const [e, n] = t.slice(0, -1).split("(");
if (e === "drop-shadow")
return t;
const [s] = n.match(On) || [];
if (!s)
return t;
const i = n.replace(s, "");
let o = Ga.has(e) ? 1 : 0;
return s !== n && (o *= 100), e + "(" + o + i + ")";
}
const za = /\b([a-z-]*)\(.*?\)/gu, cn = {
...mt,
getAnimatableNone: (t) => {
const e = t.match(za);
return e ? e.map(Ya).join(" ") : t;
}
}, Ha = {
// Border props
borderWidth: S,
borderTopWidth: S,
borderRightWidth: S,
borderBottomWidth: S,
borderLeftWidth: S,
borderRadius: S,
radius: S,
borderTopLeftRadius: S,
borderTopRightRadius: S,
borderBottomRightRadius: S,
borderBottomLeftRadius: S,
// Positioning props
width: S,
maxWidth: S,
height: S,
maxHeight: S,
top: S,
right: S,
bottom: S,
left: S,
// Spacing props
padding: S,
paddingTop: S,
paddingRight: S,
paddingBottom: S,
paddingLeft: S,
margin: S,
marginTop: S,
marginRight: S,
marginBottom: S,
marginLeft: S,
// Misc
backgroundPositionX: S,
backgroundPositionY: S
}, Xa = {
rotate: ht,
rotateX: ht,
rotateY: ht,
rotateZ: ht,
scale: he,
scaleX: he,
scaleY: he,
scaleZ: he,
skew: ht,
skewX: ht,
skewY: ht,
distance: S,
translateX: S,
translateY: S,
translateZ: S,
x: S,
y: S,
z: S,
perspective: S,
transformPerspective: S,
opacity: ee,
originX: ws,
originY: ws,
originZ: S
}, Ds = {
...Ut,
transform: Math.round
}, jn = {
...Ha,
...Xa,
zIndex: Ds,
size: S,
// SVG
fillOpacity: ee,
strokeOpacity: ee,
numOctaves: Ds
}, qa = {
...jn,
// Color props
color: U,
backgroundColor: U,
outlineColor: U,
fill: U,
stroke: U,
// Border props
borderColor: U,
borderTopColor: U,
borderRightColor: U,
borderBottomColor: U,
borderLeftColor: U,
filter: cn,
WebkitFilter: cn
}, Fn = (t) => qa[t];
function fr(t, e) {
let n = Fn(t);
return n !== cn && (n = mt), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
}
const Za = /* @__PURE__ */ new Set(["auto", "none", "0"]);
function Ja(t, e, n) {
let s = 0, i;
for (; s < t.length && !i; ) {
const o = t[s];
typeof o == "string" && !Za.has(o) && ne(o).values.length && (i = t[s]), s++;
}
if (i && n)
for (const o of e)
t[o] = fr(n, i);
}
class hr extends Ln {
constructor(e, n, s, i, o) {
super(e, n, s, i, o, !0);
}
readKeyframes() {
const { unresolvedKeyframes: e, element: n, name: s } = this;
if (!n || !n.current)
return;
super.readKeyframes();
for (let l = 0; l < e.length; l++) {
let u = e[l];
if (typeof u == "string" && (u = u.trim(), Mn(u))) {
const c = er(u, n.current);
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
}
}
if (this.resolveNoneKeyframes(), !Ra.has(s) || e.length !== 2)
return;
const [i, o] = e, r = Rs(i), a = Rs(o);
if (r !== a)
if (As(r) && As(a))
for (let l = 0; l < e.length; l++) {
const u = e[l];
typeof u == "string" && (e[l] = parseFloat(u));
}
else
this.needsMeasurement = !0;
}
resolveNoneKeyframes() {
const { unresolvedKeyframes: e, name: n } = this, s = [];
for (let i = 0; i < e.length; i++)
Pa(e[i]) && s.push(i);
s.length && Ja(e, s, n);
}
measureInitialState() {
const { element: e, unresolvedKeyframes: n, name: s } = this;
if (!e || !e.current)
return;
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = jt[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
const i = n[n.length - 1];
i !== void 0 && e.getValue(s, i).jump(i, !1);
}
measureEndState() {
var e;
const { element: n, name: s, unresolvedKeyframes: i } = this;
if (!n || !n.current)
return;
const o = n.getValue(s);
o && o.jump(this.measuredOrigin, !1);
const r = i.length - 1, a = i[r];
i[r] = jt[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
n.getValue(l).set(u);
}), this.resolveNoneKeyframes();
}
}
function _n(t) {
return typeof t == "function";
}
let pe;
function Qa() {
pe = void 0;
}
const rt = {
now: () => (pe === void 0 && rt.set(I.isProcessing || da.useManualTiming ? I.timestamp : performance.now()), pe),
set: (t) => {
pe = t, queueMicrotask(Qa);
}
}, Ms = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
(mt.test(t) || t === "0") && // And it contains numbers and/or colors
!t.startsWith("url("));
function tl(t) {
const e = t[0];
if (t.length === 1)
return !0;
for (let n = 0; n < t.length; n++)
if (t[n] !== e)
return !0;
}
function el(t, e, n, s) {
const i = t[0];
if (i === null)
return !1;
if (e === "display" || e === "visibility")
return !0;
const o = t[t.length - 1], r = Ms(i, e), a = Ms(o, e);
return Nt(r === a, `You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : tl(t) || (n === "spring" || _n(n)) && s;
}
const nl = 40;
class dr {
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: o = 0, repeatType: r = "loop", ...a }) {
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = rt.now(), this.options = {
autoplay: e,
delay: n,
type: s,
repeat: i,
repeatDelay: o,
repeatType: r,
...a
}, this.updateFinishedPromise();
}
/**
* This method uses the createdAt and resolvedAt to calculate the
* animation startTime. *Ideally*, we would use the createdAt time as t=0
* as the following frame would then be the first frame of the animation in
* progress, which would feel snappier.
*
* However, if there's a delay (main thread work) between the creation of
* the animation and the first commited frame, we prefer to use resolvedAt
* to avoid a sudden jump into the animation.
*/
calcStartTime() {
return this.resolvedAt ? this.resolvedAt - this.createdAt > nl ? this.resolvedAt : this.createdAt : this.createdAt;
}
/**
* A getter for resolved data. If keyframes are not yet resolved, accessing
* this.resolved will synchronously flush all pending keyframe resolvers.
* This is a deoptimisation, but at its worst still batches read/writes.
*/
get resolved() {
return !this._resolved && !this.hasAttemptedResolve && Oa(), this._resolved;
}
/**
* A method to be called when the keyframes resolver completes. This method
* will check if its possible to run the animation and, if not, skip it.
* Otherwise, it will call initPlayback on the implementing class.
*/
onKeyframesResolved(e, n) {
this.resolvedAt = rt.now(), this.hasAttemptedResolve = !0;
const { name: s, type: i, velocity: o, delay: r, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
if (!u && !el(e, s, i, o))
if (r)
this.options.duration = 0;
else {
l == null || l(Ee(e, this.options, n)), a == null || a(), this.resolveFinishedPromise();
return;
}
const c = this.initPlayback(e, n);
c !== !1 && (this._resolved = {
keyframes: e,
finalKeyframe: n,
...c
}, this.onPostResolved());
}
onPostResolved() {
}
/**
* Allows the returned animation to be awaited or promise-chained. Currently
* resolves when the animation finishes at all but in a future update could/should
* reject if its cancels.
*/
then(e, n) {
return this.currentFinishedPromise.then(e, n);
}
flatten() {
this.options.type = "keyframes", this.options.ease = "linear";
}
updateFinishedPromise() {
this.currentFinishedPromise = new Promise((e) => {
this.resolveFinishedPromise = e;
});
}
}
function pr(t, e) {
return e ? t * (1e3 / e) : 0;
}
const sl = 5;
function mr(t, e, n) {
const s = Math.max(e - sl, 0);
return pr(n - t(s), e - s);
}
const Ge = 1e-3, il = 0.01, Ls = 10, rl = 0.05, ol = 1;
function al({ duration: t = 800, bounce: e = 0.25, velocity: n = 0, mass: s = 1 }) {
let i, o;
Nt(t <= st(Ls), "Spring duration must be 10 seconds or less");
let r = 1 - e;
r = pt(rl, ol, r), t = pt(il, Ls, lt(t)), r < 1 ? (i = (u) => {
const c = u * r, h = c * t, d = c - n, p = fn(u, r), g = Math.exp(-h);
return Ge - d / p * g;
}, o = (u) => {
const h = u * r * t, d = h * n + n, p = Math.pow(r, 2) * Math.pow(u, 2) * t, g = Math.exp(-h), y = fn(Math.pow(u, 2), r);
return (-i(u) + Ge > 0 ? -1 : 1) * ((d - p) * g) / y;
}) : (i = (u) => {
const c = Math.exp(-u * t), h = (u - n) * t + 1;
return -Ge + c * h;
}, o = (u) => {
const c = Math.exp(-u * t), h = (n - u) * (t * t);
return c * h;
});
const a = 5 / t, l = ul(i, o, a);
if (t = st(t), isNaN(l))
return {
stiffness: 100,
damping: 10,
duration: t
};
{
const u = Math.pow(l, 2) * s;
return {
stiffness: u,
damping: r * 2 * Math.sqrt(s * u),
duration: t
};
}
}
const ll = 12;
function ul(t, e, n) {
let s = n;
for (let i = 1; i < ll; i++)
s = s - t(s) / e(s);
return s;
}
function fn(t, e) {
return t * Math.sqrt(1 - e * e);
}
const cl = ["duration", "bounce"], fl = ["stiffness", "damping", "mass"];
function Os(t, e) {
return e.some((n) => t[n] !== void 0);
}
function hl(t) {
let e = {
velocity: 0,
stiffness: 100,
damping: 10,
mass: 1,
isResolvedFromDuration: !1,
...t
};
if (!Os(t, fl) && Os(t, cl)) {
const n = al(t);
e = {
...e,
...n,
mass: 1
}, e.isResolvedFromDuration = !0;
}
return e;
}
function gr({ keyframes: t, restDelta: e, restSpeed: n, ...s }) {
const i = t[0], o = t[t.length - 1], r = { done: !1, value: i }, { stiffness: a, damping: l, mass: u, duration: c, velocity: h, isResolvedFromDuration: d } = hl({
...s,
velocity: -lt(s.velocity || 0)
}), p = h || 0, g = l / (2 * Math.sqrt(a * u)), y = o - i, x = lt(Math.sqrt(a / u)), v = Math.abs(y) < 5;
n || (n = v ? 0.01 : 2), e || (e = v ? 5e-3 : 0.5);
let T;
if (g < 1) {
const b = fn(x, g);
T = (A) => {
const E = Math.exp(-g * x * A);
return o - E * ((p + g * x * y) / b * Math.sin(b * A) + y * Math.cos(b * A));
};
} else if (g === 1)
T = (b) => o - Math.exp(-x * b) * (y + (p + x * y) * b);
else {
const b = x * Math.sqrt(g * g - 1);
T = (A) => {
const E = Math.exp(-g * x * A), F = Math.min(b * A, 300);
return o - E * ((p + g * x * y) * Math.sinh(F) + b * y * Math.cosh(F)) / b;
};
}
return {
calculatedDuration: d && c || null,
next: (b) => {
const A = T(b);
if (d)
r.done = b >= c;
else {
let E = 0;
g < 1 && (E = b === 0 ? st(p) : mr(T, b, A));
const F = Math.abs(E) <= n, q = Math.abs(o - A) <= e;
r.done = F && q;
}
return r.value = r.done ? o : A, r;
}
};
}
function ks({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: o = 500, modifyTarget: r, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
const h = t[0], d = {
done: !1,
value: h
}, p = (C) => a !== void 0 && C < a || l !== void 0 && C > l, g = (C) => a === void 0 ? l : l === void 0 || Math.abs(a - C) < Math.abs(l - C) ? a : l;
let y = n * e;
const x = h + y, v = r === void 0 ? x : r(x);
v !== x && (y = v - h);
const T = (C) => -y * Math.exp(-C / s), b = (C) => v + T(C), A = (C) => {