@ssgoi/core 4.0.0 → 4.2.0
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/animator/integrator/double-spring-integrator.d.ts +6 -0
- package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -1
- package/dist/animator/integrator/inertia-integrator.d.ts +15 -0
- package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -1
- package/dist/animator/integrator/provider.d.ts.map +1 -1
- package/dist/animator/integrator/spring-integrator.d.ts +6 -0
- package/dist/animator/integrator/spring-integrator.d.ts.map +1 -1
- package/dist/animator/multi-animator.d.ts +16 -11
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/animator/runner/css-runner.d.ts.map +1 -1
- package/dist/animator/single-animator.d.ts +6 -4
- package/dist/animator/single-animator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +603 -518
- package/dist/provider-Cs5iBqRD.cjs +1 -0
- package/dist/provider-Cu4NSF1Q.js +167 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +4 -1
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +42 -0
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -0
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +6 -6
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +84 -35
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +39 -46
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/wait-paint.d.ts +15 -0
- package/dist/utils/wait-paint.d.ts.map +1 -0
- package/dist/view-transitions/depth.d.ts.map +1 -1
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +673 -688
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/sheet.d.ts.map +1 -1
- package/dist/view-transitions/swap.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/provider-B6Xnh0BA.cjs +0 -1
- package/dist/provider-CMBovM_W.js +0 -134
- package/dist/ssgoi-transition/types.d.ts +0 -8
- package/dist/ssgoi-transition/types.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import { isCssAnimation as
|
|
6
|
-
import { S as
|
|
7
|
-
class
|
|
1
|
+
var tt = Object.defineProperty;
|
|
2
|
+
var et = (e, n, t) => n in e ? tt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var m = (e, n, t) => et(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { normalizeToMultiAnimation as F, normalizeSchedule as X } from "./types.js";
|
|
5
|
+
import { isCssAnimation as _t, isMultiAnimation as Nt, isSingleAnimation as Ut, isTickAnimation as Ht } from "./types.js";
|
|
6
|
+
import { S as $, I as it, a as nt } from "./provider-Cu4NSF1Q.js";
|
|
7
|
+
class rt {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
m(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
|
+
m(this, "rafId", null);
|
|
11
|
+
m(this, "isRunning", !1);
|
|
12
12
|
// Timing
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
m(this, "startTime", Date.now());
|
|
14
|
+
m(this, "lastUpdate", this.startTime);
|
|
15
|
+
m(this, "elapsed", 0);
|
|
16
16
|
// Lag smoothing (mobile optimization)
|
|
17
|
-
|
|
17
|
+
m(this, "lagThreshold", 500);
|
|
18
18
|
// ms - detect tab switches, backgrounding
|
|
19
|
-
|
|
19
|
+
m(this, "adjustedLag", 33);
|
|
20
20
|
// ms - max time jump to prevent animation skip
|
|
21
|
-
|
|
21
|
+
m(this, "maxDeltaTime", 33);
|
|
22
22
|
// ms - clamp for physics stability (30fps minimum)
|
|
23
23
|
// FPS throttling
|
|
24
|
-
|
|
24
|
+
m(this, "gap", 1e3 / 240);
|
|
25
25
|
// max 240fps
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
this.elapsed =
|
|
35
|
-
|
|
26
|
+
m(this, "nextTime", this.gap);
|
|
27
|
+
m(this, "tick", () => {
|
|
28
|
+
const n = Date.now();
|
|
29
|
+
let i = n - this.lastUpdate;
|
|
30
|
+
i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = n;
|
|
31
|
+
const r = n - this.startTime, o = r - this.nextTime;
|
|
32
|
+
if (o > 0) {
|
|
33
|
+
const c = i / 1e3;
|
|
34
|
+
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
|
|
35
|
+
a(c, this.elapsed);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
subscribe(
|
|
42
|
-
return this.listeners.add(
|
|
43
|
-
this.unsubscribe(
|
|
41
|
+
subscribe(n) {
|
|
42
|
+
return this.listeners.add(n), this.isRunning || (this.isRunning = !0, this.rafId = requestAnimationFrame(this.tick)), () => {
|
|
43
|
+
this.unsubscribe(n);
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
unsubscribe(
|
|
47
|
-
this.listeners.delete(
|
|
46
|
+
unsubscribe(n) {
|
|
47
|
+
this.listeners.delete(n), this.listeners.size === 0 && this.rafId !== null && (cancelAnimationFrame(this.rafId), this.isRunning = !1, this.rafId = null);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Configure lag smoothing behavior
|
|
51
51
|
* @param threshold - Time threshold to detect lag (default: 500ms)
|
|
52
52
|
* @param adjustedLag - Max time jump when lag detected (default: 33ms)
|
|
53
53
|
*/
|
|
54
|
-
lagSmoothing(
|
|
55
|
-
this.lagThreshold =
|
|
54
|
+
lagSmoothing(n, t) {
|
|
55
|
+
this.lagThreshold = n, this.adjustedLag = Math.min(t, n);
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Set maximum FPS
|
|
59
59
|
* @param fps - Target FPS (default: 240)
|
|
60
60
|
*/
|
|
61
|
-
fps(
|
|
62
|
-
this.gap = 1e3 /
|
|
61
|
+
fps(n) {
|
|
62
|
+
this.gap = 1e3 / n, this.nextTime = this.elapsed * 1e3 + this.gap;
|
|
63
63
|
}
|
|
64
64
|
getListenerCount() {
|
|
65
65
|
return this.listeners.size;
|
|
@@ -68,133 +68,138 @@ class tt {
|
|
|
68
68
|
return this.elapsed;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
71
|
+
const _ = new rt();
|
|
72
|
+
function ot(e) {
|
|
73
73
|
const {
|
|
74
|
-
integrator:
|
|
74
|
+
integrator: n,
|
|
75
75
|
from: t,
|
|
76
|
-
to:
|
|
77
|
-
velocity:
|
|
78
|
-
onUpdate:
|
|
79
|
-
onComplete:
|
|
80
|
-
onStart:
|
|
81
|
-
} =
|
|
82
|
-
let
|
|
83
|
-
const
|
|
76
|
+
to: i,
|
|
77
|
+
velocity: r = 0,
|
|
78
|
+
onUpdate: o,
|
|
79
|
+
onComplete: c,
|
|
80
|
+
onStart: a
|
|
81
|
+
} = e;
|
|
82
|
+
let s = { position: t, velocity: r }, u = !0, h = 0, p = !1;
|
|
83
|
+
const w = (v) => {
|
|
84
84
|
if (u) {
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
if (p || (p = !0, a == null || a()), s = n.step(s, i, v), n.isSettled(s, i)) {
|
|
86
|
+
if (h += Math.min(v, 0.033), h >= $) {
|
|
87
|
+
s = { position: i, velocity: 0 }, u = !1, o(s.position), _.unsubscribe(w), c();
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
} else
|
|
91
|
-
|
|
92
|
-
s
|
|
91
|
+
h = 0;
|
|
92
|
+
o(s.position);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
return
|
|
95
|
+
return _.subscribe(w), {
|
|
96
96
|
stop: () => {
|
|
97
|
-
u && (u = !1,
|
|
97
|
+
u && (u = !1, _.unsubscribe(w));
|
|
98
98
|
},
|
|
99
|
-
getPosition: () =>
|
|
100
|
-
getVelocity: () =>
|
|
99
|
+
getPosition: () => s.position,
|
|
100
|
+
getVelocity: () => s.velocity,
|
|
101
101
|
isRunning: () => u
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
for (let
|
|
109
|
-
const u =
|
|
110
|
-
if (
|
|
104
|
+
const M = 1e3 / 60;
|
|
105
|
+
function st(e, n, t, i = 0) {
|
|
106
|
+
let o = { position: n, velocity: i }, c = 0;
|
|
107
|
+
const a = [];
|
|
108
|
+
for (let s = 0; s < 600; s++) {
|
|
109
|
+
const u = s * M;
|
|
110
|
+
if (a.push({
|
|
111
111
|
time: u,
|
|
112
|
-
position:
|
|
113
|
-
velocity:
|
|
114
|
-
}),
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
time: (
|
|
112
|
+
position: o.position,
|
|
113
|
+
velocity: o.velocity
|
|
114
|
+
}), o = e.step(o, t, M / 1e3), e.isSettled(o, t)) {
|
|
115
|
+
if (c += M / 1e3, c >= $) {
|
|
116
|
+
a.push({
|
|
117
|
+
time: (s + 1) * M,
|
|
118
118
|
position: t,
|
|
119
119
|
velocity: 0
|
|
120
120
|
});
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
} else
|
|
124
|
-
|
|
124
|
+
c = 0;
|
|
125
125
|
}
|
|
126
|
-
return
|
|
126
|
+
return a;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
128
|
+
function Y(e, n) {
|
|
129
|
+
if (e.length === 0)
|
|
130
130
|
return { position: 0, velocity: 0 };
|
|
131
|
-
const t =
|
|
132
|
-
if (
|
|
131
|
+
const t = e[0], i = e[e.length - 1];
|
|
132
|
+
if (n <= 0)
|
|
133
133
|
return { position: t.position, velocity: t.velocity };
|
|
134
|
-
if (
|
|
135
|
-
return { position:
|
|
136
|
-
let
|
|
137
|
-
for (;
|
|
138
|
-
const u = Math.floor((
|
|
139
|
-
|
|
134
|
+
if (n >= i.time)
|
|
135
|
+
return { position: i.position, velocity: i.velocity };
|
|
136
|
+
let r = 0, o = e.length - 1;
|
|
137
|
+
for (; r < o - 1; ) {
|
|
138
|
+
const u = Math.floor((r + o) / 2);
|
|
139
|
+
e[u].time <= n ? r = u : o = u;
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const c = e[r], a = e[o], s = (n - c.time) / (a.time - c.time);
|
|
142
142
|
return {
|
|
143
|
-
position:
|
|
144
|
-
velocity:
|
|
143
|
+
position: c.position + (a.position - c.position) * s,
|
|
144
|
+
velocity: c.velocity + (a.velocity - c.velocity) * s
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function at(e, n) {
|
|
148
|
+
return e.map((t) => n(t.position));
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function ct(e) {
|
|
151
151
|
const {
|
|
152
|
-
integrator:
|
|
152
|
+
integrator: n,
|
|
153
153
|
element: t,
|
|
154
|
-
from:
|
|
155
|
-
to:
|
|
156
|
-
velocity:
|
|
157
|
-
style:
|
|
158
|
-
onComplete:
|
|
159
|
-
onStart:
|
|
160
|
-
} =
|
|
154
|
+
from: i,
|
|
155
|
+
to: r,
|
|
156
|
+
velocity: o = 0,
|
|
157
|
+
style: c,
|
|
158
|
+
onComplete: a,
|
|
159
|
+
onStart: s
|
|
160
|
+
} = e, u = st(n, i, r, o);
|
|
161
161
|
if (u.length === 0)
|
|
162
|
-
return
|
|
162
|
+
return s == null || s(), a(), {
|
|
163
163
|
stop: () => {
|
|
164
164
|
},
|
|
165
|
-
getPosition: () =>
|
|
165
|
+
getPosition: () => r,
|
|
166
166
|
getVelocity: () => 0,
|
|
167
167
|
isRunning: () => !1
|
|
168
168
|
};
|
|
169
|
-
const
|
|
170
|
-
|
|
169
|
+
const h = at(u, c), p = u[u.length - 1], w = p.time, v = h[0];
|
|
170
|
+
if (v)
|
|
171
|
+
for (const y of Object.keys(v))
|
|
172
|
+
t.style[y] = "";
|
|
173
|
+
const d = t.animate(h, {
|
|
174
|
+
duration: w,
|
|
171
175
|
fill: "forwards",
|
|
172
|
-
easing: "linear"
|
|
176
|
+
easing: "linear",
|
|
177
|
+
composite: "replace"
|
|
173
178
|
});
|
|
174
|
-
let
|
|
175
|
-
const
|
|
176
|
-
return
|
|
177
|
-
|
|
179
|
+
let l = !0;
|
|
180
|
+
const C = performance.now();
|
|
181
|
+
return s == null || s(), d.onfinish = () => {
|
|
182
|
+
l && (l = !1, a());
|
|
178
183
|
}, {
|
|
179
184
|
stop: () => {
|
|
180
|
-
|
|
185
|
+
l && (l = !1, d.cancel());
|
|
181
186
|
},
|
|
182
187
|
getPosition: () => {
|
|
183
|
-
if (!
|
|
184
|
-
return
|
|
185
|
-
const
|
|
186
|
-
return
|
|
188
|
+
if (!l)
|
|
189
|
+
return p.position;
|
|
190
|
+
const y = performance.now() - C;
|
|
191
|
+
return Y(u, y).position;
|
|
187
192
|
},
|
|
188
193
|
getVelocity: () => {
|
|
189
|
-
if (!
|
|
194
|
+
if (!l)
|
|
190
195
|
return 0;
|
|
191
|
-
const
|
|
192
|
-
return
|
|
196
|
+
const y = performance.now() - C;
|
|
197
|
+
return Y(u, y).velocity;
|
|
193
198
|
},
|
|
194
|
-
isRunning: () =>
|
|
199
|
+
isRunning: () => l
|
|
195
200
|
};
|
|
196
201
|
}
|
|
197
|
-
class
|
|
202
|
+
class lt {
|
|
198
203
|
/**
|
|
199
204
|
* Get bound runner based on animation mode
|
|
200
205
|
*
|
|
@@ -202,59 +207,83 @@ class ot {
|
|
|
202
207
|
* @returns Bound runner function or null if no animation mode specified
|
|
203
208
|
* @throws Error if both tick and css are provided
|
|
204
209
|
*/
|
|
205
|
-
static from(
|
|
206
|
-
const { tick: t, css:
|
|
207
|
-
if (t &&
|
|
210
|
+
static from(n) {
|
|
211
|
+
const { tick: t, css: i } = n;
|
|
212
|
+
if (t && i)
|
|
208
213
|
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
209
|
-
return
|
|
210
|
-
...
|
|
211
|
-
element:
|
|
212
|
-
style:
|
|
213
|
-
}) : t ? (
|
|
214
|
-
...
|
|
214
|
+
return i ? (r) => ct({
|
|
215
|
+
...r,
|
|
216
|
+
element: i.element,
|
|
217
|
+
style: i.style
|
|
218
|
+
}) : t ? (r) => ot({
|
|
219
|
+
...r,
|
|
215
220
|
onUpdate: t
|
|
216
221
|
}) : null;
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
|
-
class
|
|
224
|
+
class K {
|
|
220
225
|
}
|
|
221
|
-
const
|
|
222
|
-
class
|
|
226
|
+
const ut = { stiffness: 300, damping: 30 };
|
|
227
|
+
class j extends K {
|
|
223
228
|
constructor(t) {
|
|
224
229
|
super();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this
|
|
230
|
+
m(this, "options");
|
|
231
|
+
m(this, "runner");
|
|
232
|
+
m(this, "controls", null);
|
|
233
|
+
m(this, "isAnimating", !1);
|
|
234
|
+
m(this, "currentValue");
|
|
235
|
+
m(this, "currentVelocity", 0);
|
|
236
|
+
m(this, "updateFn");
|
|
237
|
+
if (this.options = {
|
|
232
238
|
from: t.from ?? 0,
|
|
233
239
|
to: t.to ?? 1,
|
|
234
240
|
physics: t.physics,
|
|
235
241
|
onComplete: t.onComplete ?? (() => {
|
|
236
242
|
}),
|
|
237
243
|
onStart: t.onStart
|
|
238
|
-
}, this.currentValue = this.options.from,
|
|
244
|
+
}, this.currentValue = this.options.from, t.tick)
|
|
245
|
+
this.updateFn = (i) => {
|
|
246
|
+
var r;
|
|
247
|
+
return (r = t.tick) == null ? void 0 : r.call(t, i);
|
|
248
|
+
};
|
|
249
|
+
else if (t.css) {
|
|
250
|
+
const { element: i, style: r } = t.css;
|
|
251
|
+
this.updateFn = (o) => {
|
|
252
|
+
const c = r(o);
|
|
253
|
+
for (const [a, s] of Object.entries(c))
|
|
254
|
+
i.style[a] = typeof s == "number" ? String(s) : s;
|
|
255
|
+
};
|
|
256
|
+
} else
|
|
257
|
+
this.updateFn = () => {
|
|
258
|
+
};
|
|
259
|
+
this.runner = lt.from({
|
|
239
260
|
tick: t.tick,
|
|
240
261
|
css: t.css
|
|
241
262
|
});
|
|
242
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Sync element state to current progress value
|
|
266
|
+
* Uses the update callback if provided
|
|
267
|
+
*/
|
|
268
|
+
syncState() {
|
|
269
|
+
var t;
|
|
270
|
+
(t = this.updateFn) == null || t.call(this, this.currentValue);
|
|
271
|
+
}
|
|
243
272
|
/**
|
|
244
273
|
* Create Integrator from physics options
|
|
245
274
|
* Priority: integrator factory > inertia/spring config > default spring
|
|
246
275
|
*/
|
|
247
276
|
createIntegrator() {
|
|
248
277
|
const t = this.options.physics;
|
|
249
|
-
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ?
|
|
278
|
+
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? it.from({
|
|
250
279
|
spring: t.spring,
|
|
251
280
|
inertia: t.inertia
|
|
252
|
-
}) : new
|
|
281
|
+
}) : new nt(ut);
|
|
253
282
|
}
|
|
254
283
|
runAnimation(t) {
|
|
255
|
-
var
|
|
284
|
+
var i, r;
|
|
256
285
|
if (this.isAnimating = !0, !this.runner) {
|
|
257
|
-
(
|
|
286
|
+
(r = (i = this.options).onStart) == null || r.call(i), this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.options.onComplete();
|
|
258
287
|
return;
|
|
259
288
|
}
|
|
260
289
|
this.controls = this.runner({
|
|
@@ -309,46 +338,46 @@ class O extends Y {
|
|
|
309
338
|
updateOptions(t) {
|
|
310
339
|
this.options = { ...this.options, ...t };
|
|
311
340
|
}
|
|
312
|
-
static fromState(t, e) {
|
|
313
|
-
const o = new O(e);
|
|
314
|
-
return o.setValue(t.position), o.setVelocity(t.velocity), o;
|
|
315
|
-
}
|
|
316
341
|
}
|
|
317
|
-
class L extends
|
|
342
|
+
class L extends K {
|
|
318
343
|
constructor(t) {
|
|
319
344
|
super();
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
this
|
|
345
|
+
m(this, "config");
|
|
346
|
+
m(this, "animators", /* @__PURE__ */ new Map());
|
|
347
|
+
m(this, "itemOrder", []);
|
|
348
|
+
m(this, "completedCount", 0);
|
|
349
|
+
m(this, "completedAnimators", /* @__PURE__ */ new Set());
|
|
350
|
+
m(this, "direction", "forward");
|
|
351
|
+
m(this, "idCounter", 0);
|
|
352
|
+
m(this, "rafId", null);
|
|
353
|
+
m(this, "from");
|
|
354
|
+
m(this, "to");
|
|
355
|
+
m(this, "initialState");
|
|
356
|
+
this.config = t.config, this.from = t.from, this.to = t.to, this.initialState = t.state ?? {
|
|
357
|
+
position: t.from,
|
|
358
|
+
velocity: 0
|
|
359
|
+
}, this.initializeAnimators();
|
|
331
360
|
}
|
|
332
361
|
generateId() {
|
|
333
362
|
return `spring_${this.idCounter++}`;
|
|
334
363
|
}
|
|
335
364
|
initializeAnimators() {
|
|
336
|
-
this.config.
|
|
337
|
-
const
|
|
365
|
+
this.config.items.forEach((t, i) => {
|
|
366
|
+
const r = this.generateId(), o = new j({
|
|
338
367
|
from: this.from,
|
|
339
368
|
to: this.to,
|
|
340
369
|
physics: t.physics,
|
|
341
370
|
tick: t.tick,
|
|
342
371
|
css: t.css,
|
|
343
|
-
onComplete: () => this.onAnimatorComplete(
|
|
372
|
+
onComplete: () => this.onAnimatorComplete(r),
|
|
344
373
|
onStart: t.onStart
|
|
345
374
|
});
|
|
346
|
-
this.animators.set(
|
|
347
|
-
id:
|
|
375
|
+
(i === 0 || t.normalizedOffset === 0) && (o.setValue(this.initialState.position), o.setVelocity(this.initialState.velocity), o.syncState()), this.animators.set(r, {
|
|
376
|
+
id: r,
|
|
348
377
|
item: t,
|
|
349
378
|
animator: o,
|
|
350
379
|
started: !1
|
|
351
|
-
}), this.
|
|
380
|
+
}), this.itemOrder.push(r);
|
|
352
381
|
});
|
|
353
382
|
}
|
|
354
383
|
/**
|
|
@@ -356,8 +385,8 @@ class L extends Y {
|
|
|
356
385
|
* Progress = |position - from| / |to - from|
|
|
357
386
|
*/
|
|
358
387
|
getAnimatorProgress(t) {
|
|
359
|
-
const
|
|
360
|
-
return
|
|
388
|
+
const i = t.animator.getCurrentState(), r = Math.abs(i.to - i.from);
|
|
389
|
+
return r === 0 ? 1 : Math.abs(i.position - i.from) / r;
|
|
361
390
|
}
|
|
362
391
|
/**
|
|
363
392
|
* Get order of springs based on direction
|
|
@@ -365,12 +394,12 @@ class L extends Y {
|
|
|
365
394
|
* Backward: n-1, n-2, ..., 0
|
|
366
395
|
*/
|
|
367
396
|
getOrderedIds() {
|
|
368
|
-
return this.direction === "forward" ? this.
|
|
397
|
+
return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
|
|
369
398
|
}
|
|
370
399
|
onAnimatorComplete(t) {
|
|
371
|
-
var
|
|
372
|
-
const
|
|
373
|
-
!
|
|
400
|
+
var r, o, c, a, s, u;
|
|
401
|
+
const i = this.animators.get(t);
|
|
402
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (s = this.config).onEnd) == null || u.call(s)));
|
|
374
403
|
}
|
|
375
404
|
/**
|
|
376
405
|
* Check and start springs based on previous spring's progress
|
|
@@ -378,22 +407,22 @@ class L extends Y {
|
|
|
378
407
|
*/
|
|
379
408
|
checkAndStartSprings() {
|
|
380
409
|
const t = this.getOrderedIds();
|
|
381
|
-
for (let
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
384
|
-
if (
|
|
385
|
-
this.startAnimator(
|
|
410
|
+
for (let i = 0; i < t.length; i++) {
|
|
411
|
+
const r = t[i], o = this.animators.get(r);
|
|
412
|
+
if (!o || o.started) continue;
|
|
413
|
+
if (i === 0) {
|
|
414
|
+
this.startAnimator(r);
|
|
386
415
|
continue;
|
|
387
416
|
}
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
|
|
417
|
+
const c = t[i - 1], a = this.animators.get(c);
|
|
418
|
+
if (!a || !a.started) continue;
|
|
419
|
+
const s = this.getAnimatorProgress(a), u = o.item.normalizedOffset;
|
|
420
|
+
s >= u && this.startAnimator(r);
|
|
392
421
|
}
|
|
393
422
|
}
|
|
394
423
|
startAnimator(t) {
|
|
395
|
-
const
|
|
396
|
-
!
|
|
424
|
+
const i = this.animators.get(t);
|
|
425
|
+
!i || i.started || (i.started = !0, this.direction === "forward" ? i.animator.forward() : i.animator.backward());
|
|
397
426
|
}
|
|
398
427
|
/**
|
|
399
428
|
* Start the scheduler loop that checks spring progress
|
|
@@ -408,17 +437,17 @@ class L extends Y {
|
|
|
408
437
|
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
|
|
409
438
|
}
|
|
410
439
|
getFirstAnimator() {
|
|
411
|
-
var
|
|
412
|
-
const t = this.
|
|
413
|
-
return t ? ((
|
|
440
|
+
var i;
|
|
441
|
+
const t = this.itemOrder[0];
|
|
442
|
+
return t ? ((i = this.animators.get(t)) == null ? void 0 : i.animator) ?? null : null;
|
|
414
443
|
}
|
|
415
444
|
forward() {
|
|
416
|
-
var t,
|
|
417
|
-
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
445
|
+
var t, i;
|
|
446
|
+
this.stop(), this.direction = "forward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
418
447
|
}
|
|
419
448
|
backward() {
|
|
420
|
-
var t,
|
|
421
|
-
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (
|
|
449
|
+
var t, i;
|
|
450
|
+
this.stop(), this.direction = "backward", this.completedCount = 0, this.completedAnimators.clear(), this.resetStartedFlags(), (i = (t = this.config).onStart) == null || i.call(t), this.startScheduler();
|
|
422
451
|
}
|
|
423
452
|
resetStartedFlags() {
|
|
424
453
|
this.animators.forEach((t) => {
|
|
@@ -434,21 +463,18 @@ class L extends Y {
|
|
|
434
463
|
this.direction = this.direction === "forward" ? "backward" : "forward", this.animators.forEach((t) => {
|
|
435
464
|
if (!t.started)
|
|
436
465
|
return;
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
s.forward(), t.animator = s;
|
|
466
|
+
const i = t.animator.getCurrentState();
|
|
467
|
+
if (i.position === i.to) {
|
|
468
|
+
const o = new j({
|
|
469
|
+
from: this.to,
|
|
470
|
+
to: this.from,
|
|
471
|
+
physics: t.item.physics,
|
|
472
|
+
tick: t.item.tick,
|
|
473
|
+
css: t.item.css,
|
|
474
|
+
onComplete: () => this.onAnimatorComplete(t.id),
|
|
475
|
+
onStart: t.item.onStart
|
|
476
|
+
});
|
|
477
|
+
o.setValue(this.to), o.setVelocity(0), o.syncState(), o.forward(), t.animator = o;
|
|
452
478
|
} else
|
|
453
479
|
t.animator.reverse();
|
|
454
480
|
});
|
|
@@ -481,16 +507,16 @@ class L extends Y {
|
|
|
481
507
|
* TODO: Support per-spring control
|
|
482
508
|
*/
|
|
483
509
|
setValue(t) {
|
|
484
|
-
const
|
|
485
|
-
|
|
510
|
+
const i = this.getFirstAnimator();
|
|
511
|
+
i == null || i.setValue(t);
|
|
486
512
|
}
|
|
487
513
|
/**
|
|
488
514
|
* Set velocity on first animator
|
|
489
515
|
* TODO: Support per-spring control
|
|
490
516
|
*/
|
|
491
517
|
setVelocity(t) {
|
|
492
|
-
const
|
|
493
|
-
|
|
518
|
+
const i = this.getFirstAnimator();
|
|
519
|
+
i == null || i.setVelocity(t);
|
|
494
520
|
}
|
|
495
521
|
/**
|
|
496
522
|
* Check if any animation is currently running
|
|
@@ -505,28 +531,27 @@ class L extends Y {
|
|
|
505
531
|
* Create MultiAnimator from existing state
|
|
506
532
|
* Uses first animator's state for initialization
|
|
507
533
|
*/
|
|
508
|
-
static fromState(t,
|
|
509
|
-
|
|
510
|
-
return o.setValue(t.position), o.setVelocity(t.velocity), o;
|
|
534
|
+
static fromState(t, i) {
|
|
535
|
+
return new L({ ...i, state: t });
|
|
511
536
|
}
|
|
512
537
|
}
|
|
513
|
-
const
|
|
514
|
-
runIn: async (
|
|
515
|
-
const { currentAnimation: t } =
|
|
538
|
+
const B = Symbol.for("TRANSITION_STRATEGY"), ft = (e) => ({
|
|
539
|
+
runIn: async (n) => {
|
|
540
|
+
const { currentAnimation: t } = e;
|
|
516
541
|
if (t && t.direction === "out") {
|
|
517
|
-
const
|
|
518
|
-
if (t.controller.stop(),
|
|
542
|
+
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
543
|
+
if (t.controller.stop(), n.out)
|
|
519
544
|
return {
|
|
520
|
-
config: await
|
|
521
|
-
state: { position:
|
|
545
|
+
config: await n.out,
|
|
546
|
+
state: { position: r, velocity: o },
|
|
522
547
|
from: 1,
|
|
523
548
|
to: 0,
|
|
524
549
|
direction: "backward"
|
|
525
550
|
// Will actually go 0→1 (backward means toward 'from')
|
|
526
551
|
};
|
|
527
552
|
}
|
|
528
|
-
return
|
|
529
|
-
config: await
|
|
553
|
+
return n.in ? {
|
|
554
|
+
config: await n.in,
|
|
530
555
|
state: {
|
|
531
556
|
position: 0,
|
|
532
557
|
velocity: 0
|
|
@@ -544,22 +569,22 @@ const W = Symbol.for("TRANSITION_STRATEGY"), at = (n) => ({
|
|
|
544
569
|
direction: "forward"
|
|
545
570
|
};
|
|
546
571
|
},
|
|
547
|
-
runOut: async (
|
|
548
|
-
const { currentAnimation: t } =
|
|
572
|
+
runOut: async (n) => {
|
|
573
|
+
const { currentAnimation: t } = e;
|
|
549
574
|
if (t && t.direction === "in") {
|
|
550
|
-
const
|
|
551
|
-
if (t.controller.stop(),
|
|
575
|
+
const r = t.controller.getCurrentValue(), o = t.controller.getVelocity();
|
|
576
|
+
if (t.controller.stop(), n.in)
|
|
552
577
|
return {
|
|
553
|
-
config: await
|
|
554
|
-
state: { position:
|
|
578
|
+
config: await n.in,
|
|
579
|
+
state: { position: r, velocity: o },
|
|
555
580
|
from: 0,
|
|
556
581
|
to: 1,
|
|
557
582
|
direction: "backward"
|
|
558
583
|
// Will actually go 1→0 (backward means toward 'from')
|
|
559
584
|
};
|
|
560
585
|
}
|
|
561
|
-
return
|
|
562
|
-
config: await
|
|
586
|
+
return n.out ? {
|
|
587
|
+
config: await n.out,
|
|
563
588
|
state: {
|
|
564
589
|
position: 1,
|
|
565
590
|
velocity: 0
|
|
@@ -577,9 +602,9 @@ const W = Symbol.for("TRANSITION_STRATEGY"), at = (n) => ({
|
|
|
577
602
|
direction: "forward"
|
|
578
603
|
};
|
|
579
604
|
}
|
|
580
|
-
}),
|
|
581
|
-
runIn: async (
|
|
582
|
-
config: await
|
|
605
|
+
}), mt = () => ({
|
|
606
|
+
runIn: async (e) => e.in ? {
|
|
607
|
+
config: await e.in,
|
|
583
608
|
state: {
|
|
584
609
|
position: 0,
|
|
585
610
|
velocity: 0
|
|
@@ -596,8 +621,8 @@ const W = Symbol.for("TRANSITION_STRATEGY"), at = (n) => ({
|
|
|
596
621
|
to: 1,
|
|
597
622
|
direction: "forward"
|
|
598
623
|
},
|
|
599
|
-
runOut: async (
|
|
600
|
-
config: await
|
|
624
|
+
runOut: async (e) => e.out ? {
|
|
625
|
+
config: await e.out,
|
|
601
626
|
state: {
|
|
602
627
|
position: 1,
|
|
603
628
|
velocity: 0
|
|
@@ -614,146 +639,178 @@ const W = Symbol.for("TRANSITION_STRATEGY"), at = (n) => ({
|
|
|
614
639
|
to: 0,
|
|
615
640
|
direction: "forward"
|
|
616
641
|
}
|
|
617
|
-
}),
|
|
618
|
-
function
|
|
619
|
-
return (
|
|
620
|
-
if (
|
|
621
|
-
return
|
|
642
|
+
}), J = "data-ssgoi-scope", Q = "data-ssgoi-scope-ready";
|
|
643
|
+
function It() {
|
|
644
|
+
return (e) => {
|
|
645
|
+
if (e)
|
|
646
|
+
return e.setAttribute(J, ""), queueMicrotask(() => {
|
|
622
647
|
queueMicrotask(() => {
|
|
623
|
-
|
|
648
|
+
e.setAttribute(Q, "true");
|
|
624
649
|
});
|
|
625
650
|
}), () => {
|
|
626
651
|
};
|
|
627
652
|
};
|
|
628
653
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
654
|
+
function dt(e) {
|
|
655
|
+
return e.hasAttribute(Q);
|
|
631
656
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
657
|
+
function ht(e) {
|
|
658
|
+
return e.closest(`[${J}]`);
|
|
634
659
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
660
|
+
const gt = (e) => {
|
|
661
|
+
let n = e.parentElement;
|
|
662
|
+
for (; n && n !== document.body; ) {
|
|
663
|
+
const t = window.getComputedStyle(n), i = t.overflow + t.overflowY + t.overflowX;
|
|
664
|
+
if (i.includes("auto") || i.includes("scroll") || n.scrollHeight > n.clientHeight || n.scrollWidth > n.clientWidth)
|
|
665
|
+
return n;
|
|
666
|
+
n = n.parentElement;
|
|
667
|
+
}
|
|
668
|
+
return document.documentElement;
|
|
669
|
+
}, pt = (e) => {
|
|
670
|
+
let n = e.parentElement;
|
|
671
|
+
for (; n && n !== document.body; ) {
|
|
672
|
+
const t = window.getComputedStyle(n).position;
|
|
673
|
+
if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
|
|
674
|
+
return n;
|
|
675
|
+
n = n.parentElement;
|
|
676
|
+
}
|
|
677
|
+
return document.body;
|
|
678
|
+
};
|
|
679
|
+
function W(e) {
|
|
680
|
+
return new Promise((n) => {
|
|
681
|
+
requestAnimationFrame(() => {
|
|
682
|
+
requestAnimationFrame(() => {
|
|
683
|
+
n();
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
function wt(e, n) {
|
|
689
|
+
var v;
|
|
690
|
+
let t = null, i = null, r = null, o = null;
|
|
691
|
+
const c = {
|
|
639
692
|
get currentAnimation() {
|
|
640
693
|
return t;
|
|
641
694
|
}
|
|
642
|
-
},
|
|
643
|
-
var
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
if (!
|
|
695
|
+
}, a = ((v = n == null ? void 0 : n.strategy) == null ? void 0 : v.call(n, c)) || ft(c), s = async (d) => {
|
|
696
|
+
var b;
|
|
697
|
+
i && (i.remove(), i = null);
|
|
698
|
+
const l = e(), C = l.in && l.in(d), y = !(n != null && n.strategy) && l.out ? l.out(d) : void 0;
|
|
699
|
+
if (!C)
|
|
647
700
|
return;
|
|
648
|
-
const
|
|
649
|
-
in:
|
|
650
|
-
out:
|
|
651
|
-
},
|
|
652
|
-
if (!
|
|
701
|
+
const P = {
|
|
702
|
+
in: F(C),
|
|
703
|
+
out: y ? F(y) : void 0
|
|
704
|
+
}, g = await a.runIn(P);
|
|
705
|
+
if (!g.config) {
|
|
653
706
|
t && (t.direction = "in");
|
|
654
707
|
return;
|
|
655
708
|
}
|
|
656
|
-
const
|
|
657
|
-
(
|
|
658
|
-
const
|
|
709
|
+
const f = g.config;
|
|
710
|
+
(b = f.prepare) == null || b.call(f);
|
|
711
|
+
const S = X(
|
|
659
712
|
{
|
|
660
|
-
...
|
|
713
|
+
...f,
|
|
661
714
|
onEnd: () => {
|
|
662
|
-
var
|
|
663
|
-
t = null, (
|
|
715
|
+
var k;
|
|
716
|
+
t = null, (k = f.onEnd) == null || k.call(f);
|
|
664
717
|
}
|
|
665
718
|
},
|
|
666
|
-
|
|
667
|
-
)
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
719
|
+
d
|
|
720
|
+
);
|
|
721
|
+
f.wait && await f.wait();
|
|
722
|
+
const A = L.fromState(g.state, {
|
|
723
|
+
config: S,
|
|
724
|
+
from: g.from,
|
|
725
|
+
to: g.to
|
|
671
726
|
});
|
|
672
|
-
t = { controller:
|
|
673
|
-
}, u = async (
|
|
674
|
-
var
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
727
|
+
t = { controller: A, direction: "in" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
|
|
728
|
+
}, u = async (d) => {
|
|
729
|
+
var k;
|
|
730
|
+
i = d;
|
|
731
|
+
const l = e(), C = !(n != null && n.strategy) && l.in ? l.in(d) : void 0, y = l.out && l.out(d);
|
|
732
|
+
if (!y)
|
|
678
733
|
return;
|
|
679
|
-
const
|
|
680
|
-
in:
|
|
681
|
-
out:
|
|
682
|
-
},
|
|
683
|
-
if (!
|
|
684
|
-
t && (t.direction = "out"),
|
|
734
|
+
const P = {
|
|
735
|
+
in: C ? F(C) : void 0,
|
|
736
|
+
out: F(y)
|
|
737
|
+
}, g = await a.runOut(P);
|
|
738
|
+
if (!g.config) {
|
|
739
|
+
t && (t.direction = "out"), i && (i.remove(), i = null);
|
|
685
740
|
return;
|
|
686
741
|
}
|
|
687
|
-
const
|
|
688
|
-
(
|
|
689
|
-
const
|
|
742
|
+
const f = g.config;
|
|
743
|
+
b(), (k = f.prepare) == null || k.call(f);
|
|
744
|
+
const S = X(
|
|
690
745
|
{
|
|
691
|
-
...
|
|
746
|
+
...f,
|
|
692
747
|
onEnd: () => {
|
|
693
|
-
var V,
|
|
694
|
-
(V =
|
|
748
|
+
var V, R;
|
|
749
|
+
(V = f.onEnd) == null || V.call(f), i && (i.remove(), i = null), t = null, (R = n == null ? void 0 : n.onCleanupEnd) == null || R.call(n);
|
|
695
750
|
}
|
|
696
751
|
},
|
|
697
|
-
|
|
698
|
-
)
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
752
|
+
d
|
|
753
|
+
);
|
|
754
|
+
f.wait && await f.wait();
|
|
755
|
+
const A = L.fromState(g.state, {
|
|
756
|
+
config: S,
|
|
757
|
+
from: g.from,
|
|
758
|
+
to: g.to
|
|
702
759
|
});
|
|
703
|
-
t = { controller:
|
|
704
|
-
function
|
|
705
|
-
!
|
|
760
|
+
t = { controller: A, direction: "out" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
|
|
761
|
+
function b() {
|
|
762
|
+
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
706
763
|
}
|
|
707
764
|
};
|
|
708
|
-
let
|
|
709
|
-
const
|
|
710
|
-
if (
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
document.contains(
|
|
715
|
-
}) : u(
|
|
765
|
+
let h = null, p = !1;
|
|
766
|
+
const w = (d) => () => {
|
|
767
|
+
if (p) return;
|
|
768
|
+
p = !0;
|
|
769
|
+
const l = d.cloneNode(!0);
|
|
770
|
+
h ? queueMicrotask(() => {
|
|
771
|
+
document.contains(h) && u(l);
|
|
772
|
+
}) : u(l);
|
|
716
773
|
};
|
|
717
|
-
return (
|
|
718
|
-
if (
|
|
774
|
+
return (d) => {
|
|
775
|
+
if (d)
|
|
719
776
|
return requestAnimationFrame(() => {
|
|
720
|
-
|
|
721
|
-
}),
|
|
722
|
-
|
|
723
|
-
}) :
|
|
777
|
+
r = d.parentElement, o = d.nextElementSibling;
|
|
778
|
+
}), p = !1, (n == null ? void 0 : n.scope) === "local" ? queueMicrotask(() => {
|
|
779
|
+
h = ht(d), !(h && !dt(h)) && s(d);
|
|
780
|
+
}) : s(d), w(d);
|
|
724
781
|
};
|
|
725
782
|
}
|
|
726
|
-
const
|
|
727
|
-
let
|
|
728
|
-
function
|
|
729
|
-
if (
|
|
730
|
-
const t =
|
|
731
|
-
|
|
783
|
+
const T = /* @__PURE__ */ new Map();
|
|
784
|
+
let E = null, N = !1;
|
|
785
|
+
function Z(e) {
|
|
786
|
+
if (e instanceof HTMLElement && T.has(e)) {
|
|
787
|
+
const t = T.get(e);
|
|
788
|
+
T.delete(e), queueMicrotask(() => {
|
|
732
789
|
t();
|
|
733
790
|
});
|
|
734
791
|
}
|
|
735
|
-
const
|
|
736
|
-
for (let t = 0; t <
|
|
737
|
-
const
|
|
738
|
-
|
|
792
|
+
const n = e.childNodes;
|
|
793
|
+
for (let t = 0; t < n.length; t++) {
|
|
794
|
+
const i = n[t];
|
|
795
|
+
i && Z(i);
|
|
739
796
|
}
|
|
740
797
|
}
|
|
741
|
-
function
|
|
742
|
-
N || typeof document > "u" || (N = !0,
|
|
743
|
-
for (const
|
|
744
|
-
const t =
|
|
745
|
-
for (let
|
|
746
|
-
const
|
|
747
|
-
|
|
798
|
+
function yt() {
|
|
799
|
+
N || typeof document > "u" || (N = !0, E = new MutationObserver((e) => {
|
|
800
|
+
for (const n of e) {
|
|
801
|
+
const t = n.removedNodes;
|
|
802
|
+
for (let i = 0; i < t.length; i++) {
|
|
803
|
+
const r = t[i];
|
|
804
|
+
r && Z(r);
|
|
748
805
|
}
|
|
749
806
|
}
|
|
750
|
-
}), document.body ?
|
|
807
|
+
}), document.body ? E.observe(document.body, {
|
|
751
808
|
childList: !0,
|
|
752
809
|
subtree: !0
|
|
753
810
|
}) : document.addEventListener(
|
|
754
811
|
"DOMContentLoaded",
|
|
755
812
|
() => {
|
|
756
|
-
|
|
813
|
+
E == null || E.observe(document.body, {
|
|
757
814
|
childList: !0,
|
|
758
815
|
subtree: !0
|
|
759
816
|
});
|
|
@@ -761,270 +818,298 @@ function dt() {
|
|
|
761
818
|
{ once: !0 }
|
|
762
819
|
));
|
|
763
820
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
821
|
+
function vt(e, n) {
|
|
822
|
+
yt(), T.set(e, n);
|
|
766
823
|
}
|
|
767
|
-
function
|
|
768
|
-
return
|
|
824
|
+
function Ft(e) {
|
|
825
|
+
return T.has(e);
|
|
769
826
|
}
|
|
770
|
-
function
|
|
771
|
-
return
|
|
827
|
+
function Mt() {
|
|
828
|
+
return T.size;
|
|
772
829
|
}
|
|
773
|
-
function
|
|
774
|
-
const
|
|
775
|
-
return
|
|
830
|
+
function xt(e) {
|
|
831
|
+
const n = T.get(e);
|
|
832
|
+
return n ? (T.delete(e), n(), !0) : !1;
|
|
776
833
|
}
|
|
777
|
-
function
|
|
778
|
-
|
|
834
|
+
function Ot() {
|
|
835
|
+
T.clear(), E == null || E.disconnect(), E = null, N = !1;
|
|
779
836
|
}
|
|
780
|
-
const
|
|
781
|
-
function
|
|
782
|
-
|
|
783
|
-
let
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
786
|
-
const
|
|
787
|
-
return
|
|
837
|
+
const O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
|
|
838
|
+
function St(e, n, t) {
|
|
839
|
+
O.set(e, n);
|
|
840
|
+
let i = U.get(e);
|
|
841
|
+
if (i)
|
|
842
|
+
return i;
|
|
843
|
+
const r = n;
|
|
844
|
+
return i = wt(
|
|
788
845
|
() => {
|
|
789
|
-
const
|
|
790
|
-
return
|
|
846
|
+
const o = O.get(e);
|
|
847
|
+
return o || (console.warn(`Transition "${String(e)}" not found`), {});
|
|
791
848
|
},
|
|
792
849
|
{
|
|
793
850
|
strategy: t == null ? void 0 : t.strategy,
|
|
794
851
|
scope: t == null ? void 0 : t.scope,
|
|
795
852
|
onCleanupEnd: () => {
|
|
796
|
-
|
|
853
|
+
O.get(e) === r && Ct(e);
|
|
797
854
|
}
|
|
798
855
|
}
|
|
799
|
-
),
|
|
856
|
+
), U.set(e, i), i;
|
|
800
857
|
}
|
|
801
|
-
function
|
|
802
|
-
|
|
858
|
+
function Ct(e) {
|
|
859
|
+
O.delete(e), U.delete(e), H.delete(e);
|
|
803
860
|
}
|
|
804
|
-
function
|
|
805
|
-
const t =
|
|
806
|
-
|
|
861
|
+
function Lt(e, n = "manual") {
|
|
862
|
+
const t = St(
|
|
863
|
+
e.key,
|
|
807
864
|
{
|
|
808
|
-
in:
|
|
809
|
-
out:
|
|
865
|
+
in: e.in,
|
|
866
|
+
out: e.out
|
|
810
867
|
},
|
|
811
868
|
{
|
|
812
|
-
strategy:
|
|
813
|
-
scope:
|
|
869
|
+
strategy: e[B],
|
|
870
|
+
scope: e.scope
|
|
814
871
|
}
|
|
815
872
|
);
|
|
816
|
-
if (
|
|
873
|
+
if (n === "manual")
|
|
817
874
|
return t;
|
|
818
|
-
let
|
|
819
|
-
return
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
822
|
-
|
|
875
|
+
let i = H.get(e.key);
|
|
876
|
+
return i || (i = (r) => {
|
|
877
|
+
if (r) {
|
|
878
|
+
const o = t(r);
|
|
879
|
+
o && vt(r, o);
|
|
823
880
|
}
|
|
824
|
-
},
|
|
881
|
+
}, H.set(e.key, i), i);
|
|
825
882
|
}
|
|
826
|
-
function
|
|
827
|
-
const
|
|
883
|
+
function At(e) {
|
|
884
|
+
const n = e.filter((t) => t.symmetric).map((t) => ({
|
|
828
885
|
from: t.to,
|
|
829
886
|
to: t.from,
|
|
830
887
|
transition: t.transition
|
|
831
888
|
}));
|
|
832
|
-
return [...
|
|
889
|
+
return [...e, ...n];
|
|
833
890
|
}
|
|
834
|
-
function
|
|
835
|
-
let
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
},
|
|
841
|
-
if (!
|
|
842
|
-
const
|
|
843
|
-
if (!
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
},
|
|
847
|
-
|
|
848
|
-
}, u = () =>
|
|
849
|
-
typeof window > "u" ||
|
|
850
|
-
},
|
|
851
|
-
typeof window > "u" || (window.removeEventListener("touchstart",
|
|
891
|
+
function Et(e) {
|
|
892
|
+
let n = !1, t = 0, i = 0, r = !1;
|
|
893
|
+
const o = 50, c = (d) => {
|
|
894
|
+
if (!e) return;
|
|
895
|
+
const l = d.touches[0];
|
|
896
|
+
l && (r = l.clientX < o, r && (t = l.clientX, i = l.clientY));
|
|
897
|
+
}, a = (d) => {
|
|
898
|
+
if (!e || !r) return;
|
|
899
|
+
const l = d.touches[0];
|
|
900
|
+
if (!l) return;
|
|
901
|
+
const C = l.clientX - t, y = l.clientY - i;
|
|
902
|
+
C > window.outerWidth / 2 - 5 && Math.abs(C) > Math.abs(y) ? n = !0 : n = !1;
|
|
903
|
+
}, s = () => {
|
|
904
|
+
e && (r = !1, t = 0, i = 0);
|
|
905
|
+
}, u = () => n, h = () => {
|
|
906
|
+
typeof window > "u" || e && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
|
|
907
|
+
}, p = () => {
|
|
908
|
+
typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
|
|
852
909
|
};
|
|
853
|
-
let
|
|
910
|
+
let w = 0;
|
|
854
911
|
return {
|
|
855
|
-
initialize:
|
|
856
|
-
cleanup:
|
|
912
|
+
initialize: h,
|
|
913
|
+
cleanup: p,
|
|
857
914
|
isSwipePending: u,
|
|
858
915
|
resetSwipeDetection: () => {
|
|
859
|
-
|
|
916
|
+
w++, w > 1 && (w = 0, n = !1);
|
|
860
917
|
}
|
|
861
918
|
};
|
|
862
919
|
}
|
|
863
|
-
|
|
864
|
-
let
|
|
865
|
-
for (; i && i !== document.body; ) {
|
|
866
|
-
const t = window.getComputedStyle(i), e = t.overflow + t.overflowY + t.overflowX;
|
|
867
|
-
if (e.includes("auto") || e.includes("scroll") || i.scrollHeight > i.clientHeight || i.scrollWidth > i.clientWidth)
|
|
868
|
-
return i;
|
|
869
|
-
i = i.parentElement;
|
|
870
|
-
}
|
|
871
|
-
return document.documentElement;
|
|
872
|
-
}, vt = (n) => {
|
|
873
|
-
let i = n.parentElement;
|
|
874
|
-
for (; i && i !== document.body; ) {
|
|
875
|
-
const t = window.getComputedStyle(i).position;
|
|
876
|
-
if (t === "relative" || t === "absolute" || t === "fixed" || t === "sticky")
|
|
877
|
-
return i;
|
|
878
|
-
i = i.parentElement;
|
|
879
|
-
}
|
|
880
|
-
return document.body;
|
|
881
|
-
};
|
|
882
|
-
function St() {
|
|
883
|
-
let n = null, i = null;
|
|
920
|
+
function Tt() {
|
|
921
|
+
let e = null, n = null;
|
|
884
922
|
const t = /* @__PURE__ */ new Map();
|
|
885
|
-
let
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
x:
|
|
889
|
-
y:
|
|
923
|
+
let i = null;
|
|
924
|
+
const r = () => {
|
|
925
|
+
e && i && t.set(i, {
|
|
926
|
+
x: e.scrollLeft,
|
|
927
|
+
y: e.scrollTop
|
|
890
928
|
});
|
|
891
929
|
};
|
|
892
930
|
return {
|
|
893
|
-
initializeContext: (
|
|
894
|
-
|
|
931
|
+
initializeContext: (h, p) => {
|
|
932
|
+
n = h, e || (e = gt(h), (e === document.documentElement ? window : e).addEventListener("scroll", r, {
|
|
895
933
|
passive: !0
|
|
896
|
-
})),
|
|
934
|
+
})), i = p;
|
|
897
935
|
},
|
|
898
|
-
calculateScrollOffset: (
|
|
899
|
-
const
|
|
936
|
+
calculateScrollOffset: (h, p) => {
|
|
937
|
+
const w = h && t.has(h) ? t.get(h) : { x: 0, y: 0 }, v = p && t.has(p) ? t.get(p) : { x: 0, y: 0 };
|
|
900
938
|
return {
|
|
901
|
-
x: -
|
|
902
|
-
y: -
|
|
939
|
+
x: -v.x + w.x,
|
|
940
|
+
y: -v.y + w.y
|
|
903
941
|
};
|
|
904
942
|
},
|
|
905
|
-
getScrollContainer: () =>
|
|
906
|
-
getPositionedParentElement: () =>
|
|
907
|
-
getScrollPosition: (
|
|
943
|
+
getScrollContainer: () => e,
|
|
944
|
+
getPositionedParentElement: () => n ? pt(n) : document.body,
|
|
945
|
+
getScrollPosition: (h) => h && t.has(h) ? t.get(h) : { x: 0, y: 0 }
|
|
908
946
|
};
|
|
909
947
|
}
|
|
910
|
-
function
|
|
911
|
-
if (
|
|
948
|
+
function x(e, n) {
|
|
949
|
+
if (n === "*")
|
|
912
950
|
return !0;
|
|
913
|
-
if (
|
|
914
|
-
const t =
|
|
915
|
-
return
|
|
951
|
+
if (n.endsWith("/*")) {
|
|
952
|
+
const t = n.slice(0, -2);
|
|
953
|
+
return e === t || e.startsWith(t + "/");
|
|
916
954
|
}
|
|
917
|
-
return
|
|
955
|
+
return e === n;
|
|
918
956
|
}
|
|
919
|
-
function
|
|
920
|
-
for (const
|
|
921
|
-
if (
|
|
922
|
-
return
|
|
923
|
-
for (const
|
|
924
|
-
if ((
|
|
925
|
-
return
|
|
957
|
+
function G(e, n, t) {
|
|
958
|
+
for (const i of t)
|
|
959
|
+
if (x(e, i.from) && x(n, i.to))
|
|
960
|
+
return i.transition;
|
|
961
|
+
for (const i of t)
|
|
962
|
+
if ((i.from === "*" || x(e, i.from)) && (i.to === "*" || x(n, i.to)))
|
|
963
|
+
return i.transition;
|
|
926
964
|
return null;
|
|
927
965
|
}
|
|
928
|
-
function
|
|
966
|
+
function bt() {
|
|
967
|
+
let e = null;
|
|
968
|
+
function n() {
|
|
969
|
+
if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
|
|
970
|
+
const t = { from: e.from, to: e.to };
|
|
971
|
+
e.outResolve(t), e.inResolve(t), e = null;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return {
|
|
975
|
+
trigger(t, i) {
|
|
976
|
+
e || (e = {}), i === "out" ? e.from = t : e.to = t;
|
|
977
|
+
},
|
|
978
|
+
get(t) {
|
|
979
|
+
return t === "in" && (!e || !e.from) ? Promise.resolve(null) : new Promise((i) => {
|
|
980
|
+
e || (e = {}), t === "out" ? e.outResolve = i : e.inResolve = i, n();
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function kt() {
|
|
986
|
+
let e = null;
|
|
987
|
+
function n() {
|
|
988
|
+
var i, r;
|
|
989
|
+
e && ((i = e.outResolve) == null || i.call(e, null), (r = e.inResolve) == null || r.call(e, null), e = null);
|
|
990
|
+
}
|
|
991
|
+
function t() {
|
|
992
|
+
if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
|
|
993
|
+
const i = { from: e.from, to: e.to };
|
|
994
|
+
e.outResolve(i), e.inResolve(i), e = null;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return {
|
|
998
|
+
trigger(i, r) {
|
|
999
|
+
e && (r === "out" && e.from && e.from !== i || r === "in" && e.to && e.to !== i) && n(), e || (e = {}), r === "out" ? e.from = i : e.to = i;
|
|
1000
|
+
},
|
|
1001
|
+
get(i) {
|
|
1002
|
+
return new Promise((r) => {
|
|
1003
|
+
e || (e = {}), i === "out" ? e.outResolve = r : e.inResolve = r, t();
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
function Dt(e, n) {
|
|
929
1009
|
const {
|
|
930
1010
|
transitions: t = [],
|
|
931
|
-
defaultTransition:
|
|
932
|
-
middleware:
|
|
1011
|
+
defaultTransition: i,
|
|
1012
|
+
middleware: r = (g, f) => ({ from: g, to: f }),
|
|
933
1013
|
// Identity function as default
|
|
934
|
-
skipOnIosSwipe:
|
|
1014
|
+
skipOnIosSwipe: o = !0
|
|
935
1015
|
// Default to true - skip animations on iOS swipe
|
|
936
|
-
} =
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1016
|
+
} = e, { outFirst: c = !0, createNavigationDetector: a } = n || {}, s = (a == null ? void 0 : a()) ?? (c ? bt() : kt()), u = At(t), {
|
|
1017
|
+
initializeContext: h,
|
|
1018
|
+
calculateScrollOffset: p,
|
|
1019
|
+
getScrollContainer: w,
|
|
1020
|
+
getPositionedParentElement: v,
|
|
1021
|
+
getScrollPosition: d
|
|
1022
|
+
} = Tt(), l = Et(o);
|
|
1023
|
+
l.initialize();
|
|
1024
|
+
const C = async (g, f) => {
|
|
1025
|
+
if (l.isSwipePending())
|
|
1026
|
+
return l.resetSwipeDetection(), () => ({});
|
|
1027
|
+
s.trigger(g, f);
|
|
1028
|
+
const S = await s.get(f);
|
|
1029
|
+
if (!S) return () => ({});
|
|
1030
|
+
const { from: A, to: b } = r(
|
|
1031
|
+
S.from,
|
|
1032
|
+
S.to
|
|
1033
|
+
), V = G(
|
|
1034
|
+
A,
|
|
1035
|
+
b,
|
|
1036
|
+
u
|
|
1037
|
+
) || i;
|
|
1038
|
+
if (!V) return () => ({});
|
|
1039
|
+
const R = p(S.from, S.to);
|
|
1040
|
+
if (f === "out") {
|
|
1041
|
+
const D = {
|
|
1042
|
+
scrollOffset: R,
|
|
1043
|
+
scroll: d(S.from),
|
|
961
1044
|
get scrollingElement() {
|
|
962
|
-
return
|
|
1045
|
+
return w() || document.documentElement;
|
|
963
1046
|
},
|
|
964
1047
|
get positionedParent() {
|
|
965
|
-
return
|
|
1048
|
+
return v();
|
|
966
1049
|
}
|
|
967
|
-
}
|
|
968
|
-
|
|
1050
|
+
};
|
|
1051
|
+
return (I) => V.out(I, D);
|
|
1052
|
+
} else {
|
|
1053
|
+
const D = {
|
|
1054
|
+
scrollOffset: R,
|
|
969
1055
|
get scroll() {
|
|
970
|
-
return
|
|
1056
|
+
return d(S.to);
|
|
971
1057
|
},
|
|
972
1058
|
get scrollingElement() {
|
|
973
|
-
return
|
|
1059
|
+
return w() || document.documentElement;
|
|
974
1060
|
},
|
|
975
1061
|
get positionedParent() {
|
|
976
|
-
return
|
|
1062
|
+
return v();
|
|
977
1063
|
}
|
|
978
1064
|
};
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1065
|
+
return async (I) => {
|
|
1066
|
+
const z = await Promise.resolve(V.in(I, D)), q = z.onStart;
|
|
1067
|
+
return z.onStart = () => {
|
|
1068
|
+
I.style.visibility = "visible", q == null || q();
|
|
1069
|
+
}, z;
|
|
1070
|
+
};
|
|
984
1071
|
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
const v = l ? async (w, h) => a.isSwipePending() ? (a.resetSwipeDetection(), () => ({})) : h === "in" && (!r || !r.from) ? () => ({}) : (r || (r = {}), h === "out" ? (r.from = w, new Promise((E) => {
|
|
990
|
-
r.outResolve = E, f();
|
|
991
|
-
})) : (r.to = w, new Promise((E) => {
|
|
992
|
-
r.inResolve = E, f();
|
|
993
|
-
}))) : async (w, h) => a.isSwipePending() ? (a.resetSwipeDetection(), () => ({})) : (r && (h === "out" && r.from && r.from !== w || h === "in" && r.to && r.to !== w) && A(), r || (r = {}), h === "out" ? (r.from = w, new Promise((C) => {
|
|
994
|
-
r.outResolve = C, f();
|
|
995
|
-
})) : (r.to = w, new Promise((C) => {
|
|
996
|
-
r.inResolve = C, f();
|
|
997
|
-
})));
|
|
998
|
-
return (w) => ({
|
|
999
|
-
key: w,
|
|
1000
|
-
in: async (h) => (u(h, w), (await v(w, "in"))(h)),
|
|
1001
|
-
out: async (h) => (await v(w, "out"))(h),
|
|
1072
|
+
}, y = (g) => ({
|
|
1073
|
+
key: g,
|
|
1074
|
+
in: async (f) => (h(f, g), (await C(g, "in"))(f)),
|
|
1075
|
+
out: async (f) => (await C(g, "out"))(f),
|
|
1002
1076
|
// Add page transition strategy for page-level transitions
|
|
1003
|
-
[
|
|
1004
|
-
})
|
|
1077
|
+
[B]: mt
|
|
1078
|
+
}), P = (g, f) => {
|
|
1079
|
+
const { from: S, to: A } = r(g, f);
|
|
1080
|
+
return !!(G(
|
|
1081
|
+
S,
|
|
1082
|
+
A,
|
|
1083
|
+
u
|
|
1084
|
+
) || i);
|
|
1085
|
+
};
|
|
1086
|
+
return a ? {
|
|
1087
|
+
getTransition: y,
|
|
1088
|
+
hasMatchingTransition: P
|
|
1089
|
+
} : y;
|
|
1005
1090
|
}
|
|
1006
1091
|
export {
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1092
|
+
J as SCOPE_ATTR,
|
|
1093
|
+
Q as SCOPE_READY_ATTR,
|
|
1094
|
+
B as TRANSITION_STRATEGY,
|
|
1095
|
+
kt as createAnyOrderDetector,
|
|
1096
|
+
ft as createDefaultStrategy,
|
|
1097
|
+
bt as createOutFirstDetector,
|
|
1098
|
+
mt as createPageTransitionStrategy,
|
|
1099
|
+
Dt as createSggoiTransitionContext,
|
|
1100
|
+
It as createTransitionScope,
|
|
1101
|
+
ht as findScope,
|
|
1102
|
+
Mt as getWatchedCount,
|
|
1103
|
+
_t as isCssAnimation,
|
|
1104
|
+
Nt as isMultiAnimation,
|
|
1105
|
+
dt as isScopeReady,
|
|
1106
|
+
Ut as isSingleAnimation,
|
|
1107
|
+
Ht as isTickAnimation,
|
|
1108
|
+
Ft as isWatched,
|
|
1109
|
+
X as normalizeSchedule,
|
|
1110
|
+
F as normalizeToMultiAnimation,
|
|
1111
|
+
Ot as resetObserver,
|
|
1112
|
+
Lt as transition,
|
|
1113
|
+
xt as triggerUnmount,
|
|
1114
|
+
vt as watchUnmount
|
|
1030
1115
|
};
|