svg-scroll-draw 2.23.1 → 2.23.4
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 +18 -19
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +140 -176
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/chunk-6TWFLRUB.mjs +3 -0
- package/dist/{chunk-OTDD2ROH.mjs → chunk-DSFD227B.mjs} +1 -1
- package/dist/chunk-I73SOXBN.mjs +1 -0
- package/dist/chunk-NLPSVYFP.mjs +1 -0
- package/dist/chunk-OPXWNJBG.mjs +1 -0
- package/dist/chunk-QFSTKVA3.mjs +1 -0
- package/dist/chunk-UPWWULKI.mjs +1 -0
- package/dist/chunk-XC5NR2MU.mjs +1 -0
- package/dist/{chunk-GVBO5GRD.mjs → chunk-XTPAW6XR.mjs} +1 -1
- package/dist/{chunk-VMUJMXKO.mjs → chunk-ZNCZYV3Q.mjs} +1 -1
- package/dist/group/index.cjs +2 -2
- package/dist/group/index.d.mts +4 -2
- package/dist/group/index.d.ts +4 -2
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -7
- package/dist/horizontal/index.d.ts +10 -7
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +3 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +9 -3
- package/dist/reveal/index.d.ts +9 -3
- package/dist/reveal/index.mjs +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +1 -1
- package/dist/timeline/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-DY5JCXVR.mjs +0 -1
- package/dist/chunk-HX4SP5WN.mjs +0 -3
- package/dist/chunk-KV3WCPQ5.mjs +0 -1
- package/dist/chunk-LTCJVVSC.mjs +0 -1
- package/dist/chunk-WXUOF4NM.mjs +0 -1
- package/dist/chunk-YWKPTYSG.mjs +0 -1
- package/dist/chunk-YZV4Z3EQ.mjs +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
[](https://github.com/DhruvilChauahan0210/ink-scroll/stargazers)
|
|
9
9
|
|
|
10
|
-
> Draw SVG paths on scroll — plus reveal, pin, snap, parallax, counters, video scrub and text splitting. **11.
|
|
10
|
+
> Draw SVG paths on scroll — plus reveal, pin, snap, parallax, counters, video scrub and text splitting. **11.6 KB gzipped for every API, from 1.6 KB if you import one.** Zero dependencies, MIT, and a native CSS fast path that runs with no per-frame JavaScript. Works in React, Next.js, Vue, Svelte, Solid, Angular, Astro, Nuxt and vanilla JS.
|
|
11
11
|
|
|
12
12
|
**[Live Demo](https://svg-scroll-draw.vercel.app)** · [npm](https://www.npmjs.com/package/svg-scroll-draw) · [Docs](https://svg-scroll-draw.vercel.app/docs) · [Examples](https://svg-scroll-draw.vercel.app/examples) · [Report a bug](https://github.com/DhruvilChauahan0210/ink-scroll/issues)
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
| `scrollParallax` | `svg-scroll-draw` | Move any element at a different rate than scroll. Speed multiplier, reverse direction. |
|
|
33
33
|
| `scrollDraw` | `svg-scroll-draw` | The original — scroll-driven SVG path drawing via `stroke-dashoffset`. |
|
|
34
34
|
| `scrollVideo` | `svg-scroll-draw/video` | Tie `<video>.currentTime` to scroll. The Apple/Stripe product-page pattern. |
|
|
35
|
-
| `scrollText` | `svg-scroll-draw/text` | Split text into chars/words/lines and stagger-animate each on scroll. 3.
|
|
35
|
+
| `scrollText` | `svg-scroll-draw/text` | Split text into chars/words/lines and stagger-animate each on scroll. 3.5 KB, nothing else to load. |
|
|
36
36
|
| `devtools` | `svg-scroll-draw/devtools` | Visual overlay showing every active animation's triggers and progress. Dev-only. |
|
|
37
37
|
| `AOS` | `svg-scroll-draw/aos` | Drop-in replacement for AOS: same `AOS.init()`, same `data-aos` markup, no `aos.css`. |
|
|
38
38
|
| `ScrollReveal` | `svg-scroll-draw/scrollreveal` | Drop-in replacement for ScrollReveal.js 4, MIT instead of GPL-3.0. |
|
|
@@ -137,12 +137,11 @@ scrollCounter('#revenue', {
|
|
|
137
137
|
once: true,
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
-
// Percentage with decimal
|
|
140
|
+
// Percentage with one decimal. decimals replaces format, so the % goes in format.
|
|
141
141
|
scrollCounter('#rate', {
|
|
142
|
-
from:
|
|
143
|
-
to:
|
|
144
|
-
|
|
145
|
-
format: n => n.toFixed(1) + '%',
|
|
142
|
+
from: 0,
|
|
143
|
+
to: 94.7,
|
|
144
|
+
format: n => n.toFixed(1) + '%',
|
|
146
145
|
});
|
|
147
146
|
```
|
|
148
147
|
|
|
@@ -161,7 +160,7 @@ import { ScrollCounter } from 'svg-scroll-draw/react';
|
|
|
161
160
|
| `to` | `number` | — | Target value **(required)** |
|
|
162
161
|
| `from` | `number` | `0` | Starting value. Set higher than `to` to count down. |
|
|
163
162
|
| `format` | `(n: number) => string` | `String(Math.round(n))` | Custom formatter |
|
|
164
|
-
| `decimals` | `number` | — | Shorthand for `format: n => n.toFixed(decimals)` |
|
|
163
|
+
| `decimals` | `number` | — | Shorthand for `format: n => n.toFixed(decimals)`; replaces `format` when both are set |
|
|
165
164
|
| `easing` | `string \| fn` | `"ease-out"` | — |
|
|
166
165
|
| `trigger` | `TriggerConfig` | `{ start: 'top 80%', end: 'top 20%' }` | — |
|
|
167
166
|
| `once` | `boolean` | `true` | — |
|
|
@@ -174,12 +173,12 @@ import { ScrollCounter } from 'svg-scroll-draw/react';
|
|
|
174
173
|
```js
|
|
175
174
|
import { scrollParallax } from 'svg-scroll-draw';
|
|
176
175
|
|
|
177
|
-
scrollParallax('#hero-bg', { speed: 0.4 }); // 40% of
|
|
178
|
-
scrollParallax('#floating-badge', { speed: -0.3 }); //
|
|
176
|
+
scrollParallax('#hero-bg', { speed: 0.4 }); // up 40% of its height: ahead of the page
|
|
177
|
+
scrollParallax('#floating-badge', { speed: -0.3 }); // down 30%: lags behind the page
|
|
179
178
|
scrollParallax('#sidebar', { speed: 0.3, axis: 'x' }); // horizontal
|
|
180
179
|
```
|
|
181
180
|
|
|
182
|
-
`speed` is a
|
|
181
|
+
`speed` is how far the element travels while it crosses the viewport, as a fraction of its own height (its width on `axis: 'x'`). A positive speed moves it up as you scroll down, so it runs ahead of the page: `0.5` = up half its height. A negative one moves it down, so it lags behind, as a background does: `-0.2` = down a fifth.
|
|
183
182
|
|
|
184
183
|
---
|
|
185
184
|
|
|
@@ -212,7 +211,7 @@ scrollVideo('#product-reveal', {
|
|
|
212
211
|
```tsx
|
|
213
212
|
import { ScrollVideo } from 'svg-scroll-draw/react';
|
|
214
213
|
|
|
215
|
-
<ScrollVideo src="/hero.mp4" trigger={{ start: 'top top', end: 'bottom top' }} />
|
|
214
|
+
<ScrollVideo src="/hero.mp4" poster="/hero.jpg" trigger={{ start: 'top top', end: 'bottom top' }} />
|
|
216
215
|
```
|
|
217
216
|
|
|
218
217
|
#### scrollVideo options
|
|
@@ -224,7 +223,7 @@ import { ScrollVideo } from 'svg-scroll-draw/react';
|
|
|
224
223
|
| `trigger` | `TriggerConfig` | `{ start: 'top top', end: 'bottom top' }` | — |
|
|
225
224
|
| `easing` | `string \| fn` | `"linear"` | — |
|
|
226
225
|
| `once` | `boolean` | `false` | — |
|
|
227
|
-
| `preload` | `"auto" \| "metadata"` | `"auto"` | Sets `preload` attribute if not already present |
|
|
226
|
+
| `preload` | `"auto" \| "metadata"` | `"auto"` | Sets `preload` attribute if not already present. The React `<ScrollVideo>` renders it from this option (2.23.4), and passes `poster` through to the `<video>` |
|
|
228
227
|
| `triggerElement` | `Element` | the video | Measure the trigger window from this element — the tall track behind a `position: sticky` stage, so a pinned film scrubs the length of the pin (2.18.0) |
|
|
229
228
|
| `onReady` | `() => void` | — | Fires when video metadata is loaded |
|
|
230
229
|
| `onProgress` | `(n: number) => void` | — | — |
|
|
@@ -234,7 +233,7 @@ import { ScrollVideo } from 'svg-scroll-draw/react';
|
|
|
234
233
|
|
|
235
234
|
## scrollText — text reveal on scroll
|
|
236
235
|
|
|
237
|
-
A
|
|
236
|
+
A 3.5 KB alternative to GSAP SplitText. SplitText is free and 3.6 KB, but it only splits — animating the pieces needs GSAP core (27.7 KB) on top.
|
|
238
237
|
|
|
239
238
|
```js
|
|
240
239
|
import { scrollText } from 'svg-scroll-draw/text';
|
|
@@ -438,7 +437,7 @@ Differences, on purpose:
|
|
|
438
437
|
On [ScrollReveal](https://scrollrevealjs.org)? It is GPL-3.0 (with a paid licence for commercial work)
|
|
439
438
|
and has not shipped since 4.0.9. `svg-scroll-draw/scrollreveal` is an independent, MIT-licensed
|
|
440
439
|
implementation of the same API, so the move is an import change — or one command: `npx svg-scroll-draw migrate`.
|
|
441
|
-
4.
|
|
440
|
+
4.7 KB gzipped, against 5.6 KB.
|
|
442
441
|
|
|
443
442
|
```diff
|
|
444
443
|
- import ScrollReveal from 'scrollreveal';
|
|
@@ -635,16 +634,16 @@ devtools.highlight('#my-element'); // outline for 2 seconds
|
|
|
635
634
|
<!-- size-table:start -->
|
|
636
635
|
| Entry | Gzipped |
|
|
637
636
|
|---|---|
|
|
638
|
-
| `svg-scroll-draw` (main, every core API) | 11.
|
|
637
|
+
| `svg-scroll-draw` (main, every core API) | 11.6 KB |
|
|
639
638
|
| `svg-scroll-draw/react` (includes the engine) | 13.2 KB |
|
|
640
639
|
| `svg-scroll-draw` + `svg-scroll-draw/react` (together; the engine ships once) | 14.8 KB |
|
|
641
|
-
| `svg-scroll-draw/reveal` | 5.
|
|
642
|
-
| `svg-scroll-draw/text` | 3.
|
|
640
|
+
| `svg-scroll-draw/reveal` | 5.7 KB |
|
|
641
|
+
| `svg-scroll-draw/text` | 3.5 KB |
|
|
643
642
|
| `svg-scroll-draw/video` | 2.8 KB |
|
|
644
643
|
| `svg-scroll-draw/scrollreveal` | 4.7 KB |
|
|
645
644
|
| `svg-scroll-draw/vivus` | 4.2 KB |
|
|
646
645
|
| `svg-scroll-draw/aos` (styles included) | 3.2 KB |
|
|
647
|
-
| `svg-scroll-draw/snap` |
|
|
646
|
+
| `svg-scroll-draw/snap` | 2.0 KB |
|
|
648
647
|
| `svg-scroll-draw/devtools` | 1.8 KB (dev only) |
|
|
649
648
|
| `svg-scroll-draw/pin` | 1.6 KB |
|
|
650
649
|
<!-- size-table:end -->
|
package/dist/angular/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';function
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${f?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(r),window.addEventListener("scroll",s,{passive:true}),s(),{el:r,destroy(){window.removeEventListener("scroll",s),r.remove();}}}var zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function An(e,n,t){if(!Ke)return;let r=(e.match(Vt)??[]).join("").toUpperCase(),s=(n.match(Vt)??[]).join("").toUpperCase(),i=(e.match(zt)??[]).length,a=(n.match(zt)??[]).length;if(r!==s){he(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&he(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function yt(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=r[s++]??a;return String(+(a+(m-a)*t).toFixed(4))})}function _t(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:qe(n,(t,r)=>$n(e,t,r))}function $n(e,n,t){let{preset:r,...s}=n,i=r?{...Ot[r],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:f=false,easing:d="linear",trigger:x={},stagger:H=0,direction:P="forward",once:Q=false,debug:me=false,axis:I="y",scrollContainer:se,autoReverse:be=false,delay:F=0,strokeColor:R,strokeWidth:k,fillOpacity:M,waypoints:w,velocityScale:v=false,threshold:T=0,rootMargin:U="0px",repeat:N=0,repeatDelay:B=0,morphTo:L,clip:fe,autoplay:Ee=false,duration:ie=1e3,native:V=true,onProgress:u,onStart:A,onComplete:h,onEnter:O,onLeave:te,onEnterBack:pe,onLeaveBack:Se}=i,Z=fe===true?"left":typeof fe=="string"?fe:false,E=typeof d=="function"?d:oe[d]??oe.linear,de=ye(x.start??"top bottom"),Ae=ye(x.end??"bottom top"),ae=typeof se=="string"?document.querySelector(se):se??null,le=Array.isArray(R)?R[0]:null,ne=Array.isArray(R)?R[1]:typeof R=="string"?R:null,re=Array.isArray(k)?k[0]:null,Y=Array.isArray(k)?k[1]:typeof k=="number"?k:null,ge=Array.isArray(M)?M[0]:null,J=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Oe(o){let c=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let _=Z?[]:Array.from(e.querySelectorAll(a)),C=[],we=[],l=0,p=0,$e=H,Te=0,$=false,z=false,G=0,Ne=false,q=-1,He=[],ze=-1,ce=false,Ie=0,Re=0,Ve,ut=null;function wt(){ut?.destroy(),ut=null;}let _e=new Set,vt=NaN,We=true,et=-1,Et=performance.now(),Ge=NaN;function Ye(){return ae?I==="x"?ae.scrollLeft:ae.scrollTop:I==="x"?window.scrollX:window.scrollY}function St(){return ae?I==="x"?ae.clientWidth:ae.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function Tt(){let o=st(e,ae,I);return Le(o,o.scroll,St(),de,Ae)}function un(){let o=p-l,c=_.length-1,y=ae??document.documentElement,X=I==="x"?"Width":"Height";if($e=H,H>0&&c>0&&o>0){let xe=y[`scroll${X}`]-y[`client${X}`]-1-l-o/m;xe>=0&&($e=Math.min(H,xe/(c*o)));}Te=p+c*$e*o;}function xt(){(({tStart:l,tEnd:p}=Tt())),un(),me&&Ke&&(wt(),ut=Ln(l,p,I));}function mt(o,c=Tt){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let y=o.destroy;return o.destroy=()=>{y.call(o),ke(e);},o}function mn(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let y=c==="reverse"?1-o:o;e.style.clipPath=Oe(y);return}_.forEach((y,X)=>{y.style.strokeDashoffset=c==="reverse"?`${C[X]*o}`:`${C[X]*(1-o)}`,f&&(y.style.opacity=c==="reverse"?`${1-o}`:`${o}`),le&&ne?y.style.stroke=Ue(le,ne,o):ne&&(y.style.stroke=ne),re!==null&&Y!==null?y.style.strokeWidth=`${re+(Y-re)*o}`:Y!==null&&(y.style.strokeWidth=`${Y}`),ge!==null&&J!==null?y.style.fillOpacity=`${ge+(J-ge)*o}`:J!==null&&(y.style.fillOpacity=`${J}`),L&&y.tagName.toLowerCase()==="path"&&we[X]&&y.setAttribute("d",yt(we[X],L,o));});}function tt(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=Oe(0);return}_.forEach((o,c)=>{o.style.strokeDasharray=`${C[c]}`,o.style.strokeDashoffset=P==="reverse"?"0":`${C[c]}`,f?o.style.opacity=P==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),re!==null&&(o.style.strokeWidth=`${re}`),ge!==null&&(o.style.fillOpacity=`${ge}`),L&&o.tagName.toLowerCase()==="path"&&we[c]&&o.setAttribute("d",we[c]);});}if(_.forEach(o=>{Mn(o);let c=Qe(o);C.push(c);let y=o.tagName.toLowerCase()==="path";y?we.push(o.getAttribute("d")??""):we.push(""),L&&(y?An(we[we.length-1],L,o):he(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=P==="reverse"?`${c}`:"0",f&&(o.style.opacity="1"),ne&&(o.style.stroke=ne),Y!==null&&(o.style.strokeWidth=`${Y}`),J!==null&&(o.style.fillOpacity=`${J}`),L&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",L)):(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=P==="reverse"?"0":`${c}`,f?o.style.opacity=P==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),re!==null&&(o.style.strokeWidth=`${re}`),ge!==null&&(o.style.fillOpacity=`${ge}`));}),Z){if(t)return e.style.clipPath=Oe(1),h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(t)return h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Mt=typeof d=="string"?it(d):null;function fn(){return !(V===false||!xn()||!_.length||!Mt||Z||I!=="y"||ae||m!==1||H!==0||Q||be||v!==false||L||w||N||F>0||u||A||h||O||te||pe||Se||R!=null||k!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function pn(){let o=++Tn,c=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,X=`--svg-scroll-draw-${o}`,xe=P==="reverse"?"0":"var(--ssd-len)",Fe=P==="reverse"?"var(--ssd-len)":"0",Pe=`stroke-dashoffset:${xe};`,S=`stroke-dashoffset:${Fe};`;f&&(Pe+=`opacity:${P==="reverse"?1:0};`,S+=`opacity:${P==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${Pe}}to{${S}}}.${y}{view-timeline-name:${X};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Mt};animation-fill-mode:both;animation-timeline:${X};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(y);function ue(g,K){g.style.setProperty("--ssd-len",String(C[K])),g.style.strokeDasharray=`${C[K]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(c);}_.forEach(ue);let b=false,W=-1;function j(){if(W>=0)return W;let g=e.getBoundingClientRect(),{tStart:K,tEnd:Me}=Le({top:g.top,height:g.height},Ye(),St(),de,Ae);return E(ee(Ye(),K,Me,m))}return {destroy(){e.classList.remove(y),_.forEach(g=>{g.classList.remove(c),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),D.remove();},replay(){b=false,W=-1,_.forEach(ue);},pause(){b=true,_.forEach(g=>{g.style.animationPlayState="paused";});},resume(){b&&(b=false,_.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let K=Math.min(1,Math.max(0,g));W=K,b=true,_.forEach((Me,ve)=>{Me.classList.remove(c),Me.style.strokeDashoffset=P==="reverse"?`${C[ve]*K}`:`${C[ve]*(1-K)}`,f&&(Me.style.opacity=P==="reverse"?`${1-K}`:`${K}`);});},getProgress(){return j()},refresh(){_.forEach((g,K)=>{C[K]=Qe(g),g.style.setProperty("--ssd-len",String(C[K])),g.style.strokeDasharray=`${C[K]}`;});}}}if(fn())return mt(pn());function dn(){let o=Math.max(1,ie),c=0,y=0,X=false;function xe(b){let W=true;if(Z){let j=Math.min(1,Math.max(0,b/o)),g=E(j);Ie=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Oe(P==="reverse"?1-g:g),u?.(g),j<1&&(W=false);}else _.forEach((j,g)=>{let K=g*H*o,Me=Math.min(1,Math.max(0,(b-K)/o)),ve=E(Me);j.style.strokeDashoffset=P==="reverse"?`${C[g]*ve}`:`${C[g]*(1-ve)}`,f&&(j.style.opacity=P==="reverse"?`${1-ve}`:`${ve}`),le&&ne?j.style.stroke=Ue(le,ne,ve):ne&&(j.style.stroke=ne),re!==null&&Y!==null?j.style.strokeWidth=`${re+(Y-re)*ve}`:Y!==null&&(j.style.strokeWidth=`${Y}`),ge!==null&&J!==null?j.style.fillOpacity=`${ge+(J-ge)*ve}`:J!==null&&(j.style.fillOpacity=`${J}`),L&&j.tagName.toLowerCase()==="path"&&we[g]&&j.setAttribute("d",yt(we[g],L,ve)),g===0&&(Ie=ve,u?.(ve),e.style.setProperty("--scroll-draw-progress",String(ve))),Me<1&&(W=false);});if(w){let j=Math.min(1,Math.max(0,b/o)),g=E(j);for(let K in w){let Me=parseFloat(K);g>=Me&&!_e.has(Me)&&(_e.add(Me),w[K]?.());}}return W}function Fe(b){if(ce)return;let W=b-c;z||(z=true,A?.());let j=xe(W);if(j&&!$){$=true,xe(o*(1+Math.max(0,_.length-1)*H)),h?.(),Re<(N==="infinite"?1/0:N??0)&&(Re++,Ve=setTimeout(()=>{c=performance.now(),z=false,$=false,_e.clear(),tt(),G=requestAnimationFrame(Fe);},B));return}j||(G=requestAnimationFrame(Fe));}function Pe(){cancelAnimationFrame(G),clearTimeout(Ve),c=performance.now(),y=0,ce=false,z=false,$=false,Re=0,X=true,Ie=0,_e.clear(),tt(),G=requestAnimationFrame(Fe);}let S=new IntersectionObserver(b=>{b.forEach(W=>{W.isIntersecting&&!(Q&&$)?Pe():!W.isIntersecting&&!Q&&!$&&(cancelAnimationFrame(G),clearTimeout(Ve),X=false);});},{root:ae??null,threshold:T,rootMargin:U}),D;function ue(){clearTimeout(D),D=setTimeout(()=>{_.forEach((b,W)=>{C[W]=Qe(b),b.style.strokeDasharray=`${C[W]}`;});},150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),F>0?setTimeout(()=>S.observe(e),F):S.observe(e),{destroy(){cancelAnimationFrame(G),clearTimeout(Ve),S.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(D);},replay(){Re=0,Pe();},pause(){ce||!X||(ce=true,y=performance.now()-c,cancelAnimationFrame(G));},resume(){ce&&(ce=false,X=true,c=performance.now()-y,G=requestAnimationFrame(Fe));},seek(b){let W=Math.min(1,Math.max(0,b));Ie=W,ce=true,y=W*o,c=performance.now()-y,cancelAnimationFrame(G),xe(y);},getProgress(){return Ie},refresh(){clearTimeout(D),_.forEach((b,W)=>{C[W]=Qe(b),b.style.strokeDasharray=`${C[W]}`;});}}}if(Ee)return mt(dn());xt();function Lt(){if(ce||!je)return;let o=performance.now(),c=Ye();if(!We&&v===false&&c===vt){pt(c);return}We=false,vt=c;let y=m;if(v!==false){let S=o-Et,D=S>0?Math.abs(c-(et<0?c:et))/S:0;y=m*Math.max(.2,1+D*(typeof v=="number"?v:1)*.04);}et=c,Et=o;let X=be?ze===-1||c>=ze?"forward":"reverse":P;ze=c;let xe=p-l,Fe=true,Pe=xe===0?0:(c-l)/xe;if(isNaN(Ge)||(Ge<=0&&Pe>0?O?.():Ge>0&&Pe<=0&&Se?.(),Ge<1&&Pe>=1?te?.():Ge>=1&&Pe<1&&pe?.()),Ge=Pe,Z){let S=E(ee(c,l,p,y));Q&&!be&&(q=Math.max(q,S),S=q),Ie=S,e.style.setProperty("--scroll-draw-progress",String(S));let D=X==="reverse"?1-S:S;e.style.clipPath=Oe(D),u?.(S),!z&&ee(c,l,p,y)>0&&(z=true,A?.()),S>=1&&!$?($=true,h?.(),Re<(N==="infinite"?1/0:N??0)&&(Re++,Ve=setTimeout(()=>{q=-1,z=false,$=false,e.style.clipPath=Oe(0);},B))):S<1&&!Q&&($=false),pt(c);return}if(_.forEach((S,D)=>{let ue=D*$e*xe,b=E(ee(c,l+ue,p+ue,y));Q&&!be&&(b=He[D]=Math.max(He[D]??q,b)),S.style.strokeDashoffset=X==="reverse"?`${C[D]*b}`:`${C[D]*(1-b)}`,f&&(S.style.opacity=X==="reverse"?`${1-b}`:`${b}`),le&&ne?S.style.stroke=Ue(le,ne,b):ne&&(S.style.stroke=ne),re!==null&&Y!==null?S.style.strokeWidth=`${re+(Y-re)*b}`:Y!==null&&(S.style.strokeWidth=`${Y}`),ge!==null&&J!==null?S.style.fillOpacity=`${ge+(J-ge)*b}`:J!==null&&(S.style.fillOpacity=`${J}`),L&&S.tagName.toLowerCase()==="path"&&we[D]&&S.setAttribute("d",yt(we[D],L,b)),D===0&&(Ie=b,u?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Fe=false);}),w){let S=E(ee(c,l,p,y));for(let D in w){let ue=parseFloat(D);S>=ue&&!_e.has(ue)&&(_e.add(ue),w[D]?.());}}!z&&ee(c,l,p,y)>0&&(z=true,A?.()),Fe&&!$?($=true,h?.(),Re<(N==="infinite"?1/0:N??0)&&(Re++,Ve=setTimeout(()=>{q=-1,He=[],z=false,$=false,_e.clear(),tt(),We=true;},B))):!Fe&&!Q&&($=false),pt(c);}function ft(o){return o>=p&&o<Te}function pt(o){Ne||ft(o)?G=requestAnimationFrame(Lt):je=false;}function dt(){return Ne||ft(Ye())}let je=false;function nt(){je||(je=true,G=requestAnimationFrame(function(){Lt();}));}function rt(){je=false,cancelAnimationFrame(G);}let gt=new IntersectionObserver(o=>{o.forEach(c=>{Ne=c.isIntersecting,Ne&&!ce?(We=true,nt()):je&&!ce&&ft(Ye())||rt();});},{root:ae??null,threshold:T,rootMargin:U});function At(){_.forEach((o,c)=>{C[c]=Qe(o),o.style.strokeDasharray=`${C[c]}`;}),xt(),We=true;}let ot;function Xe(){clearTimeout(ot),ot=setTimeout(At,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let gn=De([e],Xe);return F>0?setTimeout(()=>gt.observe(e),F):gt.observe(e),mt({destroy(){cancelAnimationFrame(G),clearTimeout(Ve),rt(),gt.disconnect(),gn(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(ot),wt();},replay(){q=-1,He=[],ze=-1,et=-1,z=false,$=false,Re=0,ce=false,Ie=0,_e.clear(),clearTimeout(Ve),tt(),We=true,dt()&&nt();},pause(){ce=true,rt();},resume(){ce&&(ce=false,We=true,dt()&&nt());},seek(o){let c=Math.min(1,Math.max(0,o));Ie=c,q=c,He=[],ce=true,rt(),mn(c,P),We=true;},getProgress(){return Ie},refresh(){clearTimeout(ot),At(),dt()&&!ce&&nt();}},()=>({tStart:l,tEnd:p}))}var Wt=new WeakMap,Pn=0;function ht(e){return JSON.stringify(e,(n,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let r=Wt.get(t);return r===void 0&&Wt.set(t,r=++Pn),`el#${r}`}return t})}function qt(e,n){let t={...e};for(let r of Object.keys(t))typeof t[r]=="function"&&(t[r]=(...s)=>n()[r]?.(...s));return t}function Cn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Bt(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let s=[],i=[],a=r[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let f=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(f?parseFloat(f[1]):0),i.push(f?f[2]:"");}n.push({fn:r[1],nums:s,units:i});}return n}function kn(e,n,t){let r=Bt(e),s=Bt(n);return r.length===0||r.length!==s.length?t<1?e:n:r.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?t<1?`${i.fn}(${i.nums.map((f,d)=>`${f}${i.units[d]}`).join(", ")})`:`${m.fn}(${m.nums.map((f,d)=>`${f}${m.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((f,d)=>`${f+(m.nums[d]-f)*t}${i.units[d]}`).join(", ")})`}).join(" ")}function Gt(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),s=String(n);if(Cn(r))return Ue(r,s,t);if(r.includes("("))return kn(r,s,t);let i=r.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),f=parseFloat(a[1]);return `${m+(f-m)*t}${i[2]||a[2]}`}return t<1?r:s}function On(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var In=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fn=0,jt="--scroll-draw-progress";function Dn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Yt(e,n){return typeof window>"u"?Ut:n.respectReducedMotion===false?Qt(e,n,false):qe(n,(t,r)=>Qt(e,t,r))}function Qt(e,n,t){let{props:r,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:f="y",scrollContainer:d,native:x=true,velocityScale:H=false,triggerElement:P,onProgress:Q,onComplete:me,onEnter:I,onLeave:se,onEnterBack:be,onLeaveBack:F}=n,R=typeof i=="function"?i:oe[i]??oe["ease-out"],k=ye(s.start??"top bottom"),M=ye(s.end??"bottom top"),w=P??e,v=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(r).map(([l,p])=>({prop:On(l),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function U(){let l=window.getComputedStyle(e);for(let p of T)p.from===""&&(p.from=l.getPropertyValue(p.prop).trim()||"0");}function N(){for(let l of T)e.style.setProperty(l.prop,String(l.to));}let B=new Map;for(let l of [...T.map(p=>p.prop),jt])B.set(l,e.style.getPropertyValue(l));function L(){for(let[l,p]of B)p?e.style.setProperty(l,p):e.style.removeProperty(l);}if(t)return N(),me?.(),{...Ut,destroy:L,getProgress:()=>1};U();let fe=typeof i=="string"?it(i):null;function Ee(){if(!x||!Dn()||!fe||f!=="y"||v||w!==e||m||a!==1||Q||me||I||se||be||F||H!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let l of T)if(!In.has(l.prop))return false;return true}function ie(){let l=`ssd-a-${++Fn}`,p=T.map(q=>`${q.prop}:${q.from}`).join(";"),$e=T.map(q=>`${q.prop}:${q.to}`).join(";"),Te=document.createElement("style");Te.setAttribute("data-ssd-animate",""),Te.textContent=`@keyframes ${l}{from{${p}}to{${$e}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${fe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(Te),e.classList.add(l);let $=()=>f==="x"?window.scrollX:window.scrollY,z=()=>f==="x"?window.innerWidth:window.innerHeight,G=()=>{let q=e.getBoundingClientRect();return Le({top:q.top,height:q.height},$(),z(),k,M)};Ce(e,{type:"animate",getProgress:()=>Ne.getProgress(),getTrigger:G});let Ne={refresh(){},destroy(){e.classList.remove(l),Te.remove(),e.style.animationPlayState="",L(),ke(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let He=Math.min(1,Math.max(0,q));e.classList.remove(l);for(let ze of T)e.style.setProperty(ze.prop,Gt(ze.from,ze.to,He));},getProgress(){let{tStart:q,tEnd:He}=G();return R(ee($(),q,He,a))}};return Ne}if(Ee())return ie();let V=0,u=0,A=0,h=false,O=false,te=-1,pe=0,Se=false,Z=NaN,E=-1,de=0,Ae=()=>v?f==="x"?v.scrollLeft:v.scrollTop:f==="x"?window.scrollX:window.scrollY,ae=()=>v?f==="x"?v.clientWidth:v.clientHeight:f==="x"?window.innerWidth:window.innerHeight,le=w===e?T:[],ne=false;function re(){let l=e.style,p=le.map(z=>l.getPropertyValue(z.prop)),$e=l.transition;le.length&&(l.transition="none"),le.forEach(z=>l.setProperty(z.prop,B.get(z.prop)??""));let Te=st(w,v,f);le.forEach((z,G)=>l.setProperty(z.prop,p[G])),le.length&&(e.offsetWidth,l.transition=$e);let $=Le(Te,Te.scroll,ae(),k,M);ne&&Math.abs($.tStart-V)<1&&Math.abs($.tEnd-u)<1||(ne=true,V=$.tStart,u=$.tEnd);}function Y(l){e.style.setProperty(jt,String(l));for(let p of T)e.style.setProperty(p.prop,Gt(p.from,p.to,l));Q?.(l);}function ge(l){if(isNaN(Z)){Z=l;return}Z<=0&&l>0?I?.():Z>0&&l<=0&&F?.(),Z<1&&l>=1?se?.():Z>=1&&l<1&&be?.(),Z=l;}function J(){if(!h||O)return;let l=performance.now(),p=Ae(),$e=a;if(H!==false){let z=l-de,G=z>0?Math.abs(p-(E<0?p:E))/z:0;$e=a*Math.max(.2,1+G*(typeof H=="number"?H:1)*.04);}E=p,de=l;let Te=u===V?0:(p-V)/(u-V);ge(Te);let $=R(ee(p,V,u,$e));m&&(te=Math.max(te,$),$=te),pe=$,Y($),$>=1&&!Se?(Se=true,me?.()):$<1&&!m&&(Se=false),A=requestAnimationFrame(J);}re(),u===V&&he("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=R(ee(Ae(),V,u,a));m&&l>0&&(te=l),pe=l,Y(l);}let Oe=new IntersectionObserver(l=>{l.forEach(p=>{h=p.isIntersecting,h&&!O?A=requestAnimationFrame(J):cancelAnimationFrame(A);});},{root:v??null}),_;function C(){clearTimeout(_),_=setTimeout(re,150);}window.addEventListener("resize",C),window.addEventListener("orientationchange",C);let we=De([w],C);return Oe.observe(e),Ce(e,{type:"animate",getProgress:()=>pe,getTrigger:()=>({tStart:V,tEnd:u})}),{destroy(){cancelAnimationFrame(A),Oe.disconnect(),window.removeEventListener("resize",C),window.removeEventListener("orientationchange",C),we(),clearTimeout(_),L(),ke(e);},replay(){te=-1,Se=false,pe=0,O=false,Y(0);},pause(){O=true,cancelAnimationFrame(A);},resume(){O&&(O=false,h&&(A=requestAnimationFrame(J)));},seek(l){let p=Math.min(1,Math.max(0,l));pe=p,te=p,O=true,cancelAnimationFrame(A),Y(p);},getProgress(){return pe},refresh(){re();}}}var bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xt(e,n){if(typeof window>"u")return bt;let t=typeof e=="string"?document.querySelector(e):e;return t?qe(n,(r,s)=>Hn(t,r,s)):(he("scrollCounter: element not found:",e),bt)}function Hn(e,n,t){let{from:r=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:f=true,decimals:d,onComplete:x}=n,H=d!==void 0?u=>u.toFixed(d):i??(u=>String(Math.round(u))),P=typeof a=="function"?a:oe[a]??oe["ease-out"],Q=ye(m.start??"top 80%"),me=ye(m.end??"top 20%");if(t)return e.textContent=H(s),x?.(),{...bt,getProgress:()=>1};let I=0,se=0,be=false,F=0,R=false,k=false,M=-1,w=0,v=false,T=()=>window.scrollY,U=()=>window.innerHeight;function N(){let u=e.getBoundingClientRect(),A=Le({top:u.top,height:u.height},T(),U(),Q,me);be&&Math.abs(A.tStart-I)<1&&Math.abs(A.tEnd-se)<1||(be=true,I=A.tStart,se=A.tEnd);}function B(u){e.textContent=H(r+(s-r)*u),e.style.setProperty("--scroll-draw-progress",String(u));}function L(){if(!R||k)return;let u=P(ee(T(),I,se,1));f&&(M=Math.max(M,u),u=M),w=u,B(u),u>=1&&!v?(v=true,x?.()):u<1&&!f&&(v=false),F=requestAnimationFrame(L);}N();{let u=P(ee(T(),I,se,1));f&&u>0&&(M=u),w=u,B(u);}let fe=new IntersectionObserver(u=>{u.forEach(A=>{R=A.isIntersecting,R&&!k?F=requestAnimationFrame(L):cancelAnimationFrame(F);});}),Ee;function ie(){clearTimeout(Ee),Ee=setTimeout(N,150);}window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie);let V=De([e],ie);return fe.observe(e),Ce(e,{type:"counter",getProgress:()=>w,getTrigger:()=>({tStart:I,tEnd:se})}),{destroy(){cancelAnimationFrame(F),fe.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),V(),clearTimeout(Ee),ke(e);},replay(){M=-1,v=false,w=0,k=false,B(0);},pause(){k=true,cancelAnimationFrame(F);},resume(){k&&(k=false,R&&(F=requestAnimationFrame(L)));},seek(u){let A=Math.min(1,Math.max(0,u));w=A,M=A,k=true,cancelAnimationFrame(F),B(A);},getProgress(){return w}}}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Zt(e,n={}){if(typeof window>"u")return Kt;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return he("scrollVideo: <video> element not found:",e),Kt;let r=t,{trigger:s={},easing:i="linear",once:a=false,axis:m="y",preload:f="auto",triggerElement:d,onReady:x,onComplete:H,onProgress:P}=n,Q=d??r,me=window.matchMedia("(prefers-reduced-motion: reduce)").matches,I=typeof i=="function"?i:oe[i]??oe.linear,se=ye(s.start??"top top"),be=ye(s.end??"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=f);let F=n.from??0,R=n.to,k=0,M=0,w=0,v=false,T=false,U=-1,N=0,B=false,L=false,fe=()=>m==="x"?window.scrollX:window.scrollY,Ee=()=>m==="x"?window.innerWidth:window.innerHeight;function ie(){let E=Q.getBoundingClientRect(),de=m==="x"?E.left:E.top,Ae=m==="x"?E.width:E.height,ae=Le({top:de,height:Ae},fe(),Ee(),se,be);k=ae.tStart,M=ae.tEnd,L&&M===k&&he("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let V=NaN;function u(E){if(!L)return;let de=R??r.duration??0,Ae=F+(de-F)*E;Ae!==V&&(V=Ae,r.currentTime=Ae),r.style.setProperty("--scroll-draw-progress",String(E)),P?.(E);}function A(){if(!v||T||!L||me)return;let E=I(ee(fe(),k,M,1));a&&(U=Math.max(U,E),E=U),N=E,u(E),E>=1&&!B?(B=true,H?.()):E<1&&!a&&(B=false),w=requestAnimationFrame(A);}function h(){if(L=true,R===void 0&&(R=r.duration),me){u(1),x?.();return}ie(),x?.(),v&&!T&&(w=requestAnimationFrame(A));}r.readyState>=1?h():r.addEventListener("loadedmetadata",h,{once:true}),L||ie();let O=me?()=>{}:ct(E=>{E&&(O(),me=true,cancelAnimationFrame(w),u(1));}),te=new IntersectionObserver(E=>{E.forEach(de=>{v=de.isIntersecting,v&&!T&&L?w=requestAnimationFrame(A):cancelAnimationFrame(w);});}),pe;function Se(){clearTimeout(pe),pe=setTimeout(ie,150);}window.addEventListener("resize",Se),window.addEventListener("orientationchange",Se);let Z=De([Q],Se);return te.observe(r),Ce(r,{type:"video",getProgress:()=>N,getTrigger:()=>({tStart:k,tEnd:M})}),{destroy(){cancelAnimationFrame(w),te.disconnect(),r.removeEventListener("loadedmetadata",h),window.removeEventListener("resize",Se),window.removeEventListener("orientationchange",Se),Z(),O(),clearTimeout(pe),ke(r);},replay(){U=-1,B=false,N=0,T=false,V=NaN,u(0);},pause(){T=true,cancelAnimationFrame(w);},resume(){T&&(T=false,v&&L&&(w=requestAnimationFrame(A)));},seek(E){let de=Math.min(1,Math.max(0,E));N=de,U=de,T=true,cancelAnimationFrame(w),V=NaN,u(de);},getProgress(){return N}}}function Jt(e,n){let t=document.createElement("span");t.textContent=n,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function nn(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(t=>{let r=document.createElement("span");return r.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(r.textContent=t,r.style.whiteSpace="pre"):(r.textContent=t,r.style.display="inline-block"),e.appendChild(r),/^\s+$/.test(t)?null:r}).filter(t=>t!==null)}function Rn(e){let n=e.textContent??"";return e.textContent="",n.split("").map(t=>{let r=document.createElement("span");return r.setAttribute("aria-hidden","true"),r.textContent=t,t===" "?r.style.whiteSpace="pre":r.style.display="inline-block",e.appendChild(r),t===" "?null:r}).filter(t=>t!==null)}function en(e){let n=nn(e),t=new Map;for(let i of n){let a=i.offsetTop;t.has(a)||t.set(a,[]),t.get(a).push(i);}let r=[],s=Array.from(t.keys()).sort((i,a)=>i-a);for(let i of s){let a=t.get(i),m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.style.display="inline-block",a.forEach((f,d)=>{let x=f.nextElementSibling;m.appendChild(f),d<a.length-1&&x&&x.style.whiteSpace==="pre"&&m.appendChild(x);}),r.push(m);}return e.textContent="",r.forEach((i,a)=>{e.appendChild(i),a<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Nn(e,n,t,r){if(t<=1||r===0)return e;let s=(t-1)*r,i=n*r,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function zn(e,n){let t=[];if(n?.y!==void 0&&t.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&t.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&t.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let r=n.scale+(1-n.scale)*e;t.push(`scale(${r})`);}return t.join(" ")||""}var tn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rn(e,n={}){if(typeof window>"u")return tn;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return he("scrollText: element not found:",e),tn;let r=t;return qe(n,(s,i)=>Vn(r,s,i))}function Vn(e,n,t){let{split:r="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:f=true,onComplete:d}=n,x=typeof i=="function"?i:oe[i]??oe["ease-out"],H=ye(m.start??"top 85%"),P=ye(m.end??"top 40%"),Q=e.innerHTML,me=e.textContent??"",I;r==="chars"?I=Rn(e):r==="lines"?I=en(e):I=nn(e),Jt(e,me);let se=I.length;function be(h,O){a?.opacity!==void 0&&(h.style.opacity=String(a.opacity+(1-a.opacity)*O));let te=zn(O,a);te&&(h.style.transform=te);}function F(h){e.style.setProperty("--scroll-draw-progress",String(h)),I.forEach((O,te)=>{let pe=x(Nn(h,te,se,s));be(O,pe);});}if(t)return F(1),d?.(),{destroy(){e.innerHTML=Q;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};F(0);let R=0,k=0,M=0,w=false,v=false,T=-1,U=0,N=false,B=()=>window.scrollY,L=()=>window.innerHeight;function fe(){let h=e.getBoundingClientRect(),O=Le({top:h.top,height:h.height},B(),L(),H,P);R=O.tStart,k=O.tEnd;}function Ee(){if(!w||v)return;let h=ee(B(),R,k,1);f&&(T=Math.max(T,h),h=T),U=h,F(h),h>=1&&!N?(N=true,d?.()):h<1&&!f&&(N=false),M=requestAnimationFrame(Ee);}fe();let ie=new IntersectionObserver(h=>{h.forEach(O=>{w=O.isIntersecting,w&&!v?M=requestAnimationFrame(Ee):cancelAnimationFrame(M);});}),V;function u(){clearTimeout(V),V=setTimeout(()=>{if(r==="lines"){let h=U;e.innerHTML=Q,I=en(e),Jt(e,me),F(h);}fe();},150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let A=De([e],u);return ie.observe(e),Ce(e,{type:"text",getProgress:()=>U,getTrigger:()=>({tStart:R,tEnd:k})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),A(),clearTimeout(V),e.innerHTML=Q,ke(e);},replay(){T=-1,N=false,U=0,v=false,F(0);},pause(){v=true,cancelAnimationFrame(M);},resume(){v&&(v=false,w&&(M=requestAnimationFrame(Ee)));},seek(h){let O=Math.min(1,Math.max(0,h));U=O,T=O,v=true,cancelAnimationFrame(M),F(O);},getProgress(){return U}}}var Be=class{constructor(n){this.create=n;this.instance=null;this.el=null;this.key="";}init(n,t){return this.destroy(),this.el=n,this.latest=t,this.key=ht(t),this.instance=this.create(n,qt(t,()=>this.latest)),this}update(n){return this.el?ht(n)!==this.key?this.init(this.el,n):(this.latest=n,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(n){return this.instance?.seek(n),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},on=class extends Be{constructor(){super(_t);}init(n,t={}){return super.init(n,t)}},sn=class extends Be{constructor(){super(Yt);}},an=class extends Be{constructor(){super(Xt);}},ln=class extends Be{constructor(){super(Zt);}init(n,t={}){return super.init(n,t)}},cn=class extends Be{constructor(){super(rn);}init(n,t={}){return super.init(n,t)}};exports.EngineRef=Be;exports.ScrollAnimateRef=sn;exports.ScrollCounterRef=an;exports.ScrollDrawRef=on;exports.ScrollTextRef=cn;exports.ScrollVideoRef=ln;
|
|
1
|
+
'use strict';function En({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),s=Math.sqrt(r),i=0,a=[];for(let h=0;h<t;h++){let E=Math.pow(s,h);a.push(E),i+=E;}let m=[0],p=0;for(let h=0;h<t;h++)p+=a[h]/i,m.push(p);return h=>{if(h<=0)return 0;if(h>=1)return 1;for(let E=0;E<t;E++)if(h<=m[E+1]){let H=(h-m[E])/(m[E+1]-m[E]);if(E===0)return H*(2-H);let S=1-Math.pow(r,E);return S+(1-S)*(2*H-1)*(2*H-1)}return 1}}function Sn({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),s=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/r)+1}var ee={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:En(),elastic:Sn()};function It(e,n,t){return Math.min(t,Math.max(n,e))}function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}function Rt(e,n,t,r){switch(r){case "top":return e+t;case "center":return e+t+n/2;case "bottom":return e+t+n;default:return e+t}}function Ft(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function U(e,n,t,r){return t===n?0:It((e-n)/(t-n)*r,0,1)}function Le(e,n,t,r,s){let i=Rt(e.top,e.height,n,r.element)-Ft(r.viewport,t),a=Rt(e.top,e.height,n,s.element)-Ft(s.viewport,t);return {tStart:i,tEnd:a}}function ot(e,n,t){let r=e.getBoundingClientRect(),s=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:s,scroll:0}:{top:t==="x"?r.left:r.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function st(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(r+s)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Ht(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function it(e,n,t){let r=Ht(e),s=Ht(n);return !r||!s?e:`rgb(${Math.round(r[0]+(s[0]-r[0])*t)},${Math.round(r[1]+(s[1]-r[1])*t)},${Math.round(r[2]+(s[2]-r[2])*t)})`}var Nt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var je=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ge(e,...n){je&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Tn="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",xn="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Dt=33;function Mn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ln(e){let n=[];for(let t=0;t<Dt;t++){let r=t/(Dt-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function at(e){switch(e){case "linear":return "linear";case "ease-in":return Tn;case "ease-out":return xn;case "ease-in-out":return Mn()?Ln(ee["ease-in-out"]):null;default:return null}}var Vt=Symbol.for("svg-scroll-draw.registry");function zt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function Pe(e,n){zt().set(e,n);}function Ce(e){zt().delete(e);}var Ke,lt=new Set,ct=new WeakMap,Ze=new Map,_t=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function An(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Oe(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();Ke??(Ke=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)ct.get(a)!==_t(a)&&(i=true),ct.set(a,"");i&<.forEach(a=>a());})),lt.add(t);let r=An(e);return [document.body,document.documentElement].forEach(s=>s&&r.add(s)),r.forEach(s=>{ct.has(s)||ct.set(s,_t(s)),Ze.set(s,(Ze.get(s)??0)+1),Ke.observe(s);}),()=>{lt.delete(t)&&(r.forEach(s=>{let i=(Ze.get(s)??1)-1;if(i)return void Ze.set(s,i);Ze.delete(s),Ke?.unobserve(s);}),lt.size||(Ke?.disconnect(),Ke=void 0));}}function ut(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function _e(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=ut(i=>{if(!i)return;r();let a=(t.getProgress?.()??0)>=1;t.destroy(),t=n(a?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...a)=>t[i]?.(...a);return s.destroy=()=>{r(),t.destroy();},s}var Pn=0;function Cn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Wt(e,n){let t="";try{t=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return t||(e.getAttribute(n)??"").trim()}var qt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function $n(e){if(!je)return;let n=Wt(e,"stroke");if(!n||n==="none"){ge("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!qt.has(t)&&!qt.has(Wt(e,"fill"))&&ge("Element has a fill \u2014 it may obscure the stroke animation.",e);}function kn(e,n,t){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,a=e-i,m=n-i,p=t==="x";r.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${p?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${p?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(r),window.addEventListener("scroll",s,{passive:true}),s(),{el:r,destroy(){window.removeEventListener("scroll",s),r.remove();}}}var Bt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Gt=/[MmLlHhVvCcSsQqTtAaZz]/g;function On(e,n,t){if(!je)return;let r=(e.match(Gt)??[]).join("").toUpperCase(),s=(n.match(Gt)??[]).join("").toUpperCase(),i=(e.match(Bt)??[]).length,a=(n.match(Bt)??[]).length;if(r!==s){ge(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&ge(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function In(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=r[s++]??a;return String(+(a+(m-a)*t).toFixed(4))})}function jt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:_e(n,(t,r)=>Rn(e,t,r))}function Rn(e,n,t){let{preset:r,...s}=n,i=r?{...Nt[r],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:p=false,easing:h="linear",trigger:E={},stagger:H=0,direction:S="forward",once:Y=false,debug:te=false,axis:L="y",scrollContainer:ne,autoReverse:we=false,delay:C=0,strokeColor:I,strokeWidth:$,fillOpacity:A,waypoints:b,velocityScale:y=false,threshold:v=0,rootMargin:G="0px",repeat:_=0,repeatDelay:q=0,morphTo:D,clip:R,autoplay:re=false,duration:Te=1e3,native:ce=true,onProgress:N,onStart:k,onComplete:O,onEnter:u,onLeave:d,onEnterBack:X,onLeaveBack:xe}=i,V=R===true?"left":typeof R=="string"?R:false,K=typeof h=="function"?h:ee[h]??ee.linear,$e=de(E.start||"top bottom"),x=de(E.end||"bottom top"),T=typeof ne=="string"?document.querySelector(ne):ne??null,ue=Array.isArray(I)?I[0]:null,me=Array.isArray(I)?I[1]:typeof I=="string"?I:null,ke=Array.isArray($)?$[0]:null,Ie=Array.isArray($)?$[1]:typeof $=="number"?$:null,Me=Array.isArray(A)?A[0]:null,Ne=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Re(o){let l=o*100;switch(V){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let F=V?[]:Array.from(e.querySelectorAll(a)),he=[],ve=[],oe=0,Z=0,We=H,Je=0,j=false,c=false,f=0,Ae=false,fe=-1,J=[],Q=-1,w=false,se=0,ye=0,De,ft=null;function St(){ft?.destroy(),ft=null;}let Ve=new Set,Tt=NaN,ze=true,et=-1,xt=performance.now(),Be=NaN;function Qe(){return T?L==="x"?T.scrollLeft:T.scrollTop:L==="x"?window.scrollX:window.scrollY}function Mt(){return T?L==="x"?T.clientWidth:T.clientHeight:L==="x"?window.innerWidth:window.innerHeight}function Lt(){let o=ot(e,T,L);return Le(o,o.scroll,Mt(),$e,x)}function dn(){let o=Z-oe,l=F.length-1,g=T??document.documentElement,P=L==="x"?"Width":"Height";if(We=H,H>0&&l>0&&o>0){let pe=g[`scroll${P}`]-g[`client${P}`]-1-oe-o/m;pe>=0&&(We=Math.min(H,pe/(l*o)));}Je=Z+l*We*o;}function At(){(({tStart:oe,tEnd:Z}=Lt())),dn(),te&&je&&(St(),ft=kn(oe,Z,L));}function pt(o,l=Lt){Pe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let g=o.destroy;return o.destroy=()=>{g.call(o),Ce(e);},o}function Pt(o,l){return Y&&!we?Math.max(fe,K(J[o]=Math.max(J[o]??0,l))):K(l)}function gn(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),V){let g=l==="reverse"?1-o:o;e.style.clipPath=Re(g);return}F.forEach((g,P)=>dt(g,P,o,l));}function dt(o,l,g,P){o.style.strokeDashoffset=P==="reverse"?`${he[l]*g}`:`${he[l]*(1-g)}`,p&&(o.style.opacity=P==="reverse"?`${1-g}`:`${g}`),ue&&me?o.style.stroke=it(ue,me,g):me&&(o.style.stroke=me),ke!==null&&Ie!==null?o.style.strokeWidth=`${ke+(Ie-ke)*g}`:Ie!==null&&(o.style.strokeWidth=`${Ie}`),Me!==null&&Ne!==null?o.style.fillOpacity=`${Me+(Ne-Me)*g}`:Ne!==null&&(o.style.fillOpacity=`${Ne}`),D&&o.tagName.toLowerCase()==="path"&&ve[l]&&o.setAttribute("d",In(ve[l],D,g));}function Ue(){if(e.style.setProperty("--scroll-draw-progress","0"),V){e.style.clipPath=Re(S==="reverse"?1:0);return}F.forEach((o,l)=>{o.style.strokeDasharray=`${he[l]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${he[l]}`,p?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),ke!==null&&(o.style.strokeWidth=`${ke}`),Me!==null&&(o.style.fillOpacity=`${Me}`),D&&o.tagName.toLowerCase()==="path"&&ve[l]&&o.setAttribute("d",ve[l]);});}function Ye(o,l){let g=o.getAttribute("d"),P=st(o);if(D&&ve[l]){o.setAttribute("d",D);let pe=st(o);o.setAttribute("d",ve[l]),P=Math.max(st(o),pe),o.setAttribute("d",g);}he[l]=P,o.style.strokeDasharray=`${P}`;}if(F.forEach((o,l)=>{$n(o);let g=o.tagName.toLowerCase()==="path";g?ve.push(o.getAttribute("d")??""):ve.push(""),Ye(o,l);let P=he[l];D&&(g?On(ve[ve.length-1],D,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=S==="reverse"?`${P}`:"0",p&&(o.style.opacity="1"),me&&(o.style.stroke=me),Ie!==null&&(o.style.strokeWidth=`${Ie}`),Ne!==null&&(o.style.fillOpacity=`${Ne}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDashoffset=S==="reverse"?"0":`${P}`,p?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),ke!==null&&(o.style.strokeWidth=`${ke}`),Me!==null&&(o.style.fillOpacity=`${Me}`));}),t)return V&&(e.style.clipPath=Re(1)),O?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};V&&(e.style.clipPath=Re(S==="reverse"?1:0));let Ct=typeof h=="string"?at(h):null;function hn(){return !(ce===false||re||te&&je||!Cn()||!F.length||!Ct||V||L!=="y"||T||m!==1||H!==0||Y||we||y!==false||D||b||_||C>0||N||k||O||u||d||X||xe||I!=null||$!=null||A!=null||(E.start||"top bottom").trim()!=="top bottom"||(E.end||"bottom top").trim()!=="bottom top")}function yn(){let o=++Pn,l=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,P=`--svg-scroll-draw-${o}`,pe=S==="reverse"?"0":"var(--ssd-len)",Fe=S==="reverse"?"var(--ssd-len)":"0",Ee=`stroke-dashoffset:${pe};`,W=`stroke-dashoffset:${Fe};`;p&&(Ee+=`opacity:${S==="reverse"?1:0};`,W+=`opacity:${S==="reverse"?0:1};`);let B=document.createElement("style");B.setAttribute("data-svg-scroll-draw",""),B.textContent=`@keyframes ${l}{from{${Ee}}to{${W}}}.${g}{view-timeline-name:${P};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${P};animation-range:cover 0% cover 100%;}`,document.head.appendChild(B),e.classList.add(g);function ie(M,z){M.style.setProperty("--ssd-len",String(he[z])),M.style.strokeDasharray=`${he[z]}`,M.style.strokeDashoffset="",M.style.opacity="",M.style.animationPlayState="",M.classList.add(l);}F.forEach(ie);let ae=false,be=-1;function Se(){if(be>=0)return be;let M=e.getBoundingClientRect(),{tStart:z,tEnd:le}=Le({top:M.top,height:M.height},Qe(),Mt(),$e,x);return K(U(Qe(),z,le,m))}return {destroy(){e.classList.remove(g),F.forEach(M=>{M.classList.remove(l),M.style.removeProperty("--ssd-len"),M.style.animationPlayState="";}),B.remove();},replay(){ae=false,be=-1,F.forEach(ie);},pause(){ae=true,F.forEach(M=>{M.style.animationPlayState="paused";});},resume(){ae&&(ae=false,F.forEach(M=>{M.style.animationPlayState="running";}));},seek(M){let z=Math.min(1,Math.max(0,M));be=z,ae=true,F.forEach((le,He)=>{le.classList.remove(l),le.style.strokeDashoffset=S==="reverse"?`${he[He]*z}`:`${he[He]*(1-z)}`,p&&(le.style.opacity=S==="reverse"?`${1-z}`:`${z}`);});},getProgress(){return Se()},refresh(){F.forEach((M,z)=>{Ye(M,z),M.style.setProperty("--ssd-len",String(he[z]));});}}}if(hn())return pt(yn());function bn(){let o=Math.max(1,Te),l=V?o:o*(1+Math.max(0,F.length-1)*H),g=0,P=0,pe=false;function Fe(be){let Se=true,M=Math.min(1,Math.max(0,be/l));if(V){let z=Math.min(1,Math.max(0,be/o)),le=K(z);se=le,e.style.setProperty("--scroll-draw-progress",String(le)),e.style.clipPath=Re(S==="reverse"?1-le:le),N?.(le),z<1&&(Se=false);}else {F.forEach((le,He)=>{let vn=He*H*o,Ot=Math.min(1,Math.max(0,(be-vn)/o));dt(le,He,K(Ot),S),Ot<1&&(Se=false);});let z=K(M);se=z,N?.(z),e.style.setProperty("--scroll-draw-progress",String(z));}if(b){let z=K(M);for(let le in b){let He=parseFloat(le);z>=He&&!Ve.has(He)&&(Ve.add(He),b[le]?.());}}return Se}function Ee(be){if(w)return;let Se=be-g;c||(c=true,k?.());let M=Fe(Se);if(M&&!j){j=true,Fe(l),O?.(),ye<(_==="infinite"?1/0:_??0)&&(ye++,De=setTimeout(()=>{g=performance.now(),c=false,j=false,Ve.clear(),Ue(),f=requestAnimationFrame(Ee);},q));return}M||(f=requestAnimationFrame(Ee));}function W(){cancelAnimationFrame(f),clearTimeout(De),g=performance.now(),P=0,w=false,c=false,j=false,ye=0,pe=true,se=0,Ve.clear(),Ue(),f=requestAnimationFrame(Ee);}let B=new IntersectionObserver(be=>{be.forEach(Se=>{Se.isIntersecting&&!(Y&&j)?W():!Se.isIntersecting&&!Y&&!j&&(cancelAnimationFrame(f),clearTimeout(De),pe=false);});},{root:T??null,threshold:v,rootMargin:G}),ie;function ae(){clearTimeout(ie),ie=setTimeout(()=>F.forEach(Ye),150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),C>0?setTimeout(()=>B.observe(e),C):B.observe(e),{destroy(){cancelAnimationFrame(f),clearTimeout(De),B.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ie);},replay(){ye=0,W();},pause(){w||!pe||(w=true,P=performance.now()-g,cancelAnimationFrame(f));},resume(){w&&(w=false,pe=true,g=performance.now()-P,f=requestAnimationFrame(Ee));},seek(be){let Se=Math.min(1,Math.max(0,be));se=Se,w=true,P=Se*l,g=performance.now()-P,cancelAnimationFrame(f),Fe(P);},getProgress(){return se},refresh(){clearTimeout(ie),F.forEach(Ye);}}}if(re)return pt(bn());At();function $t(){if(w||!Ge)return;let o=performance.now(),l=Qe();if(!ze&&y===false&&l===Tt){ht(l);return}ze=false,Tt=l;let g=m;if(y!==false){let W=o-xt,B=W>0?Math.abs(l-(et<0?l:et))/W:0;g=m*Math.max(.2,1+B*(typeof y=="number"?y:1)*.04);}et=l,xt=o;let P=we?Q===-1||l>=Q?"forward":"reverse":S;Q=l;let pe=Z-oe,Fe=true,Ee=pe===0?0:(l-oe)/pe;if(isNaN(Be)||(Be<=0&&Ee>0?u?.():Be>0&&Ee<=0&&xe?.(),Be<1&&Ee>=1?d?.():Be>=1&&Ee<1&&X?.()),Be=Ee,V){let W=Pt(0,U(l,oe,Z,g));se=W,e.style.setProperty("--scroll-draw-progress",String(W));let B=P==="reverse"?1-W:W;e.style.clipPath=Re(B),N?.(W),!c&&U(l,oe,Z,g)>0&&(c=true,k?.()),W>=1&&!j?(j=true,O?.(),ye<(_==="infinite"?1/0:_??0)&&(ye++,De=setTimeout(()=>{fe=-1,J=[],c=false,j=false,Ue();},q))):W<1&&!Y&&(j=false),ht(l);return}if(F.forEach((W,B)=>{let ie=B*We*pe,ae=Pt(B,U(l,oe+ie,Z+ie,g));dt(W,B,ae,P),B===0&&(se=ae,N?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),ae<1&&(Fe=false);}),b){let W=K(U(l,oe,Z,g));for(let B in b){let ie=parseFloat(B);W>=ie&&!Ve.has(ie)&&(Ve.add(ie),b[B]?.());}}!c&&U(l,oe,Z,g)>0&&(c=true,k?.()),Fe&&!j?(j=true,O?.(),ye<(_==="infinite"?1/0:_??0)&&(ye++,De=setTimeout(()=>{fe=-1,J=[],c=false,j=false,Ve.clear(),Ue(),ze=true;},q))):!Fe&&!Y&&(j=false),ht(l);}function gt(o){return o>=Z&&o<Je}function ht(o){Ae||gt(o)?f=requestAnimationFrame($t):Ge=false;}function yt(){return Ae||gt(Qe())}let Ge=false;function tt(){Ge||(Ge=true,f=requestAnimationFrame(function(){$t();}));}function nt(){Ge=false,cancelAnimationFrame(f);}let bt=new IntersectionObserver(o=>{o.forEach(l=>{Ae=l.isIntersecting,Ae&&!w?(ze=true,tt()):Ge&&!w&>(Qe())||nt();});},{root:T??null,threshold:v,rootMargin:G});function kt(){F.forEach(Ye),At(),ze=true;}let rt;function Xe(){clearTimeout(rt),rt=setTimeout(kt,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let wn=Oe([e],Xe);return C>0?setTimeout(()=>bt.observe(e),C):bt.observe(e),pt({destroy(){cancelAnimationFrame(f),clearTimeout(De),nt(),bt.disconnect(),wn(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(rt),St();},replay(){fe=-1,J=[],Q=-1,et=-1,c=false,j=false,ye=0,w=false,se=0,Ve.clear(),clearTimeout(De),Ue(),ze=true,yt()&&tt();},pause(){w=true,nt();},resume(){w&&(w=false,ze=true,yt()&&tt());},seek(o){let l=Math.min(1,Math.max(0,o));se=l,fe=l,J=[],w=true,nt(),gn(l,S),ze=true;},getProgress(){return se},refresh(){clearTimeout(rt),kt(),yt()&&!w&&tt();}},()=>({tStart:oe,tEnd:Z}))}var Qt=new WeakMap,Fn=0;function wt(e){return JSON.stringify(e,(n,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let r=Qt.get(t);return r===void 0&&Qt.set(t,r=++Fn),`el#${r}`}return t})}function Ut(e,n){let t={...e};for(let r of Object.keys(t))typeof t[r]=="function"&&(t[r]=(...s)=>n()[r]?.(...s));return t}function Hn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Yt(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let s=[],i=[],a=r[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let p=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(p?parseFloat(p[1]):0),i.push(p?p[2]:"");}n.push({fn:r[1],nums:s,units:i});}return n}function Nn(e,n,t){let r=Yt(e),s=Yt(n);return r.length===0||r.length!==s.length?t<1?e:n:r.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?t<1?`${i.fn}(${i.nums.map((p,h)=>`${p}${i.units[h]}`).join(", ")})`:`${m.fn}(${m.nums.map((p,h)=>`${p}${m.units[h]}`).join(", ")})`:`${i.fn}(${i.nums.map((p,h)=>`${p+(m.nums[h]-p)*t}${i.units[h]}`).join(", ")})`}).join(" ")}function Xt(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),s=String(n);if(Hn(r))return it(r,s,t);if(r.includes("("))return Nn(r,s,t);let i=r.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),p=parseFloat(a[1]);return `${m+(p-m)*t}${i[2]||a[2]}`}return t<1?r:s}function Dn(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Vn=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),zn=0,Kt="--scroll-draw-progress";function _n(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function en(e,n){return typeof window>"u"?Jt:n.respectReducedMotion===false?Zt(e,n,false):_e(n,(t,r)=>Zt(e,t,r))}function Zt(e,n,t){let{props:r,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:p="y",scrollContainer:h,native:E=true,velocityScale:H=false,triggerElement:S,onProgress:Y,onComplete:te,onEnter:L,onLeave:ne,onEnterBack:we,onLeaveBack:C}=n,I=typeof i=="function"?i:ee[i]??ee["ease-out"],$=de(s.start||"top bottom"),A=de(s.end||"bottom top"),b=S??e,y=typeof h=="string"?document.querySelector(h):h??null,v=Object.entries(r).map(([c,f])=>({prop:Dn(c),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function G(){let c=window.getComputedStyle(e);for(let f of v)f.from===""&&(f.from=c.getPropertyValue(f.prop).trim()||"0");}function _(){for(let c of v)e.style.setProperty(c.prop,String(c.to));}let q=new Map;for(let c of [...v.map(f=>f.prop),Kt])q.set(c,e.style.getPropertyValue(c));function D(){for(let[c,f]of q)f?e.style.setProperty(c,f):e.style.removeProperty(c);}if(t)return _(),te?.(),{...Jt,destroy:D,getProgress:()=>1};G();let R=()=>y?p==="x"?y.scrollLeft:y.scrollTop:p==="x"?window.scrollX:window.scrollY,re=()=>y?p==="x"?y.clientWidth:y.clientHeight:p==="x"?window.innerWidth:window.innerHeight,Te=typeof i=="string"?at(i):null;function ce(){if(!E||!_n()||!Te||p!=="y"||y||b!==e||m||a!==1||Y||te||L||ne||we||C||H!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let c of v)if(!Vn.has(c.prop))return false;return true}function N(){let c=`ssd-a-${++zn}`,f=v.map(w=>`${w.prop}:${w.from}`).join(";"),Ae=v.map(w=>`${w.prop}:${w.to}`).join(";"),fe=document.createElement("style");fe.setAttribute("data-ssd-animate",""),fe.textContent=`@keyframes ${c}{from{${f}}to{${Ae}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Te};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe),e.classList.add(c);let J=()=>{let w=e.getBoundingClientRect();return Le({top:w.top,height:w.height},R(),re(),$,A)};Pe(e,{type:"animate",getProgress:()=>Q.getProgress(),getTrigger:J});let Q={refresh(){},destroy(){e.classList.remove(c),fe.remove(),e.style.animationPlayState="",D(),Ce(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(w){let se=Math.min(1,Math.max(0,w));e.classList.remove(c);for(let ye of v)e.style.setProperty(ye.prop,Xt(ye.from,ye.to,se));},getProgress(){let{tStart:w,tEnd:se}=J();return I(U(R(),w,se,a))}};return Q}if(ce())return N();let k=0,O=0,u=0,d=NaN,X=false,xe=-1,V=0,K=0,$e=false,x=NaN,T=-1,ue=0,me=b===e?v:[],ke=false;function Ie(){let c=e.style,f=me.map(Q=>c.getPropertyValue(Q.prop)),Ae=c.transition;me.length&&(c.transition="none"),me.forEach(Q=>c.setProperty(Q.prop,q.get(Q.prop)??""));let fe=ot(b,y,p);me.forEach((Q,w)=>c.setProperty(Q.prop,f[w])),me.length&&(e.offsetWidth,c.transition=Ae);let J=Le(fe,fe.scroll,re(),$,A);ke&&Math.abs(J.tStart-k)<1&&Math.abs(J.tEnd-O)<1||(ke=true,k=J.tStart,O=J.tEnd);}function Me(c){e.style.setProperty(Kt,String(c));for(let f of v)e.style.setProperty(f.prop,Xt(f.from,f.to,c));Y?.(c);}function Ne(c){if(isNaN(x)){x=c;return}x<=0&&c>0?L?.():x>0&&c<=0&&C?.(),x<1&&c>=1?ne?.():x>=1&&c<1&&we?.(),x=c;}let Re=c=>U(c,k,O,Math.min(a,1));function F(){!u&&!X&&Re(R())!==d&&(u=requestAnimationFrame(he));}function he(){if(X)return;let c=performance.now(),f=R(),Ae=a;if(H!==false){let w=c-ue,se=w>0?Math.abs(f-(T<0?f:T))/w:0;Ae=a*Math.max(.2,1+se*(typeof H=="number"?H:1)*.04);}T=f,ue=c;let fe=O===k?0:(f-k)/(O-k);Ne(fe);let J=U(f,k,O,Ae),Q=m?Math.max(xe,I(V=Math.max(V,J))):I(J);K=Q,Me(Q),Q>=1&&!$e?($e=true,te?.()):Q<1&&!m&&($e=false),!X&&(d=Re(f),u=d>0&&d<1?requestAnimationFrame(he):0);}Ie(),O===k&&ge("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),V=U(R(),k,O,a),K=I(V),Me(K);function ve(){Ie(),F();}let oe;function Z(){clearTimeout(oe),oe=setTimeout(ve,150);}let We=y??window;We.addEventListener("scroll",F,{passive:true}),window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z);let Je=Oe([b],Z);F(),Pe(e,{type:"animate",getProgress:()=>K,getTrigger:()=>({tStart:k,tEnd:O})});function j(){X=true,cancelAnimationFrame(u),u=0,d=NaN;}return {destroy(){j(),We.removeEventListener("scroll",F),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),Je(),clearTimeout(oe),D(),Ce(e);},replay(){xe=-1,V=0,$e=false,K=0,X=false,Me(0),d=0,F();},pause:j,resume(){X&&(X=false,F());},seek(c){let f=Math.min(1,Math.max(0,c));K=f,xe=f,V=0,j(),Me(f);},getProgress(){return K},refresh:ve}}var vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tn(e,n){if(typeof window>"u")return vt;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(n,(r,s)=>Wn(t,r,s)):(ge("scrollCounter: element not found:",e),vt)}function Wn(e,n,t){let{from:r=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:p=true,decimals:h,onComplete:E}=n,H=h!==void 0?u=>u.toFixed(h):i??(u=>String(Math.round(u))),S=typeof a=="function"?a:ee[a]??ee["ease-out"],Y=de(m.start||"top 80%"),te=de(m.end||"top 20%");if(t)return e.textContent=H(s),E?.(),{...vt,getProgress:()=>1};let L=0,ne=0,we=false,C=0,I=false,$=false,A=-1,b=0,y=0,v=false,G=()=>window.scrollY,_=()=>window.innerHeight;function q(){let u=e.getBoundingClientRect(),d=Le({top:u.top,height:u.height},G(),_(),Y,te);we&&Math.abs(d.tStart-L)<1&&Math.abs(d.tEnd-ne)<1||(we=true,L=d.tStart,ne=d.tEnd);}let D=e.style.getPropertyValue("--scroll-draw-progress");function R(u){e.textContent=H(r+(s-r)*u),e.style.setProperty("--scroll-draw-progress",String(u));}function re(){if(!I||$)return;let u=U(G(),L,ne,1),d=p?Math.max(A,S(b=Math.max(b,u))):S(u);y=d,R(d),d>=1&&!v?(v=true,E?.()):d<1&&!p&&(v=false),C=requestAnimationFrame(re);}q();{b=U(G(),L,ne,1);let u=S(b);y=u,R(u);}let Te=new IntersectionObserver(u=>{u.forEach(d=>{I=d.isIntersecting,I&&!$?C=requestAnimationFrame(re):cancelAnimationFrame(C);});}),ce;function N(){clearTimeout(ce),ce=setTimeout(q,150);}window.addEventListener("resize",N),window.addEventListener("orientationchange",N);let k=Oe([e],N);Te.observe(e),Pe(e,{type:"counter",getProgress:()=>y,getTrigger:()=>({tStart:L,tEnd:ne})});function O(){$&&($=false,I&&(C=requestAnimationFrame(re)));}return {destroy(){cancelAnimationFrame(C),Te.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),k(),clearTimeout(ce),e.style.setProperty("--scroll-draw-progress",D),Ce(e);},replay(){A=-1,b=0,v=false,y=0,R(0),O();},pause(){$=true,cancelAnimationFrame(C);},resume:O,seek(u){let d=Math.min(1,Math.max(0,u));y=d,A=d,b=0,$=true,cancelAnimationFrame(C),R(d);},getProgress(){return y}}}var nn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rn(e,n={}){if(typeof window>"u")return nn;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),nn;let r=t,{trigger:s={},easing:i="linear",once:a=false,axis:m="y",preload:p="auto",triggerElement:h,onReady:E,onComplete:H,onProgress:S}=n,Y=h??r,te=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof i=="function"?i:ee[i]??ee.linear,ne=de(s.start||"top top"),we=de(s.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=p);let C=n.from??0,I=n.to,$=0,A=0,b=0,y=false,v=false,G=-1,_=0,q=0,D=false,R=false,re=()=>m==="x"?window.scrollX:window.scrollY,Te=()=>m==="x"?window.innerWidth:window.innerHeight;function ce(){let x=Y.getBoundingClientRect(),T=m==="x"?x.left:x.top,ue=m==="x"?x.width:x.height,me=Le({top:T,height:ue},re(),Te(),ne,we);$=me.tStart,A=me.tEnd,R&&A===$&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let N=NaN;function k(x){if(!R)return;let T=I??r.duration??0,ue=C+(T-C)*x;ue!==N&&(N=ue,r.currentTime=ue),r.style.setProperty("--scroll-draw-progress",String(x)),S?.(x);}function O(){if(!y||v||!R||te)return;let x=U(re(),$,A,1),T=a?Math.max(G,L(_=Math.max(_,x))):L(x);q=T,k(T),T>=1&&!D?(D=true,H?.()):T<1&&!a&&(D=false),b=requestAnimationFrame(O);}function u(){if(R=true,I===void 0&&(I=r.duration),te){k(1),E?.();return}ce(),E?.(),v?k(q):y&&(b=requestAnimationFrame(O));}r.readyState>=1?u():r.addEventListener("loadedmetadata",u,{once:true}),R||ce();let d=te?()=>{}:ut(x=>{x&&(d(),te=true,cancelAnimationFrame(b),k(1));}),X=new IntersectionObserver(x=>{x.forEach(T=>{y=T.isIntersecting,y&&!v&&R?b=requestAnimationFrame(O):cancelAnimationFrame(b);});}),xe;function V(){clearTimeout(xe),xe=setTimeout(ce,150);}window.addEventListener("resize",V),window.addEventListener("orientationchange",V);let K=Oe([Y],V);X.observe(r),Pe(r,{type:"video",getProgress:()=>q,getTrigger:()=>({tStart:$,tEnd:A})});function $e(){v&&(v=false,y&&R&&(b=requestAnimationFrame(O)));}return {destroy(){cancelAnimationFrame(b),X.disconnect(),r.removeEventListener("loadedmetadata",u),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),K(),d(),clearTimeout(xe),Ce(r);},replay(){G=-1,_=0,D=false,q=0,N=NaN,k(0),$e();},pause(){v=true,cancelAnimationFrame(b);},resume:$e,seek(x){let T=Math.min(1,Math.max(0,x));q=T,G=T,_=0,v=true,cancelAnimationFrame(b),N=NaN,k(T);},getProgress(){return q}}}function on(e,n){let t=document.createElement("span");t.textContent=n,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function mt(e=""){let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=e,n}function an(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(t=>{let r=e.appendChild(mt(t)),s=/^\s+$/.test(t);return s?r.style.whiteSpace="pre":r.style.display="inline-block",s?null:r}).filter(t=>t!==null)}function qn(e){let n=e.textContent??"";e.textContent="";let t=[],r=null;for(let s of n){let i=mt(s),a=s===" ";a?i.style.whiteSpace="pre":(i.style.display="inline-block",t.push(i)),a||s>"\u0DFF"?r=null:r||(r=e.appendChild(mt()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(i);}return t}function sn(e){let n=an(e),t=new Map;for(let i of n){let a=i.offsetTop;t.has(a)||t.set(a,[]),t.get(a).push(i);}let r=[],s=Array.from(t.keys()).sort((i,a)=>i-a);for(let i of s){let a=t.get(i),m=mt();m.style.display="inline-block",a.forEach((p,h)=>{let E=p.nextElementSibling;m.appendChild(p),h<a.length-1&&E&&E.style.whiteSpace==="pre"&&m.appendChild(E);}),r.push(m);}return e.textContent="",r.forEach((i,a)=>{e.appendChild(i),a<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Bn(e,n,t,r){if(t<=1||r===0)return e;r=Math.min(r,1/t);let s=(t-1)*r,i=n*r,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function Gn(e,n){let t=[];if(n?.y!==void 0&&t.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&t.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&t.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let r=n.scale+(1-n.scale)*e;t.push(`scale(${r})`);}return t.join(" ")}var Et={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ln(e,n={}){if(typeof window>"u")return Et;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return ge("scrollText: element not found:",e),Et;let r=t;return _e(n,(s,i)=>jn(r,s,i))}function jn(e,n,t){let{split:r="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:p=true,onComplete:h}=n,E=typeof i=="function"?i:ee[i]??ee["ease-out"],H=de(m.start||"top 85%"),S=de(m.end||"top 40%"),Y=e.innerHTML,te=e.textContent??"",L;r==="chars"?L=qn(e):r==="lines"?L=sn(e):L=an(e),on(e,te);let ne=L.length;function we(u,d){a?.opacity!==void 0&&(u.style.opacity=String(a.opacity+(1-a.opacity)*d));let X=Gn(d,a);X&&(u.style.transform=X);}function C(u){e.style.setProperty("--scroll-draw-progress",String(u)),L.forEach((d,X)=>{let xe=E(Bn(u,X,ne,s));we(d,xe);});}if(t)return C(1),h?.(),{...Et,destroy:()=>{e.innerHTML=Y;},getProgress:()=>1};C(0);let I=0,$=0,A=0,b=false,y=false,v=-1,G=0,_=false,q=()=>window.scrollY,D=()=>window.innerHeight;function R(){let u=e.getBoundingClientRect(),d=Le({top:u.top,height:u.height},q(),D(),H,S);I=d.tStart,$=d.tEnd;}function re(){if(!b||y)return;let u=U(q(),I,$,1);p&&(v=Math.max(v,u),u=v),G=u,C(u),u>=1&&!_?(_=true,h?.()):u<1&&!p&&(_=false),A=requestAnimationFrame(re);}R();let Te=new IntersectionObserver(u=>{u.forEach(d=>{b=d.isIntersecting,b&&!y?A=requestAnimationFrame(re):cancelAnimationFrame(A);});}),ce;function N(){clearTimeout(ce),ce=setTimeout(()=>{if(r==="lines"){let u=G;e.innerHTML=Y,L=sn(e),on(e,te),C(u);}R();},150);}window.addEventListener("resize",N),window.addEventListener("orientationchange",N);let k=Oe([e],N);Te.observe(e),Pe(e,{type:"text",getProgress:()=>G,getTrigger:()=>({tStart:I,tEnd:$})});function O(){y&&(y=false,b&&(A=requestAnimationFrame(re)));}return {destroy(){cancelAnimationFrame(A),Te.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),k(),clearTimeout(ce),e.innerHTML=Y,Ce(e);},replay(){v=-1,_=false,G=0,C(0),O();},pause(){y=true,cancelAnimationFrame(A);},resume:O,seek(u){let d=Math.min(1,Math.max(0,u));G=d,v=d,y=true,cancelAnimationFrame(A),C(d);},getProgress(){return G}}}var qe=class{constructor(n){this.create=n;this.instance=null;this.el=null;this.key="";}init(n,t){return this.destroy(),this.el=n,this.latest=t,this.key=wt(t),this.instance=this.create(n,Ut(t,()=>this.latest)),this}update(n){return this.el?wt(n)!==this.key?this.init(this.el,n):(this.latest=n,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(n){return this.instance?.seek(n),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},cn=class extends qe{constructor(){super(jt);}init(n,t={}){return super.init(n,t)}},un=class extends qe{constructor(){super(en);}},mn=class extends qe{constructor(){super(tn);}},fn=class extends qe{constructor(){super(rn);}init(n,t={}){return super.init(n,t)}},pn=class extends qe{constructor(){super(ln);}init(n,t={}){return super.init(n,t)}};exports.EngineRef=qe;exports.ScrollAnimateRef=un;exports.ScrollCounterRef=mn;exports.ScrollDrawRef=cn;exports.ScrollTextRef=pn;exports.ScrollVideoRef=fn;
|
package/dist/angular/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-
|
|
1
|
+
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-QFSTKVA3.mjs';import {a as a$4}from'../chunk-NLPSVYFP.mjs';import {a as a$2}from'../chunk-I73SOXBN.mjs';import {a as a$1}from'../chunk-OPXWNJBG.mjs';import {b as b$1}from'../chunk-6TWFLRUB.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';var r=class{constructor(t){this.create=t;this.instance=null;this.el=null;this.key="";}init(t,e){return this.destroy(),this.el=t,this.latest=e,this.key=a(e),this.instance=this.create(t,b(e,()=>this.latest)),this}update(t){return this.el?a(t)!==this.key?this.init(this.el,t):(this.latest=t,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(t){return this.instance?.seek(t),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},u=class extends r{constructor(){super(b$1);}init(t,e={}){return super.init(t,e)}},h=class extends r{constructor(){super(a$1);}},m=class extends r{constructor(){super(a$2);}},O=class extends r{constructor(){super(a$3);}init(t,e={}){return super.init(t,e)}},d=class extends r{constructor(){super(a$4);}init(t,e={}){return super.init(t,e)}};export{r as EngineRef,h as ScrollAnimateRef,m as ScrollCounterRef,u as ScrollDrawRef,d as ScrollTextRef,O as ScrollVideoRef};
|
package/dist/astro/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function gn({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),s=Math.sqrt(r),i=0,a=[];for(let d=0;d<n;d++){let b=Math.pow(s,d);a.push(b),i+=b;}let m=[0],u=0;for(let d=0;d<n;d++)u+=a[d]/i,m.push(u);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let b=0;b<n;b++)if(d<=m[b+1]){let P=(d-m[b])/(m[b+1]-m[b]);if(b===0)return P*(2-P);let v=1-Math.pow(r,b);return v+(1-v)*(2*P-1)*(2*P-1)}return 1}}function yn({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),s=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return i=>i<=0?0:i>=1?1:n*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/r)+1}var ue={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:gn(),elastic:yn()};function Rt(e,t,n){return Math.min(n,Math.max(t,e))}function be(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}function Ht(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function Ft(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function G(e,t,n,r){return n===t?0:Rt((e-t)/(n-t)*r,0,1)}function Le(e,t,n,r,s){let i=Ht(e.top,e.height,t,r.element)-Ft(r.viewport,n),a=Ht(e.top,e.height,t,s.element)-Ft(s.viewport,n);return {tStart:i,tEnd:a}}function ot(e,t,n){let r=e.getBoundingClientRect(),s=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:r.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:s,scroll:0}:{top:n==="x"?r.left:r.top,height:s,scroll:n==="x"?window.scrollX:window.scrollY}}function st(e){let t=parseFloat(e.getAttribute("pathLength")??"");if(t>0)return t;let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(r+s)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Nt(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function it(e,t,n){let r=Nt(e),s=Nt(t);return !r||!s?e:`rgb(${Math.round(r[0]+(s[0]-r[0])*n)},${Math.round(r[1]+(s[1]-r[1])*n)},${Math.round(r[2]+(s[2]-r[2])*n)})`}var _t={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function Q(e,...t){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var hn="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",bn="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",zt=33;function wn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function vn(e){let t=[];for(let n=0;n<zt;n++){let r=n/(zt-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function at(e){switch(e){case "linear":return "linear";case "ease-in":return hn;case "ease-out":return bn;case "ease-in-out":return wn()?vn(ue["ease-in-out"]):null;default:return null}}var Vt=Symbol.for("svg-scroll-draw.registry");function Wt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function Ie(e,t){Wt().set(e,t);}function Oe(e){Wt().delete(e);}var Xe,lt=new Set,ct=new WeakMap,Je=new Map,qt=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function En(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function _e(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();Xe??(Xe=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)ct.get(a)!==qt(a)&&(i=true),ct.set(a,"");i&<.forEach(a=>a());})),lt.add(n);let r=En(e);return [document.body,document.documentElement].forEach(s=>s&&r.add(s)),r.forEach(s=>{ct.has(s)||ct.set(s,qt(s)),Je.set(s,(Je.get(s)??0)+1),Xe.observe(s);}),()=>{lt.delete(n)&&(r.forEach(s=>{let i=(Je.get(s)??1)-1;if(i)return void Je.set(s,i);Je.delete(s),Xe?.unobserve(s);}),lt.size||(Xe?.disconnect(),Xe=void 0));}}function Bt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=s=>e(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function ze(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Bt(i=>{if(!i)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(n))s[i]=(...a)=>n[i]?.(...a);return s.destroy=()=>{r(),n.destroy();},s}var Sn=0;function Tn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e,t){let n="";try{n=getComputedStyle(e).getPropertyValue(t).trim();}catch{}return n||(e.getAttribute(t)??"").trim()}var Qt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function xn(e){if(!Ge)return;let t=Gt(e,"stroke");if(!t||t==="none"){Q("Element has no stroke \u2014 path will not be visible.",e);return}let n=(e.getAttribute("fill")??"").trim();n&&!Qt.has(n)&&!Qt.has(Gt(e,"fill"))&&Q("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Mn(e,t,n){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=n==="x"?window.scrollX:window.scrollY,a=e-i,m=t-i,u=n==="x";r.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${u?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
-
<div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function vr(e,t,r){if(!Xe)return;let n=(e.match(qt)??[]).join("").toUpperCase(),s=(t.match(qt)??[]).join("").toUpperCase(),i=(e.match(Wt)??[]).length,a=(t.match(Wt)??[]).length;if(n!==s){J(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}i!==a&&J(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function bt(e,t,r){let n=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=n[s++]??a;return String(+(a+(m-a)*r).toFixed(4))})}function ct(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:ze(t,(r,n)=>Er(e,r,n))}function Er(e,t,r){let{preset:n,...s}=t,i=n?{...It[n],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=false,easing:d="linear",trigger:E={},stagger:O=0,direction:x="forward",once:Z=false,debug:Me=false,axis:$="y",scrollContainer:ie,autoReverse:pe=false,delay:D=0,strokeColor:z,strokeWidth:I,fillOpacity:M,waypoints:C,velocityScale:S=false,threshold:R=0,rootMargin:me="0px",repeat:j=0,repeatDelay:oe=0,morphTo:F,clip:de,autoplay:ve=false,duration:ge=1e3,native:U=true,onProgress:p,onStart:L,onComplete:b,onEnter:P,onLeave:ae,onEnterBack:Ee,onLeaveBack:Ve}=i,K=de===true?"left":typeof de=="string"?de:false,Se=typeof d=="function"?d:ue[d]??ue.linear,Qe=we(E.start??"top bottom"),je=we(E.end??"bottom top"),fe=typeof ie=="string"?document.querySelector(ie):ie??null,ee=Array.isArray(z)?z[0]:null,Y=Array.isArray(z)?z[1]:typeof z=="string"?z:null,X=Array.isArray(I)?I[0]:null,q=Array.isArray(I)?I[1]:typeof I=="number"?I:null,se=Array.isArray(M)?M[0]:null,Q=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Le(o){let c=o*100;switch(K){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let H=K?[]:Array.from(e.querySelectorAll(a)),T=[],le=[],l=0,f=0,Te=O,ye=0,v=false,k=false,V=0,Ie=false,_=-1,Pe=[],Re=-1,te=false,Ae=0,De=0,Fe,ft=null;function Et(){ft?.destroy(),ft=null;}let He=new Set,St=NaN,Ne=true,et=-1,Tt=performance.now(),We=NaN;function Ue(){return fe?$==="x"?fe.scrollLeft:fe.scrollTop:$==="x"?window.scrollX:window.scrollY}function xt(){return fe?$==="x"?fe.clientWidth:fe.clientHeight:$==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=st(e,fe,$);return Ce(o,o.scroll,xt(),Qe,je)}function nr(){let o=f-l,c=H.length-1,y=fe??document.documentElement,B=$==="x"?"Width":"Height";if(Te=O,O>0&&c>0&&o>0){let he=y[`scroll${B}`]-y[`client${B}`]-1-l-o/m;he>=0&&(Te=Math.min(O,he/(c*o)));}ye=f+c*Te*o;}function Lt(){(({tStart:l,tEnd:f}=Mt())),nr(),Me&&Xe&&(Et(),ft=wr(l,f,$));}function pt(o,c=Mt){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let y=o.destroy;return o.destroy=()=>{y.call(o),Oe(e);},o}function or(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),K){let y=c==="reverse"?1-o:o;e.style.clipPath=Le(y);return}H.forEach((y,B)=>{y.style.strokeDashoffset=c==="reverse"?`${T[B]*o}`:`${T[B]*(1-o)}`,u&&(y.style.opacity=c==="reverse"?`${1-o}`:`${o}`),ee&&Y?y.style.stroke=Ge(ee,Y,o):Y&&(y.style.stroke=Y),X!==null&&q!==null?y.style.strokeWidth=`${X+(q-X)*o}`:q!==null&&(y.style.strokeWidth=`${q}`),se!==null&&Q!==null?y.style.fillOpacity=`${se+(Q-se)*o}`:Q!==null&&(y.style.fillOpacity=`${Q}`),F&&y.tagName.toLowerCase()==="path"&&le[B]&&y.setAttribute("d",bt(le[B],F,o));});}function tt(){if(e.style.setProperty("--scroll-draw-progress","0"),K){e.style.clipPath=Le(0);return}H.forEach((o,c)=>{o.style.strokeDasharray=`${T[c]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${T[c]}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",ee&&(o.style.stroke=ee),X!==null&&(o.style.strokeWidth=`${X}`),se!==null&&(o.style.fillOpacity=`${se}`),F&&o.tagName.toLowerCase()==="path"&&le[c]&&o.setAttribute("d",le[c]);});}if(H.forEach(o=>{br(o);let c=Be(o);T.push(c);let y=o.tagName.toLowerCase()==="path";y?le.push(o.getAttribute("d")??""):le.push(""),F&&(y?vr(le[le.length-1],F,o):J(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),r?(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=x==="reverse"?`${c}`:"0",u&&(o.style.opacity="1"),Y&&(o.style.stroke=Y),q!==null&&(o.style.strokeWidth=`${q}`),Q!==null&&(o.style.fillOpacity=`${Q}`),F&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",F)):(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=x==="reverse"?"0":`${c}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",ee&&(o.style.stroke=ee),X!==null&&(o.style.strokeWidth=`${X}`),se!==null&&(o.style.fillOpacity=`${se}`));}),K){if(r)return e.style.clipPath=Le(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Le(0);}else if(r)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let At=typeof d=="string"?it(d):null;function sr(){return !(U===false||!hr()||!H.length||!At||K||$!=="y"||fe||m!==1||O!==0||Z||pe||S!==false||F||C||j||D>0||p||L||b||P||ae||Ee||Ve||z!=null||I!=null||M!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function ir(){let o=++yr,c=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,B=`--svg-scroll-draw-${o}`,he=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",xe=`stroke-dashoffset:${he};`,w=`stroke-dashoffset:${$e};`;u&&(xe+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let A=document.createElement("style");A.setAttribute("data-svg-scroll-draw",""),A.textContent=`@keyframes ${c}{from{${xe}}to{${w}}}.${y}{view-timeline-name:${B};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${At};animation-fill-mode:both;animation-timeline:${B};animation-range:cover 0% cover 100%;}`,document.head.appendChild(A),e.classList.add(y);function re(g,G){g.style.setProperty("--ssd-len",String(T[G])),g.style.strokeDasharray=`${T[G]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(c);}H.forEach(re);let h=false,N=-1;function W(){if(N>=0)return N;let g=e.getBoundingClientRect(),{tStart:G,tEnd:be}=Ce({top:g.top,height:g.height},Ue(),xt(),Qe,je);return Se(ne(Ue(),G,be,m))}return {destroy(){e.classList.remove(y),H.forEach(g=>{g.classList.remove(c),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),A.remove();},replay(){h=false,N=-1,H.forEach(re);},pause(){h=true,H.forEach(g=>{g.style.animationPlayState="paused";});},resume(){h&&(h=false,H.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let G=Math.min(1,Math.max(0,g));N=G,h=true,H.forEach((be,ce)=>{be.classList.remove(c),be.style.strokeDashoffset=x==="reverse"?`${T[ce]*G}`:`${T[ce]*(1-G)}`,u&&(be.style.opacity=x==="reverse"?`${1-G}`:`${G}`);});},getProgress(){return W()},refresh(){H.forEach((g,G)=>{T[G]=Be(g),g.style.setProperty("--ssd-len",String(T[G])),g.style.strokeDasharray=`${T[G]}`;});}}}if(sr())return pt(ir());function ar(){let o=Math.max(1,ge),c=0,y=0,B=false;function he(h){let N=true;if(K){let W=Math.min(1,Math.max(0,h/o)),g=Se(W);Ae=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Le(x==="reverse"?1-g:g),p?.(g),W<1&&(N=false);}else H.forEach((W,g)=>{let G=g*O*o,be=Math.min(1,Math.max(0,(h-G)/o)),ce=Se(be);W.style.strokeDashoffset=x==="reverse"?`${T[g]*ce}`:`${T[g]*(1-ce)}`,u&&(W.style.opacity=x==="reverse"?`${1-ce}`:`${ce}`),ee&&Y?W.style.stroke=Ge(ee,Y,ce):Y&&(W.style.stroke=Y),X!==null&&q!==null?W.style.strokeWidth=`${X+(q-X)*ce}`:q!==null&&(W.style.strokeWidth=`${q}`),se!==null&&Q!==null?W.style.fillOpacity=`${se+(Q-se)*ce}`:Q!==null&&(W.style.fillOpacity=`${Q}`),F&&W.tagName.toLowerCase()==="path"&&le[g]&&W.setAttribute("d",bt(le[g],F,ce)),g===0&&(Ae=ce,p?.(ce),e.style.setProperty("--scroll-draw-progress",String(ce))),be<1&&(N=false);});if(C){let W=Math.min(1,Math.max(0,h/o)),g=Se(W);for(let G in C){let be=parseFloat(G);g>=be&&!He.has(be)&&(He.add(be),C[G]?.());}}return N}function $e(h){if(te)return;let N=h-c;k||(k=true,L?.());let W=he(N);if(W&&!v){v=true,he(o*(1+Math.max(0,H.length-1)*O)),b?.(),De<(j==="infinite"?1/0:j??0)&&(De++,Fe=setTimeout(()=>{c=performance.now(),k=false,v=false,He.clear(),tt(),V=requestAnimationFrame($e);},oe));return}W||(V=requestAnimationFrame($e));}function xe(){cancelAnimationFrame(V),clearTimeout(Fe),c=performance.now(),y=0,te=false,k=false,v=false,De=0,B=true,Ae=0,He.clear(),tt(),V=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(Z&&v)?xe():!N.isIntersecting&&!Z&&!v&&(cancelAnimationFrame(V),clearTimeout(Fe),B=false);});},{root:fe??null,threshold:R,rootMargin:me}),A;function re(){clearTimeout(A),A=setTimeout(()=>{H.forEach((h,N)=>{T[N]=Be(h),h.style.strokeDasharray=`${T[N]}`;});},150);}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),D>0?setTimeout(()=>w.observe(e),D):w.observe(e),{destroy(){cancelAnimationFrame(V),clearTimeout(Fe),w.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(A);},replay(){De=0,xe();},pause(){te||!B||(te=true,y=performance.now()-c,cancelAnimationFrame(V));},resume(){te&&(te=false,B=true,c=performance.now()-y,V=requestAnimationFrame($e));},seek(h){let N=Math.min(1,Math.max(0,h));Ae=N,te=true,y=N*o,c=performance.now()-y,cancelAnimationFrame(V),he(y);},getProgress(){return Ae},refresh(){clearTimeout(A),H.forEach((h,N)=>{T[N]=Be(h),h.style.strokeDasharray=`${T[N]}`;});}}}if(ve)return pt(ar());Lt();function $t(){if(te||!qe)return;let o=performance.now(),c=Ue();if(!Ne&&S===false&&c===St){gt(c);return}Ne=false,St=c;let y=m;if(S!==false){let w=o-Tt,A=w>0?Math.abs(c-(et<0?c:et))/w:0;y=m*Math.max(.2,1+A*(typeof S=="number"?S:1)*.04);}et=c,Tt=o;let B=pe?Re===-1||c>=Re?"forward":"reverse":x;Re=c;let he=f-l,$e=true,xe=he===0?0:(c-l)/he;if(isNaN(We)||(We<=0&&xe>0?P?.():We>0&&xe<=0&&Ve?.(),We<1&&xe>=1?ae?.():We>=1&&xe<1&&Ee?.()),We=xe,K){let w=Se(ne(c,l,f,y));Z&&!pe&&(_=Math.max(_,w),w=_),Ae=w,e.style.setProperty("--scroll-draw-progress",String(w));let A=B==="reverse"?1-w:w;e.style.clipPath=Le(A),p?.(w),!k&&ne(c,l,f,y)>0&&(k=true,L?.()),w>=1&&!v?(v=true,b?.(),De<(j==="infinite"?1/0:j??0)&&(De++,Fe=setTimeout(()=>{_=-1,k=false,v=false,e.style.clipPath=Le(0);},oe))):w<1&&!Z&&(v=false),gt(c);return}if(H.forEach((w,A)=>{let re=A*Te*he,h=Se(ne(c,l+re,f+re,y));Z&&!pe&&(h=Pe[A]=Math.max(Pe[A]??_,h)),w.style.strokeDashoffset=B==="reverse"?`${T[A]*h}`:`${T[A]*(1-h)}`,u&&(w.style.opacity=B==="reverse"?`${1-h}`:`${h}`),ee&&Y?w.style.stroke=Ge(ee,Y,h):Y&&(w.style.stroke=Y),X!==null&&q!==null?w.style.strokeWidth=`${X+(q-X)*h}`:q!==null&&(w.style.strokeWidth=`${q}`),se!==null&&Q!==null?w.style.fillOpacity=`${se+(Q-se)*h}`:Q!==null&&(w.style.fillOpacity=`${Q}`),F&&w.tagName.toLowerCase()==="path"&&le[A]&&w.setAttribute("d",bt(le[A],F,h)),A===0&&(Ae=h,p?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),C){let w=Se(ne(c,l,f,y));for(let A in C){let re=parseFloat(A);w>=re&&!He.has(re)&&(He.add(re),C[A]?.());}}!k&&ne(c,l,f,y)>0&&(k=true,L?.()),$e&&!v?(v=true,b?.(),De<(j==="infinite"?1/0:j??0)&&(De++,Fe=setTimeout(()=>{_=-1,Pe=[],k=false,v=false,He.clear(),tt(),Ne=true;},oe))):!$e&&!Z&&(v=false),gt(c);}function dt(o){return o>=f&&o<ye}function gt(o){Ie||dt(o)?V=requestAnimationFrame($t):qe=false;}function yt(){return Ie||dt(Ue())}let qe=false;function rt(){qe||(qe=true,V=requestAnimationFrame(function(){$t();}));}function nt(){qe=false,cancelAnimationFrame(V);}let ht=new IntersectionObserver(o=>{o.forEach(c=>{Ie=c.isIntersecting,Ie&&!te?(Ne=true,rt()):qe&&!te&&dt(Ue())||nt();});},{root:fe??null,threshold:R,rootMargin:me});function Ct(){H.forEach((o,c)=>{T[c]=Be(o),o.style.strokeDasharray=`${T[c]}`;}),Lt(),Ne=true;}let ot;function Ye(){clearTimeout(ot),ot=setTimeout(Ct,150);}window.addEventListener("resize",Ye),window.addEventListener("orientationchange",Ye);let lr=_e([e],Ye);return D>0?setTimeout(()=>ht.observe(e),D):ht.observe(e),pt({destroy(){cancelAnimationFrame(V),clearTimeout(Fe),nt(),ht.disconnect(),lr(),window.removeEventListener("resize",Ye),window.removeEventListener("orientationchange",Ye),clearTimeout(ot),Et();},replay(){_=-1,Pe=[],Re=-1,et=-1,k=false,v=false,De=0,te=false,Ae=0,He.clear(),clearTimeout(Fe),tt(),Ne=true,yt()&&rt();},pause(){te=true,nt();},resume(){te&&(te=false,Ne=true,yt()&&rt());},seek(o){let c=Math.min(1,Math.max(0,o));Ae=c,_=c,Pe=[],te=true,nt(),or(c,x),Ne=true;},getProgress(){return Ae},refresh(){clearTimeout(ot),Ct(),yt()&&!te&&rt();}},()=>({tStart:l,tEnd:f}))}function Sr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Bt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],a=n[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}t.push({fn:n[1],nums:s,units:i});}return t}function Tr(e,t,r){let n=Bt(e),s=Bt(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((u,d)=>`${u}${i.units[d]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,d)=>`${u}${m.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,d)=>`${u+(m.nums[d]-u)*r}${i.units[d]}`).join(", ")})`}).join(" ")}function Gt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(Sr(n))return Ge(n,s,r);if(n.includes("("))return Tr(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),u=parseFloat(a[1]);return `${m+(u-m)*r}${i[2]||a[2]}`}return r<1?n:s}function xr(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Lr=0,Qt="--scroll-draw-progress";function Ar(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Yt(e,t){return typeof window>"u"?Ut:t.respectReducedMotion===false?jt(e,t,false):ze(t,(r,n)=>jt(e,r,n))}function jt(e,t,r){let{props:n,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:u="y",scrollContainer:d,native:E=true,velocityScale:O=false,triggerElement:x,onProgress:Z,onComplete:Me,onEnter:$,onLeave:ie,onEnterBack:pe,onLeaveBack:D}=t,z=typeof i=="function"?i:ue[i]??ue["ease-out"],I=we(s.start??"top bottom"),M=we(s.end??"bottom top"),C=x??e,S=typeof d=="string"?document.querySelector(d):d??null,R=Object.entries(n).map(([l,f])=>({prop:xr(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function me(){let l=window.getComputedStyle(e);for(let f of R)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function j(){for(let l of R)e.style.setProperty(l.prop,String(l.to));}let oe=new Map;for(let l of [...R.map(f=>f.prop),Qt])oe.set(l,e.style.getPropertyValue(l));function F(){for(let[l,f]of oe)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(r)return j(),Me?.(),{...Ut,destroy:F,getProgress:()=>1};me();let de=typeof i=="string"?it(i):null;function ve(){if(!E||!Ar()||!de||u!=="y"||S||C!==e||m||a!==1||Z||Me||$||ie||pe||D||O!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let l of R)if(!Mr.has(l.prop))return false;return true}function ge(){let l=`ssd-a-${++Lr}`,f=R.map(_=>`${_.prop}:${_.from}`).join(";"),Te=R.map(_=>`${_.prop}:${_.to}`).join(";"),ye=document.createElement("style");ye.setAttribute("data-ssd-animate",""),ye.textContent=`@keyframes ${l}{from{${f}}to{${Te}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ye),e.classList.add(l);let v=()=>u==="x"?window.scrollX:window.scrollY,k=()=>u==="x"?window.innerWidth:window.innerHeight,V=()=>{let _=e.getBoundingClientRect();return Ce({top:_.top,height:_.height},v(),k(),I,M)};ke(e,{type:"animate",getProgress:()=>Ie.getProgress(),getTrigger:V});let Ie={refresh(){},destroy(){e.classList.remove(l),ye.remove(),e.style.animationPlayState="",F(),Oe(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(_){let Pe=Math.min(1,Math.max(0,_));e.classList.remove(l);for(let Re of R)e.style.setProperty(Re.prop,Gt(Re.from,Re.to,Pe));},getProgress(){let{tStart:_,tEnd:Pe}=V();return z(ne(v(),_,Pe,a))}};return Ie}if(ve())return ge();let U=0,p=0,L=0,b=false,P=false,ae=-1,Ee=0,Ve=false,K=NaN,Se=-1,Qe=0,je=()=>S?u==="x"?S.scrollLeft:S.scrollTop:u==="x"?window.scrollX:window.scrollY,fe=()=>S?u==="x"?S.clientWidth:S.clientHeight:u==="x"?window.innerWidth:window.innerHeight,ee=C===e?R:[],Y=false;function X(){let l=e.style,f=ee.map(k=>l.getPropertyValue(k.prop)),Te=l.transition;ee.length&&(l.transition="none"),ee.forEach(k=>l.setProperty(k.prop,oe.get(k.prop)??""));let ye=st(C,S,u);ee.forEach((k,V)=>l.setProperty(k.prop,f[V])),ee.length&&(e.offsetWidth,l.transition=Te);let v=Ce(ye,ye.scroll,fe(),I,M);Y&&Math.abs(v.tStart-U)<1&&Math.abs(v.tEnd-p)<1||(Y=true,U=v.tStart,p=v.tEnd);}function q(l){e.style.setProperty(Qt,String(l));for(let f of R)e.style.setProperty(f.prop,Gt(f.from,f.to,l));Z?.(l);}function se(l){if(isNaN(K)){K=l;return}K<=0&&l>0?$?.():K>0&&l<=0&&D?.(),K<1&&l>=1?ie?.():K>=1&&l<1&&pe?.(),K=l;}function Q(){if(!b||P)return;let l=performance.now(),f=je(),Te=a;if(O!==false){let k=l-Qe,V=k>0?Math.abs(f-(Se<0?f:Se))/k:0;Te=a*Math.max(.2,1+V*(typeof O=="number"?O:1)*.04);}Se=f,Qe=l;let ye=p===U?0:(f-U)/(p-U);se(ye);let v=z(ne(f,U,p,Te));m&&(ae=Math.max(ae,v),v=ae),Ee=v,q(v),v>=1&&!Ve?(Ve=true,Me?.()):v<1&&!m&&(Ve=false),L=requestAnimationFrame(Q);}X(),p===U&&J("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=z(ne(je(),U,p,a));m&&l>0&&(ae=l),Ee=l,q(l);}let Le=new IntersectionObserver(l=>{l.forEach(f=>{b=f.isIntersecting,b&&!P?L=requestAnimationFrame(Q):cancelAnimationFrame(L);});},{root:S??null}),H;function T(){clearTimeout(H),H=setTimeout(X,150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let le=_e([C],T);return Le.observe(e),ke(e,{type:"animate",getProgress:()=>Ee,getTrigger:()=>({tStart:U,tEnd:p})}),{destroy(){cancelAnimationFrame(L),Le.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),le(),clearTimeout(H),F(),Oe(e);},replay(){ae=-1,Ve=false,Ee=0,P=false,q(0);},pause(){P=true,cancelAnimationFrame(L);},resume(){P&&(P=false,b&&(L=requestAnimationFrame(Q)));},seek(l){let f=Math.min(1,Math.max(0,l));Ee=f,ae=f,P=true,cancelAnimationFrame(L),q(f);},getProgress(){return Ee},refresh(){X();}}}var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xt(e,t){if(typeof window>"u")return wt;let r=typeof e=="string"?document.querySelector(e):e;return r?ze(t,(n,s)=>$r(r,n,s)):(J("scrollCounter: element not found:",e),wt)}function $r(e,t,r){let{from:n=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:u=true,decimals:d,onComplete:E}=t,O=d!==void 0?p=>p.toFixed(d):i??(p=>String(Math.round(p))),x=typeof a=="function"?a:ue[a]??ue["ease-out"],Z=we(m.start??"top 80%"),Me=we(m.end??"top 20%");if(r)return e.textContent=O(s),E?.(),{...wt,getProgress:()=>1};let $=0,ie=0,pe=false,D=0,z=false,I=false,M=-1,C=0,S=false,R=()=>window.scrollY,me=()=>window.innerHeight;function j(){let p=e.getBoundingClientRect(),L=Ce({top:p.top,height:p.height},R(),me(),Z,Me);pe&&Math.abs(L.tStart-$)<1&&Math.abs(L.tEnd-ie)<1||(pe=true,$=L.tStart,ie=L.tEnd);}function oe(p){e.textContent=O(n+(s-n)*p),e.style.setProperty("--scroll-draw-progress",String(p));}function F(){if(!z||I)return;let p=x(ne(R(),$,ie,1));u&&(M=Math.max(M,p),p=M),C=p,oe(p),p>=1&&!S?(S=true,E?.()):p<1&&!u&&(S=false),D=requestAnimationFrame(F);}j();{let p=x(ne(R(),$,ie,1));u&&p>0&&(M=p),C=p,oe(p);}let de=new IntersectionObserver(p=>{p.forEach(L=>{z=L.isIntersecting,z&&!I?D=requestAnimationFrame(F):cancelAnimationFrame(D);});}),ve;function ge(){clearTimeout(ve),ve=setTimeout(j,150);}window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge);let U=_e([e],ge);return de.observe(e),ke(e,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:$,tEnd:ie})}),{destroy(){cancelAnimationFrame(D),de.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),U(),clearTimeout(ve),Oe(e);},replay(){M=-1,S=false,C=0,I=false,oe(0);},pause(){I=true,cancelAnimationFrame(D);},resume(){I&&(I=false,z&&(D=requestAnimationFrame(F)));},seek(p){let L=Math.min(1,Math.max(0,p));C=L,M=L,I=true,cancelAnimationFrame(D),oe(L);},getProgress(){return C}}}function Jt(e,t){let r=document.createElement("span");r.textContent=t,r.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(r);}function er(e){let t=e.textContent??"";return e.textContent="",t.split(/(\s+)/).filter(Boolean).map(r=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(n.textContent=r,n.style.whiteSpace="pre"):(n.textContent=r,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(r)?null:n}).filter(r=>r!==null)}function Cr(e){let t=e.textContent??"";return e.textContent="",t.split("").map(r=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=r,r===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),r===" "?null:n}).filter(r=>r!==null)}function Zt(e){let t=er(e),r=new Map;for(let i of t){let a=i.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(i);}let n=[],s=Array.from(r.keys()).sort((i,a)=>i-a);for(let i of s){let a=r.get(i),m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.style.display="inline-block",a.forEach((u,d)=>{let E=u.nextElementSibling;m.appendChild(u),d<a.length-1&&E&&E.style.whiteSpace==="pre"&&m.appendChild(E);}),n.push(m);}return e.textContent="",n.forEach((i,a)=>{e.appendChild(i),a<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Pr(e,t,r,n){if(r<=1||n===0)return e;let s=(r-1)*n,i=t*n,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function Dr(e,t){let r=[];if(t?.y!==void 0&&r.push(`translateY(${t.y*(1-e)}px)`),t?.x!==void 0&&r.push(`translateX(${t.x*(1-e)}px)`),t?.rotate!==void 0&&r.push(`rotate(${t.rotate*(1-e)}deg)`),t?.scale!==void 0){let n=t.scale+(1-t.scale)*e;r.push(`scale(${n})`);}return r.join(" ")||""}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tr(e,t={}){if(typeof window>"u")return Kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return J("scrollText: element not found:",e),Kt;let n=r;return ze(t,(s,i)=>kr(n,s,i))}function kr(e,t,r){let{split:n="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:u=true,onComplete:d}=t,E=typeof i=="function"?i:ue[i]??ue["ease-out"],O=we(m.start??"top 85%"),x=we(m.end??"top 40%"),Z=e.innerHTML,Me=e.textContent??"",$;n==="chars"?$=Cr(e):n==="lines"?$=Zt(e):$=er(e),Jt(e,Me);let ie=$.length;function pe(b,P){a?.opacity!==void 0&&(b.style.opacity=String(a.opacity+(1-a.opacity)*P));let ae=Dr(P,a);ae&&(b.style.transform=ae);}function D(b){e.style.setProperty("--scroll-draw-progress",String(b)),$.forEach((P,ae)=>{let Ee=E(Pr(b,ae,ie,s));pe(P,Ee);});}if(r)return D(1),d?.(),{destroy(){e.innerHTML=Z;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};D(0);let z=0,I=0,M=0,C=false,S=false,R=-1,me=0,j=false,oe=()=>window.scrollY,F=()=>window.innerHeight;function de(){let b=e.getBoundingClientRect(),P=Ce({top:b.top,height:b.height},oe(),F(),O,x);z=P.tStart,I=P.tEnd;}function ve(){if(!C||S)return;let b=ne(oe(),z,I,1);u&&(R=Math.max(R,b),b=R),me=b,D(b),b>=1&&!j?(j=true,d?.()):b<1&&!u&&(j=false),M=requestAnimationFrame(ve);}de();let ge=new IntersectionObserver(b=>{b.forEach(P=>{C=P.isIntersecting,C&&!S?M=requestAnimationFrame(ve):cancelAnimationFrame(M);});}),U;function p(){clearTimeout(U),U=setTimeout(()=>{if(n==="lines"){let b=me;e.innerHTML=Z,$=Zt(e),Jt(e,Me),D(b);}de();},150);}window.addEventListener("resize",p),window.addEventListener("orientationchange",p);let L=_e([e],p);return ge.observe(e),ke(e,{type:"text",getProgress:()=>me,getTrigger:()=>({tStart:z,tEnd:I})}),{destroy(){cancelAnimationFrame(M),ge.disconnect(),window.removeEventListener("resize",p),window.removeEventListener("orientationchange",p),L(),clearTimeout(U),e.innerHTML=Z,Oe(e);},replay(){R=-1,j=false,me=0,S=false,D(0);},pause(){S=true,cancelAnimationFrame(M);},resume(){S&&(S=false,C&&(M=requestAnimationFrame(ve)));},seek(b){let P=Math.min(1,Math.max(0,b));me=P,R=P,S=true,cancelAnimationFrame(M),D(P);},getProgress(){return me}}}function Or(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let n=typeof e=="string"?document.querySelector(e):e;return n?ct(n,t):(J("Container not found:",e),r)}function Ke(){return typeof document>"u"?null:document}var vt=new WeakMap,rr;function ut(e,t,r,n){let s=vt.get(e)??new Map;vt.set(e,s);let i=()=>{let u=r(),d=s.get(t);d&&d.key===u||(d?.inst.destroy(),s.set(t,{inst:n(u),key:u,build:i,users:d?.users??0}));};i(),s.get(t).users++;let a=true;typeof MutationObserver<"u"&&(rr??(rr=new MutationObserver(u=>u.forEach(d=>vt.get(d.target)?.forEach(E=>E.build())))),rr.observe(e,{attributes:true,attributeFilter:["draw","animate","counter","text"].map(u=>`data-scroll-${u}-options`).concat("data-scroll-drawoptions")}));let m=()=>s.get(t)?.inst;return {destroy:()=>{let u=s.get(t);!a||!u||(a=false,!(--u.users>0)&&(u.inst.destroy(),s.delete(t)));},replay:()=>m()?.replay(),pause:()=>m()?.pause(),resume:()=>m()?.resume(),seek:u=>m()?.seek(u),getProgress:()=>m()?.getProgress()??0,refresh:()=>m()?.refresh?.()}}function mt(e,t){try{return e?JSON.parse(e):t}catch{return t}}function Ir(e=Ke()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(t=>ut(t,"draw",()=>t.dataset.scrollDrawOptions??t.dataset.scrollDrawoptions??"",r=>ct(t,mt(r,{})))):[]}function Rr(e=Ke()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(t=>ut(t,"animate",()=>t.dataset.scrollAnimateOptions??"",r=>Yt(t,mt(r,{props:{}})))):[]}function Fr(e=Ke()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(t=>ut(t,"counter",()=>t.dataset.scrollCounterOptions??"",r=>{let n=mt(r,{});return !n.to&&n.to!==0&&(J('initScrollCounter: element missing "to" in options JSON:',t),n.to=0),typeof n.format!="function"&&n.format!==void 0&&(J('initScrollCounter: "format" must be a function, so it cannot come from JSON; use "decimals":',t),delete n.format),Xt(t,n)})):[]}function Hr(e=Ke()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(t=>ut(t,"text",()=>t.dataset.scrollTextOptions??"",r=>tr(t,mt(r,{})))):[]}function Gn(e=Ke()){return {draw:Ir(e),animate:Rr(e),counter:Fr(e),text:Hr(e)}}exports.initAll=Gn;exports.initScrollAnimate=Rr;exports.initScrollCounter=Fr;exports.initScrollDraw=Ir;exports.initScrollText=Hr;exports.scrollDraw=Or;
|
|
3
|
+
<div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(r),window.addEventListener("scroll",s,{passive:true}),s(),{el:r,destroy(){window.removeEventListener("scroll",s),r.remove();}}}var jt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ut=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ln(e,t,n){if(!Ge)return;let r=(e.match(Ut)??[]).join("").toUpperCase(),s=(t.match(Ut)??[]).join("").toUpperCase(),i=(e.match(jt)??[]).length,a=(t.match(jt)??[]).length;if(r!==s){Q(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}i!==a&&Q(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function An(e,t,n){let r=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=r[s++]??a;return String(+(a+(m-a)*n).toFixed(4))})}function ut(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:ze(t,(n,r)=>Cn(e,n,r))}function Cn(e,t,n){let{preset:r,...s}=t,i=r?{..._t[r],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=false,easing:d="linear",trigger:b={},stagger:P=0,direction:v="forward",once:ee=false,debug:we=false,axis:x="y",scrollContainer:ie,autoReverse:ve=false,delay:L=0,strokeColor:D,strokeWidth:I,fillOpacity:$,waypoints:M,velocityScale:w=false,threshold:A=0,rootMargin:te="0px",repeat:j=0,repeatDelay:me=0,morphTo:z,clip:W,autoplay:fe=false,duration:Te=1e3,native:Ee=true,onProgress:H,onStart:F,onComplete:O,onEnter:f,onLeave:y,onEnterBack:ne,onLeaveBack:ke}=i,q=W===true?"left":typeof W=="string"?W:false,U=typeof d=="function"?d:ue[d]??ue.linear,Ve=be(b.start||"top bottom"),xe=be(b.end||"bottom top"),re=typeof ie=="string"?document.querySelector(ie):ie??null,Ae=Array.isArray(D)?D[0]:null,ye=Array.isArray(D)?D[1]:typeof D=="string"?D:null,Me=Array.isArray(I)?I[0]:null,Ce=Array.isArray(I)?I[1]:typeof I=="number"?I:null,he=Array.isArray($)?$[0]:null,Re=Array.isArray($)?$[1]:typeof $=="number"?$:null;function Pe(o){let l=o*100;switch(q){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let T=q?[]:Array.from(e.querySelectorAll(a)),ae=[],pe=[],Y=0,V=0,We=P,Ke=0,N=false,c=false,p=0,Se=false,oe=-1,B=[],_=-1,h=false,X=0,le=0,He,dt=null;function xt(){dt?.destroy(),dt=null;}let Fe=new Set,Mt=NaN,Ne=true,et=-1,Lt=performance.now(),qe=NaN;function Qe(){return re?x==="x"?re.scrollLeft:re.scrollTop:x==="x"?window.scrollX:window.scrollY}function At(){return re?x==="x"?re.clientWidth:re.clientHeight:x==="x"?window.innerWidth:window.innerHeight}function Ct(){let o=ot(e,re,x);return Le(o,o.scroll,At(),Ve,xe)}function ln(){let o=V-Y,l=T.length-1,g=re??document.documentElement,S=x==="x"?"Width":"Height";if(We=P,P>0&&l>0&&o>0){let se=g[`scroll${S}`]-g[`client${S}`]-1-Y-o/m;se>=0&&(We=Math.min(P,se/(l*o)));}Ke=V+l*We*o;}function Pt(){(({tStart:Y,tEnd:V}=Ct())),ln(),we&&Ge&&(xt(),dt=Mn(Y,V,x));}function gt(o,l=Ct){Ie(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let g=o.destroy;return o.destroy=()=>{g.call(o),Oe(e);},o}function $t(o,l){return ee&&!ve?Math.max(oe,U(B[o]=Math.max(B[o]??0,l))):U(l)}function cn(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),q){let g=l==="reverse"?1-o:o;e.style.clipPath=Pe(g);return}T.forEach((g,S)=>yt(g,S,o,l));}function yt(o,l,g,S){o.style.strokeDashoffset=S==="reverse"?`${ae[l]*g}`:`${ae[l]*(1-g)}`,u&&(o.style.opacity=S==="reverse"?`${1-g}`:`${g}`),Ae&&ye?o.style.stroke=it(Ae,ye,g):ye&&(o.style.stroke=ye),Me!==null&&Ce!==null?o.style.strokeWidth=`${Me+(Ce-Me)*g}`:Ce!==null&&(o.style.strokeWidth=`${Ce}`),he!==null&&Re!==null?o.style.fillOpacity=`${he+(Re-he)*g}`:Re!==null&&(o.style.fillOpacity=`${Re}`),z&&o.tagName.toLowerCase()==="path"&&pe[l]&&o.setAttribute("d",An(pe[l],z,g));}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),q){e.style.clipPath=Pe(v==="reverse"?1:0);return}T.forEach((o,l)=>{o.style.strokeDasharray=`${ae[l]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${ae[l]}`,u?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",Ae&&(o.style.stroke=Ae),Me!==null&&(o.style.strokeWidth=`${Me}`),he!==null&&(o.style.fillOpacity=`${he}`),z&&o.tagName.toLowerCase()==="path"&&pe[l]&&o.setAttribute("d",pe[l]);});}function Ue(o,l){let g=o.getAttribute("d"),S=st(o);if(z&&pe[l]){o.setAttribute("d",z);let se=st(o);o.setAttribute("d",pe[l]),S=Math.max(st(o),se),o.setAttribute("d",g);}ae[l]=S,o.style.strokeDasharray=`${S}`;}if(T.forEach((o,l)=>{xn(o);let g=o.tagName.toLowerCase()==="path";g?pe.push(o.getAttribute("d")??""):pe.push(""),Ue(o,l);let S=ae[l];z&&(g?Ln(pe[pe.length-1],z,o):Q(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),n?(o.style.strokeDashoffset=v==="reverse"?`${S}`:"0",u&&(o.style.opacity="1"),ye&&(o.style.stroke=ye),Ce!==null&&(o.style.strokeWidth=`${Ce}`),Re!==null&&(o.style.fillOpacity=`${Re}`),z&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",z)):(o.style.strokeDashoffset=v==="reverse"?"0":`${S}`,u?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",Ae&&(o.style.stroke=Ae),Me!==null&&(o.style.strokeWidth=`${Me}`),he!==null&&(o.style.fillOpacity=`${he}`));}),n)return q&&(e.style.clipPath=Pe(1)),O?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};q&&(e.style.clipPath=Pe(v==="reverse"?1:0));let Dt=typeof d=="string"?at(d):null;function un(){return !(Ee===false||fe||we&&Ge||!Tn()||!T.length||!Dt||q||x!=="y"||re||m!==1||P!==0||ee||ve||w!==false||z||M||j||L>0||H||F||O||f||y||ne||ke||D!=null||I!=null||$!=null||(b.start||"top bottom").trim()!=="top bottom"||(b.end||"bottom top").trim()!=="bottom top")}function mn(){let o=++Sn,l=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,S=`--svg-scroll-draw-${o}`,se=v==="reverse"?"0":"var(--ssd-len)",$e=v==="reverse"?"var(--ssd-len)":"0",de=`stroke-dashoffset:${se};`,k=`stroke-dashoffset:${$e};`;u&&(de+=`opacity:${v==="reverse"?1:0};`,k+=`opacity:${v==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${l}{from{${de}}to{${k}}}.${g}{view-timeline-name:${S};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Dt};animation-fill-mode:both;animation-timeline:${S};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(g);function J(E,C){E.style.setProperty("--ssd-len",String(ae[C])),E.style.strokeDasharray=`${ae[C]}`,E.style.strokeDashoffset="",E.style.opacity="",E.style.animationPlayState="",E.classList.add(l);}T.forEach(J);let Z=false,ce=-1;function ge(){if(ce>=0)return ce;let E=e.getBoundingClientRect(),{tStart:C,tEnd:K}=Le({top:E.top,height:E.height},Qe(),At(),Ve,xe);return U(G(Qe(),C,K,m))}return {destroy(){e.classList.remove(g),T.forEach(E=>{E.classList.remove(l),E.style.removeProperty("--ssd-len"),E.style.animationPlayState="";}),R.remove();},replay(){Z=false,ce=-1,T.forEach(J);},pause(){Z=true,T.forEach(E=>{E.style.animationPlayState="paused";});},resume(){Z&&(Z=false,T.forEach(E=>{E.style.animationPlayState="running";}));},seek(E){let C=Math.min(1,Math.max(0,E));ce=C,Z=true,T.forEach((K,De)=>{K.classList.remove(l),K.style.strokeDashoffset=v==="reverse"?`${ae[De]*C}`:`${ae[De]*(1-C)}`,u&&(K.style.opacity=v==="reverse"?`${1-C}`:`${C}`);});},getProgress(){return ge()},refresh(){T.forEach((E,C)=>{Ue(E,C),E.style.setProperty("--ssd-len",String(ae[C]));});}}}if(un())return gt(mn());function fn(){let o=Math.max(1,Te),l=q?o:o*(1+Math.max(0,T.length-1)*P),g=0,S=0,se=false;function $e(ce){let ge=true,E=Math.min(1,Math.max(0,ce/l));if(q){let C=Math.min(1,Math.max(0,ce/o)),K=U(C);X=K,e.style.setProperty("--scroll-draw-progress",String(K)),e.style.clipPath=Pe(v==="reverse"?1-K:K),H?.(K),C<1&&(ge=false);}else {T.forEach((K,De)=>{let dn=De*P*o,kt=Math.min(1,Math.max(0,(ce-dn)/o));yt(K,De,U(kt),v),kt<1&&(ge=false);});let C=U(E);X=C,H?.(C),e.style.setProperty("--scroll-draw-progress",String(C));}if(M){let C=U(E);for(let K in M){let De=parseFloat(K);C>=De&&!Fe.has(De)&&(Fe.add(De),M[K]?.());}}return ge}function de(ce){if(h)return;let ge=ce-g;c||(c=true,F?.());let E=$e(ge);if(E&&!N){N=true,$e(l),O?.(),le<(j==="infinite"?1/0:j??0)&&(le++,He=setTimeout(()=>{g=performance.now(),c=false,N=false,Fe.clear(),je(),p=requestAnimationFrame(de);},me));return}E||(p=requestAnimationFrame(de));}function k(){cancelAnimationFrame(p),clearTimeout(He),g=performance.now(),S=0,h=false,c=false,N=false,le=0,se=true,X=0,Fe.clear(),je(),p=requestAnimationFrame(de);}let R=new IntersectionObserver(ce=>{ce.forEach(ge=>{ge.isIntersecting&&!(ee&&N)?k():!ge.isIntersecting&&!ee&&!N&&(cancelAnimationFrame(p),clearTimeout(He),se=false);});},{root:re??null,threshold:A,rootMargin:te}),J;function Z(){clearTimeout(J),J=setTimeout(()=>T.forEach(Ue),150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),L>0?setTimeout(()=>R.observe(e),L):R.observe(e),{destroy(){cancelAnimationFrame(p),clearTimeout(He),R.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(J);},replay(){le=0,k();},pause(){h||!se||(h=true,S=performance.now()-g,cancelAnimationFrame(p));},resume(){h&&(h=false,se=true,g=performance.now()-S,p=requestAnimationFrame(de));},seek(ce){let ge=Math.min(1,Math.max(0,ce));X=ge,h=true,S=ge*l,g=performance.now()-S,cancelAnimationFrame(p),$e(S);},getProgress(){return X},refresh(){clearTimeout(J),T.forEach(Ue);}}}if(fe)return gt(fn());Pt();function It(){if(h||!Be)return;let o=performance.now(),l=Qe();if(!Ne&&w===false&&l===Mt){bt(l);return}Ne=false,Mt=l;let g=m;if(w!==false){let k=o-Lt,R=k>0?Math.abs(l-(et<0?l:et))/k:0;g=m*Math.max(.2,1+R*(typeof w=="number"?w:1)*.04);}et=l,Lt=o;let S=ve?_===-1||l>=_?"forward":"reverse":v;_=l;let se=V-Y,$e=true,de=se===0?0:(l-Y)/se;if(isNaN(qe)||(qe<=0&&de>0?f?.():qe>0&&de<=0&&ke?.(),qe<1&&de>=1?y?.():qe>=1&&de<1&&ne?.()),qe=de,q){let k=$t(0,G(l,Y,V,g));X=k,e.style.setProperty("--scroll-draw-progress",String(k));let R=S==="reverse"?1-k:k;e.style.clipPath=Pe(R),H?.(k),!c&&G(l,Y,V,g)>0&&(c=true,F?.()),k>=1&&!N?(N=true,O?.(),le<(j==="infinite"?1/0:j??0)&&(le++,He=setTimeout(()=>{oe=-1,B=[],c=false,N=false,je();},me))):k<1&&!ee&&(N=false),bt(l);return}if(T.forEach((k,R)=>{let J=R*We*se,Z=$t(R,G(l,Y+J,V+J,g));yt(k,R,Z,S),R===0&&(X=Z,H?.(Z),e.style.setProperty("--scroll-draw-progress",String(Z))),Z<1&&($e=false);}),M){let k=U(G(l,Y,V,g));for(let R in M){let J=parseFloat(R);k>=J&&!Fe.has(J)&&(Fe.add(J),M[R]?.());}}!c&&G(l,Y,V,g)>0&&(c=true,F?.()),$e&&!N?(N=true,O?.(),le<(j==="infinite"?1/0:j??0)&&(le++,He=setTimeout(()=>{oe=-1,B=[],c=false,N=false,Fe.clear(),je(),Ne=true;},me))):!$e&&!ee&&(N=false),bt(l);}function ht(o){return o>=V&&o<Ke}function bt(o){Se||ht(o)?p=requestAnimationFrame(It):Be=false;}function wt(){return Se||ht(Qe())}let Be=false;function tt(){Be||(Be=true,p=requestAnimationFrame(function(){It();}));}function nt(){Be=false,cancelAnimationFrame(p);}let vt=new IntersectionObserver(o=>{o.forEach(l=>{Se=l.isIntersecting,Se&&!h?(Ne=true,tt()):Be&&!h&&ht(Qe())||nt();});},{root:re??null,threshold:A,rootMargin:te});function Ot(){T.forEach(Ue),Pt(),Ne=true;}let rt;function Ye(){clearTimeout(rt),rt=setTimeout(Ot,150);}window.addEventListener("resize",Ye),window.addEventListener("orientationchange",Ye);let pn=_e([e],Ye);return L>0?setTimeout(()=>vt.observe(e),L):vt.observe(e),gt({destroy(){cancelAnimationFrame(p),clearTimeout(He),nt(),vt.disconnect(),pn(),window.removeEventListener("resize",Ye),window.removeEventListener("orientationchange",Ye),clearTimeout(rt),xt();},replay(){oe=-1,B=[],_=-1,et=-1,c=false,N=false,le=0,h=false,X=0,Fe.clear(),clearTimeout(He),je(),Ne=true,wt()&&tt();},pause(){h=true,nt();},resume(){h&&(h=false,Ne=true,wt()&&tt());},seek(o){let l=Math.min(1,Math.max(0,o));X=l,oe=l,B=[],h=true,nt(),cn(l,v),Ne=true;},getProgress(){return X},refresh(){clearTimeout(rt),Ot(),wt()&&!h&&tt();}},()=>({tStart:Y,tEnd:V}))}function Pn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Yt(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let s=[],i=[],a=r[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}t.push({fn:r[1],nums:s,units:i});}return t}function $n(e,t,n){let r=Yt(e),s=Yt(t);return r.length===0||r.length!==s.length?n<1?e:t:r.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?n<1?`${i.fn}(${i.nums.map((u,d)=>`${u}${i.units[d]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,d)=>`${u}${m.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,d)=>`${u+(m.nums[d]-u)*n}${i.units[d]}`).join(", ")})`}).join(" ")}function Xt(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),s=String(t);if(Pn(r))return it(r,s,n);if(r.includes("("))return $n(r,s,n);let i=r.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),u=parseFloat(a[1]);return `${m+(u-m)*n}${i[2]||a[2]}`}return n<1?r:s}function Dn(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var In=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),On=0,Jt="--scroll-draw-progress";function kn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function en(e,t){return typeof window>"u"?Kt:t.respectReducedMotion===false?Zt(e,t,false):ze(t,(n,r)=>Zt(e,n,r))}function Zt(e,t,n){let{props:r,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:u="y",scrollContainer:d,native:b=true,velocityScale:P=false,triggerElement:v,onProgress:ee,onComplete:we,onEnter:x,onLeave:ie,onEnterBack:ve,onLeaveBack:L}=t,D=typeof i=="function"?i:ue[i]??ue["ease-out"],I=be(s.start||"top bottom"),$=be(s.end||"bottom top"),M=v??e,w=typeof d=="string"?document.querySelector(d):d??null,A=Object.entries(r).map(([c,p])=>({prop:Dn(c),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function te(){let c=window.getComputedStyle(e);for(let p of A)p.from===""&&(p.from=c.getPropertyValue(p.prop).trim()||"0");}function j(){for(let c of A)e.style.setProperty(c.prop,String(c.to));}let me=new Map;for(let c of [...A.map(p=>p.prop),Jt])me.set(c,e.style.getPropertyValue(c));function z(){for(let[c,p]of me)p?e.style.setProperty(c,p):e.style.removeProperty(c);}if(n)return j(),we?.(),{...Kt,destroy:z,getProgress:()=>1};te();let W=()=>w?u==="x"?w.scrollLeft:w.scrollTop:u==="x"?window.scrollX:window.scrollY,fe=()=>w?u==="x"?w.clientWidth:w.clientHeight:u==="x"?window.innerWidth:window.innerHeight,Te=typeof i=="string"?at(i):null;function Ee(){if(!b||!kn()||!Te||u!=="y"||w||M!==e||m||a!==1||ee||we||x||ie||ve||L||P!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let c of A)if(!In.has(c.prop))return false;return true}function H(){let c=`ssd-a-${++On}`,p=A.map(h=>`${h.prop}:${h.from}`).join(";"),Se=A.map(h=>`${h.prop}:${h.to}`).join(";"),oe=document.createElement("style");oe.setAttribute("data-ssd-animate",""),oe.textContent=`@keyframes ${c}{from{${p}}to{${Se}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Te};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(oe),e.classList.add(c);let B=()=>{let h=e.getBoundingClientRect();return Le({top:h.top,height:h.height},W(),fe(),I,$)};Ie(e,{type:"animate",getProgress:()=>_.getProgress(),getTrigger:B});let _={refresh(){},destroy(){e.classList.remove(c),oe.remove(),e.style.animationPlayState="",z(),Oe(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(h){let X=Math.min(1,Math.max(0,h));e.classList.remove(c);for(let le of A)e.style.setProperty(le.prop,Xt(le.from,le.to,X));},getProgress(){let{tStart:h,tEnd:X}=B();return D(G(W(),h,X,a))}};return _}if(Ee())return H();let F=0,O=0,f=0,y=NaN,ne=false,ke=-1,q=0,U=0,Ve=false,xe=NaN,re=-1,Ae=0,ye=M===e?A:[],Me=false;function Ce(){let c=e.style,p=ye.map(_=>c.getPropertyValue(_.prop)),Se=c.transition;ye.length&&(c.transition="none"),ye.forEach(_=>c.setProperty(_.prop,me.get(_.prop)??""));let oe=ot(M,w,u);ye.forEach((_,h)=>c.setProperty(_.prop,p[h])),ye.length&&(e.offsetWidth,c.transition=Se);let B=Le(oe,oe.scroll,fe(),I,$);Me&&Math.abs(B.tStart-F)<1&&Math.abs(B.tEnd-O)<1||(Me=true,F=B.tStart,O=B.tEnd);}function he(c){e.style.setProperty(Jt,String(c));for(let p of A)e.style.setProperty(p.prop,Xt(p.from,p.to,c));ee?.(c);}function Re(c){if(isNaN(xe)){xe=c;return}xe<=0&&c>0?x?.():xe>0&&c<=0&&L?.(),xe<1&&c>=1?ie?.():xe>=1&&c<1&&ve?.(),xe=c;}let Pe=c=>G(c,F,O,Math.min(a,1));function T(){!f&&!ne&&Pe(W())!==y&&(f=requestAnimationFrame(ae));}function ae(){if(ne)return;let c=performance.now(),p=W(),Se=a;if(P!==false){let h=c-Ae,X=h>0?Math.abs(p-(re<0?p:re))/h:0;Se=a*Math.max(.2,1+X*(typeof P=="number"?P:1)*.04);}re=p,Ae=c;let oe=O===F?0:(p-F)/(O-F);Re(oe);let B=G(p,F,O,Se),_=m?Math.max(ke,D(q=Math.max(q,B))):D(B);U=_,he(_),_>=1&&!Ve?(Ve=true,we?.()):_<1&&!m&&(Ve=false),!ne&&(y=Pe(p),f=y>0&&y<1?requestAnimationFrame(ae):0);}Ce(),O===F&&Q("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),q=G(W(),F,O,a),U=D(q),he(U);function pe(){Ce(),T();}let Y;function V(){clearTimeout(Y),Y=setTimeout(pe,150);}let We=w??window;We.addEventListener("scroll",T,{passive:true}),window.addEventListener("resize",V),window.addEventListener("orientationchange",V);let Ke=_e([M],V);T(),Ie(e,{type:"animate",getProgress:()=>U,getTrigger:()=>({tStart:F,tEnd:O})});function N(){ne=true,cancelAnimationFrame(f),f=0,y=NaN;}return {destroy(){N(),We.removeEventListener("scroll",T),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),Ke(),clearTimeout(Y),z(),Oe(e);},replay(){ke=-1,q=0,Ve=false,U=0,ne=false,he(0),y=0,T();},pause:N,resume(){ne&&(ne=false,T());},seek(c){let p=Math.min(1,Math.max(0,c));U=p,ke=p,q=0,N(),he(p);},getProgress(){return U},refresh:pe}}var Et={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tn(e,t){if(typeof window>"u")return Et;let n=typeof e=="string"?document.querySelector(e):e;return n?ze(t,(r,s)=>Rn(n,r,s)):(Q("scrollCounter: element not found:",e),Et)}function Rn(e,t,n){let{from:r=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:u=true,decimals:d,onComplete:b}=t,P=d!==void 0?f=>f.toFixed(d):i??(f=>String(Math.round(f))),v=typeof a=="function"?a:ue[a]??ue["ease-out"],ee=be(m.start||"top 80%"),we=be(m.end||"top 20%");if(n)return e.textContent=P(s),b?.(),{...Et,getProgress:()=>1};let x=0,ie=0,ve=false,L=0,D=false,I=false,$=-1,M=0,w=0,A=false,te=()=>window.scrollY,j=()=>window.innerHeight;function me(){let f=e.getBoundingClientRect(),y=Le({top:f.top,height:f.height},te(),j(),ee,we);ve&&Math.abs(y.tStart-x)<1&&Math.abs(y.tEnd-ie)<1||(ve=true,x=y.tStart,ie=y.tEnd);}let z=e.style.getPropertyValue("--scroll-draw-progress");function W(f){e.textContent=P(r+(s-r)*f),e.style.setProperty("--scroll-draw-progress",String(f));}function fe(){if(!D||I)return;let f=G(te(),x,ie,1),y=u?Math.max($,v(M=Math.max(M,f))):v(f);w=y,W(y),y>=1&&!A?(A=true,b?.()):y<1&&!u&&(A=false),L=requestAnimationFrame(fe);}me();{M=G(te(),x,ie,1);let f=v(M);w=f,W(f);}let Te=new IntersectionObserver(f=>{f.forEach(y=>{D=y.isIntersecting,D&&!I?L=requestAnimationFrame(fe):cancelAnimationFrame(L);});}),Ee;function H(){clearTimeout(Ee),Ee=setTimeout(me,150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let F=_e([e],H);Te.observe(e),Ie(e,{type:"counter",getProgress:()=>w,getTrigger:()=>({tStart:x,tEnd:ie})});function O(){I&&(I=false,D&&(L=requestAnimationFrame(fe)));}return {destroy(){cancelAnimationFrame(L),Te.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),F(),clearTimeout(Ee),e.style.setProperty("--scroll-draw-progress",z),Oe(e);},replay(){$=-1,M=0,A=false,w=0,W(0),O();},pause(){I=true,cancelAnimationFrame(L);},resume:O,seek(f){let y=Math.min(1,Math.max(0,f));w=y,$=y,M=0,I=true,cancelAnimationFrame(L),W(y);},getProgress(){return w}}}function nn(e,t){let n=document.createElement("span");n.textContent=t,n.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(n);}function mt(e=""){let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=e,t}function on(e){let t=e.textContent??"";return e.textContent="",t.split(/(\s+)/).filter(Boolean).map(n=>{let r=e.appendChild(mt(n)),s=/^\s+$/.test(n);return s?r.style.whiteSpace="pre":r.style.display="inline-block",s?null:r}).filter(n=>n!==null)}function Hn(e){let t=e.textContent??"";e.textContent="";let n=[],r=null;for(let s of t){let i=mt(s),a=s===" ";a?i.style.whiteSpace="pre":(i.style.display="inline-block",n.push(i)),a||s>"\u0DFF"?r=null:r||(r=e.appendChild(mt()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(i);}return n}function rn(e){let t=on(e),n=new Map;for(let i of t){let a=i.offsetTop;n.has(a)||n.set(a,[]),n.get(a).push(i);}let r=[],s=Array.from(n.keys()).sort((i,a)=>i-a);for(let i of s){let a=n.get(i),m=mt();m.style.display="inline-block",a.forEach((u,d)=>{let b=u.nextElementSibling;m.appendChild(u),d<a.length-1&&b&&b.style.whiteSpace==="pre"&&m.appendChild(b);}),r.push(m);}return e.textContent="",r.forEach((i,a)=>{e.appendChild(i),a<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Fn(e,t,n,r){if(n<=1||r===0)return e;r=Math.min(r,1/n);let s=(n-1)*r,i=t*r,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function Nn(e,t){let n=[];if(t?.y!==void 0&&n.push(`translateY(${t.y*(1-e)}px)`),t?.x!==void 0&&n.push(`translateX(${t.x*(1-e)}px)`),t?.rotate!==void 0&&n.push(`rotate(${t.rotate*(1-e)}deg)`),t?.scale!==void 0){let r=t.scale+(1-t.scale)*e;n.push(`scale(${r})`);}return n.join(" ")}var St={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function sn(e,t={}){if(typeof window>"u")return St;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return Q("scrollText: element not found:",e),St;let r=n;return ze(t,(s,i)=>_n(r,s,i))}function _n(e,t,n){let{split:r="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:u=true,onComplete:d}=t,b=typeof i=="function"?i:ue[i]??ue["ease-out"],P=be(m.start||"top 85%"),v=be(m.end||"top 40%"),ee=e.innerHTML,we=e.textContent??"",x;r==="chars"?x=Hn(e):r==="lines"?x=rn(e):x=on(e),nn(e,we);let ie=x.length;function ve(f,y){a?.opacity!==void 0&&(f.style.opacity=String(a.opacity+(1-a.opacity)*y));let ne=Nn(y,a);ne&&(f.style.transform=ne);}function L(f){e.style.setProperty("--scroll-draw-progress",String(f)),x.forEach((y,ne)=>{let ke=b(Fn(f,ne,ie,s));ve(y,ke);});}if(n)return L(1),d?.(),{...St,destroy:()=>{e.innerHTML=ee;},getProgress:()=>1};L(0);let D=0,I=0,$=0,M=false,w=false,A=-1,te=0,j=false,me=()=>window.scrollY,z=()=>window.innerHeight;function W(){let f=e.getBoundingClientRect(),y=Le({top:f.top,height:f.height},me(),z(),P,v);D=y.tStart,I=y.tEnd;}function fe(){if(!M||w)return;let f=G(me(),D,I,1);u&&(A=Math.max(A,f),f=A),te=f,L(f),f>=1&&!j?(j=true,d?.()):f<1&&!u&&(j=false),$=requestAnimationFrame(fe);}W();let Te=new IntersectionObserver(f=>{f.forEach(y=>{M=y.isIntersecting,M&&!w?$=requestAnimationFrame(fe):cancelAnimationFrame($);});}),Ee;function H(){clearTimeout(Ee),Ee=setTimeout(()=>{if(r==="lines"){let f=te;e.innerHTML=ee,x=rn(e),nn(e,we),L(f);}W();},150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let F=_e([e],H);Te.observe(e),Ie(e,{type:"text",getProgress:()=>te,getTrigger:()=>({tStart:D,tEnd:I})});function O(){w&&(w=false,M&&($=requestAnimationFrame(fe)));}return {destroy(){cancelAnimationFrame($),Te.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),F(),clearTimeout(Ee),e.innerHTML=ee,Oe(e);},replay(){A=-1,j=false,te=0,L(0),O();},pause(){w=true,cancelAnimationFrame($);},resume:O,seek(f){let y=Math.min(1,Math.max(0,f));te=y,A=y,w=true,cancelAnimationFrame($),L(y);},getProgress(){return te}}}function zn(e,t){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?ut(r,t):(Q("Container not found:",e),n)}function Ze(){return typeof document>"u"?null:document}var Tt=new WeakMap,an;function ft(e,t,n,r){let s=Tt.get(e)??new Map;Tt.set(e,s);let i=()=>{let u=n(),d=s.get(t);d&&d.key===u||(d?.inst.destroy(),s.set(t,{inst:r(u),key:u,build:i,users:d?.users??0}));};i(),s.get(t).users++;let a=true;typeof MutationObserver<"u"&&(an??(an=new MutationObserver(u=>u.forEach(d=>Tt.get(d.target)?.forEach(b=>b.build())))),an.observe(e,{attributes:true,attributeFilter:["draw","animate","counter","text"].map(u=>`data-scroll-${u}-options`).concat("data-scroll-drawoptions")}));let m=()=>s.get(t)?.inst;return {destroy:()=>{let u=s.get(t);!a||!u||(a=false,!(--u.users>0)&&(u.inst.destroy(),s.delete(t)));},replay:()=>m()?.replay(),pause:()=>m()?.pause(),resume:()=>m()?.resume(),seek:u=>m()?.seek(u),getProgress:()=>m()?.getProgress()??0,refresh:()=>m()?.refresh?.()}}function pt(e,t){try{return e?JSON.parse(e):t}catch{return t}}function Vn(e=Ze()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(t=>ft(t,"draw",()=>t.dataset.scrollDrawOptions??t.dataset.scrollDrawoptions??"",n=>ut(t,pt(n,{})))):[]}function Wn(e=Ze()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(t=>ft(t,"animate",()=>t.dataset.scrollAnimateOptions??"",n=>en(t,pt(n,{props:{}})))):[]}function qn(e=Ze()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(t=>ft(t,"counter",()=>t.dataset.scrollCounterOptions??"",n=>{let r=pt(n,{});return !r.to&&r.to!==0&&(Q('initScrollCounter: element missing "to" in options JSON:',t),r.to=0),typeof r.format!="function"&&r.format!==void 0&&(Q('initScrollCounter: "format" must be a function, so it cannot come from JSON; use "decimals":',t),delete r.format),tn(t,r)})):[]}function Bn(e=Ze()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(t=>ft(t,"text",()=>t.dataset.scrollTextOptions??"",n=>sn(t,pt(n,{})))):[]}function Jr(e=Ze()){return {draw:Vn(e),animate:Wn(e),counter:qn(e),text:Bn(e)}}exports.initAll=Jr;exports.initScrollAnimate=Wn;exports.initScrollCounter=qn;exports.initScrollDraw=Vn;exports.initScrollText=Bn;exports.scrollDraw=zn;
|
package/dist/astro/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as scrollDraw}from'../chunk-
|
|
1
|
+
export{a as scrollDraw}from'../chunk-DSFD227B.mjs';import {a as a$2}from'../chunk-NLPSVYFP.mjs';import {a as a$1}from'../chunk-I73SOXBN.mjs';import {a}from'../chunk-OPXWNJBG.mjs';import {b}from'../chunk-6TWFLRUB.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b as b$1}from'../chunk-LFSU6LR3.mjs';function i(){return typeof document>"u"?null:document}var p=new WeakMap,g;function c(r,t,n,o){let l=p.get(r)??new Map;p.set(r,l);let f=()=>{let e=n(),s=l.get(t);s&&s.key===e||(s?.inst.destroy(),l.set(t,{inst:o(e),key:e,build:f,users:s?.users??0}));};f(),l.get(t).users++;let S=true;typeof MutationObserver<"u"&&(g??(g=new MutationObserver(e=>e.forEach(s=>p.get(s.target)?.forEach(O=>O.build())))),g.observe(r,{attributes:true,attributeFilter:["draw","animate","counter","text"].map(e=>`data-scroll-${e}-options`).concat("data-scroll-drawoptions")}));let a=()=>l.get(t)?.inst;return {destroy:()=>{let e=l.get(t);!S||!e||(S=false,!(--e.users>0)&&(e.inst.destroy(),l.delete(t)));},replay:()=>a()?.replay(),pause:()=>a()?.pause(),resume:()=>a()?.resume(),seek:e=>a()?.seek(e),getProgress:()=>a()?.getProgress()??0,refresh:()=>a()?.refresh?.()}}function u(r,t){try{return r?JSON.parse(r):t}catch{return t}}function E(r=i()){return r?Array.from(r.querySelectorAll("[data-scroll-draw]")).map(t=>c(t,"draw",()=>t.dataset.scrollDrawOptions??t.dataset.scrollDrawoptions??"",n=>b(t,u(n,{})))):[]}function A(r=i()){return r?Array.from(r.querySelectorAll("[data-scroll-animate]")).map(t=>c(t,"animate",()=>t.dataset.scrollAnimateOptions??"",n=>a(t,u(n,{props:{}})))):[]}function I(r=i()){return r?Array.from(r.querySelectorAll("[data-scroll-counter]")).map(t=>c(t,"counter",()=>t.dataset.scrollCounterOptions??"",n=>{let o=u(n,{});return !o.to&&o.to!==0&&(b$1('initScrollCounter: element missing "to" in options JSON:',t),o.to=0),typeof o.format!="function"&&o.format!==void 0&&(b$1('initScrollCounter: "format" must be a function, so it cannot come from JSON; use "decimals":',t),delete o.format),a$1(t,o)})):[]}function M(r=i()){return r?Array.from(r.querySelectorAll("[data-scroll-text]")).map(t=>c(t,"text",()=>t.dataset.scrollTextOptions??"",n=>a$2(t,u(n,{})))):[]}function H(r=i()){return {draw:E(r),animate:A(r),counter:I(r),text:M(r)}}export{H as initAll,A as initScrollAnimate,I as initScrollCounter,E as initScrollDraw,M as initScrollText};
|