svg-scroll-draw 2.20.1 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +11 -9
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +1 -1
  4. package/dist/angular/index.d.ts +1 -1
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +3 -3
  7. package/dist/astro/index.mjs +1 -1
  8. package/dist/cdn/svg-scroll-draw.dev.global.js +83 -29
  9. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  10. package/dist/chunk-2PYLM3E7.mjs +1 -0
  11. package/dist/chunk-DY5JCXVR.mjs +1 -0
  12. package/dist/{chunk-MTEGM4RR.mjs → chunk-GVBO5GRD.mjs} +1 -1
  13. package/dist/chunk-HX4SP5WN.mjs +3 -0
  14. package/dist/chunk-LTCJVVSC.mjs +1 -0
  15. package/dist/chunk-N6PDF6O6.mjs +2 -0
  16. package/dist/{chunk-SMRTRZSD.mjs → chunk-OTDD2ROH.mjs} +1 -1
  17. package/dist/{chunk-ECHMYVSK.mjs → chunk-PKY27MO4.mjs} +1 -1
  18. package/dist/chunk-VDTAYUAR.mjs +1 -0
  19. package/dist/chunk-WXUOF4NM.mjs +1 -0
  20. package/dist/cinematic/index.cjs +2 -2
  21. package/dist/cinematic/index.mjs +1 -1
  22. package/dist/{engine-DQyBzZDl.d.ts → engine-B7UpB4fT.d.ts} +2 -1
  23. package/dist/{engine-P8u6OK4m.d.mts → engine-o1VSQ1lX.d.mts} +2 -1
  24. package/dist/group/index.cjs +3 -3
  25. package/dist/group/index.d.mts +2 -2
  26. package/dist/group/index.d.ts +2 -2
  27. package/dist/group/index.mjs +1 -1
  28. package/dist/horizontal/index.cjs +1 -1
  29. package/dist/horizontal/index.d.mts +2 -1
  30. package/dist/horizontal/index.d.ts +2 -1
  31. package/dist/horizontal/index.mjs +1 -1
  32. package/dist/{index-CMqK0GCT.d.mts → index-BY-CNE8c.d.mts} +1 -1
  33. package/dist/{index-DPqPEnO-.d.ts → index-DqXXiDIk.d.ts} +1 -1
  34. package/dist/index.cjs +4 -4
  35. package/dist/index.d.mts +2 -2
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.mjs +1 -1
  38. package/dist/nuxt/index.cjs +3 -3
  39. package/dist/nuxt/index.d.mts +1 -1
  40. package/dist/nuxt/index.d.ts +1 -1
  41. package/dist/nuxt/index.mjs +1 -1
  42. package/dist/react/index.cjs +3 -3
  43. package/dist/react/index.d.mts +1 -1
  44. package/dist/react/index.d.ts +1 -1
  45. package/dist/react/index.mjs +1 -1
  46. package/dist/reveal/index.cjs +1 -1
  47. package/dist/reveal/index.mjs +1 -1
  48. package/dist/snap/index.mjs +1 -1
  49. package/dist/solid/index.cjs +3 -3
  50. package/dist/solid/index.d.mts +1 -1
  51. package/dist/solid/index.d.ts +1 -1
  52. package/dist/solid/index.mjs +1 -1
  53. package/dist/svelte/index.cjs +3 -3
  54. package/dist/svelte/index.d.mts +1 -1
  55. package/dist/svelte/index.d.ts +1 -1
  56. package/dist/svelte/index.mjs +1 -1
  57. package/dist/text/index.cjs +1 -1
  58. package/dist/text/index.mjs +1 -1
  59. package/dist/timeline/index.mjs +1 -1
  60. package/dist/video/index.cjs +1 -1
  61. package/dist/video/index.mjs +1 -1
  62. package/dist/vue/index.cjs +3 -3
  63. package/dist/vue/index.d.mts +1 -1
  64. package/dist/vue/index.d.ts +1 -1
  65. package/dist/vue/index.mjs +1 -1
  66. package/dist/web-component/index.cjs +3 -3
  67. package/dist/web-component/index.mjs +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-7SBTYJGH.mjs +0 -1
  70. package/dist/chunk-BFX2CSQ3.mjs +0 -1
  71. package/dist/chunk-ENACACPZ.mjs +0 -3
  72. package/dist/chunk-I45LCJUP.mjs +0 -1
  73. package/dist/chunk-KGAJQP2N.mjs +0 -2
  74. package/dist/chunk-KHQ7OGQK.mjs +0 -1
@@ -17,7 +17,8 @@ interface ScrollAnimateOptions {
17
17
  velocityScale?: boolean | number;
18
18
  /**
19
19
  * Honour `prefers-reduced-motion: reduce` by applying the final state and not
20
- * animating. Default: `true`.
20
+ * animating, also when the reader turns it on while the page is open.
21
+ * Default: `true`.
21
22
  *
22
23
  * Set to `false` only when the movement is *scroll-linked scrubbing* rather
23
24
  * than autonomous motion — it advances solely as the user scrolls, 1:1 with
@@ -17,7 +17,8 @@ interface ScrollAnimateOptions {
17
17
  velocityScale?: boolean | number;
18
18
  /**
19
19
  * Honour `prefers-reduced-motion: reduce` by applying the final state and not
20
- * animating. Default: `true`.
20
+ * animating, also when the reader turns it on while the page is open.
21
+ * Default: `true`.
21
22
  *
22
23
  * Set to `false` only when the movement is *scroll-linked scrubbing* rather
23
24
  * than autonomous motion — it advances solely as the user scrolls, 1:1 with
@@ -1,3 +1,3 @@
1
- 'use strict';function Zt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,f=[];for(let y=0;y<r;y++){let $=Math.pow(o,y);f.push($),c+=$;}let i=[0],u=0;for(let y=0;y<r;y++)u+=f[y]/c,i.push(u);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let $=0;$<r;$++)if(y<=i[$+1]){let L=(y-i[$])/(i[$+1]-i[$]);if($===0)return L*(2-L);let w=1-Math.pow(t,$);return w+(1-w)*(2*L-1)*(2*L-1)}return 1}}function Kt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var $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:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Zt(),elastic:Kt()};function Mt(e,n,r){return Math.min(r,Math.max(n,e))}function Ne(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Lt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function kt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ie(e,n,r,t){return r===n?0:Mt((e-n)/(r-n)*t,0,1)}function Fe(e,n,r,t,o){let c=Lt(e.top,e.height,n,t.element)-kt(t.viewport,r),f=Lt(e.top,e.height,n,o.element)-kt(o.viewport,r);return {tStart:c,tEnd:f}}function ot(e,n,r){let t=e.getBoundingClientRect(),o=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function _e(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Dt(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 He(e,n,r){let t=Dt(e),o=Dt(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var It={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Be=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function pe(e,...n){Be&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Jt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",er="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ct=33;function tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function rr(e){let n=[];for(let r=0;r<Ct;r++){let t=r/(Ct-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function st(e){switch(e){case "linear":return "linear";case "ease-in":return Jt;case "ease-out":return er;case "ease-in-out":return tr()?rr($e["ease-in-out"]):null;default:return null}}var Ot=Symbol.for("svg-scroll-draw.registry");function Rt(){let e=globalThis;return e[Ot]||(e[Ot]=new Map)}function je(e,n){Rt().set(e,n);}function Ue(e){Rt().delete(e);}var Xe,it=new Set,at=new WeakMap,Ye=new Map,Nt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function nr(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function lt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();Xe??(Xe=new ResizeObserver(o=>{let c=false;for(let{target:f}of o)at.get(f)!==Nt(f)&&(c=true),at.set(f,"");c&&it.forEach(f=>f());})),it.add(r);let t=nr(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{at.has(o)||at.set(o,Nt(o)),Ye.set(o,(Ye.get(o)??0)+1),Xe.observe(o);}),()=>{it.delete(r)&&(t.forEach(o=>{let c=(Ye.get(o)??1)-1;if(c)return void Ye.set(o,c);Ye.delete(o),Xe?.unobserve(o);}),it.size||(Xe?.disconnect(),Xe=void 0));}}var or=0;function sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ft(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var _t=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ir(e){if(!Be)return;let n=Ft(e,"stroke");if(!n||n==="none"){pe("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!_t.has(r)&&!_t.has(Ft(e,"fill"))&&pe("Element has a fill \u2014 it may obscure the stroke animation.",e);}function ar(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function o(){let c=r==="x"?window.scrollX:window.scrollY,f=e-c,i=n-c,u=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${u?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${u?`left:${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 Ht=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function lr(e,n,r){if(!Be)return;let t=(e.match(Vt)??[]).join("").toUpperCase(),o=(n.match(Vt)??[]).join("").toUpperCase(),c=(e.match(Ht)??[]).length,f=(n.match(Ht)??[]).length;if(t!==o){pe(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==f&&pe(`morphTo: coordinate count differs (${c} \u2192 ${f}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function yt(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let f=parseFloat(c),i=t[o++]??f;return String(+(f+(i-f)*r).toFixed(4))})}function ht(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,o=r?{...It[r],...t}:t,c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:i=1,fade:u=false,easing:y="linear",trigger:$={},stagger:L=0,direction:w="forward",once:de=false,debug:Ze=false,axis:J="y",scrollContainer:Ie,autoReverse:Pe=false,delay:Ee=0,strokeColor:ae,strokeWidth:ge,fillOpacity:oe,waypoints:le,velocityScale:ve=false,threshold:Ae=0,rootMargin:ee="0px",repeat:R=0,repeatDelay:ze=0,morphTo:j,clip:Me,autoplay:We=false,duration:Ke=1e3,native:ct=true,onProgress:Le,onStart:U,onComplete:G,onEnter:ce,onLeave:ke,onEnterBack:ue,onLeaveBack:ye}=o,q=Me===true?"left":typeof Me=="string"?Me:false,te=typeof y=="function"?y:$e[y]??$e.linear,fe=Ne($.start??"top bottom"),Ce=Ne($.end??"bottom top"),X=typeof Ie=="string"?document.querySelector(Ie):Ie??null,K=Array.isArray(ae)?ae[0]:null,H=Array.isArray(ae)?ae[1]:typeof ae=="string"?ae:null,k=Array.isArray(ge)?ge[0]:null,N=Array.isArray(ge)?ge[1]:typeof ge=="number"?ge:null,F=Array.isArray(oe)?oe[0]:null,D=Array.isArray(oe)?oe[1]:typeof oe=="number"?oe:null;function he(s){let a=s*100;switch(q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let S=q?[]:Array.from(e.querySelectorAll(f)),E=[],V=[],O=0,Y=0,l=L,d=0,x=false,P=false,b=0,z=false,B=-1,be=[],_=-1,A=false,Q=0,we=0,Se,ut=null;function wt(){ut?.destroy(),ut=null;}let xe=new Set,Et=NaN,Te=true,Je=-1,vt=performance.now(),Oe=NaN;function Ge(){return X?J==="x"?X.scrollLeft:X.scrollTop:J==="x"?window.scrollX:window.scrollY}function St(){return X?J==="x"?X.clientWidth:X.clientHeight:J==="x"?window.innerWidth:window.innerHeight}function xt(){let s=ot(e,X,J);return Fe(s,s.scroll,St(),fe,Ce)}function Bt(){let s=Y-O,a=S.length-1,p=X??document.documentElement,I=J==="x"?"Width":"Height";if(l=L,L>0&&a>0&&s>0){let re=p[`scroll${I}`]-p[`client${I}`]-1-O-s/i;re>=0&&(l=Math.min(L,re/(a*s)));}d=Y+a*l*s;}function Tt(){(({tStart:O,tEnd:Y}=xt())),Bt(),Ze&&Be&&(wt(),ut=ar(O,Y,J));}function ft(s,a=xt){je(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:a});let p=s.destroy;return s.destroy=()=>{p.call(s),Ue(e);},s}function jt(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),q){let p=a==="reverse"?1-s:s;e.style.clipPath=he(p);return}S.forEach((p,I)=>{p.style.strokeDashoffset=a==="reverse"?`${E[I]*s}`:`${E[I]*(1-s)}`,u&&(p.style.opacity=a==="reverse"?`${1-s}`:`${s}`),K&&H?p.style.stroke=He(K,H,s):H&&(p.style.stroke=H),k!==null&&N!==null?p.style.strokeWidth=`${k+(N-k)*s}`:N!==null&&(p.style.strokeWidth=`${N}`),F!==null&&D!==null?p.style.fillOpacity=`${F+(D-F)*s}`:D!==null&&(p.style.fillOpacity=`${D}`),j&&p.tagName.toLowerCase()==="path"&&V[I]&&p.setAttribute("d",yt(V[I],j,s));});}function et(){if(e.style.setProperty("--scroll-draw-progress","0"),q){e.style.clipPath=he(0);return}S.forEach((s,a)=>{s.style.strokeDasharray=`${E[a]}`,s.style.strokeDashoffset=w==="reverse"?"0":`${E[a]}`,u?s.style.opacity=w==="reverse"?"1":"0":s.style.opacity="",K&&(s.style.stroke=K),k!==null&&(s.style.strokeWidth=`${k}`),F!==null&&(s.style.fillOpacity=`${F}`),j&&s.tagName.toLowerCase()==="path"&&V[a]&&s.setAttribute("d",V[a]);});}if(S.forEach(s=>{ir(s);let a=_e(s);E.push(a);let p=s.tagName.toLowerCase()==="path";p?V.push(s.getAttribute("d")??""):V.push(""),j&&(p?lr(V[V.length-1],j,s):pe(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),c?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=w==="reverse"?`${a}`:"0",u&&(s.style.opacity="1"),H&&(s.style.stroke=H),N!==null&&(s.style.strokeWidth=`${N}`),D!==null&&(s.style.fillOpacity=`${D}`),j&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",j)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=w==="reverse"?"0":`${a}`,u?s.style.opacity=w==="reverse"?"1":"0":s.style.opacity="",K&&(s.style.stroke=K),k!==null&&(s.style.strokeWidth=`${k}`),F!==null&&(s.style.fillOpacity=`${F}`));}),q){if(c)return e.style.clipPath=he(1),G?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=he(0);}else if(c)return G?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let $t=typeof y=="string"?st(y):null;function Ut(){return !(ct===false||!sr()||!S.length||!$t||q||J!=="y"||X||i!==1||L!==0||de||Pe||ve!==false||j||le||R||Ee>0||Le||U||G||ce||ke||ue||ye||ae!=null||ge!=null||oe!=null||($.start??"top bottom").trim()!=="top bottom"||($.end??"bottom top").trim()!=="bottom top")}function Xt(){let s=++or,a=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,I=`--svg-scroll-draw-${s}`,re=w==="reverse"?"0":"var(--ssd-len)",me=w==="reverse"?"var(--ssd-len)":"0",se=`stroke-dashoffset:${re};`,h=`stroke-dashoffset:${me};`;u&&(se+=`opacity:${w==="reverse"?1:0};`,h+=`opacity:${w==="reverse"?0:1};`);let v=document.createElement("style");v.setAttribute("data-svg-scroll-draw",""),v.textContent=`@keyframes ${a}{from{${se}}to{${h}}}.${p}{view-timeline-name:${I};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${I};animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(p);function W(m,C){m.style.setProperty("--ssd-len",String(E[C])),m.style.strokeDasharray=`${E[C]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(a);}S.forEach(W);let g=false,T=-1;function M(){if(T>=0)return T;let m=e.getBoundingClientRect(),{tStart:C,tEnd:ne}=Fe({top:m.top,height:m.height},Ge(),St(),fe,Ce);return te(ie(Ge(),C,ne,i))}return {destroy(){e.classList.remove(p),S.forEach(m=>{m.classList.remove(a),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),v.remove();},replay(){g=false,T=-1,S.forEach(W);},pause(){g=true,S.forEach(m=>{m.style.animationPlayState="paused";});},resume(){g&&(g=false,S.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let C=Math.min(1,Math.max(0,m));T=C,g=true,S.forEach((ne,Z)=>{ne.classList.remove(a),ne.style.strokeDashoffset=w==="reverse"?`${E[Z]*C}`:`${E[Z]*(1-C)}`,u&&(ne.style.opacity=w==="reverse"?`${1-C}`:`${C}`);});},getProgress(){return M()},refresh(){S.forEach((m,C)=>{E[C]=_e(m),m.style.setProperty("--ssd-len",String(E[C])),m.style.strokeDasharray=`${E[C]}`;});}}}if(Ut())return ft(Xt());function Yt(){let s=Math.max(1,Ke),a=0,p=0,I=false;function re(g){let T=true;if(q){let M=Math.min(1,Math.max(0,g/s)),m=te(M);Q=m,e.style.setProperty("--scroll-draw-progress",String(m)),e.style.clipPath=he(w==="reverse"?1-m:m),Le?.(m),M<1&&(T=false);}else S.forEach((M,m)=>{let C=m*L*s,ne=Math.min(1,Math.max(0,(g-C)/s)),Z=te(ne);M.style.strokeDashoffset=w==="reverse"?`${E[m]*Z}`:`${E[m]*(1-Z)}`,u&&(M.style.opacity=w==="reverse"?`${1-Z}`:`${Z}`),K&&H?M.style.stroke=He(K,H,Z):H&&(M.style.stroke=H),k!==null&&N!==null?M.style.strokeWidth=`${k+(N-k)*Z}`:N!==null&&(M.style.strokeWidth=`${N}`),F!==null&&D!==null?M.style.fillOpacity=`${F+(D-F)*Z}`:D!==null&&(M.style.fillOpacity=`${D}`),j&&M.tagName.toLowerCase()==="path"&&V[m]&&M.setAttribute("d",yt(V[m],j,Z)),m===0&&(Q=Z,Le?.(Z),e.style.setProperty("--scroll-draw-progress",String(Z))),ne<1&&(T=false);});if(le){let M=Math.min(1,Math.max(0,g/s)),m=te(M);for(let C in le){let ne=parseFloat(C);m>=ne&&!xe.has(ne)&&(xe.add(ne),le[C]?.());}}return T}function me(g){if(A)return;let T=g-a;P||(P=true,U?.());let M=re(T);if(M&&!x){x=true,re(s*(1+Math.max(0,S.length-1)*L)),G?.(),we<(R==="infinite"?1/0:R??0)&&(we++,Se=setTimeout(()=>{a=performance.now(),P=false,x=false,xe.clear(),et(),b=requestAnimationFrame(me);},ze));return}M||(b=requestAnimationFrame(me));}function se(){cancelAnimationFrame(b),clearTimeout(Se),a=performance.now(),p=0,A=false,P=false,x=false,we=0,I=true,Q=0,xe.clear(),et(),b=requestAnimationFrame(me);}let h=new IntersectionObserver(g=>{g.forEach(T=>{T.isIntersecting&&!(de&&x)?se():!T.isIntersecting&&!de&&!x&&(cancelAnimationFrame(b),clearTimeout(Se),I=false);});},{root:X??null,threshold:Ae,rootMargin:ee}),v;function W(){clearTimeout(v),v=setTimeout(()=>{S.forEach((g,T)=>{E[T]=_e(g),g.style.strokeDasharray=`${E[T]}`;});},150);}return window.addEventListener("resize",W),window.addEventListener("orientationchange",W),Ee>0?setTimeout(()=>h.observe(e),Ee):h.observe(e),{destroy(){cancelAnimationFrame(b),clearTimeout(Se),h.disconnect(),window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W),clearTimeout(v);},replay(){we=0,se();},pause(){A||!I||(A=true,p=performance.now()-a,cancelAnimationFrame(b));},resume(){A&&(A=false,I=true,a=performance.now()-p,b=requestAnimationFrame(me));},seek(g){let T=Math.min(1,Math.max(0,g));Q=T,A=true,p=T*s,a=performance.now()-p,cancelAnimationFrame(b),re(p);},getProgress(){return Q},refresh(){clearTimeout(v),S.forEach((g,T)=>{E[T]=_e(g),g.style.strokeDasharray=`${E[T]}`;});}}}if(We)return ft(Yt());Tt();function Pt(){if(A||!Re)return;let s=performance.now(),a=Ge();if(!Te&&ve===false&&a===Et){pt(a);return}Te=false,Et=a;let p=i;if(ve!==false){let h=s-vt,v=h>0?Math.abs(a-(Je<0?a:Je))/h:0;p=i*Math.max(.2,1+v*(typeof ve=="number"?ve:1)*.04);}Je=a,vt=s;let I=Pe?_===-1||a>=_?"forward":"reverse":w;_=a;let re=Y-O,me=true,se=re===0?0:(a-O)/re;if(isNaN(Oe)||(Oe<=0&&se>0?ce?.():Oe>0&&se<=0&&ye?.(),Oe<1&&se>=1?ke?.():Oe>=1&&se<1&&ue?.()),Oe=se,q){let h=te(ie(a,O,Y,p));de&&!Pe&&(B=Math.max(B,h),h=B),Q=h,e.style.setProperty("--scroll-draw-progress",String(h));let v=I==="reverse"?1-h:h;e.style.clipPath=he(v),Le?.(h),!P&&ie(a,O,Y,p)>0&&(P=true,U?.()),h>=1&&!x?(x=true,G?.(),we<(R==="infinite"?1/0:R??0)&&(we++,Se=setTimeout(()=>{B=-1,P=false,x=false,e.style.clipPath=he(0);},ze))):h<1&&!de&&(x=false),pt(a);return}if(S.forEach((h,v)=>{let W=v*l*re,g=te(ie(a,O+W,Y+W,p));de&&!Pe&&(g=be[v]=Math.max(be[v]??B,g)),h.style.strokeDashoffset=I==="reverse"?`${E[v]*g}`:`${E[v]*(1-g)}`,u&&(h.style.opacity=I==="reverse"?`${1-g}`:`${g}`),K&&H?h.style.stroke=He(K,H,g):H&&(h.style.stroke=H),k!==null&&N!==null?h.style.strokeWidth=`${k+(N-k)*g}`:N!==null&&(h.style.strokeWidth=`${N}`),F!==null&&D!==null?h.style.fillOpacity=`${F+(D-F)*g}`:D!==null&&(h.style.fillOpacity=`${D}`),j&&h.tagName.toLowerCase()==="path"&&V[v]&&h.setAttribute("d",yt(V[v],j,g)),v===0&&(Q=g,Le?.(g),e.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(me=false);}),le){let h=te(ie(a,O,Y,p));for(let v in le){let W=parseFloat(v);h>=W&&!xe.has(W)&&(xe.add(W),le[v]?.());}}!P&&ie(a,O,Y,p)>0&&(P=true,U?.()),me&&!x?(x=true,G?.(),we<(R==="infinite"?1/0:R??0)&&(we++,Se=setTimeout(()=>{B=-1,be=[],P=false,x=false,xe.clear(),et(),Te=true;},ze))):!me&&!de&&(x=false),pt(a);}function mt(s){return s>=Y&&s<d}function pt(s){z||mt(s)?b=requestAnimationFrame(Pt):Re=false;}function dt(){return z||mt(Ge())}let Re=false;function tt(){Re||(Re=true,b=requestAnimationFrame(function(){Pt();}));}function rt(){Re=false,cancelAnimationFrame(b);}let gt=new IntersectionObserver(s=>{s.forEach(a=>{z=a.isIntersecting,z&&!A?(Te=true,tt()):Re&&!A&&mt(Ge())||rt();});},{root:X??null,threshold:Ae,rootMargin:ee});function At(){S.forEach((s,a)=>{E[a]=_e(s),s.style.strokeDasharray=`${E[a]}`;}),Tt(),Te=true;}let nt;function qe(){clearTimeout(nt),nt=setTimeout(At,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let Qt=lt([e],qe);return Ee>0?setTimeout(()=>gt.observe(e),Ee):gt.observe(e),ft({destroy(){cancelAnimationFrame(b),clearTimeout(Se),rt(),gt.disconnect(),Qt(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(nt),wt();},replay(){B=-1,be=[],_=-1,Je=-1,P=false,x=false,we=0,A=false,Q=0,xe.clear(),clearTimeout(Se),et(),Te=true,dt()&&tt();},pause(){A=true,rt();},resume(){A&&(A=false,Te=true,dt()&&tt());},seek(s){let a=Math.min(1,Math.max(0,s));Q=a,B=a,be=[],A=true,rt(),jt(a,w),Te=true;},getProgress(){return Q},refresh(){clearTimeout(nt),At(),dt()&&!A&&tt();}},()=>({tStart:O,tEnd:Y}))}function cr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function zt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],f=t[2].trim();if(f)for(let i of f.split(/[\s,]+/)){let u=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(u?parseFloat(u[1]):0),c.push(u?u[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function ur(e,n,r){let t=zt(e),o=zt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,f)=>{let i=o[f];return c.fn!==i.fn||c.nums.length!==i.nums.length?r<1?`${c.fn}(${c.nums.map((u,y)=>`${u}${c.units[y]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,y)=>`${u}${i.units[y]}`).join(", ")})`:`${c.fn}(${c.nums.map((u,y)=>`${u+(i.nums[y]-u)*r}${c.units[y]}`).join(", ")})`}).join(" ")}function bt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(cr(t))return He(t,o,r);if(t.includes("("))return ur(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),f=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&f){let i=parseFloat(c[1]),u=parseFloat(f[1]);return `${i+(u-i)*r}${c[2]||f[2]}`}return r<1?t:o}function fr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),pr=0,Wt="--scroll-draw-progress";function dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ve(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:o={},easing:c="ease-out",speed:f=1,once:i=false,axis:u="y",scrollContainer:y,native:$=true,velocityScale:L=false,respectReducedMotion:w=true,triggerElement:de,onProgress:Ze,onComplete:J,onEnter:Ie,onLeave:Pe,onEnterBack:Ee,onLeaveBack:ae}=n,ge=w&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,oe=typeof c=="function"?c:$e[c]??$e["ease-out"],le=Ne(o.start??"top bottom"),ve=Ne(o.end??"bottom top"),Ae=de??e,ee=typeof y=="string"?document.querySelector(y):y??null,R=Object.entries(t).map(([l,d])=>({prop:fr(l),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function ze(){let l=window.getComputedStyle(e);for(let d of R)d.from===""&&(d.from=l.getPropertyValue(d.prop).trim()||"0");}function j(){for(let l of R)e.style.setProperty(l.prop,String(l.to));}let Me=new Map;for(let l of [...R.map(d=>d.prop),Wt])Me.set(l,e.style.getPropertyValue(l));function We(){for(let[l,d]of Me)d?e.style.setProperty(l,d):e.style.removeProperty(l);}if(ge)return j(),J?.(),{...r,destroy:We,getProgress:()=>1};ze();let Ke=typeof c=="string"?st(c):null;function ct(){if(!$||!dr()||!Ke||u!=="y"||ee||Ae!==e||i||f!==1||Ze||J||Ie||Pe||Ee||ae||L!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let l of R)if(!mr.has(l.prop))return false;return true}function Le(){let l=`ssd-a-${++pr}`,d=R.map(_=>`${_.prop}:${_.from}`).join(";"),x=R.map(_=>`${_.prop}:${_.to}`).join(";"),P=document.createElement("style");P.setAttribute("data-ssd-animate",""),P.textContent=`@keyframes ${l}{from{${d}}to{${x}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ke};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(P),e.classList.add(l);let b=()=>u==="x"?window.scrollX:window.scrollY,z=()=>u==="x"?window.innerWidth:window.innerHeight,B=()=>{let _=e.getBoundingClientRect();return Fe({top:_.top,height:_.height},b(),z(),le,ve)};je(e,{type:"animate",getProgress:()=>be.getProgress(),getTrigger:B});let be={refresh(){},destroy(){e.classList.remove(l),P.remove(),e.style.animationPlayState="",We(),Ue(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(_){let A=Math.min(1,Math.max(0,_));e.classList.remove(l);for(let Q of R)e.style.setProperty(Q.prop,bt(Q.from,Q.to,A));},getProgress(){let{tStart:_,tEnd:A}=B();return oe(ie(b(),_,A,f))}};return be}if(ct())return Le();let U=0,G=0,ce=0,ke=false,ue=false,ye=-1,q=0,te=false,fe=NaN,Ce=-1,X=0,K=()=>ee?u==="x"?ee.scrollLeft:ee.scrollTop:u==="x"?window.scrollX:window.scrollY,H=()=>ee?u==="x"?ee.clientWidth:ee.clientHeight:u==="x"?window.innerWidth:window.innerHeight,k=Ae===e?R:[],N=false;function F(){let l=e.style,d=k.map(z=>l.getPropertyValue(z.prop)),x=l.transition;k.length&&(l.transition="none"),k.forEach(z=>l.setProperty(z.prop,Me.get(z.prop)??""));let P=ot(Ae,ee,u);k.forEach((z,B)=>l.setProperty(z.prop,d[B])),k.length&&(e.offsetWidth,l.transition=x);let b=Fe(P,P.scroll,H(),le,ve);N&&Math.abs(b.tStart-U)<1&&Math.abs(b.tEnd-G)<1||(N=true,U=b.tStart,G=b.tEnd);}function D(l){e.style.setProperty(Wt,String(l));for(let d of R)e.style.setProperty(d.prop,bt(d.from,d.to,l));Ze?.(l);}function he(l){if(isNaN(fe)){fe=l;return}fe<=0&&l>0?Ie?.():fe>0&&l<=0&&ae?.(),fe<1&&l>=1?Pe?.():fe>=1&&l<1&&Ee?.(),fe=l;}function S(){if(!ke||ue)return;let l=performance.now(),d=K(),x=f;if(L!==false){let z=l-X,B=z>0?Math.abs(d-(Ce<0?d:Ce))/z:0;x=f*Math.max(.2,1+B*(typeof L=="number"?L:1)*.04);}Ce=d,X=l;let P=G===U?0:(d-U)/(G-U);he(P);let b=oe(ie(d,U,G,x));i&&(ye=Math.max(ye,b),b=ye),q=b,D(b),b>=1&&!te?(te=true,J?.()):b<1&&!i&&(te=false),ce=requestAnimationFrame(S);}F(),G===U&&pe("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=oe(ie(K(),U,G,f));i&&l>0&&(ye=l),q=l,D(l);}let E=new IntersectionObserver(l=>{l.forEach(d=>{ke=d.isIntersecting,ke&&!ue?ce=requestAnimationFrame(S):cancelAnimationFrame(ce);});},{root:ee??null}),V;function O(){clearTimeout(V),V=setTimeout(F,150);}window.addEventListener("resize",O),window.addEventListener("orientationchange",O);let Y=lt([Ae],O);return E.observe(e),je(e,{type:"animate",getProgress:()=>q,getTrigger:()=>({tStart:U,tEnd:G})}),{destroy(){cancelAnimationFrame(ce),E.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),Y(),clearTimeout(V),We(),Ue(e);},replay(){ye=-1,te=false,q=0,ue=false,D(0);},pause(){ue=true,cancelAnimationFrame(ce);},resume(){ue&&(ue=false,ke&&(ce=requestAnimationFrame(S)));},seek(l){let d=Math.min(1,Math.max(0,l));q=d,ye=d,ue=true,cancelAnimationFrame(ce),D(d);},getProgress(){return q},refresh(){F();}}}var Gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function qt(e,n={}){if(typeof window>"u")return Gt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return pe("scrollParallax: element not found:",e),Gt;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:f,onProgress:i}=n,u=-t*100,y=r.style,$=!!r.ownerSVGElement,L=y.getPropertyValue("transform-box");$&&y.setProperty("transform-box","fill-box");let w=Ve(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:f??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:i});return $?{...w,destroy(){w.destroy(),y.setProperty("transform-box",L);}}:w}function Qe(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var De={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function en(e,n={}){if(typeof window>"u")return De;let r=Qe(e).map(t=>ht(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 tn(e,n={}){if(typeof window>"u")return De;let r=Qe(e);if(r.length===0)return De;let t=0,o=[];function c(i){return ht(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function f(){r.forEach((i,u)=>{o[u]=c(u);});for(let i=1;i<o.length;i++)o[i].pause();}return f(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,f();},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 rn(e,n){if(typeof window>"u")return De;let r=Qe(e).map(t=>Ve(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 nn(e,n){if(typeof window>"u")return De;let r=Qe(e);if(r.length===0)return De;let t=0,o=[];function c(i){return Ve(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function f(){r.forEach((i,u)=>{o[u]=c(u);});for(let i=1;i<o.length;i++)o[i].pause();}return f(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,f();},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 on(e,n={}){if(typeof window>"u")return De;let r=Qe(e).map(t=>qt(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=rn;exports.scrollAnimateSequence=nn;exports.scrollDrawGroup=en;exports.scrollDrawSequence=tn;exports.scrollParallaxGroup=on;
1
+ 'use strict';function tr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,u=[];for(let y=0;y<r;y++){let M=Math.pow(o,y);u.push(M),c+=M;}let i=[0],m=0;for(let y=0;y<r;y++)m+=u[y]/c,i.push(m);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let M=0;M<r;M++)if(y<=i[M+1]){let L=(y-i[M])/(i[M+1]-i[M]);if(M===0)return L*(2-L);let v=1-Math.pow(t,M);return v+(1-v)*(2*L-1)*(2*L-1)}return 1}}function rr({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var Pe={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:tr(),elastic:rr()};function Lt(e,n,r){return Math.min(r,Math.max(n,e))}function Re(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function kt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function Dt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ie(e,n,r,t){return r===n?0:Lt((e-n)/(r-n)*t,0,1)}function Ne(e,n,r,t,o){let c=kt(e.top,e.height,n,t.element)-Dt(t.viewport,r),u=kt(e.top,e.height,n,o.element)-Dt(o.viewport,r);return {tStart:c,tEnd:u}}function nt(e,n,r){let t=e.getBoundingClientRect(),o=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function Fe(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Ot(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=Ot(e),o=Ot(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var It={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Be=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function de(e,...n){Be&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var nr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",or="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ct=33;function sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ir(e){let n=[];for(let r=0;r<Ct;r++){let t=r/(Ct-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function ot(e){switch(e){case "linear":return "linear";case "ease-in":return nr;case "ease-out":return or;case "ease-in-out":return sr()?ir(Pe["ease-in-out"]):null;default:return null}}var Rt=Symbol.for("svg-scroll-draw.registry");function Nt(){let e=globalThis;return e[Rt]||(e[Rt]=new Map)}function Qe(e,n){Nt().set(e,n);}function je(e){Nt().delete(e);}var Ue,st=new Set,it=new WeakMap,Xe=new Map,Ft=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function ar(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function at(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();Ue??(Ue=new ResizeObserver(o=>{let c=false;for(let{target:u}of o)it.get(u)!==Ft(u)&&(c=true),it.set(u,"");c&&st.forEach(u=>u());})),st.add(r);let t=ar(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{it.has(o)||it.set(o,Ft(o)),Xe.set(o,(Xe.get(o)??0)+1),Ue.observe(o);}),()=>{st.delete(r)&&(t.forEach(o=>{let c=(Xe.get(o)??1)-1;if(c)return void Xe.set(o,c);Xe.delete(o),Ue?.unobserve(o);}),st.size||(Ue?.disconnect(),Ue=void 0));}}function _t(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let t=n;return t.addListener?.(r),()=>t.removeListener?.(r)}function lt(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let r=n(e,false),t=_t(c=>{if(!c)return;t();let u=(r.getProgress?.()??0)>=1;r.destroy(),r=n(u?{...e,onComplete:void 0}:e,true);}),o={};for(let c of Object.keys(r))o[c]=(...u)=>r[c]?.(...u);return o.destroy=()=>{t(),r.destroy();},o}var lr=0;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ht(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ur(e){if(!Be)return;let n=Ht(e,"stroke");if(!n||n==="none"){de("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Vt.has(r)&&!Vt.has(Ht(e,"fill"))&&de("Element has a fill \u2014 it may obscure the stroke animation.",e);}function fr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function o(){let c=r==="x"?window.scrollX:window.scrollY,u=e-c,i=n-c,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${u}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${i}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${i}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var Wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function mr(e,n,r){if(!Be)return;let t=(e.match(zt)??[]).join("").toUpperCase(),o=(n.match(zt)??[]).join("").toUpperCase(),c=(e.match(Wt)??[]).length,u=(n.match(Wt)??[]).length;if(t!==o){de(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==u&&de(`morphTo: coordinate count differs (${c} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ht(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let u=parseFloat(c),i=t[o++]??u;return String(+(u+(i-u)*r).toFixed(4))})}function bt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:lt(n,(r,t)=>pr(e,r,t))}function pr(e,n,r){let{preset:t,...o}=n,c=t?{...It[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:i=1,fade:m=false,easing:y="linear",trigger:M={},stagger:L=0,direction:v="forward",once:ae=false,debug:Ve=false,axis:J="y",scrollContainer:De,autoReverse:$e=false,delay:ve=0,strokeColor:ee,strokeWidth:le,fillOpacity:ce,waypoints:j,velocityScale:W=false,threshold:U=0,rootMargin:Ze="0px",repeat:ge=0,repeatDelay:Ae=0,morphTo:N,clip:Oe,autoplay:ct=false,duration:ut=1e3,native:te=true,onProgress:q,onStart:X,onComplete:re,onEnter:ue,onLeave:ye,onEnterBack:he,onLeaveBack:Le}=c,F=Oe===true?"left":typeof Oe=="string"?Oe:false,ne=typeof y=="function"?y:Pe[y]??Pe.linear,We=Re(M.start??"top bottom"),ze=Re(M.end??"bottom top"),Q=typeof De=="string"?document.querySelector(De):De??null,_=Array.isArray(ee)?ee[0]:null,C=Array.isArray(ee)?ee[1]:typeof ee=="string"?ee:null,R=Array.isArray(le)?le[0]:null,k=Array.isArray(le)?le[1]:typeof le=="number"?le:null,z=Array.isArray(ce)?ce[0]:null,I=Array.isArray(ce)?ce[1]:typeof ce=="number"?ce:null;function fe(s){let l=s*100;switch(F){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let x=F?[]:Array.from(e.querySelectorAll(u)),w=[],G=[],a=0,f=0,oe=L,Y=0,b=false,S=false,$=0,Ee=false,P=-1,be=[],Se=-1,H=false,me=0,we=0,xe,ft=null;function vt(){ft?.destroy(),ft=null;}let Te=new Set,Et=NaN,Me=true,Ke=-1,St=performance.now(),Ie=NaN;function qe(){return Q?J==="x"?Q.scrollLeft:Q.scrollTop:J==="x"?window.scrollX:window.scrollY}function xt(){return Q?J==="x"?Q.clientWidth:Q.clientHeight:J==="x"?window.innerWidth:window.innerHeight}function Tt(){let s=nt(e,Q,J);return Ne(s,s.scroll,xt(),We,ze)}function Xt(){let s=f-a,l=x.length-1,d=Q??document.documentElement,D=J==="x"?"Width":"Height";if(oe=L,L>0&&l>0&&s>0){let Z=d[`scroll${D}`]-d[`client${D}`]-1-a-s/i;Z>=0&&(oe=Math.min(L,Z/(l*s)));}Y=f+l*oe*s;}function Mt(){(({tStart:a,tEnd:f}=Tt())),Xt(),Ve&&Be&&(vt(),ft=fr(a,f,J));}function mt(s,l=Tt){Qe(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:l});let d=s.destroy;return s.destroy=()=>{d.call(s),je(e);},s}function Yt(s,l){if(e.style.setProperty("--scroll-draw-progress",String(s)),F){let d=l==="reverse"?1-s:s;e.style.clipPath=fe(d);return}x.forEach((d,D)=>{d.style.strokeDashoffset=l==="reverse"?`${w[D]*s}`:`${w[D]*(1-s)}`,m&&(d.style.opacity=l==="reverse"?`${1-s}`:`${s}`),_&&C?d.style.stroke=_e(_,C,s):C&&(d.style.stroke=C),R!==null&&k!==null?d.style.strokeWidth=`${R+(k-R)*s}`:k!==null&&(d.style.strokeWidth=`${k}`),z!==null&&I!==null?d.style.fillOpacity=`${z+(I-z)*s}`:I!==null&&(d.style.fillOpacity=`${I}`),N&&d.tagName.toLowerCase()==="path"&&G[D]&&d.setAttribute("d",ht(G[D],N,s));});}function Je(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=fe(0);return}x.forEach((s,l)=>{s.style.strokeDasharray=`${w[l]}`,s.style.strokeDashoffset=v==="reverse"?"0":`${w[l]}`,m?s.style.opacity=v==="reverse"?"1":"0":s.style.opacity="",_&&(s.style.stroke=_),R!==null&&(s.style.strokeWidth=`${R}`),z!==null&&(s.style.fillOpacity=`${z}`),N&&s.tagName.toLowerCase()==="path"&&G[l]&&s.setAttribute("d",G[l]);});}if(x.forEach(s=>{ur(s);let l=Fe(s);w.push(l);let d=s.tagName.toLowerCase()==="path";d?G.push(s.getAttribute("d")??""):G.push(""),N&&(d?mr(G[G.length-1],N,s):de(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=v==="reverse"?`${l}`:"0",m&&(s.style.opacity="1"),C&&(s.style.stroke=C),k!==null&&(s.style.strokeWidth=`${k}`),I!==null&&(s.style.fillOpacity=`${I}`),N&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",N)):(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=v==="reverse"?"0":`${l}`,m?s.style.opacity=v==="reverse"?"1":"0":s.style.opacity="",_&&(s.style.stroke=_),R!==null&&(s.style.strokeWidth=`${R}`),z!==null&&(s.style.fillOpacity=`${z}`));}),F){if(r)return e.style.clipPath=fe(1),re?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=fe(0);}else if(r)return re?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Pt=typeof y=="string"?ot(y):null;function Zt(){return !(te===false||!cr()||!x.length||!Pt||F||J!=="y"||Q||i!==1||L!==0||ae||$e||W!==false||N||j||ge||ve>0||q||X||re||ue||ye||he||Le||ee!=null||le!=null||ce!=null||(M.start??"top bottom").trim()!=="top bottom"||(M.end??"bottom top").trim()!=="bottom top")}function Kt(){let s=++lr,l=`svg-scroll-draw-${s}`,d=`svg-scroll-draw-host-${s}`,D=`--svg-scroll-draw-${s}`,Z=v==="reverse"?"0":"var(--ssd-len)",pe=v==="reverse"?"var(--ssd-len)":"0",se=`stroke-dashoffset:${Z};`,h=`stroke-dashoffset:${pe};`;m&&(se+=`opacity:${v==="reverse"?1:0};`,h+=`opacity:${v==="reverse"?0:1};`);let E=document.createElement("style");E.setAttribute("data-svg-scroll-draw",""),E.textContent=`@keyframes ${l}{from{${se}}to{${h}}}.${d}{view-timeline-name:${D};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Pt};animation-fill-mode:both;animation-timeline:${D};animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(d);function V(p,O){p.style.setProperty("--ssd-len",String(w[O])),p.style.strokeDasharray=`${w[O]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(l);}x.forEach(V);let g=false,T=-1;function A(){if(T>=0)return T;let p=e.getBoundingClientRect(),{tStart:O,tEnd:K}=Ne({top:p.top,height:p.height},qe(),xt(),We,ze);return ne(ie(qe(),O,K,i))}return {destroy(){e.classList.remove(d),x.forEach(p=>{p.classList.remove(l),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),E.remove();},replay(){g=false,T=-1,x.forEach(V);},pause(){g=true,x.forEach(p=>{p.style.animationPlayState="paused";});},resume(){g&&(g=false,x.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let O=Math.min(1,Math.max(0,p));T=O,g=true,x.forEach((K,B)=>{K.classList.remove(l),K.style.strokeDashoffset=v==="reverse"?`${w[B]*O}`:`${w[B]*(1-O)}`,m&&(K.style.opacity=v==="reverse"?`${1-O}`:`${O}`);});},getProgress(){return A()},refresh(){x.forEach((p,O)=>{w[O]=Fe(p),p.style.setProperty("--ssd-len",String(w[O])),p.style.strokeDasharray=`${w[O]}`;});}}}if(Zt())return mt(Kt());function Jt(){let s=Math.max(1,ut),l=0,d=0,D=false;function Z(g){let T=true;if(F){let A=Math.min(1,Math.max(0,g/s)),p=ne(A);me=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=fe(v==="reverse"?1-p:p),q?.(p),A<1&&(T=false);}else x.forEach((A,p)=>{let O=p*L*s,K=Math.min(1,Math.max(0,(g-O)/s)),B=ne(K);A.style.strokeDashoffset=v==="reverse"?`${w[p]*B}`:`${w[p]*(1-B)}`,m&&(A.style.opacity=v==="reverse"?`${1-B}`:`${B}`),_&&C?A.style.stroke=_e(_,C,B):C&&(A.style.stroke=C),R!==null&&k!==null?A.style.strokeWidth=`${R+(k-R)*B}`:k!==null&&(A.style.strokeWidth=`${k}`),z!==null&&I!==null?A.style.fillOpacity=`${z+(I-z)*B}`:I!==null&&(A.style.fillOpacity=`${I}`),N&&A.tagName.toLowerCase()==="path"&&G[p]&&A.setAttribute("d",ht(G[p],N,B)),p===0&&(me=B,q?.(B),e.style.setProperty("--scroll-draw-progress",String(B))),K<1&&(T=false);});if(j){let A=Math.min(1,Math.max(0,g/s)),p=ne(A);for(let O in j){let K=parseFloat(O);p>=K&&!Te.has(K)&&(Te.add(K),j[O]?.());}}return T}function pe(g){if(H)return;let T=g-l;S||(S=true,X?.());let A=Z(T);if(A&&!b){b=true,Z(s*(1+Math.max(0,x.length-1)*L)),re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{l=performance.now(),S=false,b=false,Te.clear(),Je(),$=requestAnimationFrame(pe);},Ae));return}A||($=requestAnimationFrame(pe));}function se(){cancelAnimationFrame($),clearTimeout(xe),l=performance.now(),d=0,H=false,S=false,b=false,we=0,D=true,me=0,Te.clear(),Je(),$=requestAnimationFrame(pe);}let h=new IntersectionObserver(g=>{g.forEach(T=>{T.isIntersecting&&!(ae&&b)?se():!T.isIntersecting&&!ae&&!b&&(cancelAnimationFrame($),clearTimeout(xe),D=false);});},{root:Q??null,threshold:U,rootMargin:Ze}),E;function V(){clearTimeout(E),E=setTimeout(()=>{x.forEach((g,T)=>{w[T]=Fe(g),g.style.strokeDasharray=`${w[T]}`;});},150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),ve>0?setTimeout(()=>h.observe(e),ve):h.observe(e),{destroy(){cancelAnimationFrame($),clearTimeout(xe),h.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(E);},replay(){we=0,se();},pause(){H||!D||(H=true,d=performance.now()-l,cancelAnimationFrame($));},resume(){H&&(H=false,D=true,l=performance.now()-d,$=requestAnimationFrame(pe));},seek(g){let T=Math.min(1,Math.max(0,g));me=T,H=true,d=T*s,l=performance.now()-d,cancelAnimationFrame($),Z(d);},getProgress(){return me},refresh(){clearTimeout(E),x.forEach((g,T)=>{w[T]=Fe(g),g.style.strokeDasharray=`${w[T]}`;});}}}if(ct)return mt(Jt());Mt();function $t(){if(H||!Ce)return;let s=performance.now(),l=qe();if(!Me&&W===false&&l===Et){dt(l);return}Me=false,Et=l;let d=i;if(W!==false){let h=s-St,E=h>0?Math.abs(l-(Ke<0?l:Ke))/h:0;d=i*Math.max(.2,1+E*(typeof W=="number"?W:1)*.04);}Ke=l,St=s;let D=$e?Se===-1||l>=Se?"forward":"reverse":v;Se=l;let Z=f-a,pe=true,se=Z===0?0:(l-a)/Z;if(isNaN(Ie)||(Ie<=0&&se>0?ue?.():Ie>0&&se<=0&&Le?.(),Ie<1&&se>=1?ye?.():Ie>=1&&se<1&&he?.()),Ie=se,F){let h=ne(ie(l,a,f,d));ae&&!$e&&(P=Math.max(P,h),h=P),me=h,e.style.setProperty("--scroll-draw-progress",String(h));let E=D==="reverse"?1-h:h;e.style.clipPath=fe(E),q?.(h),!S&&ie(l,a,f,d)>0&&(S=true,X?.()),h>=1&&!b?(b=true,re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{P=-1,S=false,b=false,e.style.clipPath=fe(0);},Ae))):h<1&&!ae&&(b=false),dt(l);return}if(x.forEach((h,E)=>{let V=E*oe*Z,g=ne(ie(l,a+V,f+V,d));ae&&!$e&&(g=be[E]=Math.max(be[E]??P,g)),h.style.strokeDashoffset=D==="reverse"?`${w[E]*g}`:`${w[E]*(1-g)}`,m&&(h.style.opacity=D==="reverse"?`${1-g}`:`${g}`),_&&C?h.style.stroke=_e(_,C,g):C&&(h.style.stroke=C),R!==null&&k!==null?h.style.strokeWidth=`${R+(k-R)*g}`:k!==null&&(h.style.strokeWidth=`${k}`),z!==null&&I!==null?h.style.fillOpacity=`${z+(I-z)*g}`:I!==null&&(h.style.fillOpacity=`${I}`),N&&h.tagName.toLowerCase()==="path"&&G[E]&&h.setAttribute("d",ht(G[E],N,g)),E===0&&(me=g,q?.(g),e.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(pe=false);}),j){let h=ne(ie(l,a,f,d));for(let E in j){let V=parseFloat(E);h>=V&&!Te.has(V)&&(Te.add(V),j[E]?.());}}!S&&ie(l,a,f,d)>0&&(S=true,X?.()),pe&&!b?(b=true,re?.(),we<(ge==="infinite"?1/0:ge??0)&&(we++,xe=setTimeout(()=>{P=-1,be=[],S=false,b=false,Te.clear(),Je(),Me=true;},Ae))):!pe&&!ae&&(b=false),dt(l);}function pt(s){return s>=f&&s<Y}function dt(s){Ee||pt(s)?$=requestAnimationFrame($t):Ce=false;}function gt(){return Ee||pt(qe())}let Ce=false;function et(){Ce||(Ce=true,$=requestAnimationFrame(function(){$t();}));}function tt(){Ce=false,cancelAnimationFrame($);}let yt=new IntersectionObserver(s=>{s.forEach(l=>{Ee=l.isIntersecting,Ee&&!H?(Me=true,et()):Ce&&!H&&pt(qe())||tt();});},{root:Q??null,threshold:U,rootMargin:Ze});function At(){x.forEach((s,l)=>{w[l]=Fe(s),s.style.strokeDasharray=`${w[l]}`;}),Mt(),Me=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout(At,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let er=at([e],Ge);return ve>0?setTimeout(()=>yt.observe(e),ve):yt.observe(e),mt({destroy(){cancelAnimationFrame($),clearTimeout(xe),tt(),yt.disconnect(),er(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),vt();},replay(){P=-1,be=[],Se=-1,Ke=-1,S=false,b=false,we=0,H=false,me=0,Te.clear(),clearTimeout(xe),Je(),Me=true,gt()&&et();},pause(){H=true,tt();},resume(){H&&(H=false,Me=true,gt()&&et());},seek(s){let l=Math.min(1,Math.max(0,s));me=l,P=l,be=[],H=true,tt(),Yt(l,v),Me=true;},getProgress(){return me},refresh(){clearTimeout(rt),At(),gt()&&!H&&et();}},()=>({tStart:a,tEnd:f}))}function dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function qt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],u=t[2].trim();if(u)for(let i of u.split(/[\s,]+/)){let m=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),c.push(m?m[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function gr(e,n,r){let t=qt(e),o=qt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,u)=>{let i=o[u];return c.fn!==i.fn||c.nums.length!==i.nums.length?r<1?`${c.fn}(${c.nums.map((m,y)=>`${m}${c.units[y]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,y)=>`${m}${i.units[y]}`).join(", ")})`:`${c.fn}(${c.nums.map((m,y)=>`${m+(i.nums[y]-m)*r}${c.units[y]}`).join(", ")})`}).join(" ")}function wt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(dr(t))return _e(t,o,r);if(t.includes("("))return gr(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&u){let i=parseFloat(c[1]),m=parseFloat(u[1]);return `${i+(m-i)*r}${c[2]||u[2]}`}return r<1?t:o}function yr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var hr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),br=0,Gt="--scroll-draw-progress";function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Qt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function He(e,n){return typeof window>"u"?Qt:n.respectReducedMotion===false?Bt(e,n,false):lt(n,(r,t)=>Bt(e,r,t))}function Bt(e,n,r){let{props:t,trigger:o={},easing:c="ease-out",speed:u=1,once:i=false,axis:m="y",scrollContainer:y,native:M=true,velocityScale:L=false,triggerElement:v,onProgress:ae,onComplete:Ve,onEnter:J,onLeave:De,onEnterBack:$e,onLeaveBack:ve}=n,ee=typeof c=="function"?c:Pe[c]??Pe["ease-out"],le=Re(o.start??"top bottom"),ce=Re(o.end??"bottom top"),j=v??e,W=typeof y=="string"?document.querySelector(y):y??null,U=Object.entries(t).map(([a,f])=>({prop:yr(a),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function Ze(){let a=window.getComputedStyle(e);for(let f of U)f.from===""&&(f.from=a.getPropertyValue(f.prop).trim()||"0");}function ge(){for(let a of U)e.style.setProperty(a.prop,String(a.to));}let Ae=new Map;for(let a of [...U.map(f=>f.prop),Gt])Ae.set(a,e.style.getPropertyValue(a));function N(){for(let[a,f]of Ae)f?e.style.setProperty(a,f):e.style.removeProperty(a);}if(r)return ge(),Ve?.(),{...Qt,destroy:N,getProgress:()=>1};Ze();let Oe=typeof c=="string"?ot(c):null;function ct(){if(!M||!wr()||!Oe||m!=="y"||W||j!==e||i||u!==1||ae||Ve||J||De||$e||ve||L!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let a of U)if(!hr.has(a.prop))return false;return true}function ut(){let a=`ssd-a-${++br}`,f=U.map(P=>`${P.prop}:${P.from}`).join(";"),oe=U.map(P=>`${P.prop}:${P.to}`).join(";"),Y=document.createElement("style");Y.setAttribute("data-ssd-animate",""),Y.textContent=`@keyframes ${a}{from{${f}}to{${oe}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(Y),e.classList.add(a);let b=()=>m==="x"?window.scrollX:window.scrollY,S=()=>m==="x"?window.innerWidth:window.innerHeight,$=()=>{let P=e.getBoundingClientRect();return Ne({top:P.top,height:P.height},b(),S(),le,ce)};Qe(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:$});let Ee={refresh(){},destroy(){e.classList.remove(a),Y.remove(),e.style.animationPlayState="",N(),je(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(P){let be=Math.min(1,Math.max(0,P));e.classList.remove(a);for(let Se of U)e.style.setProperty(Se.prop,wt(Se.from,Se.to,be));},getProgress(){let{tStart:P,tEnd:be}=$();return ee(ie(b(),P,be,u))}};return Ee}if(ct())return ut();let te=0,q=0,X=0,re=false,ue=false,ye=-1,he=0,Le=false,F=NaN,ne=-1,We=0,ze=()=>W?m==="x"?W.scrollLeft:W.scrollTop:m==="x"?window.scrollX:window.scrollY,Q=()=>W?m==="x"?W.clientWidth:W.clientHeight:m==="x"?window.innerWidth:window.innerHeight,_=j===e?U:[],C=false;function R(){let a=e.style,f=_.map(S=>a.getPropertyValue(S.prop)),oe=a.transition;_.length&&(a.transition="none"),_.forEach(S=>a.setProperty(S.prop,Ae.get(S.prop)??""));let Y=nt(j,W,m);_.forEach((S,$)=>a.setProperty(S.prop,f[$])),_.length&&(e.offsetWidth,a.transition=oe);let b=Ne(Y,Y.scroll,Q(),le,ce);C&&Math.abs(b.tStart-te)<1&&Math.abs(b.tEnd-q)<1||(C=true,te=b.tStart,q=b.tEnd);}function k(a){e.style.setProperty(Gt,String(a));for(let f of U)e.style.setProperty(f.prop,wt(f.from,f.to,a));ae?.(a);}function z(a){if(isNaN(F)){F=a;return}F<=0&&a>0?J?.():F>0&&a<=0&&ve?.(),F<1&&a>=1?De?.():F>=1&&a<1&&$e?.(),F=a;}function I(){if(!re||ue)return;let a=performance.now(),f=ze(),oe=u;if(L!==false){let S=a-We,$=S>0?Math.abs(f-(ne<0?f:ne))/S:0;oe=u*Math.max(.2,1+$*(typeof L=="number"?L:1)*.04);}ne=f,We=a;let Y=q===te?0:(f-te)/(q-te);z(Y);let b=ee(ie(f,te,q,oe));i&&(ye=Math.max(ye,b),b=ye),he=b,k(b),b>=1&&!Le?(Le=true,Ve?.()):b<1&&!i&&(Le=false),X=requestAnimationFrame(I);}R(),q===te&&de("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let a=ee(ie(ze(),te,q,u));i&&a>0&&(ye=a),he=a,k(a);}let fe=new IntersectionObserver(a=>{a.forEach(f=>{re=f.isIntersecting,re&&!ue?X=requestAnimationFrame(I):cancelAnimationFrame(X);});},{root:W??null}),x;function w(){clearTimeout(x),x=setTimeout(R,150);}window.addEventListener("resize",w),window.addEventListener("orientationchange",w);let G=at([j],w);return fe.observe(e),Qe(e,{type:"animate",getProgress:()=>he,getTrigger:()=>({tStart:te,tEnd:q})}),{destroy(){cancelAnimationFrame(X),fe.disconnect(),window.removeEventListener("resize",w),window.removeEventListener("orientationchange",w),G(),clearTimeout(x),N(),je(e);},replay(){ye=-1,Le=false,he=0,ue=false,k(0);},pause(){ue=true,cancelAnimationFrame(X);},resume(){ue&&(ue=false,re&&(X=requestAnimationFrame(I)));},seek(a){let f=Math.min(1,Math.max(0,a));he=f,ye=f,ue=true,cancelAnimationFrame(X),k(f);},getProgress(){return he},refresh(){R();}}}var jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ut(e,n={}){if(typeof window>"u")return jt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return de("scrollParallax: element not found:",e),jt;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:u,onProgress:i}=n,m=-t*100,y=r.style,M=!!r.ownerSVGElement,L=y.getPropertyValue("transform-box");M&&y.setProperty("transform-box","fill-box");let v=He(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:i});return M?{...v,destroy(){v.destroy(),y.setProperty("transform-box",L);}}:v}function Ye(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var ke={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function fn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e).map(t=>bt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function mn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e);if(r.length===0)return ke;let t=0,o=[];function c(i){return bt(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function pn(e,n){if(typeof window>"u")return ke;let r=Ye(e).map(t=>He(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function dn(e,n){if(typeof window>"u")return ke;let r=Ye(e);if(r.length===0)return ke;let t=0,o=[];function c(i){return He(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function gn(e,n={}){if(typeof window>"u")return ke;let r=Ye(e).map(t=>Ut(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=pn;exports.scrollAnimateSequence=dn;exports.scrollDrawGroup=fn;exports.scrollDrawSequence=mn;exports.scrollParallaxGroup=gn;
@@ -1,6 +1,6 @@
1
1
  import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.mjs';
2
- import { S as ScrollParallaxOptions } from '../index-CMqK0GCT.mjs';
3
- import { S as ScrollAnimateOptions } from '../engine-P8u6OK4m.mjs';
2
+ import { S as ScrollParallaxOptions } from '../index-BY-CNE8c.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-o1VSQ1lX.mjs';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1,6 +1,6 @@
1
1
  import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.js';
2
- import { S as ScrollParallaxOptions } from '../index-DPqPEnO-.js';
3
- import { S as ScrollAnimateOptions } from '../engine-DQyBzZDl.js';
2
+ import { S as ScrollParallaxOptions } from '../index-DqXXiDIk.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-B7UpB4fT.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-MTEGM4RR.mjs';import {a as a$1}from'../chunk-BFX2CSQ3.mjs';import {b}from'../chunk-ENACACPZ.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
1
+ import {b as b$1}from'../chunk-GVBO5GRD.mjs';import {a as a$1}from'../chunk-LTCJVVSC.mjs';import {b}from'../chunk-HX4SP5WN.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
@@ -1 +1 @@
1
- 'use strict';function ke({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),i=Math.sqrt(n),s=0,u=[];for(let l=0;l<r;l++){let p=Math.pow(i,l);u.push(p),s+=p;}let f=[0],c=0;for(let l=0;l<r;l++)c+=u[l]/s,f.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let p=0;p<r;p++)if(l<=f[p+1]){let w=(l-f[p])/(f[p+1]-f[p]);if(p===0)return w*(2-w);let P=1-Math.pow(n,p);return P+(1-P)*(2*w-1)*(2*w-1)}return 1}}function Be({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),i=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-i)*(2*Math.PI)/n)+1}var j={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:ke(),elastic:Be()};function Se(e,t,r){return Math.min(r,Math.max(t,e))}function fe(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function Me(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function Te(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function J(e,t,r,n){return r===t?0:Se((e-t)/(r-t)*n,0,1)}function pe(e,t,r,n,i){let s=Me(e.top,e.height,t,n.element)-Te(n.viewport,r),u=Me(e.top,e.height,t,i.element)-Te(i.viewport,r);return {tStart:s,tEnd:u}}function xe(e,t,r){let n=e.getBoundingClientRect(),i=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:i,scroll:0}:{top:r==="x"?n.left:n.top,height:i,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let 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 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 Pe(e,t,r){let n=Le(e),i=Le(t);return !n||!i?e:`rgb(${Math.round(n[0]+(i[0]-n[0])*r)},${Math.round(n[1]+(i[1]-n[1])*r)},${Math.round(n[2]+(i[2]-n[2])*r)})`}var qe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",je="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Re=33;function Ge(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Xe(e){let t=[];for(let r=0;r<Re;r++){let n=r/(Re-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function $e(e){switch(e){case "linear":return "linear";case "ease-in":return qe;case "ease-out":return je;case "ease-in-out":return Ge()?Xe(j["ease-in-out"]):null;default:return null}}var Ae=Symbol.for("svg-scroll-draw.registry");function Ce(){let e=globalThis;return e[Ae]||(e[Ae]=new Map)}function ge(e,t){Ce().set(e,t);}function de(e){Ce().delete(e);}var Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function G(e,...t){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var X,ee=new Set,te=new WeakMap,U=new Map,Ie=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ye(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>t();X??(X=new ResizeObserver(i=>{let s=false;for(let{target:u}of i)te.get(u)!==Ie(u)&&(s=true),te.set(u,"");s&&ee.forEach(u=>u());})),ee.add(r);let n=Ye(e);return [document.body,document.documentElement].forEach(i=>i&&n.add(i)),n.forEach(i=>{te.has(i)||te.set(i,Ie(i)),U.set(i,(U.get(i)??0)+1),X.observe(i);}),()=>{ee.delete(r)&&(n.forEach(i=>{let s=(U.get(i)??1)-1;if(s)return void U.set(i,s);U.delete(i),X?.unobserve(i);}),ee.size||(X?.disconnect(),X=void 0));}}function Ke(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let i=[],s=[],u=n[2].trim();if(u)for(let f of u.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:n[1],nums:i,units:s});}return t}function Qe(e,t,r){let n=_e(e),i=_e(t);return n.length===0||n.length!==i.length?r<1?e:t:n.map((s,u)=>{let f=i[u];return s.fn!==f.fn||s.nums.length!==f.nums.length?r<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,l)=>`${c}${f.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(f.nums[l]-c)*r}${s.units[l]}`).join(", ")})`}).join(" ")}function He(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),i=String(t);if(Ke(n))return Pe(n,i,r);if(n.includes("("))return Qe(n,i,r);let s=n.match(/^([-+]?[\d.]+)(.*)$/),u=i.match(/^([-+]?[\d.]+)(.*)$/);if(s&&u){let f=parseFloat(s[1]),c=parseFloat(u[1]);return `${f+(c-f)*r}${s[2]||u[2]}`}return r<1?n:i}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,ze="--scroll-draw-progress";function tt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function be(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:i={},easing:s="ease-out",speed:u=1,once:f=false,axis:c="y",scrollContainer:l,native:p=true,velocityScale:w=false,respectReducedMotion:P=true,triggerElement:W,onProgress:I,onComplete:v,onEnter:g,onLeave:D,onEnterBack:T,onLeaveBack:V}=t,k=P&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,_=typeof s=="function"?s:j[s]??j["ease-out"],H=fe(i.start??"top bottom"),Y=fe(i.end??"bottom top"),M=W??e,h=typeof l=="string"?document.querySelector(l):l??null,y=Object.entries(n).map(([o,a])=>({prop:Ze(o),from:Array.isArray(a)?a[0]:"",to:Array.isArray(a)?a[1]:a}));function m(){let o=window.getComputedStyle(e);for(let a of y)a.from===""&&(a.from=o.getPropertyValue(a.prop).trim()||"0");}function d(){for(let o of y)e.style.setProperty(o.prop,String(o.to));}let re=new Map;for(let o of [...y.map(a=>a.prop),ze])re.set(o,e.style.getPropertyValue(o));function oe(){for(let[o,a]of re)a?e.style.setProperty(o,a):e.style.removeProperty(o);}if(k)return d(),v?.(),{...r,destroy:oe,getProgress:()=>1};m();let he=typeof s=="string"?$e(s):null;function Oe(){if(!p||!tt()||!he||c!=="y"||h||M!==e||f||u!==1||I||v||g||D||T||V||w!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let o of y)if(!Je.has(o.prop))return false;return true}function Fe(){let o=`ssd-a-${++et}`,a=y.map(E=>`${E.prop}:${E.from}`).join(";"),O=y.map(E=>`${E.prop}:${E.to}`).join(";"),L=document.createElement("style");L.setAttribute("data-ssd-animate",""),L.textContent=`@keyframes ${o}{from{${a}}to{${O}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${he};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(o);let b=()=>c==="x"?window.scrollX:window.scrollY,S=()=>c==="x"?window.innerWidth:window.innerHeight,F=()=>{let E=e.getBoundingClientRect();return pe({top:E.top,height:E.height},b(),S(),H,Y)};ge(e,{type:"animate",getProgress:()=>le.getProgress(),getTrigger:F});let le={refresh(){},destroy(){e.classList.remove(o),L.remove(),e.style.animationPlayState="",oe(),de(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(E){let ce=Math.min(1,Math.max(0,E));e.classList.remove(o);for(let me of y)e.style.setProperty(me.prop,He(me.from,me.to,ce));},getProgress(){let{tStart:E,tEnd:ce}=F();return _(J(b(),E,ce,u))}};return le}if(Oe())return Fe();let x=0,R=0,$=0,K=false,A=false,z=-1,N=0,Q=false,C=NaN,ie=-1,ye=0,Ee=()=>h?c==="x"?h.scrollLeft:h.scrollTop:c==="x"?window.scrollX:window.scrollY,We=()=>h?c==="x"?h.clientWidth:h.clientHeight:c==="x"?window.innerWidth:window.innerHeight,B=M===e?y:[],we=false;function se(){let o=e.style,a=B.map(S=>o.getPropertyValue(S.prop)),O=o.transition;B.length&&(o.transition="none"),B.forEach(S=>o.setProperty(S.prop,re.get(S.prop)??""));let L=xe(M,h,c);B.forEach((S,F)=>o.setProperty(S.prop,a[F])),B.length&&(e.offsetWidth,o.transition=O);let b=pe(L,L.scroll,We(),H,Y);we&&Math.abs(b.tStart-x)<1&&Math.abs(b.tEnd-R)<1||(we=true,x=b.tStart,R=b.tEnd);}function Z(o){e.style.setProperty(ze,String(o));for(let a of y)e.style.setProperty(a.prop,He(a.from,a.to,o));I?.(o);}function De(o){if(isNaN(C)){C=o;return}C<=0&&o>0?g?.():C>0&&o<=0&&V?.(),C<1&&o>=1?D?.():C>=1&&o<1&&T?.(),C=o;}function ae(){if(!K||A)return;let o=performance.now(),a=Ee(),O=u;if(w!==false){let S=o-ye,F=S>0?Math.abs(a-(ie<0?a:ie))/S:0;O=u*Math.max(.2,1+F*(typeof w=="number"?w:1)*.04);}ie=a,ye=o;let L=R===x?0:(a-x)/(R-x);De(L);let b=_(J(a,x,R,O));f&&(z=Math.max(z,b),b=z),N=b,Z(b),b>=1&&!Q?(Q=true,v?.()):b<1&&!f&&(Q=false),$=requestAnimationFrame(ae);}se(),R===x&&G("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let o=_(J(Ee(),x,R,u));f&&o>0&&(z=o),N=o,Z(o);}let ve=new IntersectionObserver(o=>{o.forEach(a=>{K=a.isIntersecting,K&&!A?$=requestAnimationFrame(ae):cancelAnimationFrame($);});},{root:h??null}),ue;function q(){clearTimeout(ue),ue=setTimeout(se,150);}window.addEventListener("resize",q),window.addEventListener("orientationchange",q);let Ve=ne([M],q);return ve.observe(e),ge(e,{type:"animate",getProgress:()=>N,getTrigger:()=>({tStart:x,tEnd:R})}),{destroy(){cancelAnimationFrame($),ve.disconnect(),window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q),Ve(),clearTimeout(ue),oe(),de(e);},replay(){z=-1,Q=false,N=0,A=false,Z(0);},pause(){A=true,cancelAnimationFrame($);},resume(){A&&(A=false,K&&($=requestAnimationFrame(ae)));},seek(o){let a=Math.min(1,Math.max(0,o));N=a,z=a,A=true,cancelAnimationFrame($),Z(a);},getProgress(){return N},refresh(){se();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function xt(e,t={}){if(typeof window>"u")return Ne;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return G("scrollHorizontal: track element not found:",e),Ne;let n=r,{easing:i="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:u,respectReducedMotion:f=false,onProgress:c}=t,l=typeof u=="string"?document.querySelector(u):u??null;function p(){for(let m=n.parentElement;m;m=m.parentElement)if(window.getComputedStyle(m).position==="sticky")return m;return null}function w(){let m=p();if(m){let d=window.getComputedStyle(m);return m.clientWidth-(parseFloat(d.paddingLeft)||0)-(parseFloat(d.paddingRight)||0)}return l?l.clientWidth:document.documentElement.clientWidth||window.innerWidth}function P(){return t.distance??n.scrollWidth-w()}function W(){if(t.triggerElement!==void 0){let d=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(d)return d;G("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=p();return m?m.parentElement??m:n}let I=P(),v=W(),g=be(n,V(I,v)),D=k(),T=null;function V(m,d){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:s,easing:i,native:false,respectReducedMotion:f,...d!==n&&{triggerElement:d},...u!==void 0&&{scrollContainer:u},...c!==void 0&&{onProgress:c}}}function k(){let m=v.getBoundingClientRect(),d=l?m.top-l.getBoundingClientRect().top+l.scrollTop:m.top+window.scrollY;return `${P()} ${Math.round(d)} ${Math.round(m.height)}`}function _(){g.destroy();let m=W(),d=m!==v;I=P(),v=m,g=be(n,V(I,v)),D=k(),T!==null&&g.seek(T),d&&y();}let H;function Y(){(W()!==v||k()!==D)&&_();}function M(){clearTimeout(H),H=setTimeout(Y,150);}window.addEventListener("resize",M),window.addEventListener("orientationchange",M);let h=()=>{};function y(){h(),h=ne([n,v],M);}return y(),{destroy(){clearTimeout(H),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),h(),g.destroy();},replay(){T=null,g.replay();},pause(){g.pause(),T=g.getProgress();},resume(){T=null,g.resume();},seek(m){g.seek(m),T=g.getProgress();},getProgress(){return g.getProgress()},refresh(){_();}}}exports.scrollHorizontal=xt;
1
+ 'use strict';function Qe({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,a=[];for(let l=0;l<n;l++){let d=Math.pow(o,l);a.push(d),s+=d;}let f=[0],c=0;for(let l=0;l<n;l++)c+=a[l]/s,f.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let d=0;d<n;d++)if(l<=f[d+1]){let E=(l-f[d])/(f[d+1]-f[d]);if(d===0)return E*(2-E);let x=1-Math.pow(r,d);return x+(1-x)*(2*E-1)*(2*E-1)}return 1}}function qe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+1}var q={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Qe(),elastic:qe()};function we(e,t,n){return Math.min(n,Math.max(t,e))}function ce(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}function ve(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function Se(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function J(e,t,n,r){return n===t?0:we((e-t)/(n-t)*r,0,1)}function me(e,t,n,r,o){let s=ve(e.top,e.height,t,r.element)-Se(r.viewport,n),a=ve(e.top,e.height,t,o.element)-Se(o.viewport,n);return {tStart:s,tEnd:a}}function Me(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left+t.scrollLeft:r.top-t.getBoundingClientRect().top+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function Le(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Te(e,t,n){let r=Le(e),o=Le(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var je="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ge="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xe=33;function Xe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ue(e){let t=[];for(let n=0;n<xe;n++){let r=n/(xe-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return je;case "ease-out":return Ge;case "ease-in-out":return Xe()?Ue(q["ease-in-out"]):null;default:return null}}var Re=Symbol.for("svg-scroll-draw.registry");function $e(){let e=globalThis;return e[Re]||(e[Re]=new Map)}function fe(e,t){$e().set(e,t);}function de(e){$e().delete(e);}var Ye=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){Ye&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var G,ee=new Set,te=new WeakMap,X=new Map,Ae=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();G??(G=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)te.get(a)!==Ae(a)&&(s=true),te.set(a,"");s&&ee.forEach(a=>a());})),ee.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{te.has(o)||te.set(o,Ae(o)),X.set(o,(X.get(o)??0)+1),G.observe(o);}),()=>{ee.delete(n)&&(r.forEach(o=>{let s=(X.get(o)??1)-1;if(s)return void X.set(o,s);X.delete(o),G?.unobserve(o);}),ee.size||(G?.disconnect(),G=void 0));}}function Ce(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Ie(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Ce(s=>{if(!s)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...a)=>n[s]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}function Ze(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let f of a.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Je(e,t,n){let r=_e(e),o=_e(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let f=o[a];return s.fn!==f.fn||s.nums.length!==f.nums.length?n<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,l)=>`${c}${f.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(f.nums[l]-c)*n}${s.units[l]}`).join(", ")})`}).join(" ")}function Oe(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Ze(r))return Te(r,o,n);if(r.includes("("))return Je(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let f=parseFloat(s[1]),c=parseFloat(a[1]);return `${f+(c-f)*n}${s[2]||a[2]}`}return n<1?r:o}function et(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var tt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nt=0,He="--scroll-draw-progress";function rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,t){return typeof window>"u"?ze:t.respectReducedMotion===false?ke(e,t,false):Ie(t,(n,r)=>ke(e,n,r))}function ke(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:f=false,axis:c="y",scrollContainer:l,native:d=true,velocityScale:E=false,triggerElement:x,onProgress:_,onComplete:$,onEnter:S,onLeave:b,onEnterBack:F,onLeaveBack:M}=t,O=typeof s=="function"?s:q[s]??q["ease-out"],H=ce(o.start??"top bottom"),D=ce(o.end??"bottom top"),P=x??e,w=typeof l=="string"?document.querySelector(l):l??null,g=Object.entries(r).map(([i,u])=>({prop:et(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function V(){let i=window.getComputedStyle(e);for(let u of g)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function U(){for(let i of g)e.style.setProperty(i.prop,String(i.to));}let m=new Map;for(let i of [...g.map(u=>u.prop),He])m.set(i,e.style.getPropertyValue(i));function p(){for(let[i,u]of m)u?e.style.setProperty(i,u):e.style.removeProperty(i);}if(n)return U(),$?.(),{...ze,destroy:p,getProgress:()=>1};V();let ge=typeof s=="string"?Pe(s):null;function We(){if(!d||!rt()||!ge||c!=="y"||w||P!==e||f||a!==1||_||$||S||b||F||M||E!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let i of g)if(!tt.has(i.prop))return false;return true}function Fe(){let i=`ssd-a-${++nt}`,u=g.map(y=>`${y.prop}:${y.from}`).join(";"),N=g.map(y=>`${y.prop}:${y.to}`).join(";"),T=document.createElement("style");T.setAttribute("data-ssd-animate",""),T.textContent=`@keyframes ${i}{from{${u}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(i);let h=()=>c==="x"?window.scrollX:window.scrollY,v=()=>c==="x"?window.innerWidth:window.innerHeight,W=()=>{let y=e.getBoundingClientRect();return me({top:y.top,height:y.height},h(),v(),H,D)};fe(e,{type:"animate",getProgress:()=>ae.getProgress(),getTrigger:W});let ae={refresh(){},destroy(){e.classList.remove(i),T.remove(),e.style.animationPlayState="",p(),de(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(y){let ue=Math.min(1,Math.max(0,y));e.classList.remove(i);for(let le of g)e.style.setProperty(le.prop,Oe(le.from,le.to,ue));},getProgress(){let{tStart:y,tEnd:ue}=W();return O(J(h(),y,ue,a))}};return ae}if(We())return Fe();let L=0,R=0,A=0,Y=false,C=false,k=-1,z=0,K=false,I=NaN,re=-1,be=0,he=()=>w?c==="x"?w.scrollLeft:w.scrollTop:c==="x"?window.scrollX:window.scrollY,De=()=>w?c==="x"?w.clientWidth:w.clientHeight:c==="x"?window.innerWidth:window.innerHeight,B=P===e?g:[],ye=false;function oe(){let i=e.style,u=B.map(v=>i.getPropertyValue(v.prop)),N=i.transition;B.length&&(i.transition="none"),B.forEach(v=>i.setProperty(v.prop,m.get(v.prop)??""));let T=Me(P,w,c);B.forEach((v,W)=>i.setProperty(v.prop,u[W])),B.length&&(e.offsetWidth,i.transition=N);let h=me(T,T.scroll,De(),H,D);ye&&Math.abs(h.tStart-L)<1&&Math.abs(h.tEnd-R)<1||(ye=true,L=h.tStart,R=h.tEnd);}function Z(i){e.style.setProperty(He,String(i));for(let u of g)e.style.setProperty(u.prop,Oe(u.from,u.to,i));_?.(i);}function Ve(i){if(isNaN(I)){I=i;return}I<=0&&i>0?S?.():I>0&&i<=0&&M?.(),I<1&&i>=1?b?.():I>=1&&i<1&&F?.(),I=i;}function ie(){if(!Y||C)return;let i=performance.now(),u=he(),N=a;if(E!==false){let v=i-be,W=v>0?Math.abs(u-(re<0?u:re))/v:0;N=a*Math.max(.2,1+W*(typeof E=="number"?E:1)*.04);}re=u,be=i;let T=R===L?0:(u-L)/(R-L);Ve(T);let h=O(J(u,L,R,N));f&&(k=Math.max(k,h),h=k),z=h,Z(h),h>=1&&!K?(K=true,$?.()):h<1&&!f&&(K=false),A=requestAnimationFrame(ie);}oe(),R===L&&j("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=O(J(he(),L,R,a));f&&i>0&&(k=i),z=i,Z(i);}let Ee=new IntersectionObserver(i=>{i.forEach(u=>{Y=u.isIntersecting,Y&&!C?A=requestAnimationFrame(ie):cancelAnimationFrame(A);});},{root:w??null}),se;function Q(){clearTimeout(se),se=setTimeout(oe,150);}window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q);let Be=ne([P],Q);return Ee.observe(e),fe(e,{type:"animate",getProgress:()=>z,getTrigger:()=>({tStart:L,tEnd:R})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),Be(),clearTimeout(se),p(),de(e);},replay(){k=-1,K=false,z=0,C=false,Z(0);},pause(){C=true,cancelAnimationFrame(A);},resume(){C&&(C=false,Y&&(A=requestAnimationFrame(ie)));},seek(i){let u=Math.min(1,Math.max(0,i));z=u,k=u,C=true,cancelAnimationFrame(A),Z(u);},getProgress(){return z},refresh(){oe();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function Ct(e,t={}){if(typeof window>"u")return Ne;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollHorizontal: track element not found:",e),Ne;let r=n,{easing:o="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:c}=t,l=typeof a=="string"?document.querySelector(a):a??null;function d(){for(let m=r.parentElement;m;m=m.parentElement)if(window.getComputedStyle(m).position==="sticky")return m;return null}function E(){let m=d();if(m){let p=window.getComputedStyle(m);return m.clientWidth-(parseFloat(p.paddingLeft)||0)-(parseFloat(p.paddingRight)||0)}return l?l.clientWidth:document.documentElement.clientWidth||window.innerWidth}function x(){return t.distance??r.scrollWidth-E()}function _(){if(t.triggerElement!==void 0){let p=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(p)return p;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=d();return m?m.parentElement??m:r}let $=x(),S=_(),b=pe(r,O($,S)),F=H(),M=null;function O(m,p){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:s,easing:o,native:false,respectReducedMotion:f,...p!==r&&{triggerElement:p},...a!==void 0&&{scrollContainer:a},...c!==void 0&&{onProgress:c}}}function H(){let m=S.getBoundingClientRect(),p=l?m.top-l.getBoundingClientRect().top+l.scrollTop:m.top+window.scrollY;return `${x()} ${Math.round(p)} ${Math.round(m.height)}`}function D(){b.destroy();let m=_(),p=m!==S;$=x(),S=m,b=pe(r,O($,S)),F=H(),M!==null&&b.seek(M),p&&U();}let P;function w(){(_()!==S||H()!==F)&&D();}function g(){clearTimeout(P),P=setTimeout(w,150);}window.addEventListener("resize",g),window.addEventListener("orientationchange",g);let V=()=>{};function U(){V(),V=ne([r,S],g);}return U(),{destroy(){clearTimeout(P),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),V(),b.destroy();},replay(){M=null,b.replay();},pause(){b.pause(),M=b.getProgress();},resume(){M=null,b.resume();},seek(m){b.seek(m),M=b.getProgress();},getProgress(){return b.getProgress()},refresh(){D();}}}exports.scrollHorizontal=Ct;
@@ -35,7 +35,8 @@ interface ScrollHorizontalOptions {
35
35
  triggerElement?: string | Element;
36
36
  /**
37
37
  * Honour `prefers-reduced-motion: reduce` by holding the track at its final
38
- * position instead of scrubbing. Default: **`false`** — unlike every other
38
+ * position instead of scrubbing, also when the reader turns it on while the
39
+ * page is open. Default: **`false`** — unlike every other
39
40
  * API here, which defaults to `true`.
40
41
  *
41
42
  * The reasoning: this transform is scroll-linked scrubbing, not autonomous
@@ -35,7 +35,8 @@ interface ScrollHorizontalOptions {
35
35
  triggerElement?: string | Element;
36
36
  /**
37
37
  * Honour `prefers-reduced-motion: reduce` by holding the track at its final
38
- * position instead of scrubbing. Default: **`false`** — unlike every other
38
+ * position instead of scrubbing, also when the reader turns it on while the
39
+ * page is open. Default: **`false`** — unlike every other
39
40
  * API here, which defaults to `true`.
40
41
  *
41
42
  * The reasoning: this transform is scroll-linked scrubbing, not autonomous
@@ -1 +1 @@
1
- import {a}from'../chunk-BFX2CSQ3.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
1
+ import {a}from'../chunk-LTCJVVSC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
@@ -1,5 +1,5 @@
1
1
  import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.mjs';
2
- import { S as ScrollAnimateOptions } from './engine-P8u6OK4m.mjs';
2
+ import { S as ScrollAnimateOptions } from './engine-o1VSQ1lX.mjs';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
@@ -1,5 +1,5 @@
1
1
  import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.js';
2
- import { S as ScrollAnimateOptions } from './engine-DQyBzZDl.js';
2
+ import { S as ScrollAnimateOptions } from './engine-B7UpB4fT.js';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';function tr({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function kt({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),a=0,u=[];for(let f=0;f<t;f++){let A=Math.pow(s,f);u.push(A),a+=A;}let m=[0],c=0;for(let f=0;f<t;f++)c+=u[f]/a,m.push(c);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let A=0;A<t;A++)if(f<=m[A+1]){let M=(f-m[A])/(m[A+1]-m[A]);if(A===0)return M*(2-M);let v=1-Math.pow(n,A);return v+(1-v)*(2*M-1)*(2*M-1)}return 1}}function Ct({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 a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-s)*(2*Math.PI)/n)+1}var ne={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:kt(),elastic:Ct()};function Dt(e,r,t){return Math.min(t,Math.max(r,e))}function ke(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}}function It(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function Ot(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function pe(e,r,t,n){return t===r?0:Dt((e-r)/(t-r)*n,0,1)}function Fe(e,r,t,n,s){let a=It(e.top,e.height,r,n.element)-Ot(n.viewport,t),u=It(e.top,e.height,r,s.element)-Ot(s.viewport,t);return {tStart:a,tEnd:u}}function nt(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.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function Be(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function Rt(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 Ge(e,r,t){let n=Rt(e),s=Rt(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 gt={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 Xe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function Q(e,...r){Xe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var rr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",nr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ft=33;function or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function sr(e){let r=[];for(let t=0;t<Ft;t++){let n=t/(Ft-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function ot(e){switch(e){case "linear":return "linear";case "ease-in":return rr;case "ease-out":return nr;case "ease-in-out":return or()?sr(ne["ease-in-out"]):null;default:return null}}var Nt=Symbol.for("svg-scroll-draw.registry");function Ht(){let e=globalThis;return e[Nt]||(e[Nt]=new Map)}function Ce(e,r){Ht().set(e,r);}function De(e){Ht().delete(e);}var Qe,st=new Set,it=new WeakMap,Ze=new Map,_t=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function ir(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 je(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Qe??(Qe=new ResizeObserver(s=>{let a=false;for(let{target:u}of s)it.get(u)!==_t(u)&&(a=true),it.set(u,"");a&&st.forEach(u=>u());})),st.add(t);let n=ir(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{it.has(s)||it.set(s,_t(s)),Ze.set(s,(Ze.get(s)??0)+1),Qe.observe(s);}),()=>{st.delete(t)&&(n.forEach(s=>{let a=(Ze.get(s)??1)-1;if(a)return void Ze.set(s,a);Ze.delete(s),Qe?.unobserve(s);}),st.size||(Qe?.disconnect(),Qe=void 0));}}var ar=0;function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Vt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var zt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function cr(e){if(!Xe)return;let r=Vt(e,"stroke");if(!r||r==="none"){Q("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!zt.has(t)&&!zt.has(Vt(e,"fill"))&&Q("Element has a fill \u2014 it may obscure the stroke animation.",e);}function ur(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 a=t==="x"?window.scrollX:window.scrollY,u=e-a,m=r-a,c=t==="x";n.innerHTML=`
2
- <div style="position:absolute;${c?`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;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function mr(e,r,t){if(!Xe)return;let n=(e.match(qt)??[]).join("").toUpperCase(),s=(r.match(qt)??[]).join("").toUpperCase(),a=(e.match(Wt)??[]).length,u=(r.match(Wt)??[]).length;if(n!==s){Q(`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}a!==u&&Q(`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.`,t);}function yt(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let u=parseFloat(a),m=n[s++]??u;return String(+(u+(m-u)*t).toFixed(4))})}function Bt(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:t,...n}=r,s=t?{...gt[t],...n}:n,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:u="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:f="linear",trigger:A={},stagger:M=0,direction:v="forward",once:oe=false,debug:Te=false,axis:E="y",scrollContainer:$,autoReverse:d=false,delay:S=0,strokeColor:x,strokeWidth:I,fillOpacity:Z,waypoints:q,velocityScale:se=false,threshold:le=0,rootMargin:G="0px",repeat:O=0,repeatDelay:Ne=0,morphTo:j,clip:ye,autoplay:Ae=false,duration:He=1e3,native:_e=true,onProgress:de,onStart:K,onComplete:p,onEnter:R,onLeave:Ve,onEnterBack:Ee,onLeaveBack:Me}=s,ie=ye===true?"left":typeof ye=="string"?ye:false,he=typeof f=="function"?f:ne[f]??ne.linear,Se=ke(A.start??"top bottom"),ze=ke(A.end??"bottom top"),ce=typeof $=="string"?document.querySelector($):$??null,ge=Array.isArray(x)?x[0]:null,J=Array.isArray(x)?x[1]:typeof x=="string"?x:null,_=Array.isArray(I)?I[0]:null,Y=Array.isArray(I)?I[1]:typeof I=="number"?I:null,U=Array.isArray(Z)?Z[0]:null,V=Array.isArray(Z)?Z[1]:typeof Z=="number"?Z:null;function $e(o){let i=o*100;switch(ie){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let k=ie?[]:Array.from(e.querySelectorAll(u)),P=[],ee=[],B=0,ue=0,l=M,h=0,C=false,F=false,T=0,te=false,ae=-1,Pe=[],X=-1,N=false,me=0,Le=0,Ie,ct=null;function Et(){ct?.destroy(),ct=null;}let Oe=new Set,St=NaN,Re=true,Ke=-1,xt=performance.now(),We=NaN;function Ye(){return ce?E==="x"?ce.scrollLeft:ce.scrollTop:E==="x"?window.scrollX:window.scrollY}function Tt(){return ce?E==="x"?ce.clientWidth:ce.clientHeight:E==="x"?window.innerWidth:window.innerHeight}function At(){let o=nt(e,ce,E);return Fe(o,o.scroll,Tt(),Se,ze)}function Xt(){let o=ue-B,i=k.length-1,y=ce??document.documentElement,z=E==="x"?"Width":"Height";if(l=M,M>0&&i>0&&o>0){let be=y[`scroll${z}`]-y[`client${z}`]-1-B-o/m;be>=0&&(l=Math.min(M,be/(i*o)));}h=ue+i*l*o;}function Mt(){(({tStart:B,tEnd:ue}=At())),Xt(),Te&&Xe&&(Et(),ct=ur(B,ue,E));}function ut(o,i=At){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:i});let y=o.destroy;return o.destroy=()=>{y.call(o),De(e);},o}function Qt(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),ie){let y=i==="reverse"?1-o:o;e.style.clipPath=$e(y);return}k.forEach((y,z)=>{y.style.strokeDashoffset=i==="reverse"?`${P[z]*o}`:`${P[z]*(1-o)}`,c&&(y.style.opacity=i==="reverse"?`${1-o}`:`${o}`),ge&&J?y.style.stroke=Ge(ge,J,o):J&&(y.style.stroke=J),_!==null&&Y!==null?y.style.strokeWidth=`${_+(Y-_)*o}`:Y!==null&&(y.style.strokeWidth=`${Y}`),U!==null&&V!==null?y.style.fillOpacity=`${U+(V-U)*o}`:V!==null&&(y.style.fillOpacity=`${V}`),j&&y.tagName.toLowerCase()==="path"&&ee[z]&&y.setAttribute("d",yt(ee[z],j,o));});}function Je(){if(e.style.setProperty("--scroll-draw-progress","0"),ie){e.style.clipPath=$e(0);return}k.forEach((o,i)=>{o.style.strokeDasharray=`${P[i]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${P[i]}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`),j&&o.tagName.toLowerCase()==="path"&&ee[i]&&o.setAttribute("d",ee[i]);});}if(k.forEach(o=>{cr(o);let i=Be(o);P.push(i);let y=o.tagName.toLowerCase()==="path";y?ee.push(o.getAttribute("d")??""):ee.push(""),j&&(y?mr(ee[ee.length-1],j,o):Q(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),a?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=v==="reverse"?`${i}`:"0",c&&(o.style.opacity="1"),J&&(o.style.stroke=J),Y!==null&&(o.style.strokeWidth=`${Y}`),V!==null&&(o.style.fillOpacity=`${V}`),j&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",j)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=v==="reverse"?"0":`${i}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`));}),ie){if(a)return e.style.clipPath=$e(1),p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=$e(0);}else if(a)return p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let $t=typeof f=="string"?ot(f):null;function Zt(){return !(_e===false||!lr()||!k.length||!$t||ie||E!=="y"||ce||m!==1||M!==0||oe||d||se!==false||j||q||O||S>0||de||K||p||R||Ve||Ee||Me||x!=null||I!=null||Z!=null||(A.start??"top bottom").trim()!=="top bottom"||(A.end??"bottom top").trim()!=="bottom top")}function Kt(){let o=++ar,i=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,z=`--svg-scroll-draw-${o}`,be=v==="reverse"?"0":"var(--ssd-len)",xe=v==="reverse"?"var(--ssd-len)":"0",ve=`stroke-dashoffset:${be};`,w=`stroke-dashoffset:${xe};`;c&&(ve+=`opacity:${v==="reverse"?1:0};`,w+=`opacity:${v==="reverse"?0:1};`);let L=document.createElement("style");L.setAttribute("data-svg-scroll-draw",""),L.textContent=`@keyframes ${i}{from{${ve}}to{${w}}}.${y}{view-timeline-name:${z};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${z};animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(y);function re(g,W){g.style.setProperty("--ssd-len",String(P[W])),g.style.strokeDasharray=`${P[W]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(i);}k.forEach(re);let b=false,D=-1;function H(){if(D>=0)return D;let g=e.getBoundingClientRect(),{tStart:W,tEnd:we}=Fe({top:g.top,height:g.height},Ye(),Tt(),Se,ze);return he(pe(Ye(),W,we,m))}return {destroy(){e.classList.remove(y),k.forEach(g=>{g.classList.remove(i),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),L.remove();},replay(){b=false,D=-1,k.forEach(re);},pause(){b=true,k.forEach(g=>{g.style.animationPlayState="paused";});},resume(){b&&(b=false,k.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let W=Math.min(1,Math.max(0,g));D=W,b=true,k.forEach((we,fe)=>{we.classList.remove(i),we.style.strokeDashoffset=v==="reverse"?`${P[fe]*W}`:`${P[fe]*(1-W)}`,c&&(we.style.opacity=v==="reverse"?`${1-W}`:`${W}`);});},getProgress(){return H()},refresh(){k.forEach((g,W)=>{P[W]=Be(g),g.style.setProperty("--ssd-len",String(P[W])),g.style.strokeDasharray=`${P[W]}`;});}}}if(Zt())return ut(Kt());function Jt(){let o=Math.max(1,He),i=0,y=0,z=false;function be(b){let D=true;if(ie){let H=Math.min(1,Math.max(0,b/o)),g=he(H);me=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=$e(v==="reverse"?1-g:g),de?.(g),H<1&&(D=false);}else k.forEach((H,g)=>{let W=g*M*o,we=Math.min(1,Math.max(0,(b-W)/o)),fe=he(we);H.style.strokeDashoffset=v==="reverse"?`${P[g]*fe}`:`${P[g]*(1-fe)}`,c&&(H.style.opacity=v==="reverse"?`${1-fe}`:`${fe}`),ge&&J?H.style.stroke=Ge(ge,J,fe):J&&(H.style.stroke=J),_!==null&&Y!==null?H.style.strokeWidth=`${_+(Y-_)*fe}`:Y!==null&&(H.style.strokeWidth=`${Y}`),U!==null&&V!==null?H.style.fillOpacity=`${U+(V-U)*fe}`:V!==null&&(H.style.fillOpacity=`${V}`),j&&H.tagName.toLowerCase()==="path"&&ee[g]&&H.setAttribute("d",yt(ee[g],j,fe)),g===0&&(me=fe,de?.(fe),e.style.setProperty("--scroll-draw-progress",String(fe))),we<1&&(D=false);});if(q){let H=Math.min(1,Math.max(0,b/o)),g=he(H);for(let W in q){let we=parseFloat(W);g>=we&&!Oe.has(we)&&(Oe.add(we),q[W]?.());}}return D}function xe(b){if(N)return;let D=b-i;F||(F=true,K?.());let H=be(D);if(H&&!C){C=true,be(o*(1+Math.max(0,k.length-1)*M)),p?.(),Le<(O==="infinite"?1/0:O??0)&&(Le++,Ie=setTimeout(()=>{i=performance.now(),F=false,C=false,Oe.clear(),Je(),T=requestAnimationFrame(xe);},Ne));return}H||(T=requestAnimationFrame(xe));}function ve(){cancelAnimationFrame(T),clearTimeout(Ie),i=performance.now(),y=0,N=false,F=false,C=false,Le=0,z=true,me=0,Oe.clear(),Je(),T=requestAnimationFrame(xe);}let w=new IntersectionObserver(b=>{b.forEach(D=>{D.isIntersecting&&!(oe&&C)?ve():!D.isIntersecting&&!oe&&!C&&(cancelAnimationFrame(T),clearTimeout(Ie),z=false);});},{root:ce??null,threshold:le,rootMargin:G}),L;function re(){clearTimeout(L),L=setTimeout(()=>{k.forEach((b,D)=>{P[D]=Be(b),b.style.strokeDasharray=`${P[D]}`;});},150);}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),S>0?setTimeout(()=>w.observe(e),S):w.observe(e),{destroy(){cancelAnimationFrame(T),clearTimeout(Ie),w.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(L);},replay(){Le=0,ve();},pause(){N||!z||(N=true,y=performance.now()-i,cancelAnimationFrame(T));},resume(){N&&(N=false,z=true,i=performance.now()-y,T=requestAnimationFrame(xe));},seek(b){let D=Math.min(1,Math.max(0,b));me=D,N=true,y=D*o,i=performance.now()-y,cancelAnimationFrame(T),be(y);},getProgress(){return me},refresh(){clearTimeout(L),k.forEach((b,D)=>{P[D]=Be(b),b.style.strokeDasharray=`${P[D]}`;});}}}if(Ae)return ut(Jt());Mt();function Pt(){if(N||!qe)return;let o=performance.now(),i=Ye();if(!Re&&se===false&&i===St){ft(i);return}Re=false,St=i;let y=m;if(se!==false){let w=o-xt,L=w>0?Math.abs(i-(Ke<0?i:Ke))/w:0;y=m*Math.max(.2,1+L*(typeof se=="number"?se:1)*.04);}Ke=i,xt=o;let z=d?X===-1||i>=X?"forward":"reverse":v;X=i;let be=ue-B,xe=true,ve=be===0?0:(i-B)/be;if(isNaN(We)||(We<=0&&ve>0?R?.():We>0&&ve<=0&&Me?.(),We<1&&ve>=1?Ve?.():We>=1&&ve<1&&Ee?.()),We=ve,ie){let w=he(pe(i,B,ue,y));oe&&!d&&(ae=Math.max(ae,w),w=ae),me=w,e.style.setProperty("--scroll-draw-progress",String(w));let L=z==="reverse"?1-w:w;e.style.clipPath=$e(L),de?.(w),!F&&pe(i,B,ue,y)>0&&(F=true,K?.()),w>=1&&!C?(C=true,p?.(),Le<(O==="infinite"?1/0:O??0)&&(Le++,Ie=setTimeout(()=>{ae=-1,F=false,C=false,e.style.clipPath=$e(0);},Ne))):w<1&&!oe&&(C=false),ft(i);return}if(k.forEach((w,L)=>{let re=L*l*be,b=he(pe(i,B+re,ue+re,y));oe&&!d&&(b=Pe[L]=Math.max(Pe[L]??ae,b)),w.style.strokeDashoffset=z==="reverse"?`${P[L]*b}`:`${P[L]*(1-b)}`,c&&(w.style.opacity=z==="reverse"?`${1-b}`:`${b}`),ge&&J?w.style.stroke=Ge(ge,J,b):J&&(w.style.stroke=J),_!==null&&Y!==null?w.style.strokeWidth=`${_+(Y-_)*b}`:Y!==null&&(w.style.strokeWidth=`${Y}`),U!==null&&V!==null?w.style.fillOpacity=`${U+(V-U)*b}`:V!==null&&(w.style.fillOpacity=`${V}`),j&&w.tagName.toLowerCase()==="path"&&ee[L]&&w.setAttribute("d",yt(ee[L],j,b)),L===0&&(me=b,de?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(xe=false);}),q){let w=he(pe(i,B,ue,y));for(let L in q){let re=parseFloat(L);w>=re&&!Oe.has(re)&&(Oe.add(re),q[L]?.());}}!F&&pe(i,B,ue,y)>0&&(F=true,K?.()),xe&&!C?(C=true,p?.(),Le<(O==="infinite"?1/0:O??0)&&(Le++,Ie=setTimeout(()=>{ae=-1,Pe=[],F=false,C=false,Oe.clear(),Je(),Re=true;},Ne))):!xe&&!oe&&(C=false),ft(i);}function mt(o){return o>=ue&&o<h}function ft(o){te||mt(o)?T=requestAnimationFrame(Pt):qe=false;}function pt(){return te||mt(Ye())}let qe=false;function et(){qe||(qe=true,T=requestAnimationFrame(function(){Pt();}));}function tt(){qe=false,cancelAnimationFrame(T);}let dt=new IntersectionObserver(o=>{o.forEach(i=>{te=i.isIntersecting,te&&!N?(Re=true,et()):qe&&!N&&mt(Ye())||tt();});},{root:ce??null,threshold:le,rootMargin:G});function Lt(){k.forEach((o,i)=>{P[i]=Be(o),o.style.strokeDasharray=`${P[i]}`;}),Mt(),Re=true;}let rt;function Ue(){clearTimeout(rt),rt=setTimeout(Lt,150);}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let er=je([e],Ue);return S>0?setTimeout(()=>dt.observe(e),S):dt.observe(e),ut({destroy(){cancelAnimationFrame(T),clearTimeout(Ie),tt(),dt.disconnect(),er(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(rt),Et();},replay(){ae=-1,Pe=[],X=-1,Ke=-1,F=false,C=false,Le=0,N=false,me=0,Oe.clear(),clearTimeout(Ie),Je(),Re=true,pt()&&et();},pause(){N=true,tt();},resume(){N&&(N=false,Re=true,pt()&&et());},seek(o){let i=Math.min(1,Math.max(0,o));me=i,ae=i,Pe=[],N=true,tt(),Qt(i,v),Re=true;},getProgress(){return me},refresh(){clearTimeout(rt),Lt(),pt()&&!N&&et();}},()=>({tStart:B,tEnd:ue}))}function fr(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?Bt(n,r):(Q("Container not found:",e),t)}function pr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Gt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],a=[],u=n[2].trim();if(u)for(let m of u.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(c?parseFloat(c[1]):0),a.push(c?c[2]:"");}r.push({fn:n[1],nums:s,units:a});}return r}function dr(e,r,t){let n=Gt(e),s=Gt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((a,u)=>{let m=s[u];return a.fn!==m.fn||a.nums.length!==m.nums.length?t<1?`${a.fn}(${a.nums.map((c,f)=>`${c}${a.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${a.fn}(${a.nums.map((c,f)=>`${c+(m.nums[f]-c)*t}${a.units[f]}`).join(", ")})`}).join(" ")}function jt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(pr(n))return Ge(n,s,t);if(n.includes("("))return dr(n,s,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),u=s.match(/^([-+]?[\d.]+)(.*)$/);if(a&&u){let m=parseFloat(a[1]),c=parseFloat(u[1]);return `${m+(c-m)*t}${a[2]||u[2]}`}return t<1?n:s}function gr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var yr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),hr=0,Yt="--scroll-draw-progress";function br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ht(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:n,trigger:s={},easing:a="ease-out",speed:u=1,once:m=false,axis:c="y",scrollContainer:f,native:A=true,velocityScale:M=false,respectReducedMotion:v=true,triggerElement:oe,onProgress:Te,onComplete:E,onEnter:$,onLeave:d,onEnterBack:S,onLeaveBack:x}=r,I=v&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Z=typeof a=="function"?a:ne[a]??ne["ease-out"],q=ke(s.start??"top bottom"),se=ke(s.end??"bottom top"),le=oe??e,G=typeof f=="string"?document.querySelector(f):f??null,O=Object.entries(n).map(([l,h])=>({prop:gr(l),from:Array.isArray(h)?h[0]:"",to:Array.isArray(h)?h[1]:h}));function Ne(){let l=window.getComputedStyle(e);for(let h of O)h.from===""&&(h.from=l.getPropertyValue(h.prop).trim()||"0");}function j(){for(let l of O)e.style.setProperty(l.prop,String(l.to));}let ye=new Map;for(let l of [...O.map(h=>h.prop),Yt])ye.set(l,e.style.getPropertyValue(l));function Ae(){for(let[l,h]of ye)h?e.style.setProperty(l,h):e.style.removeProperty(l);}if(I)return j(),E?.(),{...t,destroy:Ae,getProgress:()=>1};Ne();let He=typeof a=="string"?ot(a):null;function _e(){if(!A||!br()||!He||c!=="y"||G||le!==e||m||u!==1||Te||E||$||d||S||x||M!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let l of O)if(!yr.has(l.prop))return false;return true}function de(){let l=`ssd-a-${++hr}`,h=O.map(X=>`${X.prop}:${X.from}`).join(";"),C=O.map(X=>`${X.prop}:${X.to}`).join(";"),F=document.createElement("style");F.setAttribute("data-ssd-animate",""),F.textContent=`@keyframes ${l}{from{${h}}to{${C}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${He};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(l);let T=()=>c==="x"?window.scrollX:window.scrollY,te=()=>c==="x"?window.innerWidth:window.innerHeight,ae=()=>{let X=e.getBoundingClientRect();return Fe({top:X.top,height:X.height},T(),te(),q,se)};Ce(e,{type:"animate",getProgress:()=>Pe.getProgress(),getTrigger:ae});let Pe={refresh(){},destroy(){e.classList.remove(l),F.remove(),e.style.animationPlayState="",Ae(),De(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(X){let N=Math.min(1,Math.max(0,X));e.classList.remove(l);for(let me of O)e.style.setProperty(me.prop,jt(me.from,me.to,N));},getProgress(){let{tStart:X,tEnd:N}=ae();return Z(pe(T(),X,N,u))}};return Pe}if(_e())return de();let K=0,p=0,R=0,Ve=false,Ee=false,Me=-1,ie=0,he=false,Se=NaN,ze=-1,ce=0,ge=()=>G?c==="x"?G.scrollLeft:G.scrollTop:c==="x"?window.scrollX:window.scrollY,J=()=>G?c==="x"?G.clientWidth:G.clientHeight:c==="x"?window.innerWidth:window.innerHeight,_=le===e?O:[],Y=false;function U(){let l=e.style,h=_.map(te=>l.getPropertyValue(te.prop)),C=l.transition;_.length&&(l.transition="none"),_.forEach(te=>l.setProperty(te.prop,ye.get(te.prop)??""));let F=nt(le,G,c);_.forEach((te,ae)=>l.setProperty(te.prop,h[ae])),_.length&&(e.offsetWidth,l.transition=C);let T=Fe(F,F.scroll,J(),q,se);Y&&Math.abs(T.tStart-K)<1&&Math.abs(T.tEnd-p)<1||(Y=true,K=T.tStart,p=T.tEnd);}function V(l){e.style.setProperty(Yt,String(l));for(let h of O)e.style.setProperty(h.prop,jt(h.from,h.to,l));Te?.(l);}function $e(l){if(isNaN(Se)){Se=l;return}Se<=0&&l>0?$?.():Se>0&&l<=0&&x?.(),Se<1&&l>=1?d?.():Se>=1&&l<1&&S?.(),Se=l;}function k(){if(!Ve||Ee)return;let l=performance.now(),h=ge(),C=u;if(M!==false){let te=l-ce,ae=te>0?Math.abs(h-(ze<0?h:ze))/te:0;C=u*Math.max(.2,1+ae*(typeof M=="number"?M:1)*.04);}ze=h,ce=l;let F=p===K?0:(h-K)/(p-K);$e(F);let T=Z(pe(h,K,p,C));m&&(Me=Math.max(Me,T),T=Me),ie=T,V(T),T>=1&&!he?(he=true,E?.()):T<1&&!m&&(he=false),R=requestAnimationFrame(k);}U(),p===K&&Q("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=Z(pe(ge(),K,p,u));m&&l>0&&(Me=l),ie=l,V(l);}let P=new IntersectionObserver(l=>{l.forEach(h=>{Ve=h.isIntersecting,Ve&&!Ee?R=requestAnimationFrame(k):cancelAnimationFrame(R);});},{root:G??null}),ee;function B(){clearTimeout(ee),ee=setTimeout(U,150);}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let ue=je([le],B);return P.observe(e),Ce(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:K,tEnd:p})}),{destroy(){cancelAnimationFrame(R),P.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),ue(),clearTimeout(ee),Ae(),De(e);},replay(){Me=-1,he=false,ie=0,Ee=false,V(0);},pause(){Ee=true,cancelAnimationFrame(R);},resume(){Ee&&(Ee=false,Ve&&(R=requestAnimationFrame(k)));},seek(l){let h=Math.min(1,Math.max(0,l));ie=h,Me=h,Ee=true,cancelAnimationFrame(R),V(h);},getProgress(){return ie},refresh(){U();}}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wr(e,r){if(typeof window>"u")return at;let t=typeof e=="string"?document.querySelector(e):e;return t?ht(t,r):(Q("scrollAnimate: element not found:",e),at)}function vr(e,r={}){if(typeof window>"u")return at;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return Q("scrollParallax: element not found:",e),at;let{speed:n=.3,axis:s="y",easing:a="linear",trigger:u,onProgress:m}=r,c=-n*100,f=t.style,A=!!t.ownerSVGElement,M=f.getPropertyValue("transform-box");A&&f.setProperty("transform-box","fill-box");let v=ht(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${c}%)`]}:{transform:["translateY(0%)",`translateY(${c}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:m});return A?{...v,destroy(){v.destroy(),f.setProperty("transform-box",M);}}:v}var bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Er(e,r){if(typeof window>"u")return bt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return Q("scrollCounter: element not found:",e),bt;let n=t,{from:s=0,to:a,format:u,easing:m="ease-out",trigger:c={},once:f=true,decimals:A,onComplete:M}=r,v=A!==void 0?p=>p.toFixed(A):u??(p=>String(Math.round(p))),oe=typeof m=="function"?m:ne[m]??ne["ease-out"],Te=ke(c.start??"top 80%"),E=ke(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=v(a),M?.(),bt;let d=0,S=0,x=false,I=0,Z=false,q=false,se=-1,le=0,G=false,O=()=>window.scrollY,Ne=()=>window.innerHeight;function j(){let p=n.getBoundingClientRect(),R=Fe({top:p.top,height:p.height},O(),Ne(),Te,E);x&&Math.abs(R.tStart-d)<1&&Math.abs(R.tEnd-S)<1||(x=true,d=R.tStart,S=R.tEnd);}function ye(p){n.textContent=v(s+(a-s)*p),n.style.setProperty("--scroll-draw-progress",String(p));}function Ae(){if(!Z||q)return;let p=oe(pe(O(),d,S,1));f&&(se=Math.max(se,p),p=se),le=p,ye(p),p>=1&&!G?(G=true,M?.()):p<1&&!f&&(G=false),I=requestAnimationFrame(Ae);}j();{let p=oe(pe(O(),d,S,1));f&&p>0&&(se=p),le=p,ye(p);}let He=new IntersectionObserver(p=>{p.forEach(R=>{Z=R.isIntersecting,Z&&!q?I=requestAnimationFrame(Ae):cancelAnimationFrame(I);});}),_e;function de(){clearTimeout(_e),_e=setTimeout(j,150);}window.addEventListener("resize",de),window.addEventListener("orientationchange",de);let K=je([n],de);return He.observe(n),Ce(n,{type:"counter",getProgress:()=>le,getTrigger:()=>({tStart:d,tEnd:S})}),{destroy(){cancelAnimationFrame(I),He.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),K(),clearTimeout(_e),De(n);},replay(){se=-1,G=false,le=0,q=false,ye(0);},pause(){q=true,cancelAnimationFrame(I);},resume(){q&&(q=false,Z&&(I=requestAnimationFrame(Ae)));},seek(p){let R=Math.min(1,Math.max(0,p));le=R,se=R,q=true,cancelAnimationFrame(I),ye(R);},getProgress(){return le}}}var Ut="http://www.w3.org/2000/svg",Sr="cinematic-photo",wt=e=>e<0?0:e>1?1:e;function lt(e){let r=parseFloat(e);return Number.isFinite(r)?wt(r/100):0}function xr(e){return ne[e]??ne.linear}var Tr={destroy:()=>{},getProgress:()=>0},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||Q("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return Tr;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 E of r.scenes){if(E.background){let d=document.createElement("img");d.id=Sr,d.src=E.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d);}let $=E.animations.filter(d=>d.type==="draw");if($.length){let d=document.createElementNS(Ut,"svg");d.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let S of $){let x=document.createElementNS(Ut,"path");x.id=S.target.replace(/^#/,""),x.setAttribute("d",S.d),x.setAttribute("fill","none"),x.setAttribute("stroke",S.stroke),x.setAttribute("stroke-width",String(S.strokeWidth)),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round");let I=S.length||x.getTotalLength?.()||0;x.style.strokeDasharray=String(I),x.style.strokeDashoffset=String(I),d.appendChild(x),s.push({kind:"draw",el:x,start:lt(S.start),end:lt(S.end),ease:xr(S.easing),length:I});}}for(let d of E.animations){if(d.type!=="fade")continue;let S=n.querySelector(d.target)??document.querySelector(d.target);S&&(S.style.opacity=String(d.from),s.push({kind:"fade",el:S,start:lt(d.start),end:lt(d.end),ease:ne["ease-in-out"]??ne.linear,from:d.from,to:d.to}));}}let a=0,u=()=>{let E=t.offsetHeight-window.innerHeight;return E<=0?t.getBoundingClientRect().top<=0?1:0:wt(-t.getBoundingClientRect().top/E)},m=E=>{for(let $ of s){let d=$.end-$.start,S=d<=0?E>=$.end?1:0:wt((E-$.start)/d),x=$.ease(S);$.kind==="draw"?$.el.style.strokeDashoffset=String($.length*(1-x)):$.el.style.opacity=String($.from+($.to-$.from)*x);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=false,A=false,M=()=>{a=u(),m(a),f&&(c=requestAnimationFrame(M));},v=()=>{f||(f=true,c=requestAnimationFrame(M));},oe=()=>{f=false,cancelAnimationFrame(c);},Te=new IntersectionObserver(E=>{for(let $ of E)A=$.isIntersecting,A?v():oe();},{threshold:0});return Te.observe(n),a=u(),m(a),Ce(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let E=t.getBoundingClientRect().top+window.scrollY;return {tStart:E,tEnd:E+Math.max(0,t.offsetHeight-window.innerHeight)}}}),{destroy(){oe(),Te.disconnect(),De(t);},getProgress:()=>a}}};
4
- exports.Cinematic=vt;exports.PRESETS=gt;exports.createBounce=kt;exports.createElastic=Ct;exports.createSpring=tr;exports.scrollAnimate=wr;exports.scrollCounter=Er;exports.scrollDraw=fr;exports.scrollParallax=vr;
1
+ 'use strict';function sr({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),a=0,c=[];for(let d=0;d<t;d++){let L=Math.pow(s,d);c.push(L),a+=L;}let f=[0],u=0;for(let d=0;d<t;d++)u+=c[d]/a,f.push(u);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let L=0;L<t;L++)if(d<=f[L+1]){let P=(d-f[L])/(f[L+1]-f[L]);if(L===0)return P*(2-P);let S=1-Math.pow(n,L);return S+(1-S)*(2*P-1)*(2*P-1)}return 1}}function It({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 a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-s)*(2*Math.PI)/n)+1}var te={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Dt(),elastic:It()};function Ot(e,r,t){return Math.min(t,Math.max(r,e))}function $e(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}}function Rt(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function Ft(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function se(e,r,t,n){return t===r?0:Ot((e-r)/(t-r)*n,0,1)}function Fe(e,r,t,n,s){let a=Rt(e.top,e.height,r,n.element)-Ft(n.viewport,t),c=Rt(e.top,e.height,r,s.element)-Ft(s.viewport,t);return {tStart:a,tEnd:c}}function ot(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.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function We(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function Nt(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 qe(e,r,t){let n=Nt(e),s=Nt(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 Xe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function Y(e,...r){Xe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var ir="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",ar="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ht=33;function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function cr(e){let r=[];for(let t=0;t<Ht;t++){let n=t/(Ht-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function st(e){switch(e){case "linear":return "linear";case "ease-in":return ir;case "ease-out":return ar;case "ease-in-out":return lr()?cr(te["ease-in-out"]):null;default:return null}}var _t=Symbol.for("svg-scroll-draw.registry");function Vt(){let e=globalThis;return e[_t]||(e[_t]=new Map)}function ke(e,r){Vt().set(e,r);}function Se(e){Vt().delete(e);}var Ze,it=new Set,at=new WeakMap,Ke=new Map,zt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function ur(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 Be(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Ze??(Ze=new ResizeObserver(s=>{let a=false;for(let{target:c}of s)at.get(c)!==zt(c)&&(a=true),at.set(c,"");a&&it.forEach(c=>c());})),it.add(t);let n=ur(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{at.has(s)||at.set(s,zt(s)),Ke.set(s,(Ke.get(s)??0)+1),Ze.observe(s);}),()=>{it.delete(t)&&(n.forEach(s=>{let a=(Ke.get(s)??1)-1;if(a)return void Ke.set(s,a);Ke.delete(s),Ze?.unobserve(s);}),it.size||(Ze?.disconnect(),Ze=void 0));}}function lt(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 Ge(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=lt(a=>{if(!a)return;n();let c=(t.getProgress?.()??0)>=1;t.destroy(),t=r(c?{...e,onComplete:void 0}:e,true);}),s={};for(let a of Object.keys(t))s[a]=(...c)=>t[a]?.(...c);return s.destroy=()=>{n(),t.destroy();},s}var mr=0;function fr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Wt(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 pr(e){if(!Xe)return;let r=Wt(e,"stroke");if(!r||r==="none"){Y("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!qt.has(t)&&!qt.has(Wt(e,"fill"))&&Y("Element has a fill \u2014 it may obscure the stroke animation.",e);}function dr(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 a=t==="x"?window.scrollX:window.scrollY,c=e-a,f=r-a,u=t==="x";n.innerHTML=`
2
+ <div style="position:absolute;${u?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${u?`left:${f}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${f}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 Bt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Gt=/[MmLlHhVvCcSsQqTtAaZz]/g;function gr(e,r,t){if(!Xe)return;let n=(e.match(Gt)??[]).join("").toUpperCase(),s=(r.match(Gt)??[]).join("").toUpperCase(),a=(e.match(Bt)??[]).length,c=(r.match(Bt)??[]).length;if(n!==s){Y(`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}a!==c&&Y(`morphTo: coordinate count differs (${a} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function bt(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let c=parseFloat(a),f=n[s++]??c;return String(+(c+(f-c)*t).toFixed(4))})}function jt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(r,(t,n)=>yr(e,t,n))}function yr(e,r,t){let{preset:n,...s}=r,a=n?{...ht[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:f=1,fade:u=false,easing:d="linear",trigger:L={},stagger:P=0,direction:S="forward",once:U=false,debug:pe=false,axis:F="y",scrollContainer:x,autoReverse:A=false,delay:p=0,strokeColor:E,strokeWidth:w,fillOpacity:O,waypoints:z,velocityScale:N=false,threshold:X=0,rootMargin:_e="0px",repeat:le=0,repeatDelay:ce=0,morphTo:H,clip:xe,autoplay:Ne=false,duration:Te=1e3,native:ie=true,onProgress:g,onStart:k,onComplete:de,onEnter:be,onLeave:Ae,onEnterBack:Me,onLeaveBack:He}=a,Z=xe===true?"left":typeof xe=="string"?xe:false,ge=typeof d=="function"?d:te[d]??te.linear,je=$e(L.start??"top bottom"),Qe=$e(L.end??"bottom top"),ae=typeof x=="string"?document.querySelector(x):x??null,K=Array.isArray(E)?E[0]:null,j=Array.isArray(E)?E[1]:typeof E=="string"?E:null,Q=Array.isArray(w)?w[0]:null,W=Array.isArray(w)?w[1]:typeof w=="number"?w:null,re=Array.isArray(O)?O[0]:null,G=Array.isArray(O)?O[1]:typeof O=="number"?O:null;function we(o){let l=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let D=Z?[]:Array.from(e.querySelectorAll(c)),M=[],ne=[],i=0,m=0,ye=P,ue=0,T=false,C=false,_=0,Ce=false,R=-1,Le=[],De=-1,J=false,ve=0,Pe=0,Ie,mt=null;function xt(){mt?.destroy(),mt=null;}let Oe=new Set,Tt=NaN,Re=true,Je=-1,At=performance.now(),Ve=NaN;function Ye(){return ae?F==="x"?ae.scrollLeft:ae.scrollTop:F==="x"?window.scrollX:window.scrollY}function Mt(){return ae?F==="x"?ae.clientWidth:ae.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function Lt(){let o=ot(e,ae,F);return Fe(o,o.scroll,Mt(),je,Qe)}function Jt(){let o=m-i,l=D.length-1,h=ae??document.documentElement,q=F==="x"?"Width":"Height";if(ye=P,P>0&&l>0&&o>0){let me=h[`scroll${q}`]-h[`client${q}`]-1-i-o/f;me>=0&&(ye=Math.min(P,me/(l*o)));}ue=m+l*ye*o;}function Pt(){(({tStart:i,tEnd:m}=Lt())),Jt(),pe&&Xe&&(xt(),mt=dr(i,m,F));}function ft(o,l=Lt){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let h=o.destroy;return o.destroy=()=>{h.call(o),Se(e);},o}function er(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let h=l==="reverse"?1-o:o;e.style.clipPath=we(h);return}D.forEach((h,q)=>{h.style.strokeDashoffset=l==="reverse"?`${M[q]*o}`:`${M[q]*(1-o)}`,u&&(h.style.opacity=l==="reverse"?`${1-o}`:`${o}`),K&&j?h.style.stroke=qe(K,j,o):j&&(h.style.stroke=j),Q!==null&&W!==null?h.style.strokeWidth=`${Q+(W-Q)*o}`:W!==null&&(h.style.strokeWidth=`${W}`),re!==null&&G!==null?h.style.fillOpacity=`${re+(G-re)*o}`:G!==null&&(h.style.fillOpacity=`${G}`),H&&h.tagName.toLowerCase()==="path"&&ne[q]&&h.setAttribute("d",bt(ne[q],H,o));});}function et(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=we(0);return}D.forEach((o,l)=>{o.style.strokeDasharray=`${M[l]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${M[l]}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",K&&(o.style.stroke=K),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`),H&&o.tagName.toLowerCase()==="path"&&ne[l]&&o.setAttribute("d",ne[l]);});}if(D.forEach(o=>{pr(o);let l=We(o);M.push(l);let h=o.tagName.toLowerCase()==="path";h?ne.push(o.getAttribute("d")??""):ne.push(""),H&&(h?gr(ne[ne.length-1],H,o):Y(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=S==="reverse"?`${l}`:"0",u&&(o.style.opacity="1"),j&&(o.style.stroke=j),W!==null&&(o.style.strokeWidth=`${W}`),G!==null&&(o.style.fillOpacity=`${G}`),H&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",H)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=S==="reverse"?"0":`${l}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",K&&(o.style.stroke=K),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`));}),Z){if(t)return e.style.clipPath=we(1),de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=we(0);}else if(t)return de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let $t=typeof d=="string"?st(d):null;function tr(){return !(ie===false||!fr()||!D.length||!$t||Z||F!=="y"||ae||f!==1||P!==0||U||A||N!==false||H||z||le||p>0||g||k||de||be||Ae||Me||He||E!=null||w!=null||O!=null||(L.start??"top bottom").trim()!=="top bottom"||(L.end??"bottom top").trim()!=="bottom top")}function rr(){let o=++mr,l=`svg-scroll-draw-${o}`,h=`svg-scroll-draw-host-${o}`,q=`--svg-scroll-draw-${o}`,me=S==="reverse"?"0":"var(--ssd-len)",Ee=S==="reverse"?"var(--ssd-len)":"0",he=`stroke-dashoffset:${me};`,v=`stroke-dashoffset:${Ee};`;u&&(he+=`opacity:${S==="reverse"?1:0};`,v+=`opacity:${S==="reverse"?0:1};`);let $=document.createElement("style");$.setAttribute("data-svg-scroll-draw",""),$.textContent=`@keyframes ${l}{from{${he}}to{${v}}}.${h}{view-timeline-name:${q};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${q};animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(h);function ee(y,B){y.style.setProperty("--ssd-len",String(M[B])),y.style.strokeDasharray=`${M[B]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}D.forEach(ee);let b=false,I=-1;function V(){if(I>=0)return I;let y=e.getBoundingClientRect(),{tStart:B,tEnd:fe}=Fe({top:y.top,height:y.height},Ye(),Mt(),je,Qe);return ge(se(Ye(),B,fe,f))}return {destroy(){e.classList.remove(h),D.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),$.remove();},replay(){b=false,I=-1,D.forEach(ee);},pause(){b=true,D.forEach(y=>{y.style.animationPlayState="paused";});},resume(){b&&(b=false,D.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let B=Math.min(1,Math.max(0,y));I=B,b=true,D.forEach((fe,oe)=>{fe.classList.remove(l),fe.style.strokeDashoffset=S==="reverse"?`${M[oe]*B}`:`${M[oe]*(1-B)}`,u&&(fe.style.opacity=S==="reverse"?`${1-B}`:`${B}`);});},getProgress(){return V()},refresh(){D.forEach((y,B)=>{M[B]=We(y),y.style.setProperty("--ssd-len",String(M[B])),y.style.strokeDasharray=`${M[B]}`;});}}}if(tr())return ft(rr());function nr(){let o=Math.max(1,Te),l=0,h=0,q=false;function me(b){let I=true;if(Z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);ve=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=we(S==="reverse"?1-y:y),g?.(y),V<1&&(I=false);}else D.forEach((V,y)=>{let B=y*P*o,fe=Math.min(1,Math.max(0,(b-B)/o)),oe=ge(fe);V.style.strokeDashoffset=S==="reverse"?`${M[y]*oe}`:`${M[y]*(1-oe)}`,u&&(V.style.opacity=S==="reverse"?`${1-oe}`:`${oe}`),K&&j?V.style.stroke=qe(K,j,oe):j&&(V.style.stroke=j),Q!==null&&W!==null?V.style.strokeWidth=`${Q+(W-Q)*oe}`:W!==null&&(V.style.strokeWidth=`${W}`),re!==null&&G!==null?V.style.fillOpacity=`${re+(G-re)*oe}`:G!==null&&(V.style.fillOpacity=`${G}`),H&&V.tagName.toLowerCase()==="path"&&ne[y]&&V.setAttribute("d",bt(ne[y],H,oe)),y===0&&(ve=oe,g?.(oe),e.style.setProperty("--scroll-draw-progress",String(oe))),fe<1&&(I=false);});if(z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);for(let B in z){let fe=parseFloat(B);y>=fe&&!Oe.has(fe)&&(Oe.add(fe),z[B]?.());}}return I}function Ee(b){if(J)return;let I=b-l;C||(C=true,k?.());let V=me(I);if(V&&!T){T=true,me(o*(1+Math.max(0,D.length-1)*P)),de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Ie=setTimeout(()=>{l=performance.now(),C=false,T=false,Oe.clear(),et(),_=requestAnimationFrame(Ee);},ce));return}V||(_=requestAnimationFrame(Ee));}function he(){cancelAnimationFrame(_),clearTimeout(Ie),l=performance.now(),h=0,J=false,C=false,T=false,Pe=0,q=true,ve=0,Oe.clear(),et(),_=requestAnimationFrame(Ee);}let v=new IntersectionObserver(b=>{b.forEach(I=>{I.isIntersecting&&!(U&&T)?he():!I.isIntersecting&&!U&&!T&&(cancelAnimationFrame(_),clearTimeout(Ie),q=false);});},{root:ae??null,threshold:X,rootMargin:_e}),$;function ee(){clearTimeout($),$=setTimeout(()=>{D.forEach((b,I)=>{M[I]=We(b),b.style.strokeDasharray=`${M[I]}`;});},150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),p>0?setTimeout(()=>v.observe(e),p):v.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ie),v.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout($);},replay(){Pe=0,he();},pause(){J||!q||(J=true,h=performance.now()-l,cancelAnimationFrame(_));},resume(){J&&(J=false,q=true,l=performance.now()-h,_=requestAnimationFrame(Ee));},seek(b){let I=Math.min(1,Math.max(0,b));ve=I,J=true,h=I*o,l=performance.now()-h,cancelAnimationFrame(_),me(h);},getProgress(){return ve},refresh(){clearTimeout($),D.forEach((b,I)=>{M[I]=We(b),b.style.strokeDasharray=`${M[I]}`;});}}}if(Ne)return ft(nr());Pt();function kt(){if(J||!ze)return;let o=performance.now(),l=Ye();if(!Re&&N===false&&l===Tt){dt(l);return}Re=false,Tt=l;let h=f;if(N!==false){let v=o-At,$=v>0?Math.abs(l-(Je<0?l:Je))/v:0;h=f*Math.max(.2,1+$*(typeof N=="number"?N:1)*.04);}Je=l,At=o;let q=A?De===-1||l>=De?"forward":"reverse":S;De=l;let me=m-i,Ee=true,he=me===0?0:(l-i)/me;if(isNaN(Ve)||(Ve<=0&&he>0?be?.():Ve>0&&he<=0&&He?.(),Ve<1&&he>=1?Ae?.():Ve>=1&&he<1&&Me?.()),Ve=he,Z){let v=ge(se(l,i,m,h));U&&!A&&(R=Math.max(R,v),v=R),ve=v,e.style.setProperty("--scroll-draw-progress",String(v));let $=q==="reverse"?1-v:v;e.style.clipPath=we($),g?.(v),!C&&se(l,i,m,h)>0&&(C=true,k?.()),v>=1&&!T?(T=true,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Ie=setTimeout(()=>{R=-1,C=false,T=false,e.style.clipPath=we(0);},ce))):v<1&&!U&&(T=false),dt(l);return}if(D.forEach((v,$)=>{let ee=$*ye*me,b=ge(se(l,i+ee,m+ee,h));U&&!A&&(b=Le[$]=Math.max(Le[$]??R,b)),v.style.strokeDashoffset=q==="reverse"?`${M[$]*b}`:`${M[$]*(1-b)}`,u&&(v.style.opacity=q==="reverse"?`${1-b}`:`${b}`),K&&j?v.style.stroke=qe(K,j,b):j&&(v.style.stroke=j),Q!==null&&W!==null?v.style.strokeWidth=`${Q+(W-Q)*b}`:W!==null&&(v.style.strokeWidth=`${W}`),re!==null&&G!==null?v.style.fillOpacity=`${re+(G-re)*b}`:G!==null&&(v.style.fillOpacity=`${G}`),H&&v.tagName.toLowerCase()==="path"&&ne[$]&&v.setAttribute("d",bt(ne[$],H,b)),$===0&&(ve=b,g?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Ee=false);}),z){let v=ge(se(l,i,m,h));for(let $ in z){let ee=parseFloat($);v>=ee&&!Oe.has(ee)&&(Oe.add(ee),z[$]?.());}}!C&&se(l,i,m,h)>0&&(C=true,k?.()),Ee&&!T?(T=true,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Ie=setTimeout(()=>{R=-1,Le=[],C=false,T=false,Oe.clear(),et(),Re=true;},ce))):!Ee&&!U&&(T=false),dt(l);}function pt(o){return o>=m&&o<ue}function dt(o){Ce||pt(o)?_=requestAnimationFrame(kt):ze=false;}function gt(){return Ce||pt(Ye())}let ze=false;function tt(){ze||(ze=true,_=requestAnimationFrame(function(){kt();}));}function rt(){ze=false,cancelAnimationFrame(_);}let yt=new IntersectionObserver(o=>{o.forEach(l=>{Ce=l.isIntersecting,Ce&&!J?(Re=true,tt()):ze&&!J&&pt(Ye())||rt();});},{root:ae??null,threshold:X,rootMargin:_e});function Ct(){D.forEach((o,l)=>{M[l]=We(o),o.style.strokeDasharray=`${M[l]}`;}),Pt(),Re=true;}let nt;function Ue(){clearTimeout(nt),nt=setTimeout(Ct,150);}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let or=Be([e],Ue);return p>0?setTimeout(()=>yt.observe(e),p):yt.observe(e),ft({destroy(){cancelAnimationFrame(_),clearTimeout(Ie),rt(),yt.disconnect(),or(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(nt),xt();},replay(){R=-1,Le=[],De=-1,Je=-1,C=false,T=false,Pe=0,J=false,ve=0,Oe.clear(),clearTimeout(Ie),et(),Re=true,gt()&&tt();},pause(){J=true,rt();},resume(){J&&(J=false,Re=true,gt()&&tt());},seek(o){let l=Math.min(1,Math.max(0,o));ve=l,R=l,Le=[],J=true,rt(),er(l,S),Re=true;},getProgress(){return ve},refresh(){clearTimeout(nt),Ct(),gt()&&!J&&tt();}},()=>({tStart:i,tEnd:m}))}function hr(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):(Y("Container not found:",e),t)}function br(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Qt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],a=[],c=n[2].trim();if(c)for(let f of c.split(/[\s,]+/)){let u=f.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),a.push(u?u[2]:"");}r.push({fn:n[1],nums:s,units:a});}return r}function wr(e,r,t){let n=Qt(e),s=Qt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((a,c)=>{let f=s[c];return a.fn!==f.fn||a.nums.length!==f.nums.length?t<1?`${a.fn}(${a.nums.map((u,d)=>`${u}${a.units[d]}`).join(", ")})`:`${f.fn}(${f.nums.map((u,d)=>`${u}${f.units[d]}`).join(", ")})`:`${a.fn}(${a.nums.map((u,d)=>`${u+(f.nums[d]-u)*t}${a.units[d]}`).join(", ")})`}).join(" ")}function Yt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(br(n))return qe(n,s,t);if(n.includes("("))return wr(n,s,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(a&&c){let f=parseFloat(a[1]),u=parseFloat(c[1]);return `${f+(u-f)*t}${a[2]||c[2]}`}return t<1?n:s}function vr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Sr=0,Ut="--scroll-draw-progress";function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,r){return typeof window>"u"?Zt:r.respectReducedMotion===false?Xt(e,r,false):Ge(r,(t,n)=>Xt(e,t,n))}function Xt(e,r,t){let{props:n,trigger:s={},easing:a="ease-out",speed:c=1,once:f=false,axis:u="y",scrollContainer:d,native:L=true,velocityScale:P=false,triggerElement:S,onProgress:U,onComplete:pe,onEnter:F,onLeave:x,onEnterBack:A,onLeaveBack:p}=r,E=typeof a=="function"?a:te[a]??te["ease-out"],w=$e(s.start??"top bottom"),O=$e(s.end??"bottom top"),z=S??e,N=typeof d=="string"?document.querySelector(d):d??null,X=Object.entries(n).map(([i,m])=>({prop:vr(i),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function _e(){let i=window.getComputedStyle(e);for(let m of X)m.from===""&&(m.from=i.getPropertyValue(m.prop).trim()||"0");}function le(){for(let i of X)e.style.setProperty(i.prop,String(i.to));}let ce=new Map;for(let i of [...X.map(m=>m.prop),Ut])ce.set(i,e.style.getPropertyValue(i));function H(){for(let[i,m]of ce)m?e.style.setProperty(i,m):e.style.removeProperty(i);}if(t)return le(),pe?.(),{...Zt,destroy:H,getProgress:()=>1};_e();let xe=typeof a=="string"?st(a):null;function Ne(){if(!L||!xr()||!xe||u!=="y"||N||z!==e||f||c!==1||U||pe||F||x||A||p||P!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let i of X)if(!Er.has(i.prop))return false;return true}function Te(){let i=`ssd-a-${++Sr}`,m=X.map(R=>`${R.prop}:${R.from}`).join(";"),ye=X.map(R=>`${R.prop}:${R.to}`).join(";"),ue=document.createElement("style");ue.setAttribute("data-ssd-animate",""),ue.textContent=`@keyframes ${i}{from{${m}}to{${ye}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${xe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue),e.classList.add(i);let T=()=>u==="x"?window.scrollX:window.scrollY,C=()=>u==="x"?window.innerWidth:window.innerHeight,_=()=>{let R=e.getBoundingClientRect();return Fe({top:R.top,height:R.height},T(),C(),w,O)};ke(e,{type:"animate",getProgress:()=>Ce.getProgress(),getTrigger:_});let Ce={refresh(){},destroy(){e.classList.remove(i),ue.remove(),e.style.animationPlayState="",H(),Se(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(R){let Le=Math.min(1,Math.max(0,R));e.classList.remove(i);for(let De of X)e.style.setProperty(De.prop,Yt(De.from,De.to,Le));},getProgress(){let{tStart:R,tEnd:Le}=_();return E(se(T(),R,Le,c))}};return Ce}if(Ne())return Te();let ie=0,g=0,k=0,de=false,be=false,Ae=-1,Me=0,He=false,Z=NaN,ge=-1,je=0,Qe=()=>N?u==="x"?N.scrollLeft:N.scrollTop:u==="x"?window.scrollX:window.scrollY,ae=()=>N?u==="x"?N.clientWidth:N.clientHeight:u==="x"?window.innerWidth:window.innerHeight,K=z===e?X:[],j=false;function Q(){let i=e.style,m=K.map(C=>i.getPropertyValue(C.prop)),ye=i.transition;K.length&&(i.transition="none"),K.forEach(C=>i.setProperty(C.prop,ce.get(C.prop)??""));let ue=ot(z,N,u);K.forEach((C,_)=>i.setProperty(C.prop,m[_])),K.length&&(e.offsetWidth,i.transition=ye);let T=Fe(ue,ue.scroll,ae(),w,O);j&&Math.abs(T.tStart-ie)<1&&Math.abs(T.tEnd-g)<1||(j=true,ie=T.tStart,g=T.tEnd);}function W(i){e.style.setProperty(Ut,String(i));for(let m of X)e.style.setProperty(m.prop,Yt(m.from,m.to,i));U?.(i);}function re(i){if(isNaN(Z)){Z=i;return}Z<=0&&i>0?F?.():Z>0&&i<=0&&p?.(),Z<1&&i>=1?x?.():Z>=1&&i<1&&A?.(),Z=i;}function G(){if(!de||be)return;let i=performance.now(),m=Qe(),ye=c;if(P!==false){let C=i-je,_=C>0?Math.abs(m-(ge<0?m:ge))/C:0;ye=c*Math.max(.2,1+_*(typeof P=="number"?P:1)*.04);}ge=m,je=i;let ue=g===ie?0:(m-ie)/(g-ie);re(ue);let T=E(se(m,ie,g,ye));f&&(Ae=Math.max(Ae,T),T=Ae),Me=T,W(T),T>=1&&!He?(He=true,pe?.()):T<1&&!f&&(He=false),k=requestAnimationFrame(G);}Q(),g===ie&&Y("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=E(se(Qe(),ie,g,c));f&&i>0&&(Ae=i),Me=i,W(i);}let we=new IntersectionObserver(i=>{i.forEach(m=>{de=m.isIntersecting,de&&!be?k=requestAnimationFrame(G):cancelAnimationFrame(k);});},{root:N??null}),D;function M(){clearTimeout(D),D=setTimeout(Q,150);}window.addEventListener("resize",M),window.addEventListener("orientationchange",M);let ne=Be([z],M);return we.observe(e),ke(e,{type:"animate",getProgress:()=>Me,getTrigger:()=>({tStart:ie,tEnd:g})}),{destroy(){cancelAnimationFrame(k),we.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),ne(),clearTimeout(D),H(),Se(e);},replay(){Ae=-1,He=false,Me=0,be=false,W(0);},pause(){be=true,cancelAnimationFrame(k);},resume(){be&&(be=false,de&&(k=requestAnimationFrame(G)));},seek(i){let m=Math.min(1,Math.max(0,i));Me=m,Ae=m,be=true,cancelAnimationFrame(k),W(m);},getProgress(){return Me},refresh(){Q();}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tr(e,r){if(typeof window>"u")return ct;let t=typeof e=="string"?document.querySelector(e):e;return t?wt(t,r):(Y("scrollAnimate: element not found:",e),ct)}function Ar(e,r={}){if(typeof window>"u")return ct;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return Y("scrollParallax: element not found:",e),ct;let{speed:n=.3,axis:s="y",easing:a="linear",trigger:c,onProgress:f}=r,u=-n*100,d=t.style,L=!!t.ownerSVGElement,P=d.getPropertyValue("transform-box");L&&d.setProperty("transform-box","fill-box");let S=wt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:f});return L?{...S,destroy(){S.destroy(),d.setProperty("transform-box",P);}}:S}var vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mr(e,r){if(typeof window>"u")return vt;let t=typeof e=="string"?document.querySelector(e):e;return t?Ge(r,(n,s)=>Lr(t,n,s)):(Y("scrollCounter: element not found:",e),vt)}function Lr(e,r,t){let{from:n=0,to:s,format:a,easing:c="ease-out",trigger:f={},once:u=true,decimals:d,onComplete:L}=r,P=d!==void 0?g=>g.toFixed(d):a??(g=>String(Math.round(g))),S=typeof c=="function"?c:te[c]??te["ease-out"],U=$e(f.start??"top 80%"),pe=$e(f.end??"top 20%");if(t)return e.textContent=P(s),L?.(),{...vt,getProgress:()=>1};let F=0,x=0,A=false,p=0,E=false,w=false,O=-1,z=0,N=false,X=()=>window.scrollY,_e=()=>window.innerHeight;function le(){let g=e.getBoundingClientRect(),k=Fe({top:g.top,height:g.height},X(),_e(),U,pe);A&&Math.abs(k.tStart-F)<1&&Math.abs(k.tEnd-x)<1||(A=true,F=k.tStart,x=k.tEnd);}function ce(g){e.textContent=P(n+(s-n)*g),e.style.setProperty("--scroll-draw-progress",String(g));}function H(){if(!E||w)return;let g=S(se(X(),F,x,1));u&&(O=Math.max(O,g),g=O),z=g,ce(g),g>=1&&!N?(N=true,L?.()):g<1&&!u&&(N=false),p=requestAnimationFrame(H);}le();{let g=S(se(X(),F,x,1));u&&g>0&&(O=g),z=g,ce(g);}let xe=new IntersectionObserver(g=>{g.forEach(k=>{E=k.isIntersecting,E&&!w?p=requestAnimationFrame(H):cancelAnimationFrame(p);});}),Ne;function Te(){clearTimeout(Ne),Ne=setTimeout(le,150);}window.addEventListener("resize",Te),window.addEventListener("orientationchange",Te);let ie=Be([e],Te);return xe.observe(e),ke(e,{type:"counter",getProgress:()=>z,getTrigger:()=>({tStart:F,tEnd:x})}),{destroy(){cancelAnimationFrame(p),xe.disconnect(),window.removeEventListener("resize",Te),window.removeEventListener("orientationchange",Te),ie(),clearTimeout(Ne),Se(e);},replay(){O=-1,N=false,z=0,w=false,ce(0);},pause(){w=true,cancelAnimationFrame(p);},resume(){w&&(w=false,E&&(p=requestAnimationFrame(H)));},seek(g){let k=Math.min(1,Math.max(0,g));z=k,O=k,w=true,cancelAnimationFrame(p),ce(k);},getProgress(){return z}}}var Kt="http://www.w3.org/2000/svg",Pr="cinematic-photo",Et=e=>e<0?0:e>1?1:e;function ut(e){let r=parseFloat(e);return Number.isFinite(r)?Et(r/100):0}function $r(e){return te[e]??te.linear}var kr={destroy:()=>{},getProgress:()=>0},St=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||Y("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return kr;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 x of r.scenes){if(x.background){let p=document.createElement("img");p.id=Pr,p.src=x.background,p.alt="",p.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(p);}let A=x.animations.filter(p=>p.type==="draw");if(A.length){let p=document.createElementNS(Kt,"svg");p.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),p.setAttribute("preserveAspectRatio","xMidYMid meet"),p.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(p);for(let E of A){let w=document.createElementNS(Kt,"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 O=E.length||w.getTotalLength?.()||0;w.style.strokeDasharray=String(O),w.style.strokeDashoffset=String(O),p.appendChild(w),s.push({kind:"draw",el:w,start:ut(E.start),end:ut(E.end),ease:$r(E.easing),length:O});}}for(let p of x.animations){if(p.type!=="fade")continue;let E=n.querySelector(p.target)??document.querySelector(p.target);E&&(E.style.opacity=String(p.from),s.push({kind:"fade",el:E,start:ut(p.start),end:ut(p.end),ease:te["ease-in-out"]??te.linear,from:p.from,to:p.to}));}}let a=0,c=()=>{let x=t.offsetHeight-window.innerHeight;return x<=0?t.getBoundingClientRect().top<=0?1:0:Et(-t.getBoundingClientRect().top/x)},f=x=>{for(let A of s){let p=A.end-A.start,E=p<=0?x>=A.end?1:0:Et((x-A.start)/p),w=A.ease(E);A.kind==="draw"?A.el.style.strokeDashoffset=String(A.length*(1-w)):A.el.style.opacity=String(A.from+(A.to-A.from)*w);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let u=0,d=false,L=false,P=()=>{a=c(),f(a),d&&(u=requestAnimationFrame(P));},S=()=>{d||(d=true,u=requestAnimationFrame(P));},U=()=>{d=false,cancelAnimationFrame(u);},pe=new IntersectionObserver(x=>{for(let A of x)L=A.isIntersecting,L?S():U();},{threshold:0});pe.observe(n),a=c(),f(a),ke(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let x=t.getBoundingClientRect().top+window.scrollY;return {tStart:x,tEnd:x+Math.max(0,t.offsetHeight-window.innerHeight)}}});let F=lt(x=>{x&&(F(),U(),pe.disconnect(),Se(t),a=1,f(1));});return {destroy(){F(),U(),pe.disconnect(),Se(t);},getProgress:()=>a}}};
4
+ exports.Cinematic=St;exports.PRESETS=ht;exports.createBounce=Dt;exports.createElastic=It;exports.createSpring=sr;exports.scrollAnimate=Tr;exports.scrollCounter=Mr;exports.scrollDraw=hr;exports.scrollParallax=Ar;
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { a as ScrollDrawOptions } from './types-MswK0erX.mjs';
2
2
  export { P as PresetName, S as ScrollDrawInstance } from './types-MswK0erX.mjs';
3
3
  export { s as scrollDraw } from './scroll-draw-Dej-GIRP.mjs';
4
- export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-CMqK0GCT.mjs';
4
+ export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-BY-CNE8c.mjs';
5
5
  export { S as ScrollCounterOptions, s as scrollCounter } from './index-CdaBYn3A.mjs';
6
6
  export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.mjs';
7
- export { S as ScrollAnimateOptions } from './engine-P8u6OK4m.mjs';
7
+ export { S as ScrollAnimateOptions } from './engine-o1VSQ1lX.mjs';
8
8
 
9
9
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
10
10
  /**
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { a as ScrollDrawOptions } from './types-MswK0erX.js';
2
2
  export { P as PresetName, S as ScrollDrawInstance } from './types-MswK0erX.js';
3
3
  export { s as scrollDraw } from './scroll-draw-DsBMkwrX.js';
4
- export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-DPqPEnO-.js';
4
+ export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-DqXXiDIk.js';
5
5
  export { S as ScrollCounterOptions, s as scrollCounter } from './index-D3o4vT3e.js';
6
6
  export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.js';
7
- export { S as ScrollAnimateOptions } from './engine-DQyBzZDl.js';
7
+ export { S as ScrollAnimateOptions } from './engine-B7UpB4fT.js';
8
8
 
9
9
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
10
10
  /**
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{a as scrollAnimate,b as scrollParallax}from'./chunk-MTEGM4RR.mjs';export{a as Cinematic}from'./chunk-KGAJQP2N.mjs';export{a as scrollDraw}from'./chunk-SMRTRZSD.mjs';export{a as scrollCounter}from'./chunk-KHQ7OGQK.mjs';import'./chunk-BFX2CSQ3.mjs';export{a as PRESETS}from'./chunk-ENACACPZ.mjs';import'./chunk-OJFWQ6CU.mjs';import'./chunk-YWKPTYSG.mjs';import'./chunk-YZV4Z3EQ.mjs';import'./chunk-A4JCC3QQ.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-DM6EDKWH.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';
1
+ export{a as scrollAnimate,b as scrollParallax}from'./chunk-GVBO5GRD.mjs';export{a as Cinematic}from'./chunk-N6PDF6O6.mjs';export{a as scrollDraw}from'./chunk-OTDD2ROH.mjs';export{a as scrollCounter}from'./chunk-WXUOF4NM.mjs';import'./chunk-LTCJVVSC.mjs';export{a as PRESETS}from'./chunk-HX4SP5WN.mjs';import'./chunk-OJFWQ6CU.mjs';import'./chunk-YWKPTYSG.mjs';import'./chunk-YZV4Z3EQ.mjs';import'./chunk-2PYLM3E7.mjs';import'./chunk-A4JCC3QQ.mjs';import'./chunk-5PJEKEEP.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-DM6EDKWH.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';