@ssgoi/core 6.4.0 → 6.5.0-beta.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/README.md +73 -125
- package/dist/index.cjs +13 -13
- package/dist/index.js +792 -717
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +447 -340
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -1
- package/dist/ssgoi-transition/visibility-observer.d.ts +66 -0
- package/dist/ssgoi-transition/visibility-observer.d.ts.map +1 -0
- package/dist/transitions/axis/provider/x/fluid.d.ts.map +1 -1
- package/dist/transitions/axis/provider/x/snappy.d.ts.map +1 -1
- package/dist/transitions/axis/provider/y/directional.d.ts.map +1 -1
- package/dist/transitions/axis/provider/y/non-directional.d.ts.map +1 -1
- package/dist/transitions/axis/provider/z/directional.d.ts.map +1 -1
- package/dist/transitions/axis/provider/z/non-directional.d.ts.map +1 -1
- package/dist/transitions/axis/transition.d.ts.map +1 -1
- package/dist/transitions/blind/transition.d.ts +1 -0
- package/dist/transitions/blind/transition.d.ts.map +1 -1
- package/dist/transitions/drill/transition.d.ts.map +1 -1
- package/dist/transitions/fade/transition.d.ts.map +1 -1
- package/dist/transitions/film/transition.d.ts.map +1 -1
- package/dist/transitions/hero/provider/chrome/static.d.ts.map +1 -1
- package/dist/transitions/jaemin/transition.d.ts.map +1 -1
- package/dist/transitions/rotate/transition.d.ts.map +1 -1
- package/dist/transitions/scroll/transition.d.ts.map +1 -1
- package/dist/transitions/sheet/transition.d.ts.map +1 -1
- package/dist/transitions/slide/transition.d.ts.map +1 -1
- package/dist/transitions/strip/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
# SSGOI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The framework-agnostic animation engine behind [SSGOI](https://ssgoi.dev) — native app-like page transitions for the web.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Most apps should install a framework binding (`@ssgoi/react`, `@ssgoi/svelte`, `@ssgoi/vue`, `@ssgoi/solid`, `@ssgoi/angular`), which depend on this package. Install `@ssgoi/core` directly only when building a custom integration.
|
|
6
6
|
|
|
7
7
|
try this: [ssgoi.dev](https://ssgoi.dev)
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
## AI-Assisted Setup
|
|
12
|
+
|
|
13
|
+
Using Claude, Cursor, ChatGPT, or another AI assistant? Point it at:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
https://ssgoi.dev/llms.txt
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
It has the full setup guide, every transition, the API, and troubleshooting — everything an agent needs to wire SSGOI into your app.
|
|
20
|
+
|
|
21
|
+
## What is SSGOI?
|
|
22
|
+
|
|
23
|
+
SSGOI brings native app-like page transitions to the web. Transform your static page navigations into smooth, delightful experiences that users love.
|
|
24
|
+
|
|
11
25
|
### ✨ Key Features
|
|
12
26
|
|
|
13
27
|
- **🌍 Works Everywhere** - Unlike the browser's View Transition API, SSGOI works in all modern browsers (Chrome, Firefox, Safari)
|
|
14
|
-
- **🚀 SSR Ready** - Perfect compatibility with Next.js, Nuxt, SvelteKit. No hydration issues, SEO-friendly
|
|
28
|
+
- **🚀 SSR Ready** - Perfect compatibility with Next.js, Nuxt, SvelteKit, SolidStart. No hydration issues, SEO-friendly
|
|
15
29
|
- **🎯 Use Your Router** - Keep your existing routing. React Router, Next.js App Router, SvelteKit - all work seamlessly
|
|
16
30
|
- **💾 State Persistence** - Remembers animation state during navigation, even with browser back/forward
|
|
17
|
-
- **🎨 Framework Agnostic** - One consistent API for React, Svelte, Vue,
|
|
31
|
+
- **🎨 Framework Agnostic** - One consistent API for React, Svelte, Vue, Solid, Angular, and more
|
|
18
32
|
|
|
19
33
|
## Quick Start
|
|
20
34
|
|
|
21
35
|
### Installation
|
|
22
36
|
|
|
23
37
|
```bash
|
|
24
|
-
#
|
|
38
|
+
# Pick the binding for your framework
|
|
25
39
|
npm install @ssgoi/react
|
|
26
|
-
|
|
27
|
-
# Svelte
|
|
28
|
-
npm install @ssgoi/svelte
|
|
40
|
+
# or @ssgoi/svelte, @ssgoi/vue, @ssgoi/solid, @ssgoi/angular
|
|
29
41
|
```
|
|
30
42
|
|
|
31
43
|
### Add Transitions in 30 Seconds
|
|
@@ -36,10 +48,15 @@ npm install @ssgoi/svelte
|
|
|
36
48
|
import { Ssgoi } from "@ssgoi/react";
|
|
37
49
|
import { fade } from "@ssgoi/react/view-transitions";
|
|
38
50
|
|
|
51
|
+
const config = {
|
|
52
|
+
transitions: [fade({ paths: ["/", "/about"] })],
|
|
53
|
+
};
|
|
54
|
+
|
|
39
55
|
export default function App() {
|
|
40
56
|
return (
|
|
41
|
-
<Ssgoi config={
|
|
42
|
-
|
|
57
|
+
<Ssgoi config={config}>
|
|
58
|
+
{/* relative + z-0: the outgoing page is cloned with position:absolute */}
|
|
59
|
+
<div className="relative z-0">{/* Your app */}</div>
|
|
43
60
|
</Ssgoi>
|
|
44
61
|
);
|
|
45
62
|
}
|
|
@@ -64,44 +81,34 @@ export default function HomePage() {
|
|
|
64
81
|
|
|
65
82
|
### Route-based Transitions
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
Each transition factory returns a path-transition group. Drop the results straight into `config.transitions` — nested arrays are flattened automatically:
|
|
68
85
|
|
|
69
86
|
```tsx
|
|
87
|
+
import { fade, drill, zoom } from "@ssgoi/react/view-transitions";
|
|
88
|
+
|
|
70
89
|
const config = {
|
|
71
90
|
transitions: [
|
|
72
|
-
//
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
transition: drill({ direction: "enter" }),
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
// Pinterest-style image transitions
|
|
84
|
-
{ from: "/gallery", to: "/photo/*", transition: pinterest() },
|
|
91
|
+
// Calm cross-fade between tabs
|
|
92
|
+
fade({ paths: ["/home", "/about"] }),
|
|
93
|
+
|
|
94
|
+
// iOS-style drill-in when entering details
|
|
95
|
+
drill({ enter: "/products/*", exit: "/products" }),
|
|
96
|
+
|
|
97
|
+
// Card-to-detail zoom (needs matching data-zoom-*-key)
|
|
98
|
+
zoom({ paths: ["/gallery", "/photo/*"], type: "expand" }),
|
|
85
99
|
],
|
|
86
100
|
};
|
|
87
101
|
```
|
|
88
102
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Automatically create bidirectional transitions:
|
|
103
|
+
Transitions come in three shapes:
|
|
92
104
|
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
to: '/about',
|
|
97
|
-
transition: scroll({ direction: 'up' }),
|
|
98
|
-
symmetric: true // Automatically creates reverse transition
|
|
99
|
-
}
|
|
100
|
-
```
|
|
105
|
+
- **`{ paths }`** — symmetric: every pair animates with the same physics (`fade`, `hero`, `zoom`, `blind`, `film`, `rotate`, `strip`, `jaemin`)
|
|
106
|
+
- **`{ enter, exit, type? }`** — directional: enter and exit get different physics (`drill`, `sheet`)
|
|
107
|
+
- **`{ paths }`** — ordered: path order decides forward / back direction (`slide`, `scroll`, `axis`)
|
|
101
108
|
|
|
102
109
|
### Individual Element Animations
|
|
103
110
|
|
|
104
|
-
Animate specific elements during mount/unmount
|
|
111
|
+
Animate specific elements during mount/unmount with `transition()`:
|
|
105
112
|
|
|
106
113
|
```tsx
|
|
107
114
|
import { transition } from "@ssgoi/react";
|
|
@@ -124,15 +131,25 @@ function Card() {
|
|
|
124
131
|
|
|
125
132
|
## Built-in Transitions
|
|
126
133
|
|
|
127
|
-
### Page Transitions
|
|
134
|
+
### Page Transitions (`@ssgoi/<framework>/view-transitions`)
|
|
135
|
+
|
|
136
|
+
- `fade` - Calm cross-fade. Safe default for unrelated pages
|
|
137
|
+
- `drill` - iOS-style hierarchical navigation (list → detail)
|
|
138
|
+
- `slide` - Horizontal push for tabs / sequential flows
|
|
139
|
+
- `scroll` - Vertical page scroll for onboarding / paginated views
|
|
140
|
+
- `axis` - Material/Flutter shared-axis swap for sibling/tab routes
|
|
141
|
+
- `sheet` - Bottom sheet that slides up (modal-like flows)
|
|
142
|
+
- `hero` - Shared element transition (matching `data-hero-*-key`)
|
|
143
|
+
- `zoom` - Card-to-detail expansion (matching `data-zoom-*-key`)
|
|
144
|
+
- `strip` - 3D Y-axis perspective flip
|
|
145
|
+
- `blind` - Window-blinds wipe reveal
|
|
146
|
+
- `film` - Cinematic shrink + tile (gallery / lightbox)
|
|
147
|
+
- `rotate` - Card flip between siblings
|
|
148
|
+
- `jaemin` - Playful rotated zoom for special moments
|
|
128
149
|
|
|
129
|
-
|
|
130
|
-
- `scroll` - Vertical scrolling (up/down)
|
|
131
|
-
- `drill` - Drill in/out effect (enter/exit)
|
|
132
|
-
- `hero` - Shared element transitions
|
|
133
|
-
- `pinterest` - Pinterest-style expand effect
|
|
150
|
+
### Element Transitions (`@ssgoi/<framework>/transitions`)
|
|
134
151
|
|
|
135
|
-
|
|
152
|
+
For mount/unmount of individual elements (not whole pages):
|
|
136
153
|
|
|
137
154
|
- `fade` - Fade in/out
|
|
138
155
|
- `scale` - Scale in/out
|
|
@@ -142,61 +159,16 @@ function Card() {
|
|
|
142
159
|
- `blur` - Blur
|
|
143
160
|
- `fly` - Fly (custom x, y position)
|
|
144
161
|
|
|
145
|
-
##
|
|
162
|
+
## Layout Requirements
|
|
146
163
|
|
|
147
|
-
|
|
164
|
+
The element wrapping `<Ssgoi>` needs `position: relative` and `z-index: 0`.
|
|
148
165
|
|
|
149
|
-
|
|
150
|
-
// app/layout.tsx
|
|
151
|
-
import { Ssgoi } from "@ssgoi/react";
|
|
152
|
-
import { scroll } from "@ssgoi/react/view-transitions";
|
|
153
|
-
|
|
154
|
-
export default function RootLayout({ children }) {
|
|
155
|
-
return (
|
|
156
|
-
<html>
|
|
157
|
-
<body>
|
|
158
|
-
<Ssgoi
|
|
159
|
-
config={{
|
|
160
|
-
transitions: scroll({ paths: ["/", "/about"] }),
|
|
161
|
-
}}
|
|
162
|
-
>
|
|
163
|
-
<div style={{ position: "relative", minHeight: "100vh" }}>
|
|
164
|
-
{children}
|
|
165
|
-
</div>
|
|
166
|
-
</Ssgoi>
|
|
167
|
-
</body>
|
|
168
|
-
</html>
|
|
169
|
-
);
|
|
170
|
-
}
|
|
166
|
+
When a page leaves, SSGOI clones it back into the DOM with `position: absolute` so it can animate out while the new page animates in. Without a positioned, stacking-context ancestor the clone jumps to the wrong place or falls behind the background. Add `overflow-x-clip` too if you use horizontal transitions (`slide`, `drill`).
|
|
171
167
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
### SvelteKit
|
|
178
|
-
|
|
179
|
-
```svelte
|
|
180
|
-
<!-- +layout.svelte -->
|
|
181
|
-
<script>
|
|
182
|
-
import { Ssgoi } from '@ssgoi/svelte';
|
|
183
|
-
import { fade } from '@ssgoi/svelte/view-transitions';
|
|
184
|
-
</script>
|
|
185
|
-
|
|
186
|
-
<Ssgoi config={{ transitions: fade({ paths: ['/', '/about'] }) }}>
|
|
187
|
-
<div style="position: relative; min-height: 100vh;">
|
|
188
|
-
<slot />
|
|
189
|
-
</div>
|
|
190
|
-
</Ssgoi>
|
|
191
|
-
|
|
192
|
-
<!-- +page.svelte -->
|
|
193
|
-
<script>
|
|
194
|
-
import { page } from '$app/stores';
|
|
195
|
-
</script>
|
|
196
|
-
|
|
197
|
-
<main data-ssgoi-transition={$page.url.pathname}>
|
|
198
|
-
<!-- Your page content -->
|
|
199
|
-
</main>
|
|
168
|
+
```tsx
|
|
169
|
+
<div className="relative z-0 overflow-x-clip">
|
|
170
|
+
<Ssgoi config={config}>{children}</Ssgoi>
|
|
171
|
+
</div>
|
|
200
172
|
```
|
|
201
173
|
|
|
202
174
|
## Why SSGOI?
|
|
@@ -216,38 +188,14 @@ export default function Page() {
|
|
|
216
188
|
|
|
217
189
|
## How It Works
|
|
218
190
|
|
|
219
|
-
SSGOI
|
|
191
|
+
SSGOI orchestrates two simultaneous animations on every route change:
|
|
220
192
|
|
|
221
193
|
1. **Route Change**: Your router changes the URL
|
|
222
|
-
2. **Exit
|
|
223
|
-
3. **Enter
|
|
224
|
-
4. **State Sync**: Animation state persists across navigation
|
|
225
|
-
|
|
226
|
-
All powered by a spring physics engine for natural, smooth motion.
|
|
227
|
-
|
|
228
|
-
## Live Demos
|
|
229
|
-
|
|
230
|
-
Try out SSGOI with our framework-specific demo applications:
|
|
231
|
-
|
|
232
|
-
### React Demo
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
pnpm react-demo:dev
|
|
236
|
-
# Opens at http://localhost:3001
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Explore Next.js App Router integration with various transition effects.
|
|
240
|
-
|
|
241
|
-
### Svelte Demo
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
pnpm svelte-demo:dev
|
|
245
|
-
# Opens at http://localhost:5174
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
See SvelteKit integration with smooth page transitions.
|
|
194
|
+
2. **Exit (OUT)**: SSGOI clones the leaving page with `position: absolute` and animates it out
|
|
195
|
+
3. **Enter (IN)**: The new page mounts in place and animates in
|
|
196
|
+
4. **State Sync**: Animation state persists across navigation, including browser back/forward
|
|
249
197
|
|
|
250
|
-
|
|
198
|
+
All powered by a spring physics engine — springs are pre-computed into Web Animations API keyframes, so animations run at 60fps off the main thread.
|
|
251
199
|
|
|
252
200
|
## Documentation
|
|
253
201
|
|
|
@@ -260,7 +208,7 @@ Visit [https://ssgoi.dev](https://ssgoi.dev) for:
|
|
|
260
208
|
|
|
261
209
|
## Contributing
|
|
262
210
|
|
|
263
|
-
We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
|
|
211
|
+
We welcome contributions! Please see our [contributing guide](https://github.com/meursyphus/ssgoi/blob/main/CONTRIBUTING.md) for details.
|
|
264
212
|
|
|
265
213
|
## License
|
|
266
214
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ft=Object.defineProperty;var Yt=(e,t,n)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var S=(e,t,n)=>Yt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./multi-animation-Dw2JTJI2.cjs");function P(e,t){const n=[];for(let o=0;o<e.length;o++)for(let s=o+1;s<e.length;s++){const i=e[o],r=e[s];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function Ct(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function K(e,t,n){const o=[];for(let s=0;s<e.length;s++)for(let i=s+1;i<e.length;i++){const r=e[s],l=e[i];!r||!l||o.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return o}class Y{constructor(t){S(this,"omega");S(this,"zeta");S(this,"restDelta");S(this,"restSpeed");const{stiffness:n,damping:o}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=o/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD}step(t,n,o){const s=Math.min(o,.033),{omega:i,zeta:r}=this,{position:l,velocity:c}=t,a=-2*s*r*i*c,p=s*i*i*(n-l),f=c+a+p;return{position:l+s*f,velocity:f}}isSettled(t,n){const o=Math.abs(n-t.position),s=Math.abs(t.velocity);return o<this.restDelta&&s<this.restSpeed}}class Lt{constructor(t){S(this,"leader");S(this,"follower");S(this,"restDelta");S(this,"restSpeed");this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD,this.leader=new Y({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,o,s,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,o=t.damping):t.follower?(n=t.follower.stiffness,o=t.follower.damping,s=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,o=t.damping),this.follower=new Y({stiffness:n,damping:o,restDelta:s??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,o){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,o),l=this.follower.step(t,r.position,o);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const o=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return o._leader?Math.abs(n-o._leader.position)<this.restDelta&&Math.abs(o._leader.velocity)<this.restSpeed&&s:s}}const kt=.01,Mt=500,Ht=10;class Wt{constructor(t){S(this,"acceleration");S(this,"resistance");S(this,"resistanceType");S(this,"min");S(this,"max");S(this,"bounceStiffness");S(this,"bounceDamping");S(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Mt,this.bounceDamping=t.bounceDamping??Ht,this.restDelta=t.restDelta??kt}step(t,n,o){const s=Math.min(o,.033),{acceleration:i,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:f}=t,d=c!==void 0&&p<c,y=a!==void 0&&p>a;let m;if(d||y){const w=p-(d?c:a),E=-this.bounceStiffness*w,x=-this.bounceDamping*f;m=E+x}else{const $=n>p?1:-1;let w;l==="linear"?w=r*f:w=r*f*Math.abs(f),m=$*i-w}const u=f+m*s;let b=p+u*s;if(!d&&!y){const $=n>p?1:-1;($>0&&b>n||$<0&&b<n)&&(b=n)}return{position:b,velocity:b===n?0:u}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class g{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new Wt({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const o=n.doubleSpring;let s;return typeof o=="number"?s=o:typeof o=="object"&&(s={stiffness:o.stiffness,damping:o.damping}),new Lt({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new Y({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return g.from({spring:t})}}class Ut{constructor(t){S(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,o){const s=n-t.position;if(s===0)return t;const i=Math.sign(s),r=Math.abs(s)/this.durationSec,l=i*r*o,c=t.position+l;return(i>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<h.POSITION_THRESHOLD}}function O(e,t){function n(i){let r=0,l=0;const c=i.offsetWidth,a=i.offsetHeight;let p=i;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const o=n(e),s=n(t);return new DOMRect(s.left-o.left,s.top-o.top,s.width,s.height)}function _(e,t){const{scrollingElement:n,positionedParent:o}=e,s=n!==o&&n.contains(o)?O(n,o).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}const J=8,Q={spring:{stiffness:1e3,damping:40,doubleSpring:1.2}};function Nt({direction:e}){const t=e==="forward"?J:-J;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Rt(){return{outPhysics:Q,inPhysics:Q,composition:{mode:"parallel",startAt:[0,0]},build:Nt}}const tt=30,zt={inertia:{acceleration:150,resistance:1.5}},Xt={spring:{stiffness:180,damping:34}};function Vt({direction:e}){const t=e==="forward"?1:-1,n=-tt*t,o=tt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${o}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${o*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function Bt(){return{outPhysics:zt,inPhysics:Xt,composition:{mode:"sequence"},build:Vt}}const Zt={snappy:Rt(),fluid:Bt()},et=8,qt={inertia:{acceleration:150,resistance:1.5}},jt={spring:{stiffness:180,damping:34}};function Kt({direction:e}){const t=e==="forward"?1:-1,n=-et*t,o=et*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${o}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${o*(1-s)}px, 0)`,opacity:`${s}`})}}}function Gt(){return{outPhysics:qt,inPhysics:jt,composition:{mode:"sequence"},build:Kt}}const Jt=8,Qt={inertia:{acceleration:150,resistance:1.5}},te={spring:{stiffness:180,damping:34}};function ee(e){const t=Jt;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function ne(){return{outPhysics:Qt,inPhysics:te,composition:{mode:"sequence"},build:ee}}const nt=Gt(),oe={snappy:nt,directional:nt,"non-directional":ne()},ot={spring:{stiffness:280,damping:30}},H=.1,W=1/3,st=e=>Math.max(0,Math.min(1,e));function se({direction:e}){const t=e==="forward"?1:-1,n=1-t*H;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`scale(${1+t*o*H})`,opacity:`${st(1-o/W)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:o=>({transform:`scale(${n+t*o*H})`,opacity:`${st((o-W)/(1-W))}`})}}}function ie(){return{outPhysics:ot,inPhysics:ot,composition:{mode:"parallel"},build:se}}const it={spring:{stiffness:280,damping:30}},U=.1,N=1/3,rt=e=>Math.max(0,Math.min(1,e));function re(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${rt(1-e/N)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-U})`,opacity:"0"},animate:e=>({transform:`scale(${1-U+e*U})`,opacity:`${rt((e-N)/(1-N))}`})}}}function ae(){return{outPhysics:it,inPhysics:it,composition:{mode:"parallel"},build:re}}const at=ie(),le={snappy:at,directional:at,"non-directional":ae()},ce={x:Zt,y:oe,z:le};function pe(e,t){const n=ce[e];return n[t]??n.snappy}const fe="x",de="snappy";function lt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,o]of Object.entries(t.startStyle))e.style[n]=o}function me(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}const he=(e={})=>{const t=e.direction??"forward",n=e.type??fe,o=e.feel??de,s=pe(n,o),i=s.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(c=>{lt(c,i.out),c.style.pointerEvents="none"}),l.then(c=>{lt(c,i.in)}),{}),animation:({from:r,to:l,context:c})=>{if(n==="z"){const f=_(c,"from"),d=_(c,"to");r.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`,l.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`}const a=new h.WebAnimation({element:r,integrator:g.from(s.outPhysics),style:f=>i.out.animate(f),onComplete:n==="z"?()=>{r.style.clipPath=""}:void 0}),p=new h.WebAnimation({element:l,integrator:g.from(s.inPhysics),style:f=>i.in.animate(f),onComplete:()=>me(l)});return new h.MultiAnimation([a,p],s.composition)}}};function ue(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function ye(e){const{paths:t}=e,n=e.type??"x",o=e.variant,s=e.feel,i=ue(n,o,s);return K(t,{forward:"forward",backward:"backward"},r=>he({type:n,direction:r,feel:i}))}const ge={spring:{stiffness:200,damping:22}},be=10,we="horizontal",Se="#000000";function ct(e,t,n,o,s,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
1
|
+
"use strict";var kt=Object.defineProperty;var Yt=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>Yt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./multi-animation-Dw2JTJI2.cjs");function _(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],r=e[o];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function xt(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function K(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const r=e[o],l=e[i];!r||!l||s.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return s}class k{constructor(t){$(this,"omega");$(this,"zeta");$(this,"restDelta");$(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:r}=this,{position:l,velocity:c}=t,a=-2*o*r*i*c,p=o*i*i*(n-l),d=c+a+p;return{position:l+o*d,velocity:d}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Lt{constructor(t){$(this,"leader");$(this,"follower");$(this,"restDelta");$(this,"restSpeed");this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD,this.leader=new k({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new k({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,s),l=this.follower.step(t,r.position,s);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Mt=.01,Ht=500,Wt=10;class Ut{constructor(t){$(this,"acceleration");$(this,"resistance");$(this,"resistanceType");$(this,"min");$(this,"max");$(this,"bounceStiffness");$(this,"bounceDamping");$(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Ht,this.bounceDamping=t.bounceDamping??Wt,this.restDelta=t.restDelta??Mt}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:d}=t,f=c!==void 0&&p<c,m=a!==void 0&&p>a;let y;if(f||m){const S=p-(f?c:a),C=-this.bounceStiffness*S,E=-this.bounceDamping*d;y=C+E}else{const w=n>p?1:-1;let S;l==="linear"?S=r*d:S=r*d*Math.abs(d),y=w*i-S}const h=d+y*o;let b=p+h*o;if(!f&&!m){const w=n>p?1:-1;(w>0&&b>n||w<0&&b<n)&&(b=n)}return{position:b,velocity:b===n?0:h}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class g{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new Ut({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Lt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new k({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return g.from({spring:t})}}class Vt{constructor(t){$(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),r=Math.abs(o)/this.durationSec,l=i*r*s,c=t.position+l;return(i>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<u.POSITION_THRESHOLD}}function T(e,t){function n(i){let r=0,l=0;const c=i.offsetWidth,a=i.offsetHeight;let p=i;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const s=n(e),o=n(t);return new DOMRect(o.left-s.left,o.top-s.top,o.width,o.height)}function D(e,t){const{scrollingElement:n,positionedParent:s}=e,o=n!==s&&n.contains(s)?T(n,s).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-o}}const J=8,Q={spring:{stiffness:1e3,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function zt({direction:e}){const t=e==="forward"?J:-J;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Nt(){return{outPhysics:Q,inPhysics:Q,composition:{mode:"parallel",startAt:[0,0]},build:zt}}const tt=30,Rt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Xt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Bt({direction:e}){const t=e==="forward"?1:-1,n=-tt*t,s=tt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function Zt(){return{outPhysics:Rt,inPhysics:Xt,composition:{mode:"sequence"},build:Bt}}const qt={snappy:Nt(),fluid:Zt()},et=8,jt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Kt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Gt({direction:e}){const t=e==="forward"?1:-1,n=-et*t,s=et*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function Jt(){return{outPhysics:jt,inPhysics:Kt,composition:{mode:"sequence"},build:Gt}}const Qt=8,te={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ee={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ne(e){const t=Qt;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function se(){return{outPhysics:te,inPhysics:ee,composition:{mode:"sequence"},build:ne}}const nt=Jt(),oe={snappy:nt,directional:nt,"non-directional":se()},st={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},H=.1,W=1/3,ot=e=>Math.max(0,Math.min(1,e));function ie({direction:e}){const t=e==="forward"?1:-1,n=1-t*H;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`scale(${1+t*s*H})`,opacity:`${ot(1-s/W)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:s=>({transform:`scale(${n+t*s*H})`,opacity:`${ot((s-W)/(1-W))}`})}}}function re(){return{outPhysics:st,inPhysics:st,composition:{mode:"parallel"},build:ie}}const it={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},U=.1,V=1/3,rt=e=>Math.max(0,Math.min(1,e));function ae(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${rt(1-e/V)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-U})`,opacity:"0"},animate:e=>({transform:`scale(${1-U+e*U})`,opacity:`${rt((e-V)/(1-V))}`})}}}function le(){return{outPhysics:it,inPhysics:it,composition:{mode:"parallel"},build:ae}}const at=re(),ce={snappy:at,directional:at,"non-directional":le()},pe={x:qt,y:oe,z:ce};function de(e,t){const n=pe[e];return n[t]??n.snappy}const fe="x",ye="snappy";function lt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function At(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function he(e){At(e),e.style.pointerEvents=""}const ue=(e={})=>{const t=e.direction??"forward",n=e.type??fe,s=e.feel??ye,o=de(n,s),i=o.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(c=>{lt(c,i.out),c.style.pointerEvents="none"}),l.then(c=>{lt(c,i.in)}),{}),animation:({from:r,to:l,context:c})=>{if(n==="z"){const d=D(c,"from"),f=D(c,"to");r.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,l.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`}const a=new u.WebAnimation({element:r,integrator:g.from(o.outPhysics),style:d=>i.out.animate(d),onComplete:()=>he(r)}),p=new u.WebAnimation({element:l,integrator:g.from(o.inPhysics),style:d=>i.in.animate(d),onComplete:()=>At(l)});return new u.MultiAnimation([a,p],o.composition)}}};function me(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function ge(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=me(n,s,o);return K(t,{forward:"forward",backward:"backward"},r=>ue({type:n,direction:r,feel:i}))}const be={spring:{stiffness:200,damping:22}},we=10,Se="horizontal",$e="#000000";function ct(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
z-index: 9999;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
`;const c=[];for(let a=0;a<t;a++){const p=document.createElement("div");if(n==="horizontal"){const
|
|
10
|
+
`;const c=[];for(let a=0;a<t;a++){const p=document.createElement("div");if(n==="horizontal"){const d=100/t;p.style.cssText=`
|
|
11
11
|
position: absolute;
|
|
12
|
-
top: ${
|
|
12
|
+
top: ${d*a}%;
|
|
13
13
|
left: 0;
|
|
14
14
|
width: 100%;
|
|
15
|
-
height: calc(${
|
|
16
|
-
background: ${
|
|
17
|
-
transform: scaleX(${
|
|
15
|
+
height: calc(${d}% + 1px);
|
|
16
|
+
background: ${s};
|
|
17
|
+
transform: scaleX(${o==="hidden"?0:1});
|
|
18
18
|
transform-origin: ${i} center;
|
|
19
19
|
will-change: transform;
|
|
20
|
-
`}else{const
|
|
20
|
+
`}else{const d=100/t;p.style.cssText=`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0;
|
|
23
|
-
left: ${
|
|
24
|
-
width: calc(${
|
|
23
|
+
left: ${d*a}%;
|
|
24
|
+
width: calc(${d}% + 1px);
|
|
25
25
|
height: 100%;
|
|
26
|
-
background: ${
|
|
27
|
-
transform: scaleY(${
|
|
26
|
+
background: ${s};
|
|
27
|
+
transform: scaleY(${o==="hidden"?0:1});
|
|
28
28
|
transform-origin: ${i==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}c.push(p),l.appendChild(p)}return e.appendChild(l),{container:l,blinds:c}}const
|
|
30
|
+
`}c.push(p),l.appendChild(p)}return e.appendChild(l),{container:l,blinds:c}}const Ee=(e={})=>{const t=e.blindCount??we,n=e.direction??Se,s=e.blindColor??$e,o=e.physics??be;return{prepare:async({from:i,to:r})=>{const l=await i,c=await r;l.style.zIndex="1000";const a=ct(l,t,n,s,"hidden","left");c.style.position="relative",c.style.zIndex="0";const p=ct(c,t,n,s,"closed","right");return{fromEl:l,fromBlinds:a.blinds,fromContainer:a.container,toBlinds:p.blinds,toContainer:p.container}},animation:({fromEl:i,fromBlinds:r,fromContainer:l,toBlinds:c,toContainer:a})=>{const p=r.map(y=>new u.WebAnimation({element:y,integrator:g.from(o),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),d=c.map((y,h)=>new u.WebAnimation({element:y,integrator:g.from(o),style:(b,w)=>({transform:n==="horizontal"?`scaleX(${w})`:`scaleY(${w})`}),onComplete:h===c.length-1?()=>{a.remove(),l.remove(),i.style.zIndex="",i.style.position=""}:void 0})),f=new u.MultiAnimation(p,{mode:"parallel"}),m=new u.MultiAnimation(d,{mode:"parallel"});return new u.MultiAnimation([f,m],{mode:"sequence"})}}};function Ce(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Ee({direction:n}))}const xe={spring:{stiffness:200,damping:20,doubleSpring:.7}},O=.5;function Ae(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`,opacity:`${O+(1-O)*(1-s)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${O}`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`,opacity:`${O+(1-O)*s}`})}}}function Pe(){return{physics:xe,build:Ae}}const _e={spring:{stiffness:170,damping:22}};function De(e){const t=e==="enter"?-20:100,n=e==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`})}}}function Ie(){return{physics:_e,build:De}}const Oe={parallax:Ie(),crossfade:Pe()},Te="parallax";function pt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}const ve=(e={})=>{const t=e.direction??"enter",n=Oe[e.type??Te],s=n.physics,o=n.build(t);return{prepare:({from:i,to:r})=>(i.then(l=>{pt(l,o.out),l.style.pointerEvents="none",l.style.zIndex=t==="enter"?"-1":"100"}),r.then(l=>{pt(l,o.in)}),{}),animation:({from:i,to:r})=>{const l=new u.WebAnimation({element:i,integrator:g.from(s),style:a=>o.out.animate(a),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.opacity="",i.style.pointerEvents="",i.style.zIndex=""}}),c=new u.WebAnimation({element:r,integrator:g.from(s),style:a=>o.in.animate(a),onComplete:()=>{r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain="",r.style.transform="",r.style.opacity=""}});return new u.MultiAnimation([l,c],{mode:"parallel"})}}};function Fe(e){return e==="slide"||e==="crossfade"?"crossfade":"parallax"}function ke(e){const{enter:t,exit:n}=e,s=e.type,o=Fe(s);return xt({enter:t,exit:n},i=>ve({direction:i,type:o}))}const Ye={spring:{stiffness:180,damping:20,doubleSpring:!0}},Le={spring:{stiffness:170,damping:20,doubleSpring:!0}},Me=(e={})=>{const t=e.physics??Le,n=e.physics??Ye;return{prepare:({to:s})=>(s.then(o=>{o.style.opacity="0",o.style.willChange="opacity"}),{}),animation:({from:s,to:o})=>{const i=new u.WebAnimation({element:s,integrator:g.from(n),style:(l,c)=>({opacity:c}),onComplete:()=>{s.style.willChange="auto",s.style.opacity=""}}),r=new u.WebAnimation({element:o,integrator:g.from(t),style:l=>({opacity:l}),onComplete:()=>{o.style.willChange="auto",o.style.opacity=""}});return new u.MultiAnimation([i,r],{mode:"sequence"})}}};function He(e){const{paths:t}=e;return _(t,()=>Me())}const z={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},I={scaleDown:0,translate:.2,scaleUp:.8},We=.8,Ue="white",dt=1e3/60,Ve=600;function ze(e){const{items:t,from:n,to:s,recordFrame:o}=e,i=dt/1e3,r=Math.abs(s-n),l=t.map(a=>({item:a,integrator:new k({stiffness:a.spring.stiffness,damping:a.spring.damping}),state:{position:n,velocity:0},started:!1,settled:!1,settleTime:0}));for(let a=0;a<l.length;a++)(a===0||l[a].item.offset===0)&&(l[a].started=!0);o(0);let c=0;for(let a=1;a<=Ve;a++){const p=a*dt;c=p;for(const d of l)!d.started||d.settled||(d.state=d.integrator.step(d.state,s,i),d.integrator.isSettled(d.state,s)?(d.settleTime+=i,d.settleTime>=u.SETTLE_THRESHOLD&&(d.state={position:s,velocity:0},d.settled=!0)):d.settleTime=0,d.item.tick(d.state.position));for(let d=1;d<l.length;d++){const f=l[d];if(f.started)continue;const m=l[d-1];if(!m.started)continue;(r===0?1:Math.abs(m.state.position-n)/r)>=f.item.offset&&(f.started=!0)}if(o(p),l.every(d=>d.settled))return p}return c}function N(e,t){return e!=null&&e.spring?{stiffness:e.spring.stiffness,damping:e.spring.damping}:t}function ft(e){const{rect:t,scale:n,direction:s,override:o}=e,i=s==="out"?{scale:1,translateY:-t.top}:{scale:n,translateY:-t.top+t.height},r=N(o,z.scaleDown),l=N(o,z.translate),c=N(o,z.scaleUp),a=s==="out"?1:0,p=s==="out"?0:1,d=s==="out"?[{spring:r,offset:I.scaleDown,tick:y=>{const h=1-y;i.scale=1-(1-n)*h}},{spring:l,offset:I.translate,tick:y=>{const h=1-y;i.translateY=-t.top-t.height*h}},{spring:c,offset:I.scaleUp,tick:y=>{const h=1-y;i.scale=n+(1-n)*h}}]:[{spring:r,offset:I.scaleDown,tick:y=>{i.scale=1-(1-n)*y}},{spring:l,offset:I.translate,tick:y=>{i.translateY=-t.top+t.height*(1-y)}},{spring:c,offset:I.scaleUp,tick:y=>{i.scale=n+(1-n)*y}}],f=[],m=ze({items:d,from:a,to:p,recordFrame:y=>f.push({time:y,scale:i.scale,translateY:i.translateY})});return{snapshots:f,totalDuration:m}}function Ne(e,t){if(e.length===0)return{time:0,scale:1,translateY:0};if(e.length===1||t<=0)return e[0];if(t>=1)return e[e.length-1];const n=t*(e.length-1),s=Math.floor(n),o=Math.ceil(n);if(s===o)return e[s];const i=e[s],r=e[o],l=n-s;return{time:i.time+(r.time-i.time)*l,scale:i.scale+(r.scale-i.scale)*l,translateY:i.translateY+(r.translateY-i.translateY)*l}}const Re=[[1,1],[-1,1],[1,-1],[-1,-1]];function Xe(e,t){const o=(i,r,l)=>{const c=document.createElement("div");Object.assign(c.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...i});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:e,[l]:"0",[r]:"0"});const p=document.createElement("div");return Object.assign(p.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:e,[l]:"0",[r]:"0"}),c.appendChild(a),c.appendChild(p),c};return{topLeft:o({top:`${t.top-1}px`,left:`${t.left-1}px`},"left","top"),topRight:o({top:`${t.top-1}px`,left:`${t.left+t.width-15+1}px`},"right","top"),bottomLeft:o({top:`${t.top+t.height-15+1}px`,left:`${t.left-1}px`},"left","bottom"),bottomRight:o({top:`${t.top+t.height-15+1}px`,left:`${t.left+t.width-15+1}px`},"right","bottom")}}function yt(e,t){const n=t.left+t.width/2,s=t.top+t.height/2;e.style.transformOrigin=`${n}px ${s}px`}function ht(e,t){e.style.clipPath=`polygon(
|
|
31
31
|
${t.left}px ${t.top}px,
|
|
32
32
|
${t.left+t.width}px ${t.top}px,
|
|
33
33
|
${t.left+t.width}px ${t.top+t.height}px,
|
|
34
34
|
${t.left}px ${t.top+t.height}px
|
|
35
|
-
)`}function X(e,t,n,o,s){const i=n/1e3;return new h.WebAnimation({element:e,integrator:new Ut({durationSec:i}),lowerBound:0,upperBound:1,style:r=>o(Re(t,r)),onComplete:s})}const Ve=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??We,n=He,o=e.physics;return{prepare:({from:i,to:r,context:l})=>{const c=_(l,"from"),a=_(l,"to"),p=O(document.body,l.positionedParent),f=Xe(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(f[d]);return i.then(d=>{mt(d,c),ht(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{mt(d,a),ht(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:f,fromRect:c,toRect:a}},animation:({from:i,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const f=dt({rect:a,scale:n,direction:"out",override:o}),d=dt({rect:p,scale:n,direction:"in",override:o}),y=X(i,f.snapshots,f.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin=""}),m=X(r,d.snapshots,d.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),u=ze.map(([w,E],x)=>{const T=["topLeft","topRight","bottomLeft","bottomRight"][x];return X(c[T],f.snapshots,f.totalDuration,A=>{const C=(a.width-a.width*A.scale)/2*.7*w,M=(a.height-a.height*A.scale)/2*.7*E;return{transform:`translate(${C}px, ${M}px)`}})}),b=new h.MultiAnimation([y,m,...u],{mode:"parallel"}),$=b.onComplete;return b.onComplete=()=>{$==null||$();const w=l.positionedParent;for(const E of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[E];x.parentElement===w&&w.removeChild(x)}},b}}};function Be(e){const{paths:t,options:n}=e,o=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return P(t,()=>Ve(o))}const ut="data-hero-enter-key",yt="data-hero-exit-key",V="data-hero-key";class Ze{prepare(t){t.from.then(n=>{n.style.opacity="0"})}}const qe=()=>new Ze;class je{contribute(t){const{from:n,to:o,physics:s,onComplete:i}=t,r=n.style.opacity,l=o.style.opacity,c=n.style.willChange,a=o.style.willChange;return o.style.opacity="0",n.style.willChange="opacity",o.style.willChange="opacity",i(()=>{n.style.opacity=r,o.style.opacity=l,n.style.willChange=c,o.style.willChange=a}),[new h.WebAnimation({element:n,integrator:g.from(s),style:(p,f)=>({opacity:f})}),new h.WebAnimation({element:o,integrator:g.from(s),style:p=>({opacity:p})})]}}const Ke=()=>new je,Ge={static:qe,fade:Ke},Je={spring:{stiffness:320,damping:30}},Qe=()=>Je,tn={spring:{stiffness:300,damping:30,doubleSpring:1}},en=()=>tn,nn={default:Qe,smooth:en},on=700,sn="data-hero-aspect-ratio",rn="data-hero-radius";function an(e){if(!e)return null;if(e.includes("/")){const[n,o]=e.split("/"),s=parseFloat(n??""),i=parseFloat(o??"");return!Number.isFinite(s)||!Number.isFinite(i)||s<=0||i<=0?null:s/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function gt(e){const t=e.getAttribute(rn);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function L(e){return e.left+e.width/2}function k(e){return e.top+e.height/2}function ln(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function cn(e,t,n){const o=e.width/e.height;let s,i;return n==="contain"?o>t?(i=e.height,s=i*t):(s=e.width,i=s/t):o>t?(s=e.width,i=s/t):(i=e.height,s=i*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-i)/2,width:s,height:i}}function bt(e,t,n){const o=O(e,t),s=an(t.getAttribute(sn));if(s===null)return{bbox:o,content:o,window:o,clipInset:{top:0,right:0,bottom:0,left:0}};const i=cn(o,s,n),r=n==="cover"?o:i;return{bbox:o,content:i,window:r,clipInset:ln(i,r)}}function pn(e,t,n,o){const s=n.width/o,i=n.height/o,r=e.width/2+(L(n)-L(t))/o-s/2,l=e.height/2+(k(n)-k(t))/o-i/2;return{top:Math.max(0,l),right:Math.max(0,e.width-r-s),bottom:Math.max(0,e.height-l-i),left:Math.max(0,r)}}function v(e,t){const n=new Map,o=e.querySelectorAll(`[${t}]`);for(const s of Array.from(o)){const i=s.getAttribute(t);i&&(n.has(i)||n.set(i,s))}return n}function fn(e,t){const n=[],o=v(t,ut),s=v(e,yt);for(const[l,c]of o){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:"cover",toFit:"contain"})}const i=v(e,ut),r=v(t,yt);for(const[l,c]of i){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:"contain",toFit:"cover"})}return n}function dn(e,t){const n=[],o=Array.from(t.querySelectorAll(`[${V}]`));for(const s of o){const i=s.getAttribute(V);if(!i)continue;const r=e.querySelector(`[${V}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:s,fromFit:"contain",toFit:"contain"})}return n}function mn(e,t){const n=fn(e,t);return n.length>0?n:dn(e,t)}function hn(e,t,n){const{fromEl:o,toEl:s}=t,i=bt(e,o,t.fromFit),r=bt(e,s,t.toFit),l=i.content,c=i.window,a=r.content,p=r.window,f=r.clipInset,d=gt(o),y=gt(s);if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const m=Math.max(l.width/a.width,l.height/a.height),u=L(l),b=k(l),$=L(a),w=k(a),E=u-$,x=b-w;if(Math.abs(x)>n)return null;const T=pn(a,l,c,m);return{toContent:a,hasRadius:d>0||y>0,styleFor:(A,C)=>{const M=C*E,_t=C*x,G=A+C*m,Tt=(d*C+y*A)/G,Dt=T.top*C+f.top*A,It=T.right*C+f.right*A,Ot=T.bottom*C+f.bottom*A,vt=T.left*C+f.left*A;return{transform:`translate(${M}px, ${_t}px) scale(${G})`,clipPath:`inset(${Dt}px ${It}px ${Ot}px ${vt}px round ${Tt}px)`}}}}function un(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class yn{contribute(t){const{resolved:n,physics:o,positionedParent:s,maxDistance:i,onComplete:r}=t,l=[];for(const c of n.pairs){const{fromEl:a,toEl:p}=c,f=hn(s,c,i);if(!f)continue;const d=p.cloneNode(!0);d.style.position="absolute",d.style.left=`${f.toContent.left}px`,d.style.top=`${f.toContent.top}px`,d.style.width=`${f.toContent.width}px`,d.style.height=`${f.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",f.hasRadius&&(d.style.borderRadius="0"),un(d,f.styleFor(0,1)),s.appendChild(d);const y=a.style.opacity,m=p.style.opacity;a.style.opacity="0",p.style.opacity="0",r(()=>{a.style.opacity=y,p.style.opacity=m,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new h.WebAnimation({element:d,integrator:g.from(o),style:f.styleFor}))}return l}}function gn(e){return[new yn,Ge[e.type]()]}const bn=e=>{const t=gn(e),n=nn[e.variant](),o=on;return{prepare:s=>{var l;const i=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:mn(c,a)})),r={from:s.from,to:s.to,resolved:i};for(const c of t)(l=c.prepare)==null||l.call(c,r);return i.then(c=>({resolved:c}))},animation:({from:s,to:i,context:r,resolved:l})=>{if(l.pairs.length===0)return new h.MultiAnimation([],{mode:"parallel"});const c=[],a=m=>{c.push(m)},p={from:s,to:i,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:o,onComplete:a},f=[];for(const m of t)m.contribute&&f.push(...m.contribute(p));if(f.length===0)return new h.MultiAnimation([],{mode:"parallel"});const d=new h.MultiAnimation(f,{mode:"parallel"}),y=d.onComplete;return d.onComplete=()=>{y==null||y();for(const m of c)try{m()}catch(u){console.error("[hero] cleanup error",u)}},d}}};function wn(e){const{paths:t}=e,n=e.type??"static",o=e.variant??"default";return P(t,()=>bn({type:n,variant:o}))}const Sn={spring:{stiffness:50,damping:30}},$n={spring:{stiffness:80,damping:25}},En=(e={})=>{const t=e.physics??Sn,n=e.initialRotation??45,o=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:l})=>(i.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=_(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const f=a.left+a.width/2,d=a.top+a.height/2;c.style.transformOrigin=`${f}px ${d}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${o}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const l=new h.WebAnimation({element:i,integrator:g.from($n),style:(a,p)=>({opacity:p})}),c=new h.WebAnimation({element:r,integrator:g.from(t),style:a=>{let p;if(a<=.05)p=o;else if(a<=s){const m=(a-.05)/(s-.05),u=Math.pow(m,9);p=o+(.8-o)*u}else{const m=(a-s)/(1-s);p=.8+.2*(1-Math.pow(1-m,3))}const f=.7;let d;if(a<=f)d=n;else{const m=(a-f)/(1-f),u=1-Math.pow(1-m,2);d=n*(1-u)}let y;if(a<=f)y=1;else{const m=(a-f)/(1-f);y=1-Math.pow(m,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":y.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new h.MultiAnimation([l,c],{mode:"parallel"})}}};function xn(e){const{paths:t}=e;return P(t,()=>En())}const Cn={spring:{stiffness:100,damping:30}},An=(e={})=>{const t=e.physics??Cn;return{prepare:({from:n,to:o})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),o.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:o})=>{const s=new h.WebAnimation({element:n,integrator:g.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0})}),i=new h.WebAnimation({element:o,integrator:g.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{o.style.willChange="auto",o.style.transform="",o.style.transformOrigin="",o.style.opacity=""}});return new h.MultiAnimation([s,i],{mode:"parallel"})}}};function Pn(e){const{paths:t}=e;return P(t,()=>An())}const _n={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},wt=(e={})=>{const t=e.direction??"up",n=e.physics??_n,o=t==="up";return{prepare:({from:s,to:i})=>(s.then(r=>{r.style.zIndex=o?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:s,to:i})=>{const r=s.offsetHeight,l=i.offsetHeight,c=window.innerHeight,a=Math.max(Math.min(r,l),c),p=new h.WebAnimation({element:s,integrator:g.from(n),style:d=>({transform:`translate3d(0, ${o?-a*d:a*d}px, 0)`})}),f=new h.WebAnimation({element:i,integrator:g.from(n),style:(d,y)=>({transform:`translate3d(0, ${o?y*a:y*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([p,f],{mode:"parallel"})}}};function Tn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?P(t,()=>wt({direction:"up"})):K(t,{forward:"up",backward:"down"},o=>wt({direction:o}))}const Dn={spring:{stiffness:200,damping:24}},In={inertia:{acceleration:25,resistance:1.2}},B=.2;function On(){return{enterPhysics:Dn,exitPhysics:In,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-B*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-B+B*e})`,opacity:e})}}}const vn={spring:{stiffness:300,damping:30}},Fn={inertia:{acceleration:30,resistance:1}};function Yn(){return{enterPhysics:vn,exitPhysics:Fn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Ln={static:Yn(),"background-scale":On()},kn="static",Mn="transform",Hn=(e={})=>{const t=e.direction??"enter",n=Ln[e.type??kn],o=t==="enter"?n.enterPhysics:n.exitPhysics,s=n.background,i=s.willChange!=="";return{prepare:({from:r,to:l})=>{const c=t==="enter"?l:r,a=t==="enter"?r:l;return c.then(p=>{p.style.willChange=Mn,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=s.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:l,context:c})=>{const a=t==="enter"?l:r,p=t==="enter"?r:l,f=_(c,t==="enter"?"to":"from");a.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`;const d=t==="enter"?(E,x)=>({transform:`translate3d(0, ${x*f.height}px, 0)`}):E=>({transform:`translate3d(0, ${E*f.height}px, 0)`}),y=new h.WebAnimation({element:a,integrator:g.from(o),style:d,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform=""}});if(!i)return new h.MultiAnimation([y],{mode:"parallel"});const m=_(c,t==="enter"?"from":"to"),u=m.left+m.width/2,b=m.top+m.height/2;p.style.clipPath=`inset(${m.top}px 0 calc(100% - ${m.top+m.height}px) 0)`,p.style.transformOrigin=`${u}px ${b}px`;const $=t==="enter"?(E,x)=>s.enterStyle(E,x):E=>s.exitStyle(E),w=new h.WebAnimation({element:p,integrator:g.from(o),style:$,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:void 0});return new h.MultiAnimation([y,w],{mode:"parallel"})}}};function Wn(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Un(e){const{enter:t,exit:n}=e,o=e.type,s=Wn(o);return Ct({enter:t,exit:n},i=>Hn({direction:i,type:s}))}const Nn={spring:{stiffness:170,damping:22,doubleSpring:.8}},Rn=(e={})=>{const t=e.direction??"left",n=e.physics??Nn,o=t==="left";return{prepare:({from:s,to:i})=>(s.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:s,to:i})=>{const r=new h.WebAnimation({element:s,integrator:g.from(n),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`})}),l=new h.WebAnimation({element:i,integrator:g.from(n),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([r,l],{mode:"parallel"})}}};function zn(e){const{paths:t}=e;return K(t,{forward:"left",backward:"right"},n=>Rn({direction:n}))}const Xn={spring:{stiffness:17,damping:6}},Z=20,F=800,Vn=(e={})=>{const t=e.physics??Xn;return{prepare:({from:n,to:o})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${F}px) rotateY(0deg) translate3d(0%, 0, 0)`}),o.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${F}px) rotateY(${Z}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:o})=>{const s=new h.WebAnimation({element:n,integrator:g.from(t),style:r=>{const l=-r*Z,c=r*100;return{transform:`perspective(${F}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}}}),i=new h.WebAnimation({element:o,integrator:g.from(t),style:(r,l)=>{const c=l*Z,a=-l*100;return{transform:`perspective(${F}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{o.style.transform="",o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain=""}});return new h.MultiAnimation([s,i],{mode:"sequence"})}}};function Bn(e){const{paths:t}=e;return P(t,()=>Vn())}function Zn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:o,enterRadius:s,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-o.x,l=t.top-e.top+(t.height-e.height)/2-o.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,d=(n.height-(e.top+e.height))/n.height*100,y=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:m=>{const u=1-m,b=1+(c-1)*u,$=1+(a-1)*u,E=(i*u+s*(1-u))/((b+$)/2);return{clipPath:`inset(${p*u}% ${f*u}% ${d*u}% ${y*u}% round ${E}px)`,transform:`translate(${r*u}px, ${l*u}px) scale(${b}, ${$})`}}}}function qn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:o,enterRadius:s,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+o.x,l=t.top-e.top+(t.height-e.height)/2+o.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,d=(n.height-(e.top+e.height))/n.height*100,y=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:m=>{const u=1-m,b=1+(c-1)*u,$=1+(a-1)*u,E=(s*(1-u)+i*u)/((b+$)/2);return{clipPath:`inset(${p*u}% ${f*u}% ${d*u}% ${y*u}% round ${E}px)`,transform:`translate(${r*u-o.x}px, ${l*u}px) scale(${b}, ${$})`}}}}const jn={spring:{stiffness:430,damping:33,doubleSpring:1}},At=.12,Kn=18;function Gn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-At*t})`}}}}function Jn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-At*t})`}}}}const q={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,o=`blur(${Kn*n}px)`;return{backdropFilter:o,WebkitBackdropFilter:o}}};class Qn{constructor(){S(this,"physics",jn)}contribute(t){const{from:n,to:o,resolved:s,physics:i}=t,r=s.mode==="enter",l=r?n:o,c=r?Gn():Jn();return c&&(l.style.transformOrigin=c.transformOrigin),[new h.WebAnimation({element:l,integrator:g.from(i),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class to{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,q.initialStyle),n.style.willChange=q.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?(n.style.zIndex=t.resolved.mode==="enter"?"-1":"1",[new h.WebAnimation({element:n,integrator:g.from(t.physics),style:o=>q.style(t.resolved.mode,o)})]):[]}}const eo={spring:{stiffness:430,damping:33,doubleSpring:1}};function no({enterRect:e,exitRect:t,scrollOffset:n}){const o=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function oo({enterRect:e,exitRect:t,scrollOffset:n}){const o=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class so{constructor(){S(this,"physics",eo)}contribute(t){const{from:n,to:o,resolved:s,input:i,physics:r}=t,l=s.mode==="enter",c=l?n:o,a=l?no(i):oo(i);return a&&(c.style.transformOrigin=a.transformOrigin),[new h.WebAnimation({element:c,integrator:g.from(r),style:l?(p,f)=>a.animate(f):p=>a.animate(p)})]}}const io={spring:{stiffness:530,damping:34,doubleSpring:1}};class ro{constructor(){S(this,"physics",io)}contribute(t){return[]}}const ao={expand:()=>new so,static:()=>new ro,blur:()=>new Qn};function lo(e){return ao[e]()}const j="data-zoom-enter-key",St="data-zoom-exit-key",co="data-zoom-radius";function $t(e){const t=e.getAttribute(co);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function po(e,t){const n=[];let o=t;for(;o&&o!==e;){const s=o.parentElement;if(!s)break;for(const i of Array.from(s.children))i!==o&&i instanceof HTMLElement&&n.push(i);o=s}return n}function Et(e){const t=e.querySelectorAll(`[${j}]`);return t.length!==1?null:t[0]}function xt(e,t){const n=e.querySelectorAll(`[${St}]`);for(const o of n)if(o.getAttribute(St)===t)return o;return null}function fo(e,t){const n=Et(e),o=Et(t);if(!n&&o){const s=o.getAttribute(j);if(!s)return null;const i=xt(e,s);return i?{mode:"enter",enterEl:o,exitEl:i}:null}if(n&&!o){const s=n.getAttribute(j);if(!s)return null;const i=xt(t,s);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function mo(e,t,n,o){return{enterRect:O(e.mode==="enter"?n:t,e.enterEl),exitRect:O(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:o,enterRadius:$t(e.enterEl),exitRadius:$t(e.exitEl)}}class ho{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:o,resolved:s,input:i,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?Zn(i):qn(i),p=c?o:n,f=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?"-2":"2",y=n.style.zIndex;return n.style.zIndex=d,l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=y}),[new h.WebAnimation({element:p,integrator:g.from(r),style:f==="t"?m=>a.animate(m):(m,u)=>a.animate(u)})]}}class uo{contribute(t){const{resolved:n,physics:o,from:s,to:i,onComplete:r}=t,l=n.mode==="enter"?i:s,c=po(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const f=c[p];f&&(f.style.opacity=a[p]??"")}}),c.map(p=>new h.WebAnimation({element:p,integrator:g.from(o),style:(f,d)=>({opacity:n.mode==="enter"?f:d})}))}}class Pt{contribute(){return[]}}const yo={default:()=>new Pt,fade:()=>new uo};function go(e){return yo[e]()}class bo extends Pt{}function wo(e){const t=lo(e.type);return{strategies:[new ho,t,go(e.variant),new bo,...e.type==="blur"?[new to]:[]],physics:t.physics}}const So=e=>{const{strategies:t,physics:n}=wo(e);return{prepare:o=>{const s={from:o.from,to:o.to,context:{positionedParent:o.context.positionedParent},createElement:o.createElement},i={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(i,l)}return i},animation:({from:o,to:s,context:i,...r})=>{const l=fo(o,s);if(!l)return new h.MultiAnimation([],{mode:"parallel"});const c=mo(l,o,s,i.scrollOffset),a=[],f={from:o,to:s,resolved:l,input:c,physics:n,extras:r,onComplete:m=>{a.push(m)}},d=[];for(const m of t)m.contribute&&d.push(...m.contribute(f));const y=d[0];if(y){const m=y.onComplete;y.onComplete=()=>{m==null||m();for(const u of a)try{u()}catch(b){console.error("[zoom] cleanup error",b)}}}return new h.MultiAnimation(d,{mode:"parallel"})}}};function $o(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Eo(e){const t=$o(e);return P(e.paths,()=>So(t))}exports.Animation=h.Animation;exports.MultiAnimation=h.MultiAnimation;exports.WebAnimation=h.WebAnimation;exports.axis=ye;exports.blind=Ee;exports.drill=Fe;exports.fade=Me;exports.film=Be;exports.hero=wn;exports.jaemin=xn;exports.rotate=Pn;exports.scroll=Tn;exports.sheet=Un;exports.slide=zn;exports.strip=Bn;exports.zoom=Eo;
|
|
35
|
+
)`}function R(e,t,n,s,o){const i=n/1e3;return new u.WebAnimation({element:e,integrator:new Vt({durationSec:i}),lowerBound:0,upperBound:1,style:r=>s(Ne(t,r)),onComplete:o})}const Be=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??Ue,n=We,s=e.physics;return{prepare:({from:i,to:r,context:l})=>{const c=D(l,"from"),a=D(l,"to"),p=T(document.body,l.positionedParent),d=Xe(t,{...c,top:p.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(d[f]);return i.then(f=>{yt(f,c),ht(f,c),f.style.transform=`translateY(${-c.top}px)`}),r.then(f=>{yt(f,a),ht(f,a),f.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:d,fromRect:c,toRect:a}},animation:({from:i,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const d=ft({rect:a,scale:n,direction:"out",override:s}),f=ft({rect:p,scale:n,direction:"in",override:s}),m=R(i,d.snapshots,d.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=R(r,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),h=Re.map(([S,C],E)=>{const x=["topLeft","topRight","bottomLeft","bottomRight"][E];return R(c[x],d.snapshots,d.totalDuration,P=>{const A=(a.width-a.width*P.scale)/2*.7*S,M=(a.height-a.height*P.scale)/2*.7*C;return{transform:`translate(${A}px, ${M}px)`}})}),b=new u.MultiAnimation([m,y,...h],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=l.positionedParent;for(const C of["topLeft","topRight","bottomLeft","bottomRight"]){const E=c[C];E.parentElement===S&&S.removeChild(E)}},b}}};function Ze(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>Be(s))}const ut="data-hero-enter-key",mt="data-hero-exit-key",X="data-hero-key";class qe{constructor(){$(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const je=()=>new qe;class Ke{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,r=n.style.opacity,l=s.style.opacity,c=n.style.willChange,a=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=r,s.style.opacity=l,n.style.willChange=c,s.style.willChange=a}),[new u.WebAnimation({element:n,integrator:g.from(o),style:(p,d)=>({opacity:d})}),new u.WebAnimation({element:s,integrator:g.from(o),style:p=>({opacity:p})})]}}const Ge=()=>new Ke,Je={static:je,fade:Ge},Qe={spring:{stiffness:320,damping:30}},tn=()=>Qe,en={spring:{stiffness:300,damping:30,doubleSpring:1}},nn=()=>en,sn={default:tn,smooth:nn},on=700,rn="data-hero-aspect-ratio",an="data-hero-radius";function ln(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function gt(e){const t=e.getAttribute(an);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function Y(e){return e.left+e.width/2}function L(e){return e.top+e.height/2}function cn(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function pn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function bt(e,t,n){const s=T(e,t),o=ln(t.getAttribute(rn));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=pn(s,o,n),r=n==="cover"?s:i;return{bbox:s,content:i,window:r,clipInset:cn(i,r)}}function dn(e,t,n,s){const o=n.width/s,i=n.height/s,r=e.width/2+(Y(n)-Y(t))/s-o/2,l=e.height/2+(L(n)-L(t))/s-i/2;return{top:Math.max(0,l),right:Math.max(0,e.width-r-o),bottom:Math.max(0,e.height-l-i),left:Math.max(0,r)}}function v(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function fn(e,t){const n=[],s=v(t,ut),o=v(e,mt);for(const[l,c]of s){const a=o.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:"cover",toFit:"contain"})}const i=v(e,ut),r=v(t,mt);for(const[l,c]of i){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:"contain",toFit:"cover"})}return n}function yn(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${X}]`));for(const o of s){const i=o.getAttribute(X);if(!i)continue;const r=e.querySelector(`[${X}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function hn(e,t){const n=fn(e,t);return n.length>0?n:yn(e,t)}function un(e,t,n){const{fromEl:s,toEl:o}=t,i=bt(e,s,t.fromFit),r=bt(e,o,t.toFit),l=i.content,c=i.window,a=r.content,p=r.window,d=r.clipInset,f=gt(s),m=gt(o);if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const y=Math.max(l.width/a.width,l.height/a.height),h=Y(l),b=L(l),w=Y(a),S=L(a),C=h-w,E=b-S;if(Math.abs(E)>n)return null;const x=dn(a,l,c,y);return{toContent:a,hasRadius:f>0||m>0,styleFor:(P,A)=>{const M=A*C,Dt=A*E,G=P+A*y,It=(f*A+m*P)/G,Ot=x.top*A+d.top*P,Tt=x.right*A+d.right*P,vt=x.bottom*A+d.bottom*P,Ft=x.left*A+d.left*P;return{transform:`translate(${M}px, ${Dt}px) scale(${G})`,clipPath:`inset(${Ot}px ${Tt}px ${vt}px ${Ft}px round ${It}px)`}}}}function mn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class gn{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:r}=t,l=[];for(const c of n.pairs){const{fromEl:a,toEl:p}=c,d=un(o,c,i);if(!d)continue;const f=p.cloneNode(!0);f.style.position="absolute",f.style.left=`${d.toContent.left}px`,f.style.top=`${d.toContent.top}px`,f.style.width=`${d.toContent.width}px`,f.style.height=`${d.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",d.hasRadius&&(f.style.borderRadius="0"),mn(f,d.styleFor(0,1)),o.appendChild(f);const m=a.style.opacity,y=p.style.opacity;a.style.opacity="0",p.style.opacity="0",r(()=>{a.style.opacity=m,p.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),l.push(new u.WebAnimation({element:f,integrator:g.from(s),style:d.styleFor}))}return l}}function bn(e){return[new gn,Je[e.type]()]}const wn=e=>{const t=bn(e),n=sn[e.variant](),s=on;return{prepare:o=>{var l;const i=Promise.all([o.from,o.to]).then(([c,a])=>({pairs:hn(c,a)})),r={from:o.from,to:o.to,resolved:i};for(const c of t)(l=c.prepare)==null||l.call(c,r);return i.then(c=>({resolved:c}))},animation:({from:o,to:i,context:r,resolved:l})=>{if(l.pairs.length===0)return new u.MultiAnimation([],{mode:"parallel"});const c=[],a=y=>{c.push(y)},p={from:o,to:i,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:s,onComplete:a},d=[];for(const y of t)y.contribute&&d.push(...y.contribute(p));if(d.length===0)return new u.MultiAnimation([],{mode:"parallel"});const f=new u.MultiAnimation(d,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of c)try{y()}catch(h){console.error("[hero] cleanup error",h)}},f}}};function Sn(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>wn({type:n,variant:s}))}const $n={spring:{stiffness:50,damping:30}},En={spring:{stiffness:80,damping:25}},Cn=(e={})=>{const t=e.physics??$n,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:l})=>(i.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=D(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const d=a.left+a.width/2,f=a.top+a.height/2;c.style.transformOrigin=`${d}px ${f}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const l=new u.WebAnimation({element:i,integrator:g.from(En),style:(a,p)=>({opacity:p}),onComplete:()=>{i.style.opacity=""}}),c=new u.WebAnimation({element:r,integrator:g.from(t),style:a=>{let p;if(a<=.05)p=s;else if(a<=o){const y=(a-.05)/(o-.05),h=Math.pow(y,9);p=s+(.8-s)*h}else{const y=(a-o)/(1-o);p=.8+.2*(1-Math.pow(1-y,3))}const d=.7;let f;if(a<=d)f=n;else{const y=(a-d)/(1-d),h=1-Math.pow(1-y,2);f=n*(1-h)}let m;if(a<=d)m=1;else{const y=(a-d)/(1-d);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new u.MultiAnimation([l,c],{mode:"parallel"})}}};function xn(e){const{paths:t}=e;return _(t,()=>Cn())}const An={spring:{stiffness:100,damping:30}},Pn=(e={})=>{const t=e.physics??An;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new u.MultiAnimation([o,i],{mode:"parallel"})}}};function _n(e){const{paths:t}=e;return _(t,()=>Pn())}const Dn={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},wt=(e={})=>{const t=e.direction??"up",n=e.physics??Dn,s=t==="up";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.zIndex=s?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=o.offsetHeight,l=i.offsetHeight,c=window.innerHeight,a=Math.max(Math.min(r,l),c),p=new u.WebAnimation({element:o,integrator:g.from(n),style:f=>({transform:`translate3d(0, ${s?-a*f:a*f}px, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents="",o.style.zIndex=""}}),d=new u.WebAnimation({element:i,integrator:g.from(n),style:(f,m)=>({transform:`translate3d(0, ${s?m*a:m*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([p,d],{mode:"parallel"})}}};function In(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>wt({direction:"up"})):K(t,{forward:"up",backward:"down"},s=>wt({direction:s}))}const On={spring:{stiffness:200,damping:24}},Tn={inertia:{acceleration:25,resistance:1.2}},B=.2;function vn(){return{enterPhysics:On,exitPhysics:Tn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-B*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-B+B*e})`,opacity:e})}}}const Fn={spring:{stiffness:300,damping:30}},kn={inertia:{acceleration:30,resistance:1}};function Yn(){return{enterPhysics:Fn,exitPhysics:kn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Ln={static:Yn(),"background-scale":vn()},Mn="static",Hn="transform",Wn=(e={})=>{const t=e.direction??"enter",n=Ln[e.type??Mn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=o.willChange!=="";return{prepare:({from:r,to:l})=>{const c=t==="enter"?l:r,a=t==="enter"?r:l;return c.then(p=>{p.style.willChange=Hn,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=o.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:l,context:c})=>{const a=t==="enter"?l:r,p=t==="enter"?r:l,d=D(c,t==="enter"?"to":"from"),f=()=>{r.style.pointerEvents="",r.style.zIndex=""};a.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`;const m=t==="enter"?(E,x)=>({transform:`translate3d(0, ${x*d.height}px, 0)`}):E=>({transform:`translate3d(0, ${E*d.height}px, 0)`}),y=new u.WebAnimation({element:a,integrator:g.from(s),style:m,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform="",f()}});if(!i)return new u.MultiAnimation([y],{mode:"parallel"});const h=D(c,t==="enter"?"from":"to"),b=h.left+h.width/2,w=h.top+h.height/2;p.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`,p.style.transformOrigin=`${b}px ${w}px`;const S=t==="enter"?(E,x)=>o.enterStyle(E,x):E=>o.exitStyle(E),C=new u.WebAnimation({element:p,integrator:g.from(s),style:S,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin="",p.style.transform="",p.style.opacity=""}});return new u.MultiAnimation([y,C],{mode:"parallel"})}}};function Un(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Vn(e){const{enter:t,exit:n}=e,s=e.type,o=Un(s);return xt({enter:t,exit:n},i=>Wn({direction:i,type:o}))}const zn={spring:{stiffness:170,damping:22,doubleSpring:.8}},Nn=(e={})=>{const t=e.direction??"left",n=e.physics??zn,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=s?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=new u.WebAnimation({element:o,integrator:g.from(n),style:c=>({transform:`translate3d(${s?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),l=new u.WebAnimation({element:i,integrator:g.from(n),style:(c,a)=>({transform:`translate3d(${s?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([r,l],{mode:"parallel"})}}};function Rn(e){const{paths:t}=e;return K(t,{forward:"left",backward:"right"},n=>Nn({direction:n}))}const Xn={spring:{stiffness:17,damping:6}},Z=20,F=800,Bn=(e={})=>{const t=e.physics??Xn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${F}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${F}px) rotateY(${Z}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:r=>{const l=-r*Z,c=r*100;return{transform:`perspective(${F}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>{const c=l*Z,a=-l*100;return{transform:`perspective(${F}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new u.MultiAnimation([o,i],{mode:"sequence"})}}};function Zn(e){const{paths:t}=e;return _(t,()=>Bn())}function qn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-s.x,l=t.top-e.top+(t.height-e.height)/2-s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(c-1)*h,w=1+(a-1)*h,C=(i*h+o*(1-h))/((b+w)/2);return{clipPath:`inset(${p*h}% ${d*h}% ${f*h}% ${m*h}% round ${C}px)`,transform:`translate(${r*h}px, ${l*h}px) scale(${b}, ${w})`}}}}function jn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+s.x,l=t.top-e.top+(t.height-e.height)/2+s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(c-1)*h,w=1+(a-1)*h,C=(o*(1-h)+i*h)/((b+w)/2);return{clipPath:`inset(${p*h}% ${d*h}% ${f*h}% ${m*h}% round ${C}px)`,transform:`translate(${r*h-s.x}px, ${l*h}px) scale(${b}, ${w})`}}}}const Kn={spring:{stiffness:430,damping:33,doubleSpring:1}},Pt=.12,Gn=18;function Jn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Pt*t})`}}}}function Qn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Pt*t})`}}}}const q={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${Gn*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class ts{constructor(){$(this,"physics",Kn)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,r=o.mode==="enter",l=r?n:s,c=r?Jn():Qn();return c&&(l.style.transformOrigin=c.transformOrigin),[new u.WebAnimation({element:l,integrator:g.from(i),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class es{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,q.initialStyle),n.style.willChange=q.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?(n.style.zIndex=t.resolved.mode==="enter"?"-1":"1",[new u.WebAnimation({element:n,integrator:g.from(t.physics),style:s=>q.style(t.resolved.mode,s)})]):[]}}const ns={spring:{stiffness:430,damping:33,doubleSpring:1}};function ss({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a-n.x}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}function os({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}class is{constructor(){$(this,"physics",ns)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r}=t,l=o.mode==="enter",c=l?n:s,a=l?ss(i):os(i);return a&&(c.style.transformOrigin=a.transformOrigin),[new u.WebAnimation({element:c,integrator:g.from(r),style:l?(p,d)=>a.animate(d):p=>a.animate(p)})]}}const rs={spring:{stiffness:530,damping:34,doubleSpring:1}};class as{constructor(){$(this,"physics",rs)}contribute(t){return[]}}const ls={expand:()=>new is,static:()=>new as,blur:()=>new ts};function cs(e){return ls[e]()}const j="data-zoom-enter-key",St="data-zoom-exit-key",ps="data-zoom-radius";function $t(e){const t=e.getAttribute(ps);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function ds(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function Et(e){const t=e.querySelectorAll(`[${j}]`);return t.length!==1?null:t[0]}function Ct(e,t){const n=e.querySelectorAll(`[${St}]`);for(const s of n)if(s.getAttribute(St)===t)return s;return null}function fs(e,t){const n=Et(e),s=Et(t);if(!n&&s){const o=s.getAttribute(j);if(!o)return null;const i=Ct(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(j);if(!o)return null;const i=Ct(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function ys(e,t,n,s){return{enterRect:T(e.mode==="enter"?n:t,e.enterEl),exitRect:T(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:$t(e.enterEl),exitRadius:$t(e.exitEl)}}class hs{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r,onComplete:l}=t,c=o.mode==="enter",a=c?qn(i):jn(i),p=c?s:n,d=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const f=c?"-2":"2",m=n.style.zIndex;return n.style.zIndex=f,l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=m,n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new u.WebAnimation({element:p,integrator:g.from(r),style:d==="t"?y=>a.animate(y):(y,h)=>a.animate(h)})]}}class us{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:r}=t,l=n.mode==="enter"?i:o,c=ds(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const d=c[p];d&&(d.style.opacity=a[p]??"")}}),c.map(p=>new u.WebAnimation({element:p,integrator:g.from(s),style:(d,f)=>({opacity:n.mode==="enter"?d:f})}))}}class _t{contribute(){return[]}}const ms={default:()=>new _t,fade:()=>new us};function gs(e){return ms[e]()}class bs extends _t{}function ws(e){const t=cs(e.type);return{strategies:[new hs,t,gs(e.variant),new bs,...e.type==="blur"?[new es]:[]],physics:t.physics}}const Ss=e=>{const{strategies:t,physics:n}=ws(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(o);l&&Object.assign(i,l)}return i},animation:({from:s,to:o,context:i,...r})=>{const l=fs(s,o);if(!l)return new u.MultiAnimation([],{mode:"parallel"});const c=ys(l,s,o,i.scrollOffset),a=[],d={from:s,to:o,resolved:l,input:c,physics:n,extras:r,onComplete:y=>{a.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(d));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const h of a)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}return new u.MultiAnimation(f,{mode:"parallel"})}}};function $s(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Es(e){const t=$s(e);return _(e.paths,()=>Ss(t))}exports.Animation=u.Animation;exports.MultiAnimation=u.MultiAnimation;exports.WebAnimation=u.WebAnimation;exports.axis=ge;exports.blind=Ce;exports.drill=ke;exports.fade=He;exports.film=Ze;exports.hero=Sn;exports.jaemin=xn;exports.rotate=_n;exports.scroll=In;exports.sheet=Vn;exports.slide=Rn;exports.strip=Zn;exports.zoom=Es;
|