@ssgoi/core 2.5.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator/animation.d.ts +57 -0
- package/dist/animator/animation.d.ts.map +1 -0
- package/dist/animator/index.d.ts +4 -3
- package/dist/animator/index.d.ts.map +1 -1
- package/dist/animator/multi-animator.d.ts +98 -0
- package/dist/animator/multi-animator.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +565 -640
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/transition/transition-strategy.d.ts +20 -9
- package/dist/transition/transition-strategy.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts +5 -5
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +5 -5
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fade.d.ts +5 -5
- package/dist/transitions/fade.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts +5 -5
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +206 -207
- package/dist/transitions/mask.d.ts +5 -5
- package/dist/transitions/mask.d.ts.map +1 -1
- package/dist/transitions/none.d.ts +3 -3
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +5 -5
- package/dist/transitions/rotate.d.ts.map +1 -1
- package/dist/transitions/scale.d.ts +5 -5
- package/dist/transitions/scale.d.ts.map +1 -1
- package/dist/transitions/slide.d.ts +5 -5
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +78 -78
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +63 -15
- package/dist/view-transitions/blind.d.ts +0 -1
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/fade.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +13 -13
- package/dist/view-transitions/index.js +472 -479
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/strip.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/animator/animation-scheduler.d.ts +0 -34
- package/dist/animator/animation-scheduler.d.ts.map +0 -1
- package/dist/test-utils.d.ts +0 -46
- package/dist/test-utils.d.ts.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AnimationState } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Animation - Abstract base class for spring-based animations
|
|
4
|
+
*
|
|
5
|
+
* Provides common interface for both single and multi-spring animations.
|
|
6
|
+
* Subclasses implement the actual animation logic.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class Animation {
|
|
9
|
+
/**
|
|
10
|
+
* Start animation moving forward (from → to)
|
|
11
|
+
* For IN transitions: 0 → 1
|
|
12
|
+
*/
|
|
13
|
+
abstract forward(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Start animation moving backward (to → from)
|
|
16
|
+
* For OUT transitions: 1 → 0
|
|
17
|
+
*/
|
|
18
|
+
abstract backward(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Stop the animation at current position
|
|
21
|
+
*/
|
|
22
|
+
abstract stop(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Reverse the animation direction
|
|
25
|
+
* If animating forward, switch to backward (and vice versa)
|
|
26
|
+
*/
|
|
27
|
+
abstract reverse(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get current animation state
|
|
30
|
+
*/
|
|
31
|
+
abstract getCurrentState(): AnimationState;
|
|
32
|
+
/**
|
|
33
|
+
* Get current position value
|
|
34
|
+
* For multi-spring: returns first animator's position
|
|
35
|
+
*/
|
|
36
|
+
abstract getCurrentValue(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get current velocity
|
|
39
|
+
* For multi-spring: returns first animator's velocity
|
|
40
|
+
*/
|
|
41
|
+
abstract getVelocity(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Set current position value
|
|
44
|
+
* For multi-spring: applies to first animator (TODO: per-spring control)
|
|
45
|
+
*/
|
|
46
|
+
abstract setValue(value: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* Set current velocity
|
|
49
|
+
* For multi-spring: applies to first animator (TODO: per-spring control)
|
|
50
|
+
*/
|
|
51
|
+
abstract setVelocity(velocity: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Check if animation is currently running
|
|
54
|
+
*/
|
|
55
|
+
abstract getIsAnimating(): boolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,8BAAsB,SAAS;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,IAAI;IAExB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,IAAI,IAAI;IAEzB;;OAEG;IACH,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,IAAI;IAExB;;OAEG;IACH,QAAQ,CAAC,eAAe,IAAI,cAAc;IAE1C;;;OAGG;IACH,QAAQ,CAAC,eAAe,IAAI,MAAM;IAElC;;;OAGG;IACH,QAAQ,CAAC,WAAW,IAAI,MAAM;IAE9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAEtC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAE5C;;OAEG;IACH,QAAQ,CAAC,cAAc,IAAI,OAAO;CACnC"}
|
package/dist/animator/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StyleObject } from './animate/types';
|
|
2
|
-
import { SpringConfig,
|
|
2
|
+
import { SpringConfig, AnimationState } from '../types';
|
|
3
|
+
import { Animation } from './animation';
|
|
3
4
|
export type { StyleObject };
|
|
4
5
|
export interface AnimatorOptions {
|
|
5
6
|
from?: number;
|
|
@@ -14,13 +15,13 @@ export interface AnimatorOptions {
|
|
|
14
15
|
onStart?: () => void;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
|
-
* Animator - Spring-based Animation Controller
|
|
18
|
+
* Animator - Spring-based Animation Controller for single spring
|
|
18
19
|
*
|
|
19
20
|
* Internally selects appropriate runner based on tick or css option
|
|
20
21
|
* - tick: RAF-based real-time animation
|
|
21
22
|
* - css: Web Animation API based (GPU accelerated, velocity tracking via simulation data)
|
|
22
23
|
*/
|
|
23
|
-
export declare class Animator
|
|
24
|
+
export declare class Animator extends Animation {
|
|
24
25
|
private options;
|
|
25
26
|
private controls;
|
|
26
27
|
private isAnimating;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,OAAO,CAAC,OAAO,CAWb;IACF,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAa;gBAExB,OAAO,EAAE,eAAe;IAmBpC,OAAO,CAAC,YAAY;IAqBpB,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;IAKhB,OAAO,IAAI,IAAI;IAWf,IAAI,IAAI,IAAI;IAWZ,WAAW,IAAI,MAAM;IAIrB,eAAe,IAAI,MAAM;IAIzB,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc;IASjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAIzD,MAAM,CAAC,SAAS,CACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,EAAE,eAAe,GACvB,QAAQ;CAMZ"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Animation } from './animation';
|
|
2
|
+
import { NormalizedMultiSpringConfig, AnimationState } from '../types';
|
|
3
|
+
export interface MultiAnimatorOptions {
|
|
4
|
+
config: NormalizedMultiSpringConfig;
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* MultiAnimator - Coordinates multiple spring animations
|
|
11
|
+
*
|
|
12
|
+
* Extends Animation base class to provide unified interface.
|
|
13
|
+
* Manages the lifecycle and timing of multiple spring animations.
|
|
14
|
+
*
|
|
15
|
+
* All scheduling is progress-based using normalizedOffset (0-1):
|
|
16
|
+
* - offset 0: Start immediately with previous spring
|
|
17
|
+
* - offset 1: Start after previous spring completes
|
|
18
|
+
* - offset 0-1: Start when previous spring reaches this progress
|
|
19
|
+
*
|
|
20
|
+
* Config must be pre-normalized using normalizeMultiSpringSchedule()
|
|
21
|
+
*/
|
|
22
|
+
export declare class MultiAnimator extends Animation {
|
|
23
|
+
private config;
|
|
24
|
+
private animators;
|
|
25
|
+
private springOrder;
|
|
26
|
+
private completedCount;
|
|
27
|
+
private completedAnimators;
|
|
28
|
+
private direction;
|
|
29
|
+
private idCounter;
|
|
30
|
+
private rafId;
|
|
31
|
+
private element?;
|
|
32
|
+
private from;
|
|
33
|
+
private to;
|
|
34
|
+
constructor(options: MultiAnimatorOptions);
|
|
35
|
+
private generateId;
|
|
36
|
+
private initializeAnimators;
|
|
37
|
+
/**
|
|
38
|
+
* Calculate progress of an animator (0-1)
|
|
39
|
+
* Progress = |position - from| / |to - from|
|
|
40
|
+
*/
|
|
41
|
+
private getAnimatorProgress;
|
|
42
|
+
/**
|
|
43
|
+
* Get order of springs based on direction
|
|
44
|
+
* Forward: 0, 1, 2, ...
|
|
45
|
+
* Backward: n-1, n-2, ..., 0
|
|
46
|
+
*/
|
|
47
|
+
private getOrderedIds;
|
|
48
|
+
private onAnimatorComplete;
|
|
49
|
+
/**
|
|
50
|
+
* Check and start springs based on previous spring's progress
|
|
51
|
+
* Called on each frame while animation is running
|
|
52
|
+
*/
|
|
53
|
+
private checkAndStartSprings;
|
|
54
|
+
private startAnimator;
|
|
55
|
+
/**
|
|
56
|
+
* Start the scheduler loop that checks spring progress
|
|
57
|
+
*/
|
|
58
|
+
private startScheduler;
|
|
59
|
+
private stopScheduler;
|
|
60
|
+
private getFirstAnimator;
|
|
61
|
+
forward(): void;
|
|
62
|
+
backward(): void;
|
|
63
|
+
private resetStartedFlags;
|
|
64
|
+
stop(): void;
|
|
65
|
+
reverse(): void;
|
|
66
|
+
getCurrentState(): AnimationState;
|
|
67
|
+
/**
|
|
68
|
+
* Get current position value from first animator
|
|
69
|
+
*/
|
|
70
|
+
getCurrentValue(): number;
|
|
71
|
+
/**
|
|
72
|
+
* Get current velocity from first animator
|
|
73
|
+
*/
|
|
74
|
+
getVelocity(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Set position value on first animator
|
|
77
|
+
* TODO: Support per-spring control
|
|
78
|
+
*/
|
|
79
|
+
setValue(value: number): void;
|
|
80
|
+
/**
|
|
81
|
+
* Set velocity on first animator
|
|
82
|
+
* TODO: Support per-spring control
|
|
83
|
+
*/
|
|
84
|
+
setVelocity(velocity: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* Check if any animation is currently running
|
|
87
|
+
*/
|
|
88
|
+
getIsAnimating(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Create MultiAnimator from existing state
|
|
91
|
+
* Uses first animator's state for initialization
|
|
92
|
+
*/
|
|
93
|
+
static fromState(state: {
|
|
94
|
+
position: number;
|
|
95
|
+
velocity: number;
|
|
96
|
+
}, options: MultiAnimatorOptions): MultiAnimator;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=multi-animator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/multi-animator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,2BAA2B,EAE3B,cAAc,EACf,MAAM,UAAU,CAAC;AAiBlB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,2BAA2B,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,OAAO,CAAC,CAAc;IAC9B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,EAAE,CAAS;gBAEP,OAAO,EAAE,oBAAoB;IASzC,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IA0B3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,kBAAkB;IAiB1B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,IAAI,IAAI;IAYf,QAAQ,IAAI,IAAI;IAYhB,OAAO,CAAC,iBAAiB;IAMzB,IAAI,IAAI,IAAI;IAQZ,OAAO,IAAI,IAAI;IAsCf,eAAe,IAAI,cAAc;IAgBjC;;OAEG;IACH,eAAe,IAAI,MAAM;IAKzB;;OAEG;IACH,WAAW,IAAI,MAAM;IAKrB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC;;OAEG;IACH,cAAc,IAAI,OAAO;IASzB;;;OAGG;IACH,MAAM,CAAC,SAAS,CACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,EAAE,oBAAoB,GAC5B,aAAa;CAMjB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var K=Object.defineProperty;var B=(n,t,i)=>t in n?K(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i;var p=(n,t,i)=>B(n,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./types.cjs"),U=require("./jaemin-BG8HRXG1.cjs");class G{constructor(){p(this,"listeners",new Set);p(this,"rafId",null);p(this,"isRunning",!1);p(this,"startTime",Date.now());p(this,"lastUpdate",this.startTime);p(this,"elapsed",0);p(this,"lagThreshold",500);p(this,"adjustedLag",33);p(this,"maxDeltaTime",33);p(this,"gap",1e3/240);p(this,"nextTime",this.gap);p(this,"tick",()=>{const t=Date.now();let e=t-this.lastUpdate;e>this.lagThreshold||e<0?(this.startTime+=e-this.adjustedLag,e=this.adjustedLag):e>this.maxDeltaTime&&(e=this.maxDeltaTime),this.lastUpdate=t;const o=t-this.startTime,r=o-this.nextTime;if(r>0){const s=e/1e3;this.elapsed=o/1e3,this.nextTime+=r+(r>=this.gap?4:this.gap-r),this.listeners.forEach(c=>{c(s,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(t){return this.listeners.add(t),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(t)}}unsubscribe(t){this.listeners.delete(t),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(t,i){this.lagThreshold=t,this.adjustedLag=Math.min(i,t)}fps(t){this.gap=1e3/t,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const x=new G;function N(n){const t=n.stiffness,i=n.damping,e=1,o=Math.sqrt(t/e),r=i/(2*Math.sqrt(t*e));return{omega:o,zeta:r}}function H(n,t,i,e){const{omega:o,zeta:r}=i,{position:s,velocity:c}=n,a=Math.min(e,.033),m=-2*a*r*o*c,h=a*o*o*(t-s),u=c+m+h;return{position:s+a*u,velocity:u}}const J=.01,Q=.01,Y=.05;function j(n,t){const i=Math.abs(t-n.position),e=Math.abs(n.velocity);return i<J&&e<Q}function Z(n){const{from:t,to:i,spring:e,velocity:o=0,onUpdate:r,onComplete:s,onStart:c}=n;let a={position:t,velocity:o},m=!0,h=0,u=!1;const g=N(e),l=w=>{if(m){if(u||(u=!0,c==null||c()),a=H(a,i,g,w),j(a,i)){if(h+=Math.min(w,.033),h>=Y){a={position:i,velocity:0},m=!1,r(a.position),x.unsubscribe(l),s();return}}else h=0;r(a.position)}};return x.subscribe(l),{stop:()=>{m&&(m=!1,x.unsubscribe(l))},getPosition:()=>a.position,getVelocity:()=>a.velocity,isRunning:()=>m}}const I=1e3/60;function tt(n,t,i,e=0){const o=N(i),r=600;let s={position:n,velocity:e},c=0;const a=[];for(let m=0;m<r;m++){const h=m*I;if(a.push({time:h,position:s.position,velocity:s.velocity}),s=H(s,t,o,I/1e3),j(s,t)){if(c+=I/1e3,c>=Y){a.push({time:(m+1)*I,position:t,velocity:0});break}}else c=0}return a}function L(n,t){if(n.length===0)return{position:0,velocity:0};const i=n[0],e=n[n.length-1];if(t<=0)return{position:i.position,velocity:i.velocity};if(t>=e.time)return{position:e.position,velocity:e.velocity};let o=0,r=n.length-1;for(;o<r-1;){const m=Math.floor((o+r)/2);n[m].time<=t?o=m:r=m}const s=n[o],c=n[r],a=(t-s.time)/(c.time-s.time);return{position:s.position+(c.position-s.position)*a,velocity:s.velocity+(c.velocity-s.velocity)*a}}function it(n,t){return n.map(i=>t(i.position))}function et(n){const{element:t,from:i,to:e,spring:o,velocity:r=0,style:s,onComplete:c,onStart:a}=n,m=tt(i,e,o,r);if(m.length===0)return a==null||a(),c(),{stop:()=>{},getPosition:()=>e,getVelocity:()=>0,isRunning:()=>!1};const h=it(m,s),u=m[m.length-1],g=u.time,l=t.animate(h,{duration:g,fill:"forwards",easing:"linear"});let w=!0;const d=performance.now();return a==null||a(),l.onfinish=()=>{w&&(w=!1,c())},{stop:()=>{w&&(w=!1,l.cancel())},getPosition:()=>{if(!w)return u.position;const f=performance.now()-d;return L(m,f).position},getVelocity:()=>{if(!w)return 0;const f=performance.now()-d;return L(m,f).velocity},isRunning:()=>w}}function nt(n){const{from:t,to:i,spring:e,velocity:o,onComplete:r,onStart:s,tick:c,css:a}=n;if(c&&a)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!a?(s==null||s(),r(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1}):a?et({element:a.element,from:t,to:i,spring:e,velocity:o,style:a.style,onComplete:r,onStart:s}):Z({from:t,to:i,spring:e,velocity:o,onUpdate:c,onComplete:r,onStart:s})}class b{constructor(t){p(this,"options");p(this,"controls",null);p(this,"isAnimating",!1);p(this,"currentValue");p(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=nt({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{type:"single",position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,i){const e=new b(i);return e.setValue(t.position),e.setVelocity(t.velocity),e}}class _{constructor(t){p(this,"config");p(this,"animators",new Map);p(this,"springOrder",[]);p(this,"completedCount",0);p(this,"completedAnimators",new Set);p(this,"direction","forward");p(this,"idCounter",0);p(this,"timeoutIds",[]);this.config=t,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),e=new b({from:t.from,to:t.to,spring:t.spring,tick:t.tick,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:e,startTime:null}),this.springOrder.push(i)})}normalizeSchedule(t){const i=this.config.schedule??"overlap";return this.springOrder.map((e,o)=>{const r=this.animators.get(e);if(!r)throw new Error(`AnimationScheduler: animator with id "${e}" not found`);if(i==="overlap")return{type:"offset",id:e,delay:0};if(i==="wait")return t==="forward"&&o===0?{type:"offset",id:e,delay:0}:t==="backward"&&o===this.springOrder.length-1?{type:"offset",id:e,delay:0}:{type:"wait",id:e};const s=r.item.offset??0;if(t==="forward")return{type:"offset",id:e,delay:s};const c=Math.max(...Array.from(this.animators.values()).map(a=>a.item.offset??0));return{type:"offset",id:e,delay:c-s}})}onAnimatorComplete(t){var e,o,r,s,c,a;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(e=i.item).onComplete)==null||o.call(e),(s=(r=this.config).onProgress)==null||s.call(r,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((a=(c=this.config).onEnd)==null||a.call(c)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const i=this.springOrder.indexOf(t);if(this.direction==="forward"){const e=this.springOrder[i+1];if(e){const o=this.animators.get(e);o&&o.startTime===null&&this.startAnimator(e)}}else{const e=this.springOrder[i-1];if(e){const o=this.animators.get(e);o&&o.startTime===null&&this.startBackwardAnimator(e)}}}startAnimator(t){const i=this.animators.get(t);!i||i.startTime!==null||(i.startTime=Date.now(),i.animator.forward())}startBackwardAnimator(t){const i=this.animators.get(t);!i||i.startTime!==null||(i.startTime=Date.now(),i.animator.backward())}forward(){var i,e;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),(e=(i=this.config).onStart)==null||e.call(i),this.normalizeSchedule("forward").forEach(o=>{if(o.type!=="wait")if(o.delay===0)this.startAnimator(o.id);else{const r=window.setTimeout(()=>this.startAnimator(o.id),o.delay);this.timeoutIds.push(r)}})}backward(){var i,e;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),(e=(i=this.config).onStart)==null||e.call(i),this.normalizeSchedule("backward").forEach(o=>{if(o.type!=="wait")if(o.delay===0)this.startBackwardAnimator(o.id);else{const r=window.setTimeout(()=>this.startBackwardAnimator(o.id),o.delay);this.timeoutIds.push(r)}})}stop(){this.timeoutIds.forEach(t=>clearTimeout(t)),this.timeoutIds=[],this.animators.forEach(t=>{t.animator.stop(),t.startTime=null})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(t.startTime===null)return;const i=t.animator.getCurrentState();if(i.type!=="single")return;if(i.position===i.to){const o=b.fromState({position:1,velocity:0},{from:t.item.to??1,to:t.item.from??0,spring:t.item.spring,tick:t.item.tick,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.forward(),t.animator=o}else t.animator.reverse()})}getCurrentState(){return{type:"multi",completed:this.completedCount,total:this.config.springs.length,direction:this.direction}}}const V=Symbol.for("TRANSITION_STRATEGY"),W=n=>({runIn:async t=>{const{currentAnimation:i}=n;if(i&&i.direction==="out"){const s=i.controller.getCurrentState();if(i.controller.stop(),s.type==="multi")return i.controller.reverse(),{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if(t.out){const c=await t.out,{from:a=1,to:m=0}=c;return{config:c,state:{position:s.position,velocity:s.velocity},from:a,to:m,direction:"backward"}}}const e=await t.in;if(!e)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in e)return{config:e,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:o=0,to:r=1}=e;return{config:e,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}},runOut:async t=>{const{currentAnimation:i}=n;if(i&&i.direction==="in"){const s=i.controller.getCurrentState();if(i.controller.stop(),s.type==="multi")return i.controller.reverse(),{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if(t.in){const c=await t.in,{from:a=0,to:m=1}=c;return{config:c,state:{position:s.position,velocity:s.velocity},from:a,to:m,direction:"backward"}}}const e=await t.out;if(!e)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in e)return{config:e,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:o=1,to:r=0}=e;return{config:e,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}}}),X=()=>({runIn:async n=>{const t=await n.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in t)return{config:t,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:i=0,to:e=1}=t;return{config:t,state:{position:i,velocity:0},from:i,to:e,direction:"forward"}},runOut:async n=>{const t=await n.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in t)return{config:t,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:i=1,to:e=0}=t;return{config:t,state:{position:i,velocity:0},from:i,to:e,direction:"forward"}}});function ot(n,t){var h;let i=null,e=null,o=null,r=null;const s={get currentAnimation(){return i}},c=((h=t==null?void 0:t.strategy)==null?void 0:h.call(t,s))||W(s),a=async u=>{var S,T,A;e&&(e.remove(),e=null);const g=n(),l=g.in&&await g.in(u),w=!(t!=null&&t.strategy)&&g.out?g.out(u):void 0;if(!l)return;if(k.isMultiSpring(l)){const v={in:Promise.resolve(l),out:w&&Promise.resolve(w)};if(!(await c.runIn(v)).config){i&&(i.direction="in");return}(S=l.prepare)==null||S.call(l,u),l.wait&&await l.wait();const C=new _({...l,onEnd:()=>{var P;i=null,(P=l.onEnd)==null||P.call(l)}});i={controller:C,direction:"in"},C.forward();return}const d={in:Promise.resolve(l),out:w&&Promise.resolve(w)},f=await c.runIn(d);if(!f.config||"springs"in f.config)return;(A=(T=f.config).prepare)==null||A.call(T,u),f.config.wait&&await f.config.wait();const y=b.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,tick:f.config.tick,css:f.config.css?{element:u,style:f.config.css}:void 0,onStart:f.config.onStart,onComplete:()=>{var v,E;i=null,(E=(v=f.config)==null?void 0:v.onEnd)==null||E.call(v)}});i={controller:y,direction:"in"},f.direction==="forward"?y.forward():y.backward()},m=async u=>{var S,T,A;e=u;const g=n(),l=g.out&&await g.out(u);if(!l)return;if(k.isMultiSpring(l)){const v={in:void 0,out:Promise.resolve(l)};if(!(await c.runOut(v)).config){i&&(i.direction="out"),e&&(e.remove(),e=null);return}(S=l.prepare)==null||S.call(l,u),y(),l.wait&&await l.wait();const C=new _({...l,onEnd:()=>{var P,D;(P=l.onEnd)==null||P.call(l),e&&(e.remove(),e=null),i=null,(D=t==null?void 0:t.onCleanupEnd)==null||D.call(t)}});i={controller:C,direction:"out"},C.forward();return}const w={in:void 0,out:Promise.resolve(l)},d=await c.runOut(w);if(!d.config||"springs"in d.config)return;(A=(T=d.config).prepare)==null||A.call(T,u),y(),d.config.wait&&await d.config.wait();const f=b.fromState(d.state,{from:d.from,to:d.to,spring:d.config.spring,tick:d.config.tick,css:d.config.css?{element:u,style:d.config.css}:void 0,onStart:d.config.onStart,onComplete:()=>{var v,E,C;(E=(v=d.config)==null?void 0:v.onEnd)==null||E.call(v),e&&(e.remove(),e=null),i=null,(C=t==null?void 0:t.onCleanupEnd)==null||C.call(t)}});i={controller:f,direction:"out"},d.direction==="forward"?f.forward():f.backward();function y(){!o||!e||(r&&o.contains(r)?o.insertBefore(e,r):o.appendChild(e))}};return u=>{if(u)return o=u.parentElement,r=u.nextElementSibling,a(u),()=>{if(u.isConnected){const g=u.cloneNode(!0);m(g)}else m(u)}}}const rt=3,st=n=>{if(!n)return null;const t=n.split(`
|
|
2
|
-
`).map(
|
|
1
|
+
"use strict";var K=Object.defineProperty;var W=(n,i,t)=>i in n?K(n,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[i]=t;var d=(n,i,t)=>W(n,typeof i!="symbol"?i+"":i,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./types.cjs"),U=require("./jaemin-BG8HRXG1.cjs");class G{constructor(){d(this,"listeners",new Set);d(this,"rafId",null);d(this,"isRunning",!1);d(this,"startTime",Date.now());d(this,"lastUpdate",this.startTime);d(this,"elapsed",0);d(this,"lagThreshold",500);d(this,"adjustedLag",33);d(this,"maxDeltaTime",33);d(this,"gap",1e3/240);d(this,"nextTime",this.gap);d(this,"tick",()=>{const i=Date.now();let e=i-this.lastUpdate;e>this.lagThreshold||e<0?(this.startTime+=e-this.adjustedLag,e=this.adjustedLag):e>this.maxDeltaTime&&(e=this.maxDeltaTime),this.lastUpdate=i;const r=i-this.startTime,o=r-this.nextTime;if(o>0){const s=e/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(c=>{c(s,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(i){return this.listeners.add(i),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(i)}}unsubscribe(i){this.listeners.delete(i),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(i,t){this.lagThreshold=i,this.adjustedLag=Math.min(t,i)}fps(i){this.gap=1e3/i,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const P=new G;function L(n){const i=n.stiffness,t=n.damping,e=1,r=Math.sqrt(i/e),o=t/(2*Math.sqrt(i*e));return{omega:r,zeta:o}}function _(n,i,t,e){const{omega:r,zeta:o}=t,{position:s,velocity:c}=n,a=Math.min(e,.033),u=-2*a*o*r*c,h=a*r*r*(i-s),l=c+u+h;return{position:s+a*l,velocity:l}}const B=.01,J=.01,N=.05;function H(n,i){const t=Math.abs(i-n.position),e=Math.abs(n.velocity);return t<B&&e<J}function Q(n){const{from:i,to:t,spring:e,velocity:r=0,onUpdate:o,onComplete:s,onStart:c}=n;let a={position:i,velocity:r},u=!0,h=0,l=!1;const g=L(e),w=p=>{if(u){if(l||(l=!0,c==null||c()),a=_(a,t,g,p),H(a,t)){if(h+=Math.min(p,.033),h>=N){a={position:t,velocity:0},u=!1,o(a.position),P.unsubscribe(w),s();return}}else h=0;o(a.position)}};return P.subscribe(w),{stop:()=>{u&&(u=!1,P.unsubscribe(w))},getPosition:()=>a.position,getVelocity:()=>a.velocity,isRunning:()=>u}}const V=1e3/60;function Z(n,i,t,e=0){const r=L(t),o=600;let s={position:n,velocity:e},c=0;const a=[];for(let u=0;u<o;u++){const h=u*V;if(a.push({time:h,position:s.position,velocity:s.velocity}),s=_(s,i,r,V/1e3),H(s,i)){if(c+=V/1e3,c>=N){a.push({time:(u+1)*V,position:i,velocity:0});break}}else c=0}return a}function F(n,i){if(n.length===0)return{position:0,velocity:0};const t=n[0],e=n[n.length-1];if(i<=0)return{position:t.position,velocity:t.velocity};if(i>=e.time)return{position:e.position,velocity:e.velocity};let r=0,o=n.length-1;for(;r<o-1;){const u=Math.floor((r+o)/2);n[u].time<=i?r=u:o=u}const s=n[r],c=n[o],a=(i-s.time)/(c.time-s.time);return{position:s.position+(c.position-s.position)*a,velocity:s.velocity+(c.velocity-s.velocity)*a}}function tt(n,i){return n.map(t=>i(t.position))}function et(n){const{element:i,from:t,to:e,spring:r,velocity:o=0,style:s,onComplete:c,onStart:a}=n,u=Z(t,e,r,o);if(u.length===0)return a==null||a(),c(),{stop:()=>{},getPosition:()=>e,getVelocity:()=>0,isRunning:()=>!1};const h=tt(u,s),l=u[u.length-1],g=l.time,w=i.animate(h,{duration:g,fill:"forwards",easing:"linear"});let p=!0;const y=performance.now();return a==null||a(),w.onfinish=()=>{p&&(p=!1,c())},{stop:()=>{p&&(p=!1,w.cancel())},getPosition:()=>{if(!p)return l.position;const m=performance.now()-y;return F(u,m).position},getVelocity:()=>{if(!p)return 0;const m=performance.now()-y;return F(u,m).velocity},isRunning:()=>p}}function it(n){const{from:i,to:t,spring:e,velocity:r,onComplete:o,onStart:s,tick:c,css:a}=n;if(c&&a)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!a?(s==null||s(),o(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):a?et({element:a.element,from:i,to:t,spring:e,velocity:r,style:a.style,onComplete:o,onStart:s}):Q({from:i,to:t,spring:e,velocity:r,onUpdate:c,onComplete:o,onStart:s})}class q{}class k extends q{constructor(t){super();d(this,"options");d(this,"controls",null);d(this,"isAnimating",!1);d(this,"currentValue");d(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=it({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,e){const r=new k(e);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class M extends q{constructor(t){super();d(this,"config");d(this,"animators",new Map);d(this,"springOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(this,"rafId",null);d(this,"element");d(this,"from");d(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.element=t.element,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const e=this.generateId(),r=new k({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css&&this.element?{element:this.element,style:t.css}:void 0,onComplete:()=>this.onAnimatorComplete(e),onStart:t.onStart});this.animators.set(e,{id:e,item:t,animator:r,started:!1}),this.springOrder.push(e)})}getAnimatorProgress(t){const e=t.animator.getCurrentState(),r=Math.abs(e.to-e.from);return r===0?1:Math.abs(e.position-e.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,o,s,c,a,u;const e=this.animators.get(t);!e||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=e.item).onComplete)==null||o.call(r),(c=(s=this.config).onProgress)==null||c.call(s,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(u=(a=this.config).onEnd)==null||u.call(a)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let e=0;e<t.length;e++){const r=t[e],o=this.animators.get(r);if(!o||o.started)continue;if(e===0){this.startAnimator(r);continue}const s=t[e-1],c=this.animators.get(s);if(!c||!c.started)continue;const a=this.getAnimatorProgress(c),u=o.item.normalizedOffset;a>=u&&this.startAnimator(r)}}startAnimator(t){const e=this.animators.get(t);!e||e.started||(e.started=!0,this.direction==="forward"?e.animator.forward():e.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};this.rafId=requestAnimationFrame(t)}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var e;const t=this.springOrder[0];return t?((e=this.animators.get(t))==null?void 0:e.animator)??null:null}forward(){var t,e;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(e=(t=this.config).onStart)==null||e.call(t),this.startScheduler()}backward(){var t,e;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(e=(t=this.config).onStart)==null||e.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const e=t.animator.getCurrentState();if(e.position===e.to){const o=t.item.css&&this.element?{element:this.element,style:t.item.css}:void 0,s=k.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:o,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});s.forward(),t.animator=s}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const e=this.getFirstAnimator();e==null||e.setValue(t)}setVelocity(t){const e=this.getFirstAnimator();e==null||e.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,e){const r=new M(e);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const O=Symbol.for("TRANSITION_STRATEGY"),Y=n=>({runIn:async i=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),i.out)return{config:i.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}const e=i.in;return e?{config:e,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async i=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),i.in)return{config:i.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}const e=i.out;return e?{config:e,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),j=()=>({runIn:async n=>{const i=n.in;return i?{config:i,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async n=>{const i=n.out;return i?{config:i,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}});function nt(n,i){var h;let t=null,e=null,r=null,o=null;const s={get currentAnimation(){return t}},c=((h=i==null?void 0:i.strategy)==null?void 0:h.call(i,s))||Y(s),a=async l=>{var A;e&&(e.remove(),e=null);const g=n(),w=g.in&&await g.in(l),p=!(i!=null&&i.strategy)&&g.out?await g.out(l):void 0;if(!w)return;const y={in:S.normalizeToMultiSpring(w),out:p?S.normalizeToMultiSpring(p):void 0},m=await c.runIn(y);if(!m.config){t&&(t.direction="in");return}const f=m.config;(A=f.prepare)==null||A.call(f,l),f.wait&&await f.wait();const C=S.normalizeMultiSpringSchedule({...f,onEnd:()=>{var T;t=null,(T=f.onEnd)==null||T.call(f)}}),v=M.fromState(m.state,{config:C,from:m.from,to:m.to,element:l});t={controller:v,direction:"in"},m.direction==="forward"?v.forward():v.backward()},u=async l=>{var T;e=l;const g=n(),w=!(i!=null&&i.strategy)&&g.in?await g.in(l):void 0,p=g.out&&await g.out(l);if(!p)return;const y={in:w?S.normalizeToMultiSpring(w):void 0,out:S.normalizeToMultiSpring(p)},m=await c.runOut(y);if(!m.config){t&&(t.direction="out"),e&&(e.remove(),e=null);return}const f=m.config;(T=f.prepare)==null||T.call(f,l),A(),f.wait&&await f.wait();const C=S.normalizeMultiSpringSchedule({...f,onEnd:()=>{var I,E;(I=f.onEnd)==null||I.call(f),e&&(e.remove(),e=null),t=null,(E=i==null?void 0:i.onCleanupEnd)==null||E.call(i)}}),v=M.fromState(m.state,{config:C,from:m.from,to:m.to,element:l});t={controller:v,direction:"out"},m.direction==="forward"?v.forward():v.backward();function A(){!r||!e||(o&&r.contains(o)?r.insertBefore(e,o):r.appendChild(e))}};return l=>{if(l)return r=l.parentElement,o=l.nextElementSibling,a(l),()=>{if(l.isConnected){const g=l.cloneNode(!0);u(g)}else u(l)}}}const ot=3,rt=n=>{if(!n)return null;const i=n.split(`
|
|
2
|
+
`).map(t=>t.trim());for(let t=ot;t<Math.min(i.length,6);t++){const e=i[t],r=e==null?void 0:e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const o=r[1]??"",s=r[2]??"0",c=r[3]??"0";return{file:o.split(/[\\/]/).pop()||o,line:s,column:c}}return null},R=new Map,x=new Map;function st(n,i,t){R.set(n,i);let e=x.get(n);return e||(e=nt(()=>{const r=R.get(n);return r||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:t,onCleanupEnd:()=>X(n)}),x.set(n,e),e)}function X(n){R.delete(n),x.delete(n)}function $(){const n=rt(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const z=globalThis.FinalizationRegistry,D=z?new z(n=>{try{X(n)}catch{}}):void 0;function at(n){const i=n.key??$();if(n.ref&&D)try{D.register(n.ref,i)}catch{}return st(i,{in:n.in,out:n.out},n[O])}function ct(n){const i=n.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...n,...i]}function lt(n){let i=!1,t=0,e=0,r=!1;const o=50,s=p=>{if(!n)return;const y=p.touches[0];y&&(r=y.clientX<o,r&&(t=y.clientX,e=y.clientY))},c=p=>{if(!n||!r)return;const y=p.touches[0];if(!y)return;const m=y.clientX-t,f=y.clientY-e;m>window.outerWidth/2-5&&Math.abs(m)>Math.abs(f)?i=!0:i=!1},a=()=>{n&&(r=!1,t=0,e=0)},u=()=>i,h=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",s,{passive:!0}),window.addEventListener("touchmove",c,{passive:!0}),window.addEventListener("touchend",a,{passive:!0}))},l=()=>{typeof window>"u"||(window.removeEventListener("touchstart",s),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",a))};let g=0;return{initialize:h,cleanup:l,isSwipePending:u,resetSwipeDetection:()=>{g++,g>1&&(g=0,i=!1)}}}const ut=n=>{let i=n.parentElement;for(;i&&i!==document.body;){const t=window.getComputedStyle(i),e=t.overflow+t.overflowY+t.overflowX;if(e.includes("auto")||e.includes("scroll")||i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth)return i;i=i.parentElement}return document.documentElement},ft=n=>{let i=n.parentElement;for(;i&&i!==document.body;){const t=window.getComputedStyle(i).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return i;i=i.parentElement}return document.body};function mt(){let n=null,i=null;const t=new Map;let e=null;const r=()=>{n&&e&&t.set(e,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(h,l)=>{i=h,n||(n=ut(h),(n===document.documentElement?window:n).addEventListener("scroll",r,{passive:!0})),e=l},calculateScrollOffset:(h,l)=>{const g=h&&t.has(h)?t.get(h):{x:0,y:0},w=l&&t.has(l)?t.get(l):{x:0,y:0};return{x:-w.x+g.x,y:-w.y+g.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>i?ft(i):document.body,getScrollPosition:h=>h&&t.has(h)?t.get(h):{x:0,y:0}}}function b(n,i){if(i==="*")return!0;if(i.endsWith("/*")){const t=i.slice(0,-2);return n===t||n.startsWith(t+"/")}return n===i}function dt(n,i,t){for(const e of t)if(b(n,e.from)&&b(i,e.to))return e.transition;for(const e of t)if((e.from==="*"||b(n,e.from))&&(e.to==="*"||b(i,e.to)))return e.transition;return null}function ht(n){const{transitions:i=[],defaultTransition:t,middleware:e=(m,f)=>({from:m,to:f}),skipOnIosSwipe:r=!0}=n;let o=null;const s=ct(i),{initializeContext:c,calculateScrollOffset:a,getScrollContainer:u,getPositionedParentElement:h,getScrollPosition:l}=mt(),g=lt(r);g.initialize();function w(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:m,to:f}=e(o.from,o.to),v=dt(m,f,s)||t,A=a(o.from,o.to),T={scrollOffset:A,scroll:l(o.from),get scrollingElement(){return u()||document.documentElement},get positionedParent(){return h()}},I={scrollOffset:A,get scroll(){return o?l(o.to):{x:0,y:0}},get scrollingElement(){return u()||document.documentElement},get positionedParent(){return h()}};v&&(v.out&&o.outResolve&&o.outResolve(E=>v.out(E,T)),v.in&&o.inResolve&&o.inResolve(E=>v.in(E,I))),o=null}}const p=async(m,f)=>g.isSwipePending()?(g.resetSwipeDetection(),()=>({})):f==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),f==="out"?(o.from=m,new Promise(C=>{o.outResolve=C,w()})):(o.to=m,new Promise(C=>{o.inResolve=C,w()})));return m=>({key:m,in:async f=>(c(f,m),(await p(m,"in"))(f)),out:async f=>(await p(m,"out"))(f),[O]:j})}exports.isCssAnimation=S.isCssAnimation;exports.isMultiSpring=S.isMultiSpring;exports.isSingleSpring=S.isSingleSpring;exports.isTickAnimation=S.isTickAnimation;exports.normalizeMultiSpringSchedule=S.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=S.normalizeToMultiSpring;exports.validateAnimationMode=S.validateAnimationMode;exports.validateSpringItem=S.validateSpringItem;exports.jaeminInternal=U.jaeminInternal;exports.TRANSITION_STRATEGY=O;exports.createDefaultStrategy=Y;exports.createPageTransitionStrategy=j;exports.createSggoiTransitionContext=ht;exports.generateAutoKey=$;exports.transition=at;
|