@ssgoi/core 5.1.0 → 5.2.1
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/multi-animator.d.ts.map +1 -1
- package/dist/animator/runner/keyframes-runner.d.ts +14 -0
- package/dist/animator/runner/keyframes-runner.d.ts.map +1 -0
- package/dist/animator/runner/provider.d.ts +12 -3
- package/dist/animator/runner/provider.d.ts.map +1 -1
- package/dist/animator/single-animator.d.ts +7 -0
- package/dist/animator/single-animator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +430 -346
- package/dist/{provider-Cu4NSF1Q.js → provider-B2B8CK6H.js} +37 -62
- package/dist/provider-BKaONTeg.cjs +1 -0
- package/dist/spring-integrator-95Mh7mdw.cjs +1 -0
- package/dist/spring-integrator-BM4a-82c.js +33 -0
- package/dist/ssgoi-transition/create-swipe-back-detector.d.ts +8 -0
- package/dist/ssgoi-transition/create-swipe-back-detector.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +33 -32
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +74 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +44 -36
- package/dist/view-transitions/film.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +884 -775
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/provider-Cs5iBqRD.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var d = (e, i, t) =>
|
|
1
|
+
var nt = Object.defineProperty;
|
|
2
|
+
var it = (e, i, t) => i in e ? nt(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
|
|
3
|
+
var d = (e, i, t) => it(e, typeof i != "symbol" ? i + "" : i, t);
|
|
4
4
|
import { normalizeToMultiAnimation as F, normalizeSchedule as W } from "./types.js";
|
|
5
|
-
import { isCssAnimation as
|
|
6
|
-
import { S as
|
|
7
|
-
|
|
5
|
+
import { isCssAnimation as Gt, isKeyframesAnimation as $t, isMultiAnimation as Zt, isSingleAnimation as Jt, isTickAnimation as Qt } from "./types.js";
|
|
6
|
+
import { S as $, a as rt } from "./spring-integrator-BM4a-82c.js";
|
|
7
|
+
import { I as ot } from "./provider-B2B8CK6H.js";
|
|
8
|
+
class st {
|
|
8
9
|
constructor() {
|
|
9
10
|
d(this, "listeners", /* @__PURE__ */ new Set());
|
|
10
11
|
d(this, "rafId", null);
|
|
@@ -30,9 +31,9 @@ class ot {
|
|
|
30
31
|
n > this.lagThreshold || n < 0 ? (this.startTime += n - this.adjustedLag, n = this.adjustedLag) : n > this.maxDeltaTime && (n = this.maxDeltaTime), this.lastUpdate = i;
|
|
31
32
|
const r = i - this.startTime, o = r - this.nextTime;
|
|
32
33
|
if (o > 0) {
|
|
33
|
-
const
|
|
34
|
-
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((
|
|
35
|
-
|
|
34
|
+
const s = n / 1e3;
|
|
35
|
+
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((m) => {
|
|
36
|
+
m(s, this.elapsed);
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
@@ -68,62 +69,62 @@ class ot {
|
|
|
68
69
|
return this.elapsed;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
const z = new
|
|
72
|
-
function
|
|
72
|
+
const z = new st();
|
|
73
|
+
function at(e) {
|
|
73
74
|
const {
|
|
74
75
|
integrator: i,
|
|
75
76
|
from: t,
|
|
76
77
|
to: n,
|
|
77
78
|
velocity: r = 0,
|
|
78
79
|
onUpdate: o,
|
|
79
|
-
onComplete:
|
|
80
|
-
onStart:
|
|
80
|
+
onComplete: s,
|
|
81
|
+
onStart: m
|
|
81
82
|
} = e;
|
|
82
|
-
let
|
|
83
|
-
const A = (
|
|
84
|
-
if (
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
|
|
83
|
+
let l = { position: t, velocity: r }, u = !0, h = 0, v = !1;
|
|
84
|
+
const A = (S) => {
|
|
85
|
+
if (u) {
|
|
86
|
+
if (v || (v = !0, m == null || m()), l = i.step(l, n, S), i.isSettled(l, n)) {
|
|
87
|
+
if (h += Math.min(S, 0.033), h >= $) {
|
|
88
|
+
l = { position: n, velocity: 0 }, u = !1, o(l.position), z.unsubscribe(A), s();
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
91
|
} else
|
|
91
|
-
|
|
92
|
-
o(
|
|
92
|
+
h = 0;
|
|
93
|
+
o(l.position);
|
|
93
94
|
}
|
|
94
95
|
};
|
|
95
96
|
return z.subscribe(A), {
|
|
96
97
|
stop: () => {
|
|
97
|
-
|
|
98
|
+
u && (u = !1, z.unsubscribe(A));
|
|
98
99
|
},
|
|
99
|
-
getPosition: () =>
|
|
100
|
-
getVelocity: () =>
|
|
101
|
-
isRunning: () =>
|
|
100
|
+
getPosition: () => l.position,
|
|
101
|
+
getVelocity: () => l.velocity,
|
|
102
|
+
isRunning: () => u
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
const
|
|
105
|
+
const L = 1e3 / 60;
|
|
105
106
|
function ct(e, i, t, n = 0) {
|
|
106
|
-
let o = { position: i, velocity: n },
|
|
107
|
-
const
|
|
108
|
-
for (let
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
time:
|
|
107
|
+
let o = { position: i, velocity: n }, s = 0;
|
|
108
|
+
const m = [];
|
|
109
|
+
for (let l = 0; l < 600; l++) {
|
|
110
|
+
const u = l * L;
|
|
111
|
+
if (m.push({
|
|
112
|
+
time: u,
|
|
112
113
|
position: o.position,
|
|
113
114
|
velocity: o.velocity
|
|
114
|
-
}), o = e.step(o, t,
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
time: (
|
|
115
|
+
}), o = e.step(o, t, L / 1e3), e.isSettled(o, t)) {
|
|
116
|
+
if (s += L / 1e3, s >= $) {
|
|
117
|
+
m.push({
|
|
118
|
+
time: (l + 1) * L,
|
|
118
119
|
position: t,
|
|
119
120
|
velocity: 0
|
|
120
121
|
});
|
|
121
122
|
break;
|
|
122
123
|
}
|
|
123
124
|
} else
|
|
124
|
-
|
|
125
|
+
s = 0;
|
|
125
126
|
}
|
|
126
|
-
return
|
|
127
|
+
return m;
|
|
127
128
|
}
|
|
128
129
|
function H(e, i) {
|
|
129
130
|
if (e.length === 0)
|
|
@@ -135,71 +136,114 @@ function H(e, i) {
|
|
|
135
136
|
return { position: n.position, velocity: n.velocity };
|
|
136
137
|
let r = 0, o = e.length - 1;
|
|
137
138
|
for (; r < o - 1; ) {
|
|
138
|
-
const
|
|
139
|
-
e[
|
|
139
|
+
const u = Math.floor((r + o) / 2);
|
|
140
|
+
e[u].time <= i ? r = u : o = u;
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
+
const s = e[r], m = e[o], l = (i - s.time) / (m.time - s.time);
|
|
142
143
|
return {
|
|
143
|
-
position:
|
|
144
|
-
velocity:
|
|
144
|
+
position: s.position + (m.position - s.position) * l,
|
|
145
|
+
velocity: s.velocity + (m.velocity - s.velocity) * l
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function lt(e, i) {
|
|
148
149
|
return e.map((t) => i(t.position));
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function ut(e) {
|
|
151
152
|
const {
|
|
152
153
|
integrator: i,
|
|
153
154
|
element: t,
|
|
154
155
|
from: n,
|
|
155
156
|
to: r,
|
|
156
157
|
velocity: o = 0,
|
|
157
|
-
style:
|
|
158
|
-
onComplete:
|
|
159
|
-
onStart:
|
|
160
|
-
} = e,
|
|
161
|
-
if (
|
|
162
|
-
return
|
|
158
|
+
style: s,
|
|
159
|
+
onComplete: m,
|
|
160
|
+
onStart: l
|
|
161
|
+
} = e, u = ct(i, n, r, o);
|
|
162
|
+
if (u.length === 0)
|
|
163
|
+
return l == null || l(), m(), {
|
|
163
164
|
stop: () => {
|
|
164
165
|
},
|
|
165
166
|
getPosition: () => r,
|
|
166
167
|
getVelocity: () => 0,
|
|
167
168
|
isRunning: () => !1
|
|
168
169
|
};
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
for (const
|
|
172
|
-
t.style[
|
|
173
|
-
const
|
|
170
|
+
const h = lt(u, s), v = u[u.length - 1], A = v.time, S = h[0];
|
|
171
|
+
if (S)
|
|
172
|
+
for (const T of Object.keys(S))
|
|
173
|
+
t.style[T] = "";
|
|
174
|
+
const y = t.animate(h, {
|
|
174
175
|
duration: A,
|
|
175
176
|
fill: "forwards",
|
|
176
177
|
easing: "linear",
|
|
177
178
|
composite: "replace"
|
|
178
179
|
});
|
|
179
|
-
let
|
|
180
|
-
const
|
|
181
|
-
return
|
|
182
|
-
|
|
180
|
+
let p = !0;
|
|
181
|
+
const k = performance.now();
|
|
182
|
+
return l == null || l(), y.onfinish = () => {
|
|
183
|
+
p && (p = !1, m());
|
|
183
184
|
}, {
|
|
184
185
|
stop: () => {
|
|
185
|
-
|
|
186
|
+
p && (p = !1, y.cancel());
|
|
186
187
|
},
|
|
187
188
|
getPosition: () => {
|
|
188
|
-
if (!
|
|
189
|
-
return
|
|
190
|
-
const
|
|
191
|
-
return H(
|
|
189
|
+
if (!p)
|
|
190
|
+
return v.position;
|
|
191
|
+
const T = performance.now() - k;
|
|
192
|
+
return H(u, T).position;
|
|
192
193
|
},
|
|
193
194
|
getVelocity: () => {
|
|
194
|
-
if (!
|
|
195
|
+
if (!p)
|
|
195
196
|
return 0;
|
|
196
|
-
const
|
|
197
|
-
return H(
|
|
197
|
+
const T = performance.now() - k;
|
|
198
|
+
return H(u, T).velocity;
|
|
198
199
|
},
|
|
199
|
-
isRunning: () =>
|
|
200
|
+
isRunning: () => p
|
|
200
201
|
};
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function ft(e) {
|
|
204
|
+
const {
|
|
205
|
+
element: i,
|
|
206
|
+
frames: t,
|
|
207
|
+
duration: n,
|
|
208
|
+
easing: r = "linear",
|
|
209
|
+
from: o,
|
|
210
|
+
to: s,
|
|
211
|
+
onComplete: m,
|
|
212
|
+
onStart: l
|
|
213
|
+
} = e, u = t[0];
|
|
214
|
+
if (u)
|
|
215
|
+
for (const S of Object.keys(u))
|
|
216
|
+
S === "offset" || S === "easing" || S === "composite" || (i.style[S] = "");
|
|
217
|
+
const h = i.animate(t, {
|
|
218
|
+
duration: n,
|
|
219
|
+
fill: "forwards",
|
|
220
|
+
easing: r,
|
|
221
|
+
composite: "replace"
|
|
222
|
+
});
|
|
223
|
+
let v = !0;
|
|
224
|
+
const A = performance.now();
|
|
225
|
+
return l == null || l(), h.onfinish = () => {
|
|
226
|
+
v && (v = !1, m());
|
|
227
|
+
}, {
|
|
228
|
+
stop: () => {
|
|
229
|
+
v && (v = !1, h.cancel());
|
|
230
|
+
},
|
|
231
|
+
// Linear progress mapped onto [from, to] — used by MultiAnimator for
|
|
232
|
+
// stagger thresholds. The actual visual motion is whatever the keyframes
|
|
233
|
+
// dictate; this mapping just gives the orchestration layer a monotonic
|
|
234
|
+
// progress signal.
|
|
235
|
+
getPosition: () => {
|
|
236
|
+
if (!v) return s;
|
|
237
|
+
const S = performance.now() - A, y = Math.min(Math.max(S / n, 0), 1);
|
|
238
|
+
return o + (s - o) * y;
|
|
239
|
+
},
|
|
240
|
+
// Baked animations don't expose velocity — interruption/resumption isn't
|
|
241
|
+
// supported here (you can stop, but can't resume mid-flight with momentum).
|
|
242
|
+
getVelocity: () => 0,
|
|
243
|
+
isRunning: () => v
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function mt(e) {
|
|
203
247
|
const { to: i, onStart: t, onComplete: n } = e;
|
|
204
248
|
return t == null || t(), n(), {
|
|
205
249
|
stop: () => {
|
|
@@ -209,32 +253,61 @@ function ut(e) {
|
|
|
209
253
|
isRunning: () => !1
|
|
210
254
|
};
|
|
211
255
|
}
|
|
212
|
-
class
|
|
256
|
+
class dt {
|
|
213
257
|
/**
|
|
214
258
|
* Get bound runner based on animation mode
|
|
215
259
|
*
|
|
216
|
-
* @param options Animation mode options
|
|
260
|
+
* @param options Animation mode options — exactly one of tick / css / keyframes
|
|
217
261
|
* @returns Bound runner function (empty runner if no animation mode specified)
|
|
218
|
-
* @throws Error if
|
|
262
|
+
* @throws Error if more than one mode is provided
|
|
219
263
|
*/
|
|
220
264
|
static from(i) {
|
|
221
|
-
const { tick: t, css: n } = i;
|
|
222
|
-
if (t
|
|
223
|
-
throw new Error(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
265
|
+
const { tick: t, css: n, keyframes: r } = i;
|
|
266
|
+
if ((t ? 1 : 0) + (n ? 1 : 0) + (r ? 1 : 0) > 1)
|
|
267
|
+
throw new Error(
|
|
268
|
+
"Cannot use more than one of 'tick', 'css', 'keyframes' together"
|
|
269
|
+
);
|
|
270
|
+
return r ? (s) => ft({
|
|
271
|
+
element: r.element,
|
|
272
|
+
frames: r.frames,
|
|
273
|
+
duration: r.duration,
|
|
274
|
+
easing: r.easing,
|
|
275
|
+
from: s.from,
|
|
276
|
+
to: s.to,
|
|
277
|
+
onComplete: s.onComplete,
|
|
278
|
+
onStart: s.onStart
|
|
279
|
+
}) : n ? (s) => {
|
|
280
|
+
if (!s.integrator)
|
|
281
|
+
throw new Error("css mode requires an integrator");
|
|
282
|
+
return ut({
|
|
283
|
+
integrator: s.integrator,
|
|
284
|
+
from: s.from,
|
|
285
|
+
to: s.to,
|
|
286
|
+
velocity: s.velocity,
|
|
287
|
+
onComplete: s.onComplete,
|
|
288
|
+
onStart: s.onStart,
|
|
289
|
+
element: n.element,
|
|
290
|
+
style: n.style
|
|
291
|
+
});
|
|
292
|
+
} : t ? (s) => {
|
|
293
|
+
if (!s.integrator)
|
|
294
|
+
throw new Error("tick mode requires an integrator");
|
|
295
|
+
return at({
|
|
296
|
+
integrator: s.integrator,
|
|
297
|
+
from: s.from,
|
|
298
|
+
to: s.to,
|
|
299
|
+
velocity: s.velocity,
|
|
300
|
+
onComplete: s.onComplete,
|
|
301
|
+
onStart: s.onStart,
|
|
302
|
+
onUpdate: t
|
|
303
|
+
});
|
|
304
|
+
} : mt;
|
|
232
305
|
}
|
|
233
306
|
}
|
|
234
|
-
class
|
|
307
|
+
class Z {
|
|
235
308
|
}
|
|
236
|
-
const
|
|
237
|
-
class
|
|
309
|
+
const ht = { stiffness: 300, damping: 30 };
|
|
310
|
+
class K extends Z {
|
|
238
311
|
constructor(t) {
|
|
239
312
|
super();
|
|
240
313
|
d(this, "options");
|
|
@@ -244,6 +317,7 @@ class U extends $ {
|
|
|
244
317
|
d(this, "currentValue");
|
|
245
318
|
d(this, "currentVelocity", 0);
|
|
246
319
|
d(this, "updateFn");
|
|
320
|
+
d(this, "isKeyframesMode");
|
|
247
321
|
if (this.options = {
|
|
248
322
|
from: t.from ?? 0,
|
|
249
323
|
to: t.to ?? 1,
|
|
@@ -251,7 +325,7 @@ class U extends $ {
|
|
|
251
325
|
onComplete: t.onComplete ?? (() => {
|
|
252
326
|
}),
|
|
253
327
|
onStart: t.onStart
|
|
254
|
-
}, this.currentValue = this.options.from, t.tick)
|
|
328
|
+
}, this.currentValue = this.options.from, this.isKeyframesMode = !!t.keyframes, t.tick)
|
|
255
329
|
this.updateFn = (n) => {
|
|
256
330
|
var r;
|
|
257
331
|
return (r = t.tick) == null ? void 0 : r.call(t, n);
|
|
@@ -259,16 +333,17 @@ class U extends $ {
|
|
|
259
333
|
else if (t.css) {
|
|
260
334
|
const { element: n, style: r } = t.css;
|
|
261
335
|
this.updateFn = (o) => {
|
|
262
|
-
const
|
|
263
|
-
for (const [
|
|
264
|
-
n.style[
|
|
336
|
+
const s = r(o);
|
|
337
|
+
for (const [m, l] of Object.entries(s))
|
|
338
|
+
n.style[m] = typeof l == "number" ? String(l) : l;
|
|
265
339
|
};
|
|
266
340
|
} else
|
|
267
341
|
this.updateFn = () => {
|
|
268
342
|
};
|
|
269
|
-
this.runner =
|
|
343
|
+
this.runner = dt.from({
|
|
270
344
|
tick: t.tick,
|
|
271
|
-
css: t.css
|
|
345
|
+
css: t.css,
|
|
346
|
+
keyframes: t.keyframes
|
|
272
347
|
});
|
|
273
348
|
}
|
|
274
349
|
/**
|
|
@@ -285,14 +360,16 @@ class U extends $ {
|
|
|
285
360
|
*/
|
|
286
361
|
createIntegrator() {
|
|
287
362
|
const t = this.options.physics;
|
|
288
|
-
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ?
|
|
363
|
+
return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? ot.from({
|
|
289
364
|
spring: t.spring,
|
|
290
365
|
inertia: t.inertia
|
|
291
|
-
}) : new rt(
|
|
366
|
+
}) : new rt(ht);
|
|
292
367
|
}
|
|
293
368
|
runAnimation(t) {
|
|
294
369
|
this.isAnimating = !0, this.controls = this.runner({
|
|
295
|
-
integrator
|
|
370
|
+
// Keyframes mode plays a pre-baked WAAPI animation — no integrator
|
|
371
|
+
// needed. tick/css modes still require one.
|
|
372
|
+
integrator: this.isKeyframesMode ? void 0 : this.createIntegrator(),
|
|
296
373
|
from: this.currentValue,
|
|
297
374
|
to: t,
|
|
298
375
|
velocity: this.currentVelocity,
|
|
@@ -344,7 +421,7 @@ class U extends $ {
|
|
|
344
421
|
this.options = { ...this.options, ...t };
|
|
345
422
|
}
|
|
346
423
|
}
|
|
347
|
-
class D extends
|
|
424
|
+
class D extends Z {
|
|
348
425
|
constructor(t) {
|
|
349
426
|
super();
|
|
350
427
|
d(this, "config");
|
|
@@ -368,12 +445,13 @@ class D extends $ {
|
|
|
368
445
|
}
|
|
369
446
|
initializeAnimators() {
|
|
370
447
|
this.config.items.forEach((t, n) => {
|
|
371
|
-
const r = this.generateId(), o = new
|
|
448
|
+
const r = this.generateId(), o = new K({
|
|
372
449
|
from: this.from,
|
|
373
450
|
to: this.to,
|
|
374
451
|
physics: t.physics,
|
|
375
452
|
tick: t.tick,
|
|
376
453
|
css: t.css,
|
|
454
|
+
keyframes: t.keyframes,
|
|
377
455
|
onComplete: () => this.onAnimatorComplete(r),
|
|
378
456
|
onStart: t.onStart
|
|
379
457
|
});
|
|
@@ -402,9 +480,9 @@ class D extends $ {
|
|
|
402
480
|
return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
|
|
403
481
|
}
|
|
404
482
|
onAnimatorComplete(t) {
|
|
405
|
-
var r, o,
|
|
483
|
+
var r, o, s, m, l, u;
|
|
406
484
|
const n = this.animators.get(t);
|
|
407
|
-
!n || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = n.item).onComplete) == null || o.call(r), (
|
|
485
|
+
!n || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = n.item).onComplete) == null || o.call(r), (m = (s = this.config).onProgress) == null || m.call(s, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (l = this.config).onEnd) == null || u.call(l)));
|
|
408
486
|
}
|
|
409
487
|
/**
|
|
410
488
|
* Check and start springs based on previous spring's progress
|
|
@@ -419,10 +497,10 @@ class D extends $ {
|
|
|
419
497
|
this.startAnimator(r);
|
|
420
498
|
continue;
|
|
421
499
|
}
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
424
|
-
const
|
|
425
|
-
|
|
500
|
+
const s = t[n - 1], m = this.animators.get(s);
|
|
501
|
+
if (!m || !m.started) continue;
|
|
502
|
+
const l = this.getAnimatorProgress(m), u = o.item.normalizedOffset;
|
|
503
|
+
l >= u && this.startAnimator(r);
|
|
426
504
|
}
|
|
427
505
|
}
|
|
428
506
|
startAnimator(t) {
|
|
@@ -470,12 +548,13 @@ class D extends $ {
|
|
|
470
548
|
return;
|
|
471
549
|
const n = t.animator.getCurrentState();
|
|
472
550
|
if (n.position === n.to) {
|
|
473
|
-
const o = new
|
|
551
|
+
const o = new K({
|
|
474
552
|
from: this.to,
|
|
475
553
|
to: this.from,
|
|
476
554
|
physics: t.item.physics,
|
|
477
555
|
tick: t.item.tick,
|
|
478
556
|
css: t.item.css,
|
|
557
|
+
keyframes: t.item.keyframes,
|
|
479
558
|
onComplete: () => this.onAnimatorComplete(t.id),
|
|
480
559
|
onStart: t.item.onStart
|
|
481
560
|
});
|
|
@@ -540,7 +619,7 @@ class D extends $ {
|
|
|
540
619
|
return new D({ ...n, state: t });
|
|
541
620
|
}
|
|
542
621
|
}
|
|
543
|
-
const
|
|
622
|
+
const J = Symbol.for("TRANSITION_STRATEGY"), gt = (e) => ({
|
|
544
623
|
runIn: async (i) => {
|
|
545
624
|
const { currentAnimation: t } = e;
|
|
546
625
|
if (t && t.direction === "out") {
|
|
@@ -607,7 +686,7 @@ const Z = Symbol.for("TRANSITION_STRATEGY"), dt = (e) => ({
|
|
|
607
686
|
direction: "forward"
|
|
608
687
|
};
|
|
609
688
|
}
|
|
610
|
-
}),
|
|
689
|
+
}), yt = () => ({
|
|
611
690
|
runIn: async (e) => e.in ? {
|
|
612
691
|
config: await e.in,
|
|
613
692
|
state: {
|
|
@@ -644,25 +723,25 @@ const Z = Symbol.for("TRANSITION_STRATEGY"), dt = (e) => ({
|
|
|
644
723
|
to: 0,
|
|
645
724
|
direction: "forward"
|
|
646
725
|
}
|
|
647
|
-
}),
|
|
648
|
-
function
|
|
726
|
+
}), Q = "data-ssgoi-scope", tt = "data-ssgoi-scope-ready";
|
|
727
|
+
function Nt() {
|
|
649
728
|
return (e) => {
|
|
650
729
|
if (e)
|
|
651
|
-
return e.setAttribute(
|
|
730
|
+
return e.setAttribute(Q, ""), queueMicrotask(() => {
|
|
652
731
|
queueMicrotask(() => {
|
|
653
|
-
e.setAttribute(
|
|
732
|
+
e.setAttribute(tt, "true");
|
|
654
733
|
});
|
|
655
734
|
}), () => {
|
|
656
735
|
};
|
|
657
736
|
};
|
|
658
737
|
}
|
|
659
|
-
function gt(e) {
|
|
660
|
-
return e.hasAttribute(Q);
|
|
661
|
-
}
|
|
662
738
|
function wt(e) {
|
|
663
|
-
return e.
|
|
739
|
+
return e.hasAttribute(tt);
|
|
740
|
+
}
|
|
741
|
+
function pt(e) {
|
|
742
|
+
return e.closest(`[${Q}]`);
|
|
664
743
|
}
|
|
665
|
-
const
|
|
744
|
+
const vt = (e) => {
|
|
666
745
|
let i = e.parentElement;
|
|
667
746
|
for (; i && i !== document.body; ) {
|
|
668
747
|
const t = window.getComputedStyle(i), n = t.overflow + t.overflowY + t.overflowX;
|
|
@@ -671,7 +750,7 @@ const pt = (e) => {
|
|
|
671
750
|
i = i.parentElement;
|
|
672
751
|
}
|
|
673
752
|
return document.documentElement;
|
|
674
|
-
},
|
|
753
|
+
}, St = (e) => {
|
|
675
754
|
let i = e.parentElement;
|
|
676
755
|
for (; i && i !== document.body; ) {
|
|
677
756
|
const t = window.getComputedStyle(i).position;
|
|
@@ -681,7 +760,7 @@ const pt = (e) => {
|
|
|
681
760
|
}
|
|
682
761
|
return document.body;
|
|
683
762
|
};
|
|
684
|
-
function
|
|
763
|
+
function U(e) {
|
|
685
764
|
return new Promise((i) => {
|
|
686
765
|
requestAnimationFrame(() => {
|
|
687
766
|
requestAnimationFrame(() => {
|
|
@@ -690,104 +769,104 @@ function B(e) {
|
|
|
690
769
|
});
|
|
691
770
|
});
|
|
692
771
|
}
|
|
693
|
-
function
|
|
694
|
-
var
|
|
772
|
+
function At(e, i) {
|
|
773
|
+
var S;
|
|
695
774
|
let t = null, n = null, r = null, o = null;
|
|
696
|
-
const
|
|
775
|
+
const s = {
|
|
697
776
|
get currentAnimation() {
|
|
698
777
|
return t;
|
|
699
778
|
}
|
|
700
|
-
},
|
|
701
|
-
var
|
|
779
|
+
}, m = ((S = i == null ? void 0 : i.strategy) == null ? void 0 : S.call(i, s)) || gt(s), l = async (y) => {
|
|
780
|
+
var g, E;
|
|
702
781
|
n && (n.remove(), n = null);
|
|
703
|
-
const
|
|
704
|
-
if (!
|
|
782
|
+
const p = e(), k = p.in && p.in(y), T = !(i != null && i.strategy) && p.out ? p.out(y) : void 0;
|
|
783
|
+
if (!k)
|
|
705
784
|
return;
|
|
706
|
-
const
|
|
707
|
-
in: F(
|
|
708
|
-
out:
|
|
709
|
-
},
|
|
710
|
-
if (!
|
|
785
|
+
const w = {
|
|
786
|
+
in: F(k),
|
|
787
|
+
out: T ? F(T) : void 0
|
|
788
|
+
}, f = await m.runIn(w);
|
|
789
|
+
if (!f.config) {
|
|
711
790
|
t && (t.direction = "in");
|
|
712
791
|
return;
|
|
713
792
|
}
|
|
714
|
-
const
|
|
715
|
-
(
|
|
716
|
-
const
|
|
793
|
+
const a = f.config;
|
|
794
|
+
(g = a.prepare) == null || g.call(a);
|
|
795
|
+
const C = W(
|
|
717
796
|
{
|
|
718
|
-
...
|
|
797
|
+
...a,
|
|
719
798
|
onEnd: () => {
|
|
720
799
|
var b;
|
|
721
|
-
t = null, (b =
|
|
800
|
+
t = null, (b = a.onEnd) == null || b.call(a);
|
|
722
801
|
}
|
|
723
802
|
},
|
|
724
|
-
|
|
803
|
+
y
|
|
725
804
|
);
|
|
726
|
-
|
|
727
|
-
const c = D.fromState(
|
|
728
|
-
config:
|
|
729
|
-
from:
|
|
730
|
-
to:
|
|
805
|
+
a.wait && await a.wait();
|
|
806
|
+
const c = D.fromState(f.state, {
|
|
807
|
+
config: C,
|
|
808
|
+
from: f.from,
|
|
809
|
+
to: f.to
|
|
731
810
|
});
|
|
732
|
-
t = { controller: c, direction: "in" }, (
|
|
733
|
-
},
|
|
734
|
-
var
|
|
735
|
-
n =
|
|
736
|
-
const
|
|
737
|
-
if (!
|
|
811
|
+
t = { controller: c, direction: "in" }, (E = a.onReady) == null || E.call(a), await U(), f.direction === "forward" ? c.forward() : c.backward();
|
|
812
|
+
}, u = async (y) => {
|
|
813
|
+
var E, b;
|
|
814
|
+
n = y;
|
|
815
|
+
const p = e(), k = !(i != null && i.strategy) && p.in ? p.in(y) : void 0, T = p.out && p.out(y);
|
|
816
|
+
if (!T)
|
|
738
817
|
return;
|
|
739
|
-
const
|
|
740
|
-
in:
|
|
741
|
-
out: F(
|
|
742
|
-
},
|
|
743
|
-
if (!
|
|
818
|
+
const w = {
|
|
819
|
+
in: k ? F(k) : void 0,
|
|
820
|
+
out: F(T)
|
|
821
|
+
}, f = await m.runOut(w);
|
|
822
|
+
if (!f.config) {
|
|
744
823
|
t && (t.direction = "out"), n && (n.remove(), n = null);
|
|
745
824
|
return;
|
|
746
825
|
}
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
const
|
|
826
|
+
const a = f.config;
|
|
827
|
+
g(), (E = a.prepare) == null || E.call(a);
|
|
828
|
+
const C = W(
|
|
750
829
|
{
|
|
751
|
-
...
|
|
830
|
+
...a,
|
|
752
831
|
onEnd: () => {
|
|
753
|
-
var
|
|
754
|
-
(
|
|
832
|
+
var R, M;
|
|
833
|
+
(R = a.onEnd) == null || R.call(a), n && (n.remove(), n = null), t = null, (M = i == null ? void 0 : i.onCleanupEnd) == null || M.call(i);
|
|
755
834
|
}
|
|
756
835
|
},
|
|
757
|
-
|
|
836
|
+
y
|
|
758
837
|
);
|
|
759
|
-
|
|
760
|
-
const c = D.fromState(
|
|
761
|
-
config:
|
|
762
|
-
from:
|
|
763
|
-
to:
|
|
838
|
+
a.wait && await a.wait();
|
|
839
|
+
const c = D.fromState(f.state, {
|
|
840
|
+
config: C,
|
|
841
|
+
from: f.from,
|
|
842
|
+
to: f.to
|
|
764
843
|
});
|
|
765
|
-
t = { controller: c, direction: "out" }, (b =
|
|
766
|
-
function
|
|
844
|
+
t = { controller: c, direction: "out" }, (b = a.onReady) == null || b.call(a), await U(), f.direction === "forward" ? c.forward() : c.backward();
|
|
845
|
+
function g() {
|
|
767
846
|
!r || !n || (o && r.contains(o) ? r.insertBefore(n, o) : r.appendChild(n));
|
|
768
847
|
}
|
|
769
848
|
};
|
|
770
|
-
let
|
|
771
|
-
const A = (
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
document.contains(
|
|
777
|
-
}) :
|
|
849
|
+
let h = null, v = !1;
|
|
850
|
+
const A = (y) => () => {
|
|
851
|
+
if (v) return;
|
|
852
|
+
v = !0;
|
|
853
|
+
const p = y.cloneNode(!0);
|
|
854
|
+
h ? queueMicrotask(() => {
|
|
855
|
+
document.contains(h) && u(p);
|
|
856
|
+
}) : u(p);
|
|
778
857
|
};
|
|
779
|
-
return (
|
|
780
|
-
if (
|
|
858
|
+
return (y) => {
|
|
859
|
+
if (y)
|
|
781
860
|
return requestAnimationFrame(() => {
|
|
782
|
-
r =
|
|
783
|
-
}),
|
|
784
|
-
|
|
785
|
-
}) :
|
|
861
|
+
r = y.parentElement, o = y.nextElementSibling;
|
|
862
|
+
}), v = !1, (i == null ? void 0 : i.scope) === "local" ? queueMicrotask(() => {
|
|
863
|
+
h = pt(y), !(h && !wt(h)) && l(y);
|
|
864
|
+
}) : l(y), A(y);
|
|
786
865
|
};
|
|
787
866
|
}
|
|
788
867
|
const P = /* @__PURE__ */ new Map();
|
|
789
|
-
let I = null,
|
|
790
|
-
function
|
|
868
|
+
let I = null, q = !1;
|
|
869
|
+
function et(e) {
|
|
791
870
|
if (e instanceof HTMLElement && P.has(e)) {
|
|
792
871
|
const t = P.get(e);
|
|
793
872
|
P.delete(e), queueMicrotask(() => {
|
|
@@ -797,16 +876,16 @@ function tt(e) {
|
|
|
797
876
|
const i = e.childNodes;
|
|
798
877
|
for (let t = 0; t < i.length; t++) {
|
|
799
878
|
const n = i[t];
|
|
800
|
-
n &&
|
|
879
|
+
n && et(n);
|
|
801
880
|
}
|
|
802
881
|
}
|
|
803
|
-
function
|
|
804
|
-
|
|
882
|
+
function Ct() {
|
|
883
|
+
q || typeof document > "u" || (q = !0, I = new MutationObserver((e) => {
|
|
805
884
|
for (const i of e) {
|
|
806
885
|
const t = i.removedNodes;
|
|
807
886
|
for (let n = 0; n < t.length; n++) {
|
|
808
887
|
const r = t[n];
|
|
809
|
-
r &&
|
|
888
|
+
r && et(r);
|
|
810
889
|
}
|
|
811
890
|
}
|
|
812
891
|
}), document.body ? I.observe(document.body, {
|
|
@@ -824,54 +903,54 @@ function St() {
|
|
|
824
903
|
));
|
|
825
904
|
}
|
|
826
905
|
function Et(e, i) {
|
|
827
|
-
|
|
906
|
+
Ct(), P.set(e, i);
|
|
828
907
|
}
|
|
829
|
-
function
|
|
908
|
+
function Xt(e) {
|
|
830
909
|
return P.has(e);
|
|
831
910
|
}
|
|
832
|
-
function
|
|
911
|
+
function Wt() {
|
|
833
912
|
return P.size;
|
|
834
913
|
}
|
|
835
|
-
function
|
|
914
|
+
function Ht(e) {
|
|
836
915
|
const i = P.get(e);
|
|
837
916
|
return i ? (P.delete(e), i(), !0) : !1;
|
|
838
917
|
}
|
|
839
|
-
function
|
|
840
|
-
P.clear(), I == null || I.disconnect(), I = null,
|
|
918
|
+
function Kt() {
|
|
919
|
+
P.clear(), I == null || I.disconnect(), I = null, q = !1;
|
|
841
920
|
}
|
|
842
|
-
const
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
let n =
|
|
921
|
+
const O = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
|
|
922
|
+
function Tt(e, i, t) {
|
|
923
|
+
O.set(e, i);
|
|
924
|
+
let n = N.get(e);
|
|
846
925
|
if (n)
|
|
847
926
|
return n;
|
|
848
927
|
const r = i;
|
|
849
|
-
return n =
|
|
928
|
+
return n = At(
|
|
850
929
|
() => {
|
|
851
|
-
const o =
|
|
930
|
+
const o = O.get(e);
|
|
852
931
|
return o || (console.warn(`Transition "${String(e)}" not found`), {});
|
|
853
932
|
},
|
|
854
933
|
{
|
|
855
934
|
strategy: t == null ? void 0 : t.strategy,
|
|
856
935
|
scope: t == null ? void 0 : t.scope,
|
|
857
936
|
onCleanupEnd: () => {
|
|
858
|
-
|
|
937
|
+
O.get(e) === r && bt(e);
|
|
859
938
|
}
|
|
860
939
|
}
|
|
861
|
-
),
|
|
940
|
+
), N.set(e, n), n;
|
|
862
941
|
}
|
|
863
|
-
function
|
|
864
|
-
|
|
942
|
+
function bt(e) {
|
|
943
|
+
O.delete(e), N.delete(e), X.delete(e);
|
|
865
944
|
}
|
|
866
|
-
function
|
|
867
|
-
const t =
|
|
945
|
+
function Ut(e, i = "manual") {
|
|
946
|
+
const t = Tt(
|
|
868
947
|
e.key,
|
|
869
948
|
{
|
|
870
949
|
in: e.in,
|
|
871
950
|
out: e.out
|
|
872
951
|
},
|
|
873
952
|
{
|
|
874
|
-
strategy: e[
|
|
953
|
+
strategy: e[J],
|
|
875
954
|
scope: e.scope
|
|
876
955
|
}
|
|
877
956
|
);
|
|
@@ -885,7 +964,7 @@ function Ht(e, i = "manual") {
|
|
|
885
964
|
}
|
|
886
965
|
}, X.set(e.key, n), n);
|
|
887
966
|
}
|
|
888
|
-
function
|
|
967
|
+
function kt(e) {
|
|
889
968
|
const i = e.filter((t) => t.symmetric).map((t) => ({
|
|
890
969
|
from: t.to,
|
|
891
970
|
to: t.from,
|
|
@@ -902,7 +981,7 @@ function V(e, i) {
|
|
|
902
981
|
}
|
|
903
982
|
return e === i;
|
|
904
983
|
}
|
|
905
|
-
function
|
|
984
|
+
function Rt(e, i, t) {
|
|
906
985
|
for (const n of t)
|
|
907
986
|
if (V(e, n.from) && V(i, n.to))
|
|
908
987
|
return n.transition;
|
|
@@ -911,158 +990,162 @@ function bt(e, i, t) {
|
|
|
911
990
|
return n.transition;
|
|
912
991
|
return null;
|
|
913
992
|
}
|
|
914
|
-
const
|
|
915
|
-
function
|
|
993
|
+
const It = 768, Pt = 10, Mt = 10;
|
|
994
|
+
function Vt(e = {}) {
|
|
916
995
|
const { preserveScroll: i = (c) => c } = e, t = typeof i == "function" ? i : () => i;
|
|
917
996
|
let n = null, r = !1, o = !1;
|
|
918
|
-
const
|
|
919
|
-
const c = (n == null ? void 0 : n.clientWidth) ?? 0,
|
|
920
|
-
return
|
|
921
|
-
},
|
|
922
|
-
const
|
|
923
|
-
return
|
|
997
|
+
const s = () => {
|
|
998
|
+
const c = (n == null ? void 0 : n.clientWidth) ?? 0, g = c > 0 ? c : typeof window < "u" ? window.innerWidth : 0;
|
|
999
|
+
return g > 0 && g < It;
|
|
1000
|
+
}, m = () => (o || (r = s(), o = !0), r), l = (c) => {
|
|
1001
|
+
const g = t(m());
|
|
1002
|
+
return g === !1 ? !1 : g === !0 ? !0 : !g.exclude.some((E) => V(c, E));
|
|
924
1003
|
};
|
|
925
|
-
let
|
|
926
|
-
const
|
|
927
|
-
let
|
|
928
|
-
const
|
|
929
|
-
n &&
|
|
1004
|
+
let u = null;
|
|
1005
|
+
const h = /* @__PURE__ */ new Map();
|
|
1006
|
+
let v = null, A = !1, S = 0;
|
|
1007
|
+
const y = () => {
|
|
1008
|
+
n && v && !A && h.set(v, {
|
|
930
1009
|
x: n.scrollLeft,
|
|
931
1010
|
y: n.scrollTop
|
|
932
1011
|
});
|
|
933
|
-
},
|
|
1012
|
+
}, p = (c) => {
|
|
934
1013
|
if (!n) return;
|
|
935
|
-
const
|
|
936
|
-
let
|
|
1014
|
+
const g = l(c) && h.has(c) ? h.get(c) : { x: 0, y: 0 };
|
|
1015
|
+
let E = 0;
|
|
937
1016
|
const b = () => {
|
|
938
1017
|
if (!n) return;
|
|
939
1018
|
n.scrollTo({
|
|
940
|
-
top:
|
|
941
|
-
left:
|
|
942
|
-
}), !(Math.abs(n.scrollTop -
|
|
1019
|
+
top: g.y,
|
|
1020
|
+
left: g.x
|
|
1021
|
+
}), !(Math.abs(n.scrollTop - g.y) < 1 && Math.abs(n.scrollLeft - g.x) < 1) && E < Pt && (E++, requestAnimationFrame(b));
|
|
943
1022
|
};
|
|
944
1023
|
requestAnimationFrame(b);
|
|
945
1024
|
};
|
|
946
1025
|
return {
|
|
947
|
-
initializeContext: (c,
|
|
1026
|
+
initializeContext: (c, g) => {
|
|
948
1027
|
A = !0;
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
r =
|
|
952
|
-
}).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll",
|
|
1028
|
+
const E = ++S;
|
|
1029
|
+
u = c, n || (n = vt(c), r = s(), o = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
|
|
1030
|
+
r = s();
|
|
1031
|
+
}).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll", y, {
|
|
953
1032
|
passive: !0
|
|
954
|
-
})),
|
|
1033
|
+
})), v = g, p(g);
|
|
955
1034
|
let b = 0;
|
|
956
|
-
const
|
|
957
|
-
|
|
1035
|
+
const R = () => {
|
|
1036
|
+
E === S && (b++, b >= Mt ? A = !1 : requestAnimationFrame(R));
|
|
958
1037
|
};
|
|
959
|
-
requestAnimationFrame(
|
|
1038
|
+
requestAnimationFrame(R);
|
|
960
1039
|
},
|
|
961
|
-
calculateScrollOffset: (c,
|
|
962
|
-
const
|
|
1040
|
+
calculateScrollOffset: (c, g) => {
|
|
1041
|
+
const E = c && h.has(c) ? h.get(c) : { x: 0, y: 0 }, b = g && l(g) && h.has(g) ? h.get(g) : { x: 0, y: 0 };
|
|
963
1042
|
return {
|
|
964
|
-
x: -b.x +
|
|
965
|
-
y: -b.y +
|
|
1043
|
+
x: -b.x + E.x,
|
|
1044
|
+
y: -b.y + E.y
|
|
966
1045
|
};
|
|
967
1046
|
},
|
|
968
1047
|
evictScrollPosition: (c) => {
|
|
969
|
-
|
|
1048
|
+
h.delete(c);
|
|
970
1049
|
},
|
|
971
|
-
shouldPreserve:
|
|
1050
|
+
shouldPreserve: l,
|
|
972
1051
|
getScrollContainer: () => n,
|
|
973
|
-
getPositionedParentElement: () =>
|
|
974
|
-
getScrollPosition: (c) => c &&
|
|
1052
|
+
getPositionedParentElement: () => u ? St(u) : document.body,
|
|
1053
|
+
getScrollPosition: (c) => c && h.has(c) ? h.get(c) : { x: 0, y: 0 }
|
|
975
1054
|
};
|
|
976
1055
|
}
|
|
977
|
-
const
|
|
978
|
-
function
|
|
1056
|
+
const j = 30, B = 8, Y = 1.2, G = 30, xt = 600;
|
|
1057
|
+
function Ft() {
|
|
979
1058
|
let e = null, i = !1, t = !1, n = null, r = null, o = !1;
|
|
980
|
-
const
|
|
981
|
-
for (let
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
1059
|
+
const s = (w, f) => {
|
|
1060
|
+
for (let a = 0; a < w.length; a++) {
|
|
1061
|
+
const C = w.item(a);
|
|
1062
|
+
if (C && C.identifier === f) return C;
|
|
984
1063
|
}
|
|
985
1064
|
return null;
|
|
986
|
-
},
|
|
1065
|
+
}, m = () => {
|
|
987
1066
|
n !== null && (clearTimeout(n), n = null);
|
|
988
|
-
},
|
|
1067
|
+
}, l = () => {
|
|
989
1068
|
r !== null && (clearTimeout(r), r = null);
|
|
990
|
-
},
|
|
991
|
-
i = !0, t = !0,
|
|
1069
|
+
}, u = () => {
|
|
1070
|
+
i = !0, t = !0, m(), l(), n = setTimeout(() => {
|
|
992
1071
|
i = !1, t = !1, n = null;
|
|
993
|
-
},
|
|
994
|
-
},
|
|
995
|
-
if (
|
|
1072
|
+
}, xt);
|
|
1073
|
+
}, h = (w) => {
|
|
1074
|
+
if (w.touches.length !== 1) {
|
|
996
1075
|
e = null;
|
|
997
1076
|
return;
|
|
998
1077
|
}
|
|
999
|
-
const
|
|
1000
|
-
if (!
|
|
1078
|
+
const f = w.touches.item(0);
|
|
1079
|
+
if (!f) {
|
|
1001
1080
|
e = null;
|
|
1002
1081
|
return;
|
|
1003
1082
|
}
|
|
1004
|
-
const
|
|
1005
|
-
if (!
|
|
1083
|
+
const a = window.innerWidth, C = f.clientX <= j, c = f.clientX >= a - j;
|
|
1084
|
+
if (!C && !c) {
|
|
1006
1085
|
e = null;
|
|
1007
1086
|
return;
|
|
1008
1087
|
}
|
|
1009
1088
|
e = {
|
|
1010
|
-
identifier:
|
|
1011
|
-
startX:
|
|
1012
|
-
startY:
|
|
1013
|
-
fromLeftEdge:
|
|
1089
|
+
identifier: f.identifier,
|
|
1090
|
+
startX: f.clientX,
|
|
1091
|
+
startY: f.clientY,
|
|
1092
|
+
fromLeftEdge: C,
|
|
1014
1093
|
moved: !1
|
|
1015
1094
|
};
|
|
1016
|
-
},
|
|
1095
|
+
}, v = (w) => {
|
|
1017
1096
|
if (!e) return;
|
|
1018
|
-
if (
|
|
1097
|
+
if (w.touches.length !== 1) {
|
|
1019
1098
|
e = null;
|
|
1020
1099
|
return;
|
|
1021
1100
|
}
|
|
1022
|
-
const
|
|
1023
|
-
if (!
|
|
1101
|
+
const f = s(w.touches, e.identifier);
|
|
1102
|
+
if (!f) {
|
|
1024
1103
|
e = null;
|
|
1025
1104
|
return;
|
|
1026
1105
|
}
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1106
|
+
const a = f.clientX - e.startX, C = f.clientY - e.startY, c = Math.abs(a), g = Math.abs(C);
|
|
1107
|
+
if (g > B && g > c * Y) {
|
|
1029
1108
|
e = null;
|
|
1030
1109
|
return;
|
|
1031
1110
|
}
|
|
1032
|
-
const
|
|
1033
|
-
c >
|
|
1034
|
-
}, A = (
|
|
1111
|
+
const E = e.fromLeftEdge ? a > 0 : a < 0;
|
|
1112
|
+
c > B && c > g * Y && E && (e.moved = !0);
|
|
1113
|
+
}, A = (w) => {
|
|
1035
1114
|
if (!e) return;
|
|
1036
|
-
const
|
|
1037
|
-
if (!
|
|
1115
|
+
const f = s(w.changedTouches, e.identifier);
|
|
1116
|
+
if (!f) {
|
|
1038
1117
|
e = null;
|
|
1039
1118
|
return;
|
|
1040
1119
|
}
|
|
1041
|
-
const
|
|
1042
|
-
e.moved &&
|
|
1043
|
-
|
|
1044
|
-
|
|
1120
|
+
const a = f.clientX - e.startX, C = e.fromLeftEdge ? a > 0 : a < 0;
|
|
1121
|
+
if (e.moved && C && Math.abs(a) >= G) {
|
|
1122
|
+
u(), e = null;
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
e.moved && Math.abs(a) >= G && u(), e = null;
|
|
1126
|
+
}, S = () => {
|
|
1127
|
+
e && (e.moved && u(), e = null);
|
|
1045
1128
|
};
|
|
1046
1129
|
return { initialize: () => {
|
|
1047
1130
|
if (typeof window > "u" || o) return;
|
|
1048
1131
|
o = !0;
|
|
1049
|
-
const
|
|
1050
|
-
window.addEventListener("touchstart",
|
|
1132
|
+
const w = { passive: !0, capture: !0 };
|
|
1133
|
+
window.addEventListener("touchstart", h, w), window.addEventListener("touchmove", v, w), window.addEventListener("touchend", A, w), window.addEventListener("touchcancel", S, w);
|
|
1051
1134
|
}, destroy: () => {
|
|
1052
1135
|
if (typeof window > "u" || !o) return;
|
|
1053
1136
|
o = !1;
|
|
1054
|
-
const
|
|
1055
|
-
window.removeEventListener("touchstart",
|
|
1137
|
+
const w = { capture: !0 };
|
|
1138
|
+
window.removeEventListener("touchstart", h, w), window.removeEventListener("touchmove", v, w), window.removeEventListener("touchend", A, w), window.removeEventListener("touchcancel", S, w), m(), l(), e = null, i = !1, t = !1;
|
|
1056
1139
|
}, isSwipeBack: () => {
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1140
|
+
const w = i || t;
|
|
1141
|
+
return w && m(), w;
|
|
1059
1142
|
}, onPageEnter: () => {
|
|
1060
|
-
i = !1,
|
|
1143
|
+
i = !1, m(), l(), r = setTimeout(() => {
|
|
1061
1144
|
t = !1, r = null;
|
|
1062
1145
|
}, 0);
|
|
1063
1146
|
} };
|
|
1064
1147
|
}
|
|
1065
|
-
function
|
|
1148
|
+
function Lt() {
|
|
1066
1149
|
let e = null;
|
|
1067
1150
|
function i() {
|
|
1068
1151
|
if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
|
|
@@ -1108,100 +1191,101 @@ function Ot() {
|
|
|
1108
1191
|
}
|
|
1109
1192
|
};
|
|
1110
1193
|
}
|
|
1111
|
-
function
|
|
1194
|
+
function jt(e, i) {
|
|
1112
1195
|
const {
|
|
1113
1196
|
transitions: t = [],
|
|
1114
1197
|
defaultTransition: n,
|
|
1115
|
-
middleware: r = (
|
|
1198
|
+
middleware: r = (f, a) => ({ from: f, to: a }),
|
|
1116
1199
|
// Identity function as default
|
|
1117
|
-
preserveScroll: o = (
|
|
1118
|
-
} = e, { outFirst:
|
|
1119
|
-
|
|
1200
|
+
preserveScroll: o = (f) => f
|
|
1201
|
+
} = e, { outFirst: s = !0 } = i || {}, m = s ? Lt() : Ot(), l = kt(t), u = Ft();
|
|
1202
|
+
u.initialize();
|
|
1120
1203
|
const {
|
|
1121
|
-
initializeContext:
|
|
1122
|
-
calculateScrollOffset:
|
|
1204
|
+
initializeContext: h,
|
|
1205
|
+
calculateScrollOffset: v,
|
|
1123
1206
|
evictScrollPosition: A,
|
|
1124
|
-
shouldPreserve:
|
|
1125
|
-
getScrollContainer:
|
|
1126
|
-
getPositionedParentElement:
|
|
1127
|
-
getScrollPosition:
|
|
1128
|
-
} =
|
|
1207
|
+
shouldPreserve: S,
|
|
1208
|
+
getScrollContainer: y,
|
|
1209
|
+
getPositionedParentElement: p,
|
|
1210
|
+
getScrollPosition: k
|
|
1211
|
+
} = Vt({
|
|
1129
1212
|
preserveScroll: o
|
|
1130
|
-
}),
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
const c = await
|
|
1134
|
-
if (
|
|
1135
|
-
if (
|
|
1136
|
-
return
|
|
1137
|
-
const { from:
|
|
1213
|
+
}), T = async (f, a) => {
|
|
1214
|
+
const C = u.isSwipeBack();
|
|
1215
|
+
m.trigger(f, a);
|
|
1216
|
+
const c = await m.get(a);
|
|
1217
|
+
if (a === "in" && u.onPageEnter(), !c) return () => ({});
|
|
1218
|
+
if (C)
|
|
1219
|
+
return a === "out" && c.from && !S(c.from) && A(c.from), () => ({});
|
|
1220
|
+
const { from: g, to: E } = r(
|
|
1138
1221
|
c.from,
|
|
1139
1222
|
c.to
|
|
1140
|
-
),
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1223
|
+
), R = Rt(
|
|
1224
|
+
g,
|
|
1225
|
+
E,
|
|
1226
|
+
l
|
|
1144
1227
|
) || n;
|
|
1145
|
-
if (!
|
|
1146
|
-
const M =
|
|
1147
|
-
if (
|
|
1228
|
+
if (!R) return () => ({});
|
|
1229
|
+
const M = v(c.from, c.to);
|
|
1230
|
+
if (a === "out") {
|
|
1148
1231
|
const x = {
|
|
1149
1232
|
scrollOffset: M,
|
|
1150
|
-
scroll:
|
|
1233
|
+
scroll: k(c.from),
|
|
1151
1234
|
get scrollingElement() {
|
|
1152
|
-
return
|
|
1235
|
+
return y() || document.documentElement;
|
|
1153
1236
|
},
|
|
1154
1237
|
get positionedParent() {
|
|
1155
|
-
return
|
|
1238
|
+
return p();
|
|
1156
1239
|
}
|
|
1157
1240
|
};
|
|
1158
|
-
return c.from && !
|
|
1241
|
+
return c.from && !S(c.from) && A(c.from), (_) => R.out(_, x);
|
|
1159
1242
|
} else {
|
|
1160
1243
|
const x = {
|
|
1161
1244
|
scrollOffset: M,
|
|
1162
1245
|
get scroll() {
|
|
1163
|
-
return
|
|
1246
|
+
return k(c.to);
|
|
1164
1247
|
},
|
|
1165
1248
|
get scrollingElement() {
|
|
1166
|
-
return
|
|
1249
|
+
return y() || document.documentElement;
|
|
1167
1250
|
},
|
|
1168
1251
|
get positionedParent() {
|
|
1169
|
-
return
|
|
1252
|
+
return p();
|
|
1170
1253
|
}
|
|
1171
1254
|
};
|
|
1172
|
-
return (_) =>
|
|
1255
|
+
return (_) => R.in(_, x);
|
|
1173
1256
|
}
|
|
1174
1257
|
};
|
|
1175
|
-
return (
|
|
1176
|
-
key:
|
|
1177
|
-
in: async (
|
|
1178
|
-
out: async (
|
|
1258
|
+
return (f) => ({
|
|
1259
|
+
key: f,
|
|
1260
|
+
in: async (a) => (h(a, f), (await T(f, "in"))(a)),
|
|
1261
|
+
out: async (a) => (await T(f, "out"))(a),
|
|
1179
1262
|
// Add page transition strategy for page-level transitions
|
|
1180
|
-
[
|
|
1263
|
+
[J]: yt
|
|
1181
1264
|
});
|
|
1182
1265
|
}
|
|
1183
1266
|
export {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1267
|
+
Q as SCOPE_ATTR,
|
|
1268
|
+
tt as SCOPE_READY_ATTR,
|
|
1269
|
+
J as TRANSITION_STRATEGY,
|
|
1187
1270
|
Ot as createAnyOrderDetector,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1271
|
+
gt as createDefaultStrategy,
|
|
1272
|
+
Lt as createOutFirstDetector,
|
|
1273
|
+
yt as createPageTransitionStrategy,
|
|
1274
|
+
jt as createSggoiTransitionContext,
|
|
1275
|
+
Nt as createTransitionScope,
|
|
1276
|
+
pt as findScope,
|
|
1277
|
+
Wt as getWatchedCount,
|
|
1278
|
+
Gt as isCssAnimation,
|
|
1279
|
+
$t as isKeyframesAnimation,
|
|
1280
|
+
Zt as isMultiAnimation,
|
|
1281
|
+
wt as isScopeReady,
|
|
1282
|
+
Jt as isSingleAnimation,
|
|
1283
|
+
Qt as isTickAnimation,
|
|
1284
|
+
Xt as isWatched,
|
|
1201
1285
|
W as normalizeSchedule,
|
|
1202
1286
|
F as normalizeToMultiAnimation,
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1287
|
+
Kt as resetObserver,
|
|
1288
|
+
Ut as transition,
|
|
1289
|
+
Ht as triggerUnmount,
|
|
1206
1290
|
Et as watchUnmount
|
|
1207
1291
|
};
|