svg-scroll-draw 2.10.0 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/dist/angular/index.cjs +2 -2
- package/dist/angular/index.mjs +2 -2
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.mjs +2 -2
- package/dist/cdn/svg-scroll-draw.dev.global.js +54 -29
- package/dist/cdn/svg-scroll-draw.global.js +2 -2
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.mjs +2 -2
- package/dist/devtools/index.cjs +1 -1
- package/dist/devtools/index.mjs +1 -1
- package/dist/group/index.cjs +2 -2
- package/dist/group/index.mjs +2 -2
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.mjs +2 -2
- package/dist/pin/index.cjs +1 -1
- package/dist/pin/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.mjs +2 -2
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.mjs +2 -2
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.mjs +2 -2
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +8 -8
- package/dist/timeline/index.mjs +8 -8
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.mjs +2 -2
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +3 -3
- package/package.json +19 -2
package/dist/astro/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function Ht({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let S=Math.pow(l,d);c.push(S),s+=S;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let S=0;S<r;S++)if(d<=u[S+1]){let _=(d-u[S])/(u[S+1]-u[S]);if(S===0)return _*(2-_);let x=1-Math.pow(t,S);return x+(1-x)*(2*_-1)*(2*_-1)}return 1}}function _t({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=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-l)*(2*Math.PI)/t)+1}var ue={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:Ht(),elastic:_t()};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 yt(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 ht(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 ze(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 zt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:zt((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=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:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e,n,r,t,l){let s=yt(e.top,e.height,n,t.element)-ht(t.viewport,r),c=yt(e.top,e.height,n,l.element)-ht(l.viewport,r);return {tStart:s,tEnd:c}}function bt(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 qe(e,n,r){let t=bt(e),l=bt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var wt={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 Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function K(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Vt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Bt(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 Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Vt;case "ease-in-out":return Wt()?Bt(ue["ease-in-out"]):null;default:return null}}var vt=Symbol.for("svg-scroll-draw.registry");function Et(){let e=globalThis;return e[vt]||(e[vt]=new Map)}function Oe(e,n){Et().set(e,n);}function Ie(e){Et().delete(e);}var Gt=0;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?K("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&K("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Yt(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 l(){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 wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function jt(e,n,r){if(!Ze)return;let t=(e.match(vt)??[]).join("").toUpperCase(),l=(n.match(vt)??[]).join("").toUpperCase(),s=(e.match(wt)??[]).length,c=(n.match(wt)??[]).length;if(t!==l){ee(`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&&ee(`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 st(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 et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...ht[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:d="linear",trigger:v={},stagger:_=0,direction:x="forward",once:oe=false,debug:Oe=false,axis:j="y",scrollContainer:se,autoReverse:ie=false,delay:te=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:ce=0,morphTo:D,clip:pe,autoplay:Se=false,duration:de=1e3,native:Ee=true,onProgress:g,onStart:S,onComplete:y,onEnter:$,onLeave:ge,onEnterBack:ye,onLeaveBack:Ce}=l,re=pe===true?"left":typeof pe=="string"?pe:false,he=typeof d=="function"?d:le[d]??le.linear,Te=ve(v.start??"top bottom"),Re=ve(v.end??"bottom top"),ue=typeof se=="string"?document.querySelector(se):se??null,me=Array.isArray(T)?T[0]:null,X=Array.isArray(T)?T[1]:typeof T=="string"?T:null,Y=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,ne=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ae(o){let a=o*100;switch(re){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 I=re?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,fe=0,O=false,R=false,N=0,q=false,J=-1,Me=-1,U=false,be=0,Pe=0,ke,tt=null;function at(){tt?.destroy(),tt=null;}let Ie=new Set,lt=NaN,Fe=true,Ge=-1,ct=performance.now(),Ne=NaN;function rt(){return ue?j==="x"?ue.scrollLeft:ue.scrollTop:j==="x"?window.scrollX:window.scrollY}function ut(){return ue?j==="x"?ue.clientWidth:ue.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function mt(){let o=Qe(e,ue,j),a=Le(o,o.scroll,ut(),Te,Re);f=a.tStart,fe=a.tEnd,Oe&&Ze&&(at(),tt=Gt(f,fe,j));}function Dt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),re){let b=a==="reverse"?1-o:o;e.style.clipPath=Ae(b);return}I.forEach((b,Q)=>{b.style.strokeDashoffset=a==="reverse"?`${E[Q]*o}`:`${E[Q]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),me&&X?b.style.stroke=_e(me,X,o):X&&(b.style.stroke=X),Y!==null&&z!==null?b.style.strokeWidth=`${Y+(z-Y)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),ne!==null&&G!==null?b.style.fillOpacity=`${ne+(G-ne)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[Q]&&b.setAttribute("d",st(i[Q],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),re){e.style.clipPath=Ae(0);return}I.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(I.forEach(o=>{Bt(o);let a=He(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?jt(i[i.length-1],D,o):ee(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),X&&(o.style.stroke=X),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`));}),re){if(s)return e.style.clipPath=Ae(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ae(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ft=typeof d=="string"?Ke(d):null;function Ot(){return !(Ee===false||!Wt()||!I.length||!ft||re||j!=="y"||ue||u!==1||_!==0||oe||ie||F!==false||D||A||M||te>0||g||S||y||$||ge||ye||Ce||T!=null||W!=null||L!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function kt(){let o=++Vt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",xe=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(xe+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${xe}}to{${w}}}.${b}{view-timeline-name:${Q};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ft};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Z(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}I.forEach(Z);let h=false,k=-1;function H(){if(k>=0)return k;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),ut(),Te,Re);return he(K(rt(),V,we,u))}return {destroy(){e.classList.remove(b),I.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,k=-1,I.forEach(Z);},pause(){h=true,I.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,I.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));k=V,h=true,I.forEach((we,ae)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ae]*V}`:`${E[ae]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){I.forEach((p,V)=>{E[V]=He(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Ot())return kt();function It(){let o=Math.max(1,de),a=0,b=0,Q=false;function De(h){let k=true;if(re){let H=Math.min(1,Math.max(0,h/o)),p=he(H);be=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Ae(x==="reverse"?1-p:p),g?.(p),H<1&&(k=false);}else I.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ae=he(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ae}`:`${E[p]*(1-ae)}`,m&&(H.style.opacity=x==="reverse"?`${1-ae}`:`${ae}`),me&&X?H.style.stroke=_e(me,X,ae):X&&(H.style.stroke=X),Y!==null&&z!==null?H.style.strokeWidth=`${Y+(z-Y)*ae}`:z!==null&&(H.style.strokeWidth=`${z}`),ne!==null&&G!==null?H.style.fillOpacity=`${ne+(G-ne)*ae}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",st(i[p],D,ae)),p===0&&(be=ae,g?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),we<1&&(k=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=he(H);for(let V in A){let we=parseFloat(V);p>=we&&!Ie.has(we)&&(Ie.add(we),A[V]?.());}}return k}function $e(h){if(U)return;let k=h-a;R||(R=true,S?.());let H=De(k);if(H&&!O){O=true,De(o*(1+Math.max(0,I.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{a=performance.now(),R=false,O=false,Ie.clear(),je(),N=requestAnimationFrame($e);},ce));return}H||(N=requestAnimationFrame($e));}function xe(){cancelAnimationFrame(N),clearTimeout(ke),a=performance.now(),b=0,U=false,R=false,O=false,Pe=0,Q=true,be=0,Ie.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(k=>{k.isIntersecting&&!(oe&&O)?xe():!k.isIntersecting&&!oe&&!O&&(cancelAnimationFrame(N),clearTimeout(ke),Q=false);});},{root:ue??null,threshold:B,rootMargin:P}),C;function Z(){clearTimeout(C),C=setTimeout(()=>{I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),te>0?setTimeout(()=>w.observe(e),te):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(C);},replay(){Pe=0,xe();},pause(){U||!Q||(U=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){U&&(U=false,Q=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let k=Math.min(1,Math.max(0,h));be=k,U=true,b=k*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return be},refresh(){clearTimeout(C),I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});}}}if(Se)return It();mt();function Ue(){if(!q||U)return;let o=performance.now(),a=rt();if(!Fe&&F===false&&a===lt){N=requestAnimationFrame(Ue);return}Fe=false,lt=a;let b=u;if(F!==false){let w=o-ct,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ct=o;let Q=ie?Me===-1||a>=Me?"forward":"reverse":x;Me=a;let De=fe-f,$e=true,xe=De===0?0:(a-f)/De;if(isNaN(Ne)||(Ne<=0&&xe>0?$?.():Ne>0&&xe<=0&&Ce?.(),Ne<1&&xe>=1?ge?.():Ne>=1&&xe<1&&ye?.()),Ne=xe,re){let w=he(K(a,f,fe,b));oe&&!ie&&(J=Math.max(J,w),w=J),be=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=Q==="reverse"?1-w:w;e.style.clipPath=Ae(C),g?.(w),!R&&K(a,f,fe,b)>0&&(R=true,S?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,e.style.clipPath=Ae(0);},ce))):w<1&&!oe&&(O=false),N=requestAnimationFrame(Ue);return}if(I.forEach((w,C)=>{let Z=C*_*De,h=he(K(a,f+Z,fe+Z,b));oe&&!ie&&(J=Math.max(J,h),h=J),be=h,w.style.strokeDashoffset=Q==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=Q==="reverse"?`${1-h}`:`${h}`),me&&X?w.style.stroke=_e(me,X,h):X&&(w.style.stroke=X),Y!==null&&z!==null?w.style.strokeWidth=`${Y+(z-Y)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),ne!==null&&G!==null?w.style.fillOpacity=`${ne+(G-ne)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",st(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=he(K(a,f,fe,b));for(let C in A){let Z=parseFloat(C);w>=Z&&!Ie.has(Z)&&(Ie.add(Z),A[C]?.());}}!R&&K(a,f,fe,b)>0&&(R=true,S?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,Ie.clear(),je(),Fe=true;},ce))):!$e&&!oe&&(O=false),N=requestAnimationFrame(Ue);}let nt=false;function Xe(){nt||(nt=true,N=requestAnimationFrame(function(){Ue();}));}function Ye(){nt=false,cancelAnimationFrame(N);}let ot=new IntersectionObserver(o=>{o.forEach(a=>{q=a.isIntersecting,q&&!U?(Fe=true,Xe()):Ye();});},{root:ue??null,threshold:B,rootMargin:P});function pt(){I.forEach((o,a)=>{E[a]=He(o),o.style.strokeDasharray=`${E[a]}`;}),mt(),Fe=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(pt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),te>0?setTimeout(()=>ot.observe(e),te):ot.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),Ye(),ot.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),at();},replay(){J=-1,Me=-1,Ge=-1,R=false,O=false,Pe=0,U=false,be=0,Ie.clear(),clearTimeout(ke),je(),Fe=true,q&&Xe();},pause(){U=true,Ye();},resume(){U&&(U=false,Fe=true,q&&Xe());},seek(o){let a=Math.min(1,Math.max(0,o));be=a,J=a,U=true,Ye(),Dt(a,x),Fe=true;},getProgress(){return be},refresh(){clearTimeout(Je),pt(),q&&!U&&Xe();}}}var St=new Map;function ze(e,n){St.set(e,n);}function qe(e){St.delete(e);}function Ut(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Et(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 Xt(e,n,r){let t=Et(e),l=Et(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,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function xt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Ut(t))return _e(t,l,r);if(t.includes("("))return Xt(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 Yt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Qt=0,Tt="--scroll-draw-progress";function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function At(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:d,native:v=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:oe,onProgress:Oe,onComplete:j,onEnter:se,onLeave:ie,onEnterBack:te,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:le[s]??le["ease-out"],A=ve(l.start??"top bottom"),F=ve(l.end??"bottom top"),B=oe??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Yt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ce(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let pe=new Map;for(let i of [...M.map(f=>f.prop),Tt])pe.set(i,e.style.getPropertyValue(i));function Se(){for(let[i,f]of pe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:Se,getProgress:()=>1};ce();let de=typeof s=="string"?Ke(s):null;function Ee(){if(!v||!Zt()||!de||m!=="y"||P||B!==e||u||c!==1||Oe||j||se||ie||te||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Jt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++Qt}`,f=M.map(q=>`${q.prop}:${q.from}`).join(";"),fe=M.map(q=>`${q.prop}:${q.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${fe}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",Se();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let J=Math.min(1,Math.max(0,q));e.classList.remove(i);for(let Me of M)e.style.setProperty(Me.prop,xt(Me.from,Me.to,J));},getProgress(){let q=e.getBoundingClientRect(),J=R(),Me=N(),{tStart:U,tEnd:be}=Le({top:q.top,height:q.height},J,Me,A,F);return L(K(J,U,be,c))}}}if(Ee())return g();let S=0,y=0,$=0,ge=false,ye=false,Ce=-1,re=0,he=false,Te=NaN,Re=-1,ue=0,me=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function Y(){let i=Qe(B,P,m),f=Le(i,i.scroll,X(),A,F);S=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty(Tt,String(i));for(let f of M)e.style.setProperty(f.prop,xt(f.from,f.to,i));Oe?.(i);}function ne(i){if(isNaN(Te)){Te=i;return}Te<=0&&i>0?se?.():Te>0&&i<=0&&T?.(),Te<1&&i>=1?ie?.():Te>=1&&i<1&&te?.(),Te=i;}function G(){if(!ge||ye)return;let i=performance.now(),f=me(),fe=c;if(_!==false){let N=i-ue,q=N>0?Math.abs(f-(Re<0?f:Re))/N:0;fe=c*Math.max(.2,1+q*(typeof _=="number"?_:1)*.04);}Re=f,ue=i;let O=y===S?0:(f-S)/(y-S);ne(O);let R=L(K(f,S,y,fe));u&&(Ce=Math.max(Ce,R),R=Ce),re=R,z(R),R>=1&&!he?(he=true,j?.()):R<1&&!u&&(he=false),$=requestAnimationFrame(G);}Y(),y===S&&ee("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=L(K(me(),S,y,c));u&&i>0&&(Ce=i),re=i,z(i);}let Ae=new IntersectionObserver(i=>{i.forEach(f=>{ge=f.isIntersecting,ge&&!ye?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),I;function E(){clearTimeout(I),I=setTimeout(Y,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Ae.observe(e),ze(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:S,tEnd:y})}),{destroy(){cancelAnimationFrame($),Ae.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(I),Se(),qe(e);},replay(){Ce=-1,he=false,re=0,ye=false,z(0);},pause(){ye=true,cancelAnimationFrame($);},resume(){ye&&(ye=false,ge&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));re=f,Ce=f,ye=true,cancelAnimationFrame($),z(f);},getProgress(){return re}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,n){if(typeof window>"u")return it;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollCounter: element not found:",e),it;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:v,onComplete:_}=n,x=v!==void 0?g=>g.toFixed(v):c??(g=>String(Math.round(g))),oe=typeof u=="function"?u:le[u]??le["ease-out"],Oe=ve(m.start??"top 80%"),j=ve(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),it;let ie=0,te=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function ce(){let g=t.getBoundingClientRect(),S=Le({top:g.top,height:g.height},P(),M(),Oe,j);ie=S.tStart,te=S.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function pe(){if(!W||L)return;let g=oe(K(P(),ie,te,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(pe);}ce();{let g=oe(K(P(),ie,te,1));d&&g>0&&(A=g),F=g,D(g);}let Se=new IntersectionObserver(g=>{g.forEach(S=>{W=S.isIntersecting,W&&!L?T=requestAnimationFrame(pe):cancelAnimationFrame(T);});}),de;function Ee(){clearTimeout(de),de=setTimeout(ce,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),Se.observe(t),ze(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:ie,tEnd:te})}),{destroy(){cancelAnimationFrame(T),Se.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(de),qe(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(pe)));},seek(g){let S=Math.min(1,Math.max(0,g));F=S,A=S,L=true,cancelAnimationFrame(T),D(S);},getProgress(){return F}}}function Ct(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 Kt(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 $t(e){let n=Ct(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,d)=>{let v=m.nextElementSibling;u.appendChild(m),d<c.length-1&&v&&v.style.whiteSpace==="pre"&&u.appendChild(v);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function er(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 tr(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 Lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pt(e,n={}){if(typeof window>"u")return Lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollText: element not found:",e),Lt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:v}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:le[c]??le["ease-out"],oe=ve(m.start??"top 85%"),Oe=ve(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let se;l==="chars"?se=Kt(t):l==="lines"?se=$t(t):se=Ct(t);let ie=se.length;function te(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ge=tr($,u);ge&&(y.style.transform=ge);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),se.forEach(($,ge)=>{let ye=x(er(y,ge,ie,s));te($,ye);});}if(_)return T(1),v?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,ce=false,D=()=>window.scrollY,pe=()=>window.innerHeight;function Se(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),pe(),oe,Oe);W=$.tStart,L=$.tEnd;}function de(){if(!F||B)return;let y=K(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!ce?(ce=true,v?.()):y<1&&!d&&(ce=false),A=requestAnimationFrame(de);}Se();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(de):cancelAnimationFrame(A);});}),g;function S(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),se=$t(t),T(y);}Se();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),Ee.observe(t),ze(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),qe(t);},replay(){P=-1,ce=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(de)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function rr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(ee("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function nr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function or(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return At(n,r)}):[]}function sr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(ee('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Mt(n,r)}):[]}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return Pt(n,r)}):[]}function _r(e=Be()){return {draw:nr(e),animate:or(e),counter:sr(e),text:ir(e)}}exports.initAll=_r;exports.initScrollAnimate=or;exports.initScrollCounter=sr;exports.initScrollDraw=nr;exports.initScrollText=ir;exports.scrollDraw=rr;
|
|
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 xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Tt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Xt(e,n,r){if(!Ze)return;let t=(e.match(Tt)??[]).join("").toUpperCase(),l=(n.match(Tt)??[]).join("").toUpperCase(),s=(e.match(xt)??[]).length,c=(n.match(xt)??[]).length;if(t!==l){K(`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&&K(`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 it(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 et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...wt[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:d="linear",trigger:S={},stagger:_=0,direction:x="forward",once:ne=false,debug:ke=false,axis:j="y",scrollContainer:oe,autoReverse:se=false,delay:ee=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:me=0,morphTo:D,clip:de,autoplay:ve=false,duration:ge=1e3,native:Ee=true,onProgress:g,onStart:v,onComplete:y,onEnter:$,onLeave:ye,onEnterBack:he,onLeaveBack:Ce}=l,te=de===true?"left":typeof de=="string"?de:false,be=typeof d=="function"?d:ue[d]??ue.linear,Ae=Se(S.start??"top bottom"),He=Se(S.end??"bottom top"),fe=typeof oe=="string"?document.querySelector(oe):oe??null,pe=Array.isArray(T)?T[0]:null,Y=Array.isArray(T)?T[1]:typeof T=="string"?T:null,X=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,re=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Me(o){let a=o*100;switch(te){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 k=te?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,ie=0,O=false,R=false,N=0,xe=false,ae=-1,U=-1,q=false,le=0,Pe=0,Re,tt=null;function lt(){tt?.destroy(),tt=null;}let Fe=new Set,ct=NaN,Ne=true,Ge=-1,ut=performance.now(),_e=NaN;function rt(){return fe?j==="x"?fe.scrollLeft:fe.scrollTop:j==="x"?window.scrollX:window.scrollY}function mt(){return fe?j==="x"?fe.clientWidth:fe.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function ft(){let o=Qe(e,fe,j);return Le(o,o.scroll,mt(),Ae,He)}function pt(){(({tStart:f,tEnd:ie}=ft())),ke&&Ze&&(lt(),tt=Yt(f,ie,j));}function nt(o,a=ft){Oe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Ie(e);},o}function kt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),te){let b=a==="reverse"?1-o:o;e.style.clipPath=Me(b);return}k.forEach((b,J)=>{b.style.strokeDashoffset=a==="reverse"?`${E[J]*o}`:`${E[J]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),pe&&Y?b.style.stroke=qe(pe,Y,o):Y&&(b.style.stroke=Y),X!==null&&z!==null?b.style.strokeWidth=`${X+(z-X)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),re!==null&&G!==null?b.style.fillOpacity=`${re+(G-re)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[J]&&b.setAttribute("d",it(i[J],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),te){e.style.clipPath=Me(0);return}k.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(k.forEach(o=>{Ut(o);let a=ze(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Xt(i[i.length-1],D,o):K(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),Y&&(o.style.stroke=Y),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`));}),te){if(s)return e.style.clipPath=Me(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Me(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let dt=typeof d=="string"?Ke(d):null;function Rt(){return !(Ee===false||!jt()||!k.length||!dt||te||j!=="y"||fe||u!==1||_!==0||ne||se||F!==false||D||A||M||ee>0||g||v||y||$||ye||he||Ce||T!=null||W!=null||L!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Ft(){let o=++Gt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,J=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",Te=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(Te+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${Te}}to{${w}}}.${b}{view-timeline-name:${J};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${dt};animation-fill-mode:both;animation-timeline:${J};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Q(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}k.forEach(Q);let h=false,I=-1;function H(){if(I>=0)return I;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),mt(),Ae,He);return be(Z(rt(),V,we,u))}return {destroy(){e.classList.remove(b),k.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,I=-1,k.forEach(Q);},pause(){h=true,k.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,k.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));I=V,h=true,k.forEach((we,ce)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ce]*V}`:`${E[ce]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){k.forEach((p,V)=>{E[V]=ze(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Rt())return nt(Ft());function Nt(){let o=Math.max(1,ge),a=0,b=0,J=false;function De(h){let I=true;if(te){let H=Math.min(1,Math.max(0,h/o)),p=be(H);le=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Me(x==="reverse"?1-p:p),g?.(p),H<1&&(I=false);}else k.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ce=be(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ce}`:`${E[p]*(1-ce)}`,m&&(H.style.opacity=x==="reverse"?`${1-ce}`:`${ce}`),pe&&Y?H.style.stroke=qe(pe,Y,ce):Y&&(H.style.stroke=Y),X!==null&&z!==null?H.style.strokeWidth=`${X+(z-X)*ce}`:z!==null&&(H.style.strokeWidth=`${z}`),re!==null&&G!==null?H.style.fillOpacity=`${re+(G-re)*ce}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",it(i[p],D,ce)),p===0&&(le=ce,g?.(ce),e.style.setProperty("--scroll-draw-progress",String(ce))),we<1&&(I=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=be(H);for(let V in A){let we=parseFloat(V);p>=we&&!Fe.has(we)&&(Fe.add(we),A[V]?.());}}return I}function $e(h){if(q)return;let I=h-a;R||(R=true,v?.());let H=De(I);if(H&&!O){O=true,De(o*(1+Math.max(0,k.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{a=performance.now(),R=false,O=false,Fe.clear(),je(),N=requestAnimationFrame($e);},me));return}H||(N=requestAnimationFrame($e));}function Te(){cancelAnimationFrame(N),clearTimeout(Re),a=performance.now(),b=0,q=false,R=false,O=false,Pe=0,J=true,le=0,Fe.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(I=>{I.isIntersecting&&!(ne&&O)?Te():!I.isIntersecting&&!ne&&!O&&(cancelAnimationFrame(N),clearTimeout(Re),J=false);});},{root:fe??null,threshold:B,rootMargin:P}),C;function Q(){clearTimeout(C),C=setTimeout(()=>{k.forEach((h,I)=>{E[I]=ze(h),h.style.strokeDasharray=`${E[I]}`;});},150);}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),ee>0?setTimeout(()=>w.observe(e),ee):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(Re),w.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(C);},replay(){Pe=0,Te();},pause(){q||!J||(q=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){q&&(q=false,J=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let I=Math.min(1,Math.max(0,h));le=I,q=true,b=I*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return le},refresh(){clearTimeout(C),k.forEach((h,I)=>{E[I]=ze(h),h.style.strokeDasharray=`${E[I]}`;});}}}if(ve)return nt(Nt());pt();function Ue(){if(!xe||q)return;let o=performance.now(),a=rt();if(!Ne&&F===false&&a===ct){N=requestAnimationFrame(Ue);return}Ne=false,ct=a;let b=u;if(F!==false){let w=o-ut,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ut=o;let J=se?U===-1||a>=U?"forward":"reverse":x;U=a;let De=ie-f,$e=true,Te=De===0?0:(a-f)/De;if(isNaN(_e)||(_e<=0&&Te>0?$?.():_e>0&&Te<=0&&Ce?.(),_e<1&&Te>=1?ye?.():_e>=1&&Te<1&&he?.()),_e=Te,te){let w=be(Z(a,f,ie,b));ne&&!se&&(ae=Math.max(ae,w),w=ae),le=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=J==="reverse"?1-w:w;e.style.clipPath=Me(C),g?.(w),!R&&Z(a,f,ie,b)>0&&(R=true,v?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{ae=-1,R=false,O=false,e.style.clipPath=Me(0);},me))):w<1&&!ne&&(O=false),N=requestAnimationFrame(Ue);return}if(k.forEach((w,C)=>{let Q=C*_*De,h=be(Z(a,f+Q,ie+Q,b));ne&&!se&&(ae=Math.max(ae,h),h=ae),le=h,w.style.strokeDashoffset=J==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=J==="reverse"?`${1-h}`:`${h}`),pe&&Y?w.style.stroke=qe(pe,Y,h):Y&&(w.style.stroke=Y),X!==null&&z!==null?w.style.strokeWidth=`${X+(z-X)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),re!==null&&G!==null?w.style.fillOpacity=`${re+(G-re)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",it(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=be(Z(a,f,ie,b));for(let C in A){let Q=parseFloat(C);w>=Q&&!Fe.has(Q)&&(Fe.add(Q),A[C]?.());}}!R&&Z(a,f,ie,b)>0&&(R=true,v?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{ae=-1,R=false,O=false,Fe.clear(),je(),Ne=true;},me))):!$e&&!ne&&(O=false),N=requestAnimationFrame(Ue);}let ot=false;function Ye(){ot||(ot=true,N=requestAnimationFrame(function(){Ue();}));}function Xe(){ot=false,cancelAnimationFrame(N);}let st=new IntersectionObserver(o=>{o.forEach(a=>{xe=a.isIntersecting,xe&&!q?(Ne=true,Ye()):Xe();});},{root:fe??null,threshold:B,rootMargin:P});function gt(){k.forEach((o,a)=>{E[a]=ze(o),o.style.strokeDasharray=`${E[a]}`;}),pt(),Ne=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(gt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),ee>0?setTimeout(()=>st.observe(e),ee):st.observe(e),nt({destroy(){cancelAnimationFrame(N),clearTimeout(Re),Xe(),st.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),lt();},replay(){ae=-1,U=-1,Ge=-1,R=false,O=false,Pe=0,q=false,le=0,Fe.clear(),clearTimeout(Re),je(),Ne=true,xe&&Ye();},pause(){q=true,Xe();},resume(){q&&(q=false,Ne=true,xe&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));le=a,ae=a,q=true,Xe(),kt(a,x),Ne=true;},getProgress(){return le},refresh(){clearTimeout(Je),gt(),xe&&!q&&Ye();}},()=>({tStart:f,tEnd:ie}))}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function At(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 Qt(e,n,r){let t=At(e),l=At(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,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function Mt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Jt(t))return qe(t,l,r);if(t.includes("("))return Qt(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 Zt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Kt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),er=0,$t="--scroll-draw-progress";function tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Lt(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:d,native:S=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:ne,onProgress:ke,onComplete:j,onEnter:oe,onLeave:se,onEnterBack:ee,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:ue[s]??ue["ease-out"],A=Se(l.start??"top bottom"),F=Se(l.end??"bottom top"),B=ne??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Zt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function me(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let de=new Map;for(let i of [...M.map(f=>f.prop),$t])de.set(i,e.style.getPropertyValue(i));function ve(){for(let[i,f]of de)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:ve,getProgress:()=>1};me();let ge=typeof s=="string"?Ke(s):null;function Ee(){if(!S||!tr()||!ge||m!=="y"||P||B!==e||u||c!==1||ke||j||oe||se||ee||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Kt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++er}`,f=M.map(U=>`${U.prop}:${U.from}`).join(";"),ie=M.map(U=>`${U.prop}:${U.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${ie}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight,xe=()=>{let U=e.getBoundingClientRect();return Le({top:U.top,height:U.height},R(),N(),A,F)};Oe(e,{type:"animate",getProgress:()=>ae.getProgress(),getTrigger:xe});let ae={destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",ve(),Ie(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(U){let q=Math.min(1,Math.max(0,U));e.classList.remove(i);for(let le of M)e.style.setProperty(le.prop,Mt(le.from,le.to,q));},getProgress(){let{tStart:U,tEnd:q}=xe();return L(Z(R(),U,q,c))}};return ae}if(Ee())return g();let v=0,y=0,$=0,ye=false,he=false,Ce=-1,te=0,be=false,Ae=NaN,He=-1,fe=0,pe=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,Y=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function X(){let i=Qe(B,P,m),f=Le(i,i.scroll,Y(),A,F);v=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty($t,String(i));for(let f of M)e.style.setProperty(f.prop,Mt(f.from,f.to,i));ke?.(i);}function re(i){if(isNaN(Ae)){Ae=i;return}Ae<=0&&i>0?oe?.():Ae>0&&i<=0&&T?.(),Ae<1&&i>=1?se?.():Ae>=1&&i<1&&ee?.(),Ae=i;}function G(){if(!ye||he)return;let i=performance.now(),f=pe(),ie=c;if(_!==false){let N=i-fe,xe=N>0?Math.abs(f-(He<0?f:He))/N:0;ie=c*Math.max(.2,1+xe*(typeof _=="number"?_:1)*.04);}He=f,fe=i;let O=y===v?0:(f-v)/(y-v);re(O);let R=L(Z(f,v,y,ie));u&&(Ce=Math.max(Ce,R),R=Ce),te=R,z(R),R>=1&&!be?(be=true,j?.()):R<1&&!u&&(be=false),$=requestAnimationFrame(G);}X(),y===v&&K("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=L(Z(pe(),v,y,c));u&&i>0&&(Ce=i),te=i,z(i);}let Me=new IntersectionObserver(i=>{i.forEach(f=>{ye=f.isIntersecting,ye&&!he?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),k;function E(){clearTimeout(k),k=setTimeout(X,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Me.observe(e),Oe(e,{type:"animate",getProgress:()=>te,getTrigger:()=>({tStart:v,tEnd:y})}),{destroy(){cancelAnimationFrame($),Me.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(k),ve(),Ie(e);},replay(){Ce=-1,be=false,te=0,he=false,z(0);},pause(){he=true,cancelAnimationFrame($);},resume(){he&&(he=false,ye&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));te=f,Ce=f,he=true,cancelAnimationFrame($),z(f);},getProgress(){return te}}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ct(e,n){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollCounter: element not found:",e),at;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:S,onComplete:_}=n,x=S!==void 0?g=>g.toFixed(S):c??(g=>String(Math.round(g))),ne=typeof u=="function"?u:ue[u]??ue["ease-out"],ke=Se(m.start??"top 80%"),j=Se(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),at;let se=0,ee=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function me(){let g=t.getBoundingClientRect(),v=Le({top:g.top,height:g.height},P(),M(),ke,j);se=v.tStart,ee=v.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function de(){if(!W||L)return;let g=ne(Z(P(),se,ee,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(de);}me();{let g=ne(Z(P(),se,ee,1));d&&g>0&&(A=g),F=g,D(g);}let ve=new IntersectionObserver(g=>{g.forEach(v=>{W=v.isIntersecting,W&&!L?T=requestAnimationFrame(de):cancelAnimationFrame(T);});}),ge;function Ee(){clearTimeout(ge),ge=setTimeout(me,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),ve.observe(t),Oe(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:se,tEnd:ee})}),{destroy(){cancelAnimationFrame(T),ve.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(ge),Ie(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(de)));},seek(g){let v=Math.min(1,Math.max(0,g));F=v,A=v,L=true,cancelAnimationFrame(T),D(v);},getProgress(){return F}}}function Ot(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 rr(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 Pt(e){let n=Ot(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,d)=>{let S=m.nextElementSibling;u.appendChild(m),d<c.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function nr(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 or(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 Dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function It(e,n={}){if(typeof window>"u")return Dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollText: element not found:",e),Dt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:S}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:ue[c]??ue["ease-out"],ne=Se(m.start??"top 85%"),ke=Se(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let oe;l==="chars"?oe=rr(t):l==="lines"?oe=Pt(t):oe=Ot(t);let se=oe.length;function ee(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ye=or($,u);ye&&(y.style.transform=ye);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),oe.forEach(($,ye)=>{let he=x(nr(y,ye,se,s));ee($,he);});}if(_)return T(1),S?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,me=false,D=()=>window.scrollY,de=()=>window.innerHeight;function ve(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),de(),ne,ke);W=$.tStart,L=$.tEnd;}function ge(){if(!F||B)return;let y=Z(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!me?(me=true,S?.()):y<1&&!d&&(me=false),A=requestAnimationFrame(ge);}ve();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(ge):cancelAnimationFrame(A);});}),g;function v(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),oe=Pt(t),T(y);}ve();},150);}return window.addEventListener("resize",v),window.addEventListener("orientationchange",v),Ee.observe(t),Oe(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),Ie(t);},replay(){P=-1,me=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(ge)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function sr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(K("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function ar(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return Lt(n,r)}):[]}function lr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(K('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ct(n,r)}):[]}function cr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return It(n,r)}):[]}function Wr(e=Be()){return {draw:ir(e),animate:ar(e),counter:lr(e),text:cr(e)}}exports.initAll=Wr;exports.initScrollAnimate=ar;exports.initScrollCounter=lr;exports.initScrollDraw=ir;exports.initScrollText=cr;exports.scrollDraw=sr;
|
package/dist/astro/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Ht({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let S=Math.pow(l,d);c.push(S),s+=S;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let S=0;S<r;S++)if(d<=u[S+1]){let _=(d-u[S])/(u[S+1]-u[S]);if(S===0)return _*(2-_);let x=1-Math.pow(t,S);return x+(1-x)*(2*_-1)*(2*_-1)}return 1}}function _t({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=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-l)*(2*Math.PI)/t)+1}var ue={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:Ht(),elastic:_t()};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 yt(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 ht(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 ze(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 zt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:zt((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=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:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e,n,r,t,l){let s=yt(e.top,e.height,n,t.element)-ht(t.viewport,r),c=yt(e.top,e.height,n,l.element)-ht(l.viewport,r);return {tStart:s,tEnd:c}}function bt(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 qe(e,n,r){let t=bt(e),l=bt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var wt={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 Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function K(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Vt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Bt(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 Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Vt;case "ease-in-out":return Wt()?Bt(ue["ease-in-out"]):null;default:return null}}var vt=Symbol.for("svg-scroll-draw.registry");function Et(){let e=globalThis;return e[vt]||(e[vt]=new Map)}function Oe(e,n){Et().set(e,n);}function Ie(e){Et().delete(e);}var Gt=0;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?K("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&K("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Yt(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 l(){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 wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function jt(e,n,r){if(!Ze)return;let t=(e.match(vt)??[]).join("").toUpperCase(),l=(n.match(vt)??[]).join("").toUpperCase(),s=(e.match(wt)??[]).length,c=(n.match(wt)??[]).length;if(t!==l){ee(`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&&ee(`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 st(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 et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...ht[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:d="linear",trigger:v={},stagger:_=0,direction:x="forward",once:oe=false,debug:Oe=false,axis:j="y",scrollContainer:se,autoReverse:ie=false,delay:te=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:ce=0,morphTo:D,clip:pe,autoplay:Se=false,duration:de=1e3,native:Ee=true,onProgress:g,onStart:S,onComplete:y,onEnter:$,onLeave:ge,onEnterBack:ye,onLeaveBack:Ce}=l,re=pe===true?"left":typeof pe=="string"?pe:false,he=typeof d=="function"?d:le[d]??le.linear,Te=ve(v.start??"top bottom"),Re=ve(v.end??"bottom top"),ue=typeof se=="string"?document.querySelector(se):se??null,me=Array.isArray(T)?T[0]:null,X=Array.isArray(T)?T[1]:typeof T=="string"?T:null,Y=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,ne=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ae(o){let a=o*100;switch(re){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 I=re?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,fe=0,O=false,R=false,N=0,q=false,J=-1,Me=-1,U=false,be=0,Pe=0,ke,tt=null;function at(){tt?.destroy(),tt=null;}let Ie=new Set,lt=NaN,Fe=true,Ge=-1,ct=performance.now(),Ne=NaN;function rt(){return ue?j==="x"?ue.scrollLeft:ue.scrollTop:j==="x"?window.scrollX:window.scrollY}function ut(){return ue?j==="x"?ue.clientWidth:ue.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function mt(){let o=Qe(e,ue,j),a=Le(o,o.scroll,ut(),Te,Re);f=a.tStart,fe=a.tEnd,Oe&&Ze&&(at(),tt=Gt(f,fe,j));}function Dt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),re){let b=a==="reverse"?1-o:o;e.style.clipPath=Ae(b);return}I.forEach((b,Q)=>{b.style.strokeDashoffset=a==="reverse"?`${E[Q]*o}`:`${E[Q]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),me&&X?b.style.stroke=_e(me,X,o):X&&(b.style.stroke=X),Y!==null&&z!==null?b.style.strokeWidth=`${Y+(z-Y)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),ne!==null&&G!==null?b.style.fillOpacity=`${ne+(G-ne)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[Q]&&b.setAttribute("d",st(i[Q],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),re){e.style.clipPath=Ae(0);return}I.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(I.forEach(o=>{Bt(o);let a=He(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?jt(i[i.length-1],D,o):ee(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),X&&(o.style.stroke=X),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`));}),re){if(s)return e.style.clipPath=Ae(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ae(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ft=typeof d=="string"?Ke(d):null;function Ot(){return !(Ee===false||!Wt()||!I.length||!ft||re||j!=="y"||ue||u!==1||_!==0||oe||ie||F!==false||D||A||M||te>0||g||S||y||$||ge||ye||Ce||T!=null||W!=null||L!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function kt(){let o=++Vt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",xe=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(xe+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${xe}}to{${w}}}.${b}{view-timeline-name:${Q};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ft};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Z(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}I.forEach(Z);let h=false,k=-1;function H(){if(k>=0)return k;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),ut(),Te,Re);return he(K(rt(),V,we,u))}return {destroy(){e.classList.remove(b),I.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,k=-1,I.forEach(Z);},pause(){h=true,I.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,I.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));k=V,h=true,I.forEach((we,ae)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ae]*V}`:`${E[ae]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){I.forEach((p,V)=>{E[V]=He(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Ot())return kt();function It(){let o=Math.max(1,de),a=0,b=0,Q=false;function De(h){let k=true;if(re){let H=Math.min(1,Math.max(0,h/o)),p=he(H);be=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Ae(x==="reverse"?1-p:p),g?.(p),H<1&&(k=false);}else I.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ae=he(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ae}`:`${E[p]*(1-ae)}`,m&&(H.style.opacity=x==="reverse"?`${1-ae}`:`${ae}`),me&&X?H.style.stroke=_e(me,X,ae):X&&(H.style.stroke=X),Y!==null&&z!==null?H.style.strokeWidth=`${Y+(z-Y)*ae}`:z!==null&&(H.style.strokeWidth=`${z}`),ne!==null&&G!==null?H.style.fillOpacity=`${ne+(G-ne)*ae}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",st(i[p],D,ae)),p===0&&(be=ae,g?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),we<1&&(k=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=he(H);for(let V in A){let we=parseFloat(V);p>=we&&!Ie.has(we)&&(Ie.add(we),A[V]?.());}}return k}function $e(h){if(U)return;let k=h-a;R||(R=true,S?.());let H=De(k);if(H&&!O){O=true,De(o*(1+Math.max(0,I.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{a=performance.now(),R=false,O=false,Ie.clear(),je(),N=requestAnimationFrame($e);},ce));return}H||(N=requestAnimationFrame($e));}function xe(){cancelAnimationFrame(N),clearTimeout(ke),a=performance.now(),b=0,U=false,R=false,O=false,Pe=0,Q=true,be=0,Ie.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(k=>{k.isIntersecting&&!(oe&&O)?xe():!k.isIntersecting&&!oe&&!O&&(cancelAnimationFrame(N),clearTimeout(ke),Q=false);});},{root:ue??null,threshold:B,rootMargin:P}),C;function Z(){clearTimeout(C),C=setTimeout(()=>{I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),te>0?setTimeout(()=>w.observe(e),te):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(C);},replay(){Pe=0,xe();},pause(){U||!Q||(U=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){U&&(U=false,Q=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let k=Math.min(1,Math.max(0,h));be=k,U=true,b=k*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return be},refresh(){clearTimeout(C),I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});}}}if(Se)return It();mt();function Ue(){if(!q||U)return;let o=performance.now(),a=rt();if(!Fe&&F===false&&a===lt){N=requestAnimationFrame(Ue);return}Fe=false,lt=a;let b=u;if(F!==false){let w=o-ct,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ct=o;let Q=ie?Me===-1||a>=Me?"forward":"reverse":x;Me=a;let De=fe-f,$e=true,xe=De===0?0:(a-f)/De;if(isNaN(Ne)||(Ne<=0&&xe>0?$?.():Ne>0&&xe<=0&&Ce?.(),Ne<1&&xe>=1?ge?.():Ne>=1&&xe<1&&ye?.()),Ne=xe,re){let w=he(K(a,f,fe,b));oe&&!ie&&(J=Math.max(J,w),w=J),be=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=Q==="reverse"?1-w:w;e.style.clipPath=Ae(C),g?.(w),!R&&K(a,f,fe,b)>0&&(R=true,S?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,e.style.clipPath=Ae(0);},ce))):w<1&&!oe&&(O=false),N=requestAnimationFrame(Ue);return}if(I.forEach((w,C)=>{let Z=C*_*De,h=he(K(a,f+Z,fe+Z,b));oe&&!ie&&(J=Math.max(J,h),h=J),be=h,w.style.strokeDashoffset=Q==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=Q==="reverse"?`${1-h}`:`${h}`),me&&X?w.style.stroke=_e(me,X,h):X&&(w.style.stroke=X),Y!==null&&z!==null?w.style.strokeWidth=`${Y+(z-Y)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),ne!==null&&G!==null?w.style.fillOpacity=`${ne+(G-ne)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",st(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=he(K(a,f,fe,b));for(let C in A){let Z=parseFloat(C);w>=Z&&!Ie.has(Z)&&(Ie.add(Z),A[C]?.());}}!R&&K(a,f,fe,b)>0&&(R=true,S?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,Ie.clear(),je(),Fe=true;},ce))):!$e&&!oe&&(O=false),N=requestAnimationFrame(Ue);}let nt=false;function Xe(){nt||(nt=true,N=requestAnimationFrame(function(){Ue();}));}function Ye(){nt=false,cancelAnimationFrame(N);}let ot=new IntersectionObserver(o=>{o.forEach(a=>{q=a.isIntersecting,q&&!U?(Fe=true,Xe()):Ye();});},{root:ue??null,threshold:B,rootMargin:P});function pt(){I.forEach((o,a)=>{E[a]=He(o),o.style.strokeDasharray=`${E[a]}`;}),mt(),Fe=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(pt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),te>0?setTimeout(()=>ot.observe(e),te):ot.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),Ye(),ot.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),at();},replay(){J=-1,Me=-1,Ge=-1,R=false,O=false,Pe=0,U=false,be=0,Ie.clear(),clearTimeout(ke),je(),Fe=true,q&&Xe();},pause(){U=true,Ye();},resume(){U&&(U=false,Fe=true,q&&Xe());},seek(o){let a=Math.min(1,Math.max(0,o));be=a,J=a,U=true,Ye(),Dt(a,x),Fe=true;},getProgress(){return be},refresh(){clearTimeout(Je),pt(),q&&!U&&Xe();}}}var St=new Map;function ze(e,n){St.set(e,n);}function qe(e){St.delete(e);}function Ut(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Et(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 Xt(e,n,r){let t=Et(e),l=Et(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,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function xt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Ut(t))return _e(t,l,r);if(t.includes("("))return Xt(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 Yt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Qt=0,Tt="--scroll-draw-progress";function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function At(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:d,native:v=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:oe,onProgress:Oe,onComplete:j,onEnter:se,onLeave:ie,onEnterBack:te,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:le[s]??le["ease-out"],A=ve(l.start??"top bottom"),F=ve(l.end??"bottom top"),B=oe??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Yt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ce(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let pe=new Map;for(let i of [...M.map(f=>f.prop),Tt])pe.set(i,e.style.getPropertyValue(i));function Se(){for(let[i,f]of pe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:Se,getProgress:()=>1};ce();let de=typeof s=="string"?Ke(s):null;function Ee(){if(!v||!Zt()||!de||m!=="y"||P||B!==e||u||c!==1||Oe||j||se||ie||te||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Jt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++Qt}`,f=M.map(q=>`${q.prop}:${q.from}`).join(";"),fe=M.map(q=>`${q.prop}:${q.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${fe}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",Se();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let J=Math.min(1,Math.max(0,q));e.classList.remove(i);for(let Me of M)e.style.setProperty(Me.prop,xt(Me.from,Me.to,J));},getProgress(){let q=e.getBoundingClientRect(),J=R(),Me=N(),{tStart:U,tEnd:be}=Le({top:q.top,height:q.height},J,Me,A,F);return L(K(J,U,be,c))}}}if(Ee())return g();let S=0,y=0,$=0,ge=false,ye=false,Ce=-1,re=0,he=false,Te=NaN,Re=-1,ue=0,me=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function Y(){let i=Qe(B,P,m),f=Le(i,i.scroll,X(),A,F);S=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty(Tt,String(i));for(let f of M)e.style.setProperty(f.prop,xt(f.from,f.to,i));Oe?.(i);}function ne(i){if(isNaN(Te)){Te=i;return}Te<=0&&i>0?se?.():Te>0&&i<=0&&T?.(),Te<1&&i>=1?ie?.():Te>=1&&i<1&&te?.(),Te=i;}function G(){if(!ge||ye)return;let i=performance.now(),f=me(),fe=c;if(_!==false){let N=i-ue,q=N>0?Math.abs(f-(Re<0?f:Re))/N:0;fe=c*Math.max(.2,1+q*(typeof _=="number"?_:1)*.04);}Re=f,ue=i;let O=y===S?0:(f-S)/(y-S);ne(O);let R=L(K(f,S,y,fe));u&&(Ce=Math.max(Ce,R),R=Ce),re=R,z(R),R>=1&&!he?(he=true,j?.()):R<1&&!u&&(he=false),$=requestAnimationFrame(G);}Y(),y===S&&ee("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=L(K(me(),S,y,c));u&&i>0&&(Ce=i),re=i,z(i);}let Ae=new IntersectionObserver(i=>{i.forEach(f=>{ge=f.isIntersecting,ge&&!ye?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),I;function E(){clearTimeout(I),I=setTimeout(Y,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Ae.observe(e),ze(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:S,tEnd:y})}),{destroy(){cancelAnimationFrame($),Ae.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(I),Se(),qe(e);},replay(){Ce=-1,he=false,re=0,ye=false,z(0);},pause(){ye=true,cancelAnimationFrame($);},resume(){ye&&(ye=false,ge&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));re=f,Ce=f,ye=true,cancelAnimationFrame($),z(f);},getProgress(){return re}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,n){if(typeof window>"u")return it;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollCounter: element not found:",e),it;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:v,onComplete:_}=n,x=v!==void 0?g=>g.toFixed(v):c??(g=>String(Math.round(g))),oe=typeof u=="function"?u:le[u]??le["ease-out"],Oe=ve(m.start??"top 80%"),j=ve(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),it;let ie=0,te=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function ce(){let g=t.getBoundingClientRect(),S=Le({top:g.top,height:g.height},P(),M(),Oe,j);ie=S.tStart,te=S.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function pe(){if(!W||L)return;let g=oe(K(P(),ie,te,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(pe);}ce();{let g=oe(K(P(),ie,te,1));d&&g>0&&(A=g),F=g,D(g);}let Se=new IntersectionObserver(g=>{g.forEach(S=>{W=S.isIntersecting,W&&!L?T=requestAnimationFrame(pe):cancelAnimationFrame(T);});}),de;function Ee(){clearTimeout(de),de=setTimeout(ce,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),Se.observe(t),ze(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:ie,tEnd:te})}),{destroy(){cancelAnimationFrame(T),Se.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(de),qe(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(pe)));},seek(g){let S=Math.min(1,Math.max(0,g));F=S,A=S,L=true,cancelAnimationFrame(T),D(S);},getProgress(){return F}}}function Ct(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 Kt(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 $t(e){let n=Ct(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,d)=>{let v=m.nextElementSibling;u.appendChild(m),d<c.length-1&&v&&v.style.whiteSpace==="pre"&&u.appendChild(v);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function er(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 tr(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 Lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pt(e,n={}){if(typeof window>"u")return Lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollText: element not found:",e),Lt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:v}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:le[c]??le["ease-out"],oe=ve(m.start??"top 85%"),Oe=ve(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let se;l==="chars"?se=Kt(t):l==="lines"?se=$t(t):se=Ct(t);let ie=se.length;function te(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ge=tr($,u);ge&&(y.style.transform=ge);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),se.forEach(($,ge)=>{let ye=x(er(y,ge,ie,s));te($,ye);});}if(_)return T(1),v?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,ce=false,D=()=>window.scrollY,pe=()=>window.innerHeight;function Se(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),pe(),oe,Oe);W=$.tStart,L=$.tEnd;}function de(){if(!F||B)return;let y=K(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!ce?(ce=true,v?.()):y<1&&!d&&(ce=false),A=requestAnimationFrame(de);}Se();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(de):cancelAnimationFrame(A);});}),g;function S(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),se=$t(t),T(y);}Se();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),Ee.observe(t),ze(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),qe(t);},replay(){P=-1,ce=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(de)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function rr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(ee("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function nr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function or(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return At(n,r)}):[]}function sr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(ee('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Mt(n,r)}):[]}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return Pt(n,r)}):[]}function _r(e=Be()){return {draw:nr(e),animate:or(e),counter:sr(e),text:ir(e)}}export{_r as initAll,or as initScrollAnimate,sr as initScrollCounter,nr as initScrollDraw,ir as initScrollText,rr as scrollDraw};
|
|
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 xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Tt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Xt(e,n,r){if(!Ze)return;let t=(e.match(Tt)??[]).join("").toUpperCase(),l=(n.match(Tt)??[]).join("").toUpperCase(),s=(e.match(xt)??[]).length,c=(n.match(xt)??[]).length;if(t!==l){K(`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&&K(`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 it(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 et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...wt[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:d="linear",trigger:S={},stagger:_=0,direction:x="forward",once:ne=false,debug:ke=false,axis:j="y",scrollContainer:oe,autoReverse:se=false,delay:ee=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:me=0,morphTo:D,clip:de,autoplay:ve=false,duration:ge=1e3,native:Ee=true,onProgress:g,onStart:v,onComplete:y,onEnter:$,onLeave:ye,onEnterBack:he,onLeaveBack:Ce}=l,te=de===true?"left":typeof de=="string"?de:false,be=typeof d=="function"?d:ue[d]??ue.linear,Ae=Se(S.start??"top bottom"),He=Se(S.end??"bottom top"),fe=typeof oe=="string"?document.querySelector(oe):oe??null,pe=Array.isArray(T)?T[0]:null,Y=Array.isArray(T)?T[1]:typeof T=="string"?T:null,X=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,re=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Me(o){let a=o*100;switch(te){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 k=te?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,ie=0,O=false,R=false,N=0,xe=false,ae=-1,U=-1,q=false,le=0,Pe=0,Re,tt=null;function lt(){tt?.destroy(),tt=null;}let Fe=new Set,ct=NaN,Ne=true,Ge=-1,ut=performance.now(),_e=NaN;function rt(){return fe?j==="x"?fe.scrollLeft:fe.scrollTop:j==="x"?window.scrollX:window.scrollY}function mt(){return fe?j==="x"?fe.clientWidth:fe.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function ft(){let o=Qe(e,fe,j);return Le(o,o.scroll,mt(),Ae,He)}function pt(){(({tStart:f,tEnd:ie}=ft())),ke&&Ze&&(lt(),tt=Yt(f,ie,j));}function nt(o,a=ft){Oe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Ie(e);},o}function kt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),te){let b=a==="reverse"?1-o:o;e.style.clipPath=Me(b);return}k.forEach((b,J)=>{b.style.strokeDashoffset=a==="reverse"?`${E[J]*o}`:`${E[J]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),pe&&Y?b.style.stroke=qe(pe,Y,o):Y&&(b.style.stroke=Y),X!==null&&z!==null?b.style.strokeWidth=`${X+(z-X)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),re!==null&&G!==null?b.style.fillOpacity=`${re+(G-re)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[J]&&b.setAttribute("d",it(i[J],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),te){e.style.clipPath=Me(0);return}k.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(k.forEach(o=>{Ut(o);let a=ze(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Xt(i[i.length-1],D,o):K(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),Y&&(o.style.stroke=Y),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`));}),te){if(s)return e.style.clipPath=Me(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Me(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let dt=typeof d=="string"?Ke(d):null;function Rt(){return !(Ee===false||!jt()||!k.length||!dt||te||j!=="y"||fe||u!==1||_!==0||ne||se||F!==false||D||A||M||ee>0||g||v||y||$||ye||he||Ce||T!=null||W!=null||L!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Ft(){let o=++Gt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,J=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",Te=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(Te+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${Te}}to{${w}}}.${b}{view-timeline-name:${J};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${dt};animation-fill-mode:both;animation-timeline:${J};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Q(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}k.forEach(Q);let h=false,I=-1;function H(){if(I>=0)return I;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),mt(),Ae,He);return be(Z(rt(),V,we,u))}return {destroy(){e.classList.remove(b),k.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,I=-1,k.forEach(Q);},pause(){h=true,k.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,k.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));I=V,h=true,k.forEach((we,ce)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ce]*V}`:`${E[ce]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){k.forEach((p,V)=>{E[V]=ze(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Rt())return nt(Ft());function Nt(){let o=Math.max(1,ge),a=0,b=0,J=false;function De(h){let I=true;if(te){let H=Math.min(1,Math.max(0,h/o)),p=be(H);le=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Me(x==="reverse"?1-p:p),g?.(p),H<1&&(I=false);}else k.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ce=be(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ce}`:`${E[p]*(1-ce)}`,m&&(H.style.opacity=x==="reverse"?`${1-ce}`:`${ce}`),pe&&Y?H.style.stroke=qe(pe,Y,ce):Y&&(H.style.stroke=Y),X!==null&&z!==null?H.style.strokeWidth=`${X+(z-X)*ce}`:z!==null&&(H.style.strokeWidth=`${z}`),re!==null&&G!==null?H.style.fillOpacity=`${re+(G-re)*ce}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",it(i[p],D,ce)),p===0&&(le=ce,g?.(ce),e.style.setProperty("--scroll-draw-progress",String(ce))),we<1&&(I=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=be(H);for(let V in A){let we=parseFloat(V);p>=we&&!Fe.has(we)&&(Fe.add(we),A[V]?.());}}return I}function $e(h){if(q)return;let I=h-a;R||(R=true,v?.());let H=De(I);if(H&&!O){O=true,De(o*(1+Math.max(0,k.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{a=performance.now(),R=false,O=false,Fe.clear(),je(),N=requestAnimationFrame($e);},me));return}H||(N=requestAnimationFrame($e));}function Te(){cancelAnimationFrame(N),clearTimeout(Re),a=performance.now(),b=0,q=false,R=false,O=false,Pe=0,J=true,le=0,Fe.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(I=>{I.isIntersecting&&!(ne&&O)?Te():!I.isIntersecting&&!ne&&!O&&(cancelAnimationFrame(N),clearTimeout(Re),J=false);});},{root:fe??null,threshold:B,rootMargin:P}),C;function Q(){clearTimeout(C),C=setTimeout(()=>{k.forEach((h,I)=>{E[I]=ze(h),h.style.strokeDasharray=`${E[I]}`;});},150);}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),ee>0?setTimeout(()=>w.observe(e),ee):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(Re),w.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(C);},replay(){Pe=0,Te();},pause(){q||!J||(q=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){q&&(q=false,J=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let I=Math.min(1,Math.max(0,h));le=I,q=true,b=I*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return le},refresh(){clearTimeout(C),k.forEach((h,I)=>{E[I]=ze(h),h.style.strokeDasharray=`${E[I]}`;});}}}if(ve)return nt(Nt());pt();function Ue(){if(!xe||q)return;let o=performance.now(),a=rt();if(!Ne&&F===false&&a===ct){N=requestAnimationFrame(Ue);return}Ne=false,ct=a;let b=u;if(F!==false){let w=o-ut,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ut=o;let J=se?U===-1||a>=U?"forward":"reverse":x;U=a;let De=ie-f,$e=true,Te=De===0?0:(a-f)/De;if(isNaN(_e)||(_e<=0&&Te>0?$?.():_e>0&&Te<=0&&Ce?.(),_e<1&&Te>=1?ye?.():_e>=1&&Te<1&&he?.()),_e=Te,te){let w=be(Z(a,f,ie,b));ne&&!se&&(ae=Math.max(ae,w),w=ae),le=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=J==="reverse"?1-w:w;e.style.clipPath=Me(C),g?.(w),!R&&Z(a,f,ie,b)>0&&(R=true,v?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{ae=-1,R=false,O=false,e.style.clipPath=Me(0);},me))):w<1&&!ne&&(O=false),N=requestAnimationFrame(Ue);return}if(k.forEach((w,C)=>{let Q=C*_*De,h=be(Z(a,f+Q,ie+Q,b));ne&&!se&&(ae=Math.max(ae,h),h=ae),le=h,w.style.strokeDashoffset=J==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=J==="reverse"?`${1-h}`:`${h}`),pe&&Y?w.style.stroke=qe(pe,Y,h):Y&&(w.style.stroke=Y),X!==null&&z!==null?w.style.strokeWidth=`${X+(z-X)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),re!==null&&G!==null?w.style.fillOpacity=`${re+(G-re)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",it(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=be(Z(a,f,ie,b));for(let C in A){let Q=parseFloat(C);w>=Q&&!Fe.has(Q)&&(Fe.add(Q),A[C]?.());}}!R&&Z(a,f,ie,b)>0&&(R=true,v?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,Re=setTimeout(()=>{ae=-1,R=false,O=false,Fe.clear(),je(),Ne=true;},me))):!$e&&!ne&&(O=false),N=requestAnimationFrame(Ue);}let ot=false;function Ye(){ot||(ot=true,N=requestAnimationFrame(function(){Ue();}));}function Xe(){ot=false,cancelAnimationFrame(N);}let st=new IntersectionObserver(o=>{o.forEach(a=>{xe=a.isIntersecting,xe&&!q?(Ne=true,Ye()):Xe();});},{root:fe??null,threshold:B,rootMargin:P});function gt(){k.forEach((o,a)=>{E[a]=ze(o),o.style.strokeDasharray=`${E[a]}`;}),pt(),Ne=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(gt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),ee>0?setTimeout(()=>st.observe(e),ee):st.observe(e),nt({destroy(){cancelAnimationFrame(N),clearTimeout(Re),Xe(),st.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),lt();},replay(){ae=-1,U=-1,Ge=-1,R=false,O=false,Pe=0,q=false,le=0,Fe.clear(),clearTimeout(Re),je(),Ne=true,xe&&Ye();},pause(){q=true,Xe();},resume(){q&&(q=false,Ne=true,xe&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));le=a,ae=a,q=true,Xe(),kt(a,x),Ne=true;},getProgress(){return le},refresh(){clearTimeout(Je),gt(),xe&&!q&&Ye();}},()=>({tStart:f,tEnd:ie}))}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function At(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 Qt(e,n,r){let t=At(e),l=At(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,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function Mt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Jt(t))return qe(t,l,r);if(t.includes("("))return Qt(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 Zt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Kt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),er=0,$t="--scroll-draw-progress";function tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Lt(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:d,native:S=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:ne,onProgress:ke,onComplete:j,onEnter:oe,onLeave:se,onEnterBack:ee,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:ue[s]??ue["ease-out"],A=Se(l.start??"top bottom"),F=Se(l.end??"bottom top"),B=ne??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Zt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function me(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let de=new Map;for(let i of [...M.map(f=>f.prop),$t])de.set(i,e.style.getPropertyValue(i));function ve(){for(let[i,f]of de)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:ve,getProgress:()=>1};me();let ge=typeof s=="string"?Ke(s):null;function Ee(){if(!S||!tr()||!ge||m!=="y"||P||B!==e||u||c!==1||ke||j||oe||se||ee||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Kt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++er}`,f=M.map(U=>`${U.prop}:${U.from}`).join(";"),ie=M.map(U=>`${U.prop}:${U.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${ie}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight,xe=()=>{let U=e.getBoundingClientRect();return Le({top:U.top,height:U.height},R(),N(),A,F)};Oe(e,{type:"animate",getProgress:()=>ae.getProgress(),getTrigger:xe});let ae={destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",ve(),Ie(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(U){let q=Math.min(1,Math.max(0,U));e.classList.remove(i);for(let le of M)e.style.setProperty(le.prop,Mt(le.from,le.to,q));},getProgress(){let{tStart:U,tEnd:q}=xe();return L(Z(R(),U,q,c))}};return ae}if(Ee())return g();let v=0,y=0,$=0,ye=false,he=false,Ce=-1,te=0,be=false,Ae=NaN,He=-1,fe=0,pe=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,Y=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function X(){let i=Qe(B,P,m),f=Le(i,i.scroll,Y(),A,F);v=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty($t,String(i));for(let f of M)e.style.setProperty(f.prop,Mt(f.from,f.to,i));ke?.(i);}function re(i){if(isNaN(Ae)){Ae=i;return}Ae<=0&&i>0?oe?.():Ae>0&&i<=0&&T?.(),Ae<1&&i>=1?se?.():Ae>=1&&i<1&&ee?.(),Ae=i;}function G(){if(!ye||he)return;let i=performance.now(),f=pe(),ie=c;if(_!==false){let N=i-fe,xe=N>0?Math.abs(f-(He<0?f:He))/N:0;ie=c*Math.max(.2,1+xe*(typeof _=="number"?_:1)*.04);}He=f,fe=i;let O=y===v?0:(f-v)/(y-v);re(O);let R=L(Z(f,v,y,ie));u&&(Ce=Math.max(Ce,R),R=Ce),te=R,z(R),R>=1&&!be?(be=true,j?.()):R<1&&!u&&(be=false),$=requestAnimationFrame(G);}X(),y===v&&K("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=L(Z(pe(),v,y,c));u&&i>0&&(Ce=i),te=i,z(i);}let Me=new IntersectionObserver(i=>{i.forEach(f=>{ye=f.isIntersecting,ye&&!he?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),k;function E(){clearTimeout(k),k=setTimeout(X,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Me.observe(e),Oe(e,{type:"animate",getProgress:()=>te,getTrigger:()=>({tStart:v,tEnd:y})}),{destroy(){cancelAnimationFrame($),Me.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(k),ve(),Ie(e);},replay(){Ce=-1,be=false,te=0,he=false,z(0);},pause(){he=true,cancelAnimationFrame($);},resume(){he&&(he=false,ye&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));te=f,Ce=f,he=true,cancelAnimationFrame($),z(f);},getProgress(){return te}}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ct(e,n){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollCounter: element not found:",e),at;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:S,onComplete:_}=n,x=S!==void 0?g=>g.toFixed(S):c??(g=>String(Math.round(g))),ne=typeof u=="function"?u:ue[u]??ue["ease-out"],ke=Se(m.start??"top 80%"),j=Se(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),at;let se=0,ee=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function me(){let g=t.getBoundingClientRect(),v=Le({top:g.top,height:g.height},P(),M(),ke,j);se=v.tStart,ee=v.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function de(){if(!W||L)return;let g=ne(Z(P(),se,ee,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(de);}me();{let g=ne(Z(P(),se,ee,1));d&&g>0&&(A=g),F=g,D(g);}let ve=new IntersectionObserver(g=>{g.forEach(v=>{W=v.isIntersecting,W&&!L?T=requestAnimationFrame(de):cancelAnimationFrame(T);});}),ge;function Ee(){clearTimeout(ge),ge=setTimeout(me,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),ve.observe(t),Oe(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:se,tEnd:ee})}),{destroy(){cancelAnimationFrame(T),ve.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(ge),Ie(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(de)));},seek(g){let v=Math.min(1,Math.max(0,g));F=v,A=v,L=true,cancelAnimationFrame(T),D(v);},getProgress(){return F}}}function Ot(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 rr(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 Pt(e){let n=Ot(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,d)=>{let S=m.nextElementSibling;u.appendChild(m),d<c.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function nr(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 or(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 Dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function It(e,n={}){if(typeof window>"u")return Dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollText: element not found:",e),Dt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:S}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:ue[c]??ue["ease-out"],ne=Se(m.start??"top 85%"),ke=Se(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let oe;l==="chars"?oe=rr(t):l==="lines"?oe=Pt(t):oe=Ot(t);let se=oe.length;function ee(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ye=or($,u);ye&&(y.style.transform=ye);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),oe.forEach(($,ye)=>{let he=x(nr(y,ye,se,s));ee($,he);});}if(_)return T(1),S?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,me=false,D=()=>window.scrollY,de=()=>window.innerHeight;function ve(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),de(),ne,ke);W=$.tStart,L=$.tEnd;}function ge(){if(!F||B)return;let y=Z(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!me?(me=true,S?.()):y<1&&!d&&(me=false),A=requestAnimationFrame(ge);}ve();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(ge):cancelAnimationFrame(A);});}),g;function v(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),oe=Pt(t),T(y);}ve();},150);}return window.addEventListener("resize",v),window.addEventListener("orientationchange",v),Ee.observe(t),Oe(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),Ie(t);},replay(){P=-1,me=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(ge)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function sr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(K("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function ar(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return Lt(n,r)}):[]}function lr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(K('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ct(n,r)}):[]}function cr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return It(n,r)}):[]}function Wr(e=Be()){return {draw:ir(e),animate:ar(e),counter:lr(e),text:cr(e)}}export{Wr as initAll,ar as initScrollAnimate,lr as initScrollCounter,ir as initScrollDraw,cr as initScrollText,sr as scrollDraw};
|
|
@@ -288,6 +288,19 @@ var SvgScrollDraw = (() => {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
// src/core/registry.ts
|
|
292
|
+
var KEY = /* @__PURE__ */ Symbol.for("svg-scroll-draw.registry");
|
|
293
|
+
function registry() {
|
|
294
|
+
const g = globalThis;
|
|
295
|
+
return g[KEY] || (g[KEY] = /* @__PURE__ */ new Map());
|
|
296
|
+
}
|
|
297
|
+
function _register(el, entry) {
|
|
298
|
+
registry().set(el, entry);
|
|
299
|
+
}
|
|
300
|
+
function _unregister(el) {
|
|
301
|
+
registry().delete(el);
|
|
302
|
+
}
|
|
303
|
+
|
|
291
304
|
// src/core/engine.ts
|
|
292
305
|
var nativeUid = 0;
|
|
293
306
|
function supportsNativeTimeline() {
|
|
@@ -463,16 +476,26 @@ var SvgScrollDraw = (() => {
|
|
|
463
476
|
if (scrollEl) return axis === "x" ? scrollEl.clientWidth : scrollEl.clientHeight;
|
|
464
477
|
return axis === "x" ? window.innerWidth : window.innerHeight;
|
|
465
478
|
}
|
|
466
|
-
function
|
|
479
|
+
function measureTriggers() {
|
|
467
480
|
const frame = measureTriggerFrame(container, scrollEl, axis);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
481
|
+
return computeTriggers(frame, frame.scroll, vpSize(), startConfig, endConfig);
|
|
482
|
+
}
|
|
483
|
+
function cacheTriggers() {
|
|
484
|
+
({ tStart, tEnd } = measureTriggers());
|
|
471
485
|
if (debug && IS_DEV) {
|
|
472
486
|
destroyDebugOverlay();
|
|
473
487
|
debugOverlay = createDebugOverlay(tStart, tEnd, axis);
|
|
474
488
|
}
|
|
475
489
|
}
|
|
490
|
+
function tracked(inst, getTrigger = measureTriggers) {
|
|
491
|
+
_register(container, { type: "draw", getProgress: () => inst.getProgress(), getTrigger });
|
|
492
|
+
const destroy = inst.destroy;
|
|
493
|
+
inst.destroy = () => {
|
|
494
|
+
destroy.call(inst);
|
|
495
|
+
_unregister(container);
|
|
496
|
+
};
|
|
497
|
+
return inst;
|
|
498
|
+
}
|
|
476
499
|
function applyAlpha(alpha, dir) {
|
|
477
500
|
container.style.setProperty("--scroll-draw-progress", String(alpha));
|
|
478
501
|
if (clipDirection) {
|
|
@@ -692,7 +715,7 @@ var SvgScrollDraw = (() => {
|
|
|
692
715
|
}
|
|
693
716
|
};
|
|
694
717
|
}
|
|
695
|
-
if (nativeEligible()) return buildNative();
|
|
718
|
+
if (nativeEligible()) return tracked(buildNative());
|
|
696
719
|
function buildAutoplay() {
|
|
697
720
|
const effectiveDuration = Math.max(1, duration);
|
|
698
721
|
let startTime = 0;
|
|
@@ -867,7 +890,7 @@ var SvgScrollDraw = (() => {
|
|
|
867
890
|
}
|
|
868
891
|
};
|
|
869
892
|
}
|
|
870
|
-
if (autoplay) return buildAutoplay();
|
|
893
|
+
if (autoplay) return tracked(buildAutoplay());
|
|
871
894
|
cacheTriggers();
|
|
872
895
|
function update() {
|
|
873
896
|
if (!isVisible || paused) return;
|
|
@@ -1046,7 +1069,7 @@ var SvgScrollDraw = (() => {
|
|
|
1046
1069
|
}
|
|
1047
1070
|
if (delay > 0) setTimeout(() => observer.observe(container), delay);
|
|
1048
1071
|
else observer.observe(container);
|
|
1049
|
-
return {
|
|
1072
|
+
return tracked({
|
|
1050
1073
|
destroy() {
|
|
1051
1074
|
cancelAnimationFrame(rafId);
|
|
1052
1075
|
clearTimeout(repeatTimer);
|
|
@@ -1107,16 +1130,7 @@ var SvgScrollDraw = (() => {
|
|
|
1107
1130
|
remeasure();
|
|
1108
1131
|
if (isVisible && !paused) startLoop();
|
|
1109
1132
|
}
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
// src/core/registry.ts
|
|
1114
|
-
var _registry = /* @__PURE__ */ new Map();
|
|
1115
|
-
function _register(el, entry) {
|
|
1116
|
-
_registry.set(el, entry);
|
|
1117
|
-
}
|
|
1118
|
-
function _unregister(el) {
|
|
1119
|
-
_registry.delete(el);
|
|
1133
|
+
}, () => ({ tStart, tEnd }));
|
|
1120
1134
|
}
|
|
1121
1135
|
|
|
1122
1136
|
// src/animate/index.ts
|
|
@@ -1293,12 +1307,22 @@ var SvgScrollDraw = (() => {
|
|
|
1293
1307
|
el.classList.add(cls);
|
|
1294
1308
|
const scrollPos2 = () => axis === "x" ? window.scrollX : window.scrollY;
|
|
1295
1309
|
const vpSize2 = () => axis === "x" ? window.innerWidth : window.innerHeight;
|
|
1296
|
-
|
|
1310
|
+
const liveTriggers = () => {
|
|
1311
|
+
const rect = el.getBoundingClientRect();
|
|
1312
|
+
return computeTriggers({ top: rect.top, height: rect.height }, scrollPos2(), vpSize2(), startConfig, endConfig);
|
|
1313
|
+
};
|
|
1314
|
+
_register(el, {
|
|
1315
|
+
type: "animate",
|
|
1316
|
+
getProgress: () => instance.getProgress(),
|
|
1317
|
+
getTrigger: liveTriggers
|
|
1318
|
+
});
|
|
1319
|
+
const instance = {
|
|
1297
1320
|
destroy() {
|
|
1298
1321
|
el.classList.remove(cls);
|
|
1299
1322
|
style.remove();
|
|
1300
1323
|
el.style.animationPlayState = "";
|
|
1301
1324
|
restoreInline();
|
|
1325
|
+
_unregister(el);
|
|
1302
1326
|
},
|
|
1303
1327
|
replay() {
|
|
1304
1328
|
el.classList.remove(cls);
|
|
@@ -1319,19 +1343,11 @@ var SvgScrollDraw = (() => {
|
|
|
1319
1343
|
}
|
|
1320
1344
|
},
|
|
1321
1345
|
getProgress() {
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
const vp = vpSize2();
|
|
1325
|
-
const { tStart: tStart2, tEnd: tEnd2 } = computeTriggers(
|
|
1326
|
-
{ top: rect.top, height: rect.height },
|
|
1327
|
-
scroll,
|
|
1328
|
-
vp,
|
|
1329
|
-
startConfig,
|
|
1330
|
-
endConfig
|
|
1331
|
-
);
|
|
1332
|
-
return easeFn(computeProgress(scroll, tStart2, tEnd2, speed));
|
|
1346
|
+
const { tStart: tStart2, tEnd: tEnd2 } = liveTriggers();
|
|
1347
|
+
return easeFn(computeProgress(scrollPos2(), tStart2, tEnd2, speed));
|
|
1333
1348
|
}
|
|
1334
1349
|
};
|
|
1350
|
+
return instance;
|
|
1335
1351
|
}
|
|
1336
1352
|
if (nativeEligible()) return buildNative();
|
|
1337
1353
|
let tStart = 0;
|
|
@@ -1818,10 +1834,19 @@ var SvgScrollDraw = (() => {
|
|
|
1818
1834
|
observer.observe(stage);
|
|
1819
1835
|
progress = computeProgress2();
|
|
1820
1836
|
apply(progress);
|
|
1837
|
+
_register(mount, {
|
|
1838
|
+
type: "draw",
|
|
1839
|
+
getProgress: () => progress,
|
|
1840
|
+
getTrigger: () => {
|
|
1841
|
+
const tStart = mount.getBoundingClientRect().top + window.scrollY;
|
|
1842
|
+
return { tStart, tEnd: tStart + Math.max(0, mount.offsetHeight - window.innerHeight) };
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1821
1845
|
return {
|
|
1822
1846
|
destroy() {
|
|
1823
1847
|
stop();
|
|
1824
1848
|
observer.disconnect();
|
|
1849
|
+
_unregister(mount);
|
|
1825
1850
|
},
|
|
1826
1851
|
getProgress: () => progress
|
|
1827
1852
|
};
|