svg-scroll-draw 2.7.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/angular/index.cjs +3 -3
  2. package/dist/angular/index.d.mts +48 -0
  3. package/dist/angular/index.d.ts +48 -0
  4. package/dist/angular/index.mjs +3 -3
  5. package/dist/astro/index.cjs +3 -3
  6. package/dist/astro/index.d.mts +20 -5
  7. package/dist/astro/index.d.ts +20 -5
  8. package/dist/astro/index.mjs +3 -3
  9. package/dist/cdn/svg-scroll-draw.dev.global.js +1878 -0
  10. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  11. package/dist/cinematic/index.cjs +2 -2
  12. package/dist/cinematic/index.mjs +2 -2
  13. package/dist/cli/init.js +104 -101
  14. package/dist/devtools/index.cjs +1 -1
  15. package/dist/devtools/index.mjs +1 -1
  16. package/dist/group/index.cjs +3 -3
  17. package/dist/group/index.d.mts +48 -0
  18. package/dist/group/index.d.ts +48 -0
  19. package/dist/group/index.mjs +3 -3
  20. package/dist/horizontal/index.cjs +1 -0
  21. package/dist/horizontal/index.d.mts +108 -0
  22. package/dist/horizontal/index.d.ts +108 -0
  23. package/dist/horizontal/index.mjs +1 -0
  24. package/dist/index.cjs +4 -4
  25. package/dist/index.d.mts +48 -0
  26. package/dist/index.d.ts +48 -0
  27. package/dist/index.mjs +4 -4
  28. package/dist/nuxt/index.cjs +3 -3
  29. package/dist/nuxt/index.d.mts +33 -0
  30. package/dist/nuxt/index.d.ts +33 -0
  31. package/dist/nuxt/index.mjs +3 -3
  32. package/dist/pin/index.cjs +1 -1
  33. package/dist/pin/index.mjs +1 -1
  34. package/dist/progress/index.cjs +1 -0
  35. package/dist/progress/index.d.mts +74 -0
  36. package/dist/progress/index.d.ts +74 -0
  37. package/dist/progress/index.mjs +1 -0
  38. package/dist/react/index.cjs +3 -3
  39. package/dist/react/index.d.mts +33 -0
  40. package/dist/react/index.d.ts +33 -0
  41. package/dist/react/index.mjs +3 -3
  42. package/dist/reveal/index.cjs +1 -0
  43. package/dist/reveal/index.d.mts +80 -0
  44. package/dist/reveal/index.d.ts +80 -0
  45. package/dist/reveal/index.mjs +1 -0
  46. package/dist/snap/index.cjs +1 -1
  47. package/dist/snap/index.d.mts +8 -0
  48. package/dist/snap/index.d.ts +8 -0
  49. package/dist/snap/index.mjs +1 -1
  50. package/dist/solid/index.cjs +3 -3
  51. package/dist/solid/index.d.mts +48 -0
  52. package/dist/solid/index.d.ts +48 -0
  53. package/dist/solid/index.mjs +3 -3
  54. package/dist/svelte/index.cjs +3 -3
  55. package/dist/svelte/index.d.mts +48 -0
  56. package/dist/svelte/index.d.ts +48 -0
  57. package/dist/svelte/index.mjs +3 -3
  58. package/dist/text/index.cjs +1 -1
  59. package/dist/text/index.d.mts +15 -0
  60. package/dist/text/index.d.ts +15 -0
  61. package/dist/text/index.mjs +1 -1
  62. package/dist/timeline/index.cjs +8 -8
  63. package/dist/timeline/index.d.mts +31 -0
  64. package/dist/timeline/index.d.ts +31 -0
  65. package/dist/timeline/index.mjs +8 -8
  66. package/dist/video/index.cjs +1 -1
  67. package/dist/video/index.d.mts +15 -0
  68. package/dist/video/index.d.ts +15 -0
  69. package/dist/video/index.mjs +1 -1
  70. package/dist/vue/index.cjs +3 -3
  71. package/dist/vue/index.d.mts +33 -0
  72. package/dist/vue/index.d.ts +33 -0
  73. package/dist/vue/index.mjs +3 -3
  74. package/dist/web-component/index.cjs +3 -3
  75. package/dist/web-component/index.mjs +3 -3
  76. package/package.json +37 -5
