@micjanic/recursive-grid 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,2621 @@
1
- import { ap as f } from "./PixiApp-BHmY2ZMg.js";
1
+ var Jr = Object.defineProperty;
2
+ var Xr = (e, t, r) => t in e ? Jr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var B = (e, t, r) => Xr(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import * as cr from "react";
5
+ import Zr, { useEffect as Te, useLayoutEffect as Kr, useState as Fe, useRef as W, forwardRef as en, useCallback as tn, useMemo as me, useContext as dr, createContext as rn } from "react";
6
+ import { useApplication as nn, useTick as sn, extend as an, Application as on } from "@pixi/react";
7
+ import { Graphics as fr, Particle as hr, Sprite as un, Container as ln, Texture as cn, ParticleContainer as dn } from "pixi.js";
8
+ import { unstable_batchedUpdates as fn } from "react-dom";
9
+ var Oe = { exports: {} }, le = {};
10
+ /**
11
+ * @license React
12
+ * react-jsx-runtime.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */
19
+ var Ft;
20
+ function hn() {
21
+ if (Ft) return le;
22
+ Ft = 1;
23
+ var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
24
+ function r(n, s, i) {
25
+ var a = null;
26
+ if (i !== void 0 && (a = "" + i), s.key !== void 0 && (a = "" + s.key), "key" in s) {
27
+ i = {};
28
+ for (var u in s)
29
+ u !== "key" && (i[u] = s[u]);
30
+ } else i = s;
31
+ return s = i.ref, {
32
+ $$typeof: e,
33
+ type: n,
34
+ key: a,
35
+ ref: s !== void 0 ? s : null,
36
+ props: i
37
+ };
38
+ }
39
+ return le.Fragment = t, le.jsx = r, le.jsxs = r, le;
40
+ }
41
+ var ce = {};
42
+ /**
43
+ * @license React
44
+ * react-jsx-runtime.development.js
45
+ *
46
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */
51
+ var Vt;
52
+ function mn() {
53
+ return Vt || (Vt = 1, process.env.NODE_ENV !== "production" && (function() {
54
+ function e(o) {
55
+ if (o == null) return null;
56
+ if (typeof o == "function")
57
+ return o.$$typeof === j ? null : o.displayName || o.name || null;
58
+ if (typeof o == "string") return o;
59
+ switch (o) {
60
+ case w:
61
+ return "Fragment";
62
+ case R:
63
+ return "Profiler";
64
+ case g:
65
+ return "StrictMode";
66
+ case Q:
67
+ return "Suspense";
68
+ case I:
69
+ return "SuspenseList";
70
+ case K:
71
+ return "Activity";
72
+ }
73
+ if (typeof o == "object")
74
+ switch (typeof o.tag == "number" && console.error(
75
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
76
+ ), o.$$typeof) {
77
+ case v:
78
+ return "Portal";
79
+ case A:
80
+ return o.displayName || "Context";
81
+ case y:
82
+ return (o._context.displayName || "Context") + ".Consumer";
83
+ case P:
84
+ var S = o.render;
85
+ return o = o.displayName, o || (o = S.displayName || S.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
86
+ case re:
87
+ return S = o.displayName || null, S !== null ? S : e(o.type) || "Memo";
88
+ case C:
89
+ S = o._payload, o = o._init;
90
+ try {
91
+ return e(o(S));
92
+ } catch {
93
+ }
94
+ }
95
+ return null;
96
+ }
97
+ function t(o) {
98
+ return "" + o;
99
+ }
100
+ function r(o) {
101
+ try {
102
+ t(o);
103
+ var S = !1;
104
+ } catch {
105
+ S = !0;
106
+ }
107
+ if (S) {
108
+ S = console;
109
+ var E = S.error, T = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
110
+ return E.call(
111
+ S,
112
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
113
+ T
114
+ ), t(o);
115
+ }
116
+ }
117
+ function n(o) {
118
+ if (o === w) return "<>";
119
+ if (typeof o == "object" && o !== null && o.$$typeof === C)
120
+ return "<...>";
121
+ try {
122
+ var S = e(o);
123
+ return S ? "<" + S + ">" : "<...>";
124
+ } catch {
125
+ return "<...>";
126
+ }
127
+ }
128
+ function s() {
129
+ var o = M.A;
130
+ return o === null ? null : o.getOwner();
131
+ }
132
+ function i() {
133
+ return Error("react-stack-top-frame");
134
+ }
135
+ function a(o) {
136
+ if (G.call(o, "key")) {
137
+ var S = Object.getOwnPropertyDescriptor(o, "key").get;
138
+ if (S && S.isReactWarning) return !1;
139
+ }
140
+ return o.key !== void 0;
141
+ }
142
+ function u(o, S) {
143
+ function E() {
144
+ kt || (kt = !0, console.error(
145
+ "%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://react.dev/link/special-props)",
146
+ S
147
+ ));
148
+ }
149
+ E.isReactWarning = !0, Object.defineProperty(o, "key", {
150
+ get: E,
151
+ configurable: !0
152
+ });
153
+ }
154
+ function d() {
155
+ var o = e(this.type);
156
+ return Ct[o] || (Ct[o] = !0, console.error(
157
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
158
+ )), o = this.props.ref, o !== void 0 ? o : null;
159
+ }
160
+ function l(o, S, E, T, Ie, Xe) {
161
+ var k = E.ref;
162
+ return o = {
163
+ $$typeof: _,
164
+ type: o,
165
+ key: S,
166
+ props: E,
167
+ _owner: T
168
+ }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(o, "ref", {
169
+ enumerable: !1,
170
+ get: d
171
+ }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
172
+ configurable: !1,
173
+ enumerable: !1,
174
+ writable: !0,
175
+ value: 0
176
+ }), Object.defineProperty(o, "_debugInfo", {
177
+ configurable: !1,
178
+ enumerable: !1,
179
+ writable: !0,
180
+ value: null
181
+ }), Object.defineProperty(o, "_debugStack", {
182
+ configurable: !1,
183
+ enumerable: !1,
184
+ writable: !0,
185
+ value: Ie
186
+ }), Object.defineProperty(o, "_debugTask", {
187
+ configurable: !1,
188
+ enumerable: !1,
189
+ writable: !0,
190
+ value: Xe
191
+ }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
192
+ }
193
+ function m(o, S, E, T, Ie, Xe) {
194
+ var k = S.children;
195
+ if (k !== void 0)
196
+ if (T)
197
+ if (He(k)) {
198
+ for (T = 0; T < k.length; T++)
199
+ f(k[T]);
200
+ Object.freeze && Object.freeze(k);
201
+ } else
202
+ console.error(
203
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
204
+ );
205
+ else f(k);
206
+ if (G.call(S, "key")) {
207
+ k = e(o);
208
+ var ne = Object.keys(S).filter(function(Hr) {
209
+ return Hr !== "key";
210
+ });
211
+ T = 0 < ne.length ? "{key: someKey, " + ne.join(": ..., ") + ": ...}" : "{key: someKey}", jt[k + T] || (ne = 0 < ne.length ? "{" + ne.join(": ..., ") + ": ...}" : "{}", console.error(
212
+ `A props object containing a "key" prop is being spread into JSX:
213
+ let props = %s;
214
+ <%s {...props} />
215
+ React keys must be passed directly to JSX without using spread:
216
+ let props = %s;
217
+ <%s key={someKey} {...props} />`,
218
+ T,
219
+ k,
220
+ ne,
221
+ k
222
+ ), jt[k + T] = !0);
223
+ }
224
+ if (k = null, E !== void 0 && (r(E), k = "" + E), a(S) && (r(S.key), k = "" + S.key), "key" in S) {
225
+ E = {};
226
+ for (var Ze in S)
227
+ Ze !== "key" && (E[Ze] = S[Ze]);
228
+ } else E = S;
229
+ return k && u(
230
+ E,
231
+ typeof o == "function" ? o.displayName || o.name || "Unknown" : o
232
+ ), l(
233
+ o,
234
+ k,
235
+ E,
236
+ s(),
237
+ Ie,
238
+ Xe
239
+ );
240
+ }
241
+ function f(o) {
242
+ h(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === C && (o._payload.status === "fulfilled" ? h(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
243
+ }
244
+ function h(o) {
245
+ return typeof o == "object" && o !== null && o.$$typeof === _;
246
+ }
247
+ var p = Zr, _ = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), A = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), Q = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), re = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), j = Symbol.for("react.client.reference"), M = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, He = Array.isArray, Je = console.createTask ? console.createTask : function() {
248
+ return null;
249
+ };
250
+ p = {
251
+ react_stack_bottom_frame: function(o) {
252
+ return o();
253
+ }
254
+ };
255
+ var kt, Ct = {}, It = p.react_stack_bottom_frame.bind(
256
+ p,
257
+ i
258
+ )(), Ot = Je(n(i)), jt = {};
259
+ ce.Fragment = w, ce.jsx = function(o, S, E) {
260
+ var T = 1e4 > M.recentlyCreatedOwnerStacks++;
261
+ return m(
262
+ o,
263
+ S,
264
+ E,
265
+ !1,
266
+ T ? Error("react-stack-top-frame") : It,
267
+ T ? Je(n(o)) : Ot
268
+ );
269
+ }, ce.jsxs = function(o, S, E) {
270
+ var T = 1e4 > M.recentlyCreatedOwnerStacks++;
271
+ return m(
272
+ o,
273
+ S,
274
+ E,
275
+ !0,
276
+ T ? Error("react-stack-top-frame") : It,
277
+ T ? Je(n(o)) : Ot
278
+ );
279
+ };
280
+ })()), ce;
281
+ }
282
+ var Nt;
283
+ function pn() {
284
+ return Nt || (Nt = 1, process.env.NODE_ENV === "production" ? Oe.exports = hn() : Oe.exports = mn()), Oe.exports;
285
+ }
286
+ var D = pn(), pt = Ce(), b = (e) => ke(e, pt), gt = Ce();
287
+ b.write = (e) => ke(e, gt);
288
+ var Me = Ce();
289
+ b.onStart = (e) => ke(e, Me);
290
+ var vt = Ce();
291
+ b.onFrame = (e) => ke(e, vt);
292
+ var yt = Ce();
293
+ b.onFinish = (e) => ke(e, yt);
294
+ var ie = [];
295
+ b.setTimeout = (e, t) => {
296
+ const r = b.now() + t, n = () => {
297
+ const i = ie.findIndex((a) => a.cancel == n);
298
+ ~i && ie.splice(i, 1), X -= ~i ? 1 : 0;
299
+ }, s = { time: r, handler: e, cancel: n };
300
+ return ie.splice(mr(r), 0, s), X += 1, pr(), s;
301
+ };
302
+ var mr = (e) => ~(~ie.findIndex((t) => t.time > e) || ~ie.length);
303
+ b.cancel = (e) => {
304
+ Me.delete(e), vt.delete(e), yt.delete(e), pt.delete(e), gt.delete(e);
305
+ };
306
+ b.sync = (e) => {
307
+ it = !0, b.batchedUpdates(e), it = !1;
308
+ };
309
+ b.throttle = (e) => {
310
+ let t;
311
+ function r() {
312
+ try {
313
+ e(...t);
314
+ } finally {
315
+ t = null;
316
+ }
317
+ }
318
+ function n(...s) {
319
+ t = s, b.onStart(r);
320
+ }
321
+ return n.handler = e, n.cancel = () => {
322
+ Me.delete(r), t = null;
323
+ }, n;
324
+ };
325
+ var _t = typeof window < "u" ? window.requestAnimationFrame : (
326
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
327
+ (() => {
328
+ })
329
+ );
330
+ b.use = (e) => _t = e;
331
+ b.now = typeof performance < "u" ? () => performance.now() : Date.now;
332
+ b.batchedUpdates = (e) => e();
333
+ b.catch = console.error;
334
+ b.frameLoop = "always";
335
+ b.advance = () => {
336
+ b.frameLoop !== "demand" ? console.warn(
337
+ "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"
338
+ ) : vr();
339
+ };
340
+ var J = -1, X = 0, it = !1;
341
+ function ke(e, t) {
342
+ it ? (t.delete(e), e(0)) : (t.add(e), pr());
343
+ }
344
+ function pr() {
345
+ J < 0 && (J = 0, b.frameLoop !== "demand" && _t(gr));
346
+ }
347
+ function gn() {
348
+ J = -1;
349
+ }
350
+ function gr() {
351
+ ~J && (_t(gr), b.batchedUpdates(vr));
352
+ }
353
+ function vr() {
354
+ const e = J;
355
+ J = b.now();
356
+ const t = mr(J);
357
+ if (t && (yr(ie.splice(0, t), (r) => r.handler()), X -= t), !X) {
358
+ gn();
359
+ return;
360
+ }
361
+ Me.flush(), pt.flush(e ? Math.min(64, J - e) : 16.667), vt.flush(), gt.flush(), yt.flush();
362
+ }
363
+ function Ce() {
364
+ let e = /* @__PURE__ */ new Set(), t = e;
365
+ return {
366
+ add(r) {
367
+ X += t == e && !e.has(r) ? 1 : 0, e.add(r);
368
+ },
369
+ delete(r) {
370
+ return X -= t == e && e.has(r) ? 1 : 0, e.delete(r);
371
+ },
372
+ flush(r) {
373
+ t.size && (e = /* @__PURE__ */ new Set(), X -= t.size, yr(t, (n) => n(r) && e.add(n)), X += e.size, t = e);
374
+ }
375
+ };
376
+ }
377
+ function yr(e, t) {
378
+ e.forEach((r) => {
379
+ try {
380
+ t(r);
381
+ } catch (n) {
382
+ b.catch(n);
383
+ }
384
+ });
385
+ }
386
+ var vn = Object.defineProperty, yn = (e, t) => {
387
+ for (var r in t)
388
+ vn(e, r, { get: t[r], enumerable: !0 });
389
+ }, q = {};
390
+ yn(q, {
391
+ assign: () => bn,
392
+ colors: () => Z,
393
+ createStringInterpolator: () => wt,
394
+ skipAnimation: () => br,
395
+ to: () => _r,
396
+ willAdvance: () => Rt
397
+ });
398
+ function at() {
399
+ }
400
+ var _n = (e, t, r) => Object.defineProperty(e, t, { value: r, writable: !0, configurable: !0 }), c = {
401
+ arr: Array.isArray,
402
+ obj: (e) => !!e && e.constructor.name === "Object",
403
+ fun: (e) => typeof e == "function",
404
+ str: (e) => typeof e == "string",
405
+ num: (e) => typeof e == "number",
406
+ und: (e) => e === void 0
407
+ };
408
+ function Y(e, t) {
409
+ if (c.arr(e)) {
410
+ if (!c.arr(t) || e.length !== t.length) return !1;
411
+ for (let r = 0; r < e.length; r++)
412
+ if (e[r] !== t[r]) return !1;
413
+ return !0;
414
+ }
415
+ return e === t;
416
+ }
417
+ var x = (e, t) => e.forEach(t);
418
+ function L(e, t, r) {
419
+ if (c.arr(e)) {
420
+ for (let n = 0; n < e.length; n++)
421
+ t.call(r, e[n], `${n}`);
422
+ return;
423
+ }
424
+ for (const n in e)
425
+ e.hasOwnProperty(n) && t.call(r, e[n], n);
426
+ }
427
+ var F = (e) => c.und(e) ? [] : c.arr(e) ? e : [e];
428
+ function ge(e, t) {
429
+ if (e.size) {
430
+ const r = Array.from(e);
431
+ e.clear(), x(r, t);
432
+ }
433
+ }
434
+ var pe = (e, ...t) => ge(e, (r) => r(...t)), bt = () => typeof window > "u" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent), wt, _r, Z = null, br = !1, Rt = at, bn = (e) => {
435
+ e.to && (_r = e.to), e.now && (b.now = e.now), e.colors !== void 0 && (Z = e.colors), e.skipAnimation != null && (br = e.skipAnimation), e.createStringInterpolator && (wt = e.createStringInterpolator), e.requestAnimationFrame && b.use(e.requestAnimationFrame), e.batchedUpdates && (b.batchedUpdates = e.batchedUpdates), e.willAdvance && (Rt = e.willAdvance), e.frameLoop && (b.frameLoop = e.frameLoop);
436
+ }, ve = /* @__PURE__ */ new Set(), N = [], Ke = [], $e = 0, ze = {
437
+ get idle() {
438
+ return !ve.size && !N.length;
439
+ },
440
+ /** Advance the given animation on every frame until idle. */
441
+ start(e) {
442
+ $e > e.priority ? (ve.add(e), b.onStart(wn)) : (wr(e), b(ot));
443
+ },
444
+ /** Advance all animations by the given time. */
445
+ advance: ot,
446
+ /** Call this when an animation's priority changes. */
447
+ sort(e) {
448
+ if ($e)
449
+ b.onFrame(() => ze.sort(e));
450
+ else {
451
+ const t = N.indexOf(e);
452
+ ~t && (N.splice(t, 1), Rr(e));
453
+ }
454
+ },
455
+ /**
456
+ * Clear all animations. For testing purposes.
457
+ *
458
+ * ☠️ Never call this from within the frameloop.
459
+ */
460
+ clear() {
461
+ N = [], ve.clear();
462
+ }
463
+ };
464
+ function wn() {
465
+ ve.forEach(wr), ve.clear(), b(ot);
466
+ }
467
+ function wr(e) {
468
+ N.includes(e) || Rr(e);
469
+ }
470
+ function Rr(e) {
471
+ N.splice(
472
+ Rn(N, (t) => t.priority > e.priority),
473
+ 0,
474
+ e
475
+ );
476
+ }
477
+ function ot(e) {
478
+ const t = Ke;
479
+ for (let r = 0; r < N.length; r++) {
480
+ const n = N[r];
481
+ $e = n.priority, n.idle || (Rt(n), n.advance(e), n.idle || t.push(n));
482
+ }
483
+ return $e = 0, Ke = N, Ke.length = 0, N = t, N.length > 0;
484
+ }
485
+ function Rn(e, t) {
486
+ const r = e.findIndex(t);
487
+ return r < 0 ? e.length : r;
488
+ }
489
+ var Sn = {
490
+ transparent: 0,
491
+ aliceblue: 4042850303,
492
+ antiquewhite: 4209760255,
493
+ aqua: 16777215,
494
+ aquamarine: 2147472639,
495
+ azure: 4043309055,
496
+ beige: 4126530815,
497
+ bisque: 4293182719,
498
+ black: 255,
499
+ blanchedalmond: 4293643775,
500
+ blue: 65535,
501
+ blueviolet: 2318131967,
502
+ brown: 2771004159,
503
+ burlywood: 3736635391,
504
+ burntsienna: 3934150143,
505
+ cadetblue: 1604231423,
506
+ chartreuse: 2147418367,
507
+ chocolate: 3530104575,
508
+ coral: 4286533887,
509
+ cornflowerblue: 1687547391,
510
+ cornsilk: 4294499583,
511
+ crimson: 3692313855,
512
+ cyan: 16777215,
513
+ darkblue: 35839,
514
+ darkcyan: 9145343,
515
+ darkgoldenrod: 3095792639,
516
+ darkgray: 2846468607,
517
+ darkgreen: 6553855,
518
+ darkgrey: 2846468607,
519
+ darkkhaki: 3182914559,
520
+ darkmagenta: 2332068863,
521
+ darkolivegreen: 1433087999,
522
+ darkorange: 4287365375,
523
+ darkorchid: 2570243327,
524
+ darkred: 2332033279,
525
+ darksalmon: 3918953215,
526
+ darkseagreen: 2411499519,
527
+ darkslateblue: 1211993087,
528
+ darkslategray: 793726975,
529
+ darkslategrey: 793726975,
530
+ darkturquoise: 13554175,
531
+ darkviolet: 2483082239,
532
+ deeppink: 4279538687,
533
+ deepskyblue: 12582911,
534
+ dimgray: 1768516095,
535
+ dimgrey: 1768516095,
536
+ dodgerblue: 512819199,
537
+ firebrick: 2988581631,
538
+ floralwhite: 4294635775,
539
+ forestgreen: 579543807,
540
+ fuchsia: 4278255615,
541
+ gainsboro: 3705462015,
542
+ ghostwhite: 4177068031,
543
+ gold: 4292280575,
544
+ goldenrod: 3668254975,
545
+ gray: 2155905279,
546
+ green: 8388863,
547
+ greenyellow: 2919182335,
548
+ grey: 2155905279,
549
+ honeydew: 4043305215,
550
+ hotpink: 4285117695,
551
+ indianred: 3445382399,
552
+ indigo: 1258324735,
553
+ ivory: 4294963455,
554
+ khaki: 4041641215,
555
+ lavender: 3873897215,
556
+ lavenderblush: 4293981695,
557
+ lawngreen: 2096890111,
558
+ lemonchiffon: 4294626815,
559
+ lightblue: 2916673279,
560
+ lightcoral: 4034953471,
561
+ lightcyan: 3774873599,
562
+ lightgoldenrodyellow: 4210742015,
563
+ lightgray: 3553874943,
564
+ lightgreen: 2431553791,
565
+ lightgrey: 3553874943,
566
+ lightpink: 4290167295,
567
+ lightsalmon: 4288707327,
568
+ lightseagreen: 548580095,
569
+ lightskyblue: 2278488831,
570
+ lightslategray: 2005441023,
571
+ lightslategrey: 2005441023,
572
+ lightsteelblue: 2965692159,
573
+ lightyellow: 4294959359,
574
+ lime: 16711935,
575
+ limegreen: 852308735,
576
+ linen: 4210091775,
577
+ magenta: 4278255615,
578
+ maroon: 2147483903,
579
+ mediumaquamarine: 1724754687,
580
+ mediumblue: 52735,
581
+ mediumorchid: 3126187007,
582
+ mediumpurple: 2473647103,
583
+ mediumseagreen: 1018393087,
584
+ mediumslateblue: 2070474495,
585
+ mediumspringgreen: 16423679,
586
+ mediumturquoise: 1221709055,
587
+ mediumvioletred: 3340076543,
588
+ midnightblue: 421097727,
589
+ mintcream: 4127193855,
590
+ mistyrose: 4293190143,
591
+ moccasin: 4293178879,
592
+ navajowhite: 4292783615,
593
+ navy: 33023,
594
+ oldlace: 4260751103,
595
+ olive: 2155872511,
596
+ olivedrab: 1804477439,
597
+ orange: 4289003775,
598
+ orangered: 4282712319,
599
+ orchid: 3664828159,
600
+ palegoldenrod: 4008225535,
601
+ palegreen: 2566625535,
602
+ paleturquoise: 2951671551,
603
+ palevioletred: 3681588223,
604
+ papayawhip: 4293907967,
605
+ peachpuff: 4292524543,
606
+ peru: 3448061951,
607
+ pink: 4290825215,
608
+ plum: 3718307327,
609
+ powderblue: 2967529215,
610
+ purple: 2147516671,
611
+ rebeccapurple: 1714657791,
612
+ red: 4278190335,
613
+ rosybrown: 3163525119,
614
+ royalblue: 1097458175,
615
+ saddlebrown: 2336560127,
616
+ salmon: 4202722047,
617
+ sandybrown: 4104413439,
618
+ seagreen: 780883967,
619
+ seashell: 4294307583,
620
+ sienna: 2689740287,
621
+ silver: 3233857791,
622
+ skyblue: 2278484991,
623
+ slateblue: 1784335871,
624
+ slategray: 1887473919,
625
+ slategrey: 1887473919,
626
+ snow: 4294638335,
627
+ springgreen: 16744447,
628
+ steelblue: 1182971135,
629
+ tan: 3535047935,
630
+ teal: 8421631,
631
+ thistle: 3636451583,
632
+ tomato: 4284696575,
633
+ turquoise: 1088475391,
634
+ violet: 4001558271,
635
+ wheat: 4125012991,
636
+ white: 4294967295,
637
+ whitesmoke: 4126537215,
638
+ yellow: 4294902015,
639
+ yellowgreen: 2597139199
640
+ }, U = "[-+]?\\d*\\.?\\d+", De = U + "%";
641
+ function Le(...e) {
642
+ return "\\(\\s*(" + e.join(")\\s*,\\s*(") + ")\\s*\\)";
643
+ }
644
+ var xn = new RegExp("rgb" + Le(U, U, U)), An = new RegExp("rgba" + Le(U, U, U, U)), Pn = new RegExp("hsl" + Le(U, De, De)), En = new RegExp(
645
+ "hsla" + Le(U, De, De, U)
646
+ ), Tn = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, kn = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, Cn = /^#([0-9a-fA-F]{6})$/, In = /^#([0-9a-fA-F]{8})$/;
647
+ function On(e) {
648
+ let t;
649
+ return typeof e == "number" ? e >>> 0 === e && e >= 0 && e <= 4294967295 ? e : null : (t = Cn.exec(e)) ? parseInt(t[1] + "ff", 16) >>> 0 : Z && Z[e] !== void 0 ? Z[e] : (t = xn.exec(e)) ? (se(t[1]) << 24 | // r
650
+ se(t[2]) << 16 | // g
651
+ se(t[3]) << 8 | // b
652
+ 255) >>> // a
653
+ 0 : (t = An.exec(e)) ? (se(t[1]) << 24 | // r
654
+ se(t[2]) << 16 | // g
655
+ se(t[3]) << 8 | // b
656
+ Ut(t[4])) >>> // a
657
+ 0 : (t = Tn.exec(e)) ? parseInt(
658
+ t[1] + t[1] + // r
659
+ t[2] + t[2] + // g
660
+ t[3] + t[3] + // b
661
+ "ff",
662
+ // a
663
+ 16
664
+ ) >>> 0 : (t = In.exec(e)) ? parseInt(t[1], 16) >>> 0 : (t = kn.exec(e)) ? parseInt(
665
+ t[1] + t[1] + // r
666
+ t[2] + t[2] + // g
667
+ t[3] + t[3] + // b
668
+ t[4] + t[4],
669
+ // a
670
+ 16
671
+ ) >>> 0 : (t = Pn.exec(e)) ? ($t(
672
+ Dt(t[1]),
673
+ // h
674
+ je(t[2]),
675
+ // s
676
+ je(t[3])
677
+ // l
678
+ ) | 255) >>> // a
679
+ 0 : (t = En.exec(e)) ? ($t(
680
+ Dt(t[1]),
681
+ // h
682
+ je(t[2]),
683
+ // s
684
+ je(t[3])
685
+ // l
686
+ ) | Ut(t[4])) >>> // a
687
+ 0 : null;
688
+ }
689
+ function et(e, t, r) {
690
+ return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e;
691
+ }
692
+ function $t(e, t, r) {
693
+ const n = r < 0.5 ? r * (1 + t) : r + t - r * t, s = 2 * r - n, i = et(s, n, e + 1 / 3), a = et(s, n, e), u = et(s, n, e - 1 / 3);
694
+ return Math.round(i * 255) << 24 | Math.round(a * 255) << 16 | Math.round(u * 255) << 8;
695
+ }
696
+ function se(e) {
697
+ const t = parseInt(e, 10);
698
+ return t < 0 ? 0 : t > 255 ? 255 : t;
699
+ }
700
+ function Dt(e) {
701
+ return (parseFloat(e) % 360 + 360) % 360 / 360;
702
+ }
703
+ function Ut(e) {
704
+ const t = parseFloat(e);
705
+ return t < 0 ? 0 : t > 1 ? 255 : Math.round(t * 255);
706
+ }
707
+ function je(e) {
708
+ const t = parseFloat(e);
709
+ return t < 0 ? 0 : t > 100 ? 1 : t / 100;
710
+ }
711
+ function qt(e) {
712
+ let t = On(e);
713
+ if (t === null) return e;
714
+ t = t || 0;
715
+ const r = (t & 4278190080) >>> 24, n = (t & 16711680) >>> 16, s = (t & 65280) >>> 8, i = (t & 255) / 255;
716
+ return `rgba(${r}, ${n}, ${s}, ${i})`;
717
+ }
718
+ var be = (e, t, r) => {
719
+ if (c.fun(e))
720
+ return e;
721
+ if (c.arr(e))
722
+ return be({
723
+ range: e,
724
+ output: t,
725
+ extrapolate: r
726
+ });
727
+ if (c.str(e.output[0]))
728
+ return wt(e);
729
+ const n = e, s = n.output, i = n.range || [0, 1], a = n.extrapolateLeft || n.extrapolate || "extend", u = n.extrapolateRight || n.extrapolate || "extend", d = n.easing || ((l) => l);
730
+ return (l) => {
731
+ const m = Fn(l, i);
732
+ return jn(
733
+ l,
734
+ i[m],
735
+ i[m + 1],
736
+ s[m],
737
+ s[m + 1],
738
+ d,
739
+ a,
740
+ u,
741
+ n.map
742
+ );
743
+ };
744
+ };
745
+ function jn(e, t, r, n, s, i, a, u, d) {
746
+ let l = d ? d(e) : e;
747
+ if (l < t) {
748
+ if (a === "identity") return l;
749
+ a === "clamp" && (l = t);
750
+ }
751
+ if (l > r) {
752
+ if (u === "identity") return l;
753
+ u === "clamp" && (l = r);
754
+ }
755
+ return n === s ? n : t === r ? e <= t ? n : s : (t === -1 / 0 ? l = -l : r === 1 / 0 ? l = l - t : l = (l - t) / (r - t), l = i(l), n === -1 / 0 ? l = -l : s === 1 / 0 ? l = l + n : l = l * (s - n) + n, l);
756
+ }
757
+ function Fn(e, t) {
758
+ for (var r = 1; r < t.length - 1 && !(t[r] >= e); ++r)
759
+ ;
760
+ return r - 1;
761
+ }
762
+ var Vn = {
763
+ linear: (e) => e
764
+ }, we = Symbol.for("FluidValue.get"), oe = Symbol.for("FluidValue.observers"), V = (e) => !!(e && e[we]), O = (e) => e && e[we] ? e[we]() : e, Mt = (e) => e[oe] || null;
765
+ function Nn(e, t) {
766
+ e.eventObserved ? e.eventObserved(t) : e(t);
767
+ }
768
+ function Re(e, t) {
769
+ const r = e[oe];
770
+ r && r.forEach((n) => {
771
+ Nn(n, t);
772
+ });
773
+ }
774
+ var Sr = class {
775
+ constructor(e) {
776
+ if (!e && !(e = this.get))
777
+ throw Error("Unknown getter");
778
+ $n(this, e);
779
+ }
780
+ }, $n = (e, t) => xr(e, we, t);
781
+ function ue(e, t) {
782
+ if (e[we]) {
783
+ let r = e[oe];
784
+ r || xr(e, oe, r = /* @__PURE__ */ new Set()), r.has(t) || (r.add(t), e.observerAdded && e.observerAdded(r.size, t));
785
+ }
786
+ return t;
787
+ }
788
+ function Se(e, t) {
789
+ const r = e[oe];
790
+ if (r && r.has(t)) {
791
+ const n = r.size - 1;
792
+ n ? r.delete(t) : e[oe] = null, e.observerRemoved && e.observerRemoved(n, t);
793
+ }
794
+ }
795
+ var xr = (e, t, r) => Object.defineProperty(e, t, {
796
+ value: r,
797
+ writable: !0,
798
+ configurable: !0
799
+ }), Ve = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, Dn = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi, zt = new RegExp(`(${Ve.source})(%|[a-z]+)`, "i"), Un = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, Qe = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/, Ar = (e) => {
800
+ const [t, r] = qn(e);
801
+ if (!t || bt())
802
+ return e;
803
+ const n = window.getComputedStyle(document.documentElement).getPropertyValue(t);
804
+ if (n)
805
+ return n.trim();
806
+ if (r && r.startsWith("--")) {
807
+ const s = window.getComputedStyle(document.documentElement).getPropertyValue(r);
808
+ return s || e;
809
+ } else {
810
+ if (r && Qe.test(r))
811
+ return Ar(r);
812
+ if (r)
813
+ return r;
814
+ }
815
+ return e;
816
+ }, qn = (e) => {
817
+ const t = Qe.exec(e);
818
+ if (!t) return [,];
819
+ const [, r, n] = t;
820
+ return [r, n];
821
+ }, tt, Mn = (e, t, r, n, s) => `rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${s})`, Pr = (e) => {
822
+ tt || (tt = Z ? (
823
+ // match color names, ignore partial matches
824
+ new RegExp(`(${Object.keys(Z).join("|")})(?!\\w)`, "g")
825
+ ) : (
826
+ // never match
827
+ /^\b$/
828
+ ));
829
+ const t = e.output.map((i) => O(i).replace(Qe, Ar).replace(Dn, qt).replace(tt, qt)), r = t.map((i) => i.match(Ve).map(Number)), s = r[0].map(
830
+ (i, a) => r.map((u) => {
831
+ if (!(a in u))
832
+ throw Error('The arity of each "output" value must be equal');
833
+ return u[a];
834
+ })
835
+ ).map(
836
+ (i) => be({ ...e, output: i })
837
+ );
838
+ return (i) => {
839
+ var d;
840
+ const a = !zt.test(t[0]) && ((d = t.find((l) => zt.test(l))) == null ? void 0 : d.replace(Ve, ""));
841
+ let u = 0;
842
+ return t[0].replace(
843
+ Ve,
844
+ () => `${s[u++](i)}${a || ""}`
845
+ ).replace(Un, Mn);
846
+ };
847
+ }, St = "react-spring: ", Er = (e) => {
848
+ const t = e;
849
+ let r = !1;
850
+ if (typeof t != "function")
851
+ throw new TypeError(`${St}once requires a function parameter`);
852
+ return (...n) => {
853
+ r || (t(...n), r = !0);
854
+ };
855
+ }, zn = Er(console.warn);
856
+ function Ln() {
857
+ zn(
858
+ `${St}The "interpolate" function is deprecated in v9 (use "to" instead)`
859
+ );
860
+ }
861
+ var Qn = Er(console.warn);
862
+ function Gn() {
863
+ Qn(
864
+ `${St}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`
865
+ );
866
+ }
867
+ function Ge(e) {
868
+ return c.str(e) && (e[0] == "#" || /\d/.test(e) || // Do not identify a CSS variable as an AnimatedString if its SSR
869
+ !bt() && Qe.test(e) || e in (Z || {}));
870
+ }
871
+ var xt = bt() ? Te : Kr, Yn = () => {
872
+ const e = W(!1);
873
+ return xt(() => (e.current = !0, () => {
874
+ e.current = !1;
875
+ }), []), e;
876
+ };
877
+ function Tr() {
878
+ const e = Fe()[1], t = Yn();
879
+ return () => {
880
+ t.current && e(Math.random());
881
+ };
882
+ }
883
+ var kr = (e) => Te(e, Wn), Wn = [];
884
+ function Lt(e) {
885
+ const t = W(void 0);
886
+ return Te(() => {
887
+ t.current = e;
888
+ }), t.current;
889
+ }
890
+ var xe = Symbol.for("Animated:node"), Bn = (e) => !!e && e[xe] === e, z = (e) => e && e[xe], At = (e, t) => _n(e, xe, t), Ye = (e) => e && e[xe] && e[xe].getPayload(), Cr = class {
891
+ constructor() {
892
+ At(this, this);
893
+ }
894
+ /** Get every `AnimatedValue` used by this node. */
895
+ getPayload() {
896
+ return this.payload || [];
897
+ }
898
+ }, We = class Ir extends Cr {
899
+ constructor(t) {
900
+ super(), this._value = t, this.done = !0, this.durationProgress = 0, c.num(this._value) && (this.lastPosition = this._value);
901
+ }
902
+ /** @internal */
903
+ static create(t) {
904
+ return new Ir(t);
905
+ }
906
+ getPayload() {
907
+ return [this];
908
+ }
909
+ getValue() {
910
+ return this._value;
911
+ }
912
+ setValue(t, r) {
913
+ return c.num(t) && (this.lastPosition = t, r && (t = Math.round(t / r) * r, this.done && (this.lastPosition = t))), this._value === t ? !1 : (this._value = t, !0);
914
+ }
915
+ reset() {
916
+ const { done: t } = this;
917
+ this.done = !1, c.num(this._value) && (this.elapsedTime = 0, this.durationProgress = 0, this.lastPosition = this._value, t && (this.lastVelocity = null), this.v0 = null);
918
+ }
919
+ }, Ue = class Or extends We {
920
+ constructor(t) {
921
+ super(0), this._string = null, this._toString = be({
922
+ output: [t, t]
923
+ });
924
+ }
925
+ /** @internal */
926
+ static create(t) {
927
+ return new Or(t);
928
+ }
929
+ getValue() {
930
+ const t = this._string;
931
+ return t ?? (this._string = this._toString(this._value));
932
+ }
933
+ setValue(t) {
934
+ if (c.str(t)) {
935
+ if (t == this._string)
936
+ return !1;
937
+ this._string = t, this._value = 1;
938
+ } else if (super.setValue(t))
939
+ this._string = null;
940
+ else
941
+ return !1;
942
+ return !0;
943
+ }
944
+ reset(t) {
945
+ t && (this._toString = be({
946
+ output: [this.getValue(), t]
947
+ })), this._value = 0, super.reset();
948
+ }
949
+ }, qe = { dependencies: null }, Be = class extends Cr {
950
+ constructor(e) {
951
+ super(), this.source = e, this.setValue(e);
952
+ }
953
+ getValue(e) {
954
+ const t = {};
955
+ return L(this.source, (r, n) => {
956
+ Bn(r) ? t[n] = r.getValue(e) : V(r) ? t[n] = O(r) : e || (t[n] = r);
957
+ }), t;
958
+ }
959
+ /** Replace the raw object data */
960
+ setValue(e) {
961
+ this.source = e, this.payload = this._makePayload(e);
962
+ }
963
+ reset() {
964
+ this.payload && x(this.payload, (e) => e.reset());
965
+ }
966
+ /** Create a payload set. */
967
+ _makePayload(e) {
968
+ if (e) {
969
+ const t = /* @__PURE__ */ new Set();
970
+ return L(e, this._addToPayload, t), Array.from(t);
971
+ }
972
+ }
973
+ /** Add to a payload set. */
974
+ _addToPayload(e) {
975
+ qe.dependencies && V(e) && qe.dependencies.add(e);
976
+ const t = Ye(e);
977
+ t && x(t, (r) => this.add(r));
978
+ }
979
+ }, Hn = class jr extends Be {
980
+ constructor(t) {
981
+ super(t);
982
+ }
983
+ /** @internal */
984
+ static create(t) {
985
+ return new jr(t);
986
+ }
987
+ getValue() {
988
+ return this.source.map((t) => t.getValue());
989
+ }
990
+ setValue(t) {
991
+ const r = this.getPayload();
992
+ return t.length == r.length ? r.map((n, s) => n.setValue(t[s])).some(Boolean) : (super.setValue(t.map(Jn)), !0);
993
+ }
994
+ };
995
+ function Jn(e) {
996
+ return (Ge(e) ? Ue : We).create(e);
997
+ }
998
+ function ut(e) {
999
+ const t = z(e);
1000
+ return t ? t.constructor : c.arr(e) ? Hn : Ge(e) ? Ue : We;
1001
+ }
1002
+ var Qt = (e, t) => {
1003
+ const r = (
1004
+ // Function components must use "forwardRef" to avoid being
1005
+ // re-rendered on every animation frame.
1006
+ !c.fun(e) || e.prototype && e.prototype.isReactComponent
1007
+ );
1008
+ return en((n, s) => {
1009
+ const i = W(null), a = r && // eslint-disable-next-line react-hooks/rules-of-hooks
1010
+ tn(
1011
+ (_) => {
1012
+ i.current = Kn(s, _);
1013
+ },
1014
+ [s]
1015
+ ), [u, d] = Zn(n, t), l = Tr(), m = () => {
1016
+ const _ = i.current;
1017
+ if (r && !_)
1018
+ return;
1019
+ (_ ? t.applyAnimatedValues(_, u.getValue(!0)) : !1) === !1 && l();
1020
+ }, f = new Xn(m, d), h = W(void 0);
1021
+ xt(() => (h.current = f, x(d, (_) => ue(_, f)), () => {
1022
+ h.current && (x(
1023
+ h.current.deps,
1024
+ (_) => Se(_, h.current)
1025
+ ), b.cancel(h.current.update));
1026
+ })), Te(m, []), kr(() => () => {
1027
+ const _ = h.current;
1028
+ x(_.deps, (v) => Se(v, _));
1029
+ });
1030
+ const p = t.getComponentProps(u.getValue());
1031
+ return /* @__PURE__ */ cr.createElement(e, { ...p, ref: a });
1032
+ });
1033
+ }, Xn = class {
1034
+ constructor(e, t) {
1035
+ this.update = e, this.deps = t;
1036
+ }
1037
+ eventObserved(e) {
1038
+ e.type == "change" && b.write(this.update);
1039
+ }
1040
+ };
1041
+ function Zn(e, t) {
1042
+ const r = /* @__PURE__ */ new Set();
1043
+ return qe.dependencies = r, e.style && (e = {
1044
+ ...e,
1045
+ style: t.createAnimatedStyle(e.style)
1046
+ }), e = new Be(e), qe.dependencies = null, [e, r];
1047
+ }
1048
+ function Kn(e, t) {
1049
+ return e && (c.fun(e) ? e(t) : e.current = t), t;
1050
+ }
1051
+ var Gt = Symbol.for("AnimatedComponent"), es = (e, {
1052
+ applyAnimatedValues: t = () => !1,
1053
+ createAnimatedStyle: r = (s) => new Be(s),
1054
+ getComponentProps: n = (s) => s
1055
+ } = {}) => {
1056
+ const s = {
1057
+ applyAnimatedValues: t,
1058
+ createAnimatedStyle: r,
1059
+ getComponentProps: n
1060
+ }, i = (a) => {
1061
+ const u = Yt(a) || "Anonymous";
1062
+ return c.str(a) ? a = i[a] || (i[a] = Qt(a, s)) : a = a[Gt] || (a[Gt] = Qt(a, s)), a.displayName = `Animated(${u})`, a;
1063
+ };
1064
+ return L(e, (a, u) => {
1065
+ c.arr(e) && (u = Yt(a)), i[u] = i(a);
1066
+ }), {
1067
+ animated: i
1068
+ };
1069
+ }, Yt = (e) => c.str(e) ? e : e && c.str(e.displayName) ? e.displayName : c.fun(e) && e.name || null;
1070
+ function ee(e, ...t) {
1071
+ return c.fun(e) ? e(...t) : e;
1072
+ }
1073
+ var ye = (e, t) => e === !0 || !!(t && e && (c.fun(e) ? e(t) : F(e).includes(t))), Fr = (e, t) => c.obj(e) ? t && e[t] : e, Vr = (e, t) => e.default === !0 ? e[t] : e.default ? e.default[t] : void 0, ts = (e) => e, Pt = (e, t = ts) => {
1074
+ let r = rs;
1075
+ e.default && e.default !== !0 && (e = e.default, r = Object.keys(e));
1076
+ const n = {};
1077
+ for (const s of r) {
1078
+ const i = t(e[s], s);
1079
+ c.und(i) || (n[s] = i);
1080
+ }
1081
+ return n;
1082
+ }, rs = [
1083
+ "config",
1084
+ "onProps",
1085
+ "onStart",
1086
+ "onChange",
1087
+ "onPause",
1088
+ "onResume",
1089
+ "onRest"
1090
+ ], ns = {
1091
+ config: 1,
1092
+ from: 1,
1093
+ to: 1,
1094
+ ref: 1,
1095
+ loop: 1,
1096
+ reset: 1,
1097
+ pause: 1,
1098
+ cancel: 1,
1099
+ reverse: 1,
1100
+ immediate: 1,
1101
+ default: 1,
1102
+ delay: 1,
1103
+ onProps: 1,
1104
+ onStart: 1,
1105
+ onChange: 1,
1106
+ onPause: 1,
1107
+ onResume: 1,
1108
+ onRest: 1,
1109
+ onResolve: 1,
1110
+ // Transition props
1111
+ items: 1,
1112
+ trail: 1,
1113
+ sort: 1,
1114
+ expires: 1,
1115
+ initial: 1,
1116
+ enter: 1,
1117
+ update: 1,
1118
+ leave: 1,
1119
+ children: 1,
1120
+ onDestroyed: 1,
1121
+ // Internal props
1122
+ keys: 1,
1123
+ callId: 1,
1124
+ parentId: 1
1125
+ };
1126
+ function ss(e) {
1127
+ const t = {};
1128
+ let r = 0;
1129
+ if (L(e, (n, s) => {
1130
+ ns[s] || (t[s] = n, r++);
1131
+ }), r)
1132
+ return t;
1133
+ }
1134
+ function Nr(e) {
1135
+ const t = ss(e);
1136
+ if (t) {
1137
+ const r = { to: t };
1138
+ return L(e, (n, s) => s in t || (r[s] = n)), r;
1139
+ }
1140
+ return { ...e };
1141
+ }
1142
+ function Ae(e) {
1143
+ return e = O(e), c.arr(e) ? e.map(Ae) : Ge(e) ? q.createStringInterpolator({
1144
+ range: [0, 1],
1145
+ output: [e, e]
1146
+ })(1) : e;
1147
+ }
1148
+ function is(e) {
1149
+ for (const t in e) return !0;
1150
+ return !1;
1151
+ }
1152
+ function lt(e) {
1153
+ return c.fun(e) || c.arr(e) && c.obj(e[0]);
1154
+ }
1155
+ function as(e, t) {
1156
+ var r;
1157
+ (r = e.ref) == null || r.delete(e), t == null || t.delete(e);
1158
+ }
1159
+ function os(e, t) {
1160
+ var r;
1161
+ t && e.ref !== t && ((r = e.ref) == null || r.delete(e), t.add(e), e.ref = t);
1162
+ }
1163
+ var us = {
1164
+ default: { tension: 170, friction: 26 }
1165
+ }, ct = {
1166
+ ...us.default,
1167
+ mass: 1,
1168
+ damping: 1,
1169
+ easing: Vn.linear,
1170
+ clamp: !1
1171
+ }, ls = class {
1172
+ constructor() {
1173
+ this.velocity = 0, Object.assign(this, ct);
1174
+ }
1175
+ };
1176
+ function cs(e, t, r) {
1177
+ r && (r = { ...r }, Wt(r, t), t = { ...r, ...t }), Wt(e, t), Object.assign(e, t);
1178
+ for (const a in ct)
1179
+ e[a] == null && (e[a] = ct[a]);
1180
+ let { frequency: n, damping: s } = e;
1181
+ const { mass: i } = e;
1182
+ return c.und(n) || (n < 0.01 && (n = 0.01), s < 0 && (s = 0), e.tension = Math.pow(2 * Math.PI / n, 2) * i, e.friction = 4 * Math.PI * s * i / n), e;
1183
+ }
1184
+ function Wt(e, t) {
1185
+ if (!c.und(t.decay))
1186
+ e.duration = void 0;
1187
+ else {
1188
+ const r = !c.und(t.tension) || !c.und(t.friction);
1189
+ (r || !c.und(t.frequency) || !c.und(t.damping) || !c.und(t.mass)) && (e.duration = void 0, e.decay = void 0), r && (e.frequency = void 0);
1190
+ }
1191
+ }
1192
+ var Bt = [], ds = class {
1193
+ constructor() {
1194
+ this.changed = !1, this.values = Bt, this.toValues = null, this.fromValues = Bt, this.config = new ls(), this.immediate = !1;
1195
+ }
1196
+ };
1197
+ function $r(e, { key: t, props: r, defaultProps: n, state: s, actions: i }) {
1198
+ return new Promise((a, u) => {
1199
+ let d, l, m = ye(r.cancel ?? (n == null ? void 0 : n.cancel), t);
1200
+ if (m)
1201
+ p();
1202
+ else {
1203
+ c.und(r.pause) || (s.paused = ye(r.pause, t));
1204
+ let _ = n == null ? void 0 : n.pause;
1205
+ _ !== !0 && (_ = s.paused || ye(_, t)), d = ee(r.delay || 0, t), _ ? (s.resumeQueue.add(h), i.pause()) : (i.resume(), h());
1206
+ }
1207
+ function f() {
1208
+ s.resumeQueue.add(h), s.timeouts.delete(l), l.cancel(), d = l.time - b.now();
1209
+ }
1210
+ function h() {
1211
+ d > 0 && !q.skipAnimation ? (s.delayed = !0, l = b.setTimeout(p, d), s.pauseQueue.add(f), s.timeouts.add(l)) : p();
1212
+ }
1213
+ function p() {
1214
+ s.delayed && (s.delayed = !1), s.pauseQueue.delete(f), s.timeouts.delete(l), e <= (s.cancelId || 0) && (m = !0);
1215
+ try {
1216
+ i.start({ ...r, callId: e, cancel: m }, a);
1217
+ } catch (_) {
1218
+ u(_);
1219
+ }
1220
+ }
1221
+ });
1222
+ }
1223
+ var Et = (e, t) => t.length == 1 ? t[0] : t.some((r) => r.cancelled) ? ae(e.get()) : t.every((r) => r.noop) ? Dr(e.get()) : $(
1224
+ e.get(),
1225
+ t.every((r) => r.finished)
1226
+ ), Dr = (e) => ({
1227
+ value: e,
1228
+ noop: !0,
1229
+ finished: !0,
1230
+ cancelled: !1
1231
+ }), $ = (e, t, r = !1) => ({
1232
+ value: e,
1233
+ finished: t,
1234
+ cancelled: r
1235
+ }), ae = (e) => ({
1236
+ value: e,
1237
+ cancelled: !0,
1238
+ finished: !1
1239
+ });
1240
+ function Ur(e, t, r, n) {
1241
+ const { callId: s, parentId: i, onRest: a } = t, { asyncTo: u, promise: d } = r;
1242
+ return !i && e === u && !t.reset ? d : r.promise = (async () => {
1243
+ r.asyncId = s, r.asyncTo = e;
1244
+ const l = Pt(
1245
+ t,
1246
+ (w, g) => (
1247
+ // The `onRest` prop is only called when the `runAsync` promise is resolved.
1248
+ g === "onRest" ? void 0 : w
1249
+ )
1250
+ );
1251
+ let m, f;
1252
+ const h = new Promise(
1253
+ (w, g) => (m = w, f = g)
1254
+ ), p = (w) => {
1255
+ const g = (
1256
+ // The `cancel` prop or `stop` method was used.
1257
+ s <= (r.cancelId || 0) && ae(n) || // The async `to` prop was replaced.
1258
+ s !== r.asyncId && $(n, !1)
1259
+ );
1260
+ if (g)
1261
+ throw w.result = g, f(w), w;
1262
+ }, _ = (w, g) => {
1263
+ const R = new Ht(), y = new Jt();
1264
+ return (async () => {
1265
+ if (q.skipAnimation)
1266
+ throw Pe(r), y.result = $(n, !1), f(y), y;
1267
+ p(R);
1268
+ const A = c.obj(w) ? { ...w } : { ...g, to: w };
1269
+ A.parentId = s, L(l, (Q, I) => {
1270
+ c.und(A[I]) && (A[I] = Q);
1271
+ });
1272
+ const P = await n.start(A);
1273
+ return p(R), r.paused && await new Promise((Q) => {
1274
+ r.resumeQueue.add(Q);
1275
+ }), P;
1276
+ })();
1277
+ };
1278
+ let v;
1279
+ if (q.skipAnimation)
1280
+ return Pe(r), $(n, !1);
1281
+ try {
1282
+ let w;
1283
+ c.arr(e) ? w = (async (g) => {
1284
+ for (const R of g)
1285
+ await _(R);
1286
+ })(e) : w = Promise.resolve(e(_, n.stop.bind(n))), await Promise.all([w.then(m), h]), v = $(n.get(), !0, !1);
1287
+ } catch (w) {
1288
+ if (w instanceof Ht)
1289
+ v = w.result;
1290
+ else if (w instanceof Jt)
1291
+ v = w.result;
1292
+ else
1293
+ throw w;
1294
+ } finally {
1295
+ s == r.asyncId && (r.asyncId = i, r.asyncTo = i ? u : void 0, r.promise = i ? d : void 0);
1296
+ }
1297
+ return c.fun(a) && b.batchedUpdates(() => {
1298
+ a(v, n, n.item);
1299
+ }), v;
1300
+ })();
1301
+ }
1302
+ function Pe(e, t) {
1303
+ ge(e.timeouts, (r) => r.cancel()), e.pauseQueue.clear(), e.resumeQueue.clear(), e.asyncId = e.asyncTo = e.promise = void 0, t && (e.cancelId = t);
1304
+ }
1305
+ var Ht = class extends Error {
1306
+ constructor() {
1307
+ super(
1308
+ "An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."
1309
+ );
1310
+ }
1311
+ }, Jt = class extends Error {
1312
+ constructor() {
1313
+ super("SkipAnimationSignal");
1314
+ }
1315
+ }, dt = (e) => e instanceof Tt, fs = 1, Tt = class extends Sr {
1316
+ constructor() {
1317
+ super(...arguments), this.id = fs++, this._priority = 0;
1318
+ }
1319
+ get priority() {
1320
+ return this._priority;
1321
+ }
1322
+ set priority(e) {
1323
+ this._priority != e && (this._priority = e, this._onPriorityChange(e));
1324
+ }
1325
+ /** Get the current value */
1326
+ get() {
1327
+ const e = z(this);
1328
+ return e && e.getValue();
1329
+ }
1330
+ /** Create a spring that maps our value to another value */
1331
+ to(...e) {
1332
+ return q.to(this, e);
1333
+ }
1334
+ /** @deprecated Use the `to` method instead. */
1335
+ interpolate(...e) {
1336
+ return Ln(), q.to(this, e);
1337
+ }
1338
+ toJSON() {
1339
+ return this.get();
1340
+ }
1341
+ observerAdded(e) {
1342
+ e == 1 && this._attach();
1343
+ }
1344
+ observerRemoved(e) {
1345
+ e == 0 && this._detach();
1346
+ }
1347
+ /** Called when the first child is added. */
1348
+ _attach() {
1349
+ }
1350
+ /** Called when the last child is removed. */
1351
+ _detach() {
1352
+ }
1353
+ /** Tell our children about our new value */
1354
+ _onChange(e, t = !1) {
1355
+ Re(this, {
1356
+ type: "change",
1357
+ parent: this,
1358
+ value: e,
1359
+ idle: t
1360
+ });
1361
+ }
1362
+ /** Tell our children about our new priority */
1363
+ _onPriorityChange(e) {
1364
+ this.idle || ze.sort(this), Re(this, {
1365
+ type: "priority",
1366
+ parent: this,
1367
+ priority: e
1368
+ });
1369
+ }
1370
+ }, te = Symbol.for("SpringPhase"), qr = 1, ft = 2, ht = 4, rt = (e) => (e[te] & qr) > 0, H = (e) => (e[te] & ft) > 0, de = (e) => (e[te] & ht) > 0, Xt = (e, t) => t ? e[te] |= ft | qr : e[te] &= ~ft, Zt = (e, t) => t ? e[te] |= ht : e[te] &= ~ht, hs = class extends Tt {
1371
+ constructor(e, t) {
1372
+ if (super(), this.animation = new ds(), this.defaultProps = {}, this._state = {
1373
+ paused: !1,
1374
+ delayed: !1,
1375
+ pauseQueue: /* @__PURE__ */ new Set(),
1376
+ resumeQueue: /* @__PURE__ */ new Set(),
1377
+ timeouts: /* @__PURE__ */ new Set()
1378
+ }, this._pendingCalls = /* @__PURE__ */ new Set(), this._lastCallId = 0, this._lastToId = 0, this._memoizedDuration = 0, !c.und(e) || !c.und(t)) {
1379
+ const r = c.obj(e) ? { ...e } : { ...t, from: e };
1380
+ c.und(r.default) && (r.default = !0), this.start(r);
1381
+ }
1382
+ }
1383
+ /** Equals true when not advancing on each frame. */
1384
+ get idle() {
1385
+ return !(H(this) || this._state.asyncTo) || de(this);
1386
+ }
1387
+ get goal() {
1388
+ return O(this.animation.to);
1389
+ }
1390
+ get velocity() {
1391
+ const e = z(this);
1392
+ return e instanceof We ? e.lastVelocity || 0 : e.getPayload().map((t) => t.lastVelocity || 0);
1393
+ }
1394
+ /**
1395
+ * When true, this value has been animated at least once.
1396
+ */
1397
+ get hasAnimated() {
1398
+ return rt(this);
1399
+ }
1400
+ /**
1401
+ * When true, this value has an unfinished animation,
1402
+ * which is either active or paused.
1403
+ */
1404
+ get isAnimating() {
1405
+ return H(this);
1406
+ }
1407
+ /**
1408
+ * When true, all current and future animations are paused.
1409
+ */
1410
+ get isPaused() {
1411
+ return de(this);
1412
+ }
1413
+ /**
1414
+ *
1415
+ *
1416
+ */
1417
+ get isDelayed() {
1418
+ return this._state.delayed;
1419
+ }
1420
+ /** Advance the current animation by a number of milliseconds */
1421
+ advance(e) {
1422
+ let t = !0, r = !1;
1423
+ const n = this.animation;
1424
+ let { toValues: s } = n;
1425
+ const { config: i } = n, a = Ye(n.to);
1426
+ !a && V(n.to) && (s = F(O(n.to))), n.values.forEach((l, m) => {
1427
+ if (l.done) return;
1428
+ const f = (
1429
+ // Animated strings always go from 0 to 1.
1430
+ l.constructor == Ue ? 1 : a ? a[m].lastPosition : s[m]
1431
+ );
1432
+ let h = n.immediate, p = f;
1433
+ if (!h) {
1434
+ if (p = l.lastPosition, i.tension <= 0) {
1435
+ l.done = !0;
1436
+ return;
1437
+ }
1438
+ let _ = l.elapsedTime += e;
1439
+ const v = n.fromValues[m], w = l.v0 != null ? l.v0 : l.v0 = c.arr(i.velocity) ? i.velocity[m] : i.velocity;
1440
+ let g;
1441
+ const R = i.precision || (v == f ? 5e-3 : Math.min(1, Math.abs(f - v) * 1e-3));
1442
+ if (c.und(i.duration))
1443
+ if (i.decay) {
1444
+ const y = i.decay === !0 ? 0.998 : i.decay, A = Math.exp(-(1 - y) * _);
1445
+ p = v + w / (1 - y) * (1 - A), h = Math.abs(l.lastPosition - p) <= R, g = w * A;
1446
+ } else {
1447
+ g = l.lastVelocity == null ? w : l.lastVelocity;
1448
+ const y = i.restVelocity || R / 10, A = i.clamp ? 0 : i.bounce, P = !c.und(A), Q = v == f ? l.v0 > 0 : v < f;
1449
+ let I, re = !1;
1450
+ const C = 1, K = Math.ceil(e / C);
1451
+ for (let j = 0; j < K && (I = Math.abs(g) > y, !(!I && (h = Math.abs(f - p) <= R, h))); ++j) {
1452
+ P && (re = p == f || p > f == Q, re && (g = -g * A, p = f));
1453
+ const M = -i.tension * 1e-6 * (p - f), G = -i.friction * 1e-3 * g, He = (M + G) / i.mass;
1454
+ g = g + He * C, p = p + g * C;
1455
+ }
1456
+ }
1457
+ else {
1458
+ let y = 1;
1459
+ i.duration > 0 && (this._memoizedDuration !== i.duration && (this._memoizedDuration = i.duration, l.durationProgress > 0 && (l.elapsedTime = i.duration * l.durationProgress, _ = l.elapsedTime += e)), y = (i.progress || 0) + _ / this._memoizedDuration, y = y > 1 ? 1 : y < 0 ? 0 : y, l.durationProgress = y), p = v + i.easing(y) * (f - v), g = (p - l.lastPosition) / e, h = y == 1;
1460
+ }
1461
+ l.lastVelocity = g, Number.isNaN(p) && (console.warn("Got NaN while animating:", this), h = !0);
1462
+ }
1463
+ a && !a[m].done && (h = !1), h ? l.done = !0 : t = !1, l.setValue(p, i.round) && (r = !0);
1464
+ });
1465
+ const u = z(this), d = u.getValue();
1466
+ if (t) {
1467
+ const l = O(n.to);
1468
+ (d !== l || r) && !i.decay ? (u.setValue(l), this._onChange(l)) : r && i.decay && this._onChange(d), this._stop();
1469
+ } else r && this._onChange(d);
1470
+ }
1471
+ /** Set the current value, while stopping the current animation */
1472
+ set(e) {
1473
+ return b.batchedUpdates(() => {
1474
+ this._stop(), this._focus(e), this._set(e);
1475
+ }), this;
1476
+ }
1477
+ /**
1478
+ * Freeze the active animation in time, as well as any updates merged
1479
+ * before `resume` is called.
1480
+ */
1481
+ pause() {
1482
+ this._update({ pause: !0 });
1483
+ }
1484
+ /** Resume the animation if paused. */
1485
+ resume() {
1486
+ this._update({ pause: !1 });
1487
+ }
1488
+ /** Skip to the end of the current animation. */
1489
+ finish() {
1490
+ if (H(this)) {
1491
+ const { to: e, config: t } = this.animation;
1492
+ b.batchedUpdates(() => {
1493
+ this._onStart(), t.decay || this._set(e, !1), this._stop();
1494
+ });
1495
+ }
1496
+ return this;
1497
+ }
1498
+ /** Push props into the pending queue. */
1499
+ update(e) {
1500
+ return (this.queue || (this.queue = [])).push(e), this;
1501
+ }
1502
+ start(e, t) {
1503
+ let r;
1504
+ return c.und(e) ? (r = this.queue || [], this.queue = []) : r = [c.obj(e) ? e : { ...t, to: e }], Promise.all(
1505
+ r.map((n) => this._update(n))
1506
+ ).then((n) => Et(this, n));
1507
+ }
1508
+ /**
1509
+ * Stop the current animation, and cancel any delayed updates.
1510
+ *
1511
+ * Pass `true` to call `onRest` with `cancelled: true`.
1512
+ */
1513
+ stop(e) {
1514
+ const { to: t } = this.animation;
1515
+ return this._focus(this.get()), Pe(this._state, e && this._lastCallId), b.batchedUpdates(() => this._stop(t, e)), this;
1516
+ }
1517
+ /** Restart the animation. */
1518
+ reset() {
1519
+ this._update({ reset: !0 });
1520
+ }
1521
+ /** @internal */
1522
+ eventObserved(e) {
1523
+ e.type == "change" ? this._start() : e.type == "priority" && (this.priority = e.priority + 1);
1524
+ }
1525
+ /**
1526
+ * Parse the `to` and `from` range from the given `props` object.
1527
+ *
1528
+ * This also ensures the initial value is available to animated components
1529
+ * during the render phase.
1530
+ */
1531
+ _prepareNode(e) {
1532
+ const t = this.key || "";
1533
+ let { to: r, from: n } = e;
1534
+ r = c.obj(r) ? r[t] : r, (r == null || lt(r)) && (r = void 0), n = c.obj(n) ? n[t] : n, n == null && (n = void 0);
1535
+ const s = { to: r, from: n };
1536
+ return rt(this) || (e.reverse && ([r, n] = [n, r]), n = O(n), c.und(n) ? z(this) || this._set(r) : this._set(n)), s;
1537
+ }
1538
+ /** Every update is processed by this method before merging. */
1539
+ _update({ ...e }, t) {
1540
+ const { key: r, defaultProps: n } = this;
1541
+ e.default && Object.assign(
1542
+ n,
1543
+ Pt(
1544
+ e,
1545
+ (a, u) => /^on/.test(u) ? Fr(a, r) : a
1546
+ )
1547
+ ), er(this, e, "onProps"), he(this, "onProps", e, this);
1548
+ const s = this._prepareNode(e);
1549
+ if (Object.isFrozen(this))
1550
+ throw Error(
1551
+ "Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"
1552
+ );
1553
+ const i = this._state;
1554
+ return $r(++this._lastCallId, {
1555
+ key: r,
1556
+ props: e,
1557
+ defaultProps: n,
1558
+ state: i,
1559
+ actions: {
1560
+ pause: () => {
1561
+ de(this) || (Zt(this, !0), pe(i.pauseQueue), he(
1562
+ this,
1563
+ "onPause",
1564
+ $(this, fe(this, this.animation.to)),
1565
+ this
1566
+ ));
1567
+ },
1568
+ resume: () => {
1569
+ de(this) && (Zt(this, !1), H(this) && this._resume(), pe(i.resumeQueue), he(
1570
+ this,
1571
+ "onResume",
1572
+ $(this, fe(this, this.animation.to)),
1573
+ this
1574
+ ));
1575
+ },
1576
+ start: this._merge.bind(this, s)
1577
+ }
1578
+ }).then((a) => {
1579
+ if (e.loop && a.finished && !(t && a.noop)) {
1580
+ const u = Mr(e);
1581
+ if (u)
1582
+ return this._update(u, !0);
1583
+ }
1584
+ return a;
1585
+ });
1586
+ }
1587
+ /** Merge props into the current animation */
1588
+ _merge(e, t, r) {
1589
+ if (t.cancel)
1590
+ return this.stop(!0), r(ae(this));
1591
+ const n = !c.und(e.to), s = !c.und(e.from);
1592
+ if (n || s)
1593
+ if (t.callId > this._lastToId)
1594
+ this._lastToId = t.callId;
1595
+ else
1596
+ return r(ae(this));
1597
+ const { key: i, defaultProps: a, animation: u } = this, { to: d, from: l } = u;
1598
+ let { to: m = d, from: f = l } = e;
1599
+ s && !n && (!t.default || c.und(m)) && (m = f), t.reverse && ([m, f] = [f, m]);
1600
+ const h = !Y(f, l);
1601
+ h && (u.from = f), f = O(f);
1602
+ const p = !Y(m, d);
1603
+ p && this._focus(m);
1604
+ const _ = lt(t.to), { config: v } = u, { decay: w, velocity: g } = v;
1605
+ (n || s) && (v.velocity = 0), t.config && !_ && cs(
1606
+ v,
1607
+ ee(t.config, i),
1608
+ // Avoid calling the same "config" prop twice.
1609
+ t.config !== a.config ? ee(a.config, i) : void 0
1610
+ );
1611
+ let R = z(this);
1612
+ if (!R || c.und(m))
1613
+ return r($(this, !0));
1614
+ const y = (
1615
+ // When `reset` is undefined, the `from` prop implies `reset: true`,
1616
+ // except for declarative updates. When `reset` is defined, there
1617
+ // must exist a value to animate from.
1618
+ c.und(t.reset) ? s && !t.default : !c.und(f) && ye(t.reset, i)
1619
+ ), A = y ? f : this.get(), P = Ae(m), Q = c.num(P) || c.arr(P) || Ge(P), I = !_ && (!Q || ye(a.immediate || t.immediate, i));
1620
+ if (p) {
1621
+ const j = ut(m);
1622
+ if (j !== R.constructor)
1623
+ if (I)
1624
+ R = this._set(P);
1625
+ else
1626
+ throw Error(
1627
+ `Cannot animate between ${R.constructor.name} and ${j.name}, as the "to" prop suggests`
1628
+ );
1629
+ }
1630
+ const re = R.constructor;
1631
+ let C = V(m), K = !1;
1632
+ if (!C) {
1633
+ const j = y || !rt(this) && h;
1634
+ (p || j) && (K = Y(Ae(A), P), C = !K), (!Y(u.immediate, I) && !I || !Y(v.decay, w) || !Y(v.velocity, g)) && (C = !0);
1635
+ }
1636
+ if (K && H(this) && (u.changed && !y ? C = !0 : C || this._stop(d)), !_ && ((C || V(d)) && (u.values = R.getPayload(), u.toValues = V(m) ? null : re == Ue ? [1] : F(P)), u.immediate != I && (u.immediate = I, !I && !y && this._set(d)), C)) {
1637
+ const { onRest: j } = u;
1638
+ x(ps, (G) => er(this, t, G));
1639
+ const M = $(this, fe(this, d));
1640
+ pe(this._pendingCalls, M), this._pendingCalls.add(r), u.changed && b.batchedUpdates(() => {
1641
+ var G;
1642
+ u.changed = !y, j == null || j(M, this), y ? ee(a.onRest, M) : (G = u.onStart) == null || G.call(u, M, this);
1643
+ });
1644
+ }
1645
+ y && this._set(A), _ ? r(Ur(t.to, t, this._state, this)) : C ? this._start() : H(this) && !p ? this._pendingCalls.add(r) : r(Dr(A));
1646
+ }
1647
+ /** Update the `animation.to` value, which might be a `FluidValue` */
1648
+ _focus(e) {
1649
+ const t = this.animation;
1650
+ e !== t.to && (Mt(this) && this._detach(), t.to = e, Mt(this) && this._attach());
1651
+ }
1652
+ _attach() {
1653
+ let e = 0;
1654
+ const { to: t } = this.animation;
1655
+ V(t) && (ue(t, this), dt(t) && (e = t.priority + 1)), this.priority = e;
1656
+ }
1657
+ _detach() {
1658
+ const { to: e } = this.animation;
1659
+ V(e) && Se(e, this);
1660
+ }
1661
+ /**
1662
+ * Update the current value from outside the frameloop,
1663
+ * and return the `Animated` node.
1664
+ */
1665
+ _set(e, t = !0) {
1666
+ const r = O(e);
1667
+ if (!c.und(r)) {
1668
+ const n = z(this);
1669
+ if (!n || !Y(r, n.getValue())) {
1670
+ const s = ut(r);
1671
+ !n || n.constructor != s ? At(this, s.create(r)) : n.setValue(r), n && b.batchedUpdates(() => {
1672
+ this._onChange(r, t);
1673
+ });
1674
+ }
1675
+ }
1676
+ return z(this);
1677
+ }
1678
+ _onStart() {
1679
+ const e = this.animation;
1680
+ e.changed || (e.changed = !0, he(
1681
+ this,
1682
+ "onStart",
1683
+ $(this, fe(this, e.to)),
1684
+ this
1685
+ ));
1686
+ }
1687
+ _onChange(e, t) {
1688
+ t || (this._onStart(), ee(this.animation.onChange, e, this)), ee(this.defaultProps.onChange, e, this), super._onChange(e, t);
1689
+ }
1690
+ // This method resets the animation state (even if already animating) to
1691
+ // ensure the latest from/to range is used, and it also ensures this spring
1692
+ // is added to the frameloop.
1693
+ _start() {
1694
+ const e = this.animation;
1695
+ z(this).reset(O(e.to)), e.immediate || (e.fromValues = e.values.map((t) => t.lastPosition)), H(this) || (Xt(this, !0), de(this) || this._resume());
1696
+ }
1697
+ _resume() {
1698
+ q.skipAnimation ? this.finish() : ze.start(this);
1699
+ }
1700
+ /**
1701
+ * Exit the frameloop and notify `onRest` listeners.
1702
+ *
1703
+ * Always wrap `_stop` calls with `batchedUpdates`.
1704
+ */
1705
+ _stop(e, t) {
1706
+ if (H(this)) {
1707
+ Xt(this, !1);
1708
+ const r = this.animation;
1709
+ x(r.values, (s) => {
1710
+ s.done = !0;
1711
+ }), r.toValues && (r.onChange = r.onPause = r.onResume = void 0), Re(this, {
1712
+ type: "idle",
1713
+ parent: this
1714
+ });
1715
+ const n = t ? ae(this.get()) : $(this.get(), fe(this, e ?? r.to));
1716
+ pe(this._pendingCalls, n), r.changed && (r.changed = !1, he(this, "onRest", n, this));
1717
+ }
1718
+ }
1719
+ };
1720
+ function fe(e, t) {
1721
+ const r = Ae(t), n = Ae(e.get());
1722
+ return Y(n, r);
1723
+ }
1724
+ function Mr(e, t = e.loop, r = e.to) {
1725
+ const n = ee(t);
1726
+ if (n) {
1727
+ const s = n !== !0 && Nr(n), i = (s || e).reverse, a = !s || s.reset;
1728
+ return Ee({
1729
+ ...e,
1730
+ loop: t,
1731
+ // Avoid updating default props when looping.
1732
+ default: !1,
1733
+ // Never loop the `pause` prop.
1734
+ pause: void 0,
1735
+ // For the "reverse" prop to loop as expected, the "to" prop
1736
+ // must be undefined. The "reverse" prop is ignored when the
1737
+ // "to" prop is an array or function.
1738
+ to: !i || lt(r) ? r : void 0,
1739
+ // Ignore the "from" prop except on reset.
1740
+ from: a ? e.from : void 0,
1741
+ reset: a,
1742
+ // The "loop" prop can return a "useSpring" props object to
1743
+ // override any of the original props.
1744
+ ...s
1745
+ });
1746
+ }
1747
+ }
1748
+ function Ee(e) {
1749
+ const { to: t, from: r } = e = Nr(e), n = /* @__PURE__ */ new Set();
1750
+ return c.obj(t) && Kt(t, n), c.obj(r) && Kt(r, n), e.keys = n.size ? Array.from(n) : null, e;
1751
+ }
1752
+ function ms(e) {
1753
+ const t = Ee(e);
1754
+ return c.und(t.default) && (t.default = Pt(t)), t;
1755
+ }
1756
+ function Kt(e, t) {
1757
+ L(e, (r, n) => r != null && t.add(n));
1758
+ }
1759
+ var ps = [
1760
+ "onStart",
1761
+ "onRest",
1762
+ "onChange",
1763
+ "onPause",
1764
+ "onResume"
1765
+ ];
1766
+ function er(e, t, r) {
1767
+ e.animation[r] = t[r] !== Vr(t, r) ? Fr(t[r], e.key) : void 0;
1768
+ }
1769
+ function he(e, t, ...r) {
1770
+ var n, s, i, a;
1771
+ (s = (n = e.animation)[t]) == null || s.call(n, ...r), (a = (i = e.defaultProps)[t]) == null || a.call(i, ...r);
1772
+ }
1773
+ var gs = ["onStart", "onChange", "onRest"], vs = 1, ys = class {
1774
+ constructor(e, t) {
1775
+ this.id = vs++, this.springs = {}, this.queue = [], this._lastAsyncId = 0, this._active = /* @__PURE__ */ new Set(), this._changed = /* @__PURE__ */ new Set(), this._started = !1, this._state = {
1776
+ paused: !1,
1777
+ pauseQueue: /* @__PURE__ */ new Set(),
1778
+ resumeQueue: /* @__PURE__ */ new Set(),
1779
+ timeouts: /* @__PURE__ */ new Set()
1780
+ }, this._events = {
1781
+ onStart: /* @__PURE__ */ new Map(),
1782
+ onChange: /* @__PURE__ */ new Map(),
1783
+ onRest: /* @__PURE__ */ new Map()
1784
+ }, this._onFrame = this._onFrame.bind(this), t && (this._flush = t), e && this.start({ default: !0, ...e });
1785
+ }
1786
+ /**
1787
+ * Equals `true` when no spring values are in the frameloop, and
1788
+ * no async animation is currently active.
1789
+ */
1790
+ get idle() {
1791
+ return !this._state.asyncTo && Object.values(this.springs).every((e) => e.idle && !e.isDelayed && !e.isPaused);
1792
+ }
1793
+ get item() {
1794
+ return this._item;
1795
+ }
1796
+ set item(e) {
1797
+ this._item = e;
1798
+ }
1799
+ /** Get the current values of our springs */
1800
+ get() {
1801
+ const e = {};
1802
+ return this.each((t, r) => e[r] = t.get()), e;
1803
+ }
1804
+ /** Set the current values without animating. */
1805
+ set(e) {
1806
+ for (const t in e) {
1807
+ const r = e[t];
1808
+ c.und(r) || this.springs[t].set(r);
1809
+ }
1810
+ }
1811
+ /** Push an update onto the queue of each value. */
1812
+ update(e) {
1813
+ return e && this.queue.push(Ee(e)), this;
1814
+ }
1815
+ /**
1816
+ * Start the queued animations for every spring, and resolve the returned
1817
+ * promise once all queued animations have finished or been cancelled.
1818
+ *
1819
+ * When you pass a queue (instead of nothing), that queue is used instead of
1820
+ * the queued animations added with the `update` method, which are left alone.
1821
+ */
1822
+ start(e) {
1823
+ let { queue: t } = this;
1824
+ return e ? t = F(e).map(Ee) : this.queue = [], this._flush ? this._flush(this, t) : (Yr(this, t), mt(this, t));
1825
+ }
1826
+ /** @internal */
1827
+ stop(e, t) {
1828
+ if (e !== !!e && (t = e), t) {
1829
+ const r = this.springs;
1830
+ x(F(t), (n) => r[n].stop(!!e));
1831
+ } else
1832
+ Pe(this._state, this._lastAsyncId), this.each((r) => r.stop(!!e));
1833
+ return this;
1834
+ }
1835
+ /** Freeze the active animation in time */
1836
+ pause(e) {
1837
+ if (c.und(e))
1838
+ this.start({ pause: !0 });
1839
+ else {
1840
+ const t = this.springs;
1841
+ x(F(e), (r) => t[r].pause());
1842
+ }
1843
+ return this;
1844
+ }
1845
+ /** Resume the animation if paused. */
1846
+ resume(e) {
1847
+ if (c.und(e))
1848
+ this.start({ pause: !1 });
1849
+ else {
1850
+ const t = this.springs;
1851
+ x(F(e), (r) => t[r].resume());
1852
+ }
1853
+ return this;
1854
+ }
1855
+ /** Call a function once per spring value */
1856
+ each(e) {
1857
+ L(this.springs, e);
1858
+ }
1859
+ /** @internal Called at the end of every animation frame */
1860
+ _onFrame() {
1861
+ const { onStart: e, onChange: t, onRest: r } = this._events, n = this._active.size > 0, s = this._changed.size > 0;
1862
+ (n && !this._started || s && !this._started) && (this._started = !0, ge(e, ([u, d]) => {
1863
+ d.value = this.get(), u(d, this, this._item);
1864
+ }));
1865
+ const i = !n && this._started, a = s || i && r.size ? this.get() : null;
1866
+ s && t.size && ge(t, ([u, d]) => {
1867
+ d.value = a, u(d, this, this._item);
1868
+ }), i && (this._started = !1, ge(r, ([u, d]) => {
1869
+ d.value = a, u(d, this, this._item);
1870
+ }));
1871
+ }
1872
+ /** @internal */
1873
+ eventObserved(e) {
1874
+ if (e.type == "change")
1875
+ this._changed.add(e.parent), e.idle || this._active.add(e.parent);
1876
+ else if (e.type == "idle")
1877
+ this._active.delete(e.parent);
1878
+ else return;
1879
+ b.onFrame(this._onFrame);
1880
+ }
1881
+ };
1882
+ function mt(e, t) {
1883
+ return Promise.all(t.map((r) => zr(e, r))).then(
1884
+ (r) => Et(e, r)
1885
+ );
1886
+ }
1887
+ async function zr(e, t, r) {
1888
+ const { keys: n, to: s, from: i, loop: a, onRest: u, onResolve: d } = t, l = c.obj(t.default) && t.default;
1889
+ a && (t.loop = !1), s === !1 && (t.to = null), i === !1 && (t.from = null);
1890
+ const m = c.arr(s) || c.fun(s) ? s : void 0;
1891
+ m ? (t.to = void 0, t.onRest = void 0, l && (l.onRest = void 0)) : x(gs, (v) => {
1892
+ const w = t[v];
1893
+ if (c.fun(w)) {
1894
+ const g = e._events[v];
1895
+ t[v] = ({ finished: R, cancelled: y }) => {
1896
+ const A = g.get(w);
1897
+ A ? (R || (A.finished = !1), y && (A.cancelled = !0)) : g.set(w, {
1898
+ value: null,
1899
+ finished: R || !1,
1900
+ cancelled: y || !1
1901
+ });
1902
+ }, l && (l[v] = t[v]);
1903
+ }
1904
+ });
1905
+ const f = e._state;
1906
+ t.pause === !f.paused ? (f.paused = t.pause, pe(t.pause ? f.pauseQueue : f.resumeQueue)) : f.paused && (t.pause = !0);
1907
+ const h = (n || Object.keys(e.springs)).map(
1908
+ (v) => e.springs[v].start(t)
1909
+ ), p = t.cancel === !0 || Vr(t, "cancel") === !0;
1910
+ (m || p && f.asyncId) && h.push(
1911
+ $r(++e._lastAsyncId, {
1912
+ props: t,
1913
+ state: f,
1914
+ actions: {
1915
+ pause: at,
1916
+ resume: at,
1917
+ start(v, w) {
1918
+ p ? (Pe(f, e._lastAsyncId), w(ae(e))) : (v.onRest = u, w(
1919
+ Ur(
1920
+ m,
1921
+ v,
1922
+ f,
1923
+ e
1924
+ )
1925
+ ));
1926
+ }
1927
+ }
1928
+ })
1929
+ ), f.paused && await new Promise((v) => {
1930
+ f.resumeQueue.add(v);
1931
+ });
1932
+ const _ = Et(e, await Promise.all(h));
1933
+ if (a && _.finished && !(r && _.noop)) {
1934
+ const v = Mr(t, a, s);
1935
+ if (v)
1936
+ return Yr(e, [v]), zr(e, v, !0);
1937
+ }
1938
+ return d && b.batchedUpdates(() => d(_, e, e.item)), _;
1939
+ }
1940
+ function tr(e, t) {
1941
+ const r = { ...e.springs };
1942
+ return t && x(F(t), (n) => {
1943
+ c.und(n.keys) && (n = Ee(n)), c.obj(n.to) || (n = { ...n, to: void 0 }), Gr(r, n, (s) => Qr(s));
1944
+ }), Lr(e, r), r;
1945
+ }
1946
+ function Lr(e, t) {
1947
+ L(t, (r, n) => {
1948
+ e.springs[n] || (e.springs[n] = r, ue(r, e));
1949
+ });
1950
+ }
1951
+ function Qr(e, t) {
1952
+ const r = new hs();
1953
+ return r.key = e, t && ue(r, t), r;
1954
+ }
1955
+ function Gr(e, t, r) {
1956
+ t.keys && x(t.keys, (n) => {
1957
+ (e[n] || (e[n] = r(n)))._prepareNode(t);
1958
+ });
1959
+ }
1960
+ function Yr(e, t) {
1961
+ x(t, (r) => {
1962
+ Gr(e.springs, r, (n) => Qr(n, e));
1963
+ });
1964
+ }
1965
+ var _s = cr.createContext({
1966
+ pause: !1,
1967
+ immediate: !1
1968
+ }), bs = () => {
1969
+ const e = [], t = function(n) {
1970
+ Gn();
1971
+ const s = [];
1972
+ return x(e, (i, a) => {
1973
+ if (c.und(n))
1974
+ s.push(i.start());
1975
+ else {
1976
+ const u = r(n, i, a);
1977
+ u && s.push(i.start(u));
1978
+ }
1979
+ }), s;
1980
+ };
1981
+ t.current = e, t.add = function(n) {
1982
+ e.includes(n) || e.push(n);
1983
+ }, t.delete = function(n) {
1984
+ const s = e.indexOf(n);
1985
+ ~s && e.splice(s, 1);
1986
+ }, t.pause = function() {
1987
+ return x(e, (n) => n.pause(...arguments)), this;
1988
+ }, t.resume = function() {
1989
+ return x(e, (n) => n.resume(...arguments)), this;
1990
+ }, t.set = function(n) {
1991
+ x(e, (s, i) => {
1992
+ const a = c.fun(n) ? n(i, s) : n;
1993
+ a && s.set(a);
1994
+ });
1995
+ }, t.start = function(n) {
1996
+ const s = [];
1997
+ return x(e, (i, a) => {
1998
+ if (c.und(n))
1999
+ s.push(i.start());
2000
+ else {
2001
+ const u = this._getProps(n, i, a);
2002
+ u && s.push(i.start(u));
2003
+ }
2004
+ }), s;
2005
+ }, t.stop = function() {
2006
+ return x(e, (n) => n.stop(...arguments)), this;
2007
+ }, t.update = function(n) {
2008
+ return x(e, (s, i) => s.update(this._getProps(n, s, i))), this;
2009
+ };
2010
+ const r = function(n, s, i) {
2011
+ return c.fun(n) ? n(i, s) : n;
2012
+ };
2013
+ return t._getProps = r, t;
2014
+ };
2015
+ function ws(e, t, r) {
2016
+ const n = c.fun(t) && t;
2017
+ n && !r && (r = []);
2018
+ const s = me(
2019
+ () => n || arguments.length == 3 ? bs() : void 0,
2020
+ []
2021
+ ), i = W(0), a = Tr(), u = me(
2022
+ () => ({
2023
+ ctrls: [],
2024
+ queue: [],
2025
+ flush(g, R) {
2026
+ const y = tr(g, R);
2027
+ return i.current > 0 && !u.queue.length && !Object.keys(y).some((P) => !g.springs[P]) ? mt(g, R) : new Promise((P) => {
2028
+ Lr(g, y), u.queue.push(() => {
2029
+ P(mt(g, R));
2030
+ }), a();
2031
+ });
2032
+ }
2033
+ }),
2034
+ []
2035
+ ), d = W([...u.ctrls]), l = W([]), m = Lt(e) || 0;
2036
+ me(() => {
2037
+ x(d.current.slice(e, m), (g) => {
2038
+ as(g, s), g.stop(!0);
2039
+ }), d.current.length = e, f(m, e);
2040
+ }, [e]), me(() => {
2041
+ f(0, Math.min(m, e));
2042
+ }, r);
2043
+ function f(g, R) {
2044
+ for (let y = g; y < R; y++) {
2045
+ const A = d.current[y] || (d.current[y] = new ys(null, u.flush)), P = n ? n(y, A) : t[y];
2046
+ P && (l.current[y] = ms(P));
2047
+ }
2048
+ }
2049
+ const h = d.current.map(
2050
+ (g, R) => tr(g, l.current[R])
2051
+ ), p = dr(_s), _ = Lt(p), v = p !== _ && is(p);
2052
+ xt(() => {
2053
+ i.current++, u.ctrls = d.current;
2054
+ const { queue: g } = u;
2055
+ g.length && (u.queue = [], x(g, (R) => R())), x(d.current, (R, y) => {
2056
+ s == null || s.add(R), v && R.start({ default: p });
2057
+ const A = l.current[y];
2058
+ A && (os(R, A.ref), R.ref ? R.queue.push(A) : R.start(A));
2059
+ });
2060
+ }), kr(() => () => {
2061
+ x(u.ctrls, (g) => g.stop(!0));
2062
+ });
2063
+ const w = h.map((g) => ({ ...g }));
2064
+ return s ? [w, s] : w;
2065
+ }
2066
+ function rr(e, t) {
2067
+ const r = c.fun(e), [[n], s] = ws(
2068
+ 1,
2069
+ r ? e : [e],
2070
+ r ? [] : t
2071
+ );
2072
+ return r || arguments.length == 2 ? [n, s] : n;
2073
+ }
2074
+ var Rs = class extends Tt {
2075
+ constructor(e, t) {
2076
+ super(), this.source = e, this.idle = !0, this._active = /* @__PURE__ */ new Set(), this.calc = be(...t);
2077
+ const r = this._get(), n = ut(r);
2078
+ At(this, n.create(r));
2079
+ }
2080
+ advance(e) {
2081
+ const t = this._get(), r = this.get();
2082
+ Y(t, r) || (z(this).setValue(t), this._onChange(t, this.idle)), !this.idle && nr(this._active) && nt(this);
2083
+ }
2084
+ _get() {
2085
+ const e = c.arr(this.source) ? this.source.map(O) : F(O(this.source));
2086
+ return this.calc(...e);
2087
+ }
2088
+ _start() {
2089
+ this.idle && !nr(this._active) && (this.idle = !1, x(Ye(this), (e) => {
2090
+ e.done = !1;
2091
+ }), q.skipAnimation ? (b.batchedUpdates(() => this.advance()), nt(this)) : ze.start(this));
2092
+ }
2093
+ // Observe our sources only when we're observed.
2094
+ _attach() {
2095
+ let e = 1;
2096
+ x(F(this.source), (t) => {
2097
+ V(t) && ue(t, this), dt(t) && (t.idle || this._active.add(t), e = Math.max(e, t.priority + 1));
2098
+ }), this.priority = e, this._start();
2099
+ }
2100
+ // Stop observing our sources once we have no observers.
2101
+ _detach() {
2102
+ x(F(this.source), (e) => {
2103
+ V(e) && Se(e, this);
2104
+ }), this._active.clear(), nt(this);
2105
+ }
2106
+ /** @internal */
2107
+ eventObserved(e) {
2108
+ e.type == "change" ? e.idle ? this.advance() : (this._active.add(e.parent), this._start()) : e.type == "idle" ? this._active.delete(e.parent) : e.type == "priority" && (this.priority = F(this.source).reduce(
2109
+ (t, r) => Math.max(t, (dt(r) ? r.priority : 0) + 1),
2110
+ 0
2111
+ ));
2112
+ }
2113
+ };
2114
+ function Ss(e) {
2115
+ return e.idle !== !1;
2116
+ }
2117
+ function nr(e) {
2118
+ return !e.size || Array.from(e).every(Ss);
2119
+ }
2120
+ function nt(e) {
2121
+ e.idle || (e.idle = !0, x(Ye(e), (t) => {
2122
+ t.done = !0;
2123
+ }), Re(e, {
2124
+ type: "idle",
2125
+ parent: e
2126
+ }));
2127
+ }
2128
+ q.assign({
2129
+ createStringInterpolator: Pr,
2130
+ to: (e, t) => new Rs(e, t)
2131
+ });
2132
+ var Wr = /^--/;
2133
+ function xs(e, t) {
2134
+ return t == null || typeof t == "boolean" || t === "" ? "" : typeof t == "number" && t !== 0 && !Wr.test(e) && !(_e.hasOwnProperty(e) && _e[e]) ? t + "px" : ("" + t).trim();
2135
+ }
2136
+ var sr = {};
2137
+ function As(e, t) {
2138
+ if (!e.nodeType || !e.setAttribute)
2139
+ return !1;
2140
+ const r = e.nodeName === "filter" || e.parentNode && e.parentNode.nodeName === "filter", {
2141
+ className: n,
2142
+ style: s,
2143
+ children: i,
2144
+ scrollTop: a,
2145
+ scrollLeft: u,
2146
+ viewBox: d,
2147
+ ...l
2148
+ } = t, m = Object.values(l), f = Object.keys(l).map(
2149
+ (h) => r || e.hasAttribute(h) ? h : sr[h] || (sr[h] = h.replace(
2150
+ /([A-Z])/g,
2151
+ // Attributes are written in dash case
2152
+ (p) => "-" + p.toLowerCase()
2153
+ ))
2154
+ );
2155
+ i !== void 0 && (e.textContent = i);
2156
+ for (const h in s)
2157
+ if (s.hasOwnProperty(h)) {
2158
+ const p = xs(h, s[h]);
2159
+ Wr.test(h) ? e.style.setProperty(h, p) : e.style[h] = p;
2160
+ }
2161
+ f.forEach((h, p) => {
2162
+ e.setAttribute(h, m[p]);
2163
+ }), n !== void 0 && (e.className = n), a !== void 0 && (e.scrollTop = a), u !== void 0 && (e.scrollLeft = u), d !== void 0 && e.setAttribute("viewBox", d);
2164
+ }
2165
+ var _e = {
2166
+ animationIterationCount: !0,
2167
+ borderImageOutset: !0,
2168
+ borderImageSlice: !0,
2169
+ borderImageWidth: !0,
2170
+ boxFlex: !0,
2171
+ boxFlexGroup: !0,
2172
+ boxOrdinalGroup: !0,
2173
+ columnCount: !0,
2174
+ columns: !0,
2175
+ flex: !0,
2176
+ flexGrow: !0,
2177
+ flexPositive: !0,
2178
+ flexShrink: !0,
2179
+ flexNegative: !0,
2180
+ flexOrder: !0,
2181
+ gridRow: !0,
2182
+ gridRowEnd: !0,
2183
+ gridRowSpan: !0,
2184
+ gridRowStart: !0,
2185
+ gridColumn: !0,
2186
+ gridColumnEnd: !0,
2187
+ gridColumnSpan: !0,
2188
+ gridColumnStart: !0,
2189
+ fontWeight: !0,
2190
+ lineClamp: !0,
2191
+ lineHeight: !0,
2192
+ opacity: !0,
2193
+ order: !0,
2194
+ orphans: !0,
2195
+ tabSize: !0,
2196
+ widows: !0,
2197
+ zIndex: !0,
2198
+ zoom: !0,
2199
+ // SVG-related properties
2200
+ fillOpacity: !0,
2201
+ floodOpacity: !0,
2202
+ stopOpacity: !0,
2203
+ strokeDasharray: !0,
2204
+ strokeDashoffset: !0,
2205
+ strokeMiterlimit: !0,
2206
+ strokeOpacity: !0,
2207
+ strokeWidth: !0
2208
+ }, Ps = (e, t) => e + t.charAt(0).toUpperCase() + t.substring(1), Es = ["Webkit", "Ms", "Moz", "O"];
2209
+ _e = Object.keys(_e).reduce((e, t) => (Es.forEach((r) => e[Ps(r, t)] = e[t]), e), _e);
2210
+ var Ts = /^(matrix|translate|scale|rotate|skew)/, ks = /^(translate)/, Cs = /^(rotate|skew)/, st = (e, t) => c.num(e) && e !== 0 ? e + t : e, Ne = (e, t) => c.arr(e) ? e.every((r) => Ne(r, t)) : c.num(e) ? e === t : parseFloat(e) === t, Is = class extends Be {
2211
+ constructor({ x: e, y: t, z: r, ...n }) {
2212
+ const s = [], i = [];
2213
+ (e || t || r) && (s.push([e || 0, t || 0, r || 0]), i.push((a) => [
2214
+ `translate3d(${a.map((u) => st(u, "px")).join(",")})`,
2215
+ // prettier-ignore
2216
+ Ne(a, 0)
2217
+ ])), L(n, (a, u) => {
2218
+ if (u === "transform")
2219
+ s.push([a || ""]), i.push((d) => [d, d === ""]);
2220
+ else if (Ts.test(u)) {
2221
+ if (delete n[u], c.und(a)) return;
2222
+ const d = ks.test(u) ? "px" : Cs.test(u) ? "deg" : "";
2223
+ s.push(F(a)), i.push(
2224
+ u === "rotate3d" ? ([l, m, f, h]) => [
2225
+ `rotate3d(${l},${m},${f},${st(h, d)})`,
2226
+ Ne(h, 0)
2227
+ ] : (l) => [
2228
+ `${u}(${l.map((m) => st(m, d)).join(",")})`,
2229
+ Ne(l, u.startsWith("scale") ? 1 : 0)
2230
+ ]
2231
+ );
2232
+ }
2233
+ }), s.length && (n.transform = new Os(s, i)), super(n);
2234
+ }
2235
+ }, Os = class extends Sr {
2236
+ constructor(e, t) {
2237
+ super(), this.inputs = e, this.transforms = t, this._value = null;
2238
+ }
2239
+ get() {
2240
+ return this._value || (this._value = this._get());
2241
+ }
2242
+ _get() {
2243
+ let e = "", t = !0;
2244
+ return x(this.inputs, (r, n) => {
2245
+ const s = O(r[0]), [i, a] = this.transforms[n](
2246
+ c.arr(s) ? s : r.map(O)
2247
+ );
2248
+ e += " " + i, t = t && a;
2249
+ }), t ? "none" : e;
2250
+ }
2251
+ // Start observing our inputs once we have an observer.
2252
+ observerAdded(e) {
2253
+ e == 1 && x(
2254
+ this.inputs,
2255
+ (t) => x(
2256
+ t,
2257
+ (r) => V(r) && ue(r, this)
2258
+ )
2259
+ );
2260
+ }
2261
+ // Stop observing our inputs once we have no observers.
2262
+ observerRemoved(e) {
2263
+ e == 0 && x(
2264
+ this.inputs,
2265
+ (t) => x(
2266
+ t,
2267
+ (r) => V(r) && Se(r, this)
2268
+ )
2269
+ );
2270
+ }
2271
+ eventObserved(e) {
2272
+ e.type == "change" && (this._value = null), Re(this, e);
2273
+ }
2274
+ }, js = [
2275
+ "a",
2276
+ "abbr",
2277
+ "address",
2278
+ "area",
2279
+ "article",
2280
+ "aside",
2281
+ "audio",
2282
+ "b",
2283
+ "base",
2284
+ "bdi",
2285
+ "bdo",
2286
+ "big",
2287
+ "blockquote",
2288
+ "body",
2289
+ "br",
2290
+ "button",
2291
+ "canvas",
2292
+ "caption",
2293
+ "cite",
2294
+ "code",
2295
+ "col",
2296
+ "colgroup",
2297
+ "data",
2298
+ "datalist",
2299
+ "dd",
2300
+ "del",
2301
+ "details",
2302
+ "dfn",
2303
+ "dialog",
2304
+ "div",
2305
+ "dl",
2306
+ "dt",
2307
+ "em",
2308
+ "embed",
2309
+ "fieldset",
2310
+ "figcaption",
2311
+ "figure",
2312
+ "footer",
2313
+ "form",
2314
+ "h1",
2315
+ "h2",
2316
+ "h3",
2317
+ "h4",
2318
+ "h5",
2319
+ "h6",
2320
+ "head",
2321
+ "header",
2322
+ "hgroup",
2323
+ "hr",
2324
+ "html",
2325
+ "i",
2326
+ "iframe",
2327
+ "img",
2328
+ "input",
2329
+ "ins",
2330
+ "kbd",
2331
+ "keygen",
2332
+ "label",
2333
+ "legend",
2334
+ "li",
2335
+ "link",
2336
+ "main",
2337
+ "map",
2338
+ "mark",
2339
+ "menu",
2340
+ "menuitem",
2341
+ "meta",
2342
+ "meter",
2343
+ "nav",
2344
+ "noscript",
2345
+ "object",
2346
+ "ol",
2347
+ "optgroup",
2348
+ "option",
2349
+ "output",
2350
+ "p",
2351
+ "param",
2352
+ "picture",
2353
+ "pre",
2354
+ "progress",
2355
+ "q",
2356
+ "rp",
2357
+ "rt",
2358
+ "ruby",
2359
+ "s",
2360
+ "samp",
2361
+ "script",
2362
+ "section",
2363
+ "select",
2364
+ "small",
2365
+ "source",
2366
+ "span",
2367
+ "strong",
2368
+ "style",
2369
+ "sub",
2370
+ "summary",
2371
+ "sup",
2372
+ "table",
2373
+ "tbody",
2374
+ "td",
2375
+ "textarea",
2376
+ "tfoot",
2377
+ "th",
2378
+ "thead",
2379
+ "time",
2380
+ "title",
2381
+ "tr",
2382
+ "track",
2383
+ "u",
2384
+ "ul",
2385
+ "var",
2386
+ "video",
2387
+ "wbr",
2388
+ // SVG
2389
+ "circle",
2390
+ "clipPath",
2391
+ "defs",
2392
+ "ellipse",
2393
+ "foreignObject",
2394
+ "g",
2395
+ "image",
2396
+ "line",
2397
+ "linearGradient",
2398
+ "mask",
2399
+ "path",
2400
+ "pattern",
2401
+ "polygon",
2402
+ "polyline",
2403
+ "radialGradient",
2404
+ "rect",
2405
+ "stop",
2406
+ "svg",
2407
+ "text",
2408
+ "tspan"
2409
+ ];
2410
+ q.assign({
2411
+ batchedUpdates: fn,
2412
+ createStringInterpolator: Pr,
2413
+ colors: Sn
2414
+ });
2415
+ var Fs = es(js, {
2416
+ applyAnimatedValues: As,
2417
+ createAnimatedStyle: (e) => new Is(e),
2418
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2419
+ getComponentProps: ({ scrollTop: e, scrollLeft: t, ...r }) => r
2420
+ }), ir = Fs.animated;
2421
+ const Br = rn({}), Vs = ({ children: e }) => {
2422
+ const { app: t } = nn(), r = me(() => {
2423
+ if (!t || !t.renderer) return null;
2424
+ const n = new fr();
2425
+ n.setFillStyle({
2426
+ color: "#1e1524"
2427
+ }), n.rect(0, 0, 1, 1), n.fill();
2428
+ const s = t.renderer.generateTexture(n);
2429
+ return n.destroy(), s;
2430
+ }, [t == null ? void 0 : t.renderer]);
2431
+ return r ? /* @__PURE__ */ D.jsx(Br.Provider, { value: r, children: e }) : null;
2432
+ };
2433
+ class Ns extends hr {
2434
+ constructor(r, n, s, i, a, u) {
2435
+ super({ texture: r, x: n, y: s, scaleX: i, scaleY: a, alpha: 0 });
2436
+ B(this, "animationProgress", 0);
2437
+ B(this, "delayCounter", 0);
2438
+ B(this, "randomSpeed");
2439
+ B(this, "randomDelayOffset");
2440
+ B(this, "startScaleX");
2441
+ B(this, "startScaleY");
2442
+ this.texture = r, this.x = n, this.y = s, this.scaleX = i, this.scaleY = a, this.curLevel = u, this.startScaleX = i, this.startScaleY = a, this.curLevel = u, this.randomSpeed = 0.04 + Math.random() * 0.04, this.randomDelayOffset = Math.floor(Math.random() * 150);
2443
+ }
2444
+ update() {
2445
+ if (this.delayCounter < this.curLevel * 15 + this.randomDelayOffset) {
2446
+ this.delayCounter++;
2447
+ return;
2448
+ }
2449
+ const r = 1;
2450
+ this.animationProgress += (r - this.animationProgress) * this.randomSpeed, this.alpha = this.animationProgress;
2451
+ }
2452
+ }
2453
+ class $s {
2454
+ constructor(t, r) {
2455
+ B(this, "cells", []);
2456
+ this.texture = t, this.particleContainerRefCurrent = r, this.texture = t;
2457
+ }
2458
+ add(t, r, n, s, i) {
2459
+ const a = new Ns(this.texture, t, r, n, s, i);
2460
+ this.particleContainerRefCurrent.addParticle(a), this.cells.push(a);
2461
+ }
2462
+ updateAll() {
2463
+ for (const t of this.cells)
2464
+ t.update();
2465
+ }
2466
+ }
2467
+ const Ds = ({
2468
+ gridRows: e,
2469
+ gridCols: t,
2470
+ cellWidth: r,
2471
+ cellHeight: n,
2472
+ gridDepth: s
2473
+ }) => {
2474
+ const i = dr(Br), a = W(null), u = W(null);
2475
+ Te(() => {
2476
+ a.current && (u.current = new $s(
2477
+ i,
2478
+ a.current
2479
+ ), d(
2480
+ 0,
2481
+ 0,
2482
+ r,
2483
+ n,
2484
+ t,
2485
+ e,
2486
+ s,
2487
+ a.current
2488
+ ));
2489
+ }, []), sn(() => {
2490
+ var l;
2491
+ (l = u.current) == null || l.updateAll();
2492
+ });
2493
+ const d = (l, m, f, h, p, _, v, w) => {
2494
+ var g;
2495
+ for (let R = 0; R < _; R++)
2496
+ for (let y = 0; y < p; y++) {
2497
+ const A = l + y * f, P = m + R * h;
2498
+ v <= 0 || Math.random() > 0.7 && v < s ? Math.random() > 0.1 && ((g = u.current) == null || g.add(
2499
+ A,
2500
+ P,
2501
+ f - 1,
2502
+ h - 1,
2503
+ v
2504
+ )) : d(
2505
+ A,
2506
+ P,
2507
+ f / p,
2508
+ h / _,
2509
+ p,
2510
+ _,
2511
+ v - 1
2512
+ );
2513
+ }
2514
+ };
2515
+ return /* @__PURE__ */ D.jsx(
2516
+ "pixiParticleContainer",
2517
+ {
2518
+ ref: a,
2519
+ dynamicProperties: {
2520
+ position: !0,
2521
+ vertex: !0,
2522
+ color: !0
2523
+ }
2524
+ }
2525
+ );
2526
+ }, Us = ({
2527
+ cellWidth: e,
2528
+ cellHeight: t,
2529
+ gridRows: r,
2530
+ gridCols: n,
2531
+ gridDepth: s
2532
+ }) => /* @__PURE__ */ D.jsx(Vs, { children: /* @__PURE__ */ D.jsx(
2533
+ Ds,
2534
+ {
2535
+ cellWidth: e,
2536
+ cellHeight: t,
2537
+ gridCols: n,
2538
+ gridRows: r,
2539
+ gridDepth: s
2540
+ }
2541
+ ) }), qs = (e) => /* @__PURE__ */ D.jsx(
2542
+ "svg",
2543
+ {
2544
+ viewBox: "10 0 489.935 489.935",
2545
+ fill: "currentColor",
2546
+ xmlns: "http://www.w3.org/2000/svg",
2547
+ ...e,
2548
+ children: /* @__PURE__ */ D.jsx(
2549
+ "path",
2550
+ {
2551
+ d: `M278.235,33.267c-116.7,0-211.6,95-211.6,211.7v0.7l-41.9-63.1c-4.1-6.2-12.5-7.9-18.7-3.8c-6.2,4.1-7.9,12.5-3.8,18.7 \r
2552
+ l60.8,91.5c2.2,3.3,5.7,5.4,9.6,5.9c0.6,0.1,1.1,0.1,1.7,0.1c3.3,0,6.5-1.2,9-3.5l84.5-76.1c5.5-5,6-13.5,1-19.1 \r
2553
+ c-5-5.5-13.5-6-19.1-1l-56.1,50.7v-1c0-101.9,82.8-184.7,184.6-184.7s184.7,82.8,184.7,184.7s-82.8,184.7-184.6,184.7 \r
2554
+ c-49.3,0-95.7-19.2-130.5-54.1c-5.3-5.3-13.8-5.3-19.1,0c-5.3,5.3-5.3,13.8,0,19.1c40,40,93.1,62,149.6,62 \r
2555
+ c116.6,0,211.6-94.9,211.6-211.7S394.935,33.267,278.235,33.267z`
2556
+ }
2557
+ )
2558
+ }
2559
+ );
2560
+ an({ ParticleContainer: dn, Particle: hr, Texture: cn, Container: ln, Sprite: un, Graphics: fr });
2561
+ const ar = 2, or = 2, ur = 225, lr = 225, Ms = 5, Ws = () => {
2562
+ const [e, t] = Fe(!1), [r, n] = Fe(0), [s, i] = Fe(0), a = rr({
2563
+ from: { rotate: 0 },
2564
+ to: { rotate: s * -360 },
2565
+ config: { duration: 500, easing: (f) => 1 - Math.pow(1 - f, 3) }
2566
+ // 1 second linear spin
2567
+ }), u = rr({
2568
+ opacity: e ? 1 : 0,
2569
+ scale: e ? 1 : 0.5,
2570
+ config: { tension: 150, friction: 14 }
2571
+ }), d = ir(qs), l = ir("button"), m = () => {
2572
+ n((f) => f + 1), i((f) => f + 1);
2573
+ };
2574
+ return /* @__PURE__ */ D.jsxs("div", { className: "flex flex-col items-center justify-center w-full h-full", children: [
2575
+ /* @__PURE__ */ D.jsx(
2576
+ on,
2577
+ {
2578
+ antialias: !1,
2579
+ width: ur * ar,
2580
+ height: lr * or,
2581
+ className: "transition-all image-pixelated md:w-full max-w-max w-72 mb-8",
2582
+ backgroundAlpha: 0,
2583
+ onInit: () => t(!0),
2584
+ children: /* @__PURE__ */ D.jsx(
2585
+ Us,
2586
+ {
2587
+ gridCols: ar,
2588
+ gridRows: or,
2589
+ cellWidth: ur,
2590
+ cellHeight: lr,
2591
+ gridDepth: Ms
2592
+ },
2593
+ r
2594
+ )
2595
+ }
2596
+ ),
2597
+ e && /* @__PURE__ */ D.jsx(
2598
+ l,
2599
+ {
2600
+ style: u,
2601
+ className: "p-4",
2602
+ onClick: m,
2603
+ children: /* @__PURE__ */ D.jsx(
2604
+ d,
2605
+ {
2606
+ width: 36,
2607
+ height: 36,
2608
+ className: "hover:opacity-100 opacity-25",
2609
+ style: {
2610
+ rotate: a.rotate.to((f) => `${f}deg`)
2611
+ }
2612
+ }
2613
+ )
2614
+ }
2615
+ )
2616
+ ] });
2617
+ };
2
2618
  export {
3
- f as default
2619
+ Ws as default
4
2620
  };
5
2621
  //# sourceMappingURL=recursive-grid.es.js.map