svg-scroll-draw 2.25.0 → 2.26.1

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 (122) hide show
  1. package/README.md +116 -15
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +60 -6
  4. package/dist/angular/index.d.ts +60 -6
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +2 -2
  7. package/dist/astro/index.d.mts +3 -3
  8. package/dist/astro/index.d.ts +3 -3
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +71 -34
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
  13. package/dist/chunk-7LDSB4FT.mjs +1 -0
  14. package/dist/chunk-ASCOHQQD.mjs +2 -0
  15. package/dist/chunk-GBFWTY5L.mjs +1 -0
  16. package/dist/chunk-HAGTU5EX.mjs +1 -0
  17. package/dist/chunk-HJTHOZK5.mjs +1 -0
  18. package/dist/chunk-IJPLLT7E.mjs +1 -0
  19. package/dist/chunk-IXR6RML7.mjs +1 -0
  20. package/dist/chunk-KN2YB54Z.mjs +1 -0
  21. package/dist/chunk-NJV6S5LD.mjs +1 -0
  22. package/dist/chunk-OGFXZCKC.mjs +1 -0
  23. package/dist/chunk-UBH4K5YD.mjs +1 -0
  24. package/dist/chunk-UF3MO5XQ.mjs +1 -0
  25. package/dist/chunk-XLXVGQ3P.mjs +3 -0
  26. package/dist/chunk-YOOPMYT6.mjs +1 -0
  27. package/dist/cinematic/index.cjs +2 -2
  28. package/dist/cinematic/index.d.mts +3 -1
  29. package/dist/cinematic/index.d.ts +3 -1
  30. package/dist/cinematic/index.mjs +1 -1
  31. package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
  32. package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
  33. package/dist/frames/index.cjs +1 -1
  34. package/dist/frames/index.d.mts +2 -2
  35. package/dist/frames/index.d.ts +2 -2
  36. package/dist/frames/index.mjs +1 -1
  37. package/dist/group/index.cjs +3 -3
  38. package/dist/group/index.d.mts +3 -3
  39. package/dist/group/index.d.ts +3 -3
  40. package/dist/group/index.mjs +1 -1
  41. package/dist/horizontal/index.cjs +1 -1
  42. package/dist/horizontal/index.d.mts +2 -2
  43. package/dist/horizontal/index.d.ts +2 -2
  44. package/dist/horizontal/index.mjs +1 -1
  45. package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
  46. package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
  47. package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
  48. package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
  49. package/dist/index.cjs +4 -4
  50. package/dist/index.d.mts +6 -6
  51. package/dist/index.d.ts +6 -6
  52. package/dist/index.mjs +1 -1
  53. package/dist/lenis/index.cjs +1 -1
  54. package/dist/lenis/index.d.mts +15 -16
  55. package/dist/lenis/index.d.ts +15 -16
  56. package/dist/lenis/index.mjs +1 -1
  57. package/dist/nuxt/index.cjs +3 -3
  58. package/dist/nuxt/index.d.mts +4 -3
  59. package/dist/nuxt/index.d.ts +4 -3
  60. package/dist/nuxt/index.mjs +1 -1
  61. package/dist/progress/index.cjs +1 -1
  62. package/dist/progress/index.d.mts +2 -2
  63. package/dist/progress/index.d.ts +2 -2
  64. package/dist/progress/index.mjs +1 -1
  65. package/dist/react/index.cjs +2 -2
  66. package/dist/react/index.d.mts +4 -4
  67. package/dist/react/index.d.ts +4 -4
  68. package/dist/react/index.mjs +1 -1
  69. package/dist/reveal/index.cjs +1 -1
  70. package/dist/reveal/index.d.mts +2 -2
  71. package/dist/reveal/index.d.ts +2 -2
  72. package/dist/reveal/index.mjs +1 -1
  73. package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
  74. package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
  75. package/dist/snap/index.cjs +1 -1
  76. package/dist/snap/index.d.mts +2 -2
  77. package/dist/snap/index.d.ts +2 -2
  78. package/dist/snap/index.mjs +1 -1
  79. package/dist/solid/index.cjs +3 -3
  80. package/dist/solid/index.d.mts +40 -4
  81. package/dist/solid/index.d.ts +40 -4
  82. package/dist/solid/index.mjs +1 -1
  83. package/dist/svelte/index.cjs +3 -3
  84. package/dist/svelte/index.d.mts +47 -4
  85. package/dist/svelte/index.d.ts +47 -4
  86. package/dist/svelte/index.mjs +1 -1
  87. package/dist/text/index.cjs +1 -1
  88. package/dist/text/index.d.mts +2 -2
  89. package/dist/text/index.d.ts +2 -2
  90. package/dist/text/index.mjs +1 -1
  91. package/dist/timeline/index.cjs +10 -10
  92. package/dist/timeline/index.d.mts +2 -2
  93. package/dist/timeline/index.d.ts +2 -2
  94. package/dist/timeline/index.mjs +2 -2
  95. package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
  96. package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
  97. package/dist/video/index.cjs +1 -1
  98. package/dist/video/index.d.mts +2 -2
  99. package/dist/video/index.d.ts +2 -2
  100. package/dist/video/index.mjs +1 -1
  101. package/dist/vue/index.cjs +3 -3
  102. package/dist/vue/index.d.mts +4 -7
  103. package/dist/vue/index.d.ts +4 -7
  104. package/dist/vue/index.mjs +1 -1
  105. package/dist/web-component/index.cjs +3 -3
  106. package/dist/web-component/index.mjs +1 -1
  107. package/dist/wrapper-BOHrDnBO.d.mts +8 -0
  108. package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
  109. package/package.json +1 -1
  110. package/dist/chunk-22P4KBPG.mjs +0 -1
  111. package/dist/chunk-32ZCSGFZ.mjs +0 -1
  112. package/dist/chunk-7USW2XFB.mjs +0 -1
  113. package/dist/chunk-7XOFQCQE.mjs +0 -3
  114. package/dist/chunk-BDXWPUBJ.mjs +0 -2
  115. package/dist/chunk-BRV2B2YW.mjs +0 -1
  116. package/dist/chunk-D2BHE4F2.mjs +0 -1
  117. package/dist/chunk-QZKYGS74.mjs +0 -1
  118. package/dist/chunk-THPTANES.mjs +0 -1
  119. package/dist/chunk-U5TKLHGW.mjs +0 -1
  120. package/dist/chunk-V3Z6G5JE.mjs +0 -1
  121. package/dist/chunk-WKOT2MND.mjs +0 -1
  122. package/dist/chunk-XSVTHCLO.mjs +0 -1