@@ -0,0 +1,74 @@
1
+ type EasingName = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'spring' | 'bounce' | 'elastic';
2
+ interface TriggerConfig {
3
+ start?: string;
4
+ end?: string;
5
+ }
6
+ interface ScrollDrawInstance {
7
+ destroy: () => void;
8
+ /** Reset and replay the animation from the beginning. */
9
+ replay: () => void;
10
+ /** Pause the animation at the current progress. */
11
+ pause: () => void;
12
+ /** Resume a paused animation. */
13
+ resume: () => void;
14
+ /** Jump to a specific progress value (0–1) and pause. */
15
+ seek: (progress: number) => void;
16
+ /** Returns current draw progress (0–1). */
17
+ getProgress: () => number;
18
+ /**
19
+ * Re-measure after a layout change: path lengths, and the scroll trigger window.
20
+ *
21
+ * The engine already re-measures on `resize`, on `orientationchange`, and via a
22
+ * `ResizeObserver` on the document element — but none of those fire for a layout
23
+ * change that leaves the document height alone, such as a tab switching, a
24
+ * sibling collapsing, or a font swapping inside a fixed-height box. Call this
25
+ * after one of those.
26
+ *
27
+ * Optional on this shared type because several instances here are fan-outs over
28
+ * other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
29
+ * `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
30
+ * use `instance.refresh?.()` if you hold an instance of unknown origin.
31
+ */
32
+ refresh?: () => void;
33
+ }
34
+
35
+ interface ScrollProgressOptions {
36
+ /**
37
+ * CSS custom property to set on the target element (raw 0–1, unclamped on
38
+ * the eased side). Default: `'--scroll-progress'`.
39
+ */
40
+ variable?: string;
41
+ /**
42
+ * Second property name for the eased value. Default: `'--scroll-progress-eased'`.
43
+ * Set to `null` to skip writing the eased variable.
44
+ */
45
+ easedVariable?: string | null;
46
+ trigger?: TriggerConfig;
47
+ easing?: EasingName | ((t: number) => number);
48
+ speed?: number;
49
+ /** Scroll axis. Default: 'y'. */
50
+ axis?: 'x' | 'y';
51
+ /** Custom scroll container. Default: window. */
52
+ scrollContainer?: string | Element;
53
+ onProgress?: (raw: number, eased: number) => void;
54
+ }
55
+ /**
56
+ * Expose scroll progress as CSS custom properties on a target element.
57
+ *
58
+ * The raw (linear) value and eased value are written every frame so CSS
59
+ * transitions, `calc()` expressions, and `@property` animations can drive
60
+ * visual effects with zero per-frame JS work beyond the variable update.
61
+ *
62
+ * @example
63
+ * // JS
64
+ * scrollProgress('#hero', { easing: 'ease-in-out' });
65
+ *
66
+ * // CSS
67
+ * #hero {
68
+ * opacity: calc(var(--scroll-progress));
69
+ * transform: translateY(calc((1 - var(--scroll-progress-eased)) * 40px));
70
+ * }
71
+ */
72
+ declare function scrollProgress(target: string | Element, options?: ScrollProgressOptions): ScrollDrawInstance;
73
+
74
+ export { type ScrollProgressOptions, scrollProgress };
@@ -0,0 +1,74 @@
1
+ type EasingName = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'spring' | 'bounce' | 'elastic';
2
+ interface TriggerConfig {
3
+ start?: string;
4
+ end?: string;
5
+ }
6
+ interface ScrollDrawInstance {
7
+ destroy: () => void;
8
+ /** Reset and replay the animation from the beginning. */
9
+ replay: () => void;
10
+ /** Pause the animation at the current progress. */
11
+ pause: () => void;
12
+ /** Resume a paused animation. */
13
+ resume: () => void;
14
+ /** Jump to a specific progress value (0–1) and pause. */
15
+ seek: (progress: number) => void;
16
+ /** Returns current draw progress (0–1). */
17
+ getProgress: () => number;
18
+ /**
19
+ * Re-measure after a layout change: path lengths, and the scroll trigger window.
20
+ *
21
+ * The engine already re-measures on `resize`, on `orientationchange`, and via a
22
+ * `ResizeObserver` on the document element — but none of those fire for a layout
23
+ * change that leaves the document height alone, such as a tab switching, a
24
+ * sibling collapsing, or a font swapping inside a fixed-height box. Call this
25
+ * after one of those.
26
+ *
27
+ * Optional on this shared type because several instances here are fan-outs over
28
+ * other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
29
+ * `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
30
+ * use `instance.refresh?.()` if you hold an instance of unknown origin.
31
+ */
32
+ refresh?: () => void;
33
+ }
34
+
35
+ interface ScrollProgressOptions {
36
+ /**
37
+ * CSS custom property to set on the target element (raw 0–1, unclamped on
38
+ * the eased side). Default: `'--scroll-progress'`.
39
+ */
40
+ variable?: string;
41
+ /**
42
+ * Second property name for the eased value. Default: `'--scroll-progress-eased'`.
43
+ * Set to `null` to skip writing the eased variable.
44
+ */
45
+ easedVariable?: string | null;
46
+ trigger?: TriggerConfig;
47
+ easing?: EasingName | ((t: number) => number);
48
+ speed?: number;
49
+ /** Scroll axis. Default: 'y'. */
50
+ axis?: 'x' | 'y';
51
+ /** Custom scroll container. Default: window. */
52
+ scrollContainer?: string | Element;
53
+ onProgress?: (raw: number, eased: number) => void;
54
+ }
55
+ /**
56
+ * Expose scroll progress as CSS custom properties on a target element.
57
+ *
58
+ * The raw (linear) value and eased value are written every frame so CSS
59
+ * transitions, `calc()` expressions, and `@property` animations can drive
60
+ * visual effects with zero per-frame JS work beyond the variable update.
61
+ *
62
+ * @example
63
+ * // JS
64
+ * scrollProgress('#hero', { easing: 'ease-in-out' });
65
+ *
66
+ * // CSS
67
+ * #hero {
68
+ * opacity: calc(var(--scroll-progress));
69
+ * transform: translateY(calc((1 - var(--scroll-progress-eased)) * 40px));
70
+ * }
71
+ */
72
+ declare function scrollProgress(target: string | Element, options?: ScrollProgressOptions): ScrollDrawInstance;
73
+
74
+ export { type ScrollProgressOptions, scrollProgress };
@@ -0,0 +1 @@
1
+ function X({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),c=Math.sqrt(n),i=0,p=[];for(let o=0;o<r;o++){let u=Math.pow(c,o);p.push(u),i+=u;}let m=[0],h=0;for(let o=0;o<r;o++)h+=p[o]/i,m.push(h);return o=>{if(o<=0)return 0;if(o>=1)return 1;for(let u=0;u<r;u++)if(o<=m[u+1]){let f=(o-m[u])/(m[u+1]-m[u]);if(u===0)return f*(2-f);let d=1-Math.pow(n,u);return d+(1-d)*(2*f-1)*(2*f-1)}return 1}}function j({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),c=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-c)*(2*Math.PI)/n)+1}var P={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:X(),elastic:j()};function T(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function F(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function C(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 J(e,t,r){return Math.min(r,Math.max(t,e))}function R(e,t,r,n){return r===t?0:J((e-t)/(r-t)*n,0,1)}function V(e,t,r){let n=e.getBoundingClientRect(),c=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:c,scroll:0}:{top:r==="x"?n.left:n.top,height:c,scroll:r==="x"?window.scrollX:window.scrollY}}function D(e,t,r,n,c){let i=F(e.top,e.height,t,n.element)-C(n.viewport,r),p=F(e.top,e.height,t,c.element)-C(c.viewport,r);return {tStart:i,tEnd:p}}var O=new Map;function $(e,t){O.set(e,t);}function G(e){O.delete(e);}var K=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function N(e,...t){K&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var q={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function te(e,t={}){if(typeof window>"u")return q;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return N("scrollProgress: element not found:",e),q;let n=r,{variable:c="--scroll-progress",easedVariable:i="--scroll-progress-eased",trigger:p={},easing:m="linear",speed:h=1,axis:o="y",scrollContainer:u,onProgress:f}=t,d=typeof m=="function"?m:P[m]??P.linear,W=T(p.start??"top bottom"),z=T(p.end??"bottom top"),l=typeof u=="string"?document.querySelector(u):u??null,y=0,x=0,g=0,E=false,b=false,w=0,A=()=>l?o==="x"?l.scrollLeft:l.scrollTop:o==="x"?window.scrollX:window.scrollY,B=()=>l?o==="x"?l.clientWidth:l.clientHeight:o==="x"?window.innerWidth:window.innerHeight;function v(){let s=V(n,l,o),a=D(s,s.scroll,B(),W,z);y=a.tStart,x=a.tEnd;}function _(s,a){n.style.setProperty(c,String(s)),i!=null&&n.style.setProperty(i,String(a)),f?.(s,a);}function S(){if(!E||b)return;let s=R(A(),y,x,h),a=d(s);w=s,_(s,a),g=requestAnimationFrame(S);}v();{let s=R(A(),y,x,h),a=d(s);w=s,_(s,a);}let L=new IntersectionObserver(s=>{s.forEach(a=>{E=a.isIntersecting,E&&!b?g=requestAnimationFrame(S):cancelAnimationFrame(g);});},{root:l??null}),I;function M(){clearTimeout(I),I=setTimeout(v,150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),L.observe(r),$(r,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:y,tEnd:x})}),{destroy(){cancelAnimationFrame(g),L.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(I),n.style.removeProperty(c),i!=null&&n.style.removeProperty(i),G(r);},replay(){v();},pause(){b=true,cancelAnimationFrame(g);},resume(){b&&(b=false,E&&(g=requestAnimationFrame(S)));},seek(s){let a=Math.min(1,Math.max(0,s)),k=d(a);w=a,b=true,cancelAnimationFrame(g),_(a,k);},getProgress(){return w}}}export{te as scrollProgress};
@@ -1,3 +1,3 @@
1
- 'use strict';var _t=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var _t__default=/*#__PURE__*/_interopDefault(_t);function At({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,c=[];for(let g=0;g<r;g++){let P=Math.pow(i,g);c.push(P),o+=P;}let u=[0],l=0;for(let g=0;g<r;g++)l+=c[g]/o,u.push(l);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let P=0;P<r;P++)if(g<=u[P+1]){let N=(g-u[P])/(u[P+1]-u[P]);if(P===0)return N*(2-N);let E=1-Math.pow(t,P);return E+(1-E)*(2*N-1)*(2*N-1)}return 1}}function Mt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var ne={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:At(),elastic:Mt()};function oe(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function tt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function rt(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 Ge(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Pt(e,n,r){return Math.min(r,Math.max(n,e))}function U(e,n,r,t){return r===n?0:Pt((e-n)/(r-n)*t,0,1)}function me(e,n,r,t,i){let o=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),c=tt(e.top,e.height,n,i.element)-rt(i.viewport,r);return {tStart:o,tEnd:c}}function nt(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 r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Oe(e,n,r){let t=nt(e),i=nt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var ot={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}};function st(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var it={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function $t(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?st("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&st("Element has a fill \u2014 it may obscure the stroke animation.",e);}function kt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.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 i(){let o=r==="x"?window.scrollX:window.scrollY,c=e-o,u=n-o,l=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${l?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}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;${l?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}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(t),window.addEventListener("scroll",i,{passive:true}),i(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let c=parseFloat(o),u=t[i++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...ot[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:l=false,easing:g="linear",trigger:P={},stagger:N=0,direction:E="forward",once:J=false,debug:fe=false,axis:F="y",scrollContainer:_,autoReverse:q=false,delay:D=0,strokeColor:T,strokeWidth:A,fillOpacity:h,waypoints:y,velocityScale:C=false,threshold:$=0,rootMargin:k="0px",repeat:S=0,repeatDelay:O=0,morphTo:M,clip:R,autoplay:G=false,duration:W=1e3,native:Y=true,onProgress:d,onStart:I,onComplete:b,onEnter:w,onLeave:Z,onEnterBack:Se,onLeaveBack:be}=i,we=R===true?"left":typeof R=="string"?R:false,ge=typeof g=="function"?g:ne[g]??ne.linear,Re=oe(P.start??"top bottom"),ke=oe(P.end??"bottom top"),ee=typeof _=="string"?document.querySelector(_):_??null,a=Array.isArray(T)?T[0]:null,p=Array.isArray(T)?T[1]:typeof T=="string"?T:null,K=Array.isArray(A)?A[0]:null,B=Array.isArray(A)?A[1]:typeof A=="number"?A:null,te=Array.isArray(h)?h[0]:null,ie=Array.isArray(h)?h[1]:typeof h=="number"?h:null;function re(s){let m=s*100;switch(we){case "right":return `inset(0 0 0 ${100-m}%)`;case "top":return `inset(0 0 ${100-m}% 0)`;case "bottom":return `inset(${100-m}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-m}% 0 0)`}}let j=we?[]:Array.from(e.querySelectorAll(c)),H=[],pe=[],ye=0,Te=0,ae=false,he=false,se=0,ze=false,ve=-1,Ve=-1,le=false,Ce=0,xe=0,Ae,Ye=null,Me=new Set,qe=-1,Ke=performance.now(),Ne=NaN;function Fe(){return ee?F==="x"?ee.scrollLeft:ee.scrollTop:F==="x"?window.scrollX:window.scrollY}function Qe(){return ee?F==="x"?ee.clientWidth:ee.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function et(){let s=e.getBoundingClientRect(),m,x,Q;if(ee){let ue=ee.getBoundingClientRect();m=F==="x"?s.left-ue.left+ee.scrollLeft:s.top-ue.top+ee.scrollTop,x=F==="x"?s.width:s.height,Q=Fe();}else m=F==="x"?s.left:s.top,x=F==="x"?s.width:s.height,Q=Fe();let ce=me({top:m,height:x},Q,Qe(),Re,ke);ye=ce.tStart,Te=ce.tEnd,fe&&process.env.NODE_ENV!=="production"&&(Ye?.remove(),Ye=kt(ye,Te,F));}function Et(s,m){if(e.style.setProperty("--scroll-draw-progress",String(s)),we){let x=m==="reverse"?1-s:s;e.style.clipPath=re(x);return}j.forEach((x,Q)=>{x.style.strokeDashoffset=m==="reverse"?`${H[Q]*s}`:`${H[Q]*(1-s)}`,l&&(x.style.opacity=m==="reverse"?`${1-s}`:`${s}`),a&&p?x.style.stroke=Oe(a,p,s):p&&(x.style.stroke=p),K!==null&&B!==null?x.style.strokeWidth=`${K+(B-K)*s}`:B!==null&&(x.style.strokeWidth=`${B}`),te!==null&&ie!==null?x.style.fillOpacity=`${te+(ie-te)*s}`:ie!==null&&(x.style.fillOpacity=`${ie}`),M&&x.tagName.toLowerCase()==="path"&&pe[Q]&&x.setAttribute("d",Je(pe[Q],M,s));});}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),we){e.style.clipPath=re(0);return}j.forEach((s,m)=>{s.style.strokeDasharray=`${H[m]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${H[m]}`,l?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",a&&(s.style.stroke=a),K!==null&&(s.style.strokeWidth=`${K}`),te!==null&&(s.style.fillOpacity=`${te}`),M&&s.tagName.toLowerCase()==="path"&&pe[m]&&s.setAttribute("d",pe[m]);});}if(j.forEach(s=>{$t(s);let m=Ge(s);H.push(m),s.tagName.toLowerCase()==="path"?pe.push(s.getAttribute("d")??""):pe.push(""),o?(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=E==="reverse"?`${m}`:"0",l&&(s.style.opacity="1"),p&&(s.style.stroke=p),B!==null&&(s.style.strokeWidth=`${B}`),ie!==null&&(s.style.fillOpacity=`${ie}`),M&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",M)):(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=E==="reverse"?"0":`${m}`,l?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",a&&(s.style.stroke=a),K!==null&&(s.style.strokeWidth=`${K}`),te!==null&&(s.style.fillOpacity=`${te}`));}),we){if(o)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function St(){return !(Y===false||!Ct()||!j.length||typeof g!="string"||!(g in it)||we||F!=="y"||ee||u!==1||N!==0||J||q||C!==false||M||y||S||D>0||d||I||b||w||Z||Se||be||T!=null||A!=null||h!=null||(P.start??"top bottom").trim()!=="top bottom"||(P.end??"bottom top").trim()!=="bottom top")}function xt(){let s=`svg-scroll-draw-${++Lt}`,m=E==="reverse"?"0":"var(--ssd-len)",x=E==="reverse"?"var(--ssd-len)":"0",Q=`stroke-dashoffset:${m};`,ce=`stroke-dashoffset:${x};`;l&&(Q+=`opacity:${E==="reverse"?1:0};`,ce+=`opacity:${E==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${s}{from{${Q}}to{${ce}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${it[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function de(f,L){f.style.setProperty("--ssd-len",String(H[L])),f.style.strokeDasharray=`${H[L]}`,f.style.strokeDashoffset="",f.style.opacity="",f.style.animationPlayState="",f.classList.add(s);}j.forEach(de);let v=false,z=-1;function V(){if(z>=0)return z;let f=e.getBoundingClientRect(),{tStart:L,tEnd:X}=me({top:f.top,height:f.height},Fe(),Qe(),Re,ke);return ge(U(Fe(),L,X,u))}return {destroy(){j.forEach(f=>{f.classList.remove(s),f.style.removeProperty("--ssd-len"),f.style.animationPlayState="";}),ue.remove();},replay(){v=false,z=-1,j.forEach(de);},pause(){v=true,j.forEach(f=>{f.style.animationPlayState="paused";});},resume(){v&&(v=false,j.forEach(f=>{f.style.animationPlayState="running";}));},seek(f){let L=Math.min(1,Math.max(0,f));z=L,v=true,j.forEach((X,$e)=>{X.classList.remove(s),X.style.strokeDashoffset=E==="reverse"?`${H[$e]*L}`:`${H[$e]*(1-L)}`,l&&(X.style.opacity=E==="reverse"?`${1-L}`:`${L}`);});},getProgress(){return V()}}}if(St())return xt();function Tt(){let s=Math.max(1,W),m=0,x=0;function Q(V){let f=true;if(we){let L=Math.min(1,Math.max(0,V/s)),X=ge(L);Ce=X,e.style.setProperty("--scroll-draw-progress",String(X)),e.style.clipPath=re(E==="reverse"?1-X:X),d?.(X),L<1&&(f=false);}else j.forEach((L,X)=>{let $e=X*N*s,Ie=Math.min(1,Math.max(0,(V-$e)/s)),Ee=ge(Ie);L.style.strokeDashoffset=E==="reverse"?`${H[X]*Ee}`:`${H[X]*(1-Ee)}`,l&&(L.style.opacity=E==="reverse"?`${1-Ee}`:`${Ee}`),a&&p?L.style.stroke=Oe(a,p,Ee):p&&(L.style.stroke=p),K!==null&&B!==null?L.style.strokeWidth=`${K+(B-K)*Ee}`:B!==null&&(L.style.strokeWidth=`${B}`),te!==null&&ie!==null?L.style.fillOpacity=`${te+(ie-te)*Ee}`:ie!==null&&(L.style.fillOpacity=`${ie}`),M&&L.tagName.toLowerCase()==="path"&&pe[X]&&L.setAttribute("d",Je(pe[X],M,Ee)),X===0&&(d?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Ie<1&&(f=false);});if(y){let L=Math.min(1,Math.max(0,V/s)),X=ge(L);for(let $e in y){let Ie=parseFloat($e);X>=Ie&&!Me.has(Ie)&&(Me.add(Ie),y[$e]?.());}}return f}function ce(V){if(le)return;let f=V-m;he||(he=true,I?.());let L=Q(f);if(L&&!ae){ae=true,Q(s*(1+Math.max(0,j.length-1)*N)),b?.(),xe<(S==="infinite"?1/0:S??0)&&(xe++,Ae=setTimeout(()=>{m=performance.now(),he=false,ae=false,Me.clear(),We(),se=requestAnimationFrame(ce);},O));return}L||(se=requestAnimationFrame(ce));}function ue(){cancelAnimationFrame(se),clearTimeout(Ae),m=performance.now(),x=0,le=false,he=false,ae=false,xe=0,Me.clear(),We(),se=requestAnimationFrame(ce);}let de=new IntersectionObserver(V=>{V.forEach(f=>{f.isIntersecting&&!(J&&ae)?ue():!f.isIntersecting&&!J&&!ae&&(cancelAnimationFrame(se),clearTimeout(Ae),m=null);});},{root:ee??null,threshold:$,rootMargin:k}),v;function z(){clearTimeout(v),v=setTimeout(()=>{j.forEach((V,f)=>{H[f]=Ge(V),V.style.strokeDasharray=`${H[f]}`;});},150);}return window.addEventListener("resize",z),window.addEventListener("orientationchange",z),D>0?setTimeout(()=>de.observe(e),D):de.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),de.disconnect(),window.removeEventListener("resize",z),window.removeEventListener("orientationchange",z),clearTimeout(v);},replay(){xe=0,ue();},pause(){le||(le=true,x=performance.now()-m,cancelAnimationFrame(se));},resume(){le&&(le=false,m=performance.now()-x,se=requestAnimationFrame(ce));},seek(V){let f=Math.min(1,Math.max(0,V));Ce=f,le=true,x=f*s,m=performance.now()-x,cancelAnimationFrame(se),Q(x);},getProgress(){return Ce}}}if(G)return Tt();et();function Be(){if(!ze||le)return;let s=performance.now(),m=Fe(),x=u;if(C!==false){let v=s-Ke,z=v>0?Math.abs(m-(qe<0?m:qe))/v:0;x=u*Math.max(.2,1+z*(typeof C=="number"?C:1)*.04);}qe=m,Ke=s;let Q=q?Ve===-1||m>=Ve?"forward":"reverse":E;Ve=m;let ce=Te-ye,ue=true,de=ce===0?0:(m-ye)/ce;if(isNaN(Ne)||(Ne<=0&&de>0?w?.():Ne>0&&de<=0&&be?.(),Ne<1&&de>=1?Z?.():Ne>=1&&de<1&&Se?.()),Ne=de,we){let v=ge(U(m,ye,Te,x));J&&!q&&(ve=Math.max(ve,v),v=ve),Ce=v,e.style.setProperty("--scroll-draw-progress",String(v));let z=Q==="reverse"?1-v:v;e.style.clipPath=re(z),d?.(v),!he&&U(m,ye,Te,x)>0&&(he=true,I?.()),v>=1&&!ae?(ae=true,b?.(),xe<(S==="infinite"?1/0:S??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,ae=false,e.style.clipPath=re(0);},O))):v<1&&!J&&(ae=false),se=requestAnimationFrame(Be);return}if(j.forEach((v,z)=>{let V=z*N*ce,f=ge(U(m,ye+V,Te+V,x));J&&!q&&(ve=Math.max(ve,f),f=ve),Ce=f,v.style.strokeDashoffset=Q==="reverse"?`${H[z]*f}`:`${H[z]*(1-f)}`,l&&(v.style.opacity=Q==="reverse"?`${1-f}`:`${f}`),a&&p?v.style.stroke=Oe(a,p,f):p&&(v.style.stroke=p),K!==null&&B!==null?v.style.strokeWidth=`${K+(B-K)*f}`:B!==null&&(v.style.strokeWidth=`${B}`),te!==null&&ie!==null?v.style.fillOpacity=`${te+(ie-te)*f}`:ie!==null&&(v.style.fillOpacity=`${ie}`),M&&v.tagName.toLowerCase()==="path"&&pe[z]&&v.setAttribute("d",Je(pe[z],M,f)),z===0&&(d?.(f),e.style.setProperty("--scroll-draw-progress",String(f))),f<1&&(ue=false);}),y){let v=ge(U(m,ye,Te,x));for(let z in y){let V=parseFloat(z);v>=V&&!Me.has(V)&&(Me.add(V),y[z]?.());}}!he&&U(m,ye,Te,x)>0&&(he=true,I?.()),ue&&!ae?(ae=true,b?.(),xe<(S==="infinite"?1/0:S??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,ae=false,Me.clear(),We();},O))):!ue&&!J&&(ae=false),se=requestAnimationFrame(Be);}let je=new IntersectionObserver(s=>{s.forEach(m=>{ze=m.isIntersecting,ze&&!le?se=requestAnimationFrame(Be):cancelAnimationFrame(se);});},{root:ee??null,threshold:$,rootMargin:k}),Ue;function _e(){clearTimeout(Ue),Ue=setTimeout(()=>{j.forEach((s,m)=>{H[m]=Ge(s),s.style.strokeDasharray=`${H[m]}`;}),et();},150);}return window.addEventListener("resize",_e),window.addEventListener("orientationchange",_e),D>0?setTimeout(()=>je.observe(e),D):je.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),je.disconnect(),window.removeEventListener("resize",_e),window.removeEventListener("orientationchange",_e),clearTimeout(Ue),Ye?.remove();},replay(){ve=-1,Ve=-1,qe=-1,he=false,ae=false,xe=0,le=false,Me.clear(),clearTimeout(Ae),We();},pause(){le=true,cancelAnimationFrame(se);},resume(){le&&(le=false,ze&&(se=requestAnimationFrame(Be)));},seek(s){let m=Math.min(1,Math.max(0,s));Ce=m,ve=m,le=true,cancelAnimationFrame(se),Et(m,E);},getProgress(){return Ce}}}var lt=new Map;function Pe(e,n){lt.set(e,n);}function Le(e){lt.delete(e);}function Nt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],o=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let l=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(l?parseFloat(l[1]):0),o.push(l?l[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function It(e,n,r){let t=ct(e),i=ct(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,c)=>{let u=i[c];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((l,g)=>`${l}${o.units[g]}`).join(", ")})`:`${u.fn}(${u.nums.map((l,g)=>`${l}${u.units[g]}`).join(", ")})`:`${o.fn}(${o.nums.map((l,g)=>`${l+(u.nums[g]-l)*r}${o.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(Nt(t))return Oe(t,i,r);if(t.includes("("))return It(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),c=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&c){let u=parseFloat(o[1]),l=parseFloat(c[1]);return `${u+(l-u)*r}${o[2]||c[2]}`}return r<1?t:i}function Ot(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Rt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ft=0;function Dt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:c=1,once:u=false,axis:l="y",scrollContainer:g,native:P=true,onProgress:N,onComplete:E,onEnter:J,onLeave:fe,onEnterBack:F,onLeaveBack:_}=n,q=window.matchMedia("(prefers-reduced-motion: reduce)").matches,D=typeof o=="function"?o:ne[o]??ne["ease-out"],T=oe(i.start??"top bottom"),A=oe(i.end??"bottom top"),h=typeof g=="string"?document.querySelector(g):g??null,y=Object.entries(t).map(([a,p])=>({prop:Ot(a),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function C(){let a=window.getComputedStyle(e);for(let p of y)p.from===""&&(p.from=a.getPropertyValue(p.prop).trim()||"0");}function $(){for(let a of y)e.style.setProperty(a.prop,String(a.to));}if(q)return $(),E?.(),r;C();function k(){if(!P||!Dt()||typeof o!="string"||!(o in mt)||l!=="y"||h||u||c!==1||N||E||J||fe||F||_||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let a of y)if(!Rt.has(a.prop))return false;return true}function S(){let a=`ssd-a-${++Ft}`,p=y.map(re=>`${re.prop}:${re.from}`).join(";"),K=y.map(re=>`${re.prop}:${re.to}`).join(";"),B=document.createElement("style");B.setAttribute("data-ssd-animate",""),B.textContent=`@keyframes ${a}{from{${p}}to{${K}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${mt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(B),e.classList.add(a);let te=()=>l==="x"?window.scrollX:window.scrollY,ie=()=>l==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),B.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(re){let j=Math.min(1,Math.max(0,re));e.classList.remove(a);for(let H of y)e.style.setProperty(H.prop,ut(H.from,H.to,j));},getProgress(){let re=e.getBoundingClientRect(),j=te(),H=ie(),{tStart:pe,tEnd:ye}=me({top:re.top,height:re.height},j,H,T,A);return D(U(j,pe,ye,c))}}}if(k())return S();let O=0,M=0,R=0,G=false,W=false,Y=-1,d=0,I=false,b=NaN,w=()=>h?l==="x"?h.scrollLeft:h.scrollTop:l==="x"?window.scrollX:window.scrollY,Z=()=>h?l==="x"?h.clientWidth:h.clientHeight:l==="x"?window.innerWidth:window.innerHeight;function Se(){let a=e.getBoundingClientRect(),p,K;if(h){let te=h.getBoundingClientRect();p=l==="x"?a.left-te.left+h.scrollLeft:a.top-te.top+h.scrollTop,K=l==="x"?a.width:a.height;}else p=l==="x"?a.left:a.top,K=l==="x"?a.width:a.height;let B=me({top:p,height:K},w(),Z(),T,A);O=B.tStart,M=B.tEnd;}function be(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let p of y)e.style.setProperty(p.prop,ut(p.from,p.to,a));N?.(a);}function we(a){if(isNaN(b)){b=a;return}b<=0&&a>0?J?.():b>0&&a<=0&&_?.(),b<1&&a>=1?fe?.():b>=1&&a<1&&F?.(),b=a;}function ge(){if(!G||W)return;let a=M===O?0:(w()-O)/(M-O);we(a);let p=D(U(w(),O,M,c));u&&(Y=Math.max(Y,p),p=Y),d=p,be(p),p>=1&&!I?(I=true,E?.()):p<1&&!u&&(I=false),R=requestAnimationFrame(ge);}Se();{let a=D(U(w(),O,M,c));u&&a>0&&(Y=a),d=a,be(a);}let Re=new IntersectionObserver(a=>{a.forEach(p=>{G=p.isIntersecting,G&&!W?R=requestAnimationFrame(ge):cancelAnimationFrame(R);});},{root:h??null}),ke;function ee(){clearTimeout(ke),ke=setTimeout(Se,150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),Re.observe(e),Pe(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:O,tEnd:M})}),{destroy(){cancelAnimationFrame(R),Re.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout(ke),Le(e);},replay(){Y=-1,I=false,d=0,W=false,be(0);},pause(){W=true,cancelAnimationFrame(R);},resume(){W&&(W=false,G&&(R=requestAnimationFrame(ge)));},seek(a){let p=Math.min(1,Math.max(0,a));d=p,Y=p,W=true,cancelAnimationFrame(R),be(p);},getProgress(){return d}}}var Ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return Ze;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ze;let t=r,{from:i=0,to:o,format:c,easing:u="ease-out",trigger:l={},once:g=true,decimals:P,onComplete:N}=n,E=P!==void 0?d=>d.toFixed(P):c??(d=>String(Math.round(d))),J=typeof u=="function"?u:ne[u]??ne["ease-out"],fe=oe(l.start??"top 80%"),F=oe(l.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),N?.(),Ze;t.textContent=E(i);let q=0,D=0,T=0,A=false,h=false,y=-1,C=0,$=false,k=()=>window.scrollY,S=()=>window.innerHeight;function O(){let d=t.getBoundingClientRect(),I=me({top:d.top,height:d.height},k(),S(),fe,F);q=I.tStart,D=I.tEnd;}function M(d){t.textContent=E(i+(o-i)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function R(){if(!A||h)return;let d=J(U(k(),q,D,1));g&&(y=Math.max(y,d),d=y),C=d,M(d),d>=1&&!$?($=true,N?.()):d<1&&!g&&($=false),T=requestAnimationFrame(R);}O();{let d=J(U(k(),q,D,1));g&&d>0&&(y=d),C=d,M(d);}let G=new IntersectionObserver(d=>{d.forEach(I=>{A=I.isIntersecting,A&&!h?T=requestAnimationFrame(R):cancelAnimationFrame(T);});}),W;function Y(){clearTimeout(W),W=setTimeout(O,150);}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),G.observe(t),Pe(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:q,tEnd:D})}),{destroy(){cancelAnimationFrame(T),G.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(W),Le(t);},replay(){y=-1,$=false,C=0,h=false,M(0);},pause(){h=true,cancelAnimationFrame(T);},resume(){h&&(h=false,A&&(T=requestAnimationFrame(R)));},seek(d){let I=Math.min(1,Math.max(0,d));C=I,y=I,h=true,cancelAnimationFrame(T),M(I);},getProgress(){return C}}}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),dt;let t=r,{trigger:i={},easing:o="linear",once:c=false,axis:u="y",preload:l="auto",onReady:g,onComplete:P,onProgress:N}=n,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof o=="function"?o:ne[o]??ne.linear,fe=oe(i.start??"top top"),F=oe(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=l);let _=n.from??0,q=n.to,D=0,T=0,A=0,h=false,y=false,C=-1,$=0,k=false,S=false,O=()=>u==="x"?window.scrollX:window.scrollY,M=()=>u==="x"?window.innerWidth:window.innerHeight;function R(){let w=t.getBoundingClientRect(),Z=u==="x"?w.left:w.top,Se=u==="x"?w.width:w.height,be=me({top:Z,height:Se},O(),M(),fe,F);D=be.tStart,T=be.tEnd;}function G(w){if(!S)return;let Z=q??t.duration??0;t.currentTime=_+(Z-_)*w,t.style.setProperty("--scroll-draw-progress",String(w)),N?.(w);}function W(){if(!h||y||!S)return;let w=J(U(O(),D,T,1));c&&(C=Math.max(C,w),w=C),$=w,G(w),w>=1&&!k?(k=true,P?.()):w<1&&!c&&(k=false),A=requestAnimationFrame(W);}function Y(){if(S=true,q===void 0&&(q=t.duration),E){G(1),g?.();return}R(),g?.(),h&&!y&&(A=requestAnimationFrame(W));}t.readyState>=1?Y():t.addEventListener("loadedmetadata",Y,{once:true}),S||R();let d=new IntersectionObserver(w=>{w.forEach(Z=>{h=Z.isIntersecting,h&&!y&&S?A=requestAnimationFrame(W):cancelAnimationFrame(A);});}),I;function b(){clearTimeout(I),I=setTimeout(R,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),d.observe(t),Pe(t,{type:"video",getProgress:()=>$,getTrigger:()=>({tStart:D,tEnd:T})}),{destroy(){cancelAnimationFrame(A),d.disconnect(),t.removeEventListener("loadedmetadata",Y),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(I),Le(t);},replay(){C=-1,k=false,$=0,y=false,G(0);},pause(){y=true,cancelAnimationFrame(A);},resume(){y&&(y=false,h&&S&&(A=requestAnimationFrame(W)));},seek(w){let Z=Math.min(1,Math.max(0,w));$=Z,C=Z,y=true,cancelAnimationFrame(A),G(Z);},getProgress(){return $}}}function bt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Ht(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function yt(e){let n=bt(e),r=new Map;for(let o of n){let c=o.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(o);}let t=[],i=Array.from(r.keys()).sort((o,c)=>o-c);for(let o of i){let c=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block";for(let l of c)u.appendChild(l);t.push(u);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function zt(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,c=o+(1-i);return c<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(c-o)))}function Vt(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),ht;let t=r,{split:i="words",stagger:o=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:l={},once:g=true,onComplete:P}=n,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof c=="function"?c:ne[c]??ne["ease-out"],J=oe(l.start??"top 85%"),fe=oe(l.end??"top 40%"),F=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let _;i==="chars"?_=Ht(t):i==="lines"?_=yt(t):_=bt(t);let q=_.length;function D(b,w){u?.opacity!==void 0&&(b.style.opacity=String(u.opacity+(1-u.opacity)*w));let Z=Vt(w,u);Z&&(b.style.transform=Z);}function T(b){t.style.setProperty("--scroll-draw-progress",String(b)),_.forEach((w,Z)=>{let Se=E(zt(b,Z,q,o));D(w,Se);});}if(N)return T(1),P?.(),{destroy(){t.innerHTML=F,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let A=0,h=0,y=0,C=false,$=false,k=-1,S=0,O=false,M=()=>window.scrollY,R=()=>window.innerHeight;function G(){let b=t.getBoundingClientRect(),w=me({top:b.top,height:b.height},M(),R(),J,fe);A=w.tStart,h=w.tEnd;}function W(){if(!C||$)return;let b=U(M(),A,h,1);g&&(k=Math.max(k,b),b=k),S=b,T(b),b>=1&&!O?(O=true,P?.()):b<1&&!g&&(O=false),y=requestAnimationFrame(W);}G();let Y=new IntersectionObserver(b=>{b.forEach(w=>{C=w.isIntersecting,C&&!$?y=requestAnimationFrame(W):cancelAnimationFrame(y);});}),d;function I(){clearTimeout(d),d=setTimeout(()=>{if(i==="lines"){let b=S;t.innerHTML=F,t.setAttribute("aria-label",t.textContent??""),_=yt(t),T(b);}G();},150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Y.observe(t),Pe(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:A,tEnd:h})}),{destroy(){cancelAnimationFrame(y),Y.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(d),t.innerHTML=F,t.removeAttribute("aria-label"),Le(t);},replay(){k=-1,O=false,S=0,$=false,T(0);},pause(){$=true,cancelAnimationFrame(y);},resume(){$&&($=false,C&&(y=requestAnimationFrame(W)));},seek(b){let w=Math.min(1,Math.max(0,b));S=w,k=w,$=true,cancelAnimationFrame(y),T(w);},getProgress(){return S}}}function Bt(e,n={}){let[r,t]=_t.useState(0),i=_t.useRef(n);i.current=n;let o=_t.useRef(-1);return _t.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let c=typeof e=="string"?document.querySelector(e):e.current;if(!c)return;let u=c,{axis:l="y",scrollContainer:g,trigger:P={}}=i.current,N=typeof g=="string"?document.querySelector(g):g??null,E=oe(P.start??"top bottom"),J=oe(P.end??"bottom top"),fe=0,F=0,_=false,q=0;function D(){return N?l==="x"?N.scrollLeft:N.scrollTop:l==="x"?window.scrollX:window.scrollY}function T(){return N?l==="x"?N.clientWidth:N.clientHeight:l==="x"?window.innerWidth:window.innerHeight}function A(){let k=u.getBoundingClientRect(),S=D(),O=l==="x"?k.left:k.top,M=l==="x"?k.width:k.height,R=me({top:O,height:M},S,T(),E,J);fe=R.tStart,F=R.tEnd;}function h(){if(!_)return;let{speed:k=1,easing:S="linear",once:O=false}=i.current,M=typeof S=="function"?S:ne[S]??ne.linear,R=U(D(),fe,F,k),G=M(R);O&&(o.current=Math.max(o.current,G),G=o.current),t(G),q=requestAnimationFrame(h);}let y=new IntersectionObserver(k=>{k.forEach(S=>{_=S.isIntersecting,_?q=requestAnimationFrame(h):cancelAnimationFrame(q);});},{root:N??null,threshold:0});A(),y.observe(u);let C;function $(){clearTimeout(C),C=setTimeout(A,150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),()=>{cancelAnimationFrame(q),clearTimeout(C),y.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$);}},[]),r}function br({children:e,className:n,style:r,...t}){let i=_t.useRef(null);return _t.useEffect(()=>{if(!i.current)return;let o=at(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function wr({children:e,className:n,style:r,...t}){let i=_t.useRef(null);return _t.useEffect(()=>{if(!i.current)return;let o=ft(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function vr({className:e,style:n,...r}){let t=_t.useRef(null);return _t.useEffect(()=>{if(!t.current)return;let i=pt(t.current,r);return ()=>i.destroy()},[]),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function Er({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let c=_t.useRef(null);return _t.useEffect(()=>{if(!c.current)return;let u=gt(c.current,o);return ()=>u.destroy()},[]),jsxRuntime.jsx("video",{ref:c,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function Sr({children:e,as:n="p",className:r,style:t,...i}){let o=_t.useRef(null);return _t.useEffect(()=>{if(!o.current)return;let c=wt(o.current,i);return ()=>c.destroy()},[]),_t__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=wr;exports.ScrollCounter=vr;exports.ScrollDraw=br;exports.ScrollText=Sr;exports.ScrollVideo=Er;exports.useScrollDrawProgress=Bt;
1
+ 'use strict';var ur=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ur__default=/*#__PURE__*/_interopDefault(ur);function Vt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),s=Math.sqrt(t),o=0,a=[];for(let f=0;f<r;f++){let E=Math.pow(s,f);a.push(E),o+=E;}let u=[0],m=0;for(let f=0;f<r;f++)m+=a[f]/o,u.push(m);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let E=0;E<r;E++)if(f<=u[E+1]){let R=(f-u[E])/(u[E+1]-u[E]);if(E===0)return R*(2-R);let L=1-Math.pow(t,E);return L+(1-L)*(2*R-1)*(2*R-1)}return 1}}function _t({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),s=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-s)*(2*Math.PI)/t)+1}var Q={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:Vt(),elastic:_t()};function ne(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function gt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function yt(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 Ve(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function qt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:qt((e-n)/(r-n)*t,0,1)}function Je(e,n,r){let t=e.getBoundingClientRect(),s=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:s,scroll:0}:{top:r==="x"?t.left:t.top,height:s,scroll:r==="x"?window.scrollX:window.scrollY}}function ye(e,n,r,t,s){let o=gt(e.top,e.height,n,t.element)-yt(t.viewport,r),a=gt(e.top,e.height,n,s.element)-yt(s.viewport,r);return {tStart:o,tEnd:a}}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 r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=ht(e),s=ht(n);return !t||!s?e:`rgb(${Math.round(t[0]+(s[0]-t[0])*r)},${Math.round(t[1]+(s[1]-t[1])*r)},${Math.round(t[2]+(s[2]-t[2])*r)})`}var bt={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 Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function he(e,...n){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Wt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Bt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",wt=33;function Gt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ut(e){let n=[];for(let r=0;r<wt;r++){let t=r/(wt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return Wt;case "ease-out":return Bt;case "ease-in-out":return Gt()?Ut(Q["ease-in-out"]):null;default:return null}}var jt=0;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Yt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?he("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&he("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Qt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.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 o=r==="x"?window.scrollX:window.scrollY,a=e-o,u=n-o,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`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;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}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(t),window.addEventListener("scroll",s,{passive:true}),s(),{el:t,destroy(){window.removeEventListener("scroll",s),t.remove();}}}var vt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,St=/[MmLlHhVvCcSsQqTtAaZz]/g;function Zt(e,n,r){if(!Ke)return;let t=(e.match(St)??[]).join("").toUpperCase(),s=(n.match(St)??[]).join("").toUpperCase(),o=(e.match(vt)??[]).length,a=(n.match(vt)??[]).length;if(t!==s){he(`morphTo: command sequence differs (${t||"\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}o!==a&&he(`morphTo: coordinate count differs (${o} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let a=parseFloat(o),u=t[s++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function Et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,s=r?{...bt[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:f="linear",trigger:E={},stagger:R=0,direction:L="forward",once:te=false,debug:be=false,axis:N="y",scrollContainer:q,autoReverse:F=false,delay:H=0,strokeColor:M,strokeWidth:C,fillOpacity:A,waypoints:w,velocityScale:$=false,threshold:k=0,rootMargin:v="0px",repeat:y=0,repeatDelay:G=0,morphTo:I,clip:W,autoplay:U=false,duration:oe=1e3,native:me=true,onProgress:h,onStart:P,onComplete:g,onEnter:d,onLeave:z,onEnterBack:de,onLeaveBack:Ee}=s,fe=W===true?"left":typeof W=="string"?W:false,Te=typeof f=="function"?f:Q[f]??Q.linear,Pe=ne(E.start??"top bottom"),He=ne(E.end??"bottom top"),we=typeof q=="string"?document.querySelector(q):q??null,ve=Array.isArray(M)?M[0]:null,ie=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ae=Array.isArray(C)?C[0]:null,J=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(A)?A[0]:null,re=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Le(i){let c=i*100;switch(fe){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(${i*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let B=fe?[]:Array.from(e.querySelectorAll(a)),O=[],l=[],p=0,Se=0,V=false,j=false,X=0,K=false,le=-1,Ce=-1,se=false,xe=0,Re=0,Ie,rt=null;function lt(){rt?.destroy(),rt=null;}let Oe=new Set,ct=NaN,Fe=true,Ue=-1,ut=performance.now(),ze=NaN;function nt(){return we?N==="x"?we.scrollLeft:we.scrollTop:N==="x"?window.scrollX:window.scrollY}function mt(){return we?N==="x"?we.clientWidth:we.clientHeight:N==="x"?window.innerWidth:window.innerHeight}function ft(){let i=Je(e,we,N),c=ye(i,i.scroll,mt(),Pe,He);p=c.tStart,Se=c.tEnd,be&&Ke&&(lt(),rt=Qt(p,Se,N));}function Dt(i,c){if(e.style.setProperty("--scroll-draw-progress",String(i)),fe){let T=c==="reverse"?1-i:i;e.style.clipPath=Le(T);return}B.forEach((T,ce)=>{T.style.strokeDashoffset=c==="reverse"?`${O[ce]*i}`:`${O[ce]*(1-i)}`,m&&(T.style.opacity=c==="reverse"?`${1-i}`:`${i}`),ve&&ie?T.style.stroke=_e(ve,ie,i):ie&&(T.style.stroke=ie),ae!==null&&J!==null?T.style.strokeWidth=`${ae+(J-ae)*i}`:J!==null&&(T.style.strokeWidth=`${J}`),pe!==null&&re!==null?T.style.fillOpacity=`${pe+(re-pe)*i}`:re!==null&&(T.style.fillOpacity=`${re}`),I&&T.tagName.toLowerCase()==="path"&&l[ce]&&T.setAttribute("d",it(l[ce],I,i));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),fe){e.style.clipPath=Le(0);return}B.forEach((i,c)=>{i.style.strokeDasharray=`${O[c]}`,i.style.strokeDashoffset=L==="reverse"?"0":`${O[c]}`,m?i.style.opacity=L==="reverse"?"1":"0":i.style.opacity="",ve&&(i.style.stroke=ve),ae!==null&&(i.style.strokeWidth=`${ae}`),pe!==null&&(i.style.fillOpacity=`${pe}`),I&&i.tagName.toLowerCase()==="path"&&l[c]&&i.setAttribute("d",l[c]);});}if(B.forEach(i=>{Yt(i);let c=Ve(i);O.push(c);let T=i.tagName.toLowerCase()==="path";T?l.push(i.getAttribute("d")??""):l.push(""),I&&(T?Zt(l[l.length-1],I,i):he(`morphTo only applies to <path> elements \u2014 ignored on <${i.tagName}>.`,i)),o?(i.style.strokeDasharray=`${c}`,i.style.strokeDashoffset=L==="reverse"?`${c}`:"0",m&&(i.style.opacity="1"),ie&&(i.style.stroke=ie),J!==null&&(i.style.strokeWidth=`${J}`),re!==null&&(i.style.fillOpacity=`${re}`),I&&i.tagName.toLowerCase()==="path"&&i.setAttribute("d",I)):(i.style.strokeDasharray=`${c}`,i.style.strokeDashoffset=L==="reverse"?"0":`${c}`,m?i.style.opacity=L==="reverse"?"1":"0":i.style.opacity="",ve&&(i.style.stroke=ve),ae!==null&&(i.style.strokeWidth=`${ae}`),pe!==null&&(i.style.fillOpacity=`${pe}`));}),fe){if(o)return e.style.clipPath=Le(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Le(0);}else if(o)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let pt=typeof f=="string"?et(f):null;function Nt(){return !(me===false||!Xt()||!B.length||!pt||fe||N!=="y"||we||u!==1||R!==0||te||F||$!==false||I||w||y||H>0||h||P||g||d||z||de||Ee||M!=null||C!=null||A!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function Ht(){let i=++jt,c=`svg-scroll-draw-${i}`,T=`svg-scroll-draw-host-${i}`,ce=`--svg-scroll-draw-${i}`,ke=L==="reverse"?"0":"var(--ssd-len)",$e=L==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${ke};`,x=`stroke-dashoffset:${$e};`;m&&(Me+=`opacity:${L==="reverse"?1:0};`,x+=`opacity:${L==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${Me}}to{${x}}}.${T}{view-timeline-name:${ce};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${pt};animation-fill-mode:both;animation-timeline:${ce};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(T);function ue(b,ee){b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`,b.style.strokeDashoffset="",b.style.opacity="",b.style.animationPlayState="",b.classList.add(c);}B.forEach(ue);let S=false,_=-1;function Y(){if(_>=0)return _;let b=e.getBoundingClientRect(),{tStart:ee,tEnd:Ae}=ye({top:b.top,height:b.height},nt(),mt(),Pe,He);return Te(Z(nt(),ee,Ae,u))}return {destroy(){e.classList.remove(T),B.forEach(b=>{b.classList.remove(c),b.style.removeProperty("--ssd-len"),b.style.animationPlayState="";}),D.remove();},replay(){S=false,_=-1,B.forEach(ue);},pause(){S=true,B.forEach(b=>{b.style.animationPlayState="paused";});},resume(){S&&(S=false,B.forEach(b=>{b.style.animationPlayState="running";}));},seek(b){let ee=Math.min(1,Math.max(0,b));_=ee,S=true,B.forEach((Ae,ge)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=L==="reverse"?`${O[ge]*ee}`:`${O[ge]*(1-ee)}`,m&&(Ae.style.opacity=L==="reverse"?`${1-ee}`:`${ee}`);});},getProgress(){return Y()},refresh(){B.forEach((b,ee)=>{O[ee]=Ve(b),b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`;});}}}if(Nt())return Ht();function zt(){let i=Math.max(1,oe),c=0,T=0,ce=false;function ke(S){let _=true;if(fe){let Y=Math.min(1,Math.max(0,S/i)),b=Te(Y);xe=b,e.style.setProperty("--scroll-draw-progress",String(b)),e.style.clipPath=Le(L==="reverse"?1-b:b),h?.(b),Y<1&&(_=false);}else B.forEach((Y,b)=>{let ee=b*R*i,Ae=Math.min(1,Math.max(0,(S-ee)/i)),ge=Te(Ae);Y.style.strokeDashoffset=L==="reverse"?`${O[b]*ge}`:`${O[b]*(1-ge)}`,m&&(Y.style.opacity=L==="reverse"?`${1-ge}`:`${ge}`),ve&&ie?Y.style.stroke=_e(ve,ie,ge):ie&&(Y.style.stroke=ie),ae!==null&&J!==null?Y.style.strokeWidth=`${ae+(J-ae)*ge}`:J!==null&&(Y.style.strokeWidth=`${J}`),pe!==null&&re!==null?Y.style.fillOpacity=`${pe+(re-pe)*ge}`:re!==null&&(Y.style.fillOpacity=`${re}`),I&&Y.tagName.toLowerCase()==="path"&&l[b]&&Y.setAttribute("d",it(l[b],I,ge)),b===0&&(xe=ge,h?.(ge),e.style.setProperty("--scroll-draw-progress",String(ge))),Ae<1&&(_=false);});if(w){let Y=Math.min(1,Math.max(0,S/i)),b=Te(Y);for(let ee in w){let Ae=parseFloat(ee);b>=Ae&&!Oe.has(Ae)&&(Oe.add(Ae),w[ee]?.());}}return _}function $e(S){if(se)return;let _=S-c;j||(j=true,P?.());let Y=ke(_);if(Y&&!V){V=true,ke(i*(1+Math.max(0,B.length-1)*R)),g?.(),Re<(y==="infinite"?1/0:y??0)&&(Re++,Ie=setTimeout(()=>{c=performance.now(),j=false,V=false,Oe.clear(),je(),X=requestAnimationFrame($e);},G));return}Y||(X=requestAnimationFrame($e));}function Me(){cancelAnimationFrame(X),clearTimeout(Ie),c=performance.now(),T=0,se=false,j=false,V=false,Re=0,ce=true,xe=0,Oe.clear(),je(),X=requestAnimationFrame($e);}let x=new IntersectionObserver(S=>{S.forEach(_=>{_.isIntersecting&&!(te&&V)?Me():!_.isIntersecting&&!te&&!V&&(cancelAnimationFrame(X),clearTimeout(Ie),ce=false);});},{root:we??null,threshold:k,rootMargin:v}),D;function ue(){clearTimeout(D),D=setTimeout(()=>{B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});},150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),H>0?setTimeout(()=>x.observe(e),H):x.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(Ie),x.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(D);},replay(){Re=0,Me();},pause(){se||!ce||(se=true,T=performance.now()-c,cancelAnimationFrame(X));},resume(){se&&(se=false,ce=true,c=performance.now()-T,X=requestAnimationFrame($e));},seek(S){let _=Math.min(1,Math.max(0,S));xe=_,se=true,T=_*i,c=performance.now()-T,cancelAnimationFrame(X),ke(T);},getProgress(){return xe},refresh(){clearTimeout(D),B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});}}}if(U)return zt();ft();function Xe(){if(!K||se)return;let i=performance.now(),c=nt();if(!Fe&&$===false&&c===ct){X=requestAnimationFrame(Xe);return}Fe=false,ct=c;let T=u;if($!==false){let x=i-ut,D=x>0?Math.abs(c-(Ue<0?c:Ue))/x:0;T=u*Math.max(.2,1+D*(typeof $=="number"?$:1)*.04);}Ue=c,ut=i;let ce=F?Ce===-1||c>=Ce?"forward":"reverse":L;Ce=c;let ke=Se-p,$e=true,Me=ke===0?0:(c-p)/ke;if(isNaN(ze)||(ze<=0&&Me>0?d?.():ze>0&&Me<=0&&Ee?.(),ze<1&&Me>=1?z?.():ze>=1&&Me<1&&de?.()),ze=Me,fe){let x=Te(Z(c,p,Se,T));te&&!F&&(le=Math.max(le,x),x=le),xe=x,e.style.setProperty("--scroll-draw-progress",String(x));let D=ce==="reverse"?1-x:x;e.style.clipPath=Le(D),h?.(x),!j&&Z(c,p,Se,T)>0&&(j=true,P?.()),x>=1&&!V?(V=true,g?.(),Re<(y==="infinite"?1/0:y??0)&&(Re++,Ie=setTimeout(()=>{le=-1,j=false,V=false,e.style.clipPath=Le(0);},G))):x<1&&!te&&(V=false),X=requestAnimationFrame(Xe);return}if(B.forEach((x,D)=>{let ue=D*R*ke,S=Te(Z(c,p+ue,Se+ue,T));te&&!F&&(le=Math.max(le,S),S=le),xe=S,x.style.strokeDashoffset=ce==="reverse"?`${O[D]*S}`:`${O[D]*(1-S)}`,m&&(x.style.opacity=ce==="reverse"?`${1-S}`:`${S}`),ve&&ie?x.style.stroke=_e(ve,ie,S):ie&&(x.style.stroke=ie),ae!==null&&J!==null?x.style.strokeWidth=`${ae+(J-ae)*S}`:J!==null&&(x.style.strokeWidth=`${J}`),pe!==null&&re!==null?x.style.fillOpacity=`${pe+(re-pe)*S}`:re!==null&&(x.style.fillOpacity=`${re}`),I&&x.tagName.toLowerCase()==="path"&&l[D]&&x.setAttribute("d",it(l[D],I,S)),D===0&&(h?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&($e=false);}),w){let x=Te(Z(c,p,Se,T));for(let D in w){let ue=parseFloat(D);x>=ue&&!Oe.has(ue)&&(Oe.add(ue),w[D]?.());}}!j&&Z(c,p,Se,T)>0&&(j=true,P?.()),$e&&!V?(V=true,g?.(),Re<(y==="infinite"?1/0:y??0)&&(Re++,Ie=setTimeout(()=>{le=-1,j=false,V=false,Oe.clear(),je(),Fe=true;},G))):!$e&&!te&&(V=false),X=requestAnimationFrame(Xe);}let ot=false;function Ye(){ot||(ot=true,X=requestAnimationFrame(function(){Xe();}));}function Qe(){ot=false,cancelAnimationFrame(X);}let st=new IntersectionObserver(i=>{i.forEach(c=>{K=c.isIntersecting,K&&!se?(Fe=true,Ye()):Qe();});},{root:we??null,threshold:k,rootMargin:v});function dt(){B.forEach((i,c)=>{O[c]=Ve(i),i.style.strokeDasharray=`${O[c]}`;}),ft(),Fe=true;}let Ze;function qe(){clearTimeout(Ze),Ze=setTimeout(dt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),H>0?setTimeout(()=>st.observe(e),H):st.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(Ie),Qe(),st.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Ze),lt();},replay(){le=-1,Ce=-1,Ue=-1,j=false,V=false,Re=0,se=false,xe=0,Oe.clear(),clearTimeout(Ie),je(),Fe=true,K&&Ye();},pause(){se=true,Qe();},resume(){se&&(se=false,Fe=true,K&&Ye());},seek(i){let c=Math.min(1,Math.max(0,i));xe=c,le=c,se=true,Qe(),Dt(c,L),Fe=true;},getProgress(){return xe},refresh(){clearTimeout(Ze),dt(),K&&!se&&Ye();}}}var Tt=new Map;function De(e,n){Tt.set(e,n);}function Ne(e){Tt.delete(e);}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function xt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let s=[],o=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),o.push(m?m[2]:"");}n.push({fn:t[1],nums:s,units:o});}return n}function Kt(e,n,r){let t=xt(e),s=xt(n);return t.length===0||t.length!==s.length?r<1?e:n:t.map((o,a)=>{let u=s[a];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((m,f)=>`${m}${o.units[f]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,f)=>`${m}${u.units[f]}`).join(", ")})`:`${o.fn}(${o.nums.map((m,f)=>`${m+(u.nums[f]-m)*r}${o.units[f]}`).join(", ")})`}).join(" ")}function At(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),s=String(n);if(Jt(t))return _e(t,s,r);if(t.includes("("))return Kt(t,s,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(o&&a){let u=parseFloat(o[1]),m=parseFloat(a[1]);return `${u+(m-u)*r}${o[2]||a[2]}`}return r<1?t:s}function er(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var tr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),rr=0,Mt="--scroll-draw-progress";function nr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:s={},easing:o="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:f,native:E=true,velocityScale:R=false,respectReducedMotion:L=true,triggerElement:te,onProgress:be,onComplete:N,onEnter:q,onLeave:F,onEnterBack:H,onLeaveBack:M}=n,C=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof o=="function"?o:Q[o]??Q["ease-out"],w=ne(s.start??"top bottom"),$=ne(s.end??"bottom top"),k=te??e,v=typeof f=="string"?document.querySelector(f):f??null,y=Object.entries(t).map(([l,p])=>({prop:er(l),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function G(){let l=window.getComputedStyle(e);for(let p of y)p.from===""&&(p.from=l.getPropertyValue(p.prop).trim()||"0");}function I(){for(let l of y)e.style.setProperty(l.prop,String(l.to));}let W=new Map;for(let l of [...y.map(p=>p.prop),Mt])W.set(l,e.style.getPropertyValue(l));function U(){for(let[l,p]of W)p?e.style.setProperty(l,p):e.style.removeProperty(l);}if(C)return I(),N?.(),{...r,destroy:U,getProgress:()=>1};G();let oe=typeof o=="string"?et(o):null;function me(){if(!E||!nr()||!oe||m!=="y"||v||k!==e||u||a!==1||be||N||q||F||H||M||R!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let l of y)if(!tr.has(l.prop))return false;return true}function h(){let l=`ssd-a-${++rr}`,p=y.map(K=>`${K.prop}:${K.from}`).join(";"),Se=y.map(K=>`${K.prop}:${K.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${l}{from{${p}}to{${Se}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(l);let j=()=>m==="x"?window.scrollX:window.scrollY,X=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(l),V.remove(),e.style.animationPlayState="",U();},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(K){let le=Math.min(1,Math.max(0,K));e.classList.remove(l);for(let Ce of y)e.style.setProperty(Ce.prop,At(Ce.from,Ce.to,le));},getProgress(){let K=e.getBoundingClientRect(),le=j(),Ce=X(),{tStart:se,tEnd:xe}=ye({top:K.top,height:K.height},le,Ce,w,$);return A(Z(le,se,xe,a))}}}if(me())return h();let P=0,g=0,d=0,z=false,de=false,Ee=-1,fe=0,Te=false,Pe=NaN,He=-1,we=0,ve=()=>v?m==="x"?v.scrollLeft:v.scrollTop:m==="x"?window.scrollX:window.scrollY,ie=()=>v?m==="x"?v.clientWidth:v.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ae(){let l=Je(k,v,m),p=ye(l,l.scroll,ie(),w,$);P=p.tStart,g=p.tEnd;}function J(l){e.style.setProperty(Mt,String(l));for(let p of y)e.style.setProperty(p.prop,At(p.from,p.to,l));be?.(l);}function pe(l){if(isNaN(Pe)){Pe=l;return}Pe<=0&&l>0?q?.():Pe>0&&l<=0&&M?.(),Pe<1&&l>=1?F?.():Pe>=1&&l<1&&H?.(),Pe=l;}function re(){if(!z||de)return;let l=performance.now(),p=ve(),Se=a;if(R!==false){let X=l-we,K=X>0?Math.abs(p-(He<0?p:He))/X:0;Se=a*Math.max(.2,1+K*(typeof R=="number"?R:1)*.04);}He=p,we=l;let V=g===P?0:(p-P)/(g-P);pe(V);let j=A(Z(p,P,g,Se));u&&(Ee=Math.max(Ee,j),j=Ee),fe=j,J(j),j>=1&&!Te?(Te=true,N?.()):j<1&&!u&&(Te=false),d=requestAnimationFrame(re);}ae(),g===P&&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=A(Z(ve(),P,g,a));u&&l>0&&(Ee=l),fe=l,J(l);}let Le=new IntersectionObserver(l=>{l.forEach(p=>{z=p.isIntersecting,z&&!de?d=requestAnimationFrame(re):cancelAnimationFrame(d);});},{root:v??null}),B;function O(){clearTimeout(B),B=setTimeout(ae,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Le.observe(e),De(e,{type:"animate",getProgress:()=>fe,getTrigger:()=>({tStart:P,tEnd:g})}),{destroy(){cancelAnimationFrame(d),Le.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(B),U(),Ne(e);},replay(){Ee=-1,Te=false,fe=0,de=false,J(0);},pause(){de=true,cancelAnimationFrame(d);},resume(){de&&(de=false,z&&(d=requestAnimationFrame(re)));},seek(l){let p=Math.min(1,Math.max(0,l));fe=p,Ee=p,de=true,cancelAnimationFrame(d),J(p);},getProgress(){return fe}}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Lt(e,n){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollCounter: element not found:",e),at;let t=r,{from:s=0,to:o,format:a,easing:u="ease-out",trigger:m={},once:f=true,decimals:E,onComplete:R}=n,L=E!==void 0?h=>h.toFixed(E):a??(h=>String(Math.round(h))),te=typeof u=="function"?u:Q[u]??Q["ease-out"],be=ne(m.start??"top 80%"),N=ne(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(o),R?.(),at;let F=0,H=0,M=0,C=false,A=false,w=-1,$=0,k=false,v=()=>window.scrollY,y=()=>window.innerHeight;function G(){let h=t.getBoundingClientRect(),P=ye({top:h.top,height:h.height},v(),y(),be,N);F=P.tStart,H=P.tEnd;}function I(h){t.textContent=L(s+(o-s)*h),t.style.setProperty("--scroll-draw-progress",String(h));}function W(){if(!C||A)return;let h=te(Z(v(),F,H,1));f&&(w=Math.max(w,h),h=w),$=h,I(h),h>=1&&!k?(k=true,R?.()):h<1&&!f&&(k=false),M=requestAnimationFrame(W);}G();{let h=te(Z(v(),F,H,1));f&&h>0&&(w=h),$=h,I(h);}let U=new IntersectionObserver(h=>{h.forEach(P=>{C=P.isIntersecting,C&&!A?M=requestAnimationFrame(W):cancelAnimationFrame(M);});}),oe;function me(){clearTimeout(oe),oe=setTimeout(G,150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),U.observe(t),De(t,{type:"counter",getProgress:()=>$,getTrigger:()=>({tStart:F,tEnd:H})}),{destroy(){cancelAnimationFrame(M),U.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(oe),Ne(t);},replay(){w=-1,k=false,$=0,A=false,I(0);},pause(){A=true,cancelAnimationFrame(M);},resume(){A&&(A=false,C&&(M=requestAnimationFrame(W)));},seek(h){let P=Math.min(1,Math.max(0,h));$=P,w=P,A=true,cancelAnimationFrame(M),I(P);},getProgress(){return $}}}var Ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function $t(e,n={}){if(typeof window>"u")return Ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return he("scrollVideo: <video> element not found:",e),Ct;let t=r,{trigger:s={},easing:o="linear",once:a=false,axis:u="y",preload:m="auto",onReady:f,onComplete:E,onProgress:R}=n,L=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof o=="function"?o:Q[o]??Q.linear,be=ne(s.start??"top top"),N=ne(s.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let q=n.from??0,F=n.to,H=0,M=0,C=0,A=false,w=false,$=-1,k=0,v=false,y=false,G=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function W(){let d=t.getBoundingClientRect(),z=u==="x"?d.left:d.top,de=u==="x"?d.width:d.height,Ee=ye({top:z,height:de},G(),I(),be,N);H=Ee.tStart,M=Ee.tEnd;}function U(d){if(!y)return;let z=F??t.duration??0;t.currentTime=q+(z-q)*d,t.style.setProperty("--scroll-draw-progress",String(d)),R?.(d);}function oe(){if(!A||w||!y)return;let d=te(Z(G(),H,M,1));a&&($=Math.max($,d),d=$),k=d,U(d),d>=1&&!v?(v=true,E?.()):d<1&&!a&&(v=false),C=requestAnimationFrame(oe);}function me(){if(y=true,F===void 0&&(F=t.duration),L){U(1),f?.();return}W(),f?.(),A&&!w&&(C=requestAnimationFrame(oe));}t.readyState>=1?me():t.addEventListener("loadedmetadata",me,{once:true}),y||W();let h=new IntersectionObserver(d=>{d.forEach(z=>{A=z.isIntersecting,A&&!w&&y?C=requestAnimationFrame(oe):cancelAnimationFrame(C);});}),P;function g(){clearTimeout(P),P=setTimeout(W,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),h.observe(t),De(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:H,tEnd:M})}),{destroy(){cancelAnimationFrame(C),h.disconnect(),t.removeEventListener("loadedmetadata",me),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(P),Ne(t);},replay(){$=-1,v=false,k=0,w=false,U(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,A&&y&&(C=requestAnimationFrame(oe)));},seek(d){let z=Math.min(1,Math.max(0,d));k=z,$=z,w=true,cancelAnimationFrame(C),U(z);},getProgress(){return k}}}function It(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function or(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Rt(e){let n=It(e),r=new Map;for(let o of n){let a=o.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(o);}let t=[],s=Array.from(r.keys()).sort((o,a)=>o-a);for(let o of s){let a=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",a.forEach((m,f)=>{let E=m.nextElementSibling;u.appendChild(m),f<a.length-1&&E&&E.style.whiteSpace==="pre"&&u.appendChild(E);}),t.push(u);}return e.textContent="",t.forEach((o,a)=>{e.appendChild(o),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function sr(e,n,r,t){if(r<=1||t===0)return e;let s=(r-1)*t,o=n*t,a=o+(1-s);return a<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(a-o)))}function ir(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ot(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollText: element not found:",e),kt;let t=r,{split:s="words",stagger:o=.04,easing:a="ease-out",from:u={opacity:0,y:24},trigger:m={},once:f=true,onComplete:E}=n,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof a=="function"?a:Q[a]??Q["ease-out"],te=ne(m.start??"top 85%"),be=ne(m.end??"top 40%"),N=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let q;s==="chars"?q=or(t):s==="lines"?q=Rt(t):q=It(t);let F=q.length;function H(g,d){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*d));let z=ir(d,u);z&&(g.style.transform=z);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),q.forEach((d,z)=>{let de=L(sr(g,z,F,o));H(d,de);});}if(R)return M(1),E?.(),{destroy(){t.innerHTML=N,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let C=0,A=0,w=0,$=false,k=false,v=-1,y=0,G=false,I=()=>window.scrollY,W=()=>window.innerHeight;function U(){let g=t.getBoundingClientRect(),d=ye({top:g.top,height:g.height},I(),W(),te,be);C=d.tStart,A=d.tEnd;}function oe(){if(!$||k)return;let g=Z(I(),C,A,1);f&&(v=Math.max(v,g),g=v),y=g,M(g),g>=1&&!G?(G=true,E?.()):g<1&&!f&&(G=false),w=requestAnimationFrame(oe);}U();let me=new IntersectionObserver(g=>{g.forEach(d=>{$=d.isIntersecting,$&&!k?w=requestAnimationFrame(oe):cancelAnimationFrame(w);});}),h;function P(){clearTimeout(h),h=setTimeout(()=>{if(s==="lines"){let g=y;t.innerHTML=N,t.setAttribute("aria-label",t.textContent??""),q=Rt(t),M(g);}U();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),me.observe(t),De(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:C,tEnd:A})}),{destroy(){cancelAnimationFrame(w),me.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(h),t.innerHTML=N,t.removeAttribute("aria-label"),Ne(t);},replay(){v=-1,G=false,y=0,k=false,M(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,$&&(w=requestAnimationFrame(oe)));},seek(g){let d=Math.min(1,Math.max(0,g));y=d,v=d,k=true,cancelAnimationFrame(w),M(d);},getProgress(){return y}}}function cr(e,n={}){let[r,t]=ur.useState(0),s=ur.useRef(n);s.current=n;let o=ur.useRef(-1);return ur.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let a=typeof e=="string"?document.querySelector(e):e.current;if(!a)return;let u=a,{axis:m="y",scrollContainer:f,trigger:E={}}=s.current,R=typeof f=="string"?document.querySelector(f):f??null,L=ne(E.start??"top bottom"),te=ne(E.end??"bottom top"),be=0,N=0,q=false,F=0;function H(){return R?m==="x"?R.scrollLeft:R.scrollTop:m==="x"?window.scrollX:window.scrollY}function M(){return R?m==="x"?R.clientWidth:R.clientHeight:m==="x"?window.innerWidth:window.innerHeight}function C(){let v=u.getBoundingClientRect(),y=H(),G=m==="x"?v.left:v.top,I=m==="x"?v.width:v.height,W=ye({top:G,height:I},y,M(),L,te);be=W.tStart,N=W.tEnd;}function A(){if(!q)return;let{speed:v=1,easing:y="linear",once:G=false}=s.current,I=typeof y=="function"?y:Q[y]??Q.linear,W=Z(H(),be,N,v),U=I(W);G&&(o.current=Math.max(o.current,U),U=o.current),t(U),F=requestAnimationFrame(A);}let w=new IntersectionObserver(v=>{v.forEach(y=>{q=y.isIntersecting,q?F=requestAnimationFrame(A):cancelAnimationFrame(F);});},{root:R??null,threshold:0});C(),w.observe(u);let $;function k(){clearTimeout($),$=setTimeout(C,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),()=>{cancelAnimationFrame(F),clearTimeout($),w.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k);}},[]),r}function Xr({children:e,className:n,style:r,...t}){let s=ur.useRef(null);return ur.useEffect(()=>{if(!s.current)return;let o=Et(s.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:s,className:n,style:r,children:e})}function Yr({children:e,className:n,style:r,...t}){let s=ur.useRef(null);return ur.useEffect(()=>{if(!s.current)return;let o=Pt(s.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:s,className:n,style:r,children:e})}function Qr({className:e,style:n,...r}){let t=ur.useRef(null);return ur.useEffect(()=>{if(!t.current)return;let s=Lt(t.current,r);return ()=>s.destroy()},[]),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function Zr({src:e,className:n,style:r,muted:t=true,playsInline:s=true,...o}){let a=ur.useRef(null);return ur.useEffect(()=>{if(!a.current)return;let u=$t(a.current,o);return ()=>u.destroy()},[]),jsxRuntime.jsx("video",{ref:a,src:e,className:n,style:r,muted:t,playsInline:s,preload:"auto"})}function Jr({children:e,as:n="p",className:r,style:t,...s}){let o=ur.useRef(null);return ur.useEffect(()=>{if(!o.current)return;let a=Ot(o.current,s);return ()=>a.destroy()},[]),ur__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=Yr;exports.ScrollCounter=Qr;exports.ScrollDraw=Xr;exports.ScrollText=Jr;exports.ScrollVideo=Zr;exports.useScrollDrawProgress=cr;
@@ -126,6 +126,39 @@ interface ScrollAnimateOptions {
126
126
  axis?: 'x' | 'y';
127
127
  scrollContainer?: string | Element;
128
128
  native?: boolean;
129
+ /**
130
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
131
+ * Pass `true` for default sensitivity (1) or a number to control it.
132
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
133
+ */
134
+ velocityScale?: boolean | number;
135
+ /**
136
+ * Honour `prefers-reduced-motion: reduce` by applying the final state and not
137
+ * animating. Default: `true`.
138
+ *
139
+ * Set to `false` only when the movement is *scroll-linked scrubbing* rather
140
+ * than autonomous motion — it advances solely as the user scrolls, 1:1 with
141
+ * their input, so it is direct manipulation rather than something that plays at
142
+ * them. `scrollHorizontal` sets this, because jumping to the final state there
143
+ * would leave every panel but the last unreachable inside the sticky
144
+ * `overflow: hidden` container.
145
+ */
146
+ respectReducedMotion?: boolean;
147
+ /**
148
+ * Element whose geometry defines the trigger window, when that is not the
149
+ * element being animated. Defaults to the animated element.
150
+ *
151
+ * Needed whenever the animated element cannot supply the scroll length itself —
152
+ * the case that matters is a `position: sticky` stage, where the pinned element
153
+ * is exactly one viewport tall and all of the scroll room belongs to its
154
+ * container. Resolving `top top` → `bottom bottom` against the pinned element
155
+ * there yields tStart === tEnd, a zero-length window, and no movement at all.
156
+ *
157
+ * Setting this disables the native CSS fast path: `animation-timeline: view()`
158
+ * always measures the element the animation is attached to, so it cannot express
159
+ * a separate subject.
160
+ */
161
+ triggerElement?: Element;
129
162
  onProgress?: (alpha: number) => void;
130
163
  onComplete?: () => void;
131
164
  /** Fires when scroll enters the trigger zone (scrolling forward). */
@@ -126,6 +126,39 @@ interface ScrollAnimateOptions {
126
126
  axis?: 'x' | 'y';
127
127
  scrollContainer?: string | Element;
128
128
  native?: boolean;
129
+ /**
130
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
131
+ * Pass `true` for default sensitivity (1) or a number to control it.
132
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
133
+ */
134
+ velocityScale?: boolean | number;
135
+ /**
136
+ * Honour `prefers-reduced-motion: reduce` by applying the final state and not
137
+ * animating. Default: `true`.
138
+ *
139
+ * Set to `false` only when the movement is *scroll-linked scrubbing* rather
140
+ * than autonomous motion — it advances solely as the user scrolls, 1:1 with
141
+ * their input, so it is direct manipulation rather than something that plays at
142
+ * them. `scrollHorizontal` sets this, because jumping to the final state there
143
+ * would leave every panel but the last unreachable inside the sticky
144
+ * `overflow: hidden` container.
145
+ */
146
+ respectReducedMotion?: boolean;
147
+ /**
148
+ * Element whose geometry defines the trigger window, when that is not the
149
+ * element being animated. Defaults to the animated element.
150
+ *
151
+ * Needed whenever the animated element cannot supply the scroll length itself —
152
+ * the case that matters is a `position: sticky` stage, where the pinned element
153
+ * is exactly one viewport tall and all of the scroll room belongs to its
154
+ * container. Resolving `top top` → `bottom bottom` against the pinned element
155
+ * there yields tStart === tEnd, a zero-length window, and no movement at all.
156
+ *
157
+ * Setting this disables the native CSS fast path: `animation-timeline: view()`
158
+ * always measures the element the animation is attached to, so it cannot express
159
+ * a separate subject.
160
+ */
161
+ triggerElement?: Element;
129
162
  onProgress?: (alpha: number) => void;
130
163
  onComplete?: () => void;
131
164
  /** Fires when scroll enters the trigger zone (scrolling forward). */