svg-scroll-draw 2.23.0 → 2.23.3

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 (54) hide show
  1. package/README.md +16 -13
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.mjs +1 -1
  4. package/dist/astro/index.cjs +3 -3
  5. package/dist/astro/index.mjs +1 -1
  6. package/dist/cdn/svg-scroll-draw.dev.global.js +77 -118
  7. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  8. package/dist/chunk-23EALNDF.mjs +3 -0
  9. package/dist/{chunk-DY5JCXVR.mjs → chunk-4H2SGMAQ.mjs} +1 -1
  10. package/dist/{chunk-VMUJMXKO.mjs → chunk-4I7MLTP5.mjs} +1 -1
  11. package/dist/{chunk-OTDD2ROH.mjs → chunk-BLY6F6EC.mjs} +1 -1
  12. package/dist/{chunk-GVBO5GRD.mjs → chunk-ETACBG7W.mjs} +1 -1
  13. package/dist/chunk-GMBIGV3M.mjs +1 -0
  14. package/dist/chunk-LGJQWZHH.mjs +1 -0
  15. package/dist/chunk-UPWWULKI.mjs +1 -0
  16. package/dist/chunk-V4L3ELVC.mjs +1 -0
  17. package/dist/group/index.cjs +3 -3
  18. package/dist/group/index.d.mts +4 -2
  19. package/dist/group/index.d.ts +4 -2
  20. package/dist/group/index.mjs +1 -1
  21. package/dist/horizontal/index.cjs +1 -1
  22. package/dist/horizontal/index.mjs +1 -1
  23. package/dist/index.cjs +3 -3
  24. package/dist/index.d.mts +3 -2
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.mjs +1 -1
  27. package/dist/nuxt/index.cjs +3 -3
  28. package/dist/nuxt/index.mjs +1 -1
  29. package/dist/progress/index.cjs +1 -1
  30. package/dist/progress/index.mjs +1 -1
  31. package/dist/react/index.cjs +3 -3
  32. package/dist/react/index.mjs +1 -1
  33. package/dist/reveal/index.cjs +1 -1
  34. package/dist/reveal/index.mjs +1 -1
  35. package/dist/solid/index.cjs +2 -2
  36. package/dist/solid/index.mjs +1 -1
  37. package/dist/svelte/index.cjs +2 -2
  38. package/dist/svelte/index.mjs +1 -1
  39. package/dist/text/index.cjs +1 -1
  40. package/dist/text/index.mjs +1 -1
  41. package/dist/timeline/index.cjs +1 -1
  42. package/dist/timeline/index.mjs +1 -1
  43. package/dist/video/index.cjs +1 -1
  44. package/dist/video/index.mjs +1 -1
  45. package/dist/vue/index.cjs +3 -3
  46. package/dist/vue/index.mjs +1 -1
  47. package/dist/web-component/index.cjs +3 -3
  48. package/dist/web-component/index.mjs +1 -1
  49. package/package.json +1 -1
  50. package/dist/chunk-HX4SP5WN.mjs +0 -3
  51. package/dist/chunk-KV3WCPQ5.mjs +0 -1
  52. package/dist/chunk-LTCJVVSC.mjs +0 -1
  53. package/dist/chunk-WXUOF4NM.mjs +0 -1
  54. package/dist/chunk-YWKPTYSG.mjs +0 -1
