@acrool/react-picker 1.1.3 → 1.1.5
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.
- package/dist/acrool-react-picker.es.js +932 -932
- package/dist/react-picker.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +4 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as yn from "react";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
var
|
|
2
|
+
import Vs, { createContext as Tt, useContext as U, useRef as K, useId as vn, useInsertionEffect as Es, useCallback as z, useMemo as xt, useEffect as it, Children as oo, isValidElement as ao, useLayoutEffect as lo, useState as Dt, forwardRef as Re, Fragment as Cs, createElement as co, Component as uo } from "react";
|
|
3
|
+
import ho from "react-dom";
|
|
4
|
+
var nt = /* @__PURE__ */ ((t) => (t.bottom = "bottom", t.top = "top", t))(nt || {}), Ct = /* @__PURE__ */ ((t) => (t.left = "left", t.center = "center", t.right = "right", t))(Ct || {});
|
|
5
5
|
const se = [
|
|
6
6
|
"color: #fff",
|
|
7
7
|
"display: inline-block",
|
|
@@ -10,64 +10,68 @@ const se = [
|
|
|
10
10
|
"padding-right: 8px",
|
|
11
11
|
"border-radius: 4px"
|
|
12
12
|
], re = {
|
|
13
|
-
primary: "#
|
|
14
|
-
success: "#
|
|
15
|
-
info: "#
|
|
16
|
-
warning: "#
|
|
17
|
-
danger: "#
|
|
13
|
+
primary: "#8b7ec8",
|
|
14
|
+
success: "#70ad47",
|
|
15
|
+
info: "#5fb3d3",
|
|
16
|
+
warning: "#f5c842",
|
|
17
|
+
danger: "#e85a4f"
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function Bt(t, e, ...n) {
|
|
20
20
|
console.log(`%c ${t}`, e, ...n);
|
|
21
21
|
}
|
|
22
|
+
function fo(t, ...e) {
|
|
23
|
+
Bt(t, "", ...e);
|
|
24
|
+
}
|
|
22
25
|
function mo(t, ...e) {
|
|
23
26
|
const n = se.concat([
|
|
24
27
|
`background-color: ${re.primary}`
|
|
25
28
|
]).join(";");
|
|
26
|
-
|
|
29
|
+
Bt(t, n, ...e);
|
|
27
30
|
}
|
|
28
31
|
function po(t, ...e) {
|
|
29
32
|
const n = se.concat([
|
|
30
33
|
`background-color: ${re.success}`
|
|
31
34
|
]).join(";");
|
|
32
|
-
|
|
35
|
+
Bt(t, n, ...e);
|
|
33
36
|
}
|
|
34
37
|
function go(t, ...e) {
|
|
35
38
|
const n = se.concat([
|
|
36
39
|
`background-color: ${re.info}`
|
|
37
40
|
]).join(";");
|
|
38
|
-
|
|
41
|
+
Bt(t, n, ...e);
|
|
39
42
|
}
|
|
40
43
|
function yo(t, ...e) {
|
|
41
44
|
const n = se.concat([
|
|
42
45
|
`background-color: ${re.warning}`
|
|
43
46
|
]).join(";");
|
|
44
|
-
|
|
47
|
+
Bt(t, n, ...e);
|
|
45
48
|
}
|
|
46
49
|
function vo(t, ...e) {
|
|
47
50
|
const n = se.concat([
|
|
48
51
|
`background-color: ${re.danger}`
|
|
49
52
|
]).join(";");
|
|
50
|
-
|
|
53
|
+
Bt(t, n, ...e);
|
|
51
54
|
}
|
|
52
|
-
const
|
|
55
|
+
const at = {
|
|
56
|
+
log: fo,
|
|
53
57
|
primary: mo,
|
|
54
58
|
success: po,
|
|
55
59
|
info: go,
|
|
56
60
|
warning: yo,
|
|
57
61
|
danger: vo
|
|
58
|
-
}, xn =
|
|
59
|
-
hide: () =>
|
|
60
|
-
show: () =>
|
|
61
|
-
toggle: () =>
|
|
62
|
+
}, xn = Tt({
|
|
63
|
+
hide: () => at.warning("No hide method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
64
|
+
show: () => at.warning("No show method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
65
|
+
toggle: () => at.warning("No toggle method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
62
66
|
isVisible: !1,
|
|
63
|
-
inputFocus: () =>
|
|
64
|
-
inputBlur: () =>
|
|
67
|
+
inputFocus: () => at.warning("No focus method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
68
|
+
inputBlur: () => at.warning("No blur method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
65
69
|
isInputFocus: !1,
|
|
66
|
-
onChange: () =>
|
|
67
|
-
vertical:
|
|
68
|
-
setVertical: () =>
|
|
69
|
-
}), bh = xn.Consumer, xo = () =>
|
|
70
|
-
var he = { exports: {} },
|
|
70
|
+
onChange: () => at.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?"),
|
|
71
|
+
vertical: nt.bottom,
|
|
72
|
+
setVertical: () => at.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?")
|
|
73
|
+
}), bh = xn.Consumer, xo = () => U(xn);
|
|
74
|
+
var he = { exports: {} }, $t = {};
|
|
71
75
|
/**
|
|
72
76
|
* @license React
|
|
73
77
|
* react-jsx-runtime.production.js
|
|
@@ -79,7 +83,7 @@ var he = { exports: {} }, Ut = {};
|
|
|
79
83
|
*/
|
|
80
84
|
var ni;
|
|
81
85
|
function To() {
|
|
82
|
-
if (ni) return
|
|
86
|
+
if (ni) return $t;
|
|
83
87
|
ni = 1;
|
|
84
88
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
85
89
|
function n(i, s, o) {
|
|
@@ -97,9 +101,9 @@ function To() {
|
|
|
97
101
|
props: o
|
|
98
102
|
};
|
|
99
103
|
}
|
|
100
|
-
return
|
|
104
|
+
return $t.Fragment = e, $t.jsx = n, $t.jsxs = n, $t;
|
|
101
105
|
}
|
|
102
|
-
var
|
|
106
|
+
var Wt = {};
|
|
103
107
|
/**
|
|
104
108
|
* @license React
|
|
105
109
|
* react-jsx-runtime.development.js
|
|
@@ -111,24 +115,24 @@ var $t = {};
|
|
|
111
115
|
*/
|
|
112
116
|
var ii;
|
|
113
117
|
function bo() {
|
|
114
|
-
return ii || (ii = 1, process.env.NODE_ENV !== "production" && function() {
|
|
118
|
+
return ii || (ii = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
115
119
|
function t(m) {
|
|
116
120
|
if (m == null) return null;
|
|
117
121
|
if (typeof m == "function")
|
|
118
|
-
return m.$$typeof ===
|
|
122
|
+
return m.$$typeof === J ? null : m.displayName || m.name || null;
|
|
119
123
|
if (typeof m == "string") return m;
|
|
120
124
|
switch (m) {
|
|
121
|
-
case
|
|
125
|
+
case v:
|
|
122
126
|
return "Fragment";
|
|
123
|
-
case
|
|
127
|
+
case x:
|
|
124
128
|
return "Profiler";
|
|
125
|
-
case
|
|
129
|
+
case y:
|
|
126
130
|
return "StrictMode";
|
|
127
|
-
case T:
|
|
128
|
-
return "Suspense";
|
|
129
131
|
case A:
|
|
132
|
+
return "Suspense";
|
|
133
|
+
case D:
|
|
130
134
|
return "SuspenseList";
|
|
131
|
-
case
|
|
135
|
+
case $:
|
|
132
136
|
return "Activity";
|
|
133
137
|
}
|
|
134
138
|
if (typeof m == "object")
|
|
@@ -137,16 +141,16 @@ function bo() {
|
|
|
137
141
|
), m.$$typeof) {
|
|
138
142
|
case g:
|
|
139
143
|
return "Portal";
|
|
144
|
+
case w:
|
|
145
|
+
return m.displayName || "Context";
|
|
140
146
|
case b:
|
|
141
|
-
return (m.displayName || "Context") + ".Provider";
|
|
142
|
-
case x:
|
|
143
147
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
144
|
-
case
|
|
148
|
+
case T:
|
|
145
149
|
var V = m.render;
|
|
146
150
|
return m = m.displayName, m || (m = V.displayName || V.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
147
|
-
case D:
|
|
148
|
-
return V = m.displayName || null, V !== null ? V : t(m.type) || "Memo";
|
|
149
151
|
case S:
|
|
152
|
+
return V = m.displayName || null, V !== null ? V : t(m.type) || "Memo";
|
|
153
|
+
case j:
|
|
150
154
|
V = m._payload, m = m._init;
|
|
151
155
|
try {
|
|
152
156
|
return t(m(V));
|
|
@@ -167,17 +171,17 @@ function bo() {
|
|
|
167
171
|
}
|
|
168
172
|
if (V) {
|
|
169
173
|
V = console;
|
|
170
|
-
var
|
|
171
|
-
return
|
|
174
|
+
var O = V.error, _ = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
175
|
+
return O.call(
|
|
172
176
|
V,
|
|
173
177
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
174
|
-
|
|
178
|
+
_
|
|
175
179
|
), e(m);
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
function i(m) {
|
|
179
|
-
if (m ===
|
|
180
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
183
|
+
if (m === v) return "<>";
|
|
184
|
+
if (typeof m == "object" && m !== null && m.$$typeof === j)
|
|
181
185
|
return "<...>";
|
|
182
186
|
try {
|
|
183
187
|
var V = t(m);
|
|
@@ -187,45 +191,46 @@ function bo() {
|
|
|
187
191
|
}
|
|
188
192
|
}
|
|
189
193
|
function s() {
|
|
190
|
-
var m =
|
|
194
|
+
var m = ot.A;
|
|
191
195
|
return m === null ? null : m.getOwner();
|
|
192
196
|
}
|
|
193
197
|
function o() {
|
|
194
198
|
return Error("react-stack-top-frame");
|
|
195
199
|
}
|
|
196
200
|
function r(m) {
|
|
197
|
-
if (
|
|
201
|
+
if (Pt.call(m, "key")) {
|
|
198
202
|
var V = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
199
203
|
if (V && V.isReactWarning) return !1;
|
|
200
204
|
}
|
|
201
205
|
return m.key !== void 0;
|
|
202
206
|
}
|
|
203
207
|
function a(m, V) {
|
|
204
|
-
function
|
|
205
|
-
|
|
208
|
+
function O() {
|
|
209
|
+
R || (R = !0, console.error(
|
|
206
210
|
"%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)",
|
|
207
211
|
V
|
|
208
212
|
));
|
|
209
213
|
}
|
|
210
|
-
|
|
211
|
-
get:
|
|
214
|
+
O.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
215
|
+
get: O,
|
|
212
216
|
configurable: !0
|
|
213
217
|
});
|
|
214
218
|
}
|
|
215
219
|
function l() {
|
|
216
220
|
var m = t(this.type);
|
|
217
|
-
return
|
|
221
|
+
return C[m] || (C[m] = !0, console.error(
|
|
218
222
|
"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."
|
|
219
223
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
220
224
|
}
|
|
221
|
-
function c(m, V,
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
function c(m, V, O, _, ue, Be) {
|
|
226
|
+
var B = O.ref;
|
|
227
|
+
return m = {
|
|
228
|
+
$$typeof: p,
|
|
224
229
|
type: m,
|
|
225
230
|
key: V,
|
|
226
|
-
props:
|
|
227
|
-
_owner:
|
|
228
|
-
}, (
|
|
231
|
+
props: O,
|
|
232
|
+
_owner: _
|
|
233
|
+
}, (B !== void 0 ? B : null) !== null ? Object.defineProperty(m, "ref", {
|
|
229
234
|
enumerable: !1,
|
|
230
235
|
get: l
|
|
231
236
|
}) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
@@ -242,105 +247,102 @@ function bo() {
|
|
|
242
247
|
configurable: !1,
|
|
243
248
|
enumerable: !1,
|
|
244
249
|
writable: !0,
|
|
245
|
-
value:
|
|
250
|
+
value: ue
|
|
246
251
|
}), Object.defineProperty(m, "_debugTask", {
|
|
247
252
|
configurable: !1,
|
|
248
253
|
enumerable: !1,
|
|
249
254
|
writable: !0,
|
|
250
|
-
value:
|
|
255
|
+
value: Be
|
|
251
256
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
252
257
|
}
|
|
253
|
-
function u(m, V,
|
|
254
|
-
var
|
|
255
|
-
if (
|
|
256
|
-
if (
|
|
257
|
-
if (
|
|
258
|
-
for (
|
|
259
|
-
h(
|
|
260
|
-
Object.freeze && Object.freeze(
|
|
258
|
+
function u(m, V, O, _, ue, Be) {
|
|
259
|
+
var B = V.children;
|
|
260
|
+
if (B !== void 0)
|
|
261
|
+
if (_)
|
|
262
|
+
if (wt(B)) {
|
|
263
|
+
for (_ = 0; _ < B.length; _++)
|
|
264
|
+
h(B[_]);
|
|
265
|
+
Object.freeze && Object.freeze(B);
|
|
261
266
|
} else
|
|
262
267
|
console.error(
|
|
263
268
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
264
269
|
);
|
|
265
|
-
else h(
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
var
|
|
269
|
-
return
|
|
270
|
+
else h(B);
|
|
271
|
+
if (Pt.call(V, "key")) {
|
|
272
|
+
B = t(m);
|
|
273
|
+
var Et = Object.keys(V).filter(function(ro) {
|
|
274
|
+
return ro !== "key";
|
|
270
275
|
});
|
|
271
|
-
|
|
276
|
+
_ = 0 < Et.length ? "{key: someKey, " + Et.join(": ..., ") + ": ...}" : "{key: someKey}", Vt[B + _] || (Et = 0 < Et.length ? "{" + Et.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
272
277
|
`A props object containing a "key" prop is being spread into JSX:
|
|
273
278
|
let props = %s;
|
|
274
279
|
<%s {...props} />
|
|
275
280
|
React keys must be passed directly to JSX without using spread:
|
|
276
281
|
let props = %s;
|
|
277
282
|
<%s key={someKey} {...props} />`,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
),
|
|
283
|
+
_,
|
|
284
|
+
B,
|
|
285
|
+
Et,
|
|
286
|
+
B
|
|
287
|
+
), Vt[B + _] = !0);
|
|
283
288
|
}
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
for (var
|
|
287
|
-
|
|
288
|
-
} else
|
|
289
|
-
return
|
|
290
|
-
|
|
289
|
+
if (B = null, O !== void 0 && (n(O), B = "" + O), r(V) && (n(V.key), B = "" + V.key), "key" in V) {
|
|
290
|
+
O = {};
|
|
291
|
+
for (var Ne in V)
|
|
292
|
+
Ne !== "key" && (O[Ne] = V[Ne]);
|
|
293
|
+
} else O = V;
|
|
294
|
+
return B && a(
|
|
295
|
+
O,
|
|
291
296
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
292
297
|
), c(
|
|
293
298
|
m,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
lt,
|
|
299
|
+
B,
|
|
300
|
+
O,
|
|
297
301
|
s(),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Ne
|
|
302
|
+
ue,
|
|
303
|
+
Be
|
|
301
304
|
);
|
|
302
305
|
}
|
|
303
306
|
function h(m) {
|
|
304
|
-
typeof m == "object" && m !== null && m.$$typeof ===
|
|
307
|
+
f(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === j && (m._payload.status === "fulfilled" ? f(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
308
|
+
}
|
|
309
|
+
function f(m) {
|
|
310
|
+
return typeof m == "object" && m !== null && m.$$typeof === p;
|
|
305
311
|
}
|
|
306
|
-
var
|
|
312
|
+
var d = Vs, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), w = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), J = Symbol.for("react.client.reference"), ot = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Pt = Object.prototype.hasOwnProperty, wt = Array.isArray, St = console.createTask ? console.createTask : function() {
|
|
307
313
|
return null;
|
|
308
314
|
};
|
|
309
|
-
|
|
310
|
-
|
|
315
|
+
d = {
|
|
316
|
+
react_stack_bottom_frame: function(m) {
|
|
311
317
|
return m();
|
|
312
318
|
}
|
|
313
319
|
};
|
|
314
|
-
var
|
|
315
|
-
|
|
320
|
+
var R, C = {}, N = d.react_stack_bottom_frame.bind(
|
|
321
|
+
d,
|
|
316
322
|
o
|
|
317
|
-
)(),
|
|
318
|
-
|
|
319
|
-
var
|
|
323
|
+
)(), At = St(i(o)), Vt = {};
|
|
324
|
+
Wt.Fragment = v, Wt.jsx = function(m, V, O) {
|
|
325
|
+
var _ = 1e4 > ot.recentlyCreatedOwnerStacks++;
|
|
320
326
|
return u(
|
|
321
327
|
m,
|
|
322
328
|
V,
|
|
323
|
-
|
|
329
|
+
O,
|
|
324
330
|
!1,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
Q ? Error("react-stack-top-frame") : C,
|
|
328
|
-
Q ? at(i(m)) : B
|
|
331
|
+
_ ? Error("react-stack-top-frame") : N,
|
|
332
|
+
_ ? St(i(m)) : At
|
|
329
333
|
);
|
|
330
|
-
},
|
|
331
|
-
var
|
|
334
|
+
}, Wt.jsxs = function(m, V, O) {
|
|
335
|
+
var _ = 1e4 > ot.recentlyCreatedOwnerStacks++;
|
|
332
336
|
return u(
|
|
333
337
|
m,
|
|
334
338
|
V,
|
|
335
|
-
|
|
339
|
+
O,
|
|
336
340
|
!0,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
Q ? Error("react-stack-top-frame") : C,
|
|
340
|
-
Q ? at(i(m)) : B
|
|
341
|
+
_ ? Error("react-stack-top-frame") : N,
|
|
342
|
+
_ ? St(i(m)) : At
|
|
341
343
|
);
|
|
342
344
|
};
|
|
343
|
-
}()),
|
|
345
|
+
})()), Wt;
|
|
344
346
|
}
|
|
345
347
|
var si;
|
|
346
348
|
function Po() {
|
|
@@ -357,9 +359,9 @@ function ri(t) {
|
|
|
357
359
|
e.style[n] = (i = t.style) == null ? void 0 : i[n];
|
|
358
360
|
}), e;
|
|
359
361
|
}
|
|
360
|
-
class
|
|
362
|
+
class Ds extends Vs.Component {
|
|
361
363
|
constructor(e) {
|
|
362
|
-
super(e), Qe(this, "_el", null), Qe(this, "renderPortal", () => this._el ?
|
|
364
|
+
super(e), Qe(this, "_el", null), Qe(this, "renderPortal", () => this._el ? ho.createPortal(
|
|
363
365
|
this.props.children,
|
|
364
366
|
this._el
|
|
365
367
|
) : null), !(typeof window > "u") && (this._el = ri(e));
|
|
@@ -381,15 +383,15 @@ class Rs extends Es.Component {
|
|
|
381
383
|
return this.renderPortal();
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
|
-
Qe(
|
|
386
|
+
Qe(Ds, "defaultProps", {
|
|
385
387
|
containerSelector: () => document.body
|
|
386
388
|
});
|
|
387
|
-
const Tn =
|
|
389
|
+
const Tn = Tt({});
|
|
388
390
|
function bn(t) {
|
|
389
391
|
const e = K(null);
|
|
390
392
|
return e.current === null && (e.current = t()), e.current;
|
|
391
393
|
}
|
|
392
|
-
const Me =
|
|
394
|
+
const Me = Tt(null), Pn = Tt({
|
|
393
395
|
transformPagePoint: (t) => t,
|
|
394
396
|
isStatic: !1,
|
|
395
397
|
reducedMotion: "never"
|
|
@@ -418,8 +420,8 @@ function Eo({ children: t, isPresent: e }) {
|
|
|
418
420
|
height: 0,
|
|
419
421
|
top: 0,
|
|
420
422
|
left: 0
|
|
421
|
-
}), { nonce: o } =
|
|
422
|
-
return
|
|
423
|
+
}), { nonce: o } = U(Pn);
|
|
424
|
+
return Es(() => {
|
|
423
425
|
const { width: r, height: a, top: l, left: c } = s.current;
|
|
424
426
|
if (e || !i.current || !r || !a)
|
|
425
427
|
return;
|
|
@@ -445,7 +447,7 @@ const Co = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
|
|
|
445
447
|
if (!f)
|
|
446
448
|
return;
|
|
447
449
|
i && i();
|
|
448
|
-
}, [a, i]), u =
|
|
450
|
+
}, [a, i]), u = xt(
|
|
449
451
|
() => ({
|
|
450
452
|
id: l,
|
|
451
453
|
initial: e,
|
|
@@ -461,7 +463,7 @@ const Co = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
|
|
|
461
463
|
*/
|
|
462
464
|
o ? [Math.random(), c] : [n, c]
|
|
463
465
|
);
|
|
464
|
-
return
|
|
466
|
+
return xt(() => {
|
|
465
467
|
a.forEach((h, f) => a.set(f, !1));
|
|
466
468
|
}, [n]), yn.useEffect(() => {
|
|
467
469
|
!n && !a.size && i && i();
|
|
@@ -470,12 +472,12 @@ const Co = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
|
|
|
470
472
|
function Do() {
|
|
471
473
|
return /* @__PURE__ */ new Map();
|
|
472
474
|
}
|
|
473
|
-
function
|
|
474
|
-
const e =
|
|
475
|
+
function Rs(t = !0) {
|
|
476
|
+
const e = U(Me);
|
|
475
477
|
if (e === null)
|
|
476
478
|
return [!0, null];
|
|
477
479
|
const { isPresent: n, onExitComplete: i, register: s } = e, o = vn();
|
|
478
|
-
|
|
480
|
+
it(() => {
|
|
479
481
|
t && s(o);
|
|
480
482
|
}, [t]);
|
|
481
483
|
const r = z(() => t && i && i(o), [o, i, t]);
|
|
@@ -484,13 +486,13 @@ function Ms(t = !0) {
|
|
|
484
486
|
const fe = (t) => t.key || "";
|
|
485
487
|
function oi(t) {
|
|
486
488
|
const e = [];
|
|
487
|
-
return
|
|
488
|
-
|
|
489
|
+
return oo.forEach(t, (n) => {
|
|
490
|
+
ao(n) && e.push(n);
|
|
489
491
|
}), e;
|
|
490
492
|
}
|
|
491
|
-
const wn = typeof window < "u",
|
|
492
|
-
const [a, l] =
|
|
493
|
-
|
|
493
|
+
const wn = typeof window < "u", Ms = wn ? lo : it, Ro = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: r = !1 }) => {
|
|
494
|
+
const [a, l] = Rs(r), c = xt(() => oi(t), [t]), u = r && !a ? [] : c.map(fe), h = K(!0), f = K(c), d = bn(() => /* @__PURE__ */ new Map()), [p, g] = Dt(c), [v, y] = Dt(c);
|
|
495
|
+
Ms(() => {
|
|
494
496
|
h.current = !1, f.current = c;
|
|
495
497
|
for (let w = 0; w < v.length; w++) {
|
|
496
498
|
const T = fe(v[w]);
|
|
@@ -498,17 +500,17 @@ const wn = typeof window < "u", ks = wn ? co : st, Ro = ({ children: t, custom:
|
|
|
498
500
|
}
|
|
499
501
|
}, [v, u.length, u.join("-")]);
|
|
500
502
|
const x = [];
|
|
501
|
-
if (c !==
|
|
503
|
+
if (c !== p) {
|
|
502
504
|
let w = [...c];
|
|
503
505
|
for (let T = 0; T < v.length; T++) {
|
|
504
506
|
const A = v[T], D = fe(A);
|
|
505
507
|
u.includes(D) || (w.splice(T, 0, A), x.push(A));
|
|
506
508
|
}
|
|
507
|
-
o === "wait" && x.length && (w = x), y(oi(w)),
|
|
509
|
+
o === "wait" && x.length && (w = x), y(oi(w)), g(c);
|
|
508
510
|
return;
|
|
509
511
|
}
|
|
510
512
|
process.env.NODE_ENV !== "production" && o === "wait" && v.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
511
|
-
const { forceRender: b } =
|
|
513
|
+
const { forceRender: b } = U(Tn);
|
|
512
514
|
return E.jsx(E.Fragment, { children: v.map((w) => {
|
|
513
515
|
const T = fe(w), A = r && !a ? !1 : c === v || u.includes(T), D = () => {
|
|
514
516
|
if (d.has(T))
|
|
@@ -516,17 +518,17 @@ const wn = typeof window < "u", ks = wn ? co : st, Ro = ({ children: t, custom:
|
|
|
516
518
|
else
|
|
517
519
|
return;
|
|
518
520
|
let S = !0;
|
|
519
|
-
d.forEach((
|
|
520
|
-
|
|
521
|
+
d.forEach((j) => {
|
|
522
|
+
j || (S = !1);
|
|
521
523
|
}), S && (b == null || b(), y(f.current), r && (l == null || l()), i && i());
|
|
522
524
|
};
|
|
523
525
|
return E.jsx(Co, { isPresent: A, initial: !h.current || n ? void 0 : !1, custom: A ? void 0 : e, presenceAffectsLayout: s, mode: o, onExitComplete: A ? void 0 : D, children: w }, T);
|
|
524
526
|
}) });
|
|
525
527
|
}, H = /* @__NO_SIDE_EFFECTS__ */ (t) => t;
|
|
526
|
-
let
|
|
527
|
-
process.env.NODE_ENV !== "production" && (
|
|
528
|
+
let Nt = H, ct = H;
|
|
529
|
+
process.env.NODE_ENV !== "production" && (Nt = (t, e) => {
|
|
528
530
|
!t && typeof console < "u" && console.warn(e);
|
|
529
|
-
},
|
|
531
|
+
}, ct = (t, e) => {
|
|
530
532
|
if (!t)
|
|
531
533
|
throw new Error(e);
|
|
532
534
|
});
|
|
@@ -535,10 +537,10 @@ function Sn(t) {
|
|
|
535
537
|
let e;
|
|
536
538
|
return () => (e === void 0 && (e = t()), e);
|
|
537
539
|
}
|
|
538
|
-
const
|
|
540
|
+
const Ot = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
539
541
|
const i = e - t;
|
|
540
542
|
return i === 0 ? 1 : (n - t) / i;
|
|
541
|
-
},
|
|
543
|
+
}, Q = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, st = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3, Mo = {
|
|
542
544
|
useManualTiming: !1
|
|
543
545
|
};
|
|
544
546
|
function ko(t) {
|
|
@@ -593,7 +595,7 @@ const de = [
|
|
|
593
595
|
"postRender"
|
|
594
596
|
// Compute
|
|
595
597
|
], Lo = 40;
|
|
596
|
-
function
|
|
598
|
+
function ks(t, e) {
|
|
597
599
|
let n = !1, i = !0;
|
|
598
600
|
const s = {
|
|
599
601
|
delta: 0,
|
|
@@ -602,18 +604,18 @@ function Ls(t, e) {
|
|
|
602
604
|
}, o = () => n = !0, r = de.reduce((y, x) => (y[x] = ko(o), y), {}), { read: a, resolveKeyframes: l, update: c, preRender: u, render: h, postRender: f } = r, d = () => {
|
|
603
605
|
const y = performance.now();
|
|
604
606
|
n = !1, s.delta = i ? 1e3 / 60 : Math.max(Math.min(y - s.timestamp, Lo), 1), s.timestamp = y, s.isProcessing = !0, a.process(s), l.process(s), c.process(s), u.process(s), h.process(s), f.process(s), s.isProcessing = !1, n && e && (i = !1, t(d));
|
|
605
|
-
},
|
|
607
|
+
}, p = () => {
|
|
606
608
|
n = !0, i = !0, s.isProcessing || t(d);
|
|
607
609
|
};
|
|
608
610
|
return { schedule: de.reduce((y, x) => {
|
|
609
611
|
const b = r[x];
|
|
610
|
-
return y[x] = (w, T = !1, A = !1) => (n ||
|
|
612
|
+
return y[x] = (w, T = !1, A = !1) => (n || p(), b.schedule(w, T, A)), y;
|
|
611
613
|
}, {}), cancel: (y) => {
|
|
612
614
|
for (let x = 0; x < de.length; x++)
|
|
613
615
|
r[de[x]].cancel(y);
|
|
614
616
|
}, state: s, steps: r };
|
|
615
617
|
}
|
|
616
|
-
const { schedule: M, cancel:
|
|
618
|
+
const { schedule: M, cancel: ut, state: I, steps: Ie } = ks(typeof requestAnimationFrame < "u" ? requestAnimationFrame : H, !0), Ls = Tt({ strict: !1 }), ai = {
|
|
617
619
|
animation: [
|
|
618
620
|
"animate",
|
|
619
621
|
"variants",
|
|
@@ -632,15 +634,15 @@ const { schedule: M, cancel: ft, state: I, steps: Ue } = Ls(typeof requestAnimat
|
|
|
632
634
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
633
635
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
634
636
|
layout: ["layout", "layoutId"]
|
|
635
|
-
},
|
|
637
|
+
}, Ft = {};
|
|
636
638
|
for (const t in ai)
|
|
637
|
-
|
|
639
|
+
Ft[t] = {
|
|
638
640
|
isEnabled: (e) => ai[t].some((n) => !!e[n])
|
|
639
641
|
};
|
|
640
642
|
function jo(t) {
|
|
641
643
|
for (const e in t)
|
|
642
|
-
|
|
643
|
-
...
|
|
644
|
+
Ft[e] = {
|
|
645
|
+
...Ft[e],
|
|
644
646
|
...t[e]
|
|
645
647
|
};
|
|
646
648
|
}
|
|
@@ -679,18 +681,18 @@ const Oo = /* @__PURE__ */ new Set([
|
|
|
679
681
|
function be(t) {
|
|
680
682
|
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || Oo.has(t);
|
|
681
683
|
}
|
|
682
|
-
let
|
|
684
|
+
let js = (t) => !be(t);
|
|
683
685
|
function Fo(t) {
|
|
684
|
-
t && (
|
|
686
|
+
t && (js = (e) => e.startsWith("on") ? !be(e) : t(e));
|
|
685
687
|
}
|
|
686
688
|
try {
|
|
687
689
|
Fo(require("@emotion/is-prop-valid").default);
|
|
688
690
|
} catch {
|
|
689
691
|
}
|
|
690
|
-
function
|
|
692
|
+
function _o(t, e, n) {
|
|
691
693
|
const i = {};
|
|
692
694
|
for (const s in t)
|
|
693
|
-
s === "values" && typeof t.values == "object" || (
|
|
695
|
+
s === "values" && typeof t.values == "object" || (js(s) || n === !0 && be(s) || !e && !be(s) || // If trying to use native HTML drag events, forward drag listeners
|
|
694
696
|
t.draggable && s.startsWith("onDrag")) && (i[s] = t[s]);
|
|
695
697
|
return i;
|
|
696
698
|
}
|
|
@@ -698,7 +700,7 @@ const li = /* @__PURE__ */ new Set();
|
|
|
698
700
|
function ke(t, e, n) {
|
|
699
701
|
t || li.has(e) || (console.warn(e), li.add(e));
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function Bo(t) {
|
|
702
704
|
if (typeof Proxy > "u")
|
|
703
705
|
return t;
|
|
704
706
|
const e = /* @__PURE__ */ new Map(), n = (...i) => (process.env.NODE_ENV !== "production" && ke(!1, "motion() is deprecated. Use motion.create() instead."), t(...i));
|
|
@@ -711,7 +713,7 @@ function Io(t) {
|
|
|
711
713
|
get: (i, s) => s === "create" ? t : (e.has(s) || e.set(s, t(s)), e.get(s))
|
|
712
714
|
});
|
|
713
715
|
}
|
|
714
|
-
const Le =
|
|
716
|
+
const Le = Tt({});
|
|
715
717
|
function Qt(t) {
|
|
716
718
|
return typeof t == "string" || Array.isArray(t);
|
|
717
719
|
}
|
|
@@ -730,7 +732,7 @@ const An = [
|
|
|
730
732
|
function Oe(t) {
|
|
731
733
|
return je(t.animate) || Vn.some((e) => Qt(t[e]));
|
|
732
734
|
}
|
|
733
|
-
function
|
|
735
|
+
function Os(t) {
|
|
734
736
|
return !!(Oe(t) || t.variants);
|
|
735
737
|
}
|
|
736
738
|
function No(t, e) {
|
|
@@ -743,21 +745,21 @@ function No(t, e) {
|
|
|
743
745
|
}
|
|
744
746
|
return t.inherit !== !1 ? e : {};
|
|
745
747
|
}
|
|
746
|
-
function
|
|
747
|
-
const { initial: e, animate: n } = No(t,
|
|
748
|
-
return
|
|
748
|
+
function Io(t) {
|
|
749
|
+
const { initial: e, animate: n } = No(t, U(Le));
|
|
750
|
+
return xt(() => ({ initial: e, animate: n }), [ci(e), ci(n)]);
|
|
749
751
|
}
|
|
750
752
|
function ci(t) {
|
|
751
753
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
752
754
|
}
|
|
753
755
|
const Uo = Symbol.for("motionComponentSymbol");
|
|
754
|
-
function
|
|
756
|
+
function Rt(t) {
|
|
755
757
|
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
756
758
|
}
|
|
757
759
|
function $o(t, e, n) {
|
|
758
760
|
return z(
|
|
759
761
|
(i) => {
|
|
760
|
-
i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) :
|
|
762
|
+
i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : Rt(n) && (n.current = i));
|
|
761
763
|
},
|
|
762
764
|
/**
|
|
763
765
|
* Only pass a new ref callback to React if we've received a visual element
|
|
@@ -767,10 +769,10 @@ function $o(t, e, n) {
|
|
|
767
769
|
[e]
|
|
768
770
|
);
|
|
769
771
|
}
|
|
770
|
-
const En = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Wo = "framerAppearId",
|
|
772
|
+
const En = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Wo = "framerAppearId", Fs = "data-" + En(Wo), { schedule: Cn } = ks(queueMicrotask, !1), _s = Tt({});
|
|
771
773
|
function Go(t, e, n, i, s) {
|
|
772
774
|
var o, r;
|
|
773
|
-
const { visualElement: a } =
|
|
775
|
+
const { visualElement: a } = U(Le), l = U(Ls), c = U(Me), u = U(Pn).reducedMotion, h = K(null);
|
|
774
776
|
i = i || l.renderer, !h.current && i && (h.current = i(t, {
|
|
775
777
|
visualState: e,
|
|
776
778
|
parent: a,
|
|
@@ -779,28 +781,28 @@ function Go(t, e, n, i, s) {
|
|
|
779
781
|
blockInitialAnimation: c ? c.initial === !1 : !1,
|
|
780
782
|
reducedMotionConfig: u
|
|
781
783
|
}));
|
|
782
|
-
const f = h.current, d =
|
|
784
|
+
const f = h.current, d = U(_s);
|
|
783
785
|
f && !f.projection && s && (f.type === "html" || f.type === "svg") && Ko(h.current, n, s, d);
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
f &&
|
|
786
|
+
const p = K(!1);
|
|
787
|
+
Es(() => {
|
|
788
|
+
f && p.current && f.update(n, c);
|
|
787
789
|
});
|
|
788
|
-
const
|
|
789
|
-
return
|
|
790
|
-
f && (
|
|
791
|
-
}),
|
|
790
|
+
const g = n[Fs], v = K(!!g && !(!((o = window.MotionHandoffIsComplete) === null || o === void 0) && o.call(window, g)) && ((r = window.MotionHasOptimisedAnimation) === null || r === void 0 ? void 0 : r.call(window, g)));
|
|
791
|
+
return Ms(() => {
|
|
792
|
+
f && (p.current = !0, window.MotionIsMounted = !0, f.updateFeatures(), Cn.render(f.render), v.current && f.animationState && f.animationState.animateChanges());
|
|
793
|
+
}), it(() => {
|
|
792
794
|
f && (!v.current && f.animationState && f.animationState.animateChanges(), v.current && (queueMicrotask(() => {
|
|
793
795
|
var y;
|
|
794
|
-
(y = window.MotionHandoffMarkAsComplete) === null || y === void 0 || y.call(window,
|
|
796
|
+
(y = window.MotionHandoffMarkAsComplete) === null || y === void 0 || y.call(window, g);
|
|
795
797
|
}), v.current = !1));
|
|
796
798
|
}), f;
|
|
797
799
|
}
|
|
798
800
|
function Ko(t, e, n, i) {
|
|
799
801
|
const { layoutId: s, layout: o, drag: r, dragConstraints: a, layoutScroll: l, layoutRoot: c } = e;
|
|
800
|
-
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 :
|
|
802
|
+
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Bs(t.parent)), t.projection.setOptions({
|
|
801
803
|
layoutId: s,
|
|
802
804
|
layout: o,
|
|
803
|
-
alwaysMeasureLayout: !!r || a &&
|
|
805
|
+
alwaysMeasureLayout: !!r || a && Rt(a),
|
|
804
806
|
visualElement: t,
|
|
805
807
|
/**
|
|
806
808
|
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
@@ -815,9 +817,9 @@ function Ko(t, e, n, i) {
|
|
|
815
817
|
layoutRoot: c
|
|
816
818
|
});
|
|
817
819
|
}
|
|
818
|
-
function
|
|
820
|
+
function Bs(t) {
|
|
819
821
|
if (t)
|
|
820
|
-
return t.options.allowProjection !== !1 ? t.projection :
|
|
822
|
+
return t.options.allowProjection !== !1 ? t.projection : Bs(t.parent);
|
|
821
823
|
}
|
|
822
824
|
function Ho({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: i, Component: s }) {
|
|
823
825
|
var o, r;
|
|
@@ -825,34 +827,34 @@ function Ho({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVis
|
|
|
825
827
|
function a(c, u) {
|
|
826
828
|
let h;
|
|
827
829
|
const f = {
|
|
828
|
-
...
|
|
830
|
+
...U(Pn),
|
|
829
831
|
...c,
|
|
830
832
|
layoutId: zo(c)
|
|
831
|
-
}, { isStatic: d } = f,
|
|
833
|
+
}, { isStatic: d } = f, p = Io(c), g = i(c, d);
|
|
832
834
|
if (!d && wn) {
|
|
833
835
|
Yo(f, t);
|
|
834
836
|
const v = Xo(f);
|
|
835
|
-
h = v.MeasureLayout,
|
|
837
|
+
h = v.MeasureLayout, p.visualElement = Go(s, g, f, e, v.ProjectionNode);
|
|
836
838
|
}
|
|
837
|
-
return E.jsxs(Le.Provider, { value:
|
|
839
|
+
return E.jsxs(Le.Provider, { value: p, children: [h && p.visualElement ? E.jsx(h, { visualElement: p.visualElement, ...f }) : null, n(s, c, $o(g, p.visualElement, u), g, d, p.visualElement)] });
|
|
838
840
|
}
|
|
839
841
|
a.displayName = `motion.${typeof s == "string" ? s : `create(${(r = (o = s.displayName) !== null && o !== void 0 ? o : s.name) !== null && r !== void 0 ? r : ""})`}`;
|
|
840
842
|
const l = Re(a);
|
|
841
843
|
return l[Uo] = s, l;
|
|
842
844
|
}
|
|
843
845
|
function zo({ layoutId: t }) {
|
|
844
|
-
const e =
|
|
846
|
+
const e = U(Tn).id;
|
|
845
847
|
return e && t !== void 0 ? e + "-" + t : t;
|
|
846
848
|
}
|
|
847
849
|
function Yo(t, e) {
|
|
848
|
-
const n =
|
|
850
|
+
const n = U(Ls).strict;
|
|
849
851
|
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
850
852
|
const i = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
851
|
-
t.ignoreStrict ?
|
|
853
|
+
t.ignoreStrict ? Nt(!1, i) : ct(!1, i);
|
|
852
854
|
}
|
|
853
855
|
}
|
|
854
856
|
function Xo(t) {
|
|
855
|
-
const { drag: e, layout: n } =
|
|
857
|
+
const { drag: e, layout: n } = Ft;
|
|
856
858
|
if (!e && !n)
|
|
857
859
|
return {};
|
|
858
860
|
const i = { ...e, ...n };
|
|
@@ -937,8 +939,8 @@ function Qo({ scrapeMotionValuesFromProps: t, createRenderState: e, onUpdate: n
|
|
|
937
939
|
};
|
|
938
940
|
return n && (r.onMount = (a) => n({ props: i, current: a, ...r }), r.onUpdate = (a) => n(a)), r;
|
|
939
941
|
}
|
|
940
|
-
const
|
|
941
|
-
const i =
|
|
942
|
+
const Ns = (t) => (e, n) => {
|
|
943
|
+
const i = U(Le), s = U(Me), o = () => Qo(t, e, i, s);
|
|
942
944
|
return n ? o() : bn(o);
|
|
943
945
|
};
|
|
944
946
|
function ta(t, e, n, i) {
|
|
@@ -946,7 +948,7 @@ function ta(t, e, n, i) {
|
|
|
946
948
|
for (const f in o)
|
|
947
949
|
s[f] = ye(o[f]);
|
|
948
950
|
let { initial: r, animate: a } = t;
|
|
949
|
-
const l = Oe(t), c =
|
|
951
|
+
const l = Oe(t), c = Os(t);
|
|
950
952
|
e && c && !l && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate));
|
|
951
953
|
let u = n ? n.initial === !1 : !1;
|
|
952
954
|
u = u || r === !1;
|
|
@@ -954,9 +956,9 @@ function ta(t, e, n, i) {
|
|
|
954
956
|
if (h && typeof h != "boolean" && !je(h)) {
|
|
955
957
|
const f = Array.isArray(h) ? h : [h];
|
|
956
958
|
for (let d = 0; d < f.length; d++) {
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
959
|
-
const { transitionEnd:
|
|
959
|
+
const p = Rn(t, f[d]);
|
|
960
|
+
if (p) {
|
|
961
|
+
const { transitionEnd: g, transition: v, ...y } = p;
|
|
960
962
|
for (const x in y) {
|
|
961
963
|
let b = y[x];
|
|
962
964
|
if (Array.isArray(b)) {
|
|
@@ -965,14 +967,14 @@ function ta(t, e, n, i) {
|
|
|
965
967
|
}
|
|
966
968
|
b !== null && (s[x] = b);
|
|
967
969
|
}
|
|
968
|
-
for (const x in
|
|
969
|
-
s[x] =
|
|
970
|
+
for (const x in g)
|
|
971
|
+
s[x] = g[x];
|
|
970
972
|
}
|
|
971
973
|
}
|
|
972
974
|
}
|
|
973
975
|
return s;
|
|
974
976
|
}
|
|
975
|
-
const
|
|
977
|
+
const It = [
|
|
976
978
|
"transformPerspective",
|
|
977
979
|
"x",
|
|
978
980
|
"y",
|
|
@@ -990,24 +992,24 @@ const Bt = [
|
|
|
990
992
|
"skew",
|
|
991
993
|
"skewX",
|
|
992
994
|
"skewY"
|
|
993
|
-
],
|
|
995
|
+
], bt = new Set(It), Is = (t) => (e) => typeof e == "string" && e.startsWith(t), Us = /* @__PURE__ */ Is("--"), ea = /* @__PURE__ */ Is("var(--"), Mn = (t) => ea(t) ? na.test(t.split("/*")[0].trim()) : !1, na = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, $s = (t, e) => e && typeof t == "number" ? e.transform(t) : t, rt = (t, e, n) => n > e ? e : n < t ? t : n, Ut = {
|
|
994
996
|
test: (t) => typeof t == "number",
|
|
995
997
|
parse: parseFloat,
|
|
996
998
|
transform: (t) => t
|
|
997
999
|
}, te = {
|
|
998
|
-
...
|
|
999
|
-
transform: (t) =>
|
|
1000
|
+
...Ut,
|
|
1001
|
+
transform: (t) => rt(0, 1, t)
|
|
1000
1002
|
}, me = {
|
|
1001
|
-
...
|
|
1003
|
+
...Ut,
|
|
1002
1004
|
default: 1
|
|
1003
|
-
},
|
|
1005
|
+
}, oe = (t) => ({
|
|
1004
1006
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
1005
1007
|
parse: parseFloat,
|
|
1006
1008
|
transform: (e) => `${e}${t}`
|
|
1007
|
-
}),
|
|
1008
|
-
...
|
|
1009
|
-
parse: (t) =>
|
|
1010
|
-
transform: (t) =>
|
|
1009
|
+
}), lt = /* @__PURE__ */ oe("deg"), tt = /* @__PURE__ */ oe("%"), P = /* @__PURE__ */ oe("px"), ia = /* @__PURE__ */ oe("vh"), sa = /* @__PURE__ */ oe("vw"), hi = {
|
|
1010
|
+
...tt,
|
|
1011
|
+
parse: (t) => tt.parse(t) / 100,
|
|
1012
|
+
transform: (t) => tt.transform(t * 100)
|
|
1011
1013
|
}, ra = {
|
|
1012
1014
|
// Border props
|
|
1013
1015
|
borderWidth: P,
|
|
@@ -1045,17 +1047,17 @@ const Bt = [
|
|
|
1045
1047
|
backgroundPositionX: P,
|
|
1046
1048
|
backgroundPositionY: P
|
|
1047
1049
|
}, oa = {
|
|
1048
|
-
rotate:
|
|
1049
|
-
rotateX:
|
|
1050
|
-
rotateY:
|
|
1051
|
-
rotateZ:
|
|
1050
|
+
rotate: lt,
|
|
1051
|
+
rotateX: lt,
|
|
1052
|
+
rotateY: lt,
|
|
1053
|
+
rotateZ: lt,
|
|
1052
1054
|
scale: me,
|
|
1053
1055
|
scaleX: me,
|
|
1054
1056
|
scaleY: me,
|
|
1055
1057
|
scaleZ: me,
|
|
1056
|
-
skew:
|
|
1057
|
-
skewX:
|
|
1058
|
-
skewY:
|
|
1058
|
+
skew: lt,
|
|
1059
|
+
skewX: lt,
|
|
1060
|
+
skewY: lt,
|
|
1059
1061
|
distance: P,
|
|
1060
1062
|
translateX: P,
|
|
1061
1063
|
translateY: P,
|
|
@@ -1070,7 +1072,7 @@ const Bt = [
|
|
|
1070
1072
|
originY: hi,
|
|
1071
1073
|
originZ: P
|
|
1072
1074
|
}, fi = {
|
|
1073
|
-
...
|
|
1075
|
+
...Ut,
|
|
1074
1076
|
transform: Math.round
|
|
1075
1077
|
}, kn = {
|
|
1076
1078
|
...ra,
|
|
@@ -1086,16 +1088,16 @@ const Bt = [
|
|
|
1086
1088
|
y: "translateY",
|
|
1087
1089
|
z: "translateZ",
|
|
1088
1090
|
transformPerspective: "perspective"
|
|
1089
|
-
}, la =
|
|
1091
|
+
}, la = It.length;
|
|
1090
1092
|
function ca(t, e, n) {
|
|
1091
1093
|
let i = "", s = !0;
|
|
1092
1094
|
for (let o = 0; o < la; o++) {
|
|
1093
|
-
const r =
|
|
1095
|
+
const r = It[o], a = t[r];
|
|
1094
1096
|
if (a === void 0)
|
|
1095
1097
|
continue;
|
|
1096
1098
|
let l = !0;
|
|
1097
1099
|
if (typeof a == "number" ? l = a === (r.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
1098
|
-
const c =
|
|
1100
|
+
const c = $s(a, kn[r]);
|
|
1099
1101
|
if (!l) {
|
|
1100
1102
|
s = !1;
|
|
1101
1103
|
const u = aa[r] || r;
|
|
@@ -1111,14 +1113,14 @@ function Ln(t, e, n) {
|
|
|
1111
1113
|
let r = !1, a = !1;
|
|
1112
1114
|
for (const l in e) {
|
|
1113
1115
|
const c = e[l];
|
|
1114
|
-
if (
|
|
1116
|
+
if (bt.has(l)) {
|
|
1115
1117
|
r = !0;
|
|
1116
1118
|
continue;
|
|
1117
|
-
} else if (
|
|
1119
|
+
} else if (Us(l)) {
|
|
1118
1120
|
s[l] = c;
|
|
1119
1121
|
continue;
|
|
1120
1122
|
} else {
|
|
1121
|
-
const u =
|
|
1123
|
+
const u = $s(c, kn[l]);
|
|
1122
1124
|
l.startsWith("origin") ? (a = !0, o[l] = u) : i[l] = u;
|
|
1123
1125
|
}
|
|
1124
1126
|
}
|
|
@@ -1165,24 +1167,24 @@ function jn(t, {
|
|
|
1165
1167
|
return;
|
|
1166
1168
|
}
|
|
1167
1169
|
t.attrs = t.style, t.style = {};
|
|
1168
|
-
const { attrs: f, style: d, dimensions:
|
|
1169
|
-
f.transform && (
|
|
1170
|
+
const { attrs: f, style: d, dimensions: p } = t;
|
|
1171
|
+
f.transform && (p && (d.transform = f.transform), delete f.transform), p && (s !== void 0 || o !== void 0 || d.transform) && (d.transformOrigin = da(p, s !== void 0 ? s : 0.5, o !== void 0 ? o : 0.5)), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), i !== void 0 && (f.scale = i), r !== void 0 && fa(f, r, a, l, !1);
|
|
1170
1172
|
}
|
|
1171
1173
|
const On = () => ({
|
|
1172
1174
|
style: {},
|
|
1173
1175
|
transform: {},
|
|
1174
1176
|
transformOrigin: {},
|
|
1175
1177
|
vars: {}
|
|
1176
|
-
}),
|
|
1178
|
+
}), Ws = () => ({
|
|
1177
1179
|
...On(),
|
|
1178
1180
|
attrs: {}
|
|
1179
1181
|
}), Fn = (t) => typeof t == "string" && t.toLowerCase() === "svg";
|
|
1180
|
-
function
|
|
1182
|
+
function Gs(t, { style: e, vars: n }, i, s) {
|
|
1181
1183
|
Object.assign(t.style, e, s && s.getProjectionStyles(i));
|
|
1182
1184
|
for (const o in n)
|
|
1183
1185
|
t.style.setProperty(o, n[o]);
|
|
1184
1186
|
}
|
|
1185
|
-
const
|
|
1187
|
+
const Ks = /* @__PURE__ */ new Set([
|
|
1186
1188
|
"baseFrequency",
|
|
1187
1189
|
"diffuseConstant",
|
|
1188
1190
|
"kernelMatrix",
|
|
@@ -1207,30 +1209,30 @@ const Hs = /* @__PURE__ */ new Set([
|
|
|
1207
1209
|
"textLength",
|
|
1208
1210
|
"lengthAdjust"
|
|
1209
1211
|
]);
|
|
1210
|
-
function
|
|
1211
|
-
|
|
1212
|
+
function Hs(t, e, n, i) {
|
|
1213
|
+
Gs(t, e, void 0, i);
|
|
1212
1214
|
for (const s in e.attrs)
|
|
1213
|
-
t.setAttribute(
|
|
1215
|
+
t.setAttribute(Ks.has(s) ? s : En(s), e.attrs[s]);
|
|
1214
1216
|
}
|
|
1215
1217
|
const Pe = {};
|
|
1216
1218
|
function ma(t) {
|
|
1217
1219
|
Object.assign(Pe, t);
|
|
1218
1220
|
}
|
|
1219
|
-
function
|
|
1220
|
-
return
|
|
1221
|
+
function zs(t, { layout: e, layoutId: n }) {
|
|
1222
|
+
return bt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Pe[t] || t === "opacity");
|
|
1221
1223
|
}
|
|
1222
|
-
function
|
|
1224
|
+
function _n(t, e, n) {
|
|
1223
1225
|
var i;
|
|
1224
1226
|
const { style: s } = t, o = {};
|
|
1225
1227
|
for (const r in s)
|
|
1226
|
-
(G(s[r]) || e.style && G(e.style[r]) ||
|
|
1228
|
+
(G(s[r]) || e.style && G(e.style[r]) || zs(r, t) || ((i = n == null ? void 0 : n.getValue(r)) === null || i === void 0 ? void 0 : i.liveStyle) !== void 0) && (o[r] = s[r]);
|
|
1227
1229
|
return o;
|
|
1228
1230
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const i =
|
|
1231
|
+
function Ys(t, e, n) {
|
|
1232
|
+
const i = _n(t, e, n);
|
|
1231
1233
|
for (const s in t)
|
|
1232
1234
|
if (G(t[s]) || G(e[s])) {
|
|
1233
|
-
const o =
|
|
1235
|
+
const o = It.indexOf(s) !== -1 ? "attr" + s.charAt(0).toUpperCase() + s.substring(1) : s;
|
|
1234
1236
|
i[o] = t[s];
|
|
1235
1237
|
}
|
|
1236
1238
|
return i;
|
|
@@ -1248,16 +1250,16 @@ function pa(t, e) {
|
|
|
1248
1250
|
}
|
|
1249
1251
|
}
|
|
1250
1252
|
const mi = ["x", "y", "width", "height", "cx", "cy", "r"], ga = {
|
|
1251
|
-
useVisualState:
|
|
1252
|
-
scrapeMotionValuesFromProps:
|
|
1253
|
-
createRenderState:
|
|
1253
|
+
useVisualState: Ns({
|
|
1254
|
+
scrapeMotionValuesFromProps: Ys,
|
|
1255
|
+
createRenderState: Ws,
|
|
1254
1256
|
onUpdate: ({ props: t, prevProps: e, current: n, renderState: i, latestValues: s }) => {
|
|
1255
1257
|
if (!n)
|
|
1256
1258
|
return;
|
|
1257
1259
|
let o = !!t.drag;
|
|
1258
1260
|
if (!o) {
|
|
1259
1261
|
for (const a in s)
|
|
1260
|
-
if (
|
|
1262
|
+
if (bt.has(a)) {
|
|
1261
1263
|
o = !0;
|
|
1262
1264
|
break;
|
|
1263
1265
|
}
|
|
@@ -1272,38 +1274,38 @@ const mi = ["x", "y", "width", "height", "cx", "cy", "r"], ga = {
|
|
|
1272
1274
|
}
|
|
1273
1275
|
r && M.read(() => {
|
|
1274
1276
|
pa(n, i), M.render(() => {
|
|
1275
|
-
jn(i, s, Fn(n.tagName), t.transformTemplate),
|
|
1277
|
+
jn(i, s, Fn(n.tagName), t.transformTemplate), Hs(n, i);
|
|
1276
1278
|
});
|
|
1277
1279
|
});
|
|
1278
1280
|
}
|
|
1279
1281
|
})
|
|
1280
1282
|
}, ya = {
|
|
1281
|
-
useVisualState:
|
|
1282
|
-
scrapeMotionValuesFromProps:
|
|
1283
|
+
useVisualState: Ns({
|
|
1284
|
+
scrapeMotionValuesFromProps: _n,
|
|
1283
1285
|
createRenderState: On
|
|
1284
1286
|
})
|
|
1285
1287
|
};
|
|
1286
|
-
function
|
|
1288
|
+
function Xs(t, e, n) {
|
|
1287
1289
|
for (const i in e)
|
|
1288
|
-
!G(e[i]) && !
|
|
1290
|
+
!G(e[i]) && !zs(i, n) && (t[i] = e[i]);
|
|
1289
1291
|
}
|
|
1290
1292
|
function va({ transformTemplate: t }, e) {
|
|
1291
|
-
return
|
|
1293
|
+
return xt(() => {
|
|
1292
1294
|
const n = On();
|
|
1293
1295
|
return Ln(n, e, t), Object.assign({}, n.vars, n.style);
|
|
1294
1296
|
}, [e]);
|
|
1295
1297
|
}
|
|
1296
1298
|
function xa(t, e) {
|
|
1297
1299
|
const n = t.style || {}, i = {};
|
|
1298
|
-
return
|
|
1300
|
+
return Xs(i, n, t), Object.assign(i, va(t, e)), i;
|
|
1299
1301
|
}
|
|
1300
1302
|
function Ta(t, e) {
|
|
1301
1303
|
const n = {}, i = xa(t, e);
|
|
1302
1304
|
return t.drag && t.dragListener !== !1 && (n.draggable = !1, i.userSelect = i.WebkitUserSelect = i.WebkitTouchCallout = "none", i.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = i, n;
|
|
1303
1305
|
}
|
|
1304
1306
|
function ba(t, e, n, i) {
|
|
1305
|
-
const s =
|
|
1306
|
-
const o =
|
|
1307
|
+
const s = xt(() => {
|
|
1308
|
+
const o = Ws();
|
|
1307
1309
|
return jn(o, e, Fn(i), t.transformTemplate), {
|
|
1308
1310
|
...o.attrs,
|
|
1309
1311
|
style: { ...o.style }
|
|
@@ -1311,14 +1313,14 @@ function ba(t, e, n, i) {
|
|
|
1311
1313
|
}, [e]);
|
|
1312
1314
|
if (t.style) {
|
|
1313
1315
|
const o = {};
|
|
1314
|
-
|
|
1316
|
+
Xs(o, t.style, t), s.style = { ...o, ...s.style };
|
|
1315
1317
|
}
|
|
1316
1318
|
return s;
|
|
1317
1319
|
}
|
|
1318
1320
|
function Pa(t = !1) {
|
|
1319
1321
|
return (n, i, s, { latestValues: o }, r) => {
|
|
1320
|
-
const l = (Dn(n) ? ba : Ta)(i, o, r, n), c =
|
|
1321
|
-
return
|
|
1322
|
+
const l = (Dn(n) ? ba : Ta)(i, o, r, n), c = _o(i, typeof n == "string", t), u = n !== Cs ? { ...c, ...l, ref: s } : {}, { children: h } = i, f = xt(() => G(h) ? h.get() : h, [h]);
|
|
1323
|
+
return co(n, {
|
|
1322
1324
|
...u,
|
|
1323
1325
|
children: f
|
|
1324
1326
|
});
|
|
@@ -1336,7 +1338,7 @@ function wa(t, e) {
|
|
|
1336
1338
|
return Ho(r);
|
|
1337
1339
|
};
|
|
1338
1340
|
}
|
|
1339
|
-
function
|
|
1341
|
+
function qs(t, e) {
|
|
1340
1342
|
if (!Array.isArray(e))
|
|
1341
1343
|
return !1;
|
|
1342
1344
|
const n = e.length;
|
|
@@ -1427,11 +1429,11 @@ class Va extends Aa {
|
|
|
1427
1429
|
return Promise.all(this.animations).then(e).catch(n);
|
|
1428
1430
|
}
|
|
1429
1431
|
}
|
|
1430
|
-
function
|
|
1432
|
+
function Bn(t, e) {
|
|
1431
1433
|
return t ? t[e] || t.default || t : void 0;
|
|
1432
1434
|
}
|
|
1433
1435
|
const en = 2e4;
|
|
1434
|
-
function
|
|
1436
|
+
function Zs(t) {
|
|
1435
1437
|
let e = 0;
|
|
1436
1438
|
const n = 50;
|
|
1437
1439
|
let i = t.next(e);
|
|
@@ -1445,7 +1447,7 @@ function Nn(t) {
|
|
|
1445
1447
|
function pi(t, e) {
|
|
1446
1448
|
t.timeline = e, t.onfinish = null;
|
|
1447
1449
|
}
|
|
1448
|
-
const
|
|
1450
|
+
const In = (t) => Array.isArray(t) && typeof t[0] == "number", Ea = {
|
|
1449
1451
|
linearEasing: void 0
|
|
1450
1452
|
};
|
|
1451
1453
|
function Ca(t, e) {
|
|
@@ -1462,15 +1464,15 @@ const we = /* @__PURE__ */ Ca(() => {
|
|
|
1462
1464
|
return !1;
|
|
1463
1465
|
}
|
|
1464
1466
|
return !0;
|
|
1465
|
-
}, "linearEasing"),
|
|
1467
|
+
}, "linearEasing"), Js = (t, e, n = 10) => {
|
|
1466
1468
|
let i = "";
|
|
1467
1469
|
const s = Math.max(Math.round(e / n), 2);
|
|
1468
1470
|
for (let o = 0; o < s; o++)
|
|
1469
|
-
i += t(/* @__PURE__ */
|
|
1471
|
+
i += t(/* @__PURE__ */ Ot(0, s - 1, o)) + ", ";
|
|
1470
1472
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
1471
1473
|
};
|
|
1472
|
-
function
|
|
1473
|
-
return !!(typeof t == "function" && we() || !t || typeof t == "string" && (t in nn || we()) ||
|
|
1474
|
+
function Qs(t) {
|
|
1475
|
+
return !!(typeof t == "function" && we() || !t || typeof t == "string" && (t in nn || we()) || In(t) || Array.isArray(t) && t.every(Qs));
|
|
1474
1476
|
}
|
|
1475
1477
|
const Kt = ([t, e, n, i]) => `cubic-bezier(${t}, ${e}, ${n}, ${i})`, nn = {
|
|
1476
1478
|
linear: "linear",
|
|
@@ -1483,16 +1485,16 @@ const Kt = ([t, e, n, i]) => `cubic-bezier(${t}, ${e}, ${n}, ${i})`, nn = {
|
|
|
1483
1485
|
backIn: /* @__PURE__ */ Kt([0.31, 0.01, 0.66, -0.59]),
|
|
1484
1486
|
backOut: /* @__PURE__ */ Kt([0.33, 1.53, 0.69, 0.99])
|
|
1485
1487
|
};
|
|
1486
|
-
function
|
|
1488
|
+
function tr(t, e) {
|
|
1487
1489
|
if (t)
|
|
1488
|
-
return typeof t == "function" && we() ?
|
|
1490
|
+
return typeof t == "function" && we() ? Js(t, e) : In(t) ? Kt(t) : Array.isArray(t) ? t.map((n) => tr(n, e) || nn.easeOut) : nn[t];
|
|
1489
1491
|
}
|
|
1490
|
-
const
|
|
1492
|
+
const Z = {
|
|
1491
1493
|
x: !1,
|
|
1492
1494
|
y: !1
|
|
1493
1495
|
};
|
|
1494
|
-
function
|
|
1495
|
-
return
|
|
1496
|
+
function er() {
|
|
1497
|
+
return Z.x || Z.y;
|
|
1496
1498
|
}
|
|
1497
1499
|
function Da(t, e, n) {
|
|
1498
1500
|
var i;
|
|
@@ -1505,7 +1507,7 @@ function Da(t, e, n) {
|
|
|
1505
1507
|
}
|
|
1506
1508
|
return Array.from(t);
|
|
1507
1509
|
}
|
|
1508
|
-
function
|
|
1510
|
+
function nr(t, e) {
|
|
1509
1511
|
const n = Da(t), i = new AbortController(), s = {
|
|
1510
1512
|
passive: !0,
|
|
1511
1513
|
...e,
|
|
@@ -1515,11 +1517,11 @@ function ir(t, e) {
|
|
|
1515
1517
|
}
|
|
1516
1518
|
function gi(t) {
|
|
1517
1519
|
return (e) => {
|
|
1518
|
-
e.pointerType === "touch" ||
|
|
1520
|
+
e.pointerType === "touch" || er() || t(e);
|
|
1519
1521
|
};
|
|
1520
1522
|
}
|
|
1521
1523
|
function Ra(t, e, n = {}) {
|
|
1522
|
-
const [i, s, o] =
|
|
1524
|
+
const [i, s, o] = nr(t, n), r = gi((a) => {
|
|
1523
1525
|
const { target: l } = a, c = e(a);
|
|
1524
1526
|
if (typeof c != "function" || !l)
|
|
1525
1527
|
return;
|
|
@@ -1532,7 +1534,7 @@ function Ra(t, e, n = {}) {
|
|
|
1532
1534
|
a.addEventListener("pointerenter", r, s);
|
|
1533
1535
|
}), o;
|
|
1534
1536
|
}
|
|
1535
|
-
const
|
|
1537
|
+
const ir = (t, e) => e ? t === e ? !0 : ir(t, e.parentElement) : !1, Un = (t) => t.pointerType === "mouse" ? typeof t.button != "number" || t.button <= 0 : t.isPrimary !== !1, Ma = /* @__PURE__ */ new Set([
|
|
1536
1538
|
"BUTTON",
|
|
1537
1539
|
"INPUT",
|
|
1538
1540
|
"SELECT",
|
|
@@ -1548,7 +1550,7 @@ function yi(t) {
|
|
|
1548
1550
|
e.key === "Enter" && t(e);
|
|
1549
1551
|
};
|
|
1550
1552
|
}
|
|
1551
|
-
function
|
|
1553
|
+
function Ue(t, e) {
|
|
1552
1554
|
t.dispatchEvent(new PointerEvent("pointer" + e, { isPrimary: !0, bubbles: !0 }));
|
|
1553
1555
|
}
|
|
1554
1556
|
const La = (t, e) => {
|
|
@@ -1558,27 +1560,27 @@ const La = (t, e) => {
|
|
|
1558
1560
|
const i = yi(() => {
|
|
1559
1561
|
if (Ht.has(n))
|
|
1560
1562
|
return;
|
|
1561
|
-
|
|
1563
|
+
Ue(n, "down");
|
|
1562
1564
|
const s = yi(() => {
|
|
1563
|
-
|
|
1564
|
-
}), o = () =>
|
|
1565
|
+
Ue(n, "up");
|
|
1566
|
+
}), o = () => Ue(n, "cancel");
|
|
1565
1567
|
n.addEventListener("keyup", s, e), n.addEventListener("blur", o, e);
|
|
1566
1568
|
});
|
|
1567
1569
|
n.addEventListener("keydown", i, e), n.addEventListener("blur", () => n.removeEventListener("keydown", i), e);
|
|
1568
1570
|
};
|
|
1569
1571
|
function vi(t) {
|
|
1570
|
-
return Un(t) && !
|
|
1572
|
+
return Un(t) && !er();
|
|
1571
1573
|
}
|
|
1572
1574
|
function ja(t, e, n = {}) {
|
|
1573
|
-
const [i, s, o] =
|
|
1575
|
+
const [i, s, o] = nr(t, n), r = (a) => {
|
|
1574
1576
|
const l = a.currentTarget;
|
|
1575
1577
|
if (!vi(a) || Ht.has(l))
|
|
1576
1578
|
return;
|
|
1577
1579
|
Ht.add(l);
|
|
1578
|
-
const c = e(a), u = (d,
|
|
1579
|
-
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f), !(!vi(d) || !Ht.has(l)) && (Ht.delete(l), typeof c == "function" && c(d, { success:
|
|
1580
|
+
const c = e(a), u = (d, p) => {
|
|
1581
|
+
window.removeEventListener("pointerup", h), window.removeEventListener("pointercancel", f), !(!vi(d) || !Ht.has(l)) && (Ht.delete(l), typeof c == "function" && c(d, { success: p }));
|
|
1580
1582
|
}, h = (d) => {
|
|
1581
|
-
u(d, n.useGlobalTarget ||
|
|
1583
|
+
u(d, n.useGlobalTarget || ir(l, d.target));
|
|
1582
1584
|
}, f = (d) => {
|
|
1583
1585
|
u(d, !1);
|
|
1584
1586
|
};
|
|
@@ -1589,27 +1591,27 @@ function ja(t, e, n = {}) {
|
|
|
1589
1591
|
}), o;
|
|
1590
1592
|
}
|
|
1591
1593
|
function Oa(t) {
|
|
1592
|
-
return t === "x" || t === "y" ?
|
|
1593
|
-
|
|
1594
|
-
}) :
|
|
1595
|
-
|
|
1594
|
+
return t === "x" || t === "y" ? Z[t] ? null : (Z[t] = !0, () => {
|
|
1595
|
+
Z[t] = !1;
|
|
1596
|
+
}) : Z.x || Z.y ? null : (Z.x = Z.y = !0, () => {
|
|
1597
|
+
Z.x = Z.y = !1;
|
|
1596
1598
|
});
|
|
1597
1599
|
}
|
|
1598
|
-
const
|
|
1600
|
+
const sr = /* @__PURE__ */ new Set([
|
|
1599
1601
|
"width",
|
|
1600
1602
|
"height",
|
|
1601
1603
|
"top",
|
|
1602
1604
|
"left",
|
|
1603
1605
|
"right",
|
|
1604
1606
|
"bottom",
|
|
1605
|
-
...
|
|
1607
|
+
...It
|
|
1606
1608
|
]);
|
|
1607
1609
|
let ve;
|
|
1608
1610
|
function Fa() {
|
|
1609
1611
|
ve = void 0;
|
|
1610
1612
|
}
|
|
1611
|
-
const
|
|
1612
|
-
now: () => (ve === void 0 &&
|
|
1613
|
+
const et = {
|
|
1614
|
+
now: () => (ve === void 0 && et.set(I.isProcessing || Mo.useManualTiming ? I.timestamp : performance.now()), ve),
|
|
1613
1615
|
set: (t) => {
|
|
1614
1616
|
ve = t, queueMicrotask(Fa);
|
|
1615
1617
|
}
|
|
@@ -1646,11 +1648,11 @@ class Gn {
|
|
|
1646
1648
|
this.subscriptions.length = 0;
|
|
1647
1649
|
}
|
|
1648
1650
|
}
|
|
1649
|
-
function
|
|
1651
|
+
function rr(t, e) {
|
|
1650
1652
|
return e ? t * (1e3 / e) : 0;
|
|
1651
1653
|
}
|
|
1652
|
-
const xi = 30,
|
|
1653
|
-
class
|
|
1654
|
+
const xi = 30, _a = (t) => !isNaN(parseFloat(t));
|
|
1655
|
+
class Ba {
|
|
1654
1656
|
/**
|
|
1655
1657
|
* @param init - The initiating value
|
|
1656
1658
|
* @param config - Optional configuration options
|
|
@@ -1661,12 +1663,12 @@ class Ia {
|
|
|
1661
1663
|
*/
|
|
1662
1664
|
constructor(e, n = {}) {
|
|
1663
1665
|
this.version = "11.18.2", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, s = !0) => {
|
|
1664
|
-
const o =
|
|
1666
|
+
const o = et.now();
|
|
1665
1667
|
this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), s && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
1666
1668
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1667
1669
|
}
|
|
1668
1670
|
setCurrent(e) {
|
|
1669
|
-
this.current = e, this.updatedAt =
|
|
1671
|
+
this.current = e, this.updatedAt = et.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = _a(this.current));
|
|
1670
1672
|
}
|
|
1671
1673
|
setPrevFrameValue(e = this.current) {
|
|
1672
1674
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1787,11 +1789,11 @@ class Ia {
|
|
|
1787
1789
|
* @public
|
|
1788
1790
|
*/
|
|
1789
1791
|
getVelocity() {
|
|
1790
|
-
const e =
|
|
1792
|
+
const e = et.now();
|
|
1791
1793
|
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > xi)
|
|
1792
1794
|
return 0;
|
|
1793
1795
|
const n = Math.min(this.updatedAt - this.prevUpdatedAt, xi);
|
|
1794
|
-
return
|
|
1796
|
+
return rr(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1795
1797
|
}
|
|
1796
1798
|
/**
|
|
1797
1799
|
* Registers a new animation to control this `MotionValue`. Only one
|
|
@@ -1845,12 +1847,12 @@ class Ia {
|
|
|
1845
1847
|
}
|
|
1846
1848
|
}
|
|
1847
1849
|
function ee(t, e) {
|
|
1848
|
-
return new
|
|
1850
|
+
return new Ba(t, e);
|
|
1849
1851
|
}
|
|
1850
1852
|
function Na(t, e, n) {
|
|
1851
1853
|
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, ee(n));
|
|
1852
1854
|
}
|
|
1853
|
-
function
|
|
1855
|
+
function Ia(t, e) {
|
|
1854
1856
|
const n = Fe(t, e);
|
|
1855
1857
|
let { transitionEnd: i = {}, transition: s = {}, ...o } = n || {};
|
|
1856
1858
|
o = { ...o, ...i };
|
|
@@ -1867,32 +1869,32 @@ function sn(t, e) {
|
|
|
1867
1869
|
if (Ua(n))
|
|
1868
1870
|
return n.add(e);
|
|
1869
1871
|
}
|
|
1870
|
-
function
|
|
1871
|
-
return t.props[
|
|
1872
|
+
function or(t) {
|
|
1873
|
+
return t.props[Fs];
|
|
1872
1874
|
}
|
|
1873
|
-
const
|
|
1875
|
+
const ar = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, $a = 1e-7, Wa = 12;
|
|
1874
1876
|
function Ga(t, e, n, i, s) {
|
|
1875
1877
|
let o, r, a = 0;
|
|
1876
1878
|
do
|
|
1877
|
-
r = e + (n - e) / 2, o =
|
|
1879
|
+
r = e + (n - e) / 2, o = ar(r, i, s) - t, o > 0 ? n = r : e = r;
|
|
1878
1880
|
while (Math.abs(o) > $a && ++a < Wa);
|
|
1879
1881
|
return r;
|
|
1880
1882
|
}
|
|
1881
|
-
function
|
|
1883
|
+
function ae(t, e, n, i) {
|
|
1882
1884
|
if (t === e && n === i)
|
|
1883
1885
|
return H;
|
|
1884
1886
|
const s = (o) => Ga(o, 0, 1, t, n);
|
|
1885
|
-
return (o) => o === 0 || o === 1 ? o :
|
|
1887
|
+
return (o) => o === 0 || o === 1 ? o : ar(s(o), e, i);
|
|
1886
1888
|
}
|
|
1887
|
-
const
|
|
1889
|
+
const lr = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, cr = (t) => (e) => 1 - t(1 - e), ur = /* @__PURE__ */ ae(0.33, 1.53, 0.69, 0.99), Kn = /* @__PURE__ */ cr(ur), hr = /* @__PURE__ */ lr(Kn), fr = (t) => (t *= 2) < 1 ? 0.5 * Kn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), Hn = (t) => 1 - Math.sin(Math.acos(t)), dr = cr(Hn), mr = lr(Hn), pr = (t) => /^0[^.\s]+$/u.test(t);
|
|
1888
1890
|
function Ka(t) {
|
|
1889
|
-
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" ||
|
|
1891
|
+
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || pr(t) : !0;
|
|
1890
1892
|
}
|
|
1891
1893
|
const Yt = (t) => Math.round(t * 1e5) / 1e5, zn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
1892
1894
|
function Ha(t) {
|
|
1893
1895
|
return t == null;
|
|
1894
1896
|
}
|
|
1895
|
-
const za = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Yn = (t, e) => (n) => !!(typeof n == "string" && za.test(n) && n.startsWith(t) || e && !Ha(n) && Object.prototype.hasOwnProperty.call(n, e)),
|
|
1897
|
+
const za = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Yn = (t, e) => (n) => !!(typeof n == "string" && za.test(n) && n.startsWith(t) || e && !Ha(n) && Object.prototype.hasOwnProperty.call(n, e)), gr = (t, e, n) => (i) => {
|
|
1896
1898
|
if (typeof i != "string")
|
|
1897
1899
|
return i;
|
|
1898
1900
|
const [s, o, r, a] = i.match(zn);
|
|
@@ -1902,13 +1904,13 @@ const za = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
1902
1904
|
[n]: parseFloat(r),
|
|
1903
1905
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
1904
1906
|
};
|
|
1905
|
-
}, Ya = (t) =>
|
|
1906
|
-
...
|
|
1907
|
+
}, Ya = (t) => rt(0, 255, t), $e = {
|
|
1908
|
+
...Ut,
|
|
1907
1909
|
transform: (t) => Math.round(Ya(t))
|
|
1908
|
-
},
|
|
1910
|
+
}, yt = {
|
|
1909
1911
|
test: /* @__PURE__ */ Yn("rgb", "red"),
|
|
1910
|
-
parse: /* @__PURE__ */
|
|
1911
|
-
transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" +
|
|
1912
|
+
parse: /* @__PURE__ */ gr("red", "green", "blue"),
|
|
1913
|
+
transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" + $e.transform(t) + ", " + $e.transform(e) + ", " + $e.transform(n) + ", " + Yt(te.transform(i)) + ")"
|
|
1912
1914
|
};
|
|
1913
1915
|
function Xa(t) {
|
|
1914
1916
|
let e = "", n = "", i = "", s = "";
|
|
@@ -1922,21 +1924,21 @@ function Xa(t) {
|
|
|
1922
1924
|
const rn = {
|
|
1923
1925
|
test: /* @__PURE__ */ Yn("#"),
|
|
1924
1926
|
parse: Xa,
|
|
1925
|
-
transform:
|
|
1926
|
-
},
|
|
1927
|
+
transform: yt.transform
|
|
1928
|
+
}, Mt = {
|
|
1927
1929
|
test: /* @__PURE__ */ Yn("hsl", "hue"),
|
|
1928
|
-
parse: /* @__PURE__ */
|
|
1929
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " +
|
|
1930
|
+
parse: /* @__PURE__ */ gr("hue", "saturation", "lightness"),
|
|
1931
|
+
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + tt.transform(Yt(e)) + ", " + tt.transform(Yt(n)) + ", " + Yt(te.transform(i)) + ")"
|
|
1930
1932
|
}, W = {
|
|
1931
|
-
test: (t) =>
|
|
1932
|
-
parse: (t) =>
|
|
1933
|
-
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ?
|
|
1933
|
+
test: (t) => yt.test(t) || rn.test(t) || Mt.test(t),
|
|
1934
|
+
parse: (t) => yt.test(t) ? yt.parse(t) : Mt.test(t) ? Mt.parse(t) : rn.parse(t),
|
|
1935
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? yt.transform(t) : Mt.transform(t)
|
|
1934
1936
|
}, qa = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
1935
1937
|
function Za(t) {
|
|
1936
1938
|
var e, n;
|
|
1937
1939
|
return isNaN(t) && typeof t == "string" && (((e = t.match(zn)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(qa)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
1938
1940
|
}
|
|
1939
|
-
const
|
|
1941
|
+
const yr = "number", vr = "color", Ja = "var", Qa = "var(", Ti = "${}", tl = /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;
|
|
1940
1942
|
function ne(t) {
|
|
1941
1943
|
const e = t.toString(), n = [], i = {
|
|
1942
1944
|
color: [],
|
|
@@ -1944,33 +1946,33 @@ function ne(t) {
|
|
|
1944
1946
|
var: []
|
|
1945
1947
|
}, s = [];
|
|
1946
1948
|
let o = 0;
|
|
1947
|
-
const a = e.replace(tl, (l) => (W.test(l) ? (i.color.push(o), s.push(
|
|
1949
|
+
const a = e.replace(tl, (l) => (W.test(l) ? (i.color.push(o), s.push(vr), n.push(W.parse(l))) : l.startsWith(Qa) ? (i.var.push(o), s.push(Ja), n.push(l)) : (i.number.push(o), s.push(yr), n.push(parseFloat(l))), ++o, Ti)).split(Ti);
|
|
1948
1950
|
return { values: n, split: a, indexes: i, types: s };
|
|
1949
1951
|
}
|
|
1950
|
-
function
|
|
1952
|
+
function xr(t) {
|
|
1951
1953
|
return ne(t).values;
|
|
1952
1954
|
}
|
|
1953
|
-
function
|
|
1955
|
+
function Tr(t) {
|
|
1954
1956
|
const { split: e, types: n } = ne(t), i = e.length;
|
|
1955
1957
|
return (s) => {
|
|
1956
1958
|
let o = "";
|
|
1957
1959
|
for (let r = 0; r < i; r++)
|
|
1958
1960
|
if (o += e[r], s[r] !== void 0) {
|
|
1959
1961
|
const a = n[r];
|
|
1960
|
-
a ===
|
|
1962
|
+
a === yr ? o += Yt(s[r]) : a === vr ? o += W.transform(s[r]) : o += s[r];
|
|
1961
1963
|
}
|
|
1962
1964
|
return o;
|
|
1963
1965
|
};
|
|
1964
1966
|
}
|
|
1965
1967
|
const el = (t) => typeof t == "number" ? 0 : t;
|
|
1966
1968
|
function nl(t) {
|
|
1967
|
-
const e =
|
|
1968
|
-
return
|
|
1969
|
+
const e = xr(t);
|
|
1970
|
+
return Tr(t)(e.map(el));
|
|
1969
1971
|
}
|
|
1970
|
-
const
|
|
1972
|
+
const ht = {
|
|
1971
1973
|
test: Za,
|
|
1972
|
-
parse:
|
|
1973
|
-
createTransformer:
|
|
1974
|
+
parse: xr,
|
|
1975
|
+
createTransformer: Tr,
|
|
1974
1976
|
getAnimatableNone: nl
|
|
1975
1977
|
}, il = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1976
1978
|
function sl(t) {
|
|
@@ -1985,7 +1987,7 @@ function sl(t) {
|
|
|
1985
1987
|
return i !== n && (o *= 100), e + "(" + o + s + ")";
|
|
1986
1988
|
}
|
|
1987
1989
|
const rl = /\b([a-z-]*)\(.*?\)/gu, on = {
|
|
1988
|
-
...
|
|
1990
|
+
...ht,
|
|
1989
1991
|
getAnimatableNone: (t) => {
|
|
1990
1992
|
const e = t.match(rl);
|
|
1991
1993
|
return e ? e.map(sl).join(" ") : t;
|
|
@@ -2007,9 +2009,9 @@ const rl = /\b([a-z-]*)\(.*?\)/gu, on = {
|
|
|
2007
2009
|
filter: on,
|
|
2008
2010
|
WebkitFilter: on
|
|
2009
2011
|
}, Xn = (t) => ol[t];
|
|
2010
|
-
function
|
|
2012
|
+
function br(t, e) {
|
|
2011
2013
|
let n = Xn(t);
|
|
2012
|
-
return n !== on && (n =
|
|
2014
|
+
return n !== on && (n = ht), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
2013
2015
|
}
|
|
2014
2016
|
const al = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
2015
2017
|
function ll(t, e, n) {
|
|
@@ -2020,9 +2022,9 @@ function ll(t, e, n) {
|
|
|
2020
2022
|
}
|
|
2021
2023
|
if (s && n)
|
|
2022
2024
|
for (const o of e)
|
|
2023
|
-
t[o] =
|
|
2025
|
+
t[o] = br(n, s);
|
|
2024
2026
|
}
|
|
2025
|
-
const bi = (t) => t ===
|
|
2027
|
+
const bi = (t) => t === Ut || t === P, Pi = (t, e) => parseFloat(t.split(", ")[e]), wi = (t, e) => (n, { transform: i }) => {
|
|
2026
2028
|
if (i === "none" || !i)
|
|
2027
2029
|
return 0;
|
|
2028
2030
|
const s = i.match(/^matrix3d\((.+)\)$/u);
|
|
@@ -2032,7 +2034,7 @@ const bi = (t) => t === It || t === P, Pi = (t, e) => parseFloat(t.split(", ")[e
|
|
|
2032
2034
|
const o = i.match(/^matrix\((.+)\)$/u);
|
|
2033
2035
|
return o ? Pi(o[1], t) : 0;
|
|
2034
2036
|
}
|
|
2035
|
-
}, cl = /* @__PURE__ */ new Set(["x", "y", "z"]), ul =
|
|
2037
|
+
}, cl = /* @__PURE__ */ new Set(["x", "y", "z"]), ul = It.filter((t) => !cl.has(t));
|
|
2036
2038
|
function hl(t) {
|
|
2037
2039
|
const e = [];
|
|
2038
2040
|
return ul.forEach((n) => {
|
|
@@ -2040,7 +2042,7 @@ function hl(t) {
|
|
|
2040
2042
|
i !== void 0 && (e.push([n, i.get()]), i.set(n.startsWith("scale") ? 1 : 0));
|
|
2041
2043
|
}), e;
|
|
2042
2044
|
}
|
|
2043
|
-
const
|
|
2045
|
+
const _t = {
|
|
2044
2046
|
// Dimensions
|
|
2045
2047
|
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
2046
2048
|
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
@@ -2052,13 +2054,13 @@ const Ot = {
|
|
|
2052
2054
|
x: wi(4, 13),
|
|
2053
2055
|
y: wi(5, 14)
|
|
2054
2056
|
};
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
const
|
|
2057
|
+
_t.translateX = _t.x;
|
|
2058
|
+
_t.translateY = _t.y;
|
|
2059
|
+
const vt = /* @__PURE__ */ new Set();
|
|
2058
2060
|
let an = !1, ln = !1;
|
|
2059
|
-
function
|
|
2061
|
+
function Pr() {
|
|
2060
2062
|
if (ln) {
|
|
2061
|
-
const t = Array.from(
|
|
2063
|
+
const t = Array.from(vt).filter((i) => i.needsMeasurement), e = new Set(t.map((i) => i.element)), n = /* @__PURE__ */ new Map();
|
|
2062
2064
|
e.forEach((i) => {
|
|
2063
2065
|
const s = hl(i);
|
|
2064
2066
|
s.length && (n.set(i, s), i.render());
|
|
@@ -2073,22 +2075,22 @@ function wr() {
|
|
|
2073
2075
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
2074
2076
|
});
|
|
2075
2077
|
}
|
|
2076
|
-
ln = !1, an = !1,
|
|
2078
|
+
ln = !1, an = !1, vt.forEach((t) => t.complete()), vt.clear();
|
|
2077
2079
|
}
|
|
2078
|
-
function
|
|
2079
|
-
|
|
2080
|
+
function wr() {
|
|
2081
|
+
vt.forEach((t) => {
|
|
2080
2082
|
t.readKeyframes(), t.needsMeasurement && (ln = !0);
|
|
2081
2083
|
});
|
|
2082
2084
|
}
|
|
2083
2085
|
function fl() {
|
|
2084
|
-
|
|
2086
|
+
wr(), Pr();
|
|
2085
2087
|
}
|
|
2086
2088
|
class qn {
|
|
2087
2089
|
constructor(e, n, i, s, o, r = !1) {
|
|
2088
2090
|
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = i, this.motionValue = s, this.element = o, this.isAsync = r;
|
|
2089
2091
|
}
|
|
2090
2092
|
scheduleResolve() {
|
|
2091
|
-
this.isScheduled = !0, this.isAsync ? (
|
|
2093
|
+
this.isScheduled = !0, this.isAsync ? (vt.add(this), an || (an = !0, M.read(wr), M.resolveKeyframes(Pr))) : (this.readKeyframes(), this.complete());
|
|
2092
2094
|
}
|
|
2093
2095
|
readKeyframes() {
|
|
2094
2096
|
const { unresolvedKeyframes: e, name: n, element: i, motionValue: s } = this;
|
|
@@ -2115,16 +2117,16 @@ class qn {
|
|
|
2115
2117
|
measureEndState() {
|
|
2116
2118
|
}
|
|
2117
2119
|
complete() {
|
|
2118
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe),
|
|
2120
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), vt.delete(this);
|
|
2119
2121
|
}
|
|
2120
2122
|
cancel() {
|
|
2121
|
-
this.isComplete || (this.isScheduled = !1,
|
|
2123
|
+
this.isComplete || (this.isScheduled = !1, vt.delete(this));
|
|
2122
2124
|
}
|
|
2123
2125
|
resume() {
|
|
2124
2126
|
this.isComplete || this.scheduleResolve();
|
|
2125
2127
|
}
|
|
2126
2128
|
}
|
|
2127
|
-
const
|
|
2129
|
+
const Sr = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), dl = (
|
|
2128
2130
|
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
2129
2131
|
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
2130
2132
|
);
|
|
@@ -2136,23 +2138,23 @@ function ml(t) {
|
|
|
2136
2138
|
return [`--${n ?? i}`, s];
|
|
2137
2139
|
}
|
|
2138
2140
|
const pl = 4;
|
|
2139
|
-
function
|
|
2140
|
-
|
|
2141
|
+
function Ar(t, e, n = 1) {
|
|
2142
|
+
ct(n <= pl, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
2141
2143
|
const [i, s] = ml(t);
|
|
2142
2144
|
if (!i)
|
|
2143
2145
|
return;
|
|
2144
2146
|
const o = window.getComputedStyle(e).getPropertyValue(i);
|
|
2145
2147
|
if (o) {
|
|
2146
2148
|
const r = o.trim();
|
|
2147
|
-
return
|
|
2149
|
+
return Sr(r) ? parseFloat(r) : r;
|
|
2148
2150
|
}
|
|
2149
|
-
return Mn(s) ?
|
|
2151
|
+
return Mn(s) ? Ar(s, e, n + 1) : s;
|
|
2150
2152
|
}
|
|
2151
|
-
const
|
|
2153
|
+
const Vr = (t) => (e) => e.test(t), gl = {
|
|
2152
2154
|
test: (t) => t === "auto",
|
|
2153
2155
|
parse: (t) => t
|
|
2154
|
-
},
|
|
2155
|
-
class
|
|
2156
|
+
}, Er = [Ut, P, tt, lt, sa, ia, gl], Si = (t) => Er.find(Vr(t));
|
|
2157
|
+
class Cr extends qn {
|
|
2156
2158
|
constructor(e, n, i, s, o) {
|
|
2157
2159
|
super(e, n, i, s, o, !0);
|
|
2158
2160
|
}
|
|
@@ -2164,11 +2166,11 @@ class Dr extends qn {
|
|
|
2164
2166
|
for (let l = 0; l < e.length; l++) {
|
|
2165
2167
|
let c = e[l];
|
|
2166
2168
|
if (typeof c == "string" && (c = c.trim(), Mn(c))) {
|
|
2167
|
-
const u =
|
|
2169
|
+
const u = Ar(c, n.current);
|
|
2168
2170
|
u !== void 0 && (e[l] = u), l === e.length - 1 && (this.finalKeyframe = c);
|
|
2169
2171
|
}
|
|
2170
2172
|
}
|
|
2171
|
-
if (this.resolveNoneKeyframes(), !
|
|
2173
|
+
if (this.resolveNoneKeyframes(), !sr.has(i) || e.length !== 2)
|
|
2172
2174
|
return;
|
|
2173
2175
|
const [s, o] = e, r = Si(s), a = Si(o);
|
|
2174
2176
|
if (r !== a)
|
|
@@ -2190,7 +2192,7 @@ class Dr extends qn {
|
|
|
2190
2192
|
const { element: e, unresolvedKeyframes: n, name: i } = this;
|
|
2191
2193
|
if (!e || !e.current)
|
|
2192
2194
|
return;
|
|
2193
|
-
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
2195
|
+
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = _t[i](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
2194
2196
|
const s = n[n.length - 1];
|
|
2195
2197
|
s !== void 0 && e.getValue(i, s).jump(s, !1);
|
|
2196
2198
|
}
|
|
@@ -2202,13 +2204,13 @@ class Dr extends qn {
|
|
|
2202
2204
|
const o = n.getValue(i);
|
|
2203
2205
|
o && o.jump(this.measuredOrigin, !1);
|
|
2204
2206
|
const r = s.length - 1, a = s[r];
|
|
2205
|
-
s[r] =
|
|
2207
|
+
s[r] = _t[i](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, c]) => {
|
|
2206
2208
|
n.getValue(l).set(c);
|
|
2207
2209
|
}), this.resolveNoneKeyframes();
|
|
2208
2210
|
}
|
|
2209
2211
|
}
|
|
2210
2212
|
const Ai = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
2211
|
-
(
|
|
2213
|
+
(ht.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
2212
2214
|
!t.startsWith("url("));
|
|
2213
2215
|
function yl(t) {
|
|
2214
2216
|
const e = t[0];
|
|
@@ -2225,17 +2227,17 @@ function vl(t, e, n, i) {
|
|
|
2225
2227
|
if (e === "display" || e === "visibility")
|
|
2226
2228
|
return !0;
|
|
2227
2229
|
const o = t[t.length - 1], r = Ai(s, e), a = Ai(o, e);
|
|
2228
|
-
return
|
|
2230
|
+
return Nt(r === a, `You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : yl(t) || (n === "spring" || Nn(n)) && i;
|
|
2229
2231
|
}
|
|
2230
2232
|
const xl = (t) => t !== null;
|
|
2231
|
-
function
|
|
2233
|
+
function _e(t, { repeat: e, repeatType: n = "loop" }, i) {
|
|
2232
2234
|
const s = t.filter(xl), o = e && n !== "loop" && e % 2 === 1 ? 0 : s.length - 1;
|
|
2233
2235
|
return !o || i === void 0 ? s[o] : i;
|
|
2234
2236
|
}
|
|
2235
2237
|
const Tl = 40;
|
|
2236
|
-
class
|
|
2238
|
+
class Dr {
|
|
2237
2239
|
constructor({ autoplay: e = !0, delay: n = 0, type: i = "keyframes", repeat: s = 0, repeatDelay: o = 0, repeatType: r = "loop", ...a }) {
|
|
2238
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt =
|
|
2240
|
+
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = et.now(), this.options = {
|
|
2239
2241
|
autoplay: e,
|
|
2240
2242
|
delay: n,
|
|
2241
2243
|
type: i,
|
|
@@ -2272,13 +2274,13 @@ class Rr {
|
|
|
2272
2274
|
* Otherwise, it will call initPlayback on the implementing class.
|
|
2273
2275
|
*/
|
|
2274
2276
|
onKeyframesResolved(e, n) {
|
|
2275
|
-
this.resolvedAt =
|
|
2277
|
+
this.resolvedAt = et.now(), this.hasAttemptedResolve = !0;
|
|
2276
2278
|
const { name: i, type: s, velocity: o, delay: r, onComplete: a, onUpdate: l, isGenerator: c } = this.options;
|
|
2277
2279
|
if (!c && !vl(e, i, s, o))
|
|
2278
2280
|
if (r)
|
|
2279
2281
|
this.options.duration = 0;
|
|
2280
2282
|
else {
|
|
2281
|
-
l && l(
|
|
2283
|
+
l && l(_e(e, this.options, n)), a && a(), this.resolveFinishedPromise();
|
|
2282
2284
|
return;
|
|
2283
2285
|
}
|
|
2284
2286
|
const u = this.initPlayback(e, n);
|
|
@@ -2307,8 +2309,8 @@ class Rr {
|
|
|
2307
2309
|
});
|
|
2308
2310
|
}
|
|
2309
2311
|
}
|
|
2310
|
-
const
|
|
2311
|
-
function
|
|
2312
|
+
const L = (t, e, n) => t + (e - t) * n;
|
|
2313
|
+
function We(t, e, n) {
|
|
2312
2314
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
2313
2315
|
}
|
|
2314
2316
|
function bl({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
@@ -2318,7 +2320,7 @@ function bl({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
|
2318
2320
|
s = o = r = n;
|
|
2319
2321
|
else {
|
|
2320
2322
|
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
2321
|
-
s =
|
|
2323
|
+
s = We(l, a, t + 1 / 3), o = We(l, a, t), r = We(l, a, t - 1 / 3);
|
|
2322
2324
|
}
|
|
2323
2325
|
return {
|
|
2324
2326
|
red: Math.round(s * 255),
|
|
@@ -2330,34 +2332,34 @@ function bl({ hue: t, saturation: e, lightness: n, alpha: i }) {
|
|
|
2330
2332
|
function Se(t, e) {
|
|
2331
2333
|
return (n) => n > 0 ? e : t;
|
|
2332
2334
|
}
|
|
2333
|
-
const
|
|
2335
|
+
const Ge = (t, e, n) => {
|
|
2334
2336
|
const i = t * t, s = n * (e * e - i) + i;
|
|
2335
2337
|
return s < 0 ? 0 : Math.sqrt(s);
|
|
2336
|
-
}, Pl = [rn,
|
|
2338
|
+
}, Pl = [rn, yt, Mt], wl = (t) => Pl.find((e) => e.test(t));
|
|
2337
2339
|
function Vi(t) {
|
|
2338
2340
|
const e = wl(t);
|
|
2339
|
-
if (
|
|
2341
|
+
if (Nt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
2340
2342
|
return !1;
|
|
2341
2343
|
let n = e.parse(t);
|
|
2342
|
-
return e ===
|
|
2344
|
+
return e === Mt && (n = bl(n)), n;
|
|
2343
2345
|
}
|
|
2344
2346
|
const Ei = (t, e) => {
|
|
2345
2347
|
const n = Vi(t), i = Vi(e);
|
|
2346
2348
|
if (!n || !i)
|
|
2347
2349
|
return Se(t, e);
|
|
2348
2350
|
const s = { ...n };
|
|
2349
|
-
return (o) => (s.red =
|
|
2350
|
-
}, Sl = (t, e) => (n) => e(t(n)),
|
|
2351
|
+
return (o) => (s.red = Ge(n.red, i.red, o), s.green = Ge(n.green, i.green, o), s.blue = Ge(n.blue, i.blue, o), s.alpha = L(n.alpha, i.alpha, o), yt.transform(s));
|
|
2352
|
+
}, Sl = (t, e) => (n) => e(t(n)), le = (...t) => t.reduce(Sl), cn = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
2351
2353
|
function Al(t, e) {
|
|
2352
2354
|
return cn.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
2353
2355
|
}
|
|
2354
2356
|
function Vl(t, e) {
|
|
2355
|
-
return (n) =>
|
|
2357
|
+
return (n) => L(t, e, n);
|
|
2356
2358
|
}
|
|
2357
2359
|
function Zn(t) {
|
|
2358
|
-
return typeof t == "number" ? Vl : typeof t == "string" ? Mn(t) ? Se : W.test(t) ? Ei : Dl : Array.isArray(t) ?
|
|
2360
|
+
return typeof t == "number" ? Vl : typeof t == "string" ? Mn(t) ? Se : W.test(t) ? Ei : Dl : Array.isArray(t) ? Rr : typeof t == "object" ? W.test(t) ? Ei : El : Se;
|
|
2359
2361
|
}
|
|
2360
|
-
function
|
|
2362
|
+
function Rr(t, e) {
|
|
2361
2363
|
const n = [...t], i = n.length, s = t.map((o, r) => Zn(o)(o, e[r]));
|
|
2362
2364
|
return (o) => {
|
|
2363
2365
|
for (let r = 0; r < i; r++)
|
|
@@ -2385,18 +2387,18 @@ function Cl(t, e) {
|
|
|
2385
2387
|
return i;
|
|
2386
2388
|
}
|
|
2387
2389
|
const Dl = (t, e) => {
|
|
2388
|
-
const n =
|
|
2389
|
-
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? cn.has(t) && !s.values.length || cn.has(e) && !i.values.length ? Al(t, e) :
|
|
2390
|
+
const n = ht.createTransformer(e), i = ne(t), s = ne(e);
|
|
2391
|
+
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? cn.has(t) && !s.values.length || cn.has(e) && !i.values.length ? Al(t, e) : le(Rr(Cl(i, s), s.values), n) : (Nt(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Se(t, e));
|
|
2390
2392
|
};
|
|
2391
|
-
function
|
|
2392
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ?
|
|
2393
|
+
function Mr(t, e, n) {
|
|
2394
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? L(t, e, n) : Zn(t)(t, e);
|
|
2393
2395
|
}
|
|
2394
2396
|
const Rl = 5;
|
|
2395
|
-
function
|
|
2397
|
+
function kr(t, e, n) {
|
|
2396
2398
|
const i = Math.max(e - Rl, 0);
|
|
2397
|
-
return
|
|
2399
|
+
return rr(n - t(i), e - i);
|
|
2398
2400
|
}
|
|
2399
|
-
const
|
|
2401
|
+
const k = {
|
|
2400
2402
|
// Default spring physics
|
|
2401
2403
|
stiffness: 100,
|
|
2402
2404
|
damping: 10,
|
|
@@ -2424,29 +2426,29 @@ const L = {
|
|
|
2424
2426
|
// in seconds
|
|
2425
2427
|
minDamping: 0.05,
|
|
2426
2428
|
maxDamping: 1
|
|
2427
|
-
},
|
|
2428
|
-
function Ml({ duration: t =
|
|
2429
|
+
}, Ke = 1e-3;
|
|
2430
|
+
function Ml({ duration: t = k.duration, bounce: e = k.bounce, velocity: n = k.velocity, mass: i = k.mass }) {
|
|
2429
2431
|
let s, o;
|
|
2430
|
-
|
|
2432
|
+
Nt(t <= /* @__PURE__ */ Q(k.maxDuration), "Spring duration must be 10 seconds or less");
|
|
2431
2433
|
let r = 1 - e;
|
|
2432
|
-
r =
|
|
2433
|
-
const u = c * r, h = u * t, f = u - n, d = un(c, r),
|
|
2434
|
-
return
|
|
2434
|
+
r = rt(k.minDamping, k.maxDamping, r), t = rt(k.minDuration, k.maxDuration, /* @__PURE__ */ st(t)), r < 1 ? (s = (c) => {
|
|
2435
|
+
const u = c * r, h = u * t, f = u - n, d = un(c, r), p = Math.exp(-h);
|
|
2436
|
+
return Ke - f / d * p;
|
|
2435
2437
|
}, o = (c) => {
|
|
2436
|
-
const h = c * r * t, f = h * n + n, d = Math.pow(r, 2) * Math.pow(c, 2) * t,
|
|
2437
|
-
return (-s(c) +
|
|
2438
|
+
const h = c * r * t, f = h * n + n, d = Math.pow(r, 2) * Math.pow(c, 2) * t, p = Math.exp(-h), g = un(Math.pow(c, 2), r);
|
|
2439
|
+
return (-s(c) + Ke > 0 ? -1 : 1) * ((f - d) * p) / g;
|
|
2438
2440
|
}) : (s = (c) => {
|
|
2439
2441
|
const u = Math.exp(-c * t), h = (c - n) * t + 1;
|
|
2440
|
-
return -
|
|
2442
|
+
return -Ke + u * h;
|
|
2441
2443
|
}, o = (c) => {
|
|
2442
2444
|
const u = Math.exp(-c * t), h = (n - c) * (t * t);
|
|
2443
2445
|
return u * h;
|
|
2444
2446
|
});
|
|
2445
2447
|
const a = 5 / t, l = Ll(s, o, a);
|
|
2446
|
-
if (t = /* @__PURE__ */
|
|
2448
|
+
if (t = /* @__PURE__ */ Q(t), isNaN(l))
|
|
2447
2449
|
return {
|
|
2448
|
-
stiffness:
|
|
2449
|
-
damping:
|
|
2450
|
+
stiffness: k.stiffness,
|
|
2451
|
+
damping: k.damping,
|
|
2450
2452
|
duration: t
|
|
2451
2453
|
};
|
|
2452
2454
|
{
|
|
@@ -2469,24 +2471,24 @@ function un(t, e) {
|
|
|
2469
2471
|
return t * Math.sqrt(1 - e * e);
|
|
2470
2472
|
}
|
|
2471
2473
|
const jl = ["duration", "bounce"], Ol = ["stiffness", "damping", "mass"];
|
|
2472
|
-
function
|
|
2474
|
+
function Ci(t, e) {
|
|
2473
2475
|
return e.some((n) => t[n] !== void 0);
|
|
2474
2476
|
}
|
|
2475
2477
|
function Fl(t) {
|
|
2476
2478
|
let e = {
|
|
2477
|
-
velocity:
|
|
2478
|
-
stiffness:
|
|
2479
|
-
damping:
|
|
2480
|
-
mass:
|
|
2479
|
+
velocity: k.velocity,
|
|
2480
|
+
stiffness: k.stiffness,
|
|
2481
|
+
damping: k.damping,
|
|
2482
|
+
mass: k.mass,
|
|
2481
2483
|
isResolvedFromDuration: !1,
|
|
2482
2484
|
...t
|
|
2483
2485
|
};
|
|
2484
|
-
if (!
|
|
2486
|
+
if (!Ci(t, Ol) && Ci(t, jl))
|
|
2485
2487
|
if (t.visualDuration) {
|
|
2486
|
-
const n = t.visualDuration, i = 2 * Math.PI / (n * 1.2), s = i * i, o = 2 *
|
|
2488
|
+
const n = t.visualDuration, i = 2 * Math.PI / (n * 1.2), s = i * i, o = 2 * rt(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(s);
|
|
2487
2489
|
e = {
|
|
2488
2490
|
...e,
|
|
2489
|
-
mass:
|
|
2491
|
+
mass: k.mass,
|
|
2490
2492
|
stiffness: s,
|
|
2491
2493
|
damping: o
|
|
2492
2494
|
};
|
|
@@ -2495,12 +2497,12 @@ function Fl(t) {
|
|
|
2495
2497
|
e = {
|
|
2496
2498
|
...e,
|
|
2497
2499
|
...n,
|
|
2498
|
-
mass:
|
|
2500
|
+
mass: k.mass
|
|
2499
2501
|
}, e.isResolvedFromDuration = !0;
|
|
2500
2502
|
}
|
|
2501
2503
|
return e;
|
|
2502
2504
|
}
|
|
2503
|
-
function
|
|
2505
|
+
function Lr(t = k.visualDuration, e = k.bounce) {
|
|
2504
2506
|
const n = typeof t != "object" ? {
|
|
2505
2507
|
visualDuration: t,
|
|
2506
2508
|
keyframes: [0, 1],
|
|
@@ -2509,23 +2511,23 @@ function jr(t = L.visualDuration, e = L.bounce) {
|
|
|
2509
2511
|
let { restSpeed: i, restDelta: s } = n;
|
|
2510
2512
|
const o = n.keyframes[0], r = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: o }, { stiffness: l, damping: c, mass: u, duration: h, velocity: f, isResolvedFromDuration: d } = Fl({
|
|
2511
2513
|
...n,
|
|
2512
|
-
velocity: -/* @__PURE__ */
|
|
2513
|
-
}),
|
|
2514
|
-
i || (i = x ?
|
|
2514
|
+
velocity: -/* @__PURE__ */ st(n.velocity || 0)
|
|
2515
|
+
}), p = f || 0, g = c / (2 * Math.sqrt(l * u)), v = r - o, y = /* @__PURE__ */ st(Math.sqrt(l / u)), x = Math.abs(v) < 5;
|
|
2516
|
+
i || (i = x ? k.restSpeed.granular : k.restSpeed.default), s || (s = x ? k.restDelta.granular : k.restDelta.default);
|
|
2515
2517
|
let b;
|
|
2516
|
-
if (
|
|
2517
|
-
const T = un(y,
|
|
2518
|
+
if (g < 1) {
|
|
2519
|
+
const T = un(y, g);
|
|
2518
2520
|
b = (A) => {
|
|
2519
|
-
const D = Math.exp(-
|
|
2520
|
-
return r - D * ((
|
|
2521
|
+
const D = Math.exp(-g * y * A);
|
|
2522
|
+
return r - D * ((p + g * y * v) / T * Math.sin(T * A) + v * Math.cos(T * A));
|
|
2521
2523
|
};
|
|
2522
|
-
} else if (
|
|
2523
|
-
b = (T) => r - Math.exp(-y * T) * (v + (
|
|
2524
|
+
} else if (g === 1)
|
|
2525
|
+
b = (T) => r - Math.exp(-y * T) * (v + (p + y * v) * T);
|
|
2524
2526
|
else {
|
|
2525
|
-
const T = y * Math.sqrt(
|
|
2527
|
+
const T = y * Math.sqrt(g * g - 1);
|
|
2526
2528
|
b = (A) => {
|
|
2527
|
-
const D = Math.exp(-
|
|
2528
|
-
return r - D * ((
|
|
2529
|
+
const D = Math.exp(-g * y * A), S = Math.min(T * A, 300);
|
|
2530
|
+
return r - D * ((p + g * y * v) * Math.sinh(S) + T * v * Math.cosh(S)) / T;
|
|
2529
2531
|
};
|
|
2530
2532
|
}
|
|
2531
2533
|
const w = {
|
|
@@ -2536,36 +2538,36 @@ function jr(t = L.visualDuration, e = L.bounce) {
|
|
|
2536
2538
|
a.done = T >= h;
|
|
2537
2539
|
else {
|
|
2538
2540
|
let D = 0;
|
|
2539
|
-
|
|
2540
|
-
const S = Math.abs(D) <= i,
|
|
2541
|
-
a.done = S &&
|
|
2541
|
+
g < 1 && (D = T === 0 ? /* @__PURE__ */ Q(p) : kr(b, T, A));
|
|
2542
|
+
const S = Math.abs(D) <= i, j = Math.abs(r - A) <= s;
|
|
2543
|
+
a.done = S && j;
|
|
2542
2544
|
}
|
|
2543
2545
|
return a.value = a.done ? r : A, a;
|
|
2544
2546
|
},
|
|
2545
2547
|
toString: () => {
|
|
2546
|
-
const T = Math.min(
|
|
2548
|
+
const T = Math.min(Zs(w), en), A = Js((D) => w.next(T * D).value, T, 30);
|
|
2547
2549
|
return T + "ms " + A;
|
|
2548
2550
|
}
|
|
2549
2551
|
};
|
|
2550
2552
|
return w;
|
|
2551
2553
|
}
|
|
2552
|
-
function
|
|
2554
|
+
function Di({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 325, bounceDamping: s = 10, bounceStiffness: o = 500, modifyTarget: r, min: a, max: l, restDelta: c = 0.5, restSpeed: u }) {
|
|
2553
2555
|
const h = t[0], f = {
|
|
2554
2556
|
done: !1,
|
|
2555
2557
|
value: h
|
|
2556
|
-
}, d = (S) => a !== void 0 && S < a || l !== void 0 && S > l,
|
|
2557
|
-
let
|
|
2558
|
-
const v = h +
|
|
2559
|
-
y !== v && (
|
|
2560
|
-
const x = (S) => -
|
|
2561
|
-
const
|
|
2562
|
-
f.done = Math.abs(
|
|
2558
|
+
}, d = (S) => a !== void 0 && S < a || l !== void 0 && S > l, p = (S) => a === void 0 ? l : l === void 0 || Math.abs(a - S) < Math.abs(l - S) ? a : l;
|
|
2559
|
+
let g = n * e;
|
|
2560
|
+
const v = h + g, y = r === void 0 ? v : r(v);
|
|
2561
|
+
y !== v && (g = y - h);
|
|
2562
|
+
const x = (S) => -g * Math.exp(-S / i), b = (S) => y + x(S), w = (S) => {
|
|
2563
|
+
const j = x(S), $ = b(S);
|
|
2564
|
+
f.done = Math.abs(j) <= c, f.value = f.done ? y : $;
|
|
2563
2565
|
};
|
|
2564
2566
|
let T, A;
|
|
2565
2567
|
const D = (S) => {
|
|
2566
|
-
d(f.value) && (T = S, A =
|
|
2567
|
-
keyframes: [f.value,
|
|
2568
|
-
velocity:
|
|
2568
|
+
d(f.value) && (T = S, A = Lr({
|
|
2569
|
+
keyframes: [f.value, p(f.value)],
|
|
2570
|
+
velocity: kr(b, S, f.value),
|
|
2569
2571
|
// TODO: This should be passing * 1000
|
|
2570
2572
|
damping: s,
|
|
2571
2573
|
stiffness: o,
|
|
@@ -2576,39 +2578,39 @@ function Ri({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: i = 3
|
|
|
2576
2578
|
return D(0), {
|
|
2577
2579
|
calculatedDuration: null,
|
|
2578
2580
|
next: (S) => {
|
|
2579
|
-
let
|
|
2580
|
-
return !A && T === void 0 && (
|
|
2581
|
+
let j = !1;
|
|
2582
|
+
return !A && T === void 0 && (j = !0, w(S), D(S)), T !== void 0 && S >= T ? A.next(S - T) : (!j && w(S), f);
|
|
2581
2583
|
}
|
|
2582
2584
|
};
|
|
2583
2585
|
}
|
|
2584
|
-
const
|
|
2586
|
+
const _l = /* @__PURE__ */ ae(0.42, 0, 1, 1), Bl = /* @__PURE__ */ ae(0, 0, 0.58, 1), jr = /* @__PURE__ */ ae(0.42, 0, 0.58, 1), Nl = (t) => Array.isArray(t) && typeof t[0] != "number", Ri = {
|
|
2585
2587
|
linear: H,
|
|
2586
|
-
easeIn:
|
|
2587
|
-
easeInOut:
|
|
2588
|
-
easeOut:
|
|
2588
|
+
easeIn: _l,
|
|
2589
|
+
easeInOut: jr,
|
|
2590
|
+
easeOut: Bl,
|
|
2589
2591
|
circIn: Hn,
|
|
2590
|
-
circInOut:
|
|
2591
|
-
circOut:
|
|
2592
|
+
circInOut: mr,
|
|
2593
|
+
circOut: dr,
|
|
2592
2594
|
backIn: Kn,
|
|
2593
|
-
backInOut:
|
|
2594
|
-
backOut:
|
|
2595
|
-
anticipate:
|
|
2596
|
-
},
|
|
2597
|
-
if (
|
|
2598
|
-
|
|
2595
|
+
backInOut: hr,
|
|
2596
|
+
backOut: ur,
|
|
2597
|
+
anticipate: fr
|
|
2598
|
+
}, Mi = (t) => {
|
|
2599
|
+
if (In(t)) {
|
|
2600
|
+
ct(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
2599
2601
|
const [e, n, i, s] = t;
|
|
2600
|
-
return
|
|
2602
|
+
return ae(e, n, i, s);
|
|
2601
2603
|
} else if (typeof t == "string")
|
|
2602
|
-
return
|
|
2604
|
+
return ct(Ri[t] !== void 0, `Invalid easing type '${t}'`), Ri[t];
|
|
2603
2605
|
return t;
|
|
2604
2606
|
};
|
|
2605
|
-
function
|
|
2606
|
-
const i = [], s = n ||
|
|
2607
|
+
function Il(t, e, n) {
|
|
2608
|
+
const i = [], s = n || Mr, o = t.length - 1;
|
|
2607
2609
|
for (let r = 0; r < o; r++) {
|
|
2608
2610
|
let a = s(t[r], t[r + 1]);
|
|
2609
2611
|
if (e) {
|
|
2610
2612
|
const l = Array.isArray(e) ? e[r] || H : e;
|
|
2611
|
-
a =
|
|
2613
|
+
a = le(l, a);
|
|
2612
2614
|
}
|
|
2613
2615
|
i.push(a);
|
|
2614
2616
|
}
|
|
@@ -2616,29 +2618,29 @@ function _l(t, e, n) {
|
|
|
2616
2618
|
}
|
|
2617
2619
|
function Ul(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
2618
2620
|
const o = t.length;
|
|
2619
|
-
if (
|
|
2621
|
+
if (ct(o === e.length, "Both input and output ranges must be the same length"), o === 1)
|
|
2620
2622
|
return () => e[0];
|
|
2621
2623
|
if (o === 2 && e[0] === e[1])
|
|
2622
2624
|
return () => e[1];
|
|
2623
2625
|
const r = t[0] === t[1];
|
|
2624
2626
|
t[0] > t[o - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
2625
|
-
const a =
|
|
2627
|
+
const a = Il(e, i, s), l = a.length, c = (u) => {
|
|
2626
2628
|
if (r && u < t[0])
|
|
2627
2629
|
return e[0];
|
|
2628
2630
|
let h = 0;
|
|
2629
2631
|
if (l > 1)
|
|
2630
2632
|
for (; h < t.length - 2 && !(u < t[h + 1]); h++)
|
|
2631
2633
|
;
|
|
2632
|
-
const f = /* @__PURE__ */
|
|
2634
|
+
const f = /* @__PURE__ */ Ot(t[h], t[h + 1], u);
|
|
2633
2635
|
return a[h](f);
|
|
2634
2636
|
};
|
|
2635
|
-
return n ? (u) => c(
|
|
2637
|
+
return n ? (u) => c(rt(t[0], t[o - 1], u)) : c;
|
|
2636
2638
|
}
|
|
2637
2639
|
function $l(t, e) {
|
|
2638
2640
|
const n = t[t.length - 1];
|
|
2639
2641
|
for (let i = 1; i <= e; i++) {
|
|
2640
|
-
const s = /* @__PURE__ */
|
|
2641
|
-
t.push(
|
|
2642
|
+
const s = /* @__PURE__ */ Ot(0, e, i);
|
|
2643
|
+
t.push(L(n, 1, s));
|
|
2642
2644
|
}
|
|
2643
2645
|
}
|
|
2644
2646
|
function Wl(t) {
|
|
@@ -2649,10 +2651,10 @@ function Gl(t, e) {
|
|
|
2649
2651
|
return t.map((n) => n * e);
|
|
2650
2652
|
}
|
|
2651
2653
|
function Kl(t, e) {
|
|
2652
|
-
return t.map(() => e ||
|
|
2654
|
+
return t.map(() => e || jr).splice(0, t.length - 1);
|
|
2653
2655
|
}
|
|
2654
2656
|
function Ae({ duration: t = 300, keyframes: e, times: n, ease: i = "easeInOut" }) {
|
|
2655
|
-
const s = Nl(i) ? i.map(
|
|
2657
|
+
const s = Nl(i) ? i.map(Mi) : Mi(i), o = {
|
|
2656
2658
|
done: !1,
|
|
2657
2659
|
value: e[0]
|
|
2658
2660
|
}, r = Gl(
|
|
@@ -2672,21 +2674,21 @@ const Hl = (t) => {
|
|
|
2672
2674
|
const e = ({ timestamp: n }) => t(n);
|
|
2673
2675
|
return {
|
|
2674
2676
|
start: () => M.update(e, !0),
|
|
2675
|
-
stop: () =>
|
|
2677
|
+
stop: () => ut(e),
|
|
2676
2678
|
/**
|
|
2677
2679
|
* If we're processing this frame we can use the
|
|
2678
2680
|
* framelocked timestamp to keep things in sync.
|
|
2679
2681
|
*/
|
|
2680
|
-
now: () => I.isProcessing ? I.timestamp :
|
|
2682
|
+
now: () => I.isProcessing ? I.timestamp : et.now()
|
|
2681
2683
|
};
|
|
2682
2684
|
}, zl = {
|
|
2683
|
-
decay:
|
|
2684
|
-
inertia:
|
|
2685
|
+
decay: Di,
|
|
2686
|
+
inertia: Di,
|
|
2685
2687
|
tween: Ae,
|
|
2686
2688
|
keyframes: Ae,
|
|
2687
|
-
spring:
|
|
2689
|
+
spring: Lr
|
|
2688
2690
|
}, Yl = (t) => t / 100;
|
|
2689
|
-
class Jn extends
|
|
2691
|
+
class Jn extends Dr {
|
|
2690
2692
|
constructor(e) {
|
|
2691
2693
|
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
2692
2694
|
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
@@ -2704,13 +2706,13 @@ class Jn extends Rr {
|
|
|
2704
2706
|
initPlayback(e) {
|
|
2705
2707
|
const { type: n = "keyframes", repeat: i = 0, repeatDelay: s = 0, repeatType: o, velocity: r = 0 } = this.options, a = Nn(n) ? n : zl[n] || Ae;
|
|
2706
2708
|
let l, c;
|
|
2707
|
-
a !== Ae && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" &&
|
|
2709
|
+
a !== Ae && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && ct(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = le(Yl, Mr(e[0], e[1])), e = [0, 100]);
|
|
2708
2710
|
const u = a({ ...this.options, keyframes: e });
|
|
2709
2711
|
o === "mirror" && (c = a({
|
|
2710
2712
|
...this.options,
|
|
2711
2713
|
keyframes: [...e].reverse(),
|
|
2712
2714
|
velocity: -r
|
|
2713
|
-
})), u.calculatedDuration === null && (u.calculatedDuration =
|
|
2715
|
+
})), u.calculatedDuration === null && (u.calculatedDuration = Zs(u));
|
|
2714
2716
|
const { calculatedDuration: h } = u, f = h + s, d = f * (i + 1) - s;
|
|
2715
2717
|
return {
|
|
2716
2718
|
generator: u,
|
|
@@ -2734,39 +2736,39 @@ class Jn extends Rr {
|
|
|
2734
2736
|
const { finalKeyframe: s, generator: o, mirroredGenerator: r, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: c, totalDuration: u, resolvedDuration: h } = i;
|
|
2735
2737
|
if (this.startTime === null)
|
|
2736
2738
|
return o.next(0);
|
|
2737
|
-
const { delay: f, repeat: d, repeatType:
|
|
2739
|
+
const { delay: f, repeat: d, repeatType: p, repeatDelay: g, onUpdate: v } = this.options;
|
|
2738
2740
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - u / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
2739
2741
|
const y = this.currentTime - f * (this.speed >= 0 ? 1 : -1), x = this.speed >= 0 ? y < 0 : y > u;
|
|
2740
2742
|
this.currentTime = Math.max(y, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = u);
|
|
2741
2743
|
let b = this.currentTime, w = o;
|
|
2742
2744
|
if (d) {
|
|
2743
2745
|
const S = Math.min(this.currentTime, u) / h;
|
|
2744
|
-
let
|
|
2745
|
-
|
|
2746
|
+
let j = Math.floor(S), $ = S % 1;
|
|
2747
|
+
!$ && S >= 1 && ($ = 1), $ === 1 && j--, j = Math.min(j, d + 1), !!(j % 2) && (p === "reverse" ? ($ = 1 - $, g && ($ -= g / h)) : p === "mirror" && (w = r)), b = rt(0, 1, $) * h;
|
|
2746
2748
|
}
|
|
2747
2749
|
const T = x ? { done: !1, value: l[0] } : w.next(b);
|
|
2748
2750
|
a && (T.value = a(T.value));
|
|
2749
2751
|
let { done: A } = T;
|
|
2750
2752
|
!x && c !== null && (A = this.speed >= 0 ? this.currentTime >= u : this.currentTime <= 0);
|
|
2751
2753
|
const D = this.holdTime === null && (this.state === "finished" || this.state === "running" && A);
|
|
2752
|
-
return D && s !== void 0 && (T.value =
|
|
2754
|
+
return D && s !== void 0 && (T.value = _e(l, this.options, s)), v && v(T.value), D && this.finish(), T;
|
|
2753
2755
|
}
|
|
2754
2756
|
get duration() {
|
|
2755
2757
|
const { resolved: e } = this;
|
|
2756
|
-
return e ? /* @__PURE__ */
|
|
2758
|
+
return e ? /* @__PURE__ */ st(e.calculatedDuration) : 0;
|
|
2757
2759
|
}
|
|
2758
2760
|
get time() {
|
|
2759
|
-
return /* @__PURE__ */
|
|
2761
|
+
return /* @__PURE__ */ st(this.currentTime);
|
|
2760
2762
|
}
|
|
2761
2763
|
set time(e) {
|
|
2762
|
-
e = /* @__PURE__ */
|
|
2764
|
+
e = /* @__PURE__ */ Q(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
2763
2765
|
}
|
|
2764
2766
|
get speed() {
|
|
2765
2767
|
return this.playbackSpeed;
|
|
2766
2768
|
}
|
|
2767
2769
|
set speed(e) {
|
|
2768
2770
|
const n = this.playbackSpeed !== e;
|
|
2769
|
-
this.playbackSpeed = e, n && (this.time = /* @__PURE__ */
|
|
2771
|
+
this.playbackSpeed = e, n && (this.time = /* @__PURE__ */ st(this.currentTime));
|
|
2770
2772
|
}
|
|
2771
2773
|
play() {
|
|
2772
2774
|
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
@@ -2821,7 +2823,7 @@ const Xl = /* @__PURE__ */ new Set([
|
|
|
2821
2823
|
function ql(t, e, n, { delay: i = 0, duration: s = 300, repeat: o = 0, repeatType: r = "loop", ease: a = "easeInOut", times: l } = {}) {
|
|
2822
2824
|
const c = { [e]: n };
|
|
2823
2825
|
l && (c.offset = l);
|
|
2824
|
-
const u =
|
|
2826
|
+
const u = tr(a, s);
|
|
2825
2827
|
return Array.isArray(u) && (c.easing = u), t.animate(c, {
|
|
2826
2828
|
delay: i,
|
|
2827
2829
|
duration: s,
|
|
@@ -2833,7 +2835,7 @@ function ql(t, e, n, { delay: i = 0, duration: s = 300, repeat: o = 0, repeatTyp
|
|
|
2833
2835
|
}
|
|
2834
2836
|
const Zl = /* @__PURE__ */ Sn(() => Object.hasOwnProperty.call(Element.prototype, "animate")), Ve = 10, Jl = 2e4;
|
|
2835
2837
|
function Ql(t) {
|
|
2836
|
-
return Nn(t.type) || t.type === "spring" || !
|
|
2838
|
+
return Nn(t.type) || t.type === "spring" || !Qs(t.ease);
|
|
2837
2839
|
}
|
|
2838
2840
|
function tc(t, e) {
|
|
2839
2841
|
const n = new Jn({
|
|
@@ -2855,32 +2857,32 @@ function tc(t, e) {
|
|
|
2855
2857
|
ease: "linear"
|
|
2856
2858
|
};
|
|
2857
2859
|
}
|
|
2858
|
-
const
|
|
2859
|
-
anticipate:
|
|
2860
|
-
backInOut:
|
|
2861
|
-
circInOut:
|
|
2860
|
+
const Or = {
|
|
2861
|
+
anticipate: fr,
|
|
2862
|
+
backInOut: hr,
|
|
2863
|
+
circInOut: mr
|
|
2862
2864
|
};
|
|
2863
2865
|
function ec(t) {
|
|
2864
|
-
return t in
|
|
2866
|
+
return t in Or;
|
|
2865
2867
|
}
|
|
2866
|
-
class
|
|
2868
|
+
class ki extends Dr {
|
|
2867
2869
|
constructor(e) {
|
|
2868
2870
|
super(e);
|
|
2869
2871
|
const { name: n, motionValue: i, element: s, keyframes: o } = this.options;
|
|
2870
|
-
this.resolver = new
|
|
2872
|
+
this.resolver = new Cr(o, (r, a) => this.onKeyframesResolved(r, a), n, i, s), this.resolver.scheduleResolve();
|
|
2871
2873
|
}
|
|
2872
2874
|
initPlayback(e, n) {
|
|
2873
2875
|
let { duration: i = 300, times: s, ease: o, type: r, motionValue: a, name: l, startTime: c } = this.options;
|
|
2874
2876
|
if (!a.owner || !a.owner.current)
|
|
2875
2877
|
return !1;
|
|
2876
|
-
if (typeof o == "string" && we() && ec(o) && (o =
|
|
2877
|
-
const { onComplete: h, onUpdate: f, motionValue: d, element:
|
|
2878
|
+
if (typeof o == "string" && we() && ec(o) && (o = Or[o]), Ql(this.options)) {
|
|
2879
|
+
const { onComplete: h, onUpdate: f, motionValue: d, element: p, ...g } = this.options, v = tc(e, g);
|
|
2878
2880
|
e = v.keyframes, e.length === 1 && (e[1] = e[0]), i = v.duration, s = v.times, o = v.ease, r = "keyframes";
|
|
2879
2881
|
}
|
|
2880
2882
|
const u = ql(a.owner.current, l, e, { ...this.options, duration: i, times: s, ease: o });
|
|
2881
2883
|
return u.startTime = c ?? this.calcStartTime(), this.pendingTimeline ? (pi(u, this.pendingTimeline), this.pendingTimeline = void 0) : u.onfinish = () => {
|
|
2882
2884
|
const { onComplete: h } = this.options;
|
|
2883
|
-
a.set(
|
|
2885
|
+
a.set(_e(e, this.options, n)), h && h(), this.cancel(), this.resolveFinishedPromise();
|
|
2884
2886
|
}, {
|
|
2885
2887
|
animation: u,
|
|
2886
2888
|
duration: i,
|
|
@@ -2895,21 +2897,21 @@ class Li extends Rr {
|
|
|
2895
2897
|
if (!e)
|
|
2896
2898
|
return 0;
|
|
2897
2899
|
const { duration: n } = e;
|
|
2898
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ st(n);
|
|
2899
2901
|
}
|
|
2900
2902
|
get time() {
|
|
2901
2903
|
const { resolved: e } = this;
|
|
2902
2904
|
if (!e)
|
|
2903
2905
|
return 0;
|
|
2904
2906
|
const { animation: n } = e;
|
|
2905
|
-
return /* @__PURE__ */
|
|
2907
|
+
return /* @__PURE__ */ st(n.currentTime || 0);
|
|
2906
2908
|
}
|
|
2907
2909
|
set time(e) {
|
|
2908
2910
|
const { resolved: n } = this;
|
|
2909
2911
|
if (!n)
|
|
2910
2912
|
return;
|
|
2911
2913
|
const { animation: i } = n;
|
|
2912
|
-
i.currentTime = /* @__PURE__ */
|
|
2914
|
+
i.currentTime = /* @__PURE__ */ Q(e);
|
|
2913
2915
|
}
|
|
2914
2916
|
get speed() {
|
|
2915
2917
|
const { resolved: e } = this;
|
|
@@ -2982,7 +2984,7 @@ class Li extends Rr {
|
|
|
2982
2984
|
if (n.playState === "idle" || n.playState === "finished")
|
|
2983
2985
|
return;
|
|
2984
2986
|
if (this.time) {
|
|
2985
|
-
const { motionValue: c, onUpdate: u, onComplete: h, element: f, ...d } = this.options,
|
|
2987
|
+
const { motionValue: c, onUpdate: u, onComplete: h, element: f, ...d } = this.options, p = new Jn({
|
|
2986
2988
|
...d,
|
|
2987
2989
|
keyframes: i,
|
|
2988
2990
|
duration: s,
|
|
@@ -2990,8 +2992,8 @@ class Li extends Rr {
|
|
|
2990
2992
|
ease: r,
|
|
2991
2993
|
times: a,
|
|
2992
2994
|
isGenerator: !0
|
|
2993
|
-
}),
|
|
2994
|
-
c.setWithVelocity(
|
|
2995
|
+
}), g = /* @__PURE__ */ Q(this.time);
|
|
2996
|
+
c.setWithVelocity(p.sample(g - Ve).value, p.sample(g).value, Ve);
|
|
2995
2997
|
}
|
|
2996
2998
|
const { onStop: l } = this.options;
|
|
2997
2999
|
l && l(), this.cancel();
|
|
@@ -3033,14 +3035,14 @@ const nc = {
|
|
|
3033
3035
|
type: "keyframes",
|
|
3034
3036
|
ease: [0.25, 0.1, 0.35, 1],
|
|
3035
3037
|
duration: 0.3
|
|
3036
|
-
}, oc = (t, { keyframes: e }) => e.length > 2 ? sc :
|
|
3038
|
+
}, oc = (t, { keyframes: e }) => e.length > 2 ? sc : bt.has(t) ? t.startsWith("scale") ? ic(e[1]) : nc : rc;
|
|
3037
3039
|
function ac({ when: t, delay: e, delayChildren: n, staggerChildren: i, staggerDirection: s, repeat: o, repeatType: r, repeatDelay: a, from: l, elapsed: c, ...u }) {
|
|
3038
3040
|
return !!Object.keys(u).length;
|
|
3039
3041
|
}
|
|
3040
3042
|
const Qn = (t, e, n, i = {}, s, o) => (r) => {
|
|
3041
|
-
const a =
|
|
3043
|
+
const a = Bn(i, t) || {}, l = a.delay || i.delay || 0;
|
|
3042
3044
|
let { elapsed: c = 0 } = i;
|
|
3043
|
-
c = c - /* @__PURE__ */
|
|
3045
|
+
c = c - /* @__PURE__ */ Q(l);
|
|
3044
3046
|
let u = {
|
|
3045
3047
|
keyframes: Array.isArray(n) ? n : [null, n],
|
|
3046
3048
|
ease: "easeOut",
|
|
@@ -3060,22 +3062,22 @@ const Qn = (t, e, n, i = {}, s, o) => (r) => {
|
|
|
3060
3062
|
ac(a) || (u = {
|
|
3061
3063
|
...u,
|
|
3062
3064
|
...oc(t, u)
|
|
3063
|
-
}), u.duration && (u.duration = /* @__PURE__ */
|
|
3065
|
+
}), u.duration && (u.duration = /* @__PURE__ */ Q(u.duration)), u.repeatDelay && (u.repeatDelay = /* @__PURE__ */ Q(u.repeatDelay)), u.from !== void 0 && (u.keyframes[0] = u.from);
|
|
3064
3066
|
let h = !1;
|
|
3065
3067
|
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (u.duration = 0, u.delay === 0 && (h = !0)), h && !o && e.get() !== void 0) {
|
|
3066
|
-
const f =
|
|
3068
|
+
const f = _e(u.keyframes, a);
|
|
3067
3069
|
if (f !== void 0)
|
|
3068
3070
|
return M.update(() => {
|
|
3069
3071
|
u.onUpdate(f), u.onComplete();
|
|
3070
3072
|
}), new Va([]);
|
|
3071
3073
|
}
|
|
3072
|
-
return !o &&
|
|
3074
|
+
return !o && ki.supports(u) ? new ki(u) : new Jn(u);
|
|
3073
3075
|
};
|
|
3074
3076
|
function lc({ protectedKeys: t, needsAnimating: e }, n) {
|
|
3075
3077
|
const i = t.hasOwnProperty(n) && e[n] !== !0;
|
|
3076
3078
|
return e[n] = !1, i;
|
|
3077
3079
|
}
|
|
3078
|
-
function
|
|
3080
|
+
function Fr(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
3079
3081
|
var o;
|
|
3080
3082
|
let { transition: r = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
3081
3083
|
i && (r = i);
|
|
@@ -3084,25 +3086,25 @@ function Br(t, e, { delay: n = 0, transitionOverride: i, type: s } = {}) {
|
|
|
3084
3086
|
const f = t.getValue(h, (o = t.latestValues[h]) !== null && o !== void 0 ? o : null), d = l[h];
|
|
3085
3087
|
if (d === void 0 || u && lc(u, h))
|
|
3086
3088
|
continue;
|
|
3087
|
-
const
|
|
3089
|
+
const p = {
|
|
3088
3090
|
delay: n,
|
|
3089
|
-
...
|
|
3091
|
+
...Bn(r || {}, h)
|
|
3090
3092
|
};
|
|
3091
|
-
let
|
|
3093
|
+
let g = !1;
|
|
3092
3094
|
if (window.MotionHandoffAnimation) {
|
|
3093
|
-
const y =
|
|
3095
|
+
const y = or(t);
|
|
3094
3096
|
if (y) {
|
|
3095
3097
|
const x = window.MotionHandoffAnimation(y, h, M);
|
|
3096
|
-
x !== null && (
|
|
3098
|
+
x !== null && (p.startTime = x, g = !0);
|
|
3097
3099
|
}
|
|
3098
3100
|
}
|
|
3099
|
-
sn(t, h), f.start(Qn(h, f, d, t.shouldReduceMotion &&
|
|
3101
|
+
sn(t, h), f.start(Qn(h, f, d, t.shouldReduceMotion && sr.has(h) ? { type: !1 } : p, t, g));
|
|
3100
3102
|
const v = f.animation;
|
|
3101
3103
|
v && c.push(v);
|
|
3102
3104
|
}
|
|
3103
3105
|
return a && Promise.all(c).then(() => {
|
|
3104
3106
|
M.update(() => {
|
|
3105
|
-
a &&
|
|
3107
|
+
a && Ia(t, a);
|
|
3106
3108
|
});
|
|
3107
3109
|
}), c;
|
|
3108
3110
|
}
|
|
@@ -3111,7 +3113,7 @@ function hn(t, e, n = {}) {
|
|
|
3111
3113
|
const s = Fe(t, e, n.type === "exit" ? (i = t.presenceContext) === null || i === void 0 ? void 0 : i.custom : void 0);
|
|
3112
3114
|
let { transition: o = t.getDefaultTransition() || {} } = s || {};
|
|
3113
3115
|
n.transitionOverride && (o = n.transitionOverride);
|
|
3114
|
-
const r = s ? () => Promise.all(
|
|
3116
|
+
const r = s ? () => Promise.all(Fr(t, s, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (c = 0) => {
|
|
3115
3117
|
const { delayChildren: u = 0, staggerChildren: h, staggerDirection: f } = o;
|
|
3116
3118
|
return cc(t, e, u + c, h, f, n);
|
|
3117
3119
|
} : () => Promise.resolve(), { when: l } = o;
|
|
@@ -3143,18 +3145,18 @@ function hc(t, e, n = {}) {
|
|
|
3143
3145
|
i = hn(t, e, n);
|
|
3144
3146
|
else {
|
|
3145
3147
|
const s = typeof e == "function" ? Fe(t, e, n.custom) : e;
|
|
3146
|
-
i = Promise.all(
|
|
3148
|
+
i = Promise.all(Fr(t, s, n));
|
|
3147
3149
|
}
|
|
3148
3150
|
return i.then(() => {
|
|
3149
3151
|
t.notify("AnimationComplete", e);
|
|
3150
3152
|
});
|
|
3151
3153
|
}
|
|
3152
3154
|
const fc = Vn.length;
|
|
3153
|
-
function
|
|
3155
|
+
function _r(t) {
|
|
3154
3156
|
if (!t)
|
|
3155
3157
|
return;
|
|
3156
3158
|
if (!t.isControllingVariants) {
|
|
3157
|
-
const n = t.parent ?
|
|
3159
|
+
const n = t.parent ? _r(t.parent) || {} : {};
|
|
3158
3160
|
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
3159
3161
|
}
|
|
3160
3162
|
const e = {};
|
|
@@ -3169,13 +3171,13 @@ function pc(t) {
|
|
|
3169
3171
|
return (e) => Promise.all(e.map(({ animation: n, options: i }) => hc(t, n, i)));
|
|
3170
3172
|
}
|
|
3171
3173
|
function gc(t) {
|
|
3172
|
-
let e = pc(t), n =
|
|
3174
|
+
let e = pc(t), n = Li(), i = !0;
|
|
3173
3175
|
const s = (l) => (c, u) => {
|
|
3174
3176
|
var h;
|
|
3175
3177
|
const f = Fe(t, u, l === "exit" ? (h = t.presenceContext) === null || h === void 0 ? void 0 : h.custom : void 0);
|
|
3176
3178
|
if (f) {
|
|
3177
|
-
const { transition: d, transitionEnd:
|
|
3178
|
-
c = { ...c, ...
|
|
3179
|
+
const { transition: d, transitionEnd: p, ...g } = f;
|
|
3180
|
+
c = { ...c, ...g, ...p };
|
|
3179
3181
|
}
|
|
3180
3182
|
return c;
|
|
3181
3183
|
};
|
|
@@ -3183,11 +3185,11 @@ function gc(t) {
|
|
|
3183
3185
|
e = l(t);
|
|
3184
3186
|
}
|
|
3185
3187
|
function r(l) {
|
|
3186
|
-
const { props: c } = t, u =
|
|
3187
|
-
let d = {},
|
|
3188
|
+
const { props: c } = t, u = _r(t.parent) || {}, h = [], f = /* @__PURE__ */ new Set();
|
|
3189
|
+
let d = {}, p = 1 / 0;
|
|
3188
3190
|
for (let v = 0; v < mc; v++) {
|
|
3189
3191
|
const y = dc[v], x = n[y], b = c[y] !== void 0 ? c[y] : u[y], w = Qt(b), T = y === l ? x.isActive : null;
|
|
3190
|
-
T === !1 && (
|
|
3192
|
+
T === !1 && (p = v);
|
|
3191
3193
|
let A = b === u[y] && b !== c[y] && w;
|
|
3192
3194
|
if (A && i && t.manuallyAnimateOnMount && (A = !1), x.protectedKeys = { ...d }, // If it isn't active and hasn't *just* been set as inactive
|
|
3193
3195
|
!x.isActive && T === null || // If we didn't and don't have any defined prop for this animation type
|
|
@@ -3197,26 +3199,26 @@ function gc(t) {
|
|
|
3197
3199
|
const D = yc(x.prevProp, b);
|
|
3198
3200
|
let S = D || // If we're making this variant active, we want to always make it active
|
|
3199
3201
|
y === l && x.isActive && !A && w || // If we removed a higher-priority variant (i is in reverse order)
|
|
3200
|
-
v >
|
|
3201
|
-
const
|
|
3202
|
-
let
|
|
3203
|
-
T === !1 && (
|
|
3204
|
-
const { prevResolvedValues:
|
|
3205
|
-
...
|
|
3206
|
-
...
|
|
3207
|
-
},
|
|
3208
|
-
S = !0, f.has(C) && (
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3202
|
+
v > p && w, j = !1;
|
|
3203
|
+
const $ = Array.isArray(b) ? b : [b];
|
|
3204
|
+
let J = $.reduce(s(y), {});
|
|
3205
|
+
T === !1 && (J = {});
|
|
3206
|
+
const { prevResolvedValues: ot = {} } = x, Pt = {
|
|
3207
|
+
...ot,
|
|
3208
|
+
...J
|
|
3209
|
+
}, wt = (C) => {
|
|
3210
|
+
S = !0, f.has(C) && (j = !0, f.delete(C)), x.needsAnimating[C] = !0;
|
|
3211
|
+
const N = t.getValue(C);
|
|
3212
|
+
N && (N.liveStyle = !1);
|
|
3211
3213
|
};
|
|
3212
|
-
for (const C in
|
|
3213
|
-
const
|
|
3214
|
+
for (const C in Pt) {
|
|
3215
|
+
const N = J[C], At = ot[C];
|
|
3214
3216
|
if (d.hasOwnProperty(C))
|
|
3215
3217
|
continue;
|
|
3216
|
-
let
|
|
3217
|
-
tn(
|
|
3218
|
+
let Vt = !1;
|
|
3219
|
+
tn(N) && tn(At) ? Vt = !qs(N, At) : Vt = N !== At, Vt ? N != null ? wt(C) : f.add(C) : N !== void 0 && f.has(C) ? wt(C) : x.protectedKeys[C] = !0;
|
|
3218
3220
|
}
|
|
3219
|
-
x.prevProp = b, x.prevResolvedValues =
|
|
3221
|
+
x.prevProp = b, x.prevResolvedValues = J, x.isActive && (d = { ...d, ...J }), i && t.blockInitialAnimation && (S = !1), S && (!(A && D) || j) && h.push(...$.map((C) => ({
|
|
3220
3222
|
animation: C,
|
|
3221
3223
|
options: { type: y }
|
|
3222
3224
|
})));
|
|
@@ -3228,8 +3230,8 @@ function gc(t) {
|
|
|
3228
3230
|
b && (b.liveStyle = !0), v[y] = x ?? null;
|
|
3229
3231
|
}), h.push({ animation: v });
|
|
3230
3232
|
}
|
|
3231
|
-
let
|
|
3232
|
-
return i && (c.initial === !1 || c.initial === c.animate) && !t.manuallyAnimateOnMount && (
|
|
3233
|
+
let g = !!h.length;
|
|
3234
|
+
return i && (c.initial === !1 || c.initial === c.animate) && !t.manuallyAnimateOnMount && (g = !1), i = !1, g ? e(h) : Promise.resolve();
|
|
3233
3235
|
}
|
|
3234
3236
|
function a(l, c) {
|
|
3235
3237
|
var u;
|
|
@@ -3250,14 +3252,14 @@ function gc(t) {
|
|
|
3250
3252
|
setAnimateFunction: o,
|
|
3251
3253
|
getState: () => n,
|
|
3252
3254
|
reset: () => {
|
|
3253
|
-
n =
|
|
3255
|
+
n = Li(), i = !0;
|
|
3254
3256
|
}
|
|
3255
3257
|
};
|
|
3256
3258
|
}
|
|
3257
3259
|
function yc(t, e) {
|
|
3258
|
-
return typeof e == "string" ? e !== t : Array.isArray(e) ? !
|
|
3260
|
+
return typeof e == "string" ? e !== t : Array.isArray(e) ? !qs(e, t) : !1;
|
|
3259
3261
|
}
|
|
3260
|
-
function
|
|
3262
|
+
function dt(t = !1) {
|
|
3261
3263
|
return {
|
|
3262
3264
|
isActive: t,
|
|
3263
3265
|
protectedKeys: {},
|
|
@@ -3265,25 +3267,25 @@ function gt(t = !1) {
|
|
|
3265
3267
|
prevResolvedValues: {}
|
|
3266
3268
|
};
|
|
3267
3269
|
}
|
|
3268
|
-
function
|
|
3270
|
+
function Li() {
|
|
3269
3271
|
return {
|
|
3270
|
-
animate:
|
|
3271
|
-
whileInView:
|
|
3272
|
-
whileHover:
|
|
3273
|
-
whileTap:
|
|
3274
|
-
whileDrag:
|
|
3275
|
-
whileFocus:
|
|
3276
|
-
exit:
|
|
3272
|
+
animate: dt(!0),
|
|
3273
|
+
whileInView: dt(),
|
|
3274
|
+
whileHover: dt(),
|
|
3275
|
+
whileTap: dt(),
|
|
3276
|
+
whileDrag: dt(),
|
|
3277
|
+
whileFocus: dt(),
|
|
3278
|
+
exit: dt()
|
|
3277
3279
|
};
|
|
3278
3280
|
}
|
|
3279
|
-
class
|
|
3281
|
+
class ft {
|
|
3280
3282
|
constructor(e) {
|
|
3281
3283
|
this.isMounted = !1, this.node = e;
|
|
3282
3284
|
}
|
|
3283
3285
|
update() {
|
|
3284
3286
|
}
|
|
3285
3287
|
}
|
|
3286
|
-
class vc extends
|
|
3288
|
+
class vc extends ft {
|
|
3287
3289
|
/**
|
|
3288
3290
|
* We dynamically generate the AnimationState manager as it contains a reference
|
|
3289
3291
|
* to the underlying animation library. We only want to load that if we load this,
|
|
@@ -3312,7 +3314,7 @@ class vc extends mt {
|
|
|
3312
3314
|
}
|
|
3313
3315
|
}
|
|
3314
3316
|
let xc = 0;
|
|
3315
|
-
class Tc extends
|
|
3317
|
+
class Tc extends ft {
|
|
3316
3318
|
constructor() {
|
|
3317
3319
|
super(...arguments), this.id = xc++;
|
|
3318
3320
|
}
|
|
@@ -3343,7 +3345,7 @@ const bc = {
|
|
|
3343
3345
|
function ie(t, e, n, i = { passive: !0 }) {
|
|
3344
3346
|
return t.addEventListener(e, n, i), () => t.removeEventListener(e, n);
|
|
3345
3347
|
}
|
|
3346
|
-
function
|
|
3348
|
+
function ce(t) {
|
|
3347
3349
|
return {
|
|
3348
3350
|
point: {
|
|
3349
3351
|
x: t.pageX,
|
|
@@ -3351,16 +3353,16 @@ function ue(t) {
|
|
|
3351
3353
|
}
|
|
3352
3354
|
};
|
|
3353
3355
|
}
|
|
3354
|
-
const Pc = (t) => (e) => Un(e) && t(e,
|
|
3356
|
+
const Pc = (t) => (e) => Un(e) && t(e, ce(e));
|
|
3355
3357
|
function Xt(t, e, n, i) {
|
|
3356
3358
|
return ie(t, e, Pc(n), i);
|
|
3357
3359
|
}
|
|
3358
|
-
const
|
|
3360
|
+
const ji = (t, e) => Math.abs(t - e);
|
|
3359
3361
|
function wc(t, e) {
|
|
3360
|
-
const n =
|
|
3362
|
+
const n = ji(t.x, e.x), i = ji(t.y, e.y);
|
|
3361
3363
|
return Math.sqrt(n ** 2 + i ** 2);
|
|
3362
3364
|
}
|
|
3363
|
-
class
|
|
3365
|
+
class Br {
|
|
3364
3366
|
constructor(e, n, { transformPagePoint: i, contextWindow: s, dragSnapToOrigin: o = !1 } = {}) {
|
|
3365
3367
|
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
|
|
3366
3368
|
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
@@ -3368,64 +3370,64 @@ class Nr {
|
|
|
3368
3370
|
const h = ze(this.lastMoveEventInfo, this.history), f = this.startEvent !== null, d = wc(h.offset, { x: 0, y: 0 }) >= 3;
|
|
3369
3371
|
if (!f && !d)
|
|
3370
3372
|
return;
|
|
3371
|
-
const { point:
|
|
3372
|
-
this.history.push({ ...
|
|
3373
|
+
const { point: p } = h, { timestamp: g } = I;
|
|
3374
|
+
this.history.push({ ...p, timestamp: g });
|
|
3373
3375
|
const { onStart: v, onMove: y } = this.handlers;
|
|
3374
3376
|
f || (v && v(this.lastMoveEvent, h), this.startEvent = this.lastMoveEvent), y && y(this.lastMoveEvent, h);
|
|
3375
3377
|
}, this.handlePointerMove = (h, f) => {
|
|
3376
3378
|
this.lastMoveEvent = h, this.lastMoveEventInfo = He(f, this.transformPagePoint), M.update(this.updatePoint, !0);
|
|
3377
3379
|
}, this.handlePointerUp = (h, f) => {
|
|
3378
3380
|
this.end();
|
|
3379
|
-
const { onEnd: d, onSessionEnd:
|
|
3380
|
-
if (this.dragSnapToOrigin &&
|
|
3381
|
+
const { onEnd: d, onSessionEnd: p, resumeAnimation: g } = this.handlers;
|
|
3382
|
+
if (this.dragSnapToOrigin && g && g(), !(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
3381
3383
|
return;
|
|
3382
3384
|
const v = ze(h.type === "pointercancel" ? this.lastMoveEventInfo : He(f, this.transformPagePoint), this.history);
|
|
3383
|
-
this.startEvent && d && d(h, v),
|
|
3385
|
+
this.startEvent && d && d(h, v), p && p(h, v);
|
|
3384
3386
|
}, !Un(e))
|
|
3385
3387
|
return;
|
|
3386
3388
|
this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = i, this.contextWindow = s || window;
|
|
3387
|
-
const r =
|
|
3389
|
+
const r = ce(e), a = He(r, this.transformPagePoint), { point: l } = a, { timestamp: c } = I;
|
|
3388
3390
|
this.history = [{ ...l, timestamp: c }];
|
|
3389
3391
|
const { onSessionStart: u } = n;
|
|
3390
|
-
u && u(e, ze(a, this.history)), this.removeListeners =
|
|
3392
|
+
u && u(e, ze(a, this.history)), this.removeListeners = le(Xt(this.contextWindow, "pointermove", this.handlePointerMove), Xt(this.contextWindow, "pointerup", this.handlePointerUp), Xt(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
3391
3393
|
}
|
|
3392
3394
|
updateHandlers(e) {
|
|
3393
3395
|
this.handlers = e;
|
|
3394
3396
|
}
|
|
3395
3397
|
end() {
|
|
3396
|
-
this.removeListeners && this.removeListeners(),
|
|
3398
|
+
this.removeListeners && this.removeListeners(), ut(this.updatePoint);
|
|
3397
3399
|
}
|
|
3398
3400
|
}
|
|
3399
3401
|
function He(t, e) {
|
|
3400
3402
|
return e ? { point: e(t.point) } : t;
|
|
3401
3403
|
}
|
|
3402
|
-
function
|
|
3404
|
+
function Oi(t, e) {
|
|
3403
3405
|
return { x: t.x - e.x, y: t.y - e.y };
|
|
3404
3406
|
}
|
|
3405
3407
|
function ze({ point: t }, e) {
|
|
3406
3408
|
return {
|
|
3407
3409
|
point: t,
|
|
3408
|
-
delta:
|
|
3409
|
-
offset:
|
|
3410
|
+
delta: Oi(t, Nr(e)),
|
|
3411
|
+
offset: Oi(t, Sc(e)),
|
|
3410
3412
|
velocity: Ac(e, 0.1)
|
|
3411
3413
|
};
|
|
3412
3414
|
}
|
|
3413
3415
|
function Sc(t) {
|
|
3414
3416
|
return t[0];
|
|
3415
3417
|
}
|
|
3416
|
-
function
|
|
3418
|
+
function Nr(t) {
|
|
3417
3419
|
return t[t.length - 1];
|
|
3418
3420
|
}
|
|
3419
3421
|
function Ac(t, e) {
|
|
3420
3422
|
if (t.length < 2)
|
|
3421
3423
|
return { x: 0, y: 0 };
|
|
3422
3424
|
let n = t.length - 1, i = null;
|
|
3423
|
-
const s =
|
|
3424
|
-
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp > /* @__PURE__ */
|
|
3425
|
+
const s = Nr(t);
|
|
3426
|
+
for (; n >= 0 && (i = t[n], !(s.timestamp - i.timestamp > /* @__PURE__ */ Q(e))); )
|
|
3425
3427
|
n--;
|
|
3426
3428
|
if (!i)
|
|
3427
3429
|
return { x: 0, y: 0 };
|
|
3428
|
-
const o = /* @__PURE__ */
|
|
3430
|
+
const o = /* @__PURE__ */ st(s.timestamp - i.timestamp);
|
|
3429
3431
|
if (o === 0)
|
|
3430
3432
|
return { x: 0, y: 0 };
|
|
3431
3433
|
const r = {
|
|
@@ -3434,35 +3436,35 @@ function Ac(t, e) {
|
|
|
3434
3436
|
};
|
|
3435
3437
|
return r.x === 1 / 0 && (r.x = 0), r.y === 1 / 0 && (r.y = 0), r;
|
|
3436
3438
|
}
|
|
3437
|
-
const
|
|
3439
|
+
const Ir = 1e-4, Vc = 1 - Ir, Ec = 1 + Ir, Ur = 0.01, Cc = 0 - Ur, Dc = 0 + Ur;
|
|
3438
3440
|
function Y(t) {
|
|
3439
3441
|
return t.max - t.min;
|
|
3440
3442
|
}
|
|
3441
3443
|
function Rc(t, e, n) {
|
|
3442
3444
|
return Math.abs(t - e) <= n;
|
|
3443
3445
|
}
|
|
3444
|
-
function
|
|
3445
|
-
t.origin = i, t.originPoint =
|
|
3446
|
+
function Fi(t, e, n, i = 0.5) {
|
|
3447
|
+
t.origin = i, t.originPoint = L(e.min, e.max, t.origin), t.scale = Y(n) / Y(e), t.translate = L(n.min, n.max, t.origin) - t.originPoint, (t.scale >= Vc && t.scale <= Ec || isNaN(t.scale)) && (t.scale = 1), (t.translate >= Cc && t.translate <= Dc || isNaN(t.translate)) && (t.translate = 0);
|
|
3446
3448
|
}
|
|
3447
3449
|
function qt(t, e, n, i) {
|
|
3448
|
-
|
|
3450
|
+
Fi(t.x, e.x, n.x, i ? i.originX : void 0), Fi(t.y, e.y, n.y, i ? i.originY : void 0);
|
|
3449
3451
|
}
|
|
3450
|
-
function
|
|
3452
|
+
function _i(t, e, n) {
|
|
3451
3453
|
t.min = n.min + e.min, t.max = t.min + Y(e);
|
|
3452
3454
|
}
|
|
3453
3455
|
function Mc(t, e, n) {
|
|
3454
|
-
|
|
3456
|
+
_i(t.x, e.x, n.x), _i(t.y, e.y, n.y);
|
|
3455
3457
|
}
|
|
3456
|
-
function
|
|
3458
|
+
function Bi(t, e, n) {
|
|
3457
3459
|
t.min = e.min - n.min, t.max = t.min + Y(e);
|
|
3458
3460
|
}
|
|
3459
3461
|
function Zt(t, e, n) {
|
|
3460
|
-
|
|
3462
|
+
Bi(t.x, e.x, n.x), Bi(t.y, e.y, n.y);
|
|
3461
3463
|
}
|
|
3462
3464
|
function kc(t, { min: e, max: n }, i) {
|
|
3463
|
-
return e !== void 0 && t < e ? t = i ?
|
|
3465
|
+
return e !== void 0 && t < e ? t = i ? L(e, t, i.min) : Math.max(t, e) : n !== void 0 && t > n && (t = i ? L(n, t, i.max) : Math.min(t, n)), t;
|
|
3464
3466
|
}
|
|
3465
|
-
function
|
|
3467
|
+
function Ni(t, e, n) {
|
|
3466
3468
|
return {
|
|
3467
3469
|
min: e !== void 0 ? t.min + e : void 0,
|
|
3468
3470
|
max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
|
|
@@ -3470,67 +3472,67 @@ function _i(t, e, n) {
|
|
|
3470
3472
|
}
|
|
3471
3473
|
function Lc(t, { top: e, left: n, bottom: i, right: s }) {
|
|
3472
3474
|
return {
|
|
3473
|
-
x:
|
|
3474
|
-
y:
|
|
3475
|
+
x: Ni(t.x, n, s),
|
|
3476
|
+
y: Ni(t.y, e, i)
|
|
3475
3477
|
};
|
|
3476
3478
|
}
|
|
3477
|
-
function
|
|
3479
|
+
function Ii(t, e) {
|
|
3478
3480
|
let n = e.min - t.min, i = e.max - t.max;
|
|
3479
3481
|
return e.max - e.min < t.max - t.min && ([n, i] = [i, n]), { min: n, max: i };
|
|
3480
3482
|
}
|
|
3481
3483
|
function jc(t, e) {
|
|
3482
3484
|
return {
|
|
3483
|
-
x:
|
|
3484
|
-
y:
|
|
3485
|
+
x: Ii(t.x, e.x),
|
|
3486
|
+
y: Ii(t.y, e.y)
|
|
3485
3487
|
};
|
|
3486
3488
|
}
|
|
3487
3489
|
function Oc(t, e) {
|
|
3488
3490
|
let n = 0.5;
|
|
3489
3491
|
const i = Y(t), s = Y(e);
|
|
3490
|
-
return s > i ? n = /* @__PURE__ */
|
|
3492
|
+
return s > i ? n = /* @__PURE__ */ Ot(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ Ot(t.min, t.max - s, e.min)), rt(0, 1, n);
|
|
3491
3493
|
}
|
|
3492
3494
|
function Fc(t, e) {
|
|
3493
3495
|
const n = {};
|
|
3494
3496
|
return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
|
|
3495
3497
|
}
|
|
3496
3498
|
const fn = 0.35;
|
|
3497
|
-
function
|
|
3499
|
+
function _c(t = fn) {
|
|
3498
3500
|
return t === !1 ? t = 0 : t === !0 && (t = fn), {
|
|
3499
|
-
x:
|
|
3500
|
-
y:
|
|
3501
|
+
x: Ui(t, "left", "right"),
|
|
3502
|
+
y: Ui(t, "top", "bottom")
|
|
3501
3503
|
};
|
|
3502
3504
|
}
|
|
3503
|
-
function
|
|
3505
|
+
function Ui(t, e, n) {
|
|
3504
3506
|
return {
|
|
3505
|
-
min:
|
|
3506
|
-
max:
|
|
3507
|
+
min: $i(t, e),
|
|
3508
|
+
max: $i(t, n)
|
|
3507
3509
|
};
|
|
3508
3510
|
}
|
|
3509
|
-
function
|
|
3511
|
+
function $i(t, e) {
|
|
3510
3512
|
return typeof t == "number" ? t : t[e] || 0;
|
|
3511
3513
|
}
|
|
3512
|
-
const
|
|
3514
|
+
const Wi = () => ({
|
|
3513
3515
|
translate: 0,
|
|
3514
3516
|
scale: 1,
|
|
3515
3517
|
origin: 0,
|
|
3516
3518
|
originPoint: 0
|
|
3517
|
-
}),
|
|
3519
|
+
}), kt = () => ({
|
|
3520
|
+
x: Wi(),
|
|
3521
|
+
y: Wi()
|
|
3522
|
+
}), Gi = () => ({ min: 0, max: 0 }), F = () => ({
|
|
3518
3523
|
x: Gi(),
|
|
3519
3524
|
y: Gi()
|
|
3520
|
-
}), Ki = () => ({ min: 0, max: 0 }), O = () => ({
|
|
3521
|
-
x: Ki(),
|
|
3522
|
-
y: Ki()
|
|
3523
3525
|
});
|
|
3524
|
-
function
|
|
3526
|
+
function q(t) {
|
|
3525
3527
|
return [t("x"), t("y")];
|
|
3526
3528
|
}
|
|
3527
|
-
function
|
|
3529
|
+
function $r({ top: t, left: e, right: n, bottom: i }) {
|
|
3528
3530
|
return {
|
|
3529
3531
|
x: { min: e, max: n },
|
|
3530
3532
|
y: { min: t, max: i }
|
|
3531
3533
|
};
|
|
3532
3534
|
}
|
|
3533
|
-
function
|
|
3535
|
+
function Bc({ x: t, y: e }) {
|
|
3534
3536
|
return { top: e.min, right: t.max, bottom: e.max, left: t.min };
|
|
3535
3537
|
}
|
|
3536
3538
|
function Nc(t, e) {
|
|
@@ -3550,30 +3552,30 @@ function Ye(t) {
|
|
|
3550
3552
|
function dn({ scale: t, scaleX: e, scaleY: n }) {
|
|
3551
3553
|
return !Ye(t) || !Ye(e) || !Ye(n);
|
|
3552
3554
|
}
|
|
3553
|
-
function
|
|
3554
|
-
return dn(t) ||
|
|
3555
|
+
function mt(t) {
|
|
3556
|
+
return dn(t) || Wr(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
|
|
3555
3557
|
}
|
|
3556
|
-
function
|
|
3557
|
-
return
|
|
3558
|
+
function Wr(t) {
|
|
3559
|
+
return Ki(t.x) || Ki(t.y);
|
|
3558
3560
|
}
|
|
3559
|
-
function
|
|
3561
|
+
function Ki(t) {
|
|
3560
3562
|
return t && t !== "0%";
|
|
3561
3563
|
}
|
|
3562
3564
|
function Ee(t, e, n) {
|
|
3563
3565
|
const i = t - n, s = e * i;
|
|
3564
3566
|
return n + s;
|
|
3565
3567
|
}
|
|
3566
|
-
function
|
|
3568
|
+
function Hi(t, e, n, i, s) {
|
|
3567
3569
|
return s !== void 0 && (t = Ee(t, s, i)), Ee(t, n, i) + e;
|
|
3568
3570
|
}
|
|
3569
3571
|
function mn(t, e = 0, n = 1, i, s) {
|
|
3570
|
-
t.min =
|
|
3572
|
+
t.min = Hi(t.min, e, n, i, s), t.max = Hi(t.max, e, n, i, s);
|
|
3571
3573
|
}
|
|
3572
|
-
function
|
|
3574
|
+
function Gr(t, { x: e, y: n }) {
|
|
3573
3575
|
mn(t.x, e.translate, e.scale, e.originPoint), mn(t.y, n.translate, n.scale, n.originPoint);
|
|
3574
3576
|
}
|
|
3575
|
-
const
|
|
3576
|
-
function
|
|
3577
|
+
const zi = 0.999999999999, Yi = 1.0000000000001;
|
|
3578
|
+
function Ic(t, e, n, i = !1) {
|
|
3577
3579
|
const s = n.length;
|
|
3578
3580
|
if (!s)
|
|
3579
3581
|
return;
|
|
@@ -3582,34 +3584,34 @@ function _c(t, e, n, i = !1) {
|
|
|
3582
3584
|
for (let a = 0; a < s; a++) {
|
|
3583
3585
|
o = n[a], r = o.projectionDelta;
|
|
3584
3586
|
const { visualElement: l } = o.options;
|
|
3585
|
-
l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root &&
|
|
3587
|
+
l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root && jt(t, {
|
|
3586
3588
|
x: -o.scroll.offset.x,
|
|
3587
3589
|
y: -o.scroll.offset.y
|
|
3588
|
-
}), r && (e.x *= r.x.scale, e.y *= r.y.scale,
|
|
3590
|
+
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, Gr(t, r)), i && mt(o.latestValues) && jt(t, o.latestValues));
|
|
3589
3591
|
}
|
|
3590
|
-
e.x <
|
|
3592
|
+
e.x < Yi && e.x > zi && (e.x = 1), e.y < Yi && e.y > zi && (e.y = 1);
|
|
3591
3593
|
}
|
|
3592
|
-
function
|
|
3594
|
+
function Lt(t, e) {
|
|
3593
3595
|
t.min = t.min + e, t.max = t.max + e;
|
|
3594
3596
|
}
|
|
3595
|
-
function
|
|
3596
|
-
const o =
|
|
3597
|
+
function Xi(t, e, n, i, s = 0.5) {
|
|
3598
|
+
const o = L(t.min, t.max, s);
|
|
3597
3599
|
mn(t, e, n, o, i);
|
|
3598
3600
|
}
|
|
3599
|
-
function
|
|
3600
|
-
|
|
3601
|
+
function jt(t, e) {
|
|
3602
|
+
Xi(t.x, e.x, e.scaleX, e.scale, e.originX), Xi(t.y, e.y, e.scaleY, e.scale, e.originY);
|
|
3601
3603
|
}
|
|
3602
|
-
function
|
|
3603
|
-
return
|
|
3604
|
+
function Kr(t, e) {
|
|
3605
|
+
return $r(Nc(t.getBoundingClientRect(), e));
|
|
3604
3606
|
}
|
|
3605
3607
|
function Uc(t, e, n) {
|
|
3606
|
-
const i =
|
|
3607
|
-
return s && (
|
|
3608
|
+
const i = Kr(t, n), { scroll: s } = e;
|
|
3609
|
+
return s && (Lt(i.x, s.offset.x), Lt(i.y, s.offset.y)), i;
|
|
3608
3610
|
}
|
|
3609
|
-
const
|
|
3611
|
+
const Hr = ({ current: t }) => t ? t.ownerDocument.defaultView : null, $c = /* @__PURE__ */ new WeakMap();
|
|
3610
3612
|
class Wc {
|
|
3611
3613
|
constructor(e) {
|
|
3612
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic =
|
|
3614
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = F(), this.visualElement = e;
|
|
3613
3615
|
}
|
|
3614
3616
|
start(e, { snapToCursor: n = !1 } = {}) {
|
|
3615
3617
|
const { presenceContext: i } = this.visualElement;
|
|
@@ -3617,14 +3619,14 @@ class Wc {
|
|
|
3617
3619
|
return;
|
|
3618
3620
|
const s = (u) => {
|
|
3619
3621
|
const { dragSnapToOrigin: h } = this.getProps();
|
|
3620
|
-
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(
|
|
3622
|
+
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(ce(u).point);
|
|
3621
3623
|
}, o = (u, h) => {
|
|
3622
|
-
const { drag: f, dragPropagation: d, onDragStart:
|
|
3624
|
+
const { drag: f, dragPropagation: d, onDragStart: p } = this.getProps();
|
|
3623
3625
|
if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = Oa(f), !this.openDragLock))
|
|
3624
3626
|
return;
|
|
3625
|
-
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0),
|
|
3627
|
+
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), q((v) => {
|
|
3626
3628
|
let y = this.getAxisMotionValue(v).get() || 0;
|
|
3627
|
-
if (
|
|
3629
|
+
if (tt.test(y)) {
|
|
3628
3630
|
const { projection: x } = this.visualElement;
|
|
3629
3631
|
if (x && x.layout) {
|
|
3630
3632
|
const b = x.layout.layoutBox[v];
|
|
@@ -3632,24 +3634,24 @@ class Wc {
|
|
|
3632
3634
|
}
|
|
3633
3635
|
}
|
|
3634
3636
|
this.originPoint[v] = y;
|
|
3635
|
-
}),
|
|
3636
|
-
const { animationState:
|
|
3637
|
-
|
|
3637
|
+
}), p && M.postRender(() => p(u, h)), sn(this.visualElement, "transform");
|
|
3638
|
+
const { animationState: g } = this.visualElement;
|
|
3639
|
+
g && g.setActive("whileDrag", !0);
|
|
3638
3640
|
}, r = (u, h) => {
|
|
3639
|
-
const { dragPropagation: f, dragDirectionLock: d, onDirectionLock:
|
|
3641
|
+
const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: p, onDrag: g } = this.getProps();
|
|
3640
3642
|
if (!f && !this.openDragLock)
|
|
3641
3643
|
return;
|
|
3642
3644
|
const { offset: v } = h;
|
|
3643
3645
|
if (d && this.currentDirection === null) {
|
|
3644
|
-
this.currentDirection = Gc(v), this.currentDirection !== null &&
|
|
3646
|
+
this.currentDirection = Gc(v), this.currentDirection !== null && p && p(this.currentDirection);
|
|
3645
3647
|
return;
|
|
3646
3648
|
}
|
|
3647
|
-
this.updateAxis("x", h.point, v), this.updateAxis("y", h.point, v), this.visualElement.render(),
|
|
3648
|
-
}, a = (u, h) => this.stop(u, h), l = () =>
|
|
3649
|
+
this.updateAxis("x", h.point, v), this.updateAxis("y", h.point, v), this.visualElement.render(), g && g(u, h);
|
|
3650
|
+
}, a = (u, h) => this.stop(u, h), l = () => q((u) => {
|
|
3649
3651
|
var h;
|
|
3650
3652
|
return this.getAnimationState(u) === "paused" && ((h = this.getAxisMotionValue(u).animation) === null || h === void 0 ? void 0 : h.play());
|
|
3651
3653
|
}), { dragSnapToOrigin: c } = this.getProps();
|
|
3652
|
-
this.panSession = new
|
|
3654
|
+
this.panSession = new Br(e, {
|
|
3653
3655
|
onSessionStart: s,
|
|
3654
3656
|
onStart: o,
|
|
3655
3657
|
onMove: r,
|
|
@@ -3658,7 +3660,7 @@ class Wc {
|
|
|
3658
3660
|
}, {
|
|
3659
3661
|
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
3660
3662
|
dragSnapToOrigin: c,
|
|
3661
|
-
contextWindow:
|
|
3663
|
+
contextWindow: Hr(this.visualElement)
|
|
3662
3664
|
});
|
|
3663
3665
|
}
|
|
3664
3666
|
stop(e, n) {
|
|
@@ -3688,34 +3690,34 @@ class Wc {
|
|
|
3688
3690
|
resolveConstraints() {
|
|
3689
3691
|
var e;
|
|
3690
3692
|
const { dragConstraints: n, dragElastic: i } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, o = this.constraints;
|
|
3691
|
-
n &&
|
|
3693
|
+
n && Rt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = Lc(s.layoutBox, n) : this.constraints = !1, this.elastic = _c(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && q((r) => {
|
|
3692
3694
|
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] = Fc(s.layoutBox[r], this.constraints[r]));
|
|
3693
3695
|
});
|
|
3694
3696
|
}
|
|
3695
3697
|
resolveRefConstraints() {
|
|
3696
3698
|
const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
|
|
3697
|
-
if (!e || !
|
|
3699
|
+
if (!e || !Rt(e))
|
|
3698
3700
|
return !1;
|
|
3699
3701
|
const i = e.current;
|
|
3700
|
-
|
|
3702
|
+
ct(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
3701
3703
|
const { projection: s } = this.visualElement;
|
|
3702
3704
|
if (!s || !s.layout)
|
|
3703
3705
|
return !1;
|
|
3704
3706
|
const o = Uc(i, s.root, this.visualElement.getTransformPagePoint());
|
|
3705
3707
|
let r = jc(s.layout.layoutBox, o);
|
|
3706
3708
|
if (n) {
|
|
3707
|
-
const a = n(
|
|
3708
|
-
this.hasMutatedConstraints = !!a, a && (r =
|
|
3709
|
+
const a = n(Bc(r));
|
|
3710
|
+
this.hasMutatedConstraints = !!a, a && (r = $r(a));
|
|
3709
3711
|
}
|
|
3710
3712
|
return r;
|
|
3711
3713
|
}
|
|
3712
3714
|
startAnimation(e) {
|
|
3713
|
-
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c =
|
|
3715
|
+
const { drag: n, dragMomentum: i, dragElastic: s, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, c = q((u) => {
|
|
3714
3716
|
if (!pe(u, n, this.currentDirection))
|
|
3715
3717
|
return;
|
|
3716
3718
|
let h = l && l[u] || {};
|
|
3717
3719
|
r && (h = { min: 0, max: 0 });
|
|
3718
|
-
const f = s ? 200 : 1e6, d = s ? 40 : 1e7,
|
|
3720
|
+
const f = s ? 200 : 1e6, d = s ? 40 : 1e7, p = {
|
|
3719
3721
|
type: "inertia",
|
|
3720
3722
|
velocity: i ? e[u] : 0,
|
|
3721
3723
|
bounceStiffness: f,
|
|
@@ -3726,7 +3728,7 @@ class Wc {
|
|
|
3726
3728
|
...o,
|
|
3727
3729
|
...h
|
|
3728
3730
|
};
|
|
3729
|
-
return this.startAxisValueAnimation(u,
|
|
3731
|
+
return this.startAxisValueAnimation(u, p);
|
|
3730
3732
|
});
|
|
3731
3733
|
return Promise.all(c).then(a);
|
|
3732
3734
|
}
|
|
@@ -3735,10 +3737,10 @@ class Wc {
|
|
|
3735
3737
|
return sn(this.visualElement, e), i.start(Qn(e, i, 0, n, this.visualElement, !1));
|
|
3736
3738
|
}
|
|
3737
3739
|
stopAnimation() {
|
|
3738
|
-
|
|
3740
|
+
q((e) => this.getAxisMotionValue(e).stop());
|
|
3739
3741
|
}
|
|
3740
3742
|
pauseAnimation() {
|
|
3741
|
-
|
|
3743
|
+
q((e) => {
|
|
3742
3744
|
var n;
|
|
3743
3745
|
return (n = this.getAxisMotionValue(e).animation) === null || n === void 0 ? void 0 : n.pause();
|
|
3744
3746
|
});
|
|
@@ -3758,14 +3760,14 @@ class Wc {
|
|
|
3758
3760
|
return s || this.visualElement.getValue(e, (i.initial ? i.initial[e] : void 0) || 0);
|
|
3759
3761
|
}
|
|
3760
3762
|
snapToCursor(e) {
|
|
3761
|
-
|
|
3763
|
+
q((n) => {
|
|
3762
3764
|
const { drag: i } = this.getProps();
|
|
3763
3765
|
if (!pe(n, i, this.currentDirection))
|
|
3764
3766
|
return;
|
|
3765
3767
|
const { projection: s } = this.visualElement, o = this.getAxisMotionValue(n);
|
|
3766
3768
|
if (s && s.layout) {
|
|
3767
3769
|
const { min: r, max: a } = s.layout.layoutBox[n];
|
|
3768
|
-
o.set(e[n] -
|
|
3770
|
+
o.set(e[n] - L(r, a, 0.5));
|
|
3769
3771
|
}
|
|
3770
3772
|
});
|
|
3771
3773
|
}
|
|
@@ -3778,11 +3780,11 @@ class Wc {
|
|
|
3778
3780
|
if (!this.visualElement.current)
|
|
3779
3781
|
return;
|
|
3780
3782
|
const { drag: e, dragConstraints: n } = this.getProps(), { projection: i } = this.visualElement;
|
|
3781
|
-
if (!
|
|
3783
|
+
if (!Rt(n) || !i || !this.constraints)
|
|
3782
3784
|
return;
|
|
3783
3785
|
this.stopAnimation();
|
|
3784
3786
|
const s = { x: 0, y: 0 };
|
|
3785
|
-
|
|
3787
|
+
q((r) => {
|
|
3786
3788
|
const a = this.getAxisMotionValue(r);
|
|
3787
3789
|
if (a && this.constraints !== !1) {
|
|
3788
3790
|
const l = a.get();
|
|
@@ -3790,11 +3792,11 @@ class Wc {
|
|
|
3790
3792
|
}
|
|
3791
3793
|
});
|
|
3792
3794
|
const { transformTemplate: o } = this.visualElement.getProps();
|
|
3793
|
-
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(),
|
|
3795
|
+
this.visualElement.current.style.transform = o ? o({}, "") : "none", i.root && i.root.updateScroll(), i.updateLayout(), this.resolveConstraints(), q((r) => {
|
|
3794
3796
|
if (!pe(r, e, null))
|
|
3795
3797
|
return;
|
|
3796
3798
|
const a = this.getAxisMotionValue(r), { min: l, max: c } = this.constraints[r];
|
|
3797
|
-
a.set(
|
|
3799
|
+
a.set(L(l, c, s[r]));
|
|
3798
3800
|
});
|
|
3799
3801
|
}
|
|
3800
3802
|
addListeners() {
|
|
@@ -3806,15 +3808,15 @@ class Wc {
|
|
|
3806
3808
|
c && u && this.start(l);
|
|
3807
3809
|
}), i = () => {
|
|
3808
3810
|
const { dragConstraints: l } = this.getProps();
|
|
3809
|
-
|
|
3811
|
+
Rt(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3810
3812
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
3811
3813
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), M.read(i);
|
|
3812
|
-
const r = ie(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
3813
|
-
this.isDragging && c && (
|
|
3814
|
+
const r = ie(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: c }) => {
|
|
3815
|
+
this.isDragging && c && (q((u) => {
|
|
3814
3816
|
const h = this.getAxisMotionValue(u);
|
|
3815
3817
|
h && (this.originPoint[u] += l[u].translate, h.set(h.get() + l[u].translate));
|
|
3816
3818
|
}), this.visualElement.render());
|
|
3817
|
-
});
|
|
3819
|
+
}));
|
|
3818
3820
|
return () => {
|
|
3819
3821
|
r(), n(), o(), a && a();
|
|
3820
3822
|
};
|
|
@@ -3839,7 +3841,7 @@ function Gc(t, e = 10) {
|
|
|
3839
3841
|
let n = null;
|
|
3840
3842
|
return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
|
|
3841
3843
|
}
|
|
3842
|
-
class Kc extends
|
|
3844
|
+
class Kc extends ft {
|
|
3843
3845
|
constructor(e) {
|
|
3844
3846
|
super(e), this.removeGroupControls = H, this.removeListeners = H, this.controls = new Wc(e);
|
|
3845
3847
|
}
|
|
@@ -3851,24 +3853,24 @@ class Kc extends mt {
|
|
|
3851
3853
|
this.removeGroupControls(), this.removeListeners();
|
|
3852
3854
|
}
|
|
3853
3855
|
}
|
|
3854
|
-
const
|
|
3856
|
+
const qi = (t) => (e, n) => {
|
|
3855
3857
|
t && M.postRender(() => t(e, n));
|
|
3856
3858
|
};
|
|
3857
|
-
class Hc extends
|
|
3859
|
+
class Hc extends ft {
|
|
3858
3860
|
constructor() {
|
|
3859
3861
|
super(...arguments), this.removePointerDownListener = H;
|
|
3860
3862
|
}
|
|
3861
3863
|
onPointerDown(e) {
|
|
3862
|
-
this.session = new
|
|
3864
|
+
this.session = new Br(e, this.createPanHandlers(), {
|
|
3863
3865
|
transformPagePoint: this.node.getTransformPagePoint(),
|
|
3864
|
-
contextWindow:
|
|
3866
|
+
contextWindow: Hr(this.node)
|
|
3865
3867
|
});
|
|
3866
3868
|
}
|
|
3867
3869
|
createPanHandlers() {
|
|
3868
3870
|
const { onPanSessionStart: e, onPanStart: n, onPan: i, onPanEnd: s } = this.node.getProps();
|
|
3869
3871
|
return {
|
|
3870
|
-
onSessionStart:
|
|
3871
|
-
onStart:
|
|
3872
|
+
onSessionStart: qi(e),
|
|
3873
|
+
onStart: qi(n),
|
|
3872
3874
|
onMove: i,
|
|
3873
3875
|
onEnd: (o, r) => {
|
|
3874
3876
|
delete this.session, s && M.postRender(() => s(o, r));
|
|
@@ -3897,10 +3899,10 @@ const xe = {
|
|
|
3897
3899
|
*/
|
|
3898
3900
|
hasEverUpdated: !1
|
|
3899
3901
|
};
|
|
3900
|
-
function
|
|
3902
|
+
function Zi(t, e) {
|
|
3901
3903
|
return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
|
|
3902
3904
|
}
|
|
3903
|
-
const
|
|
3905
|
+
const Gt = {
|
|
3904
3906
|
correct: (t, e) => {
|
|
3905
3907
|
if (!e.target)
|
|
3906
3908
|
return t;
|
|
@@ -3909,21 +3911,21 @@ const Wt = {
|
|
|
3909
3911
|
t = parseFloat(t);
|
|
3910
3912
|
else
|
|
3911
3913
|
return t;
|
|
3912
|
-
const n =
|
|
3914
|
+
const n = Zi(t, e.target.x), i = Zi(t, e.target.y);
|
|
3913
3915
|
return `${n}% ${i}%`;
|
|
3914
3916
|
}
|
|
3915
3917
|
}, zc = {
|
|
3916
3918
|
correct: (t, { treeScale: e, projectionDelta: n }) => {
|
|
3917
|
-
const i = t, s =
|
|
3919
|
+
const i = t, s = ht.parse(t);
|
|
3918
3920
|
if (s.length > 5)
|
|
3919
3921
|
return i;
|
|
3920
|
-
const o =
|
|
3922
|
+
const o = ht.createTransformer(t), r = typeof s[0] != "number" ? 1 : 0, a = n.x.scale * e.x, l = n.y.scale * e.y;
|
|
3921
3923
|
s[0 + r] /= a, s[1 + r] /= l;
|
|
3922
|
-
const c =
|
|
3924
|
+
const c = L(a, l, 0.5);
|
|
3923
3925
|
return typeof s[2 + r] == "number" && (s[2 + r] /= c), typeof s[3 + r] == "number" && (s[3 + r] /= c), o(s);
|
|
3924
3926
|
}
|
|
3925
3927
|
};
|
|
3926
|
-
class Yc extends
|
|
3928
|
+
class Yc extends uo {
|
|
3927
3929
|
/**
|
|
3928
3930
|
* This only mounts projection nodes for components that
|
|
3929
3931
|
* need measuring, we might want to do it for all components
|
|
@@ -3963,13 +3965,13 @@ class Yc extends ho {
|
|
|
3963
3965
|
return null;
|
|
3964
3966
|
}
|
|
3965
3967
|
}
|
|
3966
|
-
function
|
|
3967
|
-
const [e, n] =
|
|
3968
|
-
return E.jsx(Yc, { ...t, layoutGroup: i, switchLayoutGroup:
|
|
3968
|
+
function zr(t) {
|
|
3969
|
+
const [e, n] = Rs(), i = U(Tn);
|
|
3970
|
+
return E.jsx(Yc, { ...t, layoutGroup: i, switchLayoutGroup: U(_s), isPresent: e, safeToRemove: n });
|
|
3969
3971
|
}
|
|
3970
3972
|
const Xc = {
|
|
3971
3973
|
borderRadius: {
|
|
3972
|
-
...
|
|
3974
|
+
...Gt,
|
|
3973
3975
|
applyTo: [
|
|
3974
3976
|
"borderTopLeftRadius",
|
|
3975
3977
|
"borderTopRightRadius",
|
|
@@ -3977,10 +3979,10 @@ const Xc = {
|
|
|
3977
3979
|
"borderBottomRightRadius"
|
|
3978
3980
|
]
|
|
3979
3981
|
},
|
|
3980
|
-
borderTopLeftRadius:
|
|
3981
|
-
borderTopRightRadius:
|
|
3982
|
-
borderBottomLeftRadius:
|
|
3983
|
-
borderBottomRightRadius:
|
|
3982
|
+
borderTopLeftRadius: Gt,
|
|
3983
|
+
borderTopRightRadius: Gt,
|
|
3984
|
+
borderBottomLeftRadius: Gt,
|
|
3985
|
+
borderBottomRightRadius: Gt,
|
|
3984
3986
|
boxShadow: zc
|
|
3985
3987
|
};
|
|
3986
3988
|
function qc(t, e, n) {
|
|
@@ -4006,83 +4008,83 @@ class Qc {
|
|
|
4006
4008
|
}
|
|
4007
4009
|
}
|
|
4008
4010
|
function tu(t, e) {
|
|
4009
|
-
const n =
|
|
4011
|
+
const n = et.now(), i = ({ timestamp: s }) => {
|
|
4010
4012
|
const o = s - n;
|
|
4011
|
-
o >= e && (
|
|
4013
|
+
o >= e && (ut(i), t(o - e));
|
|
4012
4014
|
};
|
|
4013
|
-
return M.read(i, !0), () =>
|
|
4015
|
+
return M.read(i, !0), () => ut(i);
|
|
4014
4016
|
}
|
|
4015
|
-
const
|
|
4017
|
+
const Yr = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], eu = Yr.length, Ji = (t) => typeof t == "string" ? parseFloat(t) : t, Qi = (t) => typeof t == "number" || P.test(t);
|
|
4016
4018
|
function nu(t, e, n, i, s, o) {
|
|
4017
|
-
s ? (t.opacity =
|
|
4019
|
+
s ? (t.opacity = L(
|
|
4018
4020
|
0,
|
|
4019
4021
|
// TODO Reinstate this if only child
|
|
4020
4022
|
n.opacity !== void 0 ? n.opacity : 1,
|
|
4021
4023
|
iu(i)
|
|
4022
|
-
), t.opacityExit =
|
|
4024
|
+
), t.opacityExit = L(e.opacity !== void 0 ? e.opacity : 1, 0, su(i))) : o && (t.opacity = L(e.opacity !== void 0 ? e.opacity : 1, n.opacity !== void 0 ? n.opacity : 1, i));
|
|
4023
4025
|
for (let r = 0; r < eu; r++) {
|
|
4024
|
-
const a = `border${
|
|
4025
|
-
let l =
|
|
4026
|
+
const a = `border${Yr[r]}Radius`;
|
|
4027
|
+
let l = ts(e, a), c = ts(n, a);
|
|
4026
4028
|
if (l === void 0 && c === void 0)
|
|
4027
4029
|
continue;
|
|
4028
|
-
l || (l = 0), c || (c = 0), l === 0 || c === 0 ||
|
|
4030
|
+
l || (l = 0), c || (c = 0), l === 0 || c === 0 || Qi(l) === Qi(c) ? (t[a] = Math.max(L(Ji(l), Ji(c), i), 0), (tt.test(c) || tt.test(l)) && (t[a] += "%")) : t[a] = c;
|
|
4029
4031
|
}
|
|
4030
|
-
(e.rotate || n.rotate) && (t.rotate =
|
|
4032
|
+
(e.rotate || n.rotate) && (t.rotate = L(e.rotate || 0, n.rotate || 0, i));
|
|
4031
4033
|
}
|
|
4032
|
-
function
|
|
4034
|
+
function ts(t, e) {
|
|
4033
4035
|
return t[e] !== void 0 ? t[e] : t.borderRadius;
|
|
4034
4036
|
}
|
|
4035
|
-
const iu = /* @__PURE__ */
|
|
4036
|
-
function
|
|
4037
|
-
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */
|
|
4037
|
+
const iu = /* @__PURE__ */ Xr(0, 0.5, dr), su = /* @__PURE__ */ Xr(0.5, 0.95, H);
|
|
4038
|
+
function Xr(t, e, n) {
|
|
4039
|
+
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ Ot(t, e, i));
|
|
4038
4040
|
}
|
|
4039
|
-
function
|
|
4041
|
+
function es(t, e) {
|
|
4040
4042
|
t.min = e.min, t.max = e.max;
|
|
4041
4043
|
}
|
|
4042
|
-
function
|
|
4043
|
-
|
|
4044
|
+
function X(t, e) {
|
|
4045
|
+
es(t.x, e.x), es(t.y, e.y);
|
|
4044
4046
|
}
|
|
4045
|
-
function
|
|
4047
|
+
function ns(t, e) {
|
|
4046
4048
|
t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
|
|
4047
4049
|
}
|
|
4048
|
-
function
|
|
4050
|
+
function is(t, e, n, i, s) {
|
|
4049
4051
|
return t -= e, t = Ee(t, 1 / n, i), s !== void 0 && (t = Ee(t, 1 / s, i)), t;
|
|
4050
4052
|
}
|
|
4051
4053
|
function ru(t, e = 0, n = 1, i = 0.5, s, o = t, r = t) {
|
|
4052
|
-
if (
|
|
4054
|
+
if (tt.test(e) && (e = parseFloat(e), e = L(r.min, r.max, e / 100) - r.min), typeof e != "number")
|
|
4053
4055
|
return;
|
|
4054
|
-
let a =
|
|
4055
|
-
t === o && (a -= e), t.min =
|
|
4056
|
+
let a = L(o.min, o.max, i);
|
|
4057
|
+
t === o && (a -= e), t.min = is(t.min, e, n, a, s), t.max = is(t.max, e, n, a, s);
|
|
4056
4058
|
}
|
|
4057
|
-
function
|
|
4059
|
+
function ss(t, e, [n, i, s], o, r) {
|
|
4058
4060
|
ru(t, e[n], e[i], e[s], e.scale, o, r);
|
|
4059
4061
|
}
|
|
4060
4062
|
const ou = ["x", "scaleX", "originX"], au = ["y", "scaleY", "originY"];
|
|
4061
|
-
function
|
|
4062
|
-
|
|
4063
|
+
function rs(t, e, n, i) {
|
|
4064
|
+
ss(t.x, e, ou, n ? n.x : void 0, i ? i.x : void 0), ss(t.y, e, au, n ? n.y : void 0, i ? i.y : void 0);
|
|
4063
4065
|
}
|
|
4064
|
-
function
|
|
4066
|
+
function os(t) {
|
|
4065
4067
|
return t.translate === 0 && t.scale === 1;
|
|
4066
4068
|
}
|
|
4067
|
-
function
|
|
4068
|
-
return
|
|
4069
|
+
function qr(t) {
|
|
4070
|
+
return os(t.x) && os(t.y);
|
|
4069
4071
|
}
|
|
4070
|
-
function
|
|
4072
|
+
function as(t, e) {
|
|
4071
4073
|
return t.min === e.min && t.max === e.max;
|
|
4072
4074
|
}
|
|
4073
4075
|
function lu(t, e) {
|
|
4074
|
-
return
|
|
4076
|
+
return as(t.x, e.x) && as(t.y, e.y);
|
|
4075
4077
|
}
|
|
4076
|
-
function
|
|
4078
|
+
function ls(t, e) {
|
|
4077
4079
|
return Math.round(t.min) === Math.round(e.min) && Math.round(t.max) === Math.round(e.max);
|
|
4078
4080
|
}
|
|
4079
|
-
function
|
|
4080
|
-
return
|
|
4081
|
+
function Zr(t, e) {
|
|
4082
|
+
return ls(t.x, e.x) && ls(t.y, e.y);
|
|
4081
4083
|
}
|
|
4082
|
-
function
|
|
4084
|
+
function cs(t) {
|
|
4083
4085
|
return Y(t.x) / Y(t.y);
|
|
4084
4086
|
}
|
|
4085
|
-
function
|
|
4087
|
+
function us(t, e) {
|
|
4086
4088
|
return t.translate === e.translate && t.scale === e.scale && t.originPoint === e.originPoint;
|
|
4087
4089
|
}
|
|
4088
4090
|
class cu {
|
|
@@ -4143,44 +4145,44 @@ function uu(t, e, n) {
|
|
|
4143
4145
|
let i = "";
|
|
4144
4146
|
const s = t.x.translate / e.x, o = t.y.translate / e.y, r = (n == null ? void 0 : n.z) || 0;
|
|
4145
4147
|
if ((s || o || r) && (i = `translate3d(${s}px, ${o}px, ${r}px) `), (e.x !== 1 || e.y !== 1) && (i += `scale(${1 / e.x}, ${1 / e.y}) `), n) {
|
|
4146
|
-
const { transformPerspective: c, rotate: u, rotateX: h, rotateY: f, skewX: d, skewY:
|
|
4147
|
-
c && (i = `perspective(${c}px) ${i}`), u && (i += `rotate(${u}deg) `), h && (i += `rotateX(${h}deg) `), f && (i += `rotateY(${f}deg) `), d && (i += `skewX(${d}deg) `),
|
|
4148
|
+
const { transformPerspective: c, rotate: u, rotateX: h, rotateY: f, skewX: d, skewY: p } = n;
|
|
4149
|
+
c && (i = `perspective(${c}px) ${i}`), u && (i += `rotate(${u}deg) `), h && (i += `rotateX(${h}deg) `), f && (i += `rotateY(${f}deg) `), d && (i += `skewX(${d}deg) `), p && (i += `skewY(${p}deg) `);
|
|
4148
4150
|
}
|
|
4149
4151
|
const a = t.x.scale * e.x, l = t.y.scale * e.y;
|
|
4150
4152
|
return (a !== 1 || l !== 1) && (i += `scale(${a}, ${l})`), i || "none";
|
|
4151
4153
|
}
|
|
4152
|
-
const
|
|
4154
|
+
const pt = {
|
|
4153
4155
|
type: "projectionFrame",
|
|
4154
4156
|
totalNodes: 0,
|
|
4155
4157
|
resolvedTargetDeltas: 0,
|
|
4156
4158
|
recalculatedProjection: 0
|
|
4157
|
-
}, zt = typeof window < "u" && window.MotionDebug !== void 0, Xe = ["", "X", "Y", "Z"], hu = { visibility: "hidden" },
|
|
4159
|
+
}, zt = typeof window < "u" && window.MotionDebug !== void 0, Xe = ["", "X", "Y", "Z"], hu = { visibility: "hidden" }, hs = 1e3;
|
|
4158
4160
|
let fu = 0;
|
|
4159
4161
|
function qe(t, e, n, i) {
|
|
4160
4162
|
const { latestValues: s } = e;
|
|
4161
4163
|
s[t] && (n[t] = s[t], e.setStaticValue(t, 0), i && (i[t] = 0));
|
|
4162
4164
|
}
|
|
4163
|
-
function
|
|
4165
|
+
function Jr(t) {
|
|
4164
4166
|
if (t.hasCheckedOptimisedAppear = !0, t.root === t)
|
|
4165
4167
|
return;
|
|
4166
4168
|
const { visualElement: e } = t.options;
|
|
4167
4169
|
if (!e)
|
|
4168
4170
|
return;
|
|
4169
|
-
const n =
|
|
4171
|
+
const n = or(e);
|
|
4170
4172
|
if (window.MotionHasOptimisedAnimation(n, "transform")) {
|
|
4171
4173
|
const { layout: s, layoutId: o } = t.options;
|
|
4172
4174
|
window.MotionCancelOptimisedAnimation(n, "transform", M, !(s || o));
|
|
4173
4175
|
}
|
|
4174
4176
|
const { parent: i } = t;
|
|
4175
|
-
i && !i.hasCheckedOptimisedAppear &&
|
|
4177
|
+
i && !i.hasCheckedOptimisedAppear && Jr(i);
|
|
4176
4178
|
}
|
|
4177
|
-
function
|
|
4179
|
+
function Qr({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: i, resetTransform: s }) {
|
|
4178
4180
|
return class {
|
|
4179
4181
|
constructor(r = {}, a = e == null ? void 0 : e()) {
|
|
4180
4182
|
this.id = fu++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
4181
4183
|
this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
|
|
4182
4184
|
}, this.updateProjection = () => {
|
|
4183
|
-
this.projectionUpdateScheduled = !1, zt && (
|
|
4185
|
+
this.projectionUpdateScheduled = !1, zt && (pt.totalNodes = pt.resolvedTargetDeltas = pt.recalculatedProjection = 0), this.nodes.forEach(pu), this.nodes.forEach(Tu), this.nodes.forEach(bu), this.nodes.forEach(gu), zt && window.MotionDebug.record(pt);
|
|
4184
4186
|
}, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
|
|
4185
4187
|
for (let l = 0; l < this.path.length; l++)
|
|
4186
4188
|
this.path[l].shouldResetTransform = !0;
|
|
@@ -4208,32 +4210,32 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4208
4210
|
let h;
|
|
4209
4211
|
const f = () => this.root.updateBlockedByResize = !1;
|
|
4210
4212
|
t(r, () => {
|
|
4211
|
-
this.root.updateBlockedByResize = !0, h && h(), h = tu(f, 250), xe.hasAnimatedSinceResize && (xe.hasAnimatedSinceResize = !1, this.nodes.forEach(
|
|
4213
|
+
this.root.updateBlockedByResize = !0, h && h(), h = tu(f, 250), xe.hasAnimatedSinceResize && (xe.hasAnimatedSinceResize = !1, this.nodes.forEach(ds));
|
|
4212
4214
|
});
|
|
4213
4215
|
}
|
|
4214
|
-
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && u && (l || c) && this.addEventListener("didUpdate", ({ delta: h, hasLayoutChanged: f, hasRelativeTargetChanged: d, layout:
|
|
4216
|
+
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && u && (l || c) && this.addEventListener("didUpdate", ({ delta: h, hasLayoutChanged: f, hasRelativeTargetChanged: d, layout: p }) => {
|
|
4215
4217
|
if (this.isTreeAnimationBlocked()) {
|
|
4216
4218
|
this.target = void 0, this.relativeTarget = void 0;
|
|
4217
4219
|
return;
|
|
4218
4220
|
}
|
|
4219
|
-
const
|
|
4221
|
+
const g = this.options.transition || u.getDefaultTransition() || Vu, { onLayoutAnimationStart: v, onLayoutAnimationComplete: y } = u.getProps(), x = !this.targetLayout || !Zr(this.targetLayout, p) || d, b = !f && d;
|
|
4220
4222
|
if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || b || f && (x || !this.currentAnimation)) {
|
|
4221
4223
|
this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0), this.setAnimationOrigin(h, b);
|
|
4222
4224
|
const w = {
|
|
4223
|
-
...
|
|
4225
|
+
...Bn(g, "layout"),
|
|
4224
4226
|
onPlay: v,
|
|
4225
4227
|
onComplete: y
|
|
4226
4228
|
};
|
|
4227
4229
|
(u.shouldReduceMotion || this.options.layoutRoot) && (w.delay = 0, w.type = !1), this.startAnimation(w);
|
|
4228
4230
|
} else
|
|
4229
|
-
f ||
|
|
4230
|
-
this.targetLayout =
|
|
4231
|
+
f || ds(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
|
|
4232
|
+
this.targetLayout = p;
|
|
4231
4233
|
});
|
|
4232
4234
|
}
|
|
4233
4235
|
unmount() {
|
|
4234
4236
|
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
4235
4237
|
const r = this.getStack();
|
|
4236
|
-
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0,
|
|
4238
|
+
r && r.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, ut(this.updateProjection);
|
|
4237
4239
|
}
|
|
4238
4240
|
// only on the root
|
|
4239
4241
|
blockUpdate() {
|
|
@@ -4261,7 +4263,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4261
4263
|
this.options.onExitComplete && this.options.onExitComplete();
|
|
4262
4264
|
return;
|
|
4263
4265
|
}
|
|
4264
|
-
if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear &&
|
|
4266
|
+
if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && Jr(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty)
|
|
4265
4267
|
return;
|
|
4266
4268
|
this.isLayoutDirty = !0;
|
|
4267
4269
|
for (let u = 0; u < this.path.length; u++) {
|
|
@@ -4276,12 +4278,12 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4276
4278
|
}
|
|
4277
4279
|
update() {
|
|
4278
4280
|
if (this.updateScheduled = !1, this.isUpdateBlocked()) {
|
|
4279
|
-
this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(
|
|
4281
|
+
this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(fs);
|
|
4280
4282
|
return;
|
|
4281
4283
|
}
|
|
4282
4284
|
this.isUpdating || this.nodes.forEach(vu), this.isUpdating = !1, this.nodes.forEach(xu), this.nodes.forEach(du), this.nodes.forEach(mu), this.clearAllSnapshots();
|
|
4283
|
-
const a =
|
|
4284
|
-
I.delta =
|
|
4285
|
+
const a = et.now();
|
|
4286
|
+
I.delta = rt(0, 1e3 / 60, a - I.timestamp), I.timestamp = a, I.isProcessing = !0, Ie.update.process(I), Ie.preRender.process(I), Ie.render.process(I), I.isProcessing = !1;
|
|
4285
4287
|
}
|
|
4286
4288
|
didUpdate() {
|
|
4287
4289
|
this.updateScheduled || (this.updateScheduled = !0, Cn.read(this.scheduleUpdate));
|
|
@@ -4310,7 +4312,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4310
4312
|
for (let l = 0; l < this.path.length; l++)
|
|
4311
4313
|
this.path[l].updateScroll();
|
|
4312
4314
|
const r = this.layout;
|
|
4313
|
-
this.layout = this.measure(!1), this.layoutCorrected =
|
|
4315
|
+
this.layout = this.measure(!1), this.layoutCorrected = F(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
|
|
4314
4316
|
const { visualElement: a } = this.options;
|
|
4315
4317
|
a && a.notify("LayoutMeasure", this.layout.layoutBox, r ? r.layoutBox : void 0);
|
|
4316
4318
|
}
|
|
@@ -4330,8 +4332,8 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4330
4332
|
resetTransform() {
|
|
4331
4333
|
if (!s)
|
|
4332
4334
|
return;
|
|
4333
|
-
const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !
|
|
4334
|
-
r && (a ||
|
|
4335
|
+
const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !qr(this.projectionDelta), l = this.getTransformTemplate(), c = l ? l(this.latestValues, "") : void 0, u = c !== this.prevTransformTemplateValue;
|
|
4336
|
+
r && (a || mt(this.latestValues) || u) && (s(this.instance, c), this.shouldResetTransform = !1, this.scheduleRender());
|
|
4335
4337
|
}
|
|
4336
4338
|
measure(r = !0) {
|
|
4337
4339
|
const a = this.measurePageBox();
|
|
@@ -4348,49 +4350,49 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4348
4350
|
var r;
|
|
4349
4351
|
const { visualElement: a } = this.options;
|
|
4350
4352
|
if (!a)
|
|
4351
|
-
return
|
|
4353
|
+
return F();
|
|
4352
4354
|
const l = a.measureViewportBox();
|
|
4353
4355
|
if (!(((r = this.scroll) === null || r === void 0 ? void 0 : r.wasRoot) || this.path.some(Cu))) {
|
|
4354
4356
|
const { scroll: u } = this.root;
|
|
4355
|
-
u && (
|
|
4357
|
+
u && (Lt(l.x, u.offset.x), Lt(l.y, u.offset.y));
|
|
4356
4358
|
}
|
|
4357
4359
|
return l;
|
|
4358
4360
|
}
|
|
4359
4361
|
removeElementScroll(r) {
|
|
4360
4362
|
var a;
|
|
4361
|
-
const l =
|
|
4362
|
-
if (
|
|
4363
|
+
const l = F();
|
|
4364
|
+
if (X(l, r), !((a = this.scroll) === null || a === void 0) && a.wasRoot)
|
|
4363
4365
|
return l;
|
|
4364
4366
|
for (let c = 0; c < this.path.length; c++) {
|
|
4365
4367
|
const u = this.path[c], { scroll: h, options: f } = u;
|
|
4366
|
-
u !== this.root && h && f.layoutScroll && (h.wasRoot &&
|
|
4368
|
+
u !== this.root && h && f.layoutScroll && (h.wasRoot && X(l, r), Lt(l.x, h.offset.x), Lt(l.y, h.offset.y));
|
|
4367
4369
|
}
|
|
4368
4370
|
return l;
|
|
4369
4371
|
}
|
|
4370
4372
|
applyTransform(r, a = !1) {
|
|
4371
|
-
const l =
|
|
4372
|
-
|
|
4373
|
+
const l = F();
|
|
4374
|
+
X(l, r);
|
|
4373
4375
|
for (let c = 0; c < this.path.length; c++) {
|
|
4374
4376
|
const u = this.path[c];
|
|
4375
|
-
!a && u.options.layoutScroll && u.scroll && u !== u.root &&
|
|
4377
|
+
!a && u.options.layoutScroll && u.scroll && u !== u.root && jt(l, {
|
|
4376
4378
|
x: -u.scroll.offset.x,
|
|
4377
4379
|
y: -u.scroll.offset.y
|
|
4378
|
-
}),
|
|
4380
|
+
}), mt(u.latestValues) && jt(l, u.latestValues);
|
|
4379
4381
|
}
|
|
4380
|
-
return
|
|
4382
|
+
return mt(this.latestValues) && jt(l, this.latestValues), l;
|
|
4381
4383
|
}
|
|
4382
4384
|
removeTransform(r) {
|
|
4383
|
-
const a =
|
|
4384
|
-
|
|
4385
|
+
const a = F();
|
|
4386
|
+
X(a, r);
|
|
4385
4387
|
for (let l = 0; l < this.path.length; l++) {
|
|
4386
4388
|
const c = this.path[l];
|
|
4387
|
-
if (!c.instance || !
|
|
4389
|
+
if (!c.instance || !mt(c.latestValues))
|
|
4388
4390
|
continue;
|
|
4389
4391
|
dn(c.latestValues) && c.updateSnapshot();
|
|
4390
|
-
const u =
|
|
4391
|
-
|
|
4392
|
+
const u = F(), h = c.measurePageBox();
|
|
4393
|
+
X(u, h), rs(a, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, u);
|
|
4392
4394
|
}
|
|
4393
|
-
return
|
|
4395
|
+
return mt(this.latestValues) && rs(a, this.latestValues), a;
|
|
4394
4396
|
}
|
|
4395
4397
|
setTargetDelta(r) {
|
|
4396
4398
|
this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
|
|
@@ -4419,20 +4421,20 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4419
4421
|
if (!(!this.layout || !(h || f))) {
|
|
4420
4422
|
if (this.resolvedRelativeTargetAt = I.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
4421
4423
|
const d = this.getClosestProjectingParent();
|
|
4422
|
-
d && d.layout && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget =
|
|
4424
|
+
d && d.layout && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget = F(), this.relativeTargetOrigin = F(), Zt(this.relativeTargetOrigin, this.layout.layoutBox, d.layout.layoutBox), X(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4423
4425
|
}
|
|
4424
4426
|
if (!(!this.relativeTarget && !this.targetDelta)) {
|
|
4425
|
-
if (this.target || (this.target =
|
|
4427
|
+
if (this.target || (this.target = F(), this.targetWithTransforms = F()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), Mc(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : X(this.target, this.layout.layoutBox), Gr(this.target, this.targetDelta)) : X(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget) {
|
|
4426
4428
|
this.attemptToResolveRelativeTarget = !1;
|
|
4427
4429
|
const d = this.getClosestProjectingParent();
|
|
4428
|
-
d && !!d.resumingFrom == !!this.resumingFrom && !d.options.layoutScroll && d.target && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget =
|
|
4430
|
+
d && !!d.resumingFrom == !!this.resumingFrom && !d.options.layoutScroll && d.target && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget = F(), this.relativeTargetOrigin = F(), Zt(this.relativeTargetOrigin, this.target, d.target), X(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
4429
4431
|
}
|
|
4430
|
-
zt &&
|
|
4432
|
+
zt && pt.resolvedTargetDeltas++;
|
|
4431
4433
|
}
|
|
4432
4434
|
}
|
|
4433
4435
|
}
|
|
4434
4436
|
getClosestProjectingParent() {
|
|
4435
|
-
if (!(!this.parent || dn(this.parent.latestValues) ||
|
|
4437
|
+
if (!(!this.parent || dn(this.parent.latestValues) || Wr(this.parent.latestValues)))
|
|
4436
4438
|
return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
|
|
4437
4439
|
}
|
|
4438
4440
|
isProjecting() {
|
|
@@ -4447,15 +4449,15 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4447
4449
|
const { layout: u, layoutId: h } = this.options;
|
|
4448
4450
|
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(u || h))
|
|
4449
4451
|
return;
|
|
4450
|
-
|
|
4452
|
+
X(this.layoutCorrected, this.layout.layoutBox);
|
|
4451
4453
|
const f = this.treeScale.x, d = this.treeScale.y;
|
|
4452
|
-
|
|
4453
|
-
const { target:
|
|
4454
|
-
if (!
|
|
4454
|
+
Ic(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox, a.targetWithTransforms = F());
|
|
4455
|
+
const { target: p } = a;
|
|
4456
|
+
if (!p) {
|
|
4455
4457
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
4456
4458
|
return;
|
|
4457
4459
|
}
|
|
4458
|
-
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (
|
|
4460
|
+
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (ns(this.prevProjectionDelta.x, this.projectionDelta.x), ns(this.prevProjectionDelta.y, this.projectionDelta.y)), qt(this.projectionDelta, this.layoutCorrected, p, this.latestValues), (this.treeScale.x !== f || this.treeScale.y !== d || !us(this.projectionDelta.x, this.prevProjectionDelta.x) || !us(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", p)), zt && pt.recalculatedProjection++;
|
|
4459
4461
|
}
|
|
4460
4462
|
hide() {
|
|
4461
4463
|
this.isVisible = !1;
|
|
@@ -4472,22 +4474,22 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4472
4474
|
this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
|
|
4473
4475
|
}
|
|
4474
4476
|
createProjectionDeltas() {
|
|
4475
|
-
this.prevProjectionDelta =
|
|
4477
|
+
this.prevProjectionDelta = kt(), this.projectionDelta = kt(), this.projectionDeltaWithTransform = kt();
|
|
4476
4478
|
}
|
|
4477
4479
|
setAnimationOrigin(r, a = !1) {
|
|
4478
|
-
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h =
|
|
4480
|
+
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h = kt();
|
|
4479
4481
|
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
4480
|
-
const f =
|
|
4482
|
+
const f = F(), d = l ? l.source : void 0, p = this.layout ? this.layout.source : void 0, g = d !== p, v = this.getStack(), y = !v || v.members.length <= 1, x = !!(g && !y && this.options.crossfade === !0 && !this.path.some(Au));
|
|
4481
4483
|
this.animationProgress = 0;
|
|
4482
4484
|
let b;
|
|
4483
4485
|
this.mixTargetDelta = (w) => {
|
|
4484
4486
|
const T = w / 1e3;
|
|
4485
|
-
|
|
4487
|
+
ms(h.x, r.x, T), ms(h.y, r.y, T), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Zt(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), Su(this.relativeTarget, this.relativeTargetOrigin, f, T), b && lu(this.relativeTarget, b) && (this.isProjectionDirty = !1), b || (b = F()), X(b, this.relativeTarget)), g && (this.animationValues = u, nu(u, c, this.latestValues, T, x, y)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = T;
|
|
4486
4488
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4487
4489
|
}
|
|
4488
4490
|
startAnimation(r) {
|
|
4489
|
-
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (
|
|
4490
|
-
xe.hasAnimatedSinceResize = !0, this.currentAnimation = qc(0,
|
|
4491
|
+
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (ut(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = M.update(() => {
|
|
4492
|
+
xe.hasAnimatedSinceResize = !0, this.currentAnimation = qc(0, hs, {
|
|
4491
4493
|
...r,
|
|
4492
4494
|
onUpdate: (a) => {
|
|
4493
4495
|
this.mixTargetDelta(a), r.onUpdate && r.onUpdate(a);
|
|
@@ -4504,20 +4506,20 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4504
4506
|
r && r.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
|
|
4505
4507
|
}
|
|
4506
4508
|
finishAnimation() {
|
|
4507
|
-
this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(
|
|
4509
|
+
this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(hs), this.currentAnimation.stop()), this.completeAnimation();
|
|
4508
4510
|
}
|
|
4509
4511
|
applyTransformsToTarget() {
|
|
4510
4512
|
const r = this.getLead();
|
|
4511
4513
|
let { targetWithTransforms: a, target: l, layout: c, latestValues: u } = r;
|
|
4512
4514
|
if (!(!a || !l || !c)) {
|
|
4513
|
-
if (this !== r && this.layout && c &&
|
|
4514
|
-
l = this.target ||
|
|
4515
|
+
if (this !== r && this.layout && c && to(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
|
|
4516
|
+
l = this.target || F();
|
|
4515
4517
|
const h = Y(this.layout.layoutBox.x);
|
|
4516
4518
|
l.x.min = r.target.x.min, l.x.max = l.x.min + h;
|
|
4517
4519
|
const f = Y(this.layout.layoutBox.y);
|
|
4518
4520
|
l.y.min = r.target.y.min, l.y.max = l.y.min + f;
|
|
4519
4521
|
}
|
|
4520
|
-
|
|
4522
|
+
X(a, l), jt(a, u), qt(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
4521
4523
|
}
|
|
4522
4524
|
}
|
|
4523
4525
|
registerSharedNode(r, a) {
|
|
@@ -4585,23 +4587,23 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4585
4587
|
return this.needsReset = !1, c.opacity = "", c.pointerEvents = ye(r == null ? void 0 : r.pointerEvents) || "", c.transform = u ? u(this.latestValues, "") : "none", c;
|
|
4586
4588
|
const h = this.getLead();
|
|
4587
4589
|
if (!this.projectionDelta || !this.layout || !h.target) {
|
|
4588
|
-
const
|
|
4589
|
-
return this.options.layoutId && (
|
|
4590
|
+
const g = {};
|
|
4591
|
+
return this.options.layoutId && (g.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, g.pointerEvents = ye(r == null ? void 0 : r.pointerEvents) || ""), this.hasProjected && !mt(this.latestValues) && (g.transform = u ? u({}, "") : "none", this.hasProjected = !1), g;
|
|
4590
4592
|
}
|
|
4591
4593
|
const f = h.animationValues || h.latestValues;
|
|
4592
4594
|
this.applyTransformsToTarget(), c.transform = uu(this.projectionDeltaWithTransform, this.treeScale, f), u && (c.transform = u(f, c.transform));
|
|
4593
|
-
const { x: d, y:
|
|
4594
|
-
c.transformOrigin = `${d.origin * 100}% ${
|
|
4595
|
-
for (const
|
|
4596
|
-
if (f[
|
|
4595
|
+
const { x: d, y: p } = this.projectionDelta;
|
|
4596
|
+
c.transformOrigin = `${d.origin * 100}% ${p.origin * 100}% 0`, h.animationValues ? c.opacity = h === this ? (l = (a = f.opacity) !== null && a !== void 0 ? a : this.latestValues.opacity) !== null && l !== void 0 ? l : 1 : this.preserveOpacity ? this.latestValues.opacity : f.opacityExit : c.opacity = h === this ? f.opacity !== void 0 ? f.opacity : "" : f.opacityExit !== void 0 ? f.opacityExit : 0;
|
|
4597
|
+
for (const g in Pe) {
|
|
4598
|
+
if (f[g] === void 0)
|
|
4597
4599
|
continue;
|
|
4598
|
-
const { correct: v, applyTo: y } = Pe[
|
|
4600
|
+
const { correct: v, applyTo: y } = Pe[g], x = c.transform === "none" ? f[g] : v(f[g], h);
|
|
4599
4601
|
if (y) {
|
|
4600
4602
|
const b = y.length;
|
|
4601
4603
|
for (let w = 0; w < b; w++)
|
|
4602
4604
|
c[y[w]] = x;
|
|
4603
4605
|
} else
|
|
4604
|
-
c[
|
|
4606
|
+
c[g] = x;
|
|
4605
4607
|
}
|
|
4606
4608
|
return this.options.layoutId && (c.pointerEvents = h === this ? ye(r == null ? void 0 : r.pointerEvents) || "" : "none"), c;
|
|
4607
4609
|
}
|
|
@@ -4613,7 +4615,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4613
4615
|
this.root.nodes.forEach((r) => {
|
|
4614
4616
|
var a;
|
|
4615
4617
|
return (a = r.currentAnimation) === null || a === void 0 ? void 0 : a.stop();
|
|
4616
|
-
}), this.root.nodes.forEach(
|
|
4618
|
+
}), this.root.nodes.forEach(fs), this.root.sharedNodes.clear();
|
|
4617
4619
|
}
|
|
4618
4620
|
};
|
|
4619
4621
|
}
|
|
@@ -4625,28 +4627,28 @@ function mu(t) {
|
|
|
4625
4627
|
const n = ((e = t.resumeFrom) === null || e === void 0 ? void 0 : e.snapshot) || t.snapshot;
|
|
4626
4628
|
if (t.isLead() && t.layout && n && t.hasListeners("didUpdate")) {
|
|
4627
4629
|
const { layoutBox: i, measuredBox: s } = t.layout, { animationType: o } = t.options, r = n.source !== t.layout.source;
|
|
4628
|
-
o === "size" ?
|
|
4630
|
+
o === "size" ? q((h) => {
|
|
4629
4631
|
const f = r ? n.measuredBox[h] : n.layoutBox[h], d = Y(f);
|
|
4630
4632
|
f.min = i[h].min, f.max = f.min + d;
|
|
4631
|
-
}) :
|
|
4633
|
+
}) : to(o, n.layoutBox, i) && q((h) => {
|
|
4632
4634
|
const f = r ? n.measuredBox[h] : n.layoutBox[h], d = Y(i[h]);
|
|
4633
4635
|
f.max = f.min + d, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + d);
|
|
4634
4636
|
});
|
|
4635
|
-
const a =
|
|
4637
|
+
const a = kt();
|
|
4636
4638
|
qt(a, i, n.layoutBox);
|
|
4637
|
-
const l =
|
|
4639
|
+
const l = kt();
|
|
4638
4640
|
r ? qt(l, t.applyTransform(s, !0), n.measuredBox) : qt(l, i, n.layoutBox);
|
|
4639
|
-
const c = !
|
|
4641
|
+
const c = !qr(a);
|
|
4640
4642
|
let u = !1;
|
|
4641
4643
|
if (!t.resumeFrom) {
|
|
4642
4644
|
const h = t.getClosestProjectingParent();
|
|
4643
4645
|
if (h && !h.resumeFrom) {
|
|
4644
4646
|
const { snapshot: f, layout: d } = h;
|
|
4645
4647
|
if (f && d) {
|
|
4646
|
-
const
|
|
4647
|
-
Zt(
|
|
4648
|
-
const
|
|
4649
|
-
Zt(
|
|
4648
|
+
const p = F();
|
|
4649
|
+
Zt(p, n.layoutBox, f.layoutBox);
|
|
4650
|
+
const g = F();
|
|
4651
|
+
Zt(g, i, d.layoutBox), Zr(p, g) || (u = !0), h.options.layoutRoot && (t.relativeTarget = g, t.relativeTargetOrigin = p, t.relativeParent = h);
|
|
4650
4652
|
}
|
|
4651
4653
|
}
|
|
4652
4654
|
}
|
|
@@ -4665,7 +4667,7 @@ function mu(t) {
|
|
|
4665
4667
|
t.options.transition = void 0;
|
|
4666
4668
|
}
|
|
4667
4669
|
function pu(t) {
|
|
4668
|
-
zt &&
|
|
4670
|
+
zt && pt.totalNodes++, t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
|
|
4669
4671
|
}
|
|
4670
4672
|
function gu(t) {
|
|
4671
4673
|
t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = !1;
|
|
@@ -4673,7 +4675,7 @@ function gu(t) {
|
|
|
4673
4675
|
function yu(t) {
|
|
4674
4676
|
t.clearSnapshot();
|
|
4675
4677
|
}
|
|
4676
|
-
function
|
|
4678
|
+
function fs(t) {
|
|
4677
4679
|
t.clearMeasurements();
|
|
4678
4680
|
}
|
|
4679
4681
|
function vu(t) {
|
|
@@ -4683,7 +4685,7 @@ function xu(t) {
|
|
|
4683
4685
|
const { visualElement: e } = t.options;
|
|
4684
4686
|
e && e.getProps().onBeforeLayoutMeasure && e.notify("BeforeLayoutMeasure"), t.resetTransform();
|
|
4685
4687
|
}
|
|
4686
|
-
function
|
|
4688
|
+
function ds(t) {
|
|
4687
4689
|
t.finishAnimation(), t.targetDelta = t.relativeTarget = t.target = void 0, t.isProjectionDirty = !0;
|
|
4688
4690
|
}
|
|
4689
4691
|
function Tu(t) {
|
|
@@ -4698,14 +4700,14 @@ function Pu(t) {
|
|
|
4698
4700
|
function wu(t) {
|
|
4699
4701
|
t.removeLeadSnapshot();
|
|
4700
4702
|
}
|
|
4701
|
-
function
|
|
4702
|
-
t.translate =
|
|
4703
|
+
function ms(t, e, n) {
|
|
4704
|
+
t.translate = L(e.translate, 0, n), t.scale = L(e.scale, 1, n), t.origin = e.origin, t.originPoint = e.originPoint;
|
|
4703
4705
|
}
|
|
4704
|
-
function
|
|
4705
|
-
t.min =
|
|
4706
|
+
function ps(t, e, n, i) {
|
|
4707
|
+
t.min = L(e.min, n.min, i), t.max = L(e.max, n.max, i);
|
|
4706
4708
|
}
|
|
4707
4709
|
function Su(t, e, n, i) {
|
|
4708
|
-
|
|
4710
|
+
ps(t.x, e.x, n.x, i), ps(t.y, e.y, n.y, i);
|
|
4709
4711
|
}
|
|
4710
4712
|
function Au(t) {
|
|
4711
4713
|
return t.animationValues && t.animationValues.opacityExit !== void 0;
|
|
@@ -4713,21 +4715,21 @@ function Au(t) {
|
|
|
4713
4715
|
const Vu = {
|
|
4714
4716
|
duration: 0.45,
|
|
4715
4717
|
ease: [0.4, 0, 0.1, 1]
|
|
4716
|
-
},
|
|
4717
|
-
function
|
|
4718
|
-
t.min =
|
|
4718
|
+
}, gs = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), ys = gs("applewebkit/") && !gs("chrome/") ? Math.round : H;
|
|
4719
|
+
function vs(t) {
|
|
4720
|
+
t.min = ys(t.min), t.max = ys(t.max);
|
|
4719
4721
|
}
|
|
4720
4722
|
function Eu(t) {
|
|
4721
|
-
|
|
4723
|
+
vs(t.x), vs(t.y);
|
|
4722
4724
|
}
|
|
4723
|
-
function
|
|
4724
|
-
return t === "position" || t === "preserve-aspect" && !Rc(
|
|
4725
|
+
function to(t, e, n) {
|
|
4726
|
+
return t === "position" || t === "preserve-aspect" && !Rc(cs(e), cs(n), 0.2);
|
|
4725
4727
|
}
|
|
4726
4728
|
function Cu(t) {
|
|
4727
4729
|
var e;
|
|
4728
4730
|
return t !== t.root && ((e = t.scroll) === null || e === void 0 ? void 0 : e.wasRoot);
|
|
4729
4731
|
}
|
|
4730
|
-
const Du =
|
|
4732
|
+
const Du = Qr({
|
|
4731
4733
|
attachResizeListener: (t, e) => ie(t, "resize", e),
|
|
4732
4734
|
measureScroll: () => ({
|
|
4733
4735
|
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
@@ -4736,7 +4738,7 @@ const Du = to({
|
|
|
4736
4738
|
checkIsScrollRoot: () => !0
|
|
4737
4739
|
}), Ze = {
|
|
4738
4740
|
current: void 0
|
|
4739
|
-
},
|
|
4741
|
+
}, eo = Qr({
|
|
4740
4742
|
measureScroll: (t) => ({
|
|
4741
4743
|
x: t.scrollLeft,
|
|
4742
4744
|
y: t.scrollTop
|
|
@@ -4758,25 +4760,25 @@ const Du = to({
|
|
|
4758
4760
|
},
|
|
4759
4761
|
drag: {
|
|
4760
4762
|
Feature: Kc,
|
|
4761
|
-
ProjectionNode:
|
|
4762
|
-
MeasureLayout:
|
|
4763
|
+
ProjectionNode: eo,
|
|
4764
|
+
MeasureLayout: zr
|
|
4763
4765
|
}
|
|
4764
4766
|
};
|
|
4765
|
-
function
|
|
4767
|
+
function xs(t, e, n) {
|
|
4766
4768
|
const { props: i } = t;
|
|
4767
4769
|
t.animationState && i.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
4768
4770
|
const s = "onHover" + n, o = i[s];
|
|
4769
|
-
o && M.postRender(() => o(e,
|
|
4771
|
+
o && M.postRender(() => o(e, ce(e)));
|
|
4770
4772
|
}
|
|
4771
|
-
class Mu extends
|
|
4773
|
+
class Mu extends ft {
|
|
4772
4774
|
mount() {
|
|
4773
4775
|
const { current: e } = this.node;
|
|
4774
|
-
e && (this.unmount = Ra(e, (n) => (
|
|
4776
|
+
e && (this.unmount = Ra(e, (n) => (xs(this.node, n, "Start"), (i) => xs(this.node, i, "End"))));
|
|
4775
4777
|
}
|
|
4776
4778
|
unmount() {
|
|
4777
4779
|
}
|
|
4778
4780
|
}
|
|
4779
|
-
class ku extends
|
|
4781
|
+
class ku extends ft {
|
|
4780
4782
|
constructor() {
|
|
4781
4783
|
super(...arguments), this.isActive = !1;
|
|
4782
4784
|
}
|
|
@@ -4793,21 +4795,21 @@ class ku extends mt {
|
|
|
4793
4795
|
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
4794
4796
|
}
|
|
4795
4797
|
mount() {
|
|
4796
|
-
this.unmount =
|
|
4798
|
+
this.unmount = le(ie(this.node.current, "focus", () => this.onFocus()), ie(this.node.current, "blur", () => this.onBlur()));
|
|
4797
4799
|
}
|
|
4798
4800
|
unmount() {
|
|
4799
4801
|
}
|
|
4800
4802
|
}
|
|
4801
|
-
function
|
|
4803
|
+
function Ts(t, e, n) {
|
|
4802
4804
|
const { props: i } = t;
|
|
4803
4805
|
t.animationState && i.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
4804
4806
|
const s = "onTap" + (n === "End" ? "" : n), o = i[s];
|
|
4805
|
-
o && M.postRender(() => o(e,
|
|
4807
|
+
o && M.postRender(() => o(e, ce(e)));
|
|
4806
4808
|
}
|
|
4807
|
-
class Lu extends
|
|
4809
|
+
class Lu extends ft {
|
|
4808
4810
|
mount() {
|
|
4809
4811
|
const { current: e } = this.node;
|
|
4810
|
-
e && (this.unmount = ja(e, (n) => (
|
|
4812
|
+
e && (this.unmount = ja(e, (n) => (Ts(this.node, n, "Start"), (i, { success: s }) => Ts(this.node, i, s ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
4811
4813
|
}
|
|
4812
4814
|
unmount() {
|
|
4813
4815
|
}
|
|
@@ -4824,17 +4826,17 @@ function Fu({ root: t, ...e }) {
|
|
|
4824
4826
|
const i = Je.get(n), s = JSON.stringify(e);
|
|
4825
4827
|
return i[s] || (i[s] = new IntersectionObserver(Ou, { root: t, ...e })), i[s];
|
|
4826
4828
|
}
|
|
4827
|
-
function
|
|
4829
|
+
function _u(t, e, n) {
|
|
4828
4830
|
const i = Fu(e);
|
|
4829
4831
|
return pn.set(t, n), i.observe(t), () => {
|
|
4830
4832
|
pn.delete(t), i.unobserve(t);
|
|
4831
4833
|
};
|
|
4832
4834
|
}
|
|
4833
|
-
const
|
|
4835
|
+
const Bu = {
|
|
4834
4836
|
some: 0,
|
|
4835
4837
|
all: 1
|
|
4836
4838
|
};
|
|
4837
|
-
class Nu extends
|
|
4839
|
+
class Nu extends ft {
|
|
4838
4840
|
constructor() {
|
|
4839
4841
|
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
4840
4842
|
}
|
|
@@ -4843,7 +4845,7 @@ class Nu extends mt {
|
|
|
4843
4845
|
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: i, amount: s = "some", once: o } = e, r = {
|
|
4844
4846
|
root: n ? n.current : void 0,
|
|
4845
4847
|
rootMargin: i,
|
|
4846
|
-
threshold: typeof s == "number" ? s :
|
|
4848
|
+
threshold: typeof s == "number" ? s : Bu[s]
|
|
4847
4849
|
}, a = (l) => {
|
|
4848
4850
|
const { isIntersecting: c } = l;
|
|
4849
4851
|
if (this.isInView === c || (this.isInView = c, o && !c && this.hasEnteredView))
|
|
@@ -4852,7 +4854,7 @@ class Nu extends mt {
|
|
|
4852
4854
|
const { onViewportEnter: u, onViewportLeave: h } = this.node.getProps(), f = c ? u : h;
|
|
4853
4855
|
f && f(l);
|
|
4854
4856
|
};
|
|
4855
|
-
return
|
|
4857
|
+
return _u(this.node.current, r, a);
|
|
4856
4858
|
}
|
|
4857
4859
|
mount() {
|
|
4858
4860
|
this.startObserver();
|
|
@@ -4861,12 +4863,12 @@ class Nu extends mt {
|
|
|
4861
4863
|
if (typeof IntersectionObserver > "u")
|
|
4862
4864
|
return;
|
|
4863
4865
|
const { props: e, prevProps: n } = this.node;
|
|
4864
|
-
["amount", "margin", "root"].some(
|
|
4866
|
+
["amount", "margin", "root"].some(Iu(e, n)) && this.startObserver();
|
|
4865
4867
|
}
|
|
4866
4868
|
unmount() {
|
|
4867
4869
|
}
|
|
4868
4870
|
}
|
|
4869
|
-
function
|
|
4871
|
+
function Iu({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
4870
4872
|
return (n) => t[n] !== e[n];
|
|
4871
4873
|
}
|
|
4872
4874
|
const Uu = {
|
|
@@ -4884,19 +4886,19 @@ const Uu = {
|
|
|
4884
4886
|
}
|
|
4885
4887
|
}, $u = {
|
|
4886
4888
|
layout: {
|
|
4887
|
-
ProjectionNode:
|
|
4888
|
-
MeasureLayout:
|
|
4889
|
+
ProjectionNode: eo,
|
|
4890
|
+
MeasureLayout: zr
|
|
4889
4891
|
}
|
|
4890
|
-
}, gn = { current: null },
|
|
4892
|
+
}, gn = { current: null }, no = { current: !1 };
|
|
4891
4893
|
function Wu() {
|
|
4892
|
-
if (
|
|
4894
|
+
if (no.current = !0, !!wn)
|
|
4893
4895
|
if (window.matchMedia) {
|
|
4894
4896
|
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => gn.current = t.matches;
|
|
4895
4897
|
t.addListener(e), e();
|
|
4896
4898
|
} else
|
|
4897
4899
|
gn.current = !1;
|
|
4898
4900
|
}
|
|
4899
|
-
const Gu = [...
|
|
4901
|
+
const Gu = [...Er, W, ht], Ku = (t) => Gu.find(Vr(t)), bs = /* @__PURE__ */ new WeakMap();
|
|
4900
4902
|
function Hu(t, e, n) {
|
|
4901
4903
|
for (const i in e) {
|
|
4902
4904
|
const s = e[i], o = n[i];
|
|
@@ -4917,7 +4919,7 @@ function Hu(t, e, n) {
|
|
|
4917
4919
|
e[i] === void 0 && t.removeValue(i);
|
|
4918
4920
|
return e;
|
|
4919
4921
|
}
|
|
4920
|
-
const
|
|
4922
|
+
const Ps = [
|
|
4921
4923
|
"AnimationStart",
|
|
4922
4924
|
"AnimationComplete",
|
|
4923
4925
|
"Update",
|
|
@@ -4941,22 +4943,22 @@ class zu {
|
|
|
4941
4943
|
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = qn, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
4942
4944
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
4943
4945
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
4944
|
-
const d =
|
|
4946
|
+
const d = et.now();
|
|
4945
4947
|
this.renderScheduledAt < d && (this.renderScheduledAt = d, M.render(this.render, !1, !0));
|
|
4946
4948
|
};
|
|
4947
4949
|
const { latestValues: l, renderState: c, onUpdate: u } = r;
|
|
4948
|
-
this.onUpdate = u, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = e, this.props = n, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = s, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = Oe(n), this.isVariantNode =
|
|
4950
|
+
this.onUpdate = u, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = e, this.props = n, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = s, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = Oe(n), this.isVariantNode = Os(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
4949
4951
|
const { willChange: h, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
4950
4952
|
for (const d in f) {
|
|
4951
|
-
const
|
|
4952
|
-
l[d] !== void 0 && G(
|
|
4953
|
+
const p = f[d];
|
|
4954
|
+
l[d] !== void 0 && G(p) && p.set(l[d], !1);
|
|
4953
4955
|
}
|
|
4954
4956
|
}
|
|
4955
4957
|
mount(e) {
|
|
4956
|
-
this.current = e,
|
|
4958
|
+
this.current = e, bs.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, i) => this.bindToMotionValue(i, n)), no.current || Wu(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : gn.current, process.env.NODE_ENV !== "production" && ke(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
4957
4959
|
}
|
|
4958
4960
|
unmount() {
|
|
4959
|
-
|
|
4961
|
+
bs.delete(this.current), this.projection && this.projection.unmount(), ut(this.notifyUpdate), ut(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
4960
4962
|
for (const e in this.events)
|
|
4961
4963
|
this.events[e].clear();
|
|
4962
4964
|
for (const e in this.features) {
|
|
@@ -4967,7 +4969,7 @@ class zu {
|
|
|
4967
4969
|
}
|
|
4968
4970
|
bindToMotionValue(e, n) {
|
|
4969
4971
|
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
4970
|
-
const i =
|
|
4972
|
+
const i = bt.has(e), s = n.on("change", (a) => {
|
|
4971
4973
|
this.latestValues[e] = a, this.props.onUpdate && M.preRender(this.notifyUpdate), i && this.projection && (this.projection.isTransformDirty = !0);
|
|
4972
4974
|
}), o = n.on("renderRequest", this.scheduleRender);
|
|
4973
4975
|
let r;
|
|
@@ -4980,8 +4982,8 @@ class zu {
|
|
|
4980
4982
|
}
|
|
4981
4983
|
updateFeatures() {
|
|
4982
4984
|
let e = "animation";
|
|
4983
|
-
for (e in
|
|
4984
|
-
const n =
|
|
4985
|
+
for (e in Ft) {
|
|
4986
|
+
const n = Ft[e];
|
|
4985
4987
|
if (!n)
|
|
4986
4988
|
continue;
|
|
4987
4989
|
const { isEnabled: i, Feature: s } = n;
|
|
@@ -5000,7 +5002,7 @@ class zu {
|
|
|
5000
5002
|
* removed with a re-render to work.
|
|
5001
5003
|
*/
|
|
5002
5004
|
measureViewportBox() {
|
|
5003
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
5005
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : F();
|
|
5004
5006
|
}
|
|
5005
5007
|
getStaticValue(e) {
|
|
5006
5008
|
return this.latestValues[e];
|
|
@@ -5014,8 +5016,8 @@ class zu {
|
|
|
5014
5016
|
*/
|
|
5015
5017
|
update(e, n) {
|
|
5016
5018
|
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
5017
|
-
for (let i = 0; i <
|
|
5018
|
-
const s =
|
|
5019
|
+
for (let i = 0; i < Ps.length; i++) {
|
|
5020
|
+
const s = Ps[i];
|
|
5019
5021
|
this.propEventSubscriptions[s] && (this.propEventSubscriptions[s](), delete this.propEventSubscriptions[s]);
|
|
5020
5022
|
const o = "on" + s, r = e[o];
|
|
5021
5023
|
r && (this.propEventSubscriptions[s] = this.on(s, r));
|
|
@@ -5086,7 +5088,7 @@ class zu {
|
|
|
5086
5088
|
readValue(e, n) {
|
|
5087
5089
|
var i;
|
|
5088
5090
|
let s = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (i = this.getBaseTargetFromProps(this.props, e)) !== null && i !== void 0 ? i : this.readValueFromInstance(this.current, e, this.options);
|
|
5089
|
-
return s != null && (typeof s == "string" && (
|
|
5091
|
+
return s != null && (typeof s == "string" && (Sr(s) || pr(s)) ? s = parseFloat(s) : !Ku(s) && ht.test(n) && (s = br(e, n)), this.setBaseTarget(e, G(s) ? s.get() : s)), G(s) ? s.get() : s;
|
|
5090
5092
|
}
|
|
5091
5093
|
/**
|
|
5092
5094
|
* Set the base target to later animate back to. This is currently
|
|
@@ -5119,9 +5121,9 @@ class zu {
|
|
|
5119
5121
|
this.events[e] && this.events[e].notify(...n);
|
|
5120
5122
|
}
|
|
5121
5123
|
}
|
|
5122
|
-
class
|
|
5124
|
+
class io extends zu {
|
|
5123
5125
|
constructor() {
|
|
5124
|
-
super(...arguments), this.KeyframeResolver =
|
|
5126
|
+
super(...arguments), this.KeyframeResolver = Cr;
|
|
5125
5127
|
}
|
|
5126
5128
|
sortInstanceNodePosition(e, n) {
|
|
5127
5129
|
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
@@ -5143,105 +5145,104 @@ class so extends zu {
|
|
|
5143
5145
|
function Yu(t) {
|
|
5144
5146
|
return window.getComputedStyle(t);
|
|
5145
5147
|
}
|
|
5146
|
-
class Xu extends
|
|
5148
|
+
class Xu extends io {
|
|
5147
5149
|
constructor() {
|
|
5148
|
-
super(...arguments), this.type = "html", this.renderInstance =
|
|
5150
|
+
super(...arguments), this.type = "html", this.renderInstance = Gs;
|
|
5149
5151
|
}
|
|
5150
5152
|
readValueFromInstance(e, n) {
|
|
5151
|
-
if (
|
|
5153
|
+
if (bt.has(n)) {
|
|
5152
5154
|
const i = Xn(n);
|
|
5153
5155
|
return i && i.default || 0;
|
|
5154
5156
|
} else {
|
|
5155
|
-
const i = Yu(e), s = (
|
|
5157
|
+
const i = Yu(e), s = (Us(n) ? i.getPropertyValue(n) : i[n]) || 0;
|
|
5156
5158
|
return typeof s == "string" ? s.trim() : s;
|
|
5157
5159
|
}
|
|
5158
5160
|
}
|
|
5159
5161
|
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
5160
|
-
return
|
|
5162
|
+
return Kr(e, n);
|
|
5161
5163
|
}
|
|
5162
5164
|
build(e, n, i) {
|
|
5163
5165
|
Ln(e, n, i.transformTemplate);
|
|
5164
5166
|
}
|
|
5165
5167
|
scrapeMotionValuesFromProps(e, n, i) {
|
|
5166
|
-
return
|
|
5168
|
+
return _n(e, n, i);
|
|
5167
5169
|
}
|
|
5168
5170
|
}
|
|
5169
|
-
class qu extends
|
|
5171
|
+
class qu extends io {
|
|
5170
5172
|
constructor() {
|
|
5171
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
5173
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = F;
|
|
5172
5174
|
}
|
|
5173
5175
|
getBaseTargetFromProps(e, n) {
|
|
5174
5176
|
return e[n];
|
|
5175
5177
|
}
|
|
5176
5178
|
readValueFromInstance(e, n) {
|
|
5177
|
-
if (
|
|
5179
|
+
if (bt.has(n)) {
|
|
5178
5180
|
const i = Xn(n);
|
|
5179
5181
|
return i && i.default || 0;
|
|
5180
5182
|
}
|
|
5181
|
-
return n =
|
|
5183
|
+
return n = Ks.has(n) ? n : En(n), e.getAttribute(n);
|
|
5182
5184
|
}
|
|
5183
5185
|
scrapeMotionValuesFromProps(e, n, i) {
|
|
5184
|
-
return
|
|
5186
|
+
return Ys(e, n, i);
|
|
5185
5187
|
}
|
|
5186
5188
|
build(e, n, i) {
|
|
5187
5189
|
jn(e, n, this.isSVGTag, i.transformTemplate);
|
|
5188
5190
|
}
|
|
5189
5191
|
renderInstance(e, n, i, s) {
|
|
5190
|
-
|
|
5192
|
+
Hs(e, n, i, s);
|
|
5191
5193
|
}
|
|
5192
5194
|
mount(e) {
|
|
5193
5195
|
this.isSVGTag = Fn(e.tagName), super.mount(e);
|
|
5194
5196
|
}
|
|
5195
5197
|
}
|
|
5196
5198
|
const Zu = (t, e) => Dn(t) ? new qu(e) : new Xu(e, {
|
|
5197
|
-
allowProjection: t !==
|
|
5199
|
+
allowProjection: t !== Cs
|
|
5198
5200
|
}), Ju = /* @__PURE__ */ wa({
|
|
5199
5201
|
...bc,
|
|
5200
5202
|
...Uu,
|
|
5201
5203
|
...Ru,
|
|
5202
5204
|
...$u
|
|
5203
|
-
}, Zu), Ce = /* @__PURE__ */
|
|
5205
|
+
}, Zu), Ce = /* @__PURE__ */ Bo(Ju);
|
|
5204
5206
|
function Te(t) {
|
|
5205
|
-
|
|
5207
|
+
const e = new Error(t);
|
|
5206
5208
|
return e.source = "ulid", e;
|
|
5207
5209
|
}
|
|
5208
|
-
|
|
5210
|
+
const ti = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Jt = ti.length, ws = Math.pow(2, 48) - 1, Qu = 10, th = 16;
|
|
5209
5211
|
function eh(t) {
|
|
5210
|
-
|
|
5212
|
+
let e = Math.floor(t() * Jt);
|
|
5211
5213
|
return e === Jt && (e = Jt - 1), ti.charAt(e);
|
|
5212
5214
|
}
|
|
5213
5215
|
function nh(t, e) {
|
|
5214
5216
|
if (isNaN(t))
|
|
5215
5217
|
throw new Error(t + " must be a number");
|
|
5216
|
-
if (t >
|
|
5217
|
-
throw Te("cannot encode time greater than " +
|
|
5218
|
+
if (t > ws)
|
|
5219
|
+
throw Te("cannot encode time greater than " + ws);
|
|
5218
5220
|
if (t < 0)
|
|
5219
5221
|
throw Te("time must be positive");
|
|
5220
|
-
if (Number.isInteger(t) === !1)
|
|
5222
|
+
if (Number.isInteger(Number(t)) === !1)
|
|
5221
5223
|
throw Te("time must be an integer");
|
|
5222
|
-
|
|
5224
|
+
let n, i = "";
|
|
5225
|
+
for (; e > 0; e--)
|
|
5223
5226
|
n = t % Jt, i = ti.charAt(n) + i, t = (t - n) / Jt;
|
|
5224
5227
|
return i;
|
|
5225
5228
|
}
|
|
5226
5229
|
function ih(t, e) {
|
|
5227
|
-
|
|
5230
|
+
let n = "";
|
|
5231
|
+
for (; t > 0; t--)
|
|
5228
5232
|
n = eh(e) + n;
|
|
5229
5233
|
return n;
|
|
5230
5234
|
}
|
|
5231
|
-
function sh() {
|
|
5232
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = arguments[1];
|
|
5235
|
+
function sh(t = !1, e) {
|
|
5233
5236
|
e || (e = typeof window < "u" ? window : null);
|
|
5234
|
-
|
|
5237
|
+
const n = e && (e.crypto || e.msCrypto);
|
|
5235
5238
|
if (n)
|
|
5236
|
-
return
|
|
5237
|
-
|
|
5238
|
-
return n.getRandomValues(
|
|
5239
|
+
return () => {
|
|
5240
|
+
const i = new Uint8Array(1);
|
|
5241
|
+
return n.getRandomValues(i), i[0] / 255;
|
|
5239
5242
|
};
|
|
5240
5243
|
try {
|
|
5241
|
-
|
|
5242
|
-
return
|
|
5243
|
-
return i.randomBytes(1).readUInt8() / 255;
|
|
5244
|
-
};
|
|
5244
|
+
const i = require("crypto");
|
|
5245
|
+
return () => i.randomBytes(1).readUInt8() / 255;
|
|
5245
5246
|
} catch {
|
|
5246
5247
|
}
|
|
5247
5248
|
if (t) {
|
|
@@ -5249,9 +5250,7 @@ function sh() {
|
|
|
5249
5250
|
console.error("secure crypto unusable, falling back to insecure Math.random()!");
|
|
5250
5251
|
} catch {
|
|
5251
5252
|
}
|
|
5252
|
-
return
|
|
5253
|
-
return Math.random();
|
|
5254
|
-
};
|
|
5253
|
+
return () => Math.random();
|
|
5255
5254
|
}
|
|
5256
5255
|
throw Te("secure crypto unusable, insecure Math.random not allowed");
|
|
5257
5256
|
}
|
|
@@ -5260,21 +5259,22 @@ function rh(t) {
|
|
|
5260
5259
|
return isNaN(n) && (n = Date.now()), nh(n, Qu) + ih(th, t);
|
|
5261
5260
|
};
|
|
5262
5261
|
}
|
|
5263
|
-
|
|
5264
|
-
|
|
5262
|
+
const oh = rh();
|
|
5263
|
+
var gt = /* @__PURE__ */ ((t) => (t.Escape = "Escape", t.Enter = "Enter", t.Space = "Space", t.Tab = "Tab", t.ShiftAndTab = "Shift+Tab", t.ArrowUp = "ArrowUp", t.ArrowDown = "ArrowDown", t.ArrowLeft = "ArrowLeft", t.ArrowRight = "ArrowRight", t))(gt || {});
|
|
5264
|
+
const Ss = ({
|
|
5265
5265
|
onMousedown: t
|
|
5266
|
-
}) => (
|
|
5266
|
+
}) => (it(() => (document.addEventListener("mousedown", t), () => {
|
|
5267
5267
|
document.removeEventListener("mousedown", t);
|
|
5268
5268
|
}), []), null), ah = ({
|
|
5269
5269
|
onPickerHide: t
|
|
5270
|
-
}) => (
|
|
5270
|
+
}) => (it(() => () => {
|
|
5271
5271
|
t();
|
|
5272
|
-
}, []), null), lh = "acrool-react-picker__main-el", ch = "acrool-react-picker__picker-el",
|
|
5272
|
+
}, []), null), lh = "acrool-react-picker__main-el", ch = "acrool-react-picker__picker-el", As = {
|
|
5273
5273
|
mainEl: lh,
|
|
5274
5274
|
pickerEl: ch
|
|
5275
5275
|
}, ei = (t, e) => (n) => {
|
|
5276
5276
|
e.current = n, t && (typeof t == "function" ? t(n) : t && (t.current = n));
|
|
5277
|
-
},
|
|
5277
|
+
}, so = {
|
|
5278
5278
|
variants: {
|
|
5279
5279
|
initial: { opacity: 0, transition: { type: "spring" } },
|
|
5280
5280
|
animate: { opacity: 1, transition: { type: "just" } },
|
|
@@ -5313,11 +5313,11 @@ const mh = (t, e, n, i) => {
|
|
|
5313
5313
|
var T;
|
|
5314
5314
|
const s = (T = t.current) == null ? void 0 : T.firstChild, o = e.current;
|
|
5315
5315
|
if (!s || !o) return;
|
|
5316
|
-
const r = o.getBoundingClientRect(), a = s.getBoundingClientRect(), l = window.innerHeight, c = window.innerWidth, u = window.pageYOffset || document.documentElement.scrollTop, h = window.pageXOffset || document.documentElement.scrollLeft, f = 8, d = a.top - f,
|
|
5317
|
-
let
|
|
5316
|
+
const r = o.getBoundingClientRect(), a = s.getBoundingClientRect(), l = window.innerHeight, c = window.innerWidth, u = window.pageYOffset || document.documentElement.scrollTop, h = window.pageXOffset || document.documentElement.scrollLeft, f = 8, d = a.top - f, p = l - a.bottom - f;
|
|
5317
|
+
let g = (i == null ? void 0 : i.vertical) ?? (p >= d ? nt.bottom : nt.top), v = g === nt.bottom ? p : d;
|
|
5318
5318
|
const y = r.width, x = a.left + y < c, b = a.right - y > 0;
|
|
5319
|
-
let w = (i == null ? void 0 : i.horizontal) ??
|
|
5320
|
-
!x && b ? w =
|
|
5319
|
+
let w = (i == null ? void 0 : i.horizontal) ?? Ct.left;
|
|
5320
|
+
!x && b ? w = Ct.right : !x && !b && (w = Ct.left), n(g), o.style.top = g === nt.bottom ? `${a.bottom + u}px` : `${a.top + u - v}px`, o.style.left = w === Ct.left ? `${a.left + h}px` : w === Ct.center ? `${a.left + h + (a.width - y) / 2}px` : `${a.right + h - y}px`, o.style.minWidth = `${a.width}px`, o.style.height = `${v}px`, o.style.transformOrigin = g === nt.bottom ? "top" : "bottom", o.style.flexDirection = g === nt.bottom ? "column" : "column-reverse";
|
|
5321
5321
|
}, ph = ({
|
|
5322
5322
|
children: t,
|
|
5323
5323
|
isDebug: e = !1,
|
|
@@ -5333,7 +5333,7 @@ const mh = (t, e, n, i) => {
|
|
|
5333
5333
|
a.importantPosition
|
|
5334
5334
|
);
|
|
5335
5335
|
}, [a.setVertical, a.importantPosition]);
|
|
5336
|
-
return
|
|
5336
|
+
return it(() => {
|
|
5337
5337
|
if (a.isVisible && n.current && r.current) {
|
|
5338
5338
|
const c = dh(n.current);
|
|
5339
5339
|
return c && (c.addEventListener("scroll", l), window.addEventListener("resize", l)), window.requestAnimationFrame(() => {
|
|
@@ -5350,7 +5350,7 @@ const mh = (t, e, n, i) => {
|
|
|
5350
5350
|
initial: "initial",
|
|
5351
5351
|
animate: "animate",
|
|
5352
5352
|
exit: "exit",
|
|
5353
|
-
...
|
|
5353
|
+
...so
|
|
5354
5354
|
},
|
|
5355
5355
|
"mask"
|
|
5356
5356
|
),
|
|
@@ -5388,7 +5388,7 @@ const mh = (t, e, n, i) => {
|
|
|
5388
5388
|
initial: "initial",
|
|
5389
5389
|
animate: "animate",
|
|
5390
5390
|
exit: "exit",
|
|
5391
|
-
...
|
|
5391
|
+
...so
|
|
5392
5392
|
},
|
|
5393
5393
|
"mask"
|
|
5394
5394
|
),
|
|
@@ -5412,63 +5412,63 @@ const mh = (t, e, n, i) => {
|
|
|
5412
5412
|
function wh(t, e, n) {
|
|
5413
5413
|
const i = t;
|
|
5414
5414
|
return Re((o, r) => {
|
|
5415
|
-
const [a, l] =
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
}, [JSON.stringify(o.value)]),
|
|
5415
|
+
const [a, l] = Dt(!1), [c, u] = Dt(!1), [h, f] = Dt(nt.bottom), [d, p] = Dt(), g = K(null), v = K(null), y = K(null), x = K(d), b = (n == null ? void 0 : n.isEnableClickOutSiteHidden) !== !1, w = (n == null ? void 0 : n.isEnableHideSave) !== !1, T = n == null ? void 0 : n.isVisibleMask;
|
|
5416
|
+
it(() => {
|
|
5417
|
+
p(o.value);
|
|
5418
|
+
}, [JSON.stringify(o.value)]), it(() => {
|
|
5419
5419
|
x.current = d;
|
|
5420
|
-
}, [d]),
|
|
5421
|
-
a &&
|
|
5420
|
+
}, [d]), it(() => {
|
|
5421
|
+
a && p(o.value);
|
|
5422
5422
|
}, [a, o.value]);
|
|
5423
5423
|
const A = z((R) => {
|
|
5424
5424
|
switch (R.key) {
|
|
5425
|
-
case
|
|
5425
|
+
case gt.Escape:
|
|
5426
5426
|
D(a)(R);
|
|
5427
5427
|
break;
|
|
5428
|
-
case
|
|
5429
|
-
case
|
|
5428
|
+
case gt.Tab:
|
|
5429
|
+
case gt.ShiftAndTab:
|
|
5430
5430
|
S(R);
|
|
5431
5431
|
break;
|
|
5432
|
-
case
|
|
5433
|
-
case
|
|
5434
|
-
case
|
|
5435
|
-
|
|
5432
|
+
case gt.ArrowUp:
|
|
5433
|
+
case gt.ArrowDown:
|
|
5434
|
+
case gt.Space:
|
|
5435
|
+
j(R);
|
|
5436
5436
|
break;
|
|
5437
5437
|
}
|
|
5438
5438
|
}, [a]), D = z((R) => (C) => {
|
|
5439
|
-
var
|
|
5440
|
-
R && (C.stopPropagation(), C.preventDefault(), (
|
|
5439
|
+
var N;
|
|
5440
|
+
R && (C.stopPropagation(), C.preventDefault(), (N = v.current) == null || N.focus(), l(!1));
|
|
5441
5441
|
}, []), S = z((R) => {
|
|
5442
5442
|
var C;
|
|
5443
5443
|
(C = v.current) == null || C.focus(), l(!1), u(!1);
|
|
5444
|
-
}, []),
|
|
5444
|
+
}, []), j = z((R) => {
|
|
5445
5445
|
R.preventDefault(), l(!0);
|
|
5446
|
-
}, []),
|
|
5446
|
+
}, []), $ = z(() => {
|
|
5447
5447
|
requestAnimationFrame(() => {
|
|
5448
5448
|
var R;
|
|
5449
5449
|
n != null && n.isDisabledHideAutoFocus ? u(!1) : (R = v.current) == null || R.focus(), l(!1);
|
|
5450
5450
|
});
|
|
5451
|
-
}, [n == null ? void 0 : n.isDisabledHideAutoFocus]),
|
|
5451
|
+
}, [n == null ? void 0 : n.isDisabledHideAutoFocus]), J = z(() => {
|
|
5452
5452
|
l((R) => (R && requestAnimationFrame(() => {
|
|
5453
5453
|
var C;
|
|
5454
5454
|
(C = v.current) == null || C.focus();
|
|
5455
5455
|
}), !R));
|
|
5456
|
-
}, []),
|
|
5457
|
-
!
|
|
5458
|
-
}, []),
|
|
5459
|
-
var
|
|
5460
|
-
const C = (
|
|
5456
|
+
}, []), ot = z((R) => {
|
|
5457
|
+
!g.current && y.current && !y.current.contains(R.target) && u(!1);
|
|
5458
|
+
}, []), Pt = z((R) => {
|
|
5459
|
+
var N;
|
|
5460
|
+
const C = (N = g.current) == null ? void 0 : N.firstChild;
|
|
5461
5461
|
C && !C.contains(R.target) && y.current && !y.current.contains(R.target) && (l(!1), u(!1));
|
|
5462
|
-
}, []),
|
|
5462
|
+
}, []), wt = z(() => {
|
|
5463
5463
|
if (typeof (o == null ? void 0 : o.onChange) > "u") {
|
|
5464
|
-
|
|
5464
|
+
at.warning("@acrool/react-picker", "createPicker component props onChange is undefined, is no call");
|
|
5465
5465
|
return;
|
|
5466
5466
|
}
|
|
5467
5467
|
typeof x.current < "u" && w && JSON.stringify(d) !== JSON.stringify(x.current) && o.onChange(x.current);
|
|
5468
|
-
}, [d, o.onChange, w]),
|
|
5468
|
+
}, [d, o.onChange, w]), St = () => n != null && n.isDisabledAutoPosition ? /* @__PURE__ */ E.jsx(
|
|
5469
5469
|
vh,
|
|
5470
5470
|
{
|
|
5471
|
-
ref:
|
|
5471
|
+
ref: g,
|
|
5472
5472
|
isDebug: n == null ? void 0 : n.isDebug,
|
|
5473
5473
|
onKeyDown: A,
|
|
5474
5474
|
isVisibleMask: T,
|
|
@@ -5478,7 +5478,7 @@ function wh(t, e, n) {
|
|
|
5478
5478
|
) : /* @__PURE__ */ E.jsx(
|
|
5479
5479
|
gh,
|
|
5480
5480
|
{
|
|
5481
|
-
ref:
|
|
5481
|
+
ref: g,
|
|
5482
5482
|
anchorRef: y,
|
|
5483
5483
|
isDebug: n == null ? void 0 : n.isDebug,
|
|
5484
5484
|
onKeyDown: A,
|
|
@@ -5490,15 +5490,15 @@ function wh(t, e, n) {
|
|
|
5490
5490
|
xn.Provider,
|
|
5491
5491
|
{
|
|
5492
5492
|
value: {
|
|
5493
|
-
hide:
|
|
5493
|
+
hide: $,
|
|
5494
5494
|
show: () => l(!0),
|
|
5495
|
-
toggle:
|
|
5495
|
+
toggle: J,
|
|
5496
5496
|
isVisible: a,
|
|
5497
5497
|
inputFocus: () => u(!0),
|
|
5498
5498
|
inputBlur: () => u(!1),
|
|
5499
5499
|
isInputFocus: c,
|
|
5500
5500
|
value: d,
|
|
5501
|
-
onChange:
|
|
5501
|
+
onChange: p,
|
|
5502
5502
|
importantPosition: n == null ? void 0 : n.importantPosition,
|
|
5503
5503
|
vertical: h,
|
|
5504
5504
|
setVertical: f
|
|
@@ -5508,7 +5508,7 @@ function wh(t, e, n) {
|
|
|
5508
5508
|
"div",
|
|
5509
5509
|
{
|
|
5510
5510
|
ref: y,
|
|
5511
|
-
className:
|
|
5511
|
+
className: As.mainEl,
|
|
5512
5512
|
onKeyDown: A,
|
|
5513
5513
|
children: /* @__PURE__ */ E.jsx(
|
|
5514
5514
|
i,
|
|
@@ -5520,24 +5520,24 @@ function wh(t, e, n) {
|
|
|
5520
5520
|
}
|
|
5521
5521
|
),
|
|
5522
5522
|
/* @__PURE__ */ E.jsx(Ro, { children: a && /* @__PURE__ */ E.jsx(
|
|
5523
|
-
|
|
5523
|
+
Ds,
|
|
5524
5524
|
{
|
|
5525
5525
|
id: `acrool-react-picker-${oh().toLowerCase()}`,
|
|
5526
|
-
className:
|
|
5527
|
-
children:
|
|
5526
|
+
className: As.pickerEl,
|
|
5527
|
+
children: St()
|
|
5528
5528
|
}
|
|
5529
5529
|
) }),
|
|
5530
|
-
a && /* @__PURE__ */ E.jsx(ah, { onPickerHide:
|
|
5531
|
-
b && a && /* @__PURE__ */ E.jsx(
|
|
5532
|
-
c && /* @__PURE__ */ E.jsx(
|
|
5530
|
+
a && /* @__PURE__ */ E.jsx(ah, { onPickerHide: wt }),
|
|
5531
|
+
b && a && /* @__PURE__ */ E.jsx(Ss, { onMousedown: Pt }),
|
|
5532
|
+
c && /* @__PURE__ */ E.jsx(Ss, { onMousedown: ot })
|
|
5533
5533
|
] })
|
|
5534
5534
|
}
|
|
5535
5535
|
);
|
|
5536
5536
|
});
|
|
5537
5537
|
}
|
|
5538
5538
|
export {
|
|
5539
|
-
|
|
5540
|
-
|
|
5539
|
+
Ct as EHorizontal,
|
|
5540
|
+
nt as EVertical,
|
|
5541
5541
|
bh as PickerProviderConsumer,
|
|
5542
5542
|
xn as PickerProviderContext,
|
|
5543
5543
|
wh as createPicker,
|