@wix/interact 2.0.1 → 2.0.3
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/README.md +14 -14
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +2 -2
- package/dist/cjs/react.js.map +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/cjs/web.js.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/es/web.js.map +1 -1
- package/dist/{index-BnI6W-7u.mjs → index-BfcN_rkn.mjs} +864 -838
- package/dist/index-BfcN_rkn.mjs.map +1 -0
- package/dist/index-HXLBEIjG.js +18 -0
- package/dist/index-HXLBEIjG.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/handlers/constants.d.ts +13 -0
- package/dist/types/handlers/constants.d.ts.map +1 -0
- package/dist/types/handlers/effectHandlers.d.ts +6 -0
- package/dist/types/handlers/effectHandlers.d.ts.map +1 -0
- package/dist/types/handlers/eventTrigger.d.ts +9 -0
- package/dist/types/handlers/eventTrigger.d.ts.map +1 -0
- package/dist/types/handlers/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +10 -0
- package/dist/types/types.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/package.json +3 -3
- package/dist/index-BnI6W-7u.mjs.map +0 -1
- package/dist/index-emAFXYqb.js +0 -18
- package/dist/index-emAFXYqb.js.map +0 -1
- package/dist/types/handlers/click.d.ts +0 -9
- package/dist/types/handlers/click.d.ts.map +0 -1
- package/dist/types/handlers/hover.d.ts +0 -9
- package/dist/types/handlers/hover.d.ts.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Be(e) {
|
|
2
2
|
return [...e.matchAll(/\[([-\w]+)]/g)].map(([t, n]) => n);
|
|
3
3
|
}
|
|
4
4
|
function R(e, t) {
|
|
5
|
-
const n =
|
|
5
|
+
const n = Be(t);
|
|
6
6
|
let s = 0;
|
|
7
7
|
return n.length ? e.replace(/\[]/g, () => {
|
|
8
8
|
const r = n[s++];
|
|
9
9
|
return r !== void 0 ? `[${r}]` : "[]";
|
|
10
10
|
}) : e;
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class ue {
|
|
13
13
|
animations;
|
|
14
14
|
options;
|
|
15
15
|
ready;
|
|
@@ -73,33 +73,33 @@ class le {
|
|
|
73
73
|
return this.animations[0]?.playState;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
const Qe = (e) => e,
|
|
76
|
+
const Qe = (e) => e, Xe = (e) => 1 - Math.cos(e * Math.PI / 2), Ue = (e) => Math.sin(e * Math.PI / 2), Je = (e) => -(Math.cos(Math.PI * e) - 1) / 2, Ze = (e) => e ** 2, et = (e) => 1 - (1 - e) ** 2, tt = (e) => e < 0.5 ? 2 * e ** 2 : 1 - (-2 * e + 2) ** 2 / 2, nt = (e) => e ** 3, st = (e) => 1 - (1 - e) ** 3, it = (e) => e < 0.5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2, rt = (e) => e ** 4, ot = (e) => 1 - (1 - e) ** 4, ct = (e) => e < 0.5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, at = (e) => e ** 5, ft = (e) => 1 - (1 - e) ** 5, lt = (e) => e < 0.5 ? 16 * e ** 5 : 1 - (-2 * e + 2) ** 5 / 2, ut = (e) => e === 0 ? 0 : 2 ** (10 * e - 10), dt = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), ht = (e) => e === 0 ? 0 : e === 1 ? 1 : e < 0.5 ? 2 ** (20 * e - 10) / 2 : (2 - 2 ** (-20 * e + 10)) / 2, mt = (e) => 1 - Math.sqrt(1 - e ** 2), gt = (e) => Math.sqrt(1 - (e - 1) ** 2), vt = (e) => e < 0.5 ? (1 - Math.sqrt(1 - 4 * e ** 2)) / 2 : (Math.sqrt(-(2 * e - 3) * (2 * e - 1)) + 1) / 2, pt = (e) => 2.70158 * e ** 3 - 1.70158 * e ** 2, yt = (e) => 1 + 2.70158 * (e - 1) ** 3 + 1.70158 * (e - 1) ** 2, Et = (e, t = 1.70158 * 1.525) => e < 0.5 ? (2 * e) ** 2 * ((t + 1) * 2 * e - t) / 2 : ((2 * e - 2) ** 2 * ((t + 1) * (e * 2 - 2) + t) + 2) / 2, wt = {
|
|
77
77
|
linear: Qe,
|
|
78
|
-
sineIn:
|
|
79
|
-
sineOut:
|
|
80
|
-
sineInOut:
|
|
81
|
-
quadIn:
|
|
82
|
-
quadOut:
|
|
83
|
-
quadInOut:
|
|
84
|
-
cubicIn:
|
|
85
|
-
cubicOut:
|
|
86
|
-
cubicInOut:
|
|
87
|
-
quartIn:
|
|
88
|
-
quartOut:
|
|
89
|
-
quartInOut:
|
|
78
|
+
sineIn: Xe,
|
|
79
|
+
sineOut: Ue,
|
|
80
|
+
sineInOut: Je,
|
|
81
|
+
quadIn: Ze,
|
|
82
|
+
quadOut: et,
|
|
83
|
+
quadInOut: tt,
|
|
84
|
+
cubicIn: nt,
|
|
85
|
+
cubicOut: st,
|
|
86
|
+
cubicInOut: it,
|
|
87
|
+
quartIn: rt,
|
|
88
|
+
quartOut: ot,
|
|
89
|
+
quartInOut: ct,
|
|
90
90
|
quintIn: at,
|
|
91
|
-
quintOut:
|
|
92
|
-
quintInOut:
|
|
93
|
-
expoIn:
|
|
94
|
-
expoOut:
|
|
95
|
-
expoInOut:
|
|
96
|
-
circIn:
|
|
97
|
-
circOut:
|
|
98
|
-
circInOut:
|
|
99
|
-
backIn:
|
|
100
|
-
backOut:
|
|
101
|
-
backInOut:
|
|
102
|
-
},
|
|
91
|
+
quintOut: ft,
|
|
92
|
+
quintInOut: lt,
|
|
93
|
+
expoIn: ut,
|
|
94
|
+
expoOut: dt,
|
|
95
|
+
expoInOut: ht,
|
|
96
|
+
circIn: mt,
|
|
97
|
+
circOut: gt,
|
|
98
|
+
circInOut: vt,
|
|
99
|
+
backIn: pt,
|
|
100
|
+
backOut: yt,
|
|
101
|
+
backInOut: Et
|
|
102
|
+
}, ve = {
|
|
103
103
|
linear: "linear",
|
|
104
104
|
ease: "ease",
|
|
105
105
|
easeIn: "ease-in",
|
|
@@ -130,16 +130,16 @@ const Qe = (e) => e, Be = (e) => 1 - Math.cos(e * Math.PI / 2), Xe = (e) => Math
|
|
|
130
130
|
backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
131
131
|
backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
132
132
|
};
|
|
133
|
-
function
|
|
133
|
+
function bt(e) {
|
|
134
134
|
return e === "percentage" ? "%" : e || "px";
|
|
135
135
|
}
|
|
136
136
|
function D(e) {
|
|
137
|
-
return e ?
|
|
137
|
+
return e ? ve[e] || e : ve.linear;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function St(e) {
|
|
140
140
|
return e ? wt[e] : void 0;
|
|
141
141
|
}
|
|
142
|
-
class
|
|
142
|
+
class Tt {
|
|
143
143
|
_animation;
|
|
144
144
|
customEffect;
|
|
145
145
|
progress;
|
|
@@ -150,8 +150,8 @@ class St {
|
|
|
150
150
|
...s,
|
|
151
151
|
composite: "add"
|
|
152
152
|
}), { timeline: o } = r;
|
|
153
|
-
this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (
|
|
154
|
-
this.effect.target?.getAnimations().find((
|
|
153
|
+
this._animation = new Animation(i, o), this._tickCbId = null, this.progress = null, this.customEffect = (c) => t(i.target, c), this._finishHandler = (c) => {
|
|
154
|
+
this.effect.target?.getAnimations().find((u) => u === this._animation) || this.cancel();
|
|
155
155
|
}, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
|
|
156
156
|
}
|
|
157
157
|
// private tick method for customEffect loop implementation
|
|
@@ -282,17 +282,17 @@ class St {
|
|
|
282
282
|
function It(e) {
|
|
283
283
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
284
284
|
}
|
|
285
|
-
var
|
|
285
|
+
var W = { exports: {} }, pe = W.exports, ye;
|
|
286
286
|
function Ot() {
|
|
287
|
-
return
|
|
287
|
+
return ye || (ye = 1, (function(e) {
|
|
288
288
|
(function(t) {
|
|
289
289
|
var n = function() {
|
|
290
|
-
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(
|
|
291
|
-
return setTimeout(
|
|
290
|
+
}, s = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.msRequestAnimationFrame || function(a) {
|
|
291
|
+
return setTimeout(a, 16);
|
|
292
292
|
};
|
|
293
293
|
function r() {
|
|
294
|
-
var
|
|
295
|
-
|
|
294
|
+
var a = this;
|
|
295
|
+
a.reads = [], a.writes = [], a.raf = s.bind(t);
|
|
296
296
|
}
|
|
297
297
|
r.prototype = {
|
|
298
298
|
constructor: r,
|
|
@@ -304,8 +304,8 @@ function Ot() {
|
|
|
304
304
|
*
|
|
305
305
|
* @param {Array} tasks
|
|
306
306
|
*/
|
|
307
|
-
runTasks: function(
|
|
308
|
-
for (var
|
|
307
|
+
runTasks: function(a) {
|
|
308
|
+
for (var f; f = a.shift(); ) f();
|
|
309
309
|
},
|
|
310
310
|
/**
|
|
311
311
|
* Adds a job to the read batch and
|
|
@@ -315,8 +315,8 @@ function Ot() {
|
|
|
315
315
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
316
316
|
* @public
|
|
317
317
|
*/
|
|
318
|
-
measure: function(
|
|
319
|
-
var d =
|
|
318
|
+
measure: function(a, f) {
|
|
319
|
+
var d = f ? a.bind(f) : a;
|
|
320
320
|
return this.reads.push(d), i(this), d;
|
|
321
321
|
},
|
|
322
322
|
/**
|
|
@@ -328,8 +328,8 @@ function Ot() {
|
|
|
328
328
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
329
329
|
* @public
|
|
330
330
|
*/
|
|
331
|
-
mutate: function(
|
|
332
|
-
var d =
|
|
331
|
+
mutate: function(a, f) {
|
|
332
|
+
var d = f ? a.bind(f) : a;
|
|
333
333
|
return this.writes.push(d), i(this), d;
|
|
334
334
|
},
|
|
335
335
|
/**
|
|
@@ -339,8 +339,8 @@ function Ot() {
|
|
|
339
339
|
* @return {Boolean} success
|
|
340
340
|
* @public
|
|
341
341
|
*/
|
|
342
|
-
clear: function(
|
|
343
|
-
return
|
|
342
|
+
clear: function(a) {
|
|
343
|
+
return c(this.reads, a) || c(this.writes, a);
|
|
344
344
|
},
|
|
345
345
|
/**
|
|
346
346
|
* Extend this FastDom with some
|
|
@@ -376,85 +376,85 @@ function Ot() {
|
|
|
376
376
|
* @param {Object} props properties to mixin
|
|
377
377
|
* @return {FastDom}
|
|
378
378
|
*/
|
|
379
|
-
extend: function(
|
|
380
|
-
if (typeof
|
|
381
|
-
var
|
|
382
|
-
return f
|
|
379
|
+
extend: function(a) {
|
|
380
|
+
if (typeof a != "object") throw new Error("expected object");
|
|
381
|
+
var f = Object.create(this);
|
|
382
|
+
return u(f, a), f.fastdom = this, f.initialize && f.initialize(), f;
|
|
383
383
|
},
|
|
384
384
|
// override this with a function
|
|
385
385
|
// to prevent Errors in console
|
|
386
386
|
// when tasks throw
|
|
387
387
|
catch: null
|
|
388
388
|
};
|
|
389
|
-
function i(
|
|
390
|
-
|
|
389
|
+
function i(a) {
|
|
390
|
+
a.scheduled || (a.scheduled = !0, a.raf(o.bind(null, a)));
|
|
391
391
|
}
|
|
392
|
-
function o(
|
|
393
|
-
var
|
|
392
|
+
function o(a) {
|
|
393
|
+
var f = a.writes, d = a.reads, v;
|
|
394
394
|
try {
|
|
395
|
-
n("flushing reads", d.length),
|
|
396
|
-
} catch (
|
|
397
|
-
|
|
395
|
+
n("flushing reads", d.length), a.runTasks(d), n("flushing writes", f.length), a.runTasks(f);
|
|
396
|
+
} catch (m) {
|
|
397
|
+
v = m;
|
|
398
398
|
}
|
|
399
|
-
if (
|
|
400
|
-
if (n("task errored",
|
|
401
|
-
else throw
|
|
399
|
+
if (a.scheduled = !1, (d.length || f.length) && i(a), v)
|
|
400
|
+
if (n("task errored", v.message), a.catch) a.catch(v);
|
|
401
|
+
else throw v;
|
|
402
402
|
}
|
|
403
|
-
function a
|
|
404
|
-
var d =
|
|
405
|
-
return !!~d && !!
|
|
403
|
+
function c(a, f) {
|
|
404
|
+
var d = a.indexOf(f);
|
|
405
|
+
return !!~d && !!a.splice(d, 1);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
for (var d in
|
|
409
|
-
|
|
407
|
+
function u(a, f) {
|
|
408
|
+
for (var d in f)
|
|
409
|
+
f.hasOwnProperty(d) && (a[d] = f[d]);
|
|
410
410
|
}
|
|
411
411
|
var l = t.fastdom = t.fastdom || new r();
|
|
412
412
|
e.exports = l;
|
|
413
413
|
})(typeof window < "u" ? window : typeof pe < "u" ? pe : globalThis);
|
|
414
|
-
})(
|
|
414
|
+
})(W)), W.exports;
|
|
415
415
|
}
|
|
416
416
|
var _t = Ot();
|
|
417
|
-
const S = /* @__PURE__ */ It(_t),
|
|
417
|
+
const S = /* @__PURE__ */ It(_t), re = {};
|
|
418
418
|
function kt(e) {
|
|
419
|
-
Object.assign(
|
|
419
|
+
Object.assign(re, e);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
return e in
|
|
421
|
+
function Ct(e) {
|
|
422
|
+
return e in re ? re[e] : (console.warn(
|
|
423
423
|
`${e} not found in registry. Please make sure to import and register the preset.`
|
|
424
424
|
), null);
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function k(e, t) {
|
|
427
427
|
return e ? document.getElementById(e) : null;
|
|
428
428
|
}
|
|
429
429
|
function xt(e, t) {
|
|
430
430
|
return e?.matches(`[data-motion-part~="${t}"]`) ? e : e?.querySelector(`[data-motion-part~="${t}"]`);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function At(e) {
|
|
433
433
|
const t = e.alternate ? "alternate" : "";
|
|
434
434
|
return e.reversed ? `${t ? `${t}-` : ""}reverse` : t || "normal";
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return `${e.value}${
|
|
436
|
+
function ne(e) {
|
|
437
|
+
return `${e.value}${bt(e.unit)}`;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${
|
|
439
|
+
function Ee(e, t, n) {
|
|
440
|
+
return `${e.name || "cover"} ${n && e.offset.unit !== "percentage" ? `calc(100% + ${ne(e.offset)}${t ? ` + ${t}` : ""})` : t ? `calc(${ne(e.offset)} + ${t})` : ne(e.offset)}`;
|
|
441
441
|
}
|
|
442
442
|
function Lt(e) {
|
|
443
443
|
return {
|
|
444
|
-
start:
|
|
445
|
-
end:
|
|
444
|
+
start: Ee(e.startOffset, e.startOffsetAdd),
|
|
445
|
+
end: Ee(e.endOffset, e.endOffsetAdd, !0)
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Re(e) {
|
|
449
449
|
return (t) => S.measure(() => t(e));
|
|
450
450
|
}
|
|
451
451
|
function $e(e) {
|
|
452
452
|
return (t) => S.mutate(() => t(e));
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function B(e) {
|
|
455
455
|
if (e.namedEffect) {
|
|
456
456
|
const t = e.namedEffect.type;
|
|
457
|
-
return typeof t == "string" ?
|
|
457
|
+
return typeof t == "string" ? Ct(t) : null;
|
|
458
458
|
} else if (e.keyframeEffect) {
|
|
459
459
|
const t = (s) => {
|
|
460
460
|
const { name: r, keyframes: i } = s.keyframeEffect;
|
|
@@ -468,16 +468,16 @@ function K(e) {
|
|
|
468
468
|
return (t) => [{ ...t, keyframes: [] }];
|
|
469
469
|
return null;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Pt(e, t, n) {
|
|
472
472
|
return e.map((s, r) => {
|
|
473
473
|
const i = {
|
|
474
474
|
fill: s.fill,
|
|
475
475
|
easing: D(s.easing),
|
|
476
476
|
iterations: s.iterations === 0 ? 1 / 0 : s.iterations || 1,
|
|
477
477
|
composite: s.composite,
|
|
478
|
-
direction:
|
|
478
|
+
direction: At(s)
|
|
479
479
|
};
|
|
480
|
-
return
|
|
480
|
+
return Fe(t) ? (i.duration = s.duration, i.delay = s.delay || 0) : window.ViewTimeline && t?.trigger === "view-progress" ? i.duration = "auto" : (i.duration = 99.99, i.delay = 0.01), {
|
|
481
481
|
effect: s,
|
|
482
482
|
options: i,
|
|
483
483
|
id: n && `${n}-${r + 1}`,
|
|
@@ -485,212 +485,212 @@ function At(e, t, n) {
|
|
|
485
485
|
};
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Fe(e) {
|
|
489
489
|
return !e || e.trigger !== "pointer-move" && e.trigger !== "view-progress";
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function we(e, t, n, s, r) {
|
|
492
492
|
if (e) {
|
|
493
|
-
if (
|
|
493
|
+
if (Fe(s) && (t.duration = t.duration || 1, r?.reducedMotion))
|
|
494
494
|
if (t.iterations === 1 || t.iterations == null)
|
|
495
495
|
t = { ...t, duration: 1 };
|
|
496
496
|
else
|
|
497
497
|
return [];
|
|
498
498
|
let i;
|
|
499
|
-
return n instanceof HTMLElement && (i = { measure:
|
|
499
|
+
return n instanceof HTMLElement && (i = { measure: Re(n), mutate: $e(n) }), e.web ? e.web(t, i, r) : e(t, i, r);
|
|
500
500
|
}
|
|
501
501
|
return [];
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
const i = e instanceof HTMLElement ? e :
|
|
503
|
+
function de(e, t, n, s, r) {
|
|
504
|
+
const i = e instanceof HTMLElement ? e : k(e);
|
|
505
505
|
if (n?.trigger === "pointer-move" && !t.keyframeEffect) {
|
|
506
506
|
let d = t;
|
|
507
507
|
t.customEffect && (d = {
|
|
508
508
|
...t,
|
|
509
509
|
namedEffect: { id: "", type: "CustomMouse" }
|
|
510
510
|
});
|
|
511
|
-
const
|
|
511
|
+
const v = B(
|
|
512
512
|
d
|
|
513
|
-
),
|
|
514
|
-
|
|
513
|
+
), m = we(
|
|
514
|
+
v,
|
|
515
515
|
t,
|
|
516
516
|
i,
|
|
517
517
|
n,
|
|
518
518
|
s
|
|
519
519
|
);
|
|
520
|
-
return typeof
|
|
520
|
+
return typeof m != "function" ? null : m(i);
|
|
521
521
|
}
|
|
522
|
-
const o =
|
|
522
|
+
const o = B(t), c = we(
|
|
523
523
|
o,
|
|
524
524
|
t,
|
|
525
525
|
i,
|
|
526
526
|
n,
|
|
527
527
|
s
|
|
528
528
|
);
|
|
529
|
-
if (!
|
|
529
|
+
if (!c || c.length === 0)
|
|
530
530
|
return null;
|
|
531
|
-
const
|
|
531
|
+
const u = Pt(c, n, t.effectId);
|
|
532
532
|
let l;
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
subject: n.element ||
|
|
533
|
+
const a = n?.trigger === "view-progress";
|
|
534
|
+
a && window.ViewTimeline && (l = new ViewTimeline({
|
|
535
|
+
subject: n.element || k(n.componentId)
|
|
536
536
|
}));
|
|
537
|
-
const
|
|
538
|
-
const
|
|
537
|
+
const f = u.map(({ effect: d, options: v, id: m, part: h }) => {
|
|
538
|
+
const g = h ? xt(i, h) : i, y = new KeyframeEffect(g || null, [], v);
|
|
539
539
|
S.mutate(() => {
|
|
540
|
-
"timing" in d &&
|
|
540
|
+
"timing" in d && y.updateTiming(d.timing), y.setKeyframes(d.keyframes);
|
|
541
541
|
});
|
|
542
|
-
const
|
|
542
|
+
const p = a && l ? { timeline: l } : {}, w = typeof d.customEffect == "function" ? new Tt(
|
|
543
543
|
d.customEffect,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
) : new Animation(
|
|
548
|
-
if (
|
|
544
|
+
g || null,
|
|
545
|
+
v,
|
|
546
|
+
p
|
|
547
|
+
) : new Animation(y, p.timeline);
|
|
548
|
+
if (a)
|
|
549
549
|
if (l)
|
|
550
550
|
S.mutate(() => {
|
|
551
|
-
const { start: b, end:
|
|
552
|
-
|
|
551
|
+
const { start: b, end: T } = Lt(d);
|
|
552
|
+
w.rangeStart = b, w.rangeEnd = T, w.play();
|
|
553
553
|
});
|
|
554
554
|
else {
|
|
555
|
-
const { startOffset: b, endOffset:
|
|
555
|
+
const { startOffset: b, endOffset: T } = t;
|
|
556
556
|
S.mutate(() => {
|
|
557
|
-
const
|
|
558
|
-
Object.assign(
|
|
557
|
+
const C = d.startOffset || b, Z = d.endOffset || T;
|
|
558
|
+
Object.assign(w, {
|
|
559
559
|
start: {
|
|
560
|
-
name:
|
|
561
|
-
offset:
|
|
560
|
+
name: C.name,
|
|
561
|
+
offset: C.offset?.value,
|
|
562
562
|
add: d.startOffsetAdd
|
|
563
563
|
},
|
|
564
564
|
end: {
|
|
565
|
-
name:
|
|
566
|
-
offset:
|
|
565
|
+
name: Z.name,
|
|
566
|
+
offset: Z.offset?.value,
|
|
567
567
|
add: d.endOffsetAdd
|
|
568
568
|
}
|
|
569
569
|
});
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
-
return
|
|
572
|
+
return m && (w.id = m), w;
|
|
573
573
|
});
|
|
574
|
-
return new
|
|
574
|
+
return new ue(f, {
|
|
575
575
|
...t,
|
|
576
576
|
trigger: { ...n || {} },
|
|
577
577
|
// make sure the group is ready after all animation targets are measured and mutated
|
|
578
578
|
measured: new Promise((d) => S.mutate(d))
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
const s =
|
|
581
|
+
function Rt(e, t, n) {
|
|
582
|
+
const s = B(t), r = e instanceof HTMLElement ? e : k(e);
|
|
583
583
|
if (s && s.prepare && r) {
|
|
584
|
-
const i = { measure:
|
|
584
|
+
const i = { measure: Re(r), mutate: $e(r) };
|
|
585
585
|
s.prepare(t, i);
|
|
586
586
|
}
|
|
587
587
|
n && S.mutate(n);
|
|
588
588
|
}
|
|
589
589
|
function $t(e, t) {
|
|
590
|
-
const n =
|
|
590
|
+
const n = B(t);
|
|
591
591
|
if (!n)
|
|
592
592
|
return null;
|
|
593
593
|
if (!n.style)
|
|
594
|
-
return t.effectId && e ?
|
|
595
|
-
const s = n.getNames(t), i = (typeof e == "string" ?
|
|
596
|
-
return s.forEach((
|
|
597
|
-
o.includes(
|
|
598
|
-
i?.find((l) => l.animationName ===
|
|
594
|
+
return t.effectId && e ? Ft(e, t.effectId) : null;
|
|
595
|
+
const s = n.getNames(t), i = (typeof e == "string" ? k(e) : e)?.getAnimations(), o = i?.map((u) => u.animationName) || [], c = [];
|
|
596
|
+
return s.forEach((u) => {
|
|
597
|
+
o.includes(u) && c.push(
|
|
598
|
+
i?.find((l) => l.animationName === u)
|
|
599
599
|
);
|
|
600
|
-
}),
|
|
600
|
+
}), c?.length ? new ue(c) : null;
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
const s = (typeof e == "string" ?
|
|
602
|
+
function Ft(e, t) {
|
|
603
|
+
const s = (typeof e == "string" ? k(e) : e)?.getAnimations().filter((r) => {
|
|
604
604
|
const i = r.id || r.animationName;
|
|
605
605
|
return i ? i.startsWith(t) : !0;
|
|
606
606
|
});
|
|
607
|
-
return s?.length ? new
|
|
607
|
+
return s?.length ? new ue(s) : null;
|
|
608
608
|
}
|
|
609
609
|
function Me(e, t, n, s = {}) {
|
|
610
|
-
const { disabled: r, allowActiveEvent: i, ...o } = s,
|
|
611
|
-
if (!
|
|
610
|
+
const { disabled: r, allowActiveEvent: i, ...o } = s, c = de(e, t, n, o);
|
|
611
|
+
if (!c)
|
|
612
612
|
return null;
|
|
613
|
-
let
|
|
613
|
+
let u = {};
|
|
614
614
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
615
|
-
const l = n.element ||
|
|
616
|
-
return
|
|
615
|
+
const l = n.element || k(n.componentId), { ready: a } = c;
|
|
616
|
+
return c.animations.map((f) => ({
|
|
617
617
|
/* we use getters for start and end in order to access the animation's start and end
|
|
618
618
|
only when initializing the scrub scene rather than immediately */
|
|
619
619
|
get start() {
|
|
620
|
-
return
|
|
620
|
+
return f.start;
|
|
621
621
|
},
|
|
622
622
|
get end() {
|
|
623
|
-
return
|
|
623
|
+
return f.end;
|
|
624
624
|
},
|
|
625
625
|
viewSource: l,
|
|
626
|
-
ready:
|
|
626
|
+
ready: a,
|
|
627
627
|
getProgress() {
|
|
628
|
-
return
|
|
628
|
+
return c.getProgress();
|
|
629
629
|
},
|
|
630
|
-
effect(d,
|
|
631
|
-
const { activeDuration:
|
|
632
|
-
|
|
630
|
+
effect(d, v) {
|
|
631
|
+
const { activeDuration: m } = f.effect.getComputedTiming(), { delay: h } = f.effect.getTiming();
|
|
632
|
+
f.currentTime = ((h || 0) + (m || 0)) * v;
|
|
633
633
|
},
|
|
634
634
|
disabled: r,
|
|
635
635
|
destroy() {
|
|
636
|
-
|
|
636
|
+
f.cancel();
|
|
637
637
|
}
|
|
638
638
|
}));
|
|
639
639
|
} else if (n.trigger === "pointer-move") {
|
|
640
|
-
const l = t, { centeredToTarget:
|
|
640
|
+
const l = t, { centeredToTarget: a, transitionDuration: f, transitionEasing: d } = l, v = n.axis;
|
|
641
641
|
if (l.keyframeEffect) {
|
|
642
|
-
const
|
|
643
|
-
return
|
|
642
|
+
const m = c;
|
|
643
|
+
return m.animations?.length === 0 ? null : {
|
|
644
644
|
target: void 0,
|
|
645
|
-
centeredToTarget:
|
|
646
|
-
ready:
|
|
645
|
+
centeredToTarget: a,
|
|
646
|
+
ready: m.ready,
|
|
647
647
|
_currentProgress: 0,
|
|
648
648
|
getProgress() {
|
|
649
649
|
return this._currentProgress;
|
|
650
650
|
},
|
|
651
|
-
effect(
|
|
652
|
-
const
|
|
653
|
-
this._currentProgress =
|
|
651
|
+
effect(g, y) {
|
|
652
|
+
const p = v === "x" ? y.x : y.y;
|
|
653
|
+
this._currentProgress = p, m.progress(p);
|
|
654
654
|
},
|
|
655
655
|
disabled: r ?? !1,
|
|
656
656
|
destroy() {
|
|
657
|
-
|
|
657
|
+
m.cancel();
|
|
658
658
|
}
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
|
|
662
|
-
centeredToTarget:
|
|
661
|
+
u = {
|
|
662
|
+
centeredToTarget: a,
|
|
663
663
|
allowActiveEvent: i
|
|
664
|
-
}, t.customEffect &&
|
|
664
|
+
}, t.customEffect && f && (u.transitionDuration = f, u.transitionEasing = St(d)), u.target = c.target;
|
|
665
665
|
}
|
|
666
666
|
return {
|
|
667
|
-
...
|
|
667
|
+
...u,
|
|
668
668
|
getProgress() {
|
|
669
|
-
return
|
|
669
|
+
return c.getProgress();
|
|
670
670
|
},
|
|
671
|
-
effect(l,
|
|
672
|
-
|
|
673
|
-
|
|
671
|
+
effect(l, a, f, d) {
|
|
672
|
+
c.progress(
|
|
673
|
+
f ? {
|
|
674
674
|
// @ts-expect-error spread error on p
|
|
675
|
-
...
|
|
676
|
-
v:
|
|
675
|
+
...a,
|
|
676
|
+
v: f,
|
|
677
677
|
active: d
|
|
678
|
-
} :
|
|
678
|
+
} : a
|
|
679
679
|
);
|
|
680
680
|
},
|
|
681
681
|
disabled: r,
|
|
682
682
|
destroy() {
|
|
683
|
-
|
|
683
|
+
c.cancel();
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function he(e, t, n, s = !1) {
|
|
688
688
|
const r = $t(e, t);
|
|
689
689
|
return r ? (r.ready = new Promise((i) => {
|
|
690
|
-
|
|
691
|
-
}), r) :
|
|
690
|
+
Rt(e, t, i);
|
|
691
|
+
}), r) : de(e, t, n, { reducedMotion: s });
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function j(e, t) {
|
|
694
694
|
return t.includes("&") ? t.replace(/&/g, e) : `${e}${t}`;
|
|
695
695
|
}
|
|
696
696
|
function Mt() {
|
|
@@ -702,7 +702,7 @@ function Mt() {
|
|
|
702
702
|
// 97 for "a"
|
|
703
703
|
);
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function qt({
|
|
706
706
|
key: e,
|
|
707
707
|
effectId: t,
|
|
708
708
|
transition: n,
|
|
@@ -712,62 +712,62 @@ function Ft({
|
|
|
712
712
|
}) {
|
|
713
713
|
let o = [];
|
|
714
714
|
if (n?.styleProperties) {
|
|
715
|
-
const { duration:
|
|
716
|
-
|
|
717
|
-
(
|
|
715
|
+
const { duration: m, easing: h, delay: g } = n;
|
|
716
|
+
m && (n.styleProperties.some(
|
|
717
|
+
(p) => p.name.startsWith("--")
|
|
718
718
|
) ? o = [
|
|
719
|
-
`all ${
|
|
719
|
+
`all ${m}ms ${D(h || "ease")}${g ? ` ${g}ms` : ""}`,
|
|
720
720
|
"visibility 0s"
|
|
721
721
|
] : o = n.styleProperties.map(
|
|
722
|
-
(
|
|
723
|
-
|
|
724
|
-
)}${
|
|
722
|
+
(p) => `${p.name} ${m}ms ${D(
|
|
723
|
+
h || "ease"
|
|
724
|
+
)}${g ? ` ${g}ms` : ""}`
|
|
725
725
|
)), s = n.styleProperties;
|
|
726
726
|
} else
|
|
727
|
-
o = s?.filter((
|
|
728
|
-
(
|
|
727
|
+
o = s?.filter((m) => m.duration).map(
|
|
728
|
+
(m) => `${m.name} ${m.duration}ms ${D(m.easing) || "ease"}${m.delay ? ` ${m.delay}ms` : ""}`
|
|
729
729
|
) || [];
|
|
730
|
-
const
|
|
731
|
-
`${
|
|
730
|
+
const c = s?.map((m) => `${m.name}: ${m.value};`) || [], u = e.replace(/"/g, "'"), l = `:is(:state(${t}), :--${t}) ${r}`, a = `[data-interact-effect~="${t}"] ${r}`, f = i ? j(l, i) : l, d = i ? j(a, i) : a, v = [
|
|
731
|
+
`${f},
|
|
732
732
|
${d} {
|
|
733
|
-
${
|
|
733
|
+
${c.join(`
|
|
734
734
|
`)}
|
|
735
735
|
}`
|
|
736
736
|
];
|
|
737
737
|
if (o.length) {
|
|
738
|
-
const
|
|
739
|
-
|
|
738
|
+
const m = `[data-interact-key="${u}"] ${r}`, h = i ? j(m, i) : m;
|
|
739
|
+
v.push(`@media (prefers-reduced-motion: no-preference) { ${h} {
|
|
740
740
|
transition: ${o.join(", ")};
|
|
741
741
|
} }`);
|
|
742
742
|
}
|
|
743
|
-
return
|
|
743
|
+
return v;
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function $(e, t) {
|
|
746
746
|
const n = (e || []).filter((i) => t[i]?.type === "media" && t[i].predicate).map((i) => t[i].predicate).join(") and ("), s = n && `(${n})`;
|
|
747
747
|
return s && window.matchMedia(s);
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Q(e, t) {
|
|
750
750
|
for (const n of e || []) {
|
|
751
751
|
const s = t[n];
|
|
752
752
|
if (s?.type === "selector" && s.predicate)
|
|
753
753
|
return s.predicate;
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
const
|
|
756
|
+
const q = {
|
|
757
757
|
rangeStart: { name: "cover", offset: { value: 0, unit: "percentage" } },
|
|
758
758
|
rangeEnd: { name: "cover", offset: { value: 100, unit: "percentage" } }
|
|
759
759
|
};
|
|
760
760
|
function Ht(e, t) {
|
|
761
|
-
const n = e?.name ??
|
|
761
|
+
const n = e?.name ?? q.rangeStart.name, s = t?.name ?? e?.name ?? q.rangeEnd.name, r = {
|
|
762
762
|
name: n,
|
|
763
|
-
offset: e?.offset ||
|
|
763
|
+
offset: e?.offset || q.rangeStart.offset
|
|
764
764
|
}, i = {
|
|
765
765
|
name: s,
|
|
766
|
-
offset: t?.offset ||
|
|
766
|
+
offset: t?.offset || q.rangeEnd.offset
|
|
767
767
|
};
|
|
768
768
|
return { startOffset: r, endOffset: i };
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function F(e) {
|
|
771
771
|
if ("keyframeEffect" in e && !e.keyframeEffect.name && "effectId" in e && (e.keyframeEffect.name = e.effectId), "duration" in e)
|
|
772
772
|
return {
|
|
773
773
|
id: "",
|
|
@@ -781,121 +781,121 @@ function x(e) {
|
|
|
781
781
|
...s
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function I(e, t, n) {
|
|
785
785
|
let s = e.get(t);
|
|
786
786
|
s || (s = /* @__PURE__ */ new Set(), e.set(t, s)), s.add(n);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function M(e, t) {
|
|
789
789
|
e.get(t)?.forEach((s) => {
|
|
790
790
|
const { source: r, target: i, cleanup: o } = s;
|
|
791
791
|
o();
|
|
792
|
-
const
|
|
793
|
-
e.get(
|
|
792
|
+
const c = r === t ? i : r;
|
|
793
|
+
e.get(c)?.delete(s);
|
|
794
794
|
}), e.delete(t);
|
|
795
795
|
}
|
|
796
|
-
const
|
|
796
|
+
const zt = {
|
|
797
797
|
root: null,
|
|
798
798
|
rootMargin: "0px 0px -10% 0px",
|
|
799
799
|
threshold: [0]
|
|
800
|
-
},
|
|
800
|
+
}, Nt = {
|
|
801
801
|
root: null,
|
|
802
802
|
rootMargin: "0px",
|
|
803
803
|
threshold: [0]
|
|
804
|
-
},
|
|
805
|
-
let
|
|
806
|
-
function
|
|
807
|
-
|
|
804
|
+
}, L = {}, X = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), G = /* @__PURE__ */ new WeakMap();
|
|
805
|
+
let qe = {}, x = null;
|
|
806
|
+
function Vt(e) {
|
|
807
|
+
qe = e;
|
|
808
808
|
}
|
|
809
809
|
function He(e, t) {
|
|
810
|
-
|
|
810
|
+
X.get(e)?.forEach(({ source: s, handler: r }) => {
|
|
811
811
|
s === e && r(t);
|
|
812
812
|
});
|
|
813
813
|
}
|
|
814
|
-
function
|
|
815
|
-
return
|
|
814
|
+
function be() {
|
|
815
|
+
return x || (x = new IntersectionObserver((e) => {
|
|
816
816
|
e.forEach((t) => {
|
|
817
817
|
const n = t.target;
|
|
818
818
|
t.isIntersecting || He(n, !1);
|
|
819
819
|
});
|
|
820
|
-
},
|
|
820
|
+
}, Nt), x);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function ze(e, t = !1) {
|
|
823
823
|
const n = JSON.stringify({ ...e, isSafeMode: t });
|
|
824
|
-
if (
|
|
825
|
-
return
|
|
826
|
-
const s = t ?
|
|
824
|
+
if (L[n])
|
|
825
|
+
return L[n];
|
|
826
|
+
const s = t ? zt : {
|
|
827
827
|
root: null,
|
|
828
828
|
rootMargin: e.inset ? `${e.inset} 0px ${e.inset}` : "0px",
|
|
829
829
|
threshold: e.threshold
|
|
830
830
|
}, r = new IntersectionObserver((i) => {
|
|
831
831
|
i.forEach((o) => {
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
832
|
+
const c = o.target, u = !Y.has(c);
|
|
833
|
+
if (u && (Y.add(c), e.useSafeViewEnter && !o.isIntersecting)) {
|
|
834
834
|
S.measure(() => {
|
|
835
|
-
const
|
|
836
|
-
if (!
|
|
835
|
+
const a = o.boundingClientRect.height, f = o.rootBounds?.height;
|
|
836
|
+
if (!f)
|
|
837
837
|
return;
|
|
838
838
|
const d = Array.isArray(e.threshold) ? Math.min(...e.threshold) : e.threshold;
|
|
839
|
-
d &&
|
|
840
|
-
r.unobserve(
|
|
841
|
-
const
|
|
842
|
-
|
|
839
|
+
d && a * d > f && S.mutate(() => {
|
|
840
|
+
r.unobserve(c);
|
|
841
|
+
const m = ze(e, !0);
|
|
842
|
+
G.set(c, m), m.observe(c);
|
|
843
843
|
});
|
|
844
844
|
});
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
847
|
const l = e.type || "once";
|
|
848
|
-
(o.isIntersecting || l === "alternate" && !
|
|
848
|
+
(o.isIntersecting || l === "alternate" && !u) && (He(c, o.isIntersecting), l === "once" && (r.unobserve(o.target), Y.delete(c)));
|
|
849
849
|
});
|
|
850
850
|
}, s);
|
|
851
|
-
return
|
|
851
|
+
return L[n] = r, r;
|
|
852
852
|
}
|
|
853
|
-
function
|
|
854
|
-
const o = { ...
|
|
853
|
+
function Dt(e, t, n, s = {}, { reducedMotion: r, selectorCondition: i } = {}) {
|
|
854
|
+
const o = { ...qe, ...s }, c = o.type || "once", u = he(
|
|
855
855
|
t,
|
|
856
|
-
|
|
856
|
+
F(n),
|
|
857
857
|
void 0,
|
|
858
858
|
r
|
|
859
859
|
);
|
|
860
|
-
if (!
|
|
860
|
+
if (!u)
|
|
861
861
|
return;
|
|
862
|
-
const l =
|
|
863
|
-
|
|
864
|
-
let
|
|
865
|
-
const
|
|
866
|
-
i && !t.matches(i) || (
|
|
867
|
-
const
|
|
862
|
+
const l = ze(o);
|
|
863
|
+
c !== "once" && u.persist?.();
|
|
864
|
+
let a = !0;
|
|
865
|
+
const v = { source: e, target: t, handler: (m) => {
|
|
866
|
+
i && !t.matches(i) || (c === "once" ? m && u.play(() => {
|
|
867
|
+
const h = () => {
|
|
868
868
|
t.dataset.interactEnter = "start";
|
|
869
869
|
};
|
|
870
|
-
|
|
871
|
-
requestAnimationFrame(
|
|
872
|
-
}),
|
|
870
|
+
u.isCSS ? (S.mutate(() => {
|
|
871
|
+
requestAnimationFrame(h);
|
|
872
|
+
}), u.onFinish(() => {
|
|
873
873
|
S.mutate(() => {
|
|
874
874
|
t.dataset.interactEnter = "done";
|
|
875
875
|
});
|
|
876
|
-
})) : S.mutate(
|
|
877
|
-
}) :
|
|
876
|
+
})) : S.mutate(h);
|
|
877
|
+
}) : c === "alternate" ? a && m ? (a = !1, u.play()) : a || u.reverse() : c === "repeat" ? m ? (u.progress(0), u.play()) : (u.pause(), u.progress(0)) : c === "state" && (m ? u.play() : u.pause()));
|
|
878
878
|
}, cleanup: () => {
|
|
879
|
-
(
|
|
879
|
+
(G.get(e) || l).unobserve(e), (c === "repeat" || c === "state") && be().unobserve(e), u.cancel(), Y.delete(e), G.delete(e);
|
|
880
880
|
} };
|
|
881
|
-
|
|
881
|
+
I(X, e, v), I(X, t, v), G.set(e, l), l.observe(e), (c === "repeat" || c === "state") && be().observe(e);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
|
|
883
|
+
function Wt(e) {
|
|
884
|
+
M(X, e);
|
|
885
885
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
886
|
+
function jt() {
|
|
887
|
+
x = null, Object.keys(L).forEach((e) => delete L[e]);
|
|
888
888
|
}
|
|
889
|
-
const
|
|
890
|
-
add:
|
|
891
|
-
remove:
|
|
892
|
-
setOptions:
|
|
893
|
-
reset:
|
|
889
|
+
const Se = {
|
|
890
|
+
add: Dt,
|
|
891
|
+
remove: Wt,
|
|
892
|
+
setOptions: Vt,
|
|
893
|
+
reset: jt
|
|
894
894
|
};
|
|
895
|
-
function
|
|
895
|
+
function Ne(e, t) {
|
|
896
896
|
return Object.assign(Object.create(t), e);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
898
|
+
function Yt(e, t, n, s) {
|
|
899
899
|
let r = e * (1 - n) + t * n;
|
|
900
900
|
if (s) {
|
|
901
901
|
const i = r - e;
|
|
@@ -906,7 +906,7 @@ function jt(e, t, n, s) {
|
|
|
906
906
|
}
|
|
907
907
|
return r;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function Gt(e) {
|
|
910
910
|
let t = !1;
|
|
911
911
|
return function() {
|
|
912
912
|
t || (t = !0, window.requestAnimationFrame(() => {
|
|
@@ -914,7 +914,7 @@ function Yt(e) {
|
|
|
914
914
|
}));
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function Te(e, t) {
|
|
918
918
|
let n = 0;
|
|
919
919
|
return function() {
|
|
920
920
|
n && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
@@ -924,102 +924,102 @@ function be(e, t) {
|
|
|
924
924
|
}
|
|
925
925
|
function Kt(e, t) {
|
|
926
926
|
const n = e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);
|
|
927
|
-
return
|
|
927
|
+
return U(n[1], t) + U(n[6], t);
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function U(e, t) {
|
|
930
930
|
return e ? /^-?\d+px$/.test(e) ? parseInt(e) : /^-?\d+[lsd]?vh$/.test(e) ? parseInt(e) * t.viewportHeight / 100 : /^-?\d+[lsd]?vw$/.test(e) ? parseInt(e) * t.viewportWidth / 100 : /^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e) ? Kt(e, t) : parseInt(e) || 0 : 0;
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
const { name: s, offset: r = 0 } = e, { start: i, end: o } = n,
|
|
934
|
-
let l,
|
|
935
|
-
return s === "entry" ? (l = i - t,
|
|
932
|
+
function O(e, t, n) {
|
|
933
|
+
const { name: s, offset: r = 0 } = e, { start: i, end: o } = n, c = o - i, u = r / 100;
|
|
934
|
+
let l, a;
|
|
935
|
+
return s === "entry" ? (l = i - t, a = Math.min(t, c)) : s === "entry-crossing" ? (l = i - t, a = c) : s === "contain" ? (l = Math.min(o - t, i), a = Math.abs(t - c)) : s === "exit" ? (l = Math.max(i, o - t), a = Math.min(t, c)) : s === "exit-crossing" ? (l = i, a = c) : s === "cover" && (l = i - t, a = c + t), l + u * a | 0;
|
|
936
936
|
}
|
|
937
|
-
function
|
|
937
|
+
function se(e, t, n, s, r) {
|
|
938
938
|
let i = 0;
|
|
939
939
|
const o = { start: t, end: n };
|
|
940
|
-
return e.forEach((
|
|
941
|
-
i +=
|
|
942
|
-
const l =
|
|
940
|
+
return e.forEach((c, u) => {
|
|
941
|
+
i += c.offset;
|
|
942
|
+
const l = c.sticky;
|
|
943
943
|
if (l) {
|
|
944
|
-
if ("end" in l && e[
|
|
945
|
-
const d = ((r ?
|
|
946
|
-
let
|
|
947
|
-
(
|
|
944
|
+
if ("end" in l && e[u - 1]?.element) {
|
|
945
|
+
const d = ((r ? c.element.offsetWidth : c.element.offsetHeight) || 0) + l.end - s, v = i + d - c.offset, m = v < o.start, h = !m && v <= n;
|
|
946
|
+
let g = 0;
|
|
947
|
+
(m || h) && (g = c.offset, o.end += g), m && (o.start += g);
|
|
948
948
|
}
|
|
949
949
|
if ("start" in l) {
|
|
950
|
-
const
|
|
951
|
-
let
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
|
|
950
|
+
const a = i - l.start, f = a < o.start, d = !f && a <= o.end;
|
|
951
|
+
let v = 0;
|
|
952
|
+
const m = e[u - 1]?.element;
|
|
953
|
+
if (m) {
|
|
954
|
+
if (f || d) {
|
|
955
|
+
const h = (r ? m.offsetWidth : m.offsetHeight) || 0, g = c.offset, y = (r ? c.element.offsetWidth : c.element.offsetHeight) || 0;
|
|
956
|
+
v = h - (g + y), i += v, o.end += v;
|
|
957
957
|
}
|
|
958
|
-
|
|
958
|
+
f && (o.start += v);
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
}), o;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
const { start: o, end:
|
|
966
|
-
let l = o,
|
|
967
|
-
if (typeof
|
|
968
|
-
|
|
969
|
-
const
|
|
970
|
-
l =
|
|
964
|
+
function Bt(e, t, n, s, r, i) {
|
|
965
|
+
const { start: o, end: c, duration: u } = e;
|
|
966
|
+
let l = o, a = c, f = e.startRange, d = e.endRange, v;
|
|
967
|
+
if (typeof u == "string") {
|
|
968
|
+
f = { name: u, offset: 0 }, d = { name: u, offset: 100 }, l = O(f, n, t), a = O(d, n, t), v = a - l;
|
|
969
|
+
const m = se(i, l, a, n, s);
|
|
970
|
+
l = m.start, a = m.end;
|
|
971
971
|
} else {
|
|
972
|
-
if (
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
l =
|
|
972
|
+
if (f || o?.name) {
|
|
973
|
+
f = f || o;
|
|
974
|
+
const m = U(f.add, r), h = O({ ...f, offset: 0 }, n, t), g = O({ ...f, offset: 100 }, n, t), y = se(i, h, g, n, s);
|
|
975
|
+
l = y.start + f.offset / 100 * (y.end - y.start) + m;
|
|
976
976
|
}
|
|
977
|
-
if (d ||
|
|
978
|
-
d = d ||
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
} else typeof
|
|
977
|
+
if (d || c?.name) {
|
|
978
|
+
d = d || c;
|
|
979
|
+
const m = U(d.add, r), h = O({ ...d, offset: 0 }, n, t), g = O({ ...d, offset: 100 }, n, t), y = se(i, h, g, n, s);
|
|
980
|
+
a = y.start + d.offset / 100 * (y.end - y.start) + m;
|
|
981
|
+
} else typeof u == "number" && (a = l + u);
|
|
982
982
|
}
|
|
983
|
-
return !
|
|
983
|
+
return !v && !u && (v = a - l), { ...e, start: l, end: a, startRange: f, endRange: d, duration: v || u };
|
|
984
984
|
}
|
|
985
985
|
function Qt(e) {
|
|
986
986
|
return e.position === "sticky";
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function Xt(e, t, n) {
|
|
989
989
|
return e.position === "fixed" && (!t || t === window.document.body || t === n);
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function Ut(e, t) {
|
|
992
992
|
return parseInt(t ? e.left : e.top);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Jt(e, t) {
|
|
995
995
|
return parseInt(t ? e.right : e.bottom);
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function Zt(e, t, n) {
|
|
998
998
|
n && (e.style.position = "static");
|
|
999
999
|
const s = (t ? e.offsetLeft : e.offsetTop) || 0;
|
|
1000
1000
|
return n && (e.style.position = null), s;
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function en(e, t) {
|
|
1003
1003
|
let n;
|
|
1004
|
-
const s =
|
|
1004
|
+
const s = Ut(e, t), r = Jt(e, t), i = !isNaN(s), o = !isNaN(r);
|
|
1005
1005
|
return (i || o) && (n = {}, i && (n.start = s), o && (n.end = r)), n;
|
|
1006
1006
|
}
|
|
1007
1007
|
function H(e, t, n, s, r) {
|
|
1008
1008
|
const i = e[0].viewSource, o = [];
|
|
1009
|
-
let
|
|
1009
|
+
let c = (s ? i.offsetWidth : i.offsetHeight) || 0, u = 0, l = i;
|
|
1010
1010
|
for (; l; ) {
|
|
1011
|
-
const
|
|
1012
|
-
if ((!
|
|
1011
|
+
const f = window.getComputedStyle(l), d = Qt(f), v = d ? en(f, s) : void 0, m = Zt(l, s, d);
|
|
1012
|
+
if ((!v || !("end" in v)) && (u += m), o.push({ element: l, offset: m, sticky: v }), l = l.offsetParent, Xt(f, l, t))
|
|
1013
1013
|
break;
|
|
1014
1014
|
if (l === t) {
|
|
1015
1015
|
o.push({ element: l, offset: 0 });
|
|
1016
1016
|
break;
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
return o.reverse(), e.map((
|
|
1020
|
-
...
|
|
1021
|
-
|
|
1022
|
-
{ start:
|
|
1019
|
+
return o.reverse(), e.map((f) => ({
|
|
1020
|
+
...Bt(
|
|
1021
|
+
f,
|
|
1022
|
+
{ start: u, end: u + c },
|
|
1023
1023
|
n,
|
|
1024
1024
|
s,
|
|
1025
1025
|
r,
|
|
@@ -1027,7 +1027,7 @@ function H(e, t, n, s, r) {
|
|
|
1027
1027
|
)
|
|
1028
1028
|
}));
|
|
1029
1029
|
}
|
|
1030
|
-
const
|
|
1030
|
+
const Ie = 100, tn = {
|
|
1031
1031
|
horizontal: !1,
|
|
1032
1032
|
observeViewportEntry: !0,
|
|
1033
1033
|
viewportRootMargin: "7% 7%",
|
|
@@ -1035,116 +1035,116 @@ const Se = 100, en = {
|
|
|
1035
1035
|
observeSourcesResize: !1,
|
|
1036
1036
|
observeContentResize: !1
|
|
1037
1037
|
};
|
|
1038
|
-
function
|
|
1038
|
+
function nn(e, t, n, s) {
|
|
1039
1039
|
let r = 0;
|
|
1040
1040
|
return e >= t && e <= n ? r = s ? (e - t) / s : 1 : e > n && (r = 1), r;
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function Oe(e, t) {
|
|
1043
1043
|
return e === window ? t ? window.document.documentElement.clientWidth : window.document.documentElement.clientHeight : t ? e.clientWidth : e.clientHeight;
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function sn() {
|
|
1046
1046
|
return {
|
|
1047
1047
|
viewportWidth: window.document.documentElement.clientWidth,
|
|
1048
1048
|
viewportHeight: window.document.documentElement.clientHeight
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const t =
|
|
1053
|
-
let i =
|
|
1054
|
-
const
|
|
1051
|
+
function rn(e) {
|
|
1052
|
+
const t = Ne(e, tn), n = t.root, s = t.horizontal, r = /* @__PURE__ */ new WeakMap();
|
|
1053
|
+
let i = Oe(n, s), o, c, u, l, a;
|
|
1054
|
+
const f = [], d = sn();
|
|
1055
1055
|
if (t.scenes = Object.values(
|
|
1056
1056
|
// TODO(ameerf): find a polyfill and use groupBy instead of following reduce
|
|
1057
1057
|
e.scenes.reduce(
|
|
1058
|
-
(
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1058
|
+
(h, g, y) => {
|
|
1059
|
+
const p = g.groupId ? `group-${g.groupId}` : String(y);
|
|
1060
|
+
return h[p] ? h[p].push(g) : h[p] = [g], h;
|
|
1061
1061
|
},
|
|
1062
1062
|
{}
|
|
1063
1063
|
)
|
|
1064
|
-
).flatMap((
|
|
1065
|
-
|
|
1066
|
-
}),
|
|
1067
|
-
|
|
1068
|
-
}),
|
|
1069
|
-
const
|
|
1070
|
-
window.ResizeObserver && (
|
|
1071
|
-
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
t.scenes[b.index] =
|
|
1075
|
-
}),
|
|
1064
|
+
).flatMap((h) => (h.every((g) => g.viewSource && (typeof g.duration == "string" || g.start?.name)) ? (h = H(h, n, i, s, d), (t.observeSourcesResize || t.observeContentResize) && f.push(h)) : h.forEach((g) => {
|
|
1065
|
+
g.end == null && (g.end = g.start + g.duration), g.duration == null && (g.duration = g.end - g.start);
|
|
1066
|
+
}), h)), t.scenes.forEach((h, g) => {
|
|
1067
|
+
h.index = g;
|
|
1068
|
+
}), f.length) {
|
|
1069
|
+
const h = /* @__PURE__ */ new Map();
|
|
1070
|
+
window.ResizeObserver && (u = new window.ResizeObserver(function(g) {
|
|
1071
|
+
g.forEach((y) => {
|
|
1072
|
+
const p = h.get(y.target), w = H(p, n, i, s, d);
|
|
1073
|
+
w.forEach((b, T) => {
|
|
1074
|
+
t.scenes[b.index] = w[T];
|
|
1075
|
+
}), f.splice(f.indexOf(p), 1, w);
|
|
1076
1076
|
});
|
|
1077
|
-
}),
|
|
1078
|
-
|
|
1079
|
-
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(
|
|
1080
|
-
const
|
|
1081
|
-
const
|
|
1082
|
-
return
|
|
1083
|
-
t.scenes[b.index] =
|
|
1084
|
-
}),
|
|
1077
|
+
}), f.forEach((g) => {
|
|
1078
|
+
u.observe(g[0].viewSource, { box: "border-box" }), h.set(g[0].viewSource, g);
|
|
1079
|
+
}), t.observeContentResize && t.contentRoot && new window.ResizeObserver(Te(() => {
|
|
1080
|
+
const y = f.map((p) => {
|
|
1081
|
+
const w = H(p, n, i, s, d);
|
|
1082
|
+
return w.forEach((b, T) => {
|
|
1083
|
+
t.scenes[b.index] = w[T];
|
|
1084
|
+
}), w;
|
|
1085
1085
|
});
|
|
1086
|
-
|
|
1087
|
-
|
|
1086
|
+
f.length = 0, f.push(...y), f.forEach((p) => {
|
|
1087
|
+
h.set(p[0].viewSource, p);
|
|
1088
1088
|
});
|
|
1089
|
-
},
|
|
1090
|
-
i =
|
|
1091
|
-
const
|
|
1092
|
-
const
|
|
1093
|
-
return
|
|
1094
|
-
t.scenes[
|
|
1095
|
-
}),
|
|
1089
|
+
}, Ie)).observe(t.contentRoot, { box: "border-box" })), t.observeViewportResize && (l = Te(function() {
|
|
1090
|
+
i = Oe(n, s);
|
|
1091
|
+
const g = f.map((y) => {
|
|
1092
|
+
const p = H(y, n, i, s, d);
|
|
1093
|
+
return p.forEach((w, b) => {
|
|
1094
|
+
t.scenes[w.index] = p[b];
|
|
1095
|
+
}), p;
|
|
1096
1096
|
});
|
|
1097
|
-
|
|
1098
|
-
|
|
1097
|
+
f.length = 0, f.push(...g), f.forEach((y) => {
|
|
1098
|
+
h.set(y[0].viewSource, y);
|
|
1099
1099
|
});
|
|
1100
|
-
},
|
|
1100
|
+
}, Ie), n === window ? window.addEventListener("resize", l) : window.ResizeObserver && (a = new window.ResizeObserver(l), a.observe(n, { box: "border-box" })));
|
|
1101
1101
|
}
|
|
1102
|
-
t.observeViewportEntry && window.IntersectionObserver && (
|
|
1103
|
-
|
|
1104
|
-
(r.get(
|
|
1105
|
-
|
|
1102
|
+
t.observeViewportEntry && window.IntersectionObserver && (c = new window.IntersectionObserver(function(h) {
|
|
1103
|
+
h.forEach((g) => {
|
|
1104
|
+
(r.get(g.target) || []).forEach((y) => {
|
|
1105
|
+
y.disabled = !g.isIntersecting;
|
|
1106
1106
|
});
|
|
1107
1107
|
});
|
|
1108
1108
|
}, {
|
|
1109
1109
|
root: n === window ? window.document : n,
|
|
1110
1110
|
rootMargin: t.viewportRootMargin,
|
|
1111
1111
|
threshold: 0
|
|
1112
|
-
}), t.scenes.forEach((
|
|
1113
|
-
if (
|
|
1114
|
-
let
|
|
1115
|
-
|
|
1112
|
+
}), t.scenes.forEach((h) => {
|
|
1113
|
+
if (h.viewSource) {
|
|
1114
|
+
let g = r.get(h.viewSource);
|
|
1115
|
+
g || (g = [], r.set(h.viewSource, g), c.observe(h.viewSource)), g.push(h);
|
|
1116
1116
|
}
|
|
1117
1117
|
}));
|
|
1118
|
-
function
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
if (
|
|
1122
|
-
for (let
|
|
1123
|
-
if (!
|
|
1124
|
-
const { start:
|
|
1125
|
-
|
|
1118
|
+
function v({ p: h, vp: g }) {
|
|
1119
|
+
h = +h.toFixed(1);
|
|
1120
|
+
const y = +g.toFixed(4);
|
|
1121
|
+
if (h !== o) {
|
|
1122
|
+
for (let p of t.scenes)
|
|
1123
|
+
if (!p.disabled) {
|
|
1124
|
+
const { start: w, end: b, duration: T } = p, C = nn(h, w, b, T);
|
|
1125
|
+
p.effect(p, C, y);
|
|
1126
1126
|
}
|
|
1127
|
-
o =
|
|
1127
|
+
o = h;
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
t.scenes.forEach((
|
|
1130
|
+
function m() {
|
|
1131
|
+
t.scenes.forEach((h) => h.destroy?.()), c && (c.disconnect(), c = null), u && (u.disconnect(), u = null), l && (a ? (a.disconnect(), a = null) : window.removeEventListener("resize", l));
|
|
1132
1132
|
}
|
|
1133
1133
|
return {
|
|
1134
|
-
tick:
|
|
1135
|
-
destroy:
|
|
1134
|
+
tick: v,
|
|
1135
|
+
destroy: m
|
|
1136
1136
|
};
|
|
1137
1137
|
}
|
|
1138
|
-
const
|
|
1138
|
+
const on = {
|
|
1139
1139
|
transitionActive: !1,
|
|
1140
1140
|
transitionFriction: 0.9,
|
|
1141
1141
|
transitionEpsilon: 1,
|
|
1142
1142
|
velocityActive: !1,
|
|
1143
1143
|
velocityMax: 1
|
|
1144
1144
|
};
|
|
1145
|
-
class
|
|
1145
|
+
class cn {
|
|
1146
1146
|
constructor(t = {}) {
|
|
1147
|
-
this.config =
|
|
1147
|
+
this.config = Ne(t, on), this.progress = {
|
|
1148
1148
|
p: 0,
|
|
1149
1149
|
prevP: 0,
|
|
1150
1150
|
vp: 0
|
|
@@ -1157,7 +1157,7 @@ class on {
|
|
|
1157
1157
|
this.config.root = n ? window : this.config.root, this.config.contentRoot = this.config.contentRoot || (n ? window.document.body : this.config.root.firstElementChild), this.config.resetProgress = this.config.resetProgress || this.resetProgress.bind(this), this._measure = this.config.measure || (() => {
|
|
1158
1158
|
const s = this.config.root;
|
|
1159
1159
|
this.progress.p = this.config.horizontal ? s.scrollX || s.scrollLeft || 0 : s.scrollY || s.scrollTop || 0;
|
|
1160
|
-
}), this._trigger =
|
|
1160
|
+
}), this._trigger = Gt(() => {
|
|
1161
1161
|
this._measure?.(), this.tick(!0);
|
|
1162
1162
|
});
|
|
1163
1163
|
}
|
|
@@ -1203,7 +1203,7 @@ class on {
|
|
|
1203
1203
|
* Calculate current progress.
|
|
1204
1204
|
*/
|
|
1205
1205
|
lerp() {
|
|
1206
|
-
this.currentProgress.p =
|
|
1206
|
+
this.currentProgress.p = Yt(this.currentProgress.p, this.progress.p, +(1 - this.config.transitionFriction).toFixed(3), this.config.transitionEpsilon);
|
|
1207
1207
|
}
|
|
1208
1208
|
/**
|
|
1209
1209
|
* Stop the event and effect, and remove all DOM side-effects.
|
|
@@ -1227,7 +1227,7 @@ class on {
|
|
|
1227
1227
|
* Reset registered effect.
|
|
1228
1228
|
*/
|
|
1229
1229
|
setupEffect() {
|
|
1230
|
-
this.removeEffect(), this.effect =
|
|
1230
|
+
this.removeEffect(), this.effect = rn(this.config);
|
|
1231
1231
|
}
|
|
1232
1232
|
/**
|
|
1233
1233
|
* Remove registered effect.
|
|
@@ -1236,22 +1236,22 @@ class on {
|
|
|
1236
1236
|
this.effect && this.effect.destroy(), this.effect = null;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
|
-
const
|
|
1240
|
-
let
|
|
1239
|
+
const oe = /* @__PURE__ */ new WeakMap();
|
|
1240
|
+
let Ve = () => ({});
|
|
1241
1241
|
function an(e) {
|
|
1242
|
-
|
|
1242
|
+
Ve = e;
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function fn(e, t, n, s, { reducedMotion: r }) {
|
|
1245
1245
|
if (r)
|
|
1246
1246
|
return;
|
|
1247
1247
|
const i = {
|
|
1248
1248
|
trigger: "view-progress",
|
|
1249
1249
|
element: e
|
|
1250
|
-
}, o =
|
|
1251
|
-
let
|
|
1250
|
+
}, o = F(n);
|
|
1251
|
+
let c;
|
|
1252
1252
|
if ("ViewTimeline" in window) {
|
|
1253
|
-
const l =
|
|
1254
|
-
l && (l.play(),
|
|
1253
|
+
const l = de(t, o, i);
|
|
1254
|
+
l && (l.play(), c = () => {
|
|
1255
1255
|
l.ready.then(() => {
|
|
1256
1256
|
l.cancel();
|
|
1257
1257
|
});
|
|
@@ -1259,175 +1259,40 @@ function cn(e, t, n, s, { reducedMotion: r }) {
|
|
|
1259
1259
|
} else {
|
|
1260
1260
|
const l = Me(t, o, i);
|
|
1261
1261
|
if (l) {
|
|
1262
|
-
const
|
|
1262
|
+
const a = Array.isArray(l) ? l : [l], f = new cn({
|
|
1263
1263
|
viewSource: e,
|
|
1264
|
-
scenes:
|
|
1264
|
+
scenes: a,
|
|
1265
1265
|
observeViewportEntry: !1,
|
|
1266
1266
|
observeViewportResize: !1,
|
|
1267
1267
|
observeSourcesResize: !0,
|
|
1268
1268
|
root: document.body,
|
|
1269
|
-
...
|
|
1269
|
+
...Ve()
|
|
1270
1270
|
});
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
}, Promise.all(
|
|
1271
|
+
c = () => {
|
|
1272
|
+
f.destroy();
|
|
1273
|
+
}, Promise.all(a.map((d) => d.ready || Promise.resolve())).then(
|
|
1274
1274
|
() => {
|
|
1275
|
-
|
|
1275
|
+
f.start();
|
|
1276
1276
|
}
|
|
1277
1277
|
);
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
if (!
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1280
|
+
if (!c) return;
|
|
1281
|
+
const u = { source: e, target: t, cleanup: c };
|
|
1282
|
+
I(oe, e, u), I(oe, t, u);
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
|
|
1284
|
+
function ln(e) {
|
|
1285
|
+
M(oe, e);
|
|
1286
1286
|
}
|
|
1287
|
-
const
|
|
1288
|
-
add:
|
|
1289
|
-
remove:
|
|
1287
|
+
const un = {
|
|
1288
|
+
add: fn,
|
|
1289
|
+
remove: ln,
|
|
1290
1290
|
registerOptionsGetter: an
|
|
1291
|
-
}, oe = /* @__PURE__ */ new WeakMap();
|
|
1292
|
-
function un(e, t, n, s = !1, r) {
|
|
1293
|
-
const i = U(
|
|
1294
|
-
e,
|
|
1295
|
-
x(t),
|
|
1296
|
-
void 0,
|
|
1297
|
-
s
|
|
1298
|
-
);
|
|
1299
|
-
if (!i)
|
|
1300
|
-
return null;
|
|
1301
|
-
const o = n.type || "alternate";
|
|
1302
|
-
let a = !0;
|
|
1303
|
-
return (f) => {
|
|
1304
|
-
r && !e.matches(r) || (f.type === "mouseenter" || f.type === "focusin" ? o === "alternate" ? a ? (a = !1, i.play()) : i.reverse() : o === "state" ? i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
|
|
1305
|
-
S.mutate(() => {
|
|
1306
|
-
e.dataset.motionEnter = "done";
|
|
1307
|
-
});
|
|
1308
|
-
}), i.play()) : (f.type === "mouseleave" || f.type === "focusout") && (o === "alternate" ? i.reverse() : o === "repeat" ? (i.cancel(), S.mutate(() => {
|
|
1309
|
-
delete e.dataset.interactEnter;
|
|
1310
|
-
})) : o === "state" && i.playState === "running" && i.pause()));
|
|
1311
|
-
};
|
|
1312
|
-
}
|
|
1313
|
-
function dn(e, t, {
|
|
1314
|
-
effectId: n,
|
|
1315
|
-
listContainer: s,
|
|
1316
|
-
listItemSelector: r
|
|
1317
|
-
}, i, o) {
|
|
1318
|
-
const a = i.method || "toggle", f = a === "toggle", l = !!s;
|
|
1319
|
-
return (c) => {
|
|
1320
|
-
if (o && !e.matches(o)) return;
|
|
1321
|
-
let u;
|
|
1322
|
-
if (l && (u = e.closest(
|
|
1323
|
-
`${s} > ${r || ""}:has(:scope)`
|
|
1324
|
-
)), c.type === "mouseenter" || c.type === "focusin") {
|
|
1325
|
-
const d = f ? "add" : a;
|
|
1326
|
-
t.toggleEffect(n, d, u);
|
|
1327
|
-
} else (c.type === "mouseleave" || c.type === "focusout") && f && t.toggleEffect(n, "remove", u);
|
|
1328
|
-
};
|
|
1329
|
-
}
|
|
1330
|
-
function hn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: a }) {
|
|
1331
|
-
let f, l = !1, c = !1;
|
|
1332
|
-
if (n.transition || n.transitionProperties ? (f = dn(
|
|
1333
|
-
t,
|
|
1334
|
-
i,
|
|
1335
|
-
n,
|
|
1336
|
-
s,
|
|
1337
|
-
o
|
|
1338
|
-
), l = !0) : (f = un(
|
|
1339
|
-
t,
|
|
1340
|
-
n,
|
|
1341
|
-
s,
|
|
1342
|
-
r,
|
|
1343
|
-
o
|
|
1344
|
-
), c = s.type === "once"), !f)
|
|
1345
|
-
return;
|
|
1346
|
-
const u = (p) => {
|
|
1347
|
-
e.contains(p.relatedTarget) || f(p);
|
|
1348
|
-
}, d = (p) => {
|
|
1349
|
-
e.contains(p.relatedTarget) || f(p);
|
|
1350
|
-
}, h = { source: e, target: t, cleanup: () => {
|
|
1351
|
-
e.removeEventListener("mouseenter", f), e.removeEventListener("mouseleave", f), a && (e.removeEventListener("focusin", u), e.removeEventListener("focusout", d));
|
|
1352
|
-
} };
|
|
1353
|
-
O(oe, e, h), O(oe, t, h), a && (e.tabIndex = 0, e.addEventListener("focusin", u, { once: c })), e.addEventListener("mouseenter", f, { passive: !0, once: c }), (l ? (s.method || "toggle") === "toggle" : s.type !== "once") && (e.addEventListener("mouseleave", f, { passive: !0 }), a && e.addEventListener("focusout", d, { once: c }));
|
|
1354
|
-
}
|
|
1355
|
-
function mn(e) {
|
|
1356
|
-
C(oe, e);
|
|
1357
|
-
}
|
|
1358
|
-
const Oe = {
|
|
1359
|
-
add: hn,
|
|
1360
|
-
remove: mn
|
|
1361
|
-
}, ae = /* @__PURE__ */ new WeakMap();
|
|
1362
|
-
function pn(e, t, n, s = !1, r) {
|
|
1363
|
-
const i = U(
|
|
1364
|
-
e,
|
|
1365
|
-
x(t),
|
|
1366
|
-
void 0,
|
|
1367
|
-
s
|
|
1368
|
-
);
|
|
1369
|
-
if (!i)
|
|
1370
|
-
return null;
|
|
1371
|
-
let o = !0;
|
|
1372
|
-
const a = n.type || "alternate";
|
|
1373
|
-
return (f) => {
|
|
1374
|
-
r && !e.matches(r) || (a === "alternate" ? o ? (o = !1, i.play()) : i.reverse() : a === "state" ? o ? (o = !1, i.play()) : i.playState === "running" ? i.pause() : i.playState !== "finished" && i.play() : (i.progress(0), i.isCSS && i.onFinish(() => {
|
|
1375
|
-
S.mutate(() => {
|
|
1376
|
-
e.dataset.interactEnter = "done";
|
|
1377
|
-
});
|
|
1378
|
-
}), i.play()));
|
|
1379
|
-
};
|
|
1380
|
-
}
|
|
1381
|
-
function gn(e, t, {
|
|
1382
|
-
effectId: n,
|
|
1383
|
-
listContainer: s,
|
|
1384
|
-
listItemSelector: r
|
|
1385
|
-
}, i, o) {
|
|
1386
|
-
const a = !!s;
|
|
1387
|
-
return (f) => {
|
|
1388
|
-
if (o && !e.matches(o)) return;
|
|
1389
|
-
let l;
|
|
1390
|
-
a && (l = e.closest(
|
|
1391
|
-
`${s} > ${r || ""}:has(:scope)`
|
|
1392
|
-
)), t.toggleEffect(n, i.method || "toggle", l);
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
function vn(e, t, n, s = {}, { reducedMotion: r, targetController: i, selectorCondition: o, allowA11yTriggers: a }) {
|
|
1396
|
-
let f, l = !1;
|
|
1397
|
-
if (n.transition || n.transitionProperties ? f = gn(
|
|
1398
|
-
t,
|
|
1399
|
-
i,
|
|
1400
|
-
n,
|
|
1401
|
-
s,
|
|
1402
|
-
o
|
|
1403
|
-
) : (f = pn(
|
|
1404
|
-
t,
|
|
1405
|
-
n,
|
|
1406
|
-
s,
|
|
1407
|
-
r,
|
|
1408
|
-
o
|
|
1409
|
-
), l = s.type === "once"), !f)
|
|
1410
|
-
return;
|
|
1411
|
-
const c = (h) => {
|
|
1412
|
-
h.pointerType && f(h);
|
|
1413
|
-
}, u = (h) => {
|
|
1414
|
-
h.code === "Space" ? (h.preventDefault(), f(h)) : h.code === "Enter" && f(h);
|
|
1415
|
-
}, g = { source: e, target: t, cleanup: () => {
|
|
1416
|
-
e.removeEventListener("click", c), a && e.removeEventListener("keydown", u);
|
|
1417
|
-
} };
|
|
1418
|
-
O(ae, e, g), O(ae, t, g), e.addEventListener("click", c, { passive: !0, once: l }), a && (e.tabIndex = 0, e.addEventListener("keydown", u, { once: l }));
|
|
1419
|
-
}
|
|
1420
|
-
function yn(e) {
|
|
1421
|
-
C(ae, e);
|
|
1422
|
-
}
|
|
1423
|
-
const _e = {
|
|
1424
|
-
add: vn,
|
|
1425
|
-
remove: yn
|
|
1426
1291
|
};
|
|
1427
|
-
function
|
|
1292
|
+
function _e(e, t, n) {
|
|
1428
1293
|
return Math.min(Math.max(e, n), t);
|
|
1429
1294
|
}
|
|
1430
|
-
function
|
|
1295
|
+
function ke(e) {
|
|
1431
1296
|
let t = !1;
|
|
1432
1297
|
return function() {
|
|
1433
1298
|
if (!t)
|
|
@@ -1436,7 +1301,7 @@ function Te(e) {
|
|
|
1436
1301
|
});
|
|
1437
1302
|
};
|
|
1438
1303
|
}
|
|
1439
|
-
function
|
|
1304
|
+
function dn(e) {
|
|
1440
1305
|
let t = e, n = 0, s = 0;
|
|
1441
1306
|
if (t.offsetParent)
|
|
1442
1307
|
do
|
|
@@ -1449,7 +1314,7 @@ function wn(e) {
|
|
|
1449
1314
|
height: e.offsetHeight
|
|
1450
1315
|
};
|
|
1451
1316
|
}
|
|
1452
|
-
function
|
|
1317
|
+
function hn() {
|
|
1453
1318
|
const e = window.devicePixelRatio;
|
|
1454
1319
|
let t = !1;
|
|
1455
1320
|
if (e === 1)
|
|
@@ -1462,13 +1327,13 @@ function En() {
|
|
|
1462
1327
|
});
|
|
1463
1328
|
return document.body.dispatchEvent(n), t;
|
|
1464
1329
|
}
|
|
1465
|
-
function
|
|
1330
|
+
function mn() {
|
|
1466
1331
|
return new Promise((e) => {
|
|
1467
1332
|
const t = window.scrollY;
|
|
1468
1333
|
let n = !1, s;
|
|
1469
1334
|
function r() {
|
|
1470
|
-
document.body.addEventListener("pointerdown", (
|
|
1471
|
-
s === void 0 ? s =
|
|
1335
|
+
document.body.addEventListener("pointerdown", (c) => {
|
|
1336
|
+
s === void 0 ? s = c.offsetY : n = c.offsetY === s;
|
|
1472
1337
|
}, { once: !0 });
|
|
1473
1338
|
const o = new PointerEvent("pointerdown", {
|
|
1474
1339
|
clientY: 500
|
|
@@ -1481,60 +1346,60 @@ function bn() {
|
|
|
1481
1346
|
r(), window.addEventListener("scroll", i), window.scrollY > 0 && window.scrollBy(0, -1);
|
|
1482
1347
|
});
|
|
1483
1348
|
}
|
|
1484
|
-
function
|
|
1485
|
-
|
|
1349
|
+
function gn(e) {
|
|
1350
|
+
mn().then((t) => {
|
|
1486
1351
|
e.fixRequired = t, t && (window.addEventListener("scroll", e.scrollHandler), e.scrollHandler());
|
|
1487
1352
|
});
|
|
1488
1353
|
}
|
|
1489
|
-
let
|
|
1490
|
-
const
|
|
1491
|
-
function
|
|
1354
|
+
let z = 0;
|
|
1355
|
+
const K = /* @__PURE__ */ new Set();
|
|
1356
|
+
function vn() {
|
|
1492
1357
|
const e = (n) => {
|
|
1493
1358
|
for (let s of n.changedTouches)
|
|
1494
|
-
|
|
1359
|
+
K.add(s.identifier);
|
|
1495
1360
|
}, t = (n) => {
|
|
1496
1361
|
for (let s of n.changedTouches)
|
|
1497
|
-
|
|
1362
|
+
K.delete(s.identifier);
|
|
1498
1363
|
};
|
|
1499
1364
|
return document.addEventListener("touchstart", e, { passive: !0 }), document.addEventListener("touchend", t, { passive: !0 }), function() {
|
|
1500
|
-
|
|
1365
|
+
K.clear(), document.removeEventListener("touchstart", e), document.removeEventListener("touchend", t);
|
|
1501
1366
|
};
|
|
1502
1367
|
}
|
|
1503
|
-
function
|
|
1368
|
+
function pn(e, t) {
|
|
1504
1369
|
if ("onscrollend" in window)
|
|
1505
1370
|
return e.addEventListener("scrollend", t), function() {
|
|
1506
1371
|
e.removeEventListener("scrollend", t);
|
|
1507
1372
|
};
|
|
1508
1373
|
let n = 0, s;
|
|
1509
|
-
|
|
1374
|
+
z || (s = vn()), z += 1;
|
|
1510
1375
|
function r(i) {
|
|
1511
1376
|
clearTimeout(n), n = setTimeout(() => {
|
|
1512
|
-
|
|
1377
|
+
K.size ? setTimeout(r, 100) : (t(i), n = 0);
|
|
1513
1378
|
}, 100);
|
|
1514
1379
|
}
|
|
1515
1380
|
return e.addEventListener("scroll", r), function() {
|
|
1516
|
-
e.removeEventListener("scroll", r),
|
|
1381
|
+
e.removeEventListener("scroll", r), z -= 1, z || s();
|
|
1517
1382
|
};
|
|
1518
1383
|
}
|
|
1519
|
-
function
|
|
1384
|
+
function yn(e, t, n) {
|
|
1520
1385
|
return {
|
|
1521
1386
|
x(s) {
|
|
1522
|
-
const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2,
|
|
1523
|
-
return (s -
|
|
1387
|
+
const r = e.left - n.x + e.width / 2, i = r >= t.width / 2, o = (i ? r : t.width - r) * 2, c = i ? 0 : r - o / 2;
|
|
1388
|
+
return (s - c) / o;
|
|
1524
1389
|
},
|
|
1525
1390
|
y(s) {
|
|
1526
|
-
const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2,
|
|
1527
|
-
return (s -
|
|
1391
|
+
const r = e.top - n.y + e.height / 2, i = r >= t.height / 2, o = (i ? r : t.height - r) * 2, c = i ? 0 : r - o / 2;
|
|
1392
|
+
return (s - c) / o;
|
|
1528
1393
|
}
|
|
1529
1394
|
};
|
|
1530
1395
|
}
|
|
1531
|
-
function
|
|
1396
|
+
function En(e, t) {
|
|
1532
1397
|
this.x = window.scrollX, this.y = window.scrollY, requestAnimationFrame(() => e && e(t));
|
|
1533
1398
|
}
|
|
1534
|
-
function
|
|
1399
|
+
function wn(e) {
|
|
1535
1400
|
e.rect.width = window.document.documentElement.clientWidth, e.rect.height = window.document.documentElement.clientHeight;
|
|
1536
1401
|
}
|
|
1537
|
-
function
|
|
1402
|
+
function bn(e) {
|
|
1538
1403
|
const t = new ResizeObserver((n) => {
|
|
1539
1404
|
n.forEach((s) => {
|
|
1540
1405
|
e.rect.width = s.borderBoxSize[0].inlineSize, e.rect.height = s.borderBoxSize[0].blockSize;
|
|
@@ -1542,38 +1407,38 @@ function xn(e) {
|
|
|
1542
1407
|
});
|
|
1543
1408
|
return t.observe(e.root, { box: "border-box" }), t;
|
|
1544
1409
|
}
|
|
1545
|
-
function
|
|
1546
|
-
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o,
|
|
1547
|
-
const
|
|
1548
|
-
e.scenes.forEach((
|
|
1549
|
-
|
|
1550
|
-
}), s = function(
|
|
1551
|
-
for (let
|
|
1552
|
-
if (!
|
|
1553
|
-
const d =
|
|
1554
|
-
e.allowActiveEvent && (
|
|
1410
|
+
function Sn(e) {
|
|
1411
|
+
let t = !1, n = { x: e.rect.width / 2, y: e.rect.height / 2, vx: 0, vy: 0 }, s, r, i, o, c;
|
|
1412
|
+
const u = { x: 0, y: 0 };
|
|
1413
|
+
e.scenes.forEach((a) => {
|
|
1414
|
+
a.target && a.centeredToTarget && (a.transform = yn(dn(a.target), e.rect, u), t = !0), e.root ? r = bn(e) : (i = wn.bind(null, e), window.addEventListener("resize", i));
|
|
1415
|
+
}), s = function(a) {
|
|
1416
|
+
for (let f of e.scenes)
|
|
1417
|
+
if (!f.disabled) {
|
|
1418
|
+
const d = f.transform?.x(a.x) || a.x / e.rect.width, v = f.transform?.y(a.y) || a.y / e.rect.height, m = +_e(0, 1, d).toPrecision(4), h = +_e(0, 1, v).toPrecision(4), g = { x: a.vx, y: a.vy };
|
|
1419
|
+
e.allowActiveEvent && (a.active = d <= 1 && v <= 1 && d >= 0 && v >= 0), f.effect(f, { x: m, y: h }, g, a.active);
|
|
1555
1420
|
}
|
|
1556
|
-
Object.assign(n,
|
|
1557
|
-
}, t && (o =
|
|
1421
|
+
Object.assign(n, a);
|
|
1422
|
+
}, t && (o = En.bind(u, s, n), c = pn(document, o));
|
|
1558
1423
|
function l() {
|
|
1559
|
-
e.scenes.forEach((
|
|
1424
|
+
e.scenes.forEach((a) => a.destroy?.()), c?.(), r ? (r.disconnect(), r = null) : (window.removeEventListener("resize", i), i = null), s = null, n = null;
|
|
1560
1425
|
}
|
|
1561
1426
|
return {
|
|
1562
1427
|
tick: s,
|
|
1563
1428
|
destroy: l
|
|
1564
1429
|
};
|
|
1565
1430
|
}
|
|
1566
|
-
const
|
|
1567
|
-
let
|
|
1568
|
-
function
|
|
1569
|
-
|
|
1431
|
+
const Tn = 1e3 / 60 * 3;
|
|
1432
|
+
let N;
|
|
1433
|
+
function In() {
|
|
1434
|
+
_.x = window.scrollX, _.y = window.scrollY;
|
|
1570
1435
|
}
|
|
1571
|
-
const
|
|
1572
|
-
class
|
|
1436
|
+
const _ = { x: 0, y: 0, scrollHandler: In, fixRequired: void 0 };
|
|
1437
|
+
class On {
|
|
1573
1438
|
constructor(t = {}) {
|
|
1574
1439
|
this.config = { ...t }, this.effect = null, this._nextTick = null, this._nextTransitionTick = null, this._startTime = 0;
|
|
1575
1440
|
let n;
|
|
1576
|
-
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() :
|
|
1441
|
+
this.config.transitionDuration ? n = this.config.noThrottle ? () => this.transition() : ke(() => this.transition()) : n = this.config.noThrottle ? () => (this.tick(), null) : ke(() => {
|
|
1577
1442
|
this.tick();
|
|
1578
1443
|
}), this.config.rect = this.config.root ? {
|
|
1579
1444
|
width: this.config.root.offsetWidth,
|
|
@@ -1596,15 +1461,15 @@ class Pn {
|
|
|
1596
1461
|
}, this._pointerEnter = () => {
|
|
1597
1462
|
this.progress.active = !0, this._nextTick = n();
|
|
1598
1463
|
}, this.config.root) {
|
|
1599
|
-
|
|
1600
|
-
const r =
|
|
1601
|
-
typeof
|
|
1464
|
+
N = typeof N == "boolean" ? N : hn();
|
|
1465
|
+
const r = N ? window.devicePixelRatio : 1;
|
|
1466
|
+
typeof _.fixRequired > "u" && gn(_), this._measure = (i) => {
|
|
1602
1467
|
if (i.target !== this.config.root) {
|
|
1603
1468
|
const o = new PointerEvent("pointermove", {
|
|
1604
1469
|
bubbles: !0,
|
|
1605
1470
|
cancelable: !0,
|
|
1606
|
-
clientX: i.x * r +
|
|
1607
|
-
clientY: i.y * r +
|
|
1471
|
+
clientX: i.x * r + _.x,
|
|
1472
|
+
clientY: i.y * r + _.y
|
|
1608
1473
|
});
|
|
1609
1474
|
i.stopPropagation(), this.config.root.dispatchEvent(o);
|
|
1610
1475
|
} else
|
|
@@ -1640,8 +1505,8 @@ class Pn {
|
|
|
1640
1505
|
const t = this.config.transitionDuration, n = this.config.transitionEasing || ((o) => o), s = performance.now();
|
|
1641
1506
|
let r = !1;
|
|
1642
1507
|
const i = (o) => {
|
|
1643
|
-
const
|
|
1644
|
-
r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [
|
|
1508
|
+
const c = (o - this._startTime) / t, u = n(Math.min(1, c));
|
|
1509
|
+
r && (this.progress.vx = 0, this.progress.vy = 0, r = !1), this.currentProgress = Object.entries(this.progress).reduce((l, [a, f]) => (a === "active" ? l[a] = f : l[a] = this.previousProgress[a] + (f - this.previousProgress[a]) * u, l), this.currentProgress || {}), c < 1 && (this._nextTransitionTick = requestAnimationFrame(i), r = o - this._startTime > Tn), this.effect.tick(this.currentProgress);
|
|
1645
1510
|
};
|
|
1646
1511
|
return this._startTime ? (this._nextTransitionTick && cancelAnimationFrame(this._nextTransitionTick), Object.assign(this.previousProgress, this.currentProgress), this._startTime = s, i(s)) : this._startTime = s, this._nextTransitionTick;
|
|
1647
1512
|
}
|
|
@@ -1670,7 +1535,7 @@ class Pn {
|
|
|
1670
1535
|
* Reset registered effect.
|
|
1671
1536
|
*/
|
|
1672
1537
|
setupEffect() {
|
|
1673
|
-
this.removeEffect(), this.effect =
|
|
1538
|
+
this.removeEffect(), this.effect = Sn(this.config);
|
|
1674
1539
|
}
|
|
1675
1540
|
/**
|
|
1676
1541
|
* Remove registered effect.
|
|
@@ -1680,88 +1545,249 @@ class Pn {
|
|
|
1680
1545
|
}
|
|
1681
1546
|
}
|
|
1682
1547
|
const ce = /* @__PURE__ */ new WeakMap();
|
|
1683
|
-
let
|
|
1684
|
-
function
|
|
1685
|
-
|
|
1548
|
+
let De = () => ({});
|
|
1549
|
+
function _n(e) {
|
|
1550
|
+
De = e;
|
|
1686
1551
|
}
|
|
1687
|
-
function
|
|
1552
|
+
function kn(e, t, n, s = {}, { reducedMotion: r }) {
|
|
1688
1553
|
if (r)
|
|
1689
1554
|
return;
|
|
1690
1555
|
const i = {
|
|
1691
1556
|
trigger: "pointer-move",
|
|
1692
1557
|
element: e,
|
|
1693
1558
|
axis: s.axis ?? "y"
|
|
1694
|
-
}, o = Me(t,
|
|
1559
|
+
}, o = Me(t, F(n), i);
|
|
1695
1560
|
if (o) {
|
|
1696
|
-
const
|
|
1561
|
+
const c = Array.isArray(o) ? o : [o], u = new On({
|
|
1697
1562
|
root: s.hitArea === "self" ? e : void 0,
|
|
1698
|
-
scenes:
|
|
1699
|
-
...
|
|
1700
|
-
}),
|
|
1701
|
-
|
|
1563
|
+
scenes: c,
|
|
1564
|
+
...De()
|
|
1565
|
+
}), a = { source: e, target: t, cleanup: () => {
|
|
1566
|
+
u.destroy();
|
|
1702
1567
|
} };
|
|
1703
|
-
|
|
1704
|
-
|
|
1568
|
+
I(ce, e, a), I(ce, t, a), Promise.all(
|
|
1569
|
+
c.map((f) => f.ready || Promise.resolve())
|
|
1705
1570
|
).then(() => {
|
|
1706
|
-
|
|
1571
|
+
u.start();
|
|
1707
1572
|
});
|
|
1708
1573
|
}
|
|
1709
1574
|
}
|
|
1710
|
-
function
|
|
1711
|
-
|
|
1712
|
-
}
|
|
1713
|
-
const
|
|
1714
|
-
add:
|
|
1715
|
-
remove:
|
|
1716
|
-
registerOptionsGetter:
|
|
1717
|
-
},
|
|
1718
|
-
function
|
|
1719
|
-
const o =
|
|
1575
|
+
function Cn(e) {
|
|
1576
|
+
M(ce, e);
|
|
1577
|
+
}
|
|
1578
|
+
const xn = {
|
|
1579
|
+
add: kn,
|
|
1580
|
+
remove: Cn,
|
|
1581
|
+
registerOptionsGetter: _n
|
|
1582
|
+
}, ae = /* @__PURE__ */ new WeakMap();
|
|
1583
|
+
function An(e, t, n, s, { reducedMotion: r, selectorCondition: i }) {
|
|
1584
|
+
const o = he(
|
|
1720
1585
|
t,
|
|
1721
|
-
|
|
1586
|
+
F(n),
|
|
1722
1587
|
void 0,
|
|
1723
1588
|
r
|
|
1724
1589
|
);
|
|
1725
1590
|
if (!o)
|
|
1726
1591
|
return;
|
|
1727
|
-
const
|
|
1592
|
+
const c = () => {
|
|
1728
1593
|
i && !t.matches(i) || o.play();
|
|
1729
1594
|
}, l = { source: e, target: t, cleanup: () => {
|
|
1730
|
-
o.cancel(), e.removeEventListener("animationend",
|
|
1595
|
+
o.cancel(), e.removeEventListener("animationend", c);
|
|
1731
1596
|
} };
|
|
1732
|
-
|
|
1597
|
+
I(ae, e, l), I(ae, t, l), e.addEventListener("animationend", c);
|
|
1733
1598
|
}
|
|
1734
|
-
function
|
|
1735
|
-
|
|
1599
|
+
function Ln(e) {
|
|
1600
|
+
M(ae, e);
|
|
1736
1601
|
}
|
|
1737
|
-
const
|
|
1738
|
-
add:
|
|
1739
|
-
remove:
|
|
1602
|
+
const Pn = {
|
|
1603
|
+
add: An,
|
|
1604
|
+
remove: Ln
|
|
1740
1605
|
};
|
|
1741
|
-
function
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1606
|
+
function Rn(e, t, n, s = !1, r, i) {
|
|
1607
|
+
const o = he(
|
|
1608
|
+
e,
|
|
1609
|
+
F(t),
|
|
1610
|
+
void 0,
|
|
1611
|
+
s
|
|
1612
|
+
);
|
|
1613
|
+
if (!o)
|
|
1614
|
+
return null;
|
|
1615
|
+
let c = !0;
|
|
1616
|
+
const u = n.type || "alternate";
|
|
1617
|
+
return (l) => {
|
|
1618
|
+
if (r && !e.matches(r)) return;
|
|
1619
|
+
const a = !i, f = i?.enter?.includes(l.type), d = i?.leave?.includes(l.type);
|
|
1620
|
+
if (f || a) {
|
|
1621
|
+
u === "alternate" || u === "state" ? c ? (c = !1, o.play()) : u === "alternate" ? o.reverse() : u === "state" && (o.playState === "running" ? o.pause() : o.playState !== "finished" && o.play()) : (o.progress(0), delete e.dataset.interactEnter, o.isCSS && o.onFinish(() => {
|
|
1622
|
+
S.mutate(() => {
|
|
1623
|
+
e.dataset.interactEnter = "done";
|
|
1624
|
+
});
|
|
1625
|
+
}), o.play());
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
d && (u === "alternate" ? o.reverse() : u === "repeat" ? (o.cancel(), S.mutate(() => {
|
|
1629
|
+
delete e.dataset.interactEnter;
|
|
1630
|
+
})) : u === "state" && o.playState === "running" && o.pause());
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
function $n(e, t, {
|
|
1634
|
+
effectId: n,
|
|
1635
|
+
listContainer: s,
|
|
1636
|
+
listItemSelector: r
|
|
1637
|
+
}, i, o, c) {
|
|
1638
|
+
const u = !!s, l = i.method || "toggle", a = l === "toggle";
|
|
1639
|
+
return (f) => {
|
|
1640
|
+
if (o && !e.matches(o)) return;
|
|
1641
|
+
const d = u ? e.closest(
|
|
1642
|
+
`${s} > ${r || ""}:has(:scope)`
|
|
1643
|
+
) : void 0, v = !c, m = c?.enter?.includes(f.type), h = c?.leave?.includes(f.type);
|
|
1644
|
+
v ? t.toggleEffect(n, l, d) : (m && t.toggleEffect(n, a ? "add" : l, d), h && a && t.toggleEffect(n, "remove", d));
|
|
1645
|
+
};
|
|
1646
|
+
}
|
|
1647
|
+
const fe = /* @__PURE__ */ new WeakMap();
|
|
1648
|
+
function Ce(e, t) {
|
|
1649
|
+
return (n) => {
|
|
1650
|
+
const s = n;
|
|
1651
|
+
e.contains(s.relatedTarget) || t(s);
|
|
1748
1652
|
};
|
|
1749
1653
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1654
|
+
function Fn(e) {
|
|
1655
|
+
return (t) => {
|
|
1656
|
+
const n = t;
|
|
1657
|
+
n.pointerType && e(n);
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
function Mn(e) {
|
|
1661
|
+
return (t) => {
|
|
1662
|
+
const n = t;
|
|
1663
|
+
n.code === "Space" ? (n.preventDefault(), e(n)) : n.code === "Enter" && e(n);
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
const qn = {
|
|
1667
|
+
focusin: (e, t) => Ce(e, t),
|
|
1668
|
+
focusout: (e, t) => Ce(e, t),
|
|
1669
|
+
click: (e, t) => Fn(t),
|
|
1670
|
+
keydown: (e, t) => Mn(t)
|
|
1760
1671
|
};
|
|
1672
|
+
function Hn(e, t, n) {
|
|
1673
|
+
const s = qn[e];
|
|
1674
|
+
return s ? s(t, n) : (r) => n(r);
|
|
1675
|
+
}
|
|
1676
|
+
function zn(e) {
|
|
1677
|
+
return typeof e == "object" && !Array.isArray(e) && ("enter" in e || "leave" in e);
|
|
1678
|
+
}
|
|
1679
|
+
function Nn(e) {
|
|
1680
|
+
if (typeof e == "string")
|
|
1681
|
+
return { toggle: [e] };
|
|
1682
|
+
if (Array.isArray(e))
|
|
1683
|
+
return { toggle: [...e] };
|
|
1684
|
+
if (zn(e)) {
|
|
1685
|
+
const t = e.enter ? [...e.enter] : [], n = e.leave ? [...e.leave] : [];
|
|
1686
|
+
return { enter: t, leave: n };
|
|
1687
|
+
}
|
|
1688
|
+
return {};
|
|
1689
|
+
}
|
|
1690
|
+
function Vn(e) {
|
|
1691
|
+
return !!(e.enter?.length || e.leave?.length);
|
|
1692
|
+
}
|
|
1761
1693
|
function Dn(e) {
|
|
1694
|
+
return Vn(e) ? { enter: e.enter ?? [], leave: e.leave ?? [] } : void 0;
|
|
1695
|
+
}
|
|
1696
|
+
function Wn(e, t, n, s, { reducedMotion: r, targetController: i, selectorCondition: o }) {
|
|
1697
|
+
const c = Nn(s.eventConfig), u = n.transition || n.transitionProperties, l = Dn(c);
|
|
1698
|
+
let a, f = !1;
|
|
1699
|
+
if (u ? a = $n(
|
|
1700
|
+
t,
|
|
1701
|
+
i,
|
|
1702
|
+
n,
|
|
1703
|
+
s,
|
|
1704
|
+
o,
|
|
1705
|
+
l
|
|
1706
|
+
) : (a = Rn(
|
|
1707
|
+
t,
|
|
1708
|
+
n,
|
|
1709
|
+
s,
|
|
1710
|
+
r,
|
|
1711
|
+
o,
|
|
1712
|
+
l
|
|
1713
|
+
), f = s.type === "once"), !a)
|
|
1714
|
+
return;
|
|
1715
|
+
const d = a, v = new AbortController();
|
|
1716
|
+
function m(y, p, w) {
|
|
1717
|
+
const b = Hn(p, e, d);
|
|
1718
|
+
y.addEventListener(p, b, { ...w, signal: v.signal });
|
|
1719
|
+
}
|
|
1720
|
+
const g = { source: e, target: t, cleanup: () => {
|
|
1721
|
+
v.abort();
|
|
1722
|
+
} };
|
|
1723
|
+
if (I(fe, e, g), I(fe, t, g), l) {
|
|
1724
|
+
const y = c.enter, p = c.leave;
|
|
1725
|
+
y.forEach((b) => {
|
|
1726
|
+
b === "focusin" && (e.tabIndex = 0), m(e, b, { passive: !0, once: f });
|
|
1727
|
+
}), (u ? s.method === "toggle" : s.type !== "once") && p.forEach((b) => {
|
|
1728
|
+
if (b === "focusout") {
|
|
1729
|
+
m(e, b, { once: f });
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
m(e, b, { passive: !0 });
|
|
1733
|
+
});
|
|
1734
|
+
} else
|
|
1735
|
+
(c.toggle ?? []).forEach((p) => {
|
|
1736
|
+
m(e, p, { once: f, passive: p !== "keydown" });
|
|
1737
|
+
});
|
|
1738
|
+
}
|
|
1739
|
+
function jn(e) {
|
|
1740
|
+
M(fe, e);
|
|
1741
|
+
}
|
|
1742
|
+
const A = {
|
|
1743
|
+
add: Wn,
|
|
1744
|
+
remove: jn
|
|
1745
|
+
}, le = {
|
|
1746
|
+
click: ["click"],
|
|
1747
|
+
activate: ["click", "keydown"],
|
|
1748
|
+
hover: { enter: ["mouseenter"], leave: ["mouseleave"] },
|
|
1749
|
+
interest: {
|
|
1750
|
+
enter: ["mouseenter", "focusin"],
|
|
1751
|
+
leave: ["mouseleave", "focusout"]
|
|
1752
|
+
}
|
|
1753
|
+
}, xe = {
|
|
1754
|
+
click: le.activate,
|
|
1755
|
+
hover: le.interest
|
|
1756
|
+
};
|
|
1757
|
+
function V(e) {
|
|
1758
|
+
const t = le[e];
|
|
1759
|
+
return (n, s, r, i, o) => {
|
|
1760
|
+
const c = o?.allowA11yTriggers && e in xe ? xe[e] : t;
|
|
1761
|
+
A.add(n, s, r, { ...i, eventConfig: c }, o ?? {});
|
|
1762
|
+
};
|
|
1763
|
+
}
|
|
1764
|
+
const P = {
|
|
1765
|
+
viewEnter: Se,
|
|
1766
|
+
hover: {
|
|
1767
|
+
add: V("hover"),
|
|
1768
|
+
remove: A.remove
|
|
1769
|
+
},
|
|
1770
|
+
click: {
|
|
1771
|
+
add: V("click"),
|
|
1772
|
+
remove: A.remove
|
|
1773
|
+
},
|
|
1774
|
+
pageVisible: Se,
|
|
1775
|
+
animationEnd: Pn,
|
|
1776
|
+
viewProgress: un,
|
|
1777
|
+
pointerMove: xn,
|
|
1778
|
+
activate: {
|
|
1779
|
+
add: V("activate"),
|
|
1780
|
+
remove: A.remove
|
|
1781
|
+
},
|
|
1782
|
+
interest: {
|
|
1783
|
+
add: V("interest"),
|
|
1784
|
+
remove: A.remove
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
function Yn(e) {
|
|
1762
1788
|
return e.replace(/\[([-\w]+)]/g, "[]");
|
|
1763
1789
|
}
|
|
1764
|
-
class
|
|
1790
|
+
class E {
|
|
1765
1791
|
static defineInteractElement;
|
|
1766
1792
|
dataCache;
|
|
1767
1793
|
addedInteractions;
|
|
@@ -1778,12 +1804,12 @@ class w {
|
|
|
1778
1804
|
init(t, n) {
|
|
1779
1805
|
if (typeof window > "u" || !window.customElements)
|
|
1780
1806
|
return;
|
|
1781
|
-
const s = n?.useCutsomElement ?? !!
|
|
1782
|
-
this.dataCache =
|
|
1783
|
-
const r =
|
|
1807
|
+
const s = n?.useCutsomElement ?? !!E.defineInteractElement;
|
|
1808
|
+
this.dataCache = Kn(t, s);
|
|
1809
|
+
const r = E.defineInteractElement?.();
|
|
1784
1810
|
s && r === !1 ? document.querySelectorAll("interact-element").forEach((i) => {
|
|
1785
1811
|
i.connect();
|
|
1786
|
-
}) :
|
|
1812
|
+
}) : E.controllerCache.forEach(
|
|
1787
1813
|
(i, o) => i.connect(o)
|
|
1788
1814
|
);
|
|
1789
1815
|
}
|
|
@@ -1792,20 +1818,20 @@ class w {
|
|
|
1792
1818
|
t.disconnect();
|
|
1793
1819
|
for (const [, t] of this.mediaQueryListeners.entries())
|
|
1794
1820
|
t.mql.removeEventListener("change", t.handler);
|
|
1795
|
-
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, conditions: {}, interactions: {} },
|
|
1821
|
+
this.mediaQueryListeners.clear(), this.addedInteractions = {}, this.listInteractionsCache = {}, this.controllers.clear(), this.dataCache = { effects: {}, conditions: {}, interactions: {} }, E.instances.splice(E.instances.indexOf(this), 1);
|
|
1796
1822
|
}
|
|
1797
1823
|
setController(t, n) {
|
|
1798
|
-
this.controllers.add(n),
|
|
1824
|
+
this.controllers.add(n), E.setController(t, n);
|
|
1799
1825
|
}
|
|
1800
1826
|
deleteController(t, n = !1) {
|
|
1801
|
-
const s =
|
|
1802
|
-
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s),
|
|
1827
|
+
const s = E.controllerCache.get(t);
|
|
1828
|
+
this.clearInteractionStateForKey(t), this.clearMediaQueryListenersForKey(t), s && n && (this.controllers.delete(s), E.deleteController(t));
|
|
1803
1829
|
}
|
|
1804
1830
|
has(t) {
|
|
1805
1831
|
return !!this.get(t);
|
|
1806
1832
|
}
|
|
1807
1833
|
get(t) {
|
|
1808
|
-
const n =
|
|
1834
|
+
const n = Yn(t);
|
|
1809
1835
|
return this.dataCache.interactions[n];
|
|
1810
1836
|
}
|
|
1811
1837
|
clearMediaQueryListenersForKey(t) {
|
|
@@ -1826,39 +1852,39 @@ class w {
|
|
|
1826
1852
|
}));
|
|
1827
1853
|
}
|
|
1828
1854
|
static create(t, n) {
|
|
1829
|
-
const s = new
|
|
1830
|
-
return
|
|
1855
|
+
const s = new E();
|
|
1856
|
+
return E.instances.push(s), s.init(t, n), s;
|
|
1831
1857
|
}
|
|
1832
1858
|
static destroy() {
|
|
1833
|
-
|
|
1859
|
+
E.controllerCache.forEach((t) => {
|
|
1834
1860
|
t.disconnect();
|
|
1835
|
-
}),
|
|
1861
|
+
}), E.instances.length = 0, E.controllerCache.clear();
|
|
1836
1862
|
}
|
|
1837
1863
|
static setup(t) {
|
|
1838
|
-
t.scrollOptionsGetter &&
|
|
1864
|
+
t.scrollOptionsGetter && P.viewProgress.registerOptionsGetter?.(
|
|
1839
1865
|
t.scrollOptionsGetter
|
|
1840
|
-
), t.pointerOptionsGetter &&
|
|
1866
|
+
), t.pointerOptionsGetter && P.pointerMove.registerOptionsGetter?.(
|
|
1841
1867
|
t.pointerOptionsGetter
|
|
1842
|
-
), t.viewEnter &&
|
|
1868
|
+
), t.viewEnter && P.viewEnter.setOptions(
|
|
1843
1869
|
t.viewEnter
|
|
1844
|
-
), t.allowA11yTriggers !== void 0 && (
|
|
1870
|
+
), t.allowA11yTriggers !== void 0 && (E.allowA11yTriggers = t.allowA11yTriggers);
|
|
1845
1871
|
}
|
|
1846
1872
|
static getInstance(t) {
|
|
1847
|
-
return
|
|
1873
|
+
return E.instances.find((n) => n.has(t));
|
|
1848
1874
|
}
|
|
1849
1875
|
static getController(t) {
|
|
1850
|
-
return t ?
|
|
1876
|
+
return t ? E.controllerCache.get(t) : void 0;
|
|
1851
1877
|
}
|
|
1852
1878
|
static setController(t, n) {
|
|
1853
|
-
|
|
1879
|
+
E.controllerCache.set(t, n);
|
|
1854
1880
|
}
|
|
1855
1881
|
static deleteController(t) {
|
|
1856
|
-
|
|
1882
|
+
E.controllerCache.delete(t);
|
|
1857
1883
|
}
|
|
1858
1884
|
static registerEffects = kt;
|
|
1859
1885
|
}
|
|
1860
|
-
let
|
|
1861
|
-
function
|
|
1886
|
+
let Gn = 0;
|
|
1887
|
+
function J(e, {
|
|
1862
1888
|
asCombinator: t = !1,
|
|
1863
1889
|
addItemFilter: n = !1,
|
|
1864
1890
|
useFirstChild: s = !1
|
|
@@ -1870,10 +1896,10 @@ function X(e, {
|
|
|
1870
1896
|
return e.selector;
|
|
1871
1897
|
return s ? t ? "> :first-child" : ":scope > :first-child" : "";
|
|
1872
1898
|
}
|
|
1873
|
-
function
|
|
1899
|
+
function Kn(e, t = !1) {
|
|
1874
1900
|
const n = e.conditions || {}, s = {};
|
|
1875
1901
|
return e.interactions?.forEach((r) => {
|
|
1876
|
-
const i = r.key, o = ++
|
|
1902
|
+
const i = r.key, o = ++Gn, { effects: c, ...u } = r;
|
|
1877
1903
|
if (!i) {
|
|
1878
1904
|
console.error(`Interaction ${o} is missing a key for source element.`);
|
|
1879
1905
|
return;
|
|
@@ -1884,32 +1910,32 @@ function Vn(e, t = !1) {
|
|
|
1884
1910
|
interactionIds: /* @__PURE__ */ new Set(),
|
|
1885
1911
|
selectors: /* @__PURE__ */ new Set()
|
|
1886
1912
|
});
|
|
1887
|
-
const l = Array.from(
|
|
1913
|
+
const l = Array.from(c);
|
|
1888
1914
|
l.reverse();
|
|
1889
|
-
const
|
|
1890
|
-
s[i].triggers.push(
|
|
1891
|
-
|
|
1915
|
+
const a = { ...u, effects: l };
|
|
1916
|
+
s[i].triggers.push(a), s[i].selectors.add(
|
|
1917
|
+
J(a, { useFirstChild: t })
|
|
1892
1918
|
);
|
|
1893
|
-
const
|
|
1919
|
+
const f = a.listContainer;
|
|
1894
1920
|
l.forEach((d) => {
|
|
1895
|
-
let
|
|
1896
|
-
if (!
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1921
|
+
let v = d.key;
|
|
1922
|
+
if (!v && d.effectId) {
|
|
1923
|
+
const g = e.effects[d.effectId];
|
|
1924
|
+
g && (v = g.key);
|
|
1899
1925
|
}
|
|
1900
|
-
d.effectId || (d.effectId = Mt()),
|
|
1901
|
-
const
|
|
1902
|
-
if (
|
|
1926
|
+
d.effectId || (d.effectId = Mt()), v = v || i, d.key = v;
|
|
1927
|
+
const m = d.effectId;
|
|
1928
|
+
if (f && d.listContainer && (v !== i || d.listContainer !== f))
|
|
1903
1929
|
return;
|
|
1904
|
-
const
|
|
1905
|
-
d.interactionId =
|
|
1930
|
+
const h = `${i}::${v}::${m}::${o}`;
|
|
1931
|
+
d.interactionId = h, s[i].interactionIds.add(h), v !== i && (s[v] ? s[v].effects[h] || (s[v].effects[h] = [], s[v].interactionIds.add(h)) : s[v] = {
|
|
1906
1932
|
triggers: [],
|
|
1907
1933
|
effects: {
|
|
1908
|
-
[
|
|
1934
|
+
[h]: []
|
|
1909
1935
|
},
|
|
1910
1936
|
interactionIds: /* @__PURE__ */ new Set(),
|
|
1911
1937
|
selectors: /* @__PURE__ */ new Set()
|
|
1912
|
-
}, s[
|
|
1938
|
+
}, s[v].effects[h].push({ ...u, effect: d }), s[v].selectors.add(J(d, { useFirstChild: t })));
|
|
1913
1939
|
});
|
|
1914
1940
|
}), {
|
|
1915
1941
|
effects: e.effects || {},
|
|
@@ -1917,7 +1943,7 @@ function Vn(e, t = !1) {
|
|
|
1917
1943
|
interactions: s
|
|
1918
1944
|
};
|
|
1919
1945
|
}
|
|
1920
|
-
function
|
|
1946
|
+
function Ae(e, t, n) {
|
|
1921
1947
|
if (e.listContainer) {
|
|
1922
1948
|
const s = t.querySelector(e.listContainer);
|
|
1923
1949
|
return s ? e.selector ? Array.from(s.querySelectorAll(e.selector)) : Array.from(s.children) : (console.warn(`Interact: No container found for list container "${e.listContainer}"`), []);
|
|
@@ -1933,32 +1959,32 @@ function Ce(e, t, n) {
|
|
|
1933
1959
|
function Le(e, t) {
|
|
1934
1960
|
return t.map((n) => e.selector ? n.querySelector(e.selector) : n).filter(Boolean);
|
|
1935
1961
|
}
|
|
1936
|
-
function
|
|
1962
|
+
function We(e, t, n, s, r, i, o, c) {
|
|
1937
1963
|
return [
|
|
1938
|
-
o ? Le(e, o) :
|
|
1939
|
-
|
|
1964
|
+
o ? Le(e, o) : Ae(e, n, s),
|
|
1965
|
+
c ? Le(t, c) : Ae(t, r, i)
|
|
1940
1966
|
];
|
|
1941
1967
|
}
|
|
1942
|
-
function
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1968
|
+
function je(e, t, n, s, r, i, o) {
|
|
1969
|
+
const c = Array.isArray(s), u = Array.isArray(r);
|
|
1970
|
+
c ? s.forEach((l, a) => {
|
|
1971
|
+
const f = u ? r[a] : r;
|
|
1972
|
+
f && Pe(
|
|
1947
1973
|
e,
|
|
1948
1974
|
l,
|
|
1949
1975
|
t.trigger,
|
|
1950
|
-
|
|
1976
|
+
f,
|
|
1951
1977
|
n,
|
|
1952
1978
|
t.params,
|
|
1953
1979
|
i,
|
|
1954
1980
|
o
|
|
1955
1981
|
);
|
|
1956
|
-
}) : (
|
|
1957
|
-
|
|
1982
|
+
}) : (u ? r : [r]).forEach((a) => {
|
|
1983
|
+
Pe(
|
|
1958
1984
|
e,
|
|
1959
1985
|
s,
|
|
1960
1986
|
t.trigger,
|
|
1961
|
-
|
|
1987
|
+
a,
|
|
1962
1988
|
n,
|
|
1963
1989
|
t.params,
|
|
1964
1990
|
i,
|
|
@@ -1966,184 +1992,184 @@ function We(e, t, n, s, r, i, o) {
|
|
|
1966
1992
|
);
|
|
1967
1993
|
});
|
|
1968
1994
|
}
|
|
1969
|
-
function
|
|
1995
|
+
function Ye(e, t, n, s, r) {
|
|
1970
1996
|
const i = {}, o = [];
|
|
1971
|
-
s.effects.forEach((
|
|
1972
|
-
const
|
|
1973
|
-
...n.dataCache.effects[
|
|
1974
|
-
...
|
|
1975
|
-
effectId:
|
|
1976
|
-
},
|
|
1977
|
-
if (i[
|
|
1997
|
+
s.effects.forEach((c) => {
|
|
1998
|
+
const u = c.effectId, l = {
|
|
1999
|
+
...n.dataCache.effects[u] || {},
|
|
2000
|
+
...c,
|
|
2001
|
+
effectId: u
|
|
2002
|
+
}, a = l.key, f = R(c.interactionId, e);
|
|
2003
|
+
if (i[f] || n.addedInteractions[f] && !r)
|
|
1978
2004
|
return;
|
|
1979
|
-
const d =
|
|
1980
|
-
if (d && n.setupMediaQueryListener(
|
|
2005
|
+
const d = $(l.conditions || [], n.dataCache.conditions);
|
|
2006
|
+
if (d && n.setupMediaQueryListener(f, d, e, () => {
|
|
1981
2007
|
t.update();
|
|
1982
2008
|
}), !d || d.matches) {
|
|
1983
|
-
i[
|
|
1984
|
-
const
|
|
1985
|
-
let
|
|
1986
|
-
if (
|
|
1987
|
-
if (
|
|
2009
|
+
i[f] = !0;
|
|
2010
|
+
const v = a && R(a, e);
|
|
2011
|
+
let m;
|
|
2012
|
+
if (v) {
|
|
2013
|
+
if (m = E.getController(v), !m)
|
|
1988
2014
|
return;
|
|
1989
|
-
l.listContainer &&
|
|
2015
|
+
l.listContainer && m.watchChildList(l.listContainer);
|
|
1990
2016
|
} else
|
|
1991
|
-
|
|
1992
|
-
const [
|
|
2017
|
+
m = t;
|
|
2018
|
+
const [h, g] = We(
|
|
1993
2019
|
s,
|
|
1994
2020
|
l,
|
|
1995
2021
|
t.element,
|
|
1996
2022
|
t.useFirstChild,
|
|
1997
|
-
|
|
1998
|
-
|
|
2023
|
+
m.element,
|
|
2024
|
+
m.useFirstChild,
|
|
1999
2025
|
r
|
|
2000
2026
|
);
|
|
2001
|
-
if (!
|
|
2027
|
+
if (!h || !g)
|
|
2002
2028
|
return;
|
|
2003
|
-
n.addedInteractions[
|
|
2004
|
-
const
|
|
2029
|
+
n.addedInteractions[f] = !0;
|
|
2030
|
+
const y = v || s.key, p = Q(
|
|
2005
2031
|
l.conditions || [],
|
|
2006
2032
|
n.dataCache.conditions
|
|
2007
2033
|
);
|
|
2008
2034
|
o.push([
|
|
2009
|
-
|
|
2035
|
+
y,
|
|
2010
2036
|
s,
|
|
2011
2037
|
l,
|
|
2012
|
-
|
|
2038
|
+
h,
|
|
2039
|
+
g,
|
|
2013
2040
|
p,
|
|
2014
|
-
|
|
2015
|
-
h.useFirstChild
|
|
2041
|
+
m.useFirstChild
|
|
2016
2042
|
]);
|
|
2017
2043
|
}
|
|
2018
|
-
}), o.reverse().forEach((
|
|
2019
|
-
|
|
2044
|
+
}), o.reverse().forEach((c) => {
|
|
2045
|
+
je(...c);
|
|
2020
2046
|
});
|
|
2021
2047
|
}
|
|
2022
|
-
function
|
|
2023
|
-
const i = n.get(e)?.effects || {}, o = Object.keys(i),
|
|
2024
|
-
return o.forEach((
|
|
2025
|
-
const l = R(
|
|
2048
|
+
function Ge(e, t, n, s, r) {
|
|
2049
|
+
const i = n.get(e)?.effects || {}, o = Object.keys(i), c = [];
|
|
2050
|
+
return o.forEach((u) => {
|
|
2051
|
+
const l = R(u, e);
|
|
2026
2052
|
if (n.addedInteractions[l] && !r)
|
|
2027
2053
|
return;
|
|
2028
|
-
i[
|
|
2029
|
-
const
|
|
2054
|
+
i[u].some(({ effect: f, ...d }) => {
|
|
2055
|
+
const v = $(
|
|
2030
2056
|
d.conditions || [],
|
|
2031
2057
|
n.dataCache.conditions
|
|
2032
2058
|
);
|
|
2033
|
-
if (
|
|
2059
|
+
if (v && !v.matches)
|
|
2034
2060
|
return !1;
|
|
2035
|
-
const
|
|
2036
|
-
...n.dataCache.effects[
|
|
2037
|
-
...
|
|
2038
|
-
effectId:
|
|
2061
|
+
const m = f.effectId, h = {
|
|
2062
|
+
...n.dataCache.effects[m] || {},
|
|
2063
|
+
...f,
|
|
2064
|
+
effectId: m
|
|
2039
2065
|
};
|
|
2040
|
-
if (s &&
|
|
2066
|
+
if (s && h.listContainer !== s)
|
|
2041
2067
|
return !1;
|
|
2042
|
-
const
|
|
2043
|
-
if (
|
|
2068
|
+
const g = $(h.conditions || [], n.dataCache.conditions);
|
|
2069
|
+
if (g && n.setupMediaQueryListener(l, g, e, () => {
|
|
2044
2070
|
t.update();
|
|
2045
|
-
}), !
|
|
2046
|
-
const
|
|
2047
|
-
if (!
|
|
2071
|
+
}), !g || g.matches) {
|
|
2072
|
+
const y = d.key && R(d.key, e), p = E.getController(y);
|
|
2073
|
+
if (!p)
|
|
2048
2074
|
return !0;
|
|
2049
|
-
|
|
2050
|
-
const [
|
|
2075
|
+
h.listContainer && t.watchChildList(h.listContainer);
|
|
2076
|
+
const [w, b] = We(
|
|
2051
2077
|
d,
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2078
|
+
h,
|
|
2079
|
+
p.element,
|
|
2080
|
+
p.useFirstChild,
|
|
2055
2081
|
t.element,
|
|
2056
2082
|
t.useFirstChild,
|
|
2057
2083
|
void 0,
|
|
2058
2084
|
r
|
|
2059
2085
|
);
|
|
2060
|
-
if (!
|
|
2086
|
+
if (!w || !b)
|
|
2061
2087
|
return !0;
|
|
2062
2088
|
n.addedInteractions[l] = !0;
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2089
|
+
const T = Q(
|
|
2090
|
+
h.conditions || [],
|
|
2065
2091
|
n.dataCache.conditions
|
|
2066
2092
|
);
|
|
2067
|
-
return
|
|
2093
|
+
return c.push([
|
|
2068
2094
|
e,
|
|
2069
2095
|
d,
|
|
2070
|
-
|
|
2071
|
-
|
|
2096
|
+
h,
|
|
2097
|
+
w,
|
|
2072
2098
|
b,
|
|
2073
|
-
|
|
2099
|
+
T,
|
|
2074
2100
|
t.useFirstChild
|
|
2075
2101
|
]), !0;
|
|
2076
2102
|
}
|
|
2077
2103
|
return !1;
|
|
2078
2104
|
});
|
|
2079
|
-
}),
|
|
2080
|
-
|
|
2105
|
+
}), c.reverse().forEach((u) => {
|
|
2106
|
+
je(...u);
|
|
2081
2107
|
}), o.length > 0;
|
|
2082
2108
|
}
|
|
2083
|
-
function
|
|
2084
|
-
let
|
|
2109
|
+
function Pe(e, t, n, s, r, i, o, c) {
|
|
2110
|
+
let u;
|
|
2085
2111
|
if (r.transition || r.transitionProperties) {
|
|
2086
2112
|
const l = {
|
|
2087
2113
|
key: e,
|
|
2088
2114
|
effectId: r.effectId,
|
|
2089
2115
|
transition: r.transition,
|
|
2090
2116
|
properties: r.transitionProperties,
|
|
2091
|
-
childSelector:
|
|
2117
|
+
childSelector: J(r, {
|
|
2092
2118
|
asCombinator: !0,
|
|
2093
2119
|
addItemFilter: !0,
|
|
2094
|
-
useFirstChild:
|
|
2120
|
+
useFirstChild: c
|
|
2095
2121
|
}),
|
|
2096
2122
|
selectorCondition: o
|
|
2097
2123
|
};
|
|
2098
|
-
if (
|
|
2124
|
+
if (u = E.getController(e), !u)
|
|
2099
2125
|
return;
|
|
2100
|
-
|
|
2126
|
+
u.renderStyle(qt(l));
|
|
2101
2127
|
}
|
|
2102
|
-
|
|
2103
|
-
reducedMotion:
|
|
2104
|
-
targetController:
|
|
2128
|
+
P[n]?.add(t, s, r, i, {
|
|
2129
|
+
reducedMotion: E.forceReducedMotion,
|
|
2130
|
+
targetController: u,
|
|
2105
2131
|
selectorCondition: o,
|
|
2106
|
-
allowA11yTriggers:
|
|
2132
|
+
allowA11yTriggers: E.allowA11yTriggers
|
|
2107
2133
|
});
|
|
2108
2134
|
}
|
|
2109
|
-
function
|
|
2110
|
-
const t = e.key, n =
|
|
2135
|
+
function Bn(e) {
|
|
2136
|
+
const t = e.key, n = E.getInstance(t);
|
|
2111
2137
|
if (!n)
|
|
2112
|
-
return console.warn(`No instance found for key: ${t}`),
|
|
2138
|
+
return console.warn(`No instance found for key: ${t}`), E.setController(t, e), !1;
|
|
2113
2139
|
const { triggers: s = [] } = n?.get(t) || {}, r = s.length > 0;
|
|
2114
|
-
n.setController(t, e), s.forEach((o,
|
|
2115
|
-
const
|
|
2116
|
-
if (
|
|
2117
|
-
const l = `${t}::trigger::${
|
|
2118
|
-
n.setupMediaQueryListener(l,
|
|
2140
|
+
n.setController(t, e), s.forEach((o, c) => {
|
|
2141
|
+
const u = $(o.conditions, n.dataCache.conditions);
|
|
2142
|
+
if (u) {
|
|
2143
|
+
const l = `${t}::trigger::${c}`;
|
|
2144
|
+
n.setupMediaQueryListener(l, u, t, () => {
|
|
2119
2145
|
e.update();
|
|
2120
2146
|
});
|
|
2121
2147
|
}
|
|
2122
|
-
(!
|
|
2148
|
+
(!u || u.matches) && (o.listContainer && e.watchChildList(o.listContainer), Ye(t, e, n, o));
|
|
2123
2149
|
});
|
|
2124
2150
|
let i = !1;
|
|
2125
|
-
return n && (i =
|
|
2151
|
+
return n && (i = Ge(t, e, n)), r || i;
|
|
2126
2152
|
}
|
|
2127
|
-
function
|
|
2128
|
-
const s = e.key, r =
|
|
2153
|
+
function Qn(e, t, n) {
|
|
2154
|
+
const s = e.key, r = E.getInstance(s);
|
|
2129
2155
|
if (r) {
|
|
2130
2156
|
const { triggers: i = [] } = r?.get(s) || {};
|
|
2131
|
-
i.forEach((o,
|
|
2157
|
+
i.forEach((o, c) => {
|
|
2132
2158
|
if (o.listContainer !== t)
|
|
2133
2159
|
return;
|
|
2134
|
-
const
|
|
2135
|
-
if (
|
|
2136
|
-
const l = `${s}::listTrigger::${t}::${
|
|
2137
|
-
r.setupMediaQueryListener(l,
|
|
2160
|
+
const u = $(o.conditions, r.dataCache.conditions);
|
|
2161
|
+
if (u) {
|
|
2162
|
+
const l = `${s}::listTrigger::${t}::${c}`;
|
|
2163
|
+
r.setupMediaQueryListener(l, u, s, () => {
|
|
2138
2164
|
e.update();
|
|
2139
2165
|
});
|
|
2140
2166
|
}
|
|
2141
|
-
(!
|
|
2142
|
-
}),
|
|
2167
|
+
(!u || u.matches) && Ye(s, e, r, o, n);
|
|
2168
|
+
}), Ge(s, e, r, t, n);
|
|
2143
2169
|
}
|
|
2144
2170
|
}
|
|
2145
|
-
function
|
|
2146
|
-
const n = e.key, s =
|
|
2171
|
+
function Xn(e, t = !1) {
|
|
2172
|
+
const n = e.key, s = E.getInstance(n);
|
|
2147
2173
|
if (!s)
|
|
2148
2174
|
return;
|
|
2149
2175
|
const r = [...s.get(n)?.selectors.values() || []].filter(Boolean).join(",");
|
|
@@ -2151,13 +2177,13 @@ function Yn(e, t = !1) {
|
|
|
2151
2177
|
r ? (i = [...e.element.querySelectorAll(r)], e.useFirstChild || i.push(e.element)) : i = [e.element], Ke(i), s.deleteController(n, t);
|
|
2152
2178
|
}
|
|
2153
2179
|
function Ke(e) {
|
|
2154
|
-
const t = Object.values(
|
|
2180
|
+
const t = Object.values(P);
|
|
2155
2181
|
for (const n of e)
|
|
2156
2182
|
for (const s of t)
|
|
2157
2183
|
s.remove(n);
|
|
2158
2184
|
}
|
|
2159
|
-
const
|
|
2160
|
-
class
|
|
2185
|
+
const ie = "interactEffect";
|
|
2186
|
+
class Un {
|
|
2161
2187
|
element;
|
|
2162
2188
|
key;
|
|
2163
2189
|
connected;
|
|
@@ -2177,10 +2203,10 @@ class Kn {
|
|
|
2177
2203
|
}
|
|
2178
2204
|
n !== t && (n && console.warn(
|
|
2179
2205
|
`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`
|
|
2180
|
-
), this.element.dataset.interactKey = t), this.key = t, this.connected =
|
|
2206
|
+
), this.element.dataset.interactKey = t), this.key = t, this.connected = Bn(this);
|
|
2181
2207
|
}
|
|
2182
2208
|
disconnect({ removeFromCache: t = !1 } = {}) {
|
|
2183
|
-
if ((this.key || this.element.dataset.interactKey) &&
|
|
2209
|
+
if ((this.key || this.element.dataset.interactKey) && Xn(this, t), this.sheet) {
|
|
2184
2210
|
const s = document.adoptedStyleSheets.indexOf(this.sheet);
|
|
2185
2211
|
document.adoptedStyleSheets.splice(s, 1);
|
|
2186
2212
|
}
|
|
@@ -2211,12 +2237,12 @@ class Kn {
|
|
|
2211
2237
|
return;
|
|
2212
2238
|
}
|
|
2213
2239
|
const i = new Set(
|
|
2214
|
-
this.element.dataset[
|
|
2240
|
+
this.element.dataset[ie]?.split(" ") || []
|
|
2215
2241
|
);
|
|
2216
|
-
n === "toggle" ? i.has(t) ? i.delete(t) : i.add(t) : n === "add" ? i.add(t) : n === "remove" ? i.delete(t) : n === "clear" && i.clear(), (s || this.element).dataset[
|
|
2242
|
+
n === "toggle" ? i.has(t) ? i.delete(t) : i.add(t) : n === "add" ? i.add(t) : n === "remove" ? i.delete(t) : n === "clear" && i.clear(), (s || this.element).dataset[ie] = Array.from(i).join(" ");
|
|
2217
2243
|
}
|
|
2218
2244
|
getActiveEffects() {
|
|
2219
|
-
const n = (this.element.dataset[
|
|
2245
|
+
const n = (this.element.dataset[ie] || "").trim();
|
|
2220
2246
|
return n ? n.split(/\s+/) : [];
|
|
2221
2247
|
}
|
|
2222
2248
|
watchChildList(t) {
|
|
@@ -2229,66 +2255,66 @@ class Kn {
|
|
|
2229
2255
|
_childListChangeHandler(t, n) {
|
|
2230
2256
|
const s = this.key || this.element.dataset.interactKey, r = [], i = [];
|
|
2231
2257
|
n.forEach((o) => {
|
|
2232
|
-
o.removedNodes.forEach((
|
|
2233
|
-
|
|
2234
|
-
}), o.addedNodes.forEach((
|
|
2235
|
-
|
|
2258
|
+
o.removedNodes.forEach((c) => {
|
|
2259
|
+
c instanceof HTMLElement && r.push(c);
|
|
2260
|
+
}), o.addedNodes.forEach((c) => {
|
|
2261
|
+
c instanceof HTMLElement && i.push(c);
|
|
2236
2262
|
});
|
|
2237
|
-
}), Ke(r), s &&
|
|
2263
|
+
}), Ke(r), s && Qn(this, t, i);
|
|
2238
2264
|
}
|
|
2239
2265
|
}
|
|
2240
|
-
function
|
|
2241
|
-
new
|
|
2266
|
+
function ns(e, t) {
|
|
2267
|
+
new Un(e, t).connect();
|
|
2242
2268
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const t =
|
|
2269
|
+
function ss(e) {
|
|
2270
|
+
const t = E.getController(e);
|
|
2245
2271
|
t && t.disconnect({ removeFromCache: !0 });
|
|
2246
2272
|
}
|
|
2247
|
-
const
|
|
2273
|
+
const Jn = (e, t, n, s) => {
|
|
2248
2274
|
let i = `[data-interact-key="${e.replace(/"/g, "'")}"]`;
|
|
2249
|
-
const o =
|
|
2250
|
-
return o && (i = `${i} ${o}`), n && (i =
|
|
2275
|
+
const o = J(t, { asCombinator: !0, useFirstChild: s });
|
|
2276
|
+
return o && (i = `${i} ${o}`), n && (i = j(i, n)), i;
|
|
2251
2277
|
};
|
|
2252
|
-
function
|
|
2278
|
+
function is(e, t = !1) {
|
|
2253
2279
|
const n = [], s = /* @__PURE__ */ new Set();
|
|
2254
2280
|
return e.interactions.forEach(
|
|
2255
2281
|
({
|
|
2256
2282
|
key: r,
|
|
2257
2283
|
selector: i,
|
|
2258
2284
|
listContainer: o,
|
|
2259
|
-
listItemSelector:
|
|
2260
|
-
trigger:
|
|
2285
|
+
listItemSelector: c,
|
|
2286
|
+
trigger: u,
|
|
2261
2287
|
params: l,
|
|
2262
|
-
effects:
|
|
2263
|
-
conditions:
|
|
2288
|
+
effects: a,
|
|
2289
|
+
conditions: f
|
|
2264
2290
|
}) => {
|
|
2265
|
-
if (
|
|
2266
|
-
const
|
|
2267
|
-
(!
|
|
2268
|
-
const
|
|
2269
|
-
key:
|
|
2270
|
-
selector:
|
|
2271
|
-
listContainer:
|
|
2291
|
+
if (u === "viewEnter") {
|
|
2292
|
+
const v = l;
|
|
2293
|
+
(!v?.type || v.type === "once") && a.forEach((h) => {
|
|
2294
|
+
const g = h?.effectId && e.effects[h.effectId] || h, {
|
|
2295
|
+
key: y,
|
|
2296
|
+
selector: p,
|
|
2297
|
+
listContainer: w,
|
|
2272
2298
|
listItemSelector: b,
|
|
2273
|
-
conditions:
|
|
2274
|
-
} =
|
|
2275
|
-
if (!(!
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
),
|
|
2280
|
-
|
|
2281
|
-
|
|
2299
|
+
conditions: T
|
|
2300
|
+
} = g;
|
|
2301
|
+
if (!(!y || y === r) || !(!p && !i || p === i) || !(!w && !o || w === o) || !(!b && !c || b === c)) return;
|
|
2302
|
+
const me = e.conditions || {}, ge = Q(
|
|
2303
|
+
T,
|
|
2304
|
+
me
|
|
2305
|
+
), ee = Q(
|
|
2306
|
+
f,
|
|
2307
|
+
me
|
|
2282
2308
|
);
|
|
2283
|
-
if (!(!
|
|
2284
|
-
const
|
|
2309
|
+
if (!(!ge && !ee || ge === ee)) return;
|
|
2310
|
+
const te = Jn(
|
|
2285
2311
|
r,
|
|
2286
|
-
|
|
2287
|
-
|
|
2312
|
+
g,
|
|
2313
|
+
ee,
|
|
2288
2314
|
t
|
|
2289
2315
|
);
|
|
2290
|
-
s.has(
|
|
2291
|
-
${
|
|
2316
|
+
s.has(te) || (s.add(te), n.push(`@media (prefers-reduced-motion: no-preference) {
|
|
2317
|
+
${te}:not([data-interact-enter]) {
|
|
2292
2318
|
visibility: hidden;
|
|
2293
2319
|
transform: none;
|
|
2294
2320
|
translate: none;
|
|
@@ -2303,10 +2329,10 @@ function Zn(e, t = !1) {
|
|
|
2303
2329
|
`);
|
|
2304
2330
|
}
|
|
2305
2331
|
export {
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2332
|
+
Un as I,
|
|
2333
|
+
E as a,
|
|
2334
|
+
ns as b,
|
|
2335
|
+
is as g,
|
|
2336
|
+
ss as r
|
|
2311
2337
|
};
|
|
2312
|
-
//# sourceMappingURL=index-
|
|
2338
|
+
//# sourceMappingURL=index-BfcN_rkn.mjs.map
|