@@ -1 +1 @@
1
- export{a as scrollFrames}from'../chunk-D2BHE4F2.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollFrames}from'../chunk-GBFWTY5L.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1,3 +1,3 @@
1
- 'use strict';function or({tension:e=2.5,friction:n=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,n)}function sr({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),a=0,u=[];for(let d=0;d<r;d++){let b=Math.pow(o,d);u.push(b),a+=b;}let i=[0],f=0;for(let d=0;d<r;d++)f+=u[d]/a,i.push(f);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let b=0;b<r;b++)if(d<=i[b+1]){let E=(d-i[b])/(i[b+1]-i[b]);if(b===0)return E*(2-E);let g=1-Math.pow(t,b);return g+(1-g)*(2*E-1)*(2*E-1)}return 1}}function ir({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 a=>a<=0?0:a>=1?1:r*Math.pow(2,-10*a)*Math.sin((a-o)*(2*Math.PI)/t)+1}var ve={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:or(),bounce:sr(),elastic:ir()};function $t(e,n,r){return Math.min(r,Math.max(n,e))}function Ce(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}}var Ct=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function kt(e,n,r,t){return e+r+n*Ct(t,0)}function Dt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ct(e,1))}function Q(e,n,r,t){return r===n?0:$t((e-n)/(r-n)*t,0,1)}function Oe(e,n,r,t,o){let a=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:a,tEnd:u}}function Ze(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 Ke(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(t+o)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}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 Je(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 Ie=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function oe(e,...n){Ie&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var ar="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",lr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Rt=33;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ur(e){let n=[];for(let r=0;r<Rt;r++){let t=r/(Rt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return ar;case "ease-out":return lr;case "ease-in-out":return cr()?ur(ve["ease-in-out"]):null;default:return null}}var Nt=Symbol.for("svg-scroll-draw.registry");function Ft(){let e=globalThis;return e[Nt]||(e[Nt]=new Map)}function Ge(e,n){Ft().set(e,n);}function We(e){Ft().delete(e);}function Ht(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 tt(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let r=n(e,false),t=Ht(a=>{if(!a)return;t();let u=(r.getProgress?.()??0)>=1;r.destroy(),r=n(u?{...e,onComplete:void 0}:e,true);}),o={};for(let a of Object.keys(r))o[a]=(...u)=>r[a]?.(...u);return o.destroy=()=>{t(),r.destroy();},o}var ze,rt=new Set,nt=new WeakMap,qe=new Map,_t=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function fr(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 Vt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();ze??(ze=new ResizeObserver(o=>{let a=false;for(let{target:u}of o)nt.get(u)!==_t(u)&&(a=true),nt.set(u,"");a&&rt.forEach(u=>u());})),rt.add(r);let t=fr(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{nt.has(o)||nt.set(o,_t(o)),qe.set(o,(qe.get(o)??0)+1),ze.observe(o);}),()=>{rt.delete(r)&&(t.forEach(o=>{let a=(qe.get(o)??1)-1;if(a)return void qe.set(o,a);qe.delete(o),ze?.unobserve(o);}),rt.size||(ze?.disconnect(),ze=void 0));}}function ot(e,n,r,t,o){let a,u=NaN,i,f,d=()=>{a=0,t(),!i&&!a&&(u=r())>0&&u<1&&(a=requestAnimationFrame(d));},b=()=>{!a&&!i&&r()!==u&&(a=requestAnimationFrame(d));},E=U=>{i=U,cancelAnimationFrame(a),a=u=NaN,b();},g=()=>{clearTimeout(f),o(),b();},q=()=>{clearTimeout(f),f=setTimeout(g,150);},ge=Vt(n,q),_=U=>{e[U]("scroll",b,{passive:true}),window[U]("resize",q),window[U]("orientationchange",q);};return _("addEventListener"),b(),{hold:E,remeasure:g,off(){E(true),_("removeEventListener"),ge(),clearTimeout(f);}}}var mr=0;function pr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(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 dr(e){if(!Ie)return;let n=Gt(e,"stroke");if(!n||n==="none"){oe("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Wt.has(r)&&!Wt.has(Gt(e,"fill"))&&oe("Element has a fill \u2014 it may obscure the stroke animation.",e);}function gr(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 a=r==="x"?window.scrollX:window.scrollY,u=e-a,i=n-a,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:${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 zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function yr(e,n,r){if(!Ie)return;let t=(e.match(qt)??[]).join("").toUpperCase(),o=(n.match(qt)??[]).join("").toUpperCase(),a=(e.match(zt)??[]).length,u=(n.match(zt)??[]).length;if(t!==o){oe(`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}a!==u&&oe(`morphTo: coordinate count differs (${a} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function hr(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let u=parseFloat(a),i=t[o++]??u;return String(+(u+(i-u)*r).toFixed(4))})}function dt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:tt(n,(r,t)=>br(e,r,t))}function br(e,n,r){let{preset:t,...o}=n,a=t?{...It[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:i=1,fade:f=false,easing:d="linear",trigger:b={},stagger:E=0,direction:g="forward",once:q=false,debug:ge=false,axis:_="y",scrollContainer:U,autoReverse:Pe=false,delay:ye=0,strokeColor:Y,strokeWidth:ee,fillOpacity:te,waypoints:X,velocityScale:R=false,threshold:J=0,rootMargin:st="0px",repeat:we=0,repeatDelay:Ae=0,morphTo:V,clip:se,autoplay:Ne=false,duration:je=1e3,native:it=true,onProgress:Ee,onStart:N,onComplete:G,onEnter:ie,onLeave:Le,onEnterBack:ae,onLeaveBack:re}=a,F=se===true?"left":typeof se=="string"?se:false,D=typeof d=="function"?d:ve[d]??ve.linear,$e=Ce(b.start||"top bottom"),Fe=Ce(b.end||"bottom top"),A=typeof U=="string"?document.querySelector(U):U??null,le=Array.isArray(Y)?Y[0]:null,ce=Array.isArray(Y)?Y[1]:typeof Y=="string"?Y:null,Z=Array.isArray(ee)?ee[0]:null,he=Array.isArray(ee)?ee[1]:typeof ee=="number"?ee:null,ue=Array.isArray(te)?te[0]:null,K=Array.isArray(te)?te[1]:typeof te=="number"?te:null;function fe(s){let c=s*100;switch(F){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=F?[]:Array.from(e.querySelectorAll(u)),m=[],L=[],v=0,S=0,P=E,x=0,be=0,$=false,me=false,pe=0,at=-1,Qe=[],Ue=-1,B=false,ne=0,Se=0,xe,lt=false,ct=null;function yt(){ct?.destroy(),ct=null;}let Me=new Set,ht=NaN,ke=true,Ye=-1,bt=performance.now(),De=NaN;function Xe(){return A?_==="x"?A.scrollLeft:A.scrollTop:_==="x"?window.scrollX:window.scrollY}function vt(){return A?_==="x"?A.clientWidth:A.clientHeight:_==="x"?window.innerWidth:window.innerHeight}function wt(){let s=Ze(e,A,_);return Oe(s,s.scroll,vt(),$e,Fe)}function Zt(){let s=S-v,c=l.length-1,p=A??document.documentElement,h=_==="x"?"Width":"Height";if(P=E,E>0&&c>0&&s>0){let C=p[`scroll${h}`]-p[`client${h}`]-1-v-s/i;C>=0&&(P=Math.min(E,C/(c*s)));}let k=Math.max(0,c)*P*s,W=s/Math.min(i,1);x=v+Math.min(0,k,W,k+W),be=v+Math.max(0,k,W,k+W);}function Et(){(({tStart:v,tEnd:S}=wt())),Zt(),ge&&Ie&&(yt(),ct=gr(v,S,_));}function ut(s,c=wt){Ge(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let p=s.destroy;return s.destroy=()=>{p.call(s),We(e);},s}function St(s,c){return q&&!Pe?Math.max(at,D(Qe[s]=Math.max(Qe[s]??0,c))):D(c)}function Kt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),F){let p=c==="reverse"?1-s:s;e.style.clipPath=fe(p);return}l.forEach((p,h)=>ft(p,h,s,c));}function ft(s,c,p,h){s.style.strokeDashoffset=h==="reverse"?`${m[c]*p}`:`${m[c]*(1-p)}`,f&&(s.style.opacity=h==="reverse"?`${1-p}`:`${p}`),le&&ce?s.style.stroke=Je(le,ce,p):ce&&(s.style.stroke=ce),Z!==null&&he!==null?s.style.strokeWidth=`${Z+(he-Z)*p}`:he!==null&&(s.style.strokeWidth=`${he}`),ue!==null&&K!==null?s.style.fillOpacity=`${ue+(K-ue)*p}`:K!==null&&(s.style.fillOpacity=`${K}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",hr(L[c],V,p));}function mt(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=fe(g==="reverse"?1:0);return}l.forEach((s,c)=>{s.style.strokeDasharray=`${m[c]}`,s.style.strokeDashoffset=g==="reverse"?"0":`${m[c]}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ue!==null&&(s.style.fillOpacity=`${ue}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",L[c]);});}function He(s,c){let p=s.getAttribute("d"),h=Ke(s);if(V&&L[c]){s.setAttribute("d",V);let k=Ke(s);s.setAttribute("d",L[c]),h=Math.max(Ke(s),k),s.setAttribute("d",p);}m[c]=h,s.style.strokeDasharray=`${h}`;}if(l.forEach((s,c)=>{dr(s);let p=s.tagName.toLowerCase()==="path";p?L.push(s.getAttribute("d")??""):L.push(""),He(s,c);let h=m[c];V&&(p?yr(L[L.length-1],V,s):oe(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDashoffset=g==="reverse"?`${h}`:"0",f&&(s.style.opacity="1"),ce&&(s.style.stroke=ce),he!==null&&(s.style.strokeWidth=`${he}`),K!==null&&(s.style.fillOpacity=`${K}`),V&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",V)):(s.style.strokeDashoffset=g==="reverse"?"0":`${h}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ue!==null&&(s.style.fillOpacity=`${ue}`));}),r)return F&&(e.style.clipPath=fe(1)),G?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};F&&(e.style.clipPath=fe(g==="reverse"?1:0));let xt=typeof d=="string"?et(d):null;function Jt(){return !(it===false||Ne||ge&&Ie||!pr()||!l.length||!xt||F||_!=="y"||A||i!==1||E!==0||q||Pe||R!==false||V||X||we||ye>0||Ee||N||G||ie||Le||ae||re||Y!=null||ee!=null||te!=null||(b.start||"top bottom").trim()!=="top bottom"||(b.end||"bottom top").trim()!=="bottom top")}function er(){let s=++mr,c=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,h=`--svg-scroll-draw-${s}`,k=g==="reverse"?"0":"var(--ssd-len)",W=g==="reverse"?"var(--ssd-len)":"0",C=`stroke-dashoffset:${k};`,M=`stroke-dashoffset:${W};`;f&&(C+=`opacity:${g==="reverse"?1:0};`,M+=`opacity:${g==="reverse"?0:1};`);let T=document.createElement("style");T.setAttribute("data-svg-scroll-draw",""),T.textContent=`@keyframes ${c}{from{${C}}to{${M}}}.${p}{view-timeline-name:${h};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${xt};animation-fill-mode:both;animation-timeline:${h};animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(p);function H(y,w){y.style.setProperty("--ssd-len",String(m[w])),y.style.strokeDasharray=`${m[w]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(c);}l.forEach(H);let O=false,z=-1;function j(){if(z>=0)return z;let y=e.getBoundingClientRect(),{tStart:w,tEnd:I}=Oe({top:y.top,height:y.height},Xe(),vt(),$e,Fe);return D(Q(Xe(),w,I,i))}return {destroy(){e.classList.remove(p),l.forEach(y=>{y.classList.remove(c),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),T.remove();},replay(){O=false,z=-1,l.forEach(H);},pause(){O=true,l.forEach(y=>{y.style.animationPlayState="paused";});},resume(){O&&(O=false,l.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let w=Math.min(1,Math.max(0,y));z=w,O=true,l.forEach((I,de)=>{I.classList.remove(c),I.style.strokeDashoffset=g==="reverse"?`${m[de]*w}`:`${m[de]*(1-w)}`,f&&(I.style.opacity=g==="reverse"?`${1-w}`:`${w}`);});},getProgress(){return j()},refresh(){l.forEach((y,w)=>{He(y,w),y.style.setProperty("--ssd-len",String(m[w]));});}}}if(Jt())return ut(er());function tr(){let s=Math.max(1,je),c=F?s:s*(1+Math.max(0,l.length-1)*E),p=0,h=0,k=false;function W(z){let j=true,y=Math.min(1,Math.max(0,z/c));if(F){let w=Math.min(1,Math.max(0,z/s)),I=D(w);ne=I,e.style.setProperty("--scroll-draw-progress",String(I)),e.style.clipPath=fe(g==="reverse"?1-I:I),Ee?.(I),w<1&&(j=false);}else {l.forEach((I,de)=>{let nr=de*E*s,Lt=Math.min(1,Math.max(0,(z-nr)/s));ft(I,de,D(Lt),g),Lt<1&&(j=false);});let w=D(y);ne=w,Ee?.(w),e.style.setProperty("--scroll-draw-progress",String(w));}if(X){let w=D(y);for(let I in X){let de=parseFloat(I);w>=de&&!Me.has(de)&&(Me.add(de),X[I]?.());}}return j}function C(z){if(B)return;let j=z-p;me||(me=true,N?.());let y=W(j);if(y&&!$){$=true,W(c),G?.(),Se<(we==="infinite"?1/0:we??0)&&(Se++,xe=setTimeout(()=>{p=performance.now(),me=false,$=false,Me.clear(),mt(),pe=requestAnimationFrame(C);},Ae));return}y||(pe=requestAnimationFrame(C));}function M(){cancelAnimationFrame(pe),clearTimeout(xe),p=performance.now(),h=0,B=false,me=false,$=false,Se=0,k=true,ne=0,Me.clear(),mt(),pe=requestAnimationFrame(C);}let T=new IntersectionObserver(z=>{z.forEach(j=>{j.isIntersecting&&!(q&&$)?M():!j.isIntersecting&&!q&&!$&&(cancelAnimationFrame(pe),clearTimeout(xe),k=false);});},{root:A??null,threshold:J,rootMargin:st}),H;function O(){clearTimeout(H),H=setTimeout(()=>l.forEach(He),150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),ye>0?setTimeout(()=>T.observe(e),ye):T.observe(e),{destroy(){cancelAnimationFrame(pe),clearTimeout(xe),T.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(H);},replay(){Se=0,M();},pause(){B||!k||(B=true,h=performance.now()-p,cancelAnimationFrame(pe));},resume(){B&&(B=false,k=true,p=performance.now()-h,pe=requestAnimationFrame(C));},seek(z){let j=Math.min(1,Math.max(0,z));ne=j,B=true,h=j*c,p=performance.now()-h,cancelAnimationFrame(pe),W(h);},getProgress(){return ne},refresh(){clearTimeout(H),l.forEach(He);}}}if(Ne)return ut(tr());Et();let Mt=()=>Q(Xe(),x,be,1);function Tt(){$=true,G?.(),Se<(we==="infinite"?1/0:we)&&(Se++,xe=setTimeout(()=>{lt=true;},Ae));}function Pt(){at=-1,Qe=[],me=false,$=false,lt=false,Me.clear(),mt(),ke=true;}function rr(){let s=performance.now(),c=Xe();if(lt&&Mt()%1&&Pt(),!ke&&R===false&&c===ht)return;ke=false,ht=c;let p=i;if(R!==false){let M=s-bt,T=M>0?Math.abs(c-(Ye<0?c:Ye))/M:0;p=i*Math.max(.2,1+T*(typeof R=="number"?R:1)*.04);}Ye=c,bt=s;let h=Pe?Ue===-1||c>=Ue?"forward":"reverse":g;Ue=c;let k=S-v,W=true,C=k===0?0:(c-v)/k;if(isNaN(De)||(De<=0&&C>0&&ie?.(),De<1&&C>=1&&Le?.(),De>=1&&C<1&&ae?.(),De>0&&C<=0&&re?.()),De=C,F){let M=St(0,Q(c,v,S,p));ne=M,e.style.setProperty("--scroll-draw-progress",String(M));let T=h==="reverse"?1-M:M;e.style.clipPath=fe(T),Ee?.(M),!me&&Q(c,v,S,p)>0&&(me=true,N?.()),M>=1&&!$?Tt():M<1&&!q&&($=false);return}if(l.forEach((M,T)=>{let H=T*P*k,O=St(T,Q(c,v+H,S+H,p));ft(M,T,O,h),T===0&&(ne=O,Ee?.(O),e.style.setProperty("--scroll-draw-progress",String(O))),O<1&&(W=false);}),X){let M=D(Q(c,v,S,p));for(let T in X){let H=parseFloat(T);M>=H&&!Me.has(H)&&(Me.add(H),X[T]?.());}}!me&&Q(c,v,S,p)>0&&(me=true,N?.()),W&&!$?Tt():!W&&!q&&($=false);}let _e=ot(A??window,[e],Mt,rr,()=>{let s=m.join();l.forEach(He),Et(),ke=true,m.join()!==s&&Ve();}),pt=ye>0;function Ve(){_e.hold(B||pt);}let At;return pt&&(At=setTimeout(()=>{pt=false,Ve();},ye)),Ve(),ut({destroy(){clearTimeout(xe),clearTimeout(At),_e.off(),yt();},replay(){Pt(),Ue=-1,Ye=-1,Se=0,B=false,ne=0,clearTimeout(xe),Ve();},pause(){B=true,_e.hold(true);},resume(){B&&(B=false,ke=true,Ve());},seek(s){let c=Math.min(1,Math.max(0,s));ne=c,at=c,Qe=[],B=true,_e.hold(true),Kt(c,g),ke=true;},getProgress(){return ne},refresh:_e.remeasure},()=>({tStart:v,tEnd:S}))}function vr(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=[],a=[],u=t[2].trim();if(u)for(let i of u.split(/[\s,]+/)){let f=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),a.push(f?f[2]:"");}n.push({fn:t[1],nums:o,units:a});}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((a,u)=>{let i=o[u];return a.fn!==i.fn||a.nums.length!==i.nums.length?r<1?`${a.fn}(${a.nums.map((f,d)=>`${f}${a.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((f,d)=>`${f}${i.units[d]}`).join(", ")})`:`${a.fn}(${a.nums.map((f,d)=>`${f+(i.nums[d]-f)*r}${a.units[d]}`).join(", ")})`}).join(" ")}function gt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(vr(t))return Je(t,o,r);if(t.includes("("))return wr(t,o,r);let a=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(a&&u){let i=parseFloat(a[1]),f=parseFloat(u[1]);return `${i+(f-i)*r}${a[2]||u[2]}`}return r<1?t:o}function Er(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Sr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),xr=0,jt="--scroll-draw-progress";function Mr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Re(e,n){return typeof window>"u"?Ut:n.respectReducedMotion===false?Qt(e,n,false):tt(n,(r,t)=>Qt(e,r,t))}function Qt(e,n,r){let{props:t,trigger:o={},easing:a="ease-out",speed:u=1,once:i=false,axis:f="y",scrollContainer:d,native:b=true,velocityScale:E=false,triggerElement:g,onProgress:q,onComplete:ge,onEnter:_,onLeave:U,onEnterBack:Pe,onLeaveBack:ye}=n,Y=typeof a=="function"?a:ve[a]??ve["ease-out"],ee=Ce(o.start||"top bottom"),te=Ce(o.end||"bottom top"),X=g??e,R=typeof d=="string"?document.querySelector(d):d??null,J=Object.entries(t).map(([l,m])=>({prop:Er(l),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function st(){let l=window.getComputedStyle(e);for(let m of J)m.from===""&&(m.from=l.getPropertyValue(m.prop).trim()||"0");}function we(){for(let l of J)e.style.setProperty(l.prop,String(l.to));}let Ae=new Map;for(let l of [...J.map(m=>m.prop),jt])Ae.set(l,e.style.getPropertyValue(l));function V(){for(let[l,m]of Ae)m?e.style.setProperty(l,m):e.style.removeProperty(l);}if(r)return we(),ge?.(),{...Ut,destroy:V,getProgress:()=>1};st();let se=()=>R?f==="x"?R.scrollLeft:R.scrollTop:f==="x"?window.scrollX:window.scrollY,Ne=()=>R?f==="x"?R.clientWidth:R.clientHeight:f==="x"?window.innerWidth:window.innerHeight,je=typeof a=="string"?et(a):null;function it(){if(!b||!Mr()||!je||f!=="y"||R||X!==e||i||u!==1||q||ge||_||U||Pe||ye||E!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of J)if(!Sr.has(l.prop))return false;return true}function Ee(){let l=`ssd-a-${++xr}`,m=J.map(x=>`${x.prop}:${x.from}`).join(";"),L=J.map(x=>`${x.prop}:${x.to}`).join(";"),v=document.createElement("style");v.setAttribute("data-ssd-animate",""),v.textContent=`@keyframes ${l}{from{${m}}to{${L}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${je};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(l);let S=()=>{let x=e.getBoundingClientRect();return Oe({top:x.top,height:x.height},se(),Ne(),ee,te)};Ge(e,{type:"animate",getProgress:()=>P.getProgress(),getTrigger:S});let P={refresh(){},destroy(){e.classList.remove(l),v.remove(),e.style.animationPlayState="",V(),We(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(x){let be=Math.min(1,Math.max(0,x));e.classList.remove(l);for(let $ of J)e.style.setProperty($.prop,gt($.from,$.to,be));},getProgress(){let{tStart:x,tEnd:be}=S();return Y(Q(se(),x,be,u))}};return P}if(it())return Ee();let N=0,G=0,ie=false,Le=-1,ae=0,re=0,F=false,D=NaN,$e=-1,Fe=0,A=X===e?J:[],le=false;function ce(){let l=e.style,m=A.map(P=>l.getPropertyValue(P.prop)),L=l.transition;A.length&&(l.transition="none"),A.forEach(P=>l.setProperty(P.prop,Ae.get(P.prop)??""));let v=Ze(X,R,f);A.forEach((P,x)=>l.setProperty(P.prop,m[x])),A.length&&(e.offsetWidth,l.transition=L);let S=Oe(v,v.scroll,Ne(),ee,te);le&&Math.abs(S.tStart-N)<1&&Math.abs(S.tEnd-G)<1||(le=true,N=S.tStart,G=S.tEnd);}function Z(l){e.style.setProperty(jt,String(l));for(let m of J)e.style.setProperty(m.prop,gt(m.from,m.to,l));q?.(l);}function he(l){if(isNaN(D)){D=l;return}D<=0&&l>0&&_?.(),D<1&&l>=1&&U?.(),D>=1&&l<1&&Pe?.(),D>0&&l<=0&&ye?.(),D=l;}function ue(){if(ie)return;let l=performance.now(),m=se(),L=u;if(E!==false){let x=l-Fe,be=x>0?Math.abs(m-($e<0?m:$e))/x:0;L=u*Math.max(.2,1+be*(typeof E=="number"?E:1)*.04);}$e=m,Fe=l;let v=G===N?0:(m-N)/(G-N);he(v);let S=Q(m,N,G,L),P=i?Math.max(Le,Y(ae=Math.max(ae,S))):Y(S);re=P,Z(P),P>=1&&!F?(F=true,ge?.()):P<1&&!i&&(F=false);}let K=ot(R??window,[X],()=>Q(se(),N,G,Math.min(u,1)),ue,ce);ce(),G===N&&oe("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ae=Q(se(),N,G,u),re=Y(ae),Z(re),Ge(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:N,tEnd:G})});function fe(){ie=true,K.hold(true);}return {destroy(){ie=true,K.off(),V(),We(e);},replay(){Le=-1,ae=0,F=false,re=0,ie=false,Z(0),K.hold(false);},pause:fe,resume(){ie&&(ie=false,K.hold(false));},seek(l){let m=Math.min(1,Math.max(0,l));re=m,Le=m,ae=0,fe(),Z(m);},getProgress(){return re},refresh:K.remeasure}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return oe("scrollParallax: element not found:",e),Yt;let{speed:t=.3,axis:o="y",easing:a="linear",trigger:u,onProgress:i}=n,f=-t*100,d=r.style,b=!!r.ownerSVGElement,E=d.getPropertyValue("transform-box");b&&d.setProperty("transform-box","fill-box");let g=Re(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${f}%)`]}:{transform:["translateY(0%)",`translateY(${f}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:i});return b?{...g,destroy(){g.destroy(),d.setProperty("transform-box",E);}}:g}function Be(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var Te={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bn(e,n={}){if(typeof window>"u")return Te;let r=Be(e).map(t=>dt(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 vn(e,n={}){if(typeof window>"u")return Te;let r=Be(e);if(r.length===0)return Te;let t=0,o=[];function a(i){return dt(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,f)=>{o[f]=a(f);});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 wn(e,n){if(typeof window>"u")return Te;let r=Be(e).map(t=>Re(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 En(e,n){if(typeof window>"u")return Te;let r=Be(e);if(r.length===0)return Te;let t=0,o=[];function a(i){return Re(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,f)=>{o[f]=a(f);});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 Sn(e,n={}){if(typeof window>"u")return Te;let r=Be(e).map(t=>Xt(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=wn;exports.scrollAnimateSequence=En;exports.scrollDrawGroup=bn;exports.scrollDrawSequence=vn;exports.scrollParallaxGroup=Sn;
1
+ 'use strict';var De=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function K(e,...n){De&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function lr({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function ur({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(r),a=0,l=[];for(let d=0;d<t;d++){let b=Math.pow(o,d);l.push(b),a+=b;}let i=[0],f=0;for(let d=0;d<t;d++)f+=l[d]/a,i.push(f);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let b=0;b<t;b++)if(d<=i[b+1]){let w=(d-i[b])/(i[b+1]-i[b]);if(b===0)return w*(2-w);let g=1-Math.pow(r,b);return g+(1-g)*(2*w-1)*(2*w-1)}return 1}}function cr({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),o=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-o)*(2*Math.PI)/r)+1}var Ce={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:lr(),bounce:ur(),elastic:cr()};function fr(e,n,t,r){let o=(a,l,i)=>((1+3*a-3*l)*i+3*l-6*a)*i*i+3*a*i;return a=>{if(a<=0||a>=1)return +(a>0);let l=a;for(let i=0;i<8;i++)l-=(o(e,t,l)-a)/((3*(1+3*e-3*t)*l+6*t-12*e)*l+3*e);if(!(l>=0&&l<=1&&Math.abs(o(e,t,l)-a)<1e-9))for(let i=0,f=0,d=1;i<30;i++)l=(f+d)/2,o(e,t,l)<a?f=l:d=l;return o(n,r,l)}}function yt(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [fr(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var Ct=new Set;function Ze(e,n="linear"){if(typeof e=="function")return e;if(e==null)return Ce[n];if({}.hasOwnProperty.call(Ce,e))return Ce[e];let t=yt(String(e));return t?t[0]:(!Ct.has(e)&&Ct.add(e)&&K(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),Ce[n])}function Ot(e,n,t){return Math.min(t,Math.max(n,e))}function Oe(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var Nt=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function It(e,n,t,r){return e+t+n*Nt(r,0)}function Rt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Nt(e,1))}function Q(e,n,t,r){return t===n?0:Ot((e-n)/(t-n)*r,0,1)}function Ie(e,n,t,r,o){let a=It(e.top,e.height,n,r.element)-Rt(r.viewport,t),l=It(e.top,e.height,n,o.element)-Rt(o.viewport,t);return {tStart:a,tEnd:l}}function Je(e,n,t){let r=e.getBoundingClientRect(),o=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:t==="x"?r.left:r.top,height:o,scroll:t==="x"?window.scrollX:window.scrollY}}function Ke(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function et(e){return `${e} ${e*2}`}function Ft(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function tt(e,n,t){let r=Ft(e),o=Ft(n);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*t)},${Math.round(r[1]+(o[1]-r[1])*t)},${Math.round(r[2]+(o[2]-r[2])*t)})`}var Ht={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 mr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",pr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",_t=33;function dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function gr(e){let n=[];for(let t=0;t<_t;t++){let r=t/(_t-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return mr;case "ease-out":return pr;case "ease-in-out":return dr()?gr(Ce["ease-in-out"]):null;default:return yt(e)?.[1]??null}}var Vt=Symbol.for("svg-scroll-draw.registry");function zt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function ze(e,n){zt().set(e,n);}function Ge(e){zt().delete(e);}function Gt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function nt(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=Gt(a=>{if(!a)return;r();let l=(t.getProgress?.()??0)>=1;t.destroy(),t=n(l?{...e,onComplete:void 0}:e,true);}),o={};for(let a of Object.keys(t))o[a]=(...l)=>t[a]?.(...l);return o.destroy=()=>{r(),t.destroy();},o}var We,ot=new Set,st=new WeakMap,Be=new Map,Wt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function yr(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Bt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();We??(We=new ResizeObserver(o=>{let a=false;for(let{target:l}of o)st.get(l)!==Wt(l)&&(a=true),st.set(l,"");a&&ot.forEach(l=>l());})),ot.add(t);let r=yr(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{st.has(o)||st.set(o,Wt(o)),Be.set(o,(Be.get(o)??0)+1),We.observe(o);}),()=>{ot.delete(t)&&(r.forEach(o=>{let a=(Be.get(o)??1)-1;if(a)return void Be.set(o,a);Be.delete(o),We?.unobserve(o);}),ot.size||(We?.disconnect(),We=void 0));}}function it(e,n,t,r,o){let a,l=NaN,i,f,d=()=>{a=0,r(),!i&&!a&&(l=t())>0&&l<1&&(a=requestAnimationFrame(d));},b=()=>{!a&&!i&&t()!==l&&(a=requestAnimationFrame(d));},w=U=>{i=U,cancelAnimationFrame(a),a=l=NaN,b();},g=()=>{clearTimeout(f),o(),b();},B=()=>{clearTimeout(f),f=setTimeout(g,150);},ge=Bt(n,B),_=U=>{e[U]("scroll",b,{passive:true}),window[U]("resize",B),window[U]("orientationchange",B);};return _("addEventListener"),b(),{hold:w,remeasure:g,off(){w(true),_("removeEventListener"),ge(),clearTimeout(f);}}}var hr=0;function br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function qt(e,n){let t="";try{t=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return t||(e.getAttribute(n)??"").trim()}var jt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Er(e){if(!De)return;let n=qt(e,"stroke");if(!n||n==="none"){K("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!jt.has(t)&&!jt.has(qt(e,"fill"))&&K("Element has a fill \u2014 it may obscure the stroke animation.",e);}function vr(e,n,t){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function o(){let a=t==="x"?window.scrollX:window.scrollY,l=e-a,i=n-a,f=t==="x";r.innerHTML=`
2
+ <div style="position:absolute;${f?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}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:${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(r),window.addEventListener("scroll",o,{passive:true}),o(),{el:r,destroy(){window.removeEventListener("scroll",o),r.remove();}}}var Qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ut=/[MmLlHhVvCcSsQqTtAaZz]/g;function wr(e,n,t){if(!De)return;let r=(e.match(Ut)??[]).join("").toUpperCase(),o=(n.match(Ut)??[]).join("").toUpperCase(),a=(e.match(Qt)??[]).length,l=(n.match(Qt)??[]).length;if(r!==o){K(`morphTo: command sequence differs (${r||"\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.`,t);return}a!==l&&K(`morphTo: coordinate count differs (${a} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Sr(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let l=parseFloat(a),i=r[o++]??l;return String(+(l+(i-l)*t).toFixed(4))})}function ht(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:nt(n,(t,r)=>Mr(e,t,r))}function Mr(e,n,t){let{preset:r,...o}=n,a=r?{...Ht[r],...o}:o,{selector:l="path, polyline, line, polygon, rect, circle",speed:i=1,fade:f=false,easing:d="linear",trigger:b={},stagger:w=0,direction:g="forward",once:B=false,debug:ge=false,axis:_="y",scrollContainer:U,autoReverse:xe=false,delay:ye=0,strokeColor:Y,strokeWidth:te,fillOpacity:re,waypoints:X,velocityScale:R=false,threshold:ee=0,rootMargin:at="0px",repeat:Ee=0,repeatDelay:Pe=0,morphTo:V,clip:se,autoplay:Ne=false,duration:je=1e3,native:lt=true,onProgress:ve,onStart:N,onComplete:z,onEnter:ie,onLeave:Ae,onEnterBack:ae,onLeaveBack:ne}=a,F=se===true?"left":typeof se=="string"?se:false,D=Ze(d),Le=Oe(b.start||"top bottom"),Fe=Oe(b.end||"bottom top"),A=typeof U=="string"?document.querySelector(U):U??null,le=Array.isArray(Y)?Y[0]:null,ue=Array.isArray(Y)?Y[1]:typeof Y=="string"?Y:null,Z=Array.isArray(te)?te[0]:null,he=Array.isArray(te)?te[1]:typeof te=="number"?te:null,ce=Array.isArray(re)?re[0]:null,J=Array.isArray(re)?re[1]:typeof re=="number"?re:null;function fe(s){let c=s*100;switch(F){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let u=F?[]:Array.from(e.querySelectorAll(l)),m=[],L=[],E=0,S=0,P=w,M=0,be=0,$=false,me=false,pe=0,ut=-1,Qe=[],Ue=-1,q=false,oe=0,we=0,Se,ct=false,ft=null;function Et(){ft?.destroy(),ft=null;}let Me=new Set,vt=NaN,$e=true,Ye=-1,wt=performance.now(),ke=NaN;function Xe(){return A?_==="x"?A.scrollLeft:A.scrollTop:_==="x"?window.scrollX:window.scrollY}function St(){return A?_==="x"?A.clientWidth:A.clientHeight:_==="x"?window.innerWidth:window.innerHeight}function Mt(){let s=Je(e,A,_);return Ie(s,s.scroll,St(),Le,Fe)}function tr(){let s=S-E,c=u.length-1,p=A??document.documentElement,h=_==="x"?"Width":"Height";if(P=w,w>0&&c>0&&s>0){let C=p[`scroll${h}`]-p[`client${h}`]-1-E-s/i;C>=0&&(P=Math.min(w,C/(c*s)));}let k=Math.max(0,c)*P*s,G=s/Math.min(i,1);M=E+Math.min(0,k,G,k+G),be=E+Math.max(0,k,G,k+G);}function Tt(){(({tStart:E,tEnd:S}=Mt())),tr(),ge&&De&&(Et(),ft=vr(E,S,_));}function mt(s,c=Mt){ze(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let p=s.destroy;return s.destroy=()=>{p.call(s),Ge(e);},s}function xt(s,c){return B&&!xe?Math.max(ut,D(Qe[s]=Math.max(Qe[s]??0,c))):D(c)}function rr(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),F){let p=c==="reverse"?1-s:s;e.style.clipPath=fe(p);return}u.forEach((p,h)=>pt(p,h,s,c));}function pt(s,c,p,h){s.style.strokeDashoffset=h==="reverse"?`${m[c]*p}`:`${m[c]*(1-p)}`,f&&(s.style.opacity=h==="reverse"?`${1-p}`:`${p}`),le&&ue?s.style.stroke=tt(le,ue,p):ue&&(s.style.stroke=ue),Z!==null&&he!==null?s.style.strokeWidth=`${Z+(he-Z)*p}`:he!==null&&(s.style.strokeWidth=`${he}`),ce!==null&&J!==null?s.style.fillOpacity=`${ce+(J-ce)*p}`:J!==null&&(s.style.fillOpacity=`${J}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",Sr(L[c],V,p));}function dt(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=fe(g==="reverse"?1:0);return}u.forEach((s,c)=>{s.style.strokeDasharray=et(m[c]),s.style.strokeDashoffset=g==="reverse"?"0":`${m[c]}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ce!==null&&(s.style.fillOpacity=`${ce}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",L[c]);});}function He(s,c){let p=s.getAttribute("d"),h=Ke(s);if(V&&L[c]){s.setAttribute("d",V);let k=Ke(s);s.setAttribute("d",L[c]),h=Math.max(Ke(s),k),s.setAttribute("d",p);}m[c]=h,s.style.strokeDasharray=et(h);}if(u.forEach((s,c)=>{Er(s);let p=s.tagName.toLowerCase()==="path";p?L.push(s.getAttribute("d")??""):L.push(""),He(s,c);let h=m[c];V&&(p?wr(L[L.length-1],V,s):K(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),t?(s.style.strokeDashoffset=g==="reverse"?`${h}`:"0",f&&(s.style.opacity="1"),ue&&(s.style.stroke=ue),he!==null&&(s.style.strokeWidth=`${he}`),J!==null&&(s.style.fillOpacity=`${J}`),V&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",V)):(s.style.strokeDashoffset=g==="reverse"?"0":`${h}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ce!==null&&(s.style.fillOpacity=`${ce}`));}),t)return F&&(e.style.clipPath=fe(1)),z?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};F&&(e.style.clipPath=fe(g==="reverse"?1:0));let Pt=typeof d=="string"?rt(d):null;function nr(){return !(lt===false||Ne||ge&&De||!br()||!u.length||!Pt||F||_!=="y"||A||i!==1||w!==0||B||xe||R!==false||V||X||Ee||ye>0||ve||N||z||ie||Ae||ae||ne||Y!=null||te!=null||re!=null||(b.start||"top bottom").trim()!=="top bottom"||(b.end||"bottom top").trim()!=="bottom top")}function or(){let s=++hr,c=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,h=`--svg-scroll-draw-${s}`,k=g==="reverse"?"0":"var(--ssd-len)",G=g==="reverse"?"var(--ssd-len)":"0",C=`stroke-dashoffset:${k};`,T=`stroke-dashoffset:${G};`;f&&(C+=`opacity:${g==="reverse"?1:0};`,T+=`opacity:${g==="reverse"?0:1};`);let x=document.createElement("style");x.setAttribute("data-svg-scroll-draw",""),x.textContent=`@keyframes ${c}{from{${C}}to{${T}}}.${p}{view-timeline-name:${h};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Pt};animation-fill-mode:both;animation-timeline:${h};animation-range:cover 0% cover 100%;}`,document.head.appendChild(x),e.classList.add(p);function H(y,v){y.style.setProperty("--ssd-len",String(m[v])),y.style.strokeDasharray=et(m[v]),y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(c);}u.forEach(H);let O=false,W=-1;function j(){if(W>=0)return W;let y=e.getBoundingClientRect(),{tStart:v,tEnd:I}=Ie({top:y.top,height:y.height},Xe(),St(),Le,Fe);return D(Q(Xe(),v,I,i))}return {destroy(){e.classList.remove(p),u.forEach(y=>{y.classList.remove(c),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),x.remove();},replay(){O=false,W=-1,u.forEach(H);},pause(){O=true,u.forEach(y=>{y.style.animationPlayState="paused";});},resume(){O&&(O=false,u.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let v=Math.min(1,Math.max(0,y));W=v,O=true,u.forEach((I,de)=>{I.classList.remove(c),I.style.strokeDashoffset=g==="reverse"?`${m[de]*v}`:`${m[de]*(1-v)}`,f&&(I.style.opacity=g==="reverse"?`${1-v}`:`${v}`);});},getProgress(){return j()},refresh(){u.forEach((y,v)=>{He(y,v),y.style.setProperty("--ssd-len",String(m[v]));});}}}if(nr())return mt(or());function sr(){let s=Math.max(1,je),c=F?s:s*(1+Math.max(0,u.length-1)*w),p=0,h=0,k=false;function G(W){let j=true,y=Math.min(1,Math.max(0,W/c));if(F){let v=Math.min(1,Math.max(0,W/s)),I=D(v);oe=I,e.style.setProperty("--scroll-draw-progress",String(I)),e.style.clipPath=fe(g==="reverse"?1-I:I),ve?.(I),v<1&&(j=false);}else {u.forEach((I,de)=>{let ar=de*w*s,Dt=Math.min(1,Math.max(0,(W-ar)/s));pt(I,de,D(Dt),g),Dt<1&&(j=false);});let v=D(y);oe=v,ve?.(v),e.style.setProperty("--scroll-draw-progress",String(v));}if(X){let v=D(y);for(let I in X){let de=parseFloat(I);v>=de&&!Me.has(de)&&(Me.add(de),X[I]?.());}}return j}function C(W){if(q)return;let j=W-p;me||(me=true,N?.());let y=G(j);if(y&&!$){$=true,G(c),z?.(),we<(Ee==="infinite"?1/0:Ee??0)&&(we++,Se=setTimeout(()=>{p=performance.now(),me=false,$=false,Me.clear(),dt(),pe=requestAnimationFrame(C);},Pe));return}y||(pe=requestAnimationFrame(C));}function T(){cancelAnimationFrame(pe),clearTimeout(Se),p=performance.now(),h=0,q=false,me=false,$=false,we=0,k=true,oe=0,Me.clear(),dt(),pe=requestAnimationFrame(C);}let x=new IntersectionObserver(W=>{W.forEach(j=>{j.isIntersecting&&!(B&&$)?T():!j.isIntersecting&&!B&&!$&&(cancelAnimationFrame(pe),clearTimeout(Se),k=false);});},{root:A??null,threshold:ee,rootMargin:at}),H;function O(){clearTimeout(H),H=setTimeout(()=>u.forEach(He),150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),ye>0?setTimeout(()=>x.observe(e),ye):x.observe(e),{destroy(){cancelAnimationFrame(pe),clearTimeout(Se),x.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(H);},replay(){we=0,T();},pause(){q||!k||(q=true,h=performance.now()-p,cancelAnimationFrame(pe));},resume(){q&&(q=false,k=true,p=performance.now()-h,pe=requestAnimationFrame(C));},seek(W){let j=Math.min(1,Math.max(0,W));oe=j,q=true,h=j*c,p=performance.now()-h,cancelAnimationFrame(pe),G(h);},getProgress(){return oe},refresh(){clearTimeout(H),u.forEach(He);}}}if(Ne)return mt(sr());Tt();let At=()=>Q(Xe(),M,be,1);function Lt(){$=true,z?.(),we<(Ee==="infinite"?1/0:Ee)&&(we++,Se=setTimeout(()=>{ct=true;},Pe));}function $t(){ut=-1,Qe=[],me=false,$=false,ct=false,Me.clear(),dt(),$e=true;}function ir(){let s=performance.now(),c=Xe();if(ct&&At()%1&&$t(),!$e&&R===false&&c===vt)return;$e=false,vt=c;let p=i;if(R!==false){let T=s-wt,x=T>0?Math.abs(c-(Ye<0?c:Ye))/T:0;p=i*Math.max(.2,1+x*(typeof R=="number"?R:1)*.04);}Ye=c,wt=s;let h=xe?Ue===-1||c>=Ue?"forward":"reverse":g;Ue=c;let k=S-E,G=true,C=k===0?0:(c-E)/k;if(isNaN(ke)||(ke<=0&&C>0&&ie?.(),ke<1&&C>=1&&Ae?.(),ke>=1&&C<1&&ae?.(),ke>0&&C<=0&&ne?.()),ke=C,F){let T=xt(0,Q(c,E,S,p));oe=T,e.style.setProperty("--scroll-draw-progress",String(T));let x=h==="reverse"?1-T:T;e.style.clipPath=fe(x),ve?.(T),!me&&Q(c,E,S,p)>0&&(me=true,N?.()),T>=1&&!$?Lt():T<1&&!B&&($=false);return}if(u.forEach((T,x)=>{let H=x*P*k,O=xt(x,Q(c,E+H,S+H,p));pt(T,x,O,h),x===0&&(oe=O,ve?.(O),e.style.setProperty("--scroll-draw-progress",String(O))),O<1&&(G=false);}),X){let T=D(Q(c,E,S,p));for(let x in X){let H=parseFloat(x);T>=H&&!Me.has(H)&&(Me.add(H),X[x]?.());}}!me&&Q(c,E,S,p)>0&&(me=true,N?.()),G&&!$?Lt():!G&&!B&&($=false);}let _e=it(A??window,[e],At,ir,()=>{let s=m.join();u.forEach(He),Tt(),$e=true,m.join()!==s&&Ve();}),gt=ye>0;function Ve(){_e.hold(q||gt);}let kt;return gt&&(kt=setTimeout(()=>{gt=false,Ve();},ye)),Ve(),mt({destroy(){clearTimeout(Se),clearTimeout(kt),_e.off(),Et();},replay(){$t(),Ue=-1,Ye=-1,we=0,q=false,oe=0,clearTimeout(Se),Ve();},pause(){q=true,_e.hold(true);},resume(){q&&(q=false,$e=true,Ve());},seek(s){let c=Math.min(1,Math.max(0,s));oe=c,ut=c,Qe=[],q=true,_e.hold(true),rr(c,g),$e=true;},getProgress(){return oe},refresh:_e.remeasure},()=>({tStart:E,tEnd:S}))}function Tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Yt(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let o=[],a=[],l=r[2].trim();if(l)for(let i of l.split(/[\s,]+/)){let f=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),a.push(f?f[2]:"");}n.push({fn:r[1],nums:o,units:a});}return n}function xr(e,n,t){let r=Yt(e),o=Yt(n);return r.length===0||r.length!==o.length?t<1?e:n:r.map((a,l)=>{let i=o[l];return a.fn!==i.fn||a.nums.length!==i.nums.length?t<1?`${a.fn}(${a.nums.map((f,d)=>`${f}${a.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((f,d)=>`${f}${i.units[d]}`).join(", ")})`:`${a.fn}(${a.nums.map((f,d)=>`${f+(i.nums[d]-f)*t}${a.units[d]}`).join(", ")})`}).join(" ")}function bt(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),o=String(n);if(Tr(r))return tt(r,o,t);if(r.includes("("))return xr(r,o,t);let a=r.match(/^([-+]?[\d.]+)(.*)$/),l=o.match(/^([-+]?[\d.]+)(.*)$/);if(a&&l){let i=parseFloat(a[1]),f=parseFloat(l[1]);return `${i+(f-i)*t}${a[2]||l[2]}`}return t<1?r:o}function Pr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Ar=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Lr=0,Xt="--scroll-draw-progress";function $r(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Re(e,n){return typeof window>"u"?Jt:n.respectReducedMotion===false?Zt(e,n,false):nt(n,(t,r)=>Zt(e,t,r))}function Zt(e,n,t){let{props:r,trigger:o={},easing:a="ease-out",speed:l=1,once:i=false,axis:f="y",scrollContainer:d,native:b=true,velocityScale:w=false,triggerElement:g,onProgress:B,onComplete:ge,onEnter:_,onLeave:U,onEnterBack:xe,onLeaveBack:ye}=n,Y=Ze(a,"ease-out"),te=Oe(o.start||"top bottom"),re=Oe(o.end||"bottom top"),X=g??e,R=typeof d=="string"?document.querySelector(d):d??null,ee=Object.entries(r).map(([u,m])=>({prop:Pr(u),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function at(){let u=window.getComputedStyle(e);for(let m of ee)m.from===""&&(m.from=u.getPropertyValue(m.prop).trim()||"0");}function Ee(){for(let u of ee)e.style.setProperty(u.prop,String(u.to));}let Pe=new Map;for(let u of [...ee.map(m=>m.prop),Xt])Pe.set(u,e.style.getPropertyValue(u));function V(){for(let[u,m]of Pe)m?e.style.setProperty(u,m):e.style.removeProperty(u);}if(t)return Ee(),ge?.(),{...Jt,destroy:V,getProgress:()=>1};at();let se=()=>R?f==="x"?R.scrollLeft:R.scrollTop:f==="x"?window.scrollX:window.scrollY,Ne=()=>R?f==="x"?R.clientWidth:R.clientHeight:f==="x"?window.innerWidth:window.innerHeight,je=typeof a=="string"?rt(a):null;function lt(){if(!b||!$r()||!je||f!=="y"||R||X!==e||i||l!==1||B||ge||_||U||xe||ye||w!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let u of ee)if(!Ar.has(u.prop))return false;return true}function ve(){let u=`ssd-a-${++Lr}`,m=ee.map(M=>`${M.prop}:${M.from}`).join(";"),L=ee.map(M=>`${M.prop}:${M.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${u}{from{${m}}to{${L}}}.${u}{animation-name:${u};animation-duration:auto;animation-timing-function:${je};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(u);let S=()=>{let M=e.getBoundingClientRect();return Ie({top:M.top,height:M.height},se(),Ne(),te,re)};ze(e,{type:"animate",getProgress:()=>P.getProgress(),getTrigger:S});let P={refresh(){},destroy(){e.classList.remove(u),E.remove(),e.style.animationPlayState="",V(),Ge(e);},replay(){e.classList.remove(u),e.offsetWidth,e.classList.add(u);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(M){let be=Math.min(1,Math.max(0,M));e.classList.remove(u);for(let $ of ee)e.style.setProperty($.prop,bt($.from,$.to,be));},getProgress(){let{tStart:M,tEnd:be}=S();return Y(Q(se(),M,be,l))}};return P}if(lt())return ve();let N=0,z=0,ie=false,Ae=-1,ae=0,ne=0,F=false,D=NaN,Le=-1,Fe=0,A=X===e?ee:[],le=false;function ue(){let u=e.style,m=A.map(P=>u.getPropertyValue(P.prop)),L=u.transition;A.length&&(u.transition="none"),A.forEach(P=>u.setProperty(P.prop,Pe.get(P.prop)??""));let E=Je(X,R,f);A.forEach((P,M)=>u.setProperty(P.prop,m[M])),A.length&&(e.offsetWidth,u.transition=L);let S=Ie(E,E.scroll,Ne(),te,re);le&&Math.abs(S.tStart-N)<1&&Math.abs(S.tEnd-z)<1||(le=true,N=S.tStart,z=S.tEnd);}function Z(u){e.style.setProperty(Xt,String(u));for(let m of ee)e.style.setProperty(m.prop,bt(m.from,m.to,u));B?.(u);}function he(u){if(isNaN(D)){D=u;return}D<=0&&u>0&&_?.(),D<1&&u>=1&&U?.(),D>=1&&u<1&&xe?.(),D>0&&u<=0&&ye?.(),D=u;}function ce(){if(ie)return;let u=performance.now(),m=se(),L=l;if(w!==false){let M=u-Fe,be=M>0?Math.abs(m-(Le<0?m:Le))/M:0;L=l*Math.max(.2,1+be*(typeof w=="number"?w:1)*.04);}Le=m,Fe=u;let E=z===N?0:(m-N)/(z-N);he(E);let S=Q(m,N,z,L),P=i?Math.max(Ae,Y(ae=Math.max(ae,S))):Y(S);ne=P,Z(P),P>=1&&!F?(F=true,ge?.()):P<1&&!i&&(F=false);}let J=it(R??window,[X],()=>Q(se(),N,z,Math.min(l,1)),ce,ue);ue(),z===N&&K("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ae=Q(se(),N,z,l),ne=Y(ae),Z(ne),ze(e,{type:"animate",getProgress:()=>ne,getTrigger:()=>({tStart:N,tEnd:z})});function fe(){ie=true,J.hold(true);}return {destroy(){ie=true,J.off(),V(),Ge(e);},replay(){Ae=-1,ae=0,F=false,ne=0,ie=false,Z(0),J.hold(false);},pause:fe,resume(){ie&&(ie=false,J.hold(false));},seek(u){let m=Math.min(1,Math.max(0,u));ne=m,Ae=m,ae=0,fe(),Z(m);},getProgress(){return ne},refresh:J.remeasure}}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function er(e,n={}){if(typeof window>"u")return Kt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return K("scrollParallax: element not found:",e),Kt;let{speed:r=.3,axis:o="y",easing:a="linear",trigger:l,onProgress:i}=n,f=-r*100,d=t.style,b=!!t.ownerSVGElement,w=d.getPropertyValue("transform-box");b&&d.setProperty("transform-box","fill-box");let g=Re(t,{props:o==="x"?{transform:["translateX(0%)",`translateX(${f}%)`]}:{transform:["translateY(0%)",`translateY(${f}%)`]},trigger:l??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:i});return b?{...g,destroy(){g.destroy(),d.setProperty("transform-box",w);}}:g}function qe(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var Te={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pn(e,n={}){if(typeof window>"u")return Te;let t=qe(e).map(r=>ht(r,n));return {destroy(){t.forEach(r=>r.destroy());},replay(){t.forEach(r=>r.replay());},pause(){t.forEach(r=>r.pause());},resume(){t.forEach(r=>r.resume());},seek(r){t.forEach(o=>o.seek(r));},getProgress(){return t[0]?.getProgress()??0},refresh(){t.forEach(r=>r.refresh?.());}}}function An(e,n={}){if(typeof window>"u")return Te;let t=qe(e);if(t.length===0)return Te;let r=0,o=[];function a(i){return ht(t[i],{...n,once:true,onComplete(){n.onComplete?.(),r=Math.min(i+1,t.length-1),r>i&&o[r]?.resume();}})}function l(){t.forEach((i,f)=>{o[f]=a(f);});for(let i=1;i<o.length;i++)o[i].pause();}return l(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,r=0,l();},pause(){o[r]?.pause();},resume(){o[r]?.resume();},seek(i){o[r]?.seek(i);},getProgress(){return o[r]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function Ln(e,n){if(typeof window>"u")return Te;let t=qe(e).map(r=>Re(r,n));return {destroy(){t.forEach(r=>r.destroy());},replay(){t.forEach(r=>r.replay());},pause(){t.forEach(r=>r.pause());},resume(){t.forEach(r=>r.resume());},seek(r){t.forEach(o=>o.seek(r));},getProgress(){return t[0]?.getProgress()??0},refresh(){t.forEach(r=>r.refresh?.());}}}function $n(e,n){if(typeof window>"u")return Te;let t=qe(e);if(t.length===0)return Te;let r=0,o=[];function a(i){return Re(t[i],{...n,once:true,onComplete(){n.onComplete?.(),r=Math.min(i+1,t.length-1),r>i&&o[r]?.resume();}})}function l(){t.forEach((i,f)=>{o[f]=a(f);});for(let i=1;i<o.length;i++)o[i].pause();}return l(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,r=0,l();},pause(){o[r]?.pause();},resume(){o[r]?.resume();},seek(i){o[r]?.seek(i);},getProgress(){return o[r]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function kn(e,n={}){if(typeof window>"u")return Te;let t=qe(e).map(r=>er(r,n));return {destroy(){t.forEach(r=>r.destroy());},replay(){t.forEach(r=>r.replay());},pause(){t.forEach(r=>r.pause());},resume(){t.forEach(r=>r.resume());},seek(r){t.forEach(o=>o.seek(r));},getProgress(){return t[0]?.getProgress()??0},refresh(){t.forEach(r=>r.refresh?.());}}}exports.scrollAnimateGroup=Ln;exports.scrollAnimateSequence=$n;exports.scrollDrawGroup=Pn;exports.scrollDrawSequence=An;exports.scrollParallaxGroup=kn;
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.mjs';
2
- import { S as ScrollParallaxOptions } from '../index-DAiRJgtF.mjs';
3
- import { S as ScrollAnimateOptions } from '../engine-BLWKCfxC.mjs';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.mjs';
2
+ import { S as ScrollParallaxOptions } from '../index-ClAFxNEp.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-Bi2x8-X-.mjs';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.js';
2
- import { S as ScrollParallaxOptions } from '../index-hSQqLVbg.js';
3
- import { S as ScrollAnimateOptions } from '../engine-6VsjEwzb.js';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.js';
2
+ import { S as ScrollParallaxOptions } from '../index-CEMsUTEG.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-DAlvk6i0.js';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1 +1 @@
1
- import {b as b$1}from'../chunk-QZKYGS74.mjs';import {a as a$1}from'../chunk-7USW2XFB.mjs';import {b}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.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-UBH4K5YD.mjs';import {a as a$1}from'../chunk-HAGTU5EX.mjs';import {b}from'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.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 Fe({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function Ve({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),i=0,a=[];for(let u=0;u<n;u++){let d=Math.pow(o,u);a.push(d),i+=d;}let f=[0],c=0;for(let u=0;u<n;u++)c+=a[u]/i,f.push(c);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let d=0;d<n;d++)if(u<=f[d+1]){let h=(u-f[d])/(f[d+1]-f[d]);if(d===0)return h*(2-h);let w=1-Math.pow(r,d);return w+(1-w)*(2*h-1)*(2*h-1)}return 1}}function Be({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 i=>i<=0?0:i>=1?1:n*Math.pow(2,-10*i)*Math.sin((i-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:Fe(),bounce:Ve(),elastic:Be()};function be(e,t,n){return Math.min(n,Math.max(t,e))}function ie(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}}var Ee=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function ye(e,t,n,r){return e+n+t*Ee(r,0)}function he(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ee(e,1))}function q(e,t,n,r){return n===t?0:be((e-t)/(n-t)*r,0,1)}function se(e,t,n,r,o){let i=ye(e.top,e.height,t,r.element)-he(r.viewport,n),a=ye(e.top,e.height,t,o.element)-he(o.viewport,n);return {tStart:i,tEnd:a}}function ve(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 we(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 Se(e,t,n){let r=we(e),o=we(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 Ge="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Me=33;function qe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function je(e){let t=[];for(let n=0;n<Me;n++){let r=n/(Me-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Le(e){switch(e){case "linear":return "linear";case "ease-in":return Ge;case "ease-out":return Qe;case "ease-in-out":return qe()?je(Q["ease-in-out"]):null;default:return null}}var Te=Symbol.for("svg-scroll-draw.registry");function xe(){let e=globalThis;return e[Te]||(e[Te]=new Map)}function ae(e,t){xe().set(e,t);}function ue(e){xe().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);}function Pe(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 Re(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Pe(i=>{if(!i)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let i of Object.keys(n))o[i]=(...a)=>n[i]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}var Y,ee=new Set,te=new WeakMap,U=new Map,$e=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ue(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();Y??(Y=new ResizeObserver(o=>{let i=false;for(let{target:a}of o)te.get(a)!==$e(a)&&(i=true),te.set(a,"");i&&ee.forEach(a=>a());})),ee.add(n);let r=Ue(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{te.has(o)||te.set(o,$e(o)),U.set(o,(U.get(o)??0)+1),Y.observe(o);}),()=>{ee.delete(n)&&(r.forEach(o=>{let i=(U.get(o)??1)-1;if(i)return void U.set(o,i);U.delete(o),Y?.unobserve(o);}),ee.size||(Y?.disconnect(),Y=void 0));}}function Ce(e,t,n,r,o){let i,a=NaN,f,c,u=()=>{i=0,r(),!f&&!i&&(a=n())>0&&a<1&&(i=requestAnimationFrame(u));},d=()=>{!i&&!f&&n()!==a&&(i=requestAnimationFrame(u));},h=p=>{f=p,cancelAnimationFrame(i),i=a=NaN,d();},w=()=>{clearTimeout(c),o(),d();},M=()=>{clearTimeout(c),c=setTimeout(w,150);},x=ne(t,M),v=p=>{e[p]("scroll",d,{passive:true}),window[p]("resize",M),window[p]("orientationchange",M);};return v("addEventListener"),d(),{hold:h,remeasure:w,off(){h(true),v("removeEventListener"),x(),clearTimeout(c);}}}function Xe(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ae(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],i=[],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),i.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:i});}return t}function Ke(e,t,n){let r=Ae(e),o=Ae(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((i,a)=>{let f=o[a];return i.fn!==f.fn||i.nums.length!==f.nums.length?n<1?`${i.fn}(${i.nums.map((c,u)=>`${c}${i.units[u]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,u)=>`${c}${f.units[u]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,u)=>`${c+(f.nums[u]-c)*n}${i.units[u]}`).join(", ")})`}).join(" ")}function Ie(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Xe(r))return Se(r,o,n);if(r.includes("("))return Ke(r,o,n);let i=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let f=parseFloat(i[1]),c=parseFloat(a[1]);return `${f+(c-f)*n}${i[2]||a[2]}`}return n<1?r:o}function Ze(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Je=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),et=0,_e="--scroll-draw-progress";function tt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ke={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,t){return typeof window>"u"?ke:t.respectReducedMotion===false?He(e,t,false):Re(t,(n,r)=>He(e,n,r))}function He(e,t,n){let{props:r,trigger:o={},easing:i="ease-out",speed:a=1,once:f=false,axis:c="y",scrollContainer:u,native:d=true,velocityScale:h=false,triggerElement:w,onProgress:M,onComplete:x,onEnter:v,onLeave:p,onEnterBack:z,onLeaveBack:P}=t,A=typeof i=="function"?i:Q[i]??Q["ease-out"],H=ie(o.start||"top bottom"),W=ie(o.end||"bottom top"),C=w??e,S=typeof u=="string"?document.querySelector(u):u??null,y=Object.entries(r).map(([s,l])=>({prop:Ze(s),from:Array.isArray(l)?l[0]:"",to:Array.isArray(l)?l[1]:l}));function D(){let s=window.getComputedStyle(e);for(let l of y)l.from===""&&(l.from=s.getPropertyValue(l.prop).trim()||"0");}function X(){for(let s of y)e.style.setProperty(s.prop,String(s.to));}let m=new Map;for(let s of [...y.map(l=>l.prop),_e])m.set(s,e.style.getPropertyValue(s));function b(){for(let[s,l]of m)l?e.style.setProperty(s,l):e.style.removeProperty(s);}if(n)return X(),x?.(),{...ke,destroy:b,getProgress:()=>1};D();let F=()=>S?c==="x"?S.scrollLeft:S.scrollTop:c==="x"?window.scrollX:window.scrollY,ce=()=>S?c==="x"?S.clientWidth:S.clientHeight:c==="x"?window.innerWidth:window.innerHeight,me=typeof i=="string"?Le(i):null;function Oe(){if(!d||!tt()||!me||c!=="y"||S||C!==e||f||a!==1||M||x||v||p||z||P||h!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let s of y)if(!Je.has(s.prop))return false;return true}function ze(){let s=`ssd-a-${++et}`,l=y.map(g=>`${g.prop}:${g.from}`).join(";"),O=y.map(g=>`${g.prop}:${g.to}`).join(";"),$=document.createElement("style");$.setAttribute("data-ssd-animate",""),$.textContent=`@keyframes ${s}{from{${l}}to{${O}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${me};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(s);let T=()=>{let g=e.getBoundingClientRect();return se({top:g.top,height:g.height},F(),ce(),H,W)};ae(e,{type:"animate",getProgress:()=>E.getProgress(),getTrigger:T});let E={refresh(){},destroy(){e.classList.remove(s),$.remove(),e.style.animationPlayState="",b(),ue(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(g){let G=Math.min(1,Math.max(0,g));e.classList.remove(s);for(let J of y)e.style.setProperty(J.prop,Ie(J.from,J.to,G));},getProgress(){let{tStart:g,tEnd:G}=T();return A(q(F(),g,G,a))}};return E}if(Oe())return ze();let L=0,R=0,k=false,re=-1,N=0,I=0,K=false,_=NaN,oe=-1,fe=0,V=C===e?y:[],de=false;function pe(){let s=e.style,l=V.map(E=>s.getPropertyValue(E.prop)),O=s.transition;V.length&&(s.transition="none"),V.forEach(E=>s.setProperty(E.prop,m.get(E.prop)??""));let $=ve(C,S,c);V.forEach((E,g)=>s.setProperty(E.prop,l[g])),V.length&&(e.offsetWidth,s.transition=O);let T=se($,$.scroll,ce(),H,W);de&&Math.abs(T.tStart-L)<1&&Math.abs(T.tEnd-R)<1||(de=true,L=T.tStart,R=T.tEnd);}function Z(s){e.style.setProperty(_e,String(s));for(let l of y)e.style.setProperty(l.prop,Ie(l.from,l.to,s));M?.(s);}function We(s){if(isNaN(_)){_=s;return}_<=0&&s>0&&v?.(),_<1&&s>=1&&p?.(),_>=1&&s<1&&z?.(),_>0&&s<=0&&P?.(),_=s;}function De(){if(k)return;let s=performance.now(),l=F(),O=a;if(h!==false){let g=s-fe,G=g>0?Math.abs(l-(oe<0?l:oe))/g:0;O=a*Math.max(.2,1+G*(typeof h=="number"?h:1)*.04);}oe=l,fe=s;let $=R===L?0:(l-L)/(R-L);We($);let T=q(l,L,R,O),E=f?Math.max(re,A(N=Math.max(N,T))):A(T);I=E,Z(E),E>=1&&!K?(K=true,x?.()):E<1&&!f&&(K=false);}let B=Ce(S??window,[C],()=>q(F(),L,R,Math.min(a,1)),De,pe);pe(),R===L&&j("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),N=q(F(),L,R,a),I=A(N),Z(I),ae(e,{type:"animate",getProgress:()=>I,getTrigger:()=>({tStart:L,tEnd:R})});function ge(){k=true,B.hold(true);}return {destroy(){k=true,B.off(),b(),ue(e);},replay(){re=-1,N=0,K=false,I=0,k=false,Z(0),B.hold(false);},pause:ge,resume(){k&&(k=false,B.hold(false));},seek(s){let l=Math.min(1,Math.max(0,s));I=l,re=l,N=0,ge(),Z(l);},getProgress(){return I},refresh:B.remeasure}}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:i={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:c}=t,u=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 h(){let m=d();if(m){let b=window.getComputedStyle(m);return m.clientWidth-(parseFloat(b.paddingLeft)||0)-(parseFloat(b.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function w(){return t.distance??r.scrollWidth-h()}function M(){if(t.triggerElement!==void 0){let b=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(b)return b;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=d();return m?m.parentElement??m:r}let x=w(),v=M(),p=le(r,A(x,v)),z=H(),P=null;function A(m,b){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:i,easing:o,native:false,respectReducedMotion:f,...b!==r&&{triggerElement:b},...a!==void 0&&{scrollContainer:a},...c!==void 0&&{onProgress:c}}}function H(){let m=v.getBoundingClientRect(),b=u?m.top-u.getBoundingClientRect().top+u.scrollTop:m.top+window.scrollY;return `${w()} ${Math.round(b)} ${Math.round(m.height)}`}function W(){p.destroy();let m=M(),b=m!==v;x=w(),v=m,p=le(r,A(x,v)),z=H(),P!==null&&p.seek(P),b&&X();}let C;function S(){(M()!==v||H()!==z)&&W();}function y(){clearTimeout(C),C=setTimeout(S,150);}window.addEventListener("resize",y),window.addEventListener("orientationchange",y);let D=()=>{};function X(){D(),D=ne([r,v],y);}return X(),{destroy(){clearTimeout(C),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),D(),p.destroy();},replay(){P=null,p.replay();},pause(){p.pause(),P=p.getProgress();},resume(){P=null,p.resume();},seek(m){p.seek(m),P=p.getProgress();},getProgress(){return p.getProgress()},refresh(){W();}}}exports.scrollHorizontal=At;
1
+ 'use strict';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 k(e,...n){Qe&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Ge({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function qe({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(r),o=0,s=[];for(let l=0;l<t;l++){let d=Math.pow(i,l);s.push(d),o+=d;}let u=[0],c=0;for(let l=0;l<t;l++)c+=s[l]/o,u.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let d=0;d<t;d++)if(l<=u[d+1]){let h=(l-u[d])/(u[d+1]-u[d]);if(d===0)return h*(2-h);let w=1-Math.pow(r,d);return w+(1-w)*(2*h-1)*(2*h-1)}return 1}}function je({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),i=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return o=>o<=0?0:o>=1?1:t*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/r)+1}var W={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:Ge(),bounce:qe(),elastic:je()};function Ue(e,n,t,r){let i=(o,s,u)=>((1+3*o-3*s)*u+3*s-6*o)*u*u+3*o*u;return o=>{if(o<=0||o>=1)return +(o>0);let s=o;for(let u=0;u<8;u++)s-=(i(e,t,s)-o)/((3*(1+3*e-3*t)*s+6*t-12*e)*s+3*e);if(!(s>=0&&s<=1&&Math.abs(i(e,t,s)-o)<1e-9))for(let u=0,c=0,l=1;u<30;u++)s=(c+l)/2,i(e,t,s)<o?c=s:l=s;return i(n,r,s)}}function ie(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [Ue(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var ye=new Set;function he(e,n="linear"){if(typeof e=="function")return e;if(e==null)return W[n];if({}.hasOwnProperty.call(W,e))return W[e];let t=ie(String(e));return t?t[0]:(!ye.has(e)&&ye.add(e)&&k(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),W[n])}function Ee(e,n,t){return Math.min(t,Math.max(n,e))}function se(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var Se=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function ve(e,n,t,r){return e+t+n*Se(r,0)}function we(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Se(e,1))}function j(e,n,t,r){return t===n?0:Ee((e-n)/(t-n)*r,0,1)}function ae(e,n,t,r,i){let o=ve(e.top,e.height,n,r.element)-we(r.viewport,t),s=ve(e.top,e.height,n,i.element)-we(i.viewport,t);return {tStart:o,tEnd:s}}function Me(e,n,t){let r=e.getBoundingClientRect(),i=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:i,scroll:0}:{top:t==="x"?r.left:r.top,height:i,scroll:t==="x"?window.scrollX:window.scrollY}}function Le(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Te(e,n,t){let r=Le(e),i=Le(n);return !r||!i?e:`rgb(${Math.round(r[0]+(i[0]-r[0])*t)},${Math.round(r[1]+(i[1]-r[1])*t)},${Math.round(r[2]+(i[2]-r[2])*t)})`}var Ye="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Xe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xe=33;function Ke(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Je(e){let n=[];for(let t=0;t<xe;t++){let r=t/(xe-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return Ye;case "ease-out":return Xe;case "ease-in-out":return Ke()?Je(W["ease-in-out"]):null;default:return ie(e)?.[1]??null}}var Re=Symbol.for("svg-scroll-draw.registry");function $e(){let e=globalThis;return e[Re]||(e[Re]=new Map)}function ue(e,n){$e().set(e,n);}function le(e){$e().delete(e);}function Ce(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=i=>e(!!i.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function Ae(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=Ce(o=>{if(!o)return;r();let s=(t.getProgress?.()??0)>=1;t.destroy(),t=n(s?{...e,onComplete:void 0}:e,true);}),i={};for(let o of Object.keys(t))i[o]=(...s)=>t[o]?.(...s);return i.destroy=()=>{r(),t.destroy();},i}var U,ee=new Set,te=new WeakMap,Y=new Map,Ie=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Ze(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function ne(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();U??(U=new ResizeObserver(i=>{let o=false;for(let{target:s}of i)te.get(s)!==Ie(s)&&(o=true),te.set(s,"");o&&ee.forEach(s=>s());})),ee.add(t);let r=Ze(e);return [document.body,document.documentElement].forEach(i=>i&&r.add(i)),r.forEach(i=>{te.has(i)||te.set(i,Ie(i)),Y.set(i,(Y.get(i)??0)+1),U.observe(i);}),()=>{ee.delete(t)&&(r.forEach(i=>{let o=(Y.get(i)??1)-1;if(o)return void Y.set(i,o);Y.delete(i),U?.unobserve(i);}),ee.size||(U?.disconnect(),U=void 0));}}function _e(e,n,t,r,i){let o,s=NaN,u,c,l=()=>{o=0,r(),!u&&!o&&(s=t())>0&&s<1&&(o=requestAnimationFrame(l));},d=()=>{!o&&!u&&t()!==s&&(o=requestAnimationFrame(l));},h=p=>{u=p,cancelAnimationFrame(o),o=s=NaN,d();},w=()=>{clearTimeout(c),i(),d();},M=()=>{clearTimeout(c),c=setTimeout(w,150);},x=ne(n,M),v=p=>{e[p]("scroll",d,{passive:true}),window[p]("resize",M),window[p]("orientationchange",M);};return v("addEventListener"),d(),{hold:h,remeasure:w,off(){h(true),v("removeEventListener"),x(),clearTimeout(c);}}}function et(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ke(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let i=[],o=[],s=r[2].trim();if(s)for(let u of s.split(/[\s,]+/)){let c=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}n.push({fn:r[1],nums:i,units:o});}return n}function tt(e,n,t){let r=ke(e),i=ke(n);return r.length===0||r.length!==i.length?t<1?e:n:r.map((o,s)=>{let u=i[s];return o.fn!==u.fn||o.nums.length!==u.nums.length?t<1?`${o.fn}(${o.nums.map((c,l)=>`${c}${o.units[l]}`).join(", ")})`:`${u.fn}(${u.nums.map((c,l)=>`${c}${u.units[l]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,l)=>`${c+(u.nums[l]-c)*t}${o.units[l]}`).join(", ")})`}).join(" ")}function He(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),i=String(n);if(et(r))return Te(r,i,t);if(r.includes("("))return tt(r,i,t);let o=r.match(/^([-+]?[\d.]+)(.*)$/),s=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&s){let u=parseFloat(o[1]),c=parseFloat(s[1]);return `${u+(c-u)*t}${o[2]||s[2]}`}return t<1?r:i}function nt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var rt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),ot=0,Oe="--scroll-draw-progress";function it(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ce(e,n){return typeof window>"u"?Ne:n.respectReducedMotion===false?ze(e,n,false):Ae(n,(t,r)=>ze(e,t,r))}function ze(e,n,t){let{props:r,trigger:i={},easing:o="ease-out",speed:s=1,once:u=false,axis:c="y",scrollContainer:l,native:d=true,velocityScale:h=false,triggerElement:w,onProgress:M,onComplete:x,onEnter:v,onLeave:p,onEnterBack:F,onLeaveBack:P}=n,A=he(o,"ease-out"),H=se(i.start||"top bottom"),D=se(i.end||"bottom top"),C=w??e,S=typeof l=="string"?document.querySelector(l):l??null,y=Object.entries(r).map(([a,m])=>({prop:nt(a),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function V(){let a=window.getComputedStyle(e);for(let m of y)m.from===""&&(m.from=a.getPropertyValue(m.prop).trim()||"0");}function X(){for(let a of y)e.style.setProperty(a.prop,String(a.to));}let f=new Map;for(let a of [...y.map(m=>m.prop),Oe])f.set(a,e.style.getPropertyValue(a));function b(){for(let[a,m]of f)m?e.style.setProperty(a,m):e.style.removeProperty(a);}if(t)return X(),x?.(),{...Ne,destroy:b,getProgress:()=>1};V();let B=()=>S?c==="x"?S.scrollLeft:S.scrollTop:c==="x"?window.scrollX:window.scrollY,me=()=>S?c==="x"?S.clientWidth:S.clientHeight:c==="x"?window.innerWidth:window.innerHeight,fe=typeof o=="string"?Pe(o):null;function Fe(){if(!d||!it()||!fe||c!=="y"||S||C!==e||u||s!==1||M||x||v||p||F||P||h!==false||(i.start||"top bottom").trim()!=="top bottom"||(i.end||"bottom top").trim()!=="bottom top")return false;for(let a of y)if(!rt.has(a.prop))return false;return true}function De(){let a=`ssd-a-${++ot}`,m=y.map(g=>`${g.prop}:${g.from}`).join(";"),N=y.map(g=>`${g.prop}:${g.to}`).join(";"),$=document.createElement("style");$.setAttribute("data-ssd-animate",""),$.textContent=`@keyframes ${a}{from{${m}}to{${N}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${fe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(a);let T=()=>{let g=e.getBoundingClientRect();return ae({top:g.top,height:g.height},B(),me(),H,D)};ue(e,{type:"animate",getProgress:()=>E.getProgress(),getTrigger:T});let E={refresh(){},destroy(){e.classList.remove(a),$.remove(),e.style.animationPlayState="",b(),le(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(g){let q=Math.min(1,Math.max(0,g));e.classList.remove(a);for(let Z of y)e.style.setProperty(Z.prop,He(Z.from,Z.to,q));},getProgress(){let{tStart:g,tEnd:q}=T();return A(j(B(),g,q,s))}};return E}if(Fe())return De();let L=0,R=0,O=false,re=-1,z=0,I=0,K=false,_=NaN,oe=-1,de=0,Q=C===e?y:[],pe=false;function ge(){let a=e.style,m=Q.map(E=>a.getPropertyValue(E.prop)),N=a.transition;Q.length&&(a.transition="none"),Q.forEach(E=>a.setProperty(E.prop,f.get(E.prop)??""));let $=Me(C,S,c);Q.forEach((E,g)=>a.setProperty(E.prop,m[g])),Q.length&&(e.offsetWidth,a.transition=N);let T=ae($,$.scroll,me(),H,D);pe&&Math.abs(T.tStart-L)<1&&Math.abs(T.tEnd-R)<1||(pe=true,L=T.tStart,R=T.tEnd);}function J(a){e.style.setProperty(Oe,String(a));for(let m of y)e.style.setProperty(m.prop,He(m.from,m.to,a));M?.(a);}function Ve(a){if(isNaN(_)){_=a;return}_<=0&&a>0&&v?.(),_<1&&a>=1&&p?.(),_>=1&&a<1&&F?.(),_>0&&a<=0&&P?.(),_=a;}function Be(){if(O)return;let a=performance.now(),m=B(),N=s;if(h!==false){let g=a-de,q=g>0?Math.abs(m-(oe<0?m:oe))/g:0;N=s*Math.max(.2,1+q*(typeof h=="number"?h:1)*.04);}oe=m,de=a;let $=R===L?0:(m-L)/(R-L);Ve($);let T=j(m,L,R,N),E=u?Math.max(re,A(z=Math.max(z,T))):A(T);I=E,J(E),E>=1&&!K?(K=true,x?.()):E<1&&!u&&(K=false);}let G=_e(S??window,[C],()=>j(B(),L,R,Math.min(s,1)),Be,ge);ge(),R===L&&k("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),z=j(B(),L,R,s),I=A(z),J(I),ue(e,{type:"animate",getProgress:()=>I,getTrigger:()=>({tStart:L,tEnd:R})});function be(){O=true,G.hold(true);}return {destroy(){O=true,G.off(),b(),le(e);},replay(){re=-1,z=0,K=false,I=0,O=false,J(0),G.hold(false);},pause:be,resume(){O&&(O=false,G.hold(false));},seek(a){let m=Math.min(1,Math.max(0,a));I=m,re=m,z=0,be(),J(m);},getProgress(){return I},refresh:G.remeasure}}var We={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function Ot(e,n={}){if(typeof window>"u")return We;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return k("scrollHorizontal: track element not found:",e),We;let r=t,{easing:i="linear",trigger:o={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:u=false,onProgress:c}=n,l=typeof s=="string"?document.querySelector(s):s??null;function d(){for(let f=r.parentElement;f;f=f.parentElement)if(window.getComputedStyle(f).position==="sticky")return f;return null}function h(){let f=d();if(f){let b=window.getComputedStyle(f);return f.clientWidth-(parseFloat(b.paddingLeft)||0)-(parseFloat(b.paddingRight)||0)}return l?l.clientWidth:document.documentElement.clientWidth||window.innerWidth}function w(){return n.distance??r.scrollWidth-h()}function M(){if(n.triggerElement!==void 0){let b=typeof n.triggerElement=="string"?document.querySelector(n.triggerElement):n.triggerElement;if(b)return b;k("scrollHorizontal: triggerElement not found:",n.triggerElement);}let f=d();return f?f.parentElement??f:r}let x=w(),v=M(),p=ce(r,A(x,v)),F=H(),P=null;function A(f,b){return {props:{transform:["translateX(0px)",`translateX(${-f}px)`]},trigger:o,easing:i,native:false,respectReducedMotion:u,...b!==r&&{triggerElement:b},...s!==void 0&&{scrollContainer:s},...c!==void 0&&{onProgress:c}}}function H(){let f=v.getBoundingClientRect(),b=l?f.top-l.getBoundingClientRect().top+l.scrollTop:f.top+window.scrollY;return `${w()} ${Math.round(b)} ${Math.round(f.height)}`}function D(){p.destroy();let f=M(),b=f!==v;x=w(),v=f,p=ce(r,A(x,v)),F=H(),P!==null&&p.seek(P),b&&X();}let C;function S(){(M()!==v||H()!==F)&&D();}function y(){clearTimeout(C),C=setTimeout(S,150);}window.addEventListener("resize",y),window.addEventListener("orientationchange",y);let V=()=>{};function X(){V(),V=ne([r,v],y);}return X(),{destroy(){clearTimeout(C),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),V(),p.destroy();},replay(){P=null,p.replay();},pause(){p.pause(),P=p.getProgress();},resume(){P=null,p.resume();},seek(f){p.seek(f),P=p.getProgress();},getProgress(){return p.getProgress()},refresh(){D();}}}exports.scrollHorizontal=Ot;
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-9bcJdVcg.mjs';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as Easing } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -17,7 +17,7 @@ interface ScrollHorizontalOptions {
17
17
  */
18
18
  trigger?: TriggerConfig;
19
19
  /** Easing for the horizontal movement. Default: `'linear'` (scrub feel). */
20
- easing?: EasingName | ((t: number) => number);
20
+ easing?: Easing;
21
21
  /** Custom scroll container. Default: window. */
22
22
  scrollContainer?: string | Element;
23
23
  /**
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-9bcJdVcg.js';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as Easing } from '../types-iITMwrru.js';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -17,7 +17,7 @@ interface ScrollHorizontalOptions {
17
17
  */
18
18
  trigger?: TriggerConfig;
19
19
  /** Easing for the horizontal movement. Default: `'linear'` (scrub feel). */
20
- easing?: EasingName | ((t: number) => number);
20
+ easing?: Easing;
21
21
  /** Custom scroll container. Default: window. */
22
22
  scrollContainer?: string | Element;
23
23
  /**
@@ -1 +1 @@
1
- import {a}from'../chunk-7USW2XFB.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.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-HAGTU5EX.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.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 S(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=S();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=S();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),b$1=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)),b$1=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==b$1)&&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,10 +1,10 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from './types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
5
5
  to: number;
6
6
  format?: (value: number) => string;
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  trigger?: TriggerConfig;
9
9
  once?: boolean;
10
10
  decimals?: number;
@@ -1,10 +1,10 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
2
- import { S as ScrollAnimateOptions } from './engine-6VsjEwzb.js';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from './types-iITMwrru.js';
2
+ import { S as ScrollAnimateOptions } from './engine-DAlvk6i0.js';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
6
6
  axis?: 'x' | 'y';
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  trigger?: TriggerConfig;
9
9
  onProgress?: (alpha: number) => void;
10
10
  }
@@ -1,10 +1,10 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
2
- import { S as ScrollAnimateOptions } from './engine-BLWKCfxC.mjs';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from './types-iITMwrru.mjs';
2
+ import { S as ScrollAnimateOptions } from './engine-Bi2x8-X-.mjs';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
6
6
  axis?: 'x' | 'y';
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  trigger?: TriggerConfig;
9
9
  onProgress?: (alpha: number) => void;
10
10
  }
@@ -1,10 +1,10 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from './types-iITMwrru.js';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
5
5
  to: number;
6
6
  format?: (value: number) => string;
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  trigger?: TriggerConfig;
9
9
  once?: boolean;
10
10
  decimals?: number;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';function Ct({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Dt({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,l=[];for(let d=0;d<t;d++){let v=Math.pow(s,d);l.push(v),i+=v;}let u=[0],m=0;for(let d=0;d<t;d++)m+=l[d]/i,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let v=0;v<t;v++)if(d<=u[v+1]){let E=(d-u[v])/(u[v+1]-u[v]);if(v===0)return E*(2-E);let y=1-Math.pow(n,v);return y+(1-y)*(2*E-1)*(2*E-1)}return 1}}function Ot({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var oe={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:Ct(),bounce:Dt(),elastic:Ot()};function It(e,r,t){return Math.min(t,Math.max(r,e))}function Te(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}var Ht=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function Rt(e,r,t,n){return e+t+r*Ht(n,0)}function Nt(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ht(e,1))}function R(e,r,t,n){return t===r?0:It((e-r)/(t-r)*n,0,1)}function $e(e,r,t,n,s){let i=Rt(e.top,e.height,r,n.element)-Nt(n.viewport,t),l=Rt(e.top,e.height,r,s.element)-Nt(s.viewport,t);return {tStart:i,tEnd:l}}function Ke(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function Je(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Ft(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function et(e,r,t){let n=Ft(e),s=Ft(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var dt={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 _e=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function W(e,...r){_e&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var mr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",fr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",_t=33;function pr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function dr(e){let r=[];for(let t=0;t<_t;t++){let n=t/(_t-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function tt(e){switch(e){case "linear":return "linear";case "ease-in":return mr;case "ease-out":return fr;case "ease-in-out":return pr()?dr(oe["ease-in-out"]):null;default:return null}}var Vt=Symbol.for("svg-scroll-draw.registry");function Gt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function Me(e,r){Gt().set(e,r);}function pe(e){Gt().delete(e);}function rt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function Ve(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=rt(i=>{if(!i)return;n();let l=(t.getProgress?.()??0)>=1;t.destroy(),t=r(l?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...l)=>t[i]?.(...l);return s.destroy=()=>{n(),t.destroy();},s}var je,nt=new Set,ot=new WeakMap,Ye=new Map,Wt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function gr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function zt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();je??(je=new ResizeObserver(s=>{let i=false;for(let{target:l}of s)ot.get(l)!==Wt(l)&&(i=true),ot.set(l,"");i&&nt.forEach(l=>l());})),nt.add(t);let n=gr(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{ot.has(s)||ot.set(s,Wt(s)),Ye.set(s,(Ye.get(s)??0)+1),je.observe(s);}),()=>{nt.delete(t)&&(n.forEach(s=>{let i=(Ye.get(s)??1)-1;if(i)return void Ye.set(s,i);Ye.delete(s),je?.unobserve(s);}),nt.size||(je?.disconnect(),je=void 0));}}function ke(e,r,t,n,s){let i,l=NaN,u,m,d=()=>{i=0,n(),!u&&!i&&(l=t())>0&&l<1&&(i=requestAnimationFrame(d));},v=()=>{!i&&!u&&t()!==l&&(i=requestAnimationFrame(d));},E=w=>{u=w,cancelAnimationFrame(i),i=l=NaN,v();},y=()=>{clearTimeout(m),s(),v();},I=()=>{clearTimeout(m),m=setTimeout(y,150);},se=zt(r,I),f=w=>{e[w]("scroll",v,{passive:true}),window[w]("resize",I),window[w]("orientationchange",I);};return f("addEventListener"),v(),{hold:E,remeasure:y,off(){E(true),f("removeEventListener"),se(),clearTimeout(m);}}}var yr=0;function hr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var qt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function br(e){if(!_e)return;let r=Bt(e,"stroke");if(!r||r==="none"){W("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!qt.has(t)&&!qt.has(Bt(e,"fill"))&&W("Element has a fill \u2014 it may obscure the stroke animation.",e);}function wr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,l=e-i,u=r-i,m=t==="x";n.innerHTML=`
2
- <div style="position:absolute;${m?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var jt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function vr(e,r,t){if(!_e)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(jt)??[]).length,l=(r.match(jt)??[]).length;if(n!==s){W(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==l&&W(`morphTo: coordinate count differs (${i} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Er(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let l=parseFloat(i),u=n[s++]??l;return String(+(l+(u-l)*t).toFixed(4))})}function Qt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ve(r,(t,n)=>Sr(e,t,n))}function Sr(e,r,t){let{preset:n,...s}=r,i=n?{...dt[n],...s}:s,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:v={},stagger:E=0,direction:y="forward",once:I=false,debug:se=false,axis:f="y",scrollContainer:w,autoReverse:h=false,delay:x=0,strokeColor:b,strokeWidth:L,fillOpacity:U,waypoints:z,velocityScale:N=false,threshold:J=0,rootMargin:Ge="0px",repeat:le=0,repeatDelay:de=0,morphTo:B,clip:ee,autoplay:Ae=false,duration:P=1e3,native:H=true,onProgress:Ce,onStart:X,onComplete:te,onEnter:ge,onLeave:Re,onEnterBack:ye,onLeaveBack:me}=i,Z=ee===true?"left":typeof ee=="string"?ee:false,q=typeof d=="function"?d:oe[d]??oe.linear,Ne=Te(v.start||"top bottom"),We=Te(v.end||"bottom top"),F=typeof w=="string"?document.querySelector(w):w??null,he=Array.isArray(b)?b[0]:null,be=Array.isArray(b)?b[1]:typeof b=="string"?b:null,ce=Array.isArray(L)?L[0]:null,Pe=Array.isArray(L)?L[1]:typeof L=="number"?L:null,we=Array.isArray(U)?U[0]:null,ue=Array.isArray(U)?U[1]:typeof U=="number"?U:null;function ve(o){let c=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let a=Z?[]:Array.from(e.querySelectorAll(l)),p=[],_=[],M=0,$=0,O=E,k=0,Le=0,V=false,Ee=false,Se=0,at=-1,Qe=[],Ue=-1,ie=false,fe=0,De=0,Oe,lt=false,ct=null;function bt(){ct?.destroy(),ct=null;}let Ie=new Set,wt=NaN,He=true,Xe=-1,vt=performance.now(),Fe=NaN;function Ze(){return F?f==="x"?F.scrollLeft:F.scrollTop:f==="x"?window.scrollX:window.scrollY}function Et(){return F?f==="x"?F.clientWidth:F.clientHeight:f==="x"?window.innerWidth:window.innerHeight}function St(){let o=Ke(e,F,f);return $e(o,o.scroll,Et(),Ne,We)}function or(){let o=$-M,c=a.length-1,g=F??document.documentElement,T=f==="x"?"Width":"Height";if(O=E,E>0&&c>0&&o>0){let j=g[`scroll${T}`]-g[`client${T}`]-1-M-o/u;j>=0&&(O=Math.min(E,j/(c*o)));}let G=Math.max(0,c)*O*o,re=o/Math.min(u,1);k=M+Math.min(0,G,re,G+re),Le=M+Math.max(0,G,re,G+re);}function xt(){(({tStart:M,tEnd:$}=St())),or(),se&&_e&&(bt(),ct=wr(M,$,f));}function ut(o,c=St){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let g=o.destroy;return o.destroy=()=>{g.call(o),pe(e);},o}function Tt(o,c){return I&&!h?Math.max(at,q(Qe[o]=Math.max(Qe[o]??0,c))):q(c)}function sr(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let g=c==="reverse"?1-o:o;e.style.clipPath=ve(g);return}a.forEach((g,T)=>mt(g,T,o,c));}function mt(o,c,g,T){o.style.strokeDashoffset=T==="reverse"?`${p[c]*g}`:`${p[c]*(1-g)}`,m&&(o.style.opacity=T==="reverse"?`${1-g}`:`${g}`),he&&be?o.style.stroke=et(he,be,g):be&&(o.style.stroke=be),ce!==null&&Pe!==null?o.style.strokeWidth=`${ce+(Pe-ce)*g}`:Pe!==null&&(o.style.strokeWidth=`${Pe}`),we!==null&&ue!==null?o.style.fillOpacity=`${we+(ue-we)*g}`:ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&_[c]&&o.setAttribute("d",Er(_[c],B,g));}function ft(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=ve(y==="reverse"?1:0);return}a.forEach((o,c)=>{o.style.strokeDasharray=`${p[c]}`,o.style.strokeDashoffset=y==="reverse"?"0":`${p[c]}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`),B&&o.tagName.toLowerCase()==="path"&&_[c]&&o.setAttribute("d",_[c]);});}function ze(o,c){let g=o.getAttribute("d"),T=Je(o);if(B&&_[c]){o.setAttribute("d",B);let G=Je(o);o.setAttribute("d",_[c]),T=Math.max(Je(o),G),o.setAttribute("d",g);}p[c]=T,o.style.strokeDasharray=`${T}`;}if(a.forEach((o,c)=>{br(o);let g=o.tagName.toLowerCase()==="path";g?_.push(o.getAttribute("d")??""):_.push(""),ze(o,c);let T=p[c];B&&(g?vr(_[_.length-1],B,o):W(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=y==="reverse"?`${T}`:"0",m&&(o.style.opacity="1"),be&&(o.style.stroke=be),Pe!==null&&(o.style.strokeWidth=`${Pe}`),ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=y==="reverse"?"0":`${T}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`));}),t)return Z&&(e.style.clipPath=ve(1)),te?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};Z&&(e.style.clipPath=ve(y==="reverse"?1:0));let Mt=typeof d=="string"?tt(d):null;function ir(){return !(H===false||Ae||se&&_e||!hr()||!a.length||!Mt||Z||f!=="y"||F||u!==1||E!==0||I||h||N!==false||B||z||le||x>0||Ce||X||te||ge||Re||ye||me||b!=null||L!=null||U!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function ar(){let o=++yr,c=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,G=y==="reverse"?"0":"var(--ssd-len)",re=y==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${G};`,C=`stroke-dashoffset:${re};`;m&&(j+=`opacity:${y==="reverse"?1:0};`,C+=`opacity:${y==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${j}}to{${C}}}.${g}{view-timeline-name:${T};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Mt};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(g);function K(S,A){S.style.setProperty("--ssd-len",String(p[A])),S.style.strokeDasharray=`${p[A]}`,S.style.strokeDashoffset="",S.style.opacity="",S.style.animationPlayState="",S.classList.add(c);}a.forEach(K);let Y=false,ne=-1;function ae(){if(ne>=0)return ne;let S=e.getBoundingClientRect(),{tStart:A,tEnd:Q}=$e({top:S.top,height:S.height},Ze(),Et(),Ne,We);return q(R(Ze(),A,Q,u))}return {destroy(){e.classList.remove(g),a.forEach(S=>{S.classList.remove(c),S.style.removeProperty("--ssd-len"),S.style.animationPlayState="";}),D.remove();},replay(){Y=false,ne=-1,a.forEach(K);},pause(){Y=true,a.forEach(S=>{S.style.animationPlayState="paused";});},resume(){Y&&(Y=false,a.forEach(S=>{S.style.animationPlayState="running";}));},seek(S){let A=Math.min(1,Math.max(0,S));ne=A,Y=true,a.forEach((Q,xe)=>{Q.classList.remove(c),Q.style.strokeDashoffset=y==="reverse"?`${p[xe]*A}`:`${p[xe]*(1-A)}`,m&&(Q.style.opacity=y==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return ae()},refresh(){a.forEach((S,A)=>{ze(S,A),S.style.setProperty("--ssd-len",String(p[A]));});}}}if(ir())return ut(ar());function lr(){let o=Math.max(1,P),c=Z?o:o*(1+Math.max(0,a.length-1)*E),g=0,T=0,G=false;function re(ne){let ae=true,S=Math.min(1,Math.max(0,ne/c));if(Z){let A=Math.min(1,Math.max(0,ne/o)),Q=q(A);fe=Q,e.style.setProperty("--scroll-draw-progress",String(Q)),e.style.clipPath=ve(y==="reverse"?1-Q:Q),Ce?.(Q),A<1&&(ae=false);}else {a.forEach((Q,xe)=>{let ur=xe*E*o,kt=Math.min(1,Math.max(0,(ne-ur)/o));mt(Q,xe,q(kt),y),kt<1&&(ae=false);});let A=q(S);fe=A,Ce?.(A),e.style.setProperty("--scroll-draw-progress",String(A));}if(z){let A=q(S);for(let Q in z){let xe=parseFloat(Q);A>=xe&&!Ie.has(xe)&&(Ie.add(xe),z[Q]?.());}}return ae}function j(ne){if(ie)return;let ae=ne-g;Ee||(Ee=true,X?.());let S=re(ae);if(S&&!V){V=true,re(c),te?.(),De<(le==="infinite"?1/0:le??0)&&(De++,Oe=setTimeout(()=>{g=performance.now(),Ee=false,V=false,Ie.clear(),ft(),Se=requestAnimationFrame(j);},de));return}S||(Se=requestAnimationFrame(j));}function C(){cancelAnimationFrame(Se),clearTimeout(Oe),g=performance.now(),T=0,ie=false,Ee=false,V=false,De=0,G=true,fe=0,Ie.clear(),ft(),Se=requestAnimationFrame(j);}let D=new IntersectionObserver(ne=>{ne.forEach(ae=>{ae.isIntersecting&&!(I&&V)?C():!ae.isIntersecting&&!I&&!V&&(cancelAnimationFrame(Se),clearTimeout(Oe),G=false);});},{root:F??null,threshold:J,rootMargin:Ge}),K;function Y(){clearTimeout(K),K=setTimeout(()=>a.forEach(ze),150);}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),x>0?setTimeout(()=>D.observe(e),x):D.observe(e),{destroy(){cancelAnimationFrame(Se),clearTimeout(Oe),D.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(K);},replay(){De=0,C();},pause(){ie||!G||(ie=true,T=performance.now()-g,cancelAnimationFrame(Se));},resume(){ie&&(ie=false,G=true,g=performance.now()-T,Se=requestAnimationFrame(j));},seek(ne){let ae=Math.min(1,Math.max(0,ne));fe=ae,ie=true,T=ae*c,g=performance.now()-T,cancelAnimationFrame(Se),re(T);},getProgress(){return fe},refresh(){clearTimeout(K),a.forEach(ze);}}}if(Ae)return ut(lr());xt();let At=()=>R(Ze(),k,Le,1);function Pt(){V=true,te?.(),De<(le==="infinite"?1/0:le)&&(De++,Oe=setTimeout(()=>{lt=true;},de));}function Lt(){at=-1,Qe=[],Ee=false,V=false,lt=false,Ie.clear(),ft(),He=true;}function cr(){let o=performance.now(),c=Ze();if(lt&&At()%1&&Lt(),!He&&N===false&&c===wt)return;He=false,wt=c;let g=u;if(N!==false){let C=o-vt,D=C>0?Math.abs(c-(Xe<0?c:Xe))/C:0;g=u*Math.max(.2,1+D*(typeof N=="number"?N:1)*.04);}Xe=c,vt=o;let T=h?Ue===-1||c>=Ue?"forward":"reverse":y;Ue=c;let G=$-M,re=true,j=G===0?0:(c-M)/G;if(isNaN(Fe)||(Fe<=0&&j>0&&ge?.(),Fe<1&&j>=1&&Re?.(),Fe>=1&&j<1&&ye?.(),Fe>0&&j<=0&&me?.()),Fe=j,Z){let C=Tt(0,R(c,M,$,g));fe=C,e.style.setProperty("--scroll-draw-progress",String(C));let D=T==="reverse"?1-C:C;e.style.clipPath=ve(D),Ce?.(C),!Ee&&R(c,M,$,g)>0&&(Ee=true,X?.()),C>=1&&!V?Pt():C<1&&!I&&(V=false);return}if(a.forEach((C,D)=>{let K=D*O*G,Y=Tt(D,R(c,M+K,$+K,g));mt(C,D,Y,T),D===0&&(fe=Y,Ce?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y))),Y<1&&(re=false);}),z){let C=q(R(c,M,$,g));for(let D in z){let K=parseFloat(D);C>=K&&!Ie.has(K)&&(Ie.add(K),z[D]?.());}}!Ee&&R(c,M,$,g)>0&&(Ee=true,X?.()),re&&!V?Pt():!re&&!I&&(V=false);}let Be=ke(F??window,[e],At,cr,()=>{let o=p.join();a.forEach(ze),xt(),He=true,p.join()!==o&&qe();}),pt=x>0;function qe(){Be.hold(ie||pt);}let $t;return pt&&($t=setTimeout(()=>{pt=false,qe();},x)),qe(),ut({destroy(){clearTimeout(Oe),clearTimeout($t),Be.off(),bt();},replay(){Lt(),Ue=-1,Xe=-1,De=0,ie=false,fe=0,clearTimeout(Oe),qe();},pause(){ie=true,Be.hold(true);},resume(){ie&&(ie=false,He=true,qe());},seek(o){let c=Math.min(1,Math.max(0,o));fe=c,at=c,Qe=[],ie=true,Be.hold(true),sr(c,y),He=true;},getProgress(){return fe},refresh:Be.remeasure},()=>({tStart:M,tEnd:$}))}function xr(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Qt(n,r):(W("Container not found:",e),t)}function Tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ut(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],l=n[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function Mr(e,r,t){let n=Ut(e),s=Ut(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,l)=>{let u=s[l];return i.fn!==u.fn||i.nums.length!==u.nums.length?t<1?`${i.fn}(${i.nums.map((m,d)=>`${m}${i.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,d)=>`${m+(u.nums[d]-m)*t}${i.units[d]}`).join(", ")})`}).join(" ")}function Xt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Tr(n))return et(n,s,t);if(n.includes("("))return Mr(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),l=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&l){let u=parseFloat(i[1]),m=parseFloat(l[1]);return `${u+(m-u)*t}${i[2]||l[2]}`}return t<1?n:s}function Ar(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Pr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Lr=0,Zt="--scroll-draw-progress";function $r(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,r){return typeof window>"u"?Jt:r.respectReducedMotion===false?Kt(e,r,false):Ve(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:l=1,once:u=false,axis:m="y",scrollContainer:d,native:v=true,velocityScale:E=false,triggerElement:y,onProgress:I,onComplete:se,onEnter:f,onLeave:w,onEnterBack:h,onLeaveBack:x}=r,b=typeof i=="function"?i:oe[i]??oe["ease-out"],L=Te(s.start||"top bottom"),U=Te(s.end||"bottom top"),z=y??e,N=typeof d=="string"?document.querySelector(d):d??null,J=Object.entries(n).map(([a,p])=>({prop:Ar(a),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function Ge(){let a=window.getComputedStyle(e);for(let p of J)p.from===""&&(p.from=a.getPropertyValue(p.prop).trim()||"0");}function le(){for(let a of J)e.style.setProperty(a.prop,String(a.to));}let de=new Map;for(let a of [...J.map(p=>p.prop),Zt])de.set(a,e.style.getPropertyValue(a));function B(){for(let[a,p]of de)p?e.style.setProperty(a,p):e.style.removeProperty(a);}if(t)return le(),se?.(),{...Jt,destroy:B,getProgress:()=>1};Ge();let ee=()=>N?m==="x"?N.scrollLeft:N.scrollTop:m==="x"?window.scrollX:window.scrollY,Ae=()=>N?m==="x"?N.clientWidth:N.clientHeight:m==="x"?window.innerWidth:window.innerHeight,P=typeof i=="string"?tt(i):null;function H(){if(!v||!$r()||!P||m!=="y"||N||z!==e||u||l!==1||I||se||f||w||h||x||E!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let a of J)if(!Pr.has(a.prop))return false;return true}function Ce(){let a=`ssd-a-${++Lr}`,p=J.map(k=>`${k.prop}:${k.from}`).join(";"),_=J.map(k=>`${k.prop}:${k.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${a}{from{${p}}to{${_}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${P};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(a);let $=()=>{let k=e.getBoundingClientRect();return $e({top:k.top,height:k.height},ee(),Ae(),L,U)};Me(e,{type:"animate",getProgress:()=>O.getProgress(),getTrigger:$});let O={refresh(){},destroy(){e.classList.remove(a),M.remove(),e.style.animationPlayState="",B(),pe(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(k){let Le=Math.min(1,Math.max(0,k));e.classList.remove(a);for(let V of J)e.style.setProperty(V.prop,Xt(V.from,V.to,Le));},getProgress(){let{tStart:k,tEnd:Le}=$();return b(R(ee(),k,Le,l))}};return O}if(H())return Ce();let X=0,te=0,ge=false,Re=-1,ye=0,me=0,Z=false,q=NaN,Ne=-1,We=0,F=z===e?J:[],he=false;function be(){let a=e.style,p=F.map(O=>a.getPropertyValue(O.prop)),_=a.transition;F.length&&(a.transition="none"),F.forEach(O=>a.setProperty(O.prop,de.get(O.prop)??""));let M=Ke(z,N,m);F.forEach((O,k)=>a.setProperty(O.prop,p[k])),F.length&&(e.offsetWidth,a.transition=_);let $=$e(M,M.scroll,Ae(),L,U);he&&Math.abs($.tStart-X)<1&&Math.abs($.tEnd-te)<1||(he=true,X=$.tStart,te=$.tEnd);}function ce(a){e.style.setProperty(Zt,String(a));for(let p of J)e.style.setProperty(p.prop,Xt(p.from,p.to,a));I?.(a);}function Pe(a){if(isNaN(q)){q=a;return}q<=0&&a>0&&f?.(),q<1&&a>=1&&w?.(),q>=1&&a<1&&h?.(),q>0&&a<=0&&x?.(),q=a;}function we(){if(ge)return;let a=performance.now(),p=ee(),_=l;if(E!==false){let k=a-We,Le=k>0?Math.abs(p-(Ne<0?p:Ne))/k:0;_=l*Math.max(.2,1+Le*(typeof E=="number"?E:1)*.04);}Ne=p,We=a;let M=te===X?0:(p-X)/(te-X);Pe(M);let $=R(p,X,te,_),O=u?Math.max(Re,b(ye=Math.max(ye,$))):b($);me=O,ce(O),O>=1&&!Z?(Z=true,se?.()):O<1&&!u&&(Z=false);}let ue=ke(N??window,[z],()=>R(ee(),X,te,Math.min(l,1)),we,be);be(),te===X&&W("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ye=R(ee(),X,te,l),me=b(ye),ce(me),Me(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:X,tEnd:te})});function ve(){ge=true,ue.hold(true);}return {destroy(){ge=true,ue.off(),B(),pe(e);},replay(){Re=-1,ye=0,Z=false,me=0,ge=false,ce(0),ue.hold(false);},pause:ve,resume(){ge&&(ge=false,ue.hold(false));},seek(a){let p=Math.min(1,Math.max(0,a));me=p,Re=p,ye=0,ve(),ce(p);},getProgress(){return me},refresh:ue.remeasure}}var st={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function kr(e,r){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;return t?gt(t,r):(W("scrollAnimate: element not found:",e),st)}function Cr(e,r={}){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return W("scrollParallax: element not found:",e),st;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:l,onProgress:u}=r,m=-n*100,d=t.style,v=!!t.ownerSVGElement,E=d.getPropertyValue("transform-box");v&&d.setProperty("transform-box","fill-box");let y=gt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:l??{start:"top bottom",end:"bottom top"},easing:i,native:false,onProgress:u});return v?{...y,destroy(){y.destroy(),d.setProperty("transform-box",E);}}:y}var yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Dr(e,r){if(typeof window>"u")return yt;let t=typeof e=="string"?document.querySelector(e):e;return t?Ve(r,(n,s)=>Or(t,n,s)):(W("scrollCounter: element not found:",e),yt)}function Or(e,r,t){let{from:n=0,to:s,format:i,easing:l="ease-out",trigger:u={},once:m=true,decimals:d,onComplete:v}=r,E=d!==void 0?P=>P.toFixed(d):i??(P=>String(Math.round(P))),y=typeof l=="function"?l:oe[l]??oe["ease-out"],I=Te(u.start||"top 80%"),se=Te(u.end||"top 20%");if(t)return e.textContent=E(s),v?.(),{...yt,getProgress:()=>1};let f=0,w=0,h=false,x=-1,b=0,L=0,U=false,z=()=>window.scrollY,N=()=>window.innerHeight;function J(){let P=e.getBoundingClientRect(),H=$e({top:P.top,height:P.height},z(),N(),I,se);h&&Math.abs(H.tStart-f)<1&&Math.abs(H.tEnd-w)<1||(h=true,f=H.tStart,w=H.tEnd);}let Ge=e.style.getPropertyValue("--scroll-draw-progress");function le(P){e.textContent=E(n+(s-n)*P),e.style.setProperty("--scroll-draw-progress",String(P));}let de=()=>R(z(),f,w,1);function B(){let P=de(),H=m?Math.max(x,y(b=Math.max(b,P))):y(P);L=H,le(H),H>=1&&!U?(U=true,v?.()):H<1&&!m&&(U=false);}J();{b=R(z(),f,w,1);let P=y(b);L=P,le(P);}let ee=ke(window,[e],de,B,J);Me(e,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:f,tEnd:w})});let Ae=()=>ee.hold(false);return {destroy(){ee.off(),e.style.setProperty("--scroll-draw-progress",Ge),pe(e);},replay(){x=-1,b=0,U=false,L=0,le(0),Ae();},pause:()=>ee.hold(true),resume:Ae,seek(P){let H=Math.min(1,Math.max(0,P));L=H,x=H,b=0,ee.hold(true),le(H);},getProgress(){return L}}}var er="http://www.w3.org/2000/svg",Ir="cinematic-photo",nr=e=>e<0?0:e>1?1:e;function it(e){let r=parseFloat(e);return Number.isFinite(r)?nr(r/100):0}function tr(e){return oe[e]??oe.linear}var rr=e=>({destroy(){},getProgress:()=>e}),ht=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||W("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return rr(0);t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let f of r.scenes){if(f.background){let h=document.createElement("img");h.id=Ir,h.src=f.background,h.alt="",h.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(h);}let w=f.animations.filter(h=>h.type==="draw");if(w.length){let h=document.createElementNS(er,"svg");h.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),h.setAttribute("preserveAspectRatio","xMidYMid meet"),h.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(h);for(let x of w){let b=document.createElementNS(er,"path");b.id=x.target.replace(/^#/,""),b.setAttribute("d",x.d),b.setAttribute("fill","none"),b.setAttribute("stroke",x.stroke),b.setAttribute("stroke-width",String(x.strokeWidth)),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round");let L=x.length||b.getTotalLength?.()||0;b.style.strokeDasharray=String(L),b.style.strokeDashoffset=String(L),h.appendChild(b),s.push({kind:"draw",el:b,start:it(x.start),end:it(x.end),ease:tr(x.easing),length:L});}}for(let h of f.animations){if(h.type!=="fade")continue;let x=n.querySelector(h.target)??document.querySelector(h.target);x&&(x.style.opacity=String(h.from),s.push({kind:"fade",el:x,start:it(h.start),end:it(h.end),ease:tr("ease-in-out"),from:h.from,to:h.to}));}}let i=0,l=null;for(let f=t.parentElement;f?.parentElement;f=f.parentElement)if(/[ao]/.test(getComputedStyle(f).overflowY)&&f.scrollHeight>f.clientHeight&&(f!==document.body||/[aoh]/.test(getComputedStyle(f.parentElement).overflowY))){l=f;break}let u=0,m=0,d=()=>{let f=t.getBoundingClientRect().top;u=l?f-l.getBoundingClientRect().top-l.clientTop+l.scrollTop:f+window.scrollY,m=u+Math.max(0,t.offsetHeight-(l?l.clientHeight:window.innerHeight));},v=()=>{let f=l?l.scrollTop:window.scrollY;return m<=u?f>=u?1:0:R(f,u,m,1)},E=f=>{for(let w of s){let h=w.end-w.start,x=h<=0?f>=w.end?1:0:nr((f-w.start)/h),b=w.ease(x);w.kind==="draw"?w.el.style.strokeDashoffset=String(w.length*(1-b)):w.el.style.opacity=String(w.from+(w.to-w.from)*b);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return E(1),rr(1);let y=()=>{i=v(),E(i);};d(),y();let I=ke(l||window,[t],v,y,d);Me(t,{type:"draw",getProgress:()=>i,getTrigger:()=>({tStart:u,tEnd:m})});let se=rt(f=>{f&&(se(),I.off(),pe(t),i=1,E(1));});return {destroy(){se(),I.off(),pe(t);},getProgress:()=>i}}};
4
- exports.Cinematic=ht;exports.PRESETS=dt;exports.createBounce=Dt;exports.createElastic=Ot;exports.createSpring=Ct;exports.scrollAnimate=kr;exports.scrollCounter=Dr;exports.scrollDraw=xr;exports.scrollParallax=Cr;
1
+ 'use strict';var Fe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function I(e,...r){Fe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function It({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Ht({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,a=[];for(let p=0;p<t;p++){let b=Math.pow(s,p);a.push(b),i+=b;}let u=[0],m=0;for(let p=0;p<t;p++)m+=a[p]/i,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let b=0;b<t;b++)if(p<=u[b+1]){let S=(p-u[b])/(u[b+1]-u[b]);if(b===0)return S*(2-S);let h=1-Math.pow(n,b);return h+(1-h)*(2*S-1)*(2*S-1)}return 1}}function Nt({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var _e={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:It(),bounce:Ht(),elastic:Nt()};function gr(e,r,t,n){let s=(i,a,u)=>((1+3*i-3*a)*u+3*a-6*i)*u*u+3*i*u;return i=>{if(i<=0||i>=1)return +(i>0);let a=i;for(let u=0;u<8;u++)a-=(s(e,t,a)-i)/((3*(1+3*e-3*t)*a+6*t-12*e)*a+3*e);if(!(a>=0&&a<=1&&Math.abs(s(e,t,a)-i)<1e-9))for(let u=0,m=0,p=1;u<30;u++)a=(m+p)/2,s(e,t,a)<i?m=a:p=a;return s(r,n,a)}}function yt(e){let r=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=r?r[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [gr(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var Rt=new Set;function Ae(e,r="linear"){if(typeof e=="function")return e;if(e==null)return _e[r];if({}.hasOwnProperty.call(_e,e))return _e[e];let t=yt(String(e));return t?t[0]:(!Rt.has(e)&&Rt.add(e)&&I(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),_e[r])}function Ft(e,r,t){return Math.min(t,Math.max(r,e))}function Se(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}var zt=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function _t(e,r,t,n){return e+t+r*zt(n,0)}function Vt(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:zt(e,1))}function N(e,r,t,n){return t===r?0:Ft((e-r)/(t-r)*n,0,1)}function Pe(e,r,t,n,s){let i=_t(e.top,e.height,r,n.element)-Vt(n.viewport,t),a=_t(e.top,e.height,r,s.element)-Vt(s.viewport,t);return {tStart:i,tEnd:a}}function Ke(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function et(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Ve(e){return `${e} ${e*2}`}function Gt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function tt(e,r,t){let n=Gt(e),s=Gt(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var ht={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 yr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",hr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Wt=33;function br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function wr(e){let r=[];for(let t=0;t<Wt;t++){let n=t/(Wt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return yr;case "ease-out":return hr;case "ease-in-out":return br()?wr(_e["ease-in-out"]):null;default:return yt(e)?.[1]??null}}var Bt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[Bt]||(e[Bt]=new Map)}function xe(e,r){qt().set(e,r);}function me(e){qt().delete(e);}function nt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function ze(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=nt(i=>{if(!i)return;n();let a=(t.getProgress?.()??0)>=1;t.destroy(),t=r(a?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...a)=>t[i]?.(...a);return s.destroy=()=>{n(),t.destroy();},s}var je,ot=new Set,st=new WeakMap,Ye=new Map,jt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function vr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Yt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();je??(je=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)st.get(a)!==jt(a)&&(i=true),st.set(a,"");i&&ot.forEach(a=>a());})),ot.add(t);let n=vr(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{st.has(s)||st.set(s,jt(s)),Ye.set(s,(Ye.get(s)??0)+1),je.observe(s);}),()=>{ot.delete(t)&&(n.forEach(s=>{let i=(Ye.get(s)??1)-1;if(i)return void Ye.set(s,i);Ye.delete(s),je?.unobserve(s);}),ot.size||(je?.disconnect(),je=void 0));}}function Le(e,r,t,n,s){let i,a=NaN,u,m,p=()=>{i=0,n(),!u&&!i&&(a=t())>0&&a<1&&(i=requestAnimationFrame(p));},b=()=>{!i&&!u&&t()!==a&&(i=requestAnimationFrame(p));},S=v=>{u=v,cancelAnimationFrame(i),i=a=NaN,b();},h=()=>{clearTimeout(m),s(),b();},L=()=>{clearTimeout(m),m=setTimeout(h,150);},F=Yt(r,L),d=v=>{e[v]("scroll",b,{passive:true}),window[v]("resize",L),window[v]("orientationchange",L);};return d("addEventListener"),b(),{hold:S,remeasure:h,off(){S(true),d("removeEventListener"),F(),clearTimeout(m);}}}var Er=0;function Sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Qt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Ut=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function xr(e){if(!Fe)return;let r=Qt(e,"stroke");if(!r||r==="none"){I("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Ut.has(t)&&!Ut.has(Qt(e,"fill"))&&I("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Tr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,a=e-i,u=r-i,m=t==="x";n.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Mr(e,r,t){if(!Fe)return;let n=(e.match(Zt)??[]).join("").toUpperCase(),s=(r.match(Zt)??[]).join("").toUpperCase(),i=(e.match(Xt)??[]).length,a=(r.match(Xt)??[]).length;if(n!==s){I(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&I(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Ar(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),u=n[s++]??a;return String(+(a+(u-a)*t).toFixed(4))})}function Jt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:ze(r,(t,n)=>Pr(e,t,n))}function Pr(e,r,t){let{preset:n,...s}=r,i=n?{...ht[n],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:b={},stagger:S=0,direction:h="forward",once:L=false,debug:F=false,axis:d="y",scrollContainer:v,autoReverse:y=false,delay:E=0,strokeColor:w,strokeWidth:H,fillOpacity:se,waypoints:X,velocityScale:_=false,threshold:q=0,rootMargin:De="0px",repeat:fe=0,repeatDelay:le=0,morphTo:V,clip:A,autoplay:D=false,duration:Qe=1e3,native:lt=true,onProgress:$e,onStart:Z,onComplete:ee,onEnter:pe,onLeave:Re,onEnterBack:de,onLeaveBack:ce}=i,J=A===true?"left":typeof A=="string"?A:false,j=Ae(p),Ie=Se(b.start||"top bottom"),Ge=Se(b.end||"bottom top"),z=typeof v=="string"?document.querySelector(v):v??null,ge=Array.isArray(w)?w[0]:null,ye=Array.isArray(w)?w[1]:typeof w=="string"?w:null,ie=Array.isArray(H)?H[0]:null,Te=Array.isArray(H)?H[1]:typeof H=="number"?H:null,he=Array.isArray(se)?se[0]:null,ae=Array.isArray(se)?se[1]:typeof se=="number"?se:null;function be(o){let c=o*100;switch(J){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=J?[]:Array.from(e.querySelectorAll(a)),f=[],G=[],M=0,$=0,R=S,C=0,Me=0,W=false,we=false,ve=0,ct=-1,Ue=[],Xe=-1,ne=false,ue=0,Ce=0,ke,ut=false,mt=null;function Et(){mt?.destroy(),mt=null;}let Oe=new Set,St=NaN,He=true,Ze=-1,xt=performance.now(),Ne=NaN;function Je(){return z?d==="x"?z.scrollLeft:z.scrollTop:d==="x"?window.scrollX:window.scrollY}function Tt(){return z?d==="x"?z.clientWidth:z.clientHeight:d==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=Ke(e,z,d);return Pe(o,o.scroll,Tt(),Ie,Ge)}function lr(){let o=$-M,c=l.length-1,g=z??document.documentElement,T=d==="x"?"Width":"Height";if(R=S,S>0&&c>0&&o>0){let Y=g[`scroll${T}`]-g[`client${T}`]-1-M-o/u;Y>=0&&(R=Math.min(S,Y/(c*o)));}let B=Math.max(0,c)*R*o,te=o/Math.min(u,1);C=M+Math.min(0,B,te,B+te),Me=M+Math.max(0,B,te,B+te);}function At(){(({tStart:M,tEnd:$}=Mt())),lr(),F&&Fe&&(Et(),mt=Tr(M,$,d));}function ft(o,c=Mt){xe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let g=o.destroy;return o.destroy=()=>{g.call(o),me(e);},o}function Pt(o,c){return L&&!y?Math.max(ct,j(Ue[o]=Math.max(Ue[o]??0,c))):j(c)}function cr(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),J){let g=c==="reverse"?1-o:o;e.style.clipPath=be(g);return}l.forEach((g,T)=>pt(g,T,o,c));}function pt(o,c,g,T){o.style.strokeDashoffset=T==="reverse"?`${f[c]*g}`:`${f[c]*(1-g)}`,m&&(o.style.opacity=T==="reverse"?`${1-g}`:`${g}`),ge&&ye?o.style.stroke=tt(ge,ye,g):ye&&(o.style.stroke=ye),ie!==null&&Te!==null?o.style.strokeWidth=`${ie+(Te-ie)*g}`:Te!==null&&(o.style.strokeWidth=`${Te}`),he!==null&&ae!==null?o.style.fillOpacity=`${he+(ae-he)*g}`:ae!==null&&(o.style.fillOpacity=`${ae}`),V&&o.tagName.toLowerCase()==="path"&&G[c]&&o.setAttribute("d",Ar(G[c],V,g));}function dt(){if(e.style.setProperty("--scroll-draw-progress","0"),J){e.style.clipPath=be(h==="reverse"?1:0);return}l.forEach((o,c)=>{o.style.strokeDasharray=Ve(f[c]),o.style.strokeDashoffset=h==="reverse"?"0":`${f[c]}`,m?o.style.opacity=h==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),ie!==null&&(o.style.strokeWidth=`${ie}`),he!==null&&(o.style.fillOpacity=`${he}`),V&&o.tagName.toLowerCase()==="path"&&G[c]&&o.setAttribute("d",G[c]);});}function We(o,c){let g=o.getAttribute("d"),T=et(o);if(V&&G[c]){o.setAttribute("d",V);let B=et(o);o.setAttribute("d",G[c]),T=Math.max(et(o),B),o.setAttribute("d",g);}f[c]=T,o.style.strokeDasharray=Ve(T);}if(l.forEach((o,c)=>{xr(o);let g=o.tagName.toLowerCase()==="path";g?G.push(o.getAttribute("d")??""):G.push(""),We(o,c);let T=f[c];V&&(g?Mr(G[G.length-1],V,o):I(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=h==="reverse"?`${T}`:"0",m&&(o.style.opacity="1"),ye&&(o.style.stroke=ye),Te!==null&&(o.style.strokeWidth=`${Te}`),ae!==null&&(o.style.fillOpacity=`${ae}`),V&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",V)):(o.style.strokeDashoffset=h==="reverse"?"0":`${T}`,m?o.style.opacity=h==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),ie!==null&&(o.style.strokeWidth=`${ie}`),he!==null&&(o.style.fillOpacity=`${he}`));}),t)return J&&(e.style.clipPath=be(1)),ee?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};J&&(e.style.clipPath=be(h==="reverse"?1:0));let Lt=typeof p=="string"?rt(p):null;function ur(){return !(lt===false||D||F&&Fe||!Sr()||!l.length||!Lt||J||d!=="y"||z||u!==1||S!==0||L||y||_!==false||V||X||fe||E>0||$e||Z||ee||pe||Re||de||ce||w!=null||H!=null||se!=null||(b.start||"top bottom").trim()!=="top bottom"||(b.end||"bottom top").trim()!=="bottom top")}function mr(){let o=++Er,c=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,B=h==="reverse"?"0":"var(--ssd-len)",te=h==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${B};`,k=`stroke-dashoffset:${te};`;m&&(Y+=`opacity:${h==="reverse"?1:0};`,k+=`opacity:${h==="reverse"?0:1};`);let O=document.createElement("style");O.setAttribute("data-svg-scroll-draw",""),O.textContent=`@keyframes ${c}{from{${Y}}to{${k}}}.${g}{view-timeline-name:${T};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(g);function K(x,P){x.style.setProperty("--ssd-len",String(f[P])),x.style.strokeDasharray=Ve(f[P]),x.style.strokeDashoffset="",x.style.opacity="",x.style.animationPlayState="",x.classList.add(c);}l.forEach(K);let Q=false,re=-1;function oe(){if(re>=0)return re;let x=e.getBoundingClientRect(),{tStart:P,tEnd:U}=Pe({top:x.top,height:x.height},Je(),Tt(),Ie,Ge);return j(N(Je(),P,U,u))}return {destroy(){e.classList.remove(g),l.forEach(x=>{x.classList.remove(c),x.style.removeProperty("--ssd-len"),x.style.animationPlayState="";}),O.remove();},replay(){Q=false,re=-1,l.forEach(K);},pause(){Q=true,l.forEach(x=>{x.style.animationPlayState="paused";});},resume(){Q&&(Q=false,l.forEach(x=>{x.style.animationPlayState="running";}));},seek(x){let P=Math.min(1,Math.max(0,x));re=P,Q=true,l.forEach((U,Ee)=>{U.classList.remove(c),U.style.strokeDashoffset=h==="reverse"?`${f[Ee]*P}`:`${f[Ee]*(1-P)}`,m&&(U.style.opacity=h==="reverse"?`${1-P}`:`${P}`);});},getProgress(){return oe()},refresh(){l.forEach((x,P)=>{We(x,P),x.style.setProperty("--ssd-len",String(f[P]));});}}}if(ur())return ft(mr());function fr(){let o=Math.max(1,Qe),c=J?o:o*(1+Math.max(0,l.length-1)*S),g=0,T=0,B=false;function te(re){let oe=true,x=Math.min(1,Math.max(0,re/c));if(J){let P=Math.min(1,Math.max(0,re/o)),U=j(P);ue=U,e.style.setProperty("--scroll-draw-progress",String(U)),e.style.clipPath=be(h==="reverse"?1-U:U),$e?.(U),P<1&&(oe=false);}else {l.forEach((U,Ee)=>{let dr=Ee*S*o,Dt=Math.min(1,Math.max(0,(re-dr)/o));pt(U,Ee,j(Dt),h),Dt<1&&(oe=false);});let P=j(x);ue=P,$e?.(P),e.style.setProperty("--scroll-draw-progress",String(P));}if(X){let P=j(x);for(let U in X){let Ee=parseFloat(U);P>=Ee&&!Oe.has(Ee)&&(Oe.add(Ee),X[U]?.());}}return oe}function Y(re){if(ne)return;let oe=re-g;we||(we=true,Z?.());let x=te(oe);if(x&&!W){W=true,te(c),ee?.(),Ce<(fe==="infinite"?1/0:fe??0)&&(Ce++,ke=setTimeout(()=>{g=performance.now(),we=false,W=false,Oe.clear(),dt(),ve=requestAnimationFrame(Y);},le));return}x||(ve=requestAnimationFrame(Y));}function k(){cancelAnimationFrame(ve),clearTimeout(ke),g=performance.now(),T=0,ne=false,we=false,W=false,Ce=0,B=true,ue=0,Oe.clear(),dt(),ve=requestAnimationFrame(Y);}let O=new IntersectionObserver(re=>{re.forEach(oe=>{oe.isIntersecting&&!(L&&W)?k():!oe.isIntersecting&&!L&&!W&&(cancelAnimationFrame(ve),clearTimeout(ke),B=false);});},{root:z??null,threshold:q,rootMargin:De}),K;function Q(){clearTimeout(K),K=setTimeout(()=>l.forEach(We),150);}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),E>0?setTimeout(()=>O.observe(e),E):O.observe(e),{destroy(){cancelAnimationFrame(ve),clearTimeout(ke),O.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(K);},replay(){Ce=0,k();},pause(){ne||!B||(ne=true,T=performance.now()-g,cancelAnimationFrame(ve));},resume(){ne&&(ne=false,B=true,g=performance.now()-T,ve=requestAnimationFrame(Y));},seek(re){let oe=Math.min(1,Math.max(0,re));ue=oe,ne=true,T=oe*c,g=performance.now()-T,cancelAnimationFrame(ve),te(T);},getProgress(){return ue},refresh(){clearTimeout(K),l.forEach(We);}}}if(D)return ft(fr());At();let $t=()=>N(Je(),C,Me,1);function Ct(){W=true,ee?.(),Ce<(fe==="infinite"?1/0:fe)&&(Ce++,ke=setTimeout(()=>{ut=true;},le));}function kt(){ct=-1,Ue=[],we=false,W=false,ut=false,Oe.clear(),dt(),He=true;}function pr(){let o=performance.now(),c=Je();if(ut&&$t()%1&&kt(),!He&&_===false&&c===St)return;He=false,St=c;let g=u;if(_!==false){let k=o-xt,O=k>0?Math.abs(c-(Ze<0?c:Ze))/k:0;g=u*Math.max(.2,1+O*(typeof _=="number"?_:1)*.04);}Ze=c,xt=o;let T=y?Xe===-1||c>=Xe?"forward":"reverse":h;Xe=c;let B=$-M,te=true,Y=B===0?0:(c-M)/B;if(isNaN(Ne)||(Ne<=0&&Y>0&&pe?.(),Ne<1&&Y>=1&&Re?.(),Ne>=1&&Y<1&&de?.(),Ne>0&&Y<=0&&ce?.()),Ne=Y,J){let k=Pt(0,N(c,M,$,g));ue=k,e.style.setProperty("--scroll-draw-progress",String(k));let O=T==="reverse"?1-k:k;e.style.clipPath=be(O),$e?.(k),!we&&N(c,M,$,g)>0&&(we=true,Z?.()),k>=1&&!W?Ct():k<1&&!L&&(W=false);return}if(l.forEach((k,O)=>{let K=O*R*B,Q=Pt(O,N(c,M+K,$+K,g));pt(k,O,Q,T),O===0&&(ue=Q,$e?.(Q),e.style.setProperty("--scroll-draw-progress",String(Q))),Q<1&&(te=false);}),X){let k=j(N(c,M,$,g));for(let O in X){let K=parseFloat(O);k>=K&&!Oe.has(K)&&(Oe.add(K),X[O]?.());}}!we&&N(c,M,$,g)>0&&(we=true,Z?.()),te&&!W?Ct():!te&&!L&&(W=false);}let Be=Le(z??window,[e],$t,pr,()=>{let o=f.join();l.forEach(We),At(),He=true,f.join()!==o&&qe();}),gt=E>0;function qe(){Be.hold(ne||gt);}let Ot;return gt&&(Ot=setTimeout(()=>{gt=false,qe();},E)),qe(),ft({destroy(){clearTimeout(ke),clearTimeout(Ot),Be.off(),Et();},replay(){kt(),Xe=-1,Ze=-1,Ce=0,ne=false,ue=0,clearTimeout(ke),qe();},pause(){ne=true,Be.hold(true);},resume(){ne&&(ne=false,He=true,qe());},seek(o){let c=Math.min(1,Math.max(0,o));ue=c,ct=c,Ue=[],ne=true,Be.hold(true),cr(c,h),He=true;},getProgress(){return ue},refresh:Be.remeasure},()=>({tStart:M,tEnd:$}))}function Lr(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Jt(n,r):(I("Container not found:",e),t)}function $r(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Kt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],a=n[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function Cr(e,r,t){let n=Kt(e),s=Kt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,a)=>{let u=s[a];return i.fn!==u.fn||i.nums.length!==u.nums.length?t<1?`${i.fn}(${i.nums.map((m,p)=>`${m}${i.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,p)=>`${m+(u.nums[p]-m)*t}${i.units[p]}`).join(", ")})`}).join(" ")}function er(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if($r(n))return tt(n,s,t);if(n.includes("("))return Cr(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let u=parseFloat(i[1]),m=parseFloat(a[1]);return `${u+(m-u)*t}${i[2]||a[2]}`}return t<1?n:s}function kr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Or=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Dr=0,tr="--scroll-draw-progress";function Rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var nr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,r){return typeof window>"u"?nr:r.respectReducedMotion===false?rr(e,r,false):ze(r,(t,n)=>rr(e,t,n))}function rr(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:p,native:b=true,velocityScale:S=false,triggerElement:h,onProgress:L,onComplete:F,onEnter:d,onLeave:v,onEnterBack:y,onLeaveBack:E}=r,w=Ae(i,"ease-out"),H=Se(s.start||"top bottom"),se=Se(s.end||"bottom top"),X=h??e,_=typeof p=="string"?document.querySelector(p):p??null,q=Object.entries(n).map(([l,f])=>({prop:kr(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function De(){let l=window.getComputedStyle(e);for(let f of q)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function fe(){for(let l of q)e.style.setProperty(l.prop,String(l.to));}let le=new Map;for(let l of [...q.map(f=>f.prop),tr])le.set(l,e.style.getPropertyValue(l));function V(){for(let[l,f]of le)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(t)return fe(),F?.(),{...nr,destroy:V,getProgress:()=>1};De();let A=()=>_?m==="x"?_.scrollLeft:_.scrollTop:m==="x"?window.scrollX:window.scrollY,D=()=>_?m==="x"?_.clientWidth:_.clientHeight:m==="x"?window.innerWidth:window.innerHeight,Qe=typeof i=="string"?rt(i):null;function lt(){if(!b||!Rr()||!Qe||m!=="y"||_||X!==e||u||a!==1||L||F||d||v||y||E||S!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let l of q)if(!Or.has(l.prop))return false;return true}function $e(){let l=`ssd-a-${++Dr}`,f=q.map(C=>`${C.prop}:${C.from}`).join(";"),G=q.map(C=>`${C.prop}:${C.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${l}{from{${f}}to{${G}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Qe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(l);let $=()=>{let C=e.getBoundingClientRect();return Pe({top:C.top,height:C.height},A(),D(),H,se)};xe(e,{type:"animate",getProgress:()=>R.getProgress(),getTrigger:$});let R={refresh(){},destroy(){e.classList.remove(l),M.remove(),e.style.animationPlayState="",V(),me(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(C){let Me=Math.min(1,Math.max(0,C));e.classList.remove(l);for(let W of q)e.style.setProperty(W.prop,er(W.from,W.to,Me));},getProgress(){let{tStart:C,tEnd:Me}=$();return w(N(A(),C,Me,a))}};return R}if(lt())return $e();let Z=0,ee=0,pe=false,Re=-1,de=0,ce=0,J=false,j=NaN,Ie=-1,Ge=0,z=X===e?q:[],ge=false;function ye(){let l=e.style,f=z.map(R=>l.getPropertyValue(R.prop)),G=l.transition;z.length&&(l.transition="none"),z.forEach(R=>l.setProperty(R.prop,le.get(R.prop)??""));let M=Ke(X,_,m);z.forEach((R,C)=>l.setProperty(R.prop,f[C])),z.length&&(e.offsetWidth,l.transition=G);let $=Pe(M,M.scroll,D(),H,se);ge&&Math.abs($.tStart-Z)<1&&Math.abs($.tEnd-ee)<1||(ge=true,Z=$.tStart,ee=$.tEnd);}function ie(l){e.style.setProperty(tr,String(l));for(let f of q)e.style.setProperty(f.prop,er(f.from,f.to,l));L?.(l);}function Te(l){if(isNaN(j)){j=l;return}j<=0&&l>0&&d?.(),j<1&&l>=1&&v?.(),j>=1&&l<1&&y?.(),j>0&&l<=0&&E?.(),j=l;}function he(){if(pe)return;let l=performance.now(),f=A(),G=a;if(S!==false){let C=l-Ge,Me=C>0?Math.abs(f-(Ie<0?f:Ie))/C:0;G=a*Math.max(.2,1+Me*(typeof S=="number"?S:1)*.04);}Ie=f,Ge=l;let M=ee===Z?0:(f-Z)/(ee-Z);Te(M);let $=N(f,Z,ee,G),R=u?Math.max(Re,w(de=Math.max(de,$))):w($);ce=R,ie(R),R>=1&&!J?(J=true,F?.()):R<1&&!u&&(J=false);}let ae=Le(_??window,[X],()=>N(A(),Z,ee,Math.min(a,1)),he,ye);ye(),ee===Z&&I("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),de=N(A(),Z,ee,a),ce=w(de),ie(ce),xe(e,{type:"animate",getProgress:()=>ce,getTrigger:()=>({tStart:Z,tEnd:ee})});function be(){pe=true,ae.hold(true);}return {destroy(){pe=true,ae.off(),V(),me(e);},replay(){Re=-1,de=0,J=false,ce=0,pe=false,ie(0),ae.hold(false);},pause:be,resume(){pe&&(pe=false,ae.hold(false));},seek(l){let f=Math.min(1,Math.max(0,l));ce=f,Re=f,de=0,be(),ie(f);},getProgress(){return ce},refresh:ae.remeasure}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ir(e,r){if(typeof window>"u")return it;let t=typeof e=="string"?document.querySelector(e):e;return t?bt(t,r):(I("scrollAnimate: element not found:",e),it)}function Hr(e,r={}){if(typeof window>"u")return it;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return I("scrollParallax: element not found:",e),it;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:a,onProgress:u}=r,m=-n*100,p=t.style,b=!!t.ownerSVGElement,S=p.getPropertyValue("transform-box");b&&p.setProperty("transform-box","fill-box");let h=bt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:a??{start:"top bottom",end:"bottom top"},easing:i,native:false,onProgress:u});return b?{...h,destroy(){h.destroy(),p.setProperty("transform-box",S);}}:h}var Nr=({decimals:e,format:r})=>e!==void 0?t=>t.toFixed(e):r??(t=>String(Math.round(t)));var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Fr(e,r){if(typeof window>"u")return wt;let t=typeof e=="string"?document.querySelector(e):e;return t?ze(r,(n,s)=>_r(t,n,s)):(I("scrollCounter: element not found:",e),wt)}function _r(e,r,t){let{from:n=0,to:s,easing:i="ease-out",trigger:a={},once:u=true,onComplete:m}=r,p=Nr(r),b=Ae(i,"ease-out"),S=Se(a.start||"top 80%"),h=Se(a.end||"top 20%");if(t)return e.textContent=p(s),m?.(),{...wt,getProgress:()=>1};let L=0,F=0,d=false,v=-1,y=0,E=0,w=false,H=()=>window.scrollY,se=()=>window.innerHeight;function X(){let A=e.getBoundingClientRect(),D=Pe({top:A.top,height:A.height},H(),se(),S,h);d&&Math.abs(D.tStart-L)<1&&Math.abs(D.tEnd-F)<1||(d=true,L=D.tStart,F=D.tEnd);}let _=e.style.getPropertyValue("--scroll-draw-progress");function q(A){e.textContent=p(n+(s-n)*A),e.style.setProperty("--scroll-draw-progress",String(A));}let De=()=>N(H(),L,F,1);function fe(){let A=De(),D=u?Math.max(v,b(y=Math.max(y,A))):b(A);E=D,q(D),D>=1&&!w?(w=true,m?.()):D<1&&!u&&(w=false);}X();{y=N(H(),L,F,1);let A=b(y);E=A,q(A);}let le=Le(window,[e],De,fe,X);xe(e,{type:"counter",getProgress:()=>E,getTrigger:()=>({tStart:L,tEnd:F})});let V=()=>le.hold(false);return {destroy(){le.off(),e.style.setProperty("--scroll-draw-progress",_),me(e);},replay(){v=-1,y=0,w=false,E=0,q(0),V();},pause:()=>le.hold(true),resume:V,seek(A){let D=Math.min(1,Math.max(0,A));E=D,v=D,y=0,le.hold(true),q(D);},getProgress(){return E}}}var or="http://www.w3.org/2000/svg",Vr="cinematic-photo",ar=e=>e<0?0:e>1?1:e;function at(e){let r=parseFloat(e);return Number.isFinite(r)?ar(r/100):0}function sr(e){return Ae(e)}var ir=e=>({destroy(){},getProgress:()=>e}),vt=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||I("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return ir(0);t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let d of r.scenes){if(d.background){let y=document.createElement("img");y.id=Vr,y.src=d.background,y.alt="",y.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(y);}let v=d.animations.filter(y=>y.type==="draw");if(v.length){let y=document.createElementNS(or,"svg");y.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),y.setAttribute("preserveAspectRatio","xMidYMid meet"),y.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(y);for(let E of v){let w=document.createElementNS(or,"path");w.id=E.target.replace(/^#/,""),w.setAttribute("d",E.d),w.setAttribute("fill","none"),w.setAttribute("stroke",E.stroke),w.setAttribute("stroke-width",String(E.strokeWidth)),w.setAttribute("stroke-linecap","round"),w.setAttribute("stroke-linejoin","round");let H=E.length||w.getTotalLength?.()||0;w.style.strokeDasharray=Ve(H),w.style.strokeDashoffset=String(H),y.appendChild(w),s.push({kind:"draw",el:w,start:at(E.start),end:at(E.end),ease:sr(E.easing),length:H});}}for(let y of d.animations){if(y.type!=="fade")continue;let E=n.querySelector(y.target)??document.querySelector(y.target);E&&(E.style.opacity=String(y.from),s.push({kind:"fade",el:E,start:at(y.start),end:at(y.end),ease:sr("ease-in-out"),from:y.from,to:y.to}));}}let i=0,a=null;for(let d=t.parentElement;d?.parentElement;d=d.parentElement)if(/[ao]/.test(getComputedStyle(d).overflowY)&&d.scrollHeight>d.clientHeight&&(d!==document.body||/[aoh]/.test(getComputedStyle(d.parentElement).overflowY))){a=d;break}let u=0,m=0,p=()=>{let d=t.getBoundingClientRect().top;u=a?d-a.getBoundingClientRect().top-a.clientTop+a.scrollTop:d+window.scrollY,m=u+Math.max(0,t.offsetHeight-(a?a.clientHeight:window.innerHeight));},b=()=>{let d=a?a.scrollTop:window.scrollY;return m<=u?d>=u?1:0:N(d,u,m,1)},S=d=>{for(let v of s){let y=v.end-v.start,E=y<=0?d>=v.end?1:0:ar((d-v.start)/y),w=v.ease(E);v.kind==="draw"?v.el.style.strokeDashoffset=String(v.length*(1-w)):v.el.style.opacity=String(v.from+(v.to-v.from)*w);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return S(1),ir(1);let h=()=>{i=b(),S(i);};p(),h();let L=Le(a||window,[t],b,h,p);xe(t,{type:"draw",getProgress:()=>i,getTrigger:()=>({tStart:u,tEnd:m})});let F=nt(d=>{d&&(F(),L.off(),me(t),i=1,S(1));});return {destroy(){F(),L.off(),me(t);},getProgress:()=>i}}};
4
+ exports.Cinematic=vt;exports.PRESETS=ht;exports.createBounce=Ht;exports.createElastic=Nt;exports.createSpring=It;exports.scrollAnimate=Ir;exports.scrollCounter=Fr;exports.scrollDraw=Lr;exports.scrollParallax=Hr;