@@ -0,0 +1,3 @@
1
+ import {b as b$1,a as a$6}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a as a$2}from'./chunk-YZV4Z3EQ.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$3}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$5,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$4}from'./chunk-LFSU6LR3.mjs';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 Ft=0;function Nt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Et(r,y){let u="";try{u=getComputedStyle(r).getPropertyValue(y).trim();}catch{}return u||(r.getAttribute(y)??"").trim()}var Tt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ht(r){if(!a$4)return;let y=Et(r,"stroke");if(!y||y==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let u=(r.getAttribute("fill")??"").trim();u&&!Tt.has(u)&&!Tt.has(Et(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function It(r,y,u){let h=document.createElement("div");h.setAttribute("data-svg-scroll-draw-debug",""),h.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 A(){let F=u==="x"?window.scrollX:window.scrollY,P=r-F,D=y-F,N=u==="x";h.innerHTML=`
2
+ <div style="position:absolute;${N?`left:${P}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${P}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;${N?`left:${D}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${D}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(h),window.addEventListener("scroll",A,{passive:true}),A(),{el:h,destroy(){window.removeEventListener("scroll",A),h.remove();}}}var St=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,$t=/[MmLlHhVvCcSsQqTtAaZz]/g;function Rt(r,y,u){if(!a$4)return;let h=(r.match($t)??[]).join("").toUpperCase(),A=(y.match($t)??[]).join("").toUpperCase(),F=(r.match(St)??[]).length,P=(y.match(St)??[]).length;if(h!==A){b(`morphTo: command sequence differs (${h||"\u2205"} \u2192 ${A||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,u);return}F!==P&&b(`morphTo: coordinate count differs (${F} \u2192 ${P}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,u);}function zt(r,y,u){let h=(y.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),A=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,F=>{let P=parseFloat(F),D=h[A++]??P;return String(+(P+(D-P)*u).toFixed(4))})}function Kt(r,y={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(y,(u,h)=>Vt(r,u,h))}function Vt(r,y,u){let{preset:h,...A}=y,F=h?{...bt[h],...A}:A,{selector:P="path, polyline, line, polygon, rect, circle",speed:D=1,fade:N=false,easing:me="linear",trigger:Ee={},stagger:U=0,direction:d$2="forward",once:te=false,debug:_e=false,axis:z="y",scrollContainer:De,autoReverse:Ce=false,delay:pe=0,strokeColor:j,strokeWidth:X,fillOpacity:Y,waypoints:Q,velocityScale:de=false,threshold:Ue=0,rootMargin:je="0px",repeat:Z=0,repeatDelay:Oe=0,morphTo:V,clip:Fe,autoplay:Xe=false,duration:kt=1e3,native:xt=true,onProgress:ye,onStart:Te,onComplete:he,onEnter:Ye,onLeave:Qe,onEnterBack:Ze,onLeaveBack:Je}=F,C=Fe===true?"left":typeof Fe=="string"?Fe:false,W=typeof me=="function"?me:d[me]??d.linear,Ke=a$1(Ee.start||"top bottom"),et=a$1(Ee.end||"bottom top"),L=typeof De=="string"?document.querySelector(De):De??null,re=Array.isArray(j)?j[0]:null,se=Array.isArray(j)?j[1]:typeof j=="string"?j:null,J=Array.isArray(X)?X[0]:null,ne=Array.isArray(X)?X[1]:typeof X=="number"?X:null,K=Array.isArray(Y)?Y[0]:null,oe=Array.isArray(Y)?Y[1]:typeof Y=="number"?Y:null;function ie(e){let t=e*100;switch(C){case "right":return `inset(0 0 0 ${100-t}%)`;case "top":return `inset(0 0 ${100-t}% 0)`;case "bottom":return `inset(${100-t}% 0 0 0)`;case "center":return `circle(${e*150}% at 50% 50%)`;default:return `inset(0 ${100-t}% 0 0)`}}let m=C?[]:Array.from(r.querySelectorAll(P)),p=[],q=[],k=0,x=0,Se=U,tt=0,E=false,M=false,T=0,$e=false,ge=-1,ae=[],ke=-1,g=false,O=0,H=0,G,Ne=null;function rt(){Ne?.destroy(),Ne=null;}let B=new Set,st=NaN,_=true,xe=-1,nt=performance.now(),le=NaN;function ve(){return L?z==="x"?L.scrollLeft:L.scrollTop:z==="x"?window.scrollX:window.scrollY}function ot(){return L?z==="x"?L.clientWidth:L.clientHeight:z==="x"?window.innerWidth:window.innerHeight}function it(){let e=a$3(r,L,z);return c(e,e.scroll,ot(),Ke,et)}function At(){let e=x-k,t=m.length-1,s=L??document.documentElement,a=z==="x"?"Width":"Height";if(Se=U,U>0&&t>0&&e>0){let S=s[`scroll${a}`]-s[`client${a}`]-1-k-e/D;S>=0&&(Se=Math.min(U,S/(t*e)));}tt=x+t*Se*e;}function at(){(({tStart:k,tEnd:x}=it())),At(),_e&&a$4&&(rt(),Ne=It(k,x,z));}function He(e,t=it){a$5(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let s=e.destroy;return e.destroy=()=>{s.call(e),b$2(r);},e}function lt(e,t){return te&&!Ce?Math.max(ge,W(ae[e]=Math.max(ae[e]??0,t))):W(t)}function Pt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),C){let s=t==="reverse"?1-e:e;r.style.clipPath=ie(s);return}m.forEach((s,a)=>Ie(s,a,e,t));}function Ie(e,t,s,a){e.style.strokeDashoffset=a==="reverse"?`${p[t]*s}`:`${p[t]*(1-s)}`,N&&(e.style.opacity=a==="reverse"?`${1-s}`:`${s}`),re&&se?e.style.stroke=a$6(re,se,s):se&&(e.style.stroke=se),J!==null&&ne!==null?e.style.strokeWidth=`${J+(ne-J)*s}`:ne!==null&&(e.style.strokeWidth=`${ne}`),K!==null&&oe!==null?e.style.fillOpacity=`${K+(oe-K)*s}`:oe!==null&&(e.style.fillOpacity=`${oe}`),V&&e.tagName.toLowerCase()==="path"&&q[t]&&e.setAttribute("d",zt(q[t],V,s));}function we(){if(r.style.setProperty("--scroll-draw-progress","0"),C){r.style.clipPath=ie(d$2==="reverse"?1:0);return}m.forEach((e,t)=>{e.style.strokeDasharray=`${p[t]}`,e.style.strokeDashoffset=d$2==="reverse"?"0":`${p[t]}`,N?e.style.opacity=d$2==="reverse"?"1":"0":e.style.opacity="",re&&(e.style.stroke=re),J!==null&&(e.style.strokeWidth=`${J}`),K!==null&&(e.style.fillOpacity=`${K}`),V&&e.tagName.toLowerCase()==="path"&&q[t]&&e.setAttribute("d",q[t]);});}if(m.forEach(e=>{Ht(e);let t=a$2(e);p.push(t);let s=e.tagName.toLowerCase()==="path";s?q.push(e.getAttribute("d")??""):q.push(""),V&&(s?Rt(q[q.length-1],V,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),u?(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=d$2==="reverse"?`${t}`:"0",N&&(e.style.opacity="1"),se&&(e.style.stroke=se),ne!==null&&(e.style.strokeWidth=`${ne}`),oe!==null&&(e.style.fillOpacity=`${oe}`),V&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",V)):(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=d$2==="reverse"?"0":`${t}`,N?e.style.opacity=d$2==="reverse"?"1":"0":e.style.opacity="",re&&(e.style.stroke=re),J!==null&&(e.style.strokeWidth=`${J}`),K!==null&&(e.style.fillOpacity=`${K}`));}),u)return C&&(r.style.clipPath=ie(1)),he?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};C&&(r.style.clipPath=ie(d$2==="reverse"?1:0));let ft=typeof me=="string"?b$1(me):null;function Lt(){return !(xt===false||Xe||_e||!Nt()||!m.length||!ft||C||z!=="y"||L||D!==1||U!==0||te||Ce||de!==false||V||Q||Z||pe>0||ye||Te||he||Ye||Qe||Ze||Je||j!=null||X!=null||Y!=null||(Ee.start||"top bottom").trim()!=="top bottom"||(Ee.end||"bottom top").trim()!=="bottom top")}function Mt(){let e=++Ft,t=`svg-scroll-draw-${e}`,s=`svg-scroll-draw-host-${e}`,a=`--svg-scroll-draw-${e}`,S=d$2==="reverse"?"0":"var(--ssd-len)",I=d$2==="reverse"?"var(--ssd-len)":"0",$=`stroke-dashoffset:${S};`,i=`stroke-dashoffset:${I};`;N&&($+=`opacity:${d$2==="reverse"?1:0};`,i+=`opacity:${d$2==="reverse"?0:1};`);let l=document.createElement("style");l.setAttribute("data-svg-scroll-draw",""),l.textContent=`@keyframes ${t}{from{${$}}to{${i}}}.${s}{view-timeline-name:${a};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${ft};animation-fill-mode:both;animation-timeline:${a};animation-range:cover 0% cover 100%;}`,document.head.appendChild(l),r.classList.add(s);function v(n,o){n.style.setProperty("--ssd-len",String(p[o])),n.style.strokeDasharray=`${p[o]}`,n.style.strokeDashoffset="",n.style.opacity="",n.style.animationPlayState="",n.classList.add(t);}m.forEach(v);let w=false,f=-1;function c$1(){if(f>=0)return f;let n=r.getBoundingClientRect(),{tStart:o,tEnd:b}=c({top:n.top,height:n.height},ve(),ot(),Ke,et);return W(b$3(ve(),o,b,D))}return {destroy(){r.classList.remove(s),m.forEach(n=>{n.classList.remove(t),n.style.removeProperty("--ssd-len"),n.style.animationPlayState="";}),l.remove();},replay(){w=false,f=-1,m.forEach(v);},pause(){w=true,m.forEach(n=>{n.style.animationPlayState="paused";});},resume(){w&&(w=false,m.forEach(n=>{n.style.animationPlayState="running";}));},seek(n){let o=Math.min(1,Math.max(0,n));f=o,w=true,m.forEach((b,R)=>{b.classList.remove(t),b.style.strokeDashoffset=d$2==="reverse"?`${p[R]*o}`:`${p[R]*(1-o)}`,N&&(b.style.opacity=d$2==="reverse"?`${1-o}`:`${o}`);});},getProgress(){return c$1()},refresh(){m.forEach((n,o)=>{p[o]=a$2(n),n.style.setProperty("--ssd-len",String(p[o])),n.style.strokeDasharray=`${p[o]}`;});}}}if(Lt())return He(Mt());function Dt(){let e=Math.max(1,kt),t=C?e:e*(1+Math.max(0,m.length-1)*U),s=0,a=0,S=false;function I(f){let c=true,n=Math.min(1,Math.max(0,f/t));if(C){let o=Math.min(1,Math.max(0,f/e)),b=W(o);O=b,r.style.setProperty("--scroll-draw-progress",String(b)),r.style.clipPath=ie(d$2==="reverse"?1-b:b),ye?.(b),o<1&&(c=false);}else {m.forEach((b,R)=>{let Ot=R*U*e,mt=Math.min(1,Math.max(0,(f-Ot)/e));Ie(b,R,W(mt),d$2),mt<1&&(c=false);});let o=W(n);O=o,ye?.(o),r.style.setProperty("--scroll-draw-progress",String(o));}if(Q){let o=W(n);for(let b in Q){let R=parseFloat(b);o>=R&&!B.has(R)&&(B.add(R),Q[b]?.());}}return c}function $(f){if(g)return;let c=f-s;M||(M=true,Te?.());let n=I(c);if(n&&!E){E=true,I(t),he?.(),H<(Z==="infinite"?1/0:Z??0)&&(H++,G=setTimeout(()=>{s=performance.now(),M=false,E=false,B.clear(),we(),T=requestAnimationFrame($);},Oe));return}n||(T=requestAnimationFrame($));}function i(){cancelAnimationFrame(T),clearTimeout(G),s=performance.now(),a=0,g=false,M=false,E=false,H=0,S=true,O=0,B.clear(),we(),T=requestAnimationFrame($);}let l=new IntersectionObserver(f=>{f.forEach(c=>{c.isIntersecting&&!(te&&E)?i():!c.isIntersecting&&!te&&!E&&(cancelAnimationFrame(T),clearTimeout(G),S=false);});},{root:L??null,threshold:Ue,rootMargin:je}),v;function w(){clearTimeout(v),v=setTimeout(()=>{m.forEach((f,c)=>{p[c]=a$2(f),f.style.strokeDasharray=`${p[c]}`;});},150);}return window.addEventListener("resize",w),window.addEventListener("orientationchange",w),pe>0?setTimeout(()=>l.observe(r),pe):l.observe(r),{destroy(){cancelAnimationFrame(T),clearTimeout(G),l.disconnect(),window.removeEventListener("resize",w),window.removeEventListener("orientationchange",w),clearTimeout(v);},replay(){H=0,i();},pause(){g||!S||(g=true,a=performance.now()-s,cancelAnimationFrame(T));},resume(){g&&(g=false,S=true,s=performance.now()-a,T=requestAnimationFrame($));},seek(f){let c=Math.min(1,Math.max(0,f));O=c,g=true,a=c*t,s=performance.now()-a,cancelAnimationFrame(T),I(a);},getProgress(){return O},refresh(){clearTimeout(v),m.forEach((f,c)=>{p[c]=a$2(f),f.style.strokeDasharray=`${p[c]}`;});}}}if(Xe)return He(Dt());at();function ct(){if(g||!fe)return;let e=performance.now(),t=ve();if(!_&&de===false&&t===st){ze(t);return}_=false,st=t;let s=D;if(de!==false){let i=e-nt,l=i>0?Math.abs(t-(xe<0?t:xe))/i:0;s=D*Math.max(.2,1+l*(typeof de=="number"?de:1)*.04);}xe=t,nt=e;let a=Ce?ke===-1||t>=ke?"forward":"reverse":d$2;ke=t;let S=x-k,I=true,$=S===0?0:(t-k)/S;if(isNaN(le)||(le<=0&&$>0?Ye?.():le>0&&$<=0&&Je?.(),le<1&&$>=1?Qe?.():le>=1&&$<1&&Ze?.()),le=$,C){let i=lt(0,b$3(t,k,x,s));O=i,r.style.setProperty("--scroll-draw-progress",String(i));let l=a==="reverse"?1-i:i;r.style.clipPath=ie(l),ye?.(i),!M&&b$3(t,k,x,s)>0&&(M=true,Te?.()),i>=1&&!E?(E=true,he?.(),H<(Z==="infinite"?1/0:Z??0)&&(H++,G=setTimeout(()=>{ge=-1,ae=[],M=false,E=false,we();},Oe))):i<1&&!te&&(E=false),ze(t);return}if(m.forEach((i,l)=>{let v=l*Se*S,w=lt(l,b$3(t,k+v,x+v,s));Ie(i,l,w,a),l===0&&(O=w,ye?.(w),r.style.setProperty("--scroll-draw-progress",String(w))),w<1&&(I=false);}),Q){let i=W(b$3(t,k,x,s));for(let l in Q){let v=parseFloat(l);i>=v&&!B.has(v)&&(B.add(v),Q[l]?.());}}!M&&b$3(t,k,x,s)>0&&(M=true,Te?.()),I&&!E?(E=true,he?.(),H<(Z==="infinite"?1/0:Z??0)&&(H++,G=setTimeout(()=>{ge=-1,ae=[],M=false,E=false,B.clear(),we(),_=true;},Oe))):!I&&!te&&(E=false),ze(t);}function Re(e){return e>=x&&e<tt}function ze(e){$e||Re(e)?T=requestAnimationFrame(ct):fe=false;}function Ve(){return $e||Re(ve())}let fe=false;function Ae(){fe||(fe=true,T=requestAnimationFrame(function(){ct();}));}function Pe(){fe=false,cancelAnimationFrame(T);}let We=new IntersectionObserver(e=>{e.forEach(t=>{$e=t.isIntersecting,$e&&!g?(_=true,Ae()):fe&&!g&&Re(ve())||Pe();});},{root:L??null,threshold:Ue,rootMargin:je});function ut(){m.forEach((e,t)=>{p[t]=a$2(e),e.style.strokeDasharray=`${p[t]}`;}),at(),_=true;}let Le;function be(){clearTimeout(Le),Le=setTimeout(ut,150);}window.addEventListener("resize",be),window.addEventListener("orientationchange",be);let Ct=d$1([r],be);return pe>0?setTimeout(()=>We.observe(r),pe):We.observe(r),He({destroy(){cancelAnimationFrame(T),clearTimeout(G),Pe(),We.disconnect(),Ct(),window.removeEventListener("resize",be),window.removeEventListener("orientationchange",be),clearTimeout(Le),rt();},replay(){ge=-1,ae=[],ke=-1,xe=-1,M=false,E=false,H=0,g=false,O=0,B.clear(),clearTimeout(G),we(),_=true,Ve()&&Ae();},pause(){g=true,Pe();},resume(){g&&(g=false,_=true,Ve()&&Ae());},seek(e){let t=Math.min(1,Math.max(0,e));O=t,ge=t,ae=[],g=true,Pe(),Pt(t,d$2),_=true;},getProgress(){return O},refresh(){clearTimeout(Le),ut(),Ve()&&!g&&Ae();}},()=>({tStart:k,tEnd:x}))}export{bt as a,Kt as b};
@@ -1 +1 @@
1
- import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function B(e,r){let t=document.createElement("span");t.textContent=r,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 _(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function Q(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function W(e){let r=_(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],c=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of c){let i=t.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block",i.forEach((g,b)=>{let h=g.nextElementSibling;l.appendChild(g),b<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Z(e,r,t,n){if(t<=1||n===0)return e;let c=(t-1)*n,s=r*n,i=s+(1-c);return i<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(i-s)))}function ee(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var Y={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,r={}){if(typeof window>"u")return Y;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),Y;let n=t;return a(r,(c,s)=>te(n,c,s))}function te(e,r,t){let{split:n="words",stagger:c$1=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:b}=r,h=typeof s=="function"?s:d[s]??d["ease-out"],j=a$1(l.start??"top 85%"),G=a$1(l.end??"top 40%"),S=e.innerHTML,I=e.textContent??"",m;n==="chars"?m=Q(e):n==="lines"?m=W(e):m=_(e),B(e,I);let U=m.length;function V(o,a){i?.opacity!==void 0&&(o.style.opacity=String(i.opacity+(1-i.opacity)*a));let E=ee(a,i);E&&(o.style.transform=E);}function d$2(o){e.style.setProperty("--scroll-draw-progress",String(o)),m.forEach((a,E)=>{let K=h(Z(o,E,U,c$1));V(a,K);});}if(t)return d$2(1),b?.(),{destroy(){e.innerHTML=S;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};d$2(0);let C=0,M=0,p=0,x=false,u=false,y=-1,f=0,w=false,F=()=>window.scrollY,X=()=>window.innerHeight;function P(){let o=e.getBoundingClientRect(),a=c({top:o.top,height:o.height},F(),X(),j,G);C=a.tStart,M=a.tEnd;}function L(){if(!x||u)return;let o=b$2(F(),C,M,1);g&&(y=Math.max(y,o),o=y),f=o,d$2(o),o>=1&&!w?(w=true,b?.()):o<1&&!g&&(w=false),p=requestAnimationFrame(L);}P();let O=new IntersectionObserver(o=>{o.forEach(a=>{x=a.isIntersecting,x&&!u?p=requestAnimationFrame(L):cancelAnimationFrame(p);});}),v;function T(){clearTimeout(v),v=setTimeout(()=>{if(n==="lines"){let o=f;e.innerHTML=S,m=W(e),B(e,I),d$2(o);}P();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let J=d$1([e],T);return O.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(p),O.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),J(),clearTimeout(v),e.innerHTML=S,b$1(e);},replay(){y=-1,w=false,f=0,u=false,d$2(0);},pause(){u=true,cancelAnimationFrame(p);},resume(){u&&(u=false,x&&(p=requestAnimationFrame(L)));},seek(o){let a=Math.min(1,Math.max(0,o));f=a,y=a,u=true,cancelAnimationFrame(p),d$2(a);},getProgress(){return f}}}export{le as a};
1
+ import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function B(e,r){let t=document.createElement("span");t.textContent=r,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 _(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function Q(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function W(e){let r=_(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],c=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of c){let i=t.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block",i.forEach((g,b)=>{let h=g.nextElementSibling;l.appendChild(g),b<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Z(e,r,t,n){if(t<=1||n===0)return e;let c=(t-1)*n,s=r*n,i=s+(1-c);return i<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(i-s)))}function ee(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var Y={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,r={}){if(typeof window>"u")return Y;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),Y;let n=t;return a(r,(c,s)=>te(n,c,s))}function te(e,r,t){let{split:n="words",stagger:c$1=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:b}=r,h=typeof s=="function"?s:d[s]??d["ease-out"],j=a$1(l.start||"top 85%"),G=a$1(l.end||"top 40%"),S=e.innerHTML,I=e.textContent??"",m;n==="chars"?m=Q(e):n==="lines"?m=W(e):m=_(e),B(e,I);let U=m.length;function V(o,a){i?.opacity!==void 0&&(o.style.opacity=String(i.opacity+(1-i.opacity)*a));let E=ee(a,i);E&&(o.style.transform=E);}function d$2(o){e.style.setProperty("--scroll-draw-progress",String(o)),m.forEach((a,E)=>{let K=h(Z(o,E,U,c$1));V(a,K);});}if(t)return d$2(1),b?.(),{destroy(){e.innerHTML=S;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};d$2(0);let C=0,M=0,p=0,x=false,u=false,y=-1,f=0,w=false,F=()=>window.scrollY,X=()=>window.innerHeight;function P(){let o=e.getBoundingClientRect(),a=c({top:o.top,height:o.height},F(),X(),j,G);C=a.tStart,M=a.tEnd;}function L(){if(!x||u)return;let o=b$2(F(),C,M,1);g&&(y=Math.max(y,o),o=y),f=o,d$2(o),o>=1&&!w?(w=true,b?.()):o<1&&!g&&(w=false),p=requestAnimationFrame(L);}P();let O=new IntersectionObserver(o=>{o.forEach(a=>{x=a.isIntersecting,x&&!u?p=requestAnimationFrame(L):cancelAnimationFrame(p);});}),v;function T(){clearTimeout(v),v=setTimeout(()=>{if(n==="lines"){let o=f;e.innerHTML=S,m=W(e),B(e,I),d$2(o);}P();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let J=d$1([e],T);return O.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(p),O.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),J(),clearTimeout(v),e.innerHTML=S,b$1(e);},replay(){y=-1,w=false,f=0,u=false,d$2(0);},pause(){u=true,cancelAnimationFrame(p);},resume(){u&&(u=false,x&&(p=requestAnimationFrame(L)));},seek(o){let a=Math.min(1,Math.max(0,o));f=a,y=a,u=true,cancelAnimationFrame(p),d$2(a);},getProgress(){return f}}}export{le as a};
@@ -1 +1 @@
1
- import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-KV3WCPQ5.mjs';import {a as a$4}from'./chunk-DY5JCXVR.mjs';import {a as a$2}from'./chunk-WXUOF4NM.mjs';import {a as a$1}from'./chunk-LTCJVVSC.mjs';import {b as b$2}from'./chunk-HX4SP5WN.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
1
+ import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-GMBIGV3M.mjs';import {a as a$4}from'./chunk-4H2SGMAQ.mjs';import {a as a$2}from'./chunk-LGJQWZHH.mjs';import {a as a$1}from'./chunk-V4L3ELVC.mjs';import {b as b$2}from'./chunk-23EALNDF.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
@@ -1 +1 @@
1
- import {b}from'./chunk-HX4SP5WN.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
1
+ import {b}from'./chunk-23EALNDF.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-LTCJVVSC.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
1
+ import {a}from'./chunk-V4L3ELVC.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
@@ -0,0 +1 @@
1
+ import {a,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var j={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(m,E={}){if(typeof window>"u")return j;let b$3=typeof m=="string"?document.querySelector(m):m;if(!b$3||b$3.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",m),j;let t=b$3,{trigger:P={},easing:T="linear",once:C=false,axis:u="y",preload:J="auto",triggerElement:K,onReady:I,onComplete:Q,onProgress:U}=E,R=K??t,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches,V=typeof T=="function"?T:d[T]??d.linear,Z=a(P.start||"top top"),$=a(P.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=J);let q=E.from??0,A=E.to,g=0,p=0,o=0,a$3=false,n=false,S=-1,w=0,s=0,v=false,i=false,O=()=>u==="x"?window.scrollX:window.scrollY,ee=()=>u==="x"?window.innerWidth:window.innerHeight;function x(){let e=R.getBoundingClientRect(),r=u==="x"?e.left:e.top,d=u==="x"?e.width:e.height,H=c({top:r,height:d},O(),ee(),Z,$);g=H.tStart,p=H.tEnd,i&&p===g&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let h=NaN;function l(e){if(!i)return;let r=A??t.duration??0,d=q+(r-q)*e;d!==h&&(h=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),U?.(e);}function y(){if(!a$3||n||!i||f)return;let e=b$2(O(),g,p,1),r=C?Math.max(S,V(w=Math.max(w,e))):V(e);s=r,l(r),r>=1&&!v?(v=true,Q?.()):r<1&&!C&&(v=false),o=requestAnimationFrame(y);}function L(){if(i=true,A===void 0&&(A=t.duration),f){l(1),I?.();return}x(),I?.(),a$3&&!n&&(o=requestAnimationFrame(y));}t.readyState>=1?L():t.addEventListener("loadedmetadata",L,{once:true}),i||x();let k=f?()=>{}:a$1(e=>{e&&(k(),f=true,cancelAnimationFrame(o),l(1));}),D=new IntersectionObserver(e=>{e.forEach(r=>{a$3=r.isIntersecting,a$3&&!n&&i?o=requestAnimationFrame(y):cancelAnimationFrame(o);});}),N;function c$1(){clearTimeout(N),N=setTimeout(x,150);}window.addEventListener("resize",c$1),window.addEventListener("orientationchange",c$1);let te=d$1([R],c$1);return D.observe(t),a$2(t,{type:"video",getProgress:()=>s,getTrigger:()=>({tStart:g,tEnd:p})}),{destroy(){cancelAnimationFrame(o),D.disconnect(),t.removeEventListener("loadedmetadata",L),window.removeEventListener("resize",c$1),window.removeEventListener("orientationchange",c$1),te(),k(),clearTimeout(N),b$1(t);},replay(){S=-1,w=0,v=false,s=0,n=false,h=NaN,l(0);},pause(){n=true,cancelAnimationFrame(o);},resume(){n&&(n=false,a$3&&i&&(o=requestAnimationFrame(y)));},seek(e){let r=Math.min(1,Math.max(0,e));s=r,S=r,w=0,n=true,cancelAnimationFrame(o),h=NaN,l(r);},getProgress(){return s}}}export{le as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var F={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function $(r,w){if(typeof window>"u")return F;let m=typeof r=="string"?document.querySelector(r):r;return m?a(w,(l,f)=>j(m,l,f)):(b("scrollCounter: element not found:",r),F)}function j(r,w,m){let{from:l=0,to:f,format:B,easing:h="ease-out",trigger:M={},once:x=true,decimals:I,onComplete:P}=w,z=I!==void 0?e=>e.toFixed(I):B??(e=>String(Math.round(e))),b=typeof h=="function"?h:d[h]??d["ease-out"],G=a$1(M.start||"top 80%"),V=a$1(M.end||"top 20%");if(m)return r.textContent=z(f),P?.(),{...F,getProgress:()=>1};let a=0,c$1=0,L=false,n=0,g=false,o=false,y=-1,i=0,s=0,p=false,v=()=>window.scrollY,W=()=>window.innerHeight;function O(){let e=r.getBoundingClientRect(),t=c({top:e.top,height:e.height},v(),W(),G,V);L&&Math.abs(t.tStart-a)<1&&Math.abs(t.tEnd-c$1)<1||(L=true,a=t.tStart,c$1=t.tEnd);}function d$2(e){r.textContent=z(l+(f-l)*e),r.style.setProperty("--scroll-draw-progress",String(e));}function S(){if(!g||o)return;let e=b$1(v(),a,c$1,1),t=x?Math.max(y,b(i=Math.max(i,e))):b(e);s=t,d$2(t),t>=1&&!p?(p=true,P?.()):t<1&&!x&&(p=false),n=requestAnimationFrame(S);}O();{i=b$1(v(),a,c$1,1);let e=b(i);s=e,d$2(e);}let R=new IntersectionObserver(e=>{e.forEach(t=>{g=t.isIntersecting,g&&!o?n=requestAnimationFrame(S):cancelAnimationFrame(n);});}),C;function u(){clearTimeout(C),C=setTimeout(O,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let Y=d$1([r],u);return R.observe(r),a$2(r,{type:"counter",getProgress:()=>s,getTrigger:()=>({tStart:a,tEnd:c$1})}),{destroy(){cancelAnimationFrame(n),R.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),Y(),clearTimeout(C),b$2(r);},replay(){y=-1,i=0,p=false,s=0,o=false,d$2(0);},pause(){o=true,cancelAnimationFrame(n);},resume(){o&&(o=false,g&&(n=requestAnimationFrame(S)));},seek(e){let t=Math.min(1,Math.max(0,e));s=t,y=t,i=0,o=true,cancelAnimationFrame(n),d$2(t);},getProgress(){return s}}}export{$ as a};
@@ -0,0 +1 @@
1
+ function g(i,t,n){let e=i.getBoundingClientRect(),o=n==="x"?e.width:e.height;return t?{top:n==="x"?e.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:e.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:o,scroll:0}:{top:n==="x"?e.left:e.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}export{g as a};
@@ -0,0 +1 @@
1
+ import {b,a as a$4}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$2,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function $e(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function de(e){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(e))!==null;){let m=[],r=[],u=s[2].trim();if(u)for(let c of u.split(/[\s,]+/)){let o=c.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(o?parseFloat(o[1]):0),r.push(o?o[2]:"");}i.push({fn:s[1],nums:m,units:r});}return i}function Ce(e,i,l){let s=de(e),m=de(i);return s.length===0||s.length!==m.length?l<1?e:i:s.map((r,u)=>{let c=m[u];return r.fn!==c.fn||r.nums.length!==c.nums.length?l<1?`${r.fn}(${r.nums.map((o,p)=>`${o}${r.units[p]}`).join(", ")})`:`${c.fn}(${c.nums.map((o,p)=>`${o}${c.units[p]}`).join(", ")})`:`${r.fn}(${r.nums.map((o,p)=>`${o+(c.nums[p]-o)*l}${r.units[p]}`).join(", ")})`}).join(" ")}function ye(e,i,l){if(typeof e=="number"&&typeof i=="number")return String(e+(i-e)*l);let s=String(e),m=String(i);if($e(s))return a$4(s,m,l);if(s.includes("("))return Ce(s,m,l);let r=s.match(/^([-+]?[\d.]+)(.*)$/),u=m.match(/^([-+]?[\d.]+)(.*)$/);if(r&&u){let c=parseFloat(r[1]),o=parseFloat(u[1]);return `${c+(o-c)*l}${r[2]||u[2]}`}return l<1?s:m}function He(e){return e.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var xe=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fe=0,he="--scroll-draw-progress";function Ie(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var be={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function De(e,i){return typeof window>"u"?be:i.respectReducedMotion===false?Ee(e,i,false):a(i,(l,s)=>Ee(e,l,s))}function Ee(e,i,l){let{props:s,trigger:m={},easing:r="ease-out",speed:u=1,once:c$1=false,axis:o="y",scrollContainer:p,native:ve=true,velocityScale:C=false,triggerElement:Se,onProgress:J,onComplete:O,onEnter:K,onLeave:Q,onEnterBack:ee,onLeaveBack:te}=i,H=typeof r=="function"?r:d[r]??d["ease-out"],ne=a$1(m.start||"top bottom"),re=a$1(m.end||"bottom top"),x=Se??e,d$2=typeof p=="string"?document.querySelector(p):p??null,y=Object.entries(s).map(([t,n])=>({prop:He(t),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function we(){let t=window.getComputedStyle(e);for(let n of y)n.from===""&&(n.from=t.getPropertyValue(n.prop).trim()||"0");}function Te(){for(let t of y)e.style.setProperty(t.prop,String(t.to));}let z=new Map;for(let t of [...y.map(n=>n.prop),he])z.set(t,e.style.getPropertyValue(t));function W(){for(let[t,n]of z)n?e.style.setProperty(t,n):e.style.removeProperty(t);}if(l)return Te(),O?.(),{...be,destroy:W,getProgress:()=>1};we();let F=()=>d$2?o==="x"?d$2.scrollLeft:d$2.scrollTop:o==="x"?window.scrollX:window.scrollY,oe=()=>d$2?o==="x"?d$2.clientWidth:d$2.clientHeight:o==="x"?window.innerWidth:window.innerHeight,se=typeof r=="string"?b(r):null;function Le(){if(!ve||!Ie()||!se||o!=="y"||d$2||x!==e||c$1||u!==1||J||O||K||Q||ee||te||C!==false||(m.start||"top bottom").trim()!=="top bottom"||(m.end||"bottom top").trim()!=="bottom top")return false;for(let t of y)if(!xe.has(t.prop))return false;return true}function Pe(){let t=`ssd-a-${++Fe}`,n=y.map(a=>`${a.prop}:${a.from}`).join(";"),P=y.map(a=>`${a.prop}:${a.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${t}{from{${n}}to{${P}}}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(t);let g=()=>{let a=e.getBoundingClientRect();return c({top:a.top,height:a.height},F(),oe(),ne,re)};a$2(e,{type:"animate",getProgress:()=>f.getProgress(),getTrigger:g});let f={refresh(){},destroy(){e.classList.remove(t),E.remove(),e.style.animationPlayState="",W(),b$3(e);},replay(){e.classList.remove(t),e.offsetWidth,e.classList.add(t);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(a){let $=Math.min(1,Math.max(0,a));e.classList.remove(t);for(let k of y)e.style.setProperty(k.prop,ye(k.from,k.to,$));},getProgress(){let{tStart:a,tEnd:$}=g();return H(b$2(F(),a,$,u))}};return f}if(Le())return Pe();let h=0,b$4=0,v=0,I=false,S=false,B=-1,L=0,w=0,N=false,T=NaN,j=-1,ie=0,M=x===e?y:[],ae=false;function D(){let t=e.style,n=M.map(f=>t.getPropertyValue(f.prop)),P=t.transition;M.length&&(t.transition="none"),M.forEach(f=>t.setProperty(f.prop,z.get(f.prop)??""));let E=a$3(x,d$2,o);M.forEach((f,a)=>t.setProperty(f.prop,n[a])),M.length&&(e.offsetWidth,t.transition=P);let g=c(E,E.scroll,oe(),ne,re);ae&&Math.abs(g.tStart-h)<1&&Math.abs(g.tEnd-b$4)<1||(ae=true,h=g.tStart,b$4=g.tEnd);}function R(t){e.style.setProperty(he,String(t));for(let n of y)e.style.setProperty(n.prop,ye(n.from,n.to,t));J?.(t);}function Me(t){if(isNaN(T)){T=t;return}T<=0&&t>0?K?.():T>0&&t<=0&&te?.(),T<1&&t>=1?Q?.():T>=1&&t<1&&ee?.(),T=t;}function _(){if(!I||S)return;let t=performance.now(),n=F(),P=u;if(C!==false){let a=t-ie,$=a>0?Math.abs(n-(j<0?n:j))/a:0;P=u*Math.max(.2,1+$*(typeof C=="number"?C:1)*.04);}j=n,ie=t;let E=b$4===h?0:(n-h)/(b$4-h);Me(E);let g=b$2(n,h,b$4,P),f=c$1?Math.max(B,H(L=Math.max(L,g))):H(g);w=f,R(f),f>=1&&!N?(N=true,O?.()):f<1&&!c$1&&(N=false),v=requestAnimationFrame(_);}D(),b$4===h&&b$1("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),L=b$2(F(),h,b$4,u),w=H(L),R(w);let le=new IntersectionObserver(t=>{t.forEach(n=>{I=n.isIntersecting,I&&!S?v=requestAnimationFrame(_):cancelAnimationFrame(v);});},{root:d$2??null}),q;function A(){clearTimeout(q),q=setTimeout(D,150);}window.addEventListener("resize",A),window.addEventListener("orientationchange",A);let Ae=d$1([x],A);return le.observe(e),a$2(e,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:h,tEnd:b$4})}),{destroy(){cancelAnimationFrame(v),le.disconnect(),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),Ae(),clearTimeout(q),W(),b$3(e);},replay(){B=-1,L=0,N=false,w=0,S=false,R(0);},pause(){S=true,cancelAnimationFrame(v);},resume(){S&&(S=false,I&&(v=requestAnimationFrame(_)));},seek(t){let n=Math.min(1,Math.max(0,t));w=n,B=n,L=0,S=true,cancelAnimationFrame(v),R(n);},getProgress(){return w},refresh(){D();}}}export{De as a};
@@ -1,3 +1,3 @@
1
- 'use strict';function tr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,u=[];for(let y=0;y<r;y++){let M=Math.pow(o,y);u.push(M),c+=M;}let i=[0],m=0;for(let y=0;y<r;y++)m+=u[y]/c,i.push(m);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let M=0;M<r;M++)if(y<=i[M+1]){let L=(y-i[M])/(i[M+1]-i[M]);if(M===0)return L*(2-L);let v=1-Math.pow(t,M);return v+(1-v)*(2*L-1)*(2*L-1)}return 1}}function rr({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var Pe={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:tr(),elastic:rr()};function Lt(e,n,r){return Math.min(r,Math.max(n,e))}function Re(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 kt(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 Dt(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 ie(e,n,r,t){return r===n?0:Lt((e-n)/(r-n)*t,0,1)}function Ne(e,n,r,t,o){let c=kt(e.top,e.height,n,t.element)-Dt(t.viewport,r),u=kt(e.top,e.height,n,o.element)-Dt(o.viewport,r);return {tStart:c,tEnd:u}}function nt(e,n,r){let t=e.getBoundingClientRect(),o=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:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function Fe(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 Ot(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=Ot(e),o=Ot(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var It={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 Be=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function de(e,...n){Be&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var nr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",or="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ct=33;function sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ir(e){let n=[];for(let r=0;r<Ct;r++){let t=r/(Ct-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function ot(e){switch(e){case "linear":return "linear";case "ease-in":return nr;case "ease-out":return or;case "ease-in-out":return sr()?ir(Pe["ease-in-out"]):null;default:return null}}var Rt=Symbol.for("svg-scroll-draw.registry");function Nt(){let e=globalThis;return e[Rt]||(e[Rt]=new Map)}function Qe(e,n){Nt().set(e,n);}function je(e){Nt().delete(e);}var Ue,st=new Set,it=new WeakMap,Xe=new Map,Ft=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function ar(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function at(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();Ue??(Ue=new ResizeObserver(o=>{let c=false;for(let{target:u}of o)it.get(u)!==Ft(u)&&(c=true),it.set(u,"");c&&st.forEach(u=>u());})),st.add(r);let t=ar(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{it.has(o)||it.set(o,Ft(o)),Xe.set(o,(Xe.get(o)??0)+1),Ue.observe(o);}),()=>{st.delete(r)&&(t.forEach(o=>{let c=(Xe.get(o)??1)-1;if(c)return void Xe.set(o,c);Xe.delete(o),Ue?.unobserve(o);}),st.size||(Ue?.disconnect(),Ue=void 0));}}function _t(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let t=n;return t.addListener?.(r),()=>t.removeListener?.(r)}function lt(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let r=n(e,false),t=_t(c=>{if(!c)return;t();let u=(r.getProgress?.()??0)>=1;r.destroy(),r=n(u?{...e,onComplete:void 0}:e,true);}),o={};for(let c of Object.keys(r))o[c]=(...u)=>r[c]?.(...u);return o.destroy=()=>{t(),r.destroy();},o}var lr=0;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ht(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ur(e){if(!Be)return;let n=Ht(e,"stroke");if(!n||n==="none"){de("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Vt.has(r)&&!Vt.has(Ht(e,"fill"))&&de("Element has a fill \u2014 it may obscure the stroke animation.",e);}function fr(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 o(){let c=r==="x"?window.scrollX:window.scrollY,u=e-c,i=n-c,m=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${u}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:${i}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${i}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",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var Wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function mr(e,n,r){if(!Be)return;let t=(e.match(zt)??[]).join("").toUpperCase(),o=(n.match(zt)??[]).join("").toUpperCase(),c=(e.match(Wt)??[]).length,u=(n.match(Wt)??[]).length;if(t!==o){de(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==u&&de(`morphTo: coordinate count differs (${c} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ht(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let u=parseFloat(c),i=t[o++]??u;return String(+(u+(i-u)*r).toFixed(4))})}function bt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:lt(n,(r,t)=>pr(e,r,t))}function pr(e,n,r){let{preset:t,...o}=n,c=t?{...It[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:i=1,fade:m=false,easing:y="linear",trigger:M={},stagger:L=0,direction:v="forward",once:ae=false,debug:Ve=false,axis:J="y",scrollContainer:De,autoReverse:$e=false,delay:ve=0,strokeColor:ee,strokeWidth:le,fillOpacity:ce,waypoints:j,velocityScale:W=false,threshold:U=0,rootMargin:Ze="0px",repeat:ge=0,repeatDelay:Ae=0,morphTo:N,clip:Oe,autoplay:ct=false,duration:ut=1e3,native:te=true,onProgress:q,onStart:X,onComplete:re,onEnter:ue,onLeave:ye,onEnterBack:he,onLeaveBack:Le}=c,F=Oe===true?"left":typeof Oe=="string"?Oe:false,ne=typeof y=="function"?y:Pe[y]??Pe.linear,We=Re(M.start??"top bottom"),ze=Re(M.end??"bottom top"),Q=typeof De=="string"?document.querySelector(De):De??null,_=Array.isArray(ee)?ee[0]:null,C=Array.isArray(ee)?ee[1]:typeof ee=="string"?ee:null,R=Array.isArray(le)?le[0]:null,k=Array.isArray(le)?le[1]:typeof le=="number"?le:null,z=Array.isArray(ce)?ce[0]:null,I=Array.isArray(ce)?ce[1]:typeof ce=="number"?ce:null;function fe(s){let l=s*100;switch(F){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let x=F?[]:Array.from(e.querySelectorAll(u)),w=[],G=[],a=0,f=0,oe=L,Y=0,b=false,S=false,$=0,Ee=false,P=-1,be=[],Se=-1,H=false,me=0,we=0,xe,ft=null;function vt(){ft?.destroy(),ft=null;}let Te=new Set,Et=NaN,Me=true,Ke=-1,St=performance.now(),Ie=NaN;function qe(){return Q?J==="x"?Q.scrollLeft:Q.scrollTop:J==="x"?window.scrollX:window.scrollY}function xt(){return Q?J==="x"?Q.clientWidth:Q.clientHeight:J==="x"?window.innerWidth:window.innerHeight}function Tt(){let s=nt(e,Q,J);return Ne(s,s.scroll,xt(),We,ze)}function Xt(){let s=f-a,l=x.length-1,d=Q??document.documentElement,D=J==="x"?"Width":"Height";if(oe=L,L>0&&l>0&&s>0){let Z=d[`scroll${D}`]-d[`client${D}`]-1-a-s/i;Z>=0&&(oe=Math.min(L,Z/(l*s)));}Y=f+l*oe*s;}function Mt(){(({tStart:a,tEnd:f}=Tt())),Xt(),Ve&&Be&&(vt(),ft=fr(a,f,J));}function mt(s,l=Tt){Qe(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:l});let d=s.destroy;return s.destroy=()=>{d.call(s),je(e);},s}function Yt(s,l){if(e.style.setProperty("--scroll-draw-progress",String(s)),F){let d=l==="reverse"?1-s:s;e.style.clipPath=fe(d);return}x.forEach((d,D)=>{d.style.strokeDashoffset=l==="reverse"?`${w[D]*s}`:`${w[D]*(1-s)}`,m&&(d.style.opacity=l==="reverse"?`${1-s}`:`${s}`),_&&C?d.style.stroke=_e(_,C,s):C&&(d.style.stroke=C),R!==null&&k!==null?d.style.strokeWidth=`${R+(k-R)*s}`:k!==null&&(d.style.strokeWidth=`${k}`),z!==null&&I!==null?d.style.fillOpacity=`${z+(I-z)*s}`:I!==null&&(d.style.fillOpacity=`${I}`),N&&d.tagName.toLowerCase()==="path"&&G[D]&&d.setAttribute("d",ht(G[D],N,s));});}function Je(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=fe(0);return}x.forEach((s,l)=>{s.style.strokeDasharray=`${w[l]}`,s.style.strokeDashoffset=v==="reverse"?"0":`${w[l]}`,m?s.style.opacity=v==="reverse"?"1":"0":s.style.opacity="",_&&(s.style.stroke=_),R!==null&&(s.style.strokeWidth=`${R}`),z!==null&&(s.style.fillOpacity=`${z}`),N&&s.tagName.toLowerCase()==="path"&&G[l]&&s.setAttribute("d",G[l]);});}if(x.forEach(s=>{ur(s);let l=Fe(s);w.push(l);let d=s.tagName.toLowerCase()==="path";d?G.push(s.getAttribute("d")??""):G.push(""),N&&(d?mr(G[G.length-1],N,s):de(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=v==="reverse"?`${l}`:"0",m&&(s.style.opacity="1"),C&&(s.style.stroke=C),k!==null&&(s.style.strokeWidth=`${k}`),I!==null&&(s.style.fillOpacity=`${I}`),N&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",N)):(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=v==="reverse"?"0":`${l}`,m?s.style.opacity=v==="reverse"?"1":"0":s.style.opacity="",_&&(s.style.stroke=_),R!==null&&(s.style.strokeWidth=`${R}`),z!==null&&(s.style.fillOpacity=`${z}`));}),F){if(r)return e.style.clipPath=fe(1),re?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=fe(0);}else if(r)return re?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Pt=typeof y=="string"?ot(y):null;function Zt(){return !(te===false||!cr()||!x.length||!Pt||F||J!=="y"||Q||i!==1||L!==0||ae||$e||W!==false||N||j||ge||ve>0||q||X||re||ue||ye||he||Le||ee!=null||le!=null||ce!=null||(M.start??"top bottom").trim()!=="top bottom"||(M.end??"bottom top").trim()!=="bottom top")}function Kt(){let s=++lr,l=`svg-scroll-draw-${s}`,d=`svg-scroll-draw-host-${s}`,D=`--svg-scroll-draw-${s}`,Z=v==="reverse"?"0":"var(--ssd-len)",pe=v==="reverse"?"var(--ssd-len)":"0",se=`stroke-dashoffset:${Z};`,h=`stroke-dashoffset:${pe};`;m&&(se+=`opacity:${v==="reverse"?1:0};`,h+=`opacity:${v==="reverse"?0:1};`);let E=document.createElement("style");E.setAttribute("data-svg-scroll-draw",""),E.textContent=`@keyframes ${l}{from{${se}}to{${h}}}.${d}{view-timeline-name:${D};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Pt};animation-fill-mode:both;animation-timeline:${D};animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(d);function V(p,O){p.style.setProperty("--ssd-len",String(w[O])),p.style.strokeDasharray=`${w[O]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(l);}x.forEach(V);let g=false,T=-1;function A(){if(T>=0)return T;let p=e.getBoundingClientRect(),{tStart:O,tEnd:K}=Ne({top:p.top,height:p.height},qe(),xt(),We,ze);return ne(ie(qe(),O,K,i))}return {destroy(){e.classList.remove(d),x.forEach(p=>{p.classList.remove(l),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),E.remove();},replay(){g=false,T=-1,x.forEach(V);},pause(){g=true,x.forEach(p=>{p.style.animationPlayState="paused";});},resume(){g&&(g=false,x.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let O=Math.min(1,Math.max(0,p));T=O,g=true,x.forEach((K,B)=>{K.classList.remove(l),K.style.strokeDashoffset=v==="reverse"?`${w[B]*O}`:`${w[B]*(1-O)}`,m&&(K.style.opacity=v==="reverse"?`${1-O}`:`${O}`);});},getProgress(){return A()},refresh(){x.forEach((p,O)=>{w[O]=Fe(p),p.style.setProperty("--ssd-len",String(w[O])),p.style.strokeDasharray=`${w[O]}`;});}}}if(Zt())return mt(Kt());function Jt(){let s=Math.max(1,ut),l=0,d=0,D=false;function Z(g){let T=true;if(F){let A=Math.min(1,Math.max(0,g/s)),p=ne(A);me=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=fe(v==="reverse"?1-p:p),q?.(p),A<1&&(T=false);}else x.forEach((A,p)=>{let O=p*L*s,K=Math.min(1,Math.max(0,(g-O)/s)),B=ne(K);A.style.strokeDashoffset=v==="reverse"?`${w[p]*B}`:`${w[p]*(1-B)}`,m&&(A.style.opacity=v==="reverse"?`${1-B}`:`${B}`),_&&C?A.style.stroke=_e(_,C,B):C&&(A.style.stroke=C),R!==null&&k!==null?A.style.strokeWidth=`${R+(k-R)*B}`:k!==null&&(A.style.strokeWidth=`${k}`),z!==null&&I!==null?A.style.fillOpacity=`${z+(I-z)*B}`:I!==null&&(A.style.fillOpacity=`${I}`),N&&A.tagName.toLowerCase()==="path"&&G[p]&&A.setAttribute("d",ht(G[p],N,B)),p===0&&(me=B,q?.(B),e.style.setProperty("--scroll-draw-progress",String(B))),K<1&&(T=false);});if(j){let A=Math.min(1,Math.max(0,g/s)),p=ne(A);for(let O in j){let K=parseFloat(O);p>=K&&!Te.has(K)&&(Te.add(K),j[O]?.());}}return T}function pe(g){if(H)return;let T=g-l;S||(S=true,X?.());let A=Z(T);if(A&&!b){b=true,Z(s*(1+Math.max(0,x.length-1)*L)),re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{l=performance.now(),S=false,b=false,Te.clear(),Je(),$=requestAnimationFrame(pe);},Ae));return}A||($=requestAnimationFrame(pe));}function se(){cancelAnimationFrame($),clearTimeout(xe),l=performance.now(),d=0,H=false,S=false,b=false,we=0,D=true,me=0,Te.clear(),Je(),$=requestAnimationFrame(pe);}let h=new IntersectionObserver(g=>{g.forEach(T=>{T.isIntersecting&&!(ae&&b)?se():!T.isIntersecting&&!ae&&!b&&(cancelAnimationFrame($),clearTimeout(xe),D=false);});},{root:Q??null,threshold:U,rootMargin:Ze}),E;function V(){clearTimeout(E),E=setTimeout(()=>{x.forEach((g,T)=>{w[T]=Fe(g),g.style.strokeDasharray=`${w[T]}`;});},150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),ve>0?setTimeout(()=>h.observe(e),ve):h.observe(e),{destroy(){cancelAnimationFrame($),clearTimeout(xe),h.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(E);},replay(){we=0,se();},pause(){H||!D||(H=true,d=performance.now()-l,cancelAnimationFrame($));},resume(){H&&(H=false,D=true,l=performance.now()-d,$=requestAnimationFrame(pe));},seek(g){let T=Math.min(1,Math.max(0,g));me=T,H=true,d=T*s,l=performance.now()-d,cancelAnimationFrame($),Z(d);},getProgress(){return me},refresh(){clearTimeout(E),x.forEach((g,T)=>{w[T]=Fe(g),g.style.strokeDasharray=`${w[T]}`;});}}}if(ct)return mt(Jt());Mt();function $t(){if(H||!Ce)return;let s=performance.now(),l=qe();if(!Me&&W===false&&l===Et){dt(l);return}Me=false,Et=l;let d=i;if(W!==false){let h=s-St,E=h>0?Math.abs(l-(Ke<0?l:Ke))/h:0;d=i*Math.max(.2,1+E*(typeof W=="number"?W:1)*.04);}Ke=l,St=s;let D=$e?Se===-1||l>=Se?"forward":"reverse":v;Se=l;let Z=f-a,pe=true,se=Z===0?0:(l-a)/Z;if(isNaN(Ie)||(Ie<=0&&se>0?ue?.():Ie>0&&se<=0&&Le?.(),Ie<1&&se>=1?ye?.():Ie>=1&&se<1&&he?.()),Ie=se,F){let h=ne(ie(l,a,f,d));ae&&!$e&&(P=Math.max(P,h),h=P),me=h,e.style.setProperty("--scroll-draw-progress",String(h));let E=D==="reverse"?1-h:h;e.style.clipPath=fe(E),q?.(h),!S&&ie(l,a,f,d)>0&&(S=true,X?.()),h>=1&&!b?(b=true,re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{P=-1,S=false,b=false,e.style.clipPath=fe(0);},Ae))):h<1&&!ae&&(b=false),dt(l);return}if(x.forEach((h,E)=>{let V=E*oe*Z,g=ne(ie(l,a+V,f+V,d));ae&&!$e&&(g=be[E]=Math.max(be[E]??P,g)),h.style.strokeDashoffset=D==="reverse"?`${w[E]*g}`:`${w[E]*(1-g)}`,m&&(h.style.opacity=D==="reverse"?`${1-g}`:`${g}`),_&&C?h.style.stroke=_e(_,C,g):C&&(h.style.stroke=C),R!==null&&k!==null?h.style.strokeWidth=`${R+(k-R)*g}`:k!==null&&(h.style.strokeWidth=`${k}`),z!==null&&I!==null?h.style.fillOpacity=`${z+(I-z)*g}`:I!==null&&(h.style.fillOpacity=`${I}`),N&&h.tagName.toLowerCase()==="path"&&G[E]&&h.setAttribute("d",ht(G[E],N,g)),E===0&&(me=g,q?.(g),e.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(pe=false);}),j){let h=ne(ie(l,a,f,d));for(let E in j){let V=parseFloat(E);h>=V&&!Te.has(V)&&(Te.add(V),j[E]?.());}}!S&&ie(l,a,f,d)>0&&(S=true,X?.()),pe&&!b?(b=true,re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{P=-1,be=[],S=false,b=false,Te.clear(),Je(),Me=true;},Ae))):!pe&&!ae&&(b=false),dt(l);}function pt(s){return s>=f&&s<Y}function dt(s){Ee||pt(s)?$=requestAnimationFrame($t):Ce=false;}function gt(){return Ee||pt(qe())}let Ce=false;function et(){Ce||(Ce=true,$=requestAnimationFrame(function(){$t();}));}function tt(){Ce=false,cancelAnimationFrame($);}let yt=new IntersectionObserver(s=>{s.forEach(l=>{Ee=l.isIntersecting,Ee&&!H?(Me=true,et()):Ce&&!H&&pt(qe())||tt();});},{root:Q??null,threshold:U,rootMargin:Ze});function At(){x.forEach((s,l)=>{w[l]=Fe(s),s.style.strokeDasharray=`${w[l]}`;}),Mt(),Me=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout(At,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let er=at([e],Ge);return ve>0?setTimeout(()=>yt.observe(e),ve):yt.observe(e),mt({destroy(){cancelAnimationFrame($),clearTimeout(xe),tt(),yt.disconnect(),er(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),vt();},replay(){P=-1,be=[],Se=-1,Ke=-1,S=false,b=false,we=0,H=false,me=0,Te.clear(),clearTimeout(xe),Je(),Me=true,gt()&&et();},pause(){H=true,tt();},resume(){H&&(H=false,Me=true,gt()&&et());},seek(s){let l=Math.min(1,Math.max(0,s));me=l,P=l,be=[],H=true,tt(),Yt(l,v),Me=true;},getProgress(){return me},refresh(){clearTimeout(rt),At(),gt()&&!H&&et();}},()=>({tStart:a,tEnd:f}))}function dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function qt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],u=t[2].trim();if(u)for(let i of u.split(/[\s,]+/)){let m=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),c.push(m?m[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function gr(e,n,r){let t=qt(e),o=qt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,u)=>{let i=o[u];return c.fn!==i.fn||c.nums.length!==i.nums.length?r<1?`${c.fn}(${c.nums.map((m,y)=>`${m}${c.units[y]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,y)=>`${m}${i.units[y]}`).join(", ")})`:`${c.fn}(${c.nums.map((m,y)=>`${m+(i.nums[y]-m)*r}${c.units[y]}`).join(", ")})`}).join(" ")}function wt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(dr(t))return _e(t,o,r);if(t.includes("("))return gr(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&u){let i=parseFloat(c[1]),m=parseFloat(u[1]);return `${i+(m-i)*r}${c[2]||u[2]}`}return r<1?t:o}function yr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var hr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),br=0,Gt="--scroll-draw-progress";function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Qt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function He(e,n){return typeof window>"u"?Qt:n.respectReducedMotion===false?Bt(e,n,false):lt(n,(r,t)=>Bt(e,r,t))}function Bt(e,n,r){let{props:t,trigger:o={},easing:c="ease-out",speed:u=1,once:i=false,axis:m="y",scrollContainer:y,native:M=true,velocityScale:L=false,triggerElement:v,onProgress:ae,onComplete:Ve,onEnter:J,onLeave:De,onEnterBack:$e,onLeaveBack:ve}=n,ee=typeof c=="function"?c:Pe[c]??Pe["ease-out"],le=Re(o.start??"top bottom"),ce=Re(o.end??"bottom top"),j=v??e,W=typeof y=="string"?document.querySelector(y):y??null,U=Object.entries(t).map(([a,f])=>({prop:yr(a),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function Ze(){let a=window.getComputedStyle(e);for(let f of U)f.from===""&&(f.from=a.getPropertyValue(f.prop).trim()||"0");}function ge(){for(let a of U)e.style.setProperty(a.prop,String(a.to));}let Ae=new Map;for(let a of [...U.map(f=>f.prop),Gt])Ae.set(a,e.style.getPropertyValue(a));function N(){for(let[a,f]of Ae)f?e.style.setProperty(a,f):e.style.removeProperty(a);}if(r)return ge(),Ve?.(),{...Qt,destroy:N,getProgress:()=>1};Ze();let Oe=typeof c=="string"?ot(c):null;function ct(){if(!M||!wr()||!Oe||m!=="y"||W||j!==e||i||u!==1||ae||Ve||J||De||$e||ve||L!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let a of U)if(!hr.has(a.prop))return false;return true}function ut(){let a=`ssd-a-${++br}`,f=U.map(P=>`${P.prop}:${P.from}`).join(";"),oe=U.map(P=>`${P.prop}:${P.to}`).join(";"),Y=document.createElement("style");Y.setAttribute("data-ssd-animate",""),Y.textContent=`@keyframes ${a}{from{${f}}to{${oe}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(Y),e.classList.add(a);let b=()=>m==="x"?window.scrollX:window.scrollY,S=()=>m==="x"?window.innerWidth:window.innerHeight,$=()=>{let P=e.getBoundingClientRect();return Ne({top:P.top,height:P.height},b(),S(),le,ce)};Qe(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:$});let Ee={refresh(){},destroy(){e.classList.remove(a),Y.remove(),e.style.animationPlayState="",N(),je(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(P){let be=Math.min(1,Math.max(0,P));e.classList.remove(a);for(let Se of U)e.style.setProperty(Se.prop,wt(Se.from,Se.to,be));},getProgress(){let{tStart:P,tEnd:be}=$();return ee(ie(b(),P,be,u))}};return Ee}if(ct())return ut();let te=0,q=0,X=0,re=false,ue=false,ye=-1,he=0,Le=false,F=NaN,ne=-1,We=0,ze=()=>W?m==="x"?W.scrollLeft:W.scrollTop:m==="x"?window.scrollX:window.scrollY,Q=()=>W?m==="x"?W.clientWidth:W.clientHeight:m==="x"?window.innerWidth:window.innerHeight,_=j===e?U:[],C=false;function R(){let a=e.style,f=_.map(S=>a.getPropertyValue(S.prop)),oe=a.transition;_.length&&(a.transition="none"),_.forEach(S=>a.setProperty(S.prop,Ae.get(S.prop)??""));let Y=nt(j,W,m);_.forEach((S,$)=>a.setProperty(S.prop,f[$])),_.length&&(e.offsetWidth,a.transition=oe);let b=Ne(Y,Y.scroll,Q(),le,ce);C&&Math.abs(b.tStart-te)<1&&Math.abs(b.tEnd-q)<1||(C=true,te=b.tStart,q=b.tEnd);}function k(a){e.style.setProperty(Gt,String(a));for(let f of U)e.style.setProperty(f.prop,wt(f.from,f.to,a));ae?.(a);}function z(a){if(isNaN(F)){F=a;return}F<=0&&a>0?J?.():F>0&&a<=0&&ve?.(),F<1&&a>=1?De?.():F>=1&&a<1&&$e?.(),F=a;}function I(){if(!re||ue)return;let a=performance.now(),f=ze(),oe=u;if(L!==false){let S=a-We,$=S>0?Math.abs(f-(ne<0?f:ne))/S:0;oe=u*Math.max(.2,1+$*(typeof L=="number"?L:1)*.04);}ne=f,We=a;let Y=q===te?0:(f-te)/(q-te);z(Y);let b=ee(ie(f,te,q,oe));i&&(ye=Math.max(ye,b),b=ye),he=b,k(b),b>=1&&!Le?(Le=true,Ve?.()):b<1&&!i&&(Le=false),X=requestAnimationFrame(I);}R(),q===te&&de("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 a=ee(ie(ze(),te,q,u));i&&a>0&&(ye=a),he=a,k(a);}let fe=new IntersectionObserver(a=>{a.forEach(f=>{re=f.isIntersecting,re&&!ue?X=requestAnimationFrame(I):cancelAnimationFrame(X);});},{root:W??null}),x;function w(){clearTimeout(x),x=setTimeout(R,150);}window.addEventListener("resize",w),window.addEventListener("orientationchange",w);let G=at([j],w);return fe.observe(e),Qe(e,{type:"animate",getProgress:()=>he,getTrigger:()=>({tStart:te,tEnd:q})}),{destroy(){cancelAnimationFrame(X),fe.disconnect(),window.removeEventListener("resize",w),window.removeEventListener("orientationchange",w),G(),clearTimeout(x),N(),je(e);},replay(){ye=-1,Le=false,he=0,ue=false,k(0);},pause(){ue=true,cancelAnimationFrame(X);},resume(){ue&&(ue=false,re&&(X=requestAnimationFrame(I)));},seek(a){let f=Math.min(1,Math.max(0,a));he=f,ye=f,ue=true,cancelAnimationFrame(X),k(f);},getProgress(){return he},refresh(){R();}}}var jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ut(e,n={}){if(typeof window>"u")return jt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return de("scrollParallax: element not found:",e),jt;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:u,onProgress:i}=n,m=-t*100,y=r.style,M=!!r.ownerSVGElement,L=y.getPropertyValue("transform-box");M&&y.setProperty("transform-box","fill-box");let v=He(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:i});return M?{...v,destroy(){v.destroy(),y.setProperty("transform-box",L);}}:v}function Ye(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var ke={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function fn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e).map(t=>bt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function mn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e);if(r.length===0)return ke;let t=0,o=[];function c(i){return bt(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function pn(e,n){if(typeof window>"u")return ke;let r=Ye(e).map(t=>He(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function dn(e,n){if(typeof window>"u")return ke;let r=Ye(e);if(r.length===0)return ke;let t=0,o=[];function c(i){return He(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function gn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e).map(t=>Ut(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=pn;exports.scrollAnimateSequence=dn;exports.scrollDrawGroup=fn;exports.scrollDrawSequence=mn;exports.scrollParallaxGroup=gn;
1
+ 'use strict';function or({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,u=[];for(let d=0;d<r;d++){let x=Math.pow(o,d);u.push(x),c+=x;}let a=[0],f=0;for(let d=0;d<r;d++)f+=u[d]/c,a.push(f);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<r;x++)if(d<=a[x+1]){let $=(d-a[x])/(a[x+1]-a[x]);if(x===0)return $*(2-$);let h=1-Math.pow(t,x);return h+(1-h)*(2*$-1)*(2*$-1)}return 1}}function sr({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var Te={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:or(),elastic:sr()};function Dt(e,n,r){return Math.min(r,Math.max(n,e))}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 It(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 Ct(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 ee(e,n,r,t){return r===n?0:Dt((e-n)/(r-n)*t,0,1)}function Fe(e,n,r,t,o){let c=It(e.top,e.height,n,t.element)-Ct(t.viewport,r),u=It(e.top,e.height,n,o.element)-Ct(o.viewport,r);return {tStart:c,tEnd:u}}function nt(e,n,r){let t=e.getBoundingClientRect(),o=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:t.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function _e(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 Ot(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 ot(e,n,r){let t=Ot(e),o=Ot(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var Rt={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 qe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ue(e,...n){qe&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var ir="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",ar="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Nt=33;function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function cr(e){let n=[];for(let r=0;r<Nt;r++){let t=r/(Nt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function st(e){switch(e){case "linear":return "linear";case "ease-in":return ir;case "ease-out":return ar;case "ease-in-out":return lr()?cr(Te["ease-in-out"]):null;default:return null}}var Ft=Symbol.for("svg-scroll-draw.registry");function _t(){let e=globalThis;return e[Ft]||(e[Ft]=new Map)}function Be(e,n){_t().set(e,n);}function Qe(e){_t().delete(e);}var je,it=new Set,at=new WeakMap,Ue=new Map,Ht=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function ur(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function lt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();je??(je=new ResizeObserver(o=>{let c=false;for(let{target:u}of o)at.get(u)!==Ht(u)&&(c=true),at.set(u,"");c&&it.forEach(u=>u());})),it.add(r);let t=ur(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{at.has(o)||at.set(o,Ht(o)),Ue.set(o,(Ue.get(o)??0)+1),je.observe(o);}),()=>{it.delete(r)&&(t.forEach(o=>{let c=(Ue.get(o)??1)-1;if(c)return void Ue.set(o,c);Ue.delete(o),je?.unobserve(o);}),it.size||(je?.disconnect(),je=void 0));}}function Vt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let t=n;return t.addListener?.(r),()=>t.removeListener?.(r)}function ct(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let r=n(e,false),t=Vt(c=>{if(!c)return;t();let u=(r.getProgress?.()??0)>=1;r.destroy(),r=n(u?{...e,onComplete:void 0}:e,true);}),o={};for(let c of Object.keys(r))o[c]=(...u)=>r[c]?.(...u);return o.destroy=()=>{t(),r.destroy();},o}var fr=0;function mr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function zt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Wt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function pr(e){if(!qe)return;let n=zt(e,"stroke");if(!n||n==="none"){ue("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Wt.has(r)&&!Wt.has(zt(e,"fill"))&&ue("Element has a fill \u2014 it may obscure the stroke animation.",e);}function dr(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 o(){let c=r==="x"?window.scrollX:window.scrollY,u=e-c,a=n-c,f=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${f?`left:${u}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${u}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;${f?`left:${a}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${a}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",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var Gt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function gr(e,n,r){if(!qe)return;let t=(e.match(qt)??[]).join("").toUpperCase(),o=(n.match(qt)??[]).join("").toUpperCase(),c=(e.match(Gt)??[]).length,u=(n.match(Gt)??[]).length;if(t!==o){ue(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==u&&ue(`morphTo: coordinate count differs (${c} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function yr(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let u=parseFloat(c),a=t[o++]??u;return String(+(u+(a-u)*r).toFixed(4))})}function bt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:ct(n,(r,t)=>hr(e,r,t))}function hr(e,n,r){let{preset:t,...o}=n,c=t?{...Rt[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:a=1,fade:f=false,easing:d="linear",trigger:x={},stagger:$=0,direction:h="forward",once:fe=false,debug:ke=false,axis:Z="y",scrollContainer:De,autoReverse:Ie=false,delay:be=0,strokeColor:B,strokeWidth:te,fillOpacity:re,waypoints:Q,velocityScale:F=false,threshold:j=0,rootMargin:Ye="0px",repeat:me=0,repeatDelay:Me=0,morphTo:U,clip:we,autoplay:Ve=false,duration:Ze=1e3,native:ut=true,onProgress:Pe,onStart:H,onComplete:V,onEnter:ne,onLeave:Ae,onEnterBack:oe,onLeaveBack:Ce}=c,D=we===true?"left":typeof we=="string"?we:false,I=typeof d=="function"?d:Te[d]??Te.linear,Le=Ne(x.start||"top bottom"),se=Ne(x.end||"bottom top"),_=typeof De=="string"?document.querySelector(De):De??null,pe=Array.isArray(B)?B[0]:null,X=Array.isArray(B)?B[1]:typeof B=="string"?B:null,ie=Array.isArray(te)?te[0]:null,ae=Array.isArray(te)?te[1]:typeof te=="number"?te:null,Y=Array.isArray(re)?re[0]:null,ve=Array.isArray(re)?re[1]:typeof re=="number"?re:null;function le(s){let i=s*100;switch(D){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let T=D?[]:Array.from(e.querySelectorAll(u)),v=[],z=[],W=0,l=0,m=$,de=0,b=false,E=false,y=0,S=false,K=-1,J=[],Ke=-1,C=false,ce=0,ge=0,Ee,ft=null;function vt(){ft?.destroy(),ft=null;}let Se=new Set,Et=NaN,xe=true,Je=-1,St=performance.now(),Oe=NaN;function ze(){return _?Z==="x"?_.scrollLeft:_.scrollTop:Z==="x"?window.scrollX:window.scrollY}function xt(){return _?Z==="x"?_.clientWidth:_.clientHeight:Z==="x"?window.innerWidth:window.innerHeight}function Tt(){let s=nt(e,_,Z);return Fe(s,s.scroll,xt(),Le,se)}function Zt(){let s=l-W,i=T.length-1,p=_??document.documentElement,P=Z==="x"?"Width":"Height";if(m=$,$>0&&i>0&&s>0){let G=p[`scroll${P}`]-p[`client${P}`]-1-W-s/a;G>=0&&(m=Math.min($,G/(i*s)));}de=l+i*m*s;}function Mt(){(({tStart:W,tEnd:l}=Tt())),Zt(),ke&&qe&&(vt(),ft=dr(W,l,Z));}function mt(s,i=Tt){Be(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:i});let p=s.destroy;return s.destroy=()=>{p.call(s),Qe(e);},s}function Pt(s,i){return fe&&!Ie?Math.max(K,I(J[s]=Math.max(J[s]??0,i))):I(i)}function Kt(s,i){if(e.style.setProperty("--scroll-draw-progress",String(s)),D){let p=i==="reverse"?1-s:s;e.style.clipPath=le(p);return}T.forEach((p,P)=>pt(p,P,s,i));}function pt(s,i,p,P){s.style.strokeDashoffset=P==="reverse"?`${v[i]*p}`:`${v[i]*(1-p)}`,f&&(s.style.opacity=P==="reverse"?`${1-p}`:`${p}`),pe&&X?s.style.stroke=ot(pe,X,p):X&&(s.style.stroke=X),ie!==null&&ae!==null?s.style.strokeWidth=`${ie+(ae-ie)*p}`:ae!==null&&(s.style.strokeWidth=`${ae}`),Y!==null&&ve!==null?s.style.fillOpacity=`${Y+(ve-Y)*p}`:ve!==null&&(s.style.fillOpacity=`${ve}`),U&&s.tagName.toLowerCase()==="path"&&z[i]&&s.setAttribute("d",yr(z[i],U,p));}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),D){e.style.clipPath=le(h==="reverse"?1:0);return}T.forEach((s,i)=>{s.style.strokeDasharray=`${v[i]}`,s.style.strokeDashoffset=h==="reverse"?"0":`${v[i]}`,f?s.style.opacity=h==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),ie!==null&&(s.style.strokeWidth=`${ie}`),Y!==null&&(s.style.fillOpacity=`${Y}`),U&&s.tagName.toLowerCase()==="path"&&z[i]&&s.setAttribute("d",z[i]);});}if(T.forEach(s=>{pr(s);let i=_e(s);v.push(i);let p=s.tagName.toLowerCase()==="path";p?z.push(s.getAttribute("d")??""):z.push(""),U&&(p?gr(z[z.length-1],U,s):ue(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=h==="reverse"?`${i}`:"0",f&&(s.style.opacity="1"),X&&(s.style.stroke=X),ae!==null&&(s.style.strokeWidth=`${ae}`),ve!==null&&(s.style.fillOpacity=`${ve}`),U&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",U)):(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=h==="reverse"?"0":`${i}`,f?s.style.opacity=h==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),ie!==null&&(s.style.strokeWidth=`${ie}`),Y!==null&&(s.style.fillOpacity=`${Y}`));}),r)return D&&(e.style.clipPath=le(1)),V?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};D&&(e.style.clipPath=le(h==="reverse"?1:0));let At=typeof d=="string"?st(d):null;function Jt(){return !(ut===false||Ve||ke||!mr()||!T.length||!At||D||Z!=="y"||_||a!==1||$!==0||fe||Ie||F!==false||U||Q||me||be>0||Pe||H||V||ne||Ae||oe||Ce||B!=null||te!=null||re!=null||(x.start||"top bottom").trim()!=="top bottom"||(x.end||"bottom top").trim()!=="bottom top")}function er(){let s=++fr,i=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,P=`--svg-scroll-draw-${s}`,G=h==="reverse"?"0":"var(--ssd-len)",ye=h==="reverse"?"var(--ssd-len)":"0",q=`stroke-dashoffset:${G};`,M=`stroke-dashoffset:${ye};`;f&&(q+=`opacity:${h==="reverse"?1:0};`,M+=`opacity:${h==="reverse"?0:1};`);let A=document.createElement("style");A.setAttribute("data-svg-scroll-draw",""),A.textContent=`@keyframes ${i}{from{${q}}to{${M}}}.${p}{view-timeline-name:${P};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${At};animation-fill-mode:both;animation-timeline:${P};animation-range:cover 0% cover 100%;}`,document.head.appendChild(A),e.classList.add(p);function O(g,w){g.style.setProperty("--ssd-len",String(v[w])),g.style.strokeDasharray=`${v[w]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(i);}T.forEach(O);let R=false,L=-1;function k(){if(L>=0)return L;let g=e.getBoundingClientRect(),{tStart:w,tEnd:N}=Fe({top:g.top,height:g.height},ze(),xt(),Le,se);return I(ee(ze(),w,N,a))}return {destroy(){e.classList.remove(p),T.forEach(g=>{g.classList.remove(i),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),A.remove();},replay(){R=false,L=-1,T.forEach(O);},pause(){R=true,T.forEach(g=>{g.style.animationPlayState="paused";});},resume(){R&&(R=false,T.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let w=Math.min(1,Math.max(0,g));L=w,R=true,T.forEach((N,he)=>{N.classList.remove(i),N.style.strokeDashoffset=h==="reverse"?`${v[he]*w}`:`${v[he]*(1-w)}`,f&&(N.style.opacity=h==="reverse"?`${1-w}`:`${w}`);});},getProgress(){return k()},refresh(){T.forEach((g,w)=>{v[w]=_e(g),g.style.setProperty("--ssd-len",String(v[w])),g.style.strokeDasharray=`${v[w]}`;});}}}if(Jt())return mt(er());function tr(){let s=Math.max(1,Ze),i=D?s:s*(1+Math.max(0,T.length-1)*$),p=0,P=0,G=false;function ye(L){let k=true,g=Math.min(1,Math.max(0,L/i));if(D){let w=Math.min(1,Math.max(0,L/s)),N=I(w);ce=N,e.style.setProperty("--scroll-draw-progress",String(N)),e.style.clipPath=le(h==="reverse"?1-N:N),Pe?.(N),w<1&&(k=false);}else {T.forEach((N,he)=>{let nr=he*$*s,kt=Math.min(1,Math.max(0,(L-nr)/s));pt(N,he,I(kt),h),kt<1&&(k=false);});let w=I(g);ce=w,Pe?.(w),e.style.setProperty("--scroll-draw-progress",String(w));}if(Q){let w=I(g);for(let N in Q){let he=parseFloat(N);w>=he&&!Se.has(he)&&(Se.add(he),Q[N]?.());}}return k}function q(L){if(C)return;let k=L-p;E||(E=true,H?.());let g=ye(k);if(g&&!b){b=true,ye(i),V?.(),ge<(me==="infinite"?1/0:me??0)&&(ge++,Ee=setTimeout(()=>{p=performance.now(),E=false,b=false,Se.clear(),We(),y=requestAnimationFrame(q);},Me));return}g||(y=requestAnimationFrame(q));}function M(){cancelAnimationFrame(y),clearTimeout(Ee),p=performance.now(),P=0,C=false,E=false,b=false,ge=0,G=true,ce=0,Se.clear(),We(),y=requestAnimationFrame(q);}let A=new IntersectionObserver(L=>{L.forEach(k=>{k.isIntersecting&&!(fe&&b)?M():!k.isIntersecting&&!fe&&!b&&(cancelAnimationFrame(y),clearTimeout(Ee),G=false);});},{root:_??null,threshold:j,rootMargin:Ye}),O;function R(){clearTimeout(O),O=setTimeout(()=>{T.forEach((L,k)=>{v[k]=_e(L),L.style.strokeDasharray=`${v[k]}`;});},150);}return window.addEventListener("resize",R),window.addEventListener("orientationchange",R),be>0?setTimeout(()=>A.observe(e),be):A.observe(e),{destroy(){cancelAnimationFrame(y),clearTimeout(Ee),A.disconnect(),window.removeEventListener("resize",R),window.removeEventListener("orientationchange",R),clearTimeout(O);},replay(){ge=0,M();},pause(){C||!G||(C=true,P=performance.now()-p,cancelAnimationFrame(y));},resume(){C&&(C=false,G=true,p=performance.now()-P,y=requestAnimationFrame(q));},seek(L){let k=Math.min(1,Math.max(0,L));ce=k,C=true,P=k*i,p=performance.now()-P,cancelAnimationFrame(y),ye(P);},getProgress(){return ce},refresh(){clearTimeout(O),T.forEach((L,k)=>{v[k]=_e(L),L.style.strokeDasharray=`${v[k]}`;});}}}if(Ve)return mt(tr());Mt();function Lt(){if(C||!Re)return;let s=performance.now(),i=ze();if(!xe&&F===false&&i===Et){gt(i);return}xe=false,Et=i;let p=a;if(F!==false){let M=s-St,A=M>0?Math.abs(i-(Je<0?i:Je))/M:0;p=a*Math.max(.2,1+A*(typeof F=="number"?F:1)*.04);}Je=i,St=s;let P=Ie?Ke===-1||i>=Ke?"forward":"reverse":h;Ke=i;let G=l-W,ye=true,q=G===0?0:(i-W)/G;if(isNaN(Oe)||(Oe<=0&&q>0?ne?.():Oe>0&&q<=0&&Ce?.(),Oe<1&&q>=1?Ae?.():Oe>=1&&q<1&&oe?.()),Oe=q,D){let M=Pt(0,ee(i,W,l,p));ce=M,e.style.setProperty("--scroll-draw-progress",String(M));let A=P==="reverse"?1-M:M;e.style.clipPath=le(A),Pe?.(M),!E&&ee(i,W,l,p)>0&&(E=true,H?.()),M>=1&&!b?(b=true,V?.(),ge<(me==="infinite"?1/0:me??0)&&(ge++,Ee=setTimeout(()=>{K=-1,J=[],E=false,b=false,We();},Me))):M<1&&!fe&&(b=false),gt(i);return}if(T.forEach((M,A)=>{let O=A*m*G,R=Pt(A,ee(i,W+O,l+O,p));pt(M,A,R,P),A===0&&(ce=R,Pe?.(R),e.style.setProperty("--scroll-draw-progress",String(R))),R<1&&(ye=false);}),Q){let M=I(ee(i,W,l,p));for(let A in Q){let O=parseFloat(A);M>=O&&!Se.has(O)&&(Se.add(O),Q[A]?.());}}!E&&ee(i,W,l,p)>0&&(E=true,H?.()),ye&&!b?(b=true,V?.(),ge<(me==="infinite"?1/0:me??0)&&(ge++,Ee=setTimeout(()=>{K=-1,J=[],E=false,b=false,Se.clear(),We(),xe=true;},Me))):!ye&&!fe&&(b=false),gt(i);}function dt(s){return s>=l&&s<de}function gt(s){S||dt(s)?y=requestAnimationFrame(Lt):Re=false;}function yt(){return S||dt(ze())}let Re=false;function et(){Re||(Re=true,y=requestAnimationFrame(function(){Lt();}));}function tt(){Re=false,cancelAnimationFrame(y);}let ht=new IntersectionObserver(s=>{s.forEach(i=>{S=i.isIntersecting,S&&!C?(xe=true,et()):Re&&!C&&dt(ze())||tt();});},{root:_??null,threshold:j,rootMargin:Ye});function $t(){T.forEach((s,i)=>{v[i]=_e(s),s.style.strokeDasharray=`${v[i]}`;}),Mt(),xe=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout($t,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let rr=lt([e],Ge);return be>0?setTimeout(()=>ht.observe(e),be):ht.observe(e),mt({destroy(){cancelAnimationFrame(y),clearTimeout(Ee),tt(),ht.disconnect(),rr(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),vt();},replay(){K=-1,J=[],Ke=-1,Je=-1,E=false,b=false,ge=0,C=false,ce=0,Se.clear(),clearTimeout(Ee),We(),xe=true,yt()&&et();},pause(){C=true,tt();},resume(){C&&(C=false,xe=true,yt()&&et());},seek(s){let i=Math.min(1,Math.max(0,s));ce=i,K=i,J=[],C=true,tt(),Kt(i,h),xe=true;},getProgress(){return ce},refresh(){clearTimeout(rt),$t(),yt()&&!C&&et();}},()=>({tStart:W,tEnd:l}))}function br(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Bt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],u=t[2].trim();if(u)for(let a of u.split(/[\s,]+/)){let f=a.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),c.push(f?f[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function wr(e,n,r){let t=Bt(e),o=Bt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,u)=>{let a=o[u];return c.fn!==a.fn||c.nums.length!==a.nums.length?r<1?`${c.fn}(${c.nums.map((f,d)=>`${f}${c.units[d]}`).join(", ")})`:`${a.fn}(${a.nums.map((f,d)=>`${f}${a.units[d]}`).join(", ")})`:`${c.fn}(${c.nums.map((f,d)=>`${f+(a.nums[d]-f)*r}${c.units[d]}`).join(", ")})`}).join(" ")}function wt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(br(t))return ot(t,o,r);if(t.includes("("))return wr(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&u){let a=parseFloat(c[1]),f=parseFloat(u[1]);return `${a+(f-a)*r}${c[2]||u[2]}`}return r<1?t:o}function vr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Sr=0,Qt="--scroll-draw-progress";function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function He(e,n){return typeof window>"u"?Ut:n.respectReducedMotion===false?jt(e,n,false):ct(n,(r,t)=>jt(e,r,t))}function jt(e,n,r){let{props:t,trigger:o={},easing:c="ease-out",speed:u=1,once:a=false,axis:f="y",scrollContainer:d,native:x=true,velocityScale:$=false,triggerElement:h,onProgress:fe,onComplete:ke,onEnter:Z,onLeave:De,onEnterBack:Ie,onLeaveBack:be}=n,B=typeof c=="function"?c:Te[c]??Te["ease-out"],te=Ne(o.start||"top bottom"),re=Ne(o.end||"bottom top"),Q=h??e,F=typeof d=="string"?document.querySelector(d):d??null,j=Object.entries(t).map(([l,m])=>({prop:vr(l),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function Ye(){let l=window.getComputedStyle(e);for(let m of j)m.from===""&&(m.from=l.getPropertyValue(m.prop).trim()||"0");}function me(){for(let l of j)e.style.setProperty(l.prop,String(l.to));}let Me=new Map;for(let l of [...j.map(m=>m.prop),Qt])Me.set(l,e.style.getPropertyValue(l));function U(){for(let[l,m]of Me)m?e.style.setProperty(l,m):e.style.removeProperty(l);}if(r)return me(),ke?.(),{...Ut,destroy:U,getProgress:()=>1};Ye();let we=()=>F?f==="x"?F.scrollLeft:F.scrollTop:f==="x"?window.scrollX:window.scrollY,Ve=()=>F?f==="x"?F.clientWidth:F.clientHeight:f==="x"?window.innerWidth:window.innerHeight,Ze=typeof c=="string"?st(c):null;function ut(){if(!x||!xr()||!Ze||f!=="y"||F||Q!==e||a||u!==1||fe||ke||Z||De||Ie||be||$!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of j)if(!Er.has(l.prop))return false;return true}function Pe(){let l=`ssd-a-${++Sr}`,m=j.map(S=>`${S.prop}:${S.from}`).join(";"),de=j.map(S=>`${S.prop}:${S.to}`).join(";"),b=document.createElement("style");b.setAttribute("data-ssd-animate",""),b.textContent=`@keyframes ${l}{from{${m}}to{${de}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ze};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(b),e.classList.add(l);let E=()=>{let S=e.getBoundingClientRect();return Fe({top:S.top,height:S.height},we(),Ve(),te,re)};Be(e,{type:"animate",getProgress:()=>y.getProgress(),getTrigger:E});let y={refresh(){},destroy(){e.classList.remove(l),b.remove(),e.style.animationPlayState="",U(),Qe(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(S){let K=Math.min(1,Math.max(0,S));e.classList.remove(l);for(let J of j)e.style.setProperty(J.prop,wt(J.from,J.to,K));},getProgress(){let{tStart:S,tEnd:K}=E();return B(ee(we(),S,K,u))}};return y}if(ut())return Pe();let H=0,V=0,ne=0,Ae=false,oe=false,Ce=-1,D=0,I=0,Le=false,se=NaN,_=-1,pe=0,X=Q===e?j:[],ie=false;function ae(){let l=e.style,m=X.map(y=>l.getPropertyValue(y.prop)),de=l.transition;X.length&&(l.transition="none"),X.forEach(y=>l.setProperty(y.prop,Me.get(y.prop)??""));let b=nt(Q,F,f);X.forEach((y,S)=>l.setProperty(y.prop,m[S])),X.length&&(e.offsetWidth,l.transition=de);let E=Fe(b,b.scroll,Ve(),te,re);ie&&Math.abs(E.tStart-H)<1&&Math.abs(E.tEnd-V)<1||(ie=true,H=E.tStart,V=E.tEnd);}function Y(l){e.style.setProperty(Qt,String(l));for(let m of j)e.style.setProperty(m.prop,wt(m.from,m.to,l));fe?.(l);}function ve(l){if(isNaN(se)){se=l;return}se<=0&&l>0?Z?.():se>0&&l<=0&&be?.(),se<1&&l>=1?De?.():se>=1&&l<1&&Ie?.(),se=l;}function le(){if(!Ae||oe)return;let l=performance.now(),m=we(),de=u;if($!==false){let S=l-pe,K=S>0?Math.abs(m-(_<0?m:_))/S:0;de=u*Math.max(.2,1+K*(typeof $=="number"?$:1)*.04);}_=m,pe=l;let b=V===H?0:(m-H)/(V-H);ve(b);let E=ee(m,H,V,de),y=a?Math.max(Ce,B(D=Math.max(D,E))):B(E);I=y,Y(y),y>=1&&!Le?(Le=true,ke?.()):y<1&&!a&&(Le=false),ne=requestAnimationFrame(le);}ae(),V===H&&ue("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),D=ee(we(),H,V,u),I=B(D),Y(I);let T=new IntersectionObserver(l=>{l.forEach(m=>{Ae=m.isIntersecting,Ae&&!oe?ne=requestAnimationFrame(le):cancelAnimationFrame(ne);});},{root:F??null}),v;function z(){clearTimeout(v),v=setTimeout(ae,150);}window.addEventListener("resize",z),window.addEventListener("orientationchange",z);let W=lt([Q],z);return T.observe(e),Be(e,{type:"animate",getProgress:()=>I,getTrigger:()=>({tStart:H,tEnd:V})}),{destroy(){cancelAnimationFrame(ne),T.disconnect(),window.removeEventListener("resize",z),window.removeEventListener("orientationchange",z),W(),clearTimeout(v),U(),Qe(e);},replay(){Ce=-1,D=0,Le=false,I=0,oe=false,Y(0);},pause(){oe=true,cancelAnimationFrame(ne);},resume(){oe&&(oe=false,Ae&&(ne=requestAnimationFrame(le)));},seek(l){let m=Math.min(1,Math.max(0,l));I=m,Ce=m,D=0,oe=true,cancelAnimationFrame(ne),Y(m);},getProgress(){return I},refresh(){ae();}}}var Xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Yt(e,n={}){if(typeof window>"u")return Xt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ue("scrollParallax: element not found:",e),Xt;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:u,onProgress:a}=n,f=-t*100,d=r.style,x=!!r.ownerSVGElement,$=d.getPropertyValue("transform-box");x&&d.setProperty("transform-box","fill-box");let h=He(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${f}%)`]}:{transform:["translateY(0%)",`translateY(${f}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:a});return x?{...h,destroy(){h.destroy(),d.setProperty("transform-box",$);}}:h}function Xe(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var $e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e).map(t=>bt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function yn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e);if(r.length===0)return $e;let t=0,o=[];function c(a){return bt(r[a],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(a+1,r.length-1),t>a&&o[t]?.resume();}})}function u(){r.forEach((a,f)=>{o[f]=c(f);});for(let a=1;a<o.length;a++)o[a].pause();}return u(),{destroy(){o.forEach(a=>a.destroy()),o.length=0;},replay(){o.forEach(a=>a.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(a){o[t]?.seek(a);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(a=>a.refresh?.());}}}function hn(e,n){if(typeof window>"u")return $e;let r=Xe(e).map(t=>He(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function bn(e,n){if(typeof window>"u")return $e;let r=Xe(e);if(r.length===0)return $e;let t=0,o=[];function c(a){return He(r[a],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(a+1,r.length-1),t>a&&o[t]?.resume();}})}function u(){r.forEach((a,f)=>{o[f]=c(f);});for(let a=1;a<o.length;a++)o[a].pause();}return u(),{destroy(){o.forEach(a=>a.destroy()),o.length=0;},replay(){o.forEach(a=>a.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(a){o[t]?.seek(a);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(a=>a.refresh?.());}}}function wn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e).map(t=>Yt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=hn;exports.scrollAnimateSequence=bn;exports.scrollDrawGroup=gn;exports.scrollDrawSequence=yn;exports.scrollParallaxGroup=wn;
@@ -74,7 +74,9 @@ declare function scrollAnimateGroup(targets: Array<string | Element>, options: S
74
74
  declare function scrollAnimateSequence(targets: Array<string | Element>, options: ScrollAnimateOptions): ScrollDrawInstance;
75
75
  /**
76
76
  * Apply a parallax effect to multiple elements simultaneously.
77
- * Each element moves at `speed × elementHeight` pixels independently.
77
+ * Each element travels `speed × its own height` over its trigger window,
78
+ * independently: a positive speed moves it up as the page scrolls down, ahead
79
+ * of the page; a negative one moves it down, so it lags behind.
78
80
  *
79
81
  * @example
80
82
  * import { scrollParallaxGroup } from 'svg-scroll-draw/group';
@@ -82,7 +84,7 @@ declare function scrollAnimateSequence(targets: Array<string | Element>, options
82
84
  * // Three background layers at the same speed
83
85
  * scrollParallaxGroup(['#layer-far', '#layer-mid', '#layer-near'], { speed: 0.4 });
84
86
  *
85
- * // Opposite direction (floats upward as you scroll down)
87
+ * // Negative: they move down, lagging behind the page as it scrolls
86
88
  * scrollParallaxGroup(['#badge', '#tag'], { speed: -0.2 });
87
89
  */
88
90
  declare function scrollParallaxGroup(targets: Array<string | Element>, options?: ScrollParallaxOptions): ScrollDrawInstance;
@@ -74,7 +74,9 @@ declare function scrollAnimateGroup(targets: Array<string | Element>, options: S
74
74
  declare function scrollAnimateSequence(targets: Array<string | Element>, options: ScrollAnimateOptions): ScrollDrawInstance;
75
75
  /**
76
76
  * Apply a parallax effect to multiple elements simultaneously.
77
- * Each element moves at `speed × elementHeight` pixels independently.
77
+ * Each element travels `speed × its own height` over its trigger window,
78
+ * independently: a positive speed moves it up as the page scrolls down, ahead
79
+ * of the page; a negative one moves it down, so it lags behind.
78
80
  *
79
81
  * @example
80
82
  * import { scrollParallaxGroup } from 'svg-scroll-draw/group';
@@ -82,7 +84,7 @@ declare function scrollAnimateSequence(targets: Array<string | Element>, options
82
84
  * // Three background layers at the same speed
83
85
  * scrollParallaxGroup(['#layer-far', '#layer-mid', '#layer-near'], { speed: 0.4 });
84
86
  *
85
- * // Opposite direction (floats upward as you scroll down)
87
+ * // Negative: they move down, lagging behind the page as it scrolls
86
88
  * scrollParallaxGroup(['#badge', '#tag'], { speed: -0.2 });
87
89
  */
88
90
  declare function scrollParallaxGroup(targets: Array<string | Element>, options?: ScrollParallaxOptions): ScrollDrawInstance;
@@ -1 +1 @@
1
- import {b as b$1}from'../chunk-GVBO5GRD.mjs';import {a as a$1}from'../chunk-LTCJVVSC.mjs';import {b}from'../chunk-HX4SP5WN.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.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';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
1
+ import {b as b$1}from'../chunk-ETACBG7W.mjs';import {a as a$1}from'../chunk-V4L3ELVC.mjs';import {b}from'../chunk-23EALNDF.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-YZV4Z3EQ.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';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
@@ -1 +1 @@
1
- 'use strict';function Qe({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,a=[];for(let l=0;l<n;l++){let d=Math.pow(o,l);a.push(d),s+=d;}let f=[0],c=0;for(let l=0;l<n;l++)c+=a[l]/s,f.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let d=0;d<n;d++)if(l<=f[d+1]){let E=(l-f[d])/(f[d+1]-f[d]);if(d===0)return E*(2-E);let x=1-Math.pow(r,d);return x+(1-x)*(2*E-1)*(2*E-1)}return 1}}function qe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+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:Qe(),elastic:qe()};function we(e,t,n){return Math.min(n,Math.max(t,e))}function ce(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 ve(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 Se(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,n,r){return n===t?0:we((e-t)/(n-t)*r,0,1)}function me(e,t,n,r,o){let s=ve(e.top,e.height,t,r.element)-Se(r.viewport,n),a=ve(e.top,e.height,t,o.element)-Se(o.viewport,n);return {tStart:s,tEnd:a}}function Me(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left+t.scrollLeft:r.top-t.getBoundingClientRect().top+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function Le(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 Te(e,t,n){let r=Le(e),o=Le(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var je="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ge="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xe=33;function Xe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ue(e){let t=[];for(let n=0;n<xe;n++){let r=n/(xe-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return je;case "ease-out":return Ge;case "ease-in-out":return Xe()?Ue(q["ease-in-out"]):null;default:return null}}var Re=Symbol.for("svg-scroll-draw.registry");function $e(){let e=globalThis;return e[Re]||(e[Re]=new Map)}function fe(e,t){$e().set(e,t);}function de(e){$e().delete(e);}var Ye=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){Ye&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var G,ee=new Set,te=new WeakMap,X=new Map,Ae=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(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 ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();G??(G=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)te.get(a)!==Ae(a)&&(s=true),te.set(a,"");s&&ee.forEach(a=>a());})),ee.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{te.has(o)||te.set(o,Ae(o)),X.set(o,(X.get(o)??0)+1),G.observe(o);}),()=>{ee.delete(n)&&(r.forEach(o=>{let s=(X.get(o)??1)-1;if(s)return void X.set(o,s);X.delete(o),G?.unobserve(o);}),ee.size||(G?.disconnect(),G=void 0));}}function Ce(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.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 Ie(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Ce(s=>{if(!s)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...a)=>n[s]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}function Ze(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let f of a.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Je(e,t,n){let r=_e(e),o=_e(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let f=o[a];return s.fn!==f.fn||s.nums.length!==f.nums.length?n<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,l)=>`${c}${f.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(f.nums[l]-c)*n}${s.units[l]}`).join(", ")})`}).join(" ")}function Oe(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Ze(r))return Te(r,o,n);if(r.includes("("))return Je(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let f=parseFloat(s[1]),c=parseFloat(a[1]);return `${f+(c-f)*n}${s[2]||a[2]}`}return n<1?r:o}function et(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var tt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nt=0,He="--scroll-draw-progress";function rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,t){return typeof window>"u"?ze:t.respectReducedMotion===false?ke(e,t,false):Ie(t,(n,r)=>ke(e,n,r))}function ke(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:f=false,axis:c="y",scrollContainer:l,native:d=true,velocityScale:E=false,triggerElement:x,onProgress:_,onComplete:$,onEnter:S,onLeave:b,onEnterBack:F,onLeaveBack:M}=t,O=typeof s=="function"?s:q[s]??q["ease-out"],H=ce(o.start??"top bottom"),D=ce(o.end??"bottom top"),P=x??e,w=typeof l=="string"?document.querySelector(l):l??null,g=Object.entries(r).map(([i,u])=>({prop:et(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function V(){let i=window.getComputedStyle(e);for(let u of g)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function U(){for(let i of g)e.style.setProperty(i.prop,String(i.to));}let m=new Map;for(let i of [...g.map(u=>u.prop),He])m.set(i,e.style.getPropertyValue(i));function p(){for(let[i,u]of m)u?e.style.setProperty(i,u):e.style.removeProperty(i);}if(n)return U(),$?.(),{...ze,destroy:p,getProgress:()=>1};V();let ge=typeof s=="string"?Pe(s):null;function We(){if(!d||!rt()||!ge||c!=="y"||w||P!==e||f||a!==1||_||$||S||b||F||M||E!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let i of g)if(!tt.has(i.prop))return false;return true}function Fe(){let i=`ssd-a-${++nt}`,u=g.map(y=>`${y.prop}:${y.from}`).join(";"),N=g.map(y=>`${y.prop}:${y.to}`).join(";"),T=document.createElement("style");T.setAttribute("data-ssd-animate",""),T.textContent=`@keyframes ${i}{from{${u}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(i);let h=()=>c==="x"?window.scrollX:window.scrollY,v=()=>c==="x"?window.innerWidth:window.innerHeight,W=()=>{let y=e.getBoundingClientRect();return me({top:y.top,height:y.height},h(),v(),H,D)};fe(e,{type:"animate",getProgress:()=>ae.getProgress(),getTrigger:W});let ae={refresh(){},destroy(){e.classList.remove(i),T.remove(),e.style.animationPlayState="",p(),de(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(y){let ue=Math.min(1,Math.max(0,y));e.classList.remove(i);for(let le of g)e.style.setProperty(le.prop,Oe(le.from,le.to,ue));},getProgress(){let{tStart:y,tEnd:ue}=W();return O(J(h(),y,ue,a))}};return ae}if(We())return Fe();let L=0,R=0,A=0,Y=false,C=false,k=-1,z=0,K=false,I=NaN,re=-1,be=0,he=()=>w?c==="x"?w.scrollLeft:w.scrollTop:c==="x"?window.scrollX:window.scrollY,De=()=>w?c==="x"?w.clientWidth:w.clientHeight:c==="x"?window.innerWidth:window.innerHeight,B=P===e?g:[],ye=false;function oe(){let i=e.style,u=B.map(v=>i.getPropertyValue(v.prop)),N=i.transition;B.length&&(i.transition="none"),B.forEach(v=>i.setProperty(v.prop,m.get(v.prop)??""));let T=Me(P,w,c);B.forEach((v,W)=>i.setProperty(v.prop,u[W])),B.length&&(e.offsetWidth,i.transition=N);let h=me(T,T.scroll,De(),H,D);ye&&Math.abs(h.tStart-L)<1&&Math.abs(h.tEnd-R)<1||(ye=true,L=h.tStart,R=h.tEnd);}function Z(i){e.style.setProperty(He,String(i));for(let u of g)e.style.setProperty(u.prop,Oe(u.from,u.to,i));_?.(i);}function Ve(i){if(isNaN(I)){I=i;return}I<=0&&i>0?S?.():I>0&&i<=0&&M?.(),I<1&&i>=1?b?.():I>=1&&i<1&&F?.(),I=i;}function ie(){if(!Y||C)return;let i=performance.now(),u=he(),N=a;if(E!==false){let v=i-be,W=v>0?Math.abs(u-(re<0?u:re))/v:0;N=a*Math.max(.2,1+W*(typeof E=="number"?E:1)*.04);}re=u,be=i;let T=R===L?0:(u-L)/(R-L);Ve(T);let h=O(J(u,L,R,N));f&&(k=Math.max(k,h),h=k),z=h,Z(h),h>=1&&!K?(K=true,$?.()):h<1&&!f&&(K=false),A=requestAnimationFrame(ie);}oe(),R===L&&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 i=O(J(he(),L,R,a));f&&i>0&&(k=i),z=i,Z(i);}let Ee=new IntersectionObserver(i=>{i.forEach(u=>{Y=u.isIntersecting,Y&&!C?A=requestAnimationFrame(ie):cancelAnimationFrame(A);});},{root:w??null}),se;function Q(){clearTimeout(se),se=setTimeout(oe,150);}window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q);let Be=ne([P],Q);return Ee.observe(e),fe(e,{type:"animate",getProgress:()=>z,getTrigger:()=>({tStart:L,tEnd:R})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),Be(),clearTimeout(se),p(),de(e);},replay(){k=-1,K=false,z=0,C=false,Z(0);},pause(){C=true,cancelAnimationFrame(A);},resume(){C&&(C=false,Y&&(A=requestAnimationFrame(ie)));},seek(i){let u=Math.min(1,Math.max(0,i));z=u,k=u,C=true,cancelAnimationFrame(A),Z(u);},getProgress(){return z},refresh(){oe();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function Ct(e,t={}){if(typeof window>"u")return Ne;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollHorizontal: track element not found:",e),Ne;let r=n,{easing:o="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:c}=t,l=typeof a=="string"?document.querySelector(a):a??null;function d(){for(let m=r.parentElement;m;m=m.parentElement)if(window.getComputedStyle(m).position==="sticky")return m;return null}function E(){let m=d();if(m){let p=window.getComputedStyle(m);return m.clientWidth-(parseFloat(p.paddingLeft)||0)-(parseFloat(p.paddingRight)||0)}return l?l.clientWidth:document.documentElement.clientWidth||window.innerWidth}function x(){return t.distance??r.scrollWidth-E()}function _(){if(t.triggerElement!==void 0){let p=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(p)return p;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=d();return m?m.parentElement??m:r}let $=x(),S=_(),b=pe(r,O($,S)),F=H(),M=null;function O(m,p){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:s,easing:o,native:false,respectReducedMotion:f,...p!==r&&{triggerElement:p},...a!==void 0&&{scrollContainer:a},...c!==void 0&&{onProgress:c}}}function H(){let m=S.getBoundingClientRect(),p=l?m.top-l.getBoundingClientRect().top+l.scrollTop:m.top+window.scrollY;return `${x()} ${Math.round(p)} ${Math.round(m.height)}`}function D(){b.destroy();let m=_(),p=m!==S;$=x(),S=m,b=pe(r,O($,S)),F=H(),M!==null&&b.seek(M),p&&U();}let P;function w(){(_()!==S||H()!==F)&&D();}function g(){clearTimeout(P),P=setTimeout(w,150);}window.addEventListener("resize",g),window.addEventListener("orientationchange",g);let V=()=>{};function U(){V(),V=ne([r,S],g);}return U(),{destroy(){clearTimeout(P),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),V(),b.destroy();},replay(){M=null,b.replay();},pause(){b.pause(),M=b.getProgress();},resume(){M=null,b.resume();},seek(m){b.seek(m),M=b.getProgress();},getProgress(){return b.getProgress()},refresh(){D();}}}exports.scrollHorizontal=Ct;
1
+ 'use strict';function Be({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,a=[];for(let c=0;c<n;c++){let p=Math.pow(o,c);a.push(p),s+=p;}let f=[0],m=0;for(let c=0;c<n;c++)m+=a[c]/s,f.push(m);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<n;p++)if(c<=f[p+1]){let E=(c-f[p])/(f[p+1]-f[p]);if(p===0)return E*(2-E);let x=1-Math.pow(r,p);return x+(1-x)*(2*E-1)*(2*E-1)}return 1}}function Qe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+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:Be(),elastic:Qe()};function we(e,t,n){return Math.min(n,Math.max(t,e))}function le(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 ve(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 Se(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 te(e,t,n,r){return n===t?0:we((e-t)/(n-t)*r,0,1)}function me(e,t,n,r,o){let s=ve(e.top,e.height,t,r.element)-Se(r.viewport,n),a=ve(e.top,e.height,t,o.element)-Se(o.viewport,n);return {tStart:s,tEnd:a}}function Me(e,t,n){let r=e.getBoundingClientRect(),o=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:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function Le(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 Te(e,t,n){let r=Le(e),o=Le(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var qe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",je="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xe=33;function Ge(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ue(e){let t=[];for(let n=0;n<xe;n++){let r=n/(xe-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return qe;case "ease-out":return je;case "ease-in-out":return Ge()?Ue(q["ease-in-out"]):null;default:return null}}var Re=Symbol.for("svg-scroll-draw.registry");function $e(){let e=globalThis;return e[Re]||(e[Re]=new Map)}function fe(e,t){$e().set(e,t);}function de(e){$e().delete(e);}var Xe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){Xe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var G,ne=new Set,re=new WeakMap,U=new Map,Ae=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(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 oe(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();G??(G=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)re.get(a)!==Ae(a)&&(s=true),re.set(a,"");s&&ne.forEach(a=>a());})),ne.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{re.has(o)||re.set(o,Ae(o)),U.set(o,(U.get(o)??0)+1),G.observe(o);}),()=>{ne.delete(n)&&(r.forEach(o=>{let s=(U.get(o)??1)-1;if(s)return void U.set(o,s);U.delete(o),G?.unobserve(o);}),ne.size||(G?.disconnect(),G=void 0));}}function Ce(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.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 Ie(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Ce(s=>{if(!s)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...a)=>n[s]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}function Ye(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let f of a.split(/[\s,]+/)){let m=f.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Ze(e,t,n){let r=_e(e),o=_e(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let f=o[a];return s.fn!==f.fn||s.nums.length!==f.nums.length?n<1?`${s.fn}(${s.nums.map((m,c)=>`${m}${s.units[c]}`).join(", ")})`:`${f.fn}(${f.nums.map((m,c)=>`${m}${f.units[c]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,c)=>`${m+(f.nums[c]-m)*n}${s.units[c]}`).join(", ")})`}).join(" ")}function Oe(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Ye(r))return Te(r,o,n);if(r.includes("("))return Ze(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let f=parseFloat(s[1]),m=parseFloat(a[1]);return `${f+(m-f)*n}${s[2]||a[2]}`}return n<1?r:o}function Je(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var et=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tt=0,ke="--scroll-draw-progress";function nt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,t){return typeof window>"u"?ze:t.respectReducedMotion===false?He(e,t,false):Ie(t,(n,r)=>He(e,n,r))}function He(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:f=false,axis:m="y",scrollContainer:c,native:p=true,velocityScale:E=false,triggerElement:x,onProgress:k,onComplete:$,onEnter:v,onLeave:y,onEnterBack:F,onLeaveBack:M}=t,A=typeof s=="function"?s:q[s]??q["ease-out"],H=le(o.start||"top bottom"),W=le(o.end||"bottom top"),P=x??e,w=typeof c=="string"?document.querySelector(c):c??null,b=Object.entries(r).map(([i,u])=>({prop:Je(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function D(){let i=window.getComputedStyle(e);for(let u of b)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function X(){for(let i of b)e.style.setProperty(i.prop,String(i.to));}let l=new Map;for(let i of [...b.map(u=>u.prop),ke])l.set(i,e.style.getPropertyValue(i));function g(){for(let[i,u]of l)u?e.style.setProperty(i,u):e.style.removeProperty(i);}if(n)return X(),$?.(),{...ze,destroy:g,getProgress:()=>1};D();let K=()=>w?m==="x"?w.scrollLeft:w.scrollTop:m==="x"?window.scrollX:window.scrollY,ge=()=>w?m==="x"?w.clientWidth:w.clientHeight:m==="x"?window.innerWidth:window.innerHeight,be=typeof s=="string"?Pe(s):null;function Fe(){if(!p||!nt()||!be||m!=="y"||w||P!==e||f||a!==1||k||$||v||y||F||M||E!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let i of b)if(!et.has(i.prop))return false;return true}function We(){let i=`ssd-a-${++tt}`,u=b.map(d=>`${d.prop}:${d.from}`).join(";"),N=b.map(d=>`${d.prop}:${d.to}`).join(";"),T=document.createElement("style");T.setAttribute("data-ssd-animate",""),T.textContent=`@keyframes ${i}{from{${u}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${be};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(i);let S=()=>{let d=e.getBoundingClientRect();return me({top:d.top,height:d.height},K(),ge(),H,W)};fe(e,{type:"animate",getProgress:()=>h.getProgress(),getTrigger:S});let h={refresh(){},destroy(){e.classList.remove(i),T.remove(),e.style.animationPlayState="",g(),de(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let Q=Math.min(1,Math.max(0,d));e.classList.remove(i);for(let ee of b)e.style.setProperty(ee.prop,Oe(ee.from,ee.to,Q));},getProgress(){let{tStart:d,tEnd:Q}=S();return A(te(K(),d,Q,a))}};return h}if(Fe())return We();let L=0,R=0,C=0,Y=false,I=false,ie=-1,z=0,_=0,Z=false,O=NaN,se=-1,ye=0,V=P===e?b:[],he=false;function ae(){let i=e.style,u=V.map(h=>i.getPropertyValue(h.prop)),N=i.transition;V.length&&(i.transition="none"),V.forEach(h=>i.setProperty(h.prop,l.get(h.prop)??""));let T=Me(P,w,m);V.forEach((h,d)=>i.setProperty(h.prop,u[d])),V.length&&(e.offsetWidth,i.transition=N);let S=me(T,T.scroll,ge(),H,W);he&&Math.abs(S.tStart-L)<1&&Math.abs(S.tEnd-R)<1||(he=true,L=S.tStart,R=S.tEnd);}function J(i){e.style.setProperty(ke,String(i));for(let u of b)e.style.setProperty(u.prop,Oe(u.from,u.to,i));k?.(i);}function De(i){if(isNaN(O)){O=i;return}O<=0&&i>0?v?.():O>0&&i<=0&&M?.(),O<1&&i>=1?y?.():O>=1&&i<1&&F?.(),O=i;}function ue(){if(!Y||I)return;let i=performance.now(),u=K(),N=a;if(E!==false){let d=i-ye,Q=d>0?Math.abs(u-(se<0?u:se))/d:0;N=a*Math.max(.2,1+Q*(typeof E=="number"?E:1)*.04);}se=u,ye=i;let T=R===L?0:(u-L)/(R-L);De(T);let S=te(u,L,R,N),h=f?Math.max(ie,A(z=Math.max(z,S))):A(S);_=h,J(h),h>=1&&!Z?(Z=true,$?.()):h<1&&!f&&(Z=false),C=requestAnimationFrame(ue);}ae(),R===L&&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),z=te(K(),L,R,a),_=A(z),J(_);let Ee=new IntersectionObserver(i=>{i.forEach(u=>{Y=u.isIntersecting,Y&&!I?C=requestAnimationFrame(ue):cancelAnimationFrame(C);});},{root:w??null}),ce;function B(){clearTimeout(ce),ce=setTimeout(ae,150);}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let Ve=oe([P],B);return Ee.observe(e),fe(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:L,tEnd:R})}),{destroy(){cancelAnimationFrame(C),Ee.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),Ve(),clearTimeout(ce),g(),de(e);},replay(){ie=-1,z=0,Z=false,_=0,I=false,J(0);},pause(){I=true,cancelAnimationFrame(C);},resume(){I&&(I=false,Y&&(C=requestAnimationFrame(ue)));},seek(i){let u=Math.min(1,Math.max(0,i));_=u,ie=u,z=0,I=true,cancelAnimationFrame(C),J(u);},getProgress(){return _},refresh(){ae();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function At(e,t={}){if(typeof window>"u")return Ne;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollHorizontal: track element not found:",e),Ne;let r=n,{easing:o="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:m}=t,c=typeof a=="string"?document.querySelector(a):a??null;function p(){for(let l=r.parentElement;l;l=l.parentElement)if(window.getComputedStyle(l).position==="sticky")return l;return null}function E(){let l=p();if(l){let g=window.getComputedStyle(l);return l.clientWidth-(parseFloat(g.paddingLeft)||0)-(parseFloat(g.paddingRight)||0)}return c?c.clientWidth:document.documentElement.clientWidth||window.innerWidth}function x(){return t.distance??r.scrollWidth-E()}function k(){if(t.triggerElement!==void 0){let g=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(g)return g;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let l=p();return l?l.parentElement??l:r}let $=x(),v=k(),y=pe(r,A($,v)),F=H(),M=null;function A(l,g){return {props:{transform:["translateX(0px)",`translateX(${-l}px)`]},trigger:s,easing:o,native:false,respectReducedMotion:f,...g!==r&&{triggerElement:g},...a!==void 0&&{scrollContainer:a},...m!==void 0&&{onProgress:m}}}function H(){let l=v.getBoundingClientRect(),g=c?l.top-c.getBoundingClientRect().top+c.scrollTop:l.top+window.scrollY;return `${x()} ${Math.round(g)} ${Math.round(l.height)}`}function W(){y.destroy();let l=k(),g=l!==v;$=x(),v=l,y=pe(r,A($,v)),F=H(),M!==null&&y.seek(M),g&&X();}let P;function w(){(k()!==v||H()!==F)&&W();}function b(){clearTimeout(P),P=setTimeout(w,150);}window.addEventListener("resize",b),window.addEventListener("orientationchange",b);let D=()=>{};function X(){D(),D=oe([r,v],b);}return X(),{destroy(){clearTimeout(P),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),D(),y.destroy();},replay(){M=null,y.replay();},pause(){y.pause(),M=y.getProgress();},resume(){M=null,y.resume();},seek(l){y.seek(l),M=y.getProgress();},getProgress(){return y.getProgress()},refresh(){W();}}}exports.scrollHorizontal=At;
@@ -1 +1 @@
1
- import {a}from'../chunk-LTCJVVSC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
1
+ import {a}from'../chunk-V4L3ELVC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};