svg-scroll-draw 2.16.0 → 2.17.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.
- package/README.md +10 -3
- package/dist/angular/index.cjs +2 -2
- package/dist/angular/index.d.mts +45 -49
- package/dist/angular/index.d.ts +45 -49
- package/dist/angular/index.mjs +1 -1
- package/dist/chunk-XSVTHCLO.mjs +1 -0
- package/dist/chunk-ZZCTLVGT.mjs +1 -0
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +4 -3
- package/dist/react/index.mjs +2 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.d.mts +16 -11
- package/dist/solid/index.d.ts +16 -11
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +5 -5
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.mjs +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.mts +14 -7
- package/dist/vue/index.d.ts +14 -7
- package/dist/vue/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-E4M2PB7B.mjs +0 -1
package/dist/nuxt/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function
|
|
1
|
+
'use strict';var vue=require('vue');function tr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),a=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(a,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let A=1-Math.pow(t,T);return A+(1-A)*(2*V-1)*(2*V-1)}return 1}}function rr({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),a=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-a)*(2*Math.PI)/t)+1}var re={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 $t(e,n,r){return Math.min(r,Math.max(n,e))}function de(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 Pt(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 Ot(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 Z(e,n,r,t){return r===n?0:$t((e-n)/(r-n)*t,0,1)}function xe(e,n,r,t,a){let s=Pt(e.top,e.height,n,t.element)-Ot(t.viewport,r),c=Pt(e.top,e.height,n,a.element)-Ot(a.viewport,r);return {tStart:s,tEnd:c}}function rt(e,n,r){let t=e.getBoundingClientRect(),a=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:a,scroll:0}:{top:r==="x"?t.left:t.top,height:a,scroll:r==="x"?window.scrollX:window.scrollY}}function qe(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 kt(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 Be(e,n,r){let t=kt(e),a=kt(n);return !t||!a?e:`rgb(${Math.round(t[0]+(a[0]-t[0])*r)},${Math.round(t[1]+(a[1]-t[1])*r)},${Math.round(t[2]+(a[2]-t[2])*r)})`}var Rt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var je=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){je&&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)",Ft=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<Ft;r++){let t=r/(Ft-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function nt(e){switch(e){case "linear":return "linear";case "ease-in":return nr;case "ease-out":return or;case "ease-in-out":return sr()?ir(re["ease-in-out"]):null;default:return null}}var Dt=Symbol.for("svg-scroll-draw.registry");function It(){let e=globalThis;return e[Dt]||(e[Dt]=new Map)}function Ce(e,n){It().set(e,n);}function Le(e){It().delete(e);}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 Nt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Ht=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function cr(e){if(!je)return;let n=Nt(e,"stroke");if(!n||n==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Ht.has(r)&&!Ht.has(Nt(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function ur(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 a(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${m?`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;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Vt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function lr(e,n,r){if(!Ue)return;let t=(e.match(zt)??[]).join("").toUpperCase(),l=(n.match(zt)??[]).join("").toUpperCase(),s=(e.match(Vt)??[]).length,c=(n.match(Vt)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function ut(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Dt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:A="forward",once:ne=false,debug:$e=false,axis:W="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:$,fillOpacity:C,waypoints:w,velocityScale:k=false,threshold:D=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:F,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:I,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),_e=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray($)?$[0]:null,j=Array.isArray($)?$[1]:typeof $=="number"?$:null,pe=Array.isArray(C)?C[0]:null,Z=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function Oe(o){let a=o*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(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ge=0,N=false,_=false,q=0,Ae=false,ye=-1,te=-1,U=false,he=0,Ie=0,He,ot=null;function St(){ot?.destroy(),ot=null;}let Ve=new Set,Et=NaN,ze=true,Qe=-1,Tt=performance.now(),qe=NaN;function st(){return ve?W==="x"?ve.scrollLeft:ve.scrollTop:W==="x"?window.scrollX:window.scrollY}function xt(){return ve?W==="x"?ve.clientWidth:ve.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function At(){let o=rt(e,ve,W);return xe(o,o.scroll,xt(),Pe,_e)}function Mt(){(({tStart:f,tEnd:ge}=At())),$e&&Ue&&(St(),ot=ar(f,ge,W));}function it(o,a=At){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Le(e);},o}function Yt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Oe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=We(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),F&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],F,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Oe(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${O[a]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${O[a]}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),F&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{ir(o);let a=Be(o);O.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),F&&(b?lr(i[i.length-1],F,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),F&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",F)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?"0":`${a}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof p=="string"?nt(p):null;function Xt(){return !(ae===false||!sr()||!z.length||!Ct||Q||W!=="y"||ve||u!==1||V!==0||ne||X||k!==false||F||w||S||G>0||d||x||g||L||E||I||fe||M!=null||$!=null||C!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Qt(){let o=++or,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ne=A==="reverse"?"0":"var(--ssd-len)",ke=A==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${Ne};`,v=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${A==="reverse"?1:0};`,v+=`opacity:${A==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Te}=xe({top:y.top,height:y.height},st(),xt(),Pe,_e);return Ee(K(st(),Y,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),R.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=A==="reverse"?`${O[be]*Y}`:`${O[be]*(1-Y)}`,m&&(Te.style.opacity=A==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return B()},refresh(){z.forEach((y,Y)=>{O[Y]=Be(y),y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`;});}}}if(Xt())return it(Qt());function Zt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Ne(h){let H=true;if(Q){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Oe(A==="reverse"?1-y:y),d?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let Y=y*V*o,Te=Math.min(1,Math.max(0,(h-Y)/o)),be=Ee(Te);B.style.strokeDashoffset=A==="reverse"?`${O[y]*be}`:`${O[y]*(1-be)}`,m&&(B.style.opacity=A==="reverse"?`${1-be}`:`${be}`),Se&&le?B.style.stroke=We(Se,le,be):le&&(B.style.stroke=le),ce!==null&&j!==null?B.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(B.style.strokeWidth=`${j}`),pe!==null&&Z!==null?B.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(B.style.fillOpacity=`${Z}`),F&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ct(i[y],F,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);for(let Y in w){let Te=parseFloat(Y);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[Y]?.());}}return H}function ke(h){if(U)return;let H=h-a;_||(_=true,x?.());let B=Ne(H);if(B&&!N){N=true,Ne(o*(1+Math.max(0,z.length-1)*V)),g?.(),Ie<(S==="infinite"?1/0:S??0)&&(Ie++,He=setTimeout(()=>{a=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},oe));return}B||(q=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(q),clearTimeout(He),a=performance.now(),b=0,U=false,_=false,N=false,Ie=0,ue=true,he=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&N)?Me():!H.isIntersecting&&!ne&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:ve??null,threshold:D,rootMargin:P}),R;function me(){clearTimeout(R),R=setTimeout(()=>{z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(R);},replay(){Ie=0,Me();},pause(){U||!ue||(U=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,U=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),Ne(b);},getProgress(){return he},refresh(){clearTimeout(R),z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(ie)return it(Zt());Mt();function Ke(){if(!Ae||U)return;let o=performance.now(),a=st();if(!ze&&k===false&&a===Et){q=requestAnimationFrame(Ke);return}ze=false,Et=a;let b=u;if(k!==false){let v=o-Tt,R=v>0?Math.abs(a-(Qe<0?a:Qe))/v:0;b=u*Math.max(.2,1+R*(typeof k=="number"?k:1)*.04);}Qe=a,Tt=o;let ue=X?te===-1||a>=te?"forward":"reverse":A;te=a;let Ne=ge-f,ke=true,Me=Ne===0?0:(a-f)/Ne;if(isNaN(qe)||(qe<=0&&Me>0?L?.():qe>0&&Me<=0&&fe?.(),qe<1&&Me>=1?E?.():qe>=1&&Me<1&&I?.()),qe=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let R=ue==="reverse"?1-v:v;e.style.clipPath=Oe(R),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!N?(N=true,g?.(),Ie<(S==="infinite"?1/0:S??0)&&(Ie++,He=setTimeout(()=>{ye=-1,_=false,N=false,e.style.clipPath=Oe(0);},oe))):v<1&&!ne&&(N=false),q=requestAnimationFrame(Ke);return}if(z.forEach((v,R)=>{let me=R*V*Ne,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${O[R]*h}`:`${O[R]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=We(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),F&&v.tagName.toLowerCase()==="path"&&i[R]&&v.setAttribute("d",ct(i[R],F,h)),R===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Ee(K(a,f,ge,b));for(let R in w){let me=parseFloat(R);v>=me&&!Ve.has(me)&&(Ve.add(me),w[R]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!N?(N=true,g?.(),Ie<(S==="infinite"?1/0:S??0)&&(Ie++,He=setTimeout(()=>{ye=-1,_=false,N=false,Ve.clear(),Ze(),ze=true;},oe))):!ke&&!ne&&(N=false),q=requestAnimationFrame(Ke);}let at=false;function Je(){at||(at=true,q=requestAnimationFrame(function(){Ke();}));}function et(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!U?(ze=true,Je()):et();});},{root:ve??null,threshold:D,rootMargin:P});function Lt(){z.forEach((o,a)=>{O[a]=Be(o),o.style.strokeDasharray=`${O[a]}`;}),Mt(),ze=true;}let tt;function Ge(){clearTimeout(tt),tt=setTimeout(Lt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(He),et(),lt.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(tt),St();},replay(){ye=-1,te=-1,Qe=-1,_=false,N=false,Ie=0,U=false,he=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Ae&&Je();},pause(){U=true,et();},resume(){U&&(U=false,ze=true,Ae&&Je());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,U=true,et(),Yt(a,A),ze=true;},getProgress(){return he},refresh(){clearTimeout(tt),Lt(),Ae&&!U&&Je();}},()=>({tStart:f,tEnd:ge}))}function cr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function ur(e,n,r){let t=_t(e),l=_t(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function qt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(cr(t))return We(t,l,r);if(t.includes("("))return ur(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function mr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var fr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),pr=0,Bt="--scroll-draw-progress";function dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:A=true,triggerElement:ne,onProgress:$e,onComplete:W,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:M}=n,$=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),D=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:mr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function F(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Bt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return F(),W?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?nt(s):null;function ae(){if(!T||!dr()||!ee||m!=="y"||P||D!==e||u||c!==1||$e||W||J||X||G||M||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!fr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++pr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Ce(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),Le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let U=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,qt(he.from,he.to,U));},getProgress(){let{tStart:te,tEnd:U}=Ae();return C(K(_(),te,U,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,I=false,fe=-1,Q=0,Ee=false,Pe=NaN,_e=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=rt(D,P,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Bt,String(i));for(let f of S)e.style.setProperty(f.prop,qt(f.from,f.to,i));$e?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&M?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||I)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,ve=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=C(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,W?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("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=C(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!I?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function O(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Oe.observe(e),Ce(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Oe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(z),ie(),Le(e);},replay(){fe=-1,Ee=false,Q=0,I=false,j(0);},pause(){I=true,cancelAnimationFrame(L);},resume(){I&&(I=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,I=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ft;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,A=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],$e=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(s),V?.(),ft;let X=0,G=0,M=0,$=false,C=false,w=-1,k=0,D=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),$e,W);X=x.tStart,G=x.tEnd;}function F(d){t.textContent=A(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!$||C)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,F(d),d>=1&&!D?(D=true,V?.()):d<1&&!p&&(D=false),M=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),k=d,F(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{$=x.isIntersecting,$&&!C?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Ce(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),Le(t);},replay(){w=-1,D=false,k=0,C=false,F(0);},pause(){C=true,cancelAnimationFrame(M);},resume(){C&&(C=false,$&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,C=true,cancelAnimationFrame(M),F(x);},getProgress(){return k}}}var Wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n={}){if(typeof window>"u")return Wt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Wt;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,A=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,$e=de(l.start??"top top"),W=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,M=0,$=0,C=false,w=false,k=-1,D=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,F=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),I=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:I,height:fe},oe(),F(),$e,W);G=Q.tStart,M=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let I=X??t.duration??0,fe=J+(I-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!C||w||!S||A)return;let E=ne(K(oe(),G,M,1));c&&(k=Math.max(k,E),E=k),D=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),$=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),A){ee(1),p?.();return}se(),p?.(),C&&!w&&($=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(I=>{C=I.isIntersecting,C&&!w&&S?$=requestAnimationFrame(ae):cancelAnimationFrame($);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Ce(t,{type:"video",getProgress:()=>D,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame($),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),Le(t);},replay(){k=-1,P=false,D=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,C&&S&&($=requestAnimationFrame(ae)));},seek(E){let I=Math.min(1,Math.max(0,E));D=I,k=I,w=true,cancelAnimationFrame($),ie=NaN,ee(I);},getProgress(){return D}}}function Ut(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function gr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Gt(e){let n=Ut(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function yr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function hr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return jt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),jt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),$e=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=gr(t):l==="lines"?J=Gt(t):J=Ut(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=hr(L,u);E&&(g.style.transform=E);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let I=A(yr(g,E,X,s));G(L,I);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let $=0,C=0,w=0,k=false,D=false,P=-1,S=0,oe=false,F=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},F(),se(),ne,$e);$=L.tStart,C=L.tEnd;}function ee(){if(!k||D)return;let g=K(F(),$,C,1);p&&(P=Math.max(P,g),g=P),S=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!D?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),J=Gt(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Ce(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:$,tEnd:C})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=W,t.removeAttribute("aria-label"),Le(t);},replay(){P=-1,oe=false,S=0,D=false,M(0);},pause(){D=true,cancelAnimationFrame(w);},resume(){D&&(D=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,D=true,cancelAnimationFrame(w),M(L);},getProgress(){return S}}}function br(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=ut(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var yt=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ut(r.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:r},n.default?.())}});function wr(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=mt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var ht=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t=mt(r.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:r},n.default?.())}});function vr(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=pt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var bt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r={to:e.to};e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete);let t=pt(n.value,r);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:n})}});function Sr(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=dt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var wt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=dt(n.value,e.options??{});vue.onUnmounted(()=>r.destroy());}),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Er(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=gt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var vt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t=gt(r.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:r},n.default?.())}});function Tn(){return {install(e){e.component("ScrollDraw",yt),e.component("ScrollAnimate",ht),e.component("ScrollCounter",bt),e.component("ScrollVideo",wt),e.component("ScrollText",vt);}}}exports.ScrollAnimate=ht;exports.ScrollCounter=bt;exports.ScrollDraw=yt;exports.ScrollText=vt;exports.ScrollVideo=wt;exports.createScrollDrawPlugin=Tn;exports.useScrollAnimate=wr;exports.useScrollCounter=vr;exports.useScrollDraw=br;exports.useScrollText=Er;exports.useScrollVideo=Sr;
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",a,{passive:true}),a(),{el:t,destroy(){window.removeEventListener("scroll",a),t.remove();}}}var Vt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,_t=/[MmLlHhVvCcSsQqTtAaZz]/g;function mr(e,n,r){if(!je)return;let t=(e.match(_t)??[]).join("").toUpperCase(),a=(n.match(_t)??[]).join("").toUpperCase(),s=(e.match(Vt)??[]).length,c=(n.match(Vt)??[]).length;if(t!==a){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${a||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),a=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[a++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function ut(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,a=r?{...Rt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:A="forward",once:ne=false,debug:$e=false,axis:W="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:$,fillOpacity:C,waypoints:w,velocityScale:k=false,threshold:R=0,rootMargin:P="0px",repeat:v=0,repeatDelay:oe=0,morphTo:F,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:I,onLeaveBack:fe}=a,K=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),_e=de(T.end??"bottom top"),Se=typeof J=="string"?document.querySelector(J):J??null,ve=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray($)?$[0]:null,j=Array.isArray($)?$[1]:typeof $=="number"?$:null,pe=Array.isArray(C)?C[0]:null,Q=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function Oe(o){let l=o*100;switch(K){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 _=K?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ge=0,N=false,z=false,q=0,Ae=false,ye=-1,te=-1,U=false,he=0,De=0,Ne,ot=null;function vt(){ot?.destroy(),ot=null;}let He=new Set,Et=NaN,Ve=true,Ke=-1,Tt=performance.now(),ze=NaN;function st(){return Se?W==="x"?Se.scrollLeft:Se.scrollTop:W==="x"?window.scrollX:window.scrollY}function xt(){return Se?W==="x"?Se.clientWidth:Se.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function At(){let o=rt(e,Se,W);return xe(o,o.scroll,xt(),Pe,_e)}function Mt(){(({tStart:f,tEnd:ge}=At())),$e&&je&&(vt(),ot=ur(f,ge,W));}function it(o,l=At){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),Le(e);},o}function Qt(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),K){let b=l==="reverse"?1-o:o;e.style.clipPath=Oe(b);return}_.forEach((b,ue)=>{b.style.strokeDashoffset=l==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),ve&&le?b.style.stroke=Be(ve,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),F&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],F,o));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),K){e.style.clipPath=Oe(0);return}_.forEach((o,l)=>{o.style.strokeDasharray=`${O[l]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${O[l]}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),F&&o.tagName.toLowerCase()==="path"&&i[l]&&o.setAttribute("d",i[l]);});}if(_.forEach(o=>{cr(o);let l=qe(o);O.push(l);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),F&&(b?mr(i[i.length-1],F,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=A==="reverse"?`${l}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Q!==null&&(o.style.fillOpacity=`${Q}`),F&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",F)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=A==="reverse"?"0":`${l}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),K){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof p=="string"?nt(p):null;function Zt(){return !(ae===false||!lr()||!_.length||!Ct||K||W!=="y"||Se||u!==1||V!==0||ne||X||k!==false||F||w||v||G>0||d||x||g||L||E||I||fe||M!=null||$!=null||C!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Jt(){let o=++ar,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ie=A==="reverse"?"0":"var(--ssd-len)",ke=A==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${Ie};`,S=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${A==="reverse"?1:0};`,S+=`opacity:${A==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${l}{from{${Me}}to{${S}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}_.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Te}=xe({top:y.top,height:y.height},st(),xt(),Pe,_e);return Ee(Z(st(),Y,Te,u))}return {destroy(){e.classList.remove(b),_.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),D.remove();},replay(){h=false,H=-1,_.forEach(me);},pause(){h=true,_.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,_.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,_.forEach((Te,be)=>{Te.classList.remove(l),Te.style.strokeDashoffset=A==="reverse"?`${O[be]*Y}`:`${O[be]*(1-Y)}`,m&&(Te.style.opacity=A==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return B()},refresh(){_.forEach((y,Y)=>{O[Y]=qe(y),y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`;});}}}if(Zt())return it(Jt());function er(){let o=Math.max(1,ee),l=0,b=0,ue=false;function Ie(h){let H=true;if(K){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Oe(A==="reverse"?1-y:y),d?.(y),B<1&&(H=false);}else _.forEach((B,y)=>{let Y=y*V*o,Te=Math.min(1,Math.max(0,(h-Y)/o)),be=Ee(Te);B.style.strokeDashoffset=A==="reverse"?`${O[y]*be}`:`${O[y]*(1-be)}`,m&&(B.style.opacity=A==="reverse"?`${1-be}`:`${be}`),ve&&le?B.style.stroke=Be(ve,le,be):le&&(B.style.stroke=le),ce!==null&&j!==null?B.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(B.style.strokeWidth=`${j}`),pe!==null&&Q!==null?B.style.fillOpacity=`${pe+(Q-pe)*be}`:Q!==null&&(B.style.fillOpacity=`${Q}`),F&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ct(i[y],F,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);for(let Y in w){let Te=parseFloat(Y);y>=Te&&!He.has(Te)&&(He.add(Te),w[Y]?.());}}return H}function ke(h){if(U)return;let H=h-l;z||(z=true,x?.());let B=Ie(H);if(B&&!N){N=true,Ie(o*(1+Math.max(0,_.length-1)*V)),g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,Ne=setTimeout(()=>{l=performance.now(),z=false,N=false,He.clear(),Qe(),q=requestAnimationFrame(ke);},oe));return}B||(q=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(q),clearTimeout(Ne),l=performance.now(),b=0,U=false,z=false,N=false,De=0,ue=true,he=0,He.clear(),Qe(),q=requestAnimationFrame(ke);}let S=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&N)?Me():!H.isIntersecting&&!ne&&!N&&(cancelAnimationFrame(q),clearTimeout(Ne),ue=false);});},{root:Se??null,threshold:R,rootMargin:P}),D;function me(){clearTimeout(D),D=setTimeout(()=>{_.forEach((h,H)=>{O[H]=qe(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>S.observe(e),G):S.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Ne),S.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(D);},replay(){De=0,Me();},pause(){U||!ue||(U=true,b=performance.now()-l,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,l=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,U=true,b=H*o,l=performance.now()-b,cancelAnimationFrame(q),Ie(b);},getProgress(){return he},refresh(){clearTimeout(D),_.forEach((h,H)=>{O[H]=qe(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(ie)return it(er());Mt();function Ze(){if(!Ae||U)return;let o=performance.now(),l=st();if(!Ve&&k===false&&l===Et){q=requestAnimationFrame(Ze);return}Ve=false,Et=l;let b=u;if(k!==false){let S=o-Tt,D=S>0?Math.abs(l-(Ke<0?l:Ke))/S:0;b=u*Math.max(.2,1+D*(typeof k=="number"?k:1)*.04);}Ke=l,Tt=o;let ue=X?te===-1||l>=te?"forward":"reverse":A;te=l;let Ie=ge-f,ke=true,Me=Ie===0?0:(l-f)/Ie;if(isNaN(ze)||(ze<=0&&Me>0?L?.():ze>0&&Me<=0&&fe?.(),ze<1&&Me>=1?E?.():ze>=1&&Me<1&&I?.()),ze=Me,K){let S=Ee(Z(l,f,ge,b));ne&&!X&&(ye=Math.max(ye,S),S=ye),he=S,e.style.setProperty("--scroll-draw-progress",String(S));let D=ue==="reverse"?1-S:S;e.style.clipPath=Oe(D),d?.(S),!z&&Z(l,f,ge,b)>0&&(z=true,x?.()),S>=1&&!N?(N=true,g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,Ne=setTimeout(()=>{ye=-1,z=false,N=false,e.style.clipPath=Oe(0);},oe))):S<1&&!ne&&(N=false),q=requestAnimationFrame(Ze);return}if(_.forEach((S,D)=>{let me=D*V*Ie,h=Ee(Z(l,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,S.style.strokeDashoffset=ue==="reverse"?`${O[D]*h}`:`${O[D]*(1-h)}`,m&&(S.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),ve&&le?S.style.stroke=Be(ve,le,h):le&&(S.style.stroke=le),ce!==null&&j!==null?S.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(S.style.strokeWidth=`${j}`),pe!==null&&Q!==null?S.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(S.style.fillOpacity=`${Q}`),F&&S.tagName.toLowerCase()==="path"&&i[D]&&S.setAttribute("d",ct(i[D],F,h)),D===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let S=Ee(Z(l,f,ge,b));for(let D in w){let me=parseFloat(D);S>=me&&!He.has(me)&&(He.add(me),w[D]?.());}}!z&&Z(l,f,ge,b)>0&&(z=true,x?.()),ke&&!N?(N=true,g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,Ne=setTimeout(()=>{ye=-1,z=false,N=false,He.clear(),Qe(),Ve=true;},oe))):!ke&&!ne&&(N=false),q=requestAnimationFrame(Ze);}let at=false;function Je(){at||(at=true,q=requestAnimationFrame(function(){Ze();}));}function et(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(l=>{Ae=l.isIntersecting,Ae&&!U?(Ve=true,Je()):et();});},{root:Se??null,threshold:R,rootMargin:P});function Lt(){_.forEach((o,l)=>{O[l]=qe(o),o.style.strokeDasharray=`${O[l]}`;}),Mt(),Ve=true;}let tt;function We(){clearTimeout(tt),tt=setTimeout(Lt,150);}window.addEventListener("resize",We),window.addEventListener("orientationchange",We);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>We()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Ne),et(),lt.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(tt),vt();},replay(){ye=-1,te=-1,Ke=-1,z=false,N=false,De=0,U=false,he=0,He.clear(),clearTimeout(Ne),Qe(),Ve=true,Ae&&Je();},pause(){U=true,et();},resume(){U&&(U=false,Ve=true,Ae&&Je());},seek(o){let l=Math.min(1,Math.max(0,o));he=l,ye=l,U=true,et(),Qt(l,A),Ve=true;},getProgress(){return he},refresh(){clearTimeout(tt),Lt(),Ae&&!U&&Je();}},()=>({tStart:f,tEnd:ge}))}var zt=new WeakMap,fr=0;function qt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=zt.get(r);return t===void 0&&zt.set(r,t=++fr),`el#${t}`}return r})}function Bt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...a)=>n()[t]?.(...a));return r}function pr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Wt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let a=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:a,units:s});}return n}function dr(e,n,r){let t=Wt(e),a=Wt(n);return t.length===0||t.length!==a.length?r<1?e:n:t.map((s,c)=>{let u=a[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Gt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),a=String(n);if(pr(t))return Be(t,a,r);if(t.includes("("))return dr(t,a,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:a}function gr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var yr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),hr=0,jt="--scroll-draw-progress";function br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:a={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:A=true,triggerElement:ne,onProgress:$e,onComplete:W,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:M}=n,$=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof s=="function"?s:re[s]??re["ease-out"],w=de(a.start??"top bottom"),k=de(a.end??"bottom top"),R=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,v=Object.entries(t).map(([i,f])=>({prop:gr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of v)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function F(){for(let i of v)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...v.map(f=>f.prop),jt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return F(),W?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?nt(s):null;function ae(){if(!T||!br()||!ee||m!=="y"||P||R!==e||u||c!==1||$e||W||J||X||G||M||V!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let i of v)if(!yr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++hr}`,f=v.map(te=>`${te.prop}:${te.from}`).join(";"),ge=v.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},z(),q(),w,k)};Ce(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),Le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let U=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of v)e.style.setProperty(he.prop,Gt(he.from,he.to,U));},getProgress(){let{tStart:te,tEnd:U}=Ae();return C(Z(z(),te,U,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,I=false,fe=-1,K=0,Ee=false,Pe=NaN,_e=-1,Se=0,ve=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=rt(R,P,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(jt,String(i));for(let f of v)e.style.setProperty(f.prop,Gt(f.from,f.to,i));$e?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&M?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Q(){if(!E||I)return;let i=performance.now(),f=ve(),ge=c;if(V!==false){let q=i-Se,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,Se=i;let N=g===x?0:(f-x)/(g-x);pe(N);let z=C(Z(f,x,g,ge));u&&(fe=Math.max(fe,z),z=fe),K=z,j(z),z>=1&&!Ee?(Ee=true,W?.()):z<1&&!u&&(Ee=false),L=requestAnimationFrame(Q);}ce(),g===x&&we("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=C(Z(ve(),x,g,c));u&&i>0&&(fe=i),K=i,j(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!I?L=requestAnimationFrame(Q):cancelAnimationFrame(L);});},{root:P??null}),_;function O(){clearTimeout(_),_=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Oe.observe(e),Ce(e,{type:"animate",getProgress:()=>K,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Oe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(_),ie(),Le(e);},replay(){fe=-1,Ee=false,K=0,I=false,j(0);},pause(){I=true,cancelAnimationFrame(L);},resume(){I&&(I=false,E&&(L=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));K=f,fe=f,I=true,cancelAnimationFrame(L),j(f);},getProgress(){return K}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ft;let t=r,{from:a=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,A=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],$e=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(s),V?.(),ft;let X=0,G=0,M=0,$=false,C=false,w=-1,k=0,R=false,P=()=>window.scrollY,v=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),v(),$e,W);X=x.tStart,G=x.tEnd;}function F(d){t.textContent=A(a+(s-a)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!$||C)return;let d=ne(Z(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,F(d),d>=1&&!R?(R=true,V?.()):d<1&&!p&&(R=false),M=requestAnimationFrame(se);}oe();{let d=ne(Z(P(),X,G,1));p&&d>0&&(w=d),k=d,F(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{$=x.isIntersecting,$&&!C?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Ce(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),Le(t);},replay(){w=-1,R=false,k=0,C=false,F(0);},pause(){C=true,cancelAnimationFrame(M);},resume(){C&&(C=false,$&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,C=true,cancelAnimationFrame(M),F(x);},getProgress(){return k}}}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n={}){if(typeof window>"u")return Ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ut;let t=r,{trigger:a={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,A=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,$e=de(a.start??"top top"),W=de(a.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,M=0,$=0,C=false,w=false,k=-1,R=0,P=false,v=false,oe=()=>u==="x"?window.scrollX:window.scrollY,F=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),I=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,K=xe({top:I,height:fe},oe(),F(),$e,W);G=K.tStart,M=K.tEnd;}let ie=NaN;function ee(E){if(!v)return;let I=X??t.duration??0,fe=J+(I-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!C||w||!v||A)return;let E=ne(Z(oe(),G,M,1));c&&(k=Math.max(k,E),E=k),R=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),$=requestAnimationFrame(ae);}function d(){if(v=true,X===void 0&&(X=t.duration),A){ee(1),p?.();return}se(),p?.(),C&&!w&&($=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),v||se();let x=new IntersectionObserver(E=>{E.forEach(I=>{C=I.isIntersecting,C&&!w&&v?$=requestAnimationFrame(ae):cancelAnimationFrame($);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Ce(t,{type:"video",getProgress:()=>R,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame($),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),Le(t);},replay(){k=-1,P=false,R=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,C&&v&&($=requestAnimationFrame(ae)));},seek(E){let I=Math.min(1,Math.max(0,E));R=I,k=I,w=true,cancelAnimationFrame($),ie=NaN,ee(I);},getProgress(){return R}}}function Kt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function wr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Yt(e){let n=Kt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],a=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of a){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function Sr(e,n,r,t){if(r<=1||t===0)return e;let a=(r-1)*t,s=n*t,c=s+(1-a);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function vr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Xt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Xt;let t=r,{split:a="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),$e=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;a==="chars"?J=wr(t):a==="lines"?J=Yt(t):J=Kt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=vr(L,u);E&&(g.style.transform=E);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let I=A(Sr(g,E,X,s));G(L,I);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let $=0,C=0,w=0,k=false,R=false,P=-1,v=0,oe=false,F=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},F(),se(),ne,$e);$=L.tStart,C=L.tEnd;}function ee(){if(!k||R)return;let g=Z(F(),$,C,1);p&&(P=Math.max(P,g),g=P),v=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!R?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(a==="lines"){let g=v;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),J=Yt(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Ce(t,{type:"text",getProgress:()=>v,getTrigger:()=>({tStart:$,tEnd:C})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=W,t.removeAttribute("aria-label"),Le(t);},replay(){P=-1,oe=false,v=0,R=false,M(0);},pause(){R=true,cancelAnimationFrame(w);},resume(){R&&(R=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));v=L,P=L,R=true,cancelAnimationFrame(w),M(L);},getProgress(){return v}}}var Xe=e=>typeof e=="function"?e():vue.unref(e);function Fe(e,n,r){let t=null,a=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Bt(a,()=>a)):null;};vue.onMounted(s),vue.watch(()=>qt(a=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function Mr(e={}){let n=vue.ref(null);return Fe(n,()=>Xe(e),ut),n}var yt=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>{let t={};return e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete),t},ut),()=>vue.h("div",{ref:r},n.default?.())}});function Cr(e){let n=vue.ref(null);return Fe(n,()=>Xe(e),mt),n}var ht=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options,mt),()=>vue.h("div",{ref:r},n.default?.())}});function Lr(e){let n=vue.ref(null);return Fe(n,()=>Xe(e),pt),n}var bt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Fe(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},pt),()=>vue.h("span",{ref:n})}});function $r(e={}){let n=vue.ref(null);return Fe(n,()=>Xe(e),dt),n}var wt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return Fe(n,()=>e.options??{},dt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Pr(e={}){let n=vue.ref(null);return Fe(n,()=>Xe(e),gt),n}var St=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options??{},gt),()=>vue.h(e.tag,{ref:r},n.default?.())}});function Rn(){return {install(e){e.component("ScrollDraw",yt),e.component("ScrollAnimate",ht),e.component("ScrollCounter",bt),e.component("ScrollVideo",wt),e.component("ScrollText",St);}}}exports.ScrollAnimate=ht;exports.ScrollCounter=bt;exports.ScrollDraw=yt;exports.ScrollText=St;exports.ScrollVideo=wt;exports.createScrollDrawPlugin=Rn;exports.useScrollAnimate=Cr;exports.useScrollCounter=Lr;exports.useScrollDraw=Mr;exports.useScrollText=Pr;exports.useScrollVideo=$r;
|
package/dist/nuxt/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,d,f,h,j}from'../chunk-
|
|
1
|
+
import {b,d,f,h,j}from'../chunk-ZZCTLVGT.mjs';export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-ZZCTLVGT.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-JC5BD4RB.mjs';import'../chunk-SNCRC6BA.mjs';import'../chunk-4MH5SQTH.mjs';import'../chunk-QJ4H2HW3.mjs';import'../chunk-WDIHLRZZ.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function s(){return {install(o){o.component("ScrollDraw",b),o.component("ScrollAnimate",d),o.component("ScrollCounter",f),o.component("ScrollVideo",h),o.component("ScrollText",j);}}}export{s as createScrollDrawPlugin};
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",i,{passive:true}),i(),{el:t,destroy(){window.removeEventListener("scroll",i),t.remove();}}}var Lt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Pt=/[MmLlHhVvCcSsQqTtAaZz]/g;function rr(e,n,r){if(!Be)return;let t=(e.match(Pt)??[]).join("").toUpperCase(),i=(n.match(Pt)??[]).join("").toUpperCase(),o=(e.match(Lt)??[]).length,a=(n.match(Lt)??[]).length;if(t!==i){ve(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}o!==a&&ve(`morphTo: coordinate count differs (${o} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function at(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let a=parseFloat(o),u=t[i++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function Ct(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...Et[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:S={},stagger:R=0,direction:M="forward",once:re=false,debug:Ee=false,axis:H="y",scrollContainer:W,autoReverse:O=false,delay:z=0,strokeColor:L,strokeWidth:P,fillOpacity:x,waypoints:b,velocityScale:C=false,threshold:k=0,rootMargin:w="0px",repeat:g=0,repeatDelay:j=0,morphTo:N,clip:B,autoplay:X=false,duration:ie=1e3,native:le=true,onProgress:d,onStart:$,onComplete:y,onEnter:I,onLeave:A,onEnterBack:V,onLeaveBack:pe}=i,ne=B===true?"left":typeof B=="string"?B:false,xe=typeof p=="function"?p:Z[p]??Z.linear,$e=se(S.start??"top bottom"),He=se(S.end??"bottom top"),Se=typeof W=="string"?document.querySelector(W):W??null,Te=Array.isArray(L)?L[0]:null,ce=Array.isArray(L)?L[1]:typeof L=="string"?L:null,ue=Array.isArray(P)?P[0]:null,K=Array.isArray(P)?P[1]:typeof P=="number"?P:null,de=Array.isArray(x)?x[0]:null,oe=Array.isArray(x)?x[1]:typeof x=="number"?x:null;function Re(s){let c=s*100;switch(ne){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let G=ne?[]:Array.from(e.querySelectorAll(a)),F=[],l=[],f=0,ge=0,_=false,U=false,Y=0,Me=false,ye=-1,ae=-1,ee=false,he=0,Ie=0,Fe,rt=null;function ct(){rt?.destroy(),rt=null;}let Oe=new Set,ut=NaN,De=true,je=-1,mt=performance.now(),ze=NaN;function nt(){return Se?H==="x"?Se.scrollLeft:Se.scrollTop:H==="x"?window.scrollX:window.scrollY}function ft(){return Se?H==="x"?Se.clientWidth:Se.clientHeight:H==="x"?window.innerWidth:window.innerHeight}function pt(){let s=Ke(e,Se,H);return we(s,s.scroll,ft(),$e,He)}function dt(){(({tStart:f,tEnd:ge}=pt())),Ee&&Be&&(ct(),rt=tr(f,ge,H));}function ot(s,c=pt){Pe(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let E=s.destroy;return s.destroy=()=>{E.call(s),Ce(e);},s}function qt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),ne){let E=c==="reverse"?1-s:s;e.style.clipPath=Re(E);return}G.forEach((E,me)=>{E.style.strokeDashoffset=c==="reverse"?`${F[me]*s}`:`${F[me]*(1-s)}`,m&&(E.style.opacity=c==="reverse"?`${1-s}`:`${s}`),Te&&ce?E.style.stroke=_e(Te,ce,s):ce&&(E.style.stroke=ce),ue!==null&&K!==null?E.style.strokeWidth=`${ue+(K-ue)*s}`:K!==null&&(E.style.strokeWidth=`${K}`),de!==null&&oe!==null?E.style.fillOpacity=`${de+(oe-de)*s}`:oe!==null&&(E.style.fillOpacity=`${oe}`),N&&E.tagName.toLowerCase()==="path"&&l[me]&&E.setAttribute("d",at(l[me],N,s));});}function Xe(){if(e.style.setProperty("--scroll-draw-progress","0"),ne){e.style.clipPath=Re(0);return}G.forEach((s,c)=>{s.style.strokeDasharray=`${F[c]}`,s.style.strokeDashoffset=M==="reverse"?"0":`${F[c]}`,m?s.style.opacity=M==="reverse"?"1":"0":s.style.opacity="",Te&&(s.style.stroke=Te),ue!==null&&(s.style.strokeWidth=`${ue}`),de!==null&&(s.style.fillOpacity=`${de}`),N&&s.tagName.toLowerCase()==="path"&&l[c]&&s.setAttribute("d",l[c]);});}if(G.forEach(s=>{er(s);let c=Ve(s);F.push(c);let E=s.tagName.toLowerCase()==="path";E?l.push(s.getAttribute("d")??""):l.push(""),N&&(E?rr(l[l.length-1],N,s):ve(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),o?(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=M==="reverse"?`${c}`:"0",m&&(s.style.opacity="1"),ce&&(s.style.stroke=ce),K!==null&&(s.style.strokeWidth=`${K}`),oe!==null&&(s.style.fillOpacity=`${oe}`),N&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",N)):(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=M==="reverse"?"0":`${c}`,m?s.style.opacity=M==="reverse"?"1":"0":s.style.opacity="",Te&&(s.style.stroke=Te),ue!==null&&(s.style.strokeWidth=`${ue}`),de!==null&&(s.style.fillOpacity=`${de}`));}),ne){if(o)return e.style.clipPath=Re(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Re(0);}else if(o)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof p=="string"?et(p):null;function Wt(){return !(le===false||!Kt()||!G.length||!gt||ne||H!=="y"||Se||u!==1||R!==0||re||O||C!==false||N||b||g||z>0||d||$||y||I||A||V||pe||L!=null||P!=null||x!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Bt(){let s=++Jt,c=`svg-scroll-draw-${s}`,E=`svg-scroll-draw-host-${s}`,me=`--svg-scroll-draw-${s}`,Ne=M==="reverse"?"0":"var(--ssd-len)",ke=M==="reverse"?"var(--ssd-len)":"0",Le=`stroke-dashoffset:${Ne};`,T=`stroke-dashoffset:${ke};`;m&&(Le+=`opacity:${M==="reverse"?1:0};`,T+=`opacity:${M==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${Le}}to{${T}}}.${E}{view-timeline-name:${me};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${me};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(E);function fe(h,te){h.style.setProperty("--ssd-len",String(F[te])),h.style.strokeDasharray=`${F[te]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(c);}G.forEach(fe);let v=false,q=-1;function Q(){if(q>=0)return q;let h=e.getBoundingClientRect(),{tStart:te,tEnd:Ae}=we({top:h.top,height:h.height},nt(),ft(),$e,He);return xe(J(nt(),te,Ae,u))}return {destroy(){e.classList.remove(E),G.forEach(h=>{h.classList.remove(c),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),D.remove();},replay(){v=false,q=-1,G.forEach(fe);},pause(){v=true,G.forEach(h=>{h.style.animationPlayState="paused";});},resume(){v&&(v=false,G.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let te=Math.min(1,Math.max(0,h));q=te,v=true,G.forEach((Ae,be)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=M==="reverse"?`${F[be]*te}`:`${F[be]*(1-te)}`,m&&(Ae.style.opacity=M==="reverse"?`${1-te}`:`${te}`);});},getProgress(){return Q()},refresh(){G.forEach((h,te)=>{F[te]=Ve(h),h.style.setProperty("--ssd-len",String(F[te])),h.style.strokeDasharray=`${F[te]}`;});}}}if(Wt())return ot(Bt());function Gt(){let s=Math.max(1,ie),c=0,E=0,me=false;function Ne(v){let q=true;if(ne){let Q=Math.min(1,Math.max(0,v/s)),h=xe(Q);he=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=Re(M==="reverse"?1-h:h),d?.(h),Q<1&&(q=false);}else G.forEach((Q,h)=>{let te=h*R*s,Ae=Math.min(1,Math.max(0,(v-te)/s)),be=xe(Ae);Q.style.strokeDashoffset=M==="reverse"?`${F[h]*be}`:`${F[h]*(1-be)}`,m&&(Q.style.opacity=M==="reverse"?`${1-be}`:`${be}`),Te&&ce?Q.style.stroke=_e(Te,ce,be):ce&&(Q.style.stroke=ce),ue!==null&&K!==null?Q.style.strokeWidth=`${ue+(K-ue)*be}`:K!==null&&(Q.style.strokeWidth=`${K}`),de!==null&&oe!==null?Q.style.fillOpacity=`${de+(oe-de)*be}`:oe!==null&&(Q.style.fillOpacity=`${oe}`),N&&Q.tagName.toLowerCase()==="path"&&l[h]&&Q.setAttribute("d",at(l[h],N,be)),h===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Ae<1&&(q=false);});if(b){let Q=Math.min(1,Math.max(0,v/s)),h=xe(Q);for(let te in b){let Ae=parseFloat(te);h>=Ae&&!Oe.has(Ae)&&(Oe.add(Ae),b[te]?.());}}return q}function ke(v){if(ee)return;let q=v-c;U||(U=true,$?.());let Q=Ne(q);if(Q&&!_){_=true,Ne(s*(1+Math.max(0,G.length-1)*R)),y?.(),Ie<(g==="infinite"?1/0:g??0)&&(Ie++,Fe=setTimeout(()=>{c=performance.now(),U=false,_=false,Oe.clear(),Xe(),Y=requestAnimationFrame(ke);},j));return}Q||(Y=requestAnimationFrame(ke));}function Le(){cancelAnimationFrame(Y),clearTimeout(Fe),c=performance.now(),E=0,ee=false,U=false,_=false,Ie=0,me=true,he=0,Oe.clear(),Xe(),Y=requestAnimationFrame(ke);}let T=new IntersectionObserver(v=>{v.forEach(q=>{q.isIntersecting&&!(re&&_)?Le():!q.isIntersecting&&!re&&!_&&(cancelAnimationFrame(Y),clearTimeout(Fe),me=false);});},{root:Se??null,threshold:k,rootMargin:w}),D;function fe(){clearTimeout(D),D=setTimeout(()=>{G.forEach((v,q)=>{F[q]=Ve(v),v.style.strokeDasharray=`${F[q]}`;});},150);}return window.addEventListener("resize",fe),window.addEventListener("orientationchange",fe),z>0?setTimeout(()=>T.observe(e),z):T.observe(e),{destroy(){cancelAnimationFrame(Y),clearTimeout(Fe),T.disconnect(),window.removeEventListener("resize",fe),window.removeEventListener("orientationchange",fe),clearTimeout(D);},replay(){Ie=0,Le();},pause(){ee||!me||(ee=true,E=performance.now()-c,cancelAnimationFrame(Y));},resume(){ee&&(ee=false,me=true,c=performance.now()-E,Y=requestAnimationFrame(ke));},seek(v){let q=Math.min(1,Math.max(0,v));he=q,ee=true,E=q*s,c=performance.now()-E,cancelAnimationFrame(Y),Ne(E);},getProgress(){return he},refresh(){clearTimeout(D),G.forEach((v,q)=>{F[q]=Ve(v),v.style.strokeDasharray=`${F[q]}`;});}}}if(X)return ot(Gt());dt();function Ye(){if(!Me||ee)return;let s=performance.now(),c=nt();if(!De&&C===false&&c===ut){Y=requestAnimationFrame(Ye);return}De=false,ut=c;let E=u;if(C!==false){let T=s-mt,D=T>0?Math.abs(c-(je<0?c:je))/T:0;E=u*Math.max(.2,1+D*(typeof C=="number"?C:1)*.04);}je=c,mt=s;let me=O?ae===-1||c>=ae?"forward":"reverse":M;ae=c;let Ne=ge-f,ke=true,Le=Ne===0?0:(c-f)/Ne;if(isNaN(ze)||(ze<=0&&Le>0?I?.():ze>0&&Le<=0&&pe?.(),ze<1&&Le>=1?A?.():ze>=1&&Le<1&&V?.()),ze=Le,ne){let T=xe(J(c,f,ge,E));re&&!O&&(ye=Math.max(ye,T),T=ye),he=T,e.style.setProperty("--scroll-draw-progress",String(T));let D=me==="reverse"?1-T:T;e.style.clipPath=Re(D),d?.(T),!U&&J(c,f,ge,E)>0&&(U=true,$?.()),T>=1&&!_?(_=true,y?.(),Ie<(g==="infinite"?1/0:g??0)&&(Ie++,Fe=setTimeout(()=>{ye=-1,U=false,_=false,e.style.clipPath=Re(0);},j))):T<1&&!re&&(_=false),Y=requestAnimationFrame(Ye);return}if(G.forEach((T,D)=>{let fe=D*R*Ne,v=xe(J(c,f+fe,ge+fe,E));re&&!O&&(ye=Math.max(ye,v),v=ye),he=v,T.style.strokeDashoffset=me==="reverse"?`${F[D]*v}`:`${F[D]*(1-v)}`,m&&(T.style.opacity=me==="reverse"?`${1-v}`:`${v}`),Te&&ce?T.style.stroke=_e(Te,ce,v):ce&&(T.style.stroke=ce),ue!==null&&K!==null?T.style.strokeWidth=`${ue+(K-ue)*v}`:K!==null&&(T.style.strokeWidth=`${K}`),de!==null&&oe!==null?T.style.fillOpacity=`${de+(oe-de)*v}`:oe!==null&&(T.style.fillOpacity=`${oe}`),N&&T.tagName.toLowerCase()==="path"&&l[D]&&T.setAttribute("d",at(l[D],N,v)),D===0&&(d?.(v),e.style.setProperty("--scroll-draw-progress",String(v))),v<1&&(ke=false);}),b){let T=xe(J(c,f,ge,E));for(let D in b){let fe=parseFloat(D);T>=fe&&!Oe.has(fe)&&(Oe.add(fe),b[D]?.());}}!U&&J(c,f,ge,E)>0&&(U=true,$?.()),ke&&!_?(_=true,y?.(),Ie<(g==="infinite"?1/0:g??0)&&(Ie++,Fe=setTimeout(()=>{ye=-1,U=false,_=false,Oe.clear(),Xe(),De=true;},j))):!ke&&!re&&(_=false),Y=requestAnimationFrame(Ye);}let st=false;function Qe(){st||(st=true,Y=requestAnimationFrame(function(){Ye();}));}function Ze(){st=false,cancelAnimationFrame(Y);}let it=new IntersectionObserver(s=>{s.forEach(c=>{Me=c.isIntersecting,Me&&!ee?(De=true,Qe()):Ze();});},{root:Se??null,threshold:k,rootMargin:w});function yt(){G.forEach((s,c)=>{F[c]=Ve(s),s.style.strokeDasharray=`${F[c]}`;}),dt(),De=true;}let Je;function qe(){clearTimeout(Je),Je=setTimeout(yt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),z>0?setTimeout(()=>it.observe(e),z):it.observe(e),ot({destroy(){cancelAnimationFrame(Y),clearTimeout(Fe),Ze(),it.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Je),ct();},replay(){ye=-1,ae=-1,je=-1,U=false,_=false,Ie=0,ee=false,he=0,Oe.clear(),clearTimeout(Fe),Xe(),De=true,Me&&Qe();},pause(){ee=true,Ze();},resume(){ee&&(ee=false,De=true,Me&&Qe());},seek(s){let c=Math.min(1,Math.max(0,s));he=c,ye=c,ee=true,Ze(),qt(c,M),De=true;},getProgress(){return he},refresh(){clearTimeout(Je),yt(),Me&&!ee&&Qe();}},()=>({tStart:f,tEnd:ge}))}function nr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],o=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(m?parseFloat(m[1]):0),o.push(m?m[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function or(e,n,r){let t=$t(e),i=$t(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,a)=>{let u=i[a];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((m,p)=>`${m}${o.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${o.fn}(${o.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${o.units[p]}`).join(", ")})`}).join(" ")}function Rt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(nr(t))return _e(t,i,r);if(t.includes("("))return or(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),a=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&a){let u=parseFloat(o[1]),m=parseFloat(a[1]);return `${u+(m-u)*r}${o[2]||a[2]}`}return r<1?t:i}function sr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ir=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),ar=0,kt="--scroll-draw-progress";function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function It(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:p,native:S=true,velocityScale:R=false,respectReducedMotion:M=true,triggerElement:re,onProgress:Ee,onComplete:H,onEnter:W,onLeave:O,onEnterBack:z,onLeaveBack:L}=n,P=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof o=="function"?o:Z[o]??Z["ease-out"],b=se(i.start??"top bottom"),C=se(i.end??"bottom top"),k=re??e,w=typeof p=="string"?document.querySelector(p):p??null,g=Object.entries(t).map(([l,f])=>({prop:sr(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function j(){let l=window.getComputedStyle(e);for(let f of g)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function N(){for(let l of g)e.style.setProperty(l.prop,String(l.to));}let B=new Map;for(let l of [...g.map(f=>f.prop),kt])B.set(l,e.style.getPropertyValue(l));function X(){for(let[l,f]of B)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(P)return N(),H?.(),{...r,destroy:X,getProgress:()=>1};j();let ie=typeof o=="string"?et(o):null;function le(){if(!S||!lr()||!ie||m!=="y"||w||k!==e||u||a!==1||Ee||H||W||O||z||L||R!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let l of g)if(!ir.has(l.prop))return false;return true}function d(){let l=`ssd-a-${++ar}`,f=g.map(ae=>`${ae.prop}:${ae.from}`).join(";"),ge=g.map(ae=>`${ae.prop}:${ae.to}`).join(";"),_=document.createElement("style");_.setAttribute("data-ssd-animate",""),_.textContent=`@keyframes ${l}{from{${f}}to{${ge}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${ie};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(_),e.classList.add(l);let U=()=>m==="x"?window.scrollX:window.scrollY,Y=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let ae=e.getBoundingClientRect();return we({top:ae.top,height:ae.height},U(),Y(),b,C)};Pe(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Me});let ye={destroy(){e.classList.remove(l),_.remove(),e.style.animationPlayState="",X(),Ce(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(ae){let ee=Math.min(1,Math.max(0,ae));e.classList.remove(l);for(let he of g)e.style.setProperty(he.prop,Rt(he.from,he.to,ee));},getProgress(){let{tStart:ae,tEnd:ee}=Me();return x(J(U(),ae,ee,a))}};return ye}if(le())return d();let $=0,y=0,I=0,A=false,V=false,pe=-1,ne=0,xe=false,$e=NaN,He=-1,Se=0,Te=()=>w?m==="x"?w.scrollLeft:w.scrollTop:m==="x"?window.scrollX:window.scrollY,ce=()=>w?m==="x"?w.clientWidth:w.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ue(){let l=Ke(k,w,m),f=we(l,l.scroll,ce(),b,C);$=f.tStart,y=f.tEnd;}function K(l){e.style.setProperty(kt,String(l));for(let f of g)e.style.setProperty(f.prop,Rt(f.from,f.to,l));Ee?.(l);}function de(l){if(isNaN($e)){$e=l;return}$e<=0&&l>0?W?.():$e>0&&l<=0&&L?.(),$e<1&&l>=1?O?.():$e>=1&&l<1&&z?.(),$e=l;}function oe(){if(!A||V)return;let l=performance.now(),f=Te(),ge=a;if(R!==false){let Y=l-Se,Me=Y>0?Math.abs(f-(He<0?f:He))/Y:0;ge=a*Math.max(.2,1+Me*(typeof R=="number"?R:1)*.04);}He=f,Se=l;let _=y===$?0:(f-$)/(y-$);de(_);let U=x(J(f,$,y,ge));u&&(pe=Math.max(pe,U),U=pe),ne=U,K(U),U>=1&&!xe?(xe=true,H?.()):U<1&&!u&&(xe=false),I=requestAnimationFrame(oe);}ue(),y===$&&ve("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=x(J(Te(),$,y,a));u&&l>0&&(pe=l),ne=l,K(l);}let Re=new IntersectionObserver(l=>{l.forEach(f=>{A=f.isIntersecting,A&&!V?I=requestAnimationFrame(oe):cancelAnimationFrame(I);});},{root:w??null}),G;function F(){clearTimeout(G),G=setTimeout(ue,150);}return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),Re.observe(e),Pe(e,{type:"animate",getProgress:()=>ne,getTrigger:()=>({tStart:$,tEnd:y})}),{destroy(){cancelAnimationFrame(I),Re.disconnect(),window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F),clearTimeout(G),X(),Ce(e);},replay(){pe=-1,xe=false,ne=0,V=false,K(0);},pause(){V=true,cancelAnimationFrame(I);},resume(){V&&(V=false,A&&(I=requestAnimationFrame(oe)));},seek(l){let f=Math.min(1,Math.max(0,l));ne=f,pe=f,V=true,cancelAnimationFrame(I),K(f);},getProgress(){return ne}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Nt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ve("scrollCounter: element not found:",e),lt;let t=r,{from:i=0,to:o,format:a,easing:u="ease-out",trigger:m={},once:p=true,decimals:S,onComplete:R}=n,M=S!==void 0?d=>d.toFixed(S):a??(d=>String(Math.round(d))),re=typeof u=="function"?u:Z[u]??Z["ease-out"],Ee=se(m.start??"top 80%"),H=se(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=M(o),R?.(),lt;let O=0,z=0,L=0,P=false,x=false,b=-1,C=0,k=false,w=()=>window.scrollY,g=()=>window.innerHeight;function j(){let d=t.getBoundingClientRect(),$=we({top:d.top,height:d.height},w(),g(),Ee,H);O=$.tStart,z=$.tEnd;}function N(d){t.textContent=M(i+(o-i)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function B(){if(!P||x)return;let d=re(J(w(),O,z,1));p&&(b=Math.max(b,d),d=b),C=d,N(d),d>=1&&!k?(k=true,R?.()):d<1&&!p&&(k=false),L=requestAnimationFrame(B);}j();{let d=re(J(w(),O,z,1));p&&d>0&&(b=d),C=d,N(d);}let X=new IntersectionObserver(d=>{d.forEach($=>{P=$.isIntersecting,P&&!x?L=requestAnimationFrame(B):cancelAnimationFrame(L);});}),ie;function le(){clearTimeout(ie),ie=setTimeout(j,150);}return window.addEventListener("resize",le),window.addEventListener("orientationchange",le),X.observe(t),Pe(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:O,tEnd:z})}),{destroy(){cancelAnimationFrame(L),X.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),clearTimeout(ie),Ce(t);},replay(){b=-1,k=false,C=0,x=false,N(0);},pause(){x=true,cancelAnimationFrame(L);},resume(){x&&(x=false,P&&(L=requestAnimationFrame(B)));},seek(d){let $=Math.min(1,Math.max(0,d));C=$,b=$,x=true,cancelAnimationFrame(L),N($);},getProgress(){return C}}}var Ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ot(e,n={}){if(typeof window>"u")return Ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ve("scrollVideo: <video> element not found:",e),Ft;let t=r,{trigger:i={},easing:o="linear",once:a=false,axis:u="y",preload:m="auto",onReady:p,onComplete:S,onProgress:R}=n,M=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof o=="function"?o:Z[o]??Z.linear,Ee=se(i.start??"top top"),H=se(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let W=n.from??0,O=n.to,z=0,L=0,P=0,x=false,b=false,C=-1,k=0,w=false,g=false,j=()=>u==="x"?window.scrollX:window.scrollY,N=()=>u==="x"?window.innerWidth:window.innerHeight;function B(){let A=t.getBoundingClientRect(),V=u==="x"?A.left:A.top,pe=u==="x"?A.width:A.height,ne=we({top:V,height:pe},j(),N(),Ee,H);z=ne.tStart,L=ne.tEnd;}let X=NaN;function ie(A){if(!g)return;let V=O??t.duration??0,pe=W+(V-W)*A;pe!==X&&(X=pe,t.currentTime=pe),t.style.setProperty("--scroll-draw-progress",String(A)),R?.(A);}function le(){if(!x||b||!g||M)return;let A=re(J(j(),z,L,1));a&&(C=Math.max(C,A),A=C),k=A,ie(A),A>=1&&!w?(w=true,S?.()):A<1&&!a&&(w=false),P=requestAnimationFrame(le);}function d(){if(g=true,O===void 0&&(O=t.duration),M){ie(1),p?.();return}B(),p?.(),x&&!b&&(P=requestAnimationFrame(le));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),g||B();let $=new IntersectionObserver(A=>{A.forEach(V=>{x=V.isIntersecting,x&&!b&&g?P=requestAnimationFrame(le):cancelAnimationFrame(P);});}),y;function I(){clearTimeout(y),y=setTimeout(B,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),$.observe(t),Pe(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:z,tEnd:L})}),{destroy(){cancelAnimationFrame(P),$.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(y),Ce(t);},replay(){C=-1,w=false,k=0,b=false,X=NaN,ie(0);},pause(){b=true,cancelAnimationFrame(P);},resume(){b&&(b=false,x&&g&&(P=requestAnimationFrame(le)));},seek(A){let V=Math.min(1,Math.max(0,A));k=V,C=V,b=true,cancelAnimationFrame(P),X=NaN,ie(V);},getProgress(){return k}}}function zt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function cr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Dt(e){let n=zt(e),r=new Map;for(let o of n){let a=o.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(o);}let t=[],i=Array.from(r.keys()).sort((o,a)=>o-a);for(let o of i){let a=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",a.forEach((m,p)=>{let S=m.nextElementSibling;u.appendChild(m),p<a.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((o,a)=>{e.appendChild(o),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function ur(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,a=o+(1-i);return a<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(a-o)))}function mr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Vt(e,n={}){if(typeof window>"u")return Ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ve("scrollText: element not found:",e),Ht;let t=r,{split:i="words",stagger:o=.04,easing:a="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:S}=n,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof a=="function"?a:Z[a]??Z["ease-out"],re=se(m.start??"top 85%"),Ee=se(m.end??"top 40%"),H=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let W;i==="chars"?W=cr(t):i==="lines"?W=Dt(t):W=zt(t);let O=W.length;function z(y,I){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*I));let A=mr(I,u);A&&(y.style.transform=A);}function L(y){t.style.setProperty("--scroll-draw-progress",String(y)),W.forEach((I,A)=>{let V=M(ur(y,A,O,o));z(I,V);});}if(R)return L(1),S?.(),{destroy(){t.innerHTML=H,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};L(0);let P=0,x=0,b=0,C=false,k=false,w=-1,g=0,j=false,N=()=>window.scrollY,B=()=>window.innerHeight;function X(){let y=t.getBoundingClientRect(),I=we({top:y.top,height:y.height},N(),B(),re,Ee);P=I.tStart,x=I.tEnd;}function ie(){if(!C||k)return;let y=J(N(),P,x,1);p&&(w=Math.max(w,y),y=w),g=y,L(y),y>=1&&!j?(j=true,S?.()):y<1&&!p&&(j=false),b=requestAnimationFrame(ie);}X();let le=new IntersectionObserver(y=>{y.forEach(I=>{C=I.isIntersecting,C&&!k?b=requestAnimationFrame(ie):cancelAnimationFrame(b);});}),d;function $(){clearTimeout(d),d=setTimeout(()=>{if(i==="lines"){let y=g;t.innerHTML=H,t.setAttribute("aria-label",t.textContent??""),W=Dt(t),L(y);}X();},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),le.observe(t),Pe(t,{type:"text",getProgress:()=>g,getTrigger:()=>({tStart:P,tEnd:x})}),{destroy(){cancelAnimationFrame(b),le.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(d),t.innerHTML=H,t.removeAttribute("aria-label"),Ce(t);},replay(){w=-1,j=false,g=0,k=false,L(0);},pause(){k=true,cancelAnimationFrame(b);},resume(){k&&(k=false,C&&(b=requestAnimationFrame(ie)));},seek(y){let I=Math.min(1,Math.max(0,y));g=I,w=I,k=true,cancelAnimationFrame(b),L(I);},getProgress(){return g}}}function dr(e,n={}){let[r,t]=gr.useState(0),i=gr.useRef(n);i.current=n;let o=gr.useRef(-1);return gr.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let a=typeof e=="string"?document.querySelector(e):e.current;if(!a)return;let u=a,{axis:m="y",scrollContainer:p,trigger:S={}}=i.current,R=typeof p=="string"?document.querySelector(p):p??null,M=se(S.start??"top bottom"),re=se(S.end??"bottom top"),Ee=0,H=0,W=false,O=0;function z(){return R?m==="x"?R.scrollLeft:R.scrollTop:m==="x"?window.scrollX:window.scrollY}function L(){return R?m==="x"?R.clientWidth:R.clientHeight:m==="x"?window.innerWidth:window.innerHeight}function P(){let w=u.getBoundingClientRect(),g=z(),j=m==="x"?w.left:w.top,N=m==="x"?w.width:w.height,B=we({top:j,height:N},g,L(),M,re);Ee=B.tStart,H=B.tEnd;}function x(){if(!W)return;let{speed:w=1,easing:g="linear",once:j=false}=i.current,N=typeof g=="function"?g:Z[g]??Z.linear,B=J(z(),Ee,H,w),X=N(B);j&&(o.current=Math.max(o.current,X),X=o.current),t(X),O=requestAnimationFrame(x);}let b=new IntersectionObserver(w=>{w.forEach(g=>{W=g.isIntersecting,W?O=requestAnimationFrame(x):cancelAnimationFrame(O);});},{root:R??null,threshold:0});P(),b.observe(u);let C;function k(){clearTimeout(C),C=setTimeout(P,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),()=>{cancelAnimationFrame(O),clearTimeout(C),b.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k);}},[]),r}function bn({children:e,className:n,style:r,...t}){let i=gr.useRef(null);return gr.useEffect(()=>{if(!i.current)return;let o=Ct(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function wn({children:e,className:n,style:r,...t}){let i=gr.useRef(null);return gr.useEffect(()=>{if(!i.current)return;let o=It(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function vn({className:e,style:n,...r}){let t=gr.useRef(null);return gr.useEffect(()=>{if(!t.current)return;let i=Nt(t.current,r);return ()=>i.destroy()},[]),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function En({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let a=gr.useRef(null);return gr.useEffect(()=>{if(!a.current)return;let u=Ot(a.current,o);return ()=>u.destroy()},[]),jsxRuntime.jsx("video",{ref:a,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function Sn({children:e,as:n="p",className:r,style:t,...i}){let o=gr.useRef(null);return gr.useEffect(()=>{if(!o.current)return;let a=Vt(o.current,i);return ()=>a.destroy()},[]),gr__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=wn;exports.ScrollCounter=vn;exports.ScrollDraw=bn;exports.ScrollText=Sn;exports.ScrollVideo=En;exports.useScrollDrawProgress=dr;
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var wr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var wr__default=/*#__PURE__*/_interopDefault(wr);function Yt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,l=[];for(let p=0;p<r;p++){let S=Math.pow(i,p);l.push(S),o+=S;}let u=[0],m=0;for(let p=0;p<r;p++)m+=l[p]/o,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let S=0;S<r;S++)if(p<=u[S+1]){let k=(p-u[S])/(u[S+1]-u[S]);if(S===0)return k*(2-k);let M=1-Math.pow(t,S);return M+(1-M)*(2*k-1)*(2*k-1)}return 1}}function Kt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var 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:Yt(),elastic:Kt()};function ht(e,n,r){return Math.min(r,Math.max(n,e))}function se(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 bt(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 wt(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 J(e,n,r,t){return r===n?0:ht((e-n)/(r-n)*t,0,1)}function we(e,n,r,t,i){let o=bt(e.top,e.height,n,t.element)-wt(t.viewport,r),l=bt(e.top,e.height,n,i.element)-wt(i.viewport,r);return {tStart:o,tEnd:l}}function Ze(e,n,r){let t=e.getBoundingClientRect(),i=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:i,scroll:0}:{top:r==="x"?t.left:t.top,height:i,scroll:r==="x"?window.scrollX:window.scrollY}}function Ve(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function vt(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=vt(e),i=vt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ve(e,...n){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Jt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function er(e){let n=[];for(let r=0;r<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return Qt;case "ease-out":return Jt;case "ease-in-out":return Zt()?er(Q["ease-in-out"]):null;default:return null}}var Tt=Symbol.for("svg-scroll-draw.registry");function xt(){let e=globalThis;return e[Tt]||(e[Tt]=new Map)}function Pe(e,n){xt().set(e,n);}function Ce(e){xt().delete(e);}var tr=0;function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function At(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Mt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function nr(e){if(!Ge)return;let n=At(e,"stroke");if(!n||n==="none"){ve("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Mt.has(r)&&!Mt.has(At(e,"fill"))&&ve("Element has a fill \u2014 it may obscure the stroke animation.",e);}function or(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function i(){let o=r==="x"?window.scrollX:window.scrollY,l=e-o,u=n-o,m=r==="x";t.innerHTML=`
|
|
3
|
+
<div style="position:absolute;${m?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
4
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",i,{passive:true}),i(),{el:t,destroy(){window.removeEventListener("scroll",i),t.remove();}}}var Lt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Pt=/[MmLlHhVvCcSsQqTtAaZz]/g;function sr(e,n,r){if(!Ge)return;let t=(e.match(Pt)??[]).join("").toUpperCase(),i=(n.match(Pt)??[]).join("").toUpperCase(),o=(e.match(Lt)??[]).length,l=(n.match(Lt)??[]).length;if(t!==i){ve(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}o!==l&&ve(`morphTo: coordinate count differs (${o} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function at(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let l=parseFloat(o),u=t[i++]??l;return String(+(l+(u-l)*r).toFixed(4))})}function Ct(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...Et[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:S={},stagger:k=0,direction:M="forward",once:re=false,debug:Ee=false,axis:H="y",scrollContainer:W,autoReverse:N=false,delay:z=0,strokeColor:L,strokeWidth:P,fillOpacity:x,waypoints:b,velocityScale:C=false,threshold:R=0,rootMargin:w="0px",repeat:g=0,repeatDelay:U=0,morphTo:I,clip:B,autoplay:X=false,duration:ie=1e3,native:le=true,onProgress:d,onStart:$,onComplete:y,onEnter:O,onLeave:A,onEnterBack:V,onLeaveBack:pe}=i,ne=B===true?"left":typeof B=="string"?B:false,xe=typeof p=="function"?p:Q[p]??Q.linear,$e=se(S.start??"top bottom"),He=se(S.end??"bottom top"),Se=typeof W=="string"?document.querySelector(W):W??null,Te=Array.isArray(L)?L[0]:null,ce=Array.isArray(L)?L[1]:typeof L=="string"?L:null,ue=Array.isArray(P)?P[0]:null,Z=Array.isArray(P)?P[1]:typeof P=="number"?P:null,de=Array.isArray(x)?x[0]:null,oe=Array.isArray(x)?x[1]:typeof x=="number"?x:null;function ke(s){let c=s*100;switch(ne){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let G=ne?[]:Array.from(e.querySelectorAll(l)),F=[],a=[],f=0,ge=0,_=false,j=false,Y=0,Me=false,ye=-1,ae=-1,ee=false,he=0,Oe=0,Fe,rt=null;function ct(){rt?.destroy(),rt=null;}let Ne=new Set,ut=NaN,De=true,Ue=-1,mt=performance.now(),ze=NaN;function nt(){return Se?H==="x"?Se.scrollLeft:Se.scrollTop:H==="x"?window.scrollX:window.scrollY}function ft(){return Se?H==="x"?Se.clientWidth:Se.clientHeight:H==="x"?window.innerWidth:window.innerHeight}function pt(){let s=Ze(e,Se,H);return we(s,s.scroll,ft(),$e,He)}function dt(){(({tStart:f,tEnd:ge}=pt())),Ee&&Ge&&(ct(),rt=or(f,ge,H));}function ot(s,c=pt){Pe(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let E=s.destroy;return s.destroy=()=>{E.call(s),Ce(e);},s}function Gt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),ne){let E=c==="reverse"?1-s:s;e.style.clipPath=ke(E);return}G.forEach((E,me)=>{E.style.strokeDashoffset=c==="reverse"?`${F[me]*s}`:`${F[me]*(1-s)}`,m&&(E.style.opacity=c==="reverse"?`${1-s}`:`${s}`),Te&&ce?E.style.stroke=_e(Te,ce,s):ce&&(E.style.stroke=ce),ue!==null&&Z!==null?E.style.strokeWidth=`${ue+(Z-ue)*s}`:Z!==null&&(E.style.strokeWidth=`${Z}`),de!==null&&oe!==null?E.style.fillOpacity=`${de+(oe-de)*s}`:oe!==null&&(E.style.fillOpacity=`${oe}`),I&&E.tagName.toLowerCase()==="path"&&a[me]&&E.setAttribute("d",at(a[me],I,s));});}function Xe(){if(e.style.setProperty("--scroll-draw-progress","0"),ne){e.style.clipPath=ke(0);return}G.forEach((s,c)=>{s.style.strokeDasharray=`${F[c]}`,s.style.strokeDashoffset=M==="reverse"?"0":`${F[c]}`,m?s.style.opacity=M==="reverse"?"1":"0":s.style.opacity="",Te&&(s.style.stroke=Te),ue!==null&&(s.style.strokeWidth=`${ue}`),de!==null&&(s.style.fillOpacity=`${de}`),I&&s.tagName.toLowerCase()==="path"&&a[c]&&s.setAttribute("d",a[c]);});}if(G.forEach(s=>{nr(s);let c=Ve(s);F.push(c);let E=s.tagName.toLowerCase()==="path";E?a.push(s.getAttribute("d")??""):a.push(""),I&&(E?sr(a[a.length-1],I,s):ve(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),o?(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=M==="reverse"?`${c}`:"0",m&&(s.style.opacity="1"),ce&&(s.style.stroke=ce),Z!==null&&(s.style.strokeWidth=`${Z}`),oe!==null&&(s.style.fillOpacity=`${oe}`),I&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",I)):(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=M==="reverse"?"0":`${c}`,m?s.style.opacity=M==="reverse"?"1":"0":s.style.opacity="",Te&&(s.style.stroke=Te),ue!==null&&(s.style.strokeWidth=`${ue}`),de!==null&&(s.style.fillOpacity=`${de}`));}),ne){if(o)return e.style.clipPath=ke(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=ke(0);}else if(o)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof p=="string"?et(p):null;function jt(){return !(le===false||!rr()||!G.length||!gt||ne||H!=="y"||Se||u!==1||k!==0||re||N||C!==false||I||b||g||z>0||d||$||y||O||A||V||pe||L!=null||P!=null||x!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Ut(){let s=++tr,c=`svg-scroll-draw-${s}`,E=`svg-scroll-draw-host-${s}`,me=`--svg-scroll-draw-${s}`,Ie=M==="reverse"?"0":"var(--ssd-len)",Re=M==="reverse"?"var(--ssd-len)":"0",Le=`stroke-dashoffset:${Ie};`,T=`stroke-dashoffset:${Re};`;m&&(Le+=`opacity:${M==="reverse"?1:0};`,T+=`opacity:${M==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${Le}}to{${T}}}.${E}{view-timeline-name:${me};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${me};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(E);function fe(h,te){h.style.setProperty("--ssd-len",String(F[te])),h.style.strokeDasharray=`${F[te]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(c);}G.forEach(fe);let v=false,q=-1;function K(){if(q>=0)return q;let h=e.getBoundingClientRect(),{tStart:te,tEnd:Ae}=we({top:h.top,height:h.height},nt(),ft(),$e,He);return xe(J(nt(),te,Ae,u))}return {destroy(){e.classList.remove(E),G.forEach(h=>{h.classList.remove(c),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),D.remove();},replay(){v=false,q=-1,G.forEach(fe);},pause(){v=true,G.forEach(h=>{h.style.animationPlayState="paused";});},resume(){v&&(v=false,G.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let te=Math.min(1,Math.max(0,h));q=te,v=true,G.forEach((Ae,be)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=M==="reverse"?`${F[be]*te}`:`${F[be]*(1-te)}`,m&&(Ae.style.opacity=M==="reverse"?`${1-te}`:`${te}`);});},getProgress(){return K()},refresh(){G.forEach((h,te)=>{F[te]=Ve(h),h.style.setProperty("--ssd-len",String(F[te])),h.style.strokeDasharray=`${F[te]}`;});}}}if(jt())return ot(Ut());function Xt(){let s=Math.max(1,ie),c=0,E=0,me=false;function Ie(v){let q=true;if(ne){let K=Math.min(1,Math.max(0,v/s)),h=xe(K);he=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=ke(M==="reverse"?1-h:h),d?.(h),K<1&&(q=false);}else G.forEach((K,h)=>{let te=h*k*s,Ae=Math.min(1,Math.max(0,(v-te)/s)),be=xe(Ae);K.style.strokeDashoffset=M==="reverse"?`${F[h]*be}`:`${F[h]*(1-be)}`,m&&(K.style.opacity=M==="reverse"?`${1-be}`:`${be}`),Te&&ce?K.style.stroke=_e(Te,ce,be):ce&&(K.style.stroke=ce),ue!==null&&Z!==null?K.style.strokeWidth=`${ue+(Z-ue)*be}`:Z!==null&&(K.style.strokeWidth=`${Z}`),de!==null&&oe!==null?K.style.fillOpacity=`${de+(oe-de)*be}`:oe!==null&&(K.style.fillOpacity=`${oe}`),I&&K.tagName.toLowerCase()==="path"&&a[h]&&K.setAttribute("d",at(a[h],I,be)),h===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Ae<1&&(q=false);});if(b){let K=Math.min(1,Math.max(0,v/s)),h=xe(K);for(let te in b){let Ae=parseFloat(te);h>=Ae&&!Ne.has(Ae)&&(Ne.add(Ae),b[te]?.());}}return q}function Re(v){if(ee)return;let q=v-c;j||(j=true,$?.());let K=Ie(q);if(K&&!_){_=true,Ie(s*(1+Math.max(0,G.length-1)*k)),y?.(),Oe<(g==="infinite"?1/0:g??0)&&(Oe++,Fe=setTimeout(()=>{c=performance.now(),j=false,_=false,Ne.clear(),Xe(),Y=requestAnimationFrame(Re);},U));return}K||(Y=requestAnimationFrame(Re));}function Le(){cancelAnimationFrame(Y),clearTimeout(Fe),c=performance.now(),E=0,ee=false,j=false,_=false,Oe=0,me=true,he=0,Ne.clear(),Xe(),Y=requestAnimationFrame(Re);}let T=new IntersectionObserver(v=>{v.forEach(q=>{q.isIntersecting&&!(re&&_)?Le():!q.isIntersecting&&!re&&!_&&(cancelAnimationFrame(Y),clearTimeout(Fe),me=false);});},{root:Se??null,threshold:R,rootMargin:w}),D;function fe(){clearTimeout(D),D=setTimeout(()=>{G.forEach((v,q)=>{F[q]=Ve(v),v.style.strokeDasharray=`${F[q]}`;});},150);}return window.addEventListener("resize",fe),window.addEventListener("orientationchange",fe),z>0?setTimeout(()=>T.observe(e),z):T.observe(e),{destroy(){cancelAnimationFrame(Y),clearTimeout(Fe),T.disconnect(),window.removeEventListener("resize",fe),window.removeEventListener("orientationchange",fe),clearTimeout(D);},replay(){Oe=0,Le();},pause(){ee||!me||(ee=true,E=performance.now()-c,cancelAnimationFrame(Y));},resume(){ee&&(ee=false,me=true,c=performance.now()-E,Y=requestAnimationFrame(Re));},seek(v){let q=Math.min(1,Math.max(0,v));he=q,ee=true,E=q*s,c=performance.now()-E,cancelAnimationFrame(Y),Ie(E);},getProgress(){return he},refresh(){clearTimeout(D),G.forEach((v,q)=>{F[q]=Ve(v),v.style.strokeDasharray=`${F[q]}`;});}}}if(X)return ot(Xt());dt();function Ye(){if(!Me||ee)return;let s=performance.now(),c=nt();if(!De&&C===false&&c===ut){Y=requestAnimationFrame(Ye);return}De=false,ut=c;let E=u;if(C!==false){let T=s-mt,D=T>0?Math.abs(c-(Ue<0?c:Ue))/T:0;E=u*Math.max(.2,1+D*(typeof C=="number"?C:1)*.04);}Ue=c,mt=s;let me=N?ae===-1||c>=ae?"forward":"reverse":M;ae=c;let Ie=ge-f,Re=true,Le=Ie===0?0:(c-f)/Ie;if(isNaN(ze)||(ze<=0&&Le>0?O?.():ze>0&&Le<=0&&pe?.(),ze<1&&Le>=1?A?.():ze>=1&&Le<1&&V?.()),ze=Le,ne){let T=xe(J(c,f,ge,E));re&&!N&&(ye=Math.max(ye,T),T=ye),he=T,e.style.setProperty("--scroll-draw-progress",String(T));let D=me==="reverse"?1-T:T;e.style.clipPath=ke(D),d?.(T),!j&&J(c,f,ge,E)>0&&(j=true,$?.()),T>=1&&!_?(_=true,y?.(),Oe<(g==="infinite"?1/0:g??0)&&(Oe++,Fe=setTimeout(()=>{ye=-1,j=false,_=false,e.style.clipPath=ke(0);},U))):T<1&&!re&&(_=false),Y=requestAnimationFrame(Ye);return}if(G.forEach((T,D)=>{let fe=D*k*Ie,v=xe(J(c,f+fe,ge+fe,E));re&&!N&&(ye=Math.max(ye,v),v=ye),he=v,T.style.strokeDashoffset=me==="reverse"?`${F[D]*v}`:`${F[D]*(1-v)}`,m&&(T.style.opacity=me==="reverse"?`${1-v}`:`${v}`),Te&&ce?T.style.stroke=_e(Te,ce,v):ce&&(T.style.stroke=ce),ue!==null&&Z!==null?T.style.strokeWidth=`${ue+(Z-ue)*v}`:Z!==null&&(T.style.strokeWidth=`${Z}`),de!==null&&oe!==null?T.style.fillOpacity=`${de+(oe-de)*v}`:oe!==null&&(T.style.fillOpacity=`${oe}`),I&&T.tagName.toLowerCase()==="path"&&a[D]&&T.setAttribute("d",at(a[D],I,v)),D===0&&(d?.(v),e.style.setProperty("--scroll-draw-progress",String(v))),v<1&&(Re=false);}),b){let T=xe(J(c,f,ge,E));for(let D in b){let fe=parseFloat(D);T>=fe&&!Ne.has(fe)&&(Ne.add(fe),b[D]?.());}}!j&&J(c,f,ge,E)>0&&(j=true,$?.()),Re&&!_?(_=true,y?.(),Oe<(g==="infinite"?1/0:g??0)&&(Oe++,Fe=setTimeout(()=>{ye=-1,j=false,_=false,Ne.clear(),Xe(),De=true;},U))):!Re&&!re&&(_=false),Y=requestAnimationFrame(Ye);}let st=false;function Ke(){st||(st=true,Y=requestAnimationFrame(function(){Ye();}));}function Qe(){st=false,cancelAnimationFrame(Y);}let it=new IntersectionObserver(s=>{s.forEach(c=>{Me=c.isIntersecting,Me&&!ee?(De=true,Ke()):Qe();});},{root:Se??null,threshold:R,rootMargin:w});function yt(){G.forEach((s,c)=>{F[c]=Ve(s),s.style.strokeDasharray=`${F[c]}`;}),dt(),De=true;}let Je;function We(){clearTimeout(Je),Je=setTimeout(yt,150);}window.addEventListener("resize",We),window.addEventListener("orientationchange",We);let Be;return typeof ResizeObserver<"u"&&(Be=new ResizeObserver(()=>We()),Be.observe(document.body),Be.observe(document.documentElement),Be.observe(e)),z>0?setTimeout(()=>it.observe(e),z):it.observe(e),ot({destroy(){cancelAnimationFrame(Y),clearTimeout(Fe),Qe(),it.disconnect(),Be?.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Je),ct();},replay(){ye=-1,ae=-1,Ue=-1,j=false,_=false,Oe=0,ee=false,he=0,Ne.clear(),clearTimeout(Fe),Xe(),De=true,Me&&Ke();},pause(){ee=true,Qe();},resume(){ee&&(ee=false,De=true,Me&&Ke());},seek(s){let c=Math.min(1,Math.max(0,s));he=c,ye=c,ee=true,Qe(),Gt(c,M),De=true;},getProgress(){return he},refresh(){clearTimeout(Je),yt(),Me&&!ee&&Ke();}},()=>({tStart:f,tEnd:ge}))}var $t=new WeakMap,ir=0;function kt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=$t.get(r);return t===void 0&&$t.set(r,t=++ir),`el#${t}`}return r})}function Rt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...i)=>n()[t]?.(...i));return r}function ar(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ot(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],o=[],l=t[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(m?parseFloat(m[1]):0),o.push(m?m[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function lr(e,n,r){let t=Ot(e),i=Ot(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,l)=>{let u=i[l];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((m,p)=>`${m}${o.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${o.fn}(${o.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${o.units[p]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(ar(t))return _e(t,i,r);if(t.includes("("))return lr(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),l=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&l){let u=parseFloat(o[1]),m=parseFloat(l[1]);return `${u+(m-u)*r}${o[2]||l[2]}`}return r<1?t:i}function cr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ur=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),mr=0,Ft="--scroll-draw-progress";function fr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:l=1,once:u=false,axis:m="y",scrollContainer:p,native:S=true,velocityScale:k=false,respectReducedMotion:M=true,triggerElement:re,onProgress:Ee,onComplete:H,onEnter:W,onLeave:N,onEnterBack:z,onLeaveBack:L}=n,P=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof o=="function"?o:Q[o]??Q["ease-out"],b=se(i.start??"top bottom"),C=se(i.end??"bottom top"),R=re??e,w=typeof p=="string"?document.querySelector(p):p??null,g=Object.entries(t).map(([a,f])=>({prop:cr(a),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function U(){let a=window.getComputedStyle(e);for(let f of g)f.from===""&&(f.from=a.getPropertyValue(f.prop).trim()||"0");}function I(){for(let a of g)e.style.setProperty(a.prop,String(a.to));}let B=new Map;for(let a of [...g.map(f=>f.prop),Ft])B.set(a,e.style.getPropertyValue(a));function X(){for(let[a,f]of B)f?e.style.setProperty(a,f):e.style.removeProperty(a);}if(P)return I(),H?.(),{...r,destroy:X,getProgress:()=>1};U();let ie=typeof o=="string"?et(o):null;function le(){if(!S||!fr()||!ie||m!=="y"||w||R!==e||u||l!==1||Ee||H||W||N||z||L||k!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let a of g)if(!ur.has(a.prop))return false;return true}function d(){let a=`ssd-a-${++mr}`,f=g.map(ae=>`${ae.prop}:${ae.from}`).join(";"),ge=g.map(ae=>`${ae.prop}:${ae.to}`).join(";"),_=document.createElement("style");_.setAttribute("data-ssd-animate",""),_.textContent=`@keyframes ${a}{from{${f}}to{${ge}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ie};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(_),e.classList.add(a);let j=()=>m==="x"?window.scrollX:window.scrollY,Y=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let ae=e.getBoundingClientRect();return we({top:ae.top,height:ae.height},j(),Y(),b,C)};Pe(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Me});let ye={destroy(){e.classList.remove(a),_.remove(),e.style.animationPlayState="",X(),Ce(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(ae){let ee=Math.min(1,Math.max(0,ae));e.classList.remove(a);for(let he of g)e.style.setProperty(he.prop,It(he.from,he.to,ee));},getProgress(){let{tStart:ae,tEnd:ee}=Me();return x(J(j(),ae,ee,l))}};return ye}if(le())return d();let $=0,y=0,O=0,A=false,V=false,pe=-1,ne=0,xe=false,$e=NaN,He=-1,Se=0,Te=()=>w?m==="x"?w.scrollLeft:w.scrollTop:m==="x"?window.scrollX:window.scrollY,ce=()=>w?m==="x"?w.clientWidth:w.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ue(){let a=Ze(R,w,m),f=we(a,a.scroll,ce(),b,C);$=f.tStart,y=f.tEnd;}function Z(a){e.style.setProperty(Ft,String(a));for(let f of g)e.style.setProperty(f.prop,It(f.from,f.to,a));Ee?.(a);}function de(a){if(isNaN($e)){$e=a;return}$e<=0&&a>0?W?.():$e>0&&a<=0&&L?.(),$e<1&&a>=1?N?.():$e>=1&&a<1&&z?.(),$e=a;}function oe(){if(!A||V)return;let a=performance.now(),f=Te(),ge=l;if(k!==false){let Y=a-Se,Me=Y>0?Math.abs(f-(He<0?f:He))/Y:0;ge=l*Math.max(.2,1+Me*(typeof k=="number"?k:1)*.04);}He=f,Se=a;let _=y===$?0:(f-$)/(y-$);de(_);let j=x(J(f,$,y,ge));u&&(pe=Math.max(pe,j),j=pe),ne=j,Z(j),j>=1&&!xe?(xe=true,H?.()):j<1&&!u&&(xe=false),O=requestAnimationFrame(oe);}ue(),y===$&&ve("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=x(J(Te(),$,y,l));u&&a>0&&(pe=a),ne=a,Z(a);}let ke=new IntersectionObserver(a=>{a.forEach(f=>{A=f.isIntersecting,A&&!V?O=requestAnimationFrame(oe):cancelAnimationFrame(O);});},{root:w??null}),G;function F(){clearTimeout(G),G=setTimeout(ue,150);}return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),ke.observe(e),Pe(e,{type:"animate",getProgress:()=>ne,getTrigger:()=>({tStart:$,tEnd:y})}),{destroy(){cancelAnimationFrame(O),ke.disconnect(),window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F),clearTimeout(G),X(),Ce(e);},replay(){pe=-1,xe=false,ne=0,V=false,Z(0);},pause(){V=true,cancelAnimationFrame(O);},resume(){V&&(V=false,A&&(O=requestAnimationFrame(oe)));},seek(a){let f=Math.min(1,Math.max(0,a));ne=f,pe=f,V=true,cancelAnimationFrame(O),Z(f);},getProgress(){return ne}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Dt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ve("scrollCounter: element not found:",e),lt;let t=r,{from:i=0,to:o,format:l,easing:u="ease-out",trigger:m={},once:p=true,decimals:S,onComplete:k}=n,M=S!==void 0?d=>d.toFixed(S):l??(d=>String(Math.round(d))),re=typeof u=="function"?u:Q[u]??Q["ease-out"],Ee=se(m.start??"top 80%"),H=se(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=M(o),k?.(),lt;let N=0,z=0,L=0,P=false,x=false,b=-1,C=0,R=false,w=()=>window.scrollY,g=()=>window.innerHeight;function U(){let d=t.getBoundingClientRect(),$=we({top:d.top,height:d.height},w(),g(),Ee,H);N=$.tStart,z=$.tEnd;}function I(d){t.textContent=M(i+(o-i)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function B(){if(!P||x)return;let d=re(J(w(),N,z,1));p&&(b=Math.max(b,d),d=b),C=d,I(d),d>=1&&!R?(R=true,k?.()):d<1&&!p&&(R=false),L=requestAnimationFrame(B);}U();{let d=re(J(w(),N,z,1));p&&d>0&&(b=d),C=d,I(d);}let X=new IntersectionObserver(d=>{d.forEach($=>{P=$.isIntersecting,P&&!x?L=requestAnimationFrame(B):cancelAnimationFrame(L);});}),ie;function le(){clearTimeout(ie),ie=setTimeout(U,150);}return window.addEventListener("resize",le),window.addEventListener("orientationchange",le),X.observe(t),Pe(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:N,tEnd:z})}),{destroy(){cancelAnimationFrame(L),X.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),clearTimeout(ie),Ce(t);},replay(){b=-1,R=false,C=0,x=false,I(0);},pause(){x=true,cancelAnimationFrame(L);},resume(){x&&(x=false,P&&(L=requestAnimationFrame(B)));},seek(d){let $=Math.min(1,Math.max(0,d));C=$,b=$,x=true,cancelAnimationFrame(L),I($);},getProgress(){return C}}}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function zt(e,n={}){if(typeof window>"u")return Ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ve("scrollVideo: <video> element not found:",e),Ht;let t=r,{trigger:i={},easing:o="linear",once:l=false,axis:u="y",preload:m="auto",onReady:p,onComplete:S,onProgress:k}=n,M=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof o=="function"?o:Q[o]??Q.linear,Ee=se(i.start??"top top"),H=se(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let W=n.from??0,N=n.to,z=0,L=0,P=0,x=false,b=false,C=-1,R=0,w=false,g=false,U=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function B(){let A=t.getBoundingClientRect(),V=u==="x"?A.left:A.top,pe=u==="x"?A.width:A.height,ne=we({top:V,height:pe},U(),I(),Ee,H);z=ne.tStart,L=ne.tEnd;}let X=NaN;function ie(A){if(!g)return;let V=N??t.duration??0,pe=W+(V-W)*A;pe!==X&&(X=pe,t.currentTime=pe),t.style.setProperty("--scroll-draw-progress",String(A)),k?.(A);}function le(){if(!x||b||!g||M)return;let A=re(J(U(),z,L,1));l&&(C=Math.max(C,A),A=C),R=A,ie(A),A>=1&&!w?(w=true,S?.()):A<1&&!l&&(w=false),P=requestAnimationFrame(le);}function d(){if(g=true,N===void 0&&(N=t.duration),M){ie(1),p?.();return}B(),p?.(),x&&!b&&(P=requestAnimationFrame(le));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),g||B();let $=new IntersectionObserver(A=>{A.forEach(V=>{x=V.isIntersecting,x&&!b&&g?P=requestAnimationFrame(le):cancelAnimationFrame(P);});}),y;function O(){clearTimeout(y),y=setTimeout(B,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),$.observe(t),Pe(t,{type:"video",getProgress:()=>R,getTrigger:()=>({tStart:z,tEnd:L})}),{destroy(){cancelAnimationFrame(P),$.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(y),Ce(t);},replay(){C=-1,w=false,R=0,b=false,X=NaN,ie(0);},pause(){b=true,cancelAnimationFrame(P);},resume(){b&&(b=false,x&&g&&(P=requestAnimationFrame(le)));},seek(A){let V=Math.min(1,Math.max(0,A));R=V,C=V,b=true,cancelAnimationFrame(P),X=NaN,ie(V);},getProgress(){return R}}}function qt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function pr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Vt(e){let n=qt(e),r=new Map;for(let o of n){let l=o.offsetTop;r.has(l)||r.set(l,[]),r.get(l).push(o);}let t=[],i=Array.from(r.keys()).sort((o,l)=>o-l);for(let o of i){let l=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",l.forEach((m,p)=>{let S=m.nextElementSibling;u.appendChild(m),p<l.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((o,l)=>{e.appendChild(o),l<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function dr(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,l=o+(1-i);return l<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(l-o)))}function gr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var _t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Wt(e,n={}){if(typeof window>"u")return _t;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ve("scrollText: element not found:",e),_t;let t=r,{split:i="words",stagger:o=.04,easing:l="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:S}=n,k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof l=="function"?l:Q[l]??Q["ease-out"],re=se(m.start??"top 85%"),Ee=se(m.end??"top 40%"),H=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let W;i==="chars"?W=pr(t):i==="lines"?W=Vt(t):W=qt(t);let N=W.length;function z(y,O){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*O));let A=gr(O,u);A&&(y.style.transform=A);}function L(y){t.style.setProperty("--scroll-draw-progress",String(y)),W.forEach((O,A)=>{let V=M(dr(y,A,N,o));z(O,V);});}if(k)return L(1),S?.(),{destroy(){t.innerHTML=H,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};L(0);let P=0,x=0,b=0,C=false,R=false,w=-1,g=0,U=false,I=()=>window.scrollY,B=()=>window.innerHeight;function X(){let y=t.getBoundingClientRect(),O=we({top:y.top,height:y.height},I(),B(),re,Ee);P=O.tStart,x=O.tEnd;}function ie(){if(!C||R)return;let y=J(I(),P,x,1);p&&(w=Math.max(w,y),y=w),g=y,L(y),y>=1&&!U?(U=true,S?.()):y<1&&!p&&(U=false),b=requestAnimationFrame(ie);}X();let le=new IntersectionObserver(y=>{y.forEach(O=>{C=O.isIntersecting,C&&!R?b=requestAnimationFrame(ie):cancelAnimationFrame(b);});}),d;function $(){clearTimeout(d),d=setTimeout(()=>{if(i==="lines"){let y=g;t.innerHTML=H,t.setAttribute("aria-label",t.textContent??""),W=Vt(t),L(y);}X();},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),le.observe(t),Pe(t,{type:"text",getProgress:()=>g,getTrigger:()=>({tStart:P,tEnd:x})}),{destroy(){cancelAnimationFrame(b),le.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(d),t.innerHTML=H,t.removeAttribute("aria-label"),Ce(t);},replay(){w=-1,U=false,g=0,R=false,L(0);},pause(){R=true,cancelAnimationFrame(b);},resume(){R&&(R=false,C&&(b=requestAnimationFrame(ie)));},seek(y){let O=Math.min(1,Math.max(0,y));g=O,w=O,R=true,cancelAnimationFrame(b),L(O);},getProgress(){return g}}}function br(e,n={}){let[r,t]=wr.useState(0),i=wr.useRef(n);i.current=n;let o=wr.useRef(-1);return wr.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let l=typeof e=="string"?document.querySelector(e):e.current;if(!l)return;let u=l,{axis:m="y",scrollContainer:p,trigger:S={}}=i.current,k=typeof p=="string"?document.querySelector(p):p??null,M=se(S.start??"top bottom"),re=se(S.end??"bottom top"),Ee=0,H=0,W=false,N=0;function z(){return k?m==="x"?k.scrollLeft:k.scrollTop:m==="x"?window.scrollX:window.scrollY}function L(){return k?m==="x"?k.clientWidth:k.clientHeight:m==="x"?window.innerWidth:window.innerHeight}function P(){let w=u.getBoundingClientRect(),g=z(),U=m==="x"?w.left:w.top,I=m==="x"?w.width:w.height,B=we({top:U,height:I},g,L(),M,re);Ee=B.tStart,H=B.tEnd;}function x(){if(!W)return;let{speed:w=1,easing:g="linear",once:U=false}=i.current,I=typeof g=="function"?g:Q[g]??Q.linear,B=J(z(),Ee,H,w),X=I(B);U&&(o.current=Math.max(o.current,X),X=o.current),t(X),N=requestAnimationFrame(x);}let b=new IntersectionObserver(w=>{w.forEach(g=>{W=g.isIntersecting,W?N=requestAnimationFrame(x):cancelAnimationFrame(N);});},{root:k??null,threshold:0});P(),b.observe(u);let C;function R(){clearTimeout(C),C=setTimeout(P,150);}return window.addEventListener("resize",R),window.addEventListener("orientationchange",R),()=>{cancelAnimationFrame(N),clearTimeout(C),b.disconnect(),window.removeEventListener("resize",R),window.removeEventListener("orientationchange",R);}},[]),r}function je(e,n,r){let t=wr.useRef(n);t.current=n;let i=kt(n);wr.useEffect(()=>{if(!e.current)return;let o=r(e.current,Rt(t.current,()=>t.current));return ()=>o.destroy()},[i]);}function An({children:e,className:n,style:r,...t}){let i=wr.useRef(null);return je(i,t,Ct),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function Mn({children:e,className:n,style:r,...t}){let i=wr.useRef(null);return je(i,t,Nt),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function Ln({className:e,style:n,...r}){let t=wr.useRef(null);return je(t,r,Dt),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function Pn({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let l=wr.useRef(null);return je(l,o,zt),jsxRuntime.jsx("video",{ref:l,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function Cn({children:e,as:n="p",className:r,style:t,...i}){let o=wr.useRef(null);return je(o,i,Wt),wr__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=Mn;exports.ScrollCounter=Ln;exports.ScrollDraw=An;exports.ScrollText=Cn;exports.ScrollVideo=Pn;exports.useScrollDrawProgress=br;
|
package/dist/react/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {a as a$1,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$4}from'../chunk-JC5BD4RB.mjs';import {a as a$5}from'../chunk-SNCRC6BA.mjs';import {a as a$3}from'../chunk-4MH5SQTH.mjs';import {a as a$2}from'../chunk-QJ4H2HW3.mjs';import {b as b$2}from'../chunk-WDIHLRZZ.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import {a,c,b}from'../chunk-PEFR3ZB7.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import Y,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function K(r,t={}){let[n,e]=useState(0),o=useRef(t);o.current=t;let s=useRef(-1);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){e(1);return}let u=typeof r=="string"?document.querySelector(r):r.current;if(!u)return;let b$1=u,{axis:a$1="y",scrollContainer:y,trigger:h={}}=o.current,l=typeof y=="string"?document.querySelector(y):y??null,W=a(h.start??"top bottom"),X=a(h.end??"bottom top"),O=0,C=0,w=false,f=0;function N(){return l?a$1==="x"?l.scrollLeft:l.scrollTop:a$1==="x"?window.scrollX:window.scrollY}function B(){return l?a$1==="x"?l.clientWidth:l.clientHeight:a$1==="x"?window.innerWidth:window.innerHeight}function D(){let i=b$1.getBoundingClientRect(),c$1=N(),v=a$1==="x"?i.left:i.top,x=a$1==="x"?i.width:i.height,g=c({top:v,height:x},c$1,B(),W,X);O=g.tStart,C=g.tEnd;}function A(){if(!w)return;let{speed:i=1,easing:c="linear",once:v=false}=o.current,x=typeof c=="function"?c:d[c]??d.linear,g=b(N(),O,C,i),P=x(g);v&&(s.current=Math.max(s.current,P),P=s.current),e(P),f=requestAnimationFrame(A);}let L=new IntersectionObserver(i=>{i.forEach(c=>{w=c.isIntersecting,w?f=requestAnimationFrame(A):cancelAnimationFrame(f);});},{root:l??null,threshold:0});D(),L.observe(b$1);let E;function d$1(){clearTimeout(E),E=setTimeout(D,150);}return window.addEventListener("resize",d$1),window.addEventListener("orientationchange",d$1),()=>{cancelAnimationFrame(f),clearTimeout(E),L.disconnect(),window.removeEventListener("resize",d$1),window.removeEventListener("orientationchange",d$1);}},[]),n}function p(r,t,n){let e=useRef(t);e.current=t;let o=a$1(t);useEffect(()=>{if(!r.current)return;let s=n(r.current,b$1(e.current,()=>e.current));return ()=>s.destroy()},[o]);}function ce({children:r,className:t,style:n,...e}){let o=useRef(null);return p(o,e,b$2),jsx("div",{ref:o,className:t,style:n,children:r})}function ae({children:r,className:t,style:n,...e}){let o=useRef(null);return p(o,e,a$2),jsx("div",{ref:o,className:t,style:n,children:r})}function me({className:r,style:t,...n}){let e=useRef(null);return p(e,n,a$3),jsx("span",{ref:e,className:r,style:t})}function ue({src:r,className:t,style:n,muted:e=true,playsInline:o=true,...s}){let u=useRef(null);return p(u,s,a$4),jsx("video",{ref:u,src:r,className:t,style:n,muted:e,playsInline:o,preload:"auto"})}function pe({children:r,as:t="p",className:n,style:e,...o}){let s=useRef(null);return p(s,o,a$5),Y.createElement(t,{ref:s,className:n,style:e},r)}export{ae as ScrollAnimate,me as ScrollCounter,ce as ScrollDraw,pe as ScrollText,ue as ScrollVideo,K as useScrollDrawProgress};
|