@ssgoi/core 5.0.2 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/animator/runner/keyframes-runner.d.ts +14 -0
- package/dist/animator/runner/keyframes-runner.d.ts.map +1 -0
- package/dist/animator/runner/provider.d.ts +12 -3
- package/dist/animator/runner/provider.d.ts.map +1 -1
- package/dist/animator/single-animator.d.ts +7 -0
- package/dist/animator/single-animator.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +636 -506
- package/dist/{provider-Cu4NSF1Q.js → provider-B2B8CK6H.js} +37 -62
- package/dist/provider-BKaONTeg.cjs +1 -0
- package/dist/spring-integrator-95Mh7mdw.cjs +1 -0
- package/dist/spring-integrator-BM4a-82c.js +33 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +2 -2
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/create-swipe-back-detector.d.ts +43 -0
- package/dist/ssgoi-transition/create-swipe-back-detector.d.ts.map +1 -0
- package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +2 -2
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.js +33 -32
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +77 -73
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +44 -36
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/view-transitions/film.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +884 -775
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/provider-Cs5iBqRD.cjs +0 -1
- package/dist/ssgoi-transition/create-navigation-direction-detector.d.ts +0 -20
- package/dist/ssgoi-transition/create-navigation-direction-detector.d.ts.map +0 -1
- package/dist/utils/is-android.d.ts +0 -5
- package/dist/utils/is-android.d.ts.map +0 -1
- package/dist/utils/is-desktop.d.ts +0 -5
- package/dist/utils/is-desktop.d.ts.map +0 -1
- package/dist/utils/is-ios.d.ts +0 -6
- package/dist/utils/is-ios.d.ts.map +0 -1
- package/dist/utils/match-platform.d.ts +0 -8
- package/dist/utils/match-platform.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/multi-animator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EACV,8BAA8B,EAE9B,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,8BAA8B,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IACzC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,SAAS,CAAgB;IACjC,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,IAAI,CAAS;IACrB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAyC;IAE7D,OAAO;IAYP,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;
|
|
1
|
+
{"version":3,"file":"multi-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/multi-animator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EACV,8BAA8B,EAE9B,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,8BAA8B,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IACzC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,SAAS,CAAgB;IACjC,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,IAAI,CAAS;IACrB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAyC;IAE7D,OAAO;IAYP,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAmC3B;;;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;IAkCf,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,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,GAC3C,aAAa;CAGjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnimationControls } from './types';
|
|
2
|
+
export interface KeyframesRunnerOptions {
|
|
3
|
+
element: HTMLElement;
|
|
4
|
+
frames: Keyframe[];
|
|
5
|
+
duration: number;
|
|
6
|
+
easing?: string;
|
|
7
|
+
/** Reported as getPosition() at the end of the animation */
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
onComplete: () => void;
|
|
11
|
+
onStart?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function runKeyframesAnimation(options: KeyframesRunnerOptions): AnimationControls;
|
|
14
|
+
//# sourceMappingURL=keyframes-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/runner/keyframes-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,iBAAiB,CAqEnB"}
|
|
@@ -6,12 +6,21 @@ export type RunnerOptions = {
|
|
|
6
6
|
element: HTMLElement;
|
|
7
7
|
style: (progress: number) => StyleObject;
|
|
8
8
|
};
|
|
9
|
+
keyframes?: {
|
|
10
|
+
element: HTMLElement;
|
|
11
|
+
frames: Keyframe[];
|
|
12
|
+
duration: number;
|
|
13
|
+
easing?: string;
|
|
14
|
+
};
|
|
9
15
|
};
|
|
10
16
|
/**
|
|
11
17
|
* Common options passed to bound runner
|
|
18
|
+
*
|
|
19
|
+
* `integrator` is required for tick/css mode and unused for keyframes mode
|
|
20
|
+
* (which has its motion pre-baked).
|
|
12
21
|
*/
|
|
13
22
|
export interface BoundRunnerOptions {
|
|
14
|
-
integrator
|
|
23
|
+
integrator?: Integrator;
|
|
15
24
|
from: number;
|
|
16
25
|
to: number;
|
|
17
26
|
velocity?: number;
|
|
@@ -26,9 +35,9 @@ export declare class RunnerProvider {
|
|
|
26
35
|
/**
|
|
27
36
|
* Get bound runner based on animation mode
|
|
28
37
|
*
|
|
29
|
-
* @param options Animation mode options
|
|
38
|
+
* @param options Animation mode options — exactly one of tick / css / keyframes
|
|
30
39
|
* @returns Bound runner function (empty runner if no animation mode specified)
|
|
31
|
-
* @throws Error if
|
|
40
|
+
* @throws Error if more than one mode is provided
|
|
32
41
|
*/
|
|
33
42
|
static from(options: RunnerOptions): BoundRunner;
|
|
34
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/runner/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/runner/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;IACF,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,WAAW,CAAC;QACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;AAqB7E,qBAAa,cAAc;IACzB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW;CA6DjD"}
|
|
@@ -11,6 +11,12 @@ export interface AnimatorOptions {
|
|
|
11
11
|
element: HTMLElement;
|
|
12
12
|
style: (progress: number) => StyleObject;
|
|
13
13
|
};
|
|
14
|
+
keyframes?: {
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
frames: Keyframe[];
|
|
17
|
+
duration: number;
|
|
18
|
+
easing?: string;
|
|
19
|
+
};
|
|
14
20
|
onComplete?: () => void;
|
|
15
21
|
onStart?: () => void;
|
|
16
22
|
}
|
|
@@ -31,6 +37,7 @@ export declare class SingleAnimator extends Animator {
|
|
|
31
37
|
private currentValue;
|
|
32
38
|
private currentVelocity;
|
|
33
39
|
private updateFn;
|
|
40
|
+
private isKeyframesMode;
|
|
34
41
|
constructor(options: AnimatorOptions);
|
|
35
42
|
/**
|
|
36
43
|
* Sync element state to current progress value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/single-animator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,YAAY,EAAE,WAAW,EAAE,CAAC;AAK5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,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;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,OAAO,CAAC,OAAO,CAMb;IACF,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,QAAQ,CAA6B;
|
|
1
|
+
{"version":3,"file":"single-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/single-animator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,YAAY,EAAE,WAAW,EAAE,CAAC;AAK5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,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,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,WAAW,CAAC;QACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,OAAO,CAAC,OAAO,CAMb;IACF,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,eAAe,CAAU;gBAErB,OAAO,EAAE,eAAe;IAsCpC;;;OAGG;IACH,SAAS,IAAI,IAAI;IAIjB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiBxB,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;CAG1D"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ct=Object.defineProperty;var lt=(e,n,t)=>n in e?ct(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var f=(e,n,t)=>lt(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./types.cjs"),D=require("./provider-Cs5iBqRD.cjs");class ut{constructor(){f(this,"listeners",new Set);f(this,"rafId",null);f(this,"isRunning",!1);f(this,"startTime",Date.now());f(this,"lastUpdate",this.startTime);f(this,"elapsed",0);f(this,"lagThreshold",500);f(this,"adjustedLag",33);f(this,"maxDeltaTime",33);f(this,"gap",1e3/240);f(this,"nextTime",this.gap);f(this,"tick",()=>{const n=Date.now();let i=n-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=n;const r=n-this.startTime,o=r-this.nextTime;if(o>0){const l=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(u=>{u(l,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(n){return this.listeners.add(n),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(n)}}unsubscribe(n){this.listeners.delete(n),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(n,t){this.lagThreshold=n,this.adjustedLag=Math.min(t,n)}fps(n){this.gap=1e3/n,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const N=new ut;function ft(e){const{integrator:n,from:t,to:i,velocity:r=0,onUpdate:o,onComplete:l,onStart:u}=e;let s={position:t,velocity:r},c=!0,d=0,w=!1;const C=E=>{if(c){if(w||(w=!0,u==null||u()),s=n.step(s,i,E),n.isSettled(s,i)){if(d+=Math.min(E,.033),d>=D.SETTLE_THRESHOLD){s={position:i,velocity:0},c=!1,o(s.position),N.unsubscribe(C),l();return}}else d=0;o(s.position)}};return N.subscribe(C),{stop:()=>{c&&(c=!1,N.unsubscribe(C))},getPosition:()=>s.position,getVelocity:()=>s.velocity,isRunning:()=>c}}const F=1e3/60;function dt(e,n,t,i=0){let o={position:n,velocity:i},l=0;const u=[];for(let s=0;s<600;s++){const c=s*F;if(u.push({time:c,position:o.position,velocity:o.velocity}),o=e.step(o,t,F/1e3),e.isSettled(o,t)){if(l+=F/1e3,l>=D.SETTLE_THRESHOLD){u.push({time:(s+1)*F,position:t,velocity:0});break}}else l=0}return u}function X(e,n){if(e.length===0)return{position:0,velocity:0};const t=e[0],i=e[e.length-1];if(n<=0)return{position:t.position,velocity:t.velocity};if(n>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=e.length-1;for(;r<o-1;){const c=Math.floor((r+o)/2);e[c].time<=n?r=c:o=c}const l=e[r],u=e[o],s=(n-l.time)/(u.time-l.time);return{position:l.position+(u.position-l.position)*s,velocity:l.velocity+(u.velocity-l.velocity)*s}}function mt(e,n){return e.map(t=>n(t.position))}function ht(e){const{integrator:n,element:t,from:i,to:r,velocity:o=0,style:l,onComplete:u,onStart:s}=e,c=dt(n,i,r,o);if(c.length===0)return s==null||s(),u(),{stop:()=>{},getPosition:()=>r,getVelocity:()=>0,isRunning:()=>!1};const d=mt(c,l),w=c[c.length-1],C=w.time,E=d[0];if(E)for(const A of Object.keys(E))t.style[A]="";const y=t.animate(d,{duration:C,fill:"forwards",easing:"linear",composite:"replace"});let p=!0;const b=performance.now();return s==null||s(),y.onfinish=()=>{p&&(p=!1,u())},{stop:()=>{p&&(p=!1,y.cancel())},getPosition:()=>{if(!p)return w.position;const A=performance.now()-b;return X(c,A).position},getVelocity:()=>{if(!p)return 0;const A=performance.now()-b;return X(c,A).velocity},isRunning:()=>p}}function gt(e){const{to:n,onStart:t,onComplete:i}=e;return t==null||t(),i(),{stop:()=>{},getPosition:()=>n,getVelocity:()=>0,isRunning:()=>!1}}class yt{static from(n){const{tick:t,css:i}=n;if(t&&i)throw new Error("Cannot use both 'tick' and 'css' options together");return i?r=>ht({...r,element:i.element,style:i.style}):t?r=>ft({...r,onUpdate:t}):gt}}class J{}const pt={stiffness:300,damping:30};class K extends J{constructor(t){super();f(this,"options");f(this,"runner");f(this,"controls",null);f(this,"isAnimating",!1);f(this,"currentValue");f(this,"currentVelocity",0);f(this,"updateFn");if(this.options={from:t.from??0,to:t.to??1,physics:t.physics,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,t.tick)this.updateFn=i=>{var r;return(r=t.tick)==null?void 0:r.call(t,i)};else if(t.css){const{element:i,style:r}=t.css;this.updateFn=o=>{const l=r(o);for(const[u,s]of Object.entries(l))i.style[u]=typeof s=="number"?String(s):s}}else this.updateFn=()=>{};this.runner=yt.from({tick:t.tick,css:t.css})}syncState(){var t;(t=this.updateFn)==null||t.call(this,this.currentValue)}createIntegrator(){const t=this.options.physics;return t!=null&&t.integrator?t.integrator():t!=null&&t.spring||t!=null&&t.inertia?D.IntegratorProvider.from({spring:t.spring,inertia:t.inertia}):new D.SpringIntegrator(pt)}runAnimation(t){this.isAnimating=!0,this.controls=this.runner({integrator:this.createIntegrator(),from:this.currentValue,to:t,velocity:this.currentVelocity,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}}}class L extends J{constructor(t){super();f(this,"config");f(this,"animators",new Map);f(this,"itemOrder",[]);f(this,"completedCount",0);f(this,"completedAnimators",new Set);f(this,"direction","forward");f(this,"idCounter",0);f(this,"rafId",null);f(this,"from");f(this,"to");f(this,"initialState");this.config=t.config,this.from=t.from,this.to=t.to,this.initialState=t.state??{position:t.from,velocity:0},this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.items.forEach((t,i)=>{const r=this.generateId(),o=new K({from:this.from,to:this.to,physics:t.physics,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(r),onStart:t.onStart});(i===0||t.normalizedOffset===0)&&(o.setValue(this.initialState.position),o.setVelocity(this.initialState.velocity),o.syncState()),this.animators.set(r,{id:r,item:t,animator:o,started:!1}),this.itemOrder.push(r)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.itemOrder:[...this.itemOrder].reverse()}onAnimatorComplete(t){var r,o,l,u,s,c;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=i.item).onComplete)==null||o.call(r),(u=(l=this.config).onProgress)==null||u.call(l,this.completedCount,this.config.items.length),this.completedCount===this.config.items.length&&(this.stopScheduler(),(c=(s=this.config).onEnd)==null||c.call(s)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],o=this.animators.get(r);if(!o||o.started)continue;if(i===0){this.startAnimator(r);continue}const l=t[i-1],u=this.animators.get(l);if(!u||!u.started)continue;const s=this.getAnimatorProgress(u),c=o.item.normalizedOffset;s>=c&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.itemOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.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 i=t.animator.getCurrentState();if(i.position===i.to){const o=new K({from:this.to,to:this.from,physics:t.item.physics,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.setValue(this.to),o.setVelocity(0),o.syncState(),o.forward(),t.animator=o}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 i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){return new L({...i,state:t})}}const j=Symbol.for("TRANSITION_STRATEGY"),Q=e=>({runIn:async n=>{const{currentAnimation:t}=e;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.out)return{config:await n.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return n.in?{config:await n.in,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{currentAnimation:t}=e;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.in)return{config:await n.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),Z=()=>({runIn:async e=>e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async e=>e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),H="data-ssgoi-scope",G="data-ssgoi-scope-ready";function wt(){return e=>{if(e)return e.setAttribute(H,""),queueMicrotask(()=>{queueMicrotask(()=>{e.setAttribute(G,"true")})}),()=>{}}}function tt(e){return e.hasAttribute(G)}function et(e){return e.closest(`[${H}]`)}const St=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.parentElement}return document.documentElement},vt=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return n;n=n.parentElement}return document.body};function $(e){return new Promise(n=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})})}function it(){return typeof window>"u"||typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}function nt(){return typeof window>"u"||typeof navigator>"u"?!1:/Android/i.test(navigator.userAgent)}function At(){return typeof window>"u"||typeof navigator>"u"?!1:!it()&&!nt()}function Tt(e){return e.length===0?!1:!!(e.includes("all")||e.includes("ios")&&it()||e.includes("android")&&nt()||e.includes("desktop")&&At())}function Ct(e,n){var E;let t=null,i=null,r=null,o=null;const l={get currentAnimation(){return t}},u=((E=n==null?void 0:n.strategy)==null?void 0:E.call(n,l))||Q(l),s=async y=>{var m,g;i&&(i.remove(),i=null);const p=e(),b=p.in&&p.in(y),A=!(n!=null&&n.strategy)&&p.out?p.out(y):void 0;if(!b)return;const I={in:k.normalizeToMultiAnimation(b),out:A?k.normalizeToMultiAnimation(A):void 0},S=await u.runIn(I);if(!S.config){t&&(t.direction="in");return}const h=S.config;(m=h.prepare)==null||m.call(h);const T=k.normalizeSchedule({...h,onEnd:()=>{var v;t=null,(v=h.onEnd)==null||v.call(h)}},y);h.wait&&await h.wait();const a=L.fromState(S.state,{config:T,from:S.from,to:S.to});t={controller:a,direction:"in"},(g=h.onReady)==null||g.call(h),await $(),S.direction==="forward"?a.forward():a.backward()},c=async y=>{var g,v;i=y;const p=e(),b=!(n!=null&&n.strategy)&&p.in?p.in(y):void 0,A=p.out&&p.out(y);if(!A)return;const I={in:b?k.normalizeToMultiAnimation(b):void 0,out:k.normalizeToMultiAnimation(A)},S=await u.runOut(I);if(!S.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const h=S.config;m(),(g=h.prepare)==null||g.call(h);const T=k.normalizeSchedule({...h,onEnd:()=>{var M,x;(M=h.onEnd)==null||M.call(h),i&&(i.remove(),i=null),t=null,(x=n==null?void 0:n.onCleanupEnd)==null||x.call(n)}},y);h.wait&&await h.wait();const a=L.fromState(S.state,{config:T,from:S.from,to:S.to});t={controller:a,direction:"out"},(v=h.onReady)==null||v.call(h),await $(),S.direction==="forward"?a.forward():a.backward();function m(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let d=null,w=!1;const C=y=>()=>{if(w)return;w=!0;const p=y.cloneNode(!0);d?queueMicrotask(()=>{document.contains(d)&&c(p)}):c(p)};return y=>{if(y)return requestAnimationFrame(()=>{r=y.parentElement,o=y.nextElementSibling}),w=!1,(n==null?void 0:n.scope)==="local"?queueMicrotask(()=>{d=et(y),!(d&&!tt(d))&&s(y)}):s(y),C(y)}}const P=new Map;let R=null,U=!1;function rt(e){if(e instanceof HTMLElement&&P.has(e)){const t=P.get(e);P.delete(e),queueMicrotask(()=>{t()})}const n=e.childNodes;for(let t=0;t<n.length;t++){const i=n[t];i&&rt(i)}}function Et(){U||typeof document>"u"||(U=!0,R=new MutationObserver(e=>{for(const n of e){const t=n.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&rt(r)}}}),document.body?R.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{R==null||R.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function ot(e,n){Et(),P.set(e,n)}function bt(e){return P.has(e)}function kt(){return P.size}function Rt(e){const n=P.get(e);return n?(P.delete(e),n(),!0):!1}function Pt(){P.clear(),R==null||R.disconnect(),R=null,U=!1}const z=new Map,W=new Map,B=new Map;function It(e,n,t){z.set(e,n);let i=W.get(e);if(i)return i;const r=n;return i=Ct(()=>{const o=z.get(e);return o||(console.warn(`Transition "${String(e)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{z.get(e)===r&&Mt(e)}}),W.set(e,i),i}function Mt(e){z.delete(e),W.delete(e),B.delete(e)}function Ot(e,n="manual"){const t=It(e.key,{in:e.in,out:e.out},{strategy:e[j],scope:e.scope});if(n==="manual")return t;let i=B.get(e.key);return i||(i=r=>{if(r){const o=t(r);o&&ot(r,o)}},B.set(e.key,i),i)}function xt(e){const n=e.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...e,...n]}function Vt(){var s;let e=typeof history<"u"?((s=history.state)==null?void 0:s.ssgoiIndex)??0:0,n="push",t=!1,i=!1;const r=c=>{var w;t=!0;const d=((w=c.state)==null?void 0:w.ssgoiIndex)??0;d<e?(n="back",i=!0):d>e&&(n="forward"),e=d};return{initialize:()=>{var c;typeof window>"u"||(window.addEventListener("popstate",r),((c=history.state)==null?void 0:c.ssgoiIndex)==null?history.replaceState({...history.state,ssgoiIndex:e},""):e=history.state.ssgoiIndex)},onPageEnter:()=>{t||(e++,history.replaceState({...history.state,ssgoiIndex:e},""));const c=n;return n="push",t=!1,setTimeout(()=>{i=!1},0),c},isBack:()=>i||n==="back"}}function O(e,n){if(n==="*")return!0;if(n.endsWith("/*")){const t=n.slice(0,-1);return e.startsWith(t)&&e.length>t.length}return e===n}function Ft(e,n,t){for(const i of t)if(O(e,i.from)&&O(n,i.to))return i.transition;for(const i of t)if((i.from==="*"||O(e,i.from))&&(i.to==="*"||O(n,i.to)))return i.transition;return null}const zt=768,Dt=10,Lt=10;function _t(e={}){const{preserveScroll:n=a=>a}=e,t=typeof n=="function"?n:()=>n;let i=null,r=!1,o=!1;const l=()=>{const a=(i==null?void 0:i.clientWidth)??0,m=a>0?a:typeof window<"u"?window.innerWidth:0;return m>0&&m<zt},u=()=>(o||(r=l(),o=!0),r),s=a=>{const m=t(u());return m===!1?!1:m===!0?!0:!m.exclude.some(g=>O(a,g))};let c=null;const d=new Map;let w=null,C=!1,E=0;const y=()=>{i&&w&&!C&&d.set(w,{x:i.scrollLeft,y:i.scrollTop})},p=a=>{if(!i)return;const m=s(a)&&d.has(a)?d.get(a):{x:0,y:0};let g=0;const v=()=>{if(!i)return;i.scrollTo({top:m.y,left:m.x}),!(Math.abs(i.scrollTop-m.y)<1&&Math.abs(i.scrollLeft-m.x)<1)&&g<Dt&&(g++,requestAnimationFrame(v))};requestAnimationFrame(v)};return{initializeContext:(a,m)=>{C=!0;const g=++E;c=a,i||(i=St(a),r=l(),o=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{r=l()}).observe(i),(i===document.documentElement?window:i).addEventListener("scroll",y,{passive:!0})),w=m,p(m);let v=0;const M=()=>{g===E&&(v++,v>=Lt?C=!1:requestAnimationFrame(M))};requestAnimationFrame(M)},calculateScrollOffset:(a,m)=>{const g=a&&d.has(a)?d.get(a):{x:0,y:0},v=m&&s(m)&&d.has(m)?d.get(m):{x:0,y:0};return{x:-v.x+g.x,y:-v.y+g.y}},evictScrollPosition:a=>{d.delete(a)},shouldPreserve:s,getScrollContainer:()=>i,getPositionedParentElement:()=>c?vt(c):document.body,getScrollPosition:a=>a&&d.has(a)?d.get(a):{x:0,y:0}}}function st(){let e=null;function n(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const t={from:e.from,to:e.to};e.outResolve(t),e.inResolve(t),e=null}}return{trigger(t,i){e||(e={}),i==="out"?e.from=t:e.to=t},get(t){return t==="in"&&(!e||!e.from)?Promise.resolve(null):new Promise(i=>{e||(e={}),t==="out"?e.outResolve=i:e.inResolve=i,n()})}}}function at(){let e=null;function n(){var i,r;e&&((i=e.outResolve)==null||i.call(e,null),(r=e.inResolve)==null||r.call(e,null),e=null)}function t(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){if(e.from===e.to){n();return}const i={from:e.from,to:e.to};e.outResolve(i),e.inResolve(i),e=null}}return{trigger(i,r){e&&(r==="out"&&e.from&&e.from!==i||r==="in"&&e.to&&e.to!==i)&&n(),e||(e={}),r==="out"?e.from=i:e.to=i},get(i){return new Promise(r=>{e||(e={}),i==="out"?e.outResolve=r:e.inResolve=r,t()})}}}function qt(e,n){const{transitions:t=[],defaultTransition:i,middleware:r=(T,a)=>({from:T,to:a}),skipAnimationOnBack:o=["ios"],preserveScroll:l=T=>T}=e,u=Tt(o),{outFirst:s=!0}=n||{},c=s?st():at(),d=xt(t),{initializeContext:w,calculateScrollOffset:C,evictScrollPosition:E,shouldPreserve:y,getScrollContainer:p,getPositionedParentElement:b,getScrollPosition:A}=_t({preserveScroll:l}),I=Vt();u&&I.initialize();const S=async(T,a)=>{const m=u&&I.isBack();c.trigger(T,a);const g=await c.get(a);if(!g)return()=>({});if(a==="in"&&u&&I.onPageEnter(),m)return()=>({});const{from:v,to:M}=r(g.from,g.to),V=Ft(v,M,d)||i;if(!V)return()=>({});const Y=C(g.from,g.to);if(a==="out"){const _={scrollOffset:Y,scroll:A(g.from),get scrollingElement(){return p()||document.documentElement},get positionedParent(){return b()}};return g.from&&!y(g.from)&&E(g.from),q=>V.out(q,_)}else{const _={scrollOffset:Y,get scroll(){return A(g.to)},get scrollingElement(){return p()||document.documentElement},get positionedParent(){return b()}};return q=>V.in(q,_)}};return T=>({key:T,in:async a=>(w(a,T),(await S(T,"in"))(a)),out:async a=>(await S(T,"out"))(a),[j]:Z})}exports.isCssAnimation=k.isCssAnimation;exports.isMultiAnimation=k.isMultiAnimation;exports.isSingleAnimation=k.isSingleAnimation;exports.isTickAnimation=k.isTickAnimation;exports.normalizeSchedule=k.normalizeSchedule;exports.normalizeToMultiAnimation=k.normalizeToMultiAnimation;exports.SCOPE_ATTR=H;exports.SCOPE_READY_ATTR=G;exports.TRANSITION_STRATEGY=j;exports.createAnyOrderDetector=at;exports.createDefaultStrategy=Q;exports.createOutFirstDetector=st;exports.createPageTransitionStrategy=Z;exports.createSggoiTransitionContext=qt;exports.createTransitionScope=wt;exports.findScope=et;exports.getWatchedCount=kt;exports.isScopeReady=tt;exports.isWatched=bt;exports.resetObserver=Pt;exports.transition=Ot;exports.triggerUnmount=Rt;exports.watchUnmount=ot;
|
|
1
|
+
"use strict";var at=Object.defineProperty;var ct=(e,n,t)=>n in e?at(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var d=(e,n,t)=>ct(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./types.cjs"),X=require("./spring-integrator-95Mh7mdw.cjs"),lt=require("./provider-BKaONTeg.cjs");class ut{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 n=Date.now();let i=n-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=n;const r=n-this.startTime,o=r-this.nextTime;if(o>0){const s=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(f=>{f(s,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(n){return this.listeners.add(n),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(n)}}unsubscribe(n){this.listeners.delete(n),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(n,t){this.lagThreshold=n,this.adjustedLag=Math.min(t,n)}fps(n){this.gap=1e3/n,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const _=new ut;function ft(e){const{integrator:n,from:t,to:i,velocity:r=0,onUpdate:o,onComplete:s,onStart:f}=e;let l={position:t,velocity:r},m=!0,h=0,v=!1;const A=S=>{if(m){if(v||(v=!0,f==null||f()),l=n.step(l,i,S),n.isSettled(l,i)){if(h+=Math.min(S,.033),h>=X.SETTLE_THRESHOLD){l={position:i,velocity:0},m=!1,o(l.position),_.unsubscribe(A),s();return}}else h=0;o(l.position)}};return _.subscribe(A),{stop:()=>{m&&(m=!1,_.unsubscribe(A))},getPosition:()=>l.position,getVelocity:()=>l.velocity,isRunning:()=>m}}const L=1e3/60;function mt(e,n,t,i=0){let o={position:n,velocity:i},s=0;const f=[];for(let l=0;l<600;l++){const m=l*L;if(f.push({time:m,position:o.position,velocity:o.velocity}),o=e.step(o,t,L/1e3),e.isSettled(o,t)){if(s+=L/1e3,s>=X.SETTLE_THRESHOLD){f.push({time:(l+1)*L,position:t,velocity:0});break}}else s=0}return f}function Y(e,n){if(e.length===0)return{position:0,velocity:0};const t=e[0],i=e[e.length-1];if(n<=0)return{position:t.position,velocity:t.velocity};if(n>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=e.length-1;for(;r<o-1;){const m=Math.floor((r+o)/2);e[m].time<=n?r=m:o=m}const s=e[r],f=e[o],l=(n-s.time)/(f.time-s.time);return{position:s.position+(f.position-s.position)*l,velocity:s.velocity+(f.velocity-s.velocity)*l}}function dt(e,n){return e.map(t=>n(t.position))}function ht(e){const{integrator:n,element:t,from:i,to:r,velocity:o=0,style:s,onComplete:f,onStart:l}=e,m=mt(n,i,r,o);if(m.length===0)return l==null||l(),f(),{stop:()=>{},getPosition:()=>r,getVelocity:()=>0,isRunning:()=>!1};const h=dt(m,s),v=m[m.length-1],A=v.time,S=h[0];if(S)for(const C of Object.keys(S))t.style[C]="";const y=t.animate(h,{duration:A,fill:"forwards",easing:"linear",composite:"replace"});let p=!0;const R=performance.now();return l==null||l(),y.onfinish=()=>{p&&(p=!1,f())},{stop:()=>{p&&(p=!1,y.cancel())},getPosition:()=>{if(!p)return v.position;const C=performance.now()-R;return Y(m,C).position},getVelocity:()=>{if(!p)return 0;const C=performance.now()-R;return Y(m,C).velocity},isRunning:()=>p}}function gt(e){const{element:n,frames:t,duration:i,easing:r="linear",from:o,to:s,onComplete:f,onStart:l}=e,m=t[0];if(m)for(const S of Object.keys(m))S==="offset"||S==="easing"||S==="composite"||(n.style[S]="");const h=n.animate(t,{duration:i,fill:"forwards",easing:r,composite:"replace"});let v=!0;const A=performance.now();return l==null||l(),h.onfinish=()=>{v&&(v=!1,f())},{stop:()=>{v&&(v=!1,h.cancel())},getPosition:()=>{if(!v)return s;const S=performance.now()-A,y=Math.min(Math.max(S/i,0),1);return o+(s-o)*y},getVelocity:()=>0,isRunning:()=>v}}function yt(e){const{to:n,onStart:t,onComplete:i}=e;return t==null||t(),i(),{stop:()=>{},getPosition:()=>n,getVelocity:()=>0,isRunning:()=>!1}}class wt{static from(n){const{tick:t,css:i,keyframes:r}=n;if((t?1:0)+(i?1:0)+(r?1:0)>1)throw new Error("Cannot use more than one of 'tick', 'css', 'keyframes' together");return r?s=>gt({element:r.element,frames:r.frames,duration:r.duration,easing:r.easing,from:s.from,to:s.to,onComplete:s.onComplete,onStart:s.onStart}):i?s=>{if(!s.integrator)throw new Error("css mode requires an integrator");return ht({integrator:s.integrator,from:s.from,to:s.to,velocity:s.velocity,onComplete:s.onComplete,onStart:s.onStart,element:i.element,style:i.style})}:t?s=>{if(!s.integrator)throw new Error("tick mode requires an integrator");return ft({integrator:s.integrator,from:s.from,to:s.to,velocity:s.velocity,onComplete:s.onComplete,onStart:s.onStart,onUpdate:t})}:yt}}class J{}const pt={stiffness:300,damping:30};class j extends J{constructor(t){super();d(this,"options");d(this,"runner");d(this,"controls",null);d(this,"isAnimating",!1);d(this,"currentValue");d(this,"currentVelocity",0);d(this,"updateFn");d(this,"isKeyframesMode");if(this.options={from:t.from??0,to:t.to??1,physics:t.physics,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,this.isKeyframesMode=!!t.keyframes,t.tick)this.updateFn=i=>{var r;return(r=t.tick)==null?void 0:r.call(t,i)};else if(t.css){const{element:i,style:r}=t.css;this.updateFn=o=>{const s=r(o);for(const[f,l]of Object.entries(s))i.style[f]=typeof l=="number"?String(l):l}}else this.updateFn=()=>{};this.runner=wt.from({tick:t.tick,css:t.css,keyframes:t.keyframes})}syncState(){var t;(t=this.updateFn)==null||t.call(this,this.currentValue)}createIntegrator(){const t=this.options.physics;return t!=null&&t.integrator?t.integrator():t!=null&&t.spring||t!=null&&t.inertia?lt.IntegratorProvider.from({spring:t.spring,inertia:t.inertia}):new X.SpringIntegrator(pt)}runAnimation(t){this.isAnimating=!0,this.controls=this.runner({integrator:this.isKeyframesMode?void 0:this.createIntegrator(),from:this.currentValue,to:t,velocity:this.currentVelocity,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}}}class z extends J{constructor(t){super();d(this,"config");d(this,"animators",new Map);d(this,"itemOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(this,"rafId",null);d(this,"from");d(this,"to");d(this,"initialState");this.config=t.config,this.from=t.from,this.to=t.to,this.initialState=t.state??{position:t.from,velocity:0},this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.items.forEach((t,i)=>{const r=this.generateId(),o=new j({from:this.from,to:this.to,physics:t.physics,tick:t.tick,css:t.css,keyframes:t.keyframes,onComplete:()=>this.onAnimatorComplete(r),onStart:t.onStart});(i===0||t.normalizedOffset===0)&&(o.setValue(this.initialState.position),o.setVelocity(this.initialState.velocity),o.syncState()),this.animators.set(r,{id:r,item:t,animator:o,started:!1}),this.itemOrder.push(r)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.itemOrder:[...this.itemOrder].reverse()}onAnimatorComplete(t){var r,o,s,f,l,m;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=i.item).onComplete)==null||o.call(r),(f=(s=this.config).onProgress)==null||f.call(s,this.completedCount,this.config.items.length),this.completedCount===this.config.items.length&&(this.stopScheduler(),(m=(l=this.config).onEnd)==null||m.call(l)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],o=this.animators.get(r);if(!o||o.started)continue;if(i===0){this.startAnimator(r);continue}const s=t[i-1],f=this.animators.get(s);if(!f||!f.started)continue;const l=this.getAnimatorProgress(f),m=o.item.normalizedOffset;l>=m&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.itemOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.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 i=t.animator.getCurrentState();if(i.position===i.to){const o=new j({from:this.to,to:this.from,physics:t.item.physics,tick:t.item.tick,css:t.item.css,keyframes:t.item.keyframes,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.setValue(this.to),o.setVelocity(0),o.syncState(),o.forward(),t.animator=o}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 i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){return new z({...i,state:t})}}const H=Symbol.for("TRANSITION_STRATEGY"),Q=e=>({runIn:async n=>{const{currentAnimation:t}=e;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.out)return{config:await n.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return n.in?{config:await n.in,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{currentAnimation:t}=e;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.in)return{config:await n.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),tt=()=>({runIn:async e=>e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async e=>e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),U="data-ssgoi-scope",K="data-ssgoi-scope-ready";function vt(){return e=>{if(e)return e.setAttribute(U,""),queueMicrotask(()=>{queueMicrotask(()=>{e.setAttribute(K,"true")})}),()=>{}}}function et(e){return e.hasAttribute(K)}function it(e){return e.closest(`[${U}]`)}const St=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.parentElement}return document.documentElement},At=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return n;n=n.parentElement}return document.body};function B(e){return new Promise(n=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})})}function Tt(e,n){var S;let t=null,i=null,r=null,o=null;const s={get currentAnimation(){return t}},f=((S=n==null?void 0:n.strategy)==null?void 0:S.call(n,s))||Q(s),l=async y=>{var g,E;i&&(i.remove(),i=null);const p=e(),R=p.in&&p.in(y),C=!(n!=null&&n.strategy)&&p.out?p.out(y):void 0;if(!R)return;const w={in:k.normalizeToMultiAnimation(R),out:C?k.normalizeToMultiAnimation(C):void 0},u=await f.runIn(w);if(!u.config){t&&(t.direction="in");return}const a=u.config;(g=a.prepare)==null||g.call(a);const T=k.normalizeSchedule({...a,onEnd:()=>{var b;t=null,(b=a.onEnd)==null||b.call(a)}},y);a.wait&&await a.wait();const c=z.fromState(u.state,{config:T,from:u.from,to:u.to});t={controller:c,direction:"in"},(E=a.onReady)==null||E.call(a),await B(),u.direction==="forward"?c.forward():c.backward()},m=async y=>{var E,b;i=y;const p=e(),R=!(n!=null&&n.strategy)&&p.in?p.in(y):void 0,C=p.out&&p.out(y);if(!C)return;const w={in:R?k.normalizeToMultiAnimation(R):void 0,out:k.normalizeToMultiAnimation(C)},u=await f.runOut(w);if(!u.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const a=u.config;g(),(E=a.prepare)==null||E.call(a);const T=k.normalizeSchedule({...a,onEnd:()=>{var P,V;(P=a.onEnd)==null||P.call(a),i&&(i.remove(),i=null),t=null,(V=n==null?void 0:n.onCleanupEnd)==null||V.call(n)}},y);a.wait&&await a.wait();const c=z.fromState(u.state,{config:T,from:u.from,to:u.to});t={controller:c,direction:"out"},(b=a.onReady)==null||b.call(a),await B(),u.direction==="forward"?c.forward():c.backward();function g(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let h=null,v=!1;const A=y=>()=>{if(v)return;v=!0;const p=y.cloneNode(!0);h?queueMicrotask(()=>{document.contains(h)&&m(p)}):m(p)};return y=>{if(y)return requestAnimationFrame(()=>{r=y.parentElement,o=y.nextElementSibling}),v=!1,(n==null?void 0:n.scope)==="local"?queueMicrotask(()=>{h=it(y),!(h&&!et(h))&&l(y)}):l(y),A(y)}}const M=new Map;let I=null,q=!1;function nt(e){if(e instanceof HTMLElement&&M.has(e)){const t=M.get(e);M.delete(e),queueMicrotask(()=>{t()})}const n=e.childNodes;for(let t=0;t<n.length;t++){const i=n[t];i&&nt(i)}}function Et(){q||typeof document>"u"||(q=!0,I=new MutationObserver(e=>{for(const n of e){const t=n.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&nt(r)}}}),document.body?I.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{I==null||I.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function rt(e,n){Et(),M.set(e,n)}function Ct(e){return M.has(e)}function bt(){return M.size}function Rt(e){const n=M.get(e);return n?(M.delete(e),n(),!0):!1}function kt(){M.clear(),I==null||I.disconnect(),I=null,q=!1}const O=new Map,N=new Map,W=new Map;function Pt(e,n,t){O.set(e,n);let i=N.get(e);if(i)return i;const r=n;return i=Tt(()=>{const o=O.get(e);return o||(console.warn(`Transition "${String(e)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{O.get(e)===r&&It(e)}}),N.set(e,i),i}function It(e){O.delete(e),N.delete(e),W.delete(e)}function Mt(e,n="manual"){const t=Pt(e.key,{in:e.in,out:e.out},{strategy:e[H],scope:e.scope});if(n==="manual")return t;let i=W.get(e.key);return i||(i=r=>{if(r){const o=t(r);o&&rt(r,o)}},W.set(e.key,i),i)}function Vt(e){const n=e.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...e,...n]}function F(e,n){if(n==="*")return!0;if(n.endsWith("/*")){const t=n.slice(0,-1);return e.startsWith(t)&&e.length>t.length}return e===n}function Ft(e,n,t){for(const i of t)if(F(e,i.from)&&F(n,i.to))return i.transition;for(const i of t)if((i.from==="*"||F(e,i.from))&&(i.to==="*"||F(n,i.to)))return i.transition;return null}const xt=768,Lt=10,Ot=10;function zt(e={}){const{preserveScroll:n=c=>c}=e,t=typeof n=="function"?n:()=>n;let i=null,r=!1,o=!1;const s=()=>{const c=(i==null?void 0:i.clientWidth)??0,g=c>0?c:typeof window<"u"?window.innerWidth:0;return g>0&&g<xt},f=()=>(o||(r=s(),o=!0),r),l=c=>{const g=t(f());return g===!1?!1:g===!0?!0:!g.exclude.some(E=>F(c,E))};let m=null;const h=new Map;let v=null,A=!1,S=0;const y=()=>{i&&v&&!A&&h.set(v,{x:i.scrollLeft,y:i.scrollTop})},p=c=>{if(!i)return;const g=l(c)&&h.has(c)?h.get(c):{x:0,y:0};let E=0;const b=()=>{if(!i)return;i.scrollTo({top:g.y,left:g.x}),!(Math.abs(i.scrollTop-g.y)<1&&Math.abs(i.scrollLeft-g.x)<1)&&E<Lt&&(E++,requestAnimationFrame(b))};requestAnimationFrame(b)};return{initializeContext:(c,g)=>{A=!0;const E=++S;m=c,i||(i=St(c),r=s(),o=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{r=s()}).observe(i),(i===document.documentElement?window:i).addEventListener("scroll",y,{passive:!0})),v=g,p(g);let b=0;const P=()=>{E===S&&(b++,b>=Ot?A=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(c,g)=>{const E=c&&h.has(c)?h.get(c):{x:0,y:0},b=g&&l(g)&&h.has(g)?h.get(g):{x:0,y:0};return{x:-b.x+E.x,y:-b.y+E.y}},evictScrollPosition:c=>{h.delete(c)},shouldPreserve:l,getScrollContainer:()=>i,getPositionedParentElement:()=>m?At(m):document.body,getScrollPosition:c=>c&&h.has(c)?h.get(c):{x:0,y:0}}}const G=30,$=8,Z=1.2,Dt=30,_t=600;function qt(){let e=null,n=!1,t=!1,i=null,r=null,o=!1;const s=(w,u)=>{for(let a=0;a<w.length;a++){const T=w.item(a);if(T&&T.identifier===u)return T}return null},f=()=>{i!==null&&(clearTimeout(i),i=null)},l=()=>{r!==null&&(clearTimeout(r),r=null)},m=()=>{n=!0,t=!0,f(),l(),i=setTimeout(()=>{n=!1,t=!1,i=null},_t)},h=w=>{if(w.touches.length!==1){e=null;return}const u=w.touches.item(0);if(!u){e=null;return}const a=window.innerWidth,T=u.clientX<=G,c=u.clientX>=a-G;if(!T&&!c){e=null;return}e={identifier:u.identifier,startX:u.clientX,startY:u.clientY,fromLeftEdge:T,moved:!1}},v=w=>{if(!e)return;if(w.touches.length!==1){e=null;return}const u=s(w.touches,e.identifier);if(!u){e=null;return}const a=u.clientX-e.startX,T=u.clientY-e.startY,c=Math.abs(a),g=Math.abs(T);if(g>$&&g>c*Z){e=null;return}const E=e.fromLeftEdge?a>0:a<0;c>$&&c>g*Z&&E&&(e.moved=!0)},A=w=>{if(!e)return;const u=s(w.changedTouches,e.identifier);if(!u){e=null;return}const a=u.clientX-e.startX,T=e.fromLeftEdge?a>0:a<0;e.moved&&T&&Math.abs(a)>=Dt&&m(),e=null},S=()=>{e&&(e.moved&&m(),e=null)};return{initialize:()=>{if(typeof window>"u"||o)return;o=!0;const w={passive:!0,capture:!0};window.addEventListener("touchstart",h,w),window.addEventListener("touchmove",v,w),window.addEventListener("touchend",A,w),window.addEventListener("touchcancel",S,w)},destroy:()=>{if(typeof window>"u"||!o)return;o=!1;const w={capture:!0};window.removeEventListener("touchstart",h,w),window.removeEventListener("touchmove",v,w),window.removeEventListener("touchend",A,w),window.removeEventListener("touchcancel",S,w),f(),l(),e=null,n=!1,t=!1},isSwipeBack:()=>{const w=n||t;return w&&f(),w},onPageEnter:()=>{n=!1,f(),l(),r=setTimeout(()=>{t=!1,r=null},0)}}}function ot(){let e=null;function n(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const t={from:e.from,to:e.to};e.outResolve(t),e.inResolve(t),e=null}}return{trigger(t,i){e||(e={}),i==="out"?e.from=t:e.to=t},get(t){return t==="in"&&(!e||!e.from)?Promise.resolve(null):new Promise(i=>{e||(e={}),t==="out"?e.outResolve=i:e.inResolve=i,n()})}}}function st(){let e=null;function n(){var i,r;e&&((i=e.outResolve)==null||i.call(e,null),(r=e.inResolve)==null||r.call(e,null),e=null)}function t(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){if(e.from===e.to){n();return}const i={from:e.from,to:e.to};e.outResolve(i),e.inResolve(i),e=null}}return{trigger(i,r){e&&(r==="out"&&e.from&&e.from!==i||r==="in"&&e.to&&e.to!==i)&&n(),e||(e={}),r==="out"?e.from=i:e.to=i},get(i){return new Promise(r=>{e||(e={}),i==="out"?e.outResolve=r:e.inResolve=r,t()})}}}function Nt(e,n){const{transitions:t=[],defaultTransition:i,middleware:r=(u,a)=>({from:u,to:a}),preserveScroll:o=u=>u}=e,{outFirst:s=!0}=n||{},f=s?ot():st(),l=Vt(t),m=qt();m.initialize();const{initializeContext:h,calculateScrollOffset:v,evictScrollPosition:A,shouldPreserve:S,getScrollContainer:y,getPositionedParentElement:p,getScrollPosition:R}=zt({preserveScroll:o}),C=async(u,a)=>{const T=m.isSwipeBack();f.trigger(u,a);const c=await f.get(a);if(a==="in"&&m.onPageEnter(),!c)return()=>({});if(T)return a==="out"&&c.from&&!S(c.from)&&A(c.from),()=>({});const{from:g,to:E}=r(c.from,c.to),P=Ft(g,E,l)||i;if(!P)return()=>({});const V=v(c.from,c.to);if(a==="out"){const x={scrollOffset:V,scroll:R(c.from),get scrollingElement(){return y()||document.documentElement},get positionedParent(){return p()}};return c.from&&!S(c.from)&&A(c.from),D=>P.out(D,x)}else{const x={scrollOffset:V,get scroll(){return R(c.to)},get scrollingElement(){return y()||document.documentElement},get positionedParent(){return p()}};return D=>P.in(D,x)}};return u=>({key:u,in:async a=>(h(a,u),(await C(u,"in"))(a)),out:async a=>(await C(u,"out"))(a),[H]:tt})}exports.isCssAnimation=k.isCssAnimation;exports.isKeyframesAnimation=k.isKeyframesAnimation;exports.isMultiAnimation=k.isMultiAnimation;exports.isSingleAnimation=k.isSingleAnimation;exports.isTickAnimation=k.isTickAnimation;exports.normalizeSchedule=k.normalizeSchedule;exports.normalizeToMultiAnimation=k.normalizeToMultiAnimation;exports.SCOPE_ATTR=U;exports.SCOPE_READY_ATTR=K;exports.TRANSITION_STRATEGY=H;exports.createAnyOrderDetector=st;exports.createDefaultStrategy=Q;exports.createOutFirstDetector=ot;exports.createPageTransitionStrategy=tt;exports.createSggoiTransitionContext=Nt;exports.createTransitionScope=vt;exports.findScope=it;exports.getWatchedCount=bt;exports.isScopeReady=et;exports.isWatched=Ct;exports.resetObserver=kt;exports.transition=Mt;exports.triggerUnmount=Rt;exports.watchUnmount=rt;